Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ketho committed Feb 25, 2020
1 parent 16d37d2 commit ec39c66
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release AddOn

on:
push:
tags:
- '**'

env:
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }}

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- uses: BigWigsMods/packager@master
with:
args: release.sh
50 changes: 50 additions & 0 deletions HideAppearance.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
local GetCategoryAppearances = C_TransmogCollection.GetCategoryAppearances

-- probably not the right way to do this and taints everything
function C_TransmogCollection.GetCategoryAppearances(...)
local visualsList = GetCategoryAppearances(...)
if HideAppearanceDB then
-- iterate from end to beginning for tremove
for i = #visualsList, 1, -1 do
if HideAppearanceDB[visualsList[i].visualID] then
tremove(visualsList, i)
end
end
end
return visualsList
end

local f = CreateFrame("Frame")

function f:OnEvent(event, addon)
if addon == "HideAppearance" then
HideAppearanceDB = HideAppearanceDB or {}
for _, model in pairs(WardrobeCollectionFrame.ItemsCollectionFrame.Models) do
model:HookScript("OnMouseDown", self.AddHideButton)
end
end
end
f:RegisterEvent("ADDON_LOADED")
f:SetScript("OnEvent", f.OnEvent)

function f.AddHideButton(model, button)
if button == "RightButton" then
UIDropDownMenu_AddButton({notCheckable = true, disabled = true})
UIDropDownMenu_AddButton({notCheckable = true, text = HIDE, func = function()
f:HideTransmog(model)
end})
end
end

function f:HideTransmog(model)
local visualID = model.visualInfo.visualID
local source = WardrobeCollectionFrame_GetSortedAppearanceSources(visualID)[1]
local name, link = GetItemInfo(source.itemID)
-- add to filter list
HideAppearanceDB[visualID] = name
-- update wardrobe window
WardrobeCollectionFrame.ItemsCollectionFrame:RefreshVisualsList()
WardrobeCollectionFrame.ItemsCollectionFrame:UpdateItems()
-- print message
print("Hiding "..link.." from the Appearances Tab")
end
10 changes: 10 additions & 0 deletions HideAppearance.toc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Interface: 80300
## Version: 1.0
## Title: HideAppearance
## Notes: Adds a dropdown button for hiding Wardrobe Appearances
## Author: Ketho
## SavedVariables: HideAppearanceDB
## LoadOnDemand: 1
## LoadWith: Blizzard_Collections

HideAppearance.lua
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Ketho's WoW addons
Copyright (c) 2020 Ketho

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down

0 comments on commit ec39c66

Please sign in to comment.