Skip to content

Commit

Permalink
2.8
Browse files Browse the repository at this point in the history
- updated toc version
- db: added missing effects of 9.0
- db: added toys of 9.1
- usage of CallbackRegistry for internal events instead of own tables
  • Loading branch information
exochron authored Jun 28, 2021
1 parent dc71504 commit ac16356
Show file tree
Hide file tree
Showing 18 changed files with 183 additions and 107 deletions.
68 changes: 58 additions & 10 deletions Database.lua
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,14 @@ ADDON.db.profession = {
[129961] = true, -- Flaming Hoop
[129958] = true, -- Leather Pet Leash
[130102] = true, -- Mother's Skinning Knife
[186686] = true, -- Pallid Oracle Bones
[186985] = true, -- Elisive Pet Treat
[186702] = true, -- Pallid Bone Flute
},

["Enchanting"] = {
[128536] = true, -- Leylight Brazier
[186973] = true, -- Anima-ted Leash
},

["Inscription"] = {
Expand Down Expand Up @@ -400,6 +404,15 @@ ADDON.db.source = {
[184447] = true, -- Kevin's Party Supplies
[184489] = true, -- Fae Harp
[184490] = true, -- Fae Pipes
[187051] = true, -- Forgotten Feather
[187113] = true, -- Personal Ball and Chain
[187140] = true, -- Ring of Duplicity
[187154] = true, -- Ancient Korthian Runes
[187155] = true, -- Guise of the Changeling
[187159] = true, -- Shadow Slicing Shortsword
[187339] = true, -- Silver Shardhide Whistle
[187344] = true, -- Offering Kit Maker
[187416] = true, -- Jailer's Cage
},

["Drop"] = {
Expand Down Expand Up @@ -544,14 +557,22 @@ ADDON.db.source = {
[174445] = true, -- Glimmerfly Cocoon
[180873] = true, -- Smolderheart
[181794] = true, -- Orophea's Lyre
[183901] = true, -- Bonestorm Top
[184292] = true, -- Ancient Elethium Coin
[184312] = true, -- Borr-Geth's Fiery Brimstone
[184396] = true, -- Malfunctioning Goliath Gauntlet -- Ascended Supplies
[184404] = true, -- Ever-Abundant Hearth
[184413] = true, -- Mnemonic Attunement Pane
[184435] = true, -- Mark of Purity -- Ascended Supplies
[184476] = true, -- Regenerating Slime Vial
[184495] = true, -- Infested Arachnid Casing -- Supplies of the Undying Army
[184413] = true, -- Mnemonic Attunement Pane
[187075] = true, -- Box of Rattling Chains
[187139] = true, -- Bottled Shade Heart
[187174] = true, -- Shaded Judgement Stone
[187176] = true, -- Vesper of Harmony
[187185] = true, -- Vesper of Faith
[187417] = true, -- Adamant Vaults Cell
[187420] = true, -- Maw-Ocular Viewfinder
},

["Quest"] = {
Expand Down Expand Up @@ -633,6 +654,7 @@ ADDON.db.source = {
[183847] = true, -- Acolyte's Guise
[183856] = true, -- Mystical Orb of Meditation
[184487] = true, -- Gormling in a Bag
[187184] = true, -- Vesper of Clarity
},

["Vendor"] = {
Expand Down Expand Up @@ -728,12 +750,9 @@ ADDON.db.source = {
[170380] = true, -- Jar of Sunwarmed Sand

-- Shadowlands
[180290] = true, -- Night Fae Hearthstone
[183716] = true, -- Venthyr Sinstone
[182773] = true, -- Necrolord Hearthstone
[183876] = true, -- Quill of Correspondence
[183989] = true, -- Dredger Barrow Racer
[184353] = true, -- Kyrian Hearthstone
[186974] = true, -- Experimental Anima Cell
},

["Instance"] = {
Expand Down Expand Up @@ -819,6 +838,10 @@ ADDON.db.source = {
[183900] = true, -- Sinvyr Tea Set
[184218] = true, -- Vulgarity Arbiter
[184410] = true, -- Aspirant's Stretcher
[180290] = true, -- Night Fae Hearthstone
[183716] = true, -- Venthyr Sinstone
[182773] = true, -- Necrolord Hearthstone
[184353] = true, -- Kyrian Hearthstone
},

["Achievement"] = {
Expand Down Expand Up @@ -1136,6 +1159,9 @@ ADDON.db.effect = {
[174873] = true, -- Trans-mogu-rifier
[183847] = true, -- Acolyte's Guise
[183903] = true, -- Smelly Jelly
[184223] = true, -- Helm of the Dominated
[187139] = true, -- Bottled Shade Heart
[187155] = true, -- Guise of the Changeling
},

-- Add to or slightly change the existing character model, keeping the same model
Expand Down Expand Up @@ -1362,6 +1388,8 @@ ADDON.db.effect = {
[183988] = true, -- Bondable Val'kyr Diadem
[184413] = true, -- Mnemonic Attunement Pane
[184476] = true, -- Regenerating Slime Vial
[184487] = true, -- Gormling in a Bag
[183901] = true, -- Bonestorm Top
},
},

Expand Down Expand Up @@ -1421,7 +1449,9 @@ ADDON.db.effect = {
[139587] = true, -- Suspicious Crate
[127666] = true, -- Vial of Red Goo
[116651] = true, -- True Love Prism
[182890] = true, -- Rapid Recitation Quill
[184489] = true, -- Fae Harp
[186702] = true, -- Pallid Bone Flute
},

["Corpse"] = {
Expand All @@ -1432,6 +1462,7 @@ ADDON.db.effect = {
[163740] = true, -- Drust Ritual Knife
[166701] = true, -- Warbeast Kraal Dinner Bell
[166784] = true, -- Narassin's Soul Gem
[187174] = true, -- Shaded Judgement Stone
},

["Roll"] = {
Expand All @@ -1445,15 +1476,15 @@ ADDON.db.effect = {
[54212] = true, -- Instant Statue Pedestal
[69776] = true, -- Ancient Amber
[72161] = true, -- Spurious Sarcophagus
[86573] = true, -- Shard of Archstone
[88417] = true, -- Gokk'lok's Shell
[113570] = true, -- Ancient's Bloom
[115472] = true, -- Permanent Time Bubble
[116125] = true, -- Klikixx's Webspinner
[119432] = true, -- Botani Camouflage
[130171] = true, -- Cursed Orb
[141879] = true, -- Berglrgl Perrgl Girggrlf
[164983] = true, -- Rhan'ka's Escape Plan
[113570] = true, -- Ancient's Bloom
[119432] = true, -- Botani Camouflage
[86573] = true, -- Shard of Archstone
[88417] = true, -- Gokk'lok's Shell
},

},
Expand Down Expand Up @@ -1486,6 +1517,7 @@ ADDON.db.effect = {
[64358] = true, -- Highborne Soul Mirror
[108745] = true, -- Personal Hologram
[129952] = true, -- Hourglass of Eternity
[187140] = true, -- Ring of Duplicity
},

-- Controlled explosives
Expand Down Expand Up @@ -1526,13 +1558,19 @@ ADDON.db.effect = {
[130214] = true, -- Worn Doll
[130232] = true, -- Moonfeather Statue
[140363] = true, -- Pocket Fel Spreader
[140632] = true, -- Lava Fountain
[141297] = true, -- Arcano-Shower
[160751] = true, -- Dance of the Dead
[169347] = true, -- Judgment of Mechagon
[140632] = true, -- Lava Fountain
[183900] = true, -- Sinvyr Tea Set
[184075] = true, -- Stonewrought Sentry
[184318] = true, -- Battlecry of Krexus
[184415] = true, -- Soothing Vesper
[184418] = true, -- Acrobatic Steward
[187154] = true, -- Ancient Korthian Runes
[187176] = true, -- Vesper of Harmony
[187184] = true, -- Vesper of Clarity
[187185] = true, -- Vesper of Faith
},

["Weather"] = {
Expand Down Expand Up @@ -1588,11 +1626,13 @@ ADDON.db.effect = {
[120857] = true, -- Barrel of Bandanas
[151877] = true, -- Barrel of Eyepatches
[183810] = true, -- Shadowlands Mini: Grandmaster Vole
[184495] = true, -- Infested Arachnid Casing
},

["Mail"] = {
[40768] = true, -- MOLL-E
[156833] = true, -- Katy's Stampwhistle
[183876] = true, -- Quill of Correspondence
},

["NPC"] = {
Expand All @@ -1605,6 +1645,8 @@ ADDON.db.effect = {
[127655] = true, -- Sassy Imp
[166247] = true, -- Citizens Brigade Whistle
[168667] = true, -- Blingtron 7000
[184218] = true, -- Vulgarity Arbiter
[184435] = true, -- Mark of Purity
},

-- Can attack these
Expand Down Expand Up @@ -1822,6 +1864,7 @@ ADDON.db.effect = {
[140336] = true, -- Brulfist Idol
},

-- faster or slower ground movement
["Running"] = {
[104329] = true, -- Ash-Covered Horn
[113543] = true, -- Spirit of Shinri
Expand All @@ -1830,6 +1873,8 @@ ADDON.db.effect = {
[129965] = true, -- Grizzlesnout's Fang
[131900] = true, -- Majestic Elderhorn Hoof
[153193] = true, -- Baarut the Brisk
[183989] = true, -- Dredger Barrow Racer
[187339] = true, -- Silver Shardhide Whistle
},

["Swimming"] = {
Expand Down Expand Up @@ -1922,5 +1967,8 @@ ADDON.db.effect = {
[174995] = true, -- Void Tendril Pet Leash
[184449] = true, -- Jiggles's Favorite Toy
[184508] = true, -- Mawsworn Pet Leash
[186973] = true, -- Anima-ted Leash
[186985] = true, -- Elisive Pet Treat
[187051] = true, -- Forgotten Feather
},
}
10 changes: 5 additions & 5 deletions DebugTest.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local ADDON_NAME, ADDON = ...
local _, ADDON = ...

local function FirstTableValue(table)
for _, value in pairs(table) do
Expand Down Expand Up @@ -64,16 +64,16 @@ local function UnusableTest()
end
end

ADDON:RegisterLoginCallback(function()
ADDON.Events:RegisterCallback("OnLogin", function()
if ADDON.settings.debugMode then
UnusableTest()
end
end)
ADDON:RegisterLoadUICallback(function()
end, "debug")
ADDON.Events:RegisterCallback("PostLoadUI", function()
if ADDON.settings.debugMode then
DebugTest()
end
end)
end, "debug")

-- After starting the client fresh the first character doesn't have a fully loaded C_ToyBox on PLAYER_LOGIN
-- (since at least 8.3)
Expand Down
12 changes: 6 additions & 6 deletions Favorites.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ local function RunSetFavorites(itemIds)
end)
end

local function InitializeDropDown(menu, level)
local function InitializeDropDown(_, level)
if level == 1 then
local info = {
isNotRadio = true,
Expand Down Expand Up @@ -118,21 +118,21 @@ local function BuildStarButton()
GameTooltip:SetText(FAVORITES)
GameTooltip:Show()
end);
starButton:SetScript("OnLeave", function(sender)
starButton:SetScript("OnLeave", function()
GameTooltip:Hide()
end);
starButton:SetScript("OnClick", function()
ToggleDropDownMenu(1, nil, menu, starButton, 0, 10)
end)
starButton:RegisterEvent("PLAYER_REGEN_ENABLED")
starButton:RegisterEvent("PLAYER_REGEN_DISABLED")
starButton:SetScript("OnEvent", function(self, event, arg1)
starButton:SetScript("OnEvent", function(self, event)
self:SetShown(event == "PLAYER_REGEN_ENABLED")
end)
starButton:SetShown(not InCombatLockdown())
end

ADDON:RegisterLoadUICallback(BuildStarButton)
ADDON.Events:RegisterCallback("OnLoadUI", BuildStarButton, "favorites")

--endregion

Expand All @@ -149,12 +149,12 @@ local function HookSetIsFavorite(itemId, value)
end
end

ADDON:RegisterLoginCallback(function()
ADDON.Events:RegisterCallback("OnLogin", function()
if ADDON.settings.favoritePerChar then
FavorToys(ADDON.settings.favoredToys, function()
hooksecurefunc(C_ToyBox, "SetIsFavorite", HookSetIsFavorite)
end)
else
hooksecurefunc(C_ToyBox, "SetIsFavorite", HookSetIsFavorite)
end
end)
end, "favorites")
19 changes: 18 additions & 1 deletion Libs/UIFixes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,21 @@ if (tonumber(UI_DROPDOWN_ENABLE_ART_PATCH_VERSION) or 0) < 1 then
set(_G["DropDownList" .. level .. "Button" .. id .. "Check"], false)
set(_G["DropDownList" .. level .. "Button" .. id .. "UnCheck"], false)
end)
end
end

-- still needed ?
--if (tonumber(UI_PETJOURNAL_INIT_FIRST_CARD_PATCH_VERSION) or 0) < 1 then
-- UI_PETJOURNAL_INIT_FIRST_CARD_PATCH_VERSION = 1
-- local frame = CreateFrame("Frame")
-- frame:RegisterEvent("ADDON_LOADED")
-- frame:SetScript("OnEvent", function(self, event, arg1)
-- if PetJournal then
-- frame:UnregisterEvent("ADDON_LOADED")
-- PetJournal:HookScript("OnShow", function()
-- if not PetJournalPetCard.petID then
-- --PetJournal_ShowPetCard(1)
-- end
-- end)
-- end
-- end)
--end
6 changes: 3 additions & 3 deletions Settings.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local ADDON_NAME, ADDON = ...
local _, ADDON = ...

ToyBoxEnhancedSettings = ToyBoxEnhancedSettings or {}
local defaultFilterStates, defaultSortStates
Expand Down Expand Up @@ -102,10 +102,10 @@ local function CombineSettings(settings, defaultSettings)
end

-- Settings have to be loaded during PLAYER_LOGIN
ADDON:RegisterLoginCallback(function()
ADDON.Events:RegisterCallback("OnInit", function()
local defaultSettings = PrepareDefaults()
defaultFilterStates = CopyTable(defaultSettings.filter)
defaultSortStates = CopyTable(defaultSettings.sort)
CombineSettings(ToyBoxEnhancedSettings, defaultSettings)
ADDON.settings = ToyBoxEnhancedSettings
end)
end, "settings")
6 changes: 3 additions & 3 deletions SettingsPanel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ local function OKHandler(frame)
end
end

ADDON:RegisterLoginCallback(function()
ADDON.Events:RegisterCallback("OnLogin", function()
local frame = BuildFrame()
frame.name = GetAddOnMetadata(ADDON_NAME, "Title")
frame.refresh = function(frame)
frame.refresh = function()
frame.enableCursorKeysCheck:SetChecked(ADDON.settings.enableCursorKeys)
frame.favoritesPerCharCheck:SetChecked(ADDON.settings.favoritePerChar)
frame.searchInSpellCheck:SetChecked(ADDON.settings.searchInDescription)
end
frame.okay = OKHandler
frame.default = ADDON.ResetUISettings
InterfaceOptions_AddCategory(frame)
end)
end, "settings-panel")
Loading

0 comments on commit ac16356

Please sign in to comment.