Skip to content

Commit 7e17c7c

Browse files
committed
Merge branch 'release/3.18.1'
2 parents 012a565 + 536cf04 commit 7e17c7c

File tree

13 files changed

+86
-29
lines changed

13 files changed

+86
-29
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ sv_to_process.lua
22
luacov.report.out
33
.env
44
.VSCodeCounter
5-
.debug
5+
.debug
6+
GEMINI.md
7+
copilot-instructions.md

.scripts/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ echo "Executing $0" >&2
1111

1212
# Process command-line options
1313
usage() {
14-
echo "Usage: test.sh [-bcp]" >&2
14+
echo "Usage: test.sh [-bcpx]" >&2
1515
echo " -b Pack to _beta_ WoW edition." >&2
1616
echo " -c Pack to _classic_ WoW edition." >&2
1717
echo " -p Pack to _ptr_ WoW edition." >&2

.vscode/tasks.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
{
3838
"label": "Busted All",
3939
"type": "shell",
40-
"command": "busted",
40+
"command": "busted.bat",
4141
"group": {
4242
"kind": "test",
4343
"isDefault": true
@@ -46,7 +46,7 @@
4646
{
4747
"label": "Busted All w/coverage",
4848
"type": "shell",
49-
"command": "busted",
49+
"command": "busted.bat",
5050
"group": {
5151
"kind": "test",
5252
"isDefault": true
@@ -58,18 +58,21 @@
5858
{
5959
"label": "Busted this file",
6060
"type": "shell",
61-
"command": "busted",
61+
"command": "busted.bat",
6262
"args": [
6363
"--lpath=__tests/?.lua;__tests/wow_api/?.lua",
6464
"-v",
6565
"${file}",
6666
],
6767
"windows": {
68-
"args": [
69-
"--lpath=${workspaceFolder}\\__tests\\?.lua;__tests\\wow_api\\?.lua",
70-
"-v",
71-
"${file}",
72-
],
68+
"options": {
69+
"shell": {
70+
"executable": "cmd.exe",
71+
"args": [
72+
"/c"
73+
]
74+
}
75+
},
7376
},
7477
"group": "test"
7578
},

Core/Constants.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ addon.OPT_MORE_BUTTONS_VALUES = {
5757
CATALYST = L.Catalyst_Items, -- items that can be converted to tier through catalyst
5858
SPECIAL = L.Special_Effects_Items,
5959
RARE = L.Rare_Items,
60+
61+
DECOR = _G.HOUSING_ITEM_TOAST_TYPE_DECOR,
6062
}
6163

6264
--- Inventory types that can be converted to tier
@@ -198,6 +200,11 @@ addon.RESPONSE_CODE_GENERATORS = {
198200
function(_, db, _, itemEquipLoc)
199201
return db.enabledButtons.CATALYST and addon.CATALYST_ITEMS[itemEquipLoc] and "CATALYST" or nil
200202
end,
203+
204+
-- Housing Decor
205+
function(_, db, _, _, classID)
206+
return db.enabledButtons.DECOR and classID == Enum.ItemClass.Housing and "DECOR" or nil
207+
end
201208
}
202209

203210
--- @alias VersionCodes

Core/Defaults.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ addon.defaults = {
7474
showSpecIcon = false,
7575
closeWithEscape = true,
7676
timeoutFlash = true,
77+
blockTradesInVoting = false,
7778
chatFrameName = "DEFAULT_CHAT_FRAME", -- The chat frame to use for :Print()s
7879
-- General - History
7980
enableHistory = true,

Core/GlobalUpdates.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ end
1818

1919
addon.SendChatMessage = C_ChatInfo and C_ChatInfo.SendChatMessage or SendChatMessage
2020

21-
Enum.LootMethod = Enum.LootMethod or {
21+
local EnumLootMethod = Enum.LootMethod or {
2222
Freeforall = 0,
2323
Roundrobin = 1,
2424
Masterlooter = 2,
@@ -33,19 +33,19 @@ addon.GetLootMethod = C_PartyInfo and C_PartyInfo.GetLootMethod or
3333
function()
3434
local method, partyID, raidId = GetLootMethod()
3535
if not method then
36-
method = Enum.LootMethod.Personal
36+
method = EnumLootMethod.Personal
3737
elseif method == "freeforall" then
38-
method = Enum.LootMethod.Freeforall
38+
method = EnumLootMethod.Freeforall
3939
elseif method == "roundrobin" then
40-
method = Enum.LootMethod.Roundrobin
40+
method = EnumLootMethod.Roundrobin
4141
elseif method == "master" then
42-
method = Enum.LootMethod.Masterlooter
42+
method = EnumLootMethod.Masterlooter
4343
elseif method == "group" then
44-
method = Enum.LootMethod.Group
44+
method = EnumLootMethod.Group
4545
elseif method == "needbeforegreed" then
46-
method = Enum.LootMethod.Needbeforegreed
46+
method = EnumLootMethod.Needbeforegreed
4747
elseif method == "personalloot" then
48-
method = Enum.LootMethod.Personal
48+
method = EnumLootMethod.Personal
4949
end
5050
return method, partyID, raidId
5151
end

Locale/enUS.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,9 @@ L["opt_skipSessionFrame_name"] = "Skip Session Frame"
589589
L["opt_skipSessionFrame_desc"] = "Skips the Session Frame. NOTE: This causes the addon to start a session with all eligble items without you having a chance to edit the list!"
590590
L.opt_timeoutFlash_name = "Timeout Flash"
591591
L.opt_timeoutFlash_desc = "When enabled, the loot frame will flash when there's 5 seconds left to the item timeouts."
592+
L.opt_blockTradesInVoting_name = "Block Trades"
593+
L.opt_blockTradesInVoting_desc = "When enabled, any trade attempts will be cancelled while the voting frame is active."
594+
L.opt_blockTradesInVoting_message = "Trade from %s blocked"
592595
L["non_tradeable_reason_not_tradeable"] = "Not Tradeable"
593596
L["non_tradeable_reason_rejected_trade"] = "Wanted to keep item"
594597
L["non_tradeable_reason_nil"] = "Unknown"

Modules/TradeUI.lua

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -253,21 +253,27 @@ end
253253
--------------------------------------------------------------
254254

255255
function TradeUI:OnEvent_TRADE_SHOW (event, ...)
256-
self.isTrading = true
257256
wipe(self.tradeItems)
258-
257+
259258
-- Try to grab the trader from Blizzard UI
260259
local target = _G.TradeFrameRecipientNameText:GetText()
261260
if not target or target == "" then
262-
target = "NPC" -- Otherwise fallback to `UnitName("NPC")`
263-
end
261+
target = "NPC" -- Otherwise fallback to `UnitName("NPC")`
262+
end
264263

265-
-- If target is from another realm, the name in the trade frame will be "Name(*)"
266-
if target:find("(*)") then
264+
-- If target is from another realm, the name in the trade frame will be "Name(*)"
265+
if target:find("(*)") then
267266
-- Remove the "(*)" so `UnitName` can attach realm.
268267
target = string.sub(target, 1, -4)
269-
end
270-
self.tradeTarget = addon:UnitName(target)
268+
end
269+
if db.blockTradesInVoting and addon:GetActiveModule("votingframe"):IsActive() then
270+
CloseTrade()
271+
addon:Print(string.format(L["opt_blockTradesInVoting_message"], addon:GetClassIconAndColoredName(target)))
272+
return
273+
end
274+
275+
self.tradeTarget = addon:UnitName(target)
276+
self.isTrading = true
271277

272278
local count = self:GetNumAwardedInBagsToTradeWindow()
273279

Modules/options.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,12 @@ function addon:OptionsTable()
478478
desc = L.opt_timeoutFlash_desc,
479479
type = "toggle"
480480
},
481+
blockTradesInVoting = {
482+
order = 7.5,
483+
name = L.opt_blockTradesInVoting_name,
484+
desc = L.opt_blockTradesInVoting_desc,
485+
type = "toggle",
486+
},
481487
chatFrameName = {
482488
order = 8,
483489
name = L["opt_chatFrameName_name"],

Modules/votingFrame.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@ function RCVotingFrame:Show()
251251
end
252252
end
253253

254+
function RCVotingFrame:IsActive()
255+
return active
256+
end
257+
254258
function RCVotingFrame:HasUnawardedItems ()
255259
for _,v in pairs(lootTable) do
256260
if not v.awarded then return true end

0 commit comments

Comments
 (0)