-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit aef93c1
Showing
6 changed files
with
112 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# These are supported funding model platforms | ||
|
||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] | ||
patreon: # Replace with a single Patreon username | ||
open_collective: # Replace with a single Open Collective username | ||
ko_fi: # Replace with a single Ko-fi username | ||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel | ||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | ||
liberapay: # Replace with a single Liberapay username | ||
issuehunt: # Replace with a single IssueHunt username | ||
otechie: # Replace with a single Otechie username | ||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry | ||
custom: ['https://www.buymeacoffee.com/djschaffner'] |
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,17 @@ | ||
{ | ||
"Lua.diagnostics.globals": [ | ||
"CreateFrame", | ||
"print", | ||
"UIDropDownMenu_SetWidth", | ||
"UIDropDownMenu_SetText", | ||
"UIDropDownMenu_Initialize", | ||
"SlashCmdList", | ||
"ToggleDropDownMenu", | ||
"UIDropDownMenu_AddButton", | ||
"UIDropDownMenu_CreateInfo", | ||
"UnitBuff", | ||
"DEFAULT_CHAT_FRAME", | ||
"StaticPopupDialogs", | ||
"StaticPopup_Show" | ||
] | ||
} |
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,7 @@ | ||
## Interface: 11501 | ||
## Title: BetterBags - ItemRack | ||
## Notes: Add a category to BetterBags for ItemRack sets | ||
## Author: DJSchaffner | ||
## Version: @1.0 | ||
|
||
main.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,4 @@ | ||
@echo off | ||
echo Copying files... | ||
cp -r ../BetterBags_ItemRack "C:\Program Files (x86)\World of Warcraft\_classic_era_\Interface\AddOns" | ||
echo Deployed |
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,65 @@ | ||
---@class BetterBags: AceAddon | ||
local addonBetterBags = LibStub('AceAddon-3.0'):GetAddon("BetterBags") | ||
---@class Categories: AceModule | ||
local categories = addonBetterBags:GetModule('Categories') | ||
---@class Localization: AceModule | ||
local L = addonBetterBags:GetModule('Localization') | ||
|
||
local debug = false | ||
local frame = CreateFrame("Frame", nil) | ||
local categoryName = "Sets" | ||
------------------------------------------------------- | ||
local function printChat(message) | ||
if debug == true then | ||
print("[BetterBags ItemRack] "..message) | ||
end | ||
end | ||
|
||
local function split(s, sep) | ||
local fields = {} | ||
|
||
local sep = sep or " " | ||
local pattern = string.format("([^%s]+)", sep) | ||
string.gsub(s, pattern, function(c) fields[#fields + 1] = c end) | ||
|
||
return fields | ||
end | ||
|
||
local function updateCategory() | ||
-- Wipe category since we can't retrieve deleted set from itemRack (Except maybe store duplicate of sets and check last version of it) | ||
categories:WipeCategory(L:G(categoryName)) | ||
|
||
-- Loop all sets | ||
for setName, _ in pairs(ItemRackUser.Sets) do | ||
-- Only update user sets (internals start with '~') | ||
if not string.match(setName, "^~") then | ||
printChat("Updating set: " .. setName) | ||
-- Loop all items of set | ||
for _, item in pairs(ItemRackUser.Sets[setName].equip) do | ||
local id = tonumber(split(item, ":")[1]) | ||
--printChat(id) | ||
--printChat(GetItemInfo(ItemRack.IRStringToItemString(item))) | ||
categories:AddItemToCategory(id, L:G(categoryName)) | ||
printChat("Added item '" .. id .. "' to '" .. categoryName .. "' category") | ||
end | ||
else | ||
printChat("Skipping internal set: " .. setName) | ||
end | ||
end | ||
end | ||
|
||
local function itemRackUpdated(event, _) | ||
printChat(event) | ||
updateCategory() | ||
end | ||
------------------------------------------------------- | ||
frame:RegisterEvent("ADDON_LOADED") | ||
frame:SetScript("OnEvent", function(self, event, addon, ...) | ||
if event == "ADDON_LOADED" and addon == "ItemRack" then | ||
ItemRack:RegisterExternalEventListener("ITEMRACK_SET_SAVED", itemRackUpdated) | ||
ItemRack:RegisterExternalEventListener("ITEMRACK_SET_DELETED", itemRackUpdated) | ||
|
||
printChat("ItemRack Loaded.. Initializing Category") | ||
updateCategory() | ||
end | ||
end) |
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,6 @@ | ||
## BetterBags - ItemRack | ||
This is a filter for the World of Warcraft addon [BetterBags](https://github.com/Cidan/BetterBags) and requires both [BetterBags](https://github.com/Cidan/BetterBags) and [ItemRack](https://github.com/Rottenbeer/ItemRack) | ||
|
||
Plugin was written for Classic SoD so it might not work for other versions of the game. | ||
|
||
It will collect all items assigned to an ItemRack set and place them in a single category. Might add the option to split them up into seperate categories for each set later but no promises. |