|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
if collectibleName ~= "" then local formatterStringId if collectibleCategory == COLLECTIBLE_CATEGORY_TYPE_CHAPTER then formatterStringId = SI_COLLECTIBLE_REQUIRED_TO_USE_SCRIBING_UPGRADE else formatterStringId = SI_COLLECTIBLE_REQUIRED_TO_USE_SCRIBING_CROWN_STORE end return zo_strformat(formatterStringId, collectibleName, GetCollectibleCategoryNameByCollectibleId(collectibleData:GetId())) end return ""end local craftedAbilityId, primaryScriptId, secondaryScriptId, tertiaryScriptId = GetCraftedAbilityIdsFromLink(link) self:LayoutCraftedAbilityByIds(craftedAbilityId, primaryScriptId, secondaryScriptId, tertiaryScriptId)endfunction ZO_Tooltip:LayoutCraftedAbilityByIds(craftedAbilityId, primaryScriptId, secondaryScriptId, tertiaryScriptId, options) if craftedAbilityData then self:LayoutCraftedAbility(craftedAbilityData, primaryScriptData, secondaryScriptData, tertiaryScriptData, options) endendfunction ZO_Tooltip:LayoutCraftedAbility(craftedAbilityData, primaryScriptData, secondaryScriptData, tertiaryScriptData, options) craftedAbilityData:SetScriptDataSelectionOverride(primaryScriptData, secondaryScriptData, tertiaryScriptData) if representativeAbilityId == 0 then return end local displayFlags = options and options.displayFlags or SCRIBING_TOOLTIP_DISPLAY_FLAGS_NONE -- Things added to the top section stack updward if skillLineData and skillTypeData then -- Header section will be added later end -- Mutually exclusive with isAlreadyScribed end local selectedScripts = { [SCRIBING_SLOT_PRIMARY] = primaryScriptData, [SCRIBING_SLOT_SECONDARY] = secondaryScriptData, [SCRIBING_SLOT_TERTIARY] = tertiaryScriptData, } local selectedScriptIds = {} for slot = SCRIBING_SLOT_ITERATION_BEGIN, SCRIBING_SLOT_ITERATION_END do local scriptData = selectedScripts[slot] end local isScribableCombination = craftedAbilityData:IsScribableScriptDataCombination(primaryScriptData, secondaryScriptData, tertiaryScriptData) if isScribableCombination then if isAlreadyScribed then -- Mutually exclusive with isLocked else end end -- Finish adding the header section before moving on to the actual ability local SIMPLE_ABILITY_OPTIONS = { omitHeader = true } -- Add errors after the actual ability local errorsSection = nil local lockedScriptSlotNames = {} for slot = SCRIBING_SLOT_ITERATION_BEGIN, SCRIBING_SLOT_ITERATION_END do -- Shouldn't be possible for scriptData to be nil here local scriptData = selectedScripts[slot] table.insert(lockedScriptSlotNames, GetString("SI_SCRIBINGSLOT_SHORT", scriptData:GetScribingSlot())) end end if #lockedScriptSlotNames > 0 then local lockedScriptErrorText = zo_strformat(SI_CRAFTED_ABILITY_TOOLTIP_FAILED_REQUIREMENT_UNOWNED_SCRIPTS, lockScriptNamesText) end if isAlreadyScribed then errorsSection:AddLine(GetString(SI_CRAFTED_ABILITY_TOOLTIP_FAILED_REQUIREMENT_ALREADY_SCRIBED), descriptionStyle, self:GetStyle("failed")) end if errorsSection then end end return else -- Finish adding the header section before moving on to the body end if isLocked and ZO_FlagHelpers.MaskHasFlag(displayFlags, SCRIBING_TOOLTIP_DISPLAY_FLAGS_SHOW_ACQUIRE_HINT) then if acquireHint ~= "" then end end if ZO_FlagHelpers.MaskHasFlag(displayFlags, SCRIBING_TOOLTIP_DISPLAY_FLAGS_SHOW_SELECTED_SCRIPTS) then for slot = SCRIBING_SLOT_ITERATION_BEGIN, SCRIBING_SLOT_ITERATION_END do local scriptData = selectedScripts[slot] local compatible = scriptData and scriptData:IsCompatibleWithSelections(craftedAbilityId, primaryScriptId, secondaryScriptId, tertiaryScriptId) local displayFlags = compatible and displayFlags or ZO_FlagHelpers.SetMaskFlag(displayFlags, SCRIBING_TOOLTIP_DISPLAY_FLAGS_SCRIPT_COMPATIBILITY_ERROR) local scriptOptions = { displayFlags = displayFlags } self:AppendCraftedAbilityScriptDescription(craftedAbilityData, scriptData, scriptOptions, descriptionStyle) end endenddo local NO_SCRIPT_DENOTATION = "-" function ZO_Tooltip:AppendCraftedAbilityScriptDescription(craftedAbilityData, scriptData, options, ...) if scriptData then local displayFlags = options and options.displayFlags local errorStyle = nil if displayFlags then displayFlags = ZO_FlagHelpers.SetMaskFlag(displayFlags, SCRIBING_TOOLTIP_DISPLAY_FLAGS_SCRIPT_LOCKED_ERROR) end end if ZO_FlagHelpers.MaskHasFlag(displayFlags, SCRIBING_TOOLTIP_DISPLAY_FLAGS_SCRIPT_COMPATIBILITY_ERROR) then elseif ZO_FlagHelpers.MaskHasFlag(displayFlags, SCRIBING_TOOLTIP_DISPLAY_FLAGS_SCRIPT_LOCKED_ERROR) then end end else end endendfunction ZO_Tooltip:LayoutCraftedAbilityScriptByIds(craftedAbilityId, scriptId, primaryScriptId, secondaryScriptId, tertiaryScriptId, options) if craftedAbilityData then self:LayoutCraftedAbilityScript(craftedAbilityData, scriptData, primaryScriptData, secondaryScriptData, tertiaryScriptData, options) endendfunction ZO_Tooltip:LayoutCraftedAbilityScript(craftedAbilityData, scriptData, primaryScriptData, secondaryScriptData, tertiaryScriptData, options) if slot == SCRIBING_SLOT_PRIMARY then primaryScriptData = scriptData elseif slot == SCRIBING_SLOT_SECONDARY then secondaryScriptData = scriptData else tertiaryScriptData = scriptData end craftedAbilityData:SetScriptDataSelectionOverride(primaryScriptData, secondaryScriptData, tertiaryScriptData) local displayFlags = options and options.displayFlags or SCRIBING_TOOLTIP_DISPLAY_FLAGS_NONE end local NO_OPTIONS = nil self:AppendCraftedAbilityScriptDescription(craftedAbilityData, scriptData, NO_OPTIONS, descriptionStyle) if acquireHint ~= "" then end end displayFlags = ZO_FlagHelpers.SetMaskFlag(displayFlags, SCRIBING_TOOLTIP_DISPLAY_FLAGS_SCRIPT_LOCKED_ERROR) end end end endend |