|
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 |
------------------------------- Tribute Pile Viewer Manager-----------------------------internalassert(TRIBUTE_BOARD_LOCATION_ITERATION_END == 20, "New TRIBUTE_BOARD_LOCATION added, check if it should be added to the PILE_FAMILIES table")local PILE_FAMILIES ={ { TRIBUTE_BOARD_LOCATION_PLAYER_DECK, TRIBUTE_BOARD_LOCATION_PLAYER_HAND, TRIBUTE_BOARD_LOCATION_PLAYER_COOLDOWN }, { TRIBUTE_BOARD_LOCATION_OPPONENT_DECK, TRIBUTE_BOARD_LOCATION_OPPONENT_COOLDOWN }, { TRIBUTE_BOARD_LOCATION_DOCKS_DECK, TRIBUTE_BOARD_LOCATION_DOCKS_DISCARD }, { TRIBUTE_BOARD_LOCATION_PLAYER_BOARD_AGENT, TRIBUTE_BOARD_LOCATION_PLAYER_BOARD_ACTION }, { TRIBUTE_BOARD_LOCATION_OPPONENT_BOARD_AGENT, TRIBUTE_BOARD_LOCATION_OPPONENT_BOARD_ACTION },}local COMPOSITE_PILE_GROUPINGS ={ { BOARD_LOCATIONS = { TRIBUTE_BOARD_LOCATION_PLAYER_DECK, TRIBUTE_BOARD_LOCATION_PLAYER_HAND }, }, { BOARD_LOCATIONS = { TRIBUTE_BOARD_LOCATION_OPPONENT_DECK, TRIBUTE_BOARD_LOCATION_OPPONENT_HAND }, OVERRIDE_VIEWER = true, },} return family end end end return nil end -- First build any composite piles, which may get used in place of regular pile viewer piles -- Make special composite piles that are used for some special cases where we want to describe piles as grouped together -- This is sort of a hack solution to make the opponent DECK/HAND appear as one pile when viewed, to combat card counting -- This also fascilitates combining the player and opponent's DECK and HAND being counted together for the Patron card count tooltips local compositePilesData = {} local boardLocations = compositePileGrouping.BOARD_LOCATIONS compositePileData.overrideViewer = compositePileGrouping.OVERRIDE_VIEWER compositePilesData[boardLocation] = compositePileData end end -- Next build all the piles for the viewer out of the families local pilesData = {} internalassert(pilesData[boardLocation] == nil, "The pile at board location %d already exists.", boardLocation) end end end, "tributePileViewer")end local viewingPileChanged = false if compositePileData then if compositePileData.overrideViewer and self.viewingPileLocation and ZO_IsElementInNumericallyIndexedTable(compositePileData:GetBoardLocations(), self.viewingPileLocation) then viewingPileChanged = true end end if pileData then viewingPileChanged = true end end if viewingPileChanged then end end) --Mark all pile data dirty when the board is cleared local viewingPileChanged = false if compositePileData.overrideViewer and self.viewingPileLocation and ZO_IsElementInNumericallyIndexedTable(compositePileData:GetBoardLocations(), self.viewingPileLocation) then viewingPileChanged = true end end viewingPileChanged = true end end if viewingPileChanged then end end) if pileData then end end) EVENT_MANAGER:RegisterForEvent(systemName, EVENT_TRIBUTE_CARD_STATE_FLAGS_CHANGED, function(_, cardInstanceId, stateFlags) end end) EVENT_MANAGER:RegisterForEvent(systemName, EVENT_TRIBUTE_AGENT_DEFEAT_COST_CHANGED, function(_, cardInstanceId, delta, newDefeatCost, shouldPlayFx) end end) EVENT_MANAGER:RegisterForEvent(systemName, EVENT_TRIBUTE_AGENT_CONFINEMENTS_CHANGED, function(_, agentInstanceId) end end) EVENT_MANAGER:RegisterForEvent(systemName, EVENT_TRIBUTE_BEGIN_TARGET_SELECTION, function(_, needsTargetViewer) --Close the viewer if target selection begins end end) EVENT_MANAGER:RegisterForEvent(systemName, EVENT_TRIBUTE_BEGIN_MECHANIC_SELECTION, function(_, cardInstanceId) --Close the viewer if mechanic selection begins end end)endendend if compositePileData and compositePileData.overrideViewer then return compositePileData endend else return nil endend --Order matters. Set the pile location before firing the activation state change endend --Cache which pile we are currently looking at before closing the pile viewer and opening the confinement viewerend --Once the confinement viewer closes, if we had a cached pile we were previously looking at, try to re-open it --Do not try to re-open the pile viewer if the user pressed escape if not isInterceptingCloseAction then end endend-- Required Overrides return "TributePileViewer_Manager"end --If the viewer is already up, we need to close and reopen it to make sure it switches to the correct UI endend--The pile viewer does not have functionality for viewing the board while it's open return falseendend--The pile viewer always has a visible keybind strip return trueend local NO_PILE = nilend |