Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PAB: DRAFT menu implementation for AvA Items - added some ToDos to be checked - added SavedVarsPatcher code to set up initial values - added new init function to get player name and alliance * remove no longer needed strings * rename key to better show its purpose * update EN/DE texts (FR missing) * shift function into PABankingCommon re-use existing functions for AvA item transfer * PAB: added FR translations from Takit
- Loading branch information
Showing
15 changed files
with
965 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
387 changes: 375 additions & 12 deletions
387
PersonalAssistant/PersonalAssistantBanking/Menu/PABankingMenu.lua
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
PersonalAssistant/PersonalAssistantBanking/PABanking/PABankingAvA.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
-- Local instances of Global tables -- | ||
local PA = PersonalAssistant | ||
local PAB = PA.Banking | ||
local PAC = PA.Constants | ||
local PAHF = PA.HelperFunctions | ||
local PAEM = PA.EventManager | ||
|
||
-- --------------------------------------------------------------------------------------------------------------------- | ||
|
||
local function depositOrWithdrawAvAItems() | ||
|
||
PAHF.debugln("PA.Banking.depositOrWithdrawAvAItems") | ||
|
||
if PAB.SavedVars.AvA.avaItemsEnabled then | ||
-- check if bankTransfer is already blocked | ||
if PAB.isBankTransferBlocked then return end | ||
PAB.isBankTransferBlocked = true | ||
|
||
-- prepare and fill the table with all ava items that needs to be transferred | ||
local individualItems = {} | ||
local itemIdTable = PAB.SavedVars.AvA.ItemIds | ||
for itemId, moveConfig in pairs(itemIdTable) do | ||
local operator = moveConfig.operator | ||
if operator ~= PAC.OPERATOR.NONE then | ||
individualItems[itemId] = { | ||
operator = operator, | ||
targetBackpackStack = moveConfig.backpackAmount | ||
} | ||
end | ||
end | ||
|
||
-- then also check the crossAlliance ava items that need to be transferred | ||
local PACAllianceSiegeTable = PAC.BANKING_AVA.SIEGE[PA.alliance] | ||
for _, corssAlianceItemIdTable in pairs(PACAllianceSiegeTable) do | ||
for crossAllianceItemId, itemId in pairs(corssAlianceItemIdTable) do | ||
local moveConfig = PAB.SavedVars.AvA.CrossAllianceItemIds[crossAllianceItemId] | ||
local operator = moveConfig.operator | ||
if operator ~= PAC.OPERATOR.NONE then | ||
individualItems[itemId] = { | ||
operator = operator, | ||
targetBackpackStack = moveConfig.backpackAmount | ||
} | ||
end | ||
end | ||
end | ||
|
||
-- then get the matching data from the backpack and bank | ||
local itemIdComparator = PAHF.getItemIdComparator(individualItems) | ||
local backpackBagCache = SHARED_INVENTORY:GenerateFullSlotData(itemIdComparator, BAG_BACKPACK) | ||
local bankBagCache = SHARED_INVENTORY:GenerateFullSlotData(itemIdComparator, BAG_BANK, BAG_SUBSCRIBER_BANK) | ||
|
||
PAHF.debugln("#backpackBagCache = "..tostring(#backpackBagCache)) | ||
PAHF.debugln("#bankBagCache = "..tostring(#bankBagCache)) | ||
|
||
-- trigger the individual itemTransactions | ||
PAB.doIndividualItemTransactions(individualItems, backpackBagCache, bankBagCache) | ||
else | ||
-- else, continue with the next function in queue | ||
PAEM.executeNextFunctionInQueue(PAB.AddonName) | ||
end | ||
end | ||
|
||
-- --------------------------------------------------------------------------------------------------------------------- | ||
-- Export | ||
PA.Banking = PA.Banking or {} | ||
PA.Banking.depositOrWithdrawAvAItems = depositOrWithdrawAvAItems |
Oops, something went wrong.