From c687b8b008c25aa7291a7e83d4ce6a2473f95eb2 Mon Sep 17 00:00:00 2001 From: Brandon Talbot Date: Thu, 4 Aug 2016 20:02:09 +0200 Subject: [PATCH] Fixed bank bag not refreshing when moving items Fixed BoA/BoE with caged battle pet Added Sold junk text to LOCALE and made zhTW translation (thanks to gaspy10) Fixed issue where bank bags were not "locking" Fixed slash commands Added close buttons back with alpha focusing Added ReStack buttons for bags and bank --- src/lua/constants/contstants.lua | 2 ++ src/lua/controller/bag.lua | 2 +- src/lua/controller/bank.lua | 9 +++++-- src/lua/core.lua | 2 +- src/lua/element/item.lua | 13 ++++++---- src/xml/element/bankBar.xml | 43 +++++++++++++++++++++++++++++++- src/xml/element/container.xml | 17 +++++++++++++ src/xml/element/mainBar.xml | 27 ++++++++++++++++++-- src/xml/settings/settingsContainer.xml | 17 +++++++++++++ 9 files changed, 120 insertions(+), 12 deletions(-) diff --git a/src/lua/constants/contstants.lua b/src/lua/constants/contstants.lua index 66c41d4..2415476 100644 --- a/src/lua/constants/contstants.lua +++ b/src/lua/constants/contstants.lua @@ -69,6 +69,7 @@ localeText['enUS'] = function() DJBags_LOCALE_VERTICAL = 'Vertical' DJBags_LOCALE_MAX_ITEMS = 'Max items' DJBags_LOCALE_MAX_HEIGHT = 'Max height' + DJBags_LOCALE_SOLD_JUNK = 'Sold junk for: %s' end localeText['zhTW'] = function() DJBags_LOCALE_MAIN_SETTINGS = '主設定:' @@ -99,6 +100,7 @@ localeText['zhTW'] = function() DJBags_LOCALE_VERTICAL = '垂直' DJBags_LOCALE_MAX_ITEMS = '分類寬度最多物品數目' DJBags_LOCALE_MAX_HEIGHT = '最大高度' + DJBags_LOCALE_SOLD_JUNK = '賣出垃圾獲得: %s' end if localeText[GetLocale()] then diff --git a/src/lua/controller/bag.lua b/src/lua/controller/bag.lua index 006d020..29eab45 100644 --- a/src/lua/controller/bag.lua +++ b/src/lua/controller/bag.lua @@ -83,7 +83,7 @@ function controller:MERCHANT_SHOW() end ResetCursor() if price ~= 0 then - DEFAULT_CHAT_FRAME:AddMessage("Sold junk for: " .. GetCoinTextureString(price)) + DEFAULT_CHAT_FRAME:AddMessage(string.format(DJBags_LOCALE_SOLD_JUNK, GetCoinTextureString(price))) end end end diff --git a/src/lua/controller/bank.lua b/src/lua/controller/bank.lua index 10406a0..bc72f52 100644 --- a/src/lua/controller/bank.lua +++ b/src/lua/controller/bank.lua @@ -115,6 +115,7 @@ end function controller:BAG_UPDATE(bag) if bag > NUM_BAG_SLOTS then ADDON:UpdateBags({bag}) + DJBagsBankContainer:Arrange() end end @@ -155,9 +156,13 @@ function controller:BAG_UPDATE_COOLDOWN() end function controller:ITEM_LOCK_CHANGED(bag, slot) - if bag ~= BANK_CONTAINER and bag ~= REAGENTBANK_CONTAINER and bag <= NUM_BAG_SLOTS then return end + if (bag ~= BANK_CONTAINER and bag ~= REAGENTBANK_CONTAINER and bag <= NUM_BAG_SLOTS) or not slot then return end - ADDON.cache:GetItem(bag, slot):UpdateLock() + if bag == BANK_CONTAINER and slot > NUM_BANKGENERIC_SLOTS then + _G[DJBagsBankBar:GetName() .. 'Bag' .. slot-NUM_BANKGENERIC_SLOTS]:UpdateLock() + else + ADDON.cache:GetItem(bag, slot):UpdateLock() + end end function controller:PLAYERREAGENTBANKSLOTS_CHANGED() diff --git a/src/lua/core.lua b/src/lua/core.lua index d007dcf..f421a5e 100644 --- a/src/lua/core.lua +++ b/src/lua/core.lua @@ -53,7 +53,7 @@ end --endregion -SLASH_DJBAGS1, SLASH_DJBAGS2, SLASH_DJBAGS3 = '/djb', '/dj', 'djbags'; +SLASH_DJBAGS1, SLASH_DJBAGS2, SLASH_DJBAGS3, SLASH_DJBAGS4 = '/djb', '/dj', '/djbags', '/db'; function SlashCmdList.DJBAGS(msg, editbox) DJBagsSettingsContainer:Show() end diff --git a/src/lua/element/item.lua b/src/lua/element/item.lua index 1a015c7..55349ba 100644 --- a/src/lua/element/item.lua +++ b/src/lua/element/item.lua @@ -65,12 +65,15 @@ function item:GetContainerName() end local subClassSplitList = ADDON.settings:GetSettings(DJBags_TYPE_SUB_CLASS) - if subClassSplitList[DJBags_SETTING_BOE] and DJBagsTooltip:IsItemBOE(self.link) then - return DJBags_LOCALE_BOE - end - if subClassSplitList[DJBags_SETTING_BOA] and DJBagsTooltip:IsItemBOA(self.link) then - return DJBags_LOCALE_BOA + if self.classId ~= LE_ITEM_CLASS_BATTLEPET then + if subClassSplitList[DJBags_SETTING_BOE] and DJBagsTooltip:IsItemBOE(self.link) then + return DJBags_LOCALE_BOE + end + if subClassSplitList[DJBags_SETTING_BOA] and DJBagsTooltip:IsItemBOA(self.link) then + return DJBags_LOCALE_BOA + end end + if subClassSplitList[self.classId] then return self.class .. (self.subClass == BAG_FILTER_JUNK and '' or '_' .. self.subClass) end diff --git a/src/xml/element/bankBar.xml b/src/xml/element/bankBar.xml index 55e9e67..b0f63d3 100644 --- a/src/xml/element/bankBar.xml +++ b/src/xml/element/bankBar.xml @@ -80,10 +80,34 @@ + + diff --git a/src/xml/element/container.xml b/src/xml/element/container.xml index 33b72ec..a7704d6 100644 --- a/src/xml/element/container.xml +++ b/src/xml/element/container.xml @@ -26,6 +26,23 @@ + diff --git a/src/xml/element/mainBar.xml b/src/xml/element/mainBar.xml index 6418ff9..cf54895 100644 --- a/src/xml/element/mainBar.xml +++ b/src/xml/element/mainBar.xml @@ -1,6 +1,6 @@ - + @@ -17,10 +17,33 @@ + -- 1.7.9.5