Skip to content

Commit a02c897

Browse files
author
Mikolaj Graf
committed
2 parents f857fe1 + ebe007f commit a02c897

13 files changed

Lines changed: 803 additions & 174 deletions

.luacheckrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ read_globals = {
9292
-- WoW API: Tooltip
9393
"TooltipDataProcessor",
9494

95+
-- WoW API: Chat
96+
"ChatEdit_InsertLink",
97+
9598
-- WoW API: Static Popup
9699
"StaticPopup_Show",
97100
"StaticPopup_Hide",
@@ -103,6 +106,9 @@ read_globals = {
103106
-- WoW API: Inventory
104107
"GetInventorySlotInfo",
105108

109+
-- WoW API: Instance
110+
"GetInstanceInfo",
111+
106112
-- WoW API: Misc
107113
"strsplit",
108114
"strtrim",
@@ -152,4 +158,7 @@ globals = {
152158
"AutoSellPlus_LastEvent",
153159
"AutoSellPlus_LastSellCount",
154160
"AutoSellPlus_Events",
161+
"BINDING_HEADER_AUTOSELLPLUS",
162+
"BINDING_NAME_ASP_TOGGLE_POPUP",
163+
"AutoSellPlus_KeybindSell",
155164
}

AutoSellPlus/Bindings.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Bindings>
2+
<Binding name="ASP_TOGGLE_POPUP" header="AUTOSELLPLUS" runOnUp="false">
3+
AutoSellPlus_KeybindSell()
4+
</Binding>
5+
</Bindings>

AutoSellPlus/Config.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ ns.globalDefaults = {
4040
-- Expansion filter
4141
filterExpansion = 0,
4242
excludeCurrentExpansion = false,
43+
protectCurrentExpMaterials = false,
4344
-- Slot filter
4445
filterSlots = {},
4546
-- Protection
@@ -48,6 +49,8 @@ ns.globalDefaults = {
4849
protectTransmogSource = true,
4950
protectBoE = true,
5051
allowBoESell = false,
52+
onlySoulbound = false,
53+
protectQuestItems = true,
5154
-- Display
5255
showSummary = true,
5356
showItemized = false,
@@ -61,6 +64,8 @@ ns.globalDefaults = {
6164
-- Marking
6265
autoMarkGrayLoot = false,
6366
autoMarkBelowIlvl = 0,
67+
-- Selling
68+
prioritySellQueue = true,
6469
-- Safety
6570
showUndoToast = true,
6671
highValueThreshold = 50000,
@@ -103,6 +108,7 @@ ns.charDefaults = {
103108
charNeverSellList = {},
104109
charAlwaysSellList = {},
105110
charFirstRunComplete = false,
111+
instanceProfiles = {},
106112
}
107113

108114
-- Profile templates for common playstyles

AutoSellPlus/Core.lua

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@ local addonName, ns = ...
22

33
local freeSlotAlertCooldown = 0
44

5+
-- Keybind support
6+
BINDING_HEADER_AUTOSELLPLUS = "AutoSellPlus"
7+
BINDING_NAME_ASP_TOGGLE_POPUP = "Toggle Sell Popup"
8+
9+
ns.isMerchantOpen = false
10+
11+
function AutoSellPlus_KeybindSell()
12+
if ns.isMerchantOpen then
13+
ns:ShowPopup()
14+
end
15+
end
16+
517
-- ============================================================
618
-- Auto-Repair
719
-- ============================================================
@@ -469,6 +481,7 @@ eventFrame:RegisterEvent("MERCHANT_CLOSED")
469481
eventFrame:RegisterEvent("EQUIPMENT_SETS_CHANGED")
470482
eventFrame:RegisterEvent("UI_ERROR_MESSAGE")
471483
eventFrame:RegisterEvent("BAG_UPDATE_DELAYED")
484+
eventFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
472485

473486
eventFrame:SetScript("OnEvent", function(self, event, ...)
474487
if event == "PLAYER_LOGIN" then
@@ -512,6 +525,7 @@ eventFrame:SetScript("OnEvent", function(self, event, ...)
512525
if ns._FireEvent then ns._FireEvent("LOADED") end
513526

514527
elseif event == "MERCHANT_SHOW" then
528+
ns.isMerchantOpen = true
515529
if ns.db.enabled then
516530
-- Auto-repair first
517531
ns:SafeCall(DoAutoRepair)
@@ -526,13 +540,15 @@ eventFrame:SetScript("OnEvent", function(self, event, ...)
526540
end
527541

528542
elseif event == "MERCHANT_CLOSED" then
543+
ns.isMerchantOpen = false
529544
ns:HidePopup()
530545
ns:HideConfirmList()
531546
ns:StopSelling()
532547
ns:CancelAutoSell()
533548
StaticPopup_Hide("ASP_AUTOSELL_EPIC_CONFIRM")
534549
StaticPopup_Hide("ASP_AUTOSELL_HIGHVALUE_CONFIRM")
535550
StaticPopup_Hide("ASP_EVICT_CONFIRM")
551+
StaticPopup_Hide("ASP_SELL_ALL_CONFIRM")
536552

537553
elseif event == "EQUIPMENT_SETS_CHANGED" then
538554
ns:RebuildEquipmentSetCache()
@@ -545,5 +561,16 @@ eventFrame:SetScript("OnEvent", function(self, event, ...)
545561
elseif event == "BAG_UPDATE_DELAYED" then
546562
ns:SafeCall(CheckBagSpace)
547563
ns:SafeCall(function() ns:UpdateCharJunkValue() end)
564+
565+
elseif event == "PLAYER_ENTERING_WORLD" then
566+
local _, instanceType = GetInstanceInfo()
567+
local profileName = AutoSellPlusCharDB.instanceProfiles
568+
and AutoSellPlusCharDB.instanceProfiles[instanceType]
569+
if profileName and profileName ~= "" then
570+
if AutoSellPlusDB.profiles[profileName] then
571+
ns:LoadProfile(profileName)
572+
ns:Print(format("Auto-loaded instance profile: |cFF00FF00%s|r (instance type: %s)", profileName, instanceType))
573+
end
574+
end
548575
end
549576
end)

AutoSellPlus/HistoryUI.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ local function CreateHistoryRow(parent, index)
7272
row:SetScript("OnLeave", function()
7373
GameTooltip:Hide()
7474
end)
75+
row:SetScript("OnMouseUp", function(self, button)
76+
if button == "LeftButton" and IsShiftKeyDown() and self.entryLink then
77+
ChatEdit_InsertLink(self.entryLink)
78+
end
79+
end)
7580

7681
row:Hide()
7782
return row

0 commit comments

Comments
 (0)