diff --git a/Fonts/ARIALN.ttf b/Fonts/ARIALN.ttf index d7ea883..48dd635 100644 Binary files a/Fonts/ARIALN.ttf and b/Fonts/ARIALN.ttf differ diff --git a/Fonts/DAMAGE.ttf b/Fonts/DAMAGE.ttf new file mode 100644 index 0000000..fb09813 Binary files /dev/null and b/Fonts/DAMAGE.ttf differ diff --git a/Fonts/FRIENDS.ttf b/Fonts/FRIENDS.ttf index d7ea883..48dd635 100644 Binary files a/Fonts/FRIENDS.ttf and b/Fonts/FRIENDS.ttf differ diff --git a/Interface/AddOns/SVUI/Bindings.xml b/Interface/AddOns/SVUI/Bindings.xml index 9e47fe2..23cbf0d 100644 --- a/Interface/AddOns/SVUI/Bindings.xml +++ b/Interface/AddOns/SVUI/Bindings.xml @@ -8,5 +8,7 @@ <Binding name="SVUI_RIDE" description="Lets Ride" category="ADDONS" runOnUp="false"> SVUILetsRide() </Binding> + <Binding name="SVUI_QUESTITEM" description="Quest Item Button" category="ADDONS" runOnUp="false" /> + <Binding name="SVUI_DRAENORZONE" description="Draenor Zone Ability Button" category="ADDONS" runOnUp="false" /> <ModifiedClick action="VENDORMARKITEM" default="ALT-BUTTON2"/> </Bindings> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/SVUI.toc b/Interface/AddOns/SVUI/SVUI.toc index af49487..c748e5f 100644 --- a/Interface/AddOns/SVUI/SVUI.toc +++ b/Interface/AddOns/SVUI/SVUI.toc @@ -1,6 +1,6 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 5.3.9 +## Version: 5.4.08 ## Title: |cffFF9900SVUI|r ## Notes: Supervillain UI [|cff9911FFCore Framework|r]. ## SavedVariables: SVUI_Global, SVUI_Errors diff --git a/Interface/AddOns/SVUI/assets/artwork/Doodads/DOCK-SPARKS-1.blp b/Interface/AddOns/SVUI/assets/artwork/Doodads/DOCK-SPARKS-1.blp new file mode 100644 index 0000000..03281c6 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Doodads/DOCK-SPARKS-1.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Doodads/DOCK-SPARKS-2.blp b/Interface/AddOns/SVUI/assets/artwork/Doodads/DOCK-SPARKS-2.blp new file mode 100644 index 0000000..9a4b442 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Doodads/DOCK-SPARKS-2.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Doodads/DOCK-SPARKS-3.blp b/Interface/AddOns/SVUI/assets/artwork/Doodads/DOCK-SPARKS-3.blp new file mode 100644 index 0000000..6f07c90 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Doodads/DOCK-SPARKS-3.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Doodads/DRUNK-PARTYTIME.blp b/Interface/AddOns/SVUI/assets/artwork/Doodads/DRUNK-PARTYTIME.blp new file mode 100644 index 0000000..8d670cb Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Doodads/DRUNK-PARTYTIME.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/NUMBER-1.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/NUMBER-1.blp deleted file mode 100644 index c0ebd6f..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Icons/NUMBER-1.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/NUMBER-2.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/NUMBER-2.blp deleted file mode 100644 index 1111dff..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Icons/NUMBER-2.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/NUMBER-3.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/NUMBER-3.blp deleted file mode 100644 index 04b5d3e..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Icons/NUMBER-3.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/NUMBER-4.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/NUMBER-4.blp deleted file mode 100644 index 957ee6c..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Icons/NUMBER-4.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/NUMBER-5.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/NUMBER-5.blp deleted file mode 100644 index 4d5323c..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Icons/NUMBER-5.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM0.blp b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM0.blp new file mode 100644 index 0000000..2b91673 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM0.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM1.blp b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM1.blp new file mode 100644 index 0000000..1a1e852 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM1.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM2.blp b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM2.blp new file mode 100644 index 0000000..d20cb32 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM2.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM3.blp b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM3.blp new file mode 100644 index 0000000..be13782 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM3.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM4.blp b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM4.blp new file mode 100644 index 0000000..7eca69c Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM4.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM5.blp b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM5.blp new file mode 100644 index 0000000..eb3b98a Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM5.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM6.blp b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM6.blp new file mode 100644 index 0000000..10547de Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM6.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM7.blp b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM7.blp new file mode 100644 index 0000000..c54fe0c Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM7.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM8.blp b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM8.blp new file mode 100644 index 0000000..09a73cc Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM8.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM9.blp b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM9.blp new file mode 100644 index 0000000..d8416e1 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE1/NUM9.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE2/NUM1.blp b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE2/NUM1.blp new file mode 100644 index 0000000..c0ebd6f Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE2/NUM1.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE2/NUM2.blp b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE2/NUM2.blp new file mode 100644 index 0000000..1111dff Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE2/NUM2.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE2/NUM3.blp b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE2/NUM3.blp new file mode 100644 index 0000000..04b5d3e Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE2/NUM3.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE2/NUM4.blp b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE2/NUM4.blp new file mode 100644 index 0000000..957ee6c Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE2/NUM4.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE2/NUM5.blp b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE2/NUM5.blp new file mode 100644 index 0000000..4d5323c Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Numbers/TYPE2/NUM5.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Quest/QUEST-COMPLETE-ICON.blp b/Interface/AddOns/SVUI/assets/artwork/Quest/QUEST-COMPLETE-ICON.blp new file mode 100644 index 0000000..625db95 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Quest/QUEST-COMPLETE-ICON.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Quest/QUEST-COMPLETE.blp b/Interface/AddOns/SVUI/assets/artwork/Quest/QUEST-COMPLETE.blp new file mode 100644 index 0000000..93db7c9 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Quest/QUEST-COMPLETE.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Quest/QUEST-INCOMPLETE-ICON.blp b/Interface/AddOns/SVUI/assets/artwork/Quest/QUEST-INCOMPLETE-ICON.blp new file mode 100644 index 0000000..b883f51 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Quest/QUEST-INCOMPLETE-ICON.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Quest/QUEST-INCOMPLETE.blp b/Interface/AddOns/SVUI/assets/artwork/Quest/QUEST-INCOMPLETE.blp new file mode 100644 index 0000000..a4ac30d Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Quest/QUEST-INCOMPLETE.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/HUNTER-TRAP-BG.blp b/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/HUNTER-TRAP-BG.blp new file mode 100644 index 0000000..33c9691 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/HUNTER-TRAP-BG.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/HUNTER-TRAP.blp b/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/HUNTER-TRAP.blp new file mode 100644 index 0000000..9fd68db Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/HUNTER-TRAP.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/PALADIN-HAMMER-BG.blp b/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/PALADIN-HAMMER-BG.blp new file mode 100644 index 0000000..6440caf Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/PALADIN-HAMMER-BG.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/PALADIN-HAMMER-FG.blp b/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/PALADIN-HAMMER-FG.blp new file mode 100644 index 0000000..9d77922 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/PALADIN-HAMMER-FG.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/PALADIN-HAMMER.blp b/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/PALADIN-HAMMER.blp deleted file mode 100644 index 350fbc1..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/PALADIN-HAMMER.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/WARLOCK-FIRE-ANIMATION.blp b/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/WARLOCK-FIRE-ANIMATION.blp deleted file mode 100644 index 1be2db2..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/WARLOCK-FIRE-ANIMATION.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/WARLOCK-SOUL-ANIMATION.blp b/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/WARLOCK-SOUL-ANIMATION.blp deleted file mode 100644 index f6ec646..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Unitframe/Class/WARLOCK-SOUL-ANIMATION.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/fonts/Action.ttf b/Interface/AddOns/SVUI/assets/fonts/Action.ttf deleted file mode 100644 index 4d68705..0000000 Binary files a/Interface/AddOns/SVUI/assets/fonts/Action.ttf and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/fonts/Adventure.ttf b/Interface/AddOns/SVUI/assets/fonts/Adventure.ttf deleted file mode 100644 index eaed0f6..0000000 Binary files a/Interface/AddOns/SVUI/assets/fonts/Adventure.ttf and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/fonts/Alert.ttf b/Interface/AddOns/SVUI/assets/fonts/Alert.ttf index da34fd0..eaed0f6 100644 Binary files a/Interface/AddOns/SVUI/assets/fonts/Alert.ttf and b/Interface/AddOns/SVUI/assets/fonts/Alert.ttf differ diff --git a/Interface/AddOns/SVUI/assets/fonts/Boom.ttf b/Interface/AddOns/SVUI/assets/fonts/Boom.ttf new file mode 100644 index 0000000..da34fd0 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/fonts/Boom.ttf differ diff --git a/Interface/AddOns/SVUI/assets/fonts/Caps.ttf b/Interface/AddOns/SVUI/assets/fonts/Caps.ttf new file mode 100644 index 0000000..42f02d6 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/fonts/Caps.ttf differ diff --git a/Interface/AddOns/SVUI/assets/fonts/Chat.ttf b/Interface/AddOns/SVUI/assets/fonts/Chat.ttf deleted file mode 100644 index 2b8c1ef..0000000 Binary files a/Interface/AddOns/SVUI/assets/fonts/Chat.ttf and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/fonts/Clean.ttf b/Interface/AddOns/SVUI/assets/fonts/Clean.ttf deleted file mode 100644 index d7ea883..0000000 Binary files a/Interface/AddOns/SVUI/assets/fonts/Clean.ttf and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/fonts/Combat2.ttf b/Interface/AddOns/SVUI/assets/fonts/Combat2.ttf new file mode 100644 index 0000000..4d68705 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/fonts/Combat2.ttf differ diff --git a/Interface/AddOns/SVUI/assets/fonts/Default.ttf b/Interface/AddOns/SVUI/assets/fonts/Default.ttf index 774c73e..48dd635 100644 Binary files a/Interface/AddOns/SVUI/assets/fonts/Default.ttf and b/Interface/AddOns/SVUI/assets/fonts/Default.ttf differ diff --git a/Interface/AddOns/SVUI/assets/fonts/Dialog.ttf b/Interface/AddOns/SVUI/assets/fonts/Dialog.ttf deleted file mode 100644 index 64ad417..0000000 Binary files a/Interface/AddOns/SVUI/assets/fonts/Dialog.ttf and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/fonts/Display.ttf b/Interface/AddOns/SVUI/assets/fonts/Display.ttf deleted file mode 100644 index 3ef95aa..0000000 Binary files a/Interface/AddOns/SVUI/assets/fonts/Display.ttf and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/fonts/Flash.ttf b/Interface/AddOns/SVUI/assets/fonts/Flash.ttf new file mode 100644 index 0000000..1408eb8 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/fonts/Flash.ttf differ diff --git a/Interface/AddOns/SVUI/assets/fonts/Names.ttf b/Interface/AddOns/SVUI/assets/fonts/Names.ttf index eaed0f6..2b8c1ef 100644 Binary files a/Interface/AddOns/SVUI/assets/fonts/Names.ttf and b/Interface/AddOns/SVUI/assets/fonts/Names.ttf differ diff --git a/Interface/AddOns/SVUI/assets/fonts/Narrative.ttf b/Interface/AddOns/SVUI/assets/fonts/Narrative.ttf index 5465a79..64ad417 100644 Binary files a/Interface/AddOns/SVUI/assets/fonts/Narrative.ttf and b/Interface/AddOns/SVUI/assets/fonts/Narrative.ttf differ diff --git a/Interface/AddOns/SVUI/assets/fonts/Roboto.ttf b/Interface/AddOns/SVUI/assets/fonts/Roboto.ttf deleted file mode 100644 index d7ea883..0000000 Binary files a/Interface/AddOns/SVUI/assets/fonts/Roboto.ttf and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/fonts/System.ttf b/Interface/AddOns/SVUI/assets/fonts/System.ttf deleted file mode 100644 index 2b8c1ef..0000000 Binary files a/Interface/AddOns/SVUI/assets/fonts/System.ttf and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/fonts/Zone.ttf b/Interface/AddOns/SVUI/assets/fonts/Zone.ttf new file mode 100644 index 0000000..b9a63a7 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/fonts/Zone.ttf differ diff --git a/Interface/AddOns/SVUI/assets/fonts/international/Action.ttf b/Interface/AddOns/SVUI/assets/fonts/international/Action.ttf deleted file mode 100644 index 99b9730..0000000 Binary files a/Interface/AddOns/SVUI/assets/fonts/international/Action.ttf and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/fonts/international/Adventure.ttf b/Interface/AddOns/SVUI/assets/fonts/international/Adventure.ttf deleted file mode 100644 index 99b9730..0000000 Binary files a/Interface/AddOns/SVUI/assets/fonts/international/Adventure.ttf and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/fonts/international/Alert.ttf b/Interface/AddOns/SVUI/assets/fonts/international/Alert.ttf deleted file mode 100644 index 99b9730..0000000 Binary files a/Interface/AddOns/SVUI/assets/fonts/international/Alert.ttf and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/fonts/international/Combat.ttf b/Interface/AddOns/SVUI/assets/fonts/international/Combat.ttf deleted file mode 100644 index 99b9730..0000000 Binary files a/Interface/AddOns/SVUI/assets/fonts/international/Combat.ttf and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/fonts/international/Combo.ttf b/Interface/AddOns/SVUI/assets/fonts/international/Combo.ttf deleted file mode 100644 index 99b9730..0000000 Binary files a/Interface/AddOns/SVUI/assets/fonts/international/Combo.ttf and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/fonts/international/Default.ttf b/Interface/AddOns/SVUI/assets/fonts/international/Default.ttf deleted file mode 100644 index 99b9730..0000000 Binary files a/Interface/AddOns/SVUI/assets/fonts/international/Default.ttf and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/fonts/international/Dialog.ttf b/Interface/AddOns/SVUI/assets/fonts/international/Dialog.ttf deleted file mode 100644 index 99b9730..0000000 Binary files a/Interface/AddOns/SVUI/assets/fonts/international/Dialog.ttf and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/fonts/international/Display.ttf b/Interface/AddOns/SVUI/assets/fonts/international/Display.ttf deleted file mode 100644 index 65b1e6f..0000000 Binary files a/Interface/AddOns/SVUI/assets/fonts/international/Display.ttf and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/fonts/international/Title.ttf b/Interface/AddOns/SVUI/assets/fonts/international/Title.ttf deleted file mode 100644 index 65b1e6f..0000000 Binary files a/Interface/AddOns/SVUI/assets/fonts/international/Title.ttf and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/sounds/beer30.mp3 b/Interface/AddOns/SVUI/assets/sounds/beer30.mp3 new file mode 100644 index 0000000..e6a018c Binary files /dev/null and b/Interface/AddOns/SVUI/assets/sounds/beer30.mp3 differ diff --git a/Interface/AddOns/SVUI/data/defaults.lua b/Interface/AddOns/SVUI/data/defaults.lua index aa000fd..0ca6aef 100644 --- a/Interface/AddOns/SVUI/data/defaults.lua +++ b/Interface/AddOns/SVUI/data/defaults.lua @@ -17,7 +17,8 @@ GET ADDON DATA ########################################################## ]]-- local SV = select(2, ...) - +local type = type; +local GetSpellInfo = GetSpellInfo; local rez = GetCVar("gxResolution"); local defaultDockWidth = tonumber(rez:match("(%d+)x%d+")) * 0.5; local defaultCenterWidth = min(defaultDockWidth, 800); @@ -37,7 +38,7 @@ end local NAMEFONT = "SVUI Name Font"; if(GetLocale() ~= "enUS") then - NAMEFONT = "Roboto" + NAMEFONT = "SVUI Clean Font" end SV.defaults = {}; @@ -65,8 +66,9 @@ SV.defaults["general"] = { ["questWatch"] = true, ["questHeaders"] = true, ["woot"] = true, - ["gamemenu"] = true, + ["gamemenu"] = '1', ["afk"] = true, + ["afkNoMove"] = false, ["pvpinterrupt"] = true, ["lookwhaticando"] = false, ["reactionChat"] = false, @@ -74,6 +76,7 @@ SV.defaults["general"] = { ["sharingiscaring"] = false, ["arenadrink"] = true, ["stupidhat"] = true, + ["drunk"] = true, ["graphSize"] = 64, ["scaleAdjust"] = 0.64, } @@ -86,13 +89,37 @@ SV.defaults["totems"] = { ["spacing"] = 4 } +SV.defaults["font"] = { + ["default"] = {file = "SVUI Default Font", size = 12, outline = "OUTLINE", optionName = "Default", optionDesc = "The most commonly used font."}, + ["name"] = {file = NAMEFONT, size = 10, outline = "OUTLINE", optionName = "Names", optionDesc = "Used in most places that unit names appear."}, + ["title"] = {file = NAMEFONT, size = 16, outline = "OUTLINE", optionName = "Titles", optionDesc = "Font used to display various titles."}, + ["number"] = {file = "SVUI Number Font", size = 11, outline = "OUTLINE", optionName = "Numbers (Regular)", optionDesc = "Font used to display most numeric values."}, + ["number_big"] = {file = "SVUI Number Font", size = 18, outline = "OUTLINE", optionName = "Numbers (Large)", optionDesc = "Font used to display larger numeric values."}, + ["combat"] = {file = "SVUI Combat Font", size = 32, outline = "OUTLINE", optionName = "Combat", optionDesc = "Scrolling combat text font."}, + ["alert"] = {file = "SVUI Alert Font", size = 20, outline = "OUTLINE", optionName = "Alerts", optionDesc = "Font used for on-screen message alerts."}, + ["zone"] = {file = "SVUI Zone Font", size = 16, outline = "OUTLINE", optionName = "Zone Text", optionDesc = "Font used for zone names. Shown when changing zones."}, + ["caps"] = {file = "SVUI Caps Font", size = 12, outline = "OUTLINE", optionName = "Caps", optionDesc = "Font typically used for things like tabs and fitted headers."}, + ["aura"] = {file = "SVUI Number Font", size = 10, outline = "OUTLINE", optionName = "Auras", optionDesc = "Aura counts and timers use this font."}, + ["data"] = {file = "SVUI Number Font", size = 11, outline = "OUTLINE", optionName = "Docked Stats", optionDesc = "Font used by the bottom and top data docks."}, + ["narrator"] = {file = "SVUI Narrator Font", size = 12, outline = "OUTLINE", optionName = "Narratives", optionDesc = "Font used for things like the 'Meanwhile' tag."}, + ["pixel"] = {file = "SVUI Pixel Font", size = 8, outline = "MONOCHROMEOUTLINE", optionName = "Pixel", optionDesc = "Tiniest fonts."}, + ["platename"] = {file = "SVUI Caps Font", size = 9, outline = "OUTLINE", optionName = "Nameplate Names", optionDesc = "Used on nameplates for unit names."}, + ["plateaura"] = {file = "SVUI Caps Font", size = 9, outline = "OUTLINE", optionName = "Nameplate Auras", optionDesc = "Used on nameplates for aura texts."}, + ["unitprimary"] = {file = "SVUI Number Font", size = 11, outline = "OUTLINE", optionName = "Unitframe Values", optionDesc = "Used on all primary unit frames for health, power and misc values.\nUnits: player, pet, target, focus, boss and arena"}, + ["unitsecondary"] = {file = "SVUI Number Font", size = 11, outline = "OUTLINE", optionName = "Unitframe Values", optionDesc = "Used on all non-primary unit frames for health, power and misc values.\nUnits: pettarget, targettarget, focustarget, party, raid, raidpet, tank and assist."}, + ["unitaurabar"] = {file = "SVUI Alert Font", size = 10, outline = "OUTLINE", optionName = "Unitframe AuraBar", optionDesc = "Used on unit aurabars."}, + ["unitaurasmall"] = {file = "SVUI Pixel Font", size = 8, outline = "MONOCHROMEOUTLINE", optionName = "Unitframe Aura (Small)", optionDesc = "Used on unit frames for auras (small scale)."}, + ["unitauramedium"] = {file = "SVUI Default Font", size = 10, outline = "OUTLINE", optionName = "Unitframe Aura (Medium)", optionDesc = "Used on unit frames for auras (medium scale)."}, + ["unitauralarge"] = {file = "SVUI Number Font", size = 10, outline = "OUTLINE", optionName = "Unitframe Aura (Large)", optionDesc = "Used on unit frames for auras (large scale)."}, +} + SV.defaults["media"] = { ["fonts"] = { - ["default"] = "SVUI System Font", + ["default"] = "SVUI Name Font", ["name"] = NAMEFONT, ["number"] = "SVUI Number Font", ["combat"] = "SVUI Number Font", - ["giant"] = "SVUI System Font", + ["giant"] = "SVUI Name Font", ["size"] = 10, ["unicodeSize"] = 12, }, @@ -130,9 +157,9 @@ SV.defaults["media"] = { }, ["tapped"] = {0.55, 0.57, 0.61}, ["disconnected"] = {0.84, 0.75, 0.65}, - ["casting"] = {0.8, 0.8, 0}, - ["spark"] = {1, 0.72, 0}, - ["interrupt"] = {0.78, 0.25, 0.25}, + ["casting"] = {0, 0.92, 1}, + ["spark"] = {0, 0.42, 1}, + ["interrupt"] = {0.78, 0, 1}, ["shield_bars"] = {0.56, 0.4, 0.62}, ["buff_bars"] = {0.31, 0.31, 0.31}, ["debuff_bars"] = {0.8, 0.1, 0.1}, @@ -150,11 +177,53 @@ SV.defaults["media"] = { [safename(86659)] = {0.98, 0.57, 0.11}, --Guardian of Ancient Kings } } -} +}; + +SV.defaults["Dock"] = { + ["enable"] = true, + ["dockLeftWidth"] = 412, + ["dockLeftHeight"] = 224, + ["dockRightWidth"] = 412, + ["dockRightHeight"] = 224, + ["dockCenterWidth"] = defaultCenterWidth, + ["dockCenterHeight"] = 20, + ["buttonSize"] = 30, + ["buttonSpacing"] = 4, + ["leftDockBackdrop"] = true, + ["rightDockBackdrop"] = true, + ["topPanel"] = true, + ["bottomPanel"] = true, + ["dataFont"] = "SVUI Number Font", + ["dataFontSize"] = 11, + ["dataFontOutline"] = "OUTLINE", + ["dataBackdrop"] = false, + ["dataHolders"] = { + ["SVUI_DockBottomCenter"] = { + [1] = "Experience Bar", + [2] = "Time", + [3] = "System", + [4] = "Gold", + [5] = "Durability", + [6] = "Reputation Bar", + }, + ["SVUI_DockTopCenter"] = { + [1] = "None", + [2] = "None", + [3] = "None", + [4] = "None", + [5] = "None", + [6] = "None", + }, + }, + ["shortGold"] = true, + ["localtime"] = true, + ["time24"] = false, + ["battleground"] = true, +}; SV.defaults["SVBar"] = { ["enable"] = true, - ["font"] = "Roboto", + ["font"] = "SVUI Clean Font", ["fontSize"] = 11, ["fontOutline"] = "OUTLINE", ["countFont"] = "SVUI Number Font", @@ -451,10 +520,10 @@ SV.defaults["SVChat"] = { ["tabHeight"] = 20, ["tabWidth"] = 75, ["tabStyled"] = true, - ["font"] = "Roboto", + ["font"] = "SVUI Clean Font", ["fontOutline"] = "OUTLINE", - ["tabFont"] = "SVUI Alert Font", - ["tabFontSize"] = 10, + ["tabFont"] = "SVUI Tab Font", + ["tabFontSize"] = 11, ["tabFontOutline"] = "OUTLINE", ["url"] = true, ["shortChannels"] = true, @@ -471,21 +540,6 @@ SV.defaults["SVChat"] = { ["basicTools"] = true, }; -SV.defaults["Dock"] = { - ["enable"] = true, - ["dockLeftWidth"] = 412, - ["dockLeftHeight"] = 224, - ["dockRightWidth"] = 412, - ["dockRightHeight"] = 224, - ["dockCenterWidth"] = defaultCenterWidth, - ["buttonSize"] = 30, - ["buttonSpacing"] = 4, - ["leftDockBackdrop"] = true, - ["rightDockBackdrop"] = true, - ["topPanel"] = true, - ["bottomPanel"] = true, -}; - SV.defaults["SVGear"] = { ["enable"] = true, ["specialization"] = { @@ -611,7 +665,8 @@ SV.defaults["SVOverride"] = { }; SV.defaults["SVPlate"] = { - ["enable"] = true, + ["enable"] = true, + ["comicStyle"] = true, ["filter"] = {}, ["font"] = NAMEFONT, ["fontSize"] = 10, @@ -682,40 +737,7 @@ SV.defaults["SVPlate"] = { SV.defaults["SVQuest"] = { ["enable"] = true, -} - -SV.defaults["SVStats"] = { - ["enable"] = true, - ["font"] = "SVUI Number Font", - ["fontSize"] = 11, - ["fontOutline"] = "OUTLINE", - ["showBackground"] = false, - ["shortGold"] = true, - ["docks"] = { - ["SVUI_DockBottomCenterLeft"] = { - ["left"] = "Experience Bar", - ["middle"] = "Time", - ["right"] = "System", - }, - ["SVUI_DockBottomCenterRight"] = { - ["left"] = "Gold", - ["middle"] = "Durability", - ["right"] = "Reputation Bar", - }, - ["SVUI_DockTopCenterLeft"] = { - ["left"] = "None", - ["middle"] = "None", - ["right"] = "None", - }, - ["SVUI_DockTopCenterRight"] = { - ["left"] = "None", - ["middle"] = "None", - ["right"] = "None", - }, - }, - ["localtime"] = true, - ["time24"] = false, - ["battleground"] = true, + ["rowHeight"] = 20, }; SV.defaults["SVTip"] = { @@ -736,7 +758,7 @@ SV.defaults["SVTip"] = { ["healthBar"] = { ["text"] = true, ["height"] = 10, - ["font"] = "Roboto", + ["font"] = "SVUI Clean Font", ["fontSize"] = 10, }, }; @@ -753,14 +775,14 @@ SV.defaults["SVUnit"] = { ["comicStyle"] = true, ["disableBlizzard"] = true, ["smoothbars"] = false, - ["statusbar"] = "SVUI BasicBar", - ["auraBarStatusbar"] = "SVUI BasicBar", + ["statusbar"] = "SVUI MultiColorBar", + ["auraBarStatusbar"] = "SVUI MultiColorBar", ["font"] = "SVUI Number Font", - ["fontSize"] = 12, - ["fontOutline"] = "OUTLINE", + ["fontSize"] = 10, + ["fontOutline"] = "NONE", ["auraFont"] = "SVUI Alert Font", - ["auraFontSize"] = 12, - ["auraFontOutline"] = "OUTLINE", + ["auraFontSize"] = 10, + ["auraFontOutline"] = "NONE", ["OORAlpha"] = 0.4, ["groupOORAlpha"] = 0.2, ["combatFadeRoles"] = true, @@ -771,28 +793,17 @@ SV.defaults["SVUnit"] = { ["glowtime"] = 0.8, ["glowcolor"] = {1, 1, 0}, ["autoRoleSet"] = false, - ["healthclass"] = true, ["forceHealthColor"] = false, ["overlayAnimation"] = true, - ["powerclass"] = false, - ["colorhealthbyvalue"] = true, - ["customhealthbackdrop"] = true, - ["classbackdrop"] = false, + ["powerclass"] = false, ["auraBarByType"] = true, ["auraBarShield"] = true, ["castClassColor"] = false, ["xrayFocus"] = true, - ["grid"] = { - ["enable"] = false, - ["size"] = 28, - ["shownames"] = false, - ["font"] = "Roboto", - ["fontsize"] = 16, - }, ["player"] = { ["enable"] = true, ["width"] = 215, - ["height"] = 60, + ["height"] = 40, ["lowmana"] = 30, ["combatfade"] = false, ["predict"] = false, @@ -825,13 +836,16 @@ SV.defaults["SVUnit"] = { ["xOffset"] = 0, ["yOffset"] = 0, ["reversed"] = false, - ["fontSize"] = 11, + ["fontSize"] = 11, + ["classColor"] = true, + ["valueColor"] = true, + ["classBackdrop"] = false, }, ["power"] = { ["enable"] = true, ["tags"] = "", - ["height"] = 10, + ["height"] = 7, ["position"] = "INNERLEFT", ["hideonnpc"] = false, ["xOffset"] = 0, @@ -840,6 +854,7 @@ SV.defaults["SVUnit"] = { ["attachTextToPower"] = false, ["druidMana"] = true, ["fontSize"] = 11, + ["classColor"] = false, }, ["name"] = { @@ -847,8 +862,8 @@ SV.defaults["SVUnit"] = { ["tags"] = "", ["xOffset"] = 0, ["yOffset"] = 0, - ["font"] = "SVUI Number Font", - ["fontSize"] = 13, + ["font"] = NAMEFONT, + ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", }, ["pvp"] = @@ -878,7 +893,8 @@ SV.defaults["SVUnit"] = { ["attachTo"] = "FRAME", ["anchorPoint"] = "TOPLEFT", ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", + ["horizontalGrowth"] = "RIGHT", + ["filterWhiteList"] = false, ["filterPlayer"] = true, ["filterRaid"] = true, ["filterAll"] = false, @@ -897,7 +913,8 @@ SV.defaults["SVUnit"] = { ["attachTo"] = "BUFFS", ["anchorPoint"] = "TOPLEFT", ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", + ["horizontalGrowth"] = "RIGHT", + ["filterWhiteList"] = false, ["filterPlayer"] = false, ["filterAll"] = false, ["filterInfinite"] = false, @@ -911,7 +928,8 @@ SV.defaults["SVUnit"] = { { ["enable"] = false, ["anchorPoint"] = "ABOVE", - ["attachTo"] = "DEBUFFS", + ["attachTo"] = "DEBUFFS", + ["filterWhiteList"] = false, ["filterPlayer"] = true, ["filterRaid"] = true, ["filterAll"] = false, @@ -961,15 +979,15 @@ SV.defaults["SVUnit"] = { ["enable"] = true, ["size"] = 26, ["attachTo"] = "INNERTOPRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, + ["xOffset"] = 8, + ["yOffset"] = 8, }, ["restIcon"] = { ["enable"] = true, - ["size"] = 25, + ["size"] = 22, ["attachTo"] = "INNERTOPRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, + ["xOffset"] = 8, + ["yOffset"] = 8, }, }, ["stagger"] = @@ -980,7 +998,7 @@ SV.defaults["SVUnit"] = { ["target"] = { ["enable"] = true, ["width"] = 215, - ["height"] = 60, + ["height"] = 40, ["threatEnabled"] = true, ["rangeCheck"] = true, ["predict"] = false, @@ -1012,27 +1030,31 @@ SV.defaults["SVUnit"] = { ["yOffset"] = 0, ["reversed"] = true, ["fontSize"] = 11, + ["classColor"] = true, + ["valueColor"] = true, + ["classBackdrop"] = false, }, ["power"] = { ["enable"] = true, ["tags"] = "[power:color][power:current]", - ["height"] = 10, + ["height"] = 7, ["position"] = "INNERRIGHT", ["hideonnpc"] = true, ["xOffset"] = 0, ["yOffset"] = 0, ["attachTextToPower"] = false, ["fontSize"] = 11, + ["classColor"] = false, }, ["name"] = { - ["position"] = "INNERRIGHT", + ["position"] = "TOPRIGHT", ["tags"] = "[name:color][name:18][smartlevel]", ["xOffset"] = -2, - ["yOffset"] = 36, + ["yOffset"] = 9, ["font"] = NAMEFONT, - ["fontSize"] = 15, + ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", }, ["portrait"] = @@ -1052,7 +1074,12 @@ SV.defaults["SVUnit"] = { ["attachTo"] = "FRAME", ["anchorPoint"] = "TOPRIGHT", ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", + ["horizontalGrowth"] = "LEFT", + ["filterWhiteList"] = + { + friendly = false, + enemy = false, + }, ["filterPlayer"] = { friendly = false, @@ -1091,7 +1118,12 @@ SV.defaults["SVUnit"] = { ["attachTo"] = "BUFFS", ["anchorPoint"] = "TOPRIGHT", ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", + ["horizontalGrowth"] = "LEFT", + ["filterWhiteList"] = + { + friendly = false, + enemy = false, + }, ["filterPlayer"] = { friendly = false, @@ -1121,7 +1153,12 @@ SV.defaults["SVUnit"] = { { ["enable"] = false, ["anchorPoint"] = "ABOVE", - ["attachTo"] = "DEBUFFS", + ["attachTo"] = "DEBUFFS", + ["filterWhiteList"] = + { + friendly = false, + enemy = false, + }, ["filterPlayer"] = { friendly = true, @@ -1200,7 +1237,7 @@ SV.defaults["SVUnit"] = { ["rangeCheck"] = true, ["threatEnabled"] = false, ["width"] = 150, - ["height"] = 30, + ["height"] = 25, ["formatting"] = { ["power_colored"] = true, ["power_type"] = "none", @@ -1228,6 +1265,9 @@ SV.defaults["SVUnit"] = { ["yOffset"] = 0, ["reversed"] = false, ["fontSize"] = 9, + ["classColor"] = true, + ["valueColor"] = true, + ["classBackdrop"] = false, }, ["power"] = { @@ -1239,6 +1279,7 @@ SV.defaults["SVUnit"] = { ["xOffset"] = 0, ["yOffset"] = 0, ["fontSize"] = 9, + ["classColor"] = false, }, ["name"] = { @@ -1246,8 +1287,8 @@ SV.defaults["SVUnit"] = { ["tags"] = "[name:color][name:10]", ["xOffset"] = 0, ["yOffset"] = 1, - ["font"] = "SVUI Narrator Font", - ["fontSize"] = 14, + ["font"] = NAMEFONT, + ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", }, ["portrait"] = @@ -1265,9 +1306,14 @@ SV.defaults["SVUnit"] = { ["perrow"] = 7, ["numrows"] = 1, ["attachTo"] = "FRAME", - ["anchorPoint"] = "BOTTOMLEFT", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "RIGHT", + ["anchorPoint"] = "TOPRIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "LEFT", + ["filterWhiteList"] = + { + friendly = false, + enemy = false, + }, ["filterPlayer"] = { friendly = true, @@ -1295,7 +1341,7 @@ SV.defaults["SVUnit"] = { }, ["useFilter"] = "", ["xOffset"] = 0, - ["yOffset"] = -8, + ["yOffset"] = 4, ["sizeOverride"] = 0, }, ["debuffs"] = @@ -1303,10 +1349,15 @@ SV.defaults["SVUnit"] = { ["enable"] = false, ["perrow"] = 5, ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "TOPLEFT", + ["attachTo"] = "BUFFS", + ["anchorPoint"] = "TOPRIGHT", ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", + ["horizontalGrowth"] = "LEFT", + ["filterWhiteList"] = + { + friendly = false, + enemy = false, + }, ["filterPlayer"] = { friendly = false, @@ -1329,7 +1380,7 @@ SV.defaults["SVUnit"] = { }, ["useFilter"] = "", ["xOffset"] = 0, - ["yOffset"] = 8, + ["yOffset"] = 4, ["sizeOverride"] = 0, }, ["icons"] = @@ -1378,6 +1429,9 @@ SV.defaults["SVUnit"] = { ["yOffset"] = 0, ["reversed"] = false, ["fontSize"] = 10, + ["classColor"] = true, + ["valueColor"] = true, + ["classBackdrop"] = false, }, ["power"] = { @@ -1389,6 +1443,7 @@ SV.defaults["SVUnit"] = { ["xOffset"] = 0, ["yOffset"] = 0, ["fontSize"] = 10, + ["classColor"] = false, }, ["name"] = { @@ -1396,10 +1451,23 @@ SV.defaults["SVUnit"] = { ["tags"] = "[name:color][name:15]", ["xOffset"] = 0, ["yOffset"] = 0, - ["font"] = "SVUI Narrator Font", - ["fontSize"] = 14, + ["font"] = NAMEFONT, + ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", }, + ["castbar"] = + { + ["enable"] = true, + ["width"] = 170, + ["height"] = 10, + ["icon"] = false, + ["matchFrameWidth"] = true, + ["format"] = "REMAINING", + ["spark"] = true, + ["useCustomColor"] = false, + ["castingColor"] = {0.8, 0.8, 0}, + ["sparkColor"] = {1, 0.72, 0}, + }, ["buffs"] = { ["enable"] = true, @@ -1408,7 +1476,12 @@ SV.defaults["SVUnit"] = { ["attachTo"] = "FRAME", ["anchorPoint"] = "TOPRIGHT", ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", + ["horizontalGrowth"] = "LEFT", + ["filterWhiteList"] = + { + friendly = false, + enemy = false, + }, ["filterPlayer"] = { friendly = true, @@ -1447,7 +1520,12 @@ SV.defaults["SVUnit"] = { ["attachTo"] = "FRAME", ["anchorPoint"] = "LEFT", ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", + ["horizontalGrowth"] = "LEFT", + ["filterWhiteList"] = + { + friendly = false, + enemy = false, + }, ["filterPlayer"] = { friendly = false, @@ -1473,24 +1551,16 @@ SV.defaults["SVUnit"] = { ["yOffset"] = 0, ["sizeOverride"] = 0, }, - ["castbar"] = - { - ["enable"] = true, - ["width"] = 170, - ["height"] = 10, - ["icon"] = false, - ["matchFrameWidth"] = true, - ["format"] = "REMAINING", - ["spark"] = true, - ["useCustomColor"] = false, - ["castingColor"] = {0.8, 0.8, 0}, - ["sparkColor"] = {1, 0.72, 0}, - }, ["aurabar"] = { ["enable"] = false, ["anchorPoint"] = "ABOVE", - ["attachTo"] = "FRAME", + ["attachTo"] = "FRAME", + ["filterWhiteList"] = + { + friendly = false, + enemy = false, + }, ["filterPlayer"] = { friendly = false, @@ -1567,6 +1637,9 @@ SV.defaults["SVUnit"] = { ["yOffset"] = 0, ["reversed"] = false, ["fontSize"] = 10, + ["classColor"] = true, + ["valueColor"] = true, + ["classBackdrop"] = false, }, ["power"] = { @@ -1578,6 +1651,7 @@ SV.defaults["SVUnit"] = { ["xOffset"] = 0, ["yOffset"] = 0, ["fontSize"] = 10, + ["classColor"] = false, }, ["name"] = { @@ -1585,8 +1659,8 @@ SV.defaults["SVUnit"] = { ["tags"] = "[name:color][name:15]", ["yOffset"] = 0, ["xOffset"] = 0, - ["font"] = "SVUI Narrator Font", - ["fontSize"] = 14, + ["font"] = NAMEFONT, + ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", }, ["buffs"] = @@ -1597,7 +1671,12 @@ SV.defaults["SVUnit"] = { ["attachTo"] = "FRAME", ["anchorPoint"] = "TOPRIGHT", ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", + ["horizontalGrowth"] = "LEFT", + ["filterWhiteList"] = + { + friendly = false, + enemy = false, + }, ["filterPlayer"] = { friendly = true, @@ -1636,7 +1715,12 @@ SV.defaults["SVUnit"] = { ["attachTo"] = "FRAME", ["anchorPoint"] = "LEFT", ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", + ["horizontalGrowth"] = "LEFT", + ["filterWhiteList"] = + { + friendly = false, + enemy = false, + }, ["filterPlayer"] = { friendly = false, @@ -1678,8 +1762,8 @@ SV.defaults["SVUnit"] = { ["enable"] = true, ["rangeCheck"] = true, ["threatEnabled"] = true, - ["width"] = 150, - ["height"] = 30, + ["width"] = 110, + ["height"] = 40, ["predict"] = false, ["formatting"] = { ["power_colored"] = true, @@ -1708,10 +1792,13 @@ SV.defaults["SVUnit"] = { ["xOffset"] = 0, ["reversed"] = false, ["fontSize"] = 10, + ["classColor"] = true, + ["valueColor"] = true, + ["classBackdrop"] = false, }, ["power"] = { - ["enable"] = false, + ["enable"] = true, ["tags"] = "", ["height"] = 7, ["position"] = "INNERLEFT", @@ -1719,6 +1806,7 @@ SV.defaults["SVUnit"] = { ["yOffset"] = 0, ["xOffset"] = 0, ["fontSize"] = 10, + ["classColor"] = false, }, ["name"] = { @@ -1726,14 +1814,14 @@ SV.defaults["SVUnit"] = { ["tags"] = "[name:color][name:8]", ["yOffset"] = 0, ["xOffset"] = 0, - ["font"] = "SVUI Narrator Font", - ["fontSize"] = 14, + ["font"] = NAMEFONT, + ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", }, ["portrait"] = { ["enable"] = true, - ["width"] = 45, + ["width"] = 40, ["overlay"] = true, ["rotation"] = 0, ["camDistanceScale"] = 1, @@ -1742,38 +1830,40 @@ SV.defaults["SVUnit"] = { ["buffs"] = { ["enable"] = true, - ["perrow"] = 3, + ["perrow"] = 4, ["numrows"] = 1, ["attachTo"] = "FRAME", - ["anchorPoint"] = "LEFT", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "LEFT", + ["anchorPoint"] = "TOPLEFT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterWhiteList"] = false, ["filterPlayer"] = true, ["filterRaid"] = true, ["filterAll"] = true, ["filterInfinite"] = true, ["filterDispellable"] = false, ["useFilter"] = "", - ["xOffset"] = -3, - ["yOffset"] = 0, + ["xOffset"] = 0, + ["yOffset"] = 4, ["sizeOverride"] = 0, }, ["debuffs"] = { ["enable"] = true, - ["perrow"] = 3, + ["perrow"] = 4, ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "RIGHT", + ["attachTo"] = "BUFFS", + ["anchorPoint"] = "TOPLEFT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterWhiteList"] = false, ["filterPlayer"] = false, ["filterAll"] = false, ["filterInfinite"] = false, ["filterDispellable"] = false, ["useFilter"] = "", - ["xOffset"] = 3, - ["yOffset"] = 0, + ["xOffset"] = 0, + ["yOffset"] = 4, ["sizeOverride"] = 0, }, ["castbar"] = @@ -1828,6 +1918,9 @@ SV.defaults["SVUnit"] = { ["xOffset"] = 0, ["reversed"] = false, ["fontSize"] = 10, + ["classColor"] = true, + ["valueColor"] = true, + ["classBackdrop"] = false, }, ["power"] = { @@ -1839,6 +1932,7 @@ SV.defaults["SVUnit"] = { ["yOffset"] = 0, ["xOffset"] = 0, ["fontSize"] = 10, + ["classColor"] = false, }, ["name"] = { @@ -1846,8 +1940,8 @@ SV.defaults["SVUnit"] = { ["tags"] = "[name:color][name:15]", ["yOffset"] = 0, ["xOffset"] = 0, - ["font"] = "SVUI Narrator Font", - ["fontSize"] = 14, + ["font"] = NAMEFONT, + ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", }, ["buffs"] = @@ -1858,7 +1952,12 @@ SV.defaults["SVUnit"] = { ["attachTo"] = "FRAME", ["anchorPoint"] = "BOTTOMLEFT", ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "RIGHT", + ["horizontalGrowth"] = "RIGHT", + ["filterWhiteList"] = + { + friendly = false, + enemy = false, + }, ["filterPlayer"] = { friendly = true, @@ -1897,7 +1996,12 @@ SV.defaults["SVUnit"] = { ["attachTo"] = "FRAME", ["anchorPoint"] = "BOTTOMRIGHT", ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "LEFT", + ["horizontalGrowth"] = "LEFT", + ["filterWhiteList"] = + { + friendly = false, + enemy = false, + }, ["filterPlayer"] = { friendly = false, @@ -1957,6 +2061,9 @@ SV.defaults["SVUnit"] = { ["xOffset"] = 0, ["reversed"] = true, ["fontSize"] = 10, + ["classColor"] = true, + ["valueColor"] = true, + ["classBackdrop"] = false, }, ["power"] = { @@ -1968,6 +2075,7 @@ SV.defaults["SVUnit"] = { ["yOffset"] = 7, ["xOffset"] = 0, ["fontSize"] = 10, + ["classColor"] = false, }, ["portrait"] = { @@ -1984,8 +2092,8 @@ SV.defaults["SVUnit"] = { ["tags"] = "[name:color][name:15]", ["yOffset"] = 0, ["xOffset"] = 0, - ["font"] = "SVUI Number Font", - ["fontSize"] = 12, + ["font"] = NAMEFONT, + ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", }, ["buffs"] = @@ -1997,6 +2105,7 @@ SV.defaults["SVUnit"] = { ["anchorPoint"] = "LEFT", ["verticalGrowth"] = "UP", ["horizontalGrowth"] = "LEFT", + ["filterWhiteList"] = false, ["filterPlayer"] = false, ["filterRaid"] = false, ["filterAll"] = false, @@ -2016,6 +2125,7 @@ SV.defaults["SVUnit"] = { ["anchorPoint"] = "LEFT", ["verticalGrowth"] = "UP", ["horizontalGrowth"] = "LEFT", + ["filterWhiteList"] = false, ["filterPlayer"] = true, ["filterAll"] = false, ["filterInfinite"] = false, @@ -2057,7 +2167,6 @@ SV.defaults["SVUnit"] = { ["width"] = 215, ["height"] = 45, ["predict"] = false, - ["colorOverride"] = "USE_DEFAULT", ["formatting"] = { ["power_colored"] = true, ["power_type"] = "none", @@ -2085,6 +2194,9 @@ SV.defaults["SVUnit"] = { ["xOffset"] = 0, ["reversed"] = true, ["fontSize"] = 10, + ["classColor"] = true, + ["valueColor"] = true, + ["classBackdrop"] = false, }, ["power"] = { @@ -2096,6 +2208,7 @@ SV.defaults["SVUnit"] = { ["yOffset"] = 7, ["xOffset"] = 0, ["fontSize"] = 10, + ["classColor"] = false, }, ["name"] = { @@ -2103,8 +2216,8 @@ SV.defaults["SVUnit"] = { ["tags"] = "[name:color][name:15]", ["yOffset"] = 0, ["xOffset"] = 0, - ["font"] = "SVUI Number Font", - ["fontSize"] = 12, + ["font"] = NAMEFONT, + ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", }, ["portrait"] = @@ -2124,33 +2237,14 @@ SV.defaults["SVUnit"] = { ["attachTo"] = "FRAME", ["anchorPoint"] = "LEFT", ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = - { - friendly = false, - enemy = false, - }, - ["filterRaid"] = - { - friendly = false, - enemy = false, - }, - ["filterAll"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, + ["horizontalGrowth"] = "LEFT", + ["filterWhiteList"] = false, + ["filterPlayer"] = false, + ["filterRaid"] = false, + ["filterAll"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, ["useFilter"] = "Shield", - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, ["xOffset"] = -8, ["yOffset"] = 0, ["sizeOverride"] = 40, @@ -2164,27 +2258,13 @@ SV.defaults["SVUnit"] = { ["anchorPoint"] = "LEFT", ["verticalGrowth"] = "UP", ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = - { - friendly = false, - enemy = false, - }, - ["filterAll"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "CC", - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, + ["filterWhiteList"] = false, + ["filterPlayer"] = false, + ["filterRaid"] = false, + ["filterAll"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "CC", ["xOffset"] = -8, ["yOffset"] = 0, ["sizeOverride"] = 40, @@ -2219,21 +2299,28 @@ SV.defaults["SVUnit"] = { ["enable"] = true, ["rangeCheck"] = true, ["threatEnabled"] = true, - ["visibility"] = "[@raid6, exists][nogroup] hide;show", + ["visibility"] = "[group:raid][nogroup] hide;show", ["showBy"] = "UP_RIGHT", ["wrapXOffset"] = 9, - ["wrapYOffset"] = 13, - ["groupCount"] = 1, + ["wrapYOffset"] = 24, + ["allowedGroup"] = { + [1] = true, + }, ["gRowCol"] = 1, ["sortMethod"] = "GROUP", ["sortDir"] = "ASC", ["invertGroupingOrder"] = false, ["showPlayer"] = true, - ["predict"] = false, - ["colorOverride"] = "USE_DEFAULT", - ["width"] = 70, - ["height"] = 70, - ["gridAllowed"] = true, + ["predict"] = false, + ["width"] = 115, + ["height"] = 30, + ["grid"] = { + ["enable"] = false, + ["size"] = 45, + ["fontsize"] = 12, + ["iconSize"] = 12, + ["powerEnable"] = false + }, ["formatting"] = { ["power_colored"] = true, ["power_type"] = "none", @@ -2263,10 +2350,13 @@ SV.defaults["SVUnit"] = { ["xOffset"] = 0, ["reversed"] = false, ["fontSize"] = 10, + ["classColor"] = true, + ["valueColor"] = true, + ["classBackdrop"] = false, }, ["power"] = { - ["enable"] = true, + ["enable"] = false, ["tags"] = "", ["frequentUpdates"] = false, ["height"] = 7, @@ -2275,16 +2365,17 @@ SV.defaults["SVUnit"] = { ["yOffset"] = 0, ["xOffset"] = 0, ["fontSize"] = 10, + ["classColor"] = false, }, ["name"] = { - ["position"] = "INNERTOPLEFT", + ["position"] = "BOTTOMLEFT", ["tags"] = "[name:color][name:10]", - ["yOffset"] = 0, + ["yOffset"] = -2, ["xOffset"] = 0, - ["font"] = "SVUI Narrator Font", - ["fontSize"] = 13, - ["fontOutline"] = "OUTLINE", + ["font"] = NAMEFONT, + ["fontSize"] = 10, + ["fontOutline"] = "NONE", }, ["buffs"] = { @@ -2295,6 +2386,7 @@ SV.defaults["SVUnit"] = { ["anchorPoint"] = "RIGHTTOP", ["verticalGrowth"] = "DOWN", ["horizontalGrowth"] = "RIGHT", + ["filterWhiteList"] = false, ["filterPlayer"] = true, ["filterRaid"] = true, ["filterAll"] = false, @@ -2314,6 +2406,7 @@ SV.defaults["SVUnit"] = { ["anchorPoint"] = "RIGHTTOP", ["verticalGrowth"] = "DOWN", ["horizontalGrowth"] = "RIGHT", + ["filterWhiteList"] = false, ["filterPlayer"] = false, ["filterAll"] = false, ["filterInfinite"] = false, @@ -2366,15 +2459,15 @@ SV.defaults["SVUnit"] = { ["roleIcon"] = { ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "INNERBOTTOMRIGHT", + ["size"] = 15, + ["attachTo"] = "BOTTOMRIGHT", ["xOffset"] = 0, - ["yOffset"] = 0, + ["yOffset"] = -2, }, ["raidRoleIcons"] = { ["enable"] = true, - ["size"] = 18, + ["size"] = 25, ["attachTo"] = "TOPLEFT", ["xOffset"] = 0, ["yOffset"] = -4, @@ -2392,22 +2485,30 @@ SV.defaults["SVUnit"] = { }, ["raid"] = { ["enable"] = true, - ["gridAllowed"] = true, ["rangeCheck"] = true, ["threatEnabled"] = true, - ["visibility"] = "[@raid26, noexists][nogroup] hide;show", + ["visibility"] = "[group:raid] show;hide", ["showBy"] = "RIGHT_DOWN", ["wrapXOffset"] = 8, ["wrapYOffset"] = 8, - ["groupCount"] = 8, + ["showGroupNumber"] = false, + ["allowedGroup"] = { + [1] = true, [2] = true, [3] = true, [4] = true, [5] = true, [6] = true, [7] = true, [8] = true, + }, ["gRowCol"] = 1, ["sortMethod"] = "GROUP", ["sortDir"] = "ASC", ["showPlayer"] = true, - ["predict"] = false, - ["colorOverride"] = "USE_DEFAULT", + ["predict"] = false, ["width"] = 50, ["height"] = 30, + ["grid"] = { + ["enable"] = false, + ["size"] = 30, + ["fontsize"] = 12, + ["iconSize"] = 12, + ["powerEnable"] = false + }, ["formatting"] = { ["power_colored"] = true, ["power_type"] = "none", @@ -2437,6 +2538,9 @@ SV.defaults["SVUnit"] = { ["xOffset"] = 0, ["reversed"] = false, ["fontSize"] = 10, + ["classColor"] = true, + ["valueColor"] = true, + ["classBackdrop"] = false, }, ["power"] = { @@ -2449,6 +2553,7 @@ SV.defaults["SVUnit"] = { ["yOffset"] = 0, ["xOffset"] = 0, ["fontSize"] = 10, + ["classColor"] = false, }, ["name"] = { @@ -2469,6 +2574,7 @@ SV.defaults["SVUnit"] = { ["anchorPoint"] = "RIGHT", ["verticalGrowth"] = "UP", ["horizontalGrowth"] = "RIGHT", + ["filterWhiteList"] = false, ["filterPlayer"] = true, ["filterRaid"] = true, ["filterAll"] = false, @@ -2488,6 +2594,7 @@ SV.defaults["SVUnit"] = { ["anchorPoint"] = "RIGHT", ["verticalGrowth"] = "UP", ["horizontalGrowth"] = "RIGHT", + ["filterWhiteList"] = false, ["filterPlayer"] = false, ["filterAll"] = false, ["filterInfinite"] = false, @@ -2539,23 +2646,29 @@ SV.defaults["SVUnit"] = { }, ["raidpet"] = { ["enable"] = false, - ["gridAllowed"] = true, ["rangeCheck"] = true, ["threatEnabled"] = true, - ["visibility"] = "[group:raid] show; hide", + ["visibility"] = "[group:raid] show;hide", ["showBy"] = "DOWN_RIGHT", ["wrapXOffset"] = 3, ["wrapYOffset"] = 3, - ["groupCount"] = 2, + ["allowedGroup"] = { + [1] = true, [2] = true, + }, ["gRowCol"] = 1, ["sortMethod"] = "PETNAME", ["sortDir"] = "ASC", ["invertGroupingOrder"] = false, - ["predict"] = false, - ["colorOverride"] = "USE_DEFAULT", + ["predict"] = false, ["width"] = 80, ["height"] = 30, - ["gridAllowed"] = true, + ["grid"] = { + ["enable"] = false, + ["size"] = 30, + ["fontsize"] = 12, + ["iconSize"] = 12, + ["powerEnable"] = false + }, ["formatting"] = { ["power_colored"] = true, ["power_type"] = "none", @@ -2585,6 +2698,9 @@ SV.defaults["SVUnit"] = { ["xOffset"] = 0, ["reversed"] = false, ["fontSize"] = 10, + ["classColor"] = true, + ["valueColor"] = true, + ["classBackdrop"] = false, }, ["name"] = { @@ -2605,6 +2721,7 @@ SV.defaults["SVUnit"] = { ["anchorPoint"] = "RIGHT", ["verticalGrowth"] = "UP", ["horizontalGrowth"] = "RIGHT", + ["filterWhiteList"] = false, ["filterPlayer"] = true, ["filterRaid"] = true, ["filterAll"] = false, @@ -2624,6 +2741,7 @@ SV.defaults["SVUnit"] = { ["anchorPoint"] = "RIGHT", ["verticalGrowth"] = "UP", ["horizontalGrowth"] = "RIGHT", + ["filterWhiteList"] = false, ["filterPlayer"] = false, ["filterAll"] = false, ["filterInfinite"] = false, @@ -2659,11 +2777,18 @@ SV.defaults["SVUnit"] = { }, ["tank"] = { ["enable"] = true, - ["threatEnabled"] = true, + ["threatEnabled"] = true, + ["visibility"] = "[group:raid] show;hide", ["rangeCheck"] = true, ["width"] = 120, ["height"] = 28, - ["gridAllowed"] = true, + ["grid"] = { + ["enable"] = false, + ["size"] = 45, + ["fontsize"] = 12, + ["iconSize"] = 12, + ["powerEnable"] = false + }, ["formatting"] = { ["power_colored"] = true, ["power_type"] = "none", @@ -2693,6 +2818,9 @@ SV.defaults["SVUnit"] = { ["xOffset"] = 0, ["reversed"] = false, ["fontSize"] = 10, + ["classColor"] = true, + ["valueColor"] = true, + ["classBackdrop"] = false, }, ["name"] = { @@ -2716,11 +2844,18 @@ SV.defaults["SVUnit"] = { }, ["assist"] = { ["enable"] = true, - ["threatEnabled"] = true, + ["threatEnabled"] = true, + ["visibility"] = "[group:raid] show;hide", ["rangeCheck"] = true, ["width"] = 120, ["height"] = 28, - ["gridAllowed"] = true, + ["grid"] = { + ["enable"] = false, + ["size"] = 45, + ["fontsize"] = 12, + ["iconSize"] = 12, + ["powerEnable"] = false + }, ["formatting"] = { ["power_colored"] = true, ["power_type"] = "none", @@ -2750,6 +2885,9 @@ SV.defaults["SVUnit"] = { ["xOffset"] = 0, ["reversed"] = false, ["fontSize"] = 10, + ["classColor"] = true, + ["valueColor"] = true, + ["classBackdrop"] = false, }, ["name"] = { diff --git a/Interface/AddOns/SVUI/data/filterdefaults.lua b/Interface/AddOns/SVUI/data/filterdefaults.lua index 9ca1c81..849c884 100644 --- a/Interface/AddOns/SVUI/data/filterdefaults.lua +++ b/Interface/AddOns/SVUI/data/filterdefaults.lua @@ -39,9 +39,9 @@ end SV.filterdefaults = {}; local FilterIDs = { - ["Blocked"] = [[36900,36901,36893,114216,97821,36032,132365,8733,57724,25771,57723,36032,58539,26013,6788,71041,41425,55711,8326,23445,24755,25163,80354,95809,95223,124275,124274,124273,117870,123981,15007,113942,89140]], + --["BlackList"] = [[36900]], - ["Allowed"] = [[31821,2825,32182,80353,90355,47788,33206,116849,22812,1490,116202,123059,136431,137332,137375,144351,142863,142864,142865,143198]], + --["WhiteList"] = [[31821]], ["CC"] = [[47476,91800,91807,91797,108194,115001,33786,339,78675,22570,5211,102359,99,127797,45334,114238,3355,24394,64803,19386,117405,128405,31661,118,122,82691,44572,33395,102051,20066,10326,853,105593,31935,105421,605,64044,8122,9484,15487,114404,88625,87194,2094,1776,6770,1833,1330,408,88611,51514,64695,63685,118905,118345,710,6789,118699,5484,6358,30283,115268,89766,137143,7922,105771,107566,132168,107570,118895,18498,116706,115078,119392,119381,120086,140023,25046,20549,107079]], @@ -50,21 +50,10 @@ local FilterIDs = { ["Player"] = [[17,47515,45243,45438,45438,115610,110909,12051,12472,80353,12042,32612,110960,108839,111264,108843,48797,48792,49039,87256,49222,55233,50461,49016,51271,96268,33206,47788,62618,47585,6346,10060,114239,119032,27827,104773,110913,108359,113860,113861,113858,88448,22812,102342,106922,61336,117679,102543,102558,102560,16689,132158,106898,1850,106951,29166,52610,69369,112071,124974,19263,53480,51755,54216,34471,3045,3584,131894,90355,90361,31224,74001,5277,45182,51713,114018,2983,121471,11327,108212,57933,79140,13750,98007,30823,108271,16188,2825,79206,16191,8178,58875,108281,108271,16166,114896,1044,1022,1038,6940,114039,31821,498,642,86659,20925,31850,31884,53563,31842,54428,105809,85499,118038,55694,97463,12975,114029,871,114030,18499,1719,23920,114028,46924,3411,107574,120954,131523,122783,122278,115213,116849,125174,116841,20594,59545,20572,26297,68992]], ["Raid"] = [[116281,116784,116417,116942,116161,117708,118303,118048,118135,117878,117949,116835,116778,116525,122761,122760,122740,123812,123180,123474,122835,123081,122125,121885,121949,117436,118091,117519,122752,123011,116161,123121,119985,119086,119775,122151,138349,137371,136767,137641,137359,137972,136903,136753,137633,137731,133767,133768,136050,138569,134691,137440,137408,137360,135000,143436,143579,147383,146124,144851,144358,144774,147207,144215,143990,144330,143494,142990,143919,143766,143773,146589,143777,143385,143974,145183]] -} +}; -local FilterOverrides = { - ["45438"] = 5, ["48797"] = 5, ["87256"] = 4, - ["33206"] = 3, ["47585"] = 5, ["22812"] = 2, - ["102342"] = 2, ["19263"] = 5, ["5277"] = 5, - ["1022"] = 5, ["31821"] = 3, ["498"] = 2, - ["642"] = 5, ["86659"] = 4, ["31850"] = 4, - ["118038"] = 5, ["114029"] = 2, ["871"] = 3, - ["120954"] = 2, ["131523"] = 5 -} - - -SV.filterdefaults["Blocked"] = {}; -SV.filterdefaults["Allowed"] = {}; +SV.filterdefaults["BlackList"] = {}; +SV.filterdefaults["WhiteList"] = {}; SV.filterdefaults["Defense"] = {}; SV.filterdefaults["Player"] = {}; SV.filterdefaults["AuraBars"] = {}; @@ -78,8 +67,7 @@ for k, x in pairs(FilterIDs) do if(id) then local saved local n = safename(id); - local p = FilterOverrides[tostring(id)] or 0; - saved = {['enable'] = true, ['priority'] = p, ['isDefault'] = true} + saved = {['enable'] = true, ['priority'] = 0, ['isDefault'] = true} src[n] = saved end end diff --git a/Interface/AddOns/SVUI/framework/api/api.xml b/Interface/AddOns/SVUI/framework/api/api.xml index 09070e6..b6babc6 100644 --- a/Interface/AddOns/SVUI/framework/api/api.xml +++ b/Interface/AddOns/SVUI/framework/api/api.xml @@ -551,6 +551,71 @@ </Frames> </Frame> + <Frame name="SVUI_PanelTemplate_Icon" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="slot" /> + <Attribute name="panelPadding" type="number" value="2" /> + <Attribute name="panelColor" type="string" value="invisible" /> + <Attribute name="panelGradient" type="boolean" value="false" /> + <Attribute name="panelTexUpdate" type="boolean" value="false" /> + <Attribute name="panelSkipUpdate" type="boolean" value="true" /> + </Attributes> + <Backdrop bgFile="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> + <EdgeSize val="1" /> + <TileSize val="0" /> + <BackgroundInsets left="1" right="1" top="1" bottom="1" /> + <Color r="0" g="0" b="0" a="0" /> + <BorderColor r="0" g="0" b="0" a="1" /> + </Backdrop> + <Layers> + <Layer level="BORDER"> + <Texture parentKey="BorderLeft" file="Interface\BUTTONS\WHITE8X8"> + <Anchors> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" /> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" /> + </Anchors> + <Size> + <AbsDimension x="2" /> + </Size> + <Color r="0" g="0" b="0" a="1" /> + </Texture> + <Texture parentKey="BorderRight" file="Interface\BUTTONS\WHITE8X8"> + <Anchors> + <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" /> + <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" /> + </Anchors> + <Size> + <AbsDimension x="2" /> + </Size> + <Color r="0" g="0" b="0" a="1" /> + </Texture> + <Texture parentKey="BorderTop" file="Interface\BUTTONS\WHITE8X8"> + <Anchors> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" /> + <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" /> + </Anchors> + <Size> + <AbsDimension y="2" /> + </Size> + <Color r="0" g="0" b="0" a="1" /> + </Texture> + <Texture parentKey="BorderBottom" file="Interface\BUTTONS\WHITE8X8"> + <Anchors> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" /> + <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" /> + </Anchors> + <Size> + <AbsDimension y="2" /> + </Size> + <Color r="0" g="0" b="0" a="1" /> + </Texture> + </Layer> + </Layers> + <Frames> + <Frame parentKey="Shadow" inherits="SVUI_ShadowTemplate" /> + </Frames> + </Frame> + <Frame name="SVUI_PanelTemplate_Inset" virtual="true"> <Attributes> <Attribute name="panelID" type="string" value="inset" /> @@ -1241,6 +1306,6 @@ </Layers> </Frame> - <Script file="api_layout.lua"/> - <Script file="api_templates.lua"/> + <Script file="api_general.lua"/> + <Script file="api_style.lua"/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/api/api_general.lua b/Interface/AddOns/SVUI/framework/api/api_general.lua new file mode 100644 index 0000000..f2688ec --- /dev/null +++ b/Interface/AddOns/SVUI/framework/api/api_general.lua @@ -0,0 +1,380 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local table = _G.table; +local string = _G.string; +local math = _G.math; +--[[ MATH METHODS ]]-- +local floor, abs, min, max = math.floor, math.abs, math.min, math.max; +local parsefloat, ceil = math.parsefloat, math.ceil; +--[[ STRING METHODS ]]-- +local lower = string.lower; +--[[ TABLE METHODS ]]-- +local tremove, tcopy, twipe, tsort, tconcat, tdump = table.remove, table.copy, table.wipe, table.sort, table.concat, table.dump; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local SVLib = LibSuperVillain("Registry"); +local LSM = LibStub("LibSharedMedia-3.0"); +local STANDARD_TEXT_FONT = _G.STANDARD_TEXT_FONT; +--[[ +########################################################## +APPENDED POSITIONING METHODS +########################################################## +]]-- +local SetSizeToScale = function(self, width, height) + if(type(width) == "number") then + local h = (height and type(height) == "number") and height or width + self:SetSize(SV:Scale(width), SV:Scale(h)) + end +end + +local SetWidthToScale = function(self, width) + if(type(width) == "number") then + self:SetWidth(SV:Scale(width)) + end +end + +local SetHeightToScale = function(self, height) + if(type(height) == "number") then + self:SetHeight(SV:Scale(height)) + end +end + +local SetAllPointsOut = function(self, parent, x, y) + x = type(x) == "number" and x or 1 + y = y or x + local nx = SV:Scale(x); + local ny = SV:Scale(y); + parent = parent or self:GetParent() + if self:GetPoint() then + self:ClearAllPoints() + end + self:SetPoint("TOPLEFT", parent, "TOPLEFT", -nx, ny) + self:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", nx, -ny) +end + +local SetAllPointsIn = function(self, parent, x, y) + x = type(x) == "number" and x or 1 + y = y or x + local nx = SV:Scale(x); + local ny = SV:Scale(y); + parent = parent or self:GetParent() + if self:GetPoint() then + self:ClearAllPoints() + end + self:SetPoint("TOPLEFT", parent, "TOPLEFT", nx, -ny) + self:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", -nx, ny) +end + +local SetPointToScale; +do + local PARAMS = {} + SetPointToScale = function(self, ...) + local n = select('#', ...) + PARAMS = {...} + local arg + for i = 1, n do + arg = PARAMS[i] + if(arg and type(arg) == "number") then + PARAMS[i] = SV:Scale(arg) + end + end + self:SetPoint(unpack(PARAMS)) + end +end +--[[ +########################################################## +APPENDED DESTROY METHODS +########################################################## +]]-- +local _purgatory = CreateFrame("Frame", nil) +_purgatory:Hide() + +local Die = function(self) + if(self.UnregisterAllEvents) then + self:UnregisterAllEvents() + self:SetParent(_purgatory) + else + self:Hide() + self.Show = SV.fubar + end +end + +local RemoveTextures = function(self, option) + if(self.Panel) then return end + local region, layer, texture + for i = 1, self:GetNumRegions()do + region = select(i, self:GetRegions()) + if(region and (region:GetObjectType() == "Texture")) then + + layer = region:GetDrawLayer() + texture = region:GetTexture() + + if(option) then + if(type(option) == "boolean") then + if region.UnregisterAllEvents then + region:UnregisterAllEvents() + region:SetParent(_purgatory) + else + region.Show = region.Hide + end + region:Hide() + elseif(type(option) == "string" and ((layer == option) or (texture ~= option))) then + region:SetTexture(0,0,0,0) + end + else + region:SetTexture(0,0,0,0) + end + end + end +end +--[[ +########################################################## +APPENDED FONT TEMPLATING METHODS +########################################################## +]]-- +local ManagedFonts = {}; + +local FontManager = function(self, fontTemplate, fontJustifyH, preUpdateFunc, postUpdateFunc) + if not self then return end + local STANDARDFONTSIZE = SV.db.font and SV.db.font.default.size or 11 + + fontTemplate = fontTemplate or "default"; + fontJustifyH = fontJustifyH or "CENTER"; + local template = SV.db.font[fontTemplate]; + if(not template) then + print(fontTemplate) + return + end + + self.___template = fontTemplate; + self.___file = LSM:Fetch("font", template.file); + self.___size = template.size; + self.___style = template.outline; + self.___common = (template.size == STANDARDFONTSIZE); + + if(preUpdateFunc and type(preUpdateFunc) == 'function') then + self.___preUpdate = preUpdateFunc + end + + if(postUpdateFunc and type(postUpdateFunc) == 'function') then + self.___postUpdate = postUpdateFunc + end + + + self:SetFont(self.___file, self.___size, self.___style) + if(template.outline and template.outline ~= "NONE") then + self:SetShadowColor(0, 0, 0, 0) + else + self:SetShadowColor(0, 0, 0, 0.2) + end + self:SetShadowOffset(1, -1) + self:SetJustifyH(fontJustifyH) + self:SetJustifyV("MIDDLE") + + ManagedFonts[self] = true +end +--[[ +########################################################## +UPDATE CALLBACKS +########################################################## +]]-- +local function FontTemplateUpdates() + local defaultSize = SV.db.font.default.size; + for frame in pairs(ManagedFonts) do + if frame then + if(frame.___preUpdate) then + frame:___preUpdate() + else + local template = SV.db.font[frame.___template]; + frame.___file = LSM:Fetch("font", template.file); + frame.___size = frame.___common and defaultSize or template.size; + frame.___style = template.outline; + end + frame:SetFont(frame.___file, frame.___size, frame.___style); + + if(frame.___postUpdate) then + frame:___postUpdate() + end + else + ManagedFonts[frame] = nil + end + end +end + +SV.Events:On("SVUI_FONTS_UPDATED", "FontTemplateUpdates", FontTemplateUpdates); +--[[ +########################################################## +SECURE FADING +########################################################## +]]-- +local SecureFade_OnUpdate = function(self, elasped) + local frame = self.owner; + if(frame) then + local state = frame.___fadeset; + state[4] = (state[4] or 0) + elasped; + if(state[4] < state[3]) then + + if(frame.___fademode == "IN") then + frame:SetAlpha((state[4] / state[3]) * (state[2] - state[1]) + state[1]) + elseif(frame.___fademode == "OUT") then + frame:SetAlpha(((state[3] - state[4]) / state[3]) * (state[1] - state[2]) + state[2]) + end + + else + state[4] = 0 + frame:SetAlpha(state[2]) + local canfade = (not InCombatLockdown()) or (InCombatLockdown() and (not frame:IsProtected())) + if(frame.___fadehide and canfade) then + frame:Hide() + end + + if(frame.___fadefunc) then + local _, catch = pcall(frame.___fadefunc, frame) + if(not catch) then + frame.___fadefunc = nil + end + end + + self.Running = false; + self:SetScript("OnUpdate", nil); + end + end +end + +local SecureFadeIn = function(self, duration, alphaStart, alphaEnd) + local alpha1 = alphaStart or 0; + local alpha2 = alphaEnd or 1; + local timer = duration or 0.1; + --local name = self:GetName() or 'Frame'; + local canfade = (not InCombatLockdown()) or (InCombatLockdown() and (not self:IsProtected())) + if(canfade and not self:IsShown()) then + self:Show() + end + + if(self:IsShown() and self:GetAlpha() == alpha2) then return end + + self.___fademode = "IN"; + self.___fadehide = false; + self.___fadefunc = nil; + + if(not self.___fadeset) then + self.___fadeset = {}; + end + self.___fadeset[1] = alpha1; + self.___fadeset[2] = alpha2; + self.___fadeset[3] = timer; + + self:SetAlpha(alpha1) + + if(not self.___fadehandler) then + self.___fadehandler = CreateFrame("Frame", nil) + self.___fadehandler.owner = self; + end + if(not self.___fadehandler.Running) then + self.___fadehandler.Running = true; + self.___fadehandler:SetScript("OnUpdate", SecureFade_OnUpdate) + end +end + +local SecureFadeOut = function(self, duration, alphaStart, alphaEnd, hideOnFinished) + local alpha1 = alphaStart or 1; + local alpha2 = alphaEnd or 0; + local timer = duration or 0.1; + --local name = self:GetName() or 'Frame'; + + if(not self:IsShown() or self:GetAlpha() == alpha2) then return end + + self.___fademode = "OUT"; + self.___fadehide = hideOnFinished; + self.___fadefunc = nil; + + if(not self.___fadeset) then + self.___fadeset = {}; + end + + self.___fadeset[1] = alpha1; + self.___fadeset[2] = alpha2; + self.___fadeset[3] = timer; + + self:SetAlpha(alpha1) + + if(not self.___fadehandler) then + self.___fadehandler = CreateFrame("Frame", nil) + self.___fadehandler.owner = self; + end + if(not self.___fadehandler.Running) then + self.___fadehandler.Running = true; + self.___fadehandler:SetScript("OnUpdate", SecureFade_OnUpdate) + end +end + +local SecureFadeCallback = function(self, callback) + self.___fadefunc = callback; +end +--[[ +########################################################## +ENUMERATION +########################################################## +]]-- +local function AppendMethods(OBJECT) + local META = getmetatable(OBJECT).__index + if not OBJECT.SetSizeToScale then META.SetSizeToScale = SetSizeToScale end + if not OBJECT.SetWidthToScale then META.SetWidthToScale = SetWidthToScale end + if not OBJECT.SetHeightToScale then META.SetHeightToScale = SetHeightToScale end + if not OBJECT.SetPointToScale then META.SetPointToScale = SetPointToScale end + if not OBJECT.SetAllPointsOut then META.SetAllPointsOut = SetAllPointsOut end + if not OBJECT.SetAllPointsIn then META.SetAllPointsIn = SetAllPointsIn end + if not OBJECT.Die then META.Die = Die end + if not OBJECT.RemoveTextures then META.RemoveTextures = RemoveTextures end + if not OBJECT.FontManager then META.FontManager = FontManager end + if not OBJECT.FadeIn then META.FadeIn = SecureFadeIn end + if not OBJECT.FadeOut then META.FadeOut = SecureFadeOut end + if not OBJECT.FadeCallback then META.FadeCallback = SecureFadeCallback end +end + +local HANDLER, OBJECT = {["Frame"] = true}, CreateFrame("Frame") +AppendMethods(OBJECT) +AppendMethods(OBJECT:CreateTexture()) +AppendMethods(OBJECT:CreateFontString()) + +OBJECT = EnumerateFrames() +while OBJECT do + local objType = OBJECT:GetObjectType() + if not HANDLER[objType] then + AppendMethods(OBJECT) + HANDLER[objType] = true + end + OBJECT = EnumerateFrames(OBJECT) +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/api/api_layout.lua b/Interface/AddOns/SVUI/framework/api/api_layout.lua deleted file mode 100644 index 12ea3e5..0000000 --- a/Interface/AddOns/SVUI/framework/api/api_layout.lua +++ /dev/null @@ -1,250 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local table = _G.table; -local string = _G.string; -local math = _G.math; ---[[ MATH METHODS ]]-- -local floor, abs, min, max = math.floor, math.abs, math.min, math.max; -local parsefloat, ceil = math.parsefloat, math.ceil; ---[[ STRING METHODS ]]-- -local lower = string.lower; ---[[ TABLE METHODS ]]-- -local tremove, tcopy, twipe, tsort, tconcat, tdump = table.remove, table.copy, table.wipe, table.sort, table.concat, table.dump; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...); ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local ManagedFonts = {}; -local STANDARD_TEXT_FONT = _G.STANDARD_TEXT_FONT; -local SizeScaled, HeightScaled, WidthScaled, PointScaled, WrapOuter, FillInner; ---[[ -########################################################## -APPENDED POSITIONING METHODS -########################################################## -]]-- -do - local PARAMS = {} - - function SizeScaled(self, width, height) - if(type(width) == "number") then - local h = (height and type(height) == "number") and height or width - self:SetSize(SV:Scale(width), SV:Scale(h)) - end - end - - function WidthScaled(self, width) - if(type(width) == "number") then - self:SetWidth(SV:Scale(width)) - end - end - - function HeightScaled(self, height) - if(type(height) == "number") then - self:SetHeight(SV:Scale(height)) - end - end - - function PointScaled(self, ...) - local n = select('#', ...) - PARAMS = {...} - local arg - for i = 1, n do - arg = PARAMS[i] - if(arg and type(arg) == "number") then - PARAMS[i] = SV:Scale(arg) - end - end - self:SetPoint(unpack(PARAMS)) - end - - function WrapOuter(self, parent, x, y) - x = type(x) == "number" and x or 1 - y = y or x - local nx = SV:Scale(x); - local ny = SV:Scale(y); - parent = parent or self:GetParent() - if self:GetPoint() then - self:ClearAllPoints() - end - self:SetPoint("TOPLEFT", parent, "TOPLEFT", -nx, ny) - self:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", nx, -ny) - end - - function FillInner(self, parent, x, y) - x = type(x) == "number" and x or 1 - y = y or x - local nx = SV:Scale(x); - local ny = SV:Scale(y); - parent = parent or self:GetParent() - if self:GetPoint() then - self:ClearAllPoints() - end - self:SetPoint("TOPLEFT", parent, "TOPLEFT", nx, -ny) - self:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", -nx, ny) - end -end ---[[ -########################################################## -APPENDED DESTROY METHODS -########################################################## -]]-- -local _purgatory = CreateFrame("Frame", nil) -_purgatory:Hide() - -local function Die(self) - if(self.UnregisterAllEvents) then - self:UnregisterAllEvents() - self:SetParent(_purgatory) - else - self:Hide() - self.Show = SV.fubar - end -end - -local function RemoveTextures(self, option) - if(self.Panel) then return end - local region, layer, texture - for i = 1, self:GetNumRegions()do - region = select(i, self:GetRegions()) - if(region and (region:GetObjectType() == "Texture")) then - - layer = region:GetDrawLayer() - texture = region:GetTexture() - - if(option) then - if(type(option) == "boolean") then - if region.UnregisterAllEvents then - region:UnregisterAllEvents() - region:SetParent(_purgatory) - else - region.Show = region.Hide - end - region:Hide() - elseif(type(option) == "string" and ((layer == option) or (texture ~= option))) then - region:SetTexture(0,0,0,0) - end - else - region:SetTexture(0,0,0,0) - end - end - end -end ---[[ -########################################################## -APPENDED FONT TEMPLATING METHODS -########################################################## -]]-- -local function FontManager(self, font, fontSize, fontStyle, fontJustifyH, fontJustifyV, noUpdate) - if not self then return end - local STANDARDFONTSIZE = SV.db.media.fonts and SV.db.media.fonts.size or 12 - font = font or [[Interface\AddOns\SVUI\assets\fonts\Default.ttf]] - fontSize = fontSize or STANDARDFONTSIZE; - fontJustifyH = fontJustifyH or "CENTER"; - fontJustifyV = fontJustifyV or "MIDDLE"; - if not font then return end - self.font = font; - self.fontSize = fontSize; - self.fontStyle = fontStyle; - self.fontJustifyH = fontJustifyH; - self.fontJustifyV = fontJustifyV; - self:SetFont(font, fontSize, fontStyle) - if(fontStyle and fontStyle ~= "NONE") then - self:SetShadowColor(0, 0, 0, 0) - else - self:SetShadowColor(0, 0, 0, 0.2) - end - self:SetShadowOffset(1, -1) - self:SetJustifyH(fontJustifyH) - self:SetJustifyV(fontJustifyV) - self.useCommon = fontSize and (fontSize == STANDARDFONTSIZE); - if(not noUpdate) then - ManagedFonts[self] = true - end -end ---[[ -########################################################## -FONT UPDATE CALLBACK -########################################################## -]]-- -local function UpdateManagedFonts() - local STANDARDFONTSIZE = SV.db.media.fonts.size; - for i=1, #ManagedFonts do - local frame = ManagedFonts[i] - if frame then - local fontSize = frame.useCommon and STANDARDFONTSIZE or frame.fontSize - frame:SetFont(frame.font, fontSize, frame.fontStyle) - else - ManagedFonts[i] = nil - end - end -end - -SV.UpdateManagedFonts = UpdateManagedFonts - -LibSuperVillain("Registry"):NewCallback("CORE_MEDIA_UPDATED", "FontTemplateUpdates", FontTemplateUpdates); ---[[ -########################################################## -ENUMERATION -########################################################## -]]-- -local function AppendMethods(OBJECT) - local META = getmetatable(OBJECT).__index - if not OBJECT.Size then META.Size = SizeScaled end - if not OBJECT.Width then META.Width = WidthScaled end - if not OBJECT.Height then META.Height = HeightScaled end - if not OBJECT.Point then META.Point = PointScaled end - if not OBJECT.WrapOuter then META.WrapOuter = WrapOuter end - if not OBJECT.FillInner then META.FillInner = FillInner end - if not OBJECT.Die then META.Die = Die end - if not OBJECT.RemoveTextures then META.RemoveTextures = RemoveTextures end - if not OBJECT.FontManager then META.FontManager = FontManager end -end - -local HANDLER, OBJECT = {["Frame"] = true}, CreateFrame("Frame") -AppendMethods(OBJECT) -AppendMethods(OBJECT:CreateTexture()) -AppendMethods(OBJECT:CreateFontString()) - -OBJECT = EnumerateFrames() -while OBJECT do - local objType = OBJECT:GetObjectType() - if not HANDLER[objType] then - AppendMethods(OBJECT) - HANDLER[objType] = true - end - OBJECT = EnumerateFrames(OBJECT) -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/api/api_style.lua b/Interface/AddOns/SVUI/framework/api/api_style.lua new file mode 100644 index 0000000..c63a31b --- /dev/null +++ b/Interface/AddOns/SVUI/framework/api/api_style.lua @@ -0,0 +1,960 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local table = _G.table; +local string = _G.string; +local math = _G.math; +--[[ MATH METHODS ]]-- +local floor, abs, min, max = math.floor, math.abs, math.min, math.max; +local parsefloat, ceil = math.parsefloat, math.ceil; +--[[ STRING METHODS ]]-- +local lower = string.lower; +--[[ TABLE METHODS ]]-- +local tremove, tcopy, twipe, tsort, tconcat, tdump = table.remove, table.copy, table.wipe, table.sort, table.concat, table.dump; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local SVLib = LibSuperVillain("Registry"); +local STANDARD_TEXT_FONT = _G.STANDARD_TEXT_FONT; +--[[ +########################################################## +TEMPLATE LOOKUP TABLES +########################################################## +]]-- +local XML_TEMPLATE = { + ["Default"] = "SVUI_PanelTemplate_Default", + ["Transparent"] = "SVUI_PanelTemplate_Transparent", + ["Component"] = "SVUI_PanelTemplate_Component", + ["Headline"] = "SVUI_PanelTemplate_Headline", + ["Button"] = "SVUI_PanelTemplate_Button", + ["FramedTop"] = "SVUI_PanelTemplate_FramedTop", + ["FramedBottom"] = "SVUI_PanelTemplate_FramedBottom", + ["Bar"] = "SVUI_PanelTemplate_Bar", + ["Slot"] = "SVUI_PanelTemplate_Slot", + ["Icon"] = "SVUI_PanelTemplate_Icon", + ["Inset"] = "SVUI_PanelTemplate_Inset", + ["Comic"] = "SVUI_PanelTemplate_Comic", + ["Model"] = "SVUI_PanelTemplate_Model", + ["ModelBorder"] = "SVUI_PanelTemplate_ModelBorder", + ["Paper"] = "SVUI_PanelTemplate_Paper", + ["Container"] = "SVUI_PanelTemplate_Container", + ["Pattern"] = "SVUI_PanelTemplate_Pattern", + ["Halftone"] = "SVUI_PanelTemplate_Halftone", + ["Action"] = "SVUI_PanelTemplate_Action", + ["Blackout"] = "SVUI_PanelTemplate_Blackout", + ["UnitLarge"] = "SVUI_PanelTemplate_UnitLarge", + ["UnitSmall"] = "SVUI_PanelTemplate_UnitSmall" +}; +--[[ +########################################################## +INTERNAL HANDLERS +########################################################## +]]-- +local HookPanelBorderColor = function(self,r,g,b,a) + if self.BorderLeft then + self.BorderLeft:SetVertexColor(r,g,b,a) + self.BorderRight:SetVertexColor(r,g,b,a) + self.BorderTop:SetVertexColor(r,g,b,a) + self.BorderBottom:SetVertexColor(r,g,b,a) + end + if self.Shadow then + local alpha = self.Shadow:GetAttribute("shadowAlpha") or 0.5 + self.Shadow:SetBackdropBorderColor(r,g,b,alpha) + end +end + +local HookBackdrop = function(self,...) + if(self.Panel) then + self.Panel:SetBackdrop(...) + end +end + +local HookBackdropColor = function(self,...) + if(self.Panel) then + self.Panel:SetBackdropColor(...) + end +end + +local HookBackdropBorderColor = function(self,...) + if(self.Panel) then + self.Panel:SetBackdropBorderColor(...) + end +end + +local HookVertexColor = function(self,...) + if(self.Panel) then + self.Panel.Skin:SetVertexColor(...) + end +end + +local HookCustomBackdrop = function(self) + if(self.Panel) then + local bgid = self.Panel:GetAttribute("panelID") + local newBgFile = SV.Media.bg[bgid] + local bd = { + bgFile = newBgFile, + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 2, + insets = + { + left = 2, + right = 2, + top = 2, + bottom = 2, + }, + } + self:SetBackdrop(bd) + end +end + +local HookFrameLevel = function(self, level) + if(self.Panel) then + local adjustment = level - 1; + if(adjustment < 0) then adjustment = 0 end + self.Panel:SetFrameLevel(adjustment) + end +end + +local Cooldown_ForceUpdate = function(self) + self.nextUpdate = 0; + self:Show() +end + +local Cooldown_StopTimer = function(self) + self.enable = nil; + self:Hide() +end + +local Cooldown_OnUpdate = function(self, elapsed) + if self.nextUpdate > 0 then + self.nextUpdate = self.nextUpdate - elapsed; + return + end + local expires = (self.duration - (GetTime() - self.start)); + if expires > 0.05 then + if (self.fontScale * self:GetEffectiveScale() / UIParent:GetScale()) < 0.5 then + self.text:SetText('') + self.nextUpdate = 500 + else + local timeLeft = 0; + local calc = 0; + if expires < 4 then + self.nextUpdate = 0.051 + self.text:SetFormattedText("|cffff0000%.1f|r", expires) + elseif expires < 60 then + self.nextUpdate = 0.51 + self.text:SetFormattedText("|cffffff00%d|r", floor(expires)) + elseif expires < 3600 then + timeLeft = ceil(expires / 60); + calc = floor((expires / 60) + .5); + self.nextUpdate = calc > 1 and ((expires - calc) * 29.5) or (expires - 59.5); + self.text:SetFormattedText("|cffffffff%dm|r", timeLeft) + elseif expires < 86400 then + timeLeft = ceil(expires / 3600); + calc = floor((expires / 3600) + .5); + self.nextUpdate = calc > 1 and ((expires - calc) * 1799.5) or (expires - 3570); + self.text:SetFormattedText("|cff66ffff%dh|r", timeLeft) + else + timeLeft = ceil(expires / 86400); + calc = floor((expires / 86400) + .5); + self.nextUpdate = calc > 1 and ((expires - calc) * 43199.5) or (expires - 86400); + self.text:SetFormattedText("|cff6666ff%dd|r", timeLeft) + end + end + else + Cooldown_StopTimer(self) + end +end + +local Cooldown_OnSizeChanged = function(self, width, height) + local frame = self.timer + local override = self.SizeOverride + local newSize = floor(width + .5) / 36; + override = override or frame:GetParent():GetParent().SizeOverride; + if override then + newSize = override / 20 + end + if newSize == frame.fontScale then + return + end + frame.fontScale = newSize; + if newSize < 0.5 and not override then + frame:Hide() + else + frame:Show() + frame.text:SetFont([[Interface\AddOns\SVUI\assets\fonts\Numbers.ttf]], newSize * 15, 'OUTLINE') + if frame.enable then + Cooldown_ForceUpdate(frame) + end + end +end + +local CreateCooldownTimer = function(self) + local timer = CreateFrame('Frame', nil, self) + timer:SetAllPoints() + timer:SetScript('OnUpdate', Cooldown_OnUpdate) + + local timeText = timer:CreateFontString(nil,'OVERLAY') + timeText:SetPoint('CENTER',1,1) + timeText:SetJustifyH("CENTER") + timer.text = timeText; + + timer:Hide() + + self.timer = timer; + + local width, height = self:GetSize() + Cooldown_OnSizeChanged(self, width, height) + self:SetScript('OnSizeChanged', Cooldown_OnSizeChanged) + + return self.timer +end + +local _hook_Cooldown_SetCooldown = function(self, start, duration, elapsed) + if start > 0 and duration > 2.5 then + local timer = self.timer or CreateCooldownTimer(self) + timer.start = start; + timer.duration = duration; + timer.enable = true; + timer.nextUpdate = 0; + + if timer.fontScale >= 0.5 then + timer:Show() + end + else + local timer = self.timer; + if timer then + Cooldown_StopTimer(timer) + end + end + if self.timer then + if elapsed and elapsed > 0 then + self.timer:SetAlpha(0) + else + self.timer:SetAlpha(0.8) + end + end +end + +local SetFrameBorderColor = function(self, r, g, b, setPrevious, reset) + if(setPrevious) then + self.__border.__previous = setPrevious + elseif(reset) then + r,g,b = unpack(SV.Media.color[self.__border.__previous]) + end + self.__border[1]:SetTexture(r, g, b) + self.__border[2]:SetTexture(r, g, b) + self.__border[3]:SetTexture(r, g, b) + self.__border[4]:SetTexture(r, g, b) +end + +local ShowAlertFlash = function(self) + self:ColorBorder(1,0.9,0) + SV.Animate:Flash(self.__border, 0.75, true) +end + +local HideAlertFlash = function(self) + SV.Animate:StopFlash(self.__border) + self:ColorBorder(1,0.9,0, nil, true) +end +--[[ +########################################################## +TEMPLATE HELPERS +########################################################## +]]-- +local function CreateCooldown(button, muted) + local cooldown = button:GetName() and _G[button:GetName().."Cooldown"] + if(cooldown) then + if(not SV.db.general or (SV.db.general and (not SV.db.general.cooldown))) then return end + cooldown:ClearAllPoints() + cooldown:SetAllPointsIn() + cooldown:SetDrawEdge(false) + if(not muted) then + cooldown:SetSwipeColor(0, 0, 0, 1) + end + + if(not cooldown.HookedCooldown) then + hooksecurefunc(cooldown, "SetCooldown", _hook_Cooldown_SetCooldown) + cooldown.HookedCooldown = true + end + end +end + +local function CreatePanelTemplate(frame, templateName, underlay, noupdate, padding, xOffset, yOffset, defaultColor) + local xmlTemplate = XML_TEMPLATE[templateName] or "SVUI_PanelTemplate_Default" + local borderColor = {0,0,0,1} + + frame.Panel = CreateFrame('Frame', nil, frame, xmlTemplate) + + local level = frame:GetFrameLevel() + if(level == 0 and not InCombatLockdown()) then + frame:SetFrameLevel(1) + level = 1 + end + + local adjustment = level - 1; + + if(adjustment < 0) then adjustment = 0 end + + frame.Panel:SetFrameLevel(adjustment) + + hooksecurefunc(frame, "SetFrameLevel", HookFrameLevel) + + if(defaultColor) then + frame.Panel:SetAttribute("panelColor", defaultColor) + end + if(noupdate) then + frame.Panel:SetAttribute("panelSkipUpdate", noupdate) + end + + local colorName = frame.Panel:GetAttribute("panelColor") + local gradientName = frame.Panel:GetAttribute("panelGradient") + local forcedOffset = frame.Panel:GetAttribute("panelOffset") + + xOffset = forcedOffset or xOffset or 1 + yOffset = forcedOffset or yOffset or 1 + + frame.Panel:SetAllPointsOut(frame, xOffset, yOffset) + + padding = padding or frame.Panel:GetAttribute("panelPadding") + + if(padding and frame.Panel.BorderLeft) then + frame.Panel.BorderLeft:SetWidth(padding) + frame.Panel.BorderRight:SetWidth(padding) + frame.Panel.BorderTop:SetHeight(padding) + frame.Panel.BorderBottom:SetHeight(padding) + end + + if(frame.Panel.Shadow) then + frame.Panel.Shadow:SetPoint('TOPLEFT', frame.Panel, 'TOPLEFT', -3, 3) + frame.Panel.Shadow:SetPoint('BOTTOMRIGHT', frame.Panel, 'BOTTOMRIGHT', 3, -3) + + local alpha = frame.Panel.Shadow:GetAttribute("shadowAlpha") or 0.5 + frame.Panel.Shadow:SetBackdropBorderColor(0,0,0,alpha) + + local level = frame.Panel.Shadow:GetFrameLevel() - 1 + if(level >= 0) then + frame.Panel.Shadow:SetFrameLevel(level) + else + frame.Panel.Shadow:SetFrameLevel(0) + end + end + + local bgColor = SV.Media.color[colorName] or {0.18,0.18,0.18,1} + + if(not frame.Panel:GetAttribute("panelNoBackdrop")) then + if(underlay) then + frame.Panel:SetBackdropColor(bgColor[1],bgColor[2],bgColor[3],bgColor[4] or 1) + frame.Panel:SetBackdropBorderColor(0,0,0,1) + else + local bd = frame.Panel:GetBackdrop() + frame:SetBackdrop(bd) + frame:SetBackdropColor(bgColor[1],bgColor[2],bgColor[3],bgColor[4] or 1) + frame:SetBackdropBorderColor(0,0,0,1) + + frame.Panel:SetBackdrop(nil) + end + + if(templateName ~= 'Transparent') then + hooksecurefunc(frame.Panel, "SetBackdropBorderColor", HookPanelBorderColor) + hooksecurefunc(frame, "SetBackdropBorderColor", HookBackdropBorderColor) + if(underlay) then + frame:SetBackdrop(nil) + frame.SetBackdrop = frame.Panel.SetBackdrop + --hooksecurefunc(frame, "SetBackdrop", HookBackdrop) + hooksecurefunc(frame, "SetBackdropColor", HookBackdropColor) + end + frame.BackdropNeedsUpdate = true + if(templateName == 'Pattern' or templateName == 'Comic') then + frame.UpdateBackdrop = HookCustomBackdrop + end + end + end + + if(frame.Panel.Skin) then + if(not underlay) then + frame.Panel.Skin:SetParent(frame) + frame.Panel.Skin:SetAllPointsIn(frame, xOffset, yOffset) + else + frame.Panel.Skin:SetAllPointsIn(frame.Panel, xOffset, yOffset) + end + if(gradientName and SV.Media.gradient[gradientName]) then + frame.Panel.Skin:SetGradient(unpack(SV.Media.gradient[gradientName])) + else + frame.Panel.Skin:SetVertexColor(bgColor[1], bgColor[2], bgColor[3], bgColor[4] or 1) + end + + if((not frame.Panel:GetAttribute("panelSkipUpdate")) and frame.Panel:GetAttribute("panelTexUpdate")) then + frame.TextureNeedsUpdate = true + if(templateName == 'UnitLarge' or templateName == 'UnitSmall') then + frame.UpdateColor = HookVertexColor + frame.NoColorUpdate = true + end + end + end +end + +local function CreateButtonPanel(frame, noChecked, brightChecked, mutedCooldown) + + if(frame.Left) then + frame.Left:SetAlpha(0) + end + + if(frame.Middle) then + frame.Middle:SetAlpha(0) + end + + if(frame.Right) then + frame.Right:SetAlpha(0) + end + + if(frame.SetNormalTexture) then + frame:SetNormalTexture("") + end + + if(frame.SetDisabledTexture) then + frame:SetDisabledTexture("") + end + + if(frame.SetCheckedTexture) then + frame:SetCheckedTexture("") + end + + if(frame.SetHighlightTexture) then + if(not frame.hover) then + local hover = frame:CreateTexture(nil, "OVERLAY") + hover:SetAllPointsIn(frame.Panel) + frame.hover = hover; + end + local color = SV.Media.color.highlight + frame.hover:SetTexture(color[1], color[2], color[3], 0.5) + frame:SetHighlightTexture(frame.hover) + end + + if(frame.SetPushedTexture) then + if(not frame.pushed) then + local pushed = frame:CreateTexture(nil, "OVERLAY") + pushed:SetAllPointsIn(frame.Panel) + frame.pushed = pushed; + end + frame.pushed:SetTexture(0.1, 0.8, 0.1, 0.3) + frame:SetPushedTexture(frame.pushed) + end + + if(not noChecked and frame.SetCheckedTexture) then + if(not frame.checked) then + local checked = frame:CreateTexture(nil, "OVERLAY") + checked:SetAllPointsIn(frame.Panel) + frame.checked = checked + end + + if(not brightChecked) then + frame.checked:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) + frame.checked:SetVertexColor(0, 0.5, 0, 0.2) + else + frame.checked:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\GLOSS]]) + frame.checked:SetVertexColor(0, 1, 0, 1) + end + + frame:SetCheckedTexture(frame.checked) + end + + CreateCooldown(frame, mutedCooldown) +end +--[[ +########################################################## +TEMPLATING METHODS +########################################################## +]]-- +local TEMPLATE_METHODS, TEMPLATE_UPDATES = {}, {}; + +TEMPLATE_METHODS["Button"] = function(self, alteration, overridePadding, xOffset, yOffset, keepNormal, defaultColor) + if(not self or (self and self.Panel)) then return end + + local padding = 1 + if(overridePadding and type(overridePadding) == "number") then + padding = overridePadding + end + + local x,y = -1,-1 + local underlay = false + if(xOffset or yOffset) then + x = xOffset or -1 + y = yOffset or -1 + underlay = true + end + + if(alteration and (type(alteration) == 'boolean')) then + CreatePanelTemplate(self, "Headline", underlay, true, padding, x, y, defaultColor) + self:SetBackdropColor(0,0,0,0) + self:SetBackdropBorderColor(0,0,0,0) + + if(self.Panel.BorderLeft) then + self.Panel.BorderLeft:SetVertexColor(0,0,0,0) + self.Panel.BorderRight:SetVertexColor(0,0,0,0) + self.Panel.BorderTop:SetVertexColor(0,0,0,0) + self.Panel.BorderBottom:SetVertexColor(0,0,0,0) + end + elseif(alteration and (type(alteration) == 'string')) then + CreatePanelTemplate(self, alteration, underlay, true, padding, x, y, defaultColor) + else + CreatePanelTemplate(self, "Button", underlay, true, padding, x, y, defaultColor) + end + + if(self.Left) then + self.Left:SetAlpha(0) + end + + if(self.Middle) then + self.Middle:SetAlpha(0) + end + + if(self.Right) then + self.Right:SetAlpha(0) + end + + if(self.SetNormalTexture and not keepNormal) then + self:SetNormalTexture("") + end + + if(self.SetDisabledTexture) then + self:SetDisabledTexture("") + end + + if(self.SetHighlightTexture) then + if(not self.hover) then + local hover = self:CreateTexture(nil, "HIGHLIGHT") + hover:SetAllPointsIn(self.Panel, 2, 2) + self.hover = hover; + end + self.hover:SetTexture(0.1, 0.8, 0.8, 0.5) + self:SetHighlightTexture(self.hover) + end + + if(self.SetPushedTexture) then + if(not self.pushed) then + local pushed = self:CreateTexture(nil, "OVERLAY") + pushed:SetAllPointsIn(self.Panel) + self.pushed = pushed; + end + + self.pushed:SetTexture(0.1, 0.8, 0.1, 0.3) + + self:SetPushedTexture(self.pushed) + end + + if(self.SetCheckedTexture) then + if(not self.checked) then + local checked = self:CreateTexture(nil, "OVERLAY") + checked:SetAllPointsIn(self.Panel) + self.checked = checked; + end + + self.checked:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) + self.checked:SetVertexColor(0, 0.5, 0, 0.2) + + self:SetCheckedTexture(self.checked) + end + + CreateCooldown(self) +end; + +TEMPLATE_METHODS["Slot"] = function(self, underlay, padding, x, y, shadowAlpha, mutedCooldown) + if(not self or (self and self.Panel)) then return end + padding = padding or 1 + CreatePanelTemplate(self, "Slot", underlay, true, padding, x, y) + CreateButtonPanel(self, true, nil, mutedCooldown) + if(shadowAlpha) then + self.Panel.Shadow:SetAttribute("shadowAlpha", shadowAlpha) + end +end; + +TEMPLATE_METHODS["Icon"] = function(self, underlay, padding, x, y, shadowAlpha, mutedCooldown) + if(not self or (self and self.Panel)) then return end + padding = padding or 1 + CreatePanelTemplate(self, "Icon", false, true, padding, x, y) + CreateButtonPanel(self, true, nil, mutedCooldown) + if(shadowAlpha) then + self.Panel.Shadow:SetAttribute("shadowAlpha", shadowAlpha) + end +end; + +TEMPLATE_METHODS["Checkbox"] = function(self, shrink, x, y) + if(not self or (self and self.Panel)) then return end + + local width, height = self:GetSize() + if(shrink) then + x = x or -2 + y = y or -2 + end + + width = width + (x or 0) + height = height + (y or 0) + + self:SetSize(width, height) + + CreatePanelTemplate(self, "Inset", true, true, 1, x, y) + + if(self.SetNormalTexture) then + self:SetNormalTexture("") + end + + if(self.SetPushedTexture) then + self:SetPushedTexture("") + end + + if(self.SetHighlightTexture) then + if(not self.hover) then + local hover = self:CreateTexture(nil, "OVERLAY") + hover:SetAllPointsIn(self.Panel) + self.hover = hover; + end + local color = SV.Media.color.highlight + self.hover:SetTexture(color[1], color[2], color[3], 0.5) + self:SetHighlightTexture(self.hover) + end + + if(self.SetCheckedTexture) then + self:SetCheckedTexture([[Interface\Buttons\UI-CheckBox-Check]]) + end + + if(self.SetDisabledCheckedTexture) then + self:SetDisabledCheckedTexture([[Interface\Buttons\UI-CheckBox-Check-Disabled]]) + end +end; + +TEMPLATE_METHODS["Colored"] = function(self, underlay, x, y) + if(not self or (self and self.Panel)) then return end + + if(underlay) then + x = x or -7 + y = y or -7 + end + + CreatePanelTemplate(self, "Slot", underlay, true, 1, x, y) + CreateButtonPanel(self, false, true) + + hooksecurefunc(self, "SetChecked", function(self,checked) + local r,g,b = 0,0,0 + if(checked) then + r,g,b = self:GetCheckedTexture():GetVertexColor() + end + self:SetBackdropBorderColor(r,g,b) + end) +end; + +TEMPLATE_METHODS["Editbox"] = function(self, x, y, fixed) + if(not self or (self and self.Panel)) then return end + + if self.TopLeftTex then self.TopLeftTex:Die() end + if self.TopRightTex then self.TopRightTex:Die() end + if self.TopTex then self.TopTex:Die() end + if self.BottomLeftTex then self.BottomLeftTex:Die() end + if self.BottomRightTex then self.BottomRightTex:Die() end + if self.BottomTex then self.BottomTex:Die() end + if self.LeftTex then self.LeftTex:Die() end + if self.RightTex then self.RightTex:Die() end + if self.MiddleTex then self.MiddleTex:Die() end + local underlay = true + if(fixed ~= nil) then underlay = fixed end + CreatePanelTemplate(self, "Inset", underlay, true, 1, x, y) + + local globalName = self:GetName(); + if globalName then + if _G[globalName.."Left"] then _G[globalName.."Left"]:Die() end + if _G[globalName.."Middle"] then _G[globalName.."Middle"]:Die() end + if _G[globalName.."Right"] then _G[globalName.."Right"]:Die() end + if _G[globalName.."Mid"] then _G[globalName.."Mid"]:Die() end + + if globalName:find("Silver") or globalName:find("Copper") or globalName:find("Gold") then + self.Panel:SetPoint("TOPLEFT", -3, 1) + if globalName:find("Silver") or globalName:find("Copper") then + self.Panel:SetPoint("BOTTOMRIGHT", -12, -2) + else + self.Panel:SetPoint("BOTTOMRIGHT", -2, -2) + end + end + end +end; + +TEMPLATE_METHODS["Framed"] = function(self, template, borderSize) + if(not self or (self and self.Panel)) then return end + + borderSize = borderSize or 2 + + template = template or "FramedBottom" + + CreatePanelTemplate(self, template, false, false, 0, -borderSize, -borderSize) + + if(self.Left) then + self.Left:SetAlpha(0) + end + + if(self.Middle) then + self.Middle:SetAlpha(0) + end + + if(self.Right) then + self.Right:SetAlpha(0) + end + + if(self.SetNormalTexture) then + self:SetNormalTexture("") + end + + if(self.SetDisabledTexture) then + self:SetDisabledTexture("") + end + + if(not self.__border) then + local t = SV.Media.color.default + local r,g,b = t[1], t[2], t[3] + + local border = CreateFrame("Frame", nil, self) + border:SetAllPoints() + + border[1] = border:CreateTexture(nil,"BORDER") + border[1]:SetTexture(r,g,b) + border[1]:SetPoint("TOPLEFT", -1, 1) + border[1]:SetPoint("BOTTOMLEFT", -1, -1) + border[1]:SetWidth(borderSize) + + local leftoutline = border:CreateTexture(nil,"BORDER") + leftoutline:SetTexture(0,0,0) + leftoutline:SetPoint("TOPLEFT", -2, 2) + leftoutline:SetPoint("BOTTOMLEFT", -2, -2) + leftoutline:SetWidth(1) + + border[2] = border:CreateTexture(nil,"BORDER") + border[2]:SetTexture(r,g,b) + border[2]:SetPoint("TOPRIGHT", 1, 1) + border[2]:SetPoint("BOTTOMRIGHT", 1, -1) + border[2]:SetWidth(borderSize) + + local rightoutline = border:CreateTexture(nil,"BORDER") + rightoutline:SetTexture(0,0,0) + rightoutline:SetPoint("TOPRIGHT", 2, 2) + rightoutline:SetPoint("BOTTOMRIGHT", 2, -2) + rightoutline:SetWidth(1) + + border[3] = border:CreateTexture(nil,"BORDER") + border[3]:SetTexture(r,g,b) + border[3]:SetPoint("TOPLEFT", -1, 1) + border[3]:SetPoint("TOPRIGHT", 1, 1) + border[3]:SetHeight(borderSize) + + local topoutline = border:CreateTexture(nil,"BORDER") + topoutline:SetTexture(0,0,0) + topoutline:SetPoint("TOPLEFT", -2, 2) + topoutline:SetPoint("TOPRIGHT", 2, 2) + topoutline:SetHeight(1) + + border[4] = border:CreateTexture(nil,"BORDER") + border[4]:SetTexture(r,g,b) + border[4]:SetPoint("BOTTOMLEFT", -1, -1) + border[4]:SetPoint("BOTTOMRIGHT", 1, -1) + border[4]:SetHeight(borderSize) + + local bottomoutline = border:CreateTexture(nil,"BORDER") + bottomoutline:SetTexture(0,0,0) + bottomoutline:SetPoint("BOTTOMLEFT", -2, -2) + bottomoutline:SetPoint("BOTTOMRIGHT", 2, -2) + bottomoutline:SetHeight(1) + + self.__border = border + self.__border.__previous = 'default'; + self.ColorBorder = SetFrameBorderColor + self.StartAlert = ShowAlertFlash + self.StopAlert = HideAlertFlash + end + + if(not self.hover) then + self.hover = self:CreateTexture(nil, "HIGHLIGHT") + end + + local color = SV.Media.color.highlight + self.hover:SetTexture(color[1], color[2], color[3], 0.5) + self.hover:SetAllPoints() + if(self.SetHighlightTexture) then + self:SetHighlightTexture(self.hover) + end + + if(not self.__registered) then + TEMPLATE_UPDATES[self] = true + self.__registered = true + end +end; + +TEMPLATE_METHODS["Fixed"] = function(self, templateName, noupdate, overridePadding, xOffset, yOffset, defaultColor) + if(not self or (self and self.Panel)) then return end + local padding = false; + if(overridePadding and type(overridePadding) == "number") then + padding = overridePadding + end + + CreatePanelTemplate(self, templateName, false, noupdate, padding, xOffset, yOffset, defaultColor) + + if(not self.Panel:GetAttribute("panelSkipUpdate") and not self.__registered) then + TEMPLATE_UPDATES[self] = true + self.__registered = true + end +end; + +TEMPLATE_METHODS["Default"] = function(self, templateName, noupdate, overridePadding, xOffset, yOffset, defaultColor) + if(not self or (self and self.Panel)) then return end + local padding = false; + if(overridePadding and type(overridePadding) == "number") then + padding = overridePadding + end + + CreatePanelTemplate(self, templateName, true, noupdate, padding, xOffset, yOffset, defaultColor) + + if(not self.Panel:GetAttribute("panelSkipUpdate") and not self.__registered) then + TEMPLATE_UPDATES[self] = true + self.__registered = true + end +end; +--[[ +########################################################## +UPDATE CALLBACKS +########################################################## +]]-- +local function FrameTemplateUpdates() + for frame in pairs(TEMPLATE_UPDATES) do + if(frame) then + local panelID = frame.Panel:GetAttribute("panelID") + local colorID = frame.Panel:GetAttribute("panelColor") + local panelColor = SV.Media.color[colorID]; + if(frame.BackdropNeedsUpdate) then + if(frame.UpdateBackdrop) then + frame:UpdateBackdrop() + end + if(panelColor) then + frame:SetBackdropColor(panelColor[1], panelColor[2], panelColor[3], panelColor[4] or 1) + end + frame:SetBackdropBorderColor(0,0,0,1) + end + if(frame.TextureNeedsUpdate and frame.Panel.Skin) then + local tex = SV.Media.bg[panelID] + if(tex) then + frame.Panel.Skin:SetTexture(tex) + end + if(not frame.NoColorUpdate) then + local gradient = frame.Panel:GetAttribute("panelGradient") + if(gradient and SV.Media.gradient[gradient]) then + local g = SV.Media.gradient[gradient] + frame.Panel.Skin:SetGradient(g[1], g[2], g[3], g[4], g[5], g[6], g[7]) + elseif(panelColor) then + frame.Panel.Skin:SetVertexColor(panelColor[1], panelColor[2], panelColor[3], panelColor[4] or 1) + end + end + end + end + end +end + +SV.Events:On("SVUI_COLORS_UPDATED", "FrameTemplateUpdates", FrameTemplateUpdates); +--[[ +########################################################## +TEMPLATE API +########################################################## +]]-- +local SetPanelColor = function(self, ...) + local arg1,arg2,arg3,arg4,arg5,arg6,arg7 = select(1, ...) + if(not self.Panel or not arg1) then return; end + if(self.Panel.Skin and self.Panel:GetAttribute("panelGradient")) then + if(type(arg1) == "string") then + if(arg1 == "VERTICAL" or arg1 == "HORIZONTAL") then + self.Panel.Skin:SetGradient(...) + elseif(SV.Media.gradient[arg1]) then + if self.ColorBorder then + local d,r,g,b,r2,g2,b2 = unpack(SV.Media.gradient[arg1]) + --self.Panel.Skin:SetGradient(d,r,g,b,r2,g2,b2) + self:ColorBorder(r2,g2,b2,arg1) + else + self.Panel.Skin:SetGradient(unpack(SV.Media.gradient[arg1])) + if(SV.Media.color[arg1]) then + local t = SV.Media.color[arg1] + local r,g,b,a = t[1], t[2], t[3], t[4] or 1; + self:SetBackdropColor(r,g,b,a) + end + end + end + end + elseif(type(arg1) == "string" and SV.Media.color[arg1]) then + local t = SV.Media.color[arg1] + local r,g,b,a = t[1], t[2], t[3], t[4] or 1; + if self.ColorBorder then + self:ColorBorder(r,g,b,arg1) + else + self:SetBackdropColor(r,g,b) + end + elseif(arg1 and type(arg1) == "number") then + self:SetBackdropColor(...) + end +end + +local SetStylePanel = function(self, method, ...) + if(not self or (self and self.Panel)) then return end + method = method or "Default"; + if(TEMPLATE_METHODS[method]) then + TEMPLATE_METHODS[method](self, ...) + end +end +--[[ +########################################################## +ENUMERATION +########################################################## +]]-- +local function AppendMethods(OBJECT) + local META = getmetatable(OBJECT).__index + if not OBJECT.SetStylePanel then META.SetStylePanel = SetStylePanel end + if not OBJECT.SetPanelColor then META.SetPanelColor = SetPanelColor end +end + +local HANDLER, OBJECT = {["Frame"] = true}, CreateFrame("Frame") +AppendMethods(OBJECT) +-- AppendMethods(OBJECT:CreateTexture()) +-- AppendMethods(OBJECT:CreateFontString()) + +OBJECT = EnumerateFrames() +while OBJECT do + local objType = OBJECT:GetObjectType() + if not HANDLER[objType] then + AppendMethods(OBJECT) + HANDLER[objType] = true + end + OBJECT = EnumerateFrames(OBJECT) +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/api/api_templates.lua b/Interface/AddOns/SVUI/framework/api/api_templates.lua deleted file mode 100644 index e854461..0000000 --- a/Interface/AddOns/SVUI/framework/api/api_templates.lua +++ /dev/null @@ -1,1029 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local table = _G.table; -local string = _G.string; -local math = _G.math; ---[[ MATH METHODS ]]-- -local floor, abs, min, max = math.floor, math.abs, math.min, math.max; -local parsefloat, ceil = math.parsefloat, math.ceil; ---[[ STRING METHODS ]]-- -local lower = string.lower; ---[[ TABLE METHODS ]]-- -local tremove, tcopy, twipe, tsort, tconcat, tdump = table.remove, table.copy, table.wipe, table.sort, table.concat, table.dump; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L -local SVLib = LibSuperVillain("Registry"); ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local TemplateUpdateFrames = {}; ---[[ -########################################################## -XML TEMPLATE LOOKUP TABLE -########################################################## -]]-- -local XML_LOOKUP = { - ["Default"] = "SVUI_PanelTemplate_Default", - ["Transparent"] = "SVUI_PanelTemplate_Transparent", - ["Component"] = "SVUI_PanelTemplate_Component", - ["Headline"] = "SVUI_PanelTemplate_Headline", - ["Button"] = "SVUI_PanelTemplate_Button", - ["FramedTop"] = "SVUI_PanelTemplate_FramedTop", - ["FramedBottom"] = "SVUI_PanelTemplate_FramedBottom", - ["Bar"] = "SVUI_PanelTemplate_Bar", - ["Slot"] = "SVUI_PanelTemplate_Slot", - ["Inset"] = "SVUI_PanelTemplate_Inset", - ["Comic"] = "SVUI_PanelTemplate_Comic", - ["Model"] = "SVUI_PanelTemplate_Model", - ["ModelBorder"] = "SVUI_PanelTemplate_ModelBorder", - ["Paper"] = "SVUI_PanelTemplate_Paper", - ["Container"] = "SVUI_PanelTemplate_Container", - ["Pattern"] = "SVUI_PanelTemplate_Pattern", - ["Halftone"] = "SVUI_PanelTemplate_Halftone", - ["Action"] = "SVUI_PanelTemplate_Action", - ["Blackout"] = "SVUI_PanelTemplate_Blackout", - ["UnitLarge"] = "SVUI_PanelTemplate_UnitLarge", - ["UnitSmall"] = "SVUI_PanelTemplate_UnitSmall" -}; ---[[ -########################################################## -INTERNAL HANDLERS -########################################################## -]]-- -local HookPanelBorderColor = function(self,r,g,b,a) - if self.BorderLeft then - self.BorderLeft:SetVertexColor(r,g,b,a) - self.BorderRight:SetVertexColor(r,g,b,a) - self.BorderTop:SetVertexColor(r,g,b,a) - self.BorderBottom:SetVertexColor(r,g,b,a) - end - if self.Shadow then - local alpha = self.Shadow:GetAttribute("shadowAlpha") or 0.5 - self.Shadow:SetBackdropBorderColor(r,g,b,alpha) - end -end - -local HookBackdrop = function(self,...) - if(self.Panel) then - self.Panel:SetBackdrop(...) - end -end - -local HookBackdropColor = function(self,...) - if(self.Panel) then - self.Panel:SetBackdropColor(...) - end -end - -local HookBackdropBorderColor = function(self,...) - if(self.Panel) then - self.Panel:SetBackdropBorderColor(...) - end -end - -local HookVertexColor = function(self,...) - if(self.Panel) then - self.Panel.Skin:SetVertexColor(...) - end -end - -local HookCustomBackdrop = function(self) - if(self.Panel) then - local bgid = self.Panel:GetAttribute("panelID") - local newBgFile = SV.Media.bg[bgid] - local bd = { - bgFile = newBgFile, - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 2, - insets = - { - left = 2, - right = 2, - top = 2, - bottom = 2, - }, - } - self:SetBackdrop(bd) - end -end - -local HookFrameLevel = function(self, level) - if(self.Panel) then - local adjustment = level - 1; - if(adjustment < 0) then adjustment = 0 end - self.Panel:SetFrameLevel(adjustment) - end -end - -local Cooldown_ForceUpdate = function(self) - self.nextUpdate = 0; - self:Show() -end - -local Cooldown_StopTimer = function(self) - self.enable = nil; - self:Hide() -end - -local Cooldown_OnUpdate = function(self, elapsed) - if self.nextUpdate > 0 then - self.nextUpdate = self.nextUpdate - elapsed; - return - end - local expires = (self.duration - (GetTime() - self.start)); - if expires > 0.05 then - if (self.fontScale * self:GetEffectiveScale() / UIParent:GetScale()) < 0.5 then - self.text:SetText('') - self.nextUpdate = 500 - else - local timeLeft = 0; - local calc = 0; - if expires < 4 then - self.nextUpdate = 0.051 - self.text:SetFormattedText("|cffff0000%.1f|r", expires) - elseif expires < 60 then - self.nextUpdate = 0.51 - self.text:SetFormattedText("|cffffff00%d|r", floor(expires)) - elseif expires < 3600 then - timeLeft = ceil(expires / 60); - calc = floor((expires / 60) + .5); - self.nextUpdate = calc > 1 and ((expires - calc) * 29.5) or (expires - 59.5); - self.text:SetFormattedText("|cffffffff%dm|r", timeLeft) - elseif expires < 86400 then - timeLeft = ceil(expires / 3600); - calc = floor((expires / 3600) + .5); - self.nextUpdate = calc > 1 and ((expires - calc) * 1799.5) or (expires - 3570); - self.text:SetFormattedText("|cff66ffff%dh|r", timeLeft) - else - timeLeft = ceil(expires / 86400); - calc = floor((expires / 86400) + .5); - self.nextUpdate = calc > 1 and ((expires - calc) * 43199.5) or (expires - 86400); - self.text:SetFormattedText("|cff6666ff%dd|r", timeLeft) - end - end - else - Cooldown_StopTimer(self) - end -end - -local Cooldown_OnSizeChanged = function(self, width, height) - local frame = self.timer - local override = self.SizeOverride - local newSize = floor(width + .5) / 36; - override = override or frame:GetParent():GetParent().SizeOverride; - if override then - newSize = override / 20 - end - if newSize == frame.fontScale then - return - end - frame.fontScale = newSize; - if newSize < 0.5 and not override then - frame:Hide() - else - frame:Show() - frame.text:SetFont([[Interface\AddOns\SVUI\assets\fonts\Numbers.ttf]], newSize * 15, 'OUTLINE') - if frame.enable then - Cooldown_ForceUpdate(frame) - end - end -end - -local function CreateCooldownTimer(frame) - local timer = CreateFrame('Frame', nil, frame) - timer:SetAllPoints() - timer:SetScript('OnUpdate', Cooldown_OnUpdate) - - local timeText = timer:CreateFontString(nil,'OVERLAY') - timeText:SetPoint('CENTER',1,1) - timeText:SetJustifyH("CENTER") - timer.text = timeText; - - timer:Hide() - - frame.timer = timer; - - local width, height = frame:GetSize() - Cooldown_OnSizeChanged(frame, width, height) - frame:SetScript('OnSizeChanged', Cooldown_OnSizeChanged) - - return frame.timer -end - -local _hook_Cooldown_SetCooldown = function(self, start, duration, elapsed) - if start > 0 and duration > 2.5 then - local timer = self.timer or CreateCooldownTimer(self) - timer.start = start; - timer.duration = duration; - timer.enable = true; - timer.nextUpdate = 0; - - if timer.fontScale >= 0.5 then - timer:Show() - end - else - local timer = self.timer; - if timer then - Cooldown_StopTimer(timer) - end - end - if self.timer then - if elapsed and elapsed > 0 then - self.timer:SetAlpha(0) - else - self.timer:SetAlpha(0.8) - end - end -end ---[[ -########################################################## -COOLDOWN HELPER -########################################################## -]]-- -local function CreateCooldown(button, muted) - local cooldown = button:GetName() and _G[button:GetName().."Cooldown"] - if(cooldown) then - if(not SV.db.general or (SV.db.general and (not SV.db.general.cooldown))) then return end - cooldown:ClearAllPoints() - cooldown:FillInner() - cooldown:SetDrawEdge(false) - if(not muted) then - cooldown:SetSwipeColor(0, 0, 0, 1) - end - - if(not cooldown.HookedCooldown) then - hooksecurefunc(cooldown, "SetCooldown", _hook_Cooldown_SetCooldown) - cooldown.HookedCooldown = true - end - end -end ---[[ -########################################################## -TEMPLATE HELPERS -########################################################## -]]-- -local function CreatePanelTemplate(frame, templateName, underlay, noupdate, padding, xOffset, yOffset, defaultColor) - local xmlTemplate = XML_LOOKUP[templateName] or "SVUI_PanelTemplate_Default" - local borderColor = {0,0,0,1} - - frame.Panel = CreateFrame('Frame', nil, frame, xmlTemplate) - - local level = frame:GetFrameLevel() - if(level == 0 and not InCombatLockdown()) then - frame:SetFrameLevel(1) - level = 1 - end - - local adjustment = level - 1; - - if(adjustment < 0) then adjustment = 0 end - - frame.Panel:SetFrameLevel(adjustment) - - hooksecurefunc(frame, "SetFrameLevel", HookFrameLevel) - - if(defaultColor) then - frame.Panel:SetAttribute("panelColor", defaultColor) - end - if(noupdate) then - frame.Panel:SetAttribute("panelSkipUpdate", noupdate) - end - - local colorName = frame.Panel:GetAttribute("panelColor") - local gradientName = frame.Panel:GetAttribute("panelGradient") - local forcedOffset = frame.Panel:GetAttribute("panelOffset") - - xOffset = forcedOffset or xOffset or 1 - yOffset = forcedOffset or yOffset or 1 - - frame.Panel:WrapOuter(frame, xOffset, yOffset) - - padding = padding or frame.Panel:GetAttribute("panelPadding") - - if(padding and frame.Panel.BorderLeft) then - frame.Panel.BorderLeft:SetWidth(padding) - frame.Panel.BorderRight:SetWidth(padding) - frame.Panel.BorderTop:SetHeight(padding) - frame.Panel.BorderBottom:SetHeight(padding) - end - - if(frame.Panel.Shadow) then - frame.Panel.Shadow:SetPoint('TOPLEFT', frame.Panel, 'TOPLEFT', -3, 3) - frame.Panel.Shadow:SetPoint('BOTTOMRIGHT', frame.Panel, 'BOTTOMRIGHT', 3, -3) - - local alpha = frame.Panel.Shadow:GetAttribute("shadowAlpha") or 0.5 - frame.Panel.Shadow:SetBackdropBorderColor(0,0,0,alpha) - - local level = frame.Panel.Shadow:GetFrameLevel() - 1 - if(level >= 0) then - frame.Panel.Shadow:SetFrameLevel(level) - else - frame.Panel.Shadow:SetFrameLevel(0) - end - end - - local bgColor = SV.Media.color[colorName] or {0.18,0.18,0.18,1} - - if(not frame.Panel:GetAttribute("panelNoBackdrop")) then - if(underlay) then - frame.Panel:SetBackdropColor(bgColor[1],bgColor[2],bgColor[3],bgColor[4] or 1) - frame.Panel:SetBackdropBorderColor(0,0,0,1) - else - local bd = frame.Panel:GetBackdrop() - frame:SetBackdrop(bd) - frame:SetBackdropColor(bgColor[1],bgColor[2],bgColor[3],bgColor[4] or 1) - frame:SetBackdropBorderColor(0,0,0,1) - - frame.Panel:SetBackdrop(nil) - end - - if(templateName ~= 'Transparent') then - hooksecurefunc(frame.Panel, "SetBackdropBorderColor", HookPanelBorderColor) - hooksecurefunc(frame, "SetBackdropBorderColor", HookBackdropBorderColor) - if(underlay) then - frame:SetBackdrop(nil) - frame.SetBackdrop = frame.Panel.SetBackdrop - --hooksecurefunc(frame, "SetBackdrop", HookBackdrop) - hooksecurefunc(frame, "SetBackdropColor", HookBackdropColor) - end - frame.BackdropNeedsUpdate = true - if(templateName == 'Pattern' or templateName == 'Comic') then - frame.UpdateBackdrop = HookCustomBackdrop - end - end - end - - if(frame.Panel.Skin) then - if(not underlay) then - frame.Panel.Skin:SetParent(frame) - frame.Panel.Skin:FillInner(frame, xOffset, yOffset) - else - frame.Panel.Skin:FillInner(frame.Panel, xOffset, yOffset) - end - if(gradientName and SV.Media.gradient[gradientName]) then - frame.Panel.Skin:SetGradient(unpack(SV.Media.gradient[gradientName])) - else - frame.Panel.Skin:SetVertexColor(bgColor[1], bgColor[2], bgColor[3], bgColor[4] or 1) - end - - if((not frame.Panel:GetAttribute("panelSkipUpdate")) and frame.Panel:GetAttribute("panelTexUpdate")) then - frame.TextureNeedsUpdate = true - if(templateName == 'UnitLarge' or templateName == 'UnitSmall') then - frame.UpdateColor = HookVertexColor - frame.NoColorUpdate = true - end - end - end -end - -local function CreateButtonPanel(frame, noChecked, brightChecked, mutedCooldown) - - if(frame.Left) then - frame.Left:SetAlpha(0) - end - - if(frame.Middle) then - frame.Middle:SetAlpha(0) - end - - if(frame.Right) then - frame.Right:SetAlpha(0) - end - - if(frame.SetNormalTexture) then - frame:SetNormalTexture("") - end - - if(frame.SetDisabledTexture) then - frame:SetDisabledTexture("") - end - - if(frame.SetCheckedTexture) then - frame:SetCheckedTexture("") - end - - if(frame.SetHighlightTexture) then - if(not frame.hover) then - local hover = frame:CreateTexture(nil, "OVERLAY") - hover:FillInner(frame.Panel) - frame.hover = hover; - end - local color = SV.Media.color.highlight - frame.hover:SetTexture(color[1], color[2], color[3], 0.5) - frame:SetHighlightTexture(frame.hover) - end - - if(frame.SetPushedTexture) then - if(not frame.pushed) then - local pushed = frame:CreateTexture(nil, "OVERLAY") - pushed:FillInner(frame.Panel) - frame.pushed = pushed; - end - frame.pushed:SetTexture(0.1, 0.8, 0.1, 0.3) - frame:SetPushedTexture(frame.pushed) - end - - if(not noChecked and frame.SetCheckedTexture) then - if(not frame.checked) then - local checked = frame:CreateTexture(nil, "OVERLAY") - checked:FillInner(frame.Panel) - frame.checked = checked - end - - if(not brightChecked) then - frame.checked:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - frame.checked:SetVertexColor(0, 0.5, 0, 0.2) - else - frame.checked:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\GLOSS]]) - frame.checked:SetVertexColor(0, 1, 0, 1) - end - - frame:SetCheckedTexture(frame.checked) - end - - CreateCooldown(frame, mutedCooldown) -end ---[[ -########################################################## -TEMPLATE API -########################################################## -]]-- -local function SetBasicPanel(self, topX, topY, bottomX, bottomY, hasShadow) - local needsHooks = false; - - if(hasShadow) then - if(not self.Panel) then - needsHooks = true - - self.Panel = CreateFrame("Frame", nil, self) - self.Panel:SetPoint("TOPLEFT", self, "TOPLEFT", -2, 2) - self.Panel:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 2, -2) - end - - self.Panel:SetBackdrop({ - bgFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], - edgeSize = 3, - insets = - { - left = 0, - right = 0, - top = 0, - bottom = 0, - }, - }) - self.Panel:SetBackdropColor(0,0,0,0) - self.Panel:SetBackdropBorderColor(0,0,0) - else - if(not self.Panel) then - needsHooks = true - - self.Panel = CreateFrame("Frame", nil, self) - self.Panel:SetPoint("TOPLEFT", self, "TOPLEFT", topX, topY) - self.Panel:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", bottomX, bottomY) - end - - self.Panel:SetBackdrop({ - bgFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - edgeSize = 1, - insets = - { - left = 1, - right = 1, - top = 1, - bottom = 1, - }, - }) - self.Panel:SetBackdropColor(0,0,0,0.5) - self.Panel:SetBackdropBorderColor(0,0,0) - end - - if(needsHooks) then - local level = self:GetFrameLevel() - if(level == 0 and not InCombatLockdown()) then - self:SetFrameLevel(1) - level = 1 - end - - local adjustment = level - 1; - if(adjustment < 0) then adjustment = 0 end - - self.Panel:SetFrameLevel(adjustment) - hooksecurefunc(self, "SetFrameLevel", HookFrameLevel) - - self:SetBackdrop(nil) - self.SetBackdrop = self.Panel.SetBackdrop - hooksecurefunc(self, "SetBackdropColor", HookBackdropColor) - hooksecurefunc(self, "SetBackdropBorderColor", HookBackdropBorderColor) - end -end - -local function SetPanelTemplate(self, templateName, noupdate, overridePadding, xOffset, yOffset, defaultColor) - if(not self or (self and self.Panel)) then return end - local padding = false - if(overridePadding and type(overridePadding) == "number") then - padding = overridePadding - end - - CreatePanelTemplate(self, templateName, true, noupdate, padding, xOffset, yOffset, defaultColor) - - if(not self.Panel:GetAttribute("panelSkipUpdate") and not self.__registered) then - TemplateUpdateFrames[self] = true - self.__registered = true - end -end - -local function SetFixedPanelTemplate(self, templateName, noupdate, overridePadding, xOffset, yOffset, defaultColor) - if(not self or (self and self.Panel)) then return end - local padding = false - if(overridePadding and type(overridePadding) == "number") then - padding = overridePadding - end - - CreatePanelTemplate(self, templateName, false, noupdate, padding, xOffset, yOffset, defaultColor) - - if(not self.Panel:GetAttribute("panelSkipUpdate") and not self.__registered) then - TemplateUpdateFrames[self] = true - self.__registered = true - end -end - -local function SetPanelColor(self, ...) - local arg1,arg2,arg3,arg4,arg5,arg6,arg7 = select(1, ...) - if(not self.Panel or not arg1) then return; end - if(self.Panel.Skin and self.Panel:GetAttribute("panelGradient")) then - if(type(arg1) == "string") then - if(arg1 == "VERTICAL" or arg1 == "HORIZONTAL") then - self.Panel.Skin:SetGradient(...) - elseif(SV.Media.gradient[arg1]) then - if self.ColorBorder then - local d,r,g,b,r2,g2,b2 = unpack(SV.Media.gradient[arg1]) - --self.Panel.Skin:SetGradient(d,r,g,b,r2,g2,b2) - self:ColorBorder(r2,g2,b2,arg1) - else - self.Panel.Skin:SetGradient(unpack(SV.Media.gradient[arg1])) - if(SV.Media.color[arg1]) then - local t = SV.Media.color[arg1] - local r,g,b,a = t[1], t[2], t[3], t[4] or 1; - self:SetBackdropColor(r,g,b,a) - end - end - end - end - elseif(type(arg1) == "string" and SV.Media.color[arg1]) then - local t = SV.Media.color[arg1] - local r,g,b,a = t[1], t[2], t[3], t[4] or 1; - if self.ColorBorder then - self:ColorBorder(r,g,b,arg1) - else - self:SetBackdropColor(r,g,b) - end - elseif(arg1 and type(arg1) == "number") then - self:SetBackdropColor(...) - end -end ---[[ -########################################################## -APPENDED BUTTON TEMPLATING METHODS -########################################################## -]]-- -local function SetButtonTemplate(self, invisible, overridePadding, xOffset, yOffset, keepNormal, defaultColor) - if(not self or (self and self.Panel)) then return end - - local padding = 1 - if(overridePadding and type(overridePadding) == "number") then - padding = overridePadding - end - - local x,y = -1,-1 - local underlay = false - if(xOffset or yOffset) then - x = xOffset or -1 - y = yOffset or -1 - underlay = true - end - - if(invisible) then - CreatePanelTemplate(self, "Transparent", underlay, true, padding, x, y, defaultColor) - self:SetBackdropColor(0,0,0,0) - self:SetBackdropBorderColor(0,0,0,0) - - if(self.Panel.BorderLeft) then - self.Panel.BorderLeft:SetVertexColor(0,0,0,0) - self.Panel.BorderRight:SetVertexColor(0,0,0,0) - self.Panel.BorderTop:SetVertexColor(0,0,0,0) - self.Panel.BorderBottom:SetVertexColor(0,0,0,0) - end - else - CreatePanelTemplate(self, "Button", underlay, true, padding, x, y, defaultColor) - end - - if(self.Left) then - self.Left:SetAlpha(0) - end - - if(self.Middle) then - self.Middle:SetAlpha(0) - end - - if(self.Right) then - self.Right:SetAlpha(0) - end - - if(self.SetNormalTexture and not keepNormal) then - self:SetNormalTexture("") - end - - if(self.SetDisabledTexture) then - self:SetDisabledTexture("") - end - - if(self.SetHighlightTexture) then - if(not self.hover) then - local hover = self:CreateTexture(nil, "HIGHLIGHT") - hover:FillInner(self.Panel, 2, 2) - self.hover = hover; - end - self.hover:SetTexture(0.1, 0.8, 0.8, 0.5) - self:SetHighlightTexture(self.hover) - end - - if(self.SetPushedTexture) then - if(not self.pushed) then - local pushed = self:CreateTexture(nil, "OVERLAY") - pushed:FillInner(self.Panel) - self.pushed = pushed; - end - - self.pushed:SetTexture(0.1, 0.8, 0.1, 0.3) - - self:SetPushedTexture(self.pushed) - end - - if(self.SetCheckedTexture) then - if(not self.checked) then - local checked = self:CreateTexture(nil, "OVERLAY") - checked:FillInner(self.Panel) - self.checked = checked; - end - - self.checked:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - self.checked:SetVertexColor(0, 0.5, 0, 0.2) - - self:SetCheckedTexture(self.checked) - end - - CreateCooldown(self) -end - -local function SetSlotTemplate(self, underlay, padding, x, y, shadowAlpha, mutedCooldown) - if(not self or (self and self.Panel)) then return end - padding = padding or 1 - CreatePanelTemplate(self, "Slot", underlay, true, padding, x, y) - CreateButtonPanel(self, true, nil, mutedCooldown) - if(shadowAlpha) then - self.Panel.Shadow:SetAttribute("shadowAlpha", shadowAlpha) - end -end - -local function SetCheckboxTemplate(self, shrink, x, y) - if(not self or (self and self.Panel)) then return end - - local width, height = self:GetSize() - if(shrink) then - x = x or -2 - y = y or -2 - end - - width = width + (x or 0) - height = height + (y or 0) - - self:SetSize(width, height) - - CreatePanelTemplate(self, "Inset", true, true, 1, x, y) - - if(self.SetNormalTexture) then - self:SetNormalTexture("") - end - - if(self.SetPushedTexture) then - self:SetPushedTexture("") - end - - if(self.SetHighlightTexture) then - if(not self.hover) then - local hover = self:CreateTexture(nil, "OVERLAY") - hover:FillInner(self.Panel) - self.hover = hover; - end - local color = SV.Media.color.highlight - self.hover:SetTexture(color[1], color[2], color[3], 0.5) - self:SetHighlightTexture(self.hover) - end - - if(self.SetCheckedTexture) then - self:SetCheckedTexture([[Interface\Buttons\UI-CheckBox-Check]]) - end - - if(self.SetDisabledCheckedTexture) then - self:SetDisabledCheckedTexture([[Interface\Buttons\UI-CheckBox-Check-Disabled]]) - end -end - -local function SetColorCheckboxTemplate(self, underlay, x, y) - if(not self or (self and self.Panel)) then return end - - if(underlay) then - x = x or -7 - y = y or -7 - end - - CreatePanelTemplate(self, "Slot", underlay, true, 1, x, y) - CreateButtonPanel(self, false, true) - - hooksecurefunc(self, "SetChecked", function(self,checked) - local r,g,b = 0,0,0 - if(checked) then - r,g,b = self:GetCheckedTexture():GetVertexColor() - end - self:SetBackdropBorderColor(r,g,b) - end) -end - -local function SetEditboxTemplate(self, x, y, fixed) - if(not self or (self and self.Panel)) then return end - - if self.TopLeftTex then self.TopLeftTex:Die() end - if self.TopRightTex then self.TopRightTex:Die() end - if self.TopTex then self.TopTex:Die() end - if self.BottomLeftTex then self.BottomLeftTex:Die() end - if self.BottomRightTex then self.BottomRightTex:Die() end - if self.BottomTex then self.BottomTex:Die() end - if self.LeftTex then self.LeftTex:Die() end - if self.RightTex then self.RightTex:Die() end - if self.MiddleTex then self.MiddleTex:Die() end - local underlay = true - if(fixed ~= nil) then underlay = fixed end - CreatePanelTemplate(self, "Inset", underlay, true, 1, x, y) - - local globalName = self:GetName(); - if globalName then - if _G[globalName.."Left"] then _G[globalName.."Left"]:Die() end - if _G[globalName.."Middle"] then _G[globalName.."Middle"]:Die() end - if _G[globalName.."Right"] then _G[globalName.."Right"]:Die() end - if _G[globalName.."Mid"] then _G[globalName.."Mid"]:Die() end - - if globalName:find("Silver") or globalName:find("Copper") or globalName:find("Gold") then - self.Panel:SetPoint("TOPLEFT", -3, 1) - if globalName:find("Silver") or globalName:find("Copper") then - self.Panel:SetPoint("BOTTOMRIGHT", -12, -2) - else - self.Panel:SetPoint("BOTTOMRIGHT", -2, -2) - end - end - end -end - -local SetFrameBorderColor = function(self, r, g, b, setPrevious, reset) - if(setPrevious) then - self.__border.__previous = setPrevious - elseif(reset) then - r,g,b = unpack(SV.Media.color[self.__border.__previous]) - end - self.__border[1]:SetTexture(r, g, b) - self.__border[2]:SetTexture(r, g, b) - self.__border[3]:SetTexture(r, g, b) - self.__border[4]:SetTexture(r, g, b) -end - -local ShowAlertFlash = function(self) - self:ColorBorder(1,0.9,0) - SV.Animate:Flash(self.__border, 0.75, true) -end - -local HideAlertFlash = function(self) - SV.Animate:StopFlash(self.__border) - self:ColorBorder(1,0.9,0, nil, true) -end - -local function SetFramedButtonTemplate(self, template, borderSize) - if(not self or (self and self.Panel)) then return end - - borderSize = borderSize or 2 - - template = template or "FramedBottom" - - CreatePanelTemplate(self, template, false, false, 0, -borderSize, -borderSize) - - if(self.Left) then - self.Left:SetAlpha(0) - end - - if(self.Middle) then - self.Middle:SetAlpha(0) - end - - if(self.Right) then - self.Right:SetAlpha(0) - end - - if(self.SetNormalTexture) then - self:SetNormalTexture("") - end - - if(self.SetDisabledTexture) then - self:SetDisabledTexture("") - end - - if(not self.__border) then - local t = SV.Media.color.default - local r,g,b = t[1], t[2], t[3] - - local border = CreateFrame("Frame", nil, self) - border:SetAllPoints() - - border[1] = border:CreateTexture(nil,"BORDER") - border[1]:SetTexture(r,g,b) - border[1]:SetPoint("TOPLEFT", -1, 1) - border[1]:SetPoint("BOTTOMLEFT", -1, -1) - border[1]:SetWidth(borderSize) - - local leftoutline = border:CreateTexture(nil,"BORDER") - leftoutline:SetTexture(0,0,0) - leftoutline:SetPoint("TOPLEFT", -2, 2) - leftoutline:SetPoint("BOTTOMLEFT", -2, -2) - leftoutline:SetWidth(1) - - border[2] = border:CreateTexture(nil,"BORDER") - border[2]:SetTexture(r,g,b) - border[2]:SetPoint("TOPRIGHT", 1, 1) - border[2]:SetPoint("BOTTOMRIGHT", 1, -1) - border[2]:SetWidth(borderSize) - - local rightoutline = border:CreateTexture(nil,"BORDER") - rightoutline:SetTexture(0,0,0) - rightoutline:SetPoint("TOPRIGHT", 2, 2) - rightoutline:SetPoint("BOTTOMRIGHT", 2, -2) - rightoutline:SetWidth(1) - - border[3] = border:CreateTexture(nil,"BORDER") - border[3]:SetTexture(r,g,b) - border[3]:SetPoint("TOPLEFT", -1, 1) - border[3]:SetPoint("TOPRIGHT", 1, 1) - border[3]:SetHeight(borderSize) - - local topoutline = border:CreateTexture(nil,"BORDER") - topoutline:SetTexture(0,0,0) - topoutline:SetPoint("TOPLEFT", -2, 2) - topoutline:SetPoint("TOPRIGHT", 2, 2) - topoutline:SetHeight(1) - - border[4] = border:CreateTexture(nil,"BORDER") - border[4]:SetTexture(r,g,b) - border[4]:SetPoint("BOTTOMLEFT", -1, -1) - border[4]:SetPoint("BOTTOMRIGHT", 1, -1) - border[4]:SetHeight(borderSize) - - local bottomoutline = border:CreateTexture(nil,"BORDER") - bottomoutline:SetTexture(0,0,0) - bottomoutline:SetPoint("BOTTOMLEFT", -2, -2) - bottomoutline:SetPoint("BOTTOMRIGHT", 2, -2) - bottomoutline:SetHeight(1) - - self.__border = border - self.__border.__previous = 'default'; - self.ColorBorder = SetFrameBorderColor - self.StartAlert = ShowAlertFlash - self.StopAlert = HideAlertFlash - end - - if(not self.hover) then - self.hover = self:CreateTexture(nil, "HIGHLIGHT") - end - - local color = SV.Media.color.highlight - self.hover:SetTexture(color[1], color[2], color[3], 0.5) - self.hover:SetAllPoints() - if(self.SetHighlightTexture) then - self:SetHighlightTexture(self.hover) - end - - if(not self.__registered) then - TemplateUpdateFrames[self] = true - self.__registered = true - end -end ---[[ -########################################################## -TEMPLATE UPDATE CALLBACK -########################################################## -]]-- -local function FrameTemplateUpdates() - for frame in pairs(TemplateUpdateFrames) do - if(frame) then - local panelID = frame.Panel:GetAttribute("panelID") - local colorID = frame.Panel:GetAttribute("panelColor") - local panelColor = SV.Media.color[colorID]; - if(frame.BackdropNeedsUpdate) then - if(frame.UpdateBackdrop) then - frame:UpdateBackdrop() - end - if(panelColor) then - frame:SetBackdropColor(panelColor[1], panelColor[2], panelColor[3], panelColor[4] or 1) - end - frame:SetBackdropBorderColor(0,0,0,1) - end - if(frame.TextureNeedsUpdate and frame.Panel.Skin) then - local tex = SV.Media.bg[panelID] - if(tex) then - frame.Panel.Skin:SetTexture(tex) - end - if(not frame.NoColorUpdate) then - local gradient = frame.Panel:GetAttribute("panelGradient") - if(gradient and SV.Media.gradient[gradient]) then - local g = SV.Media.gradient[gradient] - frame.Panel.Skin:SetGradient(g[1], g[2], g[3], g[4], g[5], g[6], g[7]) - elseif(panelColor) then - frame.Panel.Skin:SetVertexColor(panelColor[1], panelColor[2], panelColor[3], panelColor[4] or 1) - end - end - end - end - end -end - -SVLib:NewCallback("CORE_MEDIA_UPDATED", "FrameTemplateUpdates", FrameTemplateUpdates) ---[[ -########################################################## -ENUMERATION -########################################################## -]]-- -local function AppendMethods(OBJECT) - local META = getmetatable(OBJECT).__index - if not OBJECT.SetBasicPanel then META.SetBasicPanel = SetBasicPanel end - if not OBJECT.SetPanelTemplate then META.SetPanelTemplate = SetPanelTemplate end - if not OBJECT.SetFixedPanelTemplate then META.SetFixedPanelTemplate = SetFixedPanelTemplate end - if not OBJECT.SetPanelColor then META.SetPanelColor = SetPanelColor end - if not OBJECT.SetButtonTemplate then META.SetButtonTemplate = SetButtonTemplate end - if not OBJECT.SetSlotTemplate then META.SetSlotTemplate = SetSlotTemplate end - if not OBJECT.SetCheckboxTemplate then META.SetCheckboxTemplate = SetCheckboxTemplate end - if not OBJECT.SetColorCheckboxTemplate then META.SetColorCheckboxTemplate = SetColorCheckboxTemplate end - if not OBJECT.SetEditboxTemplate then META.SetEditboxTemplate = SetEditboxTemplate end - if not OBJECT.SetFramedButtonTemplate then META.SetFramedButtonTemplate = SetFramedButtonTemplate end -end - -local HANDLER, OBJECT = {["Frame"] = true}, CreateFrame("Frame") -AppendMethods(OBJECT) -AppendMethods(OBJECT:CreateTexture()) -AppendMethods(OBJECT:CreateFontString()) - -OBJECT = EnumerateFrames() -while OBJECT do - local objType = OBJECT:GetObjectType() - if not HANDLER[objType] then - AppendMethods(OBJECT) - HANDLER[objType] = true - end - OBJECT = EnumerateFrames(OBJECT) -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/docks/dock_core.lua b/Interface/AddOns/SVUI/framework/docks/dock_core.lua new file mode 100644 index 0000000..d781dbe --- /dev/null +++ b/Interface/AddOns/SVUI/framework/docks/dock_core.lua @@ -0,0 +1,1151 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## ]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local print = _G.print; +local ipairs = _G.ipairs; +local pairs = _G.pairs; +local tostring = _G.tostring; +local tonumber = _G.tonumber; + +--STRING +local string = _G.string; +local upper = string.upper; +local format = string.format; +local find = string.find; +local match = string.match; +local gsub = string.gsub; +--TABLE +local table = _G.table; +local tinsert = _G.tinsert; +local tremove = _G.tremove; +local twipe = _G.wipe; +--MATH +local math = _G.math; +local random = math.random; +local min = math.min; +local floor = math.floor +local ceil = math.ceil +--BLIZZARD API +local GameTooltip = _G.GameTooltip; +local InCombatLockdown = _G.InCombatLockdown; +local CreateFrame = _G.CreateFrame; +local GetTime = _G.GetTime; +local GetItemCooldown = _G.GetItemCooldown; +local GetItemCount = _G.GetItemCount; +local GetItemInfo = _G.GetItemInfo; +local GetSpellInfo = _G.GetSpellInfo; +local IsSpellKnown = _G.IsSpellKnown; +local GetProfessions = _G.GetProfessions; +local GetProfessionInfo = _G.GetProfessionInfo; +local hooksecurefunc = _G.hooksecurefunc; +--[[ +########################################################## +ADDON +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L; +--[[ +########################################################## +DOCKING +########################################################## +]]-- +local ORDER_TEMP = {}; +local ORDER_TEST = {}; + +local SPARK_ANIM = [[Interface\AddOns\SVUI\assets\artwork\Doodads\DOCK-SPARKS-]]; + +local DOCK_LOCATIONS = { + ["BottomLeft"] = {1, "LEFT", true, "ANCHOR_TOPLEFT"}, + ["BottomRight"] = {-1, "RIGHT", true, "ANCHOR_TOPLEFT"}, + ["TopLeft"] = {1, "LEFT", false, "ANCHOR_BOTTOMLEFT"}, + ["TopRight"] = {-1, "RIGHT", false, "ANCHOR_BOTTOMLEFT"}, +}; + +local Dock = SV:NewClass("Dock", L["Docks"]); + +Dock.Border = {}; +Dock.Registration = {}; +Dock.Locations = {}; + +local DOCK_DROPDOWN_OPTIONS = {}; + +DOCK_DROPDOWN_OPTIONS["BottomLeft"] = { text = "To BottomLeft", func = function(button) Dock.BottomLeft.Bar:Add(button) end }; +DOCK_DROPDOWN_OPTIONS["BottomRight"] = { text = "To BottomRight", func = function(button) Dock.BottomRight.Bar:Add(button) end }; +DOCK_DROPDOWN_OPTIONS["TopLeft"] = { text = "To TopLeft", func = function(button) Dock.TopLeft.Bar:Add(button) end }; +--DOCK_DROPDOWN_OPTIONS["TopRight"] = { text = "To TopRight", func = function(button) Dock.TopRight.Bar:Add(button) end }; +--[[ +########################################################## +SOUND EFFECTS +########################################################## +]]-- +local ButtonSound = SV.Sounds:Blend("DockButton", "Buttons", "Levers"); +local ErrorSound = SV.Sounds:Blend("Malfunction", "Sparks", "Wired"); +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +_G.HideSuperDocks = function(self, button) + GameTooltip:Hide() + if(button and IsAltKeyDown()) then + SV:StaticPopup_Show('RESETDOCKS_CHECK') + else + if SV.cache.Docks.IsFaded then + SV.cache.Docks.IsFaded = nil; + Dock.BottomLeft:FadeIn(0.2, Dock.BottomLeft:GetAlpha(), 1) + Dock.BottomLeft.Bar:FadeIn(0.2, Dock.BottomLeft.Bar:GetAlpha(), 1) + Dock.BottomRight:FadeIn(0.2, Dock.BottomRight:GetAlpha(), 1) + Dock.BottomRight.Bar:FadeIn(0.2, Dock.BottomRight.Bar:GetAlpha(), 1) + SV.Events:Trigger("DOCKS_FADE_IN"); + PlaySoundFile([[sound\doodad\be_scryingorb_explode.ogg]]) + --PlaySoundFile([[sound\interface\ui_etherealwindow_open.ogg]]) + else + SV.cache.Docks.IsFaded = true; + Dock.BottomLeft:FadeOut(0.2, Dock.BottomLeft:GetAlpha(), 0) + Dock.BottomLeft.Bar:FadeOut(0.2, Dock.BottomLeft.Bar:GetAlpha(), 0) + Dock.BottomRight:FadeOut(0.2, Dock.BottomRight:GetAlpha(), 0) + Dock.BottomRight.Bar:FadeOut(0.2, Dock.BottomRight.Bar:GetAlpha(), 0) + SV.Events:Trigger("DOCKS_FADE_OUT"); + PlaySoundFile([[sound\doodad\be_scryingorb_explode.ogg]]) + --PlaySoundFile([[sound\interface\ui_etherealwindow_close.ogg]]) + end + end +end + +function Dock:EnterFade() + if SV.cache.Docks.IsFaded then + --self.BottomLeft:Show() + self.BottomLeft:FadeIn(0.2, self.BottomLeft:GetAlpha(), 1) + self.BottomLeft.Bar:FadeIn(0.2, self.BottomLeft.Bar:GetAlpha(), 1) + --self.BottomRight:Show() + self.BottomRight:FadeIn(0.2, self.BottomRight:GetAlpha(), 1) + self.BottomRight.Bar:FadeIn(0.2, self.BottomRight.Bar:GetAlpha(), 1) + SV.Events:Trigger("DOCKS_FADE_IN"); + --PlaySoundFile([[sound\doodad\be_scryingorb_explode.ogg]]) + end +end + +function Dock:ExitFade() + if SV.cache.Docks.IsFaded then + self.BottomLeft:FadeOut(2, self.BottomLeft:GetAlpha(), 0) + self.BottomLeft.Bar:FadeOut(2, self.BottomLeft.Bar:GetAlpha(), 0) + self.BottomRight:FadeOut(2, self.BottomRight:GetAlpha(), 0) + self.BottomRight.Bar:FadeOut(2, self.BottomRight.Bar:GetAlpha(), 0) + SV.Events:Trigger("DOCKS_FADE_OUT"); + --PlaySoundFile([[sound\doodad\be_scryingorb_explode.ogg]]) + end +end +--[[ +########################################################## +SET DOCKBAR FUNCTIONS +########################################################## +]]-- +local RefreshDockWindows = function(self) + --print('RefreshDockWindows') + local dd = self.Data.Default + local button = _G[dd] + local default + if(button) then + default = button:GetAttribute("ownerFrame") + end + for name,window in pairs(self.Data.Windows) do + if(window ~= default) then + if(window.DockButton) then + window.DockButton:Deactivate() + end + end + end +end + +local RefreshDockButtons = function(self) + --print('RefreshDockButtons') + for name,docklet in pairs(Dock.Registration) do + if(docklet) then + if(docklet.DockButton) then + docklet.DockButton:Deactivate() + end + --docklet:FadeOut(0.1, 1, 0, true) + end + end +end + +local GetDefault = function(self) + --print('GetDefault') + local default = self.Data.Default + local button = _G[default] + if(button) then + local window = button:GetAttribute("ownerFrame") + if window and _G[window] then + self:Refresh() + self.Parent.Window.FrameLink = _G[window] + self.Parent.Window:FadeIn() + _G[window]:Show() + button:Activate() + end + end +end + +local OldDefault = function(self) + --print('OldDefault') + local default = self.Data.OriginalDefault + local button = _G[default] + if(button) then + local window = button:GetAttribute("ownerFrame") + if window and _G[window] then + self:Refresh() + self.Parent.Window.FrameLink = _G[window] + self.Parent.Window:FadeIn() + _G[window]:Show() + button:Activate() + end + end +end + +local ToggleDockletWindow = function(self, button) + --print('ToggleDockletWindow') + local frame = button.FrameLink + if(frame) then + self.Parent.Window.FrameLink = frame + self.Parent.Window:FadeIn() + self:Cycle() + --frame:FadeIn() + button:Activate() + else + button:Deactivate() + self:GetDefault() + end +end + +local AlertActivate = function(self, child) + local size = SV.db.Dock.buttonSize or 22; + self:SetHeightToScale(size) + self.backdrop:Show() + child:ClearAllPoints() + child:SetAllPoints(self) +end + +local AlertDeactivate = function(self) + self.backdrop:Hide() + self:SetHeightToScale(1) +end + +local Docklet_OnShow = function(self) + --print('Docklet_OnShow') + if(self.FrameLink) then + if(not InCombatLockdown()) then + self.FrameLink:SetFrameLevel(10) + end + self.FrameLink:FadeIn() + end +end + +local Docklet_OnHide = function(self) + --print('Docklet_OnHide') + if(self.FrameLink) then + if(not InCombatLockdown()) then + self.FrameLink:SetFrameLevel(0) + self.FrameLink:Hide() + else + self.FrameLink:FadeOut(0.2, 1, 0, true) + end + end +end + +local DockButtonMakeDefault = function(self) + self.Parent.Data.Default = self:GetName() + self.Parent:GetDefault() + if(not self.Parent.Data.OriginalDefault) then + self.Parent.Data.OriginalDefault = self:GetName() + end +end + +local DockButtonActivate = function(self) + --print('DockButtonActivate') + self:SetAttribute("isActive", true) + self:SetPanelColor("green") + self.Icon:SetGradient(unpack(SV.Media.gradient.green)) + if(self.FrameLink) then + if(not InCombatLockdown()) then + self.FrameLink:SetFrameLevel(10) + end + self.FrameLink:FadeIn() + end +end + +local DockButtonDeactivate = function(self) + --print('DockButtonDeactivate') + if(self.FrameLink) then + if(not InCombatLockdown()) then + self.FrameLink:SetFrameLevel(0) + self.FrameLink:Hide() + else + self.FrameLink:FadeOut(0.2, 1, 0, true) + end + end + self:SetAttribute("isActive", false) + self:SetPanelColor("default") + self.Icon:SetGradient(unpack(SV.Media.gradient.icon)) +end + +local DockButton_OnEnter = function(self, ...) + Dock:EnterFade() + + self:SetPanelColor("highlight") + self.Icon:SetGradient(unpack(SV.Media.gradient.highlight)) + + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) + GameTooltip:ClearLines() + local tipText = self:GetAttribute("tipText") + GameTooltip:AddDoubleLine("[Left-Click]", tipText, 0, 1, 0, 1, 1, 1) + GameTooltip:AddLine(" ") + GameTooltip:AddDoubleLine("[Alt + Click]", "Reset Dock Buttons", 0, 0.5, 1, 0.5, 1, 0.5) + GameTooltip:Show() +end + +local DockletButton_OnEnter = function(self, ...) + Dock:EnterFade() + + self:SetPanelColor("highlight") + self.Icon:SetGradient(unpack(SV.Media.gradient.highlight)) + + local tipAnchor = self:GetAttribute("tipAnchor") + GameTooltip:SetOwner(self, tipAnchor, 0, 4) + GameTooltip:ClearLines() + if(self.CustomTooltip) then + self:CustomTooltip() + else + local tipText = self:GetAttribute("tipText") + GameTooltip:AddDoubleLine("[Left-Click]", tipText, 0, 1, 0, 1, 1, 1) + end + if(self:GetAttribute("hasDropDown") and self.GetMenuList) then + GameTooltip:AddLine(" ") + GameTooltip:AddDoubleLine("[Alt + Click]", "Docking Options", 0, 0.5, 1, 0.5, 1, 0.5) + end + GameTooltip:Show() +end + +local DockletButton_OnLeave = function(self, ...) + Dock:ExitFade() + + if(self:GetAttribute("isActive")) then + self:SetPanelColor("green") + self.Icon:SetGradient(unpack(SV.Media.gradient.green)) + else + self:SetPanelColor("default") + self.Icon:SetGradient(unpack(SV.Media.gradient.icon)) + end + + GameTooltip:Hide() +end + +local DockletButton_OnClick = function(self, button) + --if InCombatLockdown() then return end + self.Sparks:SetTexture(SPARK_ANIM .. random(1,3)) + self.Sparks.anim:Play() + ButtonSound() + if(IsAltKeyDown() and (not InCombatLockdown()) and self:GetAttribute("hasDropDown") and self.GetMenuList) then + local list = self:GetMenuList(); + SV.Dropdown:Open(self, list); + else + if self.PostClickFunction then + self:PostClickFunction() + else + self.Parent:Toggle(self) + end + end +end + +local DockletButton_OnPostClick = function(self, button) + if InCombatLockdown() then + ErrorSound() + return + end + ButtonSound() + if(IsAltKeyDown() and self:GetAttribute("hasDropDown") and self.GetMenuList) then + local list = self:GetMenuList(); + SV.Dropdown:Open(self, list); + end +end + +local DockletEnable = function(self) + local dock = self.Parent; + if(self.DockButton) then dock.Bar:Add(self.DockButton) end +end + +local DockletDisable = function(self) + local dock = self.Parent; + if(self.DockButton) then dock.Bar:Remove(self.DockButton) end +end + +local DockletButtonSize = function(self) + local size = self.Bar.ToolBar:GetHeight() or 30; + return size; +end + +local DockletRelocate = function(self, location) + local newParent = Dock[location]; + + if(not newParent) then return end + + if(self.DockButton) then + newParent.Bar:Add(self.DockButton) + end + + if(self.Bar) then + local height = newParent.Bar.ToolBar:GetHeight(); + local mod = newParent.Bar.Data[1]; + local barAnchor = newParent.Bar.Data[2]; + local barReverse = SV:GetReversePoint(barAnchor); + local spacing = SV.db.Dock.buttonSpacing; + + self.Bar:ClearAllPoints(); + self.Bar:SetPointToScale(barAnchor, newParent.Bar.ToolBar, barReverse, (spacing * mod), 0) + end +end + +local GetDockablePositions = function(self) + local button = self; + local name = button:GetName(); + local currentLocation = Dock.Locations[name]; + local t; + + if(self.GetPreMenuList) then + t = self:GetPreMenuList(); + tinsert(t, { title = "Move This", divider = true }) + else + t = {{ title = "Move This", divider = true }}; + end + + for location,option in pairs(DOCK_DROPDOWN_OPTIONS) do + if(currentLocation ~= location) then + tinsert(t, option); + end + end + + tinsert(t, { title = "Re-Order", divider = true }); + + for i=1, #button.Parent.Data.Order do + if(i ~= button.OrderIndex) then + local positionText = ("Position #%d"):format(i); + tinsert(t, { text = positionText, func = function() button.Parent:ChangeOrder(button, i) end }); + end + end + + return t; +end + +local ChangeBarOrder = function(self, button, targetIndex) + local targetName = button:GetName(); + local currentIndex = button.OrderIndex; + wipe(ORDER_TEST); + wipe(ORDER_TEMP); + for i = 1, #self.Data.Order do + local nextName = self.Data.Order[i]; + if(i == targetIndex) then + if(currentIndex > targetIndex) then + tinsert(ORDER_TEMP, targetName) + tinsert(ORDER_TEMP, nextName) + else + tinsert(ORDER_TEMP, nextName) + tinsert(ORDER_TEMP, targetName) + end + elseif(targetName ~= nextName) then + tinsert(ORDER_TEMP, nextName) + end + end + + wipe(self.Data.Order); + local safeIndex = 1; + for i = 1, #ORDER_TEMP do + local nextName = ORDER_TEMP[i]; + local nextButton = self.Data.Buttons[nextName]; + if(nextButton and (not ORDER_TEST[nextName])) then + ORDER_TEST[nextName] = true + tinsert(self.Data.Order, nextName); + nextButton.OrderIndex = safeIndex; + safeIndex = safeIndex + 1; + end + end + + self:Update() +end + +local RefreshBarOrder = function(self) + wipe(ORDER_TEST); + wipe(ORDER_TEMP); + for i = 1, #self.Data.Order do + local nextName = self.Data.Order[i]; + tinsert(ORDER_TEMP, nextName) + end + wipe(self.Data.Order); + local safeIndex = 1; + for i = 1, #ORDER_TEMP do + local nextName = ORDER_TEMP[i]; + local nextButton = self.Data.Buttons[nextName]; + if(nextButton and (not ORDER_TEST[nextName])) then + ORDER_TEST[nextName] = true + tinsert(self.Data.Order, nextName); + nextButton.OrderIndex = safeIndex; + safeIndex = safeIndex + 1; + end + end +end + +local CheckBarOrder = function(self, targetName) + local found = false; + for i = 1, #self.Data.Order do + if(self.Data.Order[i] == targetName) then + found = true; + end + end + if(not found) then + tinsert(self.Data.Order, targetName); + self:UpdateOrder(); + end +end + +local RefreshBarLayout = function(self) + local anchor = upper(self.Data.Location) + local mod = self.Data.Modifier + local size = self.ToolBar:GetHeight(); + local count = #self.Data.Order; + local offset = 1; + local safeIndex = 1; + for i = 1, count do + local nextName = self.Data.Order[i]; + local nextButton = self.Data.Buttons[nextName]; + if(nextButton) then + offset = (safeIndex - 1) * (size + 6) + 6 + nextButton:ClearAllPoints(); + nextButton:SetSize(size, size); + nextButton:SetPoint(anchor, self.ToolBar, anchor, (offset * mod), 0); + if(not nextButton:IsShown()) then + nextButton:Show(); + end + nextButton.OrderIndex = safeIndex; + safeIndex = safeIndex + 1; + end + end + + self.ToolBar:SetWidth(offset + size); + + if(SV.Dropdown:IsShown()) then + ToggleFrame(SV.Dropdown) + end +end + +local AddToDock = function(self, button) + if not button then return end + local name = button:GetName(); + if(self.Data.Buttons[name]) then return end + + local registeredLocation = Dock.Locations[name] + local currentLocation = self.Data.Location + + if(registeredLocation) then + if(registeredLocation ~= currentLocation) then + if(Dock[registeredLocation].Bar.Data.Buttons[name]) then + Dock[registeredLocation].Bar:Remove(button); + else + Dock[registeredLocation].Bar:Add(button); + return + end + end + end + + self.Data.Buttons[name] = button; + self:CheckOrder(name); + + Dock.Locations[name] = currentLocation; + button.Parent = self; + button:SetParent(self.ToolBar); + + if(button.FrameLink) then + local frame = button.FrameLink + local frameName = frame:GetName() + self.Data.Windows[frameName] = frame; + Dock.Locations[frameName] = currentLocation; + frame:Show() + frame:ClearAllPoints() + frame:SetParent(self.Parent.Window) + frame:SetAllPointsIn(self.Parent.Window) + frame.Parent = self.Parent + end + + -- self:UpdateOrder() + self:Update() +end + +local RemoveFromDock = function(self, button) + if not button then return end + local name = button:GetName(); + local registeredLocation = Dock.Locations[name]; + local currentLocation = self.Data.Location + + if(registeredLocation and (registeredLocation == currentLocation)) then + Dock.Locations[name] = nil; + end + + for i = 1, #self.Data.Order do + local nextName = self.Data.Order[i]; + if(nextName == name) then + tremove(self.Data.Order, i); + break; + end + end + + if(not self.Data.Buttons[name]) then return end + + button:Hide() + if(button.FrameLink) then + local frameName = button.FrameLink:GetName() + Dock.Locations[frameName] = nil; + button.FrameLink:FadeOut(0.2, 1, 0, true) + self.Data.Windows[frameName] = nil; + end + + button.OrderIndex = 0; + self.Data.Buttons[name] = nil; + self:UpdateOrder() + self:Update() +end + +local ActivateDockletButton = function(self, button, clickFunction, tipFunction, isAction) + button.Activate = DockButtonActivate + button.Deactivate = DockButtonDeactivate + button.MakeDefault = DockButtonMakeDefault + button.GetMenuList = GetDockablePositions + + if(tipFunction and type(tipFunction) == "function") then + button.CustomTooltip = tipFunction + end + + button.Parent = self + button:SetPanelColor("default") + button.Icon:SetGradient(unpack(SV.Media.gradient.icon)) + button:SetScript("OnEnter", DockletButton_OnEnter) + button:SetScript("OnLeave", DockletButton_OnLeave) + if(not isAction) then + button:SetScript("OnClick", DockletButton_OnClick) + else + button:SetScript("PostClick", DockletButton_OnPostClick) + end + + if(clickFunction and type(clickFunction) == "function") then + button.PostClickFunction = clickFunction + end +end + +local CreateBasicToolButton = function(self, displayName, texture, onclick, globalName, tipFunction, primaryTemplate) + local dockIcon = texture or [[Interface\AddOns\SVUI\assets\artwork\Icons\SVUI-ICON]]; + local size = self.ToolBar:GetHeight(); + local template = "SVUI_DockletButtonTemplate" + + if(primaryTemplate) then + template = primaryTemplate .. ", SVUI_DockletButtonTemplate" + end + + local button = _G[globalName .. "DockletButton"] or CreateFrame("Button", globalName, self.ToolBar, template) + + button:ClearAllPoints() + button:SetSize(size, size) + button:SetStylePanel("Framed") + button.Icon:SetTexture(dockIcon) + button:SetAttribute("tipText", displayName) + button:SetAttribute("tipAnchor", self.Data.TipAnchor) + button:SetAttribute("ownerFrame", globalName) + + button.OrderIndex = 0; + + local sparkSize = size * 5; + local sparkOffset = size * 0.5; + + local sparks = button.__border:CreateTexture(nil, "OVERLAY", nil, 2) + sparks:SetSizeToScale(sparkSize, sparkSize) + sparks:SetPoint("CENTER", button, "BOTTOMRIGHT", -sparkOffset, 4) + sparks:SetTexture(SPARK_ANIM .. 1) + sparks:SetVertexColor(0.7, 0.6, 0.5) + sparks:SetBlendMode("ADD") + sparks:SetAlpha(0) + + SV.Animate:Sprite8(sparks, 0.08, 2, false, true) + + button.Sparks = sparks; + + self:Add(button) + self:Initialize(button, onclick, tipFunction, primaryTemplate) + + return button +end +--[[ +########################################################## +DOCKS +########################################################## +]]-- +for location, settings in pairs(DOCK_LOCATIONS) do + Dock[location] = _G["SVUI_Dock" .. location]; + Dock[location].Bar = _G["SVUI_DockBar" .. location]; + + Dock[location].Alert.Activate = AlertActivate; + Dock[location].Alert.Deactivate = AlertDeactivate; + + Dock[location].Bar.Parent = Dock[location]; + Dock[location].Bar.Refresh = RefreshDockButtons; + Dock[location].Bar.Cycle = RefreshDockWindows; + Dock[location].Bar.GetDefault = GetDefault; + Dock[location].Bar.UnsetDefault = OldDefault; + Dock[location].Bar.Toggle = ToggleDockletWindow; + Dock[location].Bar.Update = RefreshBarLayout; + Dock[location].Bar.UpdateOrder = RefreshBarOrder; + Dock[location].Bar.ChangeOrder = ChangeBarOrder; + Dock[location].Bar.CheckOrder = CheckBarOrder; + Dock[location].Bar.Add = AddToDock; + Dock[location].Bar.Remove = RemoveFromDock; + Dock[location].Bar.Initialize = ActivateDockletButton; + Dock[location].Bar.Create = CreateBasicToolButton; + Dock[location].Bar.Data = { + Location = location, + Anchor = settings[2], + Modifier = settings[1], + TipAnchor = settings[4], + Default = "", + Buttons = {}, + Windows = {}, + Order = {}, + }; +end + +local function SetSuperDockStyle(dock, isBottom) + if dock.backdrop then return end + + local leftGradient = {} + + local backdrop = CreateFrame("Frame", nil, dock) + backdrop:SetAllPoints(dock) + backdrop:SetFrameStrata("BACKGROUND") + + backdrop.bg = backdrop:CreateTexture(nil, "BORDER") + backdrop.bg:SetAllPointsIn(backdrop) + backdrop.bg:SetTexture(1, 1, 1, 1) + backdrop.bg:SetGradientAlpha("VERTICAL", 0, 0, 0, 0.8, 0, 0, 0, 0) + + backdrop.left = backdrop:CreateTexture(nil, "OVERLAY") + backdrop.left:SetTexture(1, 1, 1, 1) + backdrop.left:SetPointToScale("TOPLEFT", 1, -1) + backdrop.left:SetPointToScale("BOTTOMLEFT", -1, -1) + backdrop.left:SetWidthToScale(4) + if(isBottom) then + backdrop.left:SetGradientAlpha("VERTICAL", 0, 0, 0, 1, 0, 0, 0, 0) + else + backdrop.left:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 1) + end + + backdrop.right = backdrop:CreateTexture(nil, "OVERLAY") + backdrop.right:SetTexture(1, 1, 1, 1) + backdrop.right:SetPointToScale("TOPRIGHT", -1, -1) + backdrop.right:SetPointToScale("BOTTOMRIGHT", -1, -1) + backdrop.right:SetWidthToScale(4) + if(isBottom) then + backdrop.right:SetGradientAlpha("VERTICAL", 0, 0, 0, 1, 0, 0, 0, 0) + else + backdrop.right:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 1) + end + + backdrop.bottom = backdrop:CreateTexture(nil, "OVERLAY") + backdrop.bottom:SetPointToScale("BOTTOMLEFT", 1, -1) + backdrop.bottom:SetPointToScale("BOTTOMRIGHT", -1, -1) + if(isBottom) then + backdrop.bottom:SetTexture(0, 0, 0, 1) + backdrop.bottom:SetHeightToScale(4) + else + backdrop.bottom:SetTexture(0, 0, 0, 0) + backdrop.bottom:SetAlpha(0) + backdrop.bottom:SetHeightToScale(1) + end + + backdrop.top = backdrop:CreateTexture(nil, "OVERLAY") + backdrop.top:SetPointToScale("TOPLEFT", 1, -1) + backdrop.top:SetPointToScale("TOPRIGHT", -1, 1) + if(isBottom) then + backdrop.top:SetTexture(0, 0, 0, 0) + backdrop.top:SetAlpha(0) + backdrop.top:SetHeightToScale(1) + else + backdrop.top:SetTexture(0, 0, 0, 1) + backdrop.top:SetHeightToScale(4) + end + + return backdrop +end + +local function InitDockButton(button) + button:SetPanelColor("default") + button.Icon:SetGradient(unpack(SV.Media.gradient.icon)) + button:SetScript("OnEnter", DockButton_OnEnter) + button:SetScript("OnLeave", DockletButton_OnLeave) + button:SetScript("OnClick", HideSuperDocks) +end + +local function BorderColorUpdates() + Dock.Border.Top:SetBackdropColor(unpack(SV.Media.color.specialdark)) + Dock.Border.Top:SetBackdropBorderColor(0,0,0,1) + Dock.Border.Bottom:SetBackdropColor(unpack(SV.Media.color.default)) + Dock.Border.Bottom:SetBackdropBorderColor(0,0,0,1) +end + +SV.Events:On("SVUI_COLORS_UPDATED", "BorderColorUpdates", BorderColorUpdates) +--[[ +########################################################## +EXTERNALLY ACCESSIBLE METHODS +########################################################## +]]-- +function Dock:SetDockButton(location, displayName, texture, onclick, globalName, tipFunction, primaryTemplate) + if(self.Locations[globalName]) then + location = self.Locations[globalName]; + else + self.Locations[globalName] = location; + end + local parent = self[location] + return parent.Bar:Create(displayName, texture, onclick, globalName, tipFunction, primaryTemplate) +end + +function Dock:GetDimensions(location) + local width, height; + + if(location:find("Left")) then + width = SV.db.Dock.dockLeftWidth; + height = SV.db.Dock.dockLeftHeight; + else + width = SV.db.Dock.dockRightWidth; + height = SV.db.Dock.dockRightHeight; + end + + return width, height; +end + +function Dock:NewDocklet(location, globalName, readableName, texture, onclick) + if(self.Registration[globalName]) then return end; + + if(self.Locations[globalName]) then + location = self.Locations[globalName]; + else + self.Locations[globalName] = location; + end + + local newParent = self[location]; + if(not newParent) then return end + local frame = _G[globalName] or CreateFrame("Frame", globalName, UIParent, "SVUI_DockletWindowTemplate"); + frame:SetParent(newParent.Window); + frame:SetSize(newParent.Window:GetSize()); + frame:SetAllPoints(newParent.Window); + frame:SetFrameStrata("BACKGROUND"); + frame.Parent = newParent + frame.Disable = DockletDisable; + frame.Enable = DockletEnable; + frame.Relocate = DockletRelocate; + frame.GetButtonSize = DockletButtonSize; + + newParent.Bar.Data.Windows[globalName] = frame; + + local buttonName = ("%sButton"):format(globalName) + frame.DockButton = newParent.Bar:Create(readableName, texture, onclick, buttonName); + frame.DockButton.FrameLink = frame + self.Registration[globalName] = frame; + frame:SetAlpha(0) + return frame +end + +function Dock:NewAdvancedDocklet(location, globalName) + if(self.Registration[globalName]) then return end; + + if(self.Locations[globalName]) then + location = self.Locations[globalName]; + else + self.Locations[globalName] = location; + end + + local newParent = self[location]; + if(not newParent) then return end + + local frame = CreateFrame("Frame", globalName, UIParent, "SVUI_DockletWindowTemplate"); + frame:SetParent(newParent.Window); + frame:SetSize(newParent.Window:GetSize()); + frame:SetAllPoints(newParent.Window); + frame:SetFrameStrata("BACKGROUND"); + frame.Parent = newParent + frame.Disable = DockletDisable; + frame.Enable = DockletEnable; + frame.Relocate = DockletRelocate; + frame.GetButtonSize = DockletButtonSize; + + newParent.Bar.Data.Windows[globalName] = frame; + + local height = newParent.Bar.ToolBar:GetHeight(); + local mod = newParent.Bar.Data.Modifier; + local barAnchor = newParent.Bar.Data.Anchor; + local barReverse = SV:GetReversePoint(barAnchor); + local spacing = SV.db.Dock.buttonSpacing; + + frame.Bar = CreateFrame("Frame", nil, newParent); + frame.Bar:SetSize(1, height); + frame.Bar:SetPointToScale(barAnchor, newParent.Bar.ToolBar, barReverse, (spacing * mod), 0) + SV.Mentalo:Add(frame.Bar, globalName .. " Dock Bar"); + + self.Registration[globalName] = frame; + return frame +end +--[[ +########################################################## +BUILD/UPDATE +########################################################## +]]-- +function Dock:UpdateDockBackdrops() + if SV.db.Dock.rightDockBackdrop then + Dock.BottomRight.backdrop:Show() + Dock.BottomRight.backdrop:ClearAllPoints() + Dock.BottomRight.backdrop:SetAllPointsOut(Dock.BottomRight.Window, 4, 4) + + Dock.BottomRight.Alert.backdrop:ClearAllPoints() + Dock.BottomRight.Alert.backdrop:SetAllPointsOut(Dock.BottomRight.Alert, 4, 4) + else + Dock.BottomRight.backdrop:Hide() + end + if SV.db.Dock.leftDockBackdrop then + Dock.BottomLeft.backdrop:Show() + Dock.BottomLeft.backdrop:ClearAllPoints() + Dock.BottomLeft.backdrop:SetAllPointsOut(Dock.BottomLeft.Window, 4, 4) + + Dock.BottomLeft.Alert.backdrop:ClearAllPoints() + Dock.BottomLeft.Alert.backdrop:SetAllPointsOut(Dock.BottomLeft.Alert, 4, 4) + else + Dock.BottomLeft.backdrop:Hide() + end +end + +function Dock:BottomBorderVisibility() + if SV.db.Dock.bottomPanel then + self.Border.Bottom:Show() + else + self.Border.Bottom:Hide() + end +end + +function Dock:TopBorderVisibility() + if SV.db.Dock.topPanel then + self.Border.Top:Show() + else + self.Border.Top:Hide() + end +end + +function Dock:ResetAllButtons() + wipe(SV.cache.Docks.Order) + wipe(SV.cache.Docks.Locations) + ReloadUI() +end + +function Dock:UpdateAllDocks() + for location, settings in pairs(DOCK_LOCATIONS) do + local dock = self[location]; + dock.Bar:Cycle() + dock.Bar:GetDefault() + end +end + +function Dock:Refresh() + local buttonsize = SV.db.Dock.buttonSize; + local spacing = SV.db.Dock.buttonSpacing; + + for location, settings in pairs(DOCK_LOCATIONS) do + if(location ~= "TopRight") then + local width, height = self:GetDimensions(location); + local dock = self[location]; + + dock.Bar:SetSize(width, buttonsize) + dock.Bar.ToolBar:SetHeight(buttonsize) + dock:SetSize(width, height) + dock.Alert:SetSize(width, 1) + dock.Window:SetSize(width, height) + + if(dock.Bar.Button) then + dock.Bar.Button:SetSize(buttonsize, buttonsize) + end + + dock.Bar:Update() + end + end + + self:BottomBorderVisibility(); + self:TopBorderVisibility(); + self:UpdateDockBackdrops(); + + self:RefreshStats(); + + SV.Events:Trigger("DOCKS_UPDATED"); +end + +function Dock:Initialize() + SV.cache.Docks = SV.cache.Docks or {} + + if(not SV.cache.Docks.IsFaded) then + SV.cache.Docks.IsFaded = false + end + + if(not SV.cache.Docks.Order) then + SV.cache.Docks.Order = {} + end + + if(not SV.cache.Docks.Locations) then + SV.cache.Docks.Locations = {} + end + + self.Locations = SV.cache.Docks.Locations; + + local buttonsize = SV.db.Dock.buttonSize; + local spacing = SV.db.Dock.buttonSpacing; + local texture = [[Interface\AddOns\SVUI\assets\artwork\Template\BUTTON]]; + + -- [[ TOP AND BOTTOM BORDERS ]] -- + + self.Border.Top = CreateFrame("Frame", "SVUITopBorder", UIParent) + self.Border.Top:SetPointToScale("TOPLEFT", SV.Screen, "TOPLEFT", -1, 1) + self.Border.Top:SetPointToScale("TOPRIGHT", SV.Screen, "TOPRIGHT", 1, 1) + self.Border.Top:SetHeightToScale(14) + self.Border.Top:SetBackdrop({ + bgFile = texture, + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 1, + insets = {left = 0, right = 0, top = 0, bottom = 0} + }) + self.Border.Top:SetBackdropColor(unpack(SV.Media.color.specialdark)) + self.Border.Top:SetBackdropBorderColor(0,0,0,1) + self.Border.Top:SetFrameLevel(0) + self.Border.Top:SetFrameStrata('BACKGROUND') + self.Border.Top:SetScript("OnShow", function(this) + this:SetFrameLevel(0) + this:SetFrameStrata('BACKGROUND') + end) + self:TopBorderVisibility() + + self.Border.Bottom = CreateFrame("Frame", "SVUIBottomBorder", UIParent) + self.Border.Bottom:SetPointToScale("BOTTOMLEFT", SV.Screen, "BOTTOMLEFT", -1, -1) + self.Border.Bottom:SetPointToScale("BOTTOMRIGHT", SV.Screen, "BOTTOMRIGHT", 1, -1) + self.Border.Bottom:SetHeightToScale(14) + self.Border.Bottom:SetBackdrop({ + bgFile = texture, + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 1, + insets = {left = 0, right = 0, top = 0, bottom = 0} + }) + self.Border.Bottom:SetBackdropColor(unpack(SV.Media.color.default)) + self.Border.Bottom:SetBackdropBorderColor(0,0,0,1) + self.Border.Bottom:SetFrameLevel(0) + self.Border.Bottom:SetFrameStrata('BACKGROUND') + self.Border.Bottom:SetScript("OnShow", function(this) + this:SetFrameLevel(0) + this:SetFrameStrata('BACKGROUND') + end) + self:BottomBorderVisibility() + + for location, settings in pairs(DOCK_LOCATIONS) do + local width, height = self:GetDimensions(location); + local dock = self[location]; + local mod = settings[1]; + local anchor = upper(location); + local reverse = SV:GetReversePoint(anchor); + local barAnchor = settings[2]; + local barReverse = SV:GetReversePoint(barAnchor); + local isBottom = settings[3]; + local vertMod = isBottom and 1 or -1 + + dock.Bar:SetParent(SV.Screen) + dock.Bar:ClearAllPoints() + dock.Bar:SetSize(width, buttonsize) + dock.Bar:SetPoint(anchor, SV.Screen, anchor, (2 * mod), (2 * vertMod)) + + if(not SV.cache.Docks.Order[location]) then + SV.cache.Docks.Order[location] = {} + end + + dock.Bar.Data.Order = SV.cache.Docks.Order[location]; + + dock.Bar.ToolBar:ClearAllPoints() + + if(dock.Bar.Button) then + dock.Bar.Button:SetSize(buttonsize, buttonsize) + dock.Bar.Button:SetStylePanel("Framed") + dock.Bar.ToolBar:SetSize(1, buttonsize) + dock.Bar.ToolBar:SetPointToScale(barAnchor, dock.Bar.Button, barReverse, (spacing * mod), 0) + InitDockButton(dock.Bar.Button) + else + dock.Bar.ToolBar:SetSize(1, buttonsize) + dock.Bar.ToolBar:SetPointToScale(barAnchor, dock.Bar, barAnchor, 0, 0) + end + + dock:SetParent(SV.Screen) + dock:ClearAllPoints() + dock:SetPoint(anchor, dock.Bar, reverse, 0, (12 * vertMod)) + dock:SetSize(width, height) + dock:SetAttribute("buttonSize", buttonsize) + dock:SetAttribute("spacingSize", spacing) + + dock.Alert:ClearAllPoints() + dock.Alert:SetSize(width, 1) + dock.Alert:SetPoint(anchor, dock, anchor, 0, 0) + + dock.Window:ClearAllPoints() + dock.Window:SetSize(width, height) + dock.Window:SetPoint(anchor, dock.Alert, reverse, 0, (4 * vertMod)) + + SV.Mentalo:Add(dock.Bar, location .. " Dock ToolBar"); + + if(isBottom) then + dock.backdrop = SetSuperDockStyle(dock.Window, isBottom) + dock.Alert.backdrop = SetSuperDockStyle(dock.Alert, isBottom) + dock.Alert.backdrop:Hide() + end + + SV.Mentalo:Add(dock, location .. " Dock Window") + end + + if SV.cache.Docks.IsFaded then Dock.BottomLeft:Hide() Dock.BottomRight:Hide() end + + SV:AddToDisplayAudit(self.BottomRight.Window) + SV:AddToDisplayAudit(self.TopLeft) + SV:AddToDisplayAudit(self.TopRight) + + if not InCombatLockdown() then + self.BottomLeft.Bar:Refresh() + self.BottomRight.Bar:Refresh() + self.TopLeft.Bar:Refresh() + self.TopRight.Bar:Refresh() + end + + self:UpdateDockBackdrops() + + self:InitializeStats() +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/docks/dock_stats.lua b/Interface/AddOns/SVUI/framework/docks/dock_stats.lua new file mode 100644 index 0000000..e05823a --- /dev/null +++ b/Interface/AddOns/SVUI/framework/docks/dock_stats.lua @@ -0,0 +1,654 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local print = _G.print; +local ipairs = _G.ipairs; +local pairs = _G.pairs; +local next = _G.next; +local rawset = _G.rawset; +local rawget = _G.rawget; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local string = _G.string; +local math = _G.math; +local table = _G.table; +--[[ STRING METHODS ]]-- +local join, len = string.join, string.len; +--[[ MATH METHODS ]]-- +local min = math.min; +--TABLE +local table = _G.table; +local tsort = table.sort; +local tconcat = table.concat; +local tinsert = _G.tinsert; +local tremove = _G.tremove; +local twipe = _G.wipe; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local LSM = LibStub("LibSharedMedia-3.0") +local LDB = LibStub("LibDataBroker-1.1", true) +local Dock = SV.Dock; + +Dock.TopCenter = _G["SVUI_DockTopCenter"]; +Dock.BottomCenter = _G["SVUI_DockBottomCenter"]; + +Dock.DataHolders = {}; +Dock.DataTypes = {}; +Dock.DataTooltip = CreateFrame("GameTooltip", "SVUI_DataTooltip", UIParent, "GameTooltipTemplate"); + +local PVP_STAT_ORDER = {"Honor", "Kills", "Assists", "Damage", "Healing", "Deaths"}; +local PVP_STAT_LOOKUP = { + ["Name"] = {1, NAME}, + ["Kills"] = {2, KILLS}, + ["Assists"] = {3, PET_ASSIST}, + ["Deaths"] = {4, DEATHS}, + ["Honor"] = {5, HONOR}, + ["Faction"] = {6, FACTION}, + ["Race"] = {7, RACE}, + ["Class"] = {8, CLASS}, + ["Damage"] = {10, DAMAGE}, + ["Healing"] = {11, SHOW_COMBAT_HEALING}, + ["Rating"] = {12, BATTLEGROUND_RATING}, + ["Changes"] = {13, RATING_CHANGE}, + ["Spec"] = {16, SPECIALIZATION} +}; +local DIRTY_LIST = true; +--[[ +########################################################## +LOCALIZED GLOBALS +########################################################## +]]-- +local CUSTOM_CLASS_COLORS = _G.CUSTOM_CLASS_COLORS +local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS +--[[ +########################################################## +LOCAL VARIABLES +########################################################## +]]-- +local playerName = UnitName("player"); +local playerRealm = GetRealmName(); +local BGStatString = "%s: %s" +local myName = UnitName("player"); +local myClass = select(2,UnitClass("player")); +local classColor = RAID_CLASS_COLORS[myClass]; +local SCORE_CACHE = {}; +local hexHighlight = "FFFFFF"; +local StatMenuListing = {} +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- +local UpdateAnchor = function() + local backdrops, width, height = SV.db.Dock.dataBackdrop + for _, parent in pairs(Dock.DataHolders) do + local point1, point2, x, y = "LEFT", "RIGHT", 4, 0; + local slots = parent.Stats.Slots + local numPoints = #slots + if(parent.Stats.Orientation == "VERTICAL") then + width = parent:GetWidth() - 4; + height = parent:GetHeight() / numPoints - 4; + + point1, point2, x, y = "TOP", "BOTTOM", 0, -4 + else + width = parent:GetWidth() / numPoints - 4; + height = parent:GetHeight() - 4; + if(backdrops) then + height = height + 6 + end + end + + for i = 1, numPoints do + slots[i]:SetWidthToScale(width) + slots[i]:SetHeightToScale(height) + if(i == 1) then + slots[i]:SetPointToScale(point1, parent, point1, x, y) + else + slots[i]:SetPointToScale(point1, slots[i - 1], point2, x, y) + end + end + end +end + +local _hook_TooltipOnShow = function(self) + self:SetBackdrop({ + bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + edgeSize = 1 + }) + self:SetBackdropColor(0, 0, 0, 0.8) + self:SetBackdropBorderColor(0, 0, 0) +end + +local function TruncateString(value) + if value >= 1e9 then + return ("%.1fb"):format(value/1e9):gsub("%.?0+([kmb])$","%1") + elseif value >= 1e6 then + return ("%.1fm"):format(value/1e6):gsub("%.?0+([kmb])$","%1") + elseif value >= 1e3 or value <= -1e3 then + return ("%.1fk"):format(value/1e3):gsub("%.?0+([kmb])$","%1") + else + return value + end +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +function Dock:SetDataTip(stat) + local parent = stat:GetParent() + Dock.DataTooltip:Hide() + Dock.DataTooltip:SetOwner(parent, parent.Stats.TooltipAnchor) + Dock.DataTooltip:ClearLines() + GameTooltip:Hide() +end + +function Dock:ShowDataTip(noSpace) + if(not noSpace) then + Dock.DataTooltip:AddLine(" ") + end + Dock.DataTooltip:AddDoubleLine("[Alt + Click]", "Swap Stats", 0, 1, 0, 0.5, 1, 0.5) + Dock.DataTooltip:Show() +end + +local function GetDataSlot(parent, index) + if(not parent.Stats.Slots[index]) then + local GlobalName = parent:GetName() .. 'StatSlot' .. index; + + local slot = CreateFrame("Button", GlobalName, parent); + slot:RegisterForClicks("AnyUp") + + + slot.barframe = CreateFrame("Frame", nil, slot) + + if(SV.db.Dock.dataBackdrop) then + slot.barframe:SetPointToScale("TOPLEFT", slot, "TOPLEFT", 24, -2) + slot.barframe:SetPointToScale("BOTTOMRIGHT", slot, "BOTTOMRIGHT", -2, 2) + slot:SetStylePanel(parent.Stats.templateType, parent.Stats.templateName) + else + slot.barframe:SetPointToScale("TOPLEFT", slot, "TOPLEFT", 24, 2) + slot.barframe:SetPointToScale("BOTTOMRIGHT", slot, "BOTTOMRIGHT", 2, -2) + slot.barframe.bg = slot.barframe:CreateTexture(nil, "BORDER") + slot.barframe.bg:SetAllPointsIn(slot.barframe, 2, 2) + slot.barframe.bg:SetTexture([[Interface\BUTTONS\WHITE8X8]]) + slot.barframe.bg:SetGradient(unpack(SV.Media.gradient.dark)) + end + + slot.barframe:SetFrameLevel(slot:GetFrameLevel()-1) + slot.barframe:SetBackdrop({ + bgFile = [[Interface\BUTTONS\WHITE8X8]], + edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], + tile = false, + tileSize = 0, + edgeSize = 2, + insets = {left = 0, right = 0, top = 0, bottom = 0} + }) + slot.barframe:SetBackdropColor(0, 0, 0, 0.5) + slot.barframe:SetBackdropBorderColor(0, 0, 0, 0.8) + + slot.barframe.icon = CreateFrame("Frame", nil, slot.barframe) + slot.barframe.icon:SetPointToScale("TOPLEFT", slot, "TOPLEFT", 0, 6) + slot.barframe.icon:SetPointToScale("BOTTOMRIGHT", slot, "BOTTOMLEFT", 26, -6) + slot.barframe.icon.texture = slot.barframe.icon:CreateTexture(nil, "OVERLAY") + slot.barframe.icon.texture:SetAllPointsIn(slot.barframe.icon, 2, 2) + slot.barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\PLACEHOLDER") + + slot.barframe.bar = CreateFrame("StatusBar", nil, slot.barframe) + slot.barframe.bar:SetAllPointsIn(slot.barframe, 2, 2) + slot.barframe.bar:SetStatusBarTexture(SV.Media.bar.default) + + slot.barframe.bar.extra = CreateFrame("StatusBar", nil, slot.barframe.bar) + slot.barframe.bar.extra:SetAllPoints() + slot.barframe.bar.extra:SetStatusBarTexture(SV.Media.bar.default) + slot.barframe.bar.extra:Hide() + + slot.barframe:Hide() + + slot.textframe = CreateFrame("Frame", nil, slot) + slot.textframe:SetAllPoints(slot) + slot.textframe:SetFrameStrata(parent.Stats.textStrata) + + slot.text = slot.textframe:CreateFontString(nil, "OVERLAY", nil, 7) + slot.text:SetAllPoints() + + slot.text:FontManager("data") + if(SV.db.Dock.dataBackdrop) then + slot.text:SetShadowColor(0, 0, 0, 0.5) + slot.text:SetShadowOffset(2, -4) + end + + slot.SlotKey = i; + slot.TokenKey = 738; + slot.MenuList = {}; + slot.TokenList = {}; + + parent.Stats.Slots[index] = slot; + return slot; + end + + return parent.Stats.Slots[index]; +end + +function Dock:NewDataHolder(parent, maxCount, tipAnchor, isTop, customTemplate, isVertical, bgEnabled) + DIRTY_LIST = true + + local parentName = parent:GetName(); + + Dock.DataHolders[parentName] = parent; + parent.Stats = {}; + parent.Stats.Slots = {}; + parent.Stats.Orientation = isVertical and "VERTICAL" or "HORIZONTAL"; + parent.Stats.TooltipAnchor = tipAnchor or "ANCHOR_CURSOR"; + parent.Stats.BGEnabled = bgEnabled or false; + + local point1, point2, x, y = "LEFT", "RIGHT", 4, 0; + if(isVertical) then + point1, point2, x, y = "TOP", "BOTTOM", 0, -4; + end + + if(customTemplate) then + parent.Stats.templateType = "Fixed" + parent.Stats.templateName = customTemplate + parent.Stats.textStrata = "LOW" + else + parent.Stats.templateType = "Framed" + parent.Stats.templateName = isTop and "FramedTop" or "FramedBottom" + parent.Stats.textStrata = "MEDIUM" + end + + for i = 1, maxCount do + local slot = GetDataSlot(parent, i) + if(i == 1) then + parent.Stats.Slots[i]:SetPointToScale(point1, parent, point1, x, y) + else + parent.Stats.Slots[i]:SetPointToScale(point1, parent.Stats.Slots[i - 1], point2, x, y) + end + end + + parent:SetScript("OnSizeChanged", UpdateAnchor); + + UpdateAnchor(parent); +end + +function Dock:NewDataType(newStat, eventList, onEvents, update, click, focus, blur, init) + if not newStat then return end + self.DataTypes[newStat] = {} + tinsert(StatMenuListing, newStat) + if type(eventList) == "table" then + self.DataTypes[newStat]["events"] = eventList; + self.DataTypes[newStat]["event_handler"] = onEvents + end + if update and type(update) == "function" then + self.DataTypes[newStat]["update_handler"] = update + end + if click and type(click) == "function" then + self.DataTypes[newStat]["click_handler"] = click + end + if focus and type(focus) == "function" then + self.DataTypes[newStat]["focus_handler"] = focus + end + if blur and type(blur) == "function" then + self.DataTypes[newStat]["blur_handler"] = blur + end + if init and type(init) == "function" then + self.DataTypes[newStat]["init_handler"] = init + end +end + +do + local Stat_OnLeave = function() + Dock.DataTooltip:Hide() + end + + local Parent_OnClick = function(self, button) + if IsAltKeyDown() then + SV.Dropdown:Open(self, self.MenuList); + elseif(self.onClick) then + self.onClick(self, button); + end + end + + local function _load(parent, name, config) + parent.StatParent = name + + if config["init_handler"]then + config["init_handler"](parent) + end + + if config["events"]then + for _, event in pairs(config["events"])do + parent:RegisterEvent(event) + end + end + + if config["event_handler"]then + parent:SetScript("OnEvent", config["event_handler"]) + config["event_handler"](parent, "SVUI_FORCE_RUN") + end + + if config["update_handler"]then + parent:SetScript("OnUpdate", config["update_handler"]) + config["update_handler"](parent, 20000) + end + + if config["click_handler"]then + parent.onClick = config["click_handler"] + end + parent:SetScript("OnClick", Parent_OnClick) + + if config["focus_handler"]then + parent:SetScript("OnEnter", config["focus_handler"]) + end + + if config["blur_handler"]then + parent:SetScript("OnLeave", config["blur_handler"]) + else + parent:SetScript("OnLeave", Stat_OnLeave) + end + + parent:Show() + end + + local BG_OnUpdate = function(self) + local scoreString; + local parentName = self:GetParent():GetName(); + local key = self.SlotKey + local lookup = PVP_STAT_ORDER[key] + local scoreindex = PVP_STAT_LOOKUP[lookup][1] + local scoreType = PVP_STAT_LOOKUP[lookup][2] + local scoreCount = GetNumBattlefieldScores() + for i = 1, scoreCount do + SCORE_CACHE = {GetBattlefieldScore(i)} + if(SCORE_CACHE[1] and SCORE_CACHE[1] == myName and SCORE_CACHE[scoreindex]) then + scoreString = TruncateString(SCORE_CACHE[scoreindex]) + self.text:SetFormattedText(BGStatString, scoreType, scoreString) + break + end + end + end + + local BG_OnEnter = function(self) + Dock:SetDataTip(self) + local bgName; + local mapToken = GetCurrentMapAreaID() + local r, g, b; + if(classColor) then + r, g, b = classColor.r, classColor.g, classColor.b + else + r, g, b = 1, 1, 1 + end + + local scoreCount = GetNumBattlefieldScores() + + for i = 1, scoreCount do + bgName = GetBattlefieldScore(i) + if(bgName and bgName == myName) then + Dock.DataTooltip:AddDoubleLine(L["Stats For:"], bgName, 1, 1, 1, r, g, b) + Dock.DataTooltip:AddLine(" ") + if(mapToken == 443 or mapToken == 626) then + Dock.DataTooltip:AddDoubleLine(L["Flags Captured"], GetBattlefieldStatData(i, 1), 1, 1, 1) + Dock.DataTooltip:AddDoubleLine(L["Flags Returned"], GetBattlefieldStatData(i, 2), 1, 1, 1) + elseif(mapToken == 482) then + Dock.DataTooltip:AddDoubleLine(L["Flags Captured"], GetBattlefieldStatData(i, 1), 1, 1, 1) + elseif(mapToken == 401) then + Dock.DataTooltip:AddDoubleLine(L["Graveyards Assaulted"], GetBattlefieldStatData(i, 1), 1, 1, 1) + Dock.DataTooltip:AddDoubleLine(L["Graveyards Defended"], GetBattlefieldStatData(i, 2), 1, 1, 1) + Dock.DataTooltip:AddDoubleLine(L["Towers Assaulted"], GetBattlefieldStatData(i, 3), 1, 1, 1) + Dock.DataTooltip:AddDoubleLine(L["Towers Defended"], GetBattlefieldStatData(i, 4), 1, 1, 1) + elseif(mapToken == 512) then + Dock.DataTooltip:AddDoubleLine(L["Demolishers Destroyed"], GetBattlefieldStatData(i, 1), 1, 1, 1) + Dock.DataTooltip:AddDoubleLine(L["Gates Destroyed"], GetBattlefieldStatData(i, 2), 1, 1, 1) + elseif(mapToken == 540 or mapToken == 736 or mapToken == 461) then + Dock.DataTooltip:AddDoubleLine(L["Bases Assaulted"], GetBattlefieldStatData(i, 1), 1, 1, 1) + Dock.DataTooltip:AddDoubleLine(L["Bases Defended"], GetBattlefieldStatData(i, 2), 1, 1, 1) + elseif(mapToken == 856) then + Dock.DataTooltip:AddDoubleLine(L["Orb Possessions"], GetBattlefieldStatData(i, 1), 1, 1, 1) + Dock.DataTooltip:AddDoubleLine(L["Victory Points"], GetBattlefieldStatData(i, 2), 1, 1, 1) + elseif(mapToken == 860) then + Dock.DataTooltip:AddDoubleLine(L["Carts Controlled"], GetBattlefieldStatData(i, 1), 1, 1, 1) + end + break + end + end + Dock:ShowDataTip() + end + + local ForceHideBGStats; + local BG_OnClick = function() + ForceHideBGStats = true; + Dock:UpdateDataSlots() + SV:AddonMessage(L["Battleground statistics temporarily hidden, to show type \"/sv bg\" or \"/sv pvp\""]) + end + + local function setMenuLists() + local anchorTable = Dock.DataHolders; + local statMenu = StatMenuListing; + + tsort(statMenu) + + for place, parent in pairs(anchorTable) do + local slots = parent.Stats.Slots; + local numPoints = #slots; + for i = 1, numPoints do + local subList = twipe(slots[i].MenuList) + tinsert(subList,{text = NONE, func = function() Dock:ChangeDBVar("", i, "dataHolders", place); Dock:UpdateDataSlots() end}); + for _,name in pairs(statMenu) do + tinsert(subList,{text = name, func = function() Dock:ChangeDBVar(name, i, "dataHolders", place); Dock:UpdateDataSlots() end}); + end + end + end + + DIRTY_LIST = false; + end + + function Dock:UpdateDataSlots() + if(DIRTY_LIST) then setMenuLists() end + + local instance, groupType = IsInInstance() + local anchorTable = self.DataHolders + local statTable = self.DataTypes + local db = SV.db.Dock + local allowPvP = (db.battleground and not ForceHideBGStats) or false + + for place, parent in pairs(anchorTable) do + local slots = parent.Stats.Slots; + local numPoints = #slots; + + for i = 1, numPoints do + local pvpTable = (allowPvP and parent.Stats.BGEnabled) and PVP_STAT_ORDER[i] + local slot = slots[i]; + + slot:UnregisterAllEvents() + slot:SetScript("OnUpdate", nil) + slot:SetScript("OnEnter", nil) + slot:SetScript("OnLeave", nil) + slot:SetScript("OnClick", nil) + + if(db.dataBackdrop) then + slot.text:SetFont(LSM:Fetch("font", db.dataFont), db.dataFontSize, "NONE") + else + slot.text:SetFont(LSM:Fetch("font", db.dataFont), db.dataFontSize, db.dataFontOutline) + end + + slot.text:SetText(nil) + + if slot.barframe then + slot.barframe:Hide() + end + + slot:Hide() + + if(pvpTable and ((instance and groupType == "pvp") or parent.lockedOpen)) then + slot:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") + slot:SetScript("OnEvent", BG_OnUpdate) + slot:SetScript("OnEnter", BG_OnEnter) + slot:SetScript("OnLeave", Stat_OnLeave) + slot:SetScript("OnClick", BG_OnClick) + + BG_OnUpdate(slot) + + slot:Show() + else + for name, config in pairs(statTable) do + for panelName, panelData in pairs(db.dataHolders) do + if(panelData and type(panelData) == "table") then + if(panelName == place and panelData[i] and panelData[i] == name) then + _load(slot, name, config) + end + elseif(panelData and type(panelData) == "string" and panelData == name) then + if(name == place) then + _load(slot, name, config) + end + end + end + end + end + end + end + + if ForceHideBGStats then ForceHideBGStats = nil end + end +end +--[[ +########################################################## +BUILD FUNCTION / UPDATE +########################################################## +]]-- +function Dock:SetAccountantData(dataType, cacheType, defaultValue) + self.Accountant[dataType] = self.Accountant[dataType] or {}; + local cache = self.Accountant[dataType]; + if(not cache[playerName] or type(cache[playerName]) ~= cacheType) then + cache[playerName] = defaultValue; + end +end + +function Dock:RefreshStats() + local centerWidth = SV.db.Dock.dockCenterWidth; + local centerHeight = SV.db.Dock.dockCenterHeight; + + self.BottomCenter:SetSize(centerWidth, centerHeight); + self.TopCenter:SetSize(centerWidth, centerHeight); + + self:UpdateDataSlots(); +end + +function Dock:InitializeStats() + local centerWidth = SV.db.Dock.dockCenterWidth; + local centerHeight = SV.db.Dock.dockCenterHeight; + + hexHighlight = SV:HexColor("highlight") or "FFFFFF" + local hexClass = classColor.colorStr + BGStatString = "|cff" .. hexHighlight .. "%s: |c" .. hexClass .. "%s|r"; + + local accountant = LibSuperVillain("Registry"):NewGlobal("Accountant") + accountant[playerRealm] = accountant[playerRealm] or {}; + self.Accountant = accountant[playerRealm]; + + --BOTTOM CENTER BAR + self.BottomCenter:SetParent(SV.Screen) + self.BottomCenter:ClearAllPoints() + self.BottomCenter:SetSize(centerWidth, centerHeight) + self.BottomCenter:SetPoint("BOTTOM", SV.Screen, "BOTTOM", 0, 0) + SV.Mentalo:Add(self.BottomCenter, L["Bottom Data Dock"]) + self:NewDataHolder(self.BottomCenter, 6, "ANCHOR_CURSOR") + --SV:AddToDisplayAudit(self.BottomCenter) + + --TOP CENTER BAR + self.TopCenter:SetParent(SV.Screen) + self.TopCenter:ClearAllPoints() + self.TopCenter:SetSize(centerWidth, centerHeight) + self.TopCenter:SetPoint("TOP", SV.Screen, "TOP", 0, 0) + SV.Mentalo:Add(self.TopCenter, L["Top Data Dock"]) + self:NewDataHolder(self.TopCenter, 6, "ANCHOR_CURSOR") + SV:AddToDisplayAudit(self.TopCenter) + + -- self.DataTooltip:SetParent(SV.Screen) + self.DataTooltip:SetFrameStrata("DIALOG") + self.DataTooltip:HookScript("OnShow", _hook_TooltipOnShow) + + if(LDB) then + for dataName, dataObj in LDB:DataObjectIterator() do + + local OnEnter, OnLeave, OnClick, lastObj; + + if dataObj.OnTooltipShow then + function OnEnter(self) + Dock:SetDataTip(self) + dataObj.OnTooltipShow(Dock.DataTooltip) + Dock:ShowDataTip() + end + end + + if dataObj.OnEnter then + function OnEnter(self) + Dock:SetDataTip(self) + dataObj.OnEnter(Dock.DataTooltip) + Dock:ShowDataTip() + end + end + + if dataObj.OnLeave then + function OnLeave(self) + dataObj.OnLeave(self) + Dock.DataTooltip:Hide() + end + end + + if dataObj.OnClick then + function OnClick(self, button) + dataObj.OnClick(self, button) + end + end + + local function textUpdate(event, name, key, value, dataobj) + if value == nil or (len(value) > 5) or value == 'n/a' or name == value then + lastObj.text:SetText(value ~= 'n/a' and value or name) + else + lastObj.text:SetText(name..': '.. '|cff' .. hexHighlight ..value..'|r') + end + end + + local function OnEvent(self) + lastObj = self; + LDB:RegisterCallback("LibDataBroker_AttributeChanged_"..dataName.."_text", textUpdate) + LDB:RegisterCallback("LibDataBroker_AttributeChanged_"..dataName.."_value", textUpdate) + LDB.callbacks:Fire("LibDataBroker_AttributeChanged_"..dataName.."_text", dataName, nil, dataObj.text, dataObj) + end + + Dock:NewDataType(dataName, {"PLAYER_ENTERING_WORLD"}, OnEvent, nil, OnClick, OnEnter, OnLeave) + end + end + + self:UpdateDataSlots() + self:RegisterEvent("PLAYER_ENTERING_WORLD", "Generate"); +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/docks/docks.lua b/Interface/AddOns/SVUI/framework/docks/docks.lua deleted file mode 100644 index ed8cc66..0000000 --- a/Interface/AddOns/SVUI/framework/docks/docks.lua +++ /dev/null @@ -1,1154 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local assert = _G.assert; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local print = _G.print; -local ipairs = _G.ipairs; -local pairs = _G.pairs; -local tostring = _G.tostring; -local tonumber = _G.tonumber; - ---STRING -local string = _G.string; -local upper = string.upper; -local format = string.format; -local find = string.find; -local match = string.match; -local gsub = string.gsub; ---TABLE -local table = _G.table; -local tinsert = _G.tinsert; -local tremove = _G.tremove; -local twipe = _G.wipe; ---MATH -local math = _G.math; -local min = math.min; -local floor = math.floor -local ceil = math.ceil ---BLIZZARD API -local GameTooltip = _G.GameTooltip; -local InCombatLockdown = _G.InCombatLockdown; -local CreateFrame = _G.CreateFrame; -local GetTime = _G.GetTime; -local GetItemCooldown = _G.GetItemCooldown; -local GetItemCount = _G.GetItemCount; -local GetItemInfo = _G.GetItemInfo; -local GetSpellInfo = _G.GetSpellInfo; -local IsSpellKnown = _G.IsSpellKnown; -local GetProfessions = _G.GetProfessions; -local GetProfessionInfo = _G.GetProfessionInfo; -local hooksecurefunc = _G.hooksecurefunc; ---[[ -########################################################## -ADDON -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L; -local SVLib = LibSuperVillain("Registry"); ---[[ -########################################################## -DOCKING -########################################################## -]]-- -local ORDER_TEMP = {}; -local ORDER_TEST = {}; - -local DOCK_LOCATIONS = { - ["BottomLeft"] = {1, "LEFT", true, "ANCHOR_TOPLEFT"}, - ["BottomRight"] = {-1, "RIGHT", true, "ANCHOR_TOPLEFT"}, - ["TopLeft"] = {1, "LEFT", false, "ANCHOR_BOTTOMLEFT"}, - ["TopRight"] = {-1, "RIGHT", false, "ANCHOR_BOTTOMLEFT"}, -}; - -local STAT_LOCATIONS = { - ["BottomCenter"] = {1, "LEFT", true, "ANCHOR_TOPLEFT"}, - ["TopCenter"] = {1, "LEFT", false, "ANCHOR_BOTTOMLEFT"}, -}; - -local Dock = SV:NewSubClass("Dock", L["Docks"]); - -Dock.Border = {}; -Dock.Registration = {}; -Dock.Locations = {}; - -local DOCK_DROPDOWN_OPTIONS = {}; - -DOCK_DROPDOWN_OPTIONS["BottomLeft"] = { text = "To BottomLeft", func = function(button) Dock.BottomLeft.Bar:Add(button) end }; -DOCK_DROPDOWN_OPTIONS["BottomRight"] = { text = "To BottomRight", func = function(button) Dock.BottomRight.Bar:Add(button) end }; -DOCK_DROPDOWN_OPTIONS["TopLeft"] = { text = "To TopLeft", func = function(button) Dock.TopLeft.Bar:Add(button) end }; ---DOCK_DROPDOWN_OPTIONS["TopRight"] = { text = "To TopRight", func = function(button) Dock.TopRight.Bar:Add(button) end }; ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -_G.HideSuperDocks = function(self, button) - GameTooltip:Hide() - if(button and IsAltKeyDown()) then - SV:StaticPopup_Show('RESETDOCKS_CHECK') - else - if SV.cache.Docks.IsFaded then - SV.cache.Docks.IsFaded = nil; - SV:SecureFadeIn(Dock.BottomLeft, 0.2, Dock.BottomLeft:GetAlpha(), 1) - SV:SecureFadeIn(Dock.BottomLeft.Bar, 0.2, Dock.BottomLeft.Bar:GetAlpha(), 1) - SV:SecureFadeIn(Dock.BottomRight, 0.2, Dock.BottomRight:GetAlpha(), 1) - SV:SecureFadeIn(Dock.BottomRight.Bar, 0.2, Dock.BottomRight.Bar:GetAlpha(), 1) - SVLib:Trigger("DOCKS_FADE_IN"); - else - SV.cache.Docks.IsFaded = true; - SV:SecureFadeOut(Dock.BottomLeft, 0.2, Dock.BottomLeft:GetAlpha(), 0, true) - SV:SecureFadeOut(Dock.BottomLeft.Bar, 0.2, Dock.BottomLeft.Bar:GetAlpha(), 0, true) - SV:SecureFadeOut(Dock.BottomRight, 0.2, Dock.BottomRight:GetAlpha(), 0, true) - SV:SecureFadeOut(Dock.BottomRight.Bar, 0.2, Dock.BottomRight.Bar:GetAlpha(), 0, true) - SVLib:Trigger("DOCKS_FADE_OUT"); - end - end -end - -function Dock:EnterFade() - if SV.cache.Docks.IsFaded then - self.BottomLeft:Show() - SV:SecureFadeIn(self.BottomLeft, 0.2, self.BottomLeft:GetAlpha(), 1) - SV:SecureFadeIn(self.BottomLeft.Bar, 0.2, self.BottomLeft.Bar:GetAlpha(), 1) - self.BottomRight:Show() - SV:SecureFadeIn(self.BottomRight, 0.2, self.BottomRight:GetAlpha(), 1) - SV:SecureFadeIn(self.BottomRight.Bar, 0.2, self.BottomRight.Bar:GetAlpha(), 1) - SVLib:Trigger("DOCKS_FADE_IN"); - end -end - -function Dock:ExitFade() - if SV.cache.Docks.IsFaded then - SV:SecureFadeOut(self.BottomLeft, 2, self.BottomLeft:GetAlpha(), 0, true) - SV:SecureFadeOut(self.BottomLeft.Bar, 2, self.BottomLeft.Bar:GetAlpha(), 0, true) - SV:SecureFadeOut(self.BottomRight, 2, self.BottomRight:GetAlpha(), 0, true) - SV:SecureFadeOut(self.BottomRight.Bar, 2, self.BottomRight.Bar:GetAlpha(), 0, true) - SVLib:Trigger("DOCKS_FADE_OUT"); - end -end ---[[ -########################################################## -SET DOCKBAR FUNCTIONS -########################################################## -]]-- -local RefreshDockWindows = function(self) - -- print(table.dump(self.Data.Windows)) - for name,window in pairs(self.Data.Windows) do - if(window) then - if((window.IsProtected and not window:IsProtected()) or (not InCombatLockdown())) then - if(window.DockButton) then - window.DockButton:Deactivate() - end - if window.Hide then - window:Hide() - end - end - else - print("Error: No Window Found (" .. name .. ")") - end - end -end - -local RefreshDockButtons = function(self) - for name,docklet in pairs(Dock.Registration) do - if(docklet) then - if((docklet.IsProtected and not docklet:IsProtected()) or (not InCombatLockdown())) then - if(docklet.DockButton) then - docklet.DockButton:Deactivate() - end - if docklet.Hide then - docklet:Hide() - end - end - end - end -end - -local GetDefault = function(self) - local default = self.Data.Default - local button = _G[default] - if(button) then - local window = button:GetAttribute("ownerFrame") - if window and _G[window] then - self:Refresh() - self.Parent.Window.FrameLink = _G[window] - if(not self.Parent.Window:IsShown() and (not InCombatLockdown())) then - self.Parent.Window:Show() - end - if(InCombatLockdown() and (_G[window].IsProtected and _G[window]:IsProtected())) then return end - _G[window]:Show() - button:Activate() - end - end -end - -local OldDefault = function(self) - local default = self.Data.OriginalDefault - local button = _G[default] - if(button) then - local window = button:GetAttribute("ownerFrame") - if window and _G[window] then - self:Refresh() - self.Parent.Window.FrameLink = _G[window] - if(not self.Parent.Window:IsShown() and (not InCombatLockdown())) then - self.Parent.Window:Show() - end - if(InCombatLockdown() and (_G[window].IsProtected and _G[window]:IsProtected())) then return end - _G[window]:Show() - button:Activate() - end - end -end - -local ToggleDockletWindow = function(self, button) - local frame = button.FrameLink - if(frame and frame.Show and (not frame:IsShown())) then - self.Parent.Window.FrameLink = frame - - if(not self.Parent.Window:IsShown() and (not InCombatLockdown())) then - self.Parent.Window:Show() - end - self:Cycle() - if(InCombatLockdown() and (frame.IsProtected and frame:IsProtected())) then return end - frame:Show() - button:Activate() - else - button:Deactivate() - self:GetDefault() - end -end - -local AlertActivate = function(self, child) - local size = SV.db.Dock.buttonSize or 22; - self:Height(size) - self.backdrop:Show() - child:ClearAllPoints() - child:SetAllPoints(self) -end - -local AlertDeactivate = function(self) - self.backdrop:Hide() - self:Height(1) -end - -local Docklet_OnShow = function(self) - local frame = self.FrameLink - if(frame and frame.Show) then - if(InCombatLockdown() and (frame.IsProtected and frame:IsProtected())) then return end - frame:Show() - end -end - -local Docklet_OnHide = function(self) - local frame = self.FrameLink - if(frame and frame.Hide) then - if(InCombatLockdown() and (frame.IsProtected and frame:IsProtected())) then return end - frame:Hide() - end -end - -local DockButtonMakeDefault = function(self) - self.Parent.Data.Default = self:GetName() - self.Parent:GetDefault() - if(not self.Parent.Data.OriginalDefault) then - self.Parent.Data.OriginalDefault = self:GetName() - end -end - -local DockButtonActivate = function(self) - self:SetAttribute("isActive", true) - self:SetPanelColor("green") - self.Icon:SetGradient(unpack(SV.Media.gradient.green)) - if(self.FrameLink) then - self.FrameLink:Show() - end -end - -local DockButtonDeactivate = function(self) - self:SetAttribute("isActive", false) - self:SetPanelColor("default") - self.Icon:SetGradient(unpack(SV.Media.gradient.icon)) - if(self.FrameLink) then - self.FrameLink:Hide() - end -end - -local DockButton_OnEnter = function(self, ...) - Dock:EnterFade() - - self:SetPanelColor("highlight") - self.Icon:SetGradient(unpack(SV.Media.gradient.bizzaro)) - - GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) - GameTooltip:ClearLines() - local tipText = self:GetAttribute("tipText") - GameTooltip:AddDoubleLine("[Left-Click]", tipText, 0, 1, 0, 1, 1, 1) - GameTooltip:AddLine(" ") - GameTooltip:AddDoubleLine("[Alt + Click]", "Reset Dock Buttons", 0, 0.5, 1, 0.5, 1, 0.5) - GameTooltip:Show() -end - -local DockletButton_OnEnter = function(self, ...) - Dock:EnterFade() - - self:SetPanelColor("highlight") - self.Icon:SetGradient(unpack(SV.Media.gradient.bizzaro)) - - local tipAnchor = self:GetAttribute("tipAnchor") - GameTooltip:SetOwner(self, tipAnchor, 0, 4) - GameTooltip:ClearLines() - if(self.CustomTooltip) then - self:CustomTooltip() - else - local tipText = self:GetAttribute("tipText") - GameTooltip:AddDoubleLine("[Left-Click]", tipText, 0, 1, 0, 1, 1, 1) - end - if(self:GetAttribute("hasDropDown") and self.GetMenuList) then - GameTooltip:AddLine(" ") - GameTooltip:AddDoubleLine("[Alt + Click]", "Docking Options", 0, 0.5, 1, 0.5, 1, 0.5) - end - GameTooltip:Show() -end - -local DockletButton_OnLeave = function(self, ...) - Dock:ExitFade() - - if(self:GetAttribute("isActive")) then - self:SetPanelColor("green") - self.Icon:SetGradient(unpack(SV.Media.gradient.green)) - else - self:SetPanelColor("default") - self.Icon:SetGradient(unpack(SV.Media.gradient.icon)) - end - - GameTooltip:Hide() -end - -local DockletButton_OnClick = function(self, button) - --if InCombatLockdown() then return end - if(IsAltKeyDown() and (not InCombatLockdown()) and self:GetAttribute("hasDropDown") and self.GetMenuList) then - local list = self:GetMenuList() - SV.Dropdown:Open(self, list); - else - if self.PostClickFunction then - self:PostClickFunction() - else - self.Parent:Toggle(self) - end - end -end - -local DockletButton_OnPostClick = function(self, button) - if InCombatLockdown() then return end - if(IsAltKeyDown() and self:GetAttribute("hasDropDown") and self.GetMenuList) then - local list = self:GetMenuList() - SV.Dropdown:Open(self, list); - end -end - -local DockletEnable = function(self) - local dock = self.Parent; - if(self.DockButton) then dock.Bar:Add(self.DockButton) end -end - -local DockletDisable = function(self) - local dock = self.Parent; - if(self.DockButton) then dock.Bar:Remove(self.DockButton) end -end - -local DockletButtonSize = function(self) - local size = self.Bar.ToolBar:GetHeight() or 30; - return size; -end - -local DockletRelocate = function(self, location) - local newParent = Dock[location]; - - if(not newParent) then return end - - if(self.DockButton) then - newParent.Bar:Add(self.DockButton) - end - - if(self.Bar) then - local height = newParent.Bar.ToolBar:GetHeight(); - local mod = newParent.Bar.Data[1]; - local barAnchor = newParent.Bar.Data[2]; - local barReverse = SV:GetReversePoint(barAnchor); - local spacing = SV.db.Dock.buttonSpacing; - - self.Bar:ClearAllPoints(); - self.Bar:Point(barAnchor, newParent.Bar.ToolBar, barReverse, (spacing * mod), 0) - end -end - -local GetDockablePositions = function(self) - local button = self; - local name = button:GetName(); - local currentLocation = Dock.Locations[name]; - local t; - - if(self.GetPreMenuList) then - t = self:GetPreMenuList(); - tinsert(t, { title = "Move This", divider = true }) - else - t = {{ title = "Move This", divider = true }}; - end - - for location,option in pairs(DOCK_DROPDOWN_OPTIONS) do - if(currentLocation ~= location) then - tinsert(t, option); - end - end - - tinsert(t, { title = "Re-Order", divider = true }); - - for i=1, #button.Parent.Data.Order do - if(i ~= button.OrderIndex) then - local positionText = ("Position #%d"):format(i); - tinsert(t, { text = positionText, func = function() button.Parent:ChangeOrder(button, i) end }); - end - end - - return t; -end - -local ChangeBarOrder = function(self, button, targetIndex) - local targetName = button:GetName(); - local currentIndex = button.OrderIndex; - wipe(ORDER_TEST); - wipe(ORDER_TEMP); - for i = 1, #self.Data.Order do - local nextName = self.Data.Order[i]; - if(i == targetIndex) then - if(currentIndex > targetIndex) then - tinsert(ORDER_TEMP, targetName) - tinsert(ORDER_TEMP, nextName) - else - tinsert(ORDER_TEMP, nextName) - tinsert(ORDER_TEMP, targetName) - end - elseif(targetName ~= nextName) then - tinsert(ORDER_TEMP, nextName) - end - end - - wipe(self.Data.Order); - local safeIndex = 1; - for i = 1, #ORDER_TEMP do - local nextName = ORDER_TEMP[i]; - local nextButton = self.Data.Buttons[nextName]; - if(nextButton and (not ORDER_TEST[nextName])) then - ORDER_TEST[nextName] = true - tinsert(self.Data.Order, nextName); - nextButton.OrderIndex = safeIndex; - safeIndex = safeIndex + 1; - end - end - - self:Update() -end - -local RefreshBarOrder = function(self) - wipe(ORDER_TEST); - wipe(ORDER_TEMP); - for i = 1, #self.Data.Order do - local nextName = self.Data.Order[i]; - tinsert(ORDER_TEMP, nextName) - end - wipe(self.Data.Order); - local safeIndex = 1; - for i = 1, #ORDER_TEMP do - local nextName = ORDER_TEMP[i]; - local nextButton = self.Data.Buttons[nextName]; - if(nextButton and (not ORDER_TEST[nextName])) then - ORDER_TEST[nextName] = true - tinsert(self.Data.Order, nextName); - nextButton.OrderIndex = safeIndex; - safeIndex = safeIndex + 1; - end - end -end - -local CheckBarOrder = function(self, targetName) - local found = false; - for i = 1, #self.Data.Order do - if(self.Data.Order[i] == targetName) then - found = true; - end - end - if(not found) then - tinsert(self.Data.Order, targetName); - self:UpdateOrder(); - end -end - -local RefreshBarLayout = function(self) - local anchor = upper(self.Data.Location) - local mod = self.Data.Modifier - local size = self.ToolBar:GetHeight(); - local count = #self.Data.Order; - local offset = 1; - local safeIndex = 1; - for i = 1, count do - local nextName = self.Data.Order[i]; - local nextButton = self.Data.Buttons[nextName]; - if(nextButton) then - offset = (safeIndex - 1) * (size + 6) + 6 - nextButton:ClearAllPoints(); - nextButton:SetSize(size, size); - nextButton:SetPoint(anchor, self.ToolBar, anchor, (offset * mod), 0); - if(not nextButton:IsShown()) then - nextButton:Show(); - end - nextButton.OrderIndex = safeIndex; - safeIndex = safeIndex + 1; - end - end - - self.ToolBar:SetWidth(offset + size); - - if(SV.Dropdown:IsShown()) then - ToggleFrame(SV.Dropdown) - end -end - -local AddToDock = function(self, button) - if not button then return end - local name = button:GetName(); - if(self.Data.Buttons[name]) then return end - - local registeredLocation = Dock.Locations[name] - local currentLocation = self.Data.Location - - if(registeredLocation) then - if(registeredLocation ~= currentLocation) then - if(Dock[registeredLocation].Bar.Data.Buttons[name]) then - Dock[registeredLocation].Bar:Remove(button); - else - Dock[registeredLocation].Bar:Add(button); - return - end - end - end - - self.Data.Buttons[name] = button; - self:CheckOrder(name); - - Dock.Locations[name] = currentLocation; - button.Parent = self; - button:SetParent(self.ToolBar); - - if(button.FrameLink) then - local frame = button.FrameLink - local frameName = frame:GetName() - self.Data.Windows[frameName] = frame; - Dock.Locations[frameName] = currentLocation; - frame:ClearAllPoints() - frame:SetParent(self.Parent.Window) - frame:FillInner(self.Parent.Window) - - frame.Parent = self.Parent - end - - -- self:UpdateOrder() - self:Update() -end - -local RemoveFromDock = function(self, button) - if not button then return end - local name = button:GetName(); - local registeredLocation = Dock.Locations[name]; - local currentLocation = self.Data.Location - - if(registeredLocation and (registeredLocation == currentLocation)) then - Dock.Locations[name] = nil; - end - - for i = 1, #self.Data.Order do - local nextName = self.Data.Order[i]; - if(nextName == name) then - tremove(self.Data.Order, i); - break; - end - end - - if(not self.Data.Buttons[name]) then return end - - button:Hide() - if(button.FrameLink) then - local frameName = button.FrameLink:GetName() - Dock.Locations[frameName] = nil; - button.FrameLink:Hide() - self.Data.Windows[frameName] = nil; - end - - button.OrderIndex = 0; - self.Data.Buttons[name] = nil; - self:UpdateOrder() - self:Update() -end - -local ActivateDockletButton = function(self, button, clickFunction, tipFunction, isAction) - button.Activate = DockButtonActivate - button.Deactivate = DockButtonDeactivate - button.MakeDefault = DockButtonMakeDefault - button.GetMenuList = GetDockablePositions - - if(tipFunction and type(tipFunction) == "function") then - button.CustomTooltip = tipFunction - end - - button.Parent = self - button:SetPanelColor("default") - button.Icon:SetGradient(unpack(SV.Media.gradient.icon)) - button:SetScript("OnEnter", DockletButton_OnEnter) - button:SetScript("OnLeave", DockletButton_OnLeave) - if(not isAction) then - button:SetScript("OnClick", DockletButton_OnClick) - else - button:SetScript("PostClick", DockletButton_OnPostClick) - end - - if(clickFunction and type(clickFunction) == "function") then - button.PostClickFunction = clickFunction - end -end - -local CreateBasicToolButton = function(self, displayName, texture, onclick, globalName, tipFunction, primaryTemplate) - local dockIcon = texture or [[Interface\AddOns\SVUI\assets\artwork\Icons\SVUI-ICON]]; - local size = self.ToolBar:GetHeight(); - local template = "SVUI_DockletButtonTemplate" - - if(primaryTemplate) then - template = primaryTemplate .. ", SVUI_DockletButtonTemplate" - end - - local button = _G[globalName .. "DockletButton"] or CreateFrame("Button", globalName, self.ToolBar, template) - - button:ClearAllPoints() - button:SetSize(size, size) - button:SetFramedButtonTemplate() - button.Icon:SetTexture(dockIcon) - button:SetAttribute("tipText", displayName) - button:SetAttribute("tipAnchor", self.Data.TipAnchor) - button:SetAttribute("ownerFrame", globalName) - - button.OrderIndex = 0; - - self:Add(button) - self:Initialize(button, onclick, tipFunction, primaryTemplate) - - return button -end ---[[ -########################################################## -DOCKS -########################################################## -]]-- -for location, settings in pairs(DOCK_LOCATIONS) do - Dock[location] = _G["SVUI_Dock" .. location]; - Dock[location].Bar = _G["SVUI_DockBar" .. location]; - - Dock[location].Alert.Activate = AlertActivate; - Dock[location].Alert.Deactivate = AlertDeactivate; - - Dock[location].Bar.Parent = Dock[location]; - Dock[location].Bar.Refresh = RefreshDockButtons; - Dock[location].Bar.Cycle = RefreshDockWindows; - Dock[location].Bar.GetDefault = GetDefault; - Dock[location].Bar.UnsetDefault = OldDefault; - Dock[location].Bar.Toggle = ToggleDockletWindow; - Dock[location].Bar.Update = RefreshBarLayout; - Dock[location].Bar.UpdateOrder = RefreshBarOrder; - Dock[location].Bar.ChangeOrder = ChangeBarOrder; - Dock[location].Bar.CheckOrder = CheckBarOrder; - Dock[location].Bar.Add = AddToDock; - Dock[location].Bar.Remove = RemoveFromDock; - Dock[location].Bar.Initialize = ActivateDockletButton; - Dock[location].Bar.Create = CreateBasicToolButton; - Dock[location].Bar.Data = { - Location = location, - Anchor = settings[2], - Modifier = settings[1], - TipAnchor = settings[4], - Default = "", - Buttons = {}, - Windows = {}, - Order = {}, - }; -end - -for location, settings in pairs(STAT_LOCATIONS) do - Dock[location] = _G["SVUI_Dock" .. location]; -end - -local function SetSuperDockStyle(dock, isBottom) - if dock.backdrop then return end - - local leftGradient = {} - - local backdrop = CreateFrame("Frame", nil, dock) - backdrop:SetAllPoints(dock) - backdrop:SetFrameStrata("BACKGROUND") - - backdrop.bg = backdrop:CreateTexture(nil, "BORDER") - backdrop.bg:FillInner(backdrop) - backdrop.bg:SetTexture(1, 1, 1, 1) - backdrop.bg:SetGradientAlpha("VERTICAL", 0, 0, 0, 0.8, 0, 0, 0, 0) - - backdrop.left = backdrop:CreateTexture(nil, "OVERLAY") - backdrop.left:SetTexture(1, 1, 1, 1) - backdrop.left:Point("TOPLEFT", 1, -1) - backdrop.left:Point("BOTTOMLEFT", -1, -1) - backdrop.left:Width(4) - if(isBottom) then - backdrop.left:SetGradientAlpha("VERTICAL", 0, 0, 0, 1, 0, 0, 0, 0) - else - backdrop.left:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 1) - end - - backdrop.right = backdrop:CreateTexture(nil, "OVERLAY") - backdrop.right:SetTexture(1, 1, 1, 1) - backdrop.right:Point("TOPRIGHT", -1, -1) - backdrop.right:Point("BOTTOMRIGHT", -1, -1) - backdrop.right:Width(4) - if(isBottom) then - backdrop.right:SetGradientAlpha("VERTICAL", 0, 0, 0, 1, 0, 0, 0, 0) - else - backdrop.right:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 1) - end - - backdrop.bottom = backdrop:CreateTexture(nil, "OVERLAY") - backdrop.bottom:Point("BOTTOMLEFT", 1, -1) - backdrop.bottom:Point("BOTTOMRIGHT", -1, -1) - if(isBottom) then - backdrop.bottom:SetTexture(0, 0, 0, 1) - backdrop.bottom:Height(4) - else - backdrop.bottom:SetTexture(0, 0, 0, 0) - backdrop.bottom:SetAlpha(0) - backdrop.bottom:Height(1) - end - - backdrop.top = backdrop:CreateTexture(nil, "OVERLAY") - backdrop.top:Point("TOPLEFT", 1, -1) - backdrop.top:Point("TOPRIGHT", -1, 1) - if(isBottom) then - backdrop.top:SetTexture(0, 0, 0, 0) - backdrop.top:SetAlpha(0) - backdrop.top:Height(1) - else - backdrop.top:SetTexture(0, 0, 0, 1) - backdrop.top:Height(4) - end - - return backdrop -end - -local function InitDockButton(button) - button:SetPanelColor("default") - button.Icon:SetGradient(unpack(SV.Media.gradient.icon)) - button:SetScript("OnEnter", DockButton_OnEnter) - button:SetScript("OnLeave", DockletButton_OnLeave) - button:SetScript("OnClick", HideSuperDocks) -end - -local function BorderColorUpdates() - Dock.Border.Top:SetBackdropColor(unpack(SV.Media.color.specialdark)) - Dock.Border.Top:SetBackdropBorderColor(0,0,0,1) - Dock.Border.Bottom:SetBackdropColor(unpack(SV.Media.color.special)) - Dock.Border.Bottom:SetBackdropBorderColor(0,0,0,1) -end - -LibSuperVillain("Registry"):NewCallback("CORE_MEDIA_UPDATED", "BorderColorUpdates", BorderColorUpdates) ---[[ -########################################################## -EXTERNALLY ACCESSIBLE METHODS -########################################################## -]]-- -function Dock:SetDockButton(location, displayName, texture, onclick, globalName, tipFunction, primaryTemplate) - if(self.Locations[globalName]) then - location = self.Locations[globalName]; - else - self.Locations[globalName] = location; - end - local parent = self[location] - return parent.Bar:Create(displayName, texture, onclick, globalName, tipFunction, primaryTemplate) -end - -function Dock:GetDimensions(location) - local width, height; - - if(location:find("Left")) then - width = SV.db.Dock.dockLeftWidth; - height = SV.db.Dock.dockLeftHeight; - else - width = SV.db.Dock.dockRightWidth; - height = SV.db.Dock.dockRightHeight; - end - - return width, height; -end - -function Dock:NewDocklet(location, globalName, readableName, texture, onclick) - if(self.Registration[globalName]) then return end; - - if(self.Locations[globalName]) then - location = self.Locations[globalName]; - else - self.Locations[globalName] = location; - end - - local newParent = self[location]; - if(not newParent) then return end - local frame = _G[globalName] or CreateFrame("Frame", globalName, UIParent, "SVUI_DockletWindowTemplate"); - frame:SetParent(newParent.Window); - frame:SetSize(newParent.Window:GetSize()); - frame:SetAllPoints(newParent.Window); - frame:SetFrameStrata("BACKGROUND"); - frame.Parent = newParent - frame.Disable = DockletDisable; - frame.Enable = DockletEnable; - frame.Relocate = DockletRelocate; - frame.GetButtonSize = DockletButtonSize; - - newParent.Bar.Data.Windows[globalName] = frame; - - local buttonName = ("%sButton"):format(globalName) - frame.DockButton = newParent.Bar:Create(readableName, texture, onclick, buttonName); - frame.DockButton.FrameLink = frame - self.Registration[globalName] = frame; - - return frame -end - -function Dock:NewAdvancedDocklet(location, globalName) - if(self.Registration[globalName]) then return end; - - if(self.Locations[globalName]) then - location = self.Locations[globalName]; - else - self.Locations[globalName] = location; - end - - local newParent = self[location]; - if(not newParent) then return end - - local frame = CreateFrame("Frame", globalName, UIParent, "SVUI_DockletWindowTemplate"); - frame:SetParent(newParent.Window); - frame:SetSize(newParent.Window:GetSize()); - frame:SetAllPoints(newParent.Window); - frame:SetFrameStrata("BACKGROUND"); - frame.Parent = newParent - frame.Disable = DockletDisable; - frame.Enable = DockletEnable; - frame.Relocate = DockletRelocate; - frame.GetButtonSize = DockletButtonSize; - - newParent.Bar.Data.Windows[globalName] = frame; - - local height = newParent.Bar.ToolBar:GetHeight(); - local mod = newParent.Bar.Data.Modifier; - local barAnchor = newParent.Bar.Data.Anchor; - local barReverse = SV:GetReversePoint(barAnchor); - local spacing = SV.db.Dock.buttonSpacing; - - frame.Bar = CreateFrame("Frame", nil, newParent); - frame.Bar:SetSize(1, height); - frame.Bar:Point(barAnchor, newParent.Bar.ToolBar, barReverse, (spacing * mod), 0) - SV.Mentalo:Add(frame.Bar, globalName .. " Dock Bar"); - - self.Registration[globalName] = frame; - return frame -end ---[[ -########################################################## -BUILD/UPDATE -########################################################## -]]-- -function Dock:UpdateDockBackdrops() - if SV.db.Dock.rightDockBackdrop then - Dock.BottomRight.backdrop:Show() - Dock.BottomRight.backdrop:ClearAllPoints() - Dock.BottomRight.backdrop:WrapOuter(Dock.BottomRight.Window, 4, 4) - - Dock.BottomRight.Alert.backdrop:ClearAllPoints() - Dock.BottomRight.Alert.backdrop:WrapOuter(Dock.BottomRight.Alert, 4, 4) - else - Dock.BottomRight.backdrop:Hide() - end - if SV.db.Dock.leftDockBackdrop then - Dock.BottomLeft.backdrop:Show() - Dock.BottomLeft.backdrop:ClearAllPoints() - Dock.BottomLeft.backdrop:WrapOuter(Dock.BottomLeft.Window, 4, 4) - - Dock.BottomLeft.Alert.backdrop:ClearAllPoints() - Dock.BottomLeft.Alert.backdrop:WrapOuter(Dock.BottomLeft.Alert, 4, 4) - else - Dock.BottomLeft.backdrop:Hide() - end -end - -function Dock:BottomBorderVisibility() - if SV.db.Dock.bottomPanel then - self.Border.Bottom:Show() - else - self.Border.Bottom:Hide() - end -end - -function Dock:TopBorderVisibility() - if SV.db.Dock.topPanel then - self.Border.Top:Show() - else - self.Border.Top:Hide() - end -end - -function Dock:ResetAllButtons() - wipe(SV.cache.Docks.Order) - wipe(SV.cache.Docks.Locations) - ReloadUI() -end - -function Dock:Refresh() - local buttonsize = SV.db.Dock.buttonSize; - local spacing = SV.db.Dock.buttonSpacing; - local centerWidth = SV.db.Dock.dockCenterWidth; - local centerHeight = buttonsize * 0.7; - - for location, settings in pairs(DOCK_LOCATIONS) do - if(location ~= "TopRight") then - local width, height = self:GetDimensions(location); - local dock = self[location]; - - dock.Bar:SetSize(width, buttonsize) - dock.Bar.ToolBar:SetHeight(buttonsize) - dock:SetSize(width, height) - dock.Alert:SetSize(width, 1) - dock.Window:SetSize(width, height) - - if(dock.Bar.Button) then - dock.Bar.Button:SetSize(buttonsize, buttonsize) - end - - dock.Bar:Update() - end - end - - self.BottomCenter:SetSize(centerWidth, centerHeight) - self.BottomCenter.Left:SetSize((centerWidth * 0.5), centerHeight) - self.BottomCenter.Right:SetSize((centerWidth * 0.5), centerHeight) - - self.TopCenter:SetSize(centerWidth, centerHeight) - self.TopCenter.Left:SetSize((centerWidth * 0.5), centerHeight) - self.TopCenter.Right:SetSize((centerWidth * 0.5), centerHeight) - - self:BottomBorderVisibility(); - self:TopBorderVisibility(); - self:UpdateDockBackdrops(); - - SVLib:Trigger("DOCKS_UPDATED"); -end - -function Dock:Initialize() - SV.cache.Docks = SV.cache.Docks or {} - - if(not SV.cache.Docks.IsFaded) then - SV.cache.Docks.IsFaded = false - end - - if(not SV.cache.Docks.Order) then - SV.cache.Docks.Order = {} - end - - if(not SV.cache.Docks.Locations) then - SV.cache.Docks.Locations = {} - end - - self.Locations = SV.cache.Docks.Locations; - - local buttonsize = SV.db.Dock.buttonSize; - local spacing = SV.db.Dock.buttonSpacing; - local centerWidth = SV.db.Dock.dockCenterWidth; - local centerHeight = buttonsize * 0.7; - local texture = [[Interface\AddOns\SVUI\assets\artwork\Template\BUTTON]]; - - -- [[ TOP AND BOTTOM BORDERS ]] -- - - self.Border.Top = CreateFrame("Frame", "SVUITopBorder", UIParent) - self.Border.Top:Point("TOPLEFT", SV.Screen, "TOPLEFT", -1, 1) - self.Border.Top:Point("TOPRIGHT", SV.Screen, "TOPRIGHT", 1, 1) - self.Border.Top:Height(14) - self.Border.Top:SetBackdrop({ - bgFile = texture, - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 1, - insets = {left = 0, right = 0, top = 0, bottom = 0} - }) - self.Border.Top:SetBackdropColor(unpack(SV.Media.color.specialdark)) - self.Border.Top:SetBackdropBorderColor(0,0,0,1) - self.Border.Top:SetFrameLevel(0) - self.Border.Top:SetFrameStrata('BACKGROUND') - self.Border.Top:SetScript("OnShow", function(this) - this:SetFrameLevel(0) - this:SetFrameStrata('BACKGROUND') - end) - self:TopBorderVisibility() - - self.Border.Bottom = CreateFrame("Frame", "SVUIBottomBorder", UIParent) - self.Border.Bottom:Point("BOTTOMLEFT", SV.Screen, "BOTTOMLEFT", -1, -1) - self.Border.Bottom:Point("BOTTOMRIGHT", SV.Screen, "BOTTOMRIGHT", 1, -1) - self.Border.Bottom:Height(14) - self.Border.Bottom:SetBackdrop({ - bgFile = texture, - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 1, - insets = {left = 0, right = 0, top = 0, bottom = 0} - }) - self.Border.Bottom:SetBackdropColor(unpack(SV.Media.color.special)) - self.Border.Bottom:SetBackdropBorderColor(0,0,0,1) - self.Border.Bottom:SetFrameLevel(0) - self.Border.Bottom:SetFrameStrata('BACKGROUND') - self.Border.Bottom:SetScript("OnShow", function(this) - this:SetFrameLevel(0) - this:SetFrameStrata('BACKGROUND') - end) - self:BottomBorderVisibility() - - for location, settings in pairs(DOCK_LOCATIONS) do - local width, height = self:GetDimensions(location); - local dock = self[location]; - local mod = settings[1]; - local anchor = upper(location); - local reverse = SV:GetReversePoint(anchor); - local barAnchor = settings[2]; - local barReverse = SV:GetReversePoint(barAnchor); - local isBottom = settings[3]; - local vertMod = isBottom and 1 or -1 - - dock.Bar:SetParent(SV.Screen) - dock.Bar:ClearAllPoints() - dock.Bar:SetSize(width, buttonsize) - dock.Bar:SetPoint(anchor, SV.Screen, anchor, (2 * mod), (2 * vertMod)) - - if(not SV.cache.Docks.Order[location]) then - SV.cache.Docks.Order[location] = {} - end - - dock.Bar.Data.Order = SV.cache.Docks.Order[location]; - - dock.Bar.ToolBar:ClearAllPoints() - - if(dock.Bar.Button) then - dock.Bar.Button:SetSize(buttonsize, buttonsize) - dock.Bar.Button:SetFramedButtonTemplate() - dock.Bar.ToolBar:SetSize(1, buttonsize) - dock.Bar.ToolBar:Point(barAnchor, dock.Bar.Button, barReverse, (spacing * mod), 0) - InitDockButton(dock.Bar.Button) - else - dock.Bar.ToolBar:SetSize(1, buttonsize) - dock.Bar.ToolBar:Point(barAnchor, dock.Bar, barAnchor, 0, 0) - end - - dock:SetParent(SV.Screen) - dock:ClearAllPoints() - dock:SetPoint(anchor, dock.Bar, reverse, 0, (12 * vertMod)) - dock:SetSize(width, height) - dock:SetAttribute("buttonSize", buttonsize) - dock:SetAttribute("spacingSize", spacing) - - dock.Alert:ClearAllPoints() - dock.Alert:SetSize(width, 1) - dock.Alert:SetPoint(anchor, dock, anchor, 0, 0) - - dock.Window:ClearAllPoints() - dock.Window:SetSize(width, height) - dock.Window:SetPoint(anchor, dock.Alert, reverse, 0, (4 * vertMod)) - - SV.Mentalo:Add(dock.Bar, location .. " Dock ToolBar"); - - if(isBottom) then - dock.backdrop = SetSuperDockStyle(dock.Window, isBottom) - dock.Alert.backdrop = SetSuperDockStyle(dock.Alert, isBottom) - dock.Alert.backdrop:Hide() - dock.Window:SetScript("OnShow", Docklet_OnShow) - dock.Window:SetScript("OnHide", Docklet_OnHide) - end - - SV.Mentalo:Add(dock, location .. " Dock Window") - end - - if SV.cache.Docks.IsFaded then Dock.BottomLeft:Hide() Dock.BottomRight:Hide() end - - SV:AddToDisplayAudit(self.BottomRight.Window) - SV:AddToDisplayAudit(self.TopLeft.Window) - SV:AddToDisplayAudit(self.TopRight.Window) - - if not InCombatLockdown() then - self.BottomLeft.Bar:Refresh() - self.BottomRight.Bar:Refresh() - self.TopLeft.Bar:Refresh() - self.TopRight.Bar:Refresh() - end - - --BOTTOM CENTER BAR - self.BottomCenter:SetParent(SV.Screen) - self.BottomCenter:ClearAllPoints() - self.BottomCenter:SetSize(centerWidth, centerHeight) - self.BottomCenter:SetPoint("BOTTOM", SV.Screen, "BOTTOM", 0, 2) - - self.BottomCenter.Left:SetSize((centerWidth * 0.5), centerHeight) - self.BottomCenter.Left:SetPoint("LEFT") - SV.Mentalo:Add(self.BottomCenter.Left, L["BottomCenter Dock Left"]) - - self.BottomCenter.Right:SetSize((centerWidth * 0.5), centerHeight) - self.BottomCenter.Right:SetPoint("RIGHT") - SV.Mentalo:Add(self.BottomCenter.Right, L["BottomCenter Dock Right"]) - - --TOP CENTER BAR - self.TopCenter:SetParent(SV.Screen) - self.TopCenter:ClearAllPoints() - self.TopCenter:SetSize(centerWidth, centerHeight) - self.TopCenter:SetPoint("TOP", SV.Screen, "TOP", 0, -2) - - self.TopCenter.Left:SetSize((centerWidth * 0.5), centerHeight) - self.TopCenter.Left:SetPoint("LEFT", self.TopCenter, "LEFT") - SV.Mentalo:Add(self.TopCenter.Left, L["TopCenter Dock Left"]) - - self.TopCenter.Right:SetSize((centerWidth * 0.5), centerHeight) - self.TopCenter.Right:SetPoint("LEFT", self.TopCenter.Left, "RIGHT") - SV.Mentalo:Add(self.TopCenter.Right, L["TopCenter Dock Right"]) - - self:UpdateDockBackdrops() -end - -SV.Dock = Dock \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/docks/docks.xml b/Interface/AddOns/SVUI/framework/docks/docks.xml index a4f4495..f1f0a14 100644 --- a/Interface/AddOns/SVUI/framework/docks/docks.xml +++ b/Interface/AddOns/SVUI/framework/docks/docks.xml @@ -276,22 +276,6 @@ <Anchors> <Anchor point="BOTTOM" /> </Anchors> - <Frames> - <Frame name="$parentLeft" parentKey="Left"> - <Size x="1" y="22"/> - <Anchors> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" /> - <Anchor point="TOPRIGHT" relativePoint="TOP" /> - </Anchors> - </Frame> - <Frame name="$parentRight" parentKey="Right"> - <Size x="1" y="22"/> - <Anchors> - <Anchor point="BOTTOMLEFT" relativeTo="$parentLeft" relativePoint="BOTTOMRIGHT" /> - <Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT" /> - </Anchors> - </Frame> - </Frames> </Frame> <Frame name="SVUI_DockTopCenter" frameStrata="BACKGROUND"> @@ -303,23 +287,8 @@ <Anchors> <Anchor point="TOP" /> </Anchors> - <Frames> - <Frame name="$parentLeft" parentKey="Left"> - <Size x="1" y="22"/> - <Anchors> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" /> - <Anchor point="TOPRIGHT" relativePoint="TOP" /> - </Anchors> - </Frame> - <Frame name="$parentRight" parentKey="Right"> - <Size x="1" y="22"/> - <Anchors> - <Anchor point="BOTTOMLEFT" relativeTo="$parentLeft" relativePoint="BOTTOMRIGHT" /> - <Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT" /> - </Anchors> - </Frame> - </Frames> </Frame> - <Script file="docks.lua"/> + <Script file="dock_core.lua"/> + <Script file="dock_stats.lua"/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/framework.lua b/Interface/AddOns/SVUI/framework/framework.lua index cfc14f1..b80eca3 100644 --- a/Interface/AddOns/SVUI/framework/framework.lua +++ b/Interface/AddOns/SVUI/framework/framework.lua @@ -31,9 +31,10 @@ function SV:LoadFramework() self.Dropdown:Initialize(); self.Dock:Initialize(); self.Mentalo:Initialize(); - self.Graph:Initialize(); self.Dragger:Initialize(); self.Comix:Initialize(); + self.Drunk:Initialize(); self.GameMenu:Initialize(); self.AFK:Initialize(); + self.SuperButton:Initialize(); end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/movers/mover_dragger.lua b/Interface/AddOns/SVUI/framework/movers/mover_dragger.lua index 7a8af25..a4bd85c 100644 --- a/Interface/AddOns/SVUI/framework/movers/mover_dragger.lua +++ b/Interface/AddOns/SVUI/framework/movers/mover_dragger.lua @@ -58,7 +58,7 @@ UIPanels["CalendarFrame"] = { moving = false, snapped = false, canupdate = UIPanels["CharacterFrame"] = { moving = false, snapped = false, canupdate = false, cansetpoint = false, centered = false }; UIPanels["ClassTrainerFrame"] = { moving = false, snapped = false, canupdate = false, cansetpoint = false, centered = false }; UIPanels["DressUpFrame"] = { moving = false, snapped = false, canupdate = false, cansetpoint = false, centered = false }; -UIPanels["DraenorZoneAbilityFrame"] = { moving = false, snapped = false, canupdate = false, cansetpoint = false, centered = false }; +--UIPanels["DraenorZoneAbilityFrame"] = { moving = false, snapped = false, canupdate = false, cansetpoint = false, centered = false }; UIPanels["EncounterJournal"] = { moving = false, snapped = false, canupdate = false, cansetpoint = false, centered = false }; UIPanels["FriendsFrame"] = { moving = false, snapped = false, canupdate = false, cansetpoint = false, centered = false }; UIPanels["GMSurveyFrame"] = { moving = false, snapped = false, canupdate = false, cansetpoint = false, centered = true }; @@ -357,6 +357,10 @@ function Dragger:Initialize() if(not SV.db.general.questWatch) then UIPanels["ObjectiveTrackerFrame"] = { moving = false, snapped = false, canupdate = false, cansetpoint = false, centered = false }; end + if(SV.db.SVMap.tinyWorldMap) then + UIPanels["WorldMapFrame"] = { moving = false, snapped = false, canupdate = false, cansetpoint = false, centered = false }; + WorldMapTitleButton:EnableMouse(false) + end self.EventsActive = true @@ -376,4 +380,4 @@ function Dragger:Initialize() end end -SV.Dragger = Dragger \ No newline at end of file +SV.Dragger = Dragger; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/movers/mover_graph.lua b/Interface/AddOns/SVUI/framework/movers/mover_graph.lua deleted file mode 100644 index ad2915a..0000000 --- a/Interface/AddOns/SVUI/framework/movers/mover_graph.lua +++ /dev/null @@ -1,114 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local string = _G.string; -local math = _G.math; ---[[ STRING METHODS ]]-- -local format, split = string.format, string.split; ---[[ MATH METHODS ]]-- -local min, floor = math.min, math.floor; -local parsefloat = math.parsefloat; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L; - -local Graph = {} - -function Graph:Toggle(enabled) - if((not self.Grid) or (self.CellSize ~= SV.db.general.graphSize)) then - self:Generate() - end - if(not enabled) then - self.Grid:Hide() - else - self.Grid:Show() - end -end - -function Graph:Generate() - local cellSize = SV.db.general.graphSize - self.CellSize = cellSize - - self.Grid = CreateFrame('Frame', nil, UIParent) - self.Grid:SetAllPoints(SV.Screen) - - local size = 1 - local width = GetScreenWidth() - local ratio = width / GetScreenHeight() - local height = GetScreenHeight() * ratio - - local wStep = width / cellSize - local hStep = height / cellSize - - for i = 0, cellSize do - local tx = self.Grid:CreateTexture(nil, 'BACKGROUND') - if(i == cellSize / 2) then - tx:SetTexture(0, 1, 0, 0.8) - else - tx:SetTexture(0, 0, 0, 0.8) - end - tx:SetPoint("TOPLEFT", self.Grid, "TOPLEFT", i*wStep - (size/2), 0) - tx:SetPoint('BOTTOMRIGHT', self.Grid, 'BOTTOMLEFT', i*wStep + (size/2), 0) - end - - height = GetScreenHeight() - - do - local tx = self.Grid:CreateTexture(nil, 'BACKGROUND') - tx:SetTexture(0, 1, 0, 0.8) - tx:SetPoint("TOPLEFT", self.Grid, "TOPLEFT", 0, -(height/2) + (size/2)) - tx:SetPoint('BOTTOMRIGHT', self.Grid, 'TOPRIGHT', 0, -(height/2 + size/2)) - end - - for i = 1, floor((height/2)/hStep) do - local tx = self.Grid:CreateTexture(nil, 'BACKGROUND') - tx:SetTexture(0, 0, 0, 0.8) - - tx:SetPoint("TOPLEFT", self.Grid, "TOPLEFT", 0, -(height/2+i*hStep) + (size/2)) - tx:SetPoint('BOTTOMRIGHT', self.Grid, 'TOPRIGHT', 0, -(height/2+i*hStep + size/2)) - - tx = self.Grid:CreateTexture(nil, 'BACKGROUND') - tx:SetTexture(0, 0, 0, 0.8) - - tx:SetPoint("TOPLEFT", self.Grid, "TOPLEFT", 0, -(height/2-i*hStep) + (size/2)) - tx:SetPoint('BOTTOMRIGHT', self.Grid, 'TOPRIGHT', 0, -(height/2-i*hStep + size/2)) - end - - self.Grid:Hide() -end - -function Graph:Initialize() - self:Generate() -end - -SV.Graph = Graph; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/movers/mover_mentalo.lua b/Interface/AddOns/SVUI/framework/movers/mover_mentalo.lua index 74796a0..3298f1c 100644 --- a/Interface/AddOns/SVUI/framework/movers/mover_mentalo.lua +++ b/Interface/AddOns/SVUI/framework/movers/mover_mentalo.lua @@ -42,7 +42,7 @@ GET ADDON DATA local SV = select(2, ...) local L = SV.L; -local Mentalo = CreateFrame("Frame", nil) +local Mentalo = SV:NewClass("Mentalo", L["Mentalo the Frame Mover"]); Mentalo.Frames = {} --[[ /$$$$$$ /$$ /$$ /$$ @@ -395,34 +395,29 @@ local Movable_OnUpdate = function(self) if centerY >= calc3 then anchor1 = "TOP" anchor2 = "BOTTOM" - centerY = -4 else anchor1 = "BOTTOM" anchor2 = "TOP" - centerY = 4 end if centerX >= calc2 then anchor1 = "RIGHT" anchor2 = "LEFT" - centerX = -4 elseif centerX <= calc1 then anchor1 = "LEFT" anchor2 = "RIGHT" - centerX = 4 - else - centerX = 0 end SVUI_MentaloPrecision:ClearAllPoints() - SVUI_MentaloPrecision:SetPoint(anchor1, frame, anchor2, centerX, centerY) + SVUI_MentaloPrecision:SetPoint(anchor1, frame, anchor2, 0, 0) + SVUI_MentaloPrecision:SetFrameLevel(frame:GetFrameLevel() + 20) Movable_OnMouseUp(frame) end local Movable_OnSizeChanged = function(self) if InCombatLockdown()then return end if self.dirtyWidth and self.dirtyHeight then - self.Grip:Size(self.dirtyWidth, self.dirtyHeight) + self.Grip:SetSizeToScale(self.dirtyWidth, self.dirtyHeight) else - self.Grip:Size(self:GetSize()) + self.Grip:SetSizeToScale(self:GetSize()) end end @@ -469,11 +464,11 @@ local Movable_OnDragStop = function(self) end if self.positionOverride then self.parent:ClearAllPoints() - self.parent:Point(self.positionOverride, self, self.positionOverride) + self.parent:SetPointToScale(self.positionOverride, self, self.positionOverride) end self:ClearAllPoints() - self:Point(newAnchor, SV.Screen, newAnchor, cX, cY) + self:SetPointToScale(newAnchor, SV.Screen, newAnchor, cX, cY) Mentalo:SaveMovable(self.name) @@ -575,7 +570,7 @@ function Mentalo:New(frame, moveName, title, snap, dragStopFunc) end movable:SetPoint(anchor1, anchorParent, anchor2, xPos, yPos) - movable:SetFixedPanelTemplate("Transparent") + movable:SetStylePanel("Fixed", "Transparent") movable:SetAlpha(0.4) frame:SetScript("OnSizeChanged", Movable_OnSizeChanged) @@ -584,7 +579,7 @@ function Mentalo:New(frame, moveName, title, snap, dragStopFunc) frame:SetPoint(anchor1, movable, anchor1, 0, 0) local mtext = movable:CreateFontString(nil, "OVERLAY") - mtext:FontManager() + mtext:FontManager("default") mtext:SetJustifyH("CENTER") mtext:SetPoint("CENTER") mtext:SetText(title or moveName) @@ -734,6 +729,79 @@ function Mentalo:Toggle(isConfigMode) end --[[ ########################################################## +ALIGNMENT GRAPH +########################################################## +]]-- +local Graph = {} + +function Graph:Toggle(enabled) + if((not self.Grid) or (self.CellSize ~= SV.db.general.graphSize)) then + self:UpdateDataSlots() + end + if(not enabled) then + self.Grid:Hide() + else + self.Grid:Show() + end +end + +function Graph:UpdateDataSlots() + local cellSize = SV.db.general.graphSize + self.CellSize = cellSize + + self.Grid = CreateFrame('Frame', nil, UIParent) + self.Grid:SetAllPoints(SV.Screen) + + local size = 1 + local width = GetScreenWidth() + local ratio = width / GetScreenHeight() + local height = GetScreenHeight() * ratio + + local wStep = width / cellSize + local hStep = height / cellSize + + for i = 0, cellSize do + local tx = self.Grid:CreateTexture(nil, 'BACKGROUND') + if(i == cellSize / 2) then + tx:SetTexture(0, 1, 0, 0.8) + else + tx:SetTexture(0, 0, 0, 0.8) + end + tx:SetPoint("TOPLEFT", self.Grid, "TOPLEFT", i*wStep - (size/2), 0) + tx:SetPoint('BOTTOMRIGHT', self.Grid, 'BOTTOMLEFT', i*wStep + (size/2), 0) + end + + height = GetScreenHeight() + + do + local tx = self.Grid:CreateTexture(nil, 'BACKGROUND') + tx:SetTexture(0, 1, 0, 0.8) + tx:SetPoint("TOPLEFT", self.Grid, "TOPLEFT", 0, -(height/2) + (size/2)) + tx:SetPoint('BOTTOMRIGHT', self.Grid, 'TOPRIGHT', 0, -(height/2 + size/2)) + end + + for i = 1, floor((height/2)/hStep) do + local tx = self.Grid:CreateTexture(nil, 'BACKGROUND') + tx:SetTexture(0, 0, 0, 0.8) + + tx:SetPoint("TOPLEFT", self.Grid, "TOPLEFT", 0, -(height/2+i*hStep) + (size/2)) + tx:SetPoint('BOTTOMRIGHT', self.Grid, 'TOPRIGHT', 0, -(height/2+i*hStep + size/2)) + + tx = self.Grid:CreateTexture(nil, 'BACKGROUND') + tx:SetTexture(0, 0, 0, 0.8) + + tx:SetPoint("TOPLEFT", self.Grid, "TOPLEFT", 0, -(height/2-i*hStep) + (size/2)) + tx:SetPoint('BOTTOMRIGHT', self.Grid, 'TOPRIGHT', 0, -(height/2-i*hStep + size/2)) + end + + self.Grid:Hide() +end + +function Graph:Initialize() + self:UpdateDataSlots() +end +--[[ +########################################################## SCRIPT AND EVENT HANDLERS ########################################################## ]]-- @@ -746,15 +814,15 @@ end local XML_MentaloGridButton_OnClick = function(self) local enabled = true - if(SV.Graph.Grid and SV.Graph.Grid:IsShown()) then + if(Graph.Grid and Graph.Grid:IsShown()) then enabled = false end - SV.Graph:Toggle(enabled) + Graph:Toggle(enabled) end local XML_MentaloLockButton_OnClick = function(self) - SV.Graph:Toggle() + Graph:Toggle() Mentalo:Toggle(true) if IsAddOnLoaded(SV.ConfigID)then LibStub("AceConfigDialog-3.0"):Open(SV.NameID) @@ -774,7 +842,7 @@ local XML_MentaloPrecisionInputX_EnterPressed = function(self) local xOffset, yOffset, anchor = CalculateOffsets() yOffset = tonumber(SVUI_MentaloPrecisionSetY.CurrentValue) CurrentFrameTarget:ClearAllPoints() - CurrentFrameTarget:Point(anchor, SVUIParent, anchor, current, yOffset) + CurrentFrameTarget:SetPointToScale(anchor, SVUIParent, anchor, current, yOffset) Mentalo:SaveMovable(CurrentFrameTarget.name) end self.CurrentValue = current @@ -790,7 +858,7 @@ local XML_MentaloPrecisionInputY_EnterPressed = function(self) local xOffset, yOffset, anchor = CalculateOffsets() xOffset = tonumber(SVUI_MentaloPrecisionSetX.CurrentValue) CurrentFrameTarget:ClearAllPoints() - CurrentFrameTarget:Point(anchor, SVUIParent, anchor, xOffset, current) + CurrentFrameTarget:SetPointToScale(anchor, SVUIParent, anchor, xOffset, current) Mentalo:SaveMovable(CurrentFrameTarget.name) end self.CurrentValue = current @@ -806,7 +874,7 @@ Initialize function Mentalo:Initialize() SV.cache.Anchors = SV.cache.Anchors or {} - SVUI_Mentalo:SetFixedPanelTemplate("Component") + SVUI_Mentalo:SetStylePanel("Fixed", "Component") SVUI_Mentalo:SetPanelColor("yellow") SVUI_Mentalo:RegisterForDrag("LeftButton") SVUI_Mentalo:RegisterEvent("PLAYER_REGEN_DISABLED") @@ -815,21 +883,21 @@ function Mentalo:Initialize() SVUI_MentaloGridButton:SetScript("OnClick", XML_MentaloGridButton_OnClick) SVUI_MentaloLockButton:SetScript("OnClick", XML_MentaloLockButton_OnClick) - SVUI_MentaloPrecision:SetPanelTemplate("Transparent") + SVUI_MentaloPrecision:SetStylePanel("Default", "Transparent") SVUI_MentaloPrecision:EnableMouse(true) - SVUI_MentaloPrecisionSetX:SetEditboxTemplate() + SVUI_MentaloPrecisionSetX:SetStylePanel("Editbox") SVUI_MentaloPrecisionSetX.CurrentValue = 0; SVUI_MentaloPrecisionSetX:SetScript("OnEnterPressed", XML_MentaloPrecisionInputX_EnterPressed) - SVUI_MentaloPrecisionSetY:SetEditboxTemplate() + SVUI_MentaloPrecisionSetY:SetStylePanel("Editbox") SVUI_MentaloPrecisionSetY.CurrentValue = 0; SVUI_MentaloPrecisionSetY:SetScript("OnEnterPressed", XML_MentaloPrecisionInputY_EnterPressed) - SVUI_MentaloPrecisionUpButton:SetButtonTemplate() - SVUI_MentaloPrecisionDownButton:SetButtonTemplate() - SVUI_MentaloPrecisionLeftButton:SetButtonTemplate() - SVUI_MentaloPrecisionRightButton:SetButtonTemplate() + SVUI_MentaloPrecisionUpButton:SetStylePanel("Button") + SVUI_MentaloPrecisionDownButton:SetStylePanel("Button") + SVUI_MentaloPrecisionLeftButton:SetStylePanel("Button") + SVUI_MentaloPrecisionRightButton:SetStylePanel("Button") self:SetPositions() @@ -839,6 +907,4 @@ function Mentalo:Initialize() -- PetJournalParent:SetAttribute("UIPanelLayout-"..name, value); -- end -- PetJournalParent:SetAttribute("UIPanelLayout-defined", true); -end - -SV.Mentalo = Mentalo \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/movers/movers.xml b/Interface/AddOns/SVUI/framework/movers/movers.xml index f9a1e7d..ea72bf7 100644 --- a/Interface/AddOns/SVUI/framework/movers/movers.xml +++ b/Interface/AddOns/SVUI/framework/movers/movers.xml @@ -256,7 +256,6 @@ </Scripts> </Frame> - <Script file="mover_graph.lua"/> <Script file="mover_mentalo.lua"/> <Script file="mover_dragger.lua"/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/widgets/widget_afk.lua b/Interface/AddOns/SVUI/framework/widgets/widget_afk.lua index dc00e16..f26bf5d 100644 --- a/Interface/AddOns/SVUI/framework/widgets/widget_afk.lua +++ b/Interface/AddOns/SVUI/framework/widgets/widget_afk.lua @@ -32,20 +32,32 @@ local SV = select(2, ...); SV.AFK = _G["SVUI_AFKFrame"]; +local AFK_SEQUENCES = { + [1] = 120, + [2] = 141, + [3] = 119, + [4] = 5, +}; + function SV.AFK:Activate(enabled) if(InCombatLockdown()) then return end if(enabled) then - MoveViewLeftStart(0.05); + local sequence = random(1, 4); + if(not SV.db.general.afkNoMove) then + MoveViewLeftStart(0.05); + end self:Show(); UIParent:Hide(); self:SetAlpha(1); - self.Model:SetAnimation(119) + self.Model:SetAnimation(AFK_SEQUENCES[sequence]) DoEmote("READ") else UIParent:Show(); self:SetAlpha(0); self:Hide(); - MoveViewLeftStop(); + if(not SV.db.general.afkNoMove) then + MoveViewLeftStop(); + end end end @@ -64,31 +76,31 @@ end function SV.AFK:Initialize() local classToken = select(2,UnitClass("player")) - local color = SVUI_CLASS_COLORS[classToken] + local color = CUSTOM_CLASS_COLORS[classToken] self.BG:SetVertexColor(color.r, color.g, color.b) self.BG:ClearAllPoints() - self.BG:Size(500,600) - self.BG:Point("BOTTOMRIGHT", self, "BOTTOMRIGHT", 0, 0) + self.BG:SetSizeToScale(500,600) + self.BG:SetPointToScale("BOTTOMRIGHT", self, "BOTTOMRIGHT", 0, 0) self:SetFrameLevel(0) self:SetAllPoints(SV.Screen) local narr = self.Model:CreateTexture(nil, "OVERLAY") - narr:Size(300, 150) + narr:SetSizeToScale(300, 150) narr:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\AFK-NARRATIVE") - narr:Point("TOPLEFT", SV.Screen, "TOPLEFT", 15, -15) + narr:SetPointToScale("TOPLEFT", SV.Screen, "TOPLEFT", 15, -15) self.Model:ClearAllPoints() - self.Model:Size(600,600) - self.Model:Point("BOTTOMRIGHT", self, "BOTTOMRIGHT", 64, -64) + self.Model:SetSizeToScale(600,600) + self.Model:SetPointToScale("BOTTOMRIGHT", self, "BOTTOMRIGHT", 64, -64) self.Model:SetUnit("player") self.Model:SetCamDistanceScale(1.15) self.Model:SetFacing(6) local splash = self.Model:CreateTexture(nil, "OVERLAY") - splash:Size(350, 175) + splash:SetSizeToScale(350, 175) splash:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\PLAYER-AFK") - splash:Point("BOTTOMRIGHT", self.Model, "CENTER", -75, 75) + splash:SetPointToScale("BOTTOMRIGHT", self.Model, "CENTER", -75, 75) self:Hide() if(SV.db.general.afk) then diff --git a/Interface/AddOns/SVUI/framework/widgets/widget_comix.lua b/Interface/AddOns/SVUI/framework/widgets/widget_comix.lua index 3bdd930..5514a9c 100644 --- a/Interface/AddOns/SVUI/framework/widgets/widget_comix.lua +++ b/Interface/AddOns/SVUI/framework/widgets/widget_comix.lua @@ -31,7 +31,7 @@ GET ADDON DATA local SV = select(2, ...) local L = SV.L -SV.Comix = CreateFrame("Frame"); +SV.Comix = _G["SVUI_ComixFrame"]; --[[ ########################################################## LOCAL VARS @@ -77,17 +77,22 @@ local COMIX_DATA = { {210, 190, 50, 50, 220, 210, -1, 5} } }; + +local function ComixReadyState(state) + if(state == nil) then return animReady end + animReady = state +end + +local Comix_OnUpdate = function() ComixReadyState(true) end +local Toasty_OnUpdate = function(self) ComixReadyState(true); self.parent:SetAlpha(0) end --[[ ########################################################## CORE FUNCTIONS ########################################################## ]]-- -function SV.Comix:ReadyState(state) - if(state == nil) then return animReady end - animReady = state -end - function SV.Comix:LaunchPremiumPopup() + ComixReadyState(false) + local rng = random(1, 16); local coords = COMIX_DATA[1][rng]; local offsets = COMIX_DATA[2][rng] @@ -104,49 +109,42 @@ function SV.Comix:LaunchPremiumPopup() self.Premium.bg.anim:Play() end -function SV.Comix:LaunchDeluxePopup() - local rng = random(1, 16); - local coords = COMIX_DATA[1][rng]; - local step1_x = random(-100, 100); - if(step1_x > -30 and step1_x < 30) then step1_x = step1_x * 3 end - local step1_y = random(-30, 30); - if(step1_y > -30 and step1_y < 30) then step1_y = step1_y * 3 end - local step2_x = step1_x * 0.5; - local step2_y = step1_y * 0.75; - self.Deluxe.tex:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) - self.Deluxe.anim[1]:SetOffset(step1_x, step1_y) - self.Deluxe.anim[2]:SetOffset(step2_x, step2_y) - self.Deluxe.anim[3]:SetOffset(0,0) - self.Deluxe.anim:Play() -end - function SV.Comix:LaunchPopup() - local rng = random(1, 16); - local coords = COMIX_DATA[1][rng]; - local step1_x = random(-100, 100); - if(step1_x > -30 and step1_x < 30) then step1_x = step1_x * 3 end - local step1_y = random(-30, 30); - if(step1_y > -30 and step1_y < 30) then step1_y = step1_y * 3 end - local size = random(64,88) - self.Basic:Size(size,size) - self.Basic.tex:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) - self.Basic:ClearAllPoints() - self.Basic:Point("CENTER", SV.Screen, "CENTER", step1_x, step1_y) - self.Basic.anim:Play() + ComixReadyState(false) + + local coords, step1_x, step1_y, step2_x, step2_y, size; + local rng = random(1, 32); + + if(rng > 16) then + local key = rng - 16; + coords = COMIX_DATA[1][key]; + step1_x = random(-150, 150); + if(step1_x > -20 and step1_x < 20) then step1_x = step1_x * 3 end + step1_y = random(50, 150); + step2_x = step1_x * 0.5; + step2_y = step1_y * 0.75; + self.Deluxe.tex:SetTexCoord(coords[1],coords[2],coords[3],coords[4]); + self.Deluxe.anim[1]:SetOffset(step1_x, step1_y); + self.Deluxe.anim[2]:SetOffset(step2_x, step2_y); + self.Deluxe.anim[3]:SetOffset(0,0); + self.Deluxe.anim:Play(); + else + coords = COMIX_DATA[1][rng]; + step1_x = random(-100, 100); + step1_y = random(-50, 1); + size = random(96,128); + self.Basic:SetSizeToScale(size,size); + self.Basic.tex:SetTexCoord(coords[1],coords[2],coords[3],coords[4]); + self.Basic:ClearAllPoints(); + self.Basic:SetPointToScale("CENTER", SV.Screen, "CENTER", step1_x, step1_y); + self.Basic.anim:Play(); + end end local Comix_OnEvent = function(self, event, ...) - local subEvent = select(2,...) - local guid = select(4,...) - local ready = self:ReadyState() - if subEvent == "PARTY_KILL" and guid == UnitGUID('player') and ready then - self:ReadyState(false) - local rng = random(1,15) - if rng < 8 then - self:LaunchDeluxePopup() - else - self:LaunchPopup() - end + local _, subEvent, _, guid = ...; + if((subEvent == "PARTY_KILL" and guid == UnitGUID('player')) and ComixReadyState()) then + self:LaunchPopup() end end @@ -161,33 +159,32 @@ function SV.Comix:Toggle() end function SV:ToastyKombat() - --SV.Comix:LaunchPopup("DELUXE") ComixToastyPanelBG.anim[2]:SetOffset(256, -256) ComixToastyPanelBG.anim[2]:SetOffset(0, 0) ComixToastyPanelBG.anim:Play() PlaySoundFile([[Interface\AddOns\SVUI\assets\sounds\toasty.mp3]]) end -local Comix_OnUpdate = function() SV.Comix:ReadyState(true) end -local Toasty_OnUpdate = function(self) SV.Comix:ReadyState(true); self.parent:SetAlpha(0) end - function SV.Comix:Initialize() - self.Basic = _G["SVUI_ComixFrame1"] - self.Deluxe = _G["SVUI_ComixFrame2"] - self.Premium = _G["SVUI_ComixFrame3"] + self.Basic = _G["SVUI_ComixPopup1"] + self.Deluxe = _G["SVUI_ComixPopup2"] + self.Premium = _G["SVUI_ComixPopup3"] - self.Basic:Size(64,64) + self.Basic:SetParent(SV.Screen) + self.Basic:SetSizeToScale(128,128) self.Basic.tex:SetTexCoord(0,0.25,0,0.25) - SV.Animate:Kapow(self.Basic, true) + SV.Animate:Kapow(self.Basic, true, true) self.Basic:SetAlpha(0) self.Basic.anim[2]:SetScript("OnFinished", Comix_OnUpdate) - self.Deluxe:Size(88,88) + self.Deluxe:SetParent(SV.Screen) + self.Deluxe:SetSizeToScale(128,128) self.Deluxe.tex:SetTexCoord(0,0.25,0,0.25) SV.Animate:RandomSlide(self.Deluxe, true) self.Deluxe:SetAlpha(0) self.Deluxe.anim[3]:SetScript("OnFinished", Comix_OnUpdate) + self.Premium:SetParent(SV.Screen) self.Premium.tex:SetTexCoord(0,0.25,0,0.25) SV.Animate:RandomSlide(self.Premium, true) self.Premium:SetAlpha(0) @@ -199,18 +196,18 @@ function SV.Comix:Initialize() self.Premium.bg.anim[3]:SetScript("OnFinished", Comix_OnUpdate) --MOD - local toasty = CreateFrame("Frame", "ComixToastyPanelBG", UIParent) + local toasty = CreateFrame("Frame", "ComixToastyPanelBG", SV.Screen) toasty:SetSize(256, 256) toasty:SetFrameStrata("DIALOG") - toasty:Point("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", 0, 0) + toasty:SetPointToScale("BOTTOMRIGHT", SV.Screen, "BOTTOMRIGHT", 0, 0) toasty.tex = toasty:CreateTexture(nil, "ARTWORK") - toasty.tex:FillInner(toasty) + toasty.tex:SetAllPointsIn(toasty) toasty.tex:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\TOASTY]]) SV.Animate:Slide(toasty, 256, -256, true) toasty:SetAlpha(0) toasty.anim[4]:SetScript("OnFinished", Toasty_OnUpdate) - self:ReadyState(true) + ComixReadyState(true) self:Toggle() end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/widgets/widget_dropdown.lua b/Interface/AddOns/SVUI/framework/widgets/widget_dropdown.lua index 4623fb8..fac1e54 100644 --- a/Interface/AddOns/SVUI/framework/widgets/widget_dropdown.lua +++ b/Interface/AddOns/SVUI/framework/widgets/widget_dropdown.lua @@ -145,7 +145,7 @@ function SV.Dropdown:Open(target, list) self.option[i].header = self.option[i]:CreateFontString(nil, 'OVERLAY'); self.option[i].header:SetAllPoints(); - self.option[i].header:SetFont(SV.Media.font.roboto, 10, "OUTLINE"); + self.option[i].header:SetFont(SV.Media.font.default, 10, "OUTLINE"); self.option[i].header:SetTextColor(1, 0.8, 0) self.option[i].header:SetJustifyH("CENTER"); self.option[i].header:SetJustifyV("MIDDLE"); @@ -162,7 +162,7 @@ function SV.Dropdown:Open(target, list) self.option[i].button.text = self.option[i].button:CreateFontString(nil, 'BORDER'); self.option[i].button.text:SetAllPoints(); - self.option[i].button.text:SetFont(SV.Media.font.roboto, 12, "OUTLINE"); + self.option[i].button.text:SetFont(SV.Media.font.default, 12, "OUTLINE"); self.option[i].button.text:SetJustifyH("LEFT"); self.option[i].button:SetScript("OnEnter", DropdownButton_OnEnter); @@ -220,12 +220,12 @@ function SV.Dropdown:Initialize() self:SetParent(SV.Screen) self:SetFrameStrata("DIALOG") self:SetFrameLevel(99) - self:SetPanelTemplate("Default") + self:SetStylePanel("Default", "Default") self.option = {} self:SetClampedToScreen(true) self:SetSize(155, 94) - WorldFrame:HookScript("OnMouseUp", function() + WorldFrame:HookScript("OnMouseDown", function() if(SV.Dropdown:IsShown()) then ToggleFrame(SV.Dropdown) end diff --git a/Interface/AddOns/SVUI/framework/widgets/widget_drunk.lua b/Interface/AddOns/SVUI/framework/widgets/widget_drunk.lua new file mode 100644 index 0000000..cb2c6c2 --- /dev/null +++ b/Interface/AddOns/SVUI/framework/widgets/widget_drunk.lua @@ -0,0 +1,176 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local math = _G.math; +--[[ MATH METHODS ]]-- +local random = math.random; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L + +SV.Drunk = _G["SVUI_BoozedUpFrame"]; +local WORN_ITEMS = {}; +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local DRUNK_EFFECT = [[Spells\Largebluegreenradiationfog.m2]]; +local DRUNK_EFFECT2 = [[Spells\Monk_drunkenhaze_impact.m2]]; +local TIPSY_FILTERS = { + [DRUNK_MESSAGE_ITEM_SELF1] = true, + [DRUNK_MESSAGE_ITEM_SELF2] = true, + [DRUNK_MESSAGE_SELF1] = true, + [DRUNK_MESSAGE_SELF2] = true, +}; +local DRUNK_FILTERS = { + [DRUNK_MESSAGE_ITEM_SELF3] = true, + [DRUNK_MESSAGE_ITEM_SELF4] = true, + [DRUNK_MESSAGE_SELF3] = true, + [DRUNK_MESSAGE_SELF4] = true, +}; +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +local function GetNekkid() + for c = 1, 19 do + if CursorHasItem() then + ClearCursor() + end + local item = GetInventoryItemID("player", c); + WORN_ITEMS[c] = item; + PickupInventoryItem(c); + for b = 1, 4 do + if CursorHasItem() then + PutItemInBag(b) + end + end + end +end + +local function GetDressed() + for c, item in pairs(WORN_ITEMS) do + if(item) then + EquipItemByName(item) + WORN_ITEMS[c] = false + end + end +end + +function SV.Drunk:PartysOver() + SetCVar("Sound_MusicVolume", 0) + SetCVar("Sound_EnableMusic", 0) + StopMusic() + SV.Drunk:Hide() + SV.Drunk.PartyMode = nil + SV:AddonMessage("Party's Over...") + --GetDressed() +end + +function SV.Drunk:LetsParty() + --GetNekkid() + self.PartyMode = true + SetCVar("Sound_MusicVolume", 100) + SetCVar("Sound_EnableMusic", 1) + StopMusic() + PlayMusic([[Interface\AddOns\SVUI\assets\sounds\beer30.mp3]]) + self:Show() + self.ScreenEffect1:ClearModel() + self.ScreenEffect1:SetModel(DRUNK_EFFECT) + self.ScreenEffect2:ClearModel() + self.ScreenEffect2:SetModel(DRUNK_EFFECT2) + self.ScreenEffect3:ClearModel() + self.ScreenEffect3:SetModel(DRUNK_EFFECT2) + SV:AddonMessage("YEEEEEEEEE-HAW!!!") + DoEmote("dance") + -- SV.Timers:ExecuteTimer(PartysOver, 60) +end + +local DrunkAgain_OnEvent = function(self, event, message, ...) + if(self.PartyMode) then + for pattern,_ in pairs(TIPSY_FILTERS) do + if(message:find(pattern)) then + self:PartysOver() + break + end + end + else + for pattern,_ in pairs(DRUNK_FILTERS) do + if(message:find(pattern)) then + self:LetsParty() + break + end + end + end +end + +function SV.Drunk:Toggle() + if(not SV.db.general.drunk) then + self:UnregisterEvent("CHAT_MSG_SYSTEM") + self:SetScript("OnEvent", nil) + else + self:RegisterEvent("CHAT_MSG_SYSTEM") + self:SetScript("OnEvent", DrunkAgain_OnEvent) + end +end + +function SV.Drunk:Initialize() + self:SetParent(SV.Screen) + self:ClearAllPoints() + self:SetAllPoints(SV.Screen) + + self.ScreenEffect1:SetParent(self) + self.ScreenEffect1:SetAllPoints(SV.Screen) + self.ScreenEffect1:SetModel(DRUNK_EFFECT) + self.ScreenEffect1:SetCamDistanceScale(1) + + self.ScreenEffect2:SetParent(self) + self.ScreenEffect2:SetPointToScale("BOTTOMLEFT", SV.Screen, "BOTTOMLEFT", 0, 0) + self.ScreenEffect2:SetPointToScale("TOPRIGHT", SV.Screen, "TOP", 0, 0) + --self.ScreenEffect2:SetSizeToScale(350, 600) + self.ScreenEffect2:SetModel(DRUNK_EFFECT2) + self.ScreenEffect2:SetCamDistanceScale(0.25) + --self.ScreenEffect2:SetPosition(-0.21,-0.15,0) + + self.ScreenEffect3:SetParent(self) + self.ScreenEffect3:SetPointToScale("BOTTOMRIGHT", SV.Screen, "BOTTOMRIGHT", 0, 0) + self.ScreenEffect3:SetPointToScale("TOPLEFT", SV.Screen, "TOP", 0, 0) + --self.ScreenEffect3:SetSizeToScale(350, 600) + self.ScreenEffect3:SetModel(DRUNK_EFFECT2) + self.ScreenEffect3:SetCamDistanceScale(0.25) + --self.ScreenEffect3:SetPosition(-0.21,-0.15,0) + + self.YeeHaw = _G["SVUI_DrunkenYeeHaw"] + self.YeeHaw:SetParent(self) + self.YeeHaw:SetSizeToScale(512,350) + self.YeeHaw:SetPointToScale("TOP", SV.Screen, "TOP", 0, -50); + + self:Hide() + + self:Toggle() +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/widgets/widget_gamemenu.lua b/Interface/AddOns/SVUI/framework/widgets/widget_gamemenu.lua index 9482c22..80e5216 100644 --- a/Interface/AddOns/SVUI/framework/widgets/widget_gamemenu.lua +++ b/Interface/AddOns/SVUI/framework/widgets/widget_gamemenu.lua @@ -67,7 +67,7 @@ local function rng() end local Activate = function(self) - if(not SV.db.general.gamemenu) then + if(SV.db.general.gamemenu == 'NONE') then self:Toggle() return end @@ -88,11 +88,25 @@ function SV.GameMenu:Initialize() self.ModelLeft:SetPortraitZoom(0.05) self.ModelLeft:SetPosition(0,0,-0.25) - self.ModelRight:SetDisplayInfo(49084) - self.ModelRight:SetRotation(-1) - self.ModelRight:SetCamDistanceScale(1.9) - self.ModelRight:SetFacing(6) - self.ModelRight:SetPosition(0,0,-0.3) + if(SV.db.general.gamemenu == '1') then + self.ModelRight:SetDisplayInfo(49084) + self.ModelRight:SetRotation(-1) + self.ModelRight:SetCamDistanceScale(1.9) + self.ModelRight:SetFacing(6) + self.ModelRight:SetPosition(0,0,-0.3) + elseif(SV.db.general.gamemenu == '2') then + self.ModelRight:SetUnit("player") + self.ModelRight:SetRotation(-1) + self.ModelRight:SetCamDistanceScale(1.9) + self.ModelRight:SetFacing(6) + self.ModelRight:SetPosition(0,0,-0.3) + end + + -- local effectFrame = CreateFrame("PlayerModel", nil, self.ModelRight) + -- effectFrame:SetAllPoints(self.ModelRight) + -- effectFrame:SetCamDistanceScale(1) + -- effectFrame:SetPortraitZoom(0) + -- effectFrame:SetModel([[Spells\Blackmagic_precast_base.m2]]) -- local splash = self:CreateTexture(nil, "OVERLAY") -- splash:SetSize(600, 300) @@ -104,7 +118,7 @@ function SV.GameMenu:Initialize() end function SV.GameMenu:Toggle() - if(SV.db.general.gamemenu) then + if(SV.db.general.gamemenu ~= 'NONE') then self:Show() self:SetScript("OnShow", Activate) else diff --git a/Interface/AddOns/SVUI/framework/widgets/widget_superbutton.lua b/Interface/AddOns/SVUI/framework/widgets/widget_superbutton.lua new file mode 100644 index 0000000..ce68ada --- /dev/null +++ b/Interface/AddOns/SVUI/framework/widgets/widget_superbutton.lua @@ -0,0 +1,827 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local string = _G.string; +local math = _G.math; +--[[ STRING METHODS ]]-- +local find, format, split = string.find, string.format, string.split; +local gsub = string.gsub; +--[[ MATH METHODS ]]-- +local ceil = math.ceil; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L; +local SuperButton = _G["SVUI_SuperButtonFrame"]; +SuperButton.RegisteredButtons = {}; +SuperButton.ActionBlackList = {}; +SuperButton.SpellBlackList = {}; +SuperButton.ItemBlackList = {}; +local ORDERED_LIST = {}; +local NO_ART = [[Interface\AddOns\SVUI\assets\artwork\Template\EMPTY]]; +--[[ +########################################################## +HELPERS +########################################################## +]]-- +local UpdateActionCooldown = function(self) + if(self:IsShown() and self.action) then + local start, duration, enable = GetActionCooldown(self.action) + if((start and start > 0) and (duration and duration > 0)) then + self.Cooldown:SetCooldown(start, duration) + self.Cooldown:Show() + else + self.Cooldown:Hide() + end + end +end + +local UpdateSpellCooldown = function(self) + if(self:IsShown() and self.spellName) then + local start, duration, enable = GetSpellCooldown(self.spellName) + if((start and start > 0) and (duration and duration > 0)) then + self.Cooldown:SetCooldown(start, duration) + self.Cooldown:Show() + else + self.Cooldown:Hide() + end + end +end + +local UpdateItemCooldown = function(self) + if(self:IsShown() and self.itemID) then + local start, duration, enable = GetItemCooldown(self.itemID) + if((start and start > 0) and (duration and duration > 0)) then + self.Cooldown:SetCooldown(start, duration) + self.Cooldown:Show() + else + self.Cooldown:Hide() + end + end +end +--[[ +########################################################## +SCRIPT HANDLERS +########################################################## +]]-- +local SuperActionButton_OnEnter = function(self) + if(self.action) then + GameTooltip:SetOwner(self, 'ANCHOR_LEFT') + GameTooltip:SetAction(self.action) + end +end + +local SuperSpellButton_OnEnter = function(self) + if(self.spellID) then + GameTooltip:SetOwner(self, 'ANCHOR_LEFT') + GameTooltip:SetSpellByID(self.spellID) + end +end + +local SuperItemButton_OnEnter = function(self) + if(self.itemID) then + GameTooltip:SetOwner(self, 'ANCHOR_LEFT') + GameTooltip:SetHyperlink(self.itemLink) + end +end + +local SuperButton_OnShow = function(self) + SuperButton.isActive = true; + if(self.Artwork) then + self.Artwork:SetAlpha(1) + end + self:FadeIn() +end + +local SuperButton_OnHide = function(self) + SuperButton.isActive = false; + if(self.Artwork) then + self.Artwork:SetAlpha(0) + end +end + +local GetSetPositions = function(self) + local highestIndex = 0; + local lastFrame = SuperButton; + for name, frame in pairs(SuperButton.RegisteredButtons) do + if((frame ~= self) and frame:IsShown() and (frame.___posIndex > highestIndex)) then + highestIndex = frame.___posIndex; + lastFrame = name; + end + end + + self.___posIndex = highestIndex + 1; + --print(self:GetName() .. " = " .. self.___posIndex) + return lastFrame; +end + +local GetResetPositions = function(self) + self.___posIndex = 0; + for name, frame in pairs(SuperButton.RegisteredButtons) do + if((frame ~= self) and frame:IsShown() and (frame.___posIndex == 1)) then + tinsert(ORDERED_LIST, name) + end + end + for name, frame in pairs(SuperButton.RegisteredButtons) do + if((frame ~= self) and frame:IsShown() and (frame.___posIndex > 1)) then + tinsert(ORDERED_LIST, name) + end + end + return ORDERED_LIST; +end + +local UpdateGeneric = function(self) + return true; +end + +local SuperButtonAction_OnEvent = function(self, event) + if(event == 'PLAYER_REGEN_ENABLED') then + self:SetAttribute('action', self.attribute) + self:UnregisterEvent(event) + self:UpdateCooldown() + elseif(event == 'UPDATE_BINDINGS') then + if(self:IsShown()) then + self:SetAbility() + self:SetAttribute('binding', GetTime()) + end + else + self:Update() + end +end + +local SuperButtonSpell_OnEvent = function(self, event) + if(event == 'PLAYER_REGEN_ENABLED') then + self:SetAttribute('spell', self.attribute) + self:UnregisterEvent(event) + self:UpdateCooldown() + elseif(event == 'UPDATE_BINDINGS') then + if(self:IsShown()) then + self:SetAbility() + self:SetAttribute('binding', GetTime()) + end + else + self:Update() + end +end + +local SuperButtonItem_OnEvent = function(self, event) + if(event == 'BAG_UPDATE_COOLDOWN') then + self:UpdateCooldown() + elseif(event == 'PLAYER_REGEN_ENABLED') then + self:SetAttribute('item', self.attribute) + self:UnregisterEvent(event) + self:UpdateCooldown() + elseif(event == 'UPDATE_BINDINGS') then + if(self:IsShown()) then + self:SetAbility() + self:SetAttribute('binding', GetTime()) + end + else + self:Update() + end +end +--[[ +########################################################## +ACTION BUTTON INTERNALS +########################################################## +]]-- +local SetSuperButtonAction = function(self, action) + if(action) then + if(action == self.action and self:IsShown()) then + return false + end + self.action = action + + if(SuperButton.ActionBlackList[self.action]) then + return false + end + end + + local HotKey = self.HotKey + local key = GetBindingKey(self.___binding) + if(key) then + HotKey:SetText(GetBindingText(key, 1)) + HotKey:Show() + elseif(ActionHasRange(self.action)) then + HotKey:SetText(RANGE_INDICATOR) + HotKey:Show() + else + HotKey:Hide() + end + + if(InCombatLockdown()) then + self.attribute = self.action + self:RegisterEvent('PLAYER_REGEN_ENABLED') + else + self:SetAttribute('action', self.action) + self:UpdateCooldown() + end + + return true +end + +local RemoveSuperButtonAction = function(self) + self:FadeOut() + if(InCombatLockdown()) then + self.attribute = nil; + self:RegisterEvent('PLAYER_REGEN_ENABLED') + else + self:SetAttribute('action', nil) + end +end + +local SuperActionButton_OnUpdate = function(self, elapsed) + if(not self.action) then return end + if(self.rangeTimer > 0.2) then + local HotKey = self.HotKey + local inRange = IsActionInRange(self.action, 'target') + if(HotKey:GetText() == RANGE_INDICATOR) then + if(inRange == false) then + HotKey:SetTextColor(1, 0.1, 0.1) + HotKey:Show() + elseif(inRange) then + HotKey:SetTextColor(1, 1, 1) + HotKey:Show() + else + HotKey:Hide() + end + else + if(inRange == false) then + HotKey:SetTextColor(1, 0.1, 0.1) + else + HotKey:SetTextColor(1, 1, 1) + end + end + + self.rangeTimer = 0 + else + self.rangeTimer = self.rangeTimer + elapsed + end + + if(self.updateTimer > 5) then + self:Update() + self.updateTimer = 0 + else + self.updateTimer = self.updateTimer + elapsed + end +end +--[[ +########################################################## +SPELL BUTTON INTERNALS +########################################################## +]]-- +local SetSuperButtonSpell = function(self, spellID, spellName, texture) + if(spellID and spellName) then + if(spellID == self.spellID and self:IsShown()) then + return false + end + + self.Icon:SetTexture(texture) + self.spellID = spellID + self.spellName = spellName + + if(SuperButton.SpellBlackList[self.spellID]) then + return false + end + end + + local HotKey = self.HotKey + local key = GetBindingKey(self.___binding) + if(key) then + HotKey:SetText(GetBindingText(key, 1)) + HotKey:Show() + elseif(SpellHasRange(self.spellName)) then + HotKey:SetText(RANGE_INDICATOR) + HotKey:Show() + else + HotKey:Hide() + end + + if(InCombatLockdown()) then + self.attribute = self.spellName + self:RegisterEvent('PLAYER_REGEN_ENABLED') + else + self:SetAttribute('spell', self.spellName) + self:UpdateCooldown() + end + + return true +end + +local RemoveSuperButtonSpell = function(self) + self:FadeOut() + if(InCombatLockdown()) then + self.attribute = nil; + self:RegisterEvent('PLAYER_REGEN_ENABLED'); + else + self:SetAttribute('spell', nil); + end +end + +local SuperSpellButton_OnUpdate = function(self, elapsed) + if(not self.spellName) then return end + if(self.rangeTimer > 0.2) then + local HotKey = self.HotKey + local inRange = IsSpellInRange(self.spellName, 'target') + if(HotKey:GetText() == RANGE_INDICATOR) then + if(inRange == false) then + HotKey:SetTextColor(1, 0.1, 0.1) + HotKey:Show() + elseif(inRange) then + HotKey:SetTextColor(1, 1, 1) + HotKey:Show() + else + HotKey:Hide() + end + else + if(inRange == false) then + HotKey:SetTextColor(1, 0.1, 0.1) + else + HotKey:SetTextColor(1, 1, 1) + end + end + + self.rangeTimer = 0 + else + self.rangeTimer = self.rangeTimer + elapsed + end + + if(self.updateTimer > 5) then + self:Update() + self.updateTimer = 0 + else + self.updateTimer = self.updateTimer + elapsed + end +end +--[[ +########################################################## +ITEM BUTTON INTERNALS +########################################################## +]]-- +local SetSuperButtonItem = function(self, itemLink, texture) + if(itemLink) then + if(itemLink == self.itemLink and self:IsShown()) then + return false + end + + self.Icon:SetTexture(texture) + self.itemID, self.itemName = string.match(itemLink, '|Hitem:(.-):.-|h%[(.+)%]|h') + self.itemLink = itemLink + + if(SuperButton.ItemBlackList[self.itemID]) then + return false + end + end + + local HotKey = self.HotKey + local key = GetBindingKey(self.___binding) + if(key) then + HotKey:SetText(GetBindingText(key, 1)) + HotKey:Show() + elseif(ItemHasRange(self.itemLink)) then + HotKey:SetText(RANGE_INDICATOR) + HotKey:Show() + else + HotKey:Hide() + end + + if(InCombatLockdown()) then + self.attribute = self.itemName + self:RegisterEvent('PLAYER_REGEN_ENABLED') + else + self:SetAttribute('item', self.itemName) + self:UpdateCooldown() + end + + return true +end + +local RemoveSuperButtonItem = function(self) + self:FadeOut() + if(InCombatLockdown()) then + self.attribute = nil; + self:RegisterEvent('PLAYER_REGEN_ENABLED'); + else + self:SetAttribute('item', nil) + end +end + +local SuperItemButton_OnUpdate = function(self, elapsed) + if(not self.itemID) then return end + if(self.rangeTimer > 0.2) then + local HotKey = self.HotKey + local inRange = IsItemInRange(self.itemID, 'target') + if(HotKey:GetText() == RANGE_INDICATOR) then + if(inRange == false) then + HotKey:SetTextColor(1, 0.1, 0.1) + HotKey:Show() + elseif(inRange) then + HotKey:SetTextColor(1, 1, 1) + HotKey:Show() + else + HotKey:Hide() + end + else + if(inRange == false) then + HotKey:SetTextColor(1, 0.1, 0.1) + else + HotKey:SetTextColor(1, 1, 1) + end + end + + self.rangeTimer = 0 + else + self.rangeTimer = self.rangeTimer + elapsed + end + + if(self.updateTimer > 5) then + self:Update() + self.updateTimer = 0 + else + self.updateTimer = self.updateTimer + elapsed + end +end +--[[ +########################################################## +CONSTRUCTS +########################################################## +]]-- +function SuperButton:SetFrameReferences() + local listing = self.RegisteredButtons; + for buttonName, button in pairs(listing) do + button:SetFrameRef("SVUI_SuperButtonFrame", SVUI_SuperButtonFrame); + for name, frame in pairs(listing) do + if(frame ~= button) then + button:SetFrameRef(name, frame); + end + end + end +end + +function SuperButton:AddAction(buttonName, updateFunc, eventFunc, bindingKey) + local special = CreateFrame('Button', buttonName, UIParent, 'SecureActionButtonTemplate, SecureHandlerStateTemplate, SecureHandlerAttributeTemplate'); + special:SetSizeToScale(50,50); + special:SetPointToScale("CENTER", self, "CENTER", 0, 0); + special:SetAlpha(0); + special:SetStylePanel("Icon"); + special:SetScript('OnEnter', SuperActionButton_OnEnter); + special:SetScript('OnLeave', GameTooltip_Hide); + special:SetScript('OnShow', SuperButton_OnShow); + special:SetScript('OnHide', SuperButton_OnHide); + + special.___posIndex = 1; + special.___binding = bindingKey; + special.updateTimer = 0; + special.rangeTimer = 0; + + special.GetPositionRef = GetSetPositions; + special.GetResetRefList = GetResetPositions; + special.SetAbility = SetSuperButtonAction; + special.RemoveAbility = RemoveSuperButtonAction; + special.UpdateCooldown = UpdateActionCooldown; + if(updateFunc and type(updateFunc) == 'function') then + special.Update = updateFunc; + else + special.Update = UpdateGeneric; + end + if(eventFunc and type(eventFunc) == 'function') then + special:SetScript('OnEvent', eventFunc) + else + special:SetScript('OnEvent', SuperButtonAction_OnEvent) + end + + local Artwork = special.Panel:CreateTexture('$parentArtwork', 'BACKGROUND') + Artwork:SetPoint('CENTER', -2, 2) + Artwork:SetSizeToScale(256, 128) + Artwork:SetTexture(NO_ART) + Artwork:SetAlpha(0) + special.Artwork = Artwork + + local Icon = special:CreateTexture('$parentIcon', 'BACKGROUND') + Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + Icon:SetAllPoints() + special.Icon = Icon + + local HotKey = special:CreateFontString('$parentHotKey', nil, 'NumberFontNormal') + HotKey:SetPoint('BOTTOMRIGHT', -5, 5) + special.HotKey = HotKey + + local Cooldown = CreateFrame('Cooldown', '$parentCooldown', special, 'CooldownFrameTemplate') + Cooldown:ClearAllPoints() + Cooldown:SetPoint('TOPRIGHT', -2, -3) + Cooldown:SetPoint('BOTTOMLEFT', 2, 1) + Cooldown:Hide() + special.Cooldown = Cooldown + + local Count = Cooldown:CreateFontString(nil, 'OVERLAY', 'NumberFontNormal') + Count:SetPoint('BOTTOMLEFT', 5, 5) + special.Count = Count + + special:SetScript('OnUpdate', SuperActionButton_OnUpdate) + special:RegisterEvent('UPDATE_BINDINGS') + + + + special:SetAttribute('type', 'action'); + special:SetAttribute('_onattributechanged', [[ + if(name == 'action') then + if(value and not self:IsShown()) then + local refName = self:CallMethod('GetPositionRef'); + local lastFrame = self:GetFrameRef(refName); + if(lastFrame) then + self:ClearAllPoints() + self:SetPoint("BOTTOM", lastFrame, "TOP", 0, 8) + end + self:Show() + elseif(not value) then + local refList = self:CallMethod('GetResetRefList'); + local lastFrame, nextFrame; + if(refList) then + for _,refName in ipairs(refList) do + nextFrame = self:GetFrameRef(refName); + if(nextFrame) then + nextFrame:ClearAllPoints() + if(not lastFrame) then + lastFrame = self:GetFrameRef("SVUI_SuperButtonFrame"); + nextFrame:SetPoint("CENTER", lastFrame, "CENTER", 0, 0); + else + nextFrame:SetPoint("BOTTOM", lastFrame, "TOP", 0, 8); + end + end + end + end + self:Hide() + self:ClearBindings() + end + end + if(self:IsShown() and (self.___binding) and (name == 'action' or name == 'binding')) then + self:ClearBindings() + local key = GetBindingKey(self.___binding) + if(key) then + self:SetBindingClick(1, key, self, 'LeftButton') + end + end + ]]); + + self.RegisteredButtons[buttonName] = special; + + self:SetFrameReferences() + + --special:Hide() + + return special +end + +function SuperButton:AddSpell(buttonName, updateFunc, eventFunc, bindingKey) + local special = CreateFrame('Button', buttonName, UIParent, 'SecureActionButtonTemplate, SecureHandlerStateTemplate, SecureHandlerAttributeTemplate'); + special:SetSizeToScale(50,50); + special:SetPointToScale("CENTER", self, "CENTER", 0, 0); + special:SetAlpha(0); + special:SetStylePanel("Icon"); + special:SetScript('OnEnter', SuperSpellButton_OnEnter); + special:SetScript('OnLeave', GameTooltip_Hide); + special:SetScript('OnShow', SuperButton_OnShow); + special:SetScript('OnHide', SuperButton_OnHide); + + special.___posIndex = 1; + special.___binding = bindingKey; + special.updateTimer = 0; + special.rangeTimer = 0; + + special.GetPositionRef = GetSetPositions; + special.GetResetRefList = GetResetPositions; + special.SetAbility = SetSuperButtonSpell; + special.RemoveAbility = RemoveSuperButtonSpell; + special.UpdateCooldown = UpdateSpellCooldown; + + if(updateFunc and type(updateFunc) == 'function') then + special.Update = updateFunc + else + special.Update = UpdateGeneric + end + if(eventFunc and type(eventFunc) == 'function') then + special:SetScript('OnEvent', eventFunc) + else + special:SetScript('OnEvent', SuperButtonSpell_OnEvent) + end + + local Artwork = special.Panel:CreateTexture('$parentArtwork', 'BACKGROUND') + Artwork:SetPoint('CENTER', -2, 2) + Artwork:SetSizeToScale(256, 128) + Artwork:SetTexture(NO_ART) + Artwork:SetAlpha(0) + special.Artwork = Artwork + + local Icon = special:CreateTexture('$parentIcon', 'BACKGROUND') + Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + Icon:SetAllPoints() + special.Icon = Icon + + local HotKey = special:CreateFontString('$parentHotKey', nil, 'NumberFontNormal') + HotKey:SetPoint('BOTTOMRIGHT', -5, 5) + special.HotKey = HotKey + + local Cooldown = CreateFrame('Cooldown', '$parentCooldown', special, 'CooldownFrameTemplate') + Cooldown:ClearAllPoints() + Cooldown:SetPoint('TOPRIGHT', -2, -3) + Cooldown:SetPoint('BOTTOMLEFT', 2, 1) + Cooldown:Hide() + special.Cooldown = Cooldown + + special:SetScript('OnUpdate', SuperSpellButton_OnUpdate) + special:RegisterEvent('UPDATE_BINDINGS') + + special:SetAttribute('type', 'spell'); + special:SetAttribute('_onattributechanged', [[ + if(name == 'spell') then + if(value and not self:IsShown()) then + local refName = self:CallMethod('GetPositionRef'); + local lastFrame = self:GetFrameRef(refName); + if(lastFrame) then + self:ClearAllPoints() + self:SetPoint("BOTTOM", lastFrame, "TOP", 0, 8) + end + self:Show() + elseif(not value) then + local refList = self:CallMethod('GetResetRefList'); + local lastFrame, nextFrame; + if(refList) then + for _,refName in ipairs(refList) do + nextFrame = self:GetFrameRef(refName); + if(nextFrame) then + nextFrame:ClearAllPoints() + if(not lastFrame) then + lastFrame = self:GetFrameRef("SVUI_SuperButtonFrame"); + nextFrame:SetPoint("CENTER", lastFrame, "CENTER", 0, 0); + else + nextFrame:SetPoint("BOTTOM", lastFrame, "TOP", 0, 8); + end + end + end + end + self:Hide() + self:ClearBindings() + end + end + if(self:IsShown() and (self.___binding) and (name == 'spell' or name == 'binding')) then + self:ClearBindings() + local key = GetBindingKey(self.___binding) + if(key) then + self:SetBindingClick(1, key, self, 'LeftButton') + end + end + ]]); + + self.RegisteredButtons[buttonName] = special; + + self:SetFrameReferences() + + --special:Hide() + + return special +end + +function SuperButton:AddItem(buttonName, updateFunc, eventFunc, bindingKey) + local special = CreateFrame('Button', buttonName, UIParent, 'SecureActionButtonTemplate, SecureHandlerStateTemplate, SecureHandlerAttributeTemplate'); + special:SetSizeToScale(50,50); + special:SetPointToScale("CENTER", self, "CENTER", 0, 0); + special:SetAlpha(0); + special:SetStylePanel("Icon"); + special:SetScript('OnEnter', SuperItemButton_OnEnter); + special:SetScript('OnLeave', GameTooltip_Hide); + special:SetScript('OnShow', SuperButton_OnShow); + special:SetScript('OnHide', SuperButton_OnHide); + + special.___posIndex = 1; + special.___binding = bindingKey; + special.updateTimer = 0; + special.rangeTimer = 0; + + special.GetPositionRef = GetSetPositions; + special.GetResetRefList = GetResetPositions; + special.SetAbility = SetSuperButtonItem; + special.RemoveAbility = RemoveSuperButtonItem; + special.UpdateCooldown = UpdateItemCooldown; + + if(updateFunc and type(updateFunc) == 'function') then + special.Update = updateFunc + else + special.Update = UpdateGeneric + end + if(eventFunc and type(eventFunc) == 'function') then + special:SetScript('OnEvent', eventFunc) + else + special:SetScript('OnEvent', SuperButtonItem_OnEvent) + end + + local Artwork = special.Panel:CreateTexture('$parentArtwork', 'BACKGROUND') + Artwork:SetPoint('CENTER', -2, 2) + Artwork:SetSizeToScale(256, 128) + Artwork:SetTexture(NO_ART) + Artwork:SetAlpha(0) + special.Artwork = Artwork + + local Icon = special:CreateTexture('$parentIcon', 'BACKGROUND') + Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + Icon:SetAllPoints() + special.Icon = Icon + + local HotKey = special:CreateFontString('$parentHotKey', nil, 'NumberFontNormal') + HotKey:SetPoint('BOTTOMRIGHT', -5, 5) + special.HotKey = HotKey + + local Cooldown = CreateFrame('Cooldown', '$parentCooldown', special, 'CooldownFrameTemplate') + Cooldown:ClearAllPoints() + Cooldown:SetPoint('TOPRIGHT', -2, -3) + Cooldown:SetPoint('BOTTOMLEFT', 2, 1) + Cooldown:Hide() + special.Cooldown = Cooldown + + special:RegisterEvent('UPDATE_BINDINGS') + + special:SetAttribute('type', 'item'); + special:SetAttribute('_onattributechanged', [[ + if(name == 'item') then + if(value and not self:IsShown()) then + local refName = self:CallMethod('GetPositionRef'); + local lastFrame = self:GetFrameRef(refName); + if(lastFrame) then + self:ClearAllPoints() + self:SetPoint("BOTTOM", lastFrame, "TOP", 0, 8) + end + self:Show() + elseif(not value) then + local refList = self:CallMethod('GetResetRefList'); + local lastFrame, nextFrame; + if(refList) then + for _,refName in ipairs(refList) do + nextFrame = self:GetFrameRef(refName); + if(nextFrame) then + nextFrame:ClearAllPoints() + if(not lastFrame) then + lastFrame = self:GetFrameRef("SVUI_SuperButtonFrame"); + nextFrame:SetPoint("CENTER", lastFrame, "CENTER", 0, 0); + else + nextFrame:SetPoint("BOTTOM", lastFrame, "TOP", 0, 8); + end + end + end + end + self:Hide() + self:ClearBindings() + end + end + if(self:IsShown() and (self.___binding) and (name == 'item' or name == 'binding')) then + self:ClearBindings() + local key = GetBindingKey(self.___binding) + if(key) then + self:SetBindingClick(1, key, self, 'LeftButton') + end + end + ]]); + + self.RegisteredButtons[buttonName] = special; + + self:SetFrameReferences() + + --special:Hide() + + return special +end +--[[ +########################################################## +PACKAGE CALL +########################################################## +]]-- +function SuperButton:Initialize() + self:SetParent(SV.Screen) + self:SetPointToScale("BOTTOM", SV.Screen, "BOTTOM", 0, 325) + self:SetSizeToScale(50,50) + + SV.Mentalo:Add(self, L["Special Ability Button"]) +end + +SV.SuperButton = SuperButton; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/widgets/widgets.xml b/Interface/AddOns/SVUI/framework/widgets/widgets.xml index 01834dd..5917881 100644 --- a/Interface/AddOns/SVUI/framework/widgets/widgets.xml +++ b/Interface/AddOns/SVUI/framework/widgets/widgets.xml @@ -171,10 +171,12 @@ </Frames> </Frame> - <Frame name="SVUI_ComixFrame1" frameStrata="DIALOG"> + <Frame name="SVUI_ComixFrame" frameStrata="DIALOG" hidden="true" /> + + <Frame name="SVUI_ComixPopup1" frameStrata="DIALOG"> <Size x="100" y="100"/> <Anchors> - <Anchor point="CENTER" relativePoint="CENTER" x="0" y="-50" /> + <Anchor point="CENTER" relativePoint="CENTER" x="0" y="0" /> </Anchors> <Layers> <Layer level="ARTWORK"> @@ -183,10 +185,10 @@ </Layers> </Frame> - <Frame name="SVUI_ComixFrame2" frameStrata="DIALOG"> + <Frame name="SVUI_ComixPopup2" frameStrata="DIALOG"> <Size x="100" y="100"/> <Anchors> - <Anchor point="CENTER" relativePoint="CENTER" x="0" y="-50" /> + <Anchor point="BOTTOM" relativePoint="BOTTOM" x="0" y="100" /> </Anchors> <Layers> <Layer level="ARTWORK"> @@ -195,10 +197,10 @@ </Layers> </Frame> - <Frame name="SVUI_ComixFrame3" frameStrata="DIALOG"> + <Frame name="SVUI_ComixPopup3" frameStrata="DIALOG"> <Size x="100" y="100"/> <Anchors> - <Anchor point="CENTER" relativePoint="CENTER" x="0" y="-50" /> + <Anchor point="CENTER" relativePoint="CENTER" x="0" y="0" /> </Anchors> <Layers> <Layer level="ARTWORK"> @@ -209,7 +211,7 @@ <Frame name="$parentBG" parentKey="bg" frameStrata="BACKGROUND"> <Size x="128" y="128"/> <Anchors> - <Anchor point="CENTER" relativePoint="CENTER" x="0" y="-50" /> + <Anchor point="CENTER" relativePoint="CENTER" x="0" y="0" /> </Anchors> <Layers> <Layer level="ARTWORK"> @@ -220,8 +222,45 @@ </Frames> </Frame> + <Frame name="SVUI_SuperButtonFrame" parent="UIParent" hidden="true"> + <Size x="64" y="64"/> + <Anchors> + <Anchor point="BOTTOM" x="0" y="160"/> + </Anchors> + </Frame> + + <Frame name="SVUI_BoozedUpFrame" parent="UIParent" setAllPoints="true"> + <Frames> + <PlayerModel name="$parentScreenEffect1" parentKey="ScreenEffect1" frameStrata="BACKGROUND" setAllPoints="true" /> + <PlayerModel name="$parentScreenEffect2" parentKey="ScreenEffect2" frameStrata="BACKGROUND"> + <Anchors> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" x="0" y="0" /> + </Anchors> + </PlayerModel> + <PlayerModel name="$parentScreenEffect3" parentKey="ScreenEffect3" frameStrata="BACKGROUND"> + <Anchors> + <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="0" /> + </Anchors> + </PlayerModel> + </Frames> + </Frame> + + <Frame name="SVUI_DrunkenYeeHaw" frameStrata="DIALOG"> + <Size x="256" y="128"/> + <Anchors> + <Anchor point="CENTER" relativePoint="CENTER" x="-50" y="-50" /> + </Anchors> + <Layers> + <Layer level="ARTWORK"> + <Texture parentKey="tex" file="Interface\AddOns\SVUI\assets\artwork\Doodads\DRUNK-PARTYTIME" setAllPoints="true" /> + </Layer> + </Layers> + </Frame> + <Script file="widget_dropdown.lua"/> <Script file="widget_gamemenu.lua"/> <Script file="widget_afk.lua"/> <Script file="widget_comix.lua"/> + <Script file="widget_superbutton.lua"/> + <Script file="widget_drunk.lua"/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/language/chinese_ui.lua b/Interface/AddOns/SVUI/language/chinese_ui.lua index 565492e..f0cf377 100644 --- a/Interface/AddOns/SVUI/language/chinese_ui.lua +++ b/Interface/AddOns/SVUI/language/chinese_ui.lua @@ -332,7 +332,7 @@ L["Auras Frame"]="BUFF/DEBUFF 框" L["Bags"]="背包" L["Bar "]="快捷列 " L["BNet Frame"]="战网提示资讯" -L["Boss Button"]="特殊技能键" +L["Special Ability Button"]="特殊技能键" L["Boss Frames"]="首领框架" L["Experience Bar"]="经验条" L["Focus Castbar"]="焦点目标施法条" @@ -381,7 +381,7 @@ L["Confused.. Try Again!"]='请再试一次!' L["Deleted %d gray items. Total Worth: %s"]="已删除 %d 个灰色物品. 总价值: " L["No gray items to delete."]="没有要删除的灰色物品" L["No gray items to sell."]="无灰色物品出售." -L["The spell '%s' has been added to the Blocked unitframe aura filter."]='法术"%s"已经被添加到单位框架的光环过滤器中.' +L["The spell '%s' has been added to the BlackList unitframe aura filter."]='法术"%s"已经被添加到单位框架的光环过滤器中.' L["Vendored gray items for:"]="已出售灰色物品:" L["You don't have enough money to repair."]="没有足够的资金来修复." L["You must be at a vendor."]="你必需以商人为目标." diff --git a/Interface/AddOns/SVUI/language/english_ui.lua b/Interface/AddOns/SVUI/language/english_ui.lua index 6d484b3..66a027c 100644 --- a/Interface/AddOns/SVUI/language/english_ui.lua +++ b/Interface/AddOns/SVUI/language/english_ui.lua @@ -254,7 +254,7 @@ L["Auras Frame"]=true; L["Bags"]=true; L["Bar "]=true; L["BNet Frame"]=true; -L["Boss Button"]=true; +L["Special Ability Button"]=true; L["Boss Frames"]=true; L["Experience Bar"]=true; L["Focus Castbar"]=true; @@ -302,7 +302,7 @@ L["Confused.. Try Again!"]=true; L["Deleted %d gray items. Total Worth: %s"]=true; L["No gray items to delete."]=true; L["No gray items to sell."]=true; -L["The spell '%s' has been added to the Blocked unitframe aura filter."]=true; +L["The spell '%s' has been added to the BlackList unitframe aura filter."]=true; L["Vendored gray items for:"]=true; L["You don't have enough money to repair."]=true; L["You must be at a vendor."]=true; diff --git a/Interface/AddOns/SVUI/language/french_ui.lua b/Interface/AddOns/SVUI/language/french_ui.lua index 4c08aaf..be80e14 100644 --- a/Interface/AddOns/SVUI/language/french_ui.lua +++ b/Interface/AddOns/SVUI/language/french_ui.lua @@ -333,7 +333,7 @@ L["Auras Frame"]="Fenêtre des Auras" L["Bags"]="Sacs" L["Bar "]="Barre " L["BNet Frame"]="Fenetre BNet" -L["Boss Button"]="Bouton du Boss" +L["Special Ability Button"]="Bouton du Boss" L["Boss Frames"]="Cadre du Boss" L["Experience Bar"]="Barre d'expérience" L["Focus Castbar"]="Barre d'incantation du Focus" @@ -382,7 +382,7 @@ L["Confused.. Try Again!"]="Confus...Essayez à nouveau!" L["Deleted %d gray items. Total Worth: %s"]="%d Objet(s) gris détruit(s). Valeur totale perdue :%s" L["No gray items to delete."]="Aucun objet gris à détruire." L["No gray items to sell."]="Aucun objet gris à vendre." -L["The spell '%s' has been added to the Blocked unitframe aura filter."]="Le sort '%s' a bien été ajouté à la liste noire des filtres des cadres d'unités." +L["The spell '%s' has been added to the BlackList unitframe aura filter."]="Le sort '%s' a bien été ajouté à la liste noire des filtres des cadres d'unités." L["Vendored gray items for:"]="Objets gris vendus pour:" L["You don't have enough money to repair."]="Vous n'avez pas assez d'argent pour réparer votre équipement." L["You must be at a vendor."]="Vous devez être chez un marchand." diff --git a/Interface/AddOns/SVUI/language/german_ui.lua b/Interface/AddOns/SVUI/language/german_ui.lua index 04607bf..dc7fb7a 100644 --- a/Interface/AddOns/SVUI/language/german_ui.lua +++ b/Interface/AddOns/SVUI/language/german_ui.lua @@ -333,7 +333,7 @@ L["Auras Frame"]="Aurenfenster" L["Bags"]="Taschen" L["Bar "]="Leiste " L["BNet Frame"]="BNet-Fenster" -L["Boss Button"]="Boss Button" +L["Special Ability Button"]="Special Ability Button" L["Boss Frames"]="Boss Fenster" L["Experience Bar"]="Erfahrungsleiste" L["Focus Castbar"]="Fokus Zauberbalken" @@ -382,7 +382,7 @@ L["Confused.. Try Again!"]='Verwirrt.. Versuche es erneut!' L["Deleted %d gray items. Total Worth: %s"]="Es wurden %d graue Gegenstände gelöscht. Gesamtwert: %s" L["No gray items to delete."]="Es sind keine grauen Gegenstände zum Löschen vorhanden." L["No gray items to sell."]="Keine grauen Gegenstände zum Verkaufen vorhanden." -L["The spell '%s' has been added to the Blocked unitframe aura filter."]='Der Zauber "%s" wurde zur schwarzen Liste der Einheitenfenster hinzugefügt.' +L["The spell '%s' has been added to the BlackList unitframe aura filter."]='Der Zauber "%s" wurde zur schwarzen Liste der Einheitenfenster hinzugefügt.' L["Vendored gray items for:"]="Graue Gegenstände verkauft für:" L["You don't have enough money to repair."]="Du hast nicht genügend Gold für die Reparatur." L["You must be at a vendor."]="Du musst bei einem Händler sein." diff --git a/Interface/AddOns/SVUI/language/italian_ui.lua b/Interface/AddOns/SVUI/language/italian_ui.lua index 7b5b73f..feee0a5 100644 --- a/Interface/AddOns/SVUI/language/italian_ui.lua +++ b/Interface/AddOns/SVUI/language/italian_ui.lua @@ -333,7 +333,7 @@ L["Auras Frame"]=true; L["Bags"]=true; L["Bar "]=true; L["BNet Frame"]=true; -L["Boss Button"]=true; +L["Special Ability Button"]=true; L["Boss Frames"]=true; L["Experience Bar"]=true; L["Focus Castbar"]=true; @@ -382,7 +382,7 @@ L["Confused.. Try Again!"]=true; L["Deleted %d gray items. Total Worth: %s"]=true; L["No gray items to delete."]=true; L["No gray items to sell."]=true; -L["The spell '%s' has been added to the Blocked unitframe aura filter."]=true; +L["The spell '%s' has been added to the BlackList unitframe aura filter."]=true; L["Vendored gray items for:"]=true; L["You don't have enough money to repair."]=true; L["You must be at a vendor."]=true; diff --git a/Interface/AddOns/SVUI/language/korean_ui.lua b/Interface/AddOns/SVUI/language/korean_ui.lua index ebb60f9..811fb9a 100644 --- a/Interface/AddOns/SVUI/language/korean_ui.lua +++ b/Interface/AddOns/SVUI/language/korean_ui.lua @@ -333,7 +333,7 @@ L["Auras Frame"]=true; L["Bags"]="가방" L["Bar "]="바 " L["BNet Frame"]=true; -L["Boss Button"]=true; +L["Special Ability Button"]=true; L["Boss Frames"]="보스 프레임" L["Experience Bar"]=true; L["Focus Castbar"]=true; @@ -382,7 +382,7 @@ L["Confused.. Try Again!"]=true; L["Deleted %d gray items. Total Worth: %s"]="%d개의 회색 아이템을 삭제했습니다. 환산: %s:\n " L["No gray items to delete."]="삭제할 회색 아이템이 없습니다." L["No gray items to sell."]="판매할 회색 아이템이 없습니다." -L["The spell '%s' has been added to the Blocked unitframe aura filter."]=true; +L["The spell '%s' has been added to the BlackList unitframe aura filter."]=true; L["Vendored gray items for:"]="회색 항목 판매:" L["You don't have enough money to repair."]="수리 비용이 부족합니다." L["You must be at a vendor."]="당신은 상인을 만나야 합니다." diff --git a/Interface/AddOns/SVUI/language/portuguese_ui.lua b/Interface/AddOns/SVUI/language/portuguese_ui.lua index 8c33020..5363f9f 100644 --- a/Interface/AddOns/SVUI/language/portuguese_ui.lua +++ b/Interface/AddOns/SVUI/language/portuguese_ui.lua @@ -333,7 +333,7 @@ L["Auras Frame"]="Quadros de Auras" L["Bags"]="Bolsas" L["Bar "]="Barra " L["BNet Frame"]="Quadro do Bnet" -L["Boss Button"]="Botão de Chefe" +L["Special Ability Button"]="Botão de Chefe" L["Boss Frames"]="Quadros dos Chefes" L["Experience Bar"]="Barra de Experiência" L["Focus Castbar"]="Barra de Lançamento do Foco" @@ -382,7 +382,7 @@ L["Confused.. Try Again!"]="Confuso... Tente novamente!" L["Deleted %d gray items. Total Worth: %s"]="%d itens cinzentos destruidos. Valor total %s" L["No gray items to delete."]="Nenhum item cinzento para destruir." L["No gray items to sell."]="Nenhum item cinzento para vender" -L["The spell '%s' has been added to the Blocked unitframe aura filter."]='O feitiço "%s" foi adicionado à Lista Negra dos filtros das auras de unidades.' +L["The spell '%s' has been added to the BlackList unitframe aura filter."]='O feitiço "%s" foi adicionado à Lista Negra dos filtros das auras de unidades.' L["Vendored gray items for:"]="Vendeu os itens cinzentos por:" L["You don't have enough money to repair."]="Você não tem dinheiro suficiente para reparar." L["You must be at a vendor."]="Tem de estar num vendedor." diff --git a/Interface/AddOns/SVUI/language/russian_ui.lua b/Interface/AddOns/SVUI/language/russian_ui.lua index 9bc2c29..48f2bd2 100644 --- a/Interface/AddOns/SVUI/language/russian_ui.lua +++ b/Interface/AddOns/SVUI/language/russian_ui.lua @@ -333,7 +333,7 @@ L["Auras Frame"]="Ауры" L["Bags"]="Сумки" L["Bar "]="Панель " L["BNet Frame"]="Оповещения BNet" -L["Boss Button"]="Кнопка босса" +L["Special Ability Button"]="Кнопка босса" L["Boss Frames"]="Боссы" L["Experience Bar"]="Полоса опыта" L["Focus Castbar"]="Полоса заклинаний фокуса" @@ -382,7 +382,7 @@ L["Confused.. Try Again!"]="Что за... Попробуйте еще раз!" L["Deleted %d gray items. Total Worth: %s"]="Удалено %d предметов серого качества. Общая стоимость: %s" L["No gray items to delete."]="Нет предметов серого качества для удаления." L["No gray items to sell."]="Нет предметов серого качества для продажи." -L["The spell '%s' has been added to the Blocked unitframe aura filter."]='Заклинание "%s" было добавлено в фильтр "Blocked" аур рамок юнитов.' +L["The spell '%s' has been added to the BlackList unitframe aura filter."]='Заклинание "%s" было добавлено в фильтр "BlackList" аур рамок юнитов.' L["Vendored gray items for:"]="Проданы серые предметы на сумму:" L["You don't have enough money to repair."]="У вас недостаточно денег для ремонта." L["You must be at a vendor."]="Вы должны находиться у торговца" diff --git a/Interface/AddOns/SVUI/language/spanish_ui.lua b/Interface/AddOns/SVUI/language/spanish_ui.lua index cd4c210..405eee4 100644 --- a/Interface/AddOns/SVUI/language/spanish_ui.lua +++ b/Interface/AddOns/SVUI/language/spanish_ui.lua @@ -337,7 +337,7 @@ L["Auras Frame"]="Marco de Auras" L["Bags"]="Bolsas" L["Bar "]="Barra " L["BNet Frame"]="Marco BNet" -L["Boss Button"]="Botón de Jefe" +L["Special Ability Button"]="Botón de Jefe" L["Boss Frames"]="Marco de Jefe" L["Experience Bar"]="Barra de Experiencia" L["Focus Castbar"]="Barra de Lanzamiento del Foco" @@ -386,7 +386,7 @@ L["Confused.. Try Again!"]="Confundido... ¡Intenta de Nuevo!" L["Deleted %d gray items. Total Worth: %s"]="Se borraron %d objetos grises. Valor total: %s" L["No gray items to delete."]="No hay objetos grises para eliminar." L["No gray items to sell."]="No hay objetos grises para vender." -L["The spell '%s' has been added to the Blocked unitframe aura filter."]="El hechizo '%s' ha sido añadido a la Lista Negra del filtro de auras del marco de unidad." +L["The spell '%s' has been added to the BlackList unitframe aura filter."]="El hechizo '%s' ha sido añadido a la Lista Negra del filtro de auras del marco de unidad." L["Vendored gray items for:"]="Objetos grises vendidos por:" L["You don't have enough money to repair."]="No tienes suficiente dinero para reparaciones." L["You must be at a vendor."]="Debes estar cerca de un vendedor." diff --git a/Interface/AddOns/SVUI/language/taiwanese_ui.lua b/Interface/AddOns/SVUI/language/taiwanese_ui.lua index a30e5ee..1bf384e 100644 --- a/Interface/AddOns/SVUI/language/taiwanese_ui.lua +++ b/Interface/AddOns/SVUI/language/taiwanese_ui.lua @@ -333,7 +333,7 @@ L["Auras Frame"]="增益/減益 框架" L["Bags"]="背包" L["Bar "]="快捷列 " L["BNet Frame"]="戰網提示資訊" -L["Boss Button"]="特殊技能鍵" +L["Special Ability Button"]="特殊技能鍵" L["Boss Frames"]="首領框架" L["Experience Bar"]="經驗條" L["Focus Castbar"]="焦點目標施法條" @@ -382,7 +382,7 @@ L["Confused.. Try Again!"]='請再試一次!' L["Deleted %d gray items. Total Worth: %s"]="已刪除%d 個灰色物品. 總價值: %s" L["No gray items to delete."]="沒有可刪除的灰色物品." L["No gray items to sell."]="沒有可出售的灰色物品." -L["The spell '%s' has been added to the Blocked unitframe aura filter."]='法術"%s"已經被添加到單位框架的光環過濾器中.' +L["The spell '%s' has been added to the BlackList unitframe aura filter."]='法術"%s"已經被添加到單位框架的光環過濾器中.' L["Vendored gray items for:"]="已售出灰色物品,共得:" L["You don't have enough money to repair."]="沒有足夠的資金來修復." L["You must be at a vendor."]="你必須與商人對話." diff --git a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/LibSuperVillain-1.0.xml b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/LibSuperVillain-1.0.xml index ec560ff..471f665 100644 --- a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/LibSuperVillain-1.0.xml +++ b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/LibSuperVillain-1.0.xml @@ -2,6 +2,9 @@ <Script file="LibSuperVillain-1.0.lua"/> <Script file="modules\Linguist.lua"/> <Script file="modules\Registry.lua"/> + <Script file="modules\Events.lua"/> <Script file="modules\Timers.lua"/> <Script file="modules\Animate.lua"/> + <Script file="modules\Sounds.lua"/> + <Script file="modules\SpecialFX.lua"/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Animate.lua b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Animate.lua index 87959c7..cdf2ac0 100644 --- a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Animate.lua +++ b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Animate.lua @@ -30,8 +30,8 @@ if not lib then return end -- No upgrade needed local MANAGED_ANIMATIONS = { ["Orbit"] = true, - ["Sprite"] = true, - ["SmallSprite"] = true, + ["Sprite4"] = true, + ["Sprite8"] = true, ["StopSprite"] = false, ["Pulse"] = false, ["Kapow"] = false, @@ -86,7 +86,7 @@ local Anim_OnFinished = function(self) end end -local Sprite_OnUpdate = function(self) +local Sprite4_OnUpdate = function(self) local order = self:GetOrder() local parent = self.parent local left, right; @@ -103,7 +103,7 @@ local Sprite_OnUpdate = function(self) end end -local SmallSprite_OnUpdate = function(self) +local Sprite8_OnUpdate = function(self) local order = self:GetOrder() local parent = self.parent local left, right; @@ -194,7 +194,7 @@ end --[[ LIB METHODS ]]-- -local function AnimationTemplate(frame, animType, hideOnFinished, speed, special, scriptToParent) +local function AnimationTemplate(frame, animType, hideOnFinished, speed, special, scriptToParent, noShowHide) if(not frame or not animType) then return end frame.anim = frame:CreateAnimationGroup(animType) @@ -207,16 +207,18 @@ local function AnimationTemplate(frame, animType, hideOnFinished, speed, special frame.anim:SetScript("OnStop", Anim_OnStop) end - if(scriptToParent) then - local frameParent = frame:GetParent(); - if(frameParent.SetScript) then - frameParent.anim = frame.anim; - frameParent:SetScript("OnShow", Anim_OnShow) - frameParent:SetScript("OnHide", Anim_OnHide) + if(not noShowHide) then + if(scriptToParent) then + local frameParent = frame:GetParent(); + if(frameParent.SetScript) then + frameParent.anim = frame.anim; + frameParent:SetScript("OnShow", Anim_OnShow) + frameParent:SetScript("OnHide", Anim_OnHide) + end + elseif(frame.SetScript) then + frame:SetScript("OnShow", Anim_OnShow) + frame:SetScript("OnHide", Anim_OnHide) end - elseif(frame.SetScript) then - frame:SetScript("OnShow", Anim_OnShow) - frame:SetScript("OnHide", Anim_OnHide) end if(animType == 'Flash') then @@ -246,86 +248,89 @@ local function AnimationTemplate(frame, animType, hideOnFinished, speed, special frame.anim[1]:SetDuration(speed) frame.anim:SetLooping("REPEAT") frame.anim:Play() - elseif(animType == 'Sprite') then + elseif(animType == 'Sprite4') then frame.anim[1] = SetNewAnimation(frame.anim, "Translation") frame.anim[1]:SetOrder(1) frame.anim[1]:SetDuration(speed) - frame.anim[1]:SetScript("OnUpdate", Sprite_OnUpdate) + frame.anim[1]:SetScript("OnUpdate", Sprite4_OnUpdate) frame.anim[2] = SetNewAnimation(frame.anim, "Translation") frame.anim[2]:SetOrder(2) frame.anim[2]:SetDuration(speed) - frame.anim[2]:SetScript("OnUpdate", Sprite_OnUpdate) + frame.anim[2]:SetScript("OnUpdate", Sprite4_OnUpdate) frame.anim[3] = SetNewAnimation(frame.anim, "Translation") frame.anim[3]:SetOrder(3) frame.anim[3]:SetDuration(speed) - frame.anim[3]:SetScript("OnUpdate", Sprite_OnUpdate) + frame.anim[3]:SetScript("OnUpdate", Sprite4_OnUpdate) frame.anim[4] = SetNewAnimation(frame.anim, "Translation") frame.anim[4]:SetOrder(4) frame.anim[4]:SetDuration(speed) - frame.anim[4]:SetScript("OnUpdate", Sprite_OnUpdate) + frame.anim[4]:SetScript("OnUpdate", Sprite4_OnUpdate) if special then frame.anim[5] = SetNewAnimation(frame.anim, "Translation") frame.anim[5]:SetOrder(5) frame.anim[5]:SetDuration(special) frame.anim[5].isFadeFrame = true; - frame.anim[5]:SetScript("OnUpdate", Sprite_OnUpdate) + frame.anim[5]:SetScript("OnUpdate", Sprite4_OnUpdate) end - - frame.anim:SetLooping("REPEAT") - elseif(animType == 'SmallSprite') then + if(not hideOnFinished) then + frame.anim:SetLooping("REPEAT") + end + elseif(animType == 'Sprite8') then frame.anim[1] = SetNewAnimation(frame.anim, "Translation") frame.anim[1]:SetOrder(1) frame.anim[1]:SetDuration(speed) - frame.anim[1]:SetScript("OnUpdate", SmallSprite_OnUpdate) + frame.anim[1]:SetScript("OnUpdate", Sprite8_OnUpdate) frame.anim[2] = SetNewAnimation(frame.anim, "Translation") frame.anim[2]:SetOrder(2) frame.anim[2]:SetDuration(speed) - frame.anim[2]:SetScript("OnUpdate", SmallSprite_OnUpdate) + frame.anim[2]:SetScript("OnUpdate", Sprite8_OnUpdate) frame.anim[3] = SetNewAnimation(frame.anim, "Translation") frame.anim[3]:SetOrder(3) frame.anim[3]:SetDuration(speed) - frame.anim[3]:SetScript("OnUpdate", SmallSprite_OnUpdate) + frame.anim[3]:SetScript("OnUpdate", Sprite8_OnUpdate) frame.anim[4] = SetNewAnimation(frame.anim, "Translation") frame.anim[4]:SetOrder(4) frame.anim[4]:SetDuration(speed) - frame.anim[4]:SetScript("OnUpdate", SmallSprite_OnUpdate) + frame.anim[4]:SetScript("OnUpdate", Sprite8_OnUpdate) frame.anim[5] = SetNewAnimation(frame.anim, "Translation") frame.anim[5]:SetOrder(5) frame.anim[5]:SetDuration(speed) - frame.anim[5]:SetScript("OnUpdate", SmallSprite_OnUpdate) + frame.anim[5]:SetScript("OnUpdate", Sprite8_OnUpdate) frame.anim[6] = SetNewAnimation(frame.anim, "Translation") frame.anim[6]:SetOrder(6) frame.anim[6]:SetDuration(speed) - frame.anim[6]:SetScript("OnUpdate", SmallSprite_OnUpdate) + frame.anim[6]:SetScript("OnUpdate", Sprite8_OnUpdate) frame.anim[7] = SetNewAnimation(frame.anim, "Translation") frame.anim[7]:SetOrder(7) frame.anim[7]:SetDuration(speed) - frame.anim[7]:SetScript("OnUpdate", SmallSprite_OnUpdate) + frame.anim[7]:SetScript("OnUpdate", Sprite8_OnUpdate) frame.anim[8] = SetNewAnimation(frame.anim, "Translation") frame.anim[8]:SetOrder(8) frame.anim[8]:SetDuration(speed) - frame.anim[8]:SetScript("OnUpdate", SmallSprite_OnUpdate) + frame.anim[8]:SetScript("OnUpdate", Sprite8_OnUpdate) if(special) then frame.anim[9] = SetNewAnimation(frame.anim, "Translation") frame.anim[9]:SetOrder(9) frame.anim[9]:SetDuration(special) frame.anim[9].isFadeFrame = true; - frame.anim[9]:SetScript("OnUpdate", Sprite_OnUpdate) + frame.anim[9]:SetScript("OnUpdate", Sprite4_OnUpdate) end - frame.anim:SetLooping("REPEAT") + if(not hideOnFinished) then + frame.anim:SetLooping("REPEAT") + end elseif(animType == 'Pulse') then frame.anim:SetScript("OnPlay", Pulse_OnPlay) @@ -369,23 +374,23 @@ function lib:Pulse(frame, hideOnFinished) AnimationTemplate(frame, 'Pulse', hideOnFinished) end -function lib:Kapow(frame, hideOnFinished) +function lib:Kapow(frame, hideOnFinished, noShowHide) if not frame then return end - AnimationTemplate(frame, 'Kapow', hideOnFinished) + AnimationTemplate(frame, 'Kapow', hideOnFinished, nil, nil, nil, noShowHide) end --[[ ANIMATED SPRITES ]]-- -function lib:Sprite(frame, speed, fadeTime, scriptToParent) +function lib:Sprite4(frame, speed, fadeTime, scriptToParent) if not frame then return end speed = speed or 0.08; - AnimationTemplate(frame, 'Sprite', false, speed, fadeTime, scriptToParent) + AnimationTemplate(frame, 'Sprite4', false, speed, fadeTime, scriptToParent) end -function lib:SmallSprite(frame, speed, fadeTime, scriptToParent) +function lib:Sprite8(frame, speed, fadeTime, scriptToParent, hideOnFinished) if not frame then return end speed = speed or 0.08; - AnimationTemplate(frame, 'SmallSprite', false, speed, fadeTime, scriptToParent) + AnimationTemplate(frame, 'Sprite8', hideOnFinished, speed, fadeTime, scriptToParent) end function lib:StopSprite(frame) diff --git a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Events.lua b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Events.lua new file mode 100644 index 0000000..9f51ba1 --- /dev/null +++ b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Events.lua @@ -0,0 +1,100 @@ +--[[ + /$$$$$$$$ /$$ +| $$_____/ | $$ +| $$ /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$ /$$$$$$$ +| $$$$$| $$ /$$//$$__ $$| $$__ $$|_ $$_/ /$$_____/ +| $$__/ \ $$/$$/| $$$$$$$$| $$ \ $$ | $$ | $$$$$$ +| $$ \ $$$/ | $$_____/| $$ | $$ | $$ /$$\____ $$ +| $$$$$$$$\ $/ | $$$$$$$| $$ | $$ | $$$$//$$$$$$$/ +|________/ \_/ \_______/|__/ |__/ \___/ |_______/ +--]] + +--[[ LOCALIZED GLOBALS ]]-- +--GLOBAL NAMESPACE +local _G = getfenv(0); +--LUA +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local print = _G.print; +local ipairs = _G.ipairs; +local pairs = _G.pairs; +local next = _G.next; +local rawset = _G.rawset; +local rawget = _G.rawget; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local getmetatable = _G.getmetatable; +local setmetatable = _G.setmetatable; +--STRING +local string = _G.string; +local upper = string.upper; +local format = string.format; +local find = string.find; +local match = string.match; +local gsub = string.gsub; +--MATH +local math = _G.math; +local floor = math.floor +--TABLE +local table = _G.table; +local tsort = table.sort; +local tconcat = table.concat; +local tinsert = _G.tinsert; +local tremove = _G.tremove; +local twipe = _G.wipe; + +--[[ LIB CONSTRUCT ]]-- + +local lib = LibSuperVillain:NewLibrary("Events") + +if not lib then return end -- No upgrade needed + +--[[ ADDON DATA ]]-- + +local CoreName, CoreObject = ... + +--[[ LIB CALLBACK STORAGE ]]-- + +lib.Triggers = {}; + +--LOCAL HELPERS + +local function HandleErrors(schema, action, catch) + schema = schema or "LibSuperVillain:Events" + action = action or "Unknown Function" + local timestamp = date("%m/%d/%y %H:%M:%S") + local err_message = ("%s [%s] - (%s) %s"):format(schema, action, timestamp, catch) + if(CoreObject.DebugMode == true) then + CoreObject:Debugger(err_message) + end +end + +function lib:Trigger(eventName, ...) + if(not eventName) then return end; + local eventCallabcks = self.Triggers[eventName]; + if(not eventCallabcks) then return end; + for id, fn in pairs(eventCallabcks) do + if(fn and type(fn) == "function") then + local _, catch = pcall(fn, ...) + if(catch) then + HandleErrors("LibSuperVillain:Events:Trigger(" .. eventName .. "):", id, catch) + end + end + end +end + +--[[ CONSTRUCTORS ]]-- + +function lib:On(event, id, callback) + if((not event) or (not id)) then return end; + if(callback and type(callback) == "function") then + if(not self.Triggers[event]) then + self.Triggers[event] = {} + end + self.Triggers[event][id] = callback + end +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Registry.lua b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Registry.lua index cd25b13..bd7003c 100644 --- a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Registry.lua +++ b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Registry.lua @@ -104,10 +104,6 @@ if GetLocale() == "ruRU" then INFO_FORMAT = "|cffFFFF00%s|r\n |cff33FF00Версия: %s|r |cff0099FFот %s|r"; end ---[[ LIB CUSTOM EVENT CALLBACKS ]]-- - -lib.Callbacks = {}; - --[[ LIB EVENT LISTENER ]]-- lib.EventManager = CreateFrame("Frame", nil) @@ -443,6 +439,10 @@ function lib:CurrentProfile() return PROFILE_SV.SAFEDATA.GlobalKey end +function lib:UnsetProfile() + PROFILE_SV.SAFEDATA.GlobalKey = nil; +end + function lib:ImportDatabase(key, noreload) if(not key) then return end @@ -734,20 +734,6 @@ end --REGISTRY PUBLIC METHODS -function lib:Trigger(eventName) - if(not eventName) then return end; - local eventCallabcks = self.Callbacks[eventName]; - if(not eventCallabcks) then return end; - for id, fn in pairs(eventCallabcks) do - if(fn and type(fn) == "function") then - local _, catch = pcall(fn) - if(catch) then - HandleErrors("LibSuperVillain:Registry:Trigger(" .. eventName .. "):", id, catch) - end - end - end -end - function lib:RefreshModule(schema) local obj = CoreObject[schema] LoadingProxy(schema, obj) @@ -870,16 +856,6 @@ end --[[ CONSTRUCTORS ]]-- -function lib:NewCallback(event, id, callback) - if((not event) or (not id)) then return end; - if(callback and type(callback) == "function") then - if(not self.Callbacks[event]) then - self.Callbacks[event] = {} - end - self.Callbacks[event][id] = callback - end -end - function lib:NewPlugin(addonName, addonObject, pfile, gfile, cfile) local version = GetAddOnMetadata(addonName, "Version") local header = GetAddOnMetadata(addonName, HeaderFromMeta) @@ -1026,13 +1002,32 @@ end -- CORE OBJECT CONSTRUCT -local Core_NewScript = function(self, fn) - if(fn and type(fn) == "function") then - ScriptQueue[#ScriptQueue+1] = fn - end +local addNewSubClass = function(self, schema) + if(self[schema]) then return end + + local obj = { + parent = self, + Schema = schema, + RegisterEvent = registerEvent, + UnregisterEvent = unregisterEvent, + RegisterUpdate = registerUpdate, + UnregisterUpdate = unregisterUpdate + } + + local addonmeta = {} + local oldmeta = getmetatable(obj) + if oldmeta then + for k, v in pairs(oldmeta) do addonmeta[k] = v end + end + addonmeta.__tostring = rootstring + setmetatable( obj, addonmeta ) + + self[schema] = obj + + return self[schema] end -local Core_NewSubClass = function(self, schema, header) +local Core_NewClass = function(self, schema, header) if(self[schema]) then return end AllowedIndexes[schema] = schema @@ -1049,7 +1044,8 @@ local Core_NewSubClass = function(self, schema, header) RegisterEvent = registerEvent, UnregisterEvent = unregisterEvent, RegisterUpdate = registerUpdate, - UnregisterUpdate = unregisterUpdate + UnregisterUpdate = unregisterUpdate, + NewSubClass = addNewSubClass } local addonmeta = {} @@ -1065,6 +1061,12 @@ local Core_NewSubClass = function(self, schema, header) return self[schema] end +local Core_NewScript = function(self, fn) + if(fn and type(fn) == "function") then + ScriptQueue[#ScriptQueue+1] = fn + end +end + local Core_NewPackage = function(self, schema, header) if(self[schema]) then return end @@ -1116,8 +1118,12 @@ local Core_ResetData = function(self, sub, sub2, sub3) targetData = sv end if(targetData) then - for k,v in pairs(targetData) do - targetData[k] = nil + if(type(targetData) == 'table') then + for k,v in pairs(targetData) do + targetData[k] = nil + end + else + targetData = nil end else sv = {} @@ -1136,8 +1142,12 @@ local Core_ResetFilter = function(self, key) targetData = sv end if(targetData) then - for k,v in pairs(targetData) do - targetData[k] = nil + if(type(targetData) == 'table') then + for k,v in pairs(targetData) do + targetData[k] = nil + end + else + targetData = nil end else sv = {} @@ -1189,7 +1199,7 @@ function lib:NewCore(gfile, efile, pfile, cfile, ffile, lfile) CoreObject.NewScript = Core_NewScript CoreObject.NewPackage = Core_NewPackage - CoreObject.NewSubClass = Core_NewSubClass + CoreObject.NewClass = Core_NewClass CoreObject.ResetData = Core_ResetData CoreObject.ResetFilter = Core_ResetFilter diff --git a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Sounds.lua b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Sounds.lua new file mode 100644 index 0000000..455f997 --- /dev/null +++ b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Sounds.lua @@ -0,0 +1,167 @@ +--[[ + /$$$$$$ /$$ + /$$__ $$ | $$ +| $$ \__/ /$$$$$$ /$$ /$$ /$$$$$$$ /$$$$$$$ /$$$$$$$ +| $$$$$$ /$$__ $$| $$ | $$| $$__ $$ /$$__ $$ /$$_____/ + \____ $$| $$ \ $$| $$ | $$| $$ \ $$| $$ | $$| $$$$$$ + /$$ \ $$| $$ | $$| $$ | $$| $$ | $$| $$ | $$ \____ $$ +| $$$$$$/| $$$$$$/| $$$$$$/| $$ | $$| $$$$$$$ /$$$$$$$/ + \______/ \______/ \______/ |__/ |__/ \_______/|_______/ +--]] + +--[[ LOCALIZED GLOBALS ]]-- +--GLOBAL NAMESPACE +local _G = getfenv(0); +--LUA +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local print = _G.print; +local ipairs = _G.ipairs; +local pairs = _G.pairs; +local next = _G.next; +local rawset = _G.rawset; +local rawget = _G.rawget; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local getmetatable = _G.getmetatable; +local setmetatable = _G.setmetatable; +--STRING +local string = _G.string; +local upper = string.upper; +local format = string.format; +local find = string.find; +local match = string.match; +local gsub = string.gsub; +--MATH +local math = _G.math; +local random = math.random; +local floor = math.floor +--TABLE +local table = _G.table; +local tsort = table.sort; +local tconcat = table.concat; +local tinsert = _G.tinsert; +local tremove = _G.tremove; +local twipe = _G.wipe; + +--[[ LIB CONSTRUCT ]]-- + +local lib = LibSuperVillain:NewLibrary("Sounds") + +if not lib then return end -- No upgrade needed + +--[[ DUMMY FALLBACK ]]-- + +local BLANK_FOLEY = function() + return; +end; + +--[[ LIB MASTER LIST ]]-- + +lib.Master = {}; + +-- do +-- local DEFAULT_SOUND_TYPES = { 'button', 'error', 'window', 'misc' }; + +-- for i = 1, #DEFAULT_SOUND_TYPES do +-- local key = DEFAULT_SOUND_TYPES[i]; +-- lib.Master[key] = {}; +-- end +-- end + +--[[ LIB TYPE CONTROLLERS ]]-- + +lib.Effects = {}; +lib.Blends = {}; + +--[[ LIB METHODS ]]-- + +function lib:Register(soundType, soundFile) + soundType = soundType:lower(); + if(not self.Master[soundType]) then self.Master[soundType] = {} end; + tinsert(self.Master[soundType], soundFile); +end; + +--[[ BLENDED SOUND EFFECTS ]]-- + +local BlendedSound_Effect = function(self) + local key, sound, list; + local bank = self.Bank; + local channels = self.Channels; + for i = 1, channels do + key = random(1, #bank[i]); + sound = bank[i][key]; + PlaySoundFile(sound) + end +end + +function lib:Blend(blendName, ...) + blendName = blendName:lower(); + if(not self.Blends[blendName]) then + self.Blends[blendName] = {}; + self.Blends[blendName].Bank = {}; + + local numChannels = select('#', ...) + + for i = 1, numChannels do + local soundType = select(i, ...) + soundType = soundType:lower(); + if not soundType then break end + if(not self.Master[soundType]) then + self.Master[soundType] = {}; + end + self.Blends[blendName].Bank[i] = self.Master[soundType]; + end + + self.Blends[blendName].Channels = numChannels; + self.Blends[blendName].Foley = BlendedSound_Effect; + + setmetatable(self.Blends[blendName], { __call = self.Blends[blendName].Foley }) + end + + if(self.Blends[blendName]) then + return self.Blends[blendName] + else + return BLANK_FOLEY + end +end; + +--[[ STANDARD SOUND EFFECTS ]]-- + +local StandardSound_Effect = function(self) + local key, sound, list; + local bank = self.Bank; + local channels = self.Channels; + for i = 1, channels do + list = bank[i]; + key = random(1,#list); + sound = list[key]; + PlaySoundFile(sound) + end +end + +function lib:Effect(effectName) + effectName = effectName:lower(); + if(not self.Effects[effectName]) then + self.Effects[effectName] = {}; + + if(not self.Master[effectName]) then + self.Master[effectName] = {}; + end + + self.Effects[effectName].Bank = self.Master[effectName]; + self.Effects[effectName].Foley = StandardSound_Effect; + + setmetatable(self.Effects[effectName], { __call = self.Effects[effectName].Foley }) + end + + if(self.Effects[effectName]) then + return self.Effects[effectName] + else + return BLANK_FOLEY + end +end; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/SpecialFX.lua b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/SpecialFX.lua new file mode 100644 index 0000000..ff0ad09 --- /dev/null +++ b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/SpecialFX.lua @@ -0,0 +1,244 @@ +--[[ + /$$$$$$ /$$ /$$ /$$$$$$$$ /$$ /$$ + /$$__ $$ |__/ | $$| $$_____/| $$ / $$ +| $$ \__/ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$ | $$| $$ | $$/ $$/ +| $$$$$$ /$$__ $$ /$$__ $$ /$$_____/| $$ |____ $$| $$| $$$$$ \ $$$$/ + \____ $$| $$ \ $$| $$$$$$$$| $$ | $$ /$$$$$$$| $$| $$__/ >$$ $$ + /$$ \ $$| $$ | $$| $$_____/| $$ | $$ /$$__ $$| $$| $$ /$$/\ $$ +| $$$$$$/| $$$$$$$/| $$$$$$$| $$$$$$$| $$| $$$$$$$| $$| $$ | $$ \ $$ + \______/ | $$____/ \_______/ \_______/|__/ \_______/|__/|__/ |__/ |__/ + | $$ + | $$ + |__/ +--]] + +--[[ LOCALIZED GLOBALS ]]-- +--GLOBAL NAMESPACE +local _G = getfenv(0); +--LUA +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local print = _G.print; +local ipairs = _G.ipairs; +local pairs = _G.pairs; +local next = _G.next; +local rawset = _G.rawset; +local rawget = _G.rawget; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local getmetatable = _G.getmetatable; +local setmetatable = _G.setmetatable; +--STRING +local string = _G.string; +local upper = string.upper; +local format = string.format; +local find = string.find; +local match = string.match; +local gsub = string.gsub; +--MATH +local math = _G.math; +local random = math.random; +local floor = math.floor +--TABLE +local table = _G.table; +local tsort = table.sort; +local tconcat = table.concat; +local tinsert = _G.tinsert; +local tremove = _G.tremove; +local twipe = _G.wipe; + +--[[ LIB CONSTRUCT ]]-- + +local lib = LibSuperVillain:NewLibrary("SpecialFX") + +if not lib then return end + +--[[ LIB EFFECT TABLES ]]-- + +local DEFAULT_MODEL = [[Spells\Missile_bomb.m2]]; + +local DEFAULT_EFFECT = {DEFAULT_MODEL, 0, 0, 0, 0, 0.75, 0, 0}; + +local EFFECTS_LIST = setmetatable({ + ["default"] = {[[Spells\Missile_bomb.m2]], 0, 0, 0, 0, 0.75, 0, 0}, + ["holy"] = {[[Spells\Solar_precast_hand.m2]], -12, 12, 12, -12, 0.23, 0, 0}, + ["shadow"] = {[[Spells\Shadow_precast_uber_hand.m2]], -12, 12, 12, -12, 0.23, -0.1, 0.1}, + ["arcane"] = {[[Spells\Cast_arcane_01.m2]], -12, 12, 12, -12, 0.25, 0, 0}, + ["fire"] = {[[Spells\Bloodlust_state_hand.m2]], -8, 4, 24, -24, 0.23, -0.08, 0.08}, + ["frost"] = {[[Spells\Ice_cast_low_hand.m2]], -12, 12, 12, -12, 0.23, -0.1, 0.1}, + ["chi"] = {[[Spells\Fel_fire_precast_high_hand.m2]], -12, 12, 12, -12, 0.3, 0, 0}, + ["lightning"] = {[[Spells\Fill_lightning_cast_01.m2]], -12, 12, 12, -12, 1.25, 0, 0}, + ["water"] = {[[Spells\Monk_drunkenhaze_impact.m2]], -12, 12, 12, -12, 0.9, 0, 0}, + ["earth"] = {[[Spells\Sand_precast_hand.m2]], -12, 12, 12, -12, 0.23, 0, 0}, +}, { __index = function(t, k) + return DEFAULT_EFFECT +end }); + +--[[ EFFECT FRAME METHODS ]]-- + +local EffectModel_SetAnchorParent = function(self, frame) + self.___anchorParent = frame; + self:SetEffect(self.currentEffect); +end + +local EffectModel_OnShow = function(self) + self.FX:UpdateEffect(); +end + +local EffectModel_UpdateEffect = function(self) + local effect = self.currentEffect; + local effectTable = self.___fx[effect]; + self:ClearModel(); + self:SetModel(effectTable[1]); +end + +local EffectModel_SetEffect = function(self, effectName) + --print(effectName) + effectName = effectName or self.currentEffect + --print(effectName) + local effectTable = self.___fx[effectName]; + --print(effectTable[1]) + local parent = self.___anchorParent; + + self:ClearAllPoints(); + self:SetPoint("TOPLEFT", parent, "TOPLEFT", effectTable[2], effectTable[3]); + self:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", effectTable[4], effectTable[5]); + self:ClearModel(); + self:SetModel(effectTable[1]); + self:SetCamDistanceScale(effectTable[6]); + self:SetPosition(0, effectTable[7], effectTable[8]); + self:SetPortraitZoom(0); + + self.currentEffect = effectName; +end + +--[[ LIB METHODS ]]-- +function lib:Register(effectName, modelFile, leftX, leftY, rightX, rightY, zoom, posX, posY) + effectName = effectName:lower(); + modelFile = modelFile or DEFAULT_MODEL; + leftX = leftX or 0; + leftY = leftY or 0; + rightX = rightX or 0; + rightY = rightY or 0; + zoom = zoom or 0.75; + posX = posX or 0; + posY = posY or 0; + rawset(EFFECTS_LIST, effectName, {modelFile, leftX, leftY, rightX, rightY, zoom, posX, posY}) +end; + +function lib:SetFXFrame(parent, defaultEffect, noScript, anchorParent) + defaultEffect = defaultEffect or "default" + local model = CreateFrame("PlayerModel", nil, parent); + model.___fx = {}; + setmetatable(model.___fx, { __index = EFFECTS_LIST }); + model.___anchorParent = anchorParent or parent; + model.SetEffect = EffectModel_SetEffect; + model.SetAnchorParent = EffectModel_SetAnchorParent; + model.UpdateEffect = EffectModel_UpdateEffect; + model.currentEffect = defaultEffect; + parent.FX = model; + --print(defaultEffect) + EffectModel_SetEffect(model, defaultEffect) + + if(not noScript) then + if(parent:GetScript("OnShow")) then + parent:HookScript("OnShow", EffectModel_OnShow) + else + parent:SetScript("OnShow", EffectModel_OnShow) + end + end +end + +--[[ MODEL FILES FOUND FOR EFFECTS ]]-- + +-- [[Spells\Fel_fire_precast_high_hand.m2]] +-- [[Spells\Fire_precast_high_hand.m2]] +-- [[Spells\Fire_precast_low_hand.m2]] +-- [[Spells\Focused_casting_state.m2]] +-- [[Spells\Fill_holy_cast_01.m2]] +-- [[Spells\Fill_fire_cast_01.m2]] +-- [[Spells\Paladin_healinghands_state_01.m2]] +-- [[Spells\Fill_magma_cast_01.m2]] +-- [[Spells\Fill_shadow_cast_01.m2]] +-- [[Spells\Fill_arcane_precast_01.m2]] +-- [[Spells\Ice_cast_low_hand.m2]] +-- [[Spells\Immolate_state.m2]] +-- [[Spells\Immolate_state_v2_illidari.m2]] +-- [[Spells\Intervenetrail.m2]] +-- [[Spells\Invisibility_impact_base.m2]] +-- [[Spells\Fire_dot_state_chest.m2]] +-- [[Spells\Fire_dot_state_chest_jade.m2]] +-- [[Spells\Cast_arcane_01.m2]] +-- [[Spells\Spellsteal_missile.m2]] +-- [[Spells\Missile_bomb.m2]] +-- [[Spells\Shadow_frost_weapon_effect.m2]] +-- [[Spells\Shadow_precast_high_base.m2]] +-- [[Spells\Shadow_precast_high_hand.m2]] +-- [[Spells\Shadow_precast_low_hand.m2]] +-- [[Spells\Shadow_precast_med_base.m2]] +-- [[Spells\Shadow_precast_uber_hand.m2]] +-- [[Spells\Shadow_strikes_state_hand.m2]] +-- [[Spells\Shadowbolt_missile.m2]] +-- [[Spells\Shadowworddominate_chest.m2]] +-- [[Spells\Infernal_smoke_rec.m2]] +-- [[Spells\Largebluegreenradiationfog.m2]] +-- [[Spells\Leishen_lightning_fill.m2]] +-- [[Spells\Mage_arcanebarrage_missile.m2]] +-- [[Spells\Mage_firestarter.m2]] +-- [[Spells\Mage_greaterinvis_state_chest.m2]] +-- [[Spells\Magicunlock.m2]] +-- [[Spells\Chiwave_impact_hostile.m2]] +-- [[Spells\Cripple_state_base.m2]] +-- [[Spells\Monk_expelharm_missile.m2]] +-- [[Spells\Monk_forcespere_orb.m2]] +-- [[Spells\Fill_holy_cast_01.m2]] +-- [[Spells\Fill_fire_cast_01.m2]] +-- [[Spells\Fill_lightning_cast_01.m2]] +-- [[Spells\Fill_magma_cast_01.m2]] +-- [[Spells\Fill_shadow_cast_01.m2]] +-- [[Spells\Sprint_impact_chest.m2]] +-- [[Spells\Spellsteal_missile.m2]] +-- [[Spells\Warlock_destructioncharge_impact_chest.m2]] +-- [[Spells\Warlock_destructioncharge_impact_chest_fel.m2]] +-- [[Spells\Xplosion_twilight_impact_noflash.m2]] +-- [[Spells\Warlock_bodyofflames_medium_state_shoulder_right_purple.m2]] + +-- [[Spells\Blink_impact_chest.m2]] + +-- [[Spells\Christmassnowrain.m2]] +-- [[Spells\Detectinvis_impact_base.m2]] +-- [[Spells\Eastern_plaguelands_beam_effect.m2]] +-- [[Spells\battlemasterglow_high.m2]] +-- [[Spells\blueflame_low.m2]] +-- [[Spells\greenflame_low.m2]] +-- [[Spells\purpleglow_high.m2]] +-- [[Spells\redflame_low.m2]] +-- [[Spells\poisondrip.m2]] +-- [[Spells\savageryglow_high.m2]] +-- [[Spells\spellsurgeglow_high.m2]] +-- [[Spells\sunfireglow_high.m2]] +-- [[Spells\whiteflame_low.m2]] +-- [[Spells\yellowflame_low.m2]] +-- [[Spells\Food_healeffect_base.m2]] +-- [[Spells\Bloodlust_state_hand.m2]] +-- [[Spells\Deathwish_state_hand.m2]] +-- [[Spells\Disenchant_precast_hand.m2]] +-- [[Spells\Enchant_cast_hand.m2]] +-- [[Spells\Eviscerate_cast_hands.m2]] +-- [[Spells\Fire_blue_precast_hand.m2]] +-- [[Spells\Fire_blue_precast_high_hand.m2]] +-- [[Spells\Fire_precast_hand.m2]] +-- [[Spells\Fire_precast_hand_pink.m2]] +-- [[Spells\Fire_precast_hand_sha.m2]] +-- [[Spells\Fire_precast_high_hand.m2]] +-- [[Spells\Fire_precast_low_hand.m2]] +-- [[Spells\Ice_precast_high_hand.m2]] +-- [[Spells\Sand_precast_hand.m2]] +-- [[Spells\Solar_precast_hand.m2]] +-- [[Spells\Twilight_fire_precast_high_hand.m2]] +-- [[Spells\Vengeance_state_hand.m2]] +-- [[Spells\Fel_djinndeath_fire_02.m2]] \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ActionPanel/oUF_ActionPanel.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ActionPanel/oUF_ActionPanel.toc index 5363e23..ca7c4e3 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ActionPanel/oUF_ActionPanel.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ActionPanel/oUF_ActionPanel.toc @@ -2,7 +2,7 @@ ## Title: oUF ActionPanel ## Notes: Adds a backing to all unit frames that provides many utilities. ## Author: Munglunch -## Version: 5.3.9 +## Version: 5.4.08 ## X-Category: oUF ## Dependencies: oUF diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Afflicted/oUF_Afflicted.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Afflicted/oUF_Afflicted.toc index f4b00df..03e342d 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Afflicted/oUF_Afflicted.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Afflicted/oUF_Afflicted.toc @@ -2,7 +2,7 @@ ## Title: oUF Afflicted ## Notes: Adds Custom Debuff Highlighting to oUF. ## Author: Munglunch -## Version: 5.3.9 +## Version: 5.4.08 ## X-Category: oUF ## Dependencies: oUF diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.lua index 3b99824..37c65e5 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.lua @@ -17,56 +17,55 @@ local oUF = oUF or ns.oUF if not oUF then return end local function UpdateBar(self, elapsed) - if not self.expirationTime then return end + if not self.duration then return end self.elapsed = (self.elapsed or 0) + elapsed - if self.elapsed >= 0.5 then - local timeLeft = self.expirationTime - GetTime() + if self.elapsed >= 0.5 then + local timeLeft = (self.duration - GetTime()) if timeLeft > 0 then self:SetValue(timeLeft) else + self.start = nil + self.duration = nil + self:SetValue(0) + self:Hide() self:SetScript("OnUpdate", nil) end end end -local Update = function(self, event) - local unit = self.unit or 'player' +local Update = function(self, event, unit) + if(self.unit ~= unit) then return end local bar = self.ArcaneChargeBar - if(bar.PreUpdate) then bar:PreUpdate(event) end - - local talentSpecialization = GetSpecialization() + local spec = GetSpecialization() - if talentSpecialization == 1 then - bar:Show() - else - bar:Hide() - end + if(bar.PreUpdate) then bar:PreUpdate(spec) end - local arcaneCharges, maxCharges, duration, expirationTime = 0, 4 + local arcaneCharges, start, duration = 0; if bar:IsShown() then for index=1, 30 do - local _, _, _, count, _, start, timeLeft, _, _, _, spellID = UnitDebuff(unit, index) + local count, _, spellID = 0; + _, _, _, count, _, start, duration, _, _, _, spellID = UnitDebuff(unit, index) if spellID == 36032 then arcaneCharges = count or 0 - duration = start - expirationTime = timeLeft + start = start + duration = duration break end end - for i = 1, maxCharges do - if duration and expirationTime then - bar[i]:SetMinMaxValues(0, duration) + for i = 1, 4 do + if start and duration then + bar[i]:SetMinMaxValues(0, start) + bar[i].start = start bar[i].duration = duration - bar[i].expirationTime = expirationTime end + if i <= arcaneCharges then bar[i]:Show() - bar[i]:SetValue(duration) + bar[i]:SetValue(start) bar[i]:SetScript('OnUpdate', UpdateBar) else bar[i]:SetValue(0) - bar[i]:SetScript('OnUpdate', nil) bar[i]:Hide() end end diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc index b0d4096..6b37b5e 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc @@ -2,7 +2,7 @@ ## Title: oUF Arcane Charge ## Notes: Adds support for arcane charge indicators to oUF. ## Author: Munglunch -## Version: 5.3.9 +## Version: 5.4.08 ## Dependencies: oUF oUF_ArcaneCharge.lua \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_AuraBars/oUF_AuraBars.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_AuraBars/oUF_AuraBars.lua index be938a1..fc48962 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_AuraBars/oUF_AuraBars.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_AuraBars/oUF_AuraBars.lua @@ -72,7 +72,7 @@ local function SetAnchors(self) local frame = bars[index] local anchor = frame.anchor frame:SetHeight(self.auraBarHeight or 20) - frame.statusBar.iconHolder:Size(frame:GetHeight()) + frame.statusBar.iconHolder:SetSizeToScale(frame:GetHeight()) frame:SetWidth((self.auraBarWidth or self:GetWidth()) - (frame:GetHeight() + (self.gap or 0))) frame:ClearAllPoints() if self.down == true then @@ -184,27 +184,27 @@ local function CreateAuraBar(oUF, anchor) statusBar.icon:SetPoint("TOPLEFT", statusBar.iconHolder, "TOPLEFT", 1, -1) statusBar.icon:SetPoint("BOTTOMRIGHT", statusBar.iconHolder, "BOTTOMRIGHT", -1, 1) - statusBar.spelltime = statusBar:CreateFontString(nil, 'ARTWORK') - statusBar.spelltime:SetFont(auraBarParent.timeFont or [[Fonts\FRIZQT__.TTF]], auraBarParent.textSize or 10, auraBarParent.textOutline or "NONE") - statusBar.spelltime:SetTextColor(1 ,1, 1) - statusBar.spelltime:SetShadowOffset(1, -1) - statusBar.spelltime:SetShadowColor(0, 0, 0) - statusBar.spelltime:SetJustifyH'RIGHT' - statusBar.spelltime:SetJustifyV'CENTER' - statusBar.spelltime:SetPoint'RIGHT' - - statusBar.spellname = statusBar:CreateFontString(nil, 'ARTWORK') - statusBar.spellname:SetFont(auraBarParent.textFont or [[Fonts\FRIZQT__.TTF]], auraBarParent.textSize or 10, auraBarParent.textOutline or "NONE") - statusBar.spellname:SetTextColor(1, 1, 1) - statusBar.spellname:SetShadowOffset(1, -1) - statusBar.spellname:SetShadowColor(0, 0, 0) - statusBar.spellname:SetJustifyH'LEFT' - statusBar.spellname:SetJustifyV'CENTER' - statusBar.spellname:SetPoint'LEFT' - statusBar.spellname:SetPoint('RIGHT', statusBar.spelltime, 'LEFT') - if auraBarParent.PostCreateBar then auraBarParent.PostCreateBar(statusBar) + else + statusBar.spelltime = statusBar:CreateFontString(nil, 'ARTWORK') + statusBar.spelltime:SetFont(auraBarParent.timeFont or [[Fonts\FRIZQT__.TTF]], auraBarParent.textSize or 10, auraBarParent.textOutline or "NONE") + statusBar.spelltime:SetTextColor(1 ,1, 1) + statusBar.spelltime:SetShadowOffset(1, -1) + statusBar.spelltime:SetShadowColor(0, 0, 0) + statusBar.spelltime:SetJustifyH'RIGHT' + statusBar.spelltime:SetJustifyV'CENTER' + statusBar.spelltime:SetPoint'RIGHT' + + statusBar.spellname = statusBar:CreateFontString(nil, 'ARTWORK') + statusBar.spellname:SetFont(auraBarParent.textFont or [[Fonts\FRIZQT__.TTF]], auraBarParent.textSize or 10, auraBarParent.textOutline or "NONE") + statusBar.spellname:SetTextColor(1, 1, 1) + statusBar.spellname:SetShadowOffset(1, -1) + statusBar.spellname:SetShadowColor(0, 0, 0) + statusBar.spellname:SetJustifyH'LEFT' + statusBar.spellname:SetJustifyV'CENTER' + statusBar.spellname:SetPoint'LEFT' + statusBar.spellname:SetPoint('RIGHT', statusBar.spelltime, 'LEFT') end return frame @@ -328,7 +328,7 @@ local function Update(self, event, unit) elseif(frame:GetTop() and auraBars:GetBottom()) then auraBars:SetHeight(frame:GetTop() - auraBars:GetBottom()) else - auraBars:Height(20) + auraBars:SetHeightToScale(20) end end diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_AuraWatch/oUF_AuraWatch.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_AuraWatch/oUF_AuraWatch.lua index 3e83575..bbd1d8e 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_AuraWatch/oUF_AuraWatch.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_AuraWatch/oUF_AuraWatch.lua @@ -74,7 +74,7 @@ local function formatTime(s) return format("%dh", ceil(s / hour)) elseif s >= minute then return format("%dm", ceil(s / minute)) - elseif s >= minute / 12 then + elseif s >= 5 then return floor(s) end diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_CombatFader/oUF_CombatFader.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_CombatFader/oUF_CombatFader.lua index 2ed55b1..c311300 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_CombatFader/oUF_CombatFader.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_CombatFader/oUF_CombatFader.lua @@ -23,29 +23,27 @@ local parent, ns = ... local oUF = ns.oUF local frames, allFrames = {}, {} local showStatus -local CORE; local CheckForReset = function() for frame, unit in pairs(allFrames) do - if frame._secureFade and frame._secureFade.reset then + if frame.___fadereset then frame:SetAlpha(1) - frame._secureFade.reset = nil + frame.___fadereset = nil end end end local FadeFramesInOut = function(fade, unit) - if(not CORE) then return end for frame, unit in pairs(frames) do if not UnitExists(unit) then return end if fade then - if(frame:GetAlpha() ~= 1 or (frame._secureFade and frame._secureFade.endAlpha == 0)) then - CORE:SecureFadeIn(frame, 0.15) + if(frame:GetAlpha() ~= 1 or (frame.___fadeset and frame.___fadeset[2] == 0)) then + frame:FadeIn(0.15) end else if frame:GetAlpha() ~= 0 then - CORE:SecureFadeOut(frame, 0.15) - frame._secureFade.finishedFunc = CheckForReset + frame:FadeOut(0.15) + frame:FadeCallback(CheckForReset) else showStatus = false; return @@ -59,15 +57,12 @@ local FadeFramesInOut = function(fade, unit) end local Update = function(self, arg1, arg2) - if(not CORE) then return end if arg1 == "UNIT_HEALTH" and self and self.unit ~= arg2 then return end if type(arg1) == 'boolean' and not frames[self] then return end if(not frames[self]) then - if(CORE) then - CORE:SecureFadeIn(self, 0.15) - self._secureFade.reset = true - end + self:FadeIn(0.15) + self.___fadereset = true return end @@ -94,8 +89,6 @@ local Update = function(self, arg1, arg2) end local Enable = function(self, unit) - if(not CORE) then CORE = ns end - if self.CombatFade then frames[self] = self.unit allFrames[self] = self.unit diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Combatant/oUF_Combatant.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Combatant/oUF_Combatant.toc index 6068ea1..33b5d0c 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Combatant/oUF_Combatant.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Combatant/oUF_Combatant.toc @@ -2,7 +2,7 @@ ## Title: oUF Combatant ## Notes: Adds PvP trinket status and spec icons to oUF frames. ## Author: Munglunch -## Version: 5.3.9 +## Version: 5.4.08 ## X-Category: oUF ## Dependencies: oUF diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DrunkenMaster/oUF_DrunkenMaster.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DrunkenMaster/oUF_DrunkenMaster.lua index eeb45e6..a6b0025 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DrunkenMaster/oUF_DrunkenMaster.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DrunkenMaster/oUF_DrunkenMaster.lua @@ -71,83 +71,132 @@ local STANCE_OF_THE_STURY_OX_ID = 23 local UnitHealthMax = UnitHealthMax local UnitStagger = UnitStagger +local DEFAULT_BREW_COLOR = {0.91, 0.75, 0.25, 0.5}; local BREW_COLORS = { [124275] = {0, 1, 0, 1}, -- Light [124274] = {1, 0.5, 0, 1}, -- Moderate [124273] = {1, 0, 0, 1}, -- Heavy }; +local DEFAULT_STAGGER_COLOR = {1, 1, 1, 0.5}; local STAGGER_COLORS = { [124275] = {0.2, 0.8, 0.2, 1}, -- Light [124274] = {1.0, 0.8, 0.2, 1}, -- Moderate [124273] = {1.0, 0.4, 0.2, 1}, -- Heavy }; +local STAGGER_DEBUFFS = { + [124275] = true, -- Light + [124274] = true, -- Moderate + [124273] = true, -- Heavy +}; local staggerColor = {1, 1, 1, 0.5}; local brewColor = {0.91, 0.75, 0.25, 0.5}; -local function ScanForDrunkenMaster() - local name, _, icon, _, _, duration, _, _, _, _, spellID, _, _, value2, value1 = UnitAura("player", DM_L["Light Stagger"], "", "HARMFUL") - if (not name) then - name, _, icon, _, _, duration, _, _, _, _, spellID, _, _, value2, value1 = UnitAura("player", DM_L["Moderate Stagger"], "", "HARMFUL") - if (not name) then - name, _, icon, _, _, duration, _, _, _, _, spellID, _, _, value2, value1 = UnitAura("player", DM_L["Heavy Stagger"], "", "HARMFUL") +local function getStaggerAmount() + for i = 1, 40 do + local _, _, _, _, _, _, _, _, _, _, spellID, _, _, _, amount = + UnitDebuff("player", i) + if STAGGER_DEBUFFS[spellID] then + if (spellID) then + staggerColor = STAGGER_COLORS[spellID] or DEFAULT_STAGGER_COLOR + brewColor = BREW_COLORS[spellID] or DEFAULT_BREW_COLOR + else + staggerColor = DEFAULT_STAGGER_COLOR + brewColor = DEFAULT_BREW_COLOR + end + return amount end end - if (spellID) then - staggerColor = STAGGER_COLORS[spellID] - brewColor = STAGGER_COLORS[spellID] - else - staggerColor = {1, 1, 1, 0.5} - brewColor = {0.91, 0.75, 0.25, 0.5} - end - if(value1 and (value1 > 0) and duration) then - return (value1 * floor(duration)) - else - return 0 - end + return 0 end local Update = function(self, event, unit) - if unit and unit ~= self.unit then return; end - local staggerTotal = ScanForDrunkenMaster() - + if(self.unit ~= unit) then return end local stagger = self.DrunkenMaster - if(stagger.PreUpdate) then stagger:PreUpdate() end + local staggering = getStaggerAmount() + if staggering == 0 then + stagger:SetValue(0) + return + end + local health = UnitHealth("player") local maxHealth = UnitHealthMax("player") - local staggerPercent = staggerTotal / maxHealth - local currentStagger = floor(staggerPercent * 100) + local staggerTotal = UnitStagger("player") + if staggerTotal == 0 and staggering > 0 then + staggerTotal = staggering * 10 + end - stagger:SetMinMaxValues(0, 50) + local staggerPercent = staggerTotal / maxHealth * 100 + local currentStagger = floor(staggerPercent) + stagger:SetMinMaxValues(0, 100) stagger:SetStatusBarColor(unpack(brewColor)) - if currentStagger <= 50 then - stagger:SetValue(currentStagger) - else - stagger:SetValue(50) - end + stagger:SetValue(staggerPercent) local icon = stagger.icon if(icon) then icon:SetVertexColor(unpack(staggerColor)) end - + if(stagger.PostUpdate) then stagger:PostUpdate(maxHealth, currentStagger, staggerPercent) end end -local Visibility = function(self, event, unit) +local UpdateFromLog = function(self, event, ...) + local stagger = self.DrunkenMaster + local destName = select(9, ...) + if destName and UnitIsUnit(destName, "player") then + local subevent = select(2, ...) + local spellId = select(12, ...) + if (subevent:sub(1, 10) == "SPELL_AURA" and STAGGER_DEBUFFS[spellId]) or (subevent == "SPELL_PERIODIC_DAMAGE" and spellId == 124255) then + if(stagger.PreUpdate) then + stagger:PreUpdate() + end + local staggering = getStaggerAmount() + if staggering == 0 then + stagger:SetValue(0) + return + end + + local health = UnitHealth("player") + local maxHealth = UnitHealthMax("player") + local staggerTotal = UnitStagger("player") + if staggerTotal == 0 and staggering > 0 then + staggerTotal = staggering * 10 + end + + local staggerPercent = staggerTotal / maxHealth * 100 + local currentStagger = floor(staggerPercent) + stagger:SetMinMaxValues(0, 100) + stagger:SetStatusBarColor(unpack(brewColor)) + stagger:SetValue(staggerPercent) + + local icon = stagger.icon + if(icon) then + icon:SetVertexColor(unpack(staggerColor)) + end + + if(stagger.PostUpdate) then + stagger:PostUpdate(maxHealth, currentStagger, staggerPercent) + end + end + end +end + +local Visibility = function(self, event, ...) if(STANCE_OF_THE_STURY_OX_ID ~= GetShapeshiftFormID() or UnitHasVehiclePlayerFrameUI("player")) then if self.DrunkenMaster:IsShown() then self.DrunkenMaster:Hide() - self:UnregisterEvent('UNIT_AURA', Update) + --self:UnregisterEvent('UNIT_AURA', Update) + self:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED', UpdateFromLog) end else self.DrunkenMaster:Show() - self:RegisterEvent('UNIT_AURA', Update) - return Update(self, event, unit) + --self:RegisterEvent('UNIT_AURA', Update) + self:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED', UpdateFromLog) + return Update(self, event, ...) end end @@ -172,6 +221,9 @@ local function Enable(self, unit) if(element:IsObjectType'StatusBar' and not element:GetStatusBarTexture()) then element:SetStatusBarTexture(0.91, 0.75, 0.25) end + element:SetStatusBarColor(unpack(brewColor)) + element:SetMinMaxValues(0, 100) + element:SetValue(0) MonkStaggerBar.Hide = MonkStaggerBar.Show MonkStaggerBar:UnregisterEvent'PLAYER_ENTERING_WORLD' @@ -186,7 +238,8 @@ local function Disable(self) local element = self.DrunkenMaster if(element) then element:Hide() - self:UnregisterEvent('UNIT_AURA', Update) + --self:UnregisterEvent('UNIT_AURA', Update) + self:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED', Update) self:UnregisterEvent('UNIT_DISPLAYPOWER', Path) self:UnregisterEvent('UPDATE_SHAPESHIFT_FORM', Path) diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HunterTraps/oUF_HunterTraps.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HunterTraps/oUF_HunterTraps.lua new file mode 100644 index 0000000..01485d4 --- /dev/null +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HunterTraps/oUF_HunterTraps.lua @@ -0,0 +1,187 @@ +--GLOBAL NAMESPACE +local _G = _G; +--LUA +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local type = _G.type; +--BLIZZARD API +local GetTime = _G.GetTime; +local GetSpecialization = _G.GetSpecialization; +local UnitDebuff = _G.UnitDebuff; + +if select(2, UnitClass('player')) ~= "HUNTER" then return end + +local _, ns = ... +local oUF = oUF or ns.oUF +if not oUF then return end + +local FIRE_TRAP = GetSpellInfo(13813); +local FROST_TRAP = GetSpellInfo(1499); +local ICE_TRAP = GetSpellInfo(13809); +local SNAKE_TRAP, SNAKE_RANK, SNAKE_ICON = GetSpellInfo(34600); + +local FIRE_COLOR = {1,0.25,0}; +local FROST_COLOR = {0.5,1,1}; +local ICE_COLOR = {0.1,0.9,1}; +local SNAKE_COLOR = {0.2,0.8,0}; +--/script print(IsSpellKnown(34600)) +--/script print(IsSpellKnown(13809)) +local TRAP_IDS = { + [1] = FIRE_TRAP, + [2] = FROST_TRAP, + [3] = ICE_TRAP, +}; +local TRAP_COLORS = { + [1] = FIRE_COLOR, + [2] = FROST_COLOR, + [3] = ICE_COLOR, +}; + +local HAS_SNAKE_TRAP = false; + +local function UpdateBar(self, elapsed) + if not self.duration then return end + self.elapsed = (self.elapsed or 0) + elapsed + if self.elapsed >= 0.5 then + local timeLeft = (self.duration - (self.duration - (GetTime() - self.start))) * 1000 + if timeLeft < self.duration then + self:SetValue(timeLeft) + self:SetStatusBarColor(unpack(TRAP_COLORS[self.colorIndex])) + else + self:SetStatusBarColor(0.9,0.9,0.9) + self.elapsed = 0 + self.start = nil + self.duration = nil + self:SetScript("OnUpdate", nil) + self:Update(true, HAS_SNAKE_TRAP) + end + end +end + +local Update = function(self, event, ...) + local bar = self.HunterTraps + if(event and event == "SPELLS_CHANGED") then + local ice_icon = select(3, GetSpellInfo(13809)); + if(ice_icon == SNAKE_ICON) then + TRAP_IDS[3] = SNAKE_TRAP + TRAP_COLORS[3] = SNAKE_COLOR + HAS_SNAKE_TRAP = true + else + TRAP_IDS[3] = ICE_TRAP + TRAP_COLORS[3] = ICE_COLOR + HAS_SNAKE_TRAP = false + end + end + + if(bar.PreUpdate) then bar:PreUpdate(event) end + + local name, start, duration; + local unit, _, _, _, spellID = ... + if(unit and (self.unit ~= unit)) then + return + end + if(spellID) then + name = GetSpellInfo(spellID) + start = GetSpellCooldown(spellID) + duration = GetSpellBaseCooldown(spellID) + end + + if bar:IsShown() then + for i = 1, 3 do + --bar[i]:SetStatusBarColor(unpack(TRAP_COLORS[i])) + if(name and TRAP_IDS[i] == name) then + bar[i]:Show() + if((start and start > 0) and (duration and duration > 0)) then + bar[i]:SetMinMaxValues(0, duration) + bar[i]:SetValue(0) + bar[i].start = start + bar[i].duration = duration + bar[i]:SetScript('OnUpdate', UpdateBar) + bar[i]:Update(false, HAS_SNAKE_TRAP) + end + end + end + end + + if(bar.PostUpdate) then + return bar:PostUpdate(event) + end +end + + +local Path = function(self, ...) + return (self.HunterTraps.Override or Update) (self, ...) +end + +local ForceUpdate = function(element) + return Path(element.__owner, 'ForceUpdate', element.__owner.unit) +end + +local function Enable(self, unit) + local bar = self.HunterTraps + + if(bar) then + self:RegisterEvent("SPELLS_CHANGED", Path) + self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED", Path) + self:RegisterEvent("PLAYER_TALENT_UPDATE", Path) + self:RegisterEvent("PLAYER_ENTERING_WORLD", Path) + bar.__owner = self + bar.ForceUpdate = ForceUpdate + + local barWidth,barHeight = bar:GetSize() + local trapSize = barWidth * 0.25 + + local ice_icon = select(3, GetSpellInfo(13809)); + if(ice_icon == SNAKE_ICON) then + TRAP_IDS[3] = SNAKE_TRAP + TRAP_COLORS[3] = SNAKE_COLOR + HAS_SNAKE_TRAP = true + else + TRAP_IDS[3] = ICE_TRAP + TRAP_COLORS[3] = ICE_COLOR + HAS_SNAKE_TRAP = false + end + for i = 1, 3 do + if not bar[i] then + bar[i] = CreateFrame("Statusbar", nil, bar) + bar[i]:SetPoint("LEFT", bar, "LEFT", (trapSize * (i - 1)), 0) + bar[i]:SetSize(trapSize,trapSize) + end + + bar[i].colorIndex = i; + + if not bar[i]:GetStatusBarTexture() then + bar[i]:SetStatusBarTexture([=[Interface\TargetingFrame\UI-StatusBar]=]) + end + + bar[i]:SetFrameLevel(bar:GetFrameLevel() + 1) + bar[i]:GetStatusBarTexture():SetHorizTile(false) + bar[i]:SetStatusBarColor(0.9,0.9,0.9) + + if bar[i].bg then + bar[i].bg:SetAllPoints() + end + + bar[i]:SetMinMaxValues(0, 1) + bar[i]:SetValue(1) + bar[i]:Update(true, HAS_SNAKE_TRAP) + end + + return true; + end +end + +local function Disable(self,unit) + local bar = self.HunterTraps + + if(bar) then + self:UnregisterEvent("SPELLS_CHANGED", Path) + self:UnregisterEvent('UNIT_SPELLCAST_SUCCEEDED', Path) + self:UnregisterEvent("PLAYER_TALENT_UPDATE", Path) + self:UnregisterEvent("PLAYER_ENTERING_WORLD", Path) + bar:Hide() + end +end + +oUF:AddElement("HunterTraps",Path,Enable,Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_PriestOrbs/oUF_PriestOrbs.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_PriestOrbs/oUF_PriestOrbs.lua index bff2e0c..87cb043 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_PriestOrbs/oUF_PriestOrbs.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_PriestOrbs/oUF_PriestOrbs.lua @@ -33,7 +33,7 @@ local SERENDIPITY = GetSpellInfo(63733) local OrbColors = { [1] = {1, 1, 0}, - [2] = {0.1, 0.4, 1}, + [2] = {1, 1, 0}, [3] = {0.6, 0.06, 1} }; diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/colors.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/colors.lua index 5a64636..f7a62f6 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/colors.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/colors.lua @@ -19,19 +19,19 @@ local colors = { -- We do this because people edit the vars directly, and changing the default -- globals makes SPICE FLOW! local customClassColors = function() - if(SVUI_CLASS_COLORS) then + if(CUSTOM_CLASS_COLORS) then local updateColors = function() - for eclass, color in next, SVUI_CLASS_COLORS do + for eclass, color in next, CUSTOM_CLASS_COLORS do colors.class[eclass] = {color.r, color.g, color.b} end for _, obj in next, oUF.objects do - obj:UpdateAllElements("SVUI_CLASS_COLORS") + obj:UpdateAllElements("CUSTOM_CLASS_COLORS") end end updateColors() - SVUI_CLASS_COLORS:RegisterCallback(updateColors) + CUSTOM_CLASS_COLORS:RegisterCallback(updateColors) return true end diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/health.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/health.lua index 6cdf103..24548de 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/health.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/health.lua @@ -71,7 +71,6 @@ local Update = function(self, event, unit) end local bg = health.bg; - local db = oUF.SVConfigs; local r, g, b, t, t2; if(health.colorTapping and not UnitPlayerControlled(unit) and UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) and not UnitIsTappedByAllThreatList(unit)) then @@ -84,12 +83,12 @@ local Update = function(self, event, unit) local _, class = UnitClass(unit) local tmp = oUF.colors.class[class] or oUF.colors.health t = {(tmp[1] * 0.75),(tmp[2] * 0.75),(tmp[3] * 0.75)} - if(bg and (db and db.classbackdrop) and UnitIsPlayer(unit)) then + if(bg and (health.colorBackdrop) and UnitIsPlayer(unit)) then t2 = t end elseif(health.colorReaction and UnitReaction(unit, 'player')) then t = oUF.colors.reaction[UnitReaction(unit, "player")] - if(bg and (db and db.classbackdrop) and not UnitIsPlayer(unit) and UnitReaction(unit, "player")) then + if(bg and (health.colorBackdrop) and not UnitIsPlayer(unit) and UnitReaction(unit, "player")) then t2 = t end elseif(health.colorSmooth) then @@ -103,7 +102,7 @@ local Update = function(self, event, unit) end if(b) then - if(db and db.healthclass == true and db.colorhealthbyvalue == true or db.colorhealthbyvalue and self.isForced and not(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit))) then + if((health.colorClass and health.colorSmooth) or (health.colorSmooth and self.isForced and not (UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)))) then r, g, b = self.ColorGradient(min,max,1,0,0,1,1,0,r,g,b) end health:SetStatusBarColor(r, g, b) diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/oUF_core.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/oUF_core.lua index 44740a7..976bd44 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/oUF_core.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/oUF_core.lua @@ -1069,19 +1069,19 @@ local colors = { -- We do this because people edit the vars directly, and changing the default -- globals makes SPICE FLOW! local customClassColors = function() - if(SVUI_CLASS_COLORS) then + if(CUSTOM_CLASS_COLORS) then local updateColors = function() - for eclass, color in next, SVUI_CLASS_COLORS do + for eclass, color in next, CUSTOM_CLASS_COLORS do colors.class[eclass] = {color.r, color.g, color.b} end for _, obj in next, oUF.objects do - obj:UpdateAllElements("SVUI_CLASS_COLORS") + obj:UpdateAllElements("CUSTOM_CLASS_COLORS") end end updateColors() - SVUI_CLASS_COLORS:RegisterCallback(updateColors) + CUSTOM_CLASS_COLORS:RegisterCallback(updateColors) return true end diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF_Villain.xml b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF_Villain.xml index 902ba11..b595d50 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF_Villain.xml +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF_Villain.xml @@ -70,6 +70,7 @@ <Script file="plugins\oUF_ArcaneCharge\oUF_ArcaneCharge.lua"/> <Script file="plugins\oUF_ActionPanel\oUF_ActionPanel.lua"/> <Script file="plugins\oUF_Afflicted\oUF_Afflicted.lua"/> + <Script file="plugins\oUF_HunterTraps\oUF_HunterTraps.lua"/> <Script file="plugins\oUF_MainTank\oUF_MainTank.lua"/> <Script file="plugins\oUF_PallyPower\oUF_PallyPower.lua"/> <Script file="plugins\oUF_WarlockShards\oUF_WarlockShards.lua"/> diff --git a/Interface/AddOns/SVUI/packages/_load.xml b/Interface/AddOns/SVUI/packages/_load.xml index c8f5432..82e90d5 100644 --- a/Interface/AddOns/SVUI/packages/_load.xml +++ b/Interface/AddOns/SVUI/packages/_load.xml @@ -1,17 +1,15 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Include file="stats\SVStats.xml"/> <Include file="aura\SVAura.xml"/> <Script file="map\SVMap.lua"/> - <Include file="plates\SVPlate.xml"/> + <Include file="plate\SVPlate.xml"/> <Script file="tip\SVTip.lua"/> - <Script file="actionbar\SVBar.lua"/> - <Script file="actionbar\KeyBind.lua"/> + <Include file="bar\SVBar.xml"/> <Include file="unit\SVUnit.xml"/> <Script file="chat\SVChat.lua"/> <Include file="bag\SVBag.xml"/> <Include file="override\SVOverride.xml"/> <Script file="gear\SVGear.lua"/> <Script file="henchmen\SVHenchmen.lua"/> - <Include file="tools\SVTools.xml"/> - <!-- <Include file="quest\SVQuest.xml"/> --> + <Include file="tool\SVTools.xml"/> + <Include file="quest\SVQuest.xml"/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua b/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua deleted file mode 100644 index 7dadb06..0000000 --- a/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua +++ /dev/null @@ -1,525 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local string = _G.string; -local math = _G.math; -local table = _G.table; -local GetTime = _G.GetTime; ---[[ STRING METHODS ]]-- -local format, find = string.format, string.find; ---[[ MATH METHODS ]]-- -local floor = math.floor; -local tonumber = tonumber; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L; -local MOD = SV.SVBar; - -local _G = getfenv(0); - -local RefreshBindings -local NewFrame = CreateFrame; -local NewHook = hooksecurefunc; - -local Binder = NewFrame("Frame", nil, UIParent); ---[[ -########################################################## -BINDING UPDATES -########################################################## -]]-- -do - --[[ HANDLERS ]]-- - local GameTooltip_OnHide = function(self) - self:SetOwner(Binder, "ANCHOR_TOP") - self:SetPoint("BOTTOM", Binder, "TOP", 0, 1) - self:AddLine(Binder.button.name, 1, 1, 1) - Binder.button.bindings = {GetBindingKey(Binder.button.bindstring)} - local count = #Binder.button.bindings - if(count == 0) then - self:AddLine(L["No bindings set."], .6, .6, .6) - else - self:AddDoubleLine(L["Binding"], L["Key"], .6, .6, .6, .6, .6, .6) - for i = 1, count do - self:AddDoubleLine(i, Binder.button.bindings[i]) - end - end - self:Show() - self:SetScript("OnHide", nil) - end - --[[ END OF HANDLERS ]]-- - - function RefreshBindings(bindTarget, bindType) - if(not Binder.active or InCombatLockdown()) then return end - Binder.button = bindTarget; - Binder.spellmacro = bindType; - Binder:ClearAllPoints() - Binder:SetAllPoints(bindTarget) - Binder:Show() - ShoppingTooltip1:Hide() - if(bindTarget.FlyoutArrow and bindTarget.FlyoutArrow:IsShown()) then - Binder:EnableMouse(false) - elseif(not Binder:IsMouseEnabled()) then - Binder:EnableMouse(true) - end - local keyBindID, keyBindName, keyBindString; - if bindType == "FLYOUT" then - keyBindName = GetSpellInfo(bindTarget.spellID); - keyBindString = ("SPELL %s"):format(keyBindName); - Binder.button.name = keyBindName - Binder.button.bindstring = keyBindString; - GameTooltip:AddLine(L["Trigger"]) - GameTooltip:Show() - GameTooltip:SetScript("OnHide", GameTooltip_OnHide) - elseif bindType == "SPELL" then - keyBindID = SpellBook_GetSpellBookSlot(bindTarget) - keyBindName = GetSpellBookItemName(keyBindID, SpellBookFrame.bookType); - keyBindString = ("SPELL %s"):format(keyBindName); - Binder.button.id = keyBindID - Binder.button.name = keyBindName - Binder.button.bindstring = keyBindString; - GameTooltip:AddLine(L["Trigger"]) - GameTooltip:Show() - GameTooltip:SetScript("OnHide", GameTooltip_OnHide) - elseif bindType == "MACRO" then - keyBindID = bindTarget:GetID() - if(floor(.5 + select(2, MacroFrameTab1Text:GetTextColor()) * 10) / 10 == .8) then - keyBindID = keyBindID + 36 - end - keyBindName = GetMacroInfo(keyBindID) - keyBindString = ("MACRO %s"):format(keyBindName); - Binder.button.id = keyBindID - Binder.button.name = keyBindName - Binder.button.bindstring = keyBindString; - Binder.button.bindings = {GetBindingKey(keyBindString)} - GameTooltip:SetOwner(Binder, "ANCHOR_TOP") - GameTooltip:SetPoint("BOTTOM", Binder, "TOP", 0, 1) - GameTooltip:AddLine(keyBindName, 1, 1, 1) - if #Binder.button.bindings == 0 then - GameTooltip:AddLine(L["No bindings set."], .6, .6, .6) - else - GameTooltip:AddDoubleLine(L["Binding"], L["Key"], .6, .6, .6, .6, .6, .6) - for i = 1, #Binder.button.bindings do - local lineName = ("%s%d"):format(L["Binding"], i) - GameTooltip:AddDoubleLine(lineName, Binder.button.bindings[i], 1, 1, 1) - end - end - GameTooltip:Show() - elseif bindType == "STANCE" or bindType == "PET" then - keyBindID = tonumber(bindTarget:GetID()) - keyBindName = bindTarget:GetName() - if(not keyBindName) then return end - if ((not keyBindID) or (keyBindID < 1) or (keyBindID > (bindType == "STANCE" and 10 or 12))) then - keyBindString = ("CLICK %s: LeftButton"):format(keyBindName); - else - local tmpStr = bindType == "STANCE" and "StanceButton" or "BONUSACTIONBUTTON" - keyBindString = ("%s%d"):format(tmpStr, keyBindID); - end - Binder.button.id = keyBindID - Binder.button.name = keyBindName - Binder.button.bindstring = keyBindString - GameTooltip:AddLine(L["Trigger"]) - GameTooltip:Show() - GameTooltip:SetScript("OnHide", GameTooltip_OnHide) - else - keyBindID = tonumber(bindTarget.action) - keyBindName = bindTarget:GetName() - if(not keyBindName) then return end - if(not bindTarget.keyBoundTarget and ((not keyBindID) or (keyBindID < 1) or (keyBindID > 132))) then - keyBindString = ("CLICK %s: LeftButton"):format(keyBindName); - elseif(bindTarget.keyBoundTarget) then - keyBindString = bindTarget.keyBoundTarget - else - local slotID = 1 + (keyBindID - 1) % 12; - if((keyBindID < 25) or (keyBindID > 72)) then - keyBindString = ("ACTIONBUTTON%s"):format(slotID); - elseif((keyBindID < 73) and (keyBindID > 60)) then - keyBindString = ("MULTIACTIONBAR1BUTTON%s"):format(slotID); - elseif(keyBindID < 61 and keyBindID > 48) then - keyBindString = ("MULTIACTIONBAR2BUTTON%s"):format(slotID); - elseif(keyBindID < 49 and keyBindID > 36) then - keyBindString = ("MULTIACTIONBAR4BUTTON%s"):format(slotID); - elseif(keyBindID < 37 and keyBindID > 24) then - keyBindString = ("MULTIACTIONBAR3BUTTON%s"):format(slotID); - end - end - Binder.button.action = keyBindID - Binder.button.name = keyBindName - Binder.button.bindstring = keyBindString - GameTooltip:AddLine(L["Trigger"]) - GameTooltip:Show() - GameTooltip:SetScript("OnHide", GameTooltip_OnHide) - end - end -end ---[[ -########################################################## -PACKAGE PLUGIN -########################################################## -]]-- -function MOD:ToggleKeyBindingMode(deactivate, saveRequested) - if not deactivate then - Binder.active = true; - SV:StaticPopupSpecial_Show(SVUI_KeyBindPopup) - MOD:RegisterEvent('PLAYER_REGEN_DISABLED','ToggleKeyBindingMode',true,false) - else - if saveRequested then - SaveBindings(GetCurrentBindingSet()) - SV:AddonMessage(L["Binding Changes Stored"]) - else - LoadBindings(GetCurrentBindingSet()) - SV:AddonMessage(L["Binding Changes Discarded"]) - end - Binder.active = false; - Binder:ClearAllPoints() - Binder:Hide() - GameTooltip:Hide() - MOD:UnregisterEvent("PLAYER_REGEN_DISABLED") - SV:StaticPopupSpecial_Hide(SVUI_KeyBindPopup) - MOD.bindingsChanged = false - end -end - -local blockedButtons = { LSHIFT = true, RSHIFT = true, LCTRL = true, RCTRL = true, LALT = true, RALT = true, UNKNOWN = true, LeftButton = true} - ---[[ HANDLERS ]]-- -local tipTimeLapse = 0; -local GameTooltip_OnUpdate = function(self, elapsed) - tipTimeLapse = (tipTimeLapse + elapsed); - if tipTimeLapse < .2 then - return - else - tipTimeLapse = 0 - end - if(not self.comparing and IsModifiedClick("COMPAREITEMS")) then - GameTooltip_ShowCompareItem(self) - self.comparing = true - elseif(self.comparing and not IsModifiedClick("COMPAREITEMS")) then - for _,tip in pairs(self.shoppingTooltips)do - tip:Hide() - end - self.comparing = false - end -end - -local GameTooltip_OnHide = function(self) - for _, tip in pairs(self.shoppingTooltips)do - tip:Hide() - end -end - -local GameTooltip_OnHide = function(self) - for _, tip in pairs(self.shoppingTooltips)do - tip:Hide() - end -end - -local SpellButton_OnEnter = function(self) - RefreshBindings(self, "SPELL") -end - -local Button_Proxy = function(self) - RefreshBindings(self) -end -local Stance_Proxy = function(self) - RefreshBindings(self,"STANCE") -end -local Pet_Proxy = function(self) - RefreshBindings(self,"PET") -end -local Flyout_Proxy = function(self) - RefreshBindings(self,"FLYOUT") -end -local Macro_Proxy = function(self) - RefreshBindings(self, "MACRO") -end - -local BinderButton_OnEnter = function(self) - local parent = self.button:GetParent() - if parent and parent._fade then - SV:SecureFadeIn(parent, 0.2, parent:GetAlpha(), parent._alpha) - end -end - -local BinderButton_OnLeave = function(self) - local parent = self.button:GetParent() - self:ClearAllPoints() - self:Hide() - GameTooltip:Hide() - if parent and parent._fade then - SV:SecureFadeOut(parent, 1, parent:GetAlpha(), 0) - end -end - -local Binder_OnBinding = function(self, event) - MOD.bindingsChanged = true; - if(event == "ESCAPE" or event == "RightButton") then - local count = #Binder.button.bindings - for i=1, count do - SetBinding(Binder.button.bindings[i]) - end - local prefix = L["All keybindings cleared for |cff00ff00%s|r."] - local strMsg = prefix:format(Binder.button.name) - SV:AddonMessage(strMsg) - RefreshBindings(Binder.button, Binder.spellmacro) - if(Binder.spellmacro ~= "MACRO") then - GameTooltip:Hide() - end - return - end - - if(blockedButtons[event]) then return end - if(event == "MiddleButton") then - event = "BUTTON3" - end - if(event:find('Button%d')) then - event = event:upper() - end - - local altText = IsAltKeyDown() and "ALT-" or ""; - local ctrlText = IsControlKeyDown() and "CTRL-" or ""; - local shiftText = IsShiftKeyDown() and "SHIFT-" or ""; - local strBind = ("%s%s%s%s"):format(altText, ctrlText, shiftText, event) - - if(not Binder.spellmacro or Binder.spellmacro == "PET" or Binder.spellmacro == "STANCE" or Binder.spellmacro == "FLYOUT") then - SetBinding(strBind, Binder.button.bindstring) - else - local strMacro = ("%s %s"):format(Binder.spellmacro, Binder.button.name) - SetBinding(strBind, strMacro) - end - - local glue = L[" |cff00ff00bound to |r"] - local addMsg = ("%s%s%s."):format(strBind, glue, Binder.button.name) - SV:AddonMessage(addMsg) - RefreshBindings(Binder.button, Binder.spellmacro) - - if Binder.spellmacro ~= "MACRO" then - GameTooltip:Hide() - end -end - -local BinderButton_OnMouseWheel = function(self, delta) - if delta > 0 then - Binder_OnBinding(self, "MOUSEWHEELUP") - else - Binder_OnBinding(self, "MOUSEWHEELDOWN") - end -end - -local SetBindingMacro = function(self, arg) - if(arg == "Blizzard_MacroUI") then - for i=1,36 do - local btnName = ("MacroButton%d"):format(i) - local btn = _G[btnName] - btn:HookScript("OnEnter", MacroBinding_OnEnter) - end - end -end - -local Check_OnShow = function(self) - self:SetChecked(GetCurrentBindingSet() == 2) -end - -local Check_OnEnter = function(self) - GameTooltip:SetOwner(self, "ANCHOR_RIGHT") - GameTooltip:SetText(CHARACTER_SPECIFIC_KEYBINDING_TOOLTIP, nil, nil, nil, nil, 1) -end - -local Check_OnClick = function(self) - if(MOD.bindingsChanged) then - SV:StaticPopup_Show("CONFIRM_LOSE_BINDING_CHANGES") - else - if SVUI_KeyBindPopupCheckButton:GetChecked() then - LoadBindings(2) - SaveBindings(2) - else - LoadBindings(1) - SaveBindings(1) - end - end -end - -local Save_OnClick = function(self) - MOD:ToggleKeyBindingMode(true, true) -end - -local Discard_OnClick = function(self) - MOD:ToggleKeyBindingMode(true, false) -end ---[[ END OF HANDLERS ]]-- - -local function SetBindingButton(button, force) - local click1 = StanceButton1:GetScript("OnClick") - local click2 = PetActionButton1:GetScript("OnClick") - local click3 = SecureActionButton_OnClick; - local button_OnClick = button:GetScript("OnClick") - if button_OnClick == click3 or force then - button:HookScript("OnEnter", Button_Proxy) - elseif button_OnClick == click1 then - button:HookScript("OnEnter", Stance_Proxy) - elseif button_OnClick == click2 then - button:HookScript("OnEnter", Pet_Proxy) - end -end - -local function RefreshAllFlyouts() - local count = GetNumFlyouts() - for i = 1, count do - local id = GetFlyoutID(i) - local _,_,numSlots,isKnown = GetFlyoutInfo(id) - if isKnown then - for x = 1, numSlots do - local btnName = ("SpellFlyoutButton%d"):format(x) - local btn = _G[btnName] - if(SpellFlyout:IsShown() and btn and btn:IsShown()) then - if(not btn.hookedFlyout) then - btn:HookScript("OnEnter", Flyout_Proxy) - btn.hookedFlyout = true - end - end - end - end - end -end - -function MOD:LoadKeyBinder() - self:RefreshActionBars() - -- Binder:SetParent(SV.Screen) - Binder:SetFrameStrata("DIALOG") - Binder:SetFrameLevel(99) - Binder:EnableMouse(true) - Binder:EnableKeyboard(true) - Binder:EnableMouseWheel(true) - Binder.texture = Binder:CreateTexture() - Binder.texture:SetAllPoints(Binder) - Binder.texture:SetTexture(0, 0, 0, .25) - Binder:Hide() - - GameTooltip:HookScript("OnUpdate", GameTooltip_OnUpdate) - NewHook(GameTooltip, "Hide", GameTooltip_OnHide) - - Binder:SetScript("OnEnter", BinderButton_OnEnter) - Binder:SetScript("OnLeave", BinderButton_OnLeave) - Binder:SetScript("OnKeyUp", Binder_OnBinding) - Binder:SetScript("OnMouseUp", Binder_OnBinding) - Binder:SetScript("OnMouseWheel", BinderButton_OnMouseWheel) - - local OBJECT = EnumerateFrames() - while OBJECT do - if(OBJECT.IsProtected and OBJECT:IsProtected() and OBJECT.GetObjectType and OBJECT:GetObjectType() == "CheckButton" and OBJECT.GetScript) then - SetBindingButton(OBJECT) - end - OBJECT = EnumerateFrames(OBJECT) - end - - for OBJECT, _ in pairs(self.ButtonCache)do - if(OBJECT.IsProtected and OBJECT:IsProtected() and OBJECT.GetObjectType and OBJECT:GetObjectType() == "CheckButton" and OBJECT.GetScript) then - SetBindingButton(OBJECT, true) - end - end - - for i = 1, 12 do - local btnName = ("SpellButton%d"):format(i) - local spellButton = _G[btnName] - spellButton:HookScript("OnEnter", SpellButton_OnEnter) - end - - if not IsAddOnLoaded("Blizzard_MacroUI")then - NewHook("LoadAddOn", SetBindingMacro) - else - for i=1,36 do - local btnName = ("MacroButton%d"):format(i) - local btn = _G[btnName] - btn:HookScript("OnEnter", Macro_Proxy) - end - end - - NewHook("ActionButton_UpdateFlyout", RefreshAllFlyouts) - RefreshAllFlyouts() - - local pop = NewFrame("Frame", "SVUI_KeyBindPopup", UIParent) - pop:SetFrameStrata("DIALOG") - pop:SetToplevel(true) - pop:EnableMouse(true) - pop:SetMovable(true) - pop:SetFrameLevel(99) - pop:SetClampedToScreen(true) - pop:SetWidth(360) - pop:SetHeight(130) - pop:SetFixedPanelTemplate("Transparent") - pop:Hide() - - local moveHandle = NewFrame("Button", nil, pop) - moveHandle:SetFixedPanelTemplate("Button", true) - moveHandle:SetWidth(100) - moveHandle:SetHeight(25) - moveHandle:SetPoint("CENTER", pop, "TOP") - moveHandle:SetFrameLevel(moveHandle:GetFrameLevel() + 2) - moveHandle:EnableMouse(true) - moveHandle:RegisterForClicks("AnyUp", "AnyDown") - local onMouseDown = function() pop:StartMoving() end - moveHandle:SetScript("OnMouseDown", onMouseDown) - local onMouseUp = function() pop:StopMovingOrSizing() end - moveHandle:SetScript("OnMouseUp", onMouseUp) - - local moveText = moveHandle:CreateFontString("OVERLAY") - moveText:FontManager() - moveText:SetPoint("CENTER", moveHandle, "CENTER") - moveText:SetText("Key Binds") - - local moveDesc = pop:CreateFontString("ARTWORK") - moveDesc:SetFontObject("GameFontHighlight") - moveDesc:SetJustifyV("TOP") - moveDesc:SetJustifyH("LEFT") - moveDesc:SetPoint("TOPLEFT", 18, -32) - moveDesc:SetPoint("BOTTOMRIGHT", -18, 48) - moveDesc:SetText(L["Hover your mouse over any actionbutton or spellbook button to bind it. Press the escape key or right click to clear the current actionbutton's keybinding."]) - - local checkButton = NewFrame("CheckButton", "SVUI_KeyBindPopupCheckButton", pop, "OptionsCheckButtonTemplate") - checkButton:SetCheckboxTemplate(true) - _G["SVUI_KeyBindPopupCheckButtonText"]:SetText(CHARACTER_SPECIFIC_KEYBINDINGS) - checkButton:SetScript("OnShow", Check_OnShow) - checkButton:SetScript("OnClick", Check_OnClick) - checkButton:SetScript("OnEnter", Check_OnEnter) - checkButton:SetScript("OnLeave", GameTooltip_Hide) - - local saveButton = NewFrame("Button", "SVUI_KeyBindPopupSaveButton", pop, "OptionsButtonTemplate") - saveButton:Width(150) - saveButton:SetButtonTemplate() - _G["SVUI_KeyBindPopupSaveButtonText"]:SetText(L["Save"]) - saveButton:SetScript("OnClick", Save_OnClick) - - local discardButton = NewFrame("Button", "SVUI_KeyBindPopupDiscardButton", pop, "OptionsButtonTemplate") - discardButton:Width(150) - discardButton:SetButtonTemplate() - _G["SVUI_KeyBindPopupDiscardButtonText"]:SetText(L["Discard"]) - discardButton:SetScript("OnClick", Discard_OnClick) - - checkButton:SetPoint("BOTTOMLEFT", discardButton, "TOPLEFT", 0, 2) - saveButton:SetPoint("BOTTOMRIGHT", -14, 10) - discardButton:SetPoint("BOTTOMLEFT", 14, 10) -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua deleted file mode 100644 index 5f8518e..0000000 --- a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua +++ /dev/null @@ -1,1636 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local string = _G.string; -local math = _G.math; ---[[ STRING METHODS ]]-- -local find, format, split = string.find, string.format, string.split; -local gsub = string.gsub; ---[[ MATH METHODS ]]-- -local ceil = math.ceil; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L -local LSM = LibStub("LibSharedMedia-3.0") - -local MOD = SV:NewPackage("SVBar", L["ActionBars"]); -MOD.ButtonCache = {}; ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local maxFlyoutCount = 0 -local SetSpellFlyoutHook -local NewFrame = CreateFrame -local NewHook = hooksecurefunc -local NUM_ACTIONBAR_BUTTONS = NUM_ACTIONBAR_BUTTONS -local ICON_FILE = [[Interface\AddOns\SVUI\assets\artwork\Icons\MICROMENU]] -local ICON_DATA = { - {"CharacterMicroButton",0,0.25,0,0.25}, -- MICRO-CHARACTER - {"SpellbookMicroButton",0.25,0.5,0,0.25}, -- MICRO-SPELLBOOK - {"TalentMicroButton",0.5,0.75,0,0.25}, -- MICRO-TALENTS - {"AchievementMicroButton",0.75,1,0,0.25}, -- MICRO-ACHIEVEMENTS - {"QuestLogMicroButton",0,0.25,0.25,0.5}, -- MICRO-QUESTS - {"GuildMicroButton",0.25,0.5,0.25,0.5}, -- MICRO-GUILD - {"PVPMicroButton",0.5,0.75,0.25,0.5}, -- MICRO-PVP - {"LFDMicroButton",0.75,1,0.25,0.5}, -- MICRO-LFD - {"EJMicroButton",0,0.25,0.5,0.75}, -- MICRO-ENCOUNTER - {"StoreMicroButton",0.25,0.5,0.5,0.75}, -- MICRO-STORE - {"CompanionsMicroButton",0.5,0.75,0.5,0.75},-- MICRO-COMPANION - {"MainMenuMicroButton",0.75,1,0.5,0.75}, -- MICRO-SYSTEM - {"HelpMicroButton",0,0.25,0.75,1}, -- MICRO-HELP -} ---[[ -########################################################## -LOCAL FUNCTIONS -########################################################## -]]-- -local LibAB = LibStub("LibActionButton-1.0"); - -local function NewActionBar(barName) - local bar = CreateFrame("Frame", barName, UIParent, "SecureHandlerStateTemplate") - bar.buttons = {} - bar.conditions = "" - bar.config = { - outOfRangeColoring = "button", - tooltip = "enable", - showGrid = true, - colors = { - range = {0.8, 0.1, 0.1}, - mana = {0.5, 0.5, 1.0}, - hp = {0.5, 0.5, 1.0} - }, - hideElements = { - macro = false, - hotkey = false, - equipped = false - }, - keyBoundTarget = false, - clickOnDown = false - } - return bar -end - -local function NewActionButton(parent, index, name) - return LibAB:CreateButton(index, name, parent, nil) -end - -local function RefreshMicrobar() - if not SVUI_MicroBar then return end - local lastParent = SVUI_MicroBar; - local buttonSize = SV.db.SVBar.Micro.buttonsize or 30; - local spacing = SV.db.SVBar.Micro.buttonspacing or 1; - local barWidth = (buttonSize + spacing) * 13; - SVUI_MicroBar_MOVE:Size(barWidth, buttonSize) - SVUI_MicroBar:SetAllPoints(SVUI_MicroBar_MOVE) - for i=1,13 do - local data = ICON_DATA[i] - local button = _G[data[1]] - if(button) then - button:ClearAllPoints() - button:Size(buttonSize, buttonSize + 28) - button._fade = SV.db.SVBar.Micro.mouseover - if lastParent == SVUI_MicroBar then - button:SetPoint("BOTTOMLEFT", lastParent, "BOTTOMLEFT", 0, 0) - else - button:SetPoint("BOTTOMLEFT", lastParent, "BOTTOMRIGHT", spacing, 0) - end - lastParent = button; - button:Show() - end - end -end - -local Bar_OnEnter = function(self) - if(self._fade) then - SV:SecureFadeIn(self, 0.2, self:GetAlpha(), self._alpha) - end -end - -local Bar_OnLeave = function(self) - if(self._fade) then - SV:SecureFadeOut(self, 1, self:GetAlpha(), 0) - end -end - -local SVUIMicroButton_SetNormal = function() - local level = MainMenuMicroButton:GetFrameLevel() - if(level > 0) then - MainMenuMicroButton:SetFrameLevel(level - 1) - else - MainMenuMicroButton:SetFrameLevel(0) - end - MainMenuMicroButton:SetFrameStrata("BACKGROUND") - MainMenuMicroButton.overlay:SetFrameLevel(level + 1) - MainMenuMicroButton.overlay:SetFrameStrata("HIGH") - MainMenuBarPerformanceBar:Hide() - HelpMicroButton:Show() -end - -local SVUIMicroButtonsParent = function(self) - if self ~= SVUI_MicroBar then - self = SVUI_MicroBar - end - for i=1,13 do - local data = ICON_DATA[i] - if(data) then - local mButton = _G[data[1]] - if(mButton) then mButton:SetParent(SVUI_MicroBar) end - end - end -end - -local MicroButton_OnEnter = function(self) - if(self._fade) then - SV:SecureFadeIn(SVUI_MicroBar,0.2,SVUI_MicroBar:GetAlpha(),1) - end - if InCombatLockdown()then return end - self.overlay:SetPanelColor("highlight") - self.overlay.icon:SetGradient("VERTICAL", 0.75, 0.75, 0.75, 1, 1, 1) -end - -local MicroButton_OnLeave = function(self) - if(self._fade) then - SV:SecureFadeOut(SVUI_MicroBar,1,SVUI_MicroBar:GetAlpha(),0) - end - if InCombatLockdown()then return end - self.overlay:SetPanelColor("special") - self.overlay.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) -end - -local MicroButton_OnUpdate = function() - if(not SV.db.SVBar.Micro.mouseover) then - SVUI_MicroBar:SetAlpha(1) - else - SVUI_MicroBar:SetAlpha(0) - end - GuildMicroButtonTabard:ClearAllPoints(); - GuildMicroButtonTabard:Hide(); - RefreshMicrobar() -end - -function MOD:FixKeybindText(button) - local hotkey = _G[button:GetName()..'HotKey'] - local hotkeyText = hotkey:GetText() - if hotkeyText then - hotkeyText = hotkeyText:gsub('SHIFT%-', "S") - hotkeyText = hotkeyText:gsub('ALT%-', "A") - hotkeyText = hotkeyText:gsub('CTRL%-', "C") - hotkeyText = hotkeyText:gsub('BUTTON', "B") - hotkeyText = hotkeyText:gsub('MOUSEWHEELUP', "WU") - hotkeyText = hotkeyText:gsub('MOUSEWHEELDOWN', "WD") - hotkeyText = hotkeyText:gsub('NUMPAD', "N") - hotkeyText = hotkeyText:gsub('PAGEUP', "PgU") - hotkeyText = hotkeyText:gsub('PAGEDOWN', "PgD") - hotkeyText = hotkeyText:gsub('SPACE', "SP") - hotkeyText = hotkeyText:gsub('INSERT', "INS") - hotkeyText = hotkeyText:gsub('HOME', "HM") - hotkeyText = hotkeyText:gsub('DELETE', "DEL") - hotkeyText = hotkeyText:gsub('NMULTIPLY', "N*") - hotkeyText = hotkeyText:gsub('NMINUS', "N-") - hotkeyText = hotkeyText:gsub('NPLUS', "N+") - hotkey:SetText(hotkeyText) - end - hotkey:ClearAllPoints() - hotkey:SetAllPoints() -end - -local function Pinpoint(parent) - local centerX,centerY = parent:GetCenter() - local screenWidth = GetScreenWidth() - local screenHeight = GetScreenHeight() - local result; - if not centerX or not centerY then - return "CENTER" - end - local heightTop = screenHeight * 0.75; - local heightBottom = screenHeight * 0.25; - local widthLeft = screenWidth * 0.25; - local widthRight = screenWidth * 0.75; - if(((centerX > widthLeft) and (centerX < widthRight)) and (centerY > heightTop)) then - result="TOP" - elseif((centerX < widthLeft) and (centerY > heightTop)) then - result="TOPLEFT" - elseif((centerX > widthRight) and (centerY > heightTop)) then - result="TOPRIGHT" - elseif(((centerX > widthLeft) and (centerX < widthRight)) and centerY < heightBottom) then - result="BOTTOM" - elseif((centerX < widthLeft) and (centerY < heightBottom)) then - result="BOTTOMLEFT" - elseif((centerX > widthRight) and (centerY < heightBottom)) then - result="BOTTOMRIGHT" - elseif((centerX < widthLeft) and (centerY > heightBottom) and (centerY < heightTop)) then - result="LEFT" - elseif((centerX > widthRight) and (centerY < heightTop) and (centerY > heightBottom)) then - result="RIGHT" - else - result="CENTER" - end - return result -end - -local function SaveActionButton(parent) - local button = parent:GetName() - local cooldown = _G[button.."Cooldown"] - cooldown.SizeOverride = SV.db.SVBar.cooldownSize - if(not parent.cd) then - parent.cd = cooldown; - end - MOD:FixKeybindText(parent) - MOD.ButtonCache[parent] = true - parent:SetSlotTemplate(true, 2, 0, 0, 0.75, true) - parent:SetCheckedTexture("") -end - -local function SetFlyoutButton(button) - if not button or not button.FlyoutArrow or not button.FlyoutArrow:IsShown() or not button.FlyoutBorder then return end - local LOCKDOWN = InCombatLockdown() - button.FlyoutBorder:SetAlpha(0) - button.FlyoutBorderShadow:SetAlpha(0) - SpellFlyoutHorizontalBackground:SetAlpha(0) - SpellFlyoutVerticalBackground:SetAlpha(0) - SpellFlyoutBackgroundEnd:SetAlpha(0) - for i = 1, GetNumFlyouts()do - local id = GetFlyoutID(i) - local _, _, max, check = GetFlyoutInfo(id) - if check then - maxFlyoutCount = max; - break - end - end - local offset = 0; - if SpellFlyout:IsShown() and SpellFlyout:GetParent() == button or GetMouseFocus() == button then offset = 5 else offset = 2 end - if button:GetParent() and button:GetParent():GetParent() and button:GetParent():GetParent():GetName() and button:GetParent():GetParent():GetName() == "SpellBookSpellIconsFrame" then return end - if button:GetParent() then - local point = Pinpoint(button:GetParent()) - if point:find("RIGHT") then - button.FlyoutArrow:ClearAllPoints() - button.FlyoutArrow:SetPoint("LEFT", button, "LEFT", -offset, 0) - SetClampedTextureRotation(button.FlyoutArrow, 270) - if not LOCKDOWN then - button:SetAttribute("flyoutDirection", "LEFT") - end - elseif point:find("LEFT") then - button.FlyoutArrow:ClearAllPoints() - button.FlyoutArrow:SetPoint("RIGHT", button, "RIGHT", offset, 0) - SetClampedTextureRotation(button.FlyoutArrow, 90) - if not LOCKDOWN then - button:SetAttribute("flyoutDirection", "RIGHT") - end - elseif point:find("TOP") then - button.FlyoutArrow:ClearAllPoints() - button.FlyoutArrow:SetPoint("BOTTOM", button, "BOTTOM", 0, -offset) - SetClampedTextureRotation(button.FlyoutArrow, 180) - if not LOCKDOWN then - button:SetAttribute("flyoutDirection", "DOWN") - end - elseif point == "CENTER" or point:find("BOTTOM") then - button.FlyoutArrow:ClearAllPoints() - button.FlyoutArrow:SetPoint("TOP", button, "TOP", 0, offset) - SetClampedTextureRotation(button.FlyoutArrow, 0) - if not LOCKDOWN then - button:SetAttribute("flyoutDirection", "UP") - end - end - end -end - -local function ModifyActionButton(parent) - local button = parent:GetName() - local icon = _G[button.."Icon"] - local count = _G[button.."Count"] - local flash = _G[button.."Flash"] - local hotkey = _G[button.."HotKey"] - local border = _G[button.."Border"] - local normal = _G[button.."NormalTexture"] - local cooldown = _G[button.."Cooldown"] - local parentTex = parent:GetNormalTexture() - local shine = _G[button.."Shine"] - local highlight = parent:GetHighlightTexture() - local pushed = parent:GetPushedTexture() - local checked = parent:GetCheckedTexture() - if cooldown then - cooldown.SizeOverride = SV.db.SVBar.cooldownSize - --cooldown:SetAlpha(0) - end - if highlight then - highlight:SetTexture(1,1,1,.2) - end - if pushed then - pushed:SetTexture(0,0,0,.4) - end - if checked then - checked:SetTexture(1,1,1,.2) - end - if flash then - flash:SetTexture(0,0,0,0) - end - if normal then - normal:SetTexture(0,0,0,0) - normal:Hide() - normal:SetAlpha(0) - end - if parentTex then - parentTex:SetTexture(0,0,0,0) - parentTex:Hide() - parentTex:SetAlpha(0) - end - if border then border:Die()end - if count then - count:ClearAllPoints() - count:SetPoint("BOTTOMRIGHT",1,1) - count:SetShadowOffset(1,-1) - count:FontManager(LSM:Fetch("font",SV.db.SVBar.countFont),SV.db.SVBar.countFontSize,SV.db.SVBar.countFontOutline) - end - if icon then - icon:SetTexCoord(.1,.9,.1,.9) - --icon:SetGradient("VERTICAL",.5,.5,.5,1,1,1) - icon:FillInner(button) - end - if shine then shine:SetAllPoints()end - if SV.db.SVBar.hotkeytext then - hotkey:ClearAllPoints() - hotkey:SetAllPoints() - hotkey:FontManager(LSM:Fetch("font",SV.db.SVBar.font),SV.db.SVBar.fontSize,SV.db.SVBar.fontOutline) - hotkey:SetJustifyH("RIGHT") - hotkey:SetJustifyV("TOP") - hotkey:SetShadowOffset(1,-1) - end - -- if parent.style then - -- parent.style:SetDrawLayer('BACKGROUND',-7) - -- end - parent.FlyoutUpdateFunc = SetFlyoutButton; - MOD:FixKeybindText(parent) -end - -do - local SpellFlyoutButton_OnEnter = function(self) - local parent = self:GetParent() - local anchor = select(2, parent:GetPoint()) - if not MOD.ButtonCache[anchor] then return end - local anchorParent = anchor:GetParent() - if anchorParent._fade then - local alpha = anchorParent._alpha - local actual = anchorParent:GetAlpha() - SV:SecureFadeIn(anchorParent, 0.2, actual, alpha) - end - end - - local SpellFlyoutButton_OnLeave = function(self) - local parent = self:GetParent() - local anchor = select(2, parent:GetPoint()) - if not MOD.ButtonCache[anchor] then return end - local anchorParent = anchor:GetParent() - if anchorParent._fade then - local actual = anchorParent:GetAlpha() - SV:SecureFadeOut(anchorParent, 1, actual, 0) - end - end - - local SpellFlyout_OnEnter = function(self) - local anchor = select(2,self:GetPoint()) - if not MOD.ButtonCache[anchor] then return end - local anchorParent = anchor:GetParent() - if anchorParent._fade then - Bar_OnEnter(anchorParent) - end - end - - local SpellFlyout_OnLeave = function(self) - local anchor = select(2, self:GetPoint()) - if not MOD.ButtonCache[anchor] then return end - local anchorParent=anchor:GetParent() - if anchorParent._fade then - Bar_OnLeave(anchorParent) - end - end - - local SpellFlyout_OnShow = function() - for i=1,maxFlyoutCount do - local name = ("SpellFlyoutButton%s"):format(i) - local button = _G[name] - if(button) then - ModifyActionButton(button) - SaveActionButton(button) - - button:HookScript('OnEnter', SpellFlyoutButton_OnEnter) - - button:HookScript('OnLeave', SpellFlyoutButton_OnLeave) - end - end - SpellFlyout:HookScript('OnEnter', SpellFlyout_OnEnter) - SpellFlyout:HookScript('OnLeave', SpellFlyout_OnLeave) - end - - local QualifyFlyouts = function() - if InCombatLockdown() then return end - for button,_ in pairs(MOD.ButtonCache)do - if(button and button.FlyoutArrow) then - SetFlyoutButton(button) - end - end - end - - function SetSpellFlyoutHook() - SpellFlyout:HookScript("OnShow",SpellFlyout_OnShow); - SV.Timers:ExecuteTimer(QualifyFlyouts, 5) - end -end ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -function MOD:UpdateBarBindings(pet, stance) - if stance == true then - local bar = _G["SVUI_StanceBar"] - local bindText = bar.binding - - for i=1,NUM_STANCE_SLOTS do - local name = ("SVUI_StanceBarButton%s"):format(i) - local hkname = ("SVUI_StanceBarButton%sHotKey"):format(i) - local hotkey = _G[hkname] - if SV.db.SVBar.hotkeytext then - local key = bindText:format(i); - local binding = GetBindingKey(key) - hotkey:Show() - hotkey:SetText(binding) - MOD:FixKeybindText(_G[name]) - else - hotkey:Hide() - end - end - end - if pet == true then - local bar = _G["SVUI_PetActionBar"] - local bindText = bar.binding - - for i=1,NUM_PET_ACTION_SLOTS do - local name = ("PetActionButton%s"):format(i) - local hkname = ("PetActionButton%sHotKey"):format(i) - local hotkey = _G[hkname] - if SV.db.SVBar.hotkeytext then - local key = bindText:format(i); - local binding = GetBindingKey(key) - hotkey:Show() - hotkey:SetText(binding) - MOD:FixKeybindText(_G[name]) - else - hotkey:Hide() - end - end - end -end - -function MOD:UpdateAllBindings(event) - if event == "UPDATE_BINDINGS" then - MOD:UpdateBarBindings(true,true) - end - MOD:UnregisterEvent("PLAYER_REGEN_DISABLED") - if InCombatLockdown() then return end - for i = 1, 6 do - local barName = ("SVUI_ActionBar%d"):format(i) - local bar = _G[barName] - if(bar and bar.buttons) then - local thisBinding = bar.binding - - ClearOverrideBindings(bar) - - for k = 1,#bar.buttons do - local binding = thisBinding:format(k); - local btn = ("%sButton%d"):format(barName, k); - for x = 1,select('#',GetBindingKey(binding)) do - local key = select(x, GetBindingKey(binding)) - if (key and key ~= "") then - SetOverrideBindingClick(bar, false, key, btn) - end - end - end - end - end -end - -function MOD:SetBarConfigData(bar) - local db = SV.db.SVBar - local thisBinding = bar.binding; - local buttonList = bar.buttons; - local config = bar.config - config.hideElements.macro = db.macrotext; - config.hideElements.hotkey = db.hotkeytext; - config.showGrid = db.showGrid; - config.clickOnDown = db.keyDown; - config.colors.range = db.unc - config.colors.mana = db.unpc - config.colors.hp = db.unpc - SetModifiedClick("PICKUPACTION", db.unlock) - for i,button in pairs(buttonList)do - if thisBinding then - config.keyBoundTarget = thisBinding:format(i) - end - button.keyBoundTarget = config.keyBoundTarget; - button.postKeybind = self.FixKeybindText; - button:SetAttribute("buttonlock",true) - button:SetAttribute("checkselfcast",true) - button:SetAttribute("checkfocuscast",true) - button:UpdateConfig(config) - end -end - -function MOD:UpdateBarPagingDefaults() - local parse, custom; - if SV.db.SVBar.Bar6.enable then - parse = "[vehicleui,mod:alt,mod:ctrl] %d; [possessbar] %d; [overridebar] %d; [form,noform] 0; [shapeshift] 13; [bar:3] 3; [bar:4] 4; [bar:5] 5; [bar:6] 6; %s"; - else - parse = "[vehicleui,mod:alt,mod:ctrl] %d; [possessbar] %d; [overridebar] %d; [form,noform] 0; [shapeshift] 13; [bar:2] 2; [bar:3] 3; [bar:4] 4; [bar:5] 5; [bar:6] 6; %s"; - end - - local mainbar = _G["SVUI_ActionBar1"] - if(mainbar) then - if SV.db.SVBar.Bar1.useCustomPaging then - custom = SV.db.SVBar.Bar1.customPaging[SV.class]; - else - custom = "" - end - - mainbar.conditions = parse:format(GetVehicleBarIndex(), GetVehicleBarIndex(), GetOverrideBarIndex(), custom); - end - - for i=2, 6 do - local id = ("Bar%d"):format(i) - local bar = _G["SVUI_Action" .. id] - if(bar and SV.db.SVBar[id].useCustomPaging) then - bar.conditions = SV.db.SVBar[id].customPaging[SV.class]; - end - end - - if((not SV.db.SVBar.enable or InCombatLockdown()) or not self.isInitialized) then return end - local Bar2Option = InterfaceOptionsActionBarsPanelBottomRight - local Bar3Option = InterfaceOptionsActionBarsPanelBottomLeft - local Bar4Option = InterfaceOptionsActionBarsPanelRightTwo - local Bar5Option = InterfaceOptionsActionBarsPanelRight - - if (SV.db.SVBar.Bar2.enable and not Bar2Option:GetChecked()) or (not SV.db.SVBar.Bar2.enable and Bar2Option:GetChecked()) then - Bar2Option:Click() - end - - if (SV.db.SVBar.Bar3.enable and not Bar3Option:GetChecked()) or (not SV.db.SVBar.Bar3.enable and Bar3Option:GetChecked()) then - Bar3Option:Click() - end - - if not SV.db.SVBar.Bar5.enable and not SV.db.SVBar.Bar4.enable then - if Bar4Option:GetChecked() then - Bar4Option:Click() - end - - if Bar5Option:GetChecked() then - Bar5Option:Click() - end - elseif not SV.db.SVBar.Bar5.enable then - if not Bar5Option:GetChecked() then - Bar5Option:Click() - end - - if not Bar4Option:GetChecked() then - Bar4Option:Click() - end - elseif (SV.db.SVBar.Bar4.enable and not Bar4Option:GetChecked()) or (not SV.db.SVBar.Bar4.enable and Bar4Option:GetChecked()) then - Bar4Option:Click() - elseif (SV.db.SVBar.Bar5.enable and not Bar5Option:GetChecked()) or (not SV.db.SVBar.Bar5.enable and Bar5Option:GetChecked()) then - Bar5Option:Click() - end -end ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -do - local Button_OnEnter = function(self) - local parent = self:GetParent() - if parent and parent._fade then - if(self.cd) then - self.cd:SetSwipeColor(0, 0, 0, 1) - self.cd:SetDrawBling(true) - end - SV:SecureFadeIn(parent, 0.2, parent:GetAlpha(), parent._alpha) - end - end - - local Button_OnLeave = function(self) - local parent = self:GetParent() - GameTooltip:Hide() - if parent and parent._fade then - if(self.cd) then - self.cd:SetSwipeColor(0, 0, 0, 0) - self.cd:SetDrawBling(false) - end - SV:SecureFadeOut(parent, 1, parent:GetAlpha(), 0) - end - end - - local function _refreshButtons(bar, id, max, space, cols, totalButtons, size, point, selfcast) - if InCombatLockdown() then return end - if not bar then return end - local hideByScale = id == "Pet" and true or false; - local isStance = id == "Stance" and true or false; - local button,lastButton,lastRow; - for i=1, max do - button = bar.buttons[i] - lastButton = bar.buttons[i - 1] - lastRow = bar.buttons[i - cols] - button:SetParent(bar) - button:ClearAllPoints() - button:Size(size) - button:SetAttribute("showgrid",1) - - if(selfcast) then - button:SetAttribute("unit2", "player") - end - - if(bar._fade) then - if button.cd then - button.cd:SetSwipeColor(0, 0, 0, 0) - button.cd:SetDrawBling(false) - end - else - if button.cd then - button.cd:SetSwipeColor(0, 0, 0, 1) - button.cd:SetDrawBling(true) - end - end - - if(not button._hookFade) then - button:HookScript('OnEnter', Button_OnEnter) - button:HookScript('OnLeave', Button_OnLeave) - button._hookFade = true; - end - - local x,y,anchor1,anchor2; - - if(i == 1) then - x, y = 0, 0 - if(point:find("BOTTOM")) then - y = space - elseif(point:find("TOP")) then - y = -space - end - if(point:find("RIGHT")) then - x = -space - elseif(point:find("LEFT")) then - x = space - end - button:Point(point,bar,point,x,y) - elseif((i - 1) % cols == 0) then - x, y = 0, -space - anchor1, anchor2 = "TOP", "BOTTOM" - if(point:find("BOTTOM")) then - y = space; - anchor1 = "BOTTOM" - anchor2 = "TOP" - end - button:Point(anchor1,lastRow,anchor2,x,y) - else - x, y = space, 0 - anchor1, anchor2 = "LEFT", "RIGHT"; - if(point:find("RIGHT")) then - x = -space; - anchor1 = "RIGHT" - anchor2 = "LEFT" - end - button:Point(anchor1,lastButton,anchor2,x,y) - end - - if(i > totalButtons) then - if hideByScale then - button:SetScale(0.000001) - button:SetAlpha(0) - else - button:Hide() - end - if button.cd then - button.cd:SetSwipeColor(0, 0, 0, 0) - button.cd:SetDrawBling(false) - end - else - if hideByScale then - button:SetScale(1) - button:SetAlpha(1) - else - button:Show() - end - if button.cd then - button.cd:SetSwipeColor(0, 0, 0, 1) - button.cd:SetDrawBling(true) - end - end - - if (not isStance or (isStance and not button.FlyoutUpdateFunc)) then - ModifyActionButton(button); - SaveActionButton(button); - end - end - end - - local function _getPage(bar, defaultPage, condition) - local page = SV.db.SVBar[bar].customPaging[SV.class] - if not condition then condition = '' end - if not page then page = '' end - if page then - condition = condition.." "..page - end - condition = condition.." "..defaultPage - return condition - end - - function MOD:RefreshBar(id) - if(InCombatLockdown()) then return end - - local bar - local isPet, isStance = false, false - local db = SV.db.SVBar[id] - - if(id == "Pet") then - bar = _G["SVUI_PetActionBar"] - isPet = true - elseif(id == "Stance") then - bar = _G["SVUI_StanceBar"] - isStance = true - else - bar = _G[("SVUI_Action%s"):format(id)] - end - - if(not bar or not db) then return end - - local selfcast = db.rightClickSelf - local space = db.buttonspacing; - local cols = db.buttonsPerRow; - local size = db.buttonsize; - local point = db.point; - local barVisibility = db.customVisibility; - local totalButtons = db.buttons; - local max = (isStance and GetNumShapeshiftForms()) or (isPet and 10) or NUM_ACTIONBAR_BUTTONS; - local rows = ceil(totalButtons / cols); - - if max < cols then cols = max end - if rows < 1 then rows = 1 end - - bar:Width(space + (size * cols) + ((space * (cols - 1)) + space)); - bar:Height((space + (size * rows)) + ((space * (rows - 1)) + space)); - bar.backdrop:ClearAllPoints() - bar.backdrop:SetAllPoints() - bar._fade = db.mouseover; - bar._alpha = db.alpha; - - if db.backdrop == true then - bar.backdrop:Show() - else - bar.backdrop:Hide() - end - - if(not bar._hookFade) then - bar:HookScript('OnEnter', Bar_OnEnter) - bar:HookScript('OnLeave', Bar_OnLeave) - bar._hookFade = true; - end - - if(db.mouseover == true) then - bar:SetAlpha(0) - bar._fade = true - else - bar:SetAlpha(db.alpha) - bar._fade = false - end - - _refreshButtons(bar, id, max, space, cols, totalButtons, size, point, selfcast); - - if(isPet or isStance) then - if db.enable then - bar:SetScale(1) - bar:SetAlpha(db.alpha) - if(db.mouseover == true) then - bar:SetAlpha(0) - else - bar:SetAlpha(db.alpha) - end - RegisterStateDriver(bar, "visibility", barVisibility) - else - bar:SetScale(0.000001) - bar:SetAlpha(0) - UnregisterStateDriver(bar, "visibility") - end - --RegisterStateDriver(bar, "show", barVisibility) - else - local p,c = bar.page, bar.conditions - local page = _getPage(id, p, c) - if c:find("[form, noform]") then - bar:SetAttribute("hasTempBar", true) - local newCondition = c:gsub(" %[form, noform%] 0; ", ""); - bar:SetAttribute("newCondition", newCondition) - else - bar:SetAttribute("hasTempBar", false) - end - - RegisterStateDriver(bar, "page", page) - if not bar.ready then - bar.ready = true; - self:RefreshBar(id) - return - end - - if db.enable == true then - bar:Show() - RegisterStateDriver(bar, "visibility", barVisibility) - else - bar:Hide() - UnregisterStateDriver(bar, "visibility") - end - SV.Mentalo:ChangeSnapOffset(("SVUI_Action%d_MOVE"):format(id), (space / 2)) - end - end -end - -function MOD:RefreshActionBars() - if(InCombatLockdown()) then self:RegisterEvent("PLAYER_REGEN_ENABLED"); return end - self:UpdateBarPagingDefaults() - for button, _ in pairs(self.ButtonCache)do - if button then - ModifyActionButton(button) - SaveActionButton(button) - if(button.FlyoutArrow) then - SetFlyoutButton(button) - end - else - self.ButtonCache[button] = nil - end - end - - local id, bar - for i = 1, 6 do - id = ("Bar%d"):format(i) - bar = _G[("SVUI_Action%s"):format(id)] - self:RefreshBar(id) - self:SetBarConfigData(bar) - end - - self:RefreshBar("Pet") - self:RefreshBar("Stance") - self:UpdateBarBindings(true, true) - - collectgarbage("collect"); -end - -local Vehicle_Updater = function() - local bar = _G["SVUI_ActionBar1"] - local space = SV.db.SVBar["Bar1"].buttonspacing - local total = SV.db.SVBar["Bar1"].buttons; - local rows = SV.db.SVBar["Bar1"].buttonsPerRow; - local size = SV.db.SVBar["Bar1"].buttonsize - local point = SV.db.SVBar["Bar1"].point; - local columns = ceil(total / rows) - if (HasOverrideActionBar() or HasVehicleActionBar()) and total == 12 then - bar.backdrop:ClearAllPoints() - bar.backdrop:Point(SV.db.SVBar["Bar1"].point, bar, SV.db.SVBar["Bar1"].point) - bar.backdrop:Width(space + ((size * rows) + (space * (rows - 1)) + space)) - bar.backdrop:Height(space + ((size * columns) + (space * (columns - 1)) + space)) - bar.backdrop:SetFrameLevel(0); - else - bar.backdrop:SetAllPoints() - bar.backdrop:SetFrameLevel(0); - end - MOD:RefreshBar("Bar1") -end ---[[ -########################################################## -HOOKED / REGISTERED FUNCTIONS -########################################################## -]]-- -local SVUIOptionsPanel_OnEvent = function() - InterfaceOptionsActionBarsPanelBottomRight.Text:SetText((L['Remove Bar %d Action Page']):format(2)) - InterfaceOptionsActionBarsPanelBottomLeft.Text:SetText((L['Remove Bar %d Action Page']):format(3)) - InterfaceOptionsActionBarsPanelRightTwo.Text:SetText((L['Remove Bar %d Action Page']):format(4)) - InterfaceOptionsActionBarsPanelRight.Text:SetText((L['Remove Bar %d Action Page']):format(5)) - InterfaceOptionsActionBarsPanelBottomRight:SetScript('OnEnter',nil) - InterfaceOptionsActionBarsPanelBottomLeft:SetScript('OnEnter',nil) - InterfaceOptionsActionBarsPanelRightTwo:SetScript('OnEnter',nil) - InterfaceOptionsActionBarsPanelRight:SetScript('OnEnter',nil) -end - -local SVUIButton_ShowOverlayGlow = function(self) - if not self.overlay then return end - local size = self:GetWidth() / 3; - self.overlay:WrapOuter(self, size) -end - -local ResetAllBindings = function(self) - if InCombatLockdown() then return end - - local bar - for i = 1, 6 do - bar = _G[("SVUI_ActionBar%d"):format(i)] - if(bar) then - ClearOverrideBindings(bar) - end - end - - ClearOverrideBindings(_G["SVUI_PetActionBar"]) - ClearOverrideBindings(_G["SVUI_StanceBar"]) - - self:RegisterEvent("PLAYER_REGEN_DISABLED", "UpdateAllBindings") -end ---[[ -########################################################## -BAR CREATION -########################################################## -]]-- -local CreateActionBars, CreateStanceBar, CreatePetBar, CreateMicroBar; -local barBindingIndex = { - "ACTIONBUTTON%d", - "MULTIACTIONBAR2BUTTON%d", - "MULTIACTIONBAR1BUTTON%d", - "MULTIACTIONBAR4BUTTON%d", - "MULTIACTIONBAR3BUTTON%d", - "SVUIACTIONBAR6BUTTON%d" -} -local barPageIndex = {1, 5, 6, 4, 3, 2} - -CreateActionBars = function(self) - for i = 1, 6 do - local barID = ("Bar%d"):format(i) - local barName = ("SVUI_Action%s"):format(barID) - local buttonMax = NUM_ACTIONBAR_BUTTONS - - local space = SV.db.SVBar["Bar"..i].buttonspacing - - local thisBar = NewActionBar(barName) - thisBar.binding = barBindingIndex[i] - thisBar.page = barPageIndex[i] - - if(i == 1) then - thisBar:Point("BOTTOM", SV.Screen, "BOTTOM", 0, 28) - elseif(i == 2) then - thisBar:Point("BOTTOM", _G["SVUI_ActionBar1"], "TOP", 0, -space) - elseif(i == 3) then - thisBar:Point("BOTTOMLEFT", _G["SVUI_ActionBar1"], "BOTTOMRIGHT", space, 0) - elseif(i == 4) then - thisBar:Point("RIGHT", SV.Screen, "RIGHT", -space, 0) - elseif(i == 5) then - thisBar:Point("BOTTOMRIGHT", _G["SVUI_ActionBar1"], "BOTTOMLEFT", -space, 0) - else - thisBar:Point("BOTTOM", _G["SVUI_ActionBar2"], "TOP", 0, space) - end - - local bg = CreateFrame("Frame", nil, thisBar) - bg:SetAllPoints() - bg:SetFrameLevel(0) - thisBar:SetFrameLevel(5) - bg:SetPanelTemplate("Component") - bg:SetPanelColor("dark") - thisBar.backdrop = bg - - for k = 1, buttonMax do - local buttonName = ("%sButton%d"):format(barName, k) - thisBar.buttons[k] = NewActionButton(thisBar, k, buttonName) - thisBar.buttons[k]:SetState(0, "action", k) - for x = 1, 14 do - local calc = (x - 1) * buttonMax + k; - thisBar.buttons[k]:SetState(x, "action", calc) - end - if k == 12 then - thisBar.buttons[k]:SetState(12, "custom", { - func = function(...) - if UnitExists("vehicle") then - VehicleExit() - else - PetDismiss() - end - end, - texture = "Interface\\Vehicles\\UI-Vehicles-Button-Exit-Down", - tooltip = LEAVE_VEHICLE - }); - end - end - - self:SetBarConfigData(thisBar) - - if i == 1 then - thisBar:SetAttribute("hasTempBar", true) - else - thisBar:SetAttribute("hasTempBar", false) - end - - thisBar:SetAttribute("_onstate-page", [[ - if HasTempShapeshiftActionBar() and self:GetAttribute("hasTempBar") then - newstate = GetTempShapeshiftBarIndex() or newstate - end - - if newstate ~= 0 then - self:SetAttribute("state", newstate) - control:ChildUpdate("state", newstate) - else - local newCondition = self:GetAttribute("newCondition") - if newCondition then - newstate = SecureCmdOptionParse(newCondition) - self:SetAttribute("state", newstate) - control:ChildUpdate("state", newstate) - end - end - ]]) - - self:RefreshBar(barID) - SV.Mentalo:Add(thisBar, L[barID]) - end -end - -do - local function SetStanceBarButtons() - local maxForms = GetNumShapeshiftForms(); - local currentForm = GetShapeshiftForm(); - local maxButtons = NUM_STANCE_SLOTS; - local texture, name, isActive, isCastable, _; - for i = 1, maxButtons do - local button = _G["SVUI_StanceBarButton"..i] - local icon = _G["SVUI_StanceBarButton"..i.."Icon"] - if i <= maxForms then - texture, name, isActive, isCastable = GetShapeshiftFormInfo(i) - if texture == "Interface\\Icons\\Spell_Nature_WispSplode" and SV.db.SVBar.Stance.style == "darkenInactive" then - _, _, texture = GetSpellInfo(name) - end - - icon:SetTexture(texture) - - if(button.cd) then - if texture then - button.cd:SetAlpha(1) - button.cd:SetSwipeColor(0, 0, 0, 1) - button.cd:SetDrawBling(true) - else - button.cd:SetAlpha(0) - button.cd:SetSwipeColor(0, 0, 0, 0) - button.cd:SetDrawBling(false) - end - end - - if isActive then - StanceBarFrame.lastSelected = button:GetID() - - if maxForms > 1 then - if button.checked then button.checked:SetTexture(0, 0.5, 0, 0.2) end - button:SetBackdropBorderColor(0.4, 0.8, 0) - end - icon:SetVertexColor(1, 1, 1) - button:SetChecked(true) - else - if maxForms > 1 and currentForm > 0 then - button:SetBackdropBorderColor(0, 0, 0) - if button.checked then - button.checked:SetAlpha(1) - end - if SV.db.SVBar.Stance.style == "darkenInactive" then - icon:SetVertexColor(0.25, 0.25, 0.25) - else - icon:SetVertexColor(1, 1, 1) - end - end - - button:SetChecked(false) - end - if isCastable then - icon:SetDesaturated(false) - button:SetAlpha(1) - else - icon:SetDesaturated(true) - button:SetAlpha(0.4) - end - end - end - end - - local function UpdateShapeshiftForms(self, event) - if InCombatLockdown() or not _G["SVUI_StanceBar"] then return end - - local stanceBar = _G["SVUI_StanceBar"]; - - for i = 1, #stanceBar.buttons do - stanceBar.buttons[i]:Hide() - end - - local ready = false; - local maxForms = GetNumShapeshiftForms() - - for i = 1, NUM_STANCE_SLOTS do - if(not stanceBar.buttons[i]) then - stanceBar.buttons[i] = CreateFrame("CheckButton", format("SVUI_StanceBarButton%d", i), stanceBar, "StanceButtonTemplate") - stanceBar.buttons[i]:SetID(i) - ready = true - end - if(i <= maxForms) then - stanceBar.buttons[i]:Show() - else - stanceBar.buttons[i]:Hide() - end - end - - MOD:RefreshBar("Stance") - - SetStanceBarButtons() - if not C_PetBattles.IsInBattle() or ready then - if maxForms == 0 then - UnregisterStateDriver(stanceBar, "show") - stanceBar:Hide() - else - stanceBar:Show() - RegisterStateDriver(stanceBar, "show", "[petbattle] hide;show") - end - end - end - - local function UpdateShapeshiftCD() - local maxForms = GetNumShapeshiftForms() - for i = 1, NUM_STANCE_SLOTS do - if i <= maxForms then - local cooldown = _G["SVUI_StanceBarButton"..i.."Cooldown"] - local start, duration, enable = GetShapeshiftFormCooldown(i) - CooldownFrame_SetTimer(cooldown, start, duration, enable) - end - end - end - - CreateStanceBar = function(self) - local barID = "Stance"; - local parent = _G["SVUI_ActionBar1"] - local maxForms = GetNumShapeshiftForms(); - if SV.db.SVBar["Bar2"].enable then - parent = _G["SVUI_ActionBar2"] - end - - local stanceBar = NewActionBar("SVUI_StanceBar") - stanceBar.binding = "CLICK SVUI_StanceBarButton%d:LeftButton" - - stanceBar:Point("BOTTOMRIGHT",parent,"TOPRIGHT",0,2); - stanceBar:SetFrameLevel(5); - - local bg = CreateFrame("Frame", nil, stanceBar) - bg:SetAllPoints(); - bg:SetFrameLevel(0); - bg:SetPanelTemplate("Component") - bg:SetPanelColor("dark") - stanceBar.backdrop = bg; - - for i = 1, NUM_STANCE_SLOTS do - stanceBar.buttons[i] = _G["SVUI_StanceBarButton"..i] - end - - stanceBar:SetAttribute("_onstate-show", [[ - if newstate == "hide" then - self:Hide(); - else - self:Show(); - end - ]]); - - self:RegisterEvent("UPDATE_SHAPESHIFT_FORMS", UpdateShapeshiftForms) - self:RegisterEvent("UPDATE_SHAPESHIFT_COOLDOWN", UpdateShapeshiftCD) - self:RegisterEvent("UPDATE_SHAPESHIFT_USABLE", SetStanceBarButtons) - self:RegisterEvent("UPDATE_SHAPESHIFT_FORM", SetStanceBarButtons) - self:RegisterEvent("ACTIONBAR_PAGE_CHANGED", SetStanceBarButtons) - UpdateShapeshiftForms() - SV.Mentalo:Add(stanceBar, L["Stance Bar"], -3) - self:RefreshBar("Stance") - SetStanceBarButtons() - self:UpdateBarBindings(false, true) - end -end - -do - local RefreshPet = function(self, event, arg) - if event == "UNIT_AURA" and arg ~= "pet" then return end - for i = 1, NUM_PET_ACTION_SLOTS, 1 do - local name = "PetActionButton"..i; - local button = _G[name] - local icon = _G[name.."Icon"] - local auto = _G[name.."AutoCastable"] - local shine = _G[name.."Shine"] - local checked = button:GetCheckedTexture() - local actionName, subtext, actionIcon, isToken, isActive, autoCastAllowed, autoCastEnabled = GetPetActionInfo(i) - button:SetChecked(false) - button:SetBackdropBorderColor(0, 0, 0) - checked:SetAlpha(0) - if(not isToken) then - icon:SetTexture(actionIcon) - button.tooltipName = actionName - else - icon:SetTexture(_G[actionIcon]) - button.tooltipName = _G[actionName] - end - button.isToken = isToken; - button.tooltipSubtext = subtext; - if arg and actionName ~= "PET_ACTION_FOLLOW" then - if(IsPetAttackAction(i)) then PetActionButton_StartFlash(button) end - else - if(IsPetAttackAction(i)) then PetActionButton_StopFlash(button) end - end - if autoCastAllowed then - auto:Show() - else - auto:Hide() - end - if (isActive and actionName ~= "PET_ACTION_FOLLOW") then - button:SetChecked(true) - checked:SetAlpha(1) - button:SetBackdropBorderColor(0.4, 0.8, 0) - else - button:SetChecked(false) - checked:SetAlpha(0) - button:SetBackdropBorderColor(0, 0, 0) - end - if(autoCastEnabled) then - AutoCastShine_AutoCastStart(shine) - else - AutoCastShine_AutoCastStop(shine) - end - button:SetAlpha(1) - if actionIcon then - icon:Show() - if GetPetActionSlotUsable(i)then - SetDesaturation(icon, nil) - else - SetDesaturation(icon, 1) - end - if(button.cd) then - button.cd:SetAlpha(1) - button.cd:SetSwipeColor(0, 0, 0, 1) - button.cd:SetDrawBling(true) - end - else - icon:Hide() - if(button.cd) then - button.cd:SetAlpha(0) - button.cd:SetSwipeColor(0, 0, 0, 0) - button.cd:SetDrawBling(false) - end - end - - if(not PetHasActionBar() and actionIcon and actionName ~= "PET_ACTION_FOLLOW") then - PetActionButton_StopFlash(button) - SetDesaturation(icon, 1) - button:SetChecked(false) - end - end - end - - CreatePetBar = function(self) - local barID = "Pet"; - local parent = _G["SVUI_ActionBar1"] - if SV.db.SVBar["Bar2"].enable then - parent = _G["SVUI_ActionBar2"] - end - - local petBar = NewActionBar("SVUI_PetActionBar") - petBar.binding = "BONUSACTIONBUTTON%d" - - petBar:Point("BOTTOMLEFT",parent,"TOPLEFT",0,2); - petBar:SetFrameLevel(5); - local bg = CreateFrame("Frame", nil, petBar) - bg:SetAllPoints(); - bg:SetFrameLevel(0); - bg:SetPanelTemplate("Component") - bg:SetPanelColor("dark") - petBar.backdrop = bg; - for i = 1, NUM_PET_ACTION_SLOTS do - petBar.buttons[i] = _G["PetActionButton"..i] - end - petBar:SetAttribute("_onstate-show", [[ - if newstate == "hide" then - self:Hide(); - else - self:Show(); - end - ]]); - - PetActionBarFrame.showgrid = 1; - PetActionBar_ShowGrid(); - - self:RefreshBar("Pet") - self:UpdateBarBindings(true, false) - - self:RegisterEvent("PLAYER_CONTROL_GAINED", RefreshPet) - self:RegisterEvent("PLAYER_ENTERING_WORLD", RefreshPet) - self:RegisterEvent("PLAYER_CONTROL_LOST", RefreshPet) - self:RegisterEvent("PET_BAR_UPDATE", RefreshPet) - self:RegisterEvent("UNIT_PET", RefreshPet) - self:RegisterEvent("UNIT_FLAGS", RefreshPet) - self:RegisterEvent("UNIT_AURA", RefreshPet) - self:RegisterEvent("PLAYER_FARSIGHT_FOCUS_CHANGED", RefreshPet) - self:RegisterEvent("PET_BAR_UPDATE_COOLDOWN", PetActionBar_UpdateCooldowns) - - SV.Mentalo:Add(petBar, L["Pet Bar"]) - end -end - -CreateMicroBar = function(self) - local buttonSize = SV.db.SVBar.Micro.buttonsize or 30; - local spacing = SV.db.SVBar.Micro.buttonspacing or 1; - local barWidth = (buttonSize + spacing) * 13; - local barHeight = (buttonSize + 6); - local microBar = NewFrame('Frame', 'SVUI_MicroBar', UIParent) - microBar:Size(barWidth, barHeight) - microBar:SetFrameStrata("HIGH") - microBar:SetFrameLevel(0) - microBar:Point('BOTTOMLEFT', SV.Dock.TopLeft.Bar.ToolBar, 'BOTTOMRIGHT', 4, 0) - SV:AddToDisplayAudit(microBar) - - for i=1,13 do - local data = ICON_DATA[i] - if(data) then - local button = _G[data[1]] - if(button) then - button:SetParent(SVUI_MicroBar) - button:Size(buttonSize, buttonSize + 28) - button.Flash:SetTexture(0,0,0,0) - if button.SetPushedTexture then - button:SetPushedTexture("") - end - if button.SetNormalTexture then - button:SetNormalTexture("") - end - if button.SetDisabledTexture then - button:SetDisabledTexture("") - end - if button.SetHighlightTexture then - button:SetHighlightTexture("") - end - button:RemoveTextures() - - local buttonMask = NewFrame("Frame",nil,button) - buttonMask:SetPoint("TOPLEFT",button,"TOPLEFT",0,-28) - buttonMask:SetPoint("BOTTOMRIGHT",button,"BOTTOMRIGHT",0,0) - buttonMask:SetFramedButtonTemplate() - buttonMask:SetPanelColor() - buttonMask.icon = buttonMask:CreateTexture(nil,"OVERLAY",nil,2) - buttonMask.icon:FillInner(buttonMask,2,2) - buttonMask.icon:SetTexture(ICON_FILE) - buttonMask.icon:SetTexCoord(data[2],data[3],data[4],data[5]) - buttonMask.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - button.overlay = buttonMask; - button._fade = SV.db.SVBar.Micro.mouseover - button:HookScript('OnEnter', MicroButton_OnEnter) - button:HookScript('OnLeave', MicroButton_OnLeave) - button:Show() - end - end - end - - MicroButtonPortrait:ClearAllPoints() - MicroButtonPortrait:Hide() - MainMenuBarPerformanceBar:ClearAllPoints() - MainMenuBarPerformanceBar:Hide() - - NewHook('MainMenuMicroButton_SetNormal', SVUIMicroButton_SetNormal) - NewHook('UpdateMicroButtonsParent', SVUIMicroButtonsParent) - NewHook('MoveMicroButtons', RefreshMicrobar) - NewHook('UpdateMicroButtons', MicroButton_OnUpdate) - - SVUIMicroButtonsParent(microBar) - SVUIMicroButton_SetNormal() - - SV.Mentalo:Add(microBar, L["Micro Bar"]) - - RefreshMicrobar() - SVUI_MicroBar:SetAlpha(0) -end - -local CreateExtraBar = function(self) - local specialBarSize = ExtraActionBarFrame:GetSize() - local specialBar = CreateFrame("Frame", "SVUI_SpecialAbility", UIParent) - specialBar:Point("BOTTOM", SV.Screen, "BOTTOM", 0, (275 + specialBarSize)) - specialBar:Size(specialBarSize) - ExtraActionBarFrame:SetParent(specialBar) - ExtraActionBarFrame:ClearAllPoints() - ExtraActionBarFrame:SetPoint("CENTER", specialBar, "CENTER") - ExtraActionBarFrame.ignoreFramePositionManager = true; - local max = ExtraActionBarFrame:GetNumChildren() - for i = 1, max do - local name = ("ExtraActionButton%d"):format(i) - local icon = ("%sIcon"):format(name) - local cool = ("%sCooldown"):format(name) - local button = _G[name] - if(button) then - button.noResize = true; - button.pushed = true; - button.checked = true; - ModifyActionButton(button) - button:SetFixedPanelTemplate() - _G[icon]:SetDrawLayer("ARTWORK") - _G[cool]:FillInner() - local checkedTexture = button:CreateTexture(nil, "OVERLAY") - checkedTexture:SetTexture(0.9, 0.8, 0.1, 0.3) - checkedTexture:FillInner() - button:SetCheckedTexture(checkedTexture) - end - end - if HasExtraActionBar()then - ExtraActionBarFrame:Show() - end - - --local size = DraenorZoneAbilityFrame:GetHeight() - DraenorZoneAbilityFrame:ClearAllPoints() - DraenorZoneAbilityFrame:SetSize(150, 125) - --DraenorZoneAbilityFrame:SetPoint('CENTER', specialBar, 'CENTER') - - SV.Mentalo:Add(specialBar, L["Boss Button"]) -end ---[[ -########################################################## -DEFAULT REMOVAL -########################################################## -]]-- -local function RemoveDefaults() - if(InCombatLockdown()) then - MOD:RegisterEvent("PLAYER_REGEN_ENABLED") - return - end - local removalManager = CreateFrame("Frame") - removalManager:Hide() - MultiBarBottomLeft:SetParent(removalManager) - MultiBarBottomRight:SetParent(removalManager) - MultiBarLeft:SetParent(removalManager) - MultiBarRight:SetParent(removalManager) - - for i = 1, 12 do - local ab = _G[("ActionButton%d"):format(i)] - ab:Hide() - ab:UnregisterAllEvents() - ab:SetAttribute("statehidden", true) - local mbl = _G[("MultiBarLeftButton%d"):format(i)] - mbl:Hide() - mbl:UnregisterAllEvents() - mbl:SetAttribute("statehidden", true) - local mbr = _G[("MultiBarRightButton%d"):format(i)] - mbr:Hide() - mbr:UnregisterAllEvents() - mbr:SetAttribute("statehidden", true) - local mbbl = _G[("MultiBarBottomLeftButton%d"):format(i)] - mbbl:Hide() - mbbl:UnregisterAllEvents() - mbbl:SetAttribute("statehidden", true) - local mbbr = _G[("MultiBarBottomRightButton%d"):format(i)] - mbbr:Hide() - mbbr:UnregisterAllEvents() - mbbr:SetAttribute("statehidden", true) - local mca = _G[("MultiCastActionButton%d"):format(i)] - mca:Hide() - mca:UnregisterAllEvents() - mca:SetAttribute("statehidden", true) - local vb = _G[("VehicleMenuBarActionButton%d"):format(i)] - if(vb) then - vb:Hide() - vb:UnregisterAllEvents() - vb:SetAttribute("statehidden", true) - end - local ob = _G[("OverrideActionBarButton%d"):format(i)] - if(ob) then - ob:Hide() - ob:UnregisterAllEvents() - ob:SetAttribute("statehidden", true) - end - end - - ActionBarController:UnregisterAllEvents() - ActionBarController:RegisterEvent("UPDATE_EXTRA_ACTIONBAR") - - MainMenuBar:EnableMouse(false) - MainMenuBar:SetAlpha(0) - MainMenuExpBar:UnregisterAllEvents() - MainMenuExpBar:Hide() - MainMenuExpBar:SetParent(removalManager) - local maxChildren = MainMenuBar:GetNumChildren(); - for i = 1, maxChildren do - local child = select(i, MainMenuBar:GetChildren()) - if child then - child:UnregisterAllEvents() - child:Hide() - child:SetParent(removalManager) - end - end - ReputationWatchBar:UnregisterAllEvents() - ReputationWatchBar:Hide() - ReputationWatchBar:SetParent(removalManager) - MainMenuBarArtFrame:UnregisterEvent("ACTIONBAR_PAGE_CHANGED") - MainMenuBarArtFrame:UnregisterEvent("ADDON_LOADED") - MainMenuBarArtFrame:Hide() - MainMenuBarArtFrame:SetParent(removalManager) - StanceBarFrame:UnregisterAllEvents() - StanceBarFrame:Hide() - StanceBarFrame:SetParent(removalManager) - OverrideActionBar:UnregisterAllEvents() - OverrideActionBar:Hide() - OverrideActionBar:SetParent(removalManager) - PossessBarFrame:UnregisterAllEvents() - PossessBarFrame:Hide() - PossessBarFrame:SetParent(removalManager) - PetActionBarFrame:UnregisterAllEvents() - PetActionBarFrame:Hide() - PetActionBarFrame:SetParent(removalManager) - MultiCastActionBarFrame:UnregisterAllEvents() - MultiCastActionBarFrame:Hide() - MultiCastActionBarFrame:SetParent(removalManager) - IconIntroTracker:UnregisterAllEvents() - IconIntroTracker:Hide() - IconIntroTracker:SetParent(removalManager) - - InterfaceOptionsCombatPanelActionButtonUseKeyDown:SetScale(0.0001) - InterfaceOptionsCombatPanelActionButtonUseKeyDown:SetAlpha(0) - InterfaceOptionsActionBarsPanelAlwaysShowActionBars:EnableMouse(false) - InterfaceOptionsActionBarsPanelPickupActionKeyDropDownButton:SetScale(0.0001) - InterfaceOptionsActionBarsPanelLockActionBars:SetScale(0.0001) - InterfaceOptionsActionBarsPanelAlwaysShowActionBars:SetAlpha(0) - InterfaceOptionsActionBarsPanelPickupActionKeyDropDownButton:SetAlpha(0) - InterfaceOptionsActionBarsPanelLockActionBars:SetAlpha(0) - InterfaceOptionsActionBarsPanelPickupActionKeyDropDown:SetAlpha(0) - InterfaceOptionsActionBarsPanelPickupActionKeyDropDown:SetScale(0.00001) - InterfaceOptionsStatusTextPanelXP:SetAlpha(0) - InterfaceOptionsStatusTextPanelXP:SetScale(0.00001) - - if PlayerTalentFrame then - PlayerTalentFrame:UnregisterEvent("ACTIVE_TALENT_GROUP_CHANGED") - else - hooksecurefunc("TalentFrame_LoadUI", function() PlayerTalentFrame:UnregisterEvent("ACTIVE_TALENT_GROUP_CHANGED") end) - end - - MOD.DefaultsRemoved = true -end - -function MOD:PLAYER_REGEN_ENABLED() - self:UnregisterEvent("PLAYER_REGEN_ENABLED") - if(not MOD.DefaultsRemoved) then - RemoveDefaults() - end - self:RefreshActionBars() -end ---[[ -########################################################## -BUILD FUNCTION / UPDATE -########################################################## -]]-- -MOD.UpdateMicroButtons = MicroButton_OnUpdate - -function MOD:ReLoad() - self:RefreshActionBars(); -end - -function MOD:Load() - if not SV.db.SVBar.enable then return end - RemoveDefaults(); - - self:UpdateBarPagingDefaults() - - CreateActionBars(self) - CreateStanceBar(self) - CreatePetBar(self) - CreateMicroBar(self) - CreateExtraBar(self) - - self:LoadKeyBinder() - - self:RegisterEvent("UPDATE_BINDINGS", "UpdateAllBindings") - self:RegisterEvent("PET_BATTLE_CLOSE", "UpdateAllBindings") - self:RegisterEvent("PET_BATTLE_OPENING_DONE", ResetAllBindings) - self:RegisterEvent("UPDATE_VEHICLE_ACTIONBAR", Vehicle_Updater) - self:RegisterEvent("UPDATE_OVERRIDE_ACTIONBAR", Vehicle_Updater) - if C_PetBattles.IsInBattle()then - ResetAllBindings(self) - else - self:UpdateAllBindings() - end - NewHook("BlizzardOptionsPanel_OnEvent", SVUIOptionsPanel_OnEvent) - NewHook("ActionButton_ShowOverlayGlow", SVUIButton_ShowOverlayGlow) - if not GetCVarBool("lockActionBars") then SetCVar("lockActionBars", 1) end - SetSpellFlyoutHook() - - self.IsLoaded = true -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/aura/SVAura.lua b/Interface/AddOns/SVUI/packages/aura/SVAura.lua index aedb53b..b5460de 100644 --- a/Interface/AddOns/SVUI/packages/aura/SVAura.lua +++ b/Interface/AddOns/SVUI/packages/aura/SVAura.lua @@ -128,7 +128,7 @@ local function CreateHyperBuff(index) bar:SetMinMaxValues(0, 100) bar:SetValue(0) local bg = bar:CreateTexture(nil, "BACKGROUND", nil, -2) - bg:WrapOuter(buff, 1, 1) + bg:SetAllPointsOut(buff, 1, 1) bg:SetTexture(texture) bg:SetVertexColor(0, 0, 0, 0.5) local empty = bar:CreateTexture(nil, "BACKGROUND", nil, -1) @@ -269,8 +269,6 @@ do end function MOD:CreateIcon(aura) - local font = LSM:Fetch("font", SV.db.SVAura.font) - aura:SetBackdrop({ bgFile = [[Interface\BUTTONS\WHITE8X8]], tile = false, @@ -288,21 +286,21 @@ do aura:SetBackdropBorderColor(0, 0, 0) aura.texture = aura:CreateTexture(nil, "BORDER") - aura.texture:FillInner(aura, 2, 2) + aura.texture:SetAllPointsIn(aura, 2, 2) aura.texture:SetTexCoord(0.1, 0.9, 0.1, 0.9) aura.count = aura:CreateFontString(nil, "ARTWORK") aura.count:SetPoint("BOTTOMRIGHT", (-1 + SV.db.SVAura.countOffsetH), (1 + SV.db.SVAura.countOffsetV)) - aura.count:FontManager(font, SV.db.SVAura.fontSize, SV.db.SVAura.fontOutline) + aura.count:FontManager("aura") aura.time = aura:CreateFontString(nil, "ARTWORK") aura.time:SetPoint("TOP", aura, "BOTTOM", 1 + SV.db.SVAura.timeOffsetH, 0 + SV.db.SVAura.timeOffsetV) - aura.time:FontManager(font, SV.db.SVAura.fontSize, SV.db.SVAura.fontOutline) + aura.time:FontManager("aura") aura.highlight = aura:CreateTexture(nil, "HIGHLIGHT") aura.highlight:SetTexture(BASIC_TEXTURE) aura.highlight:SetVertexColor(1, 1, 1, 0.45) - aura.highlight:FillInner(aura, 2, 2) + aura.highlight:SetAllPointsIn(aura, 2, 2) SV.Animate:Flash(aura) @@ -313,7 +311,6 @@ end do local ConsolidatedBuff_OnUpdate = function(self, current) local expires = (self.expiration - current); - local calc = 0; self.expiration = expires; self.bar:SetValue(expires) if self.nextUpdate > 0 then @@ -325,6 +322,7 @@ do return end + local calc = 0; if expires < 60 then if expires >= AURA_FADE_TIME then self.nextUpdate = 0.51; @@ -449,10 +447,10 @@ do buff:ClearAllPoints() if i==1 then - buff:Point("TOP", SVUI_ConsolidatedBuffs, "TOP", 0, 0) + buff:SetPointToScale("TOP", SVUI_ConsolidatedBuffs, "TOP", 0, 0) lastGoodFrame = buff else - buff:Point("TOP", lastGoodFrame, "BOTTOM", 0, -4) + buff:SetPointToScale("TOP", lastGoodFrame, "BOTTOM", 0, -4) end if(hideIndex and i == hideIndex) then @@ -484,7 +482,6 @@ function MOD:UpdateAuraHeader(auraHeader, auraType) local db = SV.db.SVAura[auraType] local showBy = db.showBy - local font = LSM:Fetch("font", SV.db.SVAura.font) if(auraType == "buffs") then auraHeader:SetAttribute("consolidateTo", SV.db.SVAura.hyperBuffs.enable == true and 1 or 0) @@ -556,7 +553,11 @@ local function CreateAuraHeader(filter) auraHeader:Show() return auraHeader end - +--[[ +########################################################## +UPDATE AND BUILD +########################################################## +]]-- function MOD:ReLoad() if(InCombatLockdown()) then return end local maxShown = #AURA_ICONS - 1 @@ -582,7 +583,7 @@ function MOD:Load() local auras = CreateFrame("Frame", "SVUI_AurasAnchor", UIParent) auras:SetSize(CB_WIDTH, CB_HEIGHT) - auras:Point("TOPRIGHT", Minimap, "TOPLEFT", -8, 0) + auras:SetPointToScale("TOPRIGHT", Minimap, "TOPLEFT", -8, 0) SV:AddToDisplayAudit(auras) self.BuffFrame = CreateAuraHeader("HELPFUL") diff --git a/Interface/AddOns/SVUI/packages/bag/SVBag.lua b/Interface/AddOns/SVUI/packages/bag/SVBag.lua index e5731d2..d0541ad 100644 --- a/Interface/AddOns/SVUI/packages/bag/SVBag.lua +++ b/Interface/AddOns/SVUI/packages/bag/SVBag.lua @@ -65,7 +65,7 @@ local ICON_VENDOR = [[Interface\AddOns\SVUI\assets\artwork\Icons\BAGS-VENDOR]]; local ICON_REAGENTS = [[Interface\AddOns\SVUI\assets\artwork\Icons\BAGS-REAGENTS]]; local numBagFrame = NUM_BAG_FRAMES + 1; local VendorQueue = {}; -local gearSet, gearList = {}, {}; +local GEAR_CACHE, GEARSET_LISTING = {}, {}; local internalTimer; local RefProfessionColors = { [0x0008] = {224/255,187/255,74/255}, @@ -100,7 +100,7 @@ local function StyleBagToolButton(button, iconTex) if button.styled then return end local outer = button:CreateTexture(nil, "OVERLAY") - outer:WrapOuter(button, 6, 6) + outer:SetAllPointsOut(button, 6, 6) outer:SetTexture(BORDER_TEXTURE) outer:SetGradient("VERTICAL", 0.4, 0.47, 0.5, 0.3, 0.33, 0.35) @@ -109,18 +109,18 @@ local function StyleBagToolButton(button, iconTex) iconTex:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) local icon = button:CreateTexture(nil, "OVERLAY") - icon:WrapOuter(button, 6, 6) + icon:SetAllPointsOut(button, 6, 6) SetPortraitToTexture(icon, iconTex) hooksecurefunc(icon, "SetTexture", SetPortraitToTexture) local hover = button:CreateTexture(nil, "HIGHLIGHT") - hover:WrapOuter(button, 6, 6) + hover:SetAllPointsOut(button, 6, 6) hover:SetTexture(BORDER_TEXTURE) hover:SetGradient(unpack(SV.Media.gradient.yellow)) if button.SetPushedTexture then local pushed = button:CreateTexture(nil, "BORDER") - pushed:WrapOuter(button, 6, 6) + pushed:SetAllPointsOut(button, 6, 6) pushed:SetTexture(BORDER_TEXTURE) pushed:SetGradient(unpack(SV.Media.gradient.highlight)) button:SetPushedTexture(pushed) @@ -128,7 +128,7 @@ local function StyleBagToolButton(button, iconTex) if button.SetCheckedTexture then local checked = button:CreateTexture(nil, "BORDER") - checked:WrapOuter(button, 6, 6) + checked:SetAllPointsOut(button, 6, 6) checked:SetTexture(BORDER_TEXTURE) checked:SetGradient(unpack(SV.Media.gradient.green)) button:SetCheckedTexture(checked) @@ -136,7 +136,7 @@ local function StyleBagToolButton(button, iconTex) if button.SetDisabledTexture then local disabled = button:CreateTexture(nil, "BORDER") - disabled:WrapOuter(button, 6, 6) + disabled:SetAllPointsOut(button, 6, 6) disabled:SetTexture(BORDER_TEXTURE) disabled:SetGradient(unpack(SV.Media.gradient.default)) button:SetDisabledTexture(disabled) @@ -145,7 +145,7 @@ local function StyleBagToolButton(button, iconTex) local cd = button:GetName() and _G[button:GetName().."Cooldown"] if cd then cd:ClearAllPoints() - cd:FillInner() + cd:SetAllPointsIn() end button.styled = true end @@ -168,7 +168,7 @@ local function encodeSub(i, j, k) return i:sub(j, (l-1)) end -local function formatAndSave(level, font, saveTo) +local function SetGearLabel(level, font, saveTo) if level == 1 then font:SetFormattedText("|cffffffaa%s|r", encodeSub(saveTo[1], 1, 4)) elseif level == 2 then @@ -181,21 +181,23 @@ local function formatAndSave(level, font, saveTo) end local function BuildEquipmentMap() - for t, u in pairs(gearList)do - twipe(u); - end - local set, player, bank, bags, index, bag, loc, _; + for key, gearData in pairs(GEARSET_LISTING) do + twipe(gearData); + end + + local set, player, bank, bags, slotIndex, bagIndex, loc, _; + for i = 1, GetNumEquipmentSets() do set = GetEquipmentSetInfo(i); - gearSet = GetEquipmentSetLocations(set); - if(gearSet) then - for key, location in pairs(gearSet)do + GEAR_CACHE = GetEquipmentSetLocations(set); + if(GEAR_CACHE) then + for key, location in pairs(GEAR_CACHE) do if(type(location) ~= "string") then - player, bank, bags, _, index, bag = EquipmentManager_UnpackLocation(location); - if((bank or bags) and (index and bag)) then - loc = format("%d_%d", bag, index); - gearList[loc] = (gearList[loc] or {}); - tinsert(gearList[loc], set); + player, bank, bags, _, slotIndex, bagIndex = EquipmentManager_UnpackLocation(location); + if((bank or bags) and (slotIndex and bagIndex)) then + loc = format("%d_%d", bagIndex, slotIndex); + GEARSET_LISTING[loc] = (GEARSET_LISTING[loc] or {}); + tinsert(GEARSET_LISTING[loc], set); end end end @@ -327,6 +329,10 @@ local SlotUpdate = function(self, slotID) slot.JunkIcon:Show() end end + else + if(GameTooltip:NumLines() ~= 0) then + GameTooltip:Hide() + end end end @@ -352,13 +358,23 @@ local SlotUpdate = function(self, slotID) SetItemButtonTexture(slot, texture) SetItemButtonCount(slot, count) SetItemButtonDesaturated(slot, locked, 0.5, 0.5, 0.5) + + if(slot.GearInfo) then + local loc = format("%d_%d", bag, slotID) + if(GEARSET_LISTING[loc]) then + local level = #GEARSET_LISTING[loc] < 4 and #GEARSET_LISTING[loc] or 3; + SetGearLabel(level, slot.GearInfo, GEARSET_LISTING[loc]) + else + SetGearLabel(0, slot.GearInfo, nil) + end + end end local RefreshSlots = function(self) local bagID = self:GetID() if(not bagID) then return end local maxcount = GetContainerNumSlots(bagID) - for slotID = 1, maxcount do + for slotID = 1, maxcount do self:SlotUpdate(slotID) end end @@ -483,13 +499,13 @@ local ContainerFrame_UpdateLayout = function(self) local totalSlots = 0; self.ButtonSize = buttonSize; - self.holderFrame:Width(holderWidth); + self.holderFrame:SetWidthToScale(holderWidth); local menu = self.BagMenu for i, bagID in ipairs(self.BagIDs) do if((not isBank and bagID <= 3) or (isBank and (bagID ~= -1 and numContainerSlots >= 1))) then - menu:Size(((buttonSize + buttonSpacing) * (isBank and i - 1 or i)) + buttonSpacing, buttonSize + (buttonSpacing * 2)) + menu:SetSizeToScale(((buttonSize + buttonSpacing) * (isBank and i - 1 or i)) + buttonSpacing, buttonSize + (buttonSpacing * 2)) local bagSlot, globalName, bagTemplate; @@ -510,12 +526,12 @@ local ContainerFrame_UpdateLayout = function(self) bagSlot:SetPushedTexture("") bagSlot:SetScript("OnClick", nil) bagSlot:RemoveTextures() - bagSlot:SetSlotTemplate(true, 2, 0, 0, 0.5); + bagSlot:SetStylePanel("Slot", true, 2, 0, 0, 0.5); if(not bagSlot.icon) then bagSlot.icon = bagSlot:CreateTexture(nil, "BORDER"); end - bagSlot.icon:FillInner() + bagSlot.icon:SetAllPointsIn() bagSlot.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) hooksecurefunc(bagSlot, "UpdateTooltip", BagMenu_OnEnter) @@ -538,7 +554,7 @@ local ContainerFrame_UpdateLayout = function(self) bagSlot = menu[i] end - bagSlot:Size(buttonSize) + bagSlot:SetSizeToScale(buttonSize) bagSlot:ClearAllPoints() if(isBank) then @@ -607,32 +623,32 @@ local ContainerFrame_UpdateLayout = function(self) slot:SetNormalTexture(""); slot:SetCheckedTexture(""); slot:RemoveTextures() - slot:SetSlotTemplate(true, 2, 0, 0, 0.45); + slot:SetStylePanel("Slot", true, 2, 0, 0, 0.45); slot.Panel.Shadow:SetAttribute("shadowAlpha", 0.9) if(not slot.NewItemTexture) then slot.NewItemTexture = slot:CreateTexture(nil, "OVERLAY", 1); end - slot.NewItemTexture:FillInner(slot); + slot.NewItemTexture:SetAllPointsIn(slot); slot.NewItemTexture:SetTexture(0,0,0,0); slot.NewItemTexture:Hide() if(not slot.JunkIcon) then slot.JunkIcon = slot:CreateTexture(nil, "OVERLAY"); - slot.JunkIcon:Size(16,16); + slot.JunkIcon:SetSizeToScale(16,16); end slot.JunkIcon:SetTexture([[Interface\BUTTONS\UI-GroupLoot-Coin-Up]]); - slot.JunkIcon:Point("TOPLEFT", slot, "TOPLEFT", -4, 4); + slot.JunkIcon:SetPointToScale("TOPLEFT", slot, "TOPLEFT", -4, 4); if(not slot.icon) then slot.icon = slot:CreateTexture(nil, "BORDER"); end - slot.icon:FillInner(slot); + slot.icon:SetAllPointsIn(slot); slot.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9); slot.questIcon = _G[questIcon] or slot:CreateTexture(nil, "OVERLAY") slot.questIcon:SetTexture(TEXTURE_ITEM_QUEST_BANG); - slot.questIcon:FillInner(slot); + slot.questIcon:SetAllPointsIn(slot); slot.questIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9); hooksecurefunc(slot, "SetBackdropColor", function(self, r, g, b, a) if(self.HasQuestItem and (r ~= 1)) then self:SetBackdropColor(1,0.3,0.3,a) end end) @@ -645,8 +661,17 @@ local ContainerFrame_UpdateLayout = function(self) slot = bag[slotID] end + if(SV.db.SVGear.misc.setoverlay and (not slot.GearInfo)) then + slot.GearInfo = slot:CreateFontString(nil,"OVERLAY") + slot.GearInfo:FontManager("default") + slot.GearInfo:SetAllPoints(slot) + slot.GearInfo:SetWordWrap(true) + slot.GearInfo:SetJustifyH('LEFT') + slot.GearInfo:SetJustifyV('BOTTOM') + end + slot:SetID(slotID); - slot:Size(buttonSize); + slot:SetSizeToScale(buttonSize); if slot:GetPoint() then slot:ClearAllPoints(); @@ -654,13 +679,13 @@ local ContainerFrame_UpdateLayout = function(self) if lastButton then if((totalSlots - 1) % numContainerColumns == 0) then - slot:Point("TOP", lastRowButton, "BOTTOM", 0, -buttonSpacing); + slot:SetPointToScale("TOP", lastRowButton, "BOTTOM", 0, -buttonSpacing); lastRowButton = slot; else - slot:Point("LEFT", lastButton, "RIGHT", buttonSpacing, 0); + slot:SetPointToScale("LEFT", lastButton, "RIGHT", buttonSpacing, 0); end else - slot:Point("TOPLEFT", self.holderFrame, "TOPLEFT"); + slot:SetPointToScale("TOPLEFT", self.holderFrame, "TOPLEFT"); lastRowButton = slot; end @@ -685,7 +710,7 @@ local ContainerFrame_UpdateLayout = function(self) end end - self:Size(containerWidth, containerHeight); + self:SetSizeToScale(containerWidth, containerHeight); end local ReagentFrame_UpdateLayout = function(self) @@ -708,7 +733,7 @@ local ReagentFrame_UpdateLayout = function(self) local bagID = REAGENTBANK_CONTAINER; local totalSlots = 0; - self.holderFrame:Width(holderWidth); + self.holderFrame:SetWidthToScale(holderWidth); self.BagID = bagID local bag; @@ -742,25 +767,25 @@ local ReagentFrame_UpdateLayout = function(self) slot:SetNormalTexture(nil); slot:SetCheckedTexture(nil); slot:RemoveTextures() - slot:SetSlotTemplate(true, 2, 0, 0, 0.5); + slot:SetStylePanel("Slot", true, 2, 0, 0, 0.5); slot.NewItemTexture = slot:CreateTexture(nil, "OVERLAY", 1); - slot.NewItemTexture:FillInner(slot); + slot.NewItemTexture:SetAllPointsIn(slot); slot.NewItemTexture:SetTexture(0,0,0,0); slot.NewItemTexture:Hide() slot.JunkIcon = slot:CreateTexture(nil, "OVERLAY"); - slot.JunkIcon:Size(16,16); + slot.JunkIcon:SetSizeToScale(16,16); slot.JunkIcon:SetTexture(0,0,0,0); - slot.JunkIcon:Point("TOPLEFT", slot, "TOPLEFT", -4, 4); + slot.JunkIcon:SetPointToScale("TOPLEFT", slot, "TOPLEFT", -4, 4); slot.icon = _G[iconName] or slot:CreateTexture(nil, "BORDER"); - slot.icon:FillInner(slot); + slot.icon:SetAllPointsIn(slot); slot.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9); slot.questIcon = _G[questIcon] or slot:CreateTexture(nil, "OVERLAY") slot.questIcon:SetTexture(TEXTURE_ITEM_QUEST_BANG); - slot.questIcon:FillInner(slot); + slot.questIcon:SetAllPointsIn(slot); slot.questIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9); slot.cooldown = _G[cdName]; @@ -771,7 +796,7 @@ local ReagentFrame_UpdateLayout = function(self) end slot:SetID(slotID); - slot:Size(buttonSize); + slot:SetSizeToScale(buttonSize); if slot:GetPoint() then slot:ClearAllPoints(); @@ -779,13 +804,13 @@ local ReagentFrame_UpdateLayout = function(self) if lastButton then if((totalSlots - 1) % numContainerColumns == 0) then - slot:Point("TOP", lastRowButton, "BOTTOM", 0, -buttonSpacing); + slot:SetPointToScale("TOP", lastRowButton, "BOTTOM", 0, -buttonSpacing); lastRowButton = slot; else - slot:Point("LEFT", lastButton, "RIGHT", buttonSpacing, 0); + slot:SetPointToScale("LEFT", lastButton, "RIGHT", buttonSpacing, 0); end else - slot:Point("TOPLEFT", self.holderFrame, "TOPLEFT"); + slot:SetPointToScale("TOPLEFT", self.holderFrame, "TOPLEFT"); lastRowButton = slot; end @@ -797,7 +822,7 @@ local ReagentFrame_UpdateLayout = function(self) bag:SlotUpdate(slotID); end - self:Size(containerWidth, containerHeight); + self:SetSizeToScale(containerWidth, containerHeight); end function MOD:RefreshBagFrames(frame) @@ -912,22 +937,22 @@ function MOD:ModifyBags() if(docked) then if self.BagFrame then self.BagFrame:ClearAllPoints() - self.BagFrame:Point("BOTTOMRIGHT", SV.Dock.BottomRight, "BOTTOMRIGHT", 0, 0) + self.BagFrame:SetPointToScale("BOTTOMRIGHT", SV.Dock.BottomRight, "BOTTOMRIGHT", 0, 0) end if self.BankFrame then self.BankFrame:ClearAllPoints() - self.BankFrame:Point("BOTTOMLEFT", SV.Dock.BottomLeft, "BOTTOMLEFT", 0, 0) + self.BankFrame:SetPointToScale("BOTTOMLEFT", SV.Dock.BottomLeft, "BOTTOMLEFT", 0, 0) end else if self.BagFrame then local anchor, x, y = SV.db.SVBag.bags.point, SV.db.SVBag.bags.xOffset, SV.db.SVBag.bags.yOffset self.BagFrame:ClearAllPoints() - self.BagFrame:Point(anchor, SV.Screen, anchor, x, y) + self.BagFrame:SetPointToScale(anchor, SV.Screen, anchor, x, y) end if self.BankFrame then local anchor, x, y = SV.db.SVBag.bank.point, SV.db.SVBag.bank.xOffset, SV.db.SVBag.bank.yOffset self.BankFrame:ClearAllPoints() - self.BankFrame:Point(anchor, SV.Screen, anchor, x, y) + self.BankFrame:SetPointToScale(anchor, SV.Screen, anchor, x, y) end end end @@ -935,22 +960,22 @@ end do local function Bags_OnEnter() if SV.db.SVBag.bagBar.mouseover ~= true then return end - SV:SecureFadeIn(SVUI_BagBar, 0.2, SVUI_BagBar:GetAlpha(), 1) + SVUI_BagBar:FadeIn(0.2, SVUI_BagBar:GetAlpha(), 1) end local function Bags_OnLeave() if SV.db.SVBag.bagBar.mouseover ~= true then return end - SV:SecureFadeOut(SVUI_BagBar, 0.2, SVUI_BagBar:GetAlpha(), 0) + SVUI_BagBar:FadeOut(0.2, SVUI_BagBar:GetAlpha(), 0) end local function AlterBagBar(bar) local icon = _G[bar:GetName().."IconTexture"] bar.oldTex = icon:GetTexture() bar:RemoveTextures() - bar:SetFixedPanelTemplate("Default") - bar:SetSlotTemplate(false, 1, nil, nil, true) + bar:SetStylePanel("Fixed", "Default") + bar:SetStylePanel("Slot", false, 1, nil, nil, true) icon:SetTexture(bar.oldTex) - icon:FillInner() + icon:SetAllPointsIn() icon:SetTexCoord(0.1, 0.9, 0.1, 0.9 ) end @@ -967,9 +992,9 @@ do MainMenuBarBackpackButton:SetParent(bar) MainMenuBarBackpackButton.SetParent = SV.Hidden; MainMenuBarBackpackButton:ClearAllPoints() - MainMenuBarBackpackButtonCount:FontManager(nil, 10) + MainMenuBarBackpackButtonCount:FontManager("default") MainMenuBarBackpackButtonCount:ClearAllPoints() - MainMenuBarBackpackButtonCount:Point("BOTTOMRIGHT", MainMenuBarBackpackButton, "BOTTOMRIGHT", -1, 4) + MainMenuBarBackpackButtonCount:SetPointToScale("BOTTOMRIGHT", MainMenuBarBackpackButton, "BOTTOMRIGHT", -1, 4) MainMenuBarBackpackButton:HookScript("OnEnter", Bags_OnEnter) MainMenuBarBackpackButton:HookScript("OnLeave", Bags_OnLeave) @@ -1014,7 +1039,7 @@ do local button = SVUI_BagBar.buttons[i] local lastButton = SVUI_BagBar.buttons[i - 1] - button:Size(bagSize) + button:SetSizeToScale(bagSize) button:ClearAllPoints() if(showBy == "HORIZONTAL" and sortDir == "ASCENDING") then @@ -1044,15 +1069,15 @@ do end end if showBy == "HORIZONTAL" then - SVUI_BagBar:Width((bagSize * numBagFrame) + (bagSpacing * numBagFrame) + bagSpacing) - SVUI_BagBar:Height(bagSize + (bagSpacing * 2)) + SVUI_BagBar:SetWidthToScale((bagSize * numBagFrame) + (bagSpacing * numBagFrame) + bagSpacing) + SVUI_BagBar:SetHeightToScale(bagSize + (bagSpacing * 2)) else - SVUI_BagBar:Height((bagSize * numBagFrame) + (bagSpacing * numBagFrame) + bagSpacing) - SVUI_BagBar:Width(bagSize + (bagSpacing * 2)) + SVUI_BagBar:SetHeightToScale((bagSize * numBagFrame) + (bagSpacing * numBagFrame) + bagSpacing) + SVUI_BagBar:SetWidthToScale(bagSize + (bagSpacing * 2)) end if not SVUI_BagBar_MOVE then - SVUI_BagBar:SetPanelTemplate("Default") + SVUI_BagBar:SetStylePanel("Default", "Default") SV.Mentalo:Add(SVUI_BagBar, L["Bags Bar"]) end @@ -1065,32 +1090,47 @@ do end --[[ ########################################################## -BAG CONTAINER CREATION +BAG EVENTS ########################################################## ]]-- -do - local function UpdateEquipmentInfo(slot, bag, index) - if not slot.equipmentinfo then - slot.equipmentinfo = slot:CreateFontString(nil,"OVERLAY") - slot.equipmentinfo:FontManager(SV.Media.font.roboto, 10, "OUTLINE") - slot.equipmentinfo:SetAllPoints(slot) - slot.equipmentinfo:SetWordWrap(true) - slot.equipmentinfo:SetJustifyH('LEFT') - slot.equipmentinfo:SetJustifyV('BOTTOM') - end - if slot.equipmentinfo then - slot.equipmentinfo:SetAllPoints(slot) - local loc = format("%d_%d", bag, index) - local level = 0; - if gearList[loc] then - level = #gearList[loc] < 4 and #gearList[loc] or 3; - formatAndSave(level, slot.equipmentinfo, gearList[loc]) - else - formatAndSave(level, slot.equipmentinfo, nil) - end - end +local Container_OnEvent = function(self, event, ...) + if(event == "ITEM_LOCK_CHANGED") then + local bagID, slotID = ... + if(bagID and slotID and self.Bags[bagID]) then + self.Bags[bagID]:SlotUpdate(slotID) + end + elseif(event == "BAG_UPDATE" or event == "EQUIPMENT_SETS_CHANGED") then + BuildEquipmentMap() + for _, id in ipairs(self.BagIDs) do + local numSlots = GetContainerNumSlots(id) + if(not self.Bags[id] and numSlots ~= 0) or (self.Bags[id] and (numSlots ~= self.Bags[id].numSlots)) then + self:UpdateLayout(); + return; + end + end + local bagID = ... + if(bagID and self.Bags[bagID]) then + self.Bags[bagID]:RefreshSlots() + end + elseif(event == "BAG_UPDATE_COOLDOWN") then + self:RefreshCooldowns() + elseif(event == "PLAYERBANKSLOTS_CHANGED") then + self:RefreshBags() + elseif(event == "PLAYERREAGENTBANKSLOTS_CHANGED") then + local slotID = ... + local container = _G["SVUI_ReagentContainerFrame"] + if(slotID and container) then + local bagID = container.BagID + container.Bags[bagID]:SlotUpdate(slotID) + end end - +end +--[[ +########################################################## +BAG CONTAINER CREATION +########################################################## +]]-- +do local Search_OnKeyPressed = function(self) self:GetParent().detail:Show() self:ClearFocus() @@ -1138,46 +1178,6 @@ do end end - local Container_OnEvent = function(self, event, ...) - if(event == "ITEM_LOCK_CHANGED") then - local bagID, slotID = ... - if(bagID and slotID and self.Bags[bagID]) then - self.Bags[bagID]:SlotUpdate(slotID) - end - elseif(event == "BAG_UPDATE" or event == "EQUIPMENT_SETS_CHANGED") then - BuildEquipmentMap() - for id, bag in pairs(self.Bags) do - local numSlots = GetContainerNumSlots(id) - if(numSlots ~= bag.numSlots) then - self:UpdateLayout() - return - end - if(SV.db.SVGear.misc.setoverlay) then - for i = 1, numSlots do - if bag[i] then - UpdateEquipmentInfo(bag[i], id, i) - end - end - end - end - local bagID = ... - if(bagID and self.Bags[bagID]) then - self.Bags[bagID]:RefreshSlots() - end - elseif(event == "BAG_UPDATE_COOLDOWN") then - self:RefreshCooldowns() - elseif(event == "PLAYERBANKSLOTS_CHANGED") then - self:RefreshBags() - elseif(event == "PLAYERREAGENTBANKSLOTS_CHANGED") then - local slotID = ... - local container = _G["SVUI_ReagentContainerFrame"] - if(slotID and container) then - local bagID = container.BagID - container.Bags[bagID]:SlotUpdate(slotID) - end - end - end - local Vendor_OnClick = function(self) if IsShiftKeyDown()then SV.SystemAlert["DELETE_GRAYS"].Money = MOD:VendorGrays(false,true,true) @@ -1241,63 +1241,6 @@ do GameTooltip:AddDoubleLine(L['Hold Shift + Drag:'],L['Temporary Move'],1,1,1) GameTooltip:AddDoubleLine(L['Hold Control + Right Click:'],L['Reset Position'],1,1,1) GameTooltip:Show() - end - - function MOD:ToggleEquipmentOverlay() - if(self.BagFrame) then - for id,bag in ipairs(self.BagFrame.Bags) do - local numSlots = GetContainerNumSlots(id) - if(SV.db.SVGear.misc.setoverlay) then - for i=1,numSlots do - if bag[i] then - UpdateEquipmentInfo(bag[i], id, i) - end - end - else - for i=1,numSlots do - if(bag and bag[i] and bag[i].equipmentinfo) then - bag[i].equipmentinfo:SetText() - end - end - end - end - end - if(self.BankFrame) then - for id,bag in ipairs(self.BankFrame.Bags) do - local numSlots = GetContainerNumSlots(id) - if(SV.db.SVGear.misc.setoverlay) then - for i=1,numSlots do - if bag and bag[i] then - UpdateEquipmentInfo(bag[i], id, i) - end - end - else - for i=1,numSlots do - if(bag and bag[i] and bag[i].equipmentinfo) then - bag[i].equipmentinfo:SetText() - end - end - end - end - end - if(self.ReagentFrame) then - for id,bag in ipairs(self.ReagentFrame.Bags) do - local numSlots = GetContainerNumSlots(id) - if(SV.db.SVGear.misc.setoverlay) then - for i=1,numSlots do - if bag and bag[i] then - UpdateEquipmentInfo(bag[i], id, i) - end - end - else - for i=1,numSlots do - if(bag and bag[i] and bag[i].equipmentinfo) then - bag[i].equipmentinfo:SetText() - end - end - end - end - end end function MOD:MakeBags() @@ -1306,7 +1249,7 @@ do local bagsCount = #self.BagFrames + 1; local frame = CreateFrame("Button", "SVUI_ContainerFrame", UIParent) - frame:SetPanelTemplate("Container") + frame:SetStylePanel("Default", "Container") frame:SetFrameStrata("HIGH") frame.UpdateLayout = ContainerFrame_UpdateLayout; frame.RefreshBags = ContainerFrame_UpdateBags; @@ -1341,14 +1284,14 @@ do frame.Bags = {} frame.closeButton = CreateFrame("Button", "SVUI_ContainerFrameCloseButton", frame, "UIPanelCloseButton") - frame.closeButton:Point("TOPRIGHT", -4, -4) + frame.closeButton:SetPointToScale("TOPRIGHT", -4, -4) frame.closeButton:SetScript("PostClick", function() if(not InCombatLockdown()) then CloseBag(0) end end) frame.holderFrame = CreateFrame("Frame", nil, frame) - frame.holderFrame:Point("TOP", frame, "TOP", 0, -frame.topOffset) - frame.holderFrame:Point("BOTTOM", frame, "BOTTOM", 0, frame.bottomOffset) + frame.holderFrame:SetPointToScale("TOP", frame, "TOP", 0, -frame.topOffset) + frame.holderFrame:SetPointToScale("BOTTOM", frame, "BOTTOM", 0, frame.bottomOffset) frame.Title = frame:CreateFontString() frame.Title:SetFontObject(NumberFont_Outline_Large) @@ -1357,22 +1300,22 @@ do frame.Title:SetTextColor(1,0.8,0) frame.BagMenu = CreateFrame("Button", "SVUI_ContainerFrameBagMenu", frame) - frame.BagMenu:Point("BOTTOMLEFT", frame, "TOPLEFT", 0, 1) - frame.BagMenu:SetFixedPanelTemplate("Transparent") + frame.BagMenu:SetPointToScale("BOTTOMLEFT", frame, "TOPLEFT", 0, 1) + frame.BagMenu:SetStylePanel("Fixed", "Transparent") frame.BagMenu:Hide() frame.goldText = frame:CreateFontString(nil, "OVERLAY") - frame.goldText:FontManager(SV.Media.font.numbers) - frame.goldText:Point("BOTTOMRIGHT", frame.holderFrame, "TOPRIGHT", -2, 4) + frame.goldText:FontManager("number") + frame.goldText:SetPointToScale("BOTTOMRIGHT", frame.holderFrame, "TOPRIGHT", -2, 4) frame.goldText:SetJustifyH("RIGHT") frame.editBox = CreateFrame("EditBox", "SVUI_ContainerFrameEditBox", frame) frame.editBox:SetFrameLevel(frame.editBox:GetFrameLevel()+2) - frame.editBox:SetEditboxTemplate() - frame.editBox:Height(15) + frame.editBox:SetStylePanel("Editbox") + frame.editBox:SetHeightToScale(15) frame.editBox:Hide() - frame.editBox:Point("BOTTOMLEFT", frame.holderFrame, "TOPLEFT", 2, 4) - frame.editBox:Point("RIGHT", frame.goldText, "LEFT", -5, 0) + frame.editBox:SetPointToScale("BOTTOMLEFT", frame.holderFrame, "TOPLEFT", 2, 4) + frame.editBox:SetPointToScale("RIGHT", frame.goldText, "LEFT", -5, 0) frame.editBox:SetAutoFocus(true) frame.editBox:SetScript("OnEscapePressed", Search_OnKeyPressed) frame.editBox:SetScript("OnEnterPressed", Search_OnKeyPressed) @@ -1382,16 +1325,16 @@ do frame.editBox:SetScript("OnChar", Search_OnInput) frame.editBox.SearchReset = Search_OnKeyPressed frame.editBox:SetText(SEARCH) - frame.editBox:FontManager(SV.Media.font.roboto) + frame.editBox:FontManager("default") local searchButton = CreateFrame("Button", nil, frame) searchButton:RegisterForClicks("LeftButtonUp", "RightButtonUp") searchButton:SetSize(60, 18) searchButton:SetPoint("BOTTOMLEFT", frame.editBox, "BOTTOMLEFT", -2, 0) - searchButton:SetButtonTemplate() + searchButton:SetStylePanel("Button") searchButton:SetScript("OnClick", Search_OnClick) local searchText = searchButton:CreateFontString(nil, "OVERLAY") - searchText:SetFont(SV.Media.font.roboto, 12, "NONE") + searchText:SetFont(SV.Media.font.default, 12, "NONE") searchText:SetAllPoints(searchButton) searchText:SetJustifyH("CENTER") searchText:SetText("|cff9999ff"..SEARCH.."|r") @@ -1399,8 +1342,8 @@ do frame.detail = searchButton frame.sortButton = CreateFrame("Button", nil, frame) - frame.sortButton:Point("TOP", frame, "TOP", 0, -10) - frame.sortButton:Size(25, 25) + frame.sortButton:SetPointToScale("TOP", frame, "TOP", 0, -10) + frame.sortButton:SetSizeToScale(25, 25) StyleBagToolButton(frame.sortButton, ICON_CLEANUP) frame.sortButton.ttText = L["Sort Bags"] frame.sortButton.altText = L["Filtered Cleanup"] @@ -1410,8 +1353,8 @@ do frame.sortButton:SetScript("OnClick", Sort_OnClick) frame.stackButton = CreateFrame("Button", nil, frame) - frame.stackButton:Point("LEFT", frame.sortButton, "RIGHT", 10, 0) - frame.stackButton:Size(25, 25) + frame.stackButton:SetPointToScale("LEFT", frame.sortButton, "RIGHT", 10, 0) + frame.stackButton:SetSizeToScale(25, 25) StyleBagToolButton(frame.stackButton, ICON_STACK) frame.stackButton.ttText = L["Stack Items"] frame.stackButton:SetScript("OnEnter", Tooltip_Show) @@ -1420,8 +1363,8 @@ do frame.stackButton:SetScript("OnClick", Stack_OnClick) frame.vendorButton = CreateFrame("Button", nil, frame) - frame.vendorButton:Point("RIGHT", frame.sortButton, "LEFT", -10, 0) - frame.vendorButton:Size(25, 25) + frame.vendorButton:SetPointToScale("RIGHT", frame.sortButton, "LEFT", -10, 0) + frame.vendorButton:SetSizeToScale(25, 25) StyleBagToolButton(frame.vendorButton, ICON_VENDOR) frame.vendorButton.ttText = L["Vendor Grays"] frame.vendorButton.ttText2 = L["Hold Shift:"] @@ -1431,8 +1374,8 @@ do frame.vendorButton:SetScript("OnClick", Vendor_OnClick) frame.bagsButton = CreateFrame("Button", nil, frame) - frame.bagsButton:Point("RIGHT", frame.vendorButton, "LEFT", -10, 0) - frame.bagsButton:Size(25, 25) + frame.bagsButton:SetPointToScale("RIGHT", frame.vendorButton, "LEFT", -10, 0) + frame.bagsButton:SetSizeToScale(25, 25) StyleBagToolButton(frame.bagsButton, ICON_BAGS) frame.bagsButton.ttText = L["Toggle Bags"] frame.bagsButton:SetScript("OnEnter", Tooltip_Show) @@ -1447,8 +1390,8 @@ do frame.bagsButton:SetScript("OnClick", BagBtn_OnClick) frame.transferButton = CreateFrame("Button", nil, frame) - frame.transferButton:Point("LEFT", frame.stackButton, "RIGHT", 10, 0) - frame.transferButton:Size(25, 25) + frame.transferButton:SetPointToScale("LEFT", frame.stackButton, "RIGHT", 10, 0) + frame.transferButton:SetSizeToScale(25, 25) StyleBagToolButton(frame.transferButton, ICON_TRANSFER) frame.transferButton.ttText = L["Stack Bags to Bank"] frame.transferButton:SetScript("OnEnter", Tooltip_Show) @@ -1457,20 +1400,20 @@ do frame.transferButton:SetScript("OnClick", Transfer_OnClick) frame.currencyButton = CreateFrame("Frame", nil, frame) - frame.currencyButton:Point("BOTTOMLEFT", frame, "BOTTOMLEFT", 4, 0) - frame.currencyButton:Point("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -4, 0) - frame.currencyButton:Height(32) + frame.currencyButton:SetPointToScale("BOTTOMLEFT", frame, "BOTTOMLEFT", 4, 0) + frame.currencyButton:SetPointToScale("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -4, 0) + frame.currencyButton:SetHeightToScale(32) for h = 1, MAX_WATCHED_TOKENS do frame.currencyButton[h] = CreateFrame("Button", nil, frame.currencyButton) - frame.currencyButton[h]:Size(22) - frame.currencyButton[h]:SetFixedPanelTemplate("Default") + frame.currencyButton[h]:SetSizeToScale(22) + frame.currencyButton[h]:SetStylePanel("Fixed", "Default") frame.currencyButton[h]:SetID(h) frame.currencyButton[h].icon = frame.currencyButton[h]:CreateTexture(nil, "OVERLAY") - frame.currencyButton[h].icon:FillInner() + frame.currencyButton[h].icon:SetAllPointsIn() frame.currencyButton[h].icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) frame.currencyButton[h].text = frame.currencyButton[h]:CreateFontString(nil, "OVERLAY") - frame.currencyButton[h].text:Point("LEFT", frame.currencyButton[h], "RIGHT", 2, 0) - frame.currencyButton[h].text:FontManager(SV.Media.font.numbers, 18, "NONE") + frame.currencyButton[h].text:SetPointToScale("LEFT", frame.currencyButton[h], "RIGHT", 2, 0) + frame.currencyButton[h].text:FontManager("number_big") frame.currencyButton[h]:SetScript("OnEnter", Token_OnEnter) frame.currencyButton[h]:SetScript("OnLeave", Token_OnLeave) frame.currencyButton[h]:SetScript("OnClick", Token_OnClick) @@ -1493,8 +1436,9 @@ do local bagsCount = #self.BagFrames + 1; local frame = CreateFrame("Button", bagName, isReagent and self.BankFrame or SV.Screen) - frame:SetPanelTemplate(isReagent and "Action" or "Container") + frame:SetStylePanel("Default", isReagent and "Action" or "Container") frame:SetFrameStrata("HIGH") + frame:SetFrameLevel(SVUI_ContainerFrame:GetFrameLevel() + 99) frame.UpdateLayout = isReagent and ReagentFrame_UpdateLayout or ContainerFrame_UpdateLayout; frame.RefreshBags = ContainerFrame_UpdateBags; @@ -1524,7 +1468,7 @@ do frame.topOffset = 60; if(isReagent) then - frame.BagIDs = {} + frame.BagIDs = {REAGENTBANK_CONTAINER} else frame.BagIDs = {-1, 5, 6, 7, 8, 9, 10, 11} end @@ -1532,14 +1476,14 @@ do frame.Bags = {} frame.closeButton = CreateFrame("Button", bagName.."CloseButton", frame, "UIPanelCloseButton") - frame.closeButton:Point("TOPRIGHT", -4, -4) + frame.closeButton:SetPointToScale("TOPRIGHT", -4, -4) frame.closeButton:SetScript("PostClick", function() if(not InCombatLockdown()) then CloseBag(0) end end) frame.holderFrame = CreateFrame("Frame", nil, frame) - frame.holderFrame:Point("TOP", frame, "TOP", 0, -frame.topOffset) - frame.holderFrame:Point("BOTTOM", frame, "BOTTOM", 0, frame.bottomOffset) + frame.holderFrame:SetPointToScale("TOP", frame, "TOP", 0, -frame.topOffset) + frame.holderFrame:SetPointToScale("BOTTOM", frame, "BOTTOM", 0, frame.bottomOffset) frame.Title = frame:CreateFontString() frame.Title:SetFontObject(NumberFont_Outline_Large) @@ -1548,8 +1492,8 @@ do frame.Title:SetTextColor(1,0.8,0) frame.sortButton = CreateFrame("Button", nil, frame) - frame.sortButton:Point("TOPRIGHT", frame, "TOP", 0, -10) - frame.sortButton:Size(25, 25) + frame.sortButton:SetPointToScale("TOPRIGHT", frame, "TOP", 0, -10) + frame.sortButton:SetSizeToScale(25, 25) StyleBagToolButton(frame.sortButton, ICON_CLEANUP) frame.sortButton.ttText = L["Sort Bank"] frame.sortButton.altText = L["Filtered Cleanup"] @@ -1557,8 +1501,8 @@ do frame.sortButton:SetScript("OnLeave", Tooltip_Hide) frame.stackButton = CreateFrame("Button", nil, frame) - frame.stackButton:Point("LEFT", frame.sortButton, "RIGHT", 10, 0) - frame.stackButton:Size(25, 25) + frame.stackButton:SetPointToScale("LEFT", frame.sortButton, "RIGHT", 10, 0) + frame.stackButton:SetSizeToScale(25, 25) StyleBagToolButton(frame.stackButton, ICON_STACK) frame.stackButton.ttText = L["Stack Items"] frame.stackButton:SetScript("OnEnter", Tooltip_Show) @@ -1566,8 +1510,8 @@ do if(not isReagent) then frame.BagMenu = CreateFrame("Button", bagName.."BagMenu", frame) - frame.BagMenu:Point("BOTTOMLEFT", frame, "TOPLEFT", 0, 1) - frame.BagMenu:SetFixedPanelTemplate("Transparent") + frame.BagMenu:SetPointToScale("BOTTOMLEFT", frame, "TOPLEFT", 0, 1) + frame.BagMenu:SetStylePanel("Fixed", "Transparent") frame.BagMenu:Hide() local Sort_OnClick = MOD:RunSortingProcess(MOD.Sort, "bank", SortBankBags) @@ -1576,8 +1520,8 @@ do frame.stackButton:SetScript("OnClick", Stack_OnClick) frame.transferButton = CreateFrame("Button", nil, frame) - frame.transferButton:Point("LEFT", frame.stackButton, "RIGHT", 10, 0) - frame.transferButton:Size(25, 25) + frame.transferButton:SetPointToScale("LEFT", frame.stackButton, "RIGHT", 10, 0) + frame.transferButton:SetSizeToScale(25, 25) StyleBagToolButton(frame.transferButton, ICON_TRANSFER) frame.transferButton.ttText = L["Stack Bank to Bags"] frame.transferButton:SetScript("OnEnter", Tooltip_Show) @@ -1588,8 +1532,8 @@ do tinsert(UISpecialFrames, bagName) frame.bagsButton = CreateFrame("Button", nil, frame) - frame.bagsButton:Point("RIGHT", frame.sortButton, "LEFT", -10, 0) - frame.bagsButton:Size(25, 25) + frame.bagsButton:SetPointToScale("RIGHT", frame.sortButton, "LEFT", -10, 0) + frame.bagsButton:SetSizeToScale(25, 25) StyleBagToolButton(frame.bagsButton, ICON_BAGS) frame.bagsButton.ttText = L["Toggle Bags"] frame.bagsButton:SetScript("OnEnter", Tooltip_Show) @@ -1609,8 +1553,8 @@ do frame.bagsButton:SetScript("OnClick", BagBtn_OnClick) frame.purchaseBagButton = CreateFrame("Button", nil, frame) - frame.purchaseBagButton:Size(25, 25) - frame.purchaseBagButton:Point("RIGHT", frame.bagsButton, "LEFT", -10, 0) + frame.purchaseBagButton:SetSizeToScale(25, 25) + frame.purchaseBagButton:SetPointToScale("RIGHT", frame.bagsButton, "LEFT", -10, 0) frame.purchaseBagButton:SetFrameLevel(frame.purchaseBagButton:GetFrameLevel()+2) StyleBagToolButton(frame.purchaseBagButton, ICON_PURCHASE) frame.purchaseBagButton.ttText = L["Purchase"] @@ -1629,8 +1573,8 @@ do local active_icon = IsReagentBankUnlocked() and ICON_REAGENTS or ICON_PURCHASE frame.swapButton = CreateFrame("Button", nil, frame) - frame.swapButton:Point("TOPRIGHT", frame, "TOPRIGHT", -40, -10) - frame.swapButton:Size(25, 25) + frame.swapButton:SetPointToScale("TOPRIGHT", frame, "TOPRIGHT", -40, -10) + frame.swapButton:SetSizeToScale(25, 25) StyleBagToolButton(frame.swapButton, active_icon) frame.swapButton.ttText = L["Toggle Reagents Bank"] frame.swapButton:SetScript("OnEnter", function(self) @@ -1666,8 +1610,8 @@ do frame.stackButton:SetScript("OnClick", Stack_OnClick) frame.transferButton = CreateFrame("Button", nil, frame) - frame.transferButton:Point("LEFT", frame.stackButton, "RIGHT", 10, 0) - frame.transferButton:Size(25, 25) + frame.transferButton:SetPointToScale("LEFT", frame.stackButton, "RIGHT", 10, 0) + frame.transferButton:SetSizeToScale(25, 25) StyleBagToolButton(frame.transferButton, ICON_DEPOSIT) frame.transferButton.ttText = L["Deposit All Reagents"] frame.transferButton:SetScript("OnEnter", Tooltip_Show) @@ -1721,14 +1665,14 @@ function MOD:RefreshTokens() frame.bottomOffset = 28; local set = frame.currencyButton; if index == 1 then - set[1]:Point("BOTTOM", set, "BOTTOM", -(set[1].text:GetWidth() / 2), 3) + set[1]:SetPointToScale("BOTTOM", set, "BOTTOM", -(set[1].text:GetWidth() / 2), 3) elseif index == 2 then - set[1]:Point("BOTTOM", set, "BOTTOM", -set[1].text:GetWidth()-set[1]:GetWidth() / 2, 3) - frame.currencyButton[2]:Point("BOTTOMLEFT", set, "BOTTOM", set[2]:GetWidth() / 2, 3) + set[1]:SetPointToScale("BOTTOM", set, "BOTTOM", -set[1].text:GetWidth()-set[1]:GetWidth() / 2, 3) + frame.currencyButton[2]:SetPointToScale("BOTTOMLEFT", set, "BOTTOM", set[2]:GetWidth() / 2, 3) else - set[1]:Point("BOTTOMLEFT", set, "BOTTOMLEFT", 3, 3) - set[2]:Point("BOTTOM", set, "BOTTOM", -(set[2].text:GetWidth() / 3), 3) - set[3]:Point("BOTTOMRIGHT", set, "BOTTOMRIGHT", -set[3].text:GetWidth()-set[3]:GetWidth() / 2, 3) + set[1]:SetPointToScale("BOTTOMLEFT", set, "BOTTOMLEFT", 3, 3) + set[2]:SetPointToScale("BOTTOM", set, "BOTTOM", -(set[2].text:GetWidth() / 3), 3) + set[3]:SetPointToScale("BOTTOMRIGHT", set, "BOTTOMRIGHT", -set[3].text:GetWidth()-set[3]:GetWidth() / 2, 3) end end @@ -1865,7 +1809,7 @@ function MOD:Load() self.BagFrame:UpdateLayout() -- BagFilters:SetParent(SV.Screen) - BagFilters:SetPanelTemplate("Default") + BagFilters:SetStylePanel("Default", "Default") BagFilters.buttons = {} BagFilters:SetFrameStrata("DIALOG") BagFilters:SetClampedToScreen(true) @@ -1888,7 +1832,7 @@ function MOD:Load() BagFilters.buttons[i].text = BagFilters.buttons[i]:CreateFontString(nil, 'BORDER') BagFilters.buttons[i].text:SetAllPoints() - BagFilters.buttons[i].text:SetFont(SV.Media.font.roboto,12,"OUTLINE") + BagFilters.buttons[i].text:SetFont(SV.Media.font.default,12,"OUTLINE") BagFilters.buttons[i].text:SetJustifyH("LEFT") BagFilters.buttons[i].text:SetText(BAG_FILTER_LABELS[i]) @@ -1920,7 +1864,7 @@ function MOD:Load() BagFilters.buttons[clearID].hoverTex:Hide() BagFilters.buttons[clearID].text = BagFilters.buttons[clearID]:CreateFontString(nil, 'BORDER') BagFilters.buttons[clearID].text:SetAllPoints() - BagFilters.buttons[clearID].text:SetFont(SV.Media.font.roboto,12,"OUTLINE") + BagFilters.buttons[clearID].text:SetFont(SV.Media.font.default,12,"OUTLINE") BagFilters.buttons[clearID].text:SetJustifyH("LEFT") BagFilters.buttons[clearID].text:SetText(CLEAR_ALL .. " " .. FILTERS) BagFilters.buttons[clearID]:SetScript("OnEnter", DD_OnEnter) diff --git a/Interface/AddOns/SVUI/packages/bag/components/breakstuff.lua b/Interface/AddOns/SVUI/packages/bag/components/breakstuff.lua index 2141920..a49c95e 100644 --- a/Interface/AddOns/SVUI/packages/bag/components/breakstuff.lua +++ b/Interface/AddOns/SVUI/packages/bag/components/breakstuff.lua @@ -309,12 +309,12 @@ function MOD:BreakStuffLoader() BreakStuffButton:SetParent(SV.Dock.BottomRight.Bar.ToolBar) local size = SV.Dock.BottomRight.Bar.ToolBar:GetHeight() - BreakStuffButton:Size(size, size) - BreakStuffButton:Point("RIGHT", SV.Dock.BottomRight.Bar.ToolBar, "LEFT", -6, 0) + BreakStuffButton:SetSizeToScale(size, size) + BreakStuffButton:SetPointToScale("RIGHT", SV.Dock.BottomRight.Bar.ToolBar, "LEFT", -6, 0) BreakStuffButton:Show(); - BreakStuffButton:SetFramedButtonTemplate() + BreakStuffButton:SetStylePanel("Framed") BreakStuffButton.icon=BreakStuffButton:CreateTexture(nil,"OVERLAY") - BreakStuffButton.icon:FillInner(BreakStuffButton,2,2) + BreakStuffButton.icon:SetAllPointsIn(BreakStuffButton,2,2) BreakStuffButton.icon:SetTexture(ICONARTFILE) BreakStuffButton.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) BreakStuffButton.ttText = "BreakStuff : OFF"; diff --git a/Interface/AddOns/SVUI/packages/bag/components/sorting.lua b/Interface/AddOns/SVUI/packages/bag/components/sorting.lua index 33d60e0..af3454a 100644 --- a/Interface/AddOns/SVUI/packages/bag/components/sorting.lua +++ b/Interface/AddOns/SVUI/packages/bag/components/sorting.lua @@ -177,7 +177,7 @@ end LOCAL FUNCTIONS ########################################################## ]]-- -local function SetBlockedCache(...) +local function SetCacheBlacklist(...) twipe(blackList) for index = 1, select('#', ...) do local name = select(index, ...) @@ -479,7 +479,7 @@ do twipe(blackListedSlots) local ignoreItems = SV.db.SVBag.ignoreItems ignoreItems = ignoreItems:gsub(',%s', ',') - SetBlockedCache(split(",", ignoreItems)) + SetCacheBlacklist(split(",", ignoreItems)) for i, bag, slot in IterateBagsForSorting(bags, nil, 'both') do local bagSlot = BagEncoder(bag, slot) local link = GetSortingItemLink(bag, slot); diff --git a/Interface/AddOns/SVUI/packages/bar/SVBar.lua b/Interface/AddOns/SVUI/packages/bar/SVBar.lua new file mode 100644 index 0000000..cc53782 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/bar/SVBar.lua @@ -0,0 +1,1423 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local string = _G.string; +local math = _G.math; +--[[ STRING METHODS ]]-- +local find, format, split = string.find, string.format, string.split; +local gsub = string.gsub; +--[[ MATH METHODS ]]-- +local ceil = math.ceil; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local LSM = LibStub("LibSharedMedia-3.0") + +local MOD = SV:NewPackage("SVBar", L["ActionBars"]); +MOD.ButtonCache = {}; +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local maxFlyoutCount = 0 +local SetSpellFlyoutHook +local NewFrame = CreateFrame +local NewHook = hooksecurefunc +local NUM_ACTIONBAR_BUTTONS = NUM_ACTIONBAR_BUTTONS; +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- +local LibAB = LibStub("LibActionButton-1.0"); + +local function NewActionBar(barName) + local bar = CreateFrame("Frame", barName, UIParent, "SecureHandlerStateTemplate") + bar.buttons = {} + bar.conditions = "" + bar.config = { + outOfRangeColoring = "button", + tooltip = "enable", + showGrid = true, + colors = { + range = {0.8, 0.1, 0.1}, + mana = {0.5, 0.5, 1.0}, + hp = {0.5, 0.5, 1.0} + }, + hideElements = { + macro = false, + hotkey = false, + equipped = false + }, + keyBoundTarget = false, + clickOnDown = false + } + return bar +end + +local function NewActionButton(parent, index, name) + return LibAB:CreateButton(index, name, parent, nil) +end + +local Bar_OnEnter = function(self) + if(self._fade) then + self:FadeIn(0.2, self:GetAlpha(), self._alpha) + end +end + +local Bar_OnLeave = function(self) + if(self._fade) then + self:FadeOut(1, self:GetAlpha(), 0) + end +end + +function MOD:FixKeybindText(button) + local hotkey = _G[button:GetName()..'HotKey'] + local hotkeyText = hotkey:GetText() + if hotkeyText then + hotkeyText = hotkeyText:gsub('SHIFT%-', "S") + hotkeyText = hotkeyText:gsub('ALT%-', "A") + hotkeyText = hotkeyText:gsub('CTRL%-', "C") + hotkeyText = hotkeyText:gsub('BUTTON', "B") + hotkeyText = hotkeyText:gsub('MOUSEWHEELUP', "WU") + hotkeyText = hotkeyText:gsub('MOUSEWHEELDOWN', "WD") + hotkeyText = hotkeyText:gsub('NUMPAD', "N") + hotkeyText = hotkeyText:gsub('PAGEUP', "PgU") + hotkeyText = hotkeyText:gsub('PAGEDOWN', "PgD") + hotkeyText = hotkeyText:gsub('SPACE', "SP") + hotkeyText = hotkeyText:gsub('INSERT', "INS") + hotkeyText = hotkeyText:gsub('HOME', "HM") + hotkeyText = hotkeyText:gsub('DELETE', "DEL") + hotkeyText = hotkeyText:gsub('NMULTIPLY', "N*") + hotkeyText = hotkeyText:gsub('NMINUS', "N-") + hotkeyText = hotkeyText:gsub('NPLUS', "N+") + hotkey:SetText(hotkeyText) + end + hotkey:ClearAllPoints() + hotkey:SetAllPoints() +end + +local function Pinpoint(parent) + local centerX,centerY = parent:GetCenter() + local screenWidth = GetScreenWidth() + local screenHeight = GetScreenHeight() + local result; + if not centerX or not centerY then + return "CENTER" + end + local heightTop = screenHeight * 0.75; + local heightBottom = screenHeight * 0.25; + local widthLeft = screenWidth * 0.25; + local widthRight = screenWidth * 0.75; + if(((centerX > widthLeft) and (centerX < widthRight)) and (centerY > heightTop)) then + result="TOP" + elseif((centerX < widthLeft) and (centerY > heightTop)) then + result="TOPLEFT" + elseif((centerX > widthRight) and (centerY > heightTop)) then + result="TOPRIGHT" + elseif(((centerX > widthLeft) and (centerX < widthRight)) and centerY < heightBottom) then + result="BOTTOM" + elseif((centerX < widthLeft) and (centerY < heightBottom)) then + result="BOTTOMLEFT" + elseif((centerX > widthRight) and (centerY < heightBottom)) then + result="BOTTOMRIGHT" + elseif((centerX < widthLeft) and (centerY > heightBottom) and (centerY < heightTop)) then + result="LEFT" + elseif((centerX > widthRight) and (centerY < heightTop) and (centerY > heightBottom)) then + result="RIGHT" + else + result="CENTER" + end + return result +end + +local function SaveActionButton(parent) + local button = parent:GetName() + local cooldown = _G[button.."Cooldown"] + cooldown.SizeOverride = SV.db.SVBar.cooldownSize + if(not parent.cd) then + parent.cd = cooldown; + end + MOD:FixKeybindText(parent) + MOD.ButtonCache[parent] = true + parent:SetStylePanel("Slot", true, 2, 0, 0, 0.75, true) + parent:SetCheckedTexture("") +end + +local function SetFlyoutButton(button) + if not button or not button.FlyoutArrow or not button.FlyoutArrow:IsShown() or not button.FlyoutBorder then return end + local LOCKDOWN = InCombatLockdown() + button.FlyoutBorder:SetAlpha(0) + button.FlyoutBorderShadow:SetAlpha(0) + SpellFlyoutHorizontalBackground:SetAlpha(0) + SpellFlyoutVerticalBackground:SetAlpha(0) + SpellFlyoutBackgroundEnd:SetAlpha(0) + for i = 1, GetNumFlyouts()do + local id = GetFlyoutID(i) + local _, _, max, check = GetFlyoutInfo(id) + if check then + maxFlyoutCount = max; + break + end + end + local offset = 0; + if SpellFlyout:IsShown() and SpellFlyout:GetParent() == button or GetMouseFocus() == button then offset = 5 else offset = 2 end + if button:GetParent() and button:GetParent():GetParent() and button:GetParent():GetParent():GetName() and button:GetParent():GetParent():GetName() == "SpellBookSpellIconsFrame" then return end + if button:GetParent() then + local point = Pinpoint(button:GetParent()) + if point:find("RIGHT") then + button.FlyoutArrow:ClearAllPoints() + button.FlyoutArrow:SetPoint("LEFT", button, "LEFT", -offset, 0) + SetClampedTextureRotation(button.FlyoutArrow, 270) + if not LOCKDOWN then + button:SetAttribute("flyoutDirection", "LEFT") + end + elseif point:find("LEFT") then + button.FlyoutArrow:ClearAllPoints() + button.FlyoutArrow:SetPoint("RIGHT", button, "RIGHT", offset, 0) + SetClampedTextureRotation(button.FlyoutArrow, 90) + if not LOCKDOWN then + button:SetAttribute("flyoutDirection", "RIGHT") + end + elseif point:find("TOP") then + button.FlyoutArrow:ClearAllPoints() + button.FlyoutArrow:SetPoint("BOTTOM", button, "BOTTOM", 0, -offset) + SetClampedTextureRotation(button.FlyoutArrow, 180) + if not LOCKDOWN then + button:SetAttribute("flyoutDirection", "DOWN") + end + elseif point == "CENTER" or point:find("BOTTOM") then + button.FlyoutArrow:ClearAllPoints() + button.FlyoutArrow:SetPoint("TOP", button, "TOP", 0, offset) + SetClampedTextureRotation(button.FlyoutArrow, 0) + if not LOCKDOWN then + button:SetAttribute("flyoutDirection", "UP") + end + end + end +end + +local function ModifyActionButton(parent) + local button = parent:GetName() + if(not button) then return; end + local icon = _G[button.."Icon"] + local count = _G[button.."Count"] + local flash = _G[button.."Flash"] + local hotkey = _G[button.."HotKey"] + local border = _G[button.."Border"] + local normal = _G[button.."NormalTexture"] + local cooldown = _G[button.."Cooldown"] + local parentTex = parent:GetNormalTexture() + local shine = _G[button.."Shine"] + local highlight = parent:GetHighlightTexture() + local pushed = parent:GetPushedTexture() + local checked = parent:GetCheckedTexture() + if cooldown then + cooldown.SizeOverride = SV.db.SVBar.cooldownSize + --cooldown:SetAlpha(0) + end + if highlight then + highlight:SetTexture(1,1,1,.2) + end + if pushed then + pushed:SetTexture(0,0,0,.4) + end + if checked then + checked:SetTexture(1,1,1,.2) + end + if flash then + flash:SetTexture(0,0,0,0) + end + if normal then + normal:SetTexture(0,0,0,0) + normal:Hide() + normal:SetAlpha(0) + end + if parentTex then + parentTex:SetTexture(0,0,0,0) + parentTex:Hide() + parentTex:SetAlpha(0) + end + if border then border:Die()end + if count then + count:ClearAllPoints() + count:SetPoint("BOTTOMRIGHT",1,1) + count:SetShadowOffset(1,-1) + count:FontManager("number") + end + if icon then + icon:SetTexCoord(.1,.9,.1,.9) + --icon:SetGradient("VERTICAL",.5,.5,.5,1,1,1) + icon:SetAllPointsIn(button) + end + if shine then shine:SetAllPoints()end + if SV.db.SVBar.hotkeytext then + hotkey:ClearAllPoints() + hotkey:SetAllPoints() + hotkey:FontManager("default") + hotkey:SetJustifyH("RIGHT") + hotkey:SetJustifyV("TOP") + hotkey:SetShadowOffset(1,-1) + end + -- if parent.style then + -- parent.style:SetDrawLayer('BACKGROUND',-7) + -- end + parent.FlyoutUpdateFunc = SetFlyoutButton; + MOD:FixKeybindText(parent) +end + +do + local SpellFlyoutButton_OnEnter = function(self) + local parent = self:GetParent() + local anchor = select(2, parent:GetPoint()) + if not MOD.ButtonCache[anchor] then return end + local anchorParent = anchor:GetParent() + if anchorParent._fade then + local alpha = anchorParent._alpha + local actual = anchorParent:GetAlpha() + anchorParent:FadeIn(0.2, actual, alpha) + end + end + + local SpellFlyoutButton_OnLeave = function(self) + local parent = self:GetParent() + local anchor = select(2, parent:GetPoint()) + if not MOD.ButtonCache[anchor] then return end + local anchorParent = anchor:GetParent() + if anchorParent._fade then + local actual = anchorParent:GetAlpha() + anchorParent:FadeOut(1, actual, 0) + end + end + + local SpellFlyout_OnEnter = function(self) + local anchor = select(2,self:GetPoint()) + if not MOD.ButtonCache[anchor] then return end + local anchorParent = anchor:GetParent() + if anchorParent._fade then + Bar_OnEnter(anchorParent) + end + end + + local SpellFlyout_OnLeave = function(self) + local anchor = select(2, self:GetPoint()) + if not MOD.ButtonCache[anchor] then return end + local anchorParent=anchor:GetParent() + if anchorParent._fade then + Bar_OnLeave(anchorParent) + end + end + + local SpellFlyout_OnShow = function() + for i=1,maxFlyoutCount do + local name = ("SpellFlyoutButton%s"):format(i) + local button = _G[name] + if(button) then + ModifyActionButton(button) + SaveActionButton(button) + + button:HookScript('OnEnter', SpellFlyoutButton_OnEnter) + + button:HookScript('OnLeave', SpellFlyoutButton_OnLeave) + end + end + SpellFlyout:HookScript('OnEnter', SpellFlyout_OnEnter) + SpellFlyout:HookScript('OnLeave', SpellFlyout_OnLeave) + end + + local QualifyFlyouts = function() + if InCombatLockdown() then return end + for button,_ in pairs(MOD.ButtonCache)do + if(button and button.FlyoutArrow) then + SetFlyoutButton(button) + end + end + end + + function SetSpellFlyoutHook() + SpellFlyout:HookScript("OnShow",SpellFlyout_OnShow); + SV.Timers:ExecuteTimer(QualifyFlyouts, 5) + end +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +function MOD:UpdateBarBindings(pet, stance) + if stance == true then + local bar = _G["SVUI_StanceBar"] + local bindText = bar.binding + + for i=1,NUM_STANCE_SLOTS do + local name = ("SVUI_StanceBarButton%s"):format(i) + local hkname = ("SVUI_StanceBarButton%sHotKey"):format(i) + local hotkey = _G[hkname] + if SV.db.SVBar.hotkeytext then + local key = bindText:format(i); + local binding = GetBindingKey(key) + hotkey:Show() + hotkey:SetText(binding) + MOD:FixKeybindText(_G[name]) + else + hotkey:Hide() + end + end + end + if pet == true then + local bar = _G["SVUI_PetActionBar"] + local bindText = bar.binding + + for i=1,NUM_PET_ACTION_SLOTS do + local name = ("PetActionButton%s"):format(i) + local hkname = ("PetActionButton%sHotKey"):format(i) + local hotkey = _G[hkname] + if SV.db.SVBar.hotkeytext then + local key = bindText:format(i); + local binding = GetBindingKey(key) + hotkey:Show() + hotkey:SetText(binding) + MOD:FixKeybindText(_G[name]) + else + hotkey:Hide() + end + end + end +end + +function MOD:UpdateAllBindings(event) + if event == "UPDATE_BINDINGS" then + MOD:UpdateBarBindings(true,true) + end + MOD:UnregisterEvent("PLAYER_REGEN_DISABLED") + if InCombatLockdown() then return end + for i = 1, 6 do + local barName = ("SVUI_ActionBar%d"):format(i) + local bar = _G[barName] + if(bar and bar.buttons) then + local thisBinding = bar.binding + + ClearOverrideBindings(bar) + + for k = 1,#bar.buttons do + local binding = thisBinding:format(k); + local btn = ("%sButton%d"):format(barName, k); + for x = 1,select('#',GetBindingKey(binding)) do + local key = select(x, GetBindingKey(binding)) + if (key and key ~= "") then + SetOverrideBindingClick(bar, false, key, btn) + end + end + end + end + end +end + +function MOD:SetBarConfigData(bar) + local db = SV.db.SVBar + local thisBinding = bar.binding; + local buttonList = bar.buttons; + local config = bar.config + config.hideElements.macro = db.macrotext; + config.hideElements.hotkey = db.hotkeytext; + config.showGrid = db.showGrid; + config.clickOnDown = db.keyDown; + config.colors.range = db.unc + config.colors.mana = db.unpc + config.colors.hp = db.unpc + SetModifiedClick("PICKUPACTION", db.unlock) + for i,button in pairs(buttonList)do + if thisBinding then + config.keyBoundTarget = thisBinding:format(i) + end + button.keyBoundTarget = config.keyBoundTarget; + button.postKeybind = self.FixKeybindText; + button:SetAttribute("buttonlock",true) + button:SetAttribute("checkselfcast",true) + button:SetAttribute("checkfocuscast",true) + button:UpdateConfig(config) + end +end + +function MOD:UpdateBarPagingDefaults() + local parse, custom; + if SV.db.SVBar.Bar6.enable then + parse = "[vehicleui,mod:alt,mod:ctrl] %d; [possessbar] %d; [overridebar] %d; [form,noform] 0; [shapeshift] 13; [bar:3] 3; [bar:4] 4; [bar:5] 5; [bar:6] 6; %s"; + else + parse = "[vehicleui,mod:alt,mod:ctrl] %d; [possessbar] %d; [overridebar] %d; [form,noform] 0; [shapeshift] 13; [bar:2] 2; [bar:3] 3; [bar:4] 4; [bar:5] 5; [bar:6] 6; %s"; + end + + local mainbar = _G["SVUI_ActionBar1"] + if(mainbar) then + if SV.db.SVBar.Bar1.useCustomPaging then + custom = SV.db.SVBar.Bar1.customPaging[SV.class]; + else + custom = "" + end + + mainbar.conditions = parse:format(GetVehicleBarIndex(), GetVehicleBarIndex(), GetOverrideBarIndex(), custom); + end + + for i=2, 6 do + local id = ("Bar%d"):format(i) + local bar = _G["SVUI_Action" .. id] + if(bar and SV.db.SVBar[id].useCustomPaging) then + bar.conditions = SV.db.SVBar[id].customPaging[SV.class]; + end + end + + if((not SV.db.SVBar.enable or InCombatLockdown()) or not self.isInitialized) then return end + local Bar2Option = InterfaceOptionsActionBarsPanelBottomRight + local Bar3Option = InterfaceOptionsActionBarsPanelBottomLeft + local Bar4Option = InterfaceOptionsActionBarsPanelRightTwo + local Bar5Option = InterfaceOptionsActionBarsPanelRight + + if (SV.db.SVBar.Bar2.enable and not Bar2Option:GetChecked()) or (not SV.db.SVBar.Bar2.enable and Bar2Option:GetChecked()) then + Bar2Option:Click() + end + + if (SV.db.SVBar.Bar3.enable and not Bar3Option:GetChecked()) or (not SV.db.SVBar.Bar3.enable and Bar3Option:GetChecked()) then + Bar3Option:Click() + end + + if not SV.db.SVBar.Bar5.enable and not SV.db.SVBar.Bar4.enable then + if Bar4Option:GetChecked() then + Bar4Option:Click() + end + + if Bar5Option:GetChecked() then + Bar5Option:Click() + end + elseif not SV.db.SVBar.Bar5.enable then + if not Bar5Option:GetChecked() then + Bar5Option:Click() + end + + if not Bar4Option:GetChecked() then + Bar4Option:Click() + end + elseif (SV.db.SVBar.Bar4.enable and not Bar4Option:GetChecked()) or (not SV.db.SVBar.Bar4.enable and Bar4Option:GetChecked()) then + Bar4Option:Click() + elseif (SV.db.SVBar.Bar5.enable and not Bar5Option:GetChecked()) or (not SV.db.SVBar.Bar5.enable and Bar5Option:GetChecked()) then + Bar5Option:Click() + end +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +do + local Button_OnEnter = function(self) + local parent = self:GetParent() + if parent and parent._fade then + if(self.cd) then + self.cd:SetSwipeColor(0, 0, 0, 1) + self.cd:SetDrawBling(true) + end + parent:FadeIn(0.2, parent:GetAlpha(), parent._alpha) + end + end + + local Button_OnLeave = function(self) + local parent = self:GetParent() + GameTooltip:Hide() + if parent and parent._fade then + if(self.cd) then + self.cd:SetSwipeColor(0, 0, 0, 0) + self.cd:SetDrawBling(false) + end + parent:FadeOut(1, parent:GetAlpha(), 0) + end + end + + local function _refreshButtons(bar, id, max, space, cols, totalButtons, size, point, selfcast) + if InCombatLockdown() then return end + if not bar then return end + local hideByScale = id == "Pet" and true or false; + local isStance = id == "Stance" and true or false; + local button,lastButton,lastRow; + for i=1, max do + button = bar.buttons[i] + lastButton = bar.buttons[i - 1] + lastRow = bar.buttons[i - cols] + button:SetParent(bar) + button:ClearAllPoints() + button:SetSizeToScale(size) + button:SetAttribute("showgrid",1) + + if(selfcast) then + button:SetAttribute("unit2", "player") + end + + if(bar._fade) then + if button.cd then + button.cd:SetSwipeColor(0, 0, 0, 0) + button.cd:SetDrawBling(false) + end + else + if button.cd then + button.cd:SetSwipeColor(0, 0, 0, 1) + button.cd:SetDrawBling(true) + end + end + + if(not button._hookFade) then + button:HookScript('OnEnter', Button_OnEnter) + button:HookScript('OnLeave', Button_OnLeave) + button._hookFade = true; + end + + local x,y,anchor1,anchor2; + + if(i == 1) then + x, y = 0, 0 + if(point:find("BOTTOM")) then + y = space + elseif(point:find("TOP")) then + y = -space + end + if(point:find("RIGHT")) then + x = -space + elseif(point:find("LEFT")) then + x = space + end + button:SetPointToScale(point,bar,point,x,y) + elseif((i - 1) % cols == 0) then + x, y = 0, -space + anchor1, anchor2 = "TOP", "BOTTOM" + if(point:find("BOTTOM")) then + y = space; + anchor1 = "BOTTOM" + anchor2 = "TOP" + end + button:SetPointToScale(anchor1,lastRow,anchor2,x,y) + else + x, y = space, 0 + anchor1, anchor2 = "LEFT", "RIGHT"; + if(point:find("RIGHT")) then + x = -space; + anchor1 = "RIGHT" + anchor2 = "LEFT" + end + button:SetPointToScale(anchor1,lastButton,anchor2,x,y) + end + + if(i > totalButtons) then + if hideByScale then + button:SetScale(0.000001) + button:SetAlpha(0) + else + button:Hide() + end + if button.cd then + button.cd:SetSwipeColor(0, 0, 0, 0) + button.cd:SetDrawBling(false) + end + else + if hideByScale then + button:SetScale(1) + button:SetAlpha(1) + else + button:Show() + end + if button.cd then + button.cd:SetSwipeColor(0, 0, 0, 1) + button.cd:SetDrawBling(true) + end + end + + if (not isStance or (isStance and not button.FlyoutUpdateFunc)) then + ModifyActionButton(button); + SaveActionButton(button); + end + end + end + + local function _getPage(bar, defaultPage, condition) + local page = SV.db.SVBar[bar].customPaging[SV.class] + if not condition then condition = '' end + if not page then page = '' end + if page then + condition = condition.." "..page + end + condition = condition.." "..defaultPage + return condition + end + + function MOD:RefreshBar(id) + if(InCombatLockdown()) then return end + + local bar + local isPet, isStance = false, false + local db = SV.db.SVBar[id] + + if(id == "Pet") then + bar = _G["SVUI_PetActionBar"] + isPet = true + elseif(id == "Stance") then + bar = _G["SVUI_StanceBar"] + isStance = true + else + bar = _G[("SVUI_Action%s"):format(id)] + end + + if(not bar or not db) then return end + + local selfcast = db.rightClickSelf + local space = db.buttonspacing; + local cols = db.buttonsPerRow; + local size = db.buttonsize; + local point = db.point; + local barVisibility = db.customVisibility; + local totalButtons = db.buttons; + local max = (isStance and GetNumShapeshiftForms()) or (isPet and 10) or NUM_ACTIONBAR_BUTTONS; + local rows = ceil(totalButtons / cols); + + if max < cols then cols = max end + if rows < 1 then rows = 1 end + + bar:SetWidthToScale(space + (size * cols) + ((space * (cols - 1)) + space)); + bar:SetHeightToScale((space + (size * rows)) + ((space * (rows - 1)) + space)); + bar.backdrop:ClearAllPoints() + bar.backdrop:SetAllPoints() + bar._fade = db.mouseover; + bar._alpha = db.alpha; + + if db.backdrop == true then + bar.backdrop:Show() + else + bar.backdrop:Hide() + end + + if(not bar._hookFade) then + bar:HookScript('OnEnter', Bar_OnEnter) + bar:HookScript('OnLeave', Bar_OnLeave) + bar._hookFade = true; + end + + if(db.mouseover == true) then + bar:SetAlpha(0) + bar._fade = true + else + bar:SetAlpha(db.alpha) + bar._fade = false + end + + _refreshButtons(bar, id, max, space, cols, totalButtons, size, point, selfcast); + + if(isPet or isStance) then + if db.enable then + bar:SetScale(1) + bar:SetAlpha(db.alpha) + if(db.mouseover == true) then + bar:SetAlpha(0) + else + bar:SetAlpha(db.alpha) + end + RegisterStateDriver(bar, "visibility", barVisibility) + else + bar:SetScale(0.000001) + bar:SetAlpha(0) + UnregisterStateDriver(bar, "visibility") + end + --RegisterStateDriver(bar, "show", barVisibility) + else + local p,c = bar.page, bar.conditions + local page = _getPage(id, p, c) + if c:find("[form, noform]") then + bar:SetAttribute("hasTempBar", true) + local newCondition = c:gsub(" %[form, noform%] 0; ", ""); + bar:SetAttribute("newCondition", newCondition) + else + bar:SetAttribute("hasTempBar", false) + end + + RegisterStateDriver(bar, "page", page) + if not bar.ready then + bar.ready = true; + self:RefreshBar(id) + return + end + + if db.enable == true then + bar:Show() + RegisterStateDriver(bar, "visibility", barVisibility) + else + bar:Hide() + UnregisterStateDriver(bar, "visibility") + end + SV.Mentalo:ChangeSnapOffset(("SVUI_Action%d_MOVE"):format(id), (space / 2)) + end + end +end + +function MOD:RefreshActionBars() + if(InCombatLockdown()) then self:RegisterEvent("PLAYER_REGEN_ENABLED"); return end + self:UpdateBarPagingDefaults() + for button, _ in pairs(self.ButtonCache)do + if button then + ModifyActionButton(button) + SaveActionButton(button) + if(button.FlyoutArrow) then + SetFlyoutButton(button) + end + else + self.ButtonCache[button] = nil + end + end + + local id, bar + for i = 1, 6 do + id = ("Bar%d"):format(i) + bar = _G[("SVUI_Action%s"):format(id)] + self:RefreshBar(id) + self:SetBarConfigData(bar) + end + + self:RefreshBar("Pet") + self:RefreshBar("Stance") + self:UpdateBarBindings(true, true) + + collectgarbage("collect"); +end + +local Vehicle_Updater = function() + local bar = _G["SVUI_ActionBar1"] + local space = SV.db.SVBar["Bar1"].buttonspacing + local total = SV.db.SVBar["Bar1"].buttons; + local rows = SV.db.SVBar["Bar1"].buttonsPerRow; + local size = SV.db.SVBar["Bar1"].buttonsize + local point = SV.db.SVBar["Bar1"].point; + local columns = ceil(total / rows) + if (HasOverrideActionBar() or HasVehicleActionBar()) and total == 12 then + bar.backdrop:ClearAllPoints() + bar.backdrop:SetPointToScale(SV.db.SVBar["Bar1"].point, bar, SV.db.SVBar["Bar1"].point) + bar.backdrop:SetWidthToScale(space + ((size * rows) + (space * (rows - 1)) + space)) + bar.backdrop:SetHeightToScale(space + ((size * columns) + (space * (columns - 1)) + space)) + bar.backdrop:SetFrameLevel(0); + else + bar.backdrop:SetAllPoints() + bar.backdrop:SetFrameLevel(0); + end + MOD:RefreshBar("Bar1") +end +--[[ +########################################################## +HOOKED / REGISTERED FUNCTIONS +########################################################## +]]-- +local SVUIOptionsPanel_OnEvent = function() + InterfaceOptionsActionBarsPanelBottomRight.Text:SetText((L['Remove Bar %d Action Page']):format(2)) + InterfaceOptionsActionBarsPanelBottomLeft.Text:SetText((L['Remove Bar %d Action Page']):format(3)) + InterfaceOptionsActionBarsPanelRightTwo.Text:SetText((L['Remove Bar %d Action Page']):format(4)) + InterfaceOptionsActionBarsPanelRight.Text:SetText((L['Remove Bar %d Action Page']):format(5)) + InterfaceOptionsActionBarsPanelBottomRight:SetScript('OnEnter',nil) + InterfaceOptionsActionBarsPanelBottomLeft:SetScript('OnEnter',nil) + InterfaceOptionsActionBarsPanelRightTwo:SetScript('OnEnter',nil) + InterfaceOptionsActionBarsPanelRight:SetScript('OnEnter',nil) +end + +local SVUIButton_ShowOverlayGlow = function(self) + if not self.overlay then return end + local size = self:GetWidth() / 3; + self.overlay:SetAllPointsOut(self, size) +end + +local ResetAllBindings = function(self) + if InCombatLockdown() then return end + + local bar + for i = 1, 6 do + bar = _G[("SVUI_ActionBar%d"):format(i)] + if(bar) then + ClearOverrideBindings(bar) + end + end + + ClearOverrideBindings(_G["SVUI_PetActionBar"]) + ClearOverrideBindings(_G["SVUI_StanceBar"]) + + self:RegisterEvent("PLAYER_REGEN_DISABLED", "UpdateAllBindings") +end +--[[ +########################################################## +BAR CREATION +########################################################## +]]-- +local CreateActionBars, CreateStanceBar, CreatePetBar; +local barBindingIndex = { + "ACTIONBUTTON%d", + "MULTIACTIONBAR2BUTTON%d", + "MULTIACTIONBAR1BUTTON%d", + "MULTIACTIONBAR4BUTTON%d", + "MULTIACTIONBAR3BUTTON%d", + "SVUIACTIONBAR6BUTTON%d" +} +local barPageIndex = {1, 5, 6, 4, 3, 2} + +CreateActionBars = function(self) + for i = 1, 6 do + local barID = ("Bar%d"):format(i) + local barName = ("SVUI_Action%s"):format(barID) + local buttonMax = NUM_ACTIONBAR_BUTTONS + + local space = SV.db.SVBar["Bar"..i].buttonspacing + + local thisBar = NewActionBar(barName) + thisBar.binding = barBindingIndex[i] + thisBar.page = barPageIndex[i] + + if(i == 1) then + thisBar:SetPointToScale("BOTTOM", SV.Screen, "BOTTOM", 0, 28) + elseif(i == 2) then + thisBar:SetPointToScale("BOTTOM", _G["SVUI_ActionBar1"], "TOP", 0, -space) + elseif(i == 3) then + thisBar:SetPointToScale("BOTTOMLEFT", _G["SVUI_ActionBar1"], "BOTTOMRIGHT", space, 0) + elseif(i == 4) then + thisBar:SetPointToScale("RIGHT", SV.Screen, "RIGHT", -space, 0) + elseif(i == 5) then + thisBar:SetPointToScale("BOTTOMRIGHT", _G["SVUI_ActionBar1"], "BOTTOMLEFT", -space, 0) + else + thisBar:SetPointToScale("BOTTOM", _G["SVUI_ActionBar2"], "TOP", 0, space) + end + + local bg = CreateFrame("Frame", nil, thisBar) + bg:SetAllPoints() + bg:SetFrameLevel(0) + thisBar:SetFrameLevel(5) + bg:SetStylePanel("Default", "Component") + bg:SetPanelColor("dark") + thisBar.backdrop = bg + + for k = 1, buttonMax do + local buttonName = ("%sButton%d"):format(barName, k) + thisBar.buttons[k] = NewActionButton(thisBar, k, buttonName) + thisBar.buttons[k]:SetState(0, "action", k) + for x = 1, 14 do + local calc = (x - 1) * buttonMax + k; + thisBar.buttons[k]:SetState(x, "action", calc) + end + if k == 12 then + thisBar.buttons[k]:SetState(12, "custom", { + func = function(...) + if UnitExists("vehicle") then + VehicleExit() + else + PetDismiss() + end + end, + texture = "Interface\\Vehicles\\UI-Vehicles-Button-Exit-Down", + tooltip = LEAVE_VEHICLE + }); + end + end + + self:SetBarConfigData(thisBar) + + if i == 1 then + thisBar:SetAttribute("hasTempBar", true) + else + thisBar:SetAttribute("hasTempBar", false) + end + + thisBar:SetAttribute("_onstate-page", [[ + if HasTempShapeshiftActionBar() and self:GetAttribute("hasTempBar") then + newstate = GetTempShapeshiftBarIndex() or newstate + end + + if newstate ~= 0 then + self:SetAttribute("state", newstate) + control:ChildUpdate("state", newstate) + else + local newCondition = self:GetAttribute("newCondition") + if newCondition then + newstate = SecureCmdOptionParse(newCondition) + self:SetAttribute("state", newstate) + control:ChildUpdate("state", newstate) + end + end + ]]) + + self:RefreshBar(barID) + SV.Mentalo:Add(thisBar, L[barID]) + end +end + +do + local function SetStanceBarButtons() + local maxForms = GetNumShapeshiftForms(); + local currentForm = GetShapeshiftForm(); + local maxButtons = NUM_STANCE_SLOTS; + local texture, name, isActive, isCastable, _; + for i = 1, maxButtons do + local button = _G["SVUI_StanceBarButton"..i] + local icon = _G["SVUI_StanceBarButton"..i.."Icon"] + if i <= maxForms then + texture, name, isActive, isCastable = GetShapeshiftFormInfo(i) + if texture == "Interface\\Icons\\Spell_Nature_WispSplode" and SV.db.SVBar.Stance.style == "darkenInactive" then + _, _, texture = GetSpellInfo(name) + end + + icon:SetTexture(texture) + + if(button.cd) then + if texture then + button.cd:SetAlpha(1) + button.cd:SetSwipeColor(0, 0, 0, 1) + button.cd:SetDrawBling(true) + else + button.cd:SetAlpha(0) + button.cd:SetSwipeColor(0, 0, 0, 0) + button.cd:SetDrawBling(false) + end + end + + if isActive then + StanceBarFrame.lastSelected = button:GetID() + + if maxForms > 1 then + if button.checked then button.checked:SetTexture(0, 0.5, 0, 0.2) end + button:SetBackdropBorderColor(0.4, 0.8, 0) + end + icon:SetVertexColor(1, 1, 1) + button:SetChecked(true) + else + if maxForms > 1 and currentForm > 0 then + button:SetBackdropBorderColor(0, 0, 0) + if button.checked then + button.checked:SetAlpha(1) + end + if SV.db.SVBar.Stance.style == "darkenInactive" then + icon:SetVertexColor(0.25, 0.25, 0.25) + else + icon:SetVertexColor(1, 1, 1) + end + end + + button:SetChecked(false) + end + if isCastable then + icon:SetDesaturated(false) + button:SetAlpha(1) + else + icon:SetDesaturated(true) + button:SetAlpha(0.4) + end + end + end + end + + local function UpdateShapeshiftForms(self, event) + if InCombatLockdown() or not _G["SVUI_StanceBar"] then return end + + local stanceBar = _G["SVUI_StanceBar"]; + + for i = 1, #stanceBar.buttons do + stanceBar.buttons[i]:Hide() + end + + local ready = false; + local maxForms = GetNumShapeshiftForms() + + for i = 1, NUM_STANCE_SLOTS do + if(not stanceBar.buttons[i]) then + stanceBar.buttons[i] = CreateFrame("CheckButton", format("SVUI_StanceBarButton%d", i), stanceBar, "StanceButtonTemplate") + stanceBar.buttons[i]:SetID(i) + ready = true + end + if(i <= maxForms) then + stanceBar.buttons[i]:Show() + else + stanceBar.buttons[i]:Hide() + end + end + + MOD:RefreshBar("Stance") + + SetStanceBarButtons() + if not C_PetBattles.IsInBattle() or ready then + if maxForms == 0 then + UnregisterStateDriver(stanceBar, "show") + stanceBar:Hide() + else + stanceBar:Show() + RegisterStateDriver(stanceBar, "show", "[petbattle] hide;show") + end + end + end + + local function UpdateShapeshiftCD() + local maxForms = GetNumShapeshiftForms() + for i = 1, NUM_STANCE_SLOTS do + if i <= maxForms then + local cooldown = _G["SVUI_StanceBarButton"..i.."Cooldown"] + local start, duration, enable = GetShapeshiftFormCooldown(i) + CooldownFrame_SetTimer(cooldown, start, duration, enable) + end + end + end + + CreateStanceBar = function(self) + local barID = "Stance"; + local parent = _G["SVUI_ActionBar1"] + local maxForms = GetNumShapeshiftForms(); + if SV.db.SVBar["Bar2"].enable then + parent = _G["SVUI_ActionBar2"] + end + + local stanceBar = NewActionBar("SVUI_StanceBar") + stanceBar.binding = "CLICK SVUI_StanceBarButton%d:LeftButton" + + stanceBar:SetPointToScale("BOTTOMRIGHT",parent,"TOPRIGHT",0,2); + stanceBar:SetFrameLevel(5); + + local bg = CreateFrame("Frame", nil, stanceBar) + bg:SetAllPoints(); + bg:SetFrameLevel(0); + bg:SetStylePanel("Default", "Component") + bg:SetPanelColor("dark") + stanceBar.backdrop = bg; + + for i = 1, NUM_STANCE_SLOTS do + stanceBar.buttons[i] = _G["SVUI_StanceBarButton"..i] + end + + stanceBar:SetAttribute("_onstate-show", [[ + if newstate == "hide" then + self:Hide(); + else + self:Show(); + end + ]]); + + self:RegisterEvent("UPDATE_SHAPESHIFT_FORMS", UpdateShapeshiftForms) + self:RegisterEvent("UPDATE_SHAPESHIFT_COOLDOWN", UpdateShapeshiftCD) + self:RegisterEvent("UPDATE_SHAPESHIFT_USABLE", SetStanceBarButtons) + self:RegisterEvent("UPDATE_SHAPESHIFT_FORM", SetStanceBarButtons) + self:RegisterEvent("ACTIONBAR_PAGE_CHANGED", SetStanceBarButtons) + UpdateShapeshiftForms() + SV.Mentalo:Add(stanceBar, L["Stance Bar"], -3) + self:RefreshBar("Stance") + SetStanceBarButtons() + self:UpdateBarBindings(false, true) + end +end + +do + local RefreshPet = function(self, event, arg) + if event == "UNIT_AURA" and arg ~= "pet" then return end + for i = 1, NUM_PET_ACTION_SLOTS, 1 do + local name = "PetActionButton"..i; + local button = _G[name] + local icon = _G[name.."Icon"] + local auto = _G[name.."AutoCastable"] + local shine = _G[name.."Shine"] + local checked = button:GetCheckedTexture() + local actionName, subtext, actionIcon, isToken, isActive, autoCastAllowed, autoCastEnabled = GetPetActionInfo(i) + button:SetChecked(false) + button:SetBackdropBorderColor(0, 0, 0) + checked:SetAlpha(0) + if(not isToken) then + icon:SetTexture(actionIcon) + button.tooltipName = actionName + else + icon:SetTexture(_G[actionIcon]) + button.tooltipName = _G[actionName] + end + button.isToken = isToken; + button.tooltipSubtext = subtext; + if arg and actionName ~= "PET_ACTION_FOLLOW" then + if(IsPetAttackAction(i)) then PetActionButton_StartFlash(button) end + else + if(IsPetAttackAction(i)) then PetActionButton_StopFlash(button) end + end + if autoCastAllowed then + auto:Show() + else + auto:Hide() + end + if (isActive and actionName ~= "PET_ACTION_FOLLOW") then + button:SetChecked(true) + checked:SetAlpha(1) + button:SetBackdropBorderColor(0.4, 0.8, 0) + else + button:SetChecked(false) + checked:SetAlpha(0) + button:SetBackdropBorderColor(0, 0, 0) + end + if(autoCastEnabled) then + AutoCastShine_AutoCastStart(shine) + else + AutoCastShine_AutoCastStop(shine) + end + button:SetAlpha(1) + if actionIcon then + icon:Show() + if GetPetActionSlotUsable(i)then + SetDesaturation(icon, nil) + else + SetDesaturation(icon, 1) + end + if(button.cd) then + button.cd:SetAlpha(1) + button.cd:SetSwipeColor(0, 0, 0, 1) + button.cd:SetDrawBling(true) + end + else + icon:Hide() + if(button.cd) then + button.cd:SetAlpha(0) + button.cd:SetSwipeColor(0, 0, 0, 0) + button.cd:SetDrawBling(false) + end + end + + if(not PetHasActionBar() and actionIcon and actionName ~= "PET_ACTION_FOLLOW") then + PetActionButton_StopFlash(button) + SetDesaturation(icon, 1) + button:SetChecked(false) + end + end + end + + CreatePetBar = function(self) + local barID = "Pet"; + local parent = _G["SVUI_ActionBar1"] + if SV.db.SVBar["Bar2"].enable then + parent = _G["SVUI_ActionBar2"] + end + + local petBar = NewActionBar("SVUI_PetActionBar") + petBar.binding = "BONUSACTIONBUTTON%d" + + petBar:SetPointToScale("BOTTOMLEFT",parent,"TOPLEFT",0,2); + petBar:SetFrameLevel(5); + local bg = CreateFrame("Frame", nil, petBar) + bg:SetAllPoints(); + bg:SetFrameLevel(0); + bg:SetStylePanel("Default", "Component") + bg:SetPanelColor("dark") + petBar.backdrop = bg; + for i = 1, NUM_PET_ACTION_SLOTS do + petBar.buttons[i] = _G["PetActionButton"..i] + end + petBar:SetAttribute("_onstate-show", [[ + if newstate == "hide" then + self:Hide(); + else + self:Show(); + end + ]]); + + PetActionBarFrame.showgrid = 1; + PetActionBar_ShowGrid(); + + self:RefreshBar("Pet") + self:UpdateBarBindings(true, false) + + self:RegisterEvent("PLAYER_CONTROL_GAINED", RefreshPet) + self:RegisterEvent("PLAYER_ENTERING_WORLD", RefreshPet) + self:RegisterEvent("PLAYER_CONTROL_LOST", RefreshPet) + self:RegisterEvent("PET_BAR_UPDATE", RefreshPet) + self:RegisterEvent("UNIT_PET", RefreshPet) + self:RegisterEvent("UNIT_FLAGS", RefreshPet) + self:RegisterEvent("UNIT_AURA", RefreshPet) + self:RegisterEvent("PLAYER_FARSIGHT_FOCUS_CHANGED", RefreshPet) + self:RegisterEvent("PET_BAR_UPDATE_COOLDOWN", PetActionBar_UpdateCooldowns) + + SV.Mentalo:Add(petBar, L["Pet Bar"]) + end +end +--[[ +########################################################## +DEFAULT REMOVAL +########################################################## +]]-- +local function RemoveDefaults() + if(InCombatLockdown()) then + MOD:RegisterEvent("PLAYER_REGEN_ENABLED") + return + end + local removalManager = CreateFrame("Frame") + removalManager:Hide() + MultiBarBottomLeft:SetParent(removalManager) + MultiBarBottomRight:SetParent(removalManager) + MultiBarLeft:SetParent(removalManager) + MultiBarRight:SetParent(removalManager) + + for i = 1, 12 do + local ab = _G[("ActionButton%d"):format(i)] + ab:Hide() + ab:UnregisterAllEvents() + ab:SetAttribute("statehidden", true) + local mbl = _G[("MultiBarLeftButton%d"):format(i)] + mbl:Hide() + mbl:UnregisterAllEvents() + mbl:SetAttribute("statehidden", true) + local mbr = _G[("MultiBarRightButton%d"):format(i)] + mbr:Hide() + mbr:UnregisterAllEvents() + mbr:SetAttribute("statehidden", true) + local mbbl = _G[("MultiBarBottomLeftButton%d"):format(i)] + mbbl:Hide() + mbbl:UnregisterAllEvents() + mbbl:SetAttribute("statehidden", true) + local mbbr = _G[("MultiBarBottomRightButton%d"):format(i)] + mbbr:Hide() + mbbr:UnregisterAllEvents() + mbbr:SetAttribute("statehidden", true) + local mca = _G[("MultiCastActionButton%d"):format(i)] + mca:Hide() + mca:UnregisterAllEvents() + mca:SetAttribute("statehidden", true) + local vb = _G[("VehicleMenuBarActionButton%d"):format(i)] + if(vb) then + vb:Hide() + vb:UnregisterAllEvents() + vb:SetAttribute("statehidden", true) + end + local ob = _G[("OverrideActionBarButton%d"):format(i)] + if(ob) then + ob:Hide() + ob:UnregisterAllEvents() + ob:SetAttribute("statehidden", true) + end + end + + ActionBarController:UnregisterAllEvents() + ActionBarController:RegisterEvent("UPDATE_EXTRA_ACTIONBAR") + + MainMenuBar:EnableMouse(false) + MainMenuBar:SetAlpha(0) + MainMenuExpBar:UnregisterAllEvents() + MainMenuExpBar:Hide() + MainMenuExpBar:SetParent(removalManager) + local maxChildren = MainMenuBar:GetNumChildren(); + for i = 1, maxChildren do + local child = select(i, MainMenuBar:GetChildren()) + if child then + child:UnregisterAllEvents() + child:Hide() + child:SetParent(removalManager) + end + end + ReputationWatchBar:UnregisterAllEvents() + ReputationWatchBar:Hide() + ReputationWatchBar:SetParent(removalManager) + MainMenuBarArtFrame:UnregisterEvent("ACTIONBAR_PAGE_CHANGED") + MainMenuBarArtFrame:UnregisterEvent("ADDON_LOADED") + MainMenuBarArtFrame:Hide() + MainMenuBarArtFrame:SetParent(removalManager) + StanceBarFrame:UnregisterAllEvents() + StanceBarFrame:Hide() + StanceBarFrame:SetParent(removalManager) + OverrideActionBar:UnregisterAllEvents() + OverrideActionBar:Hide() + OverrideActionBar:SetParent(removalManager) + PossessBarFrame:UnregisterAllEvents() + PossessBarFrame:Hide() + PossessBarFrame:SetParent(removalManager) + PetActionBarFrame:UnregisterAllEvents() + PetActionBarFrame:Hide() + PetActionBarFrame:SetParent(removalManager) + MultiCastActionBarFrame:UnregisterAllEvents() + MultiCastActionBarFrame:Hide() + MultiCastActionBarFrame:SetParent(removalManager) + IconIntroTracker:UnregisterAllEvents() + IconIntroTracker:Hide() + IconIntroTracker:SetParent(removalManager) + + InterfaceOptionsCombatPanelActionButtonUseKeyDown:SetScale(0.0001) + InterfaceOptionsCombatPanelActionButtonUseKeyDown:SetAlpha(0) + InterfaceOptionsActionBarsPanelAlwaysShowActionBars:EnableMouse(false) + InterfaceOptionsActionBarsPanelPickupActionKeyDropDownButton:SetScale(0.0001) + InterfaceOptionsActionBarsPanelLockActionBars:SetScale(0.0001) + InterfaceOptionsActionBarsPanelAlwaysShowActionBars:SetAlpha(0) + InterfaceOptionsActionBarsPanelPickupActionKeyDropDownButton:SetAlpha(0) + InterfaceOptionsActionBarsPanelLockActionBars:SetAlpha(0) + InterfaceOptionsActionBarsPanelPickupActionKeyDropDown:SetAlpha(0) + InterfaceOptionsActionBarsPanelPickupActionKeyDropDown:SetScale(0.00001) + InterfaceOptionsStatusTextPanelXP:SetAlpha(0) + InterfaceOptionsStatusTextPanelXP:SetScale(0.00001) + + if PlayerTalentFrame then + PlayerTalentFrame:UnregisterEvent("ACTIVE_TALENT_GROUP_CHANGED") + else + hooksecurefunc("TalentFrame_LoadUI", function() PlayerTalentFrame:UnregisterEvent("ACTIVE_TALENT_GROUP_CHANGED") end) + end + + MOD.DefaultsRemoved = true +end + +function MOD:PLAYER_REGEN_ENABLED() + self:UnregisterEvent("PLAYER_REGEN_ENABLED") + if(not MOD.DefaultsRemoved) then + RemoveDefaults() + end + self:RefreshActionBars() +end +--[[ +########################################################## +BUILD FUNCTION / UPDATE +########################################################## +]]-- +function MOD:ReLoad() + self:RefreshActionBars(); +end + +function MOD:Load() + RemoveDefaults(); + + self:UpdateBarPagingDefaults() + + CreateActionBars(self) + CreateStanceBar(self) + CreatePetBar(self) + self:InitializeMicroBar() + self:InitializeExtraButtons() + + self:LoadKeyBinder() + + self:RegisterEvent("UPDATE_BINDINGS", "UpdateAllBindings") + self:RegisterEvent("PET_BATTLE_CLOSE", "UpdateAllBindings") + self:RegisterEvent("PET_BATTLE_OPENING_DONE", ResetAllBindings) + self:RegisterEvent("UPDATE_VEHICLE_ACTIONBAR", Vehicle_Updater) + self:RegisterEvent("UPDATE_OVERRIDE_ACTIONBAR", Vehicle_Updater) + if C_PetBattles.IsInBattle()then + ResetAllBindings(self) + else + self:UpdateAllBindings() + end + NewHook("BlizzardOptionsPanel_OnEvent", SVUIOptionsPanel_OnEvent) + NewHook("ActionButton_ShowOverlayGlow", SVUIButton_ShowOverlayGlow) + if not GetCVarBool("lockActionBars") then SetCVar("lockActionBars", 1) end + SetSpellFlyoutHook() + + self.IsLoaded = true +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/bar/SVBar.xml b/Interface/AddOns/SVUI/packages/bar/SVBar.xml new file mode 100644 index 0000000..8049a73 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/bar/SVBar.xml @@ -0,0 +1,6 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Script file="SVBar.lua"/> + <Script file="components\keybind.lua"/> + <Script file="components\micro.lua"/> + <Script file="components\extra.lua"/> +</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/bar/components/extra.lua b/Interface/AddOns/SVUI/packages/bar/components/extra.lua new file mode 100644 index 0000000..b025066 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/bar/components/extra.lua @@ -0,0 +1,182 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local string = _G.string; +local math = _G.math; +--[[ STRING METHODS ]]-- +local find, format, split = string.find, string.format, string.split; +local gsub = string.gsub; +--[[ MATH METHODS ]]-- +local ceil = math.ceil; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L; +local MOD = SV.SVBar; + +local DefaultExtraActionStyle = "Interface\\ExtraButton\\Default"; +--[[ +########################################################## +EXTRA ACTION BUTTON INTERNALS +########################################################## +]]-- +local ExtraButton_OnEvent = function(self, event) + if(event == 'UPDATE_EXTRA_ACTIONBAR') then + local action = ExtraActionButton1:GetAttribute('action') + self:SetAbility(action) + self:UpdateCooldown() + elseif(event == 'PLAYER_REGEN_ENABLED') then + self:SetAttribute('action', self.attribute) + self:UnregisterEvent(event) + self:UpdateCooldown() + elseif(event == 'UPDATE_BINDINGS') then + if(self:IsShown()) then + self:SetAttribute('binding', GetTime()) + self:SetAbility() + end + else + self:Update() + end +end + +local ExtraButtonUpdate = function(self) + if(HasExtraActionBar()) then + local texture = GetOverrideBarSkin() or DefaultExtraActionStyle; + self.Artwork:SetTexture(texture) + else + self:RemoveAbility(); + end +end +--[[ +########################################################## +DRAENOR ZONE BUTTON INTERNALS +########################################################## +]]-- +local DraenorButton_OnDrag = function(self) + if(self.spellID) then + PickupSpell(DraenorZoneAbilitySpellID); + end +end + +local DraenorButton_OnEvent = function(self, event) + if(event == "SPELLS_CHANGED") then + if(not self.baseName) then + self.baseName = GetSpellInfo(DraenorZoneAbilitySpellID); + end + self:UpdateCooldown() + elseif(event == 'PLAYER_REGEN_ENABLED') then + self:SetAttribute('spell', self.attribute) + self:UnregisterEvent(event) + self:UpdateCooldown() + elseif(event == 'UPDATE_BINDINGS') then + if(self:IsShown()) then + self:SetAbility() + self:SetAttribute('binding', GetTime()) + end + else + self:Update() + end + + if(not self.baseName) then + return; + end + + local lastState = self.BuffSeen; + self.BuffSeen = HasDraenorZoneAbility(); + local spellName, _, texture, _, _, _, spellID = GetSpellInfo(self.baseName); + + if(self.BuffSeen) then + if(not HasDraenorZoneSpellOnBar(self)) then + self:SetAbility(spellID, spellName, texture); + else + self:RemoveAbility(); + end + else + DraenorZoneAbilityFrame.CurrentTexture = texture; + self:RemoveAbility(); + end + + -- if(lastState ~= self.BuffSeen) then + -- UIParent_ManageFramePositions(); + -- ActionBarController_UpdateAll(true); + -- end +end + +local DraenorButtonUpdate = function(self) + if (not self.baseName) then + return; + end + local name, _, tex, _, _, _, spellID = GetSpellInfo(self.baseName); + + DraenorZoneAbilityFrame.CurrentTexture = tex; + DraenorZoneAbilityFrame.CurrentSpell = name; + + self.Icon:SetTexture(tex); + self.Artwork:SetTexture(DRAENOR_ZONE_SPELL_ABILITY_TEXTURES_BASE[spellID]) + + local charges, maxCharges, chargeStart, chargeDuration = GetSpellCharges(spellID); + local usesCharges = false; + if(self.Count) then + if(maxCharges and maxCharges > 1) then + self.Count:SetText(charges); + usesCharges = true; + else + self.Count:SetText(""); + end + end + + local start, duration, enable = GetSpellCooldown(name); + + if(usesCharges and charges < maxCharges) then + CooldownFrame_SetTimer(self.Cooldown, chargeStart, chargeDuration, enable, charges, maxCharges); + elseif(start) then + CooldownFrame_SetTimer(self.Cooldown, start, duration, enable); + end + + self.spellName = name; + self.spellID = spellID; +end +--[[ +########################################################## +PACKAGE CALL +########################################################## +]]-- +function MOD:InitializeExtraButtons() + local extra = SV.SuperButton:AddAction("SVUI_ExtraActionButton", ExtraButtonUpdate, ExtraButton_OnEvent, 'EXTRAACTIONBUTTON1'); + extra:RegisterEvent('UPDATE_EXTRA_ACTIONBAR') + ExtraActionBarFrame:UnregisterAllEvents() + + local draenor = SV.SuperButton:AddSpell("SVUI_DraenorZoneAbility", DraenorButtonUpdate, DraenorButton_OnEvent, 'SVUI_DRAENORZONE'); + draenor:RegisterForDrag("LeftButton") + draenor:SetScript('OnDragStart', DraenorButton_OnDrag) + draenor:RegisterUnitEvent("UNIT_AURA", "player"); + draenor:RegisterEvent("SPELL_UPDATE_COOLDOWN"); + draenor:RegisterEvent("SPELL_UPDATE_USABLE"); + draenor:RegisterEvent("SPELL_UPDATE_CHARGES"); + draenor:RegisterEvent("SPELLS_CHANGED"); + draenor:RegisterEvent("ACTIONBAR_SLOT_CHANGED"); + DraenorZoneAbilityFrame:UnregisterAllEvents() +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/bar/components/keybind.lua b/Interface/AddOns/SVUI/packages/bar/components/keybind.lua new file mode 100644 index 0000000..b119607 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/bar/components/keybind.lua @@ -0,0 +1,525 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local string = _G.string; +local math = _G.math; +local table = _G.table; +local GetTime = _G.GetTime; +--[[ STRING METHODS ]]-- +local format, find = string.format, string.find; +--[[ MATH METHODS ]]-- +local floor = math.floor; +local tonumber = tonumber; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L; +local MOD = SV.SVBar; + +local _G = getfenv(0); + +local RefreshBindings +local NewFrame = CreateFrame; +local NewHook = hooksecurefunc; + +local Binder = NewFrame("Frame", nil, UIParent); +--[[ +########################################################## +BINDING UPDATES +########################################################## +]]-- +do + --[[ HANDLERS ]]-- + local GameTooltip_OnHide = function(self) + self:SetOwner(Binder, "ANCHOR_TOP") + self:SetPoint("BOTTOM", Binder, "TOP", 0, 1) + self:AddLine(Binder.button.name, 1, 1, 1) + Binder.button.bindings = {GetBindingKey(Binder.button.bindstring)} + local count = #Binder.button.bindings + if(count == 0) then + self:AddLine(L["No bindings set."], .6, .6, .6) + else + self:AddDoubleLine(L["Binding"], L["Key"], .6, .6, .6, .6, .6, .6) + for i = 1, count do + self:AddDoubleLine(i, Binder.button.bindings[i]) + end + end + self:Show() + self:SetScript("OnHide", nil) + end + --[[ END OF HANDLERS ]]-- + + function RefreshBindings(bindTarget, bindType) + if(not Binder.active or InCombatLockdown()) then return end + Binder.button = bindTarget; + Binder.spellmacro = bindType; + Binder:ClearAllPoints() + Binder:SetAllPoints(bindTarget) + Binder:Show() + ShoppingTooltip1:Hide() + if(bindTarget.FlyoutArrow and bindTarget.FlyoutArrow:IsShown()) then + Binder:EnableMouse(false) + elseif(not Binder:IsMouseEnabled()) then + Binder:EnableMouse(true) + end + local keyBindID, keyBindName, keyBindString; + if bindType == "FLYOUT" then + keyBindName = GetSpellInfo(bindTarget.spellID); + keyBindString = ("SPELL %s"):format(keyBindName); + Binder.button.name = keyBindName + Binder.button.bindstring = keyBindString; + GameTooltip:AddLine(L["Trigger"]) + GameTooltip:Show() + GameTooltip:SetScript("OnHide", GameTooltip_OnHide) + elseif bindType == "SPELL" then + keyBindID = SpellBook_GetSpellBookSlot(bindTarget) + keyBindName = GetSpellBookItemName(keyBindID, SpellBookFrame.bookType); + keyBindString = ("SPELL %s"):format(keyBindName); + Binder.button.id = keyBindID + Binder.button.name = keyBindName + Binder.button.bindstring = keyBindString; + GameTooltip:AddLine(L["Trigger"]) + GameTooltip:Show() + GameTooltip:SetScript("OnHide", GameTooltip_OnHide) + elseif bindType == "MACRO" then + keyBindID = bindTarget:GetID() + if(floor(.5 + select(2, MacroFrameTab1Text:GetTextColor()) * 10) / 10 == .8) then + keyBindID = keyBindID + 36 + end + keyBindName = GetMacroInfo(keyBindID) + keyBindString = ("MACRO %s"):format(keyBindName); + Binder.button.id = keyBindID + Binder.button.name = keyBindName + Binder.button.bindstring = keyBindString; + Binder.button.bindings = {GetBindingKey(keyBindString)} + GameTooltip:SetOwner(Binder, "ANCHOR_TOP") + GameTooltip:SetPoint("BOTTOM", Binder, "TOP", 0, 1) + GameTooltip:AddLine(keyBindName, 1, 1, 1) + if #Binder.button.bindings == 0 then + GameTooltip:AddLine(L["No bindings set."], .6, .6, .6) + else + GameTooltip:AddDoubleLine(L["Binding"], L["Key"], .6, .6, .6, .6, .6, .6) + for i = 1, #Binder.button.bindings do + local lineName = ("%s%d"):format(L["Binding"], i) + GameTooltip:AddDoubleLine(lineName, Binder.button.bindings[i], 1, 1, 1) + end + end + GameTooltip:Show() + elseif bindType == "STANCE" or bindType == "PET" then + keyBindID = tonumber(bindTarget:GetID()) + keyBindName = bindTarget:GetName() + if(not keyBindName) then return end + if ((not keyBindID) or (keyBindID < 1) or (keyBindID > (bindType == "STANCE" and 10 or 12))) then + keyBindString = ("CLICK %s: LeftButton"):format(keyBindName); + else + local tmpStr = bindType == "STANCE" and "StanceButton" or "BONUSACTIONBUTTON" + keyBindString = ("%s%d"):format(tmpStr, keyBindID); + end + Binder.button.id = keyBindID + Binder.button.name = keyBindName + Binder.button.bindstring = keyBindString + GameTooltip:AddLine(L["Trigger"]) + GameTooltip:Show() + GameTooltip:SetScript("OnHide", GameTooltip_OnHide) + else + keyBindID = tonumber(bindTarget.action) + keyBindName = bindTarget:GetName() + if(not keyBindName) then return end + if(not bindTarget.keyBoundTarget and ((not keyBindID) or (keyBindID < 1) or (keyBindID > 132))) then + keyBindString = ("CLICK %s: LeftButton"):format(keyBindName); + elseif(bindTarget.keyBoundTarget) then + keyBindString = bindTarget.keyBoundTarget + else + local slotID = 1 + (keyBindID - 1) % 12; + if((keyBindID < 25) or (keyBindID > 72)) then + keyBindString = ("ACTIONBUTTON%s"):format(slotID); + elseif((keyBindID < 73) and (keyBindID > 60)) then + keyBindString = ("MULTIACTIONBAR1BUTTON%s"):format(slotID); + elseif(keyBindID < 61 and keyBindID > 48) then + keyBindString = ("MULTIACTIONBAR2BUTTON%s"):format(slotID); + elseif(keyBindID < 49 and keyBindID > 36) then + keyBindString = ("MULTIACTIONBAR4BUTTON%s"):format(slotID); + elseif(keyBindID < 37 and keyBindID > 24) then + keyBindString = ("MULTIACTIONBAR3BUTTON%s"):format(slotID); + end + end + Binder.button.action = keyBindID + Binder.button.name = keyBindName + Binder.button.bindstring = keyBindString + GameTooltip:AddLine(L["Trigger"]) + GameTooltip:Show() + GameTooltip:SetScript("OnHide", GameTooltip_OnHide) + end + end +end +--[[ +########################################################## +PACKAGE PLUGIN +########################################################## +]]-- +function MOD:ToggleKeyBindingMode(deactivate, saveRequested) + if not deactivate then + Binder.active = true; + SV:StaticPopupSpecial_Show(SVUI_KeyBindPopup) + MOD:RegisterEvent('PLAYER_REGEN_DISABLED','ToggleKeyBindingMode',true,false) + else + if saveRequested then + SaveBindings(GetCurrentBindingSet()) + SV:AddonMessage(L["Binding Changes Stored"]) + else + LoadBindings(GetCurrentBindingSet()) + SV:AddonMessage(L["Binding Changes Discarded"]) + end + Binder.active = false; + Binder:ClearAllPoints() + Binder:Hide() + GameTooltip:Hide() + MOD:UnregisterEvent("PLAYER_REGEN_DISABLED") + SV:StaticPopupSpecial_Hide(SVUI_KeyBindPopup) + MOD.bindingsChanged = false + end +end + +local blockedButtons = { LSHIFT = true, RSHIFT = true, LCTRL = true, RCTRL = true, LALT = true, RALT = true, UNKNOWN = true, LeftButton = true} + +--[[ HANDLERS ]]-- +local tipTimeLapse = 0; +local GameTooltip_OnUpdate = function(self, elapsed) + tipTimeLapse = (tipTimeLapse + elapsed); + if tipTimeLapse < .2 then + return + else + tipTimeLapse = 0 + end + if(not self.comparing and IsModifiedClick("COMPAREITEMS")) then + GameTooltip_ShowCompareItem(self) + self.comparing = true + elseif(self.comparing and not IsModifiedClick("COMPAREITEMS")) then + for _,tip in pairs(self.shoppingTooltips)do + tip:Hide() + end + self.comparing = false + end +end + +local GameTooltip_OnHide = function(self) + for _, tip in pairs(self.shoppingTooltips)do + tip:Hide() + end +end + +local GameTooltip_OnHide = function(self) + for _, tip in pairs(self.shoppingTooltips)do + tip:Hide() + end +end + +local SpellButton_OnEnter = function(self) + RefreshBindings(self, "SPELL") +end + +local Button_Proxy = function(self) + RefreshBindings(self) +end +local Stance_Proxy = function(self) + RefreshBindings(self,"STANCE") +end +local Pet_Proxy = function(self) + RefreshBindings(self,"PET") +end +local Flyout_Proxy = function(self) + RefreshBindings(self,"FLYOUT") +end +local Macro_Proxy = function(self) + RefreshBindings(self, "MACRO") +end + +local BinderButton_OnEnter = function(self) + local parent = self.button:GetParent() + if parent and parent._fade then + parent:FadeIn(0.2, parent:GetAlpha(), parent._alpha) + end +end + +local BinderButton_OnLeave = function(self) + local parent = self.button:GetParent() + self:ClearAllPoints() + self:Hide() + GameTooltip:Hide() + if parent and parent._fade then + parent:FadeOut(1, parent:GetAlpha(), 0) + end +end + +local Binder_OnBinding = function(self, event) + MOD.bindingsChanged = true; + if(event == "ESCAPE" or event == "RightButton") then + local count = #Binder.button.bindings + for i=1, count do + SetBinding(Binder.button.bindings[i]) + end + local prefix = L["All keybindings cleared for |cff00ff00%s|r."] + local strMsg = prefix:format(Binder.button.name) + SV:AddonMessage(strMsg) + RefreshBindings(Binder.button, Binder.spellmacro) + if(Binder.spellmacro ~= "MACRO") then + GameTooltip:Hide() + end + return + end + + if(blockedButtons[event]) then return end + if(event == "MiddleButton") then + event = "BUTTON3" + end + if(event:find('Button%d')) then + event = event:upper() + end + + local altText = IsAltKeyDown() and "ALT-" or ""; + local ctrlText = IsControlKeyDown() and "CTRL-" or ""; + local shiftText = IsShiftKeyDown() and "SHIFT-" or ""; + local strBind = ("%s%s%s%s"):format(altText, ctrlText, shiftText, event) + + if(not Binder.spellmacro or Binder.spellmacro == "PET" or Binder.spellmacro == "STANCE" or Binder.spellmacro == "FLYOUT") then + SetBinding(strBind, Binder.button.bindstring) + else + local strMacro = ("%s %s"):format(Binder.spellmacro, Binder.button.name) + SetBinding(strBind, strMacro) + end + + local glue = L[" |cff00ff00bound to |r"] + local addMsg = ("%s%s%s."):format(strBind, glue, Binder.button.name) + SV:AddonMessage(addMsg) + RefreshBindings(Binder.button, Binder.spellmacro) + + if Binder.spellmacro ~= "MACRO" then + GameTooltip:Hide() + end +end + +local BinderButton_OnMouseWheel = function(self, delta) + if delta > 0 then + Binder_OnBinding(self, "MOUSEWHEELUP") + else + Binder_OnBinding(self, "MOUSEWHEELDOWN") + end +end + +local SetBindingMacro = function(self, arg) + if(arg == "Blizzard_MacroUI") then + for i=1,36 do + local btnName = ("MacroButton%d"):format(i) + local btn = _G[btnName] + btn:HookScript("OnEnter", MacroBinding_OnEnter) + end + end +end + +local Check_OnShow = function(self) + self:SetChecked(GetCurrentBindingSet() == 2) +end + +local Check_OnEnter = function(self) + GameTooltip:SetOwner(self, "ANCHOR_RIGHT") + GameTooltip:SetText(CHARACTER_SPECIFIC_KEYBINDING_TOOLTIP, nil, nil, nil, nil, 1) +end + +local Check_OnClick = function(self) + if(MOD.bindingsChanged) then + SV:StaticPopup_Show("CONFIRM_LOSE_BINDING_CHANGES") + else + if SVUI_KeyBindPopupCheckButton:GetChecked() then + LoadBindings(2) + SaveBindings(2) + else + LoadBindings(1) + SaveBindings(1) + end + end +end + +local Save_OnClick = function(self) + MOD:ToggleKeyBindingMode(true, true) +end + +local Discard_OnClick = function(self) + MOD:ToggleKeyBindingMode(true, false) +end +--[[ END OF HANDLERS ]]-- + +local function SetBindingButton(button, force) + local click1 = StanceButton1:GetScript("OnClick") + local click2 = PetActionButton1:GetScript("OnClick") + local click3 = SecureActionButton_OnClick; + local button_OnClick = button:GetScript("OnClick") + if button_OnClick == click3 or force then + button:HookScript("OnEnter", Button_Proxy) + elseif button_OnClick == click1 then + button:HookScript("OnEnter", Stance_Proxy) + elseif button_OnClick == click2 then + button:HookScript("OnEnter", Pet_Proxy) + end +end + +local function RefreshAllFlyouts() + local count = GetNumFlyouts() + for i = 1, count do + local id = GetFlyoutID(i) + local _,_,numSlots,isKnown = GetFlyoutInfo(id) + if isKnown then + for x = 1, numSlots do + local btnName = ("SpellFlyoutButton%d"):format(x) + local btn = _G[btnName] + if(SpellFlyout:IsShown() and btn and btn:IsShown()) then + if(not btn.hookedFlyout) then + btn:HookScript("OnEnter", Flyout_Proxy) + btn.hookedFlyout = true + end + end + end + end + end +end + +function MOD:LoadKeyBinder() + self:RefreshActionBars() + -- Binder:SetParent(SV.Screen) + Binder:SetFrameStrata("DIALOG") + Binder:SetFrameLevel(99) + Binder:EnableMouse(true) + Binder:EnableKeyboard(true) + Binder:EnableMouseWheel(true) + Binder.texture = Binder:CreateTexture() + Binder.texture:SetAllPoints(Binder) + Binder.texture:SetTexture(0, 0, 0, .25) + Binder:Hide() + + GameTooltip:HookScript("OnUpdate", GameTooltip_OnUpdate) + NewHook(GameTooltip, "Hide", GameTooltip_OnHide) + + Binder:SetScript("OnEnter", BinderButton_OnEnter) + Binder:SetScript("OnLeave", BinderButton_OnLeave) + Binder:SetScript("OnKeyUp", Binder_OnBinding) + Binder:SetScript("OnMouseUp", Binder_OnBinding) + Binder:SetScript("OnMouseWheel", BinderButton_OnMouseWheel) + + local OBJECT = EnumerateFrames() + while OBJECT do + if(OBJECT.IsProtected and OBJECT:IsProtected() and OBJECT.GetObjectType and OBJECT:GetObjectType() == "CheckButton" and OBJECT.GetScript) then + SetBindingButton(OBJECT) + end + OBJECT = EnumerateFrames(OBJECT) + end + + for OBJECT, _ in pairs(self.ButtonCache)do + if(OBJECT.IsProtected and OBJECT:IsProtected() and OBJECT.GetObjectType and OBJECT:GetObjectType() == "CheckButton" and OBJECT.GetScript) then + SetBindingButton(OBJECT, true) + end + end + + for i = 1, 12 do + local btnName = ("SpellButton%d"):format(i) + local spellButton = _G[btnName] + spellButton:HookScript("OnEnter", SpellButton_OnEnter) + end + + if not IsAddOnLoaded("Blizzard_MacroUI")then + NewHook("LoadAddOn", SetBindingMacro) + else + for i=1,36 do + local btnName = ("MacroButton%d"):format(i) + local btn = _G[btnName] + btn:HookScript("OnEnter", Macro_Proxy) + end + end + + NewHook("ActionButton_UpdateFlyout", RefreshAllFlyouts) + RefreshAllFlyouts() + + local pop = NewFrame("Frame", "SVUI_KeyBindPopup", UIParent) + pop:SetFrameStrata("DIALOG") + pop:SetToplevel(true) + pop:EnableMouse(true) + pop:SetMovable(true) + pop:SetFrameLevel(99) + pop:SetClampedToScreen(true) + pop:SetWidth(360) + pop:SetHeight(130) + pop:SetStylePanel("Fixed", "Transparent") + pop:Hide() + + local moveHandle = NewFrame("Button", nil, pop) + moveHandle:SetStylePanel("Fixed", "Button", true) + moveHandle:SetWidth(100) + moveHandle:SetHeight(25) + moveHandle:SetPoint("CENTER", pop, "TOP") + moveHandle:SetFrameLevel(moveHandle:GetFrameLevel() + 2) + moveHandle:EnableMouse(true) + moveHandle:RegisterForClicks("AnyUp", "AnyDown") + local onMouseDown = function() pop:StartMoving() end + moveHandle:SetScript("OnMouseDown", onMouseDown) + local onMouseUp = function() pop:StopMovingOrSizing() end + moveHandle:SetScript("OnMouseUp", onMouseUp) + + local moveText = moveHandle:CreateFontString("OVERLAY") + moveText:FontManager("default") + moveText:SetPoint("CENTER", moveHandle, "CENTER") + moveText:SetText("Key Binds") + + local moveDesc = pop:CreateFontString("ARTWORK") + moveDesc:SetFontObject("GameFontHighlight") + moveDesc:SetJustifyV("TOP") + moveDesc:SetJustifyH("LEFT") + moveDesc:SetPoint("TOPLEFT", 18, -32) + moveDesc:SetPoint("BOTTOMRIGHT", -18, 48) + moveDesc:SetText(L["Hover your mouse over any actionbutton or spellbook button to bind it. Press the escape key or right click to clear the current actionbutton's keybinding."]) + + local checkButton = NewFrame("CheckButton", "SVUI_KeyBindPopupCheckButton", pop, "OptionsCheckButtonTemplate") + checkButton:SetStylePanel("Checkbox", true) + _G["SVUI_KeyBindPopupCheckButtonText"]:SetText(CHARACTER_SPECIFIC_KEYBINDINGS) + checkButton:SetScript("OnShow", Check_OnShow) + checkButton:SetScript("OnClick", Check_OnClick) + checkButton:SetScript("OnEnter", Check_OnEnter) + checkButton:SetScript("OnLeave", GameTooltip_Hide) + + local saveButton = NewFrame("Button", "SVUI_KeyBindPopupSaveButton", pop, "OptionsButtonTemplate") + saveButton:SetWidthToScale(150) + saveButton:SetStylePanel("Button") + _G["SVUI_KeyBindPopupSaveButtonText"]:SetText(L["Save"]) + saveButton:SetScript("OnClick", Save_OnClick) + + local discardButton = NewFrame("Button", "SVUI_KeyBindPopupDiscardButton", pop, "OptionsButtonTemplate") + discardButton:SetWidthToScale(150) + discardButton:SetStylePanel("Button") + _G["SVUI_KeyBindPopupDiscardButtonText"]:SetText(L["Discard"]) + discardButton:SetScript("OnClick", Discard_OnClick) + + checkButton:SetPoint("BOTTOMLEFT", discardButton, "TOPLEFT", 0, 2) + saveButton:SetPoint("BOTTOMRIGHT", -14, 10) + discardButton:SetPoint("BOTTOMLEFT", 14, 10) +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/bar/components/micro.lua b/Interface/AddOns/SVUI/packages/bar/components/micro.lua new file mode 100644 index 0000000..76395d0 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/bar/components/micro.lua @@ -0,0 +1,223 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local string = _G.string; +local math = _G.math; +--[[ STRING METHODS ]]-- +local find, format, split = string.find, string.format, string.split; +local gsub = string.gsub; +--[[ MATH METHODS ]]-- +local ceil = math.ceil; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L; +local MOD = SV.SVBar; +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local NewFrame = CreateFrame +local NewHook = hooksecurefunc +local ICON_FILE = [[Interface\AddOns\SVUI\assets\artwork\Icons\MICROMENU]] +local ICON_DATA = { + {"CharacterMicroButton",0,0.25,0,0.25}, -- MICRO-CHARACTER + {"SpellbookMicroButton",0.25,0.5,0,0.25}, -- MICRO-SPELLBOOK + {"TalentMicroButton",0.5,0.75,0,0.25}, -- MICRO-TALENTS + {"AchievementMicroButton",0.75,1,0,0.25}, -- MICRO-ACHIEVEMENTS + {"QuestLogMicroButton",0,0.25,0.25,0.5}, -- MICRO-QUESTS + {"GuildMicroButton",0.25,0.5,0.25,0.5}, -- MICRO-GUILD + {"PVPMicroButton",0.5,0.75,0.25,0.5}, -- MICRO-PVP + {"LFDMicroButton",0.75,1,0.25,0.5}, -- MICRO-LFD + {"EJMicroButton",0,0.25,0.5,0.75}, -- MICRO-ENCOUNTER + {"StoreMicroButton",0.25,0.5,0.5,0.75}, -- MICRO-STORE + {"CompanionsMicroButton",0.5,0.75,0.5,0.75},-- MICRO-COMPANION + {"MainMenuMicroButton",0.75,1,0.5,0.75}, -- MICRO-SYSTEM + {"HelpMicroButton",0,0.25,0.75,1}, -- MICRO-HELP +} +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- +local function RefreshMicrobar() + if not SVUI_MicroBar then return end + local lastParent = SVUI_MicroBar; + local buttonSize = SV.db.SVBar.Micro.buttonsize or 30; + local spacing = SV.db.SVBar.Micro.buttonspacing or 1; + local barWidth = (buttonSize + spacing) * 13; + SVUI_MicroBar_MOVE:SetSizeToScale(barWidth, buttonSize) + SVUI_MicroBar:SetAllPoints(SVUI_MicroBar_MOVE) + for i=1,13 do + local data = ICON_DATA[i] + local button = _G[data[1]] + if(button) then + button:ClearAllPoints() + button:SetSizeToScale(buttonSize, buttonSize + 28) + button._fade = SV.db.SVBar.Micro.mouseover + if lastParent == SVUI_MicroBar then + button:SetPoint("BOTTOMLEFT", lastParent, "BOTTOMLEFT", 0, 0) + else + button:SetPoint("BOTTOMLEFT", lastParent, "BOTTOMRIGHT", spacing, 0) + end + lastParent = button; + button:Show() + end + end +end + +local SVUIMicroButton_SetNormal = function() + local level = MainMenuMicroButton:GetFrameLevel() + if(level > 0) then + MainMenuMicroButton:SetFrameLevel(level - 1) + else + MainMenuMicroButton:SetFrameLevel(0) + end + MainMenuMicroButton:SetFrameStrata("BACKGROUND") + MainMenuMicroButton.overlay:SetFrameLevel(level + 1) + MainMenuMicroButton.overlay:SetFrameStrata("HIGH") + MainMenuBarPerformanceBar:Hide() + HelpMicroButton:Show() +end + +local SVUIMicroButtonsParent = function(self) + if self ~= SVUI_MicroBar then + self = SVUI_MicroBar + end + for i=1,13 do + local data = ICON_DATA[i] + if(data) then + local mButton = _G[data[1]] + if(mButton) then mButton:SetParent(SVUI_MicroBar) end + end + end +end + +local MicroButton_OnEnter = function(self) + if(self._fade) then + SVUI_MicroBar:FadeIn(0.2,SVUI_MicroBar:GetAlpha(),1) + end + if InCombatLockdown()then return end + self.overlay:SetPanelColor("highlight") + self.overlay.icon:SetGradient("VERTICAL", 0.75, 0.75, 0.75, 1, 1, 1) +end + +local MicroButton_OnLeave = function(self) + if(self._fade) then + SVUI_MicroBar:FadeOut(1,SVUI_MicroBar:GetAlpha(),0) + end + if InCombatLockdown()then return end + self.overlay:SetPanelColor("special") + self.overlay.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) +end +--[[ +########################################################## +BAR CREATION +########################################################## +]]-- +function MOD:UpdateMicroButtons() + if(not SV.db.SVBar.Micro.mouseover) then + SVUI_MicroBar:SetAlpha(1) + else + SVUI_MicroBar:SetAlpha(0) + end + GuildMicroButtonTabard:ClearAllPoints(); + GuildMicroButtonTabard:Hide(); + RefreshMicrobar() +end + +function MOD:InitializeMicroBar() + local buttonSize = SV.db.SVBar.Micro.buttonsize or 30; + local spacing = SV.db.SVBar.Micro.buttonspacing or 1; + local barWidth = (buttonSize + spacing) * 13; + local barHeight = (buttonSize + 6); + local microBar = NewFrame('Frame', 'SVUI_MicroBar', UIParent) + microBar:SetSizeToScale(barWidth, barHeight) + microBar:SetFrameStrata("HIGH") + microBar:SetFrameLevel(0) + microBar:SetPointToScale('BOTTOMLEFT', SV.Dock.TopLeft.Bar.ToolBar, 'BOTTOMRIGHT', 4, 0) + SV:AddToDisplayAudit(microBar) + + for i=1,13 do + local data = ICON_DATA[i] + if(data) then + local button = _G[data[1]] + if(button) then + button:SetParent(SVUI_MicroBar) + button:SetSizeToScale(buttonSize, buttonSize + 28) + button.Flash:SetTexture(0,0,0,0) + if button.SetPushedTexture then + button:SetPushedTexture("") + end + if button.SetNormalTexture then + button:SetNormalTexture("") + end + if button.SetDisabledTexture then + button:SetDisabledTexture("") + end + if button.SetHighlightTexture then + button:SetHighlightTexture("") + end + button:RemoveTextures() + + local buttonMask = NewFrame("Frame",nil,button) + buttonMask:SetPoint("TOPLEFT",button,"TOPLEFT",0,-28) + buttonMask:SetPoint("BOTTOMRIGHT",button,"BOTTOMRIGHT",0,0) + buttonMask:SetStylePanel("Framed") + buttonMask:SetPanelColor() + buttonMask.icon = buttonMask:CreateTexture(nil,"OVERLAY",nil,2) + buttonMask.icon:SetAllPointsIn(buttonMask,2,2) + buttonMask.icon:SetTexture(ICON_FILE) + buttonMask.icon:SetTexCoord(data[2],data[3],data[4],data[5]) + buttonMask.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + button.overlay = buttonMask; + button._fade = SV.db.SVBar.Micro.mouseover + button:HookScript('OnEnter', MicroButton_OnEnter) + button:HookScript('OnLeave', MicroButton_OnLeave) + button:Show() + end + end + end + + MicroButtonPortrait:ClearAllPoints() + MicroButtonPortrait:Hide() + MainMenuBarPerformanceBar:ClearAllPoints() + MainMenuBarPerformanceBar:Hide() + + NewHook('MainMenuMicroButton_SetNormal', SVUIMicroButton_SetNormal) + NewHook('UpdateMicroButtonsParent', SVUIMicroButtonsParent) + NewHook('MoveMicroButtons', RefreshMicrobar) + NewHook('UpdateMicroButtons', MOD.UpdateMicroButtons) + + SVUIMicroButtonsParent(microBar) + SVUIMicroButton_SetNormal() + + SV.Mentalo:Add(microBar, L["Micro Bar"]) + + RefreshMicrobar() + SVUI_MicroBar:SetAlpha(0) +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/chat/SVChat.lua b/Interface/AddOns/SVUI/packages/chat/SVChat.lua index c9f9c49..3fc4e47 100644 --- a/Interface/AddOns/SVUI/packages/chat/SVChat.lua +++ b/Interface/AddOns/SVUI/packages/chat/SVChat.lua @@ -96,14 +96,14 @@ local CHAT_THROTTLE = 45; local CHAT_ALLOW_URL = true; local CHAT_HOVER_URL = true; local CHAT_STICKY = true; -local CHAT_FONT = [[Interface\AddOns\SVUI\assets\fonts\Roboto.ttf]]; +local CHAT_FONT = [[Interface\AddOns\SVUI\assets\fonts\Default.ttf]]; local CHAT_FONTSIZE = 12; local CHAT_FONTOUTLINE = "OUTLINE"; local TAB_WIDTH = 75; local TAB_HEIGHT = 20; local TAB_SKINS = true; -local TAB_FONT = [[Interface\AddOns\SVUI\assets\fonts\Alert.ttf]]; -local TAB_FONTSIZE = 10; +local TAB_FONT = [[Interface\AddOns\SVUI\assets\fonts\Caps.ttf]]; +local TAB_FONTSIZE = 11; local TAB_FONTOUTLINE = "OUTLINE"; local CHAT_FADING = false; local CHAT_PSST = [[Interface\AddOns\SVUI\assets\sounds\whisper.mp3]]; @@ -111,7 +111,8 @@ local TIME_STAMP_MASK = "NONE"; local ICONARTFILE = [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-CHAT]] local SCROLL_ALERT = [[Interface\AddOns\SVUI\assets\artwork\Chat\CHAT-SCROLL]] local WHISPER_ALERT = [[Interface\AddOns\SVUI\assets\artwork\Chat\CHAT-WHISPER]] -local THROTTLE_CACHE = {} +local THROTTLE_CACHE = {}; +local ACTIVE_HYPER_LINK; --[[ ########################################################## INIT SETTINGS @@ -427,12 +428,15 @@ do ScrollIndicator:Show() SV.Animate:Flash(ScrollIndicator,1,true) end - if ( chatFrame.isDocked and FCFDock_GetSelectedWindow(GENERAL_CHAT_DOCK) ~= chatFrame ) then + for chatID,frame in pairs(TabsList) do + frame.link.IsOpen = false + frame.link:SetPanelColor("default") + frame.link.icon:SetGradient(unpack(SV.Media.gradient.icon)) + end + if(chatFrame.isDocked) then self.IsOpen = true - self:SetPanelColor("highlight") - else - self.IsOpen = false - self:SetPanelColor("default") + self:SetPanelColor("green") + self.icon:SetGradient(unpack(SV.Media.gradient.green)) end end @@ -522,16 +526,16 @@ do local lastTab = TabsList[1]; if(lastTab) then lastTab:ClearAllPoints() - lastTab:Point("LEFT", MOD.Dock.Bar, "LEFT", 2, 0); + lastTab:SetPointToScale("LEFT", MOD.Dock.Bar, "LEFT", 2, 0); end local offset = 1; for chatID,frame in pairs(TabsList) do if(frame and chatID ~= 1 and frame.isDocked) then frame:ClearAllPoints() if(not lastTab) then - frame:Point("LEFT", MOD.Dock.Bar, "LEFT", 2, 0); + frame:SetPointToScale("LEFT", MOD.Dock.Bar, "LEFT", 2, 0); else - frame:Point("LEFT", lastTab, "RIGHT", 6, 0); + frame:SetPointToScale("LEFT", lastTab, "RIGHT", 6, 0); end lastTab = frame end @@ -551,7 +555,7 @@ do end frame:SetParent(chat) frame:ClearAllPoints() - frame:Point("TOPLEFT", chat, "BOTTOMLEFT", 0, 0) + frame:SetPointToScale("TOPLEFT", chat, "BOTTOMLEFT", 0, 0) _repositionDockedTabs() end @@ -578,20 +582,27 @@ do tab:SetParent(holder) tab:ClearAllPoints() tab:SetAllPoints(holder) - tab:SetFramedButtonTemplate() + tab:SetStylePanel("Framed") tab.icon = tab:CreateTexture(nil,"BACKGROUND",nil,3) - tab.icon:Size(tabSize * 1.25, tabSize) - tab.icon:Point("CENTER",tab,"CENTER",0,0) + tab.icon:SetAllPointsIn(tab, 6, 3) tab.icon:SetTexture(ICONARTFILE) if(tab.conversationIcon) then + tab:SetPanelColor("VERTICAL", 0.1, 0.53, 0.65, 0.6, 0.2, 1) tab.icon:SetGradient("VERTICAL", 0.1, 0.53, 0.65, 0.3, 0.7, 1) else - tab.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + tab:SetPanelColor("default") + tab.icon:SetGradient(unpack(SV.Media.gradient.icon)) + end + if(chatID == 1) then + tab.IsOpen = true + tab:SetPanelColor("green") + tab.icon:SetGradient(unpack(SV.Media.gradient.green)) end tab.icon:SetAlpha(0.5) tab.TText = tabText; - - --tab.SetWidth = SV.fubar + tab:SetAlpha(1); + + tab.SetAlpha = SV.fubar tab.SetHeight = SV.fubar tab.SetSize = SV.fubar tab.SetParent = SV.fubar @@ -618,7 +629,7 @@ do chat:SetFont(CHAT_FONT, CHAT_FONTSIZE, CHAT_FONTOUTLINE) tabText:SetFont(TAB_FONT, TAB_FONTSIZE, TAB_FONTOUTLINE) if(not chat.Panel) then - chat:SetPanelTemplate("Transparent") + chat:SetStylePanel("Default", "Transparent") chat.Panel:Hide() end if(CHAT_FONTOUTLINE ~= 'NONE' )then @@ -651,16 +662,16 @@ do _G[tabName .."HighlightRight"]:SetTexture(0,0,0,0) tab.text = _G[chatName.."TabText"] - tab.text:SetTextColor(1, 1, 1) tab.text:SetShadowColor(0, 0, 0) tab.text:SetShadowOffset(2, -2) - tab.text:FillInner(tab) + tab.text:SetAllPointsIn(tab) tab.text:SetJustifyH("CENTER") tab.text:SetJustifyV("MIDDLE") NewHook(tab.text, "SetTextColor", _hook_TabTextColor) - if tab.conversationIcon then + if tab.conversationIcon then + tab.conversationIcon:SetAlpha(0) tab.conversationIcon:ClearAllPoints() - tab.conversationIcon:Point("RIGHT", tab.text, "LEFT", -1, 0) + tab.conversationIcon:SetPointToScale("TOPLEFT", tab, "TOPLEFT", 0, 0) end if(TAB_SKINS and not tab.IsStyled) then local arg3 = (chat.inUse or chat.isDocked or chat.isTemporary) @@ -678,7 +689,7 @@ do _G[editBoxName.."FocusLeft"]:Die() _G[editBoxName.."FocusMid"]:Die() _G[editBoxName.."FocusRight"]:Die() - editBox:SetPanelTemplate("Inset", true, 2, -2, -3) + editBox:SetStylePanel("Default", "Headline", true, 2, -2, -3) editBox:SetAltArrowKeyMode(false) editBox:SetAllPoints(MOD.Dock.Parent.Alert) editBox:HookScript("OnEditFocusGained", EditBox_OnEditFocusGained) @@ -760,7 +771,7 @@ do end chat:ClearAllPoints(); - chat:SetAllPoints(MOD.Dock); + chat:SetAllPointsIn(MOD.Dock, 2, 2); chat:SetBackdropColor(0,0,0,0); chat.Panel:Hide(); @@ -869,7 +880,7 @@ do ShowUIPanel(GameTooltip) GameTooltip:SetOwner(self, "ANCHOR_CURSOR") GameTooltip:SetHyperlink(refString) - ActiveHyperLink = self; + ACTIVE_HYPER_LINK = self; GameTooltip:Show() end end @@ -879,15 +890,15 @@ do local token = refString:match("^([^:]+)") if _linkTokens[token] then HideUIPanel(GameTooltip) - ActiveHyperLink = nil; + ACTIVE_HYPER_LINK = nil; end end local _hook_OnMessageScrollChanged = function(self) if(not CHAT_HOVER_URL) then return; end - if(ActiveHyperLink == self) then + if(ACTIVE_HYPER_LINK == self) then HideUIPanel(GameTooltip) - ActiveHyperLink = false; + ACTIVE_HYPER_LINK = false; end if(self:AtBottom() and ScrollIndicator:IsShown()) then SV.Animate:StopFlash(ScrollIndicator) @@ -968,15 +979,15 @@ end local function DockFadeInChat() local activeChatFrame = FCFDock_GetSelectedWindow(GENERAL_CHAT_DOCK) - SV:SecureFadeIn(activeChatFrame, 0.2, activeChatFrame:GetAlpha(), 1) + activeChatFrame:FadeIn(0.2, activeChatFrame:GetAlpha(), 1) end -LibSuperVillain("Registry"):NewCallback("DOCKS_FADE_IN", "DockFadeInChat", DockFadeInChat); +SV.Events:On("DOCKS_FADE_IN", "DockFadeInChat", DockFadeInChat); local function DockFadeOutChat() local activeChatFrame = FCFDock_GetSelectedWindow(GENERAL_CHAT_DOCK) - SV:SecureFadeOut(activeChatFrame, 2, activeChatFrame:GetAlpha(), 0, true) + activeChatFrame:FadeOut(2, activeChatFrame:GetAlpha(), 0, true) end -LibSuperVillain("Registry"):NewCallback("DOCKS_FADE_OUT", "DockFadeOutChat", DockFadeOutChat); +SV.Events:On("DOCKS_FADE_OUT", "DockFadeOutChat", DockFadeOutChat); function MOD:UpdateLocals() CHAT_WIDTH = (SV.db.Dock.dockLeftWidth or 350) - 10; @@ -985,15 +996,15 @@ function MOD:UpdateLocals() CHAT_ALLOW_URL = SV.db.SVChat.url; CHAT_HOVER_URL = SV.db.SVChat.hyperlinkHover; CHAT_STICKY = SV.db.SVChat.sticky; - CHAT_FONT = LSM:Fetch("font", SV.db.SVChat.font); - CHAT_FONTSIZE = SV.db.media.fonts.size or 12; - CHAT_FONTOUTLINE = SV.db.SVChat.fontOutline; + CHAT_FONT = LSM:Fetch("font", SV.db.font.default.file); + CHAT_FONTSIZE = SV.db.font.default.size or 11; + CHAT_FONTOUTLINE = SV.db.font.default.outline; TAB_WIDTH = SV.db.SVChat.tabWidth; TAB_HEIGHT = SV.db.SVChat.tabHeight; TAB_SKINS = SV.db.SVChat.tabStyled; - TAB_FONT = LSM:Fetch("font", SV.db.SVChat.tabFont); - TAB_FONTSIZE = SV.db.SVChat.tabFontSize; - TAB_FONTOUTLINE = SV.db.SVChat.tabFontOutline; + TAB_FONT = LSM:Fetch("font", SV.db.font.caps.file); + TAB_FONTSIZE = SV.db.font.caps.size; + TAB_FONTOUTLINE = SV.db.font.caps.outline; CHAT_FADING = SV.db.SVChat.fade; CHAT_PSST = LSM:Fetch("sound", SV.db.SVChat.psst); TIME_STAMP_MASK = SV.db.SVChat.timeStampFormat; @@ -1031,7 +1042,7 @@ function MOD:Load() _G.GeneralDockManagerOverflowButton:ClearAllPoints() _G.GeneralDockManagerOverflowButton:SetPoint('BOTTOMRIGHT', self.Dock.Bar, 'BOTTOMRIGHT', -2, 2) - _G.GeneralDockManagerOverflowButtonList:SetFixedPanelTemplate('Transparent') + _G.GeneralDockManagerOverflowButtonList:SetStylePanel("Fixed", 'Transparent') _G.GeneralDockManager:SetAllPoints(self.Dock.Bar) SetAllChatHooks() diff --git a/Interface/AddOns/SVUI/packages/gear/SVGear.lua b/Interface/AddOns/SVUI/packages/gear/SVGear.lua index a12f77c..51cdcde 100644 --- a/Interface/AddOns/SVUI/packages/gear/SVGear.lua +++ b/Interface/AddOns/SVUI/packages/gear/SVGear.lua @@ -147,19 +147,19 @@ local function SetDisplayStats(arg) if(flags[1]) then frame.ItemLevel = frame:CreateFontString(nil, "OVERLAY") - frame.ItemLevel:Point("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 2, 1) - frame.ItemLevel:FontManager(SV.Media.font.roboto, 10, "OUTLINE", "RIGHT") + frame.ItemLevel:SetPointToScale("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 2, 1) + frame.ItemLevel:FontManager("default") end if(arg == "Character" and flags[2]) then frame.DurabilityInfo = CreateFrame("Frame", nil, frame) - frame.DurabilityInfo:Width(7) + frame.DurabilityInfo:SetWidthToScale(7) if flags[3] then - frame.DurabilityInfo:Point("TOPRIGHT", frame, "TOPLEFT", -1, 1) - frame.DurabilityInfo:Point("BOTTOMRIGHT", frame, "BOTTOMLEFT", -1, -1) + frame.DurabilityInfo:SetPointToScale("TOPRIGHT", frame, "TOPLEFT", -1, 1) + frame.DurabilityInfo:SetPointToScale("BOTTOMRIGHT", frame, "BOTTOMLEFT", -1, -1) else - frame.DurabilityInfo:Point("TOPLEFT", frame, "TOPRIGHT", 1, 1) - frame.DurabilityInfo:Point("BOTTOMLEFT", frame, "BOTTOMRIGHT", 1, -1) + frame.DurabilityInfo:SetPointToScale("TOPLEFT", frame, "TOPRIGHT", 1, 1) + frame.DurabilityInfo:SetPointToScale("BOTTOMLEFT", frame, "BOTTOMRIGHT", 1, -1) end frame.DurabilityInfo:SetFrameLevel(frame:GetFrameLevel()-1) frame.DurabilityInfo:SetBackdrop({ @@ -178,11 +178,11 @@ local function SetDisplayStats(arg) frame.DurabilityInfo:SetBackdropColor(0, 0, 0, 0.5) frame.DurabilityInfo:SetBackdropBorderColor(0, 0, 0, 0.8) frame.DurabilityInfo.bar = CreateFrame("StatusBar", nil, frame.DurabilityInfo) - frame.DurabilityInfo.bar:FillInner(frame.DurabilityInfo, 2, 2) + frame.DurabilityInfo.bar:SetAllPointsIn(frame.DurabilityInfo, 2, 2) frame.DurabilityInfo.bar:SetStatusBarTexture(SV.Media.bar.default) frame.DurabilityInfo.bar:SetOrientation("VERTICAL") frame.DurabilityInfo.bg = frame.DurabilityInfo:CreateTexture(nil, "BORDER") - frame.DurabilityInfo.bg:FillInner(frame.DurabilityInfo, 2, 2) + frame.DurabilityInfo.bg:SetAllPointsIn(frame.DurabilityInfo, 2, 2) frame.DurabilityInfo.bg:SetTexture([[Interface\BUTTONS\WHITE8X8]]) frame.DurabilityInfo.bg:SetVertexColor("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) end diff --git a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua index 002def8..df6e417 100644 --- a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua +++ b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua @@ -97,16 +97,7 @@ local HENCHMEN_DATA = { {40,"Select Rewards","Your minions will automatically select quest rewards for you", "autoquestreward"}, {-40,"Greed Roll","Your minions will automatically roll greed (or disenchant if available) on green quality items for you", "autoRoll"}, {-20,"Watch Factions","Your minions will automatically change your tracked reputation to the last faction you were awarded points for", "autorepchange"} - }, - { - {49084,67,113,69,70,73,75}, --Rascal Bot - {29404,67,113,69,70,73,75}, --Macabre Marionette - {45613,0,5,10,69,10,69}, --Bishibosh - {34770,70,82,70,82,70,82}, --Gilgoblin - {45562,69,69,69,69,69,69}, --Burgle - {37339,60,60,60,60,60,60}, --Augh - {2323,67,113,69,70,73,75}, --Defias Henchman - } + } } local takingOnlyCash,deletedelay,mailElapsed,childCount=false,0.5,0,-1; @@ -127,6 +118,16 @@ local AutomatedEvents = { "QUEST_ACCEPT_CONFIRM", "QUEST_PROGRESS" } + +MOD.YOUR_HENCHMEN = { + {49084,67,113,69,70,73,75}, --Rascal Bot + {29404,67,113,69,70,73,75}, --Macabre Marionette + {45613,0,5,10,69,10,69}, --Bishibosh + {34770,70,82,70,82,70,82}, --Gilgoblin + {45562,69,69,69,69,69,69}, --Burgle + {37339,60,60,60,60,60,60}, --Augh + {2323,67,113,69,70,73,75}, --Defias Henchman +} --[[ ########################################################## SCRIPT HANDLERS @@ -192,7 +193,7 @@ LOCAL FUNCTIONS ]]-- local function UpdateHenchmanModel(hide) if(not hide and not HenchmenFrameModel:IsShown()) then - local models = HENCHMEN_DATA[3] + local models = MOD.YOUR_HENCHMEN local mod = random(1,#models) local emod = random(2,7) local id = models[mod][1] @@ -207,7 +208,7 @@ local function UpdateHenchmanModel(hide) end function GetAllMail() - if GetInboxNumItems()==0 then return end + if(GetInboxNumItems() == 0) then return end SVUI_GetMailButton:SetScript("OnClick",nil) SVUI_GetGoldButton:SetScript("OnClick",nil) baseInboxFrame_OnClick=InboxFrame_OnClick; @@ -302,9 +303,9 @@ local function CreateMinionOptions(i) option:SetSize(148,50) if i==1 then - option:Point("TOPRIGHT",HenchmenFrame,"TOPLEFT",-32,-32) + option:SetPointToScale("TOPRIGHT",HenchmenFrame,"TOPLEFT",-32,-32) else - option:Point("TOP",_G["MinionOptionButton"..lastIndex],"BOTTOM",offsetX,-32) + option:SetPointToScale("TOP",_G["MinionOptionButton"..lastIndex],"BOTTOM",offsetX,-32) end local setting = options[4]; @@ -326,15 +327,15 @@ local function CreateMinionOptions(i) option.bg:SetTexture(OPTION_LEFT) option.bg:SetVertexColor(1,1,1,0.6) option.txt = option:CreateFontString(nil,"DIALOG") - option.txt:FillInner(option) - option.txt:SetFont(SV.Media.font.dialog,12,"NONE") + option.txt:SetAllPointsIn(option) + option.txt:SetFont(SV.Media.font.narrator,12,"NONE") option.txt:SetJustifyH("CENTER") option.txt:SetJustifyV("MIDDLE") option.txt:SetText(options[2]) option.txt:SetTextColor(0,0,0) option.txthigh = option:CreateFontString(nil,"HIGHLIGHT") - option.txthigh:FillInner(option) - option.txthigh:SetFont(SV.Media.font.dialog,12,"OUTLINE") + option.txthigh:SetAllPointsIn(option) + option.txthigh:SetFont(SV.Media.font.narrator,12,"OUTLINE") option.txthigh:SetJustifyH("CENTER") option.txthigh:SetJustifyV("MIDDLE") option.txthigh:SetText(options[2]) @@ -342,7 +343,7 @@ local function CreateMinionOptions(i) option.ttText = options[3] option.indicator = option:CreateTexture(nil,"OVERLAY") option.indicator:SetSize(100,32) - option.indicator:Point("RIGHT", option , "LEFT", -5, 0) + option.indicator:SetPointToScale("RIGHT", option , "LEFT", -5, 0) option.indicator:SetTexture(SWITCH) if(not dbSet) then option.indicator:SetTexCoord(0,1,0,0.5) @@ -362,9 +363,9 @@ local function CreateHenchmenOptions(i) local option = CreateFrame("Frame", "HenchmenOptionButton"..i, HenchmenFrame) option:SetSize(148,50) if i==1 then - option:Point("TOPLEFT",HenchmenFrame,"TOPRIGHT",32,-32) + option:SetPointToScale("TOPLEFT",HenchmenFrame,"TOPRIGHT",32,-32) else - option:Point("TOP",_G["HenchmenOptionButton"..lastIndex],"BOTTOM",offsetX,-32) + option:SetPointToScale("TOP",_G["HenchmenOptionButton"..lastIndex],"BOTTOM",offsetX,-32) end SV.Animate:Slide(option,500,-500) option:SetFrameStrata("DIALOG") @@ -376,15 +377,15 @@ local function CreateHenchmenOptions(i) option.bg:SetTexture(OPTION_RIGHT) option.bg:SetVertexColor(1,1,1,0.6) option.txt = option:CreateFontString(nil,"DIALOG") - option.txt:FillInner(option) - option.txt:SetFont(SV.Media.font.dialog,12,"NONE") + option.txt:SetAllPointsIn(option) + option.txt:SetFont(SV.Media.font.narrator,12,"NONE") option.txt:SetJustifyH("CENTER") option.txt:SetJustifyV("MIDDLE") option.txt:SetText(options[2]) option.txt:SetTextColor(0,0,0) option.txthigh = option:CreateFontString(nil,"HIGHLIGHT") - option.txthigh:FillInner(option) - option.txthigh:SetFont(SV.Media.font.dialog,12,"OUTLINE") + option.txthigh:SetAllPointsIn(option) + option.txthigh:SetFont(SV.Media.font.narrator,12,"OUTLINE") option.txthigh:SetJustifyH("CENTER") option.txthigh:SetJustifyV("MIDDLE") option.txthigh:SetText(options[2]) @@ -401,7 +402,7 @@ local function CreateHenchmenSubOptions(buttonIndex,optionIndex) local yOffset = 180 - calc; local frame = CreateFrame("Frame",name,HenchmenFrame) frame:SetSize(122,50) - frame:Point("BOTTOMLEFT", parent, "TOPRIGHT", 75, yOffset) + frame:SetPointToScale("BOTTOMLEFT", parent, "TOPRIGHT", 75, yOffset) frame:SetFrameStrata("DIALOG") frame:SetFrameLevel(24) frame:EnableMouse(true) @@ -411,14 +412,14 @@ local function CreateHenchmenSubOptions(buttonIndex,optionIndex) frame.bg:SetTexture(OPTION_SUB) frame.bg:SetVertexColor(1,1,1,0.6) frame.txt = frame:CreateFontString(nil,"DIALOG") - frame.txt:FillInner(frame) + frame.txt:SetAllPointsIn(frame) frame.txt:SetFont(STANDARD_TEXT_FONT,12,"OUTLINE") frame.txt:SetJustifyH("CENTER") frame.txt:SetJustifyV("MIDDLE") frame.txt:SetTextColor(1,1,1) frame.txthigh = frame:CreateFontString(nil,"HIGHLIGHT") - frame.txthigh:FillInner(frame) - frame.txthigh:FontManager(false,12,"OUTLINE","CENTER","MIDDLE") + frame.txthigh:SetAllPointsIn(frame) + frame.txthigh:FontManager("default") frame.txthigh:SetTextColor(1,1,0) SV.Animate:Slide(frame,500,0) @@ -450,7 +451,7 @@ local function CreateHenchmenFrame() HenchmenCalloutFrame:SetFrameStrata("DIALOG") HenchmenCalloutFrame:SetFrameLevel(24) SV.Animate:Slide(HenchmenCalloutFrame,-356,-278) - HenchmenCalloutFramePic = HenchmenCalloutFrame:CreateTexture("HenchmenCalloutFramePic","ARTWORK") + local HenchmenCalloutFramePic = HenchmenCalloutFrame:CreateTexture("HenchmenCalloutFramePic","ARTWORK") HenchmenCalloutFramePic:SetTexture([[Interface\Addons\SVUI\assets\artwork\Doodads\HENCHMEN-CALLOUT]]) HenchmenCalloutFramePic:SetAllPoints(HenchmenCalloutFrame) HenchmenCalloutFrame:Hide() @@ -671,7 +672,7 @@ function MOD:LoadMailMinions() local SVUI_GetMailButton=CreateFrame("Button","SVUI_GetMailButton",SVUI_MailMinion,"UIPanelButtonTemplate") SVUI_GetMailButton:SetWidth(70) SVUI_GetMailButton:SetHeight(25) - SVUI_GetMailButton:SetButtonTemplate() + SVUI_GetMailButton:SetStylePanel("Button") SVUI_GetMailButton:SetPoint("LEFT",SVUI_MailMinion,"LEFT",0,0) SVUI_GetMailButton:SetText("Get All") SVUI_GetMailButton:SetScript("OnClick",GetAllMail) @@ -692,7 +693,7 @@ function MOD:LoadMailMinions() local SVUI_GetGoldButton=CreateFrame("Button","SVUI_GetGoldButton",SVUI_MailMinion,"UIPanelButtonTemplate") SVUI_GetGoldButton:SetWidth(70) SVUI_GetGoldButton:SetHeight(25) - SVUI_GetGoldButton:SetButtonTemplate() + SVUI_GetGoldButton:SetStylePanel("Button") SVUI_GetGoldButton:SetPoint("RIGHT",SVUI_MailMinion,"RIGHT",0,0) SVUI_GetGoldButton:SetText("Get Gold") SVUI_GetGoldButton:SetScript("OnClick",GetAllMailCash) @@ -714,49 +715,56 @@ end INVITE AUTOMATONS ########################################################## ]]-- -function MOD:PARTY_INVITE_REQUEST(event, arg) - if not SV.db.SVHenchmen.autoAcceptInvite then return end +function MOD:PARTY_INVITE_REQUEST(event, invitedBy) + if(not SV.db.SVHenchmen.autoAcceptInvite) then return; end - if IsInGroup() or QueueStatusMinimapButton:IsShown() then return end - - if GetNumFriends() > 0 then ShowFriends() end - if IsInGuild() then GuildRoster() end + if(QueueStatusMinimapButton:IsShown() or IsInGroup()) then return end + if(GetNumFriends() > 0) then + ShowFriends() + end + if(IsInGuild()) then + GuildRoster() + end hideStatic = true; - local invited = false; - for i = 1, GetNumFriends()do - local friend = GetFriendInfo(i) - if friend == arg then + local invited = false; + + for f = 1, GetNumFriends() do + local friend = gsub(GetFriendInfo(f), "-.*", "") + if(friend == invitedBy) then AcceptGroup() invited = true; SV:AddonMessage("Accepted an Invite From Your Friends!") - break + break; end end - if not invited then - for i = 1, BNGetNumFriends()do - local _, _, _, friend = BNGetFriendInfo(i) - arg = arg:match("(.+)%-.+") or arg; - if friend == arg then + + if(not invited) then + for b = 1, BNGetNumFriends() do + local _, _, _, _, friend = BNGetFriendInfo(b) + invitedBy = invitedBy:match("(.+)%-.+") or invitedBy; + if(friend == invitedBy) then AcceptGroup() invited = true; - SV:AddonMessage("Accepted an Invite!") - break + SV:AddonMessage("Accepted an Invite From Your Friends!") + break; end end - end - if not invited then - for i = 1, GetNumGuildMembers(true)do - local guildMate = GetGuildRosterInfo(i) - if guildMate == arg then + end + + if(not invited) then + for g = 1, GetNumGuildMembers(true) do + local guildMate = gsub(GetGuildRosterInfo(g), "-.*", "") + if(guildMate == invitedBy) then AcceptGroup() invited = true; SV:AddonMessage("Accepted an Invite From Your Guild!") - break + break; end end end - if invited then + + if(invited) then local popup = StaticPopup_FindVisible("PARTY_INVITE") if(popup) then popup.inviteAccepted = 1 diff --git a/Interface/AddOns/SVUI/packages/map/SVMap.lua b/Interface/AddOns/SVUI/packages/map/SVMap.lua index cfd4012..ec67e8f 100644 --- a/Interface/AddOns/SVUI/packages/map/SVMap.lua +++ b/Interface/AddOns/SVUI/packages/map/SVMap.lua @@ -45,7 +45,7 @@ MOD.MinimapButtons = {} LOCALIZED GLOBALS ########################################################## ]]-- -local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS +local CUSTOM_CLASS_COLORS = _G.CUSTOM_CLASS_COLORS local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS --[[ ########################################################## @@ -78,6 +78,7 @@ local MM_WIDTH = MM_SIZE + (MM_BRDR * 2) local MM_HEIGHT = (MM_SIZE - (MM_OFFSET_TOP + MM_OFFSET_BOTTOM) + (MM_BRDR * 2)) local WM_ALPHA = false; local SVUI_MinimapFrame = CreateFrame("Frame", "SVUI_MinimapFrame", UIParent) +local WMCoords = CreateFrame('Frame', 'SVUI_WorldMapCoords', WorldMapFrame) SVUI_MinimapFrame:SetSize(MM_WIDTH, MM_HEIGHT) --[[ ########################################################## @@ -117,8 +118,8 @@ do if(not SV.db.SVMap.minimapbar.enable) then return end MMBBar:SetPoint("CENTER", MMBHolder, "CENTER", 0, 0) - MMBBar:Height(SV.db.SVMap.minimapbar.buttonSize + 4) - MMBBar:Width(SV.db.SVMap.minimapbar.buttonSize + 4) + MMBBar:SetHeightToScale(SV.db.SVMap.minimapbar.buttonSize + 4) + MMBBar:SetWidthToScale(SV.db.SVMap.minimapbar.buttonSize + 4) MMBBar:SetFrameStrata("LOW") MMBBar:SetFrameLevel(0) @@ -151,7 +152,7 @@ do btn:ClearAllPoints() btn:SetFrameStrata("LOW") btn:SetFrameLevel(20) - btn:Size(SV.db.SVMap.minimapbar.buttonSize) + btn:SetSizeToScale(SV.db.SVMap.minimapbar.buttonSize) if SV.db.SVMap.minimapbar.styleType == "HORIZONTAL"then anchor = "RIGHT" relative = "LEFT" @@ -174,9 +175,9 @@ do end if (SV.db.SVMap.minimapbar.styleType ~= "NOANCHOR" and (count > 0)) then if SV.db.SVMap.minimapbar.styleType == "HORIZONTAL" then - MMBBar:Width((SV.db.SVMap.minimapbar.buttonSize * count) + count * 2) + MMBBar:SetWidthToScale((SV.db.SVMap.minimapbar.buttonSize * count) + count * 2) else - MMBBar:Height((SV.db.SVMap.minimapbar.buttonSize * count) + count * 2) + MMBBar:SetHeightToScale((SV.db.SVMap.minimapbar.buttonSize * count) + count * 2) end MMBHolder:SetSize(MMBBar:GetSize()) MMBBar:Show() @@ -227,8 +228,8 @@ do frame:SetTexture(0,0,0,0) else frame:ClearAllPoints() - frame:Point("TOPLEFT", btn, "TOPLEFT", 2, -2) - frame:Point("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -2, 2) + frame:SetPointToScale("TOPLEFT", btn, "TOPLEFT", 2, -2) + frame:SetPointToScale("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -2, 2) frame:SetTexCoord(0.1, 0.9, 0.1, 0.9 ) frame:SetDrawLayer("ARTWORK") if name == "PS_MinimapButton" then @@ -238,7 +239,7 @@ do end end - btn:SetSlotTemplate(true, 2, -1, -1) + btn:SetStylePanel("Slot", true, 2, -1, -1) if(name == "DBMMinimapButton") then btn:SetNormalTexture("Interface\\Icons\\INV_Helmet_87") @@ -285,7 +286,7 @@ local function UpdateMapCoords() local xF, yF = "|cffffffffx: |r%.1f", "|cffffffffy: |r%.1f" local skip = IsInInstance() local c, d = GetPlayerMapPosition("player") - if(not skip and not IsIndoors() and c ~= 0 and d ~= 0) then + if((not skip) and (c ~= 0 and d ~= 0)) then c = parsefloat(100 * c, 2) d = parsefloat(100 * d, 2) if(MM_XY_COORD == "SIMPLE") then @@ -294,35 +295,36 @@ local function UpdateMapCoords() if c ~= 0 and d ~= 0 then SVUI_MiniMapCoords.playerXCoords:SetFormattedText(xF, c) SVUI_MiniMapCoords.playerYCoords:SetFormattedText(yF, d) - if(SVUI_WorldMapCoords and WorldMapFrame:IsShown()) then + if(WorldMapFrame:IsShown()) then SVUI_WorldMapCoords.playerCoords:SetText(PLAYER..": "..c..", "..d) end else SVUI_MiniMapCoords.playerXCoords:SetText("") SVUI_MiniMapCoords.playerYCoords:SetText("") - if(SVUI_WorldMapCoords and WorldMapFrame:IsShown()) then + if(WorldMapFrame:IsShown()) then SVUI_WorldMapCoords.playerCoords:SetText("") end end - if(not WorldMapFrame:IsShown() or not SVUI_WorldMapCoords) then return end - local e = WorldMapDetailFrame:GetEffectiveScale() - local f = WorldMapDetailFrame:GetWidth() - local g = WorldMapDetailFrame:GetHeight() - local h, i = WorldMapDetailFrame:GetCenter() - local c, d = GetCursorPosition() - local j = (c / e - (h - (f / 2))) / f; - local k = (i + (g / 2)-d / e) / g; - if j >= 0 and k >= 0 and j <= 1 and k <= 1 then - j = parsefloat(100 * j, 2) - k = parsefloat(100 * k, 2) - SVUI_WorldMapCoords.mouseCoords:SetText(MOUSE_LABEL..": "..j..", "..k) - else - SVUI_WorldMapCoords.mouseCoords:SetText("") + if(WorldMapFrame:IsShown()) then + local e = WorldMapDetailFrame:GetEffectiveScale() + local f = WorldMapDetailFrame:GetWidth() + local g = WorldMapDetailFrame:GetHeight() + local h, i = WorldMapDetailFrame:GetCenter() + local c, d = GetCursorPosition() + local j = (c / e - (h - (f / 2))) / f; + local k = (i + (g / 2)-d / e) / g; + if j >= 0 and k >= 0 and j <= 1 and k <= 1 then + j = parsefloat(100 * j, 2) + k = parsefloat(100 * k, 2) + SVUI_WorldMapCoords.mouseCoords:SetText(MOUSE_LABEL..": "..j..", "..k) + else + SVUI_WorldMapCoords.mouseCoords:SetText("") + end end else SVUI_MiniMapCoords.playerXCoords:SetText("") SVUI_MiniMapCoords.playerYCoords:SetText("") - if(SVUI_WorldMapCoords and WorldMapFrame:IsShown()) then + if(WorldMapFrame:IsShown()) then SVUI_WorldMapCoords.playerCoords:SetText("") end end @@ -376,11 +378,11 @@ end local function AdjustMapSize() if InCombatLockdown() then return end - if WORLDMAP_SETTINGS.size == WORLDMAP_FULLMAP_SIZE then - SetLargeWorldMap() - elseif WORLDMAP_SETTINGS.size == WORLDMAP_WINDOWED_SIZE then - SetSmallWorldMap() - end + -- if WORLDMAP_SETTINGS.size == WORLDMAP_FULLMAP_SIZE then + -- SetLargeWorldMap() + -- elseif WORLDMAP_SETTINGS.size == WORLDMAP_WINDOWED_SIZE then + -- SetSmallWorldMap() + -- end if SV.db.SVMap.tinyWorldMap == true then BlackoutWorld:SetTexture(0,0,0,0) @@ -400,7 +402,7 @@ local function UpdateWorldMapConfig() else if((not InCombatLockdown()) and (not SVUI_MiniMapCoords:IsShown())) then SVUI_MiniMapCoords:Show() end UpdateMapCoords() - MOD.CoordTimer = SV.Timers:ExecuteLoop(UpdateMapCoords, 0.2) + MOD.CoordTimer = SV.Timers:ExecuteLoop(UpdateMapCoords, 0.1) end if InCombatLockdown()then return end @@ -506,7 +508,7 @@ HOOKS ]]-- local _hook_WorldMapZoneDropDownButton_OnClick = function(self) DropDownList1:ClearAllPoints() - DropDownList1:Point("TOPRIGHT",self,"BOTTOMRIGHT",-17,-4) + DropDownList1:SetPointToScale("TOPRIGHT",self,"BOTTOMRIGHT",-17,-4) end local _hook_WorldMapFrame_OnShow = function() @@ -551,19 +553,19 @@ function MOD:RefreshMiniMap() local minimapRotationEnabled = GetCVar("rotateMinimap") ~= "0" if(minimapRotationEnabled) then - SV.Dock.TopRight:Size(MM_WIDTH, (MM_WIDTH + 4)) - self.Holder:Size(MM_WIDTH, MM_WIDTH) - Minimap:Size(MM_SIZE,MM_SIZE) + SV.Dock.TopRight:SetSizeToScale(MM_WIDTH, (MM_WIDTH + 4)) + self.Holder:SetSizeToScale(MM_WIDTH, MM_WIDTH) + Minimap:SetSizeToScale(MM_SIZE,MM_SIZE) self.Holder.Square:Hide() self.Holder.Circle:Show() self.Holder.Circle:SetGradient(unpack(MM_COLOR)) Minimap:SetHitRectInsets(0, 0, 0, 0) - Minimap:FillInner(self.Holder, MM_BRDR, MM_BRDR) + Minimap:SetAllPointsIn(self.Holder, MM_BRDR, MM_BRDR) Minimap:SetMaskTexture('Textures\\MinimapMask') else - SV.Dock.TopRight:Size(MM_WIDTH, (MM_HEIGHT + 4)) - self.Holder:Size(MM_WIDTH, MM_HEIGHT) - Minimap:Size(MM_SIZE,MM_SIZE) + SV.Dock.TopRight:SetSizeToScale(MM_WIDTH, (MM_HEIGHT + 4)) + self.Holder:SetSizeToScale(MM_WIDTH, MM_HEIGHT) + Minimap:SetSizeToScale(MM_SIZE,MM_SIZE) self.Holder.Circle:Hide() self.Holder.Square:Show() self.Holder.Square.Panel.Skin:SetGradient(unpack(MM_COLOR)) @@ -574,7 +576,7 @@ function MOD:RefreshMiniMap() Minimap:SetMaskTexture('Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP_MASK_RECTANGLE') else Minimap:SetHitRectInsets(0, 0, 0, 0) - Minimap:FillInner(self.Holder, MM_BRDR, MM_BRDR) + Minimap:SetAllPointsIn(self.Holder, MM_BRDR, MM_BRDR) Minimap:SetMaskTexture('Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP_MASK_SQUARE') end end @@ -582,7 +584,7 @@ function MOD:RefreshMiniMap() Minimap:SetZoom(1) Minimap:SetZoom(0) else - SV.Dock.TopRight:Size(MM_WIDTH, (MM_HEIGHT + 4)) + SV.Dock.TopRight:SetSizeToScale(MM_WIDTH, (MM_HEIGHT + 4)) end self.Zone:SetSize(MM_WIDTH,28) @@ -610,13 +612,13 @@ function MOD:RefreshMiniMap() end if SVUI_AurasAnchor then - SVUI_AurasAnchor:Height(MM_HEIGHT) + SVUI_AurasAnchor:SetHeightToScale(MM_HEIGHT) if SVUI_AurasAnchor_MOVE and not SV.Mentalo:HasMoved('SVUI_AurasAnchor_MOVE') and not SV.Mentalo:HasMoved('SVUI_MinimapFrame_MOVE') then SVUI_AurasAnchor_MOVE:ClearAllPoints() - SVUI_AurasAnchor_MOVE:Point("TOPRIGHT", SVUI_MinimapFrame_MOVE, "TOPLEFT", -8, 0) + SVUI_AurasAnchor_MOVE:SetPointToScale("TOPRIGHT", SVUI_MinimapFrame_MOVE, "TOPLEFT", -8, 0) end if SVSVUI_AurasAnchor_MOVE then - SVUI_AurasAnchor_MOVE:Height(MM_HEIGHT) + SVUI_AurasAnchor_MOVE:SetHeightToScale(MM_HEIGHT) end end if SVUI_HyperBuffs then @@ -724,16 +726,16 @@ function MOD:Load() local mapHolder = SVUI_MinimapFrame -- mapHolder:SetParent(SV.Screen); mapHolder:SetFrameStrata("BACKGROUND") - mapHolder:Point("TOPRIGHT", SV.Screen, "TOPRIGHT", -10, -10) - mapHolder:Size(MM_WIDTH, MM_HEIGHT) + mapHolder:SetPointToScale("TOPRIGHT", SV.Screen, "TOPRIGHT", -10, -10) + mapHolder:SetSizeToScale(MM_WIDTH, MM_HEIGHT) mapHolder.Square = CreateFrame("Frame", nil, mapHolder) - mapHolder.Square:WrapOuter(mapHolder, 2) - mapHolder.Square:SetPanelTemplate("Blackout") + mapHolder.Square:SetAllPointsOut(mapHolder, 2) + mapHolder.Square:SetStylePanel("Default", "Blackout") mapHolder.Square.Panel.Skin:SetGradient(unpack(MM_COLOR)) mapHolder.Circle = mapHolder:CreateTexture(nil, "BACKGROUND", nil, -2) - mapHolder.Circle:WrapOuter(mapHolder, 2) + mapHolder.Circle:SetAllPointsOut(mapHolder, 2) mapHolder.Circle:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP-ROUND") mapHolder.Circle:SetGradient(unpack(MM_COLOR)) mapHolder.Circle:Hide() @@ -759,57 +761,57 @@ function MOD:Load() MinimapZoneTextButton:Hide() MiniMapTracking:Hide() MiniMapMailFrame:ClearAllPoints() - MiniMapMailFrame:Point("TOPRIGHT", mapHolder, 3, 4) + MiniMapMailFrame:SetPointToScale("TOPRIGHT", mapHolder, 3, 4) MiniMapMailBorder:Hide() MiniMapMailIcon:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP-MAIL") MiniMapWorldMapButton:Hide() MiniMapInstanceDifficulty:ClearAllPoints() MiniMapInstanceDifficulty:SetParent(Minimap) - MiniMapInstanceDifficulty:Point("LEFT", mapHolder, "LEFT", 0, 0) + MiniMapInstanceDifficulty:SetPointToScale("LEFT", mapHolder, "LEFT", 0, 0) GuildInstanceDifficulty:ClearAllPoints() GuildInstanceDifficulty:SetParent(Minimap) - GuildInstanceDifficulty:Point("LEFT", mapHolder, "LEFT", 0, 0) + GuildInstanceDifficulty:SetPointToScale("LEFT", mapHolder, "LEFT", 0, 0) MiniMapChallengeMode:ClearAllPoints() MiniMapChallengeMode:SetParent(Minimap) - MiniMapChallengeMode:Point("LEFT", mapHolder, "LEFT", 12, 0) + MiniMapChallengeMode:SetPointToScale("LEFT", mapHolder, "LEFT", 12, 0) QueueStatusMinimapButton:ClearAllPoints() - QueueStatusMinimapButton:Point("BOTTOMLEFT", mapHolder, "BOTTOMLEFT", 6, 5) - QueueStatusMinimapButton:SetPanelTemplate("Button", false, 1, -2, -2) + QueueStatusMinimapButton:SetPointToScale("BOTTOMLEFT", mapHolder, "BOTTOMLEFT", 2, 1) + QueueStatusMinimapButton:SetStylePanel("Default", "Icon", true, 1, -6, -6) QueueStatusFrame:SetClampedToScreen(true) QueueStatusMinimapButtonBorder:Hide() QueueStatusMinimapButton:SetScript("OnShow", function() - MiniMapInstanceDifficulty:Point("BOTTOMLEFT", QueueStatusMinimapButton, "TOPLEFT", 0, 0) - GuildInstanceDifficulty:Point("BOTTOMLEFT", QueueStatusMinimapButton, "TOPLEFT", 0, 0) - MiniMapChallengeMode:Point("BOTTOMLEFT", QueueStatusMinimapButton, "TOPRIGHT", 0, 0) + MiniMapInstanceDifficulty:SetPointToScale("BOTTOMLEFT", QueueStatusMinimapButton, "TOPLEFT", 0, 0) + GuildInstanceDifficulty:SetPointToScale("BOTTOMLEFT", QueueStatusMinimapButton, "TOPLEFT", 0, 0) + MiniMapChallengeMode:SetPointToScale("BOTTOMLEFT", QueueStatusMinimapButton, "TOPRIGHT", 0, 0) end) QueueStatusMinimapButton:SetScript("OnHide", function() - MiniMapInstanceDifficulty:Point("LEFT", mapHolder, "LEFT", 0, 0) - GuildInstanceDifficulty:Point("LEFT", mapHolder, "LEFT", 0, 0) - MiniMapChallengeMode:Point("LEFT", mapHolder, "LEFT", 12, 0) + MiniMapInstanceDifficulty:SetPointToScale("LEFT", mapHolder, "LEFT", 0, 0) + GuildInstanceDifficulty:SetPointToScale("LEFT", mapHolder, "LEFT", 0, 0) + MiniMapChallengeMode:SetPointToScale("LEFT", mapHolder, "LEFT", 12, 0) end) if FeedbackUIButton then FeedbackUIButton:Die() end - local mwfont = SV.Media.font.dialog + local mwfont = SV.Media.font.narrator local narr = CreateFrame("Frame", nil, mapHolder) - narr:Point("TOPLEFT", mapHolder, "TOPLEFT", 2, -2) + narr:SetPointToScale("TOPLEFT", mapHolder, "TOPLEFT", 2, -2) narr:SetSize(100, 22) - narr:SetFixedPanelTemplate("Component", true) + narr:SetStylePanel("Fixed", "Component", true) narr:SetPanelColor("yellow") narr:SetBackdropColor(1, 1, 0, 1) narr:SetFrameLevel(Minimap:GetFrameLevel() + 2) narr:SetParent(Minimap) narr.Text = narr:CreateFontString(nil, "ARTWORK", nil, 7) - narr.Text:FontManager(mwfont, 12, "OUTLINE", "CENTER", "MIDDLE") + narr.Text:FontManager("narrator") narr.Text:SetAllPoints(narr) narr.Text:SetTextColor(1, 1, 1) narr.Text:SetShadowColor(0, 0, 0, 0.3) @@ -818,14 +820,14 @@ function MOD:Load() self.Narrator = narr local zt = CreateFrame("Frame", nil, mapHolder) - zt:Point("BOTTOMRIGHT", mapHolder, "BOTTOMRIGHT", 2, -3) + zt:SetPointToScale("BOTTOMRIGHT", mapHolder, "BOTTOMRIGHT", 2, -3) zt:SetSize(MM_WIDTH, 28) zt:SetFrameLevel(Minimap:GetFrameLevel() + 1) zt:SetParent(Minimap) zt.Text = zt:CreateFontString(nil, "ARTWORK", nil, 7) - zt.Text:FontManager(mwfont, 12, "OUTLINE", "RIGHT", "MIDDLE") - zt.Text:Point("RIGHT", zt) + zt.Text:FontManager("narrator", "RIGHT") + zt.Text:SetPointToScale("RIGHT", zt) zt.Text:SetSize(MM_WIDTH, 32) zt.Text:SetTextColor(1, 1, 0) zt.Text:SetShadowColor(0, 0, 0, 0.3) @@ -846,7 +848,6 @@ function MOD:Load() WorldMapFrame:HookScript('OnHide', _hook_WorldMapFrame_OnHide) end - local WMCoords = CreateFrame('Frame', 'SVUI_WorldMapCoords', WorldMapFrame) WMCoords:SetFrameLevel(WorldMapDetailFrame:GetFrameLevel() + 1) WMCoords:SetFrameStrata(WorldMapDetailFrame:GetFrameStrata()) WMCoords.playerCoords = WMCoords:CreateFontString(nil,'OVERLAY') @@ -880,14 +881,14 @@ function MOD:Load() CoordsHolder.playerXCoords:SetPoint("BOTTOMLEFT", CoordsHolder, "BOTTOMLEFT", 0, 0) CoordsHolder.playerXCoords:SetWidth(70) CoordsHolder.playerXCoords:SetHeight(22) - CoordsHolder.playerXCoords:FontManager(SV.Media.font.numbers, 12, "OUTLINE") + CoordsHolder.playerXCoords:FontManager("number") CoordsHolder.playerXCoords:SetTextColor(cColor.r, cColor.g, cColor.b) CoordsHolder.playerYCoords = CoordsHolder:CreateFontString(nil, "OVERLAY") CoordsHolder.playerYCoords:SetPoint("BOTTOMLEFT", CoordsHolder.playerXCoords, "BOTTOMRIGHT", 4, 0) CoordsHolder.playerXCoords:SetWidth(70) CoordsHolder.playerYCoords:SetHeight(22) - CoordsHolder.playerYCoords:FontManager(SV.Media.font.numbers, 12, "OUTLINE") + CoordsHolder.playerYCoords:FontManager("number") CoordsHolder.playerYCoords:SetTextColor(cColor.r, cColor.g, cColor.b) local calendarButton = CreateFrame("Button", "SVUI_CalendarButton", CoordsHolder) @@ -918,8 +919,8 @@ function MOD:Load() if(SV.db.SVMap.minimapbar.enable == true) then MMBHolder = CreateFrame("Frame", "SVUI_MiniMapButtonHolder", mapHolder) - MMBHolder:Point("TOPRIGHT", SV.Dock.TopRight, "BOTTOMRIGHT", 0, -4) - MMBHolder:Size(mapHolder:GetWidth(), 32) + MMBHolder:SetPointToScale("TOPRIGHT", SV.Dock.TopRight, "BOTTOMRIGHT", 0, -4) + MMBHolder:SetSizeToScale(mapHolder:GetWidth(), 32) MMBHolder:SetFrameStrata("BACKGROUND") MMBBar = CreateFrame("Frame", "SVUI_MiniMapButtonBar", MMBHolder) MMBBar:SetFrameStrata("LOW") diff --git a/Interface/AddOns/SVUI/packages/override/SVOverride.lua b/Interface/AddOns/SVUI/packages/override/SVOverride.lua index 0263be0..2dc9436 100644 --- a/Interface/AddOns/SVUI/packages/override/SVOverride.lua +++ b/Interface/AddOns/SVUI/packages/override/SVOverride.lua @@ -88,7 +88,7 @@ local CaptureBarHandler = function() local captureBar = _G["WorldStateCaptureBar"..i] if(captureBar and captureBar:IsVisible()) then captureBar:ClearAllPoints() - captureBar:Point("TOP", lastFrame, "TOP", 0, offset) + captureBar:SetPointToScale("TOP", lastFrame, "TOP", 0, offset) lastFrame = captureBar offset = (-45 * i); end @@ -100,9 +100,9 @@ local Vehicle_OnSetPoint = function(self, _, parent) if(parent == "MinimapCluster" or parent == _G["MinimapCluster"]) then VehicleSeatIndicator:ClearAllPoints() if _G.VehicleSeatIndicator_MOVE then - VehicleSeatIndicator:Point("BOTTOM", VehicleSeatIndicator_MOVE, "BOTTOM", 0, 0) + VehicleSeatIndicator:SetPointToScale("BOTTOM", VehicleSeatIndicator_MOVE, "BOTTOM", 0, 0) else - VehicleSeatIndicator:Point("TOPLEFT", SV.Dock.TopLeft, "TOPLEFT", 0, 0) + VehicleSeatIndicator:SetPointToScale("TOPLEFT", SV.Dock.TopLeft, "TOPLEFT", 0, 0) SV.Mentalo:Add(VehicleSeatIndicator, L["Vehicle Seat Frame"]) end VehicleSeatIndicator:SetScale(0.8) @@ -112,7 +112,7 @@ end local Dura_OnSetPoint = function(self, _, parent) if((parent == "MinimapCluster") or (parent == _G["MinimapCluster"])) then self:ClearAllPoints() - self:Point("RIGHT", Minimap, "RIGHT") + self:SetPointToScale("RIGHT", Minimap, "RIGHT") self:SetScale(0.6) end end @@ -149,22 +149,22 @@ function MOD:Load() NewHook(VehicleSeatIndicator, "SetPoint", Vehicle_OnSetPoint) VehicleSeatIndicator:SetPoint("TOPLEFT", MinimapCluster, "TOPLEFT", 2, 2) - SVUI_WorldStateHolder:Size(200, 45) + SVUI_WorldStateHolder:SetSizeToScale(200, 45) SV.Mentalo:Add(SVUI_WorldStateHolder, L["Capture Bars"]) NewHook("UIParent_ManageFramePositions", CaptureBarHandler) - SVUI_AltPowerBar:Size(128, 50) - PlayerPowerBarAlt:ClearAllPoints() - PlayerPowerBarAlt:SetPoint("CENTER", SVUI_AltPowerBar, "CENTER") + SVUI_AltPowerBar:SetSizeToScale(128, 50) PlayerPowerBarAlt:SetParent(SVUI_AltPowerBar) + PlayerPowerBarAlt:ClearAllPoints() + PlayerPowerBarAlt:SetPoint("CENTER", SVUI_AltPowerBar, "CENTER", 0, 0) PlayerPowerBarAlt.ignoreFramePositionManager = true; SV.Mentalo:Add(SVUI_AltPowerBar, L["Alternative Power"]) - SVUI_BailOut:Size(30, 30) + SVUI_BailOut:SetSizeToScale(30, 30) SVUI_BailOut:SetNormalTexture(BAILOUT_ICON) SVUI_BailOut:SetPushedTexture(BAILOUT_ICON) SVUI_BailOut:SetHighlightTexture(BAILOUT_ICON) - SVUI_BailOut:SetFixedPanelTemplate("Transparent") + SVUI_BailOut:SetStylePanel("Fixed", "Transparent") SVUI_BailOut:RegisterForClicks("AnyUp") SVUI_BailOut:SetScript("OnClick", VehicleExit) SVUI_BailOut:RegisterEvent("UNIT_ENTERED_VEHICLE") @@ -176,7 +176,7 @@ function MOD:Load() SVUI_BailOut:Hide() LossOfControlFrame:ClearAllPoints() - LossOfControlFrame:Point("CENTER", SV.Screen, "CENTER", 0, 50) + LossOfControlFrame:SetPointToScale("CENTER", SV.Screen, "CENTER", 0, 50) SV.Mentalo:Add(LossOfControlFrame, L["Loss Control Icon"], nil, nil, "LoC") self:RegisterEvent("CHAT_MSG_BG_SYSTEM_HORDE", PVPRaidNoticeHandler) diff --git a/Interface/AddOns/SVUI/packages/override/components/alert.lua b/Interface/AddOns/SVUI/packages/override/components/alert.lua index c8d6f8b..da5630a 100644 --- a/Interface/AddOns/SVUI/packages/override/components/alert.lua +++ b/Interface/AddOns/SVUI/packages/override/components/alert.lua @@ -187,9 +187,9 @@ local AlertFramePostMove_Hook = function(forced) for index, rollFrame in pairs(MOD.RollFrames) do rollFrame:ClearAllPoints() if(POSITION == "TOP") then - rollFrame:Point("TOP", lastFrame, "BOTTOM", 0, -4) + rollFrame:SetPointToScale("TOP", lastFrame, "BOTTOM", 0, -4) else - rollFrame:Point("BOTTOM", lastFrame, "TOP", 0, 4) + rollFrame:SetPointToScale("BOTTOM", lastFrame, "TOP", 0, 4) end lastFrame = rollFrame; if(rollFrame:IsShown()) then @@ -218,7 +218,7 @@ PACKAGE CALL ########################################################## ]]-- function MOD:SetAlerts() - SVUI_AlertFrame:Size(180, 20); + SVUI_AlertFrame:SetSizeToScale(180, 20); SV.Mentalo:Add(SVUI_AlertFrame, L["Loot / Alert Frames"], nil, AlertFramePostMove_Hook) NewHook('AlertFrame_FixAnchors', AlertFramePostMove_Hook) diff --git a/Interface/AddOns/SVUI/packages/override/components/loot.lua b/Interface/AddOns/SVUI/packages/override/components/loot.lua index a27e706..c19b265 100644 --- a/Interface/AddOns/SVUI/packages/override/components/loot.lua +++ b/Interface/AddOns/SVUI/packages/override/components/loot.lua @@ -192,7 +192,7 @@ local LootRoll_OnUpdate = function(self) if not self.parent.rollID then return end local remaining = GetLootRollTimeLeft(self.parent.rollID) local mu = remaining / self.parent.time; - self.spark:Point("CENTER", self, "LEFT", mu * self:GetWidth(), 0) + self.spark:SetPointToScale("CENTER", self, "LEFT", mu * self:GetWidth(), 0) self:SetValue(remaining) if remaining > 1000000000 then self:GetParent():Hide() @@ -253,18 +253,18 @@ local function HandleSlots(frame) local slot = frame.slots[i] if slot:IsShown() then counter = counter + 1; - slot:Point("TOP", SVUI_LootFrame, 4, (-8 + scale) - (counter * scale)) + slot:SetPointToScale("TOP", SVUI_LootFrame, 4, (-8 + scale) - (counter * scale)) end end - frame:Height(max(counter * scale + 16, 20)) + frame:SetHeightToScale(max(counter * scale + 16, 20)) end local function MakeSlots(id) local size = LOOT_HEIGHT; local slot = CreateFrame("Button", "SVUI_LootSlot"..id, SVUI_LootFrame) - slot:Point("LEFT", 8, 0) - slot:Point("RIGHT", -8, 0) - slot:Height(size) + slot:SetPointToScale("LEFT", 8, 0) + slot:SetPointToScale("RIGHT", -8, 0) + slot:SetHeightToScale(size) slot:SetID(id) slot:RegisterForClicks("LeftButtonUp", "RightButtonUp") slot:SetScript("OnEnter", LootSlot_OnEnter) @@ -273,19 +273,19 @@ local function MakeSlots(id) slot:SetScript("OnShow", LootSlot_OnShow) slot.iconFrame = CreateFrame("Frame", nil, slot) - slot.iconFrame:Height(size) - slot.iconFrame:Width(size) + slot.iconFrame:SetHeightToScale(size) + slot.iconFrame:SetWidthToScale(size) slot.iconFrame:SetPoint("RIGHT", slot) - slot.iconFrame:SetPanelTemplate("Transparent") + slot.iconFrame:SetStylePanel("Default", "Transparent") slot.icon = slot.iconFrame:CreateTexture(nil, "ARTWORK") slot.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - slot.icon:FillInner() + slot.icon:SetAllPointsIn() slot.count = slot.iconFrame:CreateFontString(nil, "OVERLAY") slot.count:SetJustifyH("RIGHT") - slot.count:Point("BOTTOMRIGHT", slot.iconFrame, -2, 2) - slot.count:SetFont(LSM:Fetch("font", "Roboto"), 12, "OUTLINE") + slot.count:SetPointToScale("BOTTOMRIGHT", slot.iconFrame, -2, 2) + slot.count:SetFont(LSM:Fetch("font", "SVUI Clean Font"), 12, "OUTLINE") slot.count:SetText(1) slot.name = slot:CreateFontString(nil, "OVERLAY") @@ -293,7 +293,7 @@ local function MakeSlots(id) slot.name:SetPoint("LEFT", slot) slot.name:SetPoint("RIGHT", slot.icon, "LEFT") slot.name:SetNonSpaceWrap(true) - slot.name:SetFont(LSM:Fetch("font", "Roboto"), 12, "OUTLINE") + slot.name:SetFont(LSM:Fetch("font", "SVUI Clean Font"), 12, "OUTLINE") slot.drop = slot:CreateTexture(nil, "ARTWORK") slot.drop:SetTexture("Interface\\QuestFrame\\UI-QuestLogTitleHighlight") @@ -303,7 +303,7 @@ local function MakeSlots(id) slot.drop:SetAlpha(.3) slot.questTexture = slot.iconFrame:CreateTexture(nil, "OVERLAY") - slot.questTexture:FillInner() + slot.questTexture:SetAllPointsIn() slot.questTexture:SetTexture(TEXTURE_ITEM_QUEST_BANG) slot.questTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) @@ -314,8 +314,8 @@ end local function CreateRollButton(rollFrame, type, locale, anchor) local preset = RollTypePresets[type]; local rollButton = CreateFrame("Button", nil, rollFrame) - rollButton:Point("LEFT", anchor, "RIGHT", tonumber(preset[4]), tonumber(preset[5])) - rollButton:Size(LOOT_HEIGHT - 4) + rollButton:SetPointToScale("LEFT", anchor, "RIGHT", tonumber(preset[4]), tonumber(preset[5])) + rollButton:SetSizeToScale(LOOT_HEIGHT - 4) rollButton:SetNormalTexture(preset[1]) if preset[2] and preset[2] ~= "" then rollButton:SetPushedTexture(preset[2]) @@ -329,23 +329,23 @@ local function CreateRollButton(rollFrame, type, locale, anchor) rollButton:SetScript("OnClick", DoDaRoll) rollButton:SetMotionScriptsWhileDisabled(true) local text = rollButton:CreateFontString(nil, nil) - text:SetFont(LSM:Fetch("font", "Roboto"),14,"OUTLINE") - text:Point("CENTER", 0, ((type == 2 and 1) or (type == 0 and -1.2) or 0)) + text:SetFont(LSM:Fetch("font", "SVUI Clean Font"),14,"OUTLINE") + text:SetPointToScale("CENTER", 0, ((type == 2 and 1) or (type == 0 and -1.2) or 0)) return rollButton, text end local function CreateRollFrame() UpdateLootUpvalues() local rollFrame = CreateFrame("Frame", nil, UIParent) - rollFrame:Size(LOOT_WIDTH,LOOT_HEIGHT) - rollFrame:SetFixedPanelTemplate('Default') + rollFrame:SetSizeToScale(LOOT_WIDTH,LOOT_HEIGHT) + rollFrame:SetStylePanel("Fixed", 'Default') rollFrame:SetScript("OnEvent",LootRoll_OnEvent) rollFrame:RegisterEvent("CANCEL_LOOT_ROLL") rollFrame:Hide() rollFrame.button = CreateFrame("Button",nil,rollFrame) - rollFrame.button:Point("RIGHT",rollFrame,'LEFT',0,0) - rollFrame.button:Size(LOOT_HEIGHT - 2) - rollFrame.button:SetPanelTemplate('Default') + rollFrame.button:SetPointToScale("RIGHT",rollFrame,'LEFT',0,0) + rollFrame.button:SetSizeToScale(LOOT_HEIGHT - 2) + rollFrame.button:SetStylePanel("Default", 'Default') rollFrame.button:SetScript("OnEnter",LootItem_SetTooltip) rollFrame.button:SetScript("OnLeave",LootItem_OnLeave) rollFrame.button:SetScript("OnUpdate",LootItem_OnUpdate) @@ -354,13 +354,13 @@ local function CreateRollFrame() rollFrame.button.icon:SetAllPoints() rollFrame.button.icon:SetTexCoord(0.1,0.9,0.1,0.9 ) local border = rollFrame:CreateTexture(nil,"BORDER") - border:Point("TOPLEFT",rollFrame,"TOPLEFT",4,0) - border:Point("BOTTOMRIGHT",rollFrame,"BOTTOMRIGHT",-4,0) + border:SetPointToScale("TOPLEFT",rollFrame,"TOPLEFT",4,0) + border:SetPointToScale("BOTTOMRIGHT",rollFrame,"BOTTOMRIGHT",-4,0) border:SetTexture("Interface\\ChatFrame\\ChatFrameBackground") border:SetBlendMode("ADD") border:SetGradientAlpha("VERTICAL",.1,.1,.1,0,.1,.1,.1,0) rollFrame.status=CreateFrame("StatusBar",nil,rollFrame) - rollFrame.status:FillInner() + rollFrame.status:SetAllPointsIn() rollFrame.status:SetScript("OnUpdate",LootRoll_OnUpdate) rollFrame.status:SetFrameLevel(rollFrame.status:GetFrameLevel() - 1) rollFrame.status:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) @@ -371,7 +371,7 @@ local function CreateRollFrame() rollFrame.status.bg:SetAllPoints() rollFrame.status.bg:SetDrawLayer('BACKGROUND',2) rollFrame.status.spark = rollFrame:CreateTexture(nil,"OVERLAY") - rollFrame.status.spark:Size(LOOT_HEIGHT * 0.5, LOOT_HEIGHT) + rollFrame.status.spark:SetSizeToScale(LOOT_HEIGHT * 0.5, LOOT_HEIGHT) rollFrame.status.spark:SetTexture("Interface\\CastingBar\\UI-CastingBar-Spark") rollFrame.status.spark:SetBlendMode("ADD") @@ -382,19 +382,19 @@ local function CreateRollFrame() rollFrame.NeedIt,rollFrame.WantIt,rollFrame.BreakIt = needButton,greedButton,deButton; rollFrame.need,rollFrame.greed,rollFrame.pass,rollFrame.disenchant = needText,greedText,passText,deText; rollFrame.bindText = rollFrame:CreateFontString() - rollFrame.bindText:Point("LEFT",passButton,"RIGHT",3,1) + rollFrame.bindText:SetPointToScale("LEFT",passButton,"RIGHT",3,1) rollFrame.bindText:SetFont(LSM:Fetch("font", "SVUI Number Font"),14,"OUTLINE") rollFrame.lootText = rollFrame:CreateFontString(nil,"ARTWORK") rollFrame.lootText:SetFont(LSM:Fetch("font", "SVUI Number Font"),14,"OUTLINE") - rollFrame.lootText:Point("LEFT",rollFrame.bindText,"RIGHT",0,0) - rollFrame.lootText:Point("RIGHT",rollFrame,"RIGHT",-5,0) - rollFrame.lootText:Size(200,10) + rollFrame.lootText:SetPointToScale("LEFT",rollFrame.bindText,"RIGHT",0,0) + rollFrame.lootText:SetPointToScale("RIGHT",rollFrame,"RIGHT",-5,0) + rollFrame.lootText:SetSizeToScale(200,10) rollFrame.lootText:SetJustifyH("LEFT") rollFrame.yourRoll = rollFrame:CreateFontString(nil,"ARTWORK") rollFrame.yourRoll:SetFont(LSM:Fetch("font", "SVUI Number Font"),18,"OUTLINE") - rollFrame.yourRoll:Size(22,22) - rollFrame.yourRoll:Point("LEFT",rollFrame,"RIGHT",5,0) + rollFrame.yourRoll:SetSizeToScale(22,22) + rollFrame.yourRoll:SetPointToScale("LEFT",rollFrame,"RIGHT",5,0) rollFrame.yourRoll:SetJustifyH("CENTER") rollFrame.rolls = {} @@ -408,7 +408,7 @@ local function FetchRollFrame() end end local roll = CreateRollFrame() - roll:Point("TOP", next(MOD.RollFrames) and MOD.RollFrames[#MOD.RollFrames] or SVUI_AlertFrame, "BOTTOM", 0, -4); + roll:SetPointToScale("TOP", next(MOD.RollFrames) and MOD.RollFrames[#MOD.RollFrames] or SVUI_AlertFrame, "BOTTOM", 0, -4); tinsert(MOD.RollFrames, roll) return roll end @@ -545,7 +545,7 @@ local OpenedLootHandler = function(_, event, autoLoot) titleWidth = titleWidth + 5; local color = ITEM_QUALITY_COLORS[iQuality] SVUI_LootFrame:SetBackdropBorderColor(color.r, color.g, color.b, .8) - SVUI_LootFrame:Width(max(nameWidth, titleWidth)) + SVUI_LootFrame:SetWidthToScale(max(nameWidth, titleWidth)) end local LootComplexEventsHandler = function(_, event, arg1, arg2) @@ -641,14 +641,15 @@ PACKAGE CALL ########################################################## ]]-- function MOD:SetLootFrames() + if not SV.db.SVOverride.loot then return end UIPARENT_MANAGED_FRAME_POSITIONS["GroupLootContainer"] = nil; LootFrame:UnregisterAllEvents(); - SVUI_LootFrameHolder:Size(150, 22); + SVUI_LootFrameHolder:SetSizeToScale(150, 22); SV.Mentalo:Add(SVUI_LootFrameHolder, L["Loot Frame"], nil, nil, "SVUI_LootFrame"); - SVUI_LootFrame:Size(256, 64); - SVUI_LootFrame:SetFixedPanelTemplate('Transparent'); + SVUI_LootFrame:SetSizeToScale(256, 64); + SVUI_LootFrame:SetStylePanel("Fixed", 'Transparent'); SVUI_LootFrame.title:SetFont(LSM:Fetch("font", "SVUI Number Font"),18,"OUTLINE") SV:AddToDisplayAudit(SVUI_LootFrame); SVUI_LootFrame:Hide(); diff --git a/Interface/AddOns/SVUI/packages/override/components/mirror.lua b/Interface/AddOns/SVUI/packages/override/components/mirror.lua index 8928919..8b238b9 100644 --- a/Interface/AddOns/SVUI/packages/override/components/mirror.lua +++ b/Interface/AddOns/SVUI/packages/override/components/mirror.lua @@ -72,7 +72,7 @@ MIRROR BARS ]]-- local SetMirrorPosition = function(bar) local yOffset = mirrorYOffset[bar.type] - return bar:Point("TOP", SV.Screen, "TOP", 0, -yOffset) + return bar:SetPointToScale("TOP", SV.Screen, "TOP", 0, -yOffset) end local MirrorBar_OnUpdate = function(self, elapsed) @@ -107,18 +107,18 @@ local function MirrorBarRegistry(barType) return RegisteredMirrorBars[barType] end local bar = CreateFrame('StatusBar', nil, UIParent) - bar:SetPanelTemplate("Bar", false, 3, 3, 3) + bar:SetStylePanel("Default", "Bar", false, 3, 3, 3) bar:SetScript("OnUpdate", MirrorBar_OnUpdate) local r, g, b = unpack(mirrorTypeColor[barType]) bar.text = bar:CreateFontString(nil, 'OVERLAY') - bar.text:FontManager(SV.Media.font.roboto, 12, 'OUTLINE') + bar.text:FontManager("default") bar.text:SetJustifyH('CENTER') bar.text:SetTextColor(1, 1, 1) bar.text:SetPoint('LEFT', bar) bar.text:SetPoint('RIGHT', bar) - bar.text:Point('TOP', bar, 0, 2) + bar.text:SetPointToScale('TOP', bar, 0, 2) bar.text:SetPoint('BOTTOM', bar) - bar:Size(222, 18) + bar:SetSizeToScale(222, 18) bar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) bar:SetStatusBarColor(r, g, b) bar.type = barType; @@ -134,12 +134,12 @@ local function SetTimerStyle(bar) if child:GetObjectType() == "Texture"then child:SetTexture(0,0,0,0) elseif child:GetObjectType() == "FontString" then - child:FontManager(SV.Media.font.roboto, 12, 'OUTLINE') + child:FontManager("default") end end bar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) bar:SetStatusBarColor(0.37, 0.92, 0.08) - bar:SetPanelTemplate("Bar", false, 3, 3, 3) + bar:SetStylePanel("Default", "Bar", false, 3, 3, 3) end local MirrorBarToggleHandler = function(_, event, arg, ...) diff --git a/Interface/AddOns/SVUI/packages/plate/SVPlate.lua b/Interface/AddOns/SVUI/packages/plate/SVPlate.lua new file mode 100644 index 0000000..200b4aa --- /dev/null +++ b/Interface/AddOns/SVUI/packages/plate/SVPlate.lua @@ -0,0 +1,1581 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +credit: Elv. SVPlates was parently nameplates.lua adapted from ElvUI # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local string = _G.string; +local math = _G.math; +local bit = _G.bit; +local table = _G.table; +--[[ STRING METHODS ]]-- +local lower, upper = string.lower, string.upper; +local find, format, split = string.find, string.format, string.split; +local match, gmatch, gsub = string.match, string.gmatch, string.gsub; +--[[ MATH METHODS ]]-- +local floor, ceil = math.floor, math.ceil; -- Basic +--[[ BINARY METHODS ]]-- +local band, bor = bit.band, bit.bor; +--[[ TABLE METHODS ]]-- +local tremove, tcopy, twipe, tsort, tconcat = table.remove, table.copy, table.wipe, table.sort, table.concat; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local LSM = LibStub("LibSharedMedia-3.0") +local MOD = SV:NewPackage("SVPlate", L["NamePlates"]); +--[[ +########################################################## +LOCALIZED GLOBALS +########################################################## +]]-- +local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local numChildren = -1; +local PlateRegistry, VisiblePlates = {}, {}; +local WorldFrameUpdateHook, UpdatePlateElements, PlateForge; +local BLIZZ_PLATE, SVUI_PLATE, PLATE_REF, PLATE_ARGS, PLATE_AURAS, PLATE_AURAICONS, PLATE_GRIP, PLATE_REALNAME; +local CURRENT_TARGET_NAME; +local TARGET_CHECKS = 0; +local PLATE_TOP = [[Interface\Addons\SVUI\assets\artwork\Template\Plate\PLATE-TOP]] +local PLATE_BOTTOM = [[Interface\Addons\SVUI\assets\artwork\Template\Plate\PLATE-BOTTOM]] +local PLATE_RIGHT = [[Interface\Addons\SVUI\assets\artwork\Template\Plate\PLATE-RIGHT]] +local PLATE_LEFT = [[Interface\Addons\SVUI\assets\artwork\Template\Plate\PLATE-LEFT]] +--[[ + Quick explaination of what Im doing with all of these locals... + Unlike many of the other modules, SVPlates has to continuously + reference config settings which can start to get sluggish. What + I have done is set local variables for every database value + that the module can read efficiently. The function "UpdateLocals" + is used to refresh these any time a change is made to configs + and once when the mod is loaded. +]]-- +local NPClassRole = SV.ClassRole; +local NPBaseAlpha = 0.6; +local NPCombatHide = false; +local NPNameMatch = false; +local NPComboColor={ + [1]={0.69,0.31,0.31}, + [2]={0.69,0.31,0.31}, + [3]={0.65,0.63,0.35}, + [4]={0.65,0.63,0.35}, + [5]={0.33,0.59,0.33} +} + +local NPFont = [[Interface\AddOns\SVUI\assets\fonts\Action.ttf]]; +local NPFSize = 10; +local NPFOutline = "OUTLINE"; + +local NPUsePointer = true; +local NPPointerMatch = false; +local NPPointerColor = {0.7,0,1}; + +local NPUseThreat = false; +local NPThreatGS = 1; +local NPThreatBS = 1; +local NPGoodThreat = {0.29,0.68,0.3} +local NPBadThreat = {0.78,0.25,0.25} +local NPGoodTrans = {0.85,0.77,0.36} +local NPBadTrans = {0.94,0.6,0.06} + +local NPReactTap = {0.3,0.3,0.3} +local NPReactNPCGood = {0.31,0.45,0.63} +local NPReactPlayerGood = {0.29,0.68,0.3} +local NPReactNeutral = {0.85,0.77,0.36} +local NPReactEnemy = {0.78,0.25,0.25} + +local RIconCoords = {[0]={[0]="STAR", [0.25]="MOON"}, [0.25]={[0]="CIRCLE", [0.25]="SQUARE"}, [0.5]={[0]="DIAMOND", [0.25]="CROSS"}, [0.75]={[0]="TRIANGLE", [0.25]="SKULL"}}; +local RIAnchor = "LEFT"; +local RIXoffset = -4; +local RIYoffset = 6; +local RISize = 36; + +local HBThresh = 0.4; +local HBTextFormat = false; +local HBTextAnchor = "CENTER"; +local HBXoffset = 0; +local HBYoffset = 0; +local HBWidth = 108; +local HBHeight = 9; + +local NPIcons = 14; + +local CBColor = {0.1,0.81,0} +local CBNoInterrupt = {1,0.25,0.25} +local CBHeight = 6; +local CBText = true; +local CBXoffset = 0; +local CBYoffset = 0; + +local AuraFont = [[Interface\AddOns\SVUI\assets\fonts\Numbers.ttf]]; +local AuraFSize = 7; +local AuraFOutline = "OUTLINE"; +local AuraFilterName, AuraFilter; +local AuraMaxCount = 5; + +local RestrictedPlates = { + ["Army of the Dead Ghoul"] = true, + ["Venomous Snake"] = true, + ["Healing Tide Totem"] = true, + ["Dragonmaw War Banner"] = true +}; +local RIconData = {["STAR"] = 0x00000001, ["CIRCLE"] = 0x00000002, ["DIAMOND"] = 0x00000004, ["TRIANGLE"] = 0x00000008, ["MOON"] = 0x00000010, ["SQUARE"] = 0x00000020, ["CROSS"] = 0x00000040, ["SKULL"] = 0x00000080}; +local RIconNames = {"STAR", "CIRCLE", "DIAMOND", "TRIANGLE", "MOON", "SQUARE", "CROSS", "SKULL"} +local UnitPlateAuras = {}; +local AuraByRaidIcon = {}; +local AuraByName = {}; +local CachedAuraDurations = {}; +local AurasCache = {}; +local AuraClocks = {}; +local ClockIsTicking = false; +local TickTock = 0; +local LastKnownTarget; +--[[ +########################################################## +UTILITY FRAMES +########################################################## +]]-- +local NPGrip = _G.SVUI_PlateParentFrame +local NPGlow = _G.SVUI_PlateGlowFrame +local AuraClockManager = CreateFrame("Frame") +--[[ +########################################################## +PRE VARS/FUNCTIONS +########################################################## +]]-- +local formatting = { + ["CURRENT"] = "%s", + ["CURRENT_MAX"] = "%s - %s", + ["CURRENT_PERCENT"] = "%s - %s%%", + ["CURRENT_MAX_PERCENT"] = "%s - %s | %s%%", + ["PERCENT"] = "%s%%", + ["DEFICIT"] = "-%s" +}; + +local function TruncateString(value) + if value >= 1e9 then + return ("%.1fb"):format(value / 1e9):gsub("%.?0 + ([kmb])$", "%1") + elseif value >= 1e6 then + return ("%.1fm"):format(value / 1e6):gsub("%.?0 + ([kmb])$", "%1") + elseif value >= 1e3 or value <= -1e3 then + return ("%.1fk"):format(value / 1e3):gsub("%.?0 + ([kmb])$", "%1") + else + return value + end +end + +local function SetTextStyle(style, min, max) + if max == 0 then max = 1 end + local result; + local textFormat = formatting[style] + if style == "DEFICIT" then + local result = max - min; + if result <= 0 then + return "" + else + return format(textFormat, TruncateString(result)) + end + elseif style == "PERCENT" then + result = format(textFormat, format("%.1f", min / max * 100)) + result = result:gsub(".0%%", "%%") + return result + elseif style == "CURRENT" or (style == "CURRENT_MAX" or style == "CURRENT_MAX_PERCENT" or style == "CURRENT_PERCENT") and min == max then + return format(formatting["CURRENT"], TruncateString(min)) + elseif style == "CURRENT_MAX" then + return format(textFormat, TruncateString(min), TruncateString(max)) + elseif style == "CURRENT_PERCENT" then + result = format(textFormat, TruncateString(min), format("%.1f", min / max * 100)) + result = result:gsub(".0%%", "%%") + return result + elseif style == "CURRENT_MAX_PERCENT" then + result = format(textFormat, TruncateString(min), TruncateString(max), format("%.1f", min / max * 100)) + result = result:gsub(".0%%", "%%") + return result + end +end + +local function SetPlateBorder(plate, point) + point = point or plate + local noscalemult = 2 * UIParent:GetScale() + if point.bordertop then return end + point.backdrop = plate:CreateTexture(nil, "BORDER") + point.backdrop:SetDrawLayer("BORDER", -4) + point.backdrop:SetAllPoints(point) + point.backdrop:SetTexture(SV.Media.bar.default) + point.backdrop:SetVertexColor(0.1,0.1,0.1) + + point.bordertop = plate:CreateTexture(nil, "BORDER") + point.bordertop:SetPoint("TOPLEFT", point, "TOPLEFT", -noscalemult, noscalemult) + point.bordertop:SetPoint("TOPRIGHT", point, "TOPRIGHT", noscalemult, noscalemult) + point.bordertop:SetHeight(noscalemult) + point.bordertop:SetTexture(0,0,0) + point.bordertop:SetDrawLayer("BORDER", 1) + + point.borderbottom = plate:CreateTexture(nil, "BORDER") + point.borderbottom:SetPoint("BOTTOMLEFT", point, "BOTTOMLEFT", -noscalemult, -noscalemult) + point.borderbottom:SetPoint("BOTTOMRIGHT", point, "BOTTOMRIGHT", noscalemult, -noscalemult) + point.borderbottom:SetHeight(noscalemult) + point.borderbottom:SetTexture(0,0,0) + point.borderbottom:SetDrawLayer("BORDER", 1) + + point.borderleft = plate:CreateTexture(nil, "BORDER") + point.borderleft:SetPoint("TOPLEFT", point, "TOPLEFT", -noscalemult, noscalemult) + point.borderleft:SetPoint("BOTTOMLEFT", point, "BOTTOMLEFT", noscalemult, -noscalemult) + point.borderleft:SetWidth(noscalemult) + point.borderleft:SetTexture(0,0,0) + point.borderleft:SetDrawLayer("BORDER", 1) + + point.borderright = plate:CreateTexture(nil, "BORDER") + point.borderright:SetPoint("TOPRIGHT", point, "TOPRIGHT", noscalemult, noscalemult) + point.borderright:SetPoint("BOTTOMRIGHT", point, "BOTTOMRIGHT", -noscalemult, -noscalemult) + point.borderright:SetWidth(noscalemult) + point.borderright:SetTexture(0,0,0) + point.borderright:SetDrawLayer("BORDER", 1) +end + +local function SetEliteBorder(point) + local noscalemult = 2 * UIParent:GetScale() + if point.eliteborder then return end + + point.eliteborder = CreateFrame("Frame", nil, point) + point.eliteborder:SetAllPoints(point) + point.eliteborder:SetFrameStrata("BACKGROUND") + point.eliteborder:SetFrameLevel(0) + + point.eliteborder.top = point.eliteborder:CreateTexture(nil, "BACKGROUND") + point.eliteborder.top:SetPoint("BOTTOMLEFT", point.eliteborder, "TOPLEFT", 0, 0) + point.eliteborder.top:SetPoint("BOTTOMRIGHT", point.eliteborder, "TOPRIGHT", 0, 0) + point.eliteborder.top:SetHeight(22) + point.eliteborder.top:SetTexture(PLATE_TOP) + point.eliteborder.top:SetVertexColor(1, 1, 0) + point.eliteborder.top:SetBlendMode("BLEND") + + point.eliteborder.bottom = point.eliteborder:CreateTexture(nil, "BACKGROUND") + point.eliteborder.bottom:SetPoint("TOPLEFT", point.eliteborder, "BOTTOMLEFT", 0, 0) + point.eliteborder.bottom:SetPoint("TOPRIGHT", point.eliteborder, "BOTTOMRIGHT", 0, 0) + point.eliteborder.bottom:SetHeight(32) + point.eliteborder.bottom:SetTexture(PLATE_BOTTOM) + point.eliteborder.bottom:SetVertexColor(1, 1, 0) + point.eliteborder.bottom:SetBlendMode("BLEND") + + -- point.eliteborder.right = point.eliteborder:CreateTexture(nil, "BACKGROUND") + -- point.eliteborder.right:SetPoint("TOPLEFT", point.eliteborder, "TOPRIGHT", 0, 0) + -- point.eliteborder.right:SetPoint("BOTTOMLEFT", point.eliteborder, "BOTTOMRIGHT", 0, 0) + -- point.eliteborder.right:SetWidth(point:GetHeight() * 4) + -- point.eliteborder.right:SetTexture(PLATE_RIGHT) + -- point.eliteborder.right:SetVertexColor(1, 1, 0) + -- point.eliteborder.right:SetBlendMode("BLEND") + + -- point.eliteborder.left = point.eliteborder:CreateTexture(nil, "BACKGROUND") + -- point.eliteborder.left:SetPoint("TOPRIGHT", point.eliteborder, "TOPLEFT", 0, 0) + -- point.eliteborder.left:SetPoint("BOTTOMRIGHT", point.eliteborder, "BOTTOMLEFT", 0, 0) + -- point.eliteborder.left:SetWidth(point:GetHeight() * 4) + -- point.eliteborder.left:SetTexture(PLATE_LEFT) + -- point.eliteborder.left:SetVertexColor(1, 1, 0) + -- point.eliteborder.left:SetBlendMode("BLEND") + + point.eliteborder:SetAlpha(0.35) + + point.eliteborder:Hide() +end +--[[ +########################################################## +UPVALUE PROXYS +########################################################## +]]-- +local function ProxyThisPlate(plate, updateName) + if(not plate or not plate.frame) then return false; end + BLIZZ_PLATE = plate + SVUI_PLATE = plate.frame + PLATE_REF = plate.ref + PLATE_AURAS = plate.frame.auras + PLATE_AURAICONS = plate.frame.auraicons + PLATE_ARGS = plate.setting + PLATE_GRIP = plate.holder + if updateName then + plate.ref.nametext = gsub(plate.name:GetText(), '%s%(%*%)',''); + end + PLATE_REALNAME = plate.ref.nametext + return true +end +--[[ +########################################################## +LOCAL HELPERS +########################################################## +]]-- +local function ParseByGUID(guid) + for plate, _ in pairs(VisiblePlates) do + if plate and plate:IsShown() and plate.guid == guid then + return plate + end + end +end + +local function CheckRaidIcon(plate) + if(plate and plate.ref) then + SVUI_PLATE = plate.frame + PLATE_REF = plate.ref + end + if PLATE_REF.raidicon:IsShown() then + local ULx,ULy,LLx,LLy,URx,URy,LRx,LRy = PLATE_REF.raidicon:GetTexCoord() + PLATE_REF.raidicontype = RIconCoords[ULx][ULy] + SVUI_PLATE.raidicon:Show() + SVUI_PLATE.raidicon:SetTexCoord(ULx,ULy,LLx,LLy,URx,URy,LRx,LRy) + else + PLATE_REF.raidicontype = nil; + SVUI_PLATE.raidicon:Hide() + end +end + +local function UpdateComboPoints() + local guid = UnitGUID("target") + if (not guid) then return end + local numPoints = GetComboPoints(UnitHasVehicleUI('player') and 'vehicle' or 'player', 'target') + numPoints = numPoints or 0 + if(numPoints > 0) then + if(LastKnownTarget and LastKnownTarget.guid and LastKnownTarget.guid ~= guid) then + LastKnownTarget.frame.combo[1]:Hide() + LastKnownTarget.frame.combo[2]:Hide() + LastKnownTarget.frame.combo[3]:Hide() + LastKnownTarget.frame.combo[4]:Hide() + LastKnownTarget.frame.combo[5]:Hide() + LastKnownTarget = nil + end + end + local plate = ParseByGUID(guid) + if(plate) then + for i=1, MAX_COMBO_POINTS do + if(i <= numPoints) then + plate.frame.combo[i]:Show() + else + plate.frame.combo[i]:Hide() + end + end + LastKnownTarget = plate + end +end +--[[ +########################################################## +AURA HELPERS +########################################################## +]]-- +local ClockUpdateHandler = function(self, elapsed) + local curTime = GetTime() + if curTime < TickTock then return end + local deactivate = true; + TickTock = curTime + 0.1 + for frame, expiration in pairs(AuraClocks) do + local calc = 0; + local expires = expiration - curTime; + if expiration < curTime then + frame:Hide(); + AuraClocks[frame] = nil + else + if expires < 60 then + calc = floor(expires) + if expires >= 4 then + frame.TimeLeft:SetFormattedText("|cffffff00%d|r", calc) + elseif expires >= 1 then + frame.TimeLeft:SetFormattedText("|cffff0000%d|r", calc) + else + frame.TimeLeft:SetFormattedText("|cffff0000%.1f|r", expires) + end + elseif expires < 3600 then + calc = ceil(expires / 60); + frame.TimeLeft:SetFormattedText("|cffffffff%.1f|r", calc) + elseif expires < 86400 then + calc = ceil(expires / 3600); + frame.TimeLeft:SetFormattedText("|cff66ffff%.1f|r", calc) + else + calc = ceil(expires / 86400); + frame.TimeLeft:SetFormattedText("|cff6666ff%.1f|r", calc) + end + deactivate = false + end + end + if deactivate then + self:SetScript("OnUpdate", nil); + ClockIsTicking = false + end +end + +local function RegisterAuraClock(frame, expiration) + if(not frame) then return end + if expiration == 0 then + frame:Hide() + AuraClocks[frame] = nil + else + AuraClocks[frame] = expiration + frame:Show() + if(not ClockIsTicking) then + AuraClockManager:SetScript("OnUpdate", ClockUpdateHandler) + ClockIsTicking = true + end + end +end + +local function GetUnitPlateAuras(guid) + if guid and UnitPlateAuras[guid] then return UnitPlateAuras[guid] end +end + +local function SetAuraInstance(guid, spellID, expiration, stacks, caster, duration, texture) + if(spellID == 65148) then return end + local filter = true; + if (caster == UnitGUID('player')) then + filter = nil; + end + if(AuraFilter and AuraFilterName) then + local name = GetSpellInfo(spellID) + if(AuraFilter[name] and AuraFilter[name].enable and ((AuraFilterName ~= 'BlackList') and (AuraFilterName ~= 'Allowed'))) then + filter = nil; + end + end + if(not filter and (guid and spellID and caster and texture)) then + local auraID = spellID..(tostring(caster or "UNKNOWN_CASTER")) + UnitPlateAuras[guid] = UnitPlateAuras[guid] or {} + UnitPlateAuras[guid][auraID] = { + spellID = spellID, + expiration = expiration or 0, + stacks = stacks, + duration = duration, + texture = texture + } + end +end + +local function UpdateAuraIcon(aura, texture, expiration, stacks, test) + if aura and texture and expiration then + aura.Icon:SetTexture(texture) + if stacks > 1 then + aura.Stacks:SetText(stacks) + else + aura.Stacks:SetText("") + end + aura:Show() + RegisterAuraClock(aura, expiration) + else + RegisterAuraClock(aura, 0) + end +end + +local function SortExpires(t) + tsort(t, function(a,b) return a.expiration < b.expiration end) + return t +end + +local function UpdateAuraIconGrid(plate) + local frame = plate.frame; + local guid = plate.guid; + local iconCache = frame.auraicons; + local AurasOnUnit = GetUnitPlateAuras(guid); + local AuraSlotIndex = 1; + local auraID; + if AurasOnUnit then + frame.auras:Show() + local auraCount = 1 + for auraID,aura in pairs(AurasOnUnit) do + if tonumber(aura.spellID) then + aura.name = GetSpellInfo(tonumber(aura.spellID)) + aura.unit = plate.unit + if(aura.expiration > GetTime()) then + AurasCache[auraCount] = aura + auraCount = auraCount + 1 + end + end + end + end + AurasCache = SortExpires(AurasCache) + for index = 1, #AurasCache do + local cachedaura = AurasCache[index] + local gridaura = iconCache[AuraSlotIndex] + if gridaura and cachedaura.spellID and cachedaura.expiration then + UpdateAuraIcon(gridaura, cachedaura.texture, cachedaura.expiration, cachedaura.stacks) + AuraSlotIndex = AuraSlotIndex + 1 + end + if(AuraSlotIndex > AuraMaxCount) then + break + end + end + if(iconCache[AuraSlotIndex]) then + RegisterAuraClock(iconCache[AuraSlotIndex], 0) + end + twipe(AurasCache) +end + +local function LoadDuration(spellID) + if spellID then + return CachedAuraDurations[spellID] or 0 + end + return 0 +end + +local function SaveDuration(spellID, duration) + duration = duration or 0 + if spellID then CachedAuraDurations[spellID] = duration end +end + +function MOD:UpdateAuras(plate) + if plate.setting.tiny then return end + local guid = plate.guid + local frame = plate.frame + if not guid then + if RAID_CLASS_COLORS[plate.setting.unitcategory] then + local pn = plate.name:GetText() + local name = pn:gsub("%s%(%*%)", "") + guid = AuraByName[name] + elseif plate.ref.raidicon:IsShown() then + guid = AuraByRaidIcon[plate.ref.raidicontype] + end + if guid then + plate.guid = guid + else + frame.auras:Hide() + return + end + end + UpdateAuraIconGrid(plate) + if(self.UseCombo) then + local numPoints = GetComboPoints(UnitHasVehicleUI("player") and "vehicle" or "player", "target") + for i = 1, MAX_COMBO_POINTS do + if(i <= numPoints) then + frame.combo[i]:Show() + else + frame.combo[i]:Hide() + end + end + end +end + +function MOD:UpdateAurasByUnitID(unitid) + local guid = UnitGUID(unitid) + if(guid and UnitPlateAuras[guid]) then + local auras = UnitPlateAuras[guid] + for auraID, _ in pairs(auras) do + UnitPlateAuras[guid][auraID] = nil + end + end + for i = 1, 40 do + local spellname , _, texture, count, dispelType, duration, expirationTime, unitCaster, _, _, spellid, _, isBossDebuff = UnitAura(unitid, i, "HARMFUL") + if(not spellname) then break end + SaveDuration(spellid, duration) + SetAuraInstance(guid, spellid, expirationTime, count, UnitGUID(unitCaster or ""), duration, texture) + end + local name; + if UnitPlayerControlled(unitid) then + name = UnitName(unitid) + AuraByName[name] = guid + end + local raidIcon = RIconNames[GetRaidTargetIndex(unitid) or ""]; + if(raidIcon) then + AuraByRaidIcon[raidIcon] = guid + end + self:RequestScanUpdate(guid, raidIcon, name, "UpdateAuras") +end +--[[ +########################################################## +PLATE COLORING +########################################################## +]]-- +do + local function GetPlateThreatReaction(plate) + if plate.ref.threat:IsShown() then + local r, g, b = plate.ref.threat:GetVertexColor() + if g + b == 0 then + return 'FULL_THREAT' + else + if plate.ref.reaction == 'FULL_THREAT' then + return 'GAINING_THREAT' + else + return 'LOSING_THREAT' + end + end + else + return 'NO_THREAT' + end + end + + local function GetPlateReaction(plate) + if plate.guid ~= nil then + local class, classToken, _, _, _, _, _ = GetPlayerInfoByGUID(plate.guid) + if RAID_CLASS_COLORS[classToken] then + return classToken + end + end + + local oldR,oldG,oldB = plate.health:GetStatusBarColor() + local r = floor(oldR * 100 + .5) * 0.01; + local g = floor(oldG * 100 + .5) * 0.01; + local b = floor(oldB * 100 + .5) * 0.01; + --print(plate.health:GetStatusBarColor()) + for classToken, _ in pairs(RAID_CLASS_COLORS) do + local bb = b + if classToken == 'MONK' then + bb = bb - 0.01 + end + if RAID_CLASS_COLORS[classToken].r == r and RAID_CLASS_COLORS[classToken].g == g and RAID_CLASS_COLORS[classToken].b == bb then + return classToken + end + end + + if (r + b + b) == 1.59 then + return 'TAPPED_NPC' + elseif g + b == 0 then + return 'HOSTILE_NPC' + elseif r + b == 0 then + return 'FRIENDLY_NPC' + elseif r + g > 1.95 then + return 'NEUTRAL_NPC' + elseif r + g == 0 then + return 'FRIENDLY_PLAYER' + else + return 'HOSTILE_PLAYER' + end + end + + local function ColorizeAndScale(plate, frame) + local unitType = GetPlateReaction(plate) + local scale = 1 + + plate.setting.unitcategory = unitType + + local latestColor; + + if RAID_CLASS_COLORS[unitType] then + latestColor = {RAID_CLASS_COLORS[unitType].r, RAID_CLASS_COLORS[unitType].g, RAID_CLASS_COLORS[unitType].b} + elseif unitType == "TAPPED_NPC" then + latestColor = NPReactTap + elseif unitType == "HOSTILE_NPC" or unitType == "NEUTRAL_NPC" then + local threatReaction = GetPlateThreatReaction(plate) + if (not NPUseThreat) then + if unitType == "NEUTRAL_NPC" then + latestColor = NPReactNeutral + else + latestColor = NPReactEnemy + end + else + if threatReaction == 'FULL_THREAT' then + if NPClassRole == 'T' then + latestColor = NPGoodThreat + scale = NPThreatGS + else + latestColor = NPBadThreat + scale = NPThreatBS + end + elseif threatReaction == 'GAINING_THREAT' then + if NPClassRole == 'T' then + latestColor = NPGoodTrans + else + latestColor = NPBadTrans + end + elseif threatReaction == 'LOSING_THREAT' then + if NPClassRole == 'T' then + latestColor = NPBadTrans + else + latestColor = NPGoodTrans + end + elseif InCombatLockdown() then + if NPClassRole == 'T' then + latestColor = NPBadThreat + scale = NPThreatBS + else + latestColor = NPGoodThreat + scale = NPThreatGS + end + else + if unitType == "NEUTRAL_NPC" then + latestColor = NPReactNeutral + else + latestColor = NPReactEnemy + end + end + end + plate.ref.reaction = threatReaction + elseif unitType == "FRIENDLY_NPC" then + latestColor = NPReactNPCGood + elseif unitType == "FRIENDLY_PLAYER" then + latestColor = NPReactPlayerGood + end + + local r,g,b + if(latestColor) then + r,g,b = unpack(latestColor) + else + r,g,b = plate.health:GetStatusBarColor() + end + + frame.health:SetStatusBarColor(r,g,b) + if(NPUsePointer and NPPointerMatch and plate.setting.unit == "target") then + NPGlow:SetBackdropBorderColor(r,g,b) + end + --frame.health.eliteborder.bottom:SetVertexColor(r,g,b) + --frame.health.eliteborder.right:SetVertexColor(r,g,b) + --frame.health.eliteborder.left:SetVertexColor(r,g,b) + + if(not plate.setting.scaled and not plate.setting.tiny and frame.health:GetWidth() ~= (HBWidth * scale)) then + frame.health:SetSize(HBWidth * scale, HBHeight * scale) + plate.cast.icon:SetSize(CBHeight + (HBHeight * scale) + 5, CBHeight + (HBHeight * scale) + 5) + end + end + + function UpdatePlateElements(plate, frame) + ColorizeAndScale(plate, frame) + local region = select(4, plate:GetRegions()) + if(region and region:GetObjectType() == 'FontString') then + plate.ref.level = region + end + + if(plate.ref.level:IsShown()) then + local level = plate.ref.level:GetObjectType() == 'FontString' and tonumber(plate.ref.level:GetText()) or nil + local elite, boss, mylevel = plate.ref.eliteicon:IsShown(), plate.ref.skullicon:IsShown(), UnitLevel("player") + frame.health.eliteborder:Hide() + if(boss) then + frame.level:SetText("??") + frame.level:SetTextColor(0.8, 0.05, 0) + frame.health.eliteborder:Show() + elseif(level) then + frame.level:SetText(level..(elite and "+" or "")) + frame.level:SetTextColor(plate.ref.level:GetTextColor()) + if(elite) then frame.health.eliteborder:Show() end + end + elseif(plate.ref.skullicon:IsShown() and frame.level:GetText() ~= '??') then + frame.level:SetText("??") + frame.level:SetTextColor(0.8, 0.05, 0) + end + + if plate.setting.tiny then + frame.level:SetText("") + frame.level:Hide() + elseif(not frame.level:IsShown()) then + frame.level:Show() + end + + if(frame.name.SetText) then + frame.name:SetText(plate.name:GetText()) + end + end +end +--[[ +########################################################## +PLATE UPDATE HANDLERS +########################################################## +]]-- +do + local function IsNamePlate(frame) + local frameName = frame:GetName() + if frameName and frameName:find('^NamePlate%d') then + local textObj = select(2, frame:GetChildren()) + if textObj then + local textRegions = textObj:GetRegions() + return (textRegions and textRegions:GetObjectType() == 'FontString') + end + end + end + + local function SetPlateAlpha(plate, frame) + if plate:GetAlpha() < 1 then + frame:SetAlpha(NPBaseAlpha) + else + frame:SetAlpha(1) + end + end + + local function UpdatePlateUnit() + local plateName = PLATE_REF.nametext + + if BLIZZ_PLATE:GetAlpha() == 1 and CURRENT_TARGET_NAME and (CURRENT_TARGET_NAME == plateName) then + BLIZZ_PLATE.guid = UnitGUID("target") + PLATE_ARGS.unit = "target" + SVUI_PLATE:SetFrameLevel(2) + SVUI_PLATE.highlight:Hide() + if(NPUsePointer) then + NPGlow:SetParent(SVUI_PLATE) + NPGlow:SetAllPointsOut(SVUI_PLATE.health,2,2) + NPGlow:SetFrameLevel(0) + NPGlow:SetFrameStrata("BACKGROUND") + NPGlow:Show() + end + if((TARGET_CHECKS > 0) or PLATE_ARGS.allowed) then + TARGET_CHECKS = TARGET_CHECKS + 1 + if(TARGET_CHECKS == 2) then + TARGET_CHECKS = 0 + end + MOD:UpdateAurasByUnitID('target') + if MOD.UseCombo then + UpdateComboPoints() + end + PLATE_ARGS.allowed = nil + end + elseif PLATE_REF.highlight:IsShown() and UnitExists("mouseover") and (UnitName("mouseover") == plateName) then + if(PLATE_ARGS.unit ~= "mouseover" or PLATE_ARGS.allowed) then + SVUI_PLATE:SetFrameLevel(1) + SVUI_PLATE.highlight:Show() + MOD:UpdateAurasByUnitID('mouseover') + if MOD.UseCombo then + UpdateComboPoints() + end + PLATE_ARGS.allowed = nil + end + BLIZZ_PLATE.guid = UnitGUID("mouseover") + PLATE_ARGS.unit = "mouseover" + else + SVUI_PLATE:SetFrameLevel(0) + SVUI_PLATE.highlight:Hide() + PLATE_ARGS.unit = nil + end + CheckRaidIcon() + UpdatePlateElements(BLIZZ_PLATE,SVUI_PLATE) + end + + function WorldFrameUpdateHook(self, elapsed) + NPGrip:Hide() + for plate, _ in pairs(VisiblePlates) do + local frame = plate.frame + if(plate:IsShown()) then + local x,y = plate:GetCenter() + frame:SetPoint("CENTER", self, "BOTTOMLEFT", floor(x), floor(y)) + SetPlateAlpha(plate, frame) + else + frame:Hide() + end + end + NPGrip:Show() + + if(self.elapsed and self.elapsed > 0.2) then + + for plate, _ in pairs(VisiblePlates) do + local frame = plate.frame + if(plate:IsShown() and frame:IsShown() and ProxyThisPlate(plate)) then + UpdatePlateUnit() + end + end + self.elapsed = 0 + else + self.elapsed = (self.elapsed or 0) + elapsed + end + local curChildren = self:GetNumChildren() + if(numChildren ~= curChildren) then + for i = 1, curChildren do + local frame = select(i, self:GetChildren()) + if(not PlateRegistry[frame] and IsNamePlate(frame)) then + PlateForge(frame) + end + end + numChildren = curChildren + end + end +end +--[[ +########################################################## +SCRIPT HANDLERS +########################################################## +]]-- +do + local function CreateAuraIcon(auras, plate) + local noscalemult = 2 * UIParent:GetScale() + local button = CreateFrame("Frame", nil, auras) + button:SetScript('OnHide', function() + if plate.guid then + UpdateAuraIconGrid(plate) + end + end) + button.bord = button:CreateTexture(nil, "BACKGROUND") + button.bord:SetDrawLayer('BACKGROUND', 2) + button.bord:SetTexture(0,0,0,1) + button.bord:SetPoint("TOPLEFT", button, "TOPLEFT", -noscalemult, noscalemult) + button.bord:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", noscalemult, -noscalemult) + button.Icon = button:CreateTexture(nil, "BORDER") + button.Icon:SetPoint("TOPLEFT",button,"TOPLEFT") + button.Icon:SetPoint("BOTTOMRIGHT",button,"BOTTOMRIGHT") + button.Icon:SetTexCoord(.1, .9, .2, .8) + button.TimeLeft = button:CreateFontString(nil, 'OVERLAY') + button.TimeLeft:FontManager("plateaura") + button.TimeLeft:SetPoint("BOTTOMLEFT",button,"TOPLEFT",-3,-1) + button.TimeLeft:SetJustifyH('CENTER') + button.Stacks = button:CreateFontString(nil,"OVERLAY") + button.Stacks:FontManager("plateaura") + button.Stacks:SetPoint("BOTTOMRIGHT",button,"BOTTOMRIGHT",3,-3) + button:Hide() + return button + end + + local function HealthBarSizeChanged(self, width, height) + if(not ProxyThisPlate(self.sync)) then return; end + width = floor(width + 0.5) + local numAuras = AuraMaxCount + local auraWidth = ((width - (4 * (numAuras - 1))) / numAuras) + local auraHeight = (auraWidth * 0.7) + for index = 1, numAuras do + if not PLATE_AURAICONS[index] then + PLATE_AURAICONS[index] = CreateAuraIcon(PLATE_AURAS, SVUI_PLATE); + end + PLATE_AURAICONS[index]:SetWidth(auraWidth) + PLATE_AURAICONS[index]:SetHeight(auraHeight) + PLATE_AURAICONS[index]:ClearAllPoints() + if(index == 1) then + PLATE_AURAICONS[index]:SetPoint("LEFT", PLATE_AURAS, 0, 0) + else + PLATE_AURAICONS[index]:SetPoint("LEFT", PLATE_AURAICONS[index-1], "RIGHT", 4, 0) + end + end + if(numAuras > #PLATE_AURAICONS) then + for index = (numAuras + 1), #PLATE_AURAICONS do + RegisterAuraClock(PLATE_AURAICONS[index], 0) + end + end + end + + local function HealthBarValueChanged(self, value) + local healthBar = self.sync; + local alert = healthBar.alert; + local minValue, maxValue = self:GetMinMaxValues() + local showText = false + healthBar:SetMinMaxValues(minValue, maxValue) + healthBar:SetValue(value) + local percentValue = (value/maxValue) + if percentValue < HBThresh then + alert:Show() + if percentValue < (HBThresh / 2) then + alert:SetBackdropBorderColor(1, 0, 0, 0.9) + else + alert:SetBackdropBorderColor(1, 1, 0, 0.9) + end + elseif alert:IsShown() then + alert:Hide() + end + if((value and value > 0) and (maxValue and maxValue > 1) and self:GetScale() == 1) then + showText = true + end + if(HBTextFormat and showText) then + healthBar.text:Show() + healthBar.text:SetText(SetTextStyle(HBTextFormat, value, maxValue)) + elseif healthBar.text:IsShown() then + healthBar.text:Hide() + end + end + + local function CastBarValueChanged(self, value) + local castBar = self.sync + local min, max = self:GetMinMaxValues() + local isChannel = value < castBar:GetValue() + castBar:SetMinMaxValues(min, max) + castBar:SetValue(value) + castBar.text:SetFormattedText("%.1f ", value) + local color + if(self.shield:IsShown()) then + color = CBNoInterrupt + else + if value > 0 and (isChannel and (value/max) <= 0.02 or (value/max) >= 0.98) then + color = {0,1,0} + else + color = CBColor + end + end + castBar:SetStatusBarColor(unpack(color)) + end + + local function ShowThisPlate(plate) + if(not ProxyThisPlate(plate, true)) then return; end + + if RestrictedPlates[PLATE_REALNAME] then + SVUI_PLATE:Hide() + PLATE_GRIP:Hide() + return + elseif(not SVUI_PLATE:IsShown()) then + PLATE_GRIP:Show() + SVUI_PLATE:Show() + end + + VisiblePlates[BLIZZ_PLATE] = true + + PLATE_ARGS.tiny = (BLIZZ_PLATE.health:GetEffectiveScale() < 1) + SVUI_PLATE:SetSize(BLIZZ_PLATE:GetSize()) + + SVUI_PLATE.name:ClearAllPoints() + if(PLATE_ARGS.tiny) then + SVUI_PLATE.health:SetSize(BLIZZ_PLATE.health:GetWidth() * (BLIZZ_PLATE.health:GetEffectiveScale() * 1.25), HBHeight) + SVUI_PLATE.name:SetPoint("BOTTOM", SVUI_PLATE.health, "TOP", 0, 3) + else + SVUI_PLATE.name:SetPoint("BOTTOMLEFT", SVUI_PLATE.health, "TOPLEFT", 0, 3) + SVUI_PLATE.name:SetPoint("BOTTOMRIGHT", SVUI_PLATE.level, "BOTTOMLEFT", -2, 0) + end + + UpdatePlateElements(BLIZZ_PLATE, SVUI_PLATE) + + HealthBarValueChanged(BLIZZ_PLATE.health, BLIZZ_PLATE.health:GetValue()) + + if(not PLATE_ARGS.tiny) then + CheckRaidIcon() + MOD:UpdateAuras(BLIZZ_PLATE) + else + PLATE_ARGS.allowed = true + end + + if(not NPPointerMatch) then + NPGlow:SetBackdropBorderColor(unpack(NPPointerColor)) + end + end + + local function HideThisPlate(plate) + if(not ProxyThisPlate(plate)) then return; end + + SVUI_PLATE:Hide() + PLATE_GRIP:Hide() + VisiblePlates[plate] = nil + + PLATE_REF.reaction = nil + PLATE_ARGS.unitcategory = nil + plate.guid = nil + PLATE_ARGS.unit = nil + PLATE_REF.raidicontype = nil + PLATE_ARGS.scaled = nil + PLATE_ARGS.tiny = nil + PLATE_ARGS.allowed = nil + if(NPGlow:GetParent() == SVUI_PLATE) then + NPGlow:Hide() + end + SVUI_PLATE.health.alert:Hide() + SVUI_PLATE.health.icon:Hide() + if SVUI_PLATE.health then + SVUI_PLATE.health:SetSize(HBWidth, HBHeight) + plate.cast.icon:SetSizeToScale(CBHeight + HBHeight + 5) + end + if PLATE_AURAS then + for index = 1, #PLATE_AURAICONS do + RegisterAuraClock(PLATE_AURAICONS[index], 0) + end + end + if MOD.UseCombo then + for i=1, MAX_COMBO_POINTS do + SVUI_PLATE.combo[i]:Hide() + end + end + + SVUI_PLATE:SetPoint("BOTTOMLEFT", plate, "BOTTOMLEFT") + end + + local function UpdateThisPlate(plate) + if(not ProxyThisPlate(plate, true)) then return; end + SVUI_PLATE.name:FontManager("platename") + SVUI_PLATE.name:SetTextColor(1, 1, 1) + SVUI_PLATE.level:FontManager("platename") + if not PLATE_ARGS.scaled and not PLATE_ARGS.tiny then + SVUI_PLATE.health:SetSize(HBWidth, HBHeight) + end + SVUI_PLATE.health:SetStatusBarTexture(SV.Media.bar.default) + SVUI_PLATE.health.text:FontManager("plateaura") + SVUI_PLATE.cast:SetSize(HBWidth, CBHeight) + SVUI_PLATE.cast:SetStatusBarTexture(SV.Media.bar.gradient) + SVUI_PLATE.cast.text:SetFont(SV.Media.font.default, 8, "OUTLINE") + plate.cast.text:SetFont(SV.Media.font.default, 8, "OUTLINE") + plate.cast.icon:SetSizeToScale((CBHeight + HBHeight) + 5) + PLATE_REF.raidicon:ClearAllPoints() + SV:SetReversePoint(PLATE_REF.raidicon, RIAnchor, SVUI_PLATE.health, RIXoffset, RIYoffset) + PLATE_REF.raidicon:SetSize(RISize, RISize) + SVUI_PLATE.health.icon:ClearAllPoints() + SV:SetReversePoint(SVUI_PLATE.health.icon, RIAnchor, SVUI_PLATE.health, RIXoffset, RIYoffset) + SVUI_PLATE.health.icon:SetSize(RISize, RISize) + for index = 1, #PLATE_AURAICONS do + if PLATE_AURAICONS and PLATE_AURAICONS[index] then + PLATE_AURAICONS[index].TimeLeft:FontManager("plateaura") + PLATE_AURAICONS[index].Stacks:FontManager("plateaura") + PLATE_AURAICONS[index].Icon:SetTexCoord(.07, 0.93, .23, 0.77) + end + end + + if(MOD.UseCombo and not SVUI_PLATE.combo:IsShown()) then + SVUI_PLATE.combo:Show() + elseif(SVUI_PLATE.combo:IsShown()) then + SVUI_PLATE.combo:Hide() + end + + ShowThisPlate(plate) + HealthBarSizeChanged(SVUI_PLATE.health, SVUI_PLATE.health:GetSize()) + end + + function PlateForge(plate) + PlateRegistry[plate] = true; + + local ref, skin = {}, {}; + local barRegions, fontRegions = plate:GetChildren() + local health, cast = barRegions:GetChildren() + + ref.threat, + ref.border, + ref.highlight, + ref.level, + ref.skullicon, + ref.raidicon, + ref.eliteicon = barRegions:GetRegions() + + ref.nametext = ""; + + cast.border, + cast.shield, + cast.icon, + cast.text, + cast.shadow = select(2, cast:GetRegions()) + + health:SetStatusBarTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\EMPTY") + cast:SetStatusBarTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\EMPTY") + + plate.health = health + plate.cast = cast + plate.name = fontRegions:GetRegions() + + health:Hide() + fontRegions:Hide() + + ref.threat:SetTexture(0,0,0,0) + ref.border:Hide() + ref.highlight:SetTexture(0,0,0,0) + ref.level:SetWidth( 000.1 ) + ref.level:Hide() + ref.skullicon:SetTexture(0,0,0,0) + ref.raidicon:SetAlpha( 0 ) + ref.eliteicon:SetTexture(0,0,0,0) + + plate.name:Hide() + + cast.border:SetTexture(0,0,0,0) + cast.shield:SetTexture(0,0,0,0) + cast.icon:SetTexCoord( 0, 0, 0, 0 ) + cast.icon:SetWidth(.001) + cast.shadow:SetTexture(0,0,0,0) + --cast.shadow:Hide() + --cast.text:Hide() + + local frameName = "SVUI_PlateHolder"..numChildren + local holder = CreateFrame("Frame", frameName, NPGrip) + local frame = CreateFrame("Frame", nil, holder) + + --[[ HEALTH BAR ]]-- + + frame.health = CreateFrame("StatusBar", nil, frame) + frame.health:SetPoint('BOTTOM', frame, 'BOTTOM', 0, 5) + frame.health:SetFrameStrata("BACKGROUND") + frame.health:SetFrameLevel(0) + frame.health:SetScript("OnSizeChanged", HealthBarSizeChanged) + frame.health.sync = plate; + SetPlateBorder(frame.health) + SetEliteBorder(frame.health) + + frame.health.text = frame.health:CreateFontString(nil, 'OVERLAY') + frame.health.text:SetPoint("CENTER", frame.health, HBTextAnchor, HBXoffset, HBYoffset) + frame.health.text:SetJustifyH("CENTER") + + frame.level = frame:CreateFontString(nil, 'OVERLAY') + frame.level:SetPoint("BOTTOMRIGHT", frame.health, "TOPRIGHT", 3, 3) + frame.level:SetJustifyH("RIGHT") + + frame.name = frame:CreateFontString(nil, 'OVERLAY') + frame.name:SetJustifyH("LEFT") + + frame.eliteicon = frame:CreateTexture(nil, "OVERLAY") + frame.skullicon = frame:CreateTexture(nil, "OVERLAY") + + frame.raidicon = frame:CreateTexture(nil, "ARTWORK") + frame.raidicon:SetSize(NPIcons,NPIcons) + frame.raidicon:SetPoint("RIGHT", frame.health, "LEFT", -3, 0) + frame.raidicon:SetTexture("Interface\\TargetingFrame\\UI-RaidTargetingIcons") + + frame.health.icon = frame:CreateTexture(nil, 'ARTWORK') + frame.health.icon:SetSize(ref.raidicon:GetSize()) + frame.health.icon:SetPoint("BOTTOMRIGHT", frame.health, "TOPLEFT", -3, 3) + + frame.health.icon:SetTexture([[Interface\Addons\SVUI\assets\artwork\Unitframe\UNIT-ROLES]]) + frame.health.icon:SetTexCoord(0,0.5,0.5,1) + frame.health.icon:Hide() + + frame.highlight = frame:CreateTexture(nil, 'OVERLAY') + frame.highlight:SetAllPoints(frame.health) + frame.highlight:SetTexture(1, 1, 1, 0.3) + frame.highlight:Hide() + + local alert = CreateFrame("Frame", nil, frame) + alert:SetFrameLevel(0) + alert:SetAllPointsOut(frame.health,2,2) + alert:SetBackdrop({edgeFile=[[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]],edgeSize=2}) + alert:SetBackdropColor(0, 0, 0, 0) + alert:SetBackdropBorderColor(1, 1, 0, 0.9) + alert:SetScale(1.5) + alert:Hide() + frame.health.alert = alert + + health.sync = frame.health + + --[[ CAST BAR ]]-- + + frame.cast = CreateFrame("StatusBar", nil, frame) + frame.cast:SetPoint('TOPLEFT', frame.health, 'BOTTOMLEFT', 0, -8) + frame.cast:SetPoint('TOPRIGHT', frame.health, 'BOTTOMRIGHT', 0, -8) + frame.cast:SetFrameStrata("BACKGROUND") + frame.cast:SetStylePanel("Default", 'Bar') + frame.cast:SetFrameLevel(0) + + frame.cast.text = frame.cast:CreateFontString(nil, 'OVERLAY') + frame.cast.text:SetPoint("RIGHT", frame.cast, "LEFT", -4, CBYoffset) + frame.cast.text:SetJustifyH("LEFT") + + cast.text:SetParent(frame.cast) + cast.text:ClearAllPoints() + cast.text:SetPoint("LEFT", frame.cast, "LEFT", CBXoffset, CBYoffset) + cast.text:SetJustifyH("LEFT") + + cast.icon:SetParent(frame.cast) + cast.icon:SetTexCoord(.07, .93, .07, .93) + cast.icon:SetDrawLayer("OVERLAY") + cast.icon:ClearAllPoints() + cast.icon:SetPoint("TOPLEFT", frame.health, "TOPRIGHT", 5, 0) + + local bgFrame = CreateFrame("Frame", nil, frame.cast) + bgFrame:SetAllPointsOut(cast.icon) + bgFrame:SetFrameLevel(bgFrame:GetFrameLevel() - 1) + + bgFrame:SetStylePanel("Default", "Bar", true, 2, 0, 0) + + --SetPlateBorder(frame.cast, cast.icon) + + cast.sync = frame.cast + + frame.combo = CreateFrame("Frame", nil, frame.health) + frame.combo:SetPointToScale("CENTER", frame.health, "BOTTOM") + frame.combo:SetSize(68, 1) + frame.combo:Hide() + + if MOD.UseCombo then + for i = 1, MAX_COMBO_POINTS do + frame.combo[i] = frame.combo:CreateTexture(nil, 'OVERLAY') + frame.combo[i]:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\COMBO-POINT-SMALL") + frame.combo[i]:SetSize(12, 12) + frame.combo[i]:SetVertexColor(unpack(NPComboColor[i])) + if(i == 1) then + frame.combo[i]:SetPoint("TOPLEFT", frame.combo, "TOPLEFT") + else + frame.combo[i]:SetPoint("LEFT", frame.combo[i-1], "RIGHT", 2, 0) + end + frame.combo[i]:Hide() + end + end + + frame.auras = CreateFrame("Frame", nil, frame) + frame.auras:SetHeight(32); frame.auras:Show() + frame.auras:SetPoint('BOTTOMRIGHT', frame.health, 'TOPRIGHT', 0, 10) + frame.auras:SetPoint('BOTTOMLEFT', frame.health, 'TOPLEFT', 0, 10) + frame.auras:SetFrameStrata("BACKGROUND") + frame.auras:SetFrameLevel(0) + frame.auraicons = {} + + plate.holder = holder; + plate.frame = frame; + plate.ref = ref; + plate.setting = {}; + + UpdateThisPlate(plate) + + plate:HookScript("OnShow", ShowThisPlate) + plate:HookScript("OnHide", HideThisPlate) + plate:HookScript("OnSizeChanged", function(self, width, height) + self.frame:SetSize(width, height) + end) + + health:HookScript("OnValueChanged", HealthBarValueChanged) + + cast:HookScript("OnShow", function(self) self.sync:Show() end) + cast:HookScript("OnHide", function(self) self.sync:Hide() end) + cast:HookScript("OnValueChanged", CastBarValueChanged) + + VisiblePlates[plate] = true + + if not cast:IsShown() then + frame.cast:Hide() + elseif not frame.cast:IsShown() then + frame.cast:Show() + end + end + + function MOD:UpdateAllPlates() + self:UpdateLocals() + for plate, _ in pairs(VisiblePlates) do + if(plate) then + UpdateThisPlate(plate) + end + end + end +end +--[[ +########################################################## +SCANNER +########################################################## +]]-- +do + local function ParseByName(sourceName) + if not sourceName then return; end + local SearchFor = split("-", sourceName) + for plate, _ in pairs(VisiblePlates) do + if plate and plate:IsShown() and plate.ref.nametext == SearchFor and RAID_CLASS_COLORS[plate.setting.unitcategory] then + return plate + end + end + end + + local function ParseByIconName(raidIcon) + for plate, _ in pairs(VisiblePlates) do + CheckRaidIcon(plate) + if plate and plate:IsShown() and plate.ref.raidicon:IsShown() and (plate.ref.raidicontype and plate.ref.raidicontype == raidIcon) then + return plate + end + end + end + + function MOD:RequestScanUpdate(guid, raidIcon, name, callbackFunc, ...) + local plate + if guid then plate = ParseByGUID(guid) end + if (not plate) and name then plate = ParseByName(name) end + if (not plate) and raidIcon then plate = ParseByIconName(raidIcon) end + if(plate) then + MOD[callbackFunc](MOD, plate, ...) + end + end +end +--[[ +########################################################## +EVENTS +########################################################## +]]-- +function MOD:PLAYER_ENTERING_WORLD() + self:UpdateLocals(); +end + +function MOD:UPDATE_MOUSEOVER_UNIT() + WorldFrame.elapsed = 0.1 +end + +function MOD:PLAYER_REGEN_DISABLED() + SetCVar("nameplateShowEnemies", 1) +end + +function MOD:PLAYER_REGEN_ENABLED() + SetCVar("nameplateShowEnemies", 0) +end + +function MOD:PLAYER_TARGET_CHANGED() + if(UnitExists("target")) then + CURRENT_TARGET_NAME = UnitName("target"); + TARGET_CHECKS = 1; + WorldFrame.elapsed = 0.1; + else + NPGlow:Hide(); + CURRENT_TARGET_NAME = nil; + TARGET_CHECKS = 0; + end +end + +function MOD:UNIT_COMBO_POINTS(event, unit) + if(unit == "player" or unit == "vehicle") then + UpdateComboPoints() + end +end + +function MOD:UNIT_AURA(event, unit) + if(unit == "target" or unit == "focus") then + self:UpdateAurasByUnitID(unit) + if(self.UseCombo) then + UpdateComboPoints() + end + end +end + +function MOD:COMBAT_LOG_EVENT_UNFILTERED(event, timestamp, combatevent, hideCaster, ...) + local _, sourceGUID, sourceName, destGUID, destName, destFlags, destRaidFlag, spellID, spellname + if(not destGUID or not spellID) then return end + if(combatevent == SPELL_AURA_APPLIED or combatevent == SPELL_AURA_REFRESH or combatevent == SPELL_AURA_APPLIED_DOSE or combatevent == SPELL_AURA_REMOVED_DOSE) then + sourceGUID, sourceName, _, _, destGUID, destName, destFlags, destRaidFlag, spellID, spellname = ... + local stackCount = 1 + local duration = LoadDuration(spellID) + local texture = GetSpellTexture(spellID) + if(combatevent == SPELL_AURA_APPLIED_DOSE or combatevent == SPELL_AURA_REMOVED_DOSE) then + stackCount = select(16, ...) + end + SetAuraInstance(destGUID, spellID, (GetTime() + duration), stackCount, sourceGUID, duration, texture) + elseif(combatevent == SPELL_AURA_BROKEN or combatevent == SPELL_AURA_BROKEN_SPELL or combatevent == SPELL_AURA_REMOVED) then + sourceGUID, sourceName, _, _, destGUID, destName, destFlags, destRaidFlag, spellID, spellname = ... + local auraID = spellID..(tostring(sourceName or "UNKNOWN_CASTER")) + if UnitPlateAuras[destGUID][auraID] then + UnitPlateAuras[destGUID][auraID] = nil + end + else + return + end + + local rawName, raidIcon + if(destName and (band(destFlags, COMBATLOG_OBJECT_CONTROL_PLAYER) > 0)) then + rawName = split("-", destName) + AuraByName[rawName] = destGUID + end + for iconName, bitmask in pairs(RIconData) do + if band(destRaidFlag, bitmask) > 0 then + raidIcon = iconName + AuraByRaidIcon[raidIcon] = destGUID + break + end + end + self:RequestScanUpdate(destGUID, raidIcon, rawName, "UpdateAuras") +end +--[[ +########################################################## +UPDATE AND BUILD +########################################################## +]]-- +function MOD:UpdateLocals() + local db = SV.db.SVPlate + if not db then return end + + NPClassRole = SV.ClassRole; + NPBaseAlpha = db.nonTargetAlpha; + NPCombatHide = db.combatHide; + + RIAnchor = db.raidHealIcon.attachTo; + RIXoffset = db.raidHealIcon.xOffset; + RIYoffset = db.raidHealIcon.yOffset; + RISize = db.raidHealIcon.size; + + HBThresh = db.healthBar.lowThreshold; + NPNameMatch = db.colorNameByValue; + HBTextFormat = db.healthBar.text.enable and db.healthBar.text.format or false; + HBTextAnchor = db.healthBar.text.attachTo; + HBXoffset = db.healthBar.text.xOffset; + HBYoffset = db.healthBar.text.yOffset; + HBWidth = db.healthBar.width; + HBHeight = db.healthBar.height; + + NPIcons = HBHeight * 1.5 + + CBColor = {db.castBar.color[1], db.castBar.color[2], db.castBar.color[3]} + CBNoInterrupt = {db.castBar.noInterrupt[1], db.castBar.noInterrupt[2], db.castBar.noInterrupt[3]} + CBHeight = db.castBar.height; + CBText = db.castBar.text.enable; + CBXoffset = db.castBar.text.xOffset; + CBYoffset = db.castBar.text.yOffset; + + NPUsePointer = db.pointer.enable; + NPPointerMatch = db.pointer.colorMatchHealthBar; + NPPointerColor = {db.pointer.color[1], db.pointer.color[2], db.pointer.color[3]}; + + local tc = db.threat + NPUseThreat = tc.enable; + NPThreatGS = tc.goodScale; + NPThreatBS = tc.badScale; + NPGoodThreat = {tc.goodColor[1], tc.goodColor[2], tc.goodColor[3]} + NPBadThreat = {tc.badColor[1], tc.badColor[2], tc.badColor[3]} + NPGoodTrans = {tc.goodTransitionColor[1], tc.goodTransitionColor[2], tc.goodTransitionColor[3]} + NPBadTrans = {tc.badTransitionColor[1], tc.badTransitionColor[2], tc.badTransitionColor[3]} + + local rc = db.reactions + NPReactTap = {rc.tapped[1], rc.tapped[2], rc.tapped[3]} + NPReactNPCGood = {rc.friendlyNPC[1], rc.friendlyNPC[2], rc.friendlyNPC[3]} + NPReactPlayerGood = {rc.friendlyPlayer[1], rc.friendlyPlayer[2], rc.friendlyPlayer[3]} + NPReactNeutral = {rc.neutral[1], rc.neutral[2], rc.neutral[3]} + NPReactEnemy = {rc.enemy[1], rc.enemy[2], rc.enemy[3]} + + local npnf = SV.db.font.platename; + NPFont = npnf.file; + NPFSize = npnf.size; + NPFOutline = npnf.outline; + + local npaf = SV.db.font.plateaura; + AuraFont = npaf.file; + AuraFSize = npaf.size; + AuraFOutline = npaf.outline; + AuraMaxCount = db.auras.numAuras; + AuraFilterName = db.auras.additionalFilter + AuraFilter = SV.filters[AuraFilterName] + + if(not db.comicStyle) then + PLATE_TOP = [[Interface\Addons\SVUI\assets\artwork\Template\EMPTY]] + PLATE_BOTTOM = [[Interface\Addons\SVUI\assets\artwork\Template\EMPTY]] + PLATE_RIGHT = [[Interface\Addons\SVUI\assets\artwork\Template\EMPTY]] + PLATE_LEFT = [[Interface\Addons\SVUI\assets\artwork\Template\EMPTY]] + else + PLATE_TOP = [[Interface\Addons\SVUI\assets\artwork\Template\Plate\PLATE-TOP]] + PLATE_BOTTOM = [[Interface\Addons\SVUI\assets\artwork\Template\Plate\PLATE-BOTTOM]] + PLATE_RIGHT = [[Interface\Addons\SVUI\assets\artwork\Template\Plate\PLATE-RIGHT]] + PLATE_LEFT = [[Interface\Addons\SVUI\assets\artwork\Template\Plate\PLATE-LEFT]] + end + + if (db.comboPoints and (SV.class == 'ROGUE' or SV.class == 'DRUID')) then + self.UseCombo = true + self:RegisterEvent("UNIT_COMBO_POINTS") + else + self.UseCombo = false + self:UnregisterEvent("UNIT_COMBO_POINTS") + end +end + +function MOD:CombatToggle(noToggle) + if(NPCombatHide) then + self:RegisterEvent("PLAYER_REGEN_DISABLED") + self:RegisterEvent("PLAYER_REGEN_ENABLED") + if(not noToggle) then + SetCVar("nameplateShowEnemies", 0) + end + else + self:UnregisterEvent("PLAYER_REGEN_DISABLED") + self:UnregisterEvent("PLAYER_REGEN_ENABLED") + if(not noToggle) then + SetCVar("nameplateShowEnemies", 1) + end + end +end + +function MOD:ReLoad() + if SV.db["SVPlate"].enable ~= true then + self:DisableTracking() + return + end + self:UpdateAllPlates(); +end + +function MOD:Load() + if SV.db.SVPlate.enable ~= true then return end + self:UpdateLocals() + self:RegisterEvent("PLAYER_ENTERING_WORLD") + self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") + self:RegisterEvent("UNIT_AURA") + self:RegisterEvent("PLAYER_TARGET_CHANGED") + self:RegisterEvent("UPDATE_MOUSEOVER_UNIT") + WorldFrame:HookScript('OnUpdate', WorldFrameUpdateHook) + self:CombatToggle(true) +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/plate/SVPlate.xml b/Interface/AddOns/SVUI/packages/plate/SVPlate.xml new file mode 100644 index 0000000..9547082 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/plate/SVPlate.xml @@ -0,0 +1,25 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Frame name="SVUI_PlateParentFrame" frameStrata="BACKGROUND" hidden="true"> + <Scripts> + <OnLoad> + self:SetParent(_G['WorldFrame']) + </OnLoad> + </Scripts> + </Frame> + + <Frame name="SVUI_PlateGlowFrame" frameStrata="BACKGROUND" hidden="true"> + <Scripts> + <OnLoad> + self:SetParent(_G['WorldFrame']) + self:SetBackdrop({ + edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], + edgeSize = 2 + }) + self:SetBackdropColor(0, 0, 0, 0) + self:SetScale(2.5) + </OnLoad> + </Scripts> + </Frame> + + <Script file='SVPlate.lua'/> +</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/plates/SVPlate.lua b/Interface/AddOns/SVUI/packages/plates/SVPlate.lua deleted file mode 100644 index cdf299f..0000000 --- a/Interface/AddOns/SVUI/packages/plates/SVPlate.lua +++ /dev/null @@ -1,1577 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -credit: Elv. SVPlates was parently nameplates.lua adapted from ElvUI # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local tinsert = _G.tinsert; -local string = _G.string; -local math = _G.math; -local bit = _G.bit; -local table = _G.table; ---[[ STRING METHODS ]]-- -local lower, upper = string.lower, string.upper; -local find, format, split = string.find, string.format, string.split; -local match, gmatch, gsub = string.match, string.gmatch, string.gsub; ---[[ MATH METHODS ]]-- -local floor, ceil = math.floor, math.ceil; -- Basic ---[[ BINARY METHODS ]]-- -local band, bor = bit.band, bit.bor; ---[[ TABLE METHODS ]]-- -local tremove, tcopy, twipe, tsort, tconcat = table.remove, table.copy, table.wipe, table.sort, table.concat; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L -local LSM = LibStub("LibSharedMedia-3.0") -local MOD = SV:NewPackage("SVPlate", L["NamePlates"]); ---[[ -########################################################## -LOCALIZED GLOBALS -########################################################## -]]-- -local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local numChildren = -1; -local PlateRegistry, VisiblePlates = {}, {}; -local WorldFrameUpdateHook, UpdatePlateElements, PlateForge; -local BLIZZ_PLATE, SVUI_PLATE, PLATE_REF, PLATE_ARGS, PLATE_AURAS, PLATE_AURAICONS, PLATE_GRIP, PLATE_REALNAME; -local CURRENT_TARGET_NAME; -local TARGET_CHECKS = 0; -local PLATE_TOP = [[Interface\Addons\SVUI\assets\artwork\Template\Plate\PLATE-TOP]] -local PLATE_BOTTOM = [[Interface\Addons\SVUI\assets\artwork\Template\Plate\PLATE-BOTTOM]] -local PLATE_RIGHT = [[Interface\Addons\SVUI\assets\artwork\Template\Plate\PLATE-RIGHT]] -local PLATE_LEFT = [[Interface\Addons\SVUI\assets\artwork\Template\Plate\PLATE-LEFT]] ---[[ - Quick explaination of what Im doing with all of these locals... - Unlike many of the other modules, SVPlates has to continuously - reference config settings which can start to get sluggish. What - I have done is set local variables for every database value - that the module can read efficiently. The function "UpdateLocals" - is used to refresh these any time a change is made to configs - and once when the mod is loaded. -]]-- -local NPClassRole = SV.ClassRole; -local NPBaseAlpha = 0.6; -local NPCombatHide = false; -local NPNameMatch = false; -local NPComboColor={ - [1]={0.69,0.31,0.31}, - [2]={0.69,0.31,0.31}, - [3]={0.65,0.63,0.35}, - [4]={0.65,0.63,0.35}, - [5]={0.33,0.59,0.33} -} - -local NPFont = [[Interface\AddOns\SVUI\assets\fonts\Action.ttf]]; -local NPFSize = 10; -local NPFOutline = "OUTLINE"; - -local NPUsePointer = true; -local NPPointerMatch = false; -local NPPointerColor = {0.7,0,1}; - -local NPUseThreat = false; -local NPThreatGS = 1; -local NPThreatBS = 1; -local NPGoodThreat = {0.29,0.68,0.3} -local NPBadThreat = {0.78,0.25,0.25} -local NPGoodTrans = {0.85,0.77,0.36} -local NPBadTrans = {0.94,0.6,0.06} - -local NPReactTap = {0.3,0.3,0.3} -local NPReactNPCGood = {0.31,0.45,0.63} -local NPReactPlayerGood = {0.29,0.68,0.3} -local NPReactNeutral = {0.85,0.77,0.36} -local NPReactEnemy = {0.78,0.25,0.25} - -local RIconCoords = {[0]={[0]="STAR", [0.25]="MOON"}, [0.25]={[0]="CIRCLE", [0.25]="SQUARE"}, [0.5]={[0]="DIAMOND", [0.25]="CROSS"}, [0.75]={[0]="TRIANGLE", [0.25]="SKULL"}}; -local RIAnchor = "LEFT"; -local RIXoffset = -4; -local RIYoffset = 6; -local RISize = 36; - -local HBThresh = 0.4; -local HBTextFormat = false; -local HBTextAnchor = "CENTER"; -local HBXoffset = 0; -local HBYoffset = 0; -local HBWidth = 108; -local HBHeight = 9; - -local NPIcons = 14; - -local CBColor = {0.1,0.81,0} -local CBNoInterrupt = {1,0.25,0.25} -local CBHeight = 6; -local CBText = true; -local CBXoffset = 0; -local CBYoffset = 0; - -local AuraFont = [[Interface\AddOns\SVUI\assets\fonts\Roboto.ttf]]; -local AuraFSize = 10; -local AuraFOutline = "MONOCHROME"; -local AuraMaxCount = 5; - -local AuraFont = [[Interface\AddOns\SVUI\assets\fonts\Numbers.ttf]]; -local AuraFSize = 7; -local AuraFOutline = "OUTLINE"; -local AuraFilterName, AuraFilter; -local AuraMaxCount = 5; - -local BlockedPlates = { - ["Army of the Dead Ghoul"] = true, - ["Venomous Snake"] = true, - ["Healing Tide Totem"] = true, - ["Dragonmaw War Banner"] = true -}; -local RIconData = {["STAR"] = 0x00000001, ["CIRCLE"] = 0x00000002, ["DIAMOND"] = 0x00000004, ["TRIANGLE"] = 0x00000008, ["MOON"] = 0x00000010, ["SQUARE"] = 0x00000020, ["CROSS"] = 0x00000040, ["SKULL"] = 0x00000080}; -local RIconNames = {"STAR", "CIRCLE", "DIAMOND", "TRIANGLE", "MOON", "SQUARE", "CROSS", "SKULL"} -local UnitPlateAuras = {}; -local AuraByRaidIcon = {}; -local AuraByName = {}; -local CachedAuraDurations = {}; -local AurasCache = {}; -local AuraClocks = {}; -local ClockIsTicking = false; -local TickTock = 0; -local LastKnownTarget; ---[[ -########################################################## -UTILITY FRAMES -########################################################## -]]-- -local NPGrip = _G.SVUI_PlateParentFrame -local NPGlow = _G.SVUI_PlateGlowFrame -local AuraClockManager = CreateFrame("Frame") ---[[ -########################################################## -PRE VARS/FUNCTIONS -########################################################## -]]-- -local formatting = { - ["CURRENT"] = "%s", - ["CURRENT_MAX"] = "%s - %s", - ["CURRENT_PERCENT"] = "%s - %s%%", - ["CURRENT_MAX_PERCENT"] = "%s - %s | %s%%", - ["PERCENT"] = "%s%%", - ["DEFICIT"] = "-%s" -}; - -local function TruncateString(value) - if value >= 1e9 then - return ("%.1fb"):format(value / 1e9):gsub("%.?0 + ([kmb])$", "%1") - elseif value >= 1e6 then - return ("%.1fm"):format(value / 1e6):gsub("%.?0 + ([kmb])$", "%1") - elseif value >= 1e3 or value <= -1e3 then - return ("%.1fk"):format(value / 1e3):gsub("%.?0 + ([kmb])$", "%1") - else - return value - end -end - -local function SetTextStyle(style, min, max) - if max == 0 then max = 1 end - local result; - local textFormat = formatting[style] - if style == "DEFICIT" then - local result = max - min; - if result <= 0 then - return "" - else - return format(textFormat, TruncateString(result)) - end - elseif style == "PERCENT" then - result = format(textFormat, format("%.1f", min / max * 100)) - result = result:gsub(".0%%", "%%") - return result - elseif style == "CURRENT" or (style == "CURRENT_MAX" or style == "CURRENT_MAX_PERCENT" or style == "CURRENT_PERCENT") and min == max then - return format(formatting["CURRENT"], TruncateString(min)) - elseif style == "CURRENT_MAX" then - return format(textFormat, TruncateString(min), TruncateString(max)) - elseif style == "CURRENT_PERCENT" then - result = format(textFormat, TruncateString(min), format("%.1f", min / max * 100)) - result = result:gsub(".0%%", "%%") - return result - elseif style == "CURRENT_MAX_PERCENT" then - result = format(textFormat, TruncateString(min), TruncateString(max), format("%.1f", min / max * 100)) - result = result:gsub(".0%%", "%%") - return result - end -end - -local function SetPlateBorder(plate, point) - point = point or plate - local noscalemult = 2 * UIParent:GetScale() - if point.bordertop then return end - point.backdrop = plate:CreateTexture(nil, "BORDER") - point.backdrop:SetDrawLayer("BORDER", -4) - point.backdrop:SetAllPoints(point) - point.backdrop:SetTexture(SV.Media.bar.default) - point.backdrop:SetVertexColor(0.1,0.1,0.1) - - point.bordertop = plate:CreateTexture(nil, "BORDER") - point.bordertop:SetPoint("TOPLEFT", point, "TOPLEFT", -noscalemult, noscalemult) - point.bordertop:SetPoint("TOPRIGHT", point, "TOPRIGHT", noscalemult, noscalemult) - point.bordertop:SetHeight(noscalemult) - point.bordertop:SetTexture(0,0,0) - point.bordertop:SetDrawLayer("BORDER", 1) - - point.borderbottom = plate:CreateTexture(nil, "BORDER") - point.borderbottom:SetPoint("BOTTOMLEFT", point, "BOTTOMLEFT", -noscalemult, -noscalemult) - point.borderbottom:SetPoint("BOTTOMRIGHT", point, "BOTTOMRIGHT", noscalemult, -noscalemult) - point.borderbottom:SetHeight(noscalemult) - point.borderbottom:SetTexture(0,0,0) - point.borderbottom:SetDrawLayer("BORDER", 1) - - point.borderleft = plate:CreateTexture(nil, "BORDER") - point.borderleft:SetPoint("TOPLEFT", point, "TOPLEFT", -noscalemult, noscalemult) - point.borderleft:SetPoint("BOTTOMLEFT", point, "BOTTOMLEFT", noscalemult, -noscalemult) - point.borderleft:SetWidth(noscalemult) - point.borderleft:SetTexture(0,0,0) - point.borderleft:SetDrawLayer("BORDER", 1) - - point.borderright = plate:CreateTexture(nil, "BORDER") - point.borderright:SetPoint("TOPRIGHT", point, "TOPRIGHT", noscalemult, noscalemult) - point.borderright:SetPoint("BOTTOMRIGHT", point, "BOTTOMRIGHT", -noscalemult, -noscalemult) - point.borderright:SetWidth(noscalemult) - point.borderright:SetTexture(0,0,0) - point.borderright:SetDrawLayer("BORDER", 1) -end - -local function SetEliteBorder(point) - local noscalemult = 2 * UIParent:GetScale() - if point.eliteborder then return end - - point.eliteborder = CreateFrame("Frame", nil, point) - point.eliteborder:SetAllPoints(point) - point.eliteborder:SetFrameStrata("BACKGROUND") - point.eliteborder:SetFrameLevel(0) - - point.eliteborder.top = point.eliteborder:CreateTexture(nil, "BACKGROUND") - point.eliteborder.top:SetPoint("BOTTOMLEFT", point.eliteborder, "TOPLEFT", 0, 0) - point.eliteborder.top:SetPoint("BOTTOMRIGHT", point.eliteborder, "TOPRIGHT", 0, 0) - point.eliteborder.top:SetHeight(22) - point.eliteborder.top:SetTexture(PLATE_TOP) - point.eliteborder.top:SetVertexColor(1, 1, 0) - point.eliteborder.top:SetBlendMode("BLEND") - - point.eliteborder.bottom = point.eliteborder:CreateTexture(nil, "BACKGROUND") - point.eliteborder.bottom:SetPoint("TOPLEFT", point.eliteborder, "BOTTOMLEFT", 0, 0) - point.eliteborder.bottom:SetPoint("TOPRIGHT", point.eliteborder, "BOTTOMRIGHT", 0, 0) - point.eliteborder.bottom:SetHeight(32) - point.eliteborder.bottom:SetTexture(PLATE_BOTTOM) - point.eliteborder.bottom:SetVertexColor(1, 1, 0) - point.eliteborder.bottom:SetBlendMode("BLEND") - - -- point.eliteborder.right = point.eliteborder:CreateTexture(nil, "BACKGROUND") - -- point.eliteborder.right:SetPoint("TOPLEFT", point.eliteborder, "TOPRIGHT", 0, 0) - -- point.eliteborder.right:SetPoint("BOTTOMLEFT", point.eliteborder, "BOTTOMRIGHT", 0, 0) - -- point.eliteborder.right:SetWidth(point:GetHeight() * 4) - -- point.eliteborder.right:SetTexture(PLATE_RIGHT) - -- point.eliteborder.right:SetVertexColor(1, 1, 0) - -- point.eliteborder.right:SetBlendMode("BLEND") - - -- point.eliteborder.left = point.eliteborder:CreateTexture(nil, "BACKGROUND") - -- point.eliteborder.left:SetPoint("TOPRIGHT", point.eliteborder, "TOPLEFT", 0, 0) - -- point.eliteborder.left:SetPoint("BOTTOMRIGHT", point.eliteborder, "BOTTOMLEFT", 0, 0) - -- point.eliteborder.left:SetWidth(point:GetHeight() * 4) - -- point.eliteborder.left:SetTexture(PLATE_LEFT) - -- point.eliteborder.left:SetVertexColor(1, 1, 0) - -- point.eliteborder.left:SetBlendMode("BLEND") - - point.eliteborder:SetAlpha(0.35) - - point.eliteborder:Hide() -end ---[[ -########################################################## -UPVALUE PROXYS -########################################################## -]]-- -local function ProxyThisPlate(plate, updateName) - if(not plate or not plate.frame) then return false; end - BLIZZ_PLATE = plate - SVUI_PLATE = plate.frame - PLATE_REF = plate.ref - PLATE_AURAS = plate.frame.auras - PLATE_AURAICONS = plate.frame.auraicons - PLATE_ARGS = plate.setting - PLATE_GRIP = plate.holder - if updateName then - plate.ref.nametext = gsub(plate.name:GetText(), '%s%(%*%)',''); - end - PLATE_REALNAME = plate.ref.nametext - return true -end ---[[ -########################################################## -LOCAL HELPERS -########################################################## -]]-- -local function ParseByGUID(guid) - for plate, _ in pairs(VisiblePlates) do - if plate and plate:IsShown() and plate.guid == guid then - return plate - end - end -end - -local function CheckRaidIcon(plate) - if(plate and plate.ref) then - SVUI_PLATE = plate.frame - PLATE_REF = plate.ref - end - if PLATE_REF.raidicon:IsShown() then - local ULx,ULy,LLx,LLy,URx,URy,LRx,LRy = PLATE_REF.raidicon:GetTexCoord() - PLATE_REF.raidicontype = RIconCoords[ULx][ULy] - SVUI_PLATE.raidicon:Show() - SVUI_PLATE.raidicon:SetTexCoord(ULx,ULy,LLx,LLy,URx,URy,LRx,LRy) - else - PLATE_REF.raidicontype = nil; - SVUI_PLATE.raidicon:Hide() - end -end - -local function UpdateComboPoints() - local guid = UnitGUID("target") - if (not guid) then return end - local numPoints = GetComboPoints(UnitHasVehicleUI('player') and 'vehicle' or 'player', 'target') - numPoints = numPoints or 0 - if(numPoints > 0) then - if(LastKnownTarget and LastKnownTarget.guid and LastKnownTarget.guid ~= guid) then - LastKnownTarget.frame.combo[1]:Hide() - LastKnownTarget.frame.combo[2]:Hide() - LastKnownTarget.frame.combo[3]:Hide() - LastKnownTarget.frame.combo[4]:Hide() - LastKnownTarget.frame.combo[5]:Hide() - LastKnownTarget = nil - end - end - local plate = ParseByGUID(guid) - if(plate) then - for i=1, MAX_COMBO_POINTS do - if(i <= numPoints) then - plate.frame.combo[i]:Show() - else - plate.frame.combo[i]:Hide() - end - end - LastKnownTarget = plate - end -end ---[[ -########################################################## -AURA HELPERS -########################################################## -]]-- -local ClockUpdateHandler = function(self, elapsed) - local curTime = GetTime() - if curTime < TickTock then return end - local deactivate = true; - TickTock = curTime + 0.1 - for frame, expiration in pairs(AuraClocks) do - local calc = 0; - local expires = expiration - curTime; - if expiration < curTime then - frame:Hide(); - AuraClocks[frame] = nil - else - if expires < 60 then - calc = floor(expires) - if expires >= 4 then - frame.TimeLeft:SetFormattedText("|cffffff00%d|r", calc) - elseif expires >= 1 then - frame.TimeLeft:SetFormattedText("|cffff0000%d|r", calc) - else - frame.TimeLeft:SetFormattedText("|cffff0000%.1f|r", expires) - end - elseif expires < 3600 then - calc = ceil(expires / 60); - frame.TimeLeft:SetFormattedText("|cffffffff%.1f|r", calc) - elseif expires < 86400 then - calc = ceil(expires / 3600); - frame.TimeLeft:SetFormattedText("|cff66ffff%.1f|r", calc) - else - calc = ceil(expires / 86400); - frame.TimeLeft:SetFormattedText("|cff6666ff%.1f|r", calc) - end - deactivate = false - end - end - if deactivate then - self:SetScript("OnUpdate", nil); - ClockIsTicking = false - end -end - -local function RegisterAuraClock(frame, expiration) - if(not frame) then return end - if expiration == 0 then - frame:Hide() - AuraClocks[frame] = nil - else - AuraClocks[frame] = expiration - frame:Show() - if(not ClockIsTicking) then - AuraClockManager:SetScript("OnUpdate", ClockUpdateHandler) - ClockIsTicking = true - end - end -end - -local function GetUnitPlateAuras(guid) - if guid and UnitPlateAuras[guid] then return UnitPlateAuras[guid] end -end - -local function SetAuraInstance(guid, spellID, expiration, stacks, caster, duration, texture) - if(spellID == 65148) then return end - local filter = true; - if (caster == UnitGUID('player')) then - filter = nil; - end - if(AuraFilter and AuraFilterName) then - local name = GetSpellInfo(spellID) - if(AuraFilter[name] and AuraFilter[name].enable and ((AuraFilterName ~= 'Blocked') and (AuraFilterName ~= 'Allowed'))) then - filter = nil; - end - end - if(not filter and (guid and spellID and caster and texture)) then - local auraID = spellID..(tostring(caster or "UNKNOWN_CASTER")) - UnitPlateAuras[guid] = UnitPlateAuras[guid] or {} - UnitPlateAuras[guid][auraID] = { - spellID = spellID, - expiration = expiration or 0, - stacks = stacks, - duration = duration, - texture = texture - } - end -end - -local function UpdateAuraIcon(aura, texture, expiration, stacks, test) - if aura and texture and expiration then - aura.Icon:SetTexture(texture) - if stacks > 1 then - aura.Stacks:SetText(stacks) - else - aura.Stacks:SetText("") - end - aura:Show() - RegisterAuraClock(aura, expiration) - else - RegisterAuraClock(aura, 0) - end -end - -local function SortExpires(t) - tsort(t, function(a,b) return a.expiration < b.expiration end) - return t -end - -local function UpdateAuraIconGrid(plate) - local frame = plate.frame; - local guid = plate.guid; - local iconCache = frame.auraicons; - local AurasOnUnit = GetUnitPlateAuras(guid); - local AuraSlotIndex = 1; - local auraID; - if AurasOnUnit then - frame.auras:Show() - local auraCount = 1 - for auraID,aura in pairs(AurasOnUnit) do - if tonumber(aura.spellID) then - aura.name = GetSpellInfo(tonumber(aura.spellID)) - aura.unit = plate.unit - if(aura.expiration > GetTime()) then - AurasCache[auraCount] = aura - auraCount = auraCount + 1 - end - end - end - end - AurasCache = SortExpires(AurasCache) - for index = 1, #AurasCache do - local cachedaura = AurasCache[index] - local gridaura = iconCache[AuraSlotIndex] - if gridaura and cachedaura.spellID and cachedaura.expiration then - UpdateAuraIcon(gridaura, cachedaura.texture, cachedaura.expiration, cachedaura.stacks) - AuraSlotIndex = AuraSlotIndex + 1 - end - if(AuraSlotIndex > AuraMaxCount) then - break - end - end - if(iconCache[AuraSlotIndex]) then - RegisterAuraClock(iconCache[AuraSlotIndex], 0) - end - twipe(AurasCache) -end - -local function LoadDuration(spellID) - if spellID then - return CachedAuraDurations[spellID] or 0 - end - return 0 -end - -local function SaveDuration(spellID, duration) - duration = duration or 0 - if spellID then CachedAuraDurations[spellID] = duration end -end - -function MOD:UpdateAuras(plate) - if plate.setting.tiny then return end - local guid = plate.guid - local frame = plate.frame - if not guid then - if RAID_CLASS_COLORS[plate.setting.unitcategory] then - local pn = plate.name:GetText() - local name = pn:gsub("%s%(%*%)", "") - guid = AuraByName[name] - elseif plate.ref.raidicon:IsShown() then - guid = AuraByRaidIcon[plate.ref.raidicontype] - end - if guid then - plate.guid = guid - else - frame.auras:Hide() - return - end - end - UpdateAuraIconGrid(plate) - if(self.UseCombo) then - local numPoints = GetComboPoints(UnitHasVehicleUI("player") and "vehicle" or "player", "target") - for i = 1, MAX_COMBO_POINTS do - if(i <= numPoints) then - frame.combo[i]:Show() - else - frame.combo[i]:Hide() - end - end - end -end - -function MOD:UpdateAurasByUnitID(unitid) - local guid = UnitGUID(unitid) - if(guid and UnitPlateAuras[guid]) then - local auras = UnitPlateAuras[guid] - for auraID, _ in pairs(auras) do - UnitPlateAuras[guid][auraID] = nil - end - end - for i = 1, 40 do - local spellname , _, texture, count, dispelType, duration, expirationTime, unitCaster, _, _, spellid, _, isBossDebuff = UnitAura(unitid, i, "HARMFUL") - if(not spellname) then break end - SaveDuration(spellid, duration) - SetAuraInstance(guid, spellid, expirationTime, count, UnitGUID(unitCaster or ""), duration, texture) - end - local name; - if UnitPlayerControlled(unitid) then - name = UnitName(unitid) - AuraByName[name] = guid - end - local raidIcon = RIconNames[GetRaidTargetIndex(unitid) or ""]; - if(raidIcon) then - AuraByRaidIcon[raidIcon] = guid - end - self:RequestScanUpdate(guid, raidIcon, name, "UpdateAuras") -end ---[[ -########################################################## -PLATE COLORING -########################################################## -]]-- -do - local function GetPlateThreatReaction(plate) - if plate.ref.threat:IsShown() then - local r, g, b = plate.ref.threat:GetVertexColor() - if g + b == 0 then - return 'FULL_THREAT' - else - if plate.ref.reaction == 'FULL_THREAT' then - return 'GAINING_THREAT' - else - return 'LOSING_THREAT' - end - end - else - return 'NO_THREAT' - end - end - - local function GetPlateReaction(plate) - if plate.guid ~= nil then - local class, classToken, _, _, _, _, _ = GetPlayerInfoByGUID(plate.guid) - if RAID_CLASS_COLORS[classToken] then - return classToken - end - end - - local oldR,oldG,oldB = plate.health:GetStatusBarColor() - local r = floor(oldR * 100 + .5) * 0.01; - local g = floor(oldG * 100 + .5) * 0.01; - local b = floor(oldB * 100 + .5) * 0.01; - --print(plate.health:GetStatusBarColor()) - for classToken, _ in pairs(RAID_CLASS_COLORS) do - local bb = b - if classToken == 'MONK' then - bb = bb - 0.01 - end - if RAID_CLASS_COLORS[classToken].r == r and RAID_CLASS_COLORS[classToken].g == g and RAID_CLASS_COLORS[classToken].b == bb then - return classToken - end - end - - if (r + b + b) == 1.59 then - return 'TAPPED_NPC' - elseif g + b == 0 then - return 'HOSTILE_NPC' - elseif r + b == 0 then - return 'FRIENDLY_NPC' - elseif r + g > 1.95 then - return 'NEUTRAL_NPC' - elseif r + g == 0 then - return 'FRIENDLY_PLAYER' - else - return 'HOSTILE_PLAYER' - end - end - - local function ColorizeAndScale(plate, frame) - local unitType = GetPlateReaction(plate) - local scale = 1 - - plate.setting.unitcategory = unitType - - local latestColor; - - if RAID_CLASS_COLORS[unitType] then - latestColor = {RAID_CLASS_COLORS[unitType].r, RAID_CLASS_COLORS[unitType].g, RAID_CLASS_COLORS[unitType].b} - elseif unitType == "TAPPED_NPC" then - latestColor = NPReactTap - elseif unitType == "HOSTILE_NPC" or unitType == "NEUTRAL_NPC" then - local threatReaction = GetPlateThreatReaction(plate) - if (not NPUseThreat) then - if unitType == "NEUTRAL_NPC" then - latestColor = NPReactNeutral - else - latestColor = NPReactEnemy - end - else - if threatReaction == 'FULL_THREAT' then - if NPClassRole == 'T' then - latestColor = NPGoodThreat - scale = NPThreatGS - else - latestColor = NPBadThreat - scale = NPThreatBS - end - elseif threatReaction == 'GAINING_THREAT' then - if NPClassRole == 'T' then - latestColor = NPGoodTrans - else - latestColor = NPBadTrans - end - elseif threatReaction == 'LOSING_THREAT' then - if NPClassRole == 'T' then - latestColor = NPBadTrans - else - latestColor = NPGoodTrans - end - elseif InCombatLockdown() then - if NPClassRole == 'T' then - latestColor = NPBadThreat - scale = NPThreatBS - else - latestColor = NPGoodThreat - scale = NPThreatGS - end - else - if unitType == "NEUTRAL_NPC" then - latestColor = NPReactNeutral - else - latestColor = NPReactEnemy - end - end - end - plate.ref.reaction = threatReaction - elseif unitType == "FRIENDLY_NPC" then - latestColor = NPReactNPCGood - elseif unitType == "FRIENDLY_PLAYER" then - latestColor = NPReactPlayerGood - end - - local r,g,b - if(latestColor) then - r,g,b = unpack(latestColor) - else - r,g,b = plate.health:GetStatusBarColor() - end - - frame.health:SetStatusBarColor(r,g,b) - if(NPUsePointer and NPPointerMatch and plate.setting.unit == "target") then - NPGlow:SetBackdropBorderColor(r,g,b) - end - --frame.health.eliteborder.bottom:SetVertexColor(r,g,b) - --frame.health.eliteborder.right:SetVertexColor(r,g,b) - --frame.health.eliteborder.left:SetVertexColor(r,g,b) - - if(not plate.setting.scaled and not plate.setting.tiny and frame.health:GetWidth() ~= (HBWidth * scale)) then - frame.health:SetSize(HBWidth * scale, HBHeight * scale) - plate.cast.icon:SetSize(CBHeight + (HBHeight * scale) + 5, CBHeight + (HBHeight * scale) + 5) - end - end - - function UpdatePlateElements(plate, frame) - ColorizeAndScale(plate, frame) - local region = select(4, plate:GetRegions()) - if(region and region:GetObjectType() == 'FontString') then - plate.ref.level = region - end - - if(plate.ref.level:IsShown()) then - local level = plate.ref.level:GetObjectType() == 'FontString' and tonumber(plate.ref.level:GetText()) or nil - local elite, boss, mylevel = plate.ref.eliteicon:IsShown(), plate.ref.skullicon:IsShown(), UnitLevel("player") - frame.health.eliteborder:Hide() - if(boss) then - frame.level:SetText("??") - frame.level:SetTextColor(0.8, 0.05, 0) - frame.health.eliteborder:Show() - elseif(level) then - frame.level:SetText(level..(elite and "+" or "")) - frame.level:SetTextColor(plate.ref.level:GetTextColor()) - if(elite) then frame.health.eliteborder:Show() end - end - elseif(plate.ref.skullicon:IsShown() and frame.level:GetText() ~= '??') then - frame.level:SetText("??") - frame.level:SetTextColor(0.8, 0.05, 0) - end - - if plate.setting.tiny then - frame.level:SetText("") - frame.level:Hide() - elseif(not frame.level:IsShown()) then - frame.level:Show() - end - - if(frame.name.SetText) then - frame.name:SetText(plate.name:GetText()) - end - end -end ---[[ -########################################################## -PLATE UPDATE HANDLERS -########################################################## -]]-- -do - local function IsNamePlate(frame) - local frameName = frame:GetName() - if frameName and frameName:find('^NamePlate%d') then - local textObj = select(2, frame:GetChildren()) - if textObj then - local textRegions = textObj:GetRegions() - return (textRegions and textRegions:GetObjectType() == 'FontString') - end - end - end - - local function SetPlateAlpha(plate, frame) - if plate:GetAlpha() < 1 then - frame:SetAlpha(NPBaseAlpha) - else - frame:SetAlpha(1) - end - end - - local function UpdatePlateUnit() - local plateName = PLATE_REF.nametext - - if BLIZZ_PLATE:GetAlpha() == 1 and CURRENT_TARGET_NAME and (CURRENT_TARGET_NAME == plateName) then - BLIZZ_PLATE.guid = UnitGUID("target") - PLATE_ARGS.unit = "target" - SVUI_PLATE:SetFrameLevel(2) - SVUI_PLATE.highlight:Hide() - if(NPUsePointer) then - NPGlow:SetParent(SVUI_PLATE) - NPGlow:WrapOuter(SVUI_PLATE.health,2,2) - NPGlow:SetFrameLevel(0) - NPGlow:SetFrameStrata("BACKGROUND") - NPGlow:Show() - end - if((TARGET_CHECKS > 0) or PLATE_ARGS.allowed) then - TARGET_CHECKS = TARGET_CHECKS + 1 - if(TARGET_CHECKS == 2) then - TARGET_CHECKS = 0 - end - MOD:UpdateAurasByUnitID('target') - if MOD.UseCombo then - UpdateComboPoints() - end - PLATE_ARGS.allowed = nil - end - elseif PLATE_REF.highlight:IsShown() and UnitExists("mouseover") and (UnitName("mouseover") == plateName) then - if(PLATE_ARGS.unit ~= "mouseover" or PLATE_ARGS.allowed) then - SVUI_PLATE:SetFrameLevel(1) - SVUI_PLATE.highlight:Show() - MOD:UpdateAurasByUnitID('mouseover') - if MOD.UseCombo then - UpdateComboPoints() - end - PLATE_ARGS.allowed = nil - end - BLIZZ_PLATE.guid = UnitGUID("mouseover") - PLATE_ARGS.unit = "mouseover" - else - SVUI_PLATE:SetFrameLevel(0) - SVUI_PLATE.highlight:Hide() - PLATE_ARGS.unit = nil - end - CheckRaidIcon() - UpdatePlateElements(BLIZZ_PLATE,SVUI_PLATE) - end - - function WorldFrameUpdateHook(self, elapsed) - NPGrip:Hide() - for plate, _ in pairs(VisiblePlates) do - local frame = plate.frame - if(plate:IsShown()) then - local x,y = plate:GetCenter() - frame:SetPoint("CENTER", self, "BOTTOMLEFT", floor(x), floor(y)) - SetPlateAlpha(plate, frame) - else - frame:Hide() - end - end - NPGrip:Show() - - if(self.elapsed and self.elapsed > 0.2) then - - for plate, _ in pairs(VisiblePlates) do - local frame = plate.frame - if(plate:IsShown() and frame:IsShown() and ProxyThisPlate(plate)) then - UpdatePlateUnit() - end - end - self.elapsed = 0 - else - self.elapsed = (self.elapsed or 0) + elapsed - end - local curChildren = self:GetNumChildren() - if(numChildren ~= curChildren) then - for i = 1, curChildren do - local frame = select(i, self:GetChildren()) - if(not PlateRegistry[frame] and IsNamePlate(frame)) then - PlateForge(frame) - end - end - numChildren = curChildren - end - end -end ---[[ -########################################################## -SCRIPT HANDLERS -########################################################## -]]-- -do - local function CreateAuraIcon(auras, plate) - local noscalemult = 2 * UIParent:GetScale() - local button = CreateFrame("Frame", nil, auras) - button:SetScript('OnHide', function() - if plate.guid then - UpdateAuraIconGrid(plate) - end - end) - button.bord = button:CreateTexture(nil, "BACKGROUND") - button.bord:SetDrawLayer('BACKGROUND', 2) - button.bord:SetTexture(0,0,0,1) - button.bord:SetPoint("TOPLEFT", button, "TOPLEFT", -noscalemult, noscalemult) - button.bord:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", noscalemult, -noscalemult) - button.Icon = button:CreateTexture(nil, "BORDER") - button.Icon:SetPoint("TOPLEFT",button,"TOPLEFT") - button.Icon:SetPoint("BOTTOMRIGHT",button,"BOTTOMRIGHT") - button.Icon:SetTexCoord(.1, .9, .2, .8) - button.TimeLeft = button:CreateFontString(nil, 'OVERLAY') - button.TimeLeft:SetFont(AuraFont, AuraFSize, AuraFOutline) - button.TimeLeft:SetPoint("BOTTOMLEFT",button,"TOPLEFT",-3,-1) - button.TimeLeft:SetJustifyH('CENTER') - button.Stacks = button:CreateFontString(nil,"OVERLAY") - button.Stacks:SetFont(AuraFont, AuraFSize + 2, AuraFOutline) - button.Stacks:SetPoint("BOTTOMRIGHT",button,"BOTTOMRIGHT",3,-3) - button:Hide() - return button - end - - local function HealthBarSizeChanged(self, width, height) - if(not ProxyThisPlate(self.sync)) then return; end - width = floor(width + 0.5) - local numAuras = AuraMaxCount - local auraWidth = ((width - (4 * (numAuras - 1))) / numAuras) - local auraHeight = (auraWidth * 0.7) - for index = 1, numAuras do - if not PLATE_AURAICONS[index] then - PLATE_AURAICONS[index] = CreateAuraIcon(PLATE_AURAS, SVUI_PLATE); - end - PLATE_AURAICONS[index]:SetWidth(auraWidth) - PLATE_AURAICONS[index]:SetHeight(auraHeight) - PLATE_AURAICONS[index]:ClearAllPoints() - if(index == 1) then - PLATE_AURAICONS[index]:SetPoint("LEFT", PLATE_AURAS, 0, 0) - else - PLATE_AURAICONS[index]:SetPoint("LEFT", PLATE_AURAICONS[index-1], "RIGHT", 4, 0) - end - end - if(numAuras > #PLATE_AURAICONS) then - for index = (numAuras + 1), #PLATE_AURAICONS do - RegisterAuraClock(PLATE_AURAICONS[index], 0) - end - end - end - - local function HealthBarValueChanged(self, value) - local healthBar = self.sync; - local alert = healthBar.alert; - local minValue, maxValue = self:GetMinMaxValues() - local showText = false - healthBar:SetMinMaxValues(minValue, maxValue) - healthBar:SetValue(value) - local percentValue = (value/maxValue) - if percentValue < HBThresh then - alert:Show() - if percentValue < (HBThresh / 2) then - alert:SetBackdropBorderColor(1, 0, 0, 0.9) - else - alert:SetBackdropBorderColor(1, 1, 0, 0.9) - end - elseif alert:IsShown() then - alert:Hide() - end - if((value and value > 0) and (maxValue and maxValue > 1) and self:GetScale() == 1) then - showText = true - end - if(HBTextFormat and showText) then - healthBar.text:Show() - healthBar.text:SetText(SetTextStyle(HBTextFormat, value, maxValue)) - elseif healthBar.text:IsShown() then - healthBar.text:Hide() - end - end - - local function CastBarValueChanged(self, value) - local castBar = self.sync - local min, max = self:GetMinMaxValues() - local isChannel = value < castBar:GetValue() - castBar:SetMinMaxValues(min, max) - castBar:SetValue(value) - castBar.text:SetFormattedText("%.1f ", value) - local color - if(self.shield:IsShown()) then - color = CBNoInterrupt - else - if value > 0 and (isChannel and (value/max) <= 0.02 or (value/max) >= 0.98) then - color = {0,1,0} - else - color = CBColor - end - end - castBar:SetStatusBarColor(unpack(color)) - end - - local function ShowThisPlate(plate) - if(not ProxyThisPlate(plate, true)) then return; end - - if BlockedPlates[PLATE_REALNAME] then - SVUI_PLATE:Hide() - PLATE_GRIP:Hide() - return - elseif(not SVUI_PLATE:IsShown()) then - PLATE_GRIP:Show() - SVUI_PLATE:Show() - end - - VisiblePlates[BLIZZ_PLATE] = true - - PLATE_ARGS.tiny = (BLIZZ_PLATE.health:GetEffectiveScale() < 1) - SVUI_PLATE:SetSize(BLIZZ_PLATE:GetSize()) - - SVUI_PLATE.name:ClearAllPoints() - if(PLATE_ARGS.tiny) then - SVUI_PLATE.health:SetSize(BLIZZ_PLATE.health:GetWidth() * (BLIZZ_PLATE.health:GetEffectiveScale() * 1.25), HBHeight) - SVUI_PLATE.name:SetPoint("BOTTOM", SVUI_PLATE.health, "TOP", 0, 3) - else - SVUI_PLATE.name:SetPoint("BOTTOMLEFT", SVUI_PLATE.health, "TOPLEFT", 0, 3) - SVUI_PLATE.name:SetPoint("BOTTOMRIGHT", SVUI_PLATE.level, "BOTTOMLEFT", -2, 0) - end - - UpdatePlateElements(BLIZZ_PLATE, SVUI_PLATE) - - HealthBarValueChanged(BLIZZ_PLATE.health, BLIZZ_PLATE.health:GetValue()) - - if(not PLATE_ARGS.tiny) then - CheckRaidIcon() - MOD:UpdateAuras(BLIZZ_PLATE) - else - PLATE_ARGS.allowed = true - end - - if(not NPPointerMatch) then - NPGlow:SetBackdropBorderColor(unpack(NPPointerColor)) - end - end - - local function HideThisPlate(plate) - if(not ProxyThisPlate(plate)) then return; end - - SVUI_PLATE:Hide() - PLATE_GRIP:Hide() - VisiblePlates[plate] = nil - - PLATE_REF.reaction = nil - PLATE_ARGS.unitcategory = nil - plate.guid = nil - PLATE_ARGS.unit = nil - PLATE_REF.raidicontype = nil - PLATE_ARGS.scaled = nil - PLATE_ARGS.tiny = nil - PLATE_ARGS.allowed = nil - if(NPGlow:GetParent() == SVUI_PLATE) then - NPGlow:Hide() - end - SVUI_PLATE.health.alert:Hide() - SVUI_PLATE.health.icon:Hide() - if SVUI_PLATE.health then - SVUI_PLATE.health:SetSize(HBWidth, HBHeight) - plate.cast.icon:Size(CBHeight + HBHeight + 5) - end - if PLATE_AURAS then - for index = 1, #PLATE_AURAICONS do - RegisterAuraClock(PLATE_AURAICONS[index], 0) - end - end - if MOD.UseCombo then - for i=1, MAX_COMBO_POINTS do - SVUI_PLATE.combo[i]:Hide() - end - end - - SVUI_PLATE:SetPoint("BOTTOMLEFT", plate, "BOTTOMLEFT") - end - - local function UpdateThisPlate(plate) - if(not ProxyThisPlate(plate, true)) then return; end - SVUI_PLATE.name:FontManager(NPFont, NPFSize, NPFOutline) - SVUI_PLATE.name:SetTextColor(1, 1, 1) - SVUI_PLATE.level:FontManager(NPFont, NPFSize, NPFOutline) - if not PLATE_ARGS.scaled and not PLATE_ARGS.tiny then - SVUI_PLATE.health:SetSize(HBWidth, HBHeight) - end - SVUI_PLATE.health:SetStatusBarTexture(SV.Media.bar.default) - SVUI_PLATE.health.text:FontManager(SV.Media.font.roboto, 8, "OUTLINE") - SVUI_PLATE.cast:SetSize(HBWidth, CBHeight) - SVUI_PLATE.cast:SetStatusBarTexture(SV.Media.bar.gradient) - SVUI_PLATE.cast.text:SetFont(SV.Media.font.roboto, 8, "OUTLINE") - plate.cast.text:SetFont(SV.Media.font.roboto, 8, "OUTLINE") - plate.cast.icon:Size((CBHeight + HBHeight) + 5) - PLATE_REF.raidicon:ClearAllPoints() - SV:SetReversePoint(PLATE_REF.raidicon, RIAnchor, SVUI_PLATE.health, RIXoffset, RIYoffset) - PLATE_REF.raidicon:SetSize(RISize, RISize) - SVUI_PLATE.health.icon:ClearAllPoints() - SV:SetReversePoint(SVUI_PLATE.health.icon, RIAnchor, SVUI_PLATE.health, RIXoffset, RIYoffset) - SVUI_PLATE.health.icon:SetSize(RISize, RISize) - for index = 1, #PLATE_AURAICONS do - if PLATE_AURAICONS and PLATE_AURAICONS[index] then - PLATE_AURAICONS[index].TimeLeft:FontManager(AuraFont, AuraFSize, AuraFOutline) - PLATE_AURAICONS[index].Stacks:FontManager(AuraFont, AuraFSize, AuraFOutline) - PLATE_AURAICONS[index].Icon:SetTexCoord(.07, 0.93, .23, 0.77) - end - end - - if(MOD.UseCombo and not SVUI_PLATE.combo:IsShown()) then - SVUI_PLATE.combo:Show() - elseif(SVUI_PLATE.combo:IsShown()) then - SVUI_PLATE.combo:Hide() - end - - ShowThisPlate(plate) - HealthBarSizeChanged(SVUI_PLATE.health, SVUI_PLATE.health:GetSize()) - end - - function PlateForge(plate) - PlateRegistry[plate] = true; - - local ref, skin = {}, {}; - local barRegions, fontRegions = plate:GetChildren() - local health, cast = barRegions:GetChildren() - - ref.threat, - ref.border, - ref.highlight, - ref.level, - ref.skullicon, - ref.raidicon, - ref.eliteicon = barRegions:GetRegions() - - ref.nametext = ""; - - cast.border, - cast.shield, - cast.icon, - cast.text, - cast.shadow = select(2, cast:GetRegions()) - - health:SetStatusBarTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\EMPTY") - cast:SetStatusBarTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\EMPTY") - - plate.health = health - plate.cast = cast - plate.name = fontRegions:GetRegions() - - health:Hide() - fontRegions:Hide() - - ref.threat:SetTexture(0,0,0,0) - ref.border:Hide() - ref.highlight:SetTexture(0,0,0,0) - ref.level:SetWidth( 000.1 ) - ref.level:Hide() - ref.skullicon:SetTexture(0,0,0,0) - ref.raidicon:SetAlpha( 0 ) - ref.eliteicon:SetTexture(0,0,0,0) - - plate.name:Hide() - - cast.border:SetTexture(0,0,0,0) - cast.shield:SetTexture(0,0,0,0) - cast.icon:SetTexCoord( 0, 0, 0, 0 ) - cast.icon:SetWidth(.001) - cast.shadow:SetTexture(0,0,0,0) - --cast.shadow:Hide() - --cast.text:Hide() - - local frameName = "SVUI_PlateHolder"..numChildren - local holder = CreateFrame("Frame", frameName, NPGrip) - local frame = CreateFrame("Frame", nil, holder) - - --[[ HEALTH BAR ]]-- - - frame.health = CreateFrame("StatusBar", nil, frame) - frame.health:SetPoint('BOTTOM', frame, 'BOTTOM', 0, 5) - frame.health:SetFrameStrata("BACKGROUND") - frame.health:SetFrameLevel(0) - frame.health:SetScript("OnSizeChanged", HealthBarSizeChanged) - frame.health.sync = plate; - SetPlateBorder(frame.health) - SetEliteBorder(frame.health) - - frame.health.text = frame.health:CreateFontString(nil, 'OVERLAY') - frame.health.text:SetPoint("CENTER", frame.health, HBTextAnchor, HBXoffset, HBYoffset) - frame.health.text:SetJustifyH("CENTER") - - frame.level = frame:CreateFontString(nil, 'OVERLAY') - frame.level:SetPoint("BOTTOMRIGHT", frame.health, "TOPRIGHT", 3, 3) - frame.level:SetJustifyH("RIGHT") - - frame.name = frame:CreateFontString(nil, 'OVERLAY') - frame.name:SetJustifyH("LEFT") - - frame.eliteicon = frame:CreateTexture(nil, "OVERLAY") - frame.skullicon = frame:CreateTexture(nil, "OVERLAY") - - frame.raidicon = frame:CreateTexture(nil, "ARTWORK") - frame.raidicon:SetSize(NPIcons,NPIcons) - frame.raidicon:SetPoint("RIGHT", frame.health, "LEFT", -3, 0) - frame.raidicon:SetTexture("Interface\\TargetingFrame\\UI-RaidTargetingIcons") - - frame.health.icon = frame:CreateTexture(nil, 'ARTWORK') - frame.health.icon:SetSize(ref.raidicon:GetSize()) - frame.health.icon:SetPoint("BOTTOMRIGHT", frame.health, "TOPLEFT", -3, 3) - - frame.health.icon:SetTexture([[Interface\Addons\SVUI\assets\artwork\Unitframe\UNIT-ROLES]]) - frame.health.icon:SetTexCoord(0,0.5,0.5,1) - frame.health.icon:Hide() - - frame.highlight = frame:CreateTexture(nil, 'OVERLAY') - frame.highlight:SetAllPoints(frame.health) - frame.highlight:SetTexture(1, 1, 1, 0.3) - frame.highlight:Hide() - - local alert = CreateFrame("Frame", nil, frame) - alert:SetFrameLevel(0) - alert:WrapOuter(frame.health,2,2) - alert:SetBackdrop({edgeFile=[[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]],edgeSize=2}) - alert:SetBackdropColor(0, 0, 0, 0) - alert:SetBackdropBorderColor(1, 1, 0, 0.9) - alert:SetScale(1.5) - alert:Hide() - frame.health.alert = alert - - health.sync = frame.health - - --[[ CAST BAR ]]-- - - frame.cast = CreateFrame("StatusBar", nil, frame) - frame.cast:SetPoint('TOPLEFT', frame.health, 'BOTTOMLEFT', 0, -8) - frame.cast:SetPoint('TOPRIGHT', frame.health, 'BOTTOMRIGHT', 0, -8) - frame.cast:SetFrameStrata("BACKGROUND") - frame.cast:SetPanelTemplate('Bar') - frame.cast:SetFrameLevel(0) - - frame.cast.text = frame.cast:CreateFontString(nil, 'OVERLAY') - frame.cast.text:SetPoint("RIGHT", frame.cast, "LEFT", -4, CBYoffset) - frame.cast.text:SetJustifyH("LEFT") - - cast.text:SetParent(frame.cast) - cast.text:ClearAllPoints() - cast.text:SetPoint("LEFT", frame.cast, "LEFT", CBXoffset, CBYoffset) - cast.text:SetJustifyH("LEFT") - - cast.icon:SetParent(frame.cast) - cast.icon:SetTexCoord(.07, .93, .07, .93) - cast.icon:SetDrawLayer("OVERLAY") - cast.icon:ClearAllPoints() - cast.icon:SetPoint("TOPLEFT", frame.health, "TOPRIGHT", 5, 0) - - local bgFrame = CreateFrame("Frame", nil, frame.cast) - bgFrame:WrapOuter(cast.icon) - bgFrame:SetFrameLevel(bgFrame:GetFrameLevel() - 1) - - bgFrame:SetPanelTemplate("Bar", true, 2, 0, 0) - - --SetPlateBorder(frame.cast, cast.icon) - - cast.sync = frame.cast - - frame.combo = CreateFrame("Frame", nil, frame.health) - frame.combo:Point("CENTER", frame.health, "BOTTOM") - frame.combo:SetSize(68, 1) - frame.combo:Hide() - - if MOD.UseCombo then - for i = 1, MAX_COMBO_POINTS do - frame.combo[i] = frame.combo:CreateTexture(nil, 'OVERLAY') - frame.combo[i]:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\COMBO-POINT-SMALL") - frame.combo[i]:SetSize(12, 12) - frame.combo[i]:SetVertexColor(unpack(NPComboColor[i])) - if(i == 1) then - frame.combo[i]:SetPoint("TOPLEFT", frame.combo, "TOPLEFT") - else - frame.combo[i]:SetPoint("LEFT", frame.combo[i-1], "RIGHT", 2, 0) - end - frame.combo[i]:Hide() - end - end - - frame.auras = CreateFrame("Frame", nil, frame) - frame.auras:SetHeight(32); frame.auras:Show() - frame.auras:SetPoint('BOTTOMRIGHT', frame.health, 'TOPRIGHT', 0, 10) - frame.auras:SetPoint('BOTTOMLEFT', frame.health, 'TOPLEFT', 0, 10) - frame.auras:SetFrameStrata("BACKGROUND") - frame.auras:SetFrameLevel(0) - frame.auraicons = {} - - plate.holder = holder; - plate.frame = frame; - plate.ref = ref; - plate.setting = {}; - - UpdateThisPlate(plate) - - plate:HookScript("OnShow", ShowThisPlate) - plate:HookScript("OnHide", HideThisPlate) - plate:HookScript("OnSizeChanged", function(self, width, height) - self.frame:SetSize(width, height) - end) - - health:HookScript("OnValueChanged", HealthBarValueChanged) - - cast:HookScript("OnShow", function(self) self.sync:Show() end) - cast:HookScript("OnHide", function(self) self.sync:Hide() end) - cast:HookScript("OnValueChanged", CastBarValueChanged) - - VisiblePlates[plate] = true - - if not cast:IsShown() then - frame.cast:Hide() - elseif not frame.cast:IsShown() then - frame.cast:Show() - end - end - - function MOD:UpdateAllPlates() - self:UpdateLocals() - for plate, _ in pairs(VisiblePlates) do - if(plate) then - UpdateThisPlate(plate) - end - end - end -end ---[[ -########################################################## -SCANNER -########################################################## -]]-- -do - local function ParseByName(sourceName) - if not sourceName then return; end - local SearchFor = split("-", sourceName) - for plate, _ in pairs(VisiblePlates) do - if plate and plate:IsShown() and plate.ref.nametext == SearchFor and RAID_CLASS_COLORS[plate.setting.unitcategory] then - return plate - end - end - end - - local function ParseByIconName(raidIcon) - for plate, _ in pairs(VisiblePlates) do - CheckRaidIcon(plate) - if plate and plate:IsShown() and plate.ref.raidicon:IsShown() and (plate.ref.raidicontype and plate.ref.raidicontype == raidIcon) then - return plate - end - end - end - - function MOD:RequestScanUpdate(guid, raidIcon, name, callbackFunc, ...) - local plate - if guid then plate = ParseByGUID(guid) end - if (not plate) and name then plate = ParseByName(name) end - if (not plate) and raidIcon then plate = ParseByIconName(raidIcon) end - if(plate) then - MOD[callbackFunc](MOD, plate, ...) - end - end -end ---[[ -########################################################## -EVENTS -########################################################## -]]-- -function MOD:PLAYER_ENTERING_WORLD() - self:UpdateLocals(); -end - -function MOD:UPDATE_MOUSEOVER_UNIT() - WorldFrame.elapsed = 0.1 -end - -function MOD:PLAYER_REGEN_DISABLED() - SetCVar("nameplateShowEnemies", 1) -end - -function MOD:PLAYER_REGEN_ENABLED() - SetCVar("nameplateShowEnemies", 0) -end - -function MOD:PLAYER_TARGET_CHANGED() - if(UnitExists("target")) then - CURRENT_TARGET_NAME = UnitName("target"); - TARGET_CHECKS = 1; - WorldFrame.elapsed = 0.1; - else - NPGlow:Hide(); - CURRENT_TARGET_NAME = nil; - TARGET_CHECKS = 0; - end -end - -function MOD:UNIT_COMBO_POINTS(event, unit) - if(unit == "player" or unit == "vehicle") then - UpdateComboPoints() - end -end - -function MOD:UNIT_AURA(event, unit) - if(unit == "target" or unit == "focus") then - self:UpdateAurasByUnitID(unit) - if(self.UseCombo) then - UpdateComboPoints() - end - end -end - -function MOD:COMBAT_LOG_EVENT_UNFILTERED(event, timestamp, combatevent, hideCaster, ...) - local _, sourceGUID, sourceName, destGUID, destName, destFlags, destRaidFlag, spellID, spellname - if(not destGUID or not spellID) then return end - if(combatevent == SPELL_AURA_APPLIED or combatevent == SPELL_AURA_REFRESH or combatevent == SPELL_AURA_APPLIED_DOSE or combatevent == SPELL_AURA_REMOVED_DOSE) then - sourceGUID, sourceName, _, _, destGUID, destName, destFlags, destRaidFlag, spellID, spellname = ... - local stackCount = 1 - local duration = LoadDuration(spellID) - local texture = GetSpellTexture(spellID) - if(combatevent == SPELL_AURA_APPLIED_DOSE or combatevent == SPELL_AURA_REMOVED_DOSE) then - stackCount = select(16, ...) - end - SetAuraInstance(destGUID, spellID, (GetTime() + duration), stackCount, sourceGUID, duration, texture) - elseif(combatevent == SPELL_AURA_BROKEN or combatevent == SPELL_AURA_BROKEN_SPELL or combatevent == SPELL_AURA_REMOVED) then - sourceGUID, sourceName, _, _, destGUID, destName, destFlags, destRaidFlag, spellID, spellname = ... - local auraID = spellID..(tostring(sourceName or "UNKNOWN_CASTER")) - if UnitPlateAuras[destGUID][auraID] then - UnitPlateAuras[destGUID][auraID] = nil - end - else - return - end - - local rawName, raidIcon - if(destName and (band(destFlags, COMBATLOG_OBJECT_CONTROL_PLAYER) > 0)) then - rawName = split("-", destName) - AuraByName[rawName] = destGUID - end - for iconName, bitmask in pairs(RIconData) do - if band(destRaidFlag, bitmask) > 0 then - raidIcon = iconName - AuraByRaidIcon[raidIcon] = destGUID - break - end - end - self:RequestScanUpdate(destGUID, raidIcon, rawName, "UpdateAuras") -end ---[[ -########################################################## -UPDATE AND BUILD -########################################################## -]]-- -function MOD:UpdateLocals() - local db = SV.db.SVPlate - if not db then return end - - NPClassRole = SV.ClassRole; - NPBaseAlpha = db.nonTargetAlpha; - NPCombatHide = db.combatHide; - - NPFont = LSM:Fetch("font", db.font); - NPFSize = db.fontSize; - NPFOutline = db.fontOutline; - - AuraFont = LSM:Fetch("font", db.auras.font); - AuraFSize = db.auras.fontSize; - AuraFOutline = db.auras.fontOutline; - AuraMaxCount = db.auras.numAuras; - - RIAnchor = db.raidHealIcon.attachTo; - RIXoffset = db.raidHealIcon.xOffset; - RIYoffset = db.raidHealIcon.yOffset; - RISize = db.raidHealIcon.size; - - HBThresh = db.healthBar.lowThreshold; - NPNameMatch = db.colorNameByValue; - HBTextFormat = db.healthBar.text.enable and db.healthBar.text.format or false; - HBTextAnchor = db.healthBar.text.attachTo; - HBXoffset = db.healthBar.text.xOffset; - HBYoffset = db.healthBar.text.yOffset; - HBWidth = db.healthBar.width; - HBHeight = db.healthBar.height; - - NPIcons = HBHeight * 1.5 - - CBColor = {db.castBar.color[1], db.castBar.color[2], db.castBar.color[3]} - CBNoInterrupt = {db.castBar.noInterrupt[1], db.castBar.noInterrupt[2], db.castBar.noInterrupt[3]} - CBHeight = db.castBar.height; - CBText = db.castBar.text.enable; - CBXoffset = db.castBar.text.xOffset; - CBYoffset = db.castBar.text.yOffset; - - NPUsePointer = db.pointer.enable; - NPPointerMatch = db.pointer.colorMatchHealthBar; - NPPointerColor = {db.pointer.color[1], db.pointer.color[2], db.pointer.color[3]}; - - local tc = db.threat - NPUseThreat = tc.enable; - NPThreatGS = tc.goodScale; - NPThreatBS = tc.badScale; - NPGoodThreat = {tc.goodColor[1], tc.goodColor[2], tc.goodColor[3]} - NPBadThreat = {tc.badColor[1], tc.badColor[2], tc.badColor[3]} - NPGoodTrans = {tc.goodTransitionColor[1], tc.goodTransitionColor[2], tc.goodTransitionColor[3]} - NPBadTrans = {tc.badTransitionColor[1], tc.badTransitionColor[2], tc.badTransitionColor[3]} - - local rc = db.reactions - NPReactTap = {rc.tapped[1], rc.tapped[2], rc.tapped[3]} - NPReactNPCGood = {rc.friendlyNPC[1], rc.friendlyNPC[2], rc.friendlyNPC[3]} - NPReactPlayerGood = {rc.friendlyPlayer[1], rc.friendlyPlayer[2], rc.friendlyPlayer[3]} - NPReactNeutral = {rc.neutral[1], rc.neutral[2], rc.neutral[3]} - NPReactEnemy = {rc.enemy[1], rc.enemy[2], rc.enemy[3]} - - AuraFont = LSM:Fetch("font", db.auras.font); - AuraFSize = db.auras.fontSize; - AuraFOutline = db.auras.fontOutline; - AuraMaxCount = db.auras.numAuras; - AuraFilterName = db.auras.additionalFilter - AuraFilter = SV.filters[AuraFilterName] - - if (db.comboPoints and (SV.class == 'ROGUE' or SV.class == 'DRUID')) then - self.UseCombo = true - self:RegisterEvent("UNIT_COMBO_POINTS") - else - self.UseCombo = false - self:UnregisterEvent("UNIT_COMBO_POINTS") - end -end - -function MOD:CombatToggle(noToggle) - if(NPCombatHide) then - self:RegisterEvent("PLAYER_REGEN_DISABLED") - self:RegisterEvent("PLAYER_REGEN_ENABLED") - if(not noToggle) then - SetCVar("nameplateShowEnemies", 0) - end - else - self:UnregisterEvent("PLAYER_REGEN_DISABLED") - self:UnregisterEvent("PLAYER_REGEN_ENABLED") - if(not noToggle) then - SetCVar("nameplateShowEnemies", 1) - end - end -end - -function MOD:ReLoad() - if SV.db["SVPlate"].enable ~= true then - self:DisableTracking() - return - end - self:UpdateAllPlates(); -end - -function MOD:Load() - if SV.db.SVPlate.enable ~= true then return end - self:UpdateLocals() - self:RegisterEvent("PLAYER_ENTERING_WORLD") - self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") - self:RegisterEvent("UNIT_AURA") - self:RegisterEvent("PLAYER_TARGET_CHANGED") - self:RegisterEvent("UPDATE_MOUSEOVER_UNIT") - WorldFrame:HookScript('OnUpdate', WorldFrameUpdateHook) - self:CombatToggle(true) -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/plates/SVPlate.xml b/Interface/AddOns/SVUI/packages/plates/SVPlate.xml deleted file mode 100644 index 9547082..0000000 --- a/Interface/AddOns/SVUI/packages/plates/SVPlate.xml +++ /dev/null @@ -1,25 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Frame name="SVUI_PlateParentFrame" frameStrata="BACKGROUND" hidden="true"> - <Scripts> - <OnLoad> - self:SetParent(_G['WorldFrame']) - </OnLoad> - </Scripts> - </Frame> - - <Frame name="SVUI_PlateGlowFrame" frameStrata="BACKGROUND" hidden="true"> - <Scripts> - <OnLoad> - self:SetParent(_G['WorldFrame']) - self:SetBackdrop({ - edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], - edgeSize = 2 - }) - self:SetBackdropColor(0, 0, 0, 0) - self:SetScale(2.5) - </OnLoad> - </Scripts> - </Frame> - - <Script file='SVPlate.lua'/> -</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/quest/SVQuest.lua b/Interface/AddOns/SVUI/packages/quest/SVQuest.lua index 03701b5..f1e0c60 100644 --- a/Interface/AddOns/SVUI/packages/quest/SVQuest.lua +++ b/Interface/AddOns/SVUI/packages/quest/SVQuest.lua @@ -51,340 +51,451 @@ local MOD = SV:NewPackage("SVQuest", L['Questing']); LOCALS ########################################################## ]]-- -local ShowSubDocklet = function(self) - if(InCombatLockdown()) then return end - if(not ObjectiveTrackerFrame:IsShown()) then ObjectiveTrackerFrame:Show() end +local ROW_WIDTH = 300; +local ROW_HEIGHT = 24; +local INNER_HEIGHT = ROW_HEIGHT - 4; +local LARGE_ROW_HEIGHT = ROW_HEIGHT * 2; +local LARGE_INNER_HEIGHT = LARGE_ROW_HEIGHT - 4; + +local NO_ICON = [[Interface\AddOns\SVUI\assets\artwork\Template\EMPTY]]; +local OBJ_ICON_ACTIVE = [[Interface\COMMON\Indicator-Yellow]]; +local OBJ_ICON_COMPLETE = [[Interface\COMMON\Indicator-Green]]; +local OBJ_ICON_INCOMPLETE = [[Interface\COMMON\Indicator-Gray]]; +--[[ +########################################################## +OBJECTIVE SCRIPT HANDLERS +########################################################## +]]-- +local OBJECTIVE_StartProgress = function(self, ...) + local questID, finished = ... + + local status = self:GetStatus(); + status:FadeIn(); + status.Bar.questID = questID; + status.Bar.finished = finished; + status.Bar:SetMinMaxValues(0, 100); + local percent = 100; + if(not finished) then + percent = GetQuestProgressBarPercent(questID); + end + status.Bar:SetValue(percent); + status.Label:SetFormattedText(PERCENTAGE_STRING, percent); + self:RegisterEvent("QUEST_LOG_UPDATE") end -local HideSubDocklet = function(self) - if(InCombatLockdown()) then return end - if(ObjectiveTrackerFrame:IsShown()) then ObjectiveTrackerFrame:Hide() end +local OBJECTIVE_StopProgress = function(self) + if(not self.Status) then return end + local status = self.Status; + status:SetAlpha(0); + status.Bar:SetValue(0); + status.Label:SetText(''); + self:UnregisterEvent("QUEST_LOG_UPDATE") end -local function GetTimerTextColor(duration, elapsed) - local yellowPercent = .66 - local redPercent = .33 - - local percentageLeft = 1 - ( elapsed / duration ) - if(percentageLeft > yellowPercent) then - return 1, 1, 1; - elseif(percentageLeft > redPercent) then - local blueOffset = (percentageLeft - redPercent) / (yellowPercent - redPercent); - return 1, 1, blueOffset; - else - local greenOffset = percentageLeft / redPercent; - return 1, greenOffset, 0; +local OBJECTIVE_UpdateProgress = function(self, event, ...) + if(not self.Status) then + self:UnregisterEvent("QUEST_LOG_UPDATE") + return end + local status = self.Status; + local percent = 100; + if(not status.Bar.finished) then + percent = GetQuestProgressBarPercent(status.Bar.questID); + end + status.Bar:SetValue(percent); + status.Label:SetFormattedText(PERCENTAGE_STRING, percent); end -local function CheckAndHideHeader(moduleHeader) - if(moduleHeader and not moduleHeader.added and moduleHeader:IsShown()) then - moduleHeader:Hide(); - if(moduleHeader.animating) then - moduleHeader.animating = nil; - moduleHeader.HeaderOpenAnim:Stop(); - end - end +local OBJECTIVE_StartTimer = function(self, ...) + local duration, elapsed = ... + local timeNow = GetTime(); + local startTime = timeNow - elapsed; + local timeRemaining = duration - startTime; + + local status = self:GetStatus(); + status:FadeIn(); + status.Bar.duration = duration or 1; + status.Bar.startTime = startTime; + status.Bar:SetMinMaxValues(0, status.Bar.duration); + status.Bar:SetValue(timeRemaining); + status.Label:SetText(GetTimeStringFromSeconds(duration, nil, true)); + status.Label:SetTextColor(MOD:GetTimerTextColor(duration, duration - timeRemaining)); + + self:SetScript("OnUpdate", self.UpdateTimer); end ---[[ -########################################################## -SCRIPT HANDLERS -########################################################## -]]-- -local TrackerFrame_OnUpdate = function(self, elapsed) - if(self:GetHeight() > 0) then - self:SetScript("OnUpdate", nil); - MOD:UpdateTracker(OBJECTIVE_TRACKER_UPDATE_ALL); - end + +local OBJECTIVE_StopTimer = function(self, ...) + if(not self.Status) then return end + local status = self.Status; + status:SetAlpha(0); + status.Bar.duration = 1; + status.Bar.startTime = 0; + status.Bar:SetMinMaxValues(0, status.Bar.duration); + status.Bar:SetValue(0); + status.Label:SetText(''); + status.Label:SetTextColor(1,1,1); + + self:SetScript("OnUpdate", nil); end -local TimerBar_OnUpdate = function(self, elapsed) +local OBJECTIVE_UpdateTimer = function(self, ...) + if(not self.Status) then + self:SetScript("OnUpdate", nil); + return + end + local status = self.Status; local timeNow = GetTime(); - local timeRemaining = self.duration - (timeNow - self.startTime); - self.Bar:SetValue(timeRemaining); + local timeRemaining = status.Bar.duration - (timeNow - status.Bar.startTime); + status.Bar:SetValue(timeRemaining); if(timeRemaining < 0) then -- hold at 0 for a moment if(timeRemaining > -1) then timeRemaining = 0; else - MOD:UpdateTracker(self.block.module.updateReasonModule); - return; + self:SetAlpha(0); + status.Bar.duration = 1; + status.Bar.startTime = 0; + status.Bar:SetMinMaxValues(0, status.Bar.duration); + status.Bar:SetValue(0); + status.Label:SetText(''); + status.Label:SetTextColor(1,1,1); + self:SetScript("OnUpdate", nil); end end - self.Label:SetText(GetTimeStringFromSeconds(timeRemaining, nil, true)); - self.Label:SetTextColor(GetTimerTextColor(self.duration, self.duration - timeRemaining)); + local r,g,b = MOD:GetTimerTextColor(status.Bar.duration, status.Bar.duration - timeRemaining) + status.Label:SetText(GetTimeStringFromSeconds(timeRemaining, nil, true)); + status.Label:SetTextColor(r,g,b); +end + +local OBJECTIVE_GetStatus = function(self) + if(not self.Status) then + local status = CreateFrame("Frame", nil, self) + status:SetPoint("TOPLEFT", self.Icon, "TOPRIGHT", 4, 0); + status:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 0, 0); + + status.Bar = CreateFrame("StatusBar", nil, status); + status.Bar:SetPointToScale("TOPLEFT", status, "TOPLEFT", 4, -2); + status.Bar:SetPointToScale("BOTTOMRIGHT", status, "BOTTOMRIGHT", -4, 2); + status.Bar:SetStatusBarTexture(SV.Media.bar.default) + status.Bar:SetStatusBarColor(0.15,0.5,1) --1,0.15,0.08 + status.Bar:SetMinMaxValues(0, 1) + status.Bar:SetValue(0) + + local bgFrame = CreateFrame("Frame", nil, status.Bar) + bgFrame:SetAllPointsIn(status.Bar, -2, -2) + bgFrame:SetFrameLevel(bgFrame:GetFrameLevel() - 1) + + bgFrame.bg = bgFrame:CreateTexture(nil, "BACKGROUND") + bgFrame.bg:SetAllPoints(bgFrame) + bgFrame.bg:SetTexture(SV.Media.bar.default) + bgFrame.bg:SetVertexColor(0,0,0,0.5) + + local borderB = bgFrame:CreateTexture(nil,"OVERLAY") + borderB:SetTexture(0,0,0) + borderB:SetPoint("BOTTOMLEFT") + borderB:SetPoint("BOTTOMRIGHT") + borderB:SetHeight(2) + + local borderT = bgFrame:CreateTexture(nil,"OVERLAY") + borderT:SetTexture(0,0,0) + borderT:SetPoint("TOPLEFT") + borderT:SetPoint("TOPRIGHT") + borderT:SetHeight(2) + + local borderL = bgFrame:CreateTexture(nil,"OVERLAY") + borderL:SetTexture(0,0,0) + borderL:SetPoint("TOPLEFT") + borderL:SetPoint("BOTTOMLEFT") + borderL:SetWidth(2) + + local borderR = bgFrame:CreateTexture(nil,"OVERLAY") + borderR:SetTexture(0,0,0) + borderR:SetPoint("TOPRIGHT") + borderR:SetPoint("BOTTOMRIGHT") + borderR:SetWidth(2) + + status.Label = status.Bar:CreateFontString(nil,"OVERLAY"); + status.Label:SetAllPointsIn(status.Bar); + status.Label:SetFont(SV.Media.font.numbers, 12, "OUTLINE") + status.Label:SetTextColor(1,1,1) + status.Label:SetShadowOffset(-1,-1) + status.Label:SetShadowColor(0,0,0,0.5) + status.Label:SetJustifyH('CENTER') + status.Label:SetJustifyV('MIDDLE') + status.Label:SetText('') + + status:SetAlpha(0); + + self.Status = status; + + self:SetScript("OnEvent", self.UpdateProgress); + + return status; + end + + return self.Status; end --[[ ########################################################## -TRACKER FUNCTIONS +OBJECTIVE CONSTRUCTOR ########################################################## ]]-- -function MOD:SetProgressBarValue(percent) - self.Bar:SetValue(percent); - self.Bar.Label:SetFormattedText(PERCENTAGE_STRING, percent); -end +function MOD:NewObjectiveRow(header, index) + local yOffset = (index * (ROW_HEIGHT)) - ROW_HEIGHT; -local function CreateTrackerLine(parent, anchor, WIDTH) - local newLine = CreateFrame("Frame", nil, parent) - newLine:SetWidth(WIDTH); - newLine:SetHeight(24); - newLine:SetPoint("TOP", anchor, "BOTTOM", 0, -1); - - newLine.Header = CreateFrame("Frame", nil, newLine) - newLine.Header:SetPoint("TOPLEFT", newLine, "TOPLEFT", 2, -2); - newLine.Header:SetPoint("TOPRIGHT", newLine, "TOPRIGHT", -2, -2); - newLine.Header:SetHeight(20); - newLine.Header:SetPanelTemplate("Headline") - - newLine.Title = newLine.Header:CreateFontString(nil,"OVERLAY") - newLine.Title:SetFont(SV.Media.font.roboto, 14, "NONE") - newLine.Title:SetShadowOffset(-1,-1) - newLine.Title:SetShadowColor(0,0,0,0.5) - newLine.Title:SetText('') - newLine.Title:SetAllPoints(newLine.Header) - - newLine.Text = newLine:CreateFontString(nil,"OVERLAY") - newLine.Text:SetFont(SV.Media.font.roboto, 12, "NONE") - newLine.Text:SetShadowOffset(-1,-1) - newLine.Text:SetShadowColor(0,0,0,0.5) - newLine.Text:SetText('') - newLine.Text:SetPoint("TOPLEFT", newLine.Header, "BOTTOMLEFT", 0, -2) - - return newLine; -end + local objective = CreateFrame("Frame", nil, header); + objective:SetPoint("TOPLEFT", header, "TOPLEFT", 22, -yOffset); + objective:SetPoint("TOPRIGHT", header, "TOPRIGHT", 0, -yOffset); + objective:SetHeightToScale(ROW_HEIGHT); -function MOD:UpdateTracker() - if(not MOD.Tracker.initialized) then return; end + objective.Icon = objective:CreateTexture(nil,"OVERLAY"); + objective.Icon:SetPoint("TOPLEFT", objective, "TOPLEFT", 4, -2); + objective.Icon:SetPoint("BOTTOMLEFT", objective, "BOTTOMLEFT", 4, 2); + objective.Icon:SetWidth(16); + objective.Icon:SetTexture(OBJ_ICON_INCOMPLETE); - local tracker = MOD.Tracker; - for i = 1, GetNumQuestWatches() do - local questIndex = GetQuestIndexForWatch(i) - --local questID, title, questLogIndex, numObjectives, requiredMoney, isComplete, startEvent, isAutoComplete, failureTime, timeElapsed, questType, isTask, isStory, isOnMap, hasLocalPOI = GetQuestWatchInfo(i); - local title, level, suggestedGroup = GetQuestLogTitle(questIndex) - local text = ('[%s] %s'):format(level,title) - MOD.Tracker.Quest[i].Title:SetText(text) - end + objective.Text = objective:CreateFontString(nil,"OVERLAY"); + objective.Text:SetPoint("TOPLEFT", objective, "TOPLEFT", 20 + 6, -2); + objective.Text:SetPoint("TOPRIGHT", objective, "TOPRIGHT", 0, -2); + objective.Text:SetHeightToScale(INNER_HEIGHT); + objective.Text:SetFont(SV.Media.font.default, 11, "NONE"); + objective.Text:SetTextColor(0.6,0.6,0.6); + objective.Text:SetShadowOffset(-1,-1); + objective.Text:SetShadowColor(0,0,0,0.5); + objective.Text:SetJustifyH('LEFT'); + objective.Text:SetJustifyV('MIDDLE'); + objective.Text:SetText(''); + + objective.StartProgress = OBJECTIVE_StartProgress; + objective.StopProgress = OBJECTIVE_StopProgress; + objective.UpdateProgress = OBJECTIVE_UpdateProgress; + objective.StartTimer = OBJECTIVE_StartTimer; + objective.StopTimer = OBJECTIVE_StopTimer; + objective.UpdateTimer = OBJECTIVE_UpdateTimer; + objective.GetStatus = OBJECTIVE_GetStatus; + + return objective; end --[[ ########################################################## -EVENT HANDLERS +OBJECTIVE HEADER METHODS ########################################################## ]]-- -local TrackerFrame_OnEvent = function(self, event, ...) - if(event == "QUEST_LOG_UPDATE") then - MOD:UpdateTracker(); - elseif(event == "TRACKED_ACHIEVEMENT_UPDATE") then - AchievementObjectiveTracker_OnAchievementUpdate(...); - elseif(event == "QUEST_ACCEPTED") then - local questLogIndex, questID = ...; - if(IsQuestTask(questID)) then - MOD:UpdateTracker(); - else - if(AUTO_QUEST_WATCH == "1" and GetNumQuestWatches() < MAX_WATCHABLE_QUESTS) then - AddQuestWatch(questLogIndex); - QuestSuperTracking_OnQuestTracked(questID); - end - end - elseif(event == "TRACKED_ACHIEVEMENT_LIST_CHANGED") then - local achievementID, added = ...; - if(added) then - MOD:UpdateTracker(OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT_ADDED, achievementID); - else - MOD:UpdateTracker(OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT); - end - elseif(event == "QUEST_WATCH_LIST_CHANGED") then - local questID, added = ...; - if(added) then - if(not IsQuestTask(questID)) then - MOD:UpdateTracker(OBJECTIVE_TRACKER_UPDATE_QUEST_ADDED, questID); +local OBJECTIVE_HEADER_Reset = function(self, lite) + for x = 1, #self.Rows do + local objective = self.Rows[x] + if(objective) then + if(not objective:IsShown()) then + objective:Show() end - else - MOD:UpdateTracker(OBJECTIVE_TRACKER_UPDATE_QUEST); - end - elseif(event == "QUEST_POI_UPDATE") then - QuestPOIUpdateIcons(); - if(GetCVar("trackQuestSorting") == "proximity") then - SortQuestWatches(); - end - MOD:UpdateTracker(OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST); - QuestSuperTracking_OnPOIUpdate(); - elseif(event == "SCENARIO_CRITERIA_UPDATE") then - MOD:UpdateTracker(OBJECTIVE_TRACKER_UPDATE_SCENARIO); - elseif(event == "SUPER_TRACKED_QUEST_CHANGED") then - local questID = ...; - QuestPOI_SelectButtonByQuestID(self.BlocksFrame, questID); - elseif(event == "ZONE_CHANGED") then - local inMicroDungeon = IsPlayerInMicroDungeon(); - if(inMicroDungeon ~= self.inMicroDungeon) then - if(not WorldMapFrame:IsShown() and GetCVarBool("questPOI")) then - SetMapToCurrentZone(); + objective.Text:SetText(''); + objective.Icon:SetTexture(NO_ICON); + objective:StopTimer(); + objective:StopProgress(); + objective:SetHeight(1); + if(not lite) then + objective:SetAlpha(0); end - SortQuestWatches(); - self.inMicroDungeon = inMicroDungeon; - end - elseif(event == "QUEST_AUTOCOMPLETE") then - local questId = ...; - AutoQuestPopupTracker_AddPopUp(questId, "COMPLETE"); - elseif(event == "SCENARIO_UPDATE") then - local newStage = ...; - if(newStage) then - MOD:UpdateTracker(OBJECTIVE_TRACKER_UPDATE_SCENARIO_NEW_STAGE); - else - MOD:UpdateTracker(OBJECTIVE_TRACKER_UPDATE_SCENARIO); - end - elseif(event == "ZONE_CHANGED_NEW_AREA") then - if(not WorldMapFrame:IsShown() and GetCVarBool("questPOI")) then - SetMapToCurrentZone(); - end - SortQuestWatches(); - elseif(event == "QUEST_TURNED_IN") then - local questID, xp, money = ...; - if(IsQuestTask(questID)) then - BonusObjectiveTracker_OnTaskCompleted(...); end - elseif(event == "PLAYER_MONEY" and self.watchMoneyReasons > 0) then - MOD:UpdateTracker(self.watchMoneyReasons); - elseif(event == "PLAYER_ENTERING_WORLD") then - if(not self.initialized) then - ObjectiveTracker_Initialize(self); - end - MOD:UpdateTracker(); - QuestSuperTracking_ChooseClosestQuest(); - self.inMicroDungeon = IsPlayerInMicroDungeon(); - elseif(event == "VARIABLES_LOADED") then - MOD:UpdateTracker(); end + self:SetHeight(1); +end + +local OBJECTIVE_HEADER_Get = function(self, index) + if(not self.Rows[index]) then + local objective = MOD:NewObjectiveRow(self, index); + self.Rows[index] = objective; + return objective; + end + + return self.Rows[index]; +end + +local OBJECTIVE_HEADER_SetInfo = function(self, index, ...) + index = index + 1; + local description, completed, failed = ... + local objective = self:Get(index); + + if(failed) then + objective.Text:SetTextColor(1,0,0) + objective.Icon:SetTexture(OBJ_ICON_INCOMPLETE) + elseif(completed) then + objective.Text:SetTextColor(0.1,0.9,0.1) + objective.Icon:SetTexture(OBJ_ICON_COMPLETE) + else + objective.Text:SetTextColor(0.6,0.6,0.6) + objective.Icon:SetTexture(OBJ_ICON_INCOMPLETE) + end + objective.Text:SetText(description); + objective:SetHeightToScale(INNER_HEIGHT); + objective:FadeIn(); + + return index; +end + +local OBJECTIVE_HEADER_SetTimer = function(self, index, ...) + index = index + 1; + + local objective = self:Get(index); + objective.Text:SetText('') + objective:SetHeightToScale(INNER_HEIGHT); + objective:FadeIn(); + + objective:StartTimer(...) + + return index; +end + +local OBJECTIVE_HEADER_SetProgress = function(self, index, ...) + index = index + 1; + + local objective = self:Get(index); + objective.Text:SetText('') + objective:SetHeightToScale(INNER_HEIGHT); + objective:FadeIn(); + + objective:StartProgress(...) + + return index; +end +--[[ +########################################################## +OBJECTIVE CONSTRUCTOR +########################################################## +]]-- +function MOD:NewObjectiveHeader(parent) + local header = CreateFrame("Frame", nil, parent); + header.Rows = {}; + + header.Reset = OBJECTIVE_HEADER_Reset; + header.Get = OBJECTIVE_HEADER_Get; + header.SetInfo = OBJECTIVE_HEADER_SetInfo; + header.SetTimer = OBJECTIVE_HEADER_SetTimer; + header.SetProgress = OBJECTIVE_HEADER_SetProgress; + + return header; end --[[ ########################################################## CORE FUNCTIONS ########################################################## ]]-- +function MOD:GetTimerTextColor(duration, elapsed) + local yellowPercent = .66 + local redPercent = .33 + + local percentageLeft = 1 - ( elapsed / duration ) + if(percentageLeft > yellowPercent) then + return 1, 1, 1; + elseif(percentageLeft > redPercent) then + local blueOffset = (percentageLeft - redPercent) / (yellowPercent - redPercent); + return 1, 1, blueOffset; + else + local greenOffset = percentageLeft / redPercent; + return 1, greenOffset, 0; + end +end + +function MOD:UpdateDimensions() + local totalHeight = 1; + local scrollHeight = self.Docklet.ScrollFrame:GetHeight(); + local scrollWidth = self.Docklet.ScrollFrame:GetWidth(); + + for headerName, headerFrame in pairs(self.Headers) do + totalHeight = totalHeight + headerFrame:GetHeight() + headerFrame:SetWidth(scrollWidth) + end + + self.Docklet.ScrollFrame.MaxVal = totalHeight; + self.Docklet.ScrollFrame.ScrollBar:SetMinMaxValues(1, totalHeight); + self.Docklet.ScrollFrame.ScrollBar:SetHeight(scrollHeight); + self.Docklet.ScrollFrame.ScrollChild:SetWidth(scrollWidth); + self.Docklet.ScrollFrame.ScrollChild:SetHeight(totalHeight); +end + +function MOD:UpdateLocals() + ROW_WIDTH = self.Docklet.ScrollFrame:GetWidth(); + ROW_HEIGHT = SV.db.SVQuest.rowHeight; + INNER_HEIGHT = ROW_HEIGHT - 4; + LARGE_ROW_HEIGHT = ROW_HEIGHT * 2; + LARGE_INNER_HEIGHT = LARGE_ROW_HEIGHT - 4; + SV.Events:Trigger("QUEST_UPVALUES_UPDATED", ROW_WIDTH, ROW_HEIGHT, INNER_HEIGHT, LARGE_ROW_HEIGHT, LARGE_INNER_HEIGHT); +end + function MOD:ReLoad() -- DO STUFF + self:UpdateDimensions() end function MOD:Load() - -- DO STUFF - self.Tracker = SV.Dock:NewDocklet("BottomRight", "SVUI_QuestTracker", "Quest Tracker", [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-QUESTS]]) - - local listFrame = CreateFrame("ScrollFrame", "SVUI_QuestWatchFrameScrollFrame", self.Tracker); - listFrame:SetPoint("TOPLEFT", self.Tracker, 0, 0); - listFrame:SetPoint("BOTTOMRIGHT", self.Tracker, -31, 21); - listFrame:EnableMouseWheel(true); - - local WIDTH = listFrame:GetWidth(); - - local scrollFrame = CreateFrame("Slider", "SVUI_QuestWatchFrameScrollBar", listFrame); - scrollFrame:SetHeight(listFrame:GetHeight()); - scrollFrame:SetWidth(18); - scrollFrame:SetPoint("TOPRIGHT", self.Tracker, "TOPRIGHT", -3, 0); - scrollFrame:SetBackdrop({bgFile = bgTex, edgeFile = bdTex, edgeSize = 4, insets = {left = 3, right = 3, top = 3, bottom = 3}}); - scrollFrame:SetFrameLevel(6) - scrollFrame:SetFixedPanelTemplate("Transparent", true); - scrollFrame:SetThumbTexture("Interface\\Buttons\\UI-ScrollBar-Knob"); - scrollFrame:SetOrientation("VERTICAL"); - scrollFrame:SetValueStep(5); - scrollFrame:SetMinMaxValues(1, 420); - scrollFrame:SetValue(1); - scrollFrame:SetScript("OnValueChanged", function(self, argValue) - listFrame:SetVerticalScroll(argValue) + self.Docklet = SV.Dock:NewDocklet("BottomRight", "SVUI_QuestTracker", "Quest Tracker", [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-QUESTS]]); + + local scrollFrame = CreateFrame("ScrollFrame", "SVUI_QuestTrackerScrollFrame", self.Docklet); + scrollFrame:SetPoint("TOPLEFT", self.Docklet, "TOPLEFT", 4, -2); + scrollFrame:SetPoint("BOTTOMRIGHT", self.Docklet, "BOTTOMRIGHT", -30, 2); + scrollFrame:EnableMouseWheel(true); + scrollFrame.MaxVal = 420; + + local scrollBar = CreateFrame("Slider", "SVUI_QuestTrackerScrollFrameScrollBar", scrollFrame); + scrollBar:SetHeight(scrollFrame:GetHeight()); + scrollBar:SetWidth(18); + scrollBar:SetPoint("TOPRIGHT", self.Docklet, "TOPRIGHT", -4, -2); + scrollBar:SetBackdrop({bgFile = bgTex, edgeFile = bdTex, edgeSize = 4, insets = {left = 3, right = 3, top = 3, bottom = 3}}); + scrollBar:SetFrameLevel(6) + scrollBar:SetStylePanel("Fixed", "Transparent", true); + scrollBar:SetThumbTexture("Interface\\Buttons\\UI-ScrollBar-Knob"); + scrollBar:SetOrientation("VERTICAL"); + scrollBar:SetValueStep(5); + scrollBar:SetMinMaxValues(1, 420); + scrollBar:SetValue(1); + scrollBar:SetScript("OnValueChanged", function(self, argValue) + SVUI_QuestTrackerScrollFrame:SetVerticalScroll(argValue) end) - listFrame.slider = scrollFrame; - listFrame:SetScript("OnMouseWheel", function(self, delta) + local scrollChild = CreateFrame("Frame", "SVUI_QuestTrackerScrollFrameScrollChild", scrollFrame); + scrollChild:SetWidth(scrollFrame:GetWidth()); + scrollChild:SetClampedToScreen(false) + scrollChild:SetHeight(500) + scrollChild:SetPoint("TOPRIGHT", scrollFrame, "TOPRIGHT", -2, 0) + scrollChild:SetFrameLevel(scrollFrame:GetFrameLevel() + 1) + + scrollFrame:SetScrollChild(scrollChild); + scrollFrame.ScrollBar = scrollBar; + scrollFrame.ScrollChild = scrollChild; + scrollFrame:SetScript("OnMouseWheel", function(self, delta) local scroll = self:GetVerticalScroll(); local value = (scroll - (20 * delta)); if value < -1 then value = 0 end - if value > 420 then - value = 420 + if value > self.MaxVal then + value = self.MaxVal end - --self:SetVerticalScroll(value) - self.slider:SetValue(value) + self:SetVerticalScroll(value) + self.ScrollBar:SetValue(value) end) - local scrollChild = CreateFrame("Frame", nil, listFrame) - scrollChild:SetWidth(WIDTH); - scrollChild:SetClampedToScreen(false) - scrollChild:SetHeight(500) - scrollChild:SetPoint("TOPRIGHT", listFrame, "TOPRIGHT", -2, 0) - scrollChild:SetFrameLevel(listFrame:GetFrameLevel() + 1) - - local quests = CreateFrame("Frame", nil, scrollChild) - quests:SetWidth(WIDTH - 4); - quests:SetHeight(20); - quests:SetPoint("TOP", scrollChild, "TOP", 0, -2); - - quests.Header = CreateFrame("Frame", nil, quests) - quests.Header:SetPoint("TOPLEFT", quests, "TOPLEFT", 2, -2); - quests.Header:SetPoint("TOPRIGHT", quests, "TOPRIGHT", -2, -2); - quests.Header:SetHeight(20); - quests.Header:SetPanelTemplate("Headline") - - quests.Title = quests.Header:CreateFontString(nil,"OVERLAY") - quests.Title:SetFont(SV.Media.font.roboto, 14, "NONE") - quests.Title:SetShadowOffset(-1,-1) - quests.Title:SetShadowColor(0,0,0,0.5) - quests.Title:SetText(TRACKER_HEADER_QUESTS) - quests.Title:SetAllPoints(quests.Header) - - quests[1] = CreateTrackerLine(quests, quests, WIDTH) - for i = 2, 25 do - quests[i] = CreateTrackerLine(quests, quests[i - 1], WIDTH) - end - - -- local achievements = CreateFrame("Frame", nil, scrollChild, "SVUI_QuestTrackerHeaderTemplate") - -- achievements:SetWidth(WIDTH - 4); - -- achievements:SetHeight(20); - -- achievements:SetPoint("TOP", quests[25], "BOTTOM", 0, -2); - -- achievements.Text:SetText(TRACKER_HEADER_ACHIEVEMENTS); - -- achievements[1] = CreateTrackerLine(achievements, achievements) - -- for i = 2, 10 do - -- achievements[i] = CreateTrackerLine(achievements, achievements[i - 1]) - -- end - - -- local scenarios = CreateFrame("Frame", nil, scrollChild, "SVUI_QuestTrackerHeaderTemplate") - -- scenarios:SetWidth(WIDTH - 4); - -- scenarios:SetHeight(20); - -- scenarios:SetPoint("TOP", achievements[10], "BOTTOM", 0, -2); - -- scenarios.Text:SetText(TRACKER_HEADER_SCENARIO); - -- scenarios[1] = CreateTrackerLine(scenarios, scenarios) - -- scenarios[2] = CreateTrackerLine(scenarios, scenarios[1]) - -- scenarios[3] = CreateTrackerLine(scenarios, scenarios[2]) - - listFrame:SetScrollChild(scrollChild) - - self.Tracker.Quest = quests; - --self.Tracker.Achievement = achievements; - --self.Tracker.Scenario = scenarios; - - self.Tracker.DockButton:MakeDefault(); - self.Tracker:Show(); - --self.Tracker:SetScript('OnShow', ShowSubDocklet); - --self.Tracker:SetScript('OnHide', HideSubDocklet); - - --self:InitializeButton() - - -- self.Tracker:RegisterEvent("QUEST_LOG_UPDATE"); - -- self.Tracker:RegisterEvent("TRACKED_ACHIEVEMENT_LIST_CHANGED"); - -- self.Tracker:RegisterEvent("QUEST_WATCH_LIST_CHANGED"); - -- self.Tracker:RegisterEvent("QUEST_AUTOCOMPLETE"); - -- self.Tracker:RegisterEvent("QUEST_ACCEPTED"); - -- self.Tracker:RegisterEvent("SUPER_TRACKED_QUEST_CHANGED"); - -- self.Tracker:RegisterEvent("SCENARIO_UPDATE"); - -- self.Tracker:RegisterEvent("SCENARIO_CRITERIA_UPDATE"); - -- self.Tracker:RegisterEvent("TRACKED_ACHIEVEMENT_UPDATE"); - -- self.Tracker:RegisterEvent("ZONE_CHANGED_NEW_AREA"); - -- self.Tracker:RegisterEvent("ZONE_CHANGED"); - -- self.Tracker:RegisterEvent("QUEST_POI_UPDATE"); - -- self.Tracker:RegisterEvent("VARIABLES_LOADED"); - -- self.Tracker:RegisterEvent("QUEST_TURNED_IN"); - -- self.Tracker:RegisterEvent("PLAYER_MONEY"); - -- self.Tracker:SetScript("OnEvent", TrackerFrame_OnEvent); - - ObjectiveTrackerFrame:HookScript("OnEvent", MOD.UpdateTracker) - - self.Tracker.initialized = true; + self.Docklet.ScrollFrame = scrollFrame; + self:UpdateLocals(); + + self.ClosestQuest = 0; + self.CurrentQuest = 0; + self.Headers = {} + + self:InitializePopups() + self:InitializeActive() + self:InitializeScenarios() + self:InitializeQuestItem() + self:InitializeBonuses() + self:InitializeQuests() + self:InitializeAchievements() + + self:UpdateDimensions(); + self.Docklet.DockButton:MakeDefault(); + self.Docklet:Show(); + + ObjectiveTrackerFrame:UnregisterAllEvents(); + ObjectiveTrackerFrame:SetParent(SV.Hidden); + + self.Headers["Popups"]:Refresh() end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/quest/SVQuest.xml b/Interface/AddOns/SVUI/packages/quest/SVQuest.xml index 80e71c8..842eb62 100644 --- a/Interface/AddOns/SVUI/packages/quest/SVQuest.xml +++ b/Interface/AddOns/SVUI/packages/quest/SVQuest.xml @@ -1,67 +1,10 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> - - <Frame name="SVUI_QuestTrackerHeaderTemplate" virtual="true" hidden="true"> - <Size x="235" y="25"/> - <Layers> - <Layer level="ARTWORK"> - <FontString parentKey="Text" inherits="GameFontNormalMed2" justifyH="LEFT"> - <Size x="170" y="16"/> - <Anchors> - <Anchor point="LEFT" x="4" y="-1"/> - </Anchors> - </FontString> - <Texture parentKey="LineGlow" hidden="false" alpha="0" alphaMode="ADD" atlas="OBJFX_LineGlow" useAtlasSize="true"> - <Anchors> - <Anchor point="LEFT" relativeKey="$parent.Background" x="-50" y="18"/> - </Anchors> - </Texture> - <Texture parentKey="SoftGlow" hidden="false" alpha="0" alphaMode="ADD" atlas="OBJFX_Glow" useAtlasSize="true"> - <Anchors> - <Anchor point="CENTER" relativeKey="$parent.Background" relativePoint="LEFT" x="20" y="20"/> - </Anchors> - </Texture> - <Texture parentKey="StarBurst" hidden="false" alpha="0" alphaMode="ADD" atlas="OBJFX_StarBurst" useAtlasSize="true"> - <Anchors> - <Anchor point="CENTER" relativeKey="$parent.SoftGlow"/> - </Anchors> - </Texture> - <Texture parentKey="LineSheen" hidden="false" alpha="0" alphaMode="ADD" atlas="OBJFX_LineBurst"> - <Size x="60" y="15"/> - <Anchors> - <Anchor point="CENTER" relativeKey="$parent.SoftGlow" x="0" y="-13"/> - </Anchors> - </Texture> - </Layer> - </Layers> - <Animations> - <AnimationGroup parentKey="HeaderOpenAnim" setToFinalAlpha="true"> - <Alpha childKey="LineGlow" duration="0.15" order="1" fromAlpha="0" toAlpha="1"/> - <Alpha childKey="LineGlow" startDelay="0.25" duration="0.65" order="1" fromAlpha="1" toAlpha="0"/> - <Scale childKey="LineGlow" duration="0.15" order="1" fromScaleX="0.1" fromScaleY="1.5" toScaleX="2" toScaleY="1.5"> - <Origin point="CENTER"> - <Offset x="-50" y="0"/> - </Origin> - </Scale> - <Translation childKey="LineGlow" duration="0.75" order="1" offsetX="50" offsetY="0"/> - <Alpha childKey="SoftGlow" duration="0.25" order="1" fromAlpha="0" toAlpha="1"/> - <Alpha childKey="SoftGlow" startDelay="0.25" duration="0.5" order="1" fromAlpha="1" toAlpha="0"/> - <Scale childKey="SoftGlow" duration="0.25" order="1" fromScaleX="0.5" fromScaleY="0.5" toScaleX="0.8" toScaleY="0.8"/> - <Alpha childKey="StarBurst" duration="0.25" order="1" fromAlpha="0" toAlpha="1"/> - <Alpha childKey="StarBurst" startDelay="0.25" duration="0.5" order="1" fromAlpha="1" toAlpha="0"/> - <Scale childKey="StarBurst" duration="0.25" order="1" fromScaleX="0.5" fromScaleY="0.5" toScaleX="1" toScaleY="1"/> - <Alpha childKey="LineSheen" startDelay="0.15" duration="0.5" order="1" fromAlpha="0" toAlpha="0.75"/> - <Alpha childKey="LineSheen" startDelay="0.75" duration="0.5" order="1" fromAlpha="0.75" toAlpha="0"/> - <Translation childKey="LineSheen" startDelay="0.15" duration="1.5" order="1" offsetX="250" offsetY="0"/> - <Scripts> - <OnFinished> - local header = self:GetParent(); - header.animating = false; - </OnFinished> - </Scripts> - </AnimationGroup> - </Animations> - </Frame> - <Script file='SVQuest.lua'/> <Script file='components\button.lua'/> + <Script file='components\popups.lua'/> + <Script file='components\active.lua'/> + <Script file='components\scenario.lua'/> + <Script file='components\quests.lua'/> + <Script file='components\bonus.lua'/> + <Script file='components\achievements.lua'/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/quest/components/achievements.lua b/Interface/AddOns/SVUI/packages/quest/components/achievements.lua new file mode 100644 index 0000000..9dd5334 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/quest/components/achievements.lua @@ -0,0 +1,346 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local string = _G.string; +local math = _G.math; +local table = _G.table; +--[[ STRING METHODS ]]-- +local format = string.format; +--[[ MATH METHODS ]]-- +local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; +--[[ TABLE METHODS ]]-- +local tremove, twipe = table.remove, table.wipe; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local LSM = LibStub("LibSharedMedia-3.0") +local MOD = SV.SVQuest; +--[[ +########################################################## +LOCALS +########################################################## +]]-- +local ROW_WIDTH = 300; +local ROW_HEIGHT = 20; +local INNER_HEIGHT = ROW_HEIGHT - 4; +local LARGE_ROW_HEIGHT = ROW_HEIGHT * 2; +local LARGE_INNER_HEIGHT = LARGE_ROW_HEIGHT - 4; + +local NO_ICON = [[Interface\AddOns\SVUI\assets\artwork\Template\EMPTY]]; +local OBJ_ICON_ACTIVE = [[Interface\COMMON\Indicator-Yellow]]; +local OBJ_ICON_COMPLETE = [[Interface\COMMON\Indicator-Green]]; +local OBJ_ICON_INCOMPLETE = [[Interface\COMMON\Indicator-Gray]]; + +local LINE_ACHIEVEMENT_ICON = [[Interface\ICONS\Achievement_General]]; +--[[ +########################################################## +SCRIPT HANDLERS +########################################################## +]]-- +local RowButton_OnEnter = function(self, ...) + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) + GameTooltip:ClearLines() + GameTooltip:AddLine("View this in the achievements window.") + GameTooltip:Show() +end + +local RowButton_OnLeave = function(self, ...) + GameTooltip:Hide() +end + +local ViewButton_OnClick = function(self, button) + local achievementID = self:GetID(); + if(achievementID and (achievementID ~= 0)) then + if(IsModifiedClick("CHATLINK") and ChatEdit_GetActiveWindow()) then + local achievementLink = GetAchievementLink(achievementID); + if(achievementLink) then + ChatEdit_InsertLink(achievementLink); + end + else + CloseDropDownMenus(); + if(not AchievementFrame ) then + AchievementFrame_LoadUI(); + end + if(IsModifiedClick("QUESTWATCHTOGGLE") ) then + AchievementObjectiveTracker_UntrackAchievement(_, achievementID); + elseif(not AchievementFrame:IsShown()) then + AchievementFrame_ToggleAchievementFrame(); + AchievementFrame_SelectAchievement(achievementID); + else + if(AchievementFrameAchievements.selection ~= achievementID) then + AchievementFrame_SelectAchievement(achievementID); + else + AchievementFrame_ToggleAchievementFrame(); + end + end + end + end +end +--[[ +########################################################## +TRACKER FUNCTIONS +########################################################## +]]-- +local GetAchievementRow = function(self, index) + if(not self.Rows[index]) then + local previousFrame = self.Rows[#self.Rows] + local index = #self.Rows + 1; + + local anchorFrame; + if(previousFrame and previousFrame.Objectives) then + anchorFrame = previousFrame.Objectives; + else + anchorFrame = self.Header; + end + + local row = CreateFrame("Frame", nil, self) + row:SetPoint("TOPLEFT", anchorFrame, "BOTTOMLEFT", 0, -2); + row:SetPoint("TOPRIGHT", anchorFrame, "BOTTOMRIGHT", 0, -2); + row:SetHeightToScale(ROW_HEIGHT); + + row.Badge = CreateFrame("Frame", nil, row) + row.Badge:SetPoint("TOPLEFT", row, "TOPLEFT", 2, -2); + row.Badge:SetSize(INNER_HEIGHT, INNER_HEIGHT); + row.Badge:SetStylePanel("Default", "Headline") + row.Badge.Icon = row.Badge:CreateTexture(nil,"OVERLAY") + row.Badge.Icon:SetAllPoints(row.Badge); + row.Badge.Icon:SetTexture(LINE_ACHIEVEMENT_ICON) + row.Badge.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + + row.Header = CreateFrame("Frame", nil, row) + row.Header:SetPoint("TOPLEFT", row.Badge, "TOPRIGHT", 2, 0); + row.Header:SetPoint("TOPRIGHT", row, "TOPRIGHT", -2, 0); + row.Header:SetHeightToScale(INNER_HEIGHT); + row.Header.Text = row.Header:CreateFontString(nil,"OVERLAY") + row.Header.Text:SetFont(SV.Media.font.default, 13, "NONE") + row.Header.Text:SetTextColor(1,1,0) + row.Header.Text:SetShadowOffset(-1,-1) + row.Header.Text:SetShadowColor(0,0,0,0.5) + row.Header.Text:SetJustifyH('LEFT') + row.Header.Text:SetJustifyV('MIDDLE') + row.Header.Text:SetText('') + row.Header.Text:SetPoint("TOPLEFT", row.Header, "TOPLEFT", 4, 0); + row.Header.Text:SetPoint("BOTTOMRIGHT", row.Header, "BOTTOMRIGHT", 0, 0); + + row.Button = CreateFrame("Button", nil, row.Header) + row.Button:SetAllPoints(row.Header); + row.Button:SetStylePanel("Button", "Headline", 1, 1, 1) + row.Button:SetID(0) + row.Button:RegisterForClicks("LeftButtonUp", "RightButtonUp") + row.Button:SetScript("OnClick", ViewButton_OnClick) + row.Button:SetScript("OnEnter", RowButton_OnEnter) + row.Button:SetScript("OnLeave", RowButton_OnLeave) + + row.Objectives = MOD:NewObjectiveHeader(row); + row.Objectives:SetPoint("TOPLEFT", row, "BOTTOMLEFT", 0, 0); + row.Objectives:SetPoint("TOPRIGHT", row, "BOTTOMRIGHT", 0, 0); + row.Objectives:SetHeightToScale(1); + + row.RowID = 0; + self.Rows[index] = row; + return row; + end + + return self.Rows[index]; +end + +local SetAchievementRow = function(self, index, title, details, icon, achievementID) + index = index + 1; + icon = icon or LINE_ACHIEVEMENT_ICON; + + local fill_height = 0; + local shown_objectives = 0; + local objective_rows = 0; + + local row = self:Get(index); + row.RowID = achievementID + row.Header.Text:SetText(title) + row.Badge.Icon:SetTexture(icon); + row.Badge:SetAlpha(1); + row.Button:Enable(); + row.Button:SetID(achievementID); + row:SetHeightToScale(ROW_HEIGHT); + row:FadeIn(); + row.Header:FadeIn(); + + local objective_block = row.Objectives; + local subCount = GetAchievementNumCriteria(achievementID); + + for i = 1, subCount do + local description, category, completed, quantity, totalQuantity, _, flags, assetID, quantityString, criteriaID, eligible, duration, elapsed = GetAchievementCriteriaInfo(achievementID, i); + if(not ((not completed) and (shown_objectives > 5))) then + if(shown_objectives == 5 and subCount > (6)) then + shown_objectives = shown_objectives + 1; + else + if(description and bit.band(flags, EVALUATION_TREE_FLAG_PROGRESS_BAR) == EVALUATION_TREE_FLAG_PROGRESS_BAR) then + if(string.find(strlower(quantityString), "interface\\moneyframe")) then + description = quantityString.."\n"..description; + else + description = string.gsub(quantityString, " / ", "/").." "..description; + end + else + if(category == CRITERIA_TYPE_ACHIEVEMENT and assetID) then + _, description = GetAchievementInfo(assetID); + end + end + shown_objectives = shown_objectives + 1; + end + if((not completed) and description and description ~= '') then + fill_height = fill_height + (INNER_HEIGHT + 2); + objective_rows = objective_block:SetInfo(objective_rows, description, completed) + if(duration and elapsed and elapsed < duration) then + fill_height = fill_height + (INNER_HEIGHT + 2); + objective_rows = objective_block:SetTimer(objective_rows, duration, elapsed); + end + end + end + end + + if(objective_rows > 0) then + objective_block:SetHeightToScale(fill_height); + objective_block:FadeIn(); + end + + fill_height = fill_height + (ROW_HEIGHT + 2); + + return index, fill_height; +end + +local RefreshAchievements = function(self, event, ...) + local list = { GetTrackedAchievements() }; + local fill_height = 0; + local rows = 0; + + if(#list > 0) then + for i = 1, #list do + local achievementID = list[i]; + local _, title, _, completed, _, _, _, details, _, icon, _, _, wasEarnedByMe = GetAchievementInfo(achievementID); + if(not wasEarnedByMe) then + local add_height = 0; + rows, add_height = self:Set(rows, title, details, icon, achievementID) + fill_height = fill_height + add_height + end + end + end + + if(rows == 0 or (fill_height <= 1)) then + self:SetHeight(1); + self.Header.Text:SetText(''); + self.Header:SetAlpha(0); + self:SetAlpha(0); + else + self:SetHeightToScale(fill_height + 2); + self.Header.Text:SetText(TRACKER_HEADER_ACHIEVEMENTS); + self:FadeIn(); + self.Header:FadeIn(); + end +end + +local ResetAchievementBlock = function(self) + for x = 1, #self.Rows do + local row = self.Rows[x] + if(row) then + row.RowID = 0; + row.Header.Text:SetText(''); + row.Header:SetAlpha(0); + row.Button:Disable(); + row.Button:SetID(0); + row.Badge.Icon:SetTexture(NO_ICON); + row.Badge:SetAlpha(0); + row:SetHeight(1); + row:SetAlpha(0); + row.Objectives:Reset(); + end + end +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +function MOD:UpdateAchievements(event, ...) + self.Headers["Achievements"]:Reset() + self.Headers["Achievements"]:Refresh(event, ...) + self:UpdateDimensions(); +end + +local function UpdateAchievementLocals(...) + ROW_WIDTH, ROW_HEIGHT, INNER_HEIGHT, LARGE_ROW_HEIGHT, LARGE_INNER_HEIGHT = ...; +end + +SV.Events:On("QUEST_UPVALUES_UPDATED", "UpdateAchievementLocals", UpdateAchievementLocals); + +function MOD:InitializeAchievements() + local scrollChild = self.Docklet.ScrollFrame.ScrollChild; + + local achievements = CreateFrame("Frame", nil, scrollChild) + achievements:SetWidth(ROW_WIDTH); + achievements:SetHeightToScale(ROW_HEIGHT); + achievements:SetPoint("TOPLEFT", self.Headers["Quests"], "BOTTOMLEFT", 0, -6); + + achievements.Header = CreateFrame("Frame", nil, achievements) + achievements.Header:SetPoint("TOPLEFT", achievements, "TOPLEFT", 2, -2); + achievements.Header:SetPoint("TOPRIGHT", achievements, "TOPRIGHT", -2, -2); + achievements.Header:SetHeightToScale(INNER_HEIGHT); + + achievements.Header.Text = achievements.Header:CreateFontString(nil,"OVERLAY") + achievements.Header.Text:SetPoint("TOPLEFT", achievements.Header, "TOPLEFT", 2, 0); + achievements.Header.Text:SetPoint("BOTTOMLEFT", achievements.Header, "BOTTOMLEFT", 2, 0); + achievements.Header.Text:SetFont(SV.Media.font.narrator, 16, "OUTLINE") + achievements.Header.Text:SetJustifyH('LEFT') + achievements.Header.Text:SetJustifyV('MIDDLE') + achievements.Header.Text:SetTextColor(0.28,0.75,1) + achievements.Header.Text:SetShadowOffset(-1,-1) + achievements.Header.Text:SetShadowColor(0,0,0,0.5) + achievements.Header.Text:SetText(TRACKER_HEADER_ACHIEVEMENTS) + + achievements.Header.Divider = achievements.Header:CreateTexture(nil, 'BACKGROUND'); + achievements.Header.Divider:SetPoint("TOPLEFT", achievements.Header.Text, "TOPRIGHT", -10, 0); + achievements.Header.Divider:SetPoint("BOTTOMRIGHT", achievements.Header, "BOTTOMRIGHT", 0, 0); + achievements.Header.Divider:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DROPDOWN-DIVIDER]]); + + achievements.Rows = {}; + + achievements.Get = GetAchievementRow; + achievements.Set = SetAchievementRow; + achievements.Refresh = RefreshAchievements; + achievements.Reset = ResetAchievementBlock; + + self.Headers["Achievements"] = achievements; + + self:RegisterEvent("TRACKED_ACHIEVEMENT_UPDATE", self.UpdateAchievements); + self:RegisterEvent("TRACKED_ACHIEVEMENT_LIST_CHANGED", self.UpdateAchievements); + + self.Headers["Achievements"]:Refresh() +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/quest/components/active.lua b/Interface/AddOns/SVUI/packages/quest/components/active.lua new file mode 100644 index 0000000..2dea86f --- /dev/null +++ b/Interface/AddOns/SVUI/packages/quest/components/active.lua @@ -0,0 +1,438 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local string = _G.string; +local math = _G.math; +local table = _G.table; +--[[ STRING METHODS ]]-- +local format = string.format; +--[[ MATH METHODS ]]-- +local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; +--[[ TABLE METHODS ]]-- +local tremove, twipe = table.remove, table.wipe; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local LSM = LibStub("LibSharedMedia-3.0") +local MOD = SV.SVQuest; +--[[ +########################################################## +LOCALS +########################################################## +]]-- +local ROW_WIDTH = 300; +local ROW_HEIGHT = 24; +local INNER_HEIGHT = ROW_HEIGHT - 4; +local LARGE_ROW_HEIGHT = ROW_HEIGHT * 2; +local LARGE_INNER_HEIGHT = LARGE_ROW_HEIGHT - 4; + +local OBJ_ICON_ACTIVE = [[Interface\COMMON\Indicator-Yellow]]; +local OBJ_ICON_COMPLETE = [[Interface\COMMON\Indicator-Green]]; +local OBJ_ICON_INCOMPLETE = [[Interface\COMMON\Indicator-Gray]]; + +local QUEST_ICON = [[Interface\AddOns\SVUI\assets\artwork\Quest\QUEST-INCOMPLETE-ICON]]; +local QUEST_ICON_COMPLETE = [[Interface\AddOns\SVUI\assets\artwork\Quest\QUEST-COMPLETE-ICON]]; + +local DEFAULT_COLOR = {r = 1, g = 0.68, b = 0.1} +--[[ +########################################################## +SCRIPT HANDLERS +########################################################## +]]-- +local ObjectiveTimer_OnUpdate = function(self, elapsed) + local statusbar = self.Timer.Bar + local timeNow = GetTime(); + local timeRemaining = statusbar.duration - (timeNow - statusbar.startTime); + statusbar:SetValue(timeRemaining); + if(timeRemaining < 0) then + -- hold at 0 for a moment + if(timeRemaining > -1) then + timeRemaining = 0; + else + self:StopTimer(); + end + end + local r,g,b = MOD:GetTimerTextColor(statusbar.duration, statusbar.duration - timeRemaining) + statusbar.Label:SetText(GetTimeStringFromSeconds(timeRemaining, nil, true)); + statusbar.Label:SetTextColor(r,g,b); +end + +local ObjectiveProgressBar_OnEvent = function(self, event, ...) + local statusbar = self.Progress.Bar; + local percent = 100; + if(not statusbar.finished) then + percent = GetQuestProgressBarPercent(statusbar.questID); + end + statusbar:SetValue(percent); + statusbar.Label:SetFormattedText(PERCENTAGE_STRING, percent); +end + +local ActiveButton_OnEnter = function(self, ...) + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) + GameTooltip:ClearLines() + GameTooltip:AddDoubleLine("[Left-Click]", "View the log entry for this quest.", 0, 1, 0, 1, 1, 1) + GameTooltip:AddLine(" ") + GameTooltip:AddDoubleLine("[Right-Click]", "Remove this quest from the tracker.", 0, 1, 0, 1, 1, 1) + GameTooltip:AddLine(" ") + GameTooltip:AddDoubleLine("[SHIFT+Click]", "Show this quest on the map.", 0, 1, 0, 1, 1, 1) + GameTooltip:Show() +end + +local ActiveButton_OnLeave = function(self, ...) + GameTooltip:Hide() +end + +local ActiveButton_OnClick = function(self, button) + MOD.Headers["Active"]:Unset(); +end + +local ViewButton_OnClick = function(self, button) + local questIndex = self:GetID(); + if(questIndex and (questIndex ~= 0)) then + local questID = select(8, GetQuestLogTitle(questIndex)); + if(IsModifiedClick("CHATLINK") and ChatEdit_GetActiveWindow()) then + local questLink = GetQuestLink(questIndex); + if(questLink) then + ChatEdit_InsertLink(questLink); + end + elseif(questID and IsShiftKeyDown()) then + QuestMapFrame_OpenToQuestDetails(questID); + elseif(questID and button ~= "RightButton") then + CloseDropDownMenus(); + if(IsQuestComplete(questID) and GetQuestLogIsAutoComplete(questIndex)) then + AutoQuestPopupTracker_RemovePopUp(questID); + ShowQuestComplete(questIndex); + else + QuestLogPopupDetailFrame_Show(questIndex); + end + elseif(questID) then + RemoveQuestWatch(questIndex); + if(questID == superTrackedQuestID) then + QuestSuperTracking_OnQuestUntracked(); + end + end + end +end + +local CloseButton_OnEnter = function(self) + self:SetBackdropBorderColor(0.1, 0.8, 0.8) +end + +local CloseButton_OnLeave = function(self) + self:SetBackdropBorderColor(0,0,0,1) +end +--[[ +########################################################## +TRACKER FUNCTIONS +########################################################## +]]-- +local UnsetActiveData = function(self, bypass) + local block = self.Block; + block:SetHeight(1); + block.Header.Text:SetText(''); + block.Header.Level:SetText(''); + block.Badge.Icon:SetTexture(0,0,0,0); + block.Button:SetID(0); + self.ActiveQuestID = 0; + MOD.ActiveQuestID = self.ActiveQuestID; + MOD.CurrentQuest = 0; + block.Objectives:Reset(); + self:SetHeight(1); + block:SetAlpha(0); + self:SetAlpha(0); + if(not bypass and MOD.Headers["Quests"]) then + MOD:UpdateObjectives('FORCED_UPDATE') + end +end + +local SetActiveData = function(self, title, level, icon, questID, questLogIndex, numObjectives, duration, elapsed, isComplete) + self.ActiveQuestID = questID; + MOD.ActiveQuestID = self.ActiveQuestID; + local fill_height = 0; + local objective_rows = 0; + local block = self.Block; + + local color = DEFAULT_COLOR + if(level and type(level) == 'number') then + color = GetQuestDifficultyColor(level); + end + block.Header.Level:SetTextColor(color.r, color.g, color.b); + block.Header.Level:SetText(level); + block.Header.Text:SetText(title); + block.Button:SetID(questLogIndex); + + MOD.CurrentQuest = questLogIndex; + + local objective_block = block.Objectives; + objective_block:Reset(); + for i = 1, numObjectives do + local description, category, completed = GetQuestObjectiveInfo(questID, i); + if(not completed) then isComplete = false end + if(duration and elapsed and (elapsed < duration)) then + objective_rows = objective_block:SetTimer(objective_rows, duration, elapsed); + fill_height = fill_height + (INNER_HEIGHT + 2); + elseif(description and description ~= '') then + objective_rows = objective_block:SetInfo(objective_rows, description, completed); + fill_height = fill_height + (INNER_HEIGHT + 2); + end + end + + if(objective_rows > 0) then + objective_block:SetHeightToScale(fill_height); + objective_block:FadeIn(); + end + + fill_height = fill_height + ((INNER_HEIGHT + 4) + (LARGE_ROW_HEIGHT + 8)); + block:SetHeightToScale(fill_height); + + MOD.Docklet.ScrollFrame.ScrollBar:SetValue(0); + + if(isComplete) then + icon = QUEST_ICON_COMPLETE; + else + icon = icon or QUEST_ICON; + end + block.Badge.Icon:SetTexture(icon); + + local link, texture, _, showCompleted = GetQuestLogSpecialItemInfo(questLogIndex) + if(link) then + if(MOD.QuestItem:SetAbility(link, texture)) then + MOD.QuestItem.CurrentQuest = questLogIndex + end + end + + if(self.Block.Badge.PostUpdate) then + self.Block.Badge:PostUpdate(questID) + end + + self:RefreshHeight() +end + +local RefreshActiveHeight = function(self) + if(self.ActiveQuestID == 0) then + self:Unset() + else + self:FadeIn(); + self.Block:FadeIn(); + self:SetHeight(self.Block:GetHeight()) + end +end + +local RefreshActiveObjective = function(self, event, ...) + -- print('<-----ACTIVE') + -- print(event) + -- print(...) + if(event) then + if(event == 'ACTIVE_QUEST_LOADED') then + self.ActiveQuestID = 0; + self:Set(...) + elseif(event == 'SUPER_TRACKED_QUEST_CHANGED') then + local questID = ...; + if(questID and questID ~= self.ActiveQuestID) then + local questLogIndex = GetQuestLogIndexByID(questID) + if(questLogIndex) then + local questWatchIndex = GetQuestWatchIndex(questLogIndex) + if(questWatchIndex) then + local title, level, suggestedGroup = GetQuestLogTitle(questLogIndex) + local questID, _, questLogIndex, numObjectives, requiredMoney, completed, startEvent, isAutoComplete, duration, elapsed, questType, isTask, isStory, isOnMap, hasLocalPOI = GetQuestWatchInfo(questWatchIndex); + self:Set(title, level, nil, questID, questLogIndex, numObjectives, duration, elapsed, hasLocalPOI) + end + end + end + elseif(event == 'FORCED_UPDATE') then + local questID = self.ActiveQuestID; + if(questID and questID ~= 0) then + local questLogIndex = GetQuestLogIndexByID(questID) + if(questLogIndex) then + local questWatchIndex = GetQuestWatchIndex(questLogIndex) + if(questWatchIndex) then + local title, level, suggestedGroup = GetQuestLogTitle(questLogIndex) + local questID, _, questLogIndex, numObjectives, requiredMoney, completed, startEvent, isAutoComplete, duration, elapsed, questType, isTask, isStory, isOnMap, hasLocalPOI = GetQuestWatchInfo(questWatchIndex); + self:Set(title, level, nil, questID, questLogIndex, numObjectives, duration, elapsed, hasLocalPOI) + end + end + end + end + end +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +function MOD:CheckActiveQuest(questID, ...) + if(questID and self.Headers["Active"].ActiveQuestID == questID) then + self.Headers["Active"]:Unset(true); + else + local currentQuestIndex = self.CurrentQuest; + if(currentQuestIndex and (currentQuestIndex ~= 0)) then + local questLogIndex = select(5, ...); + if(questLogIndex and (questLogIndex == currentQuestIndex)) then + self.Headers["Active"]:Set(...); + return true; + end + end + end + return false; +end + +function MOD:UpdateActiveObjective(event, ...) + self.Headers["Active"]:Refresh(event, ...) + self:UpdateDimensions(); +end + +local function UpdateActiveLocals(...) + ROW_WIDTH, ROW_HEIGHT, INNER_HEIGHT, LARGE_ROW_HEIGHT, LARGE_INNER_HEIGHT = ...; +end + +SV.Events:On("QUEST_UPVALUES_UPDATED", "UpdateActiveLocals", UpdateActiveLocals); + +function MOD:InitializeActive() + local scrollChild = self.Docklet.ScrollFrame.ScrollChild; + + local active = CreateFrame("Frame", nil, scrollChild) + active:SetWidth(ROW_WIDTH); + active:SetHeight(1); + active:SetPoint("TOPLEFT", self.Headers["Popups"], "BOTTOMLEFT", 0, 0); + + local block = CreateFrame("Frame", nil, active) + block:SetPointToScale("TOPLEFT", active, "TOPLEFT", 2, -4); + block:SetPointToScale("TOPRIGHT", active, "TOPRIGHT", -2, -4); + block:SetHeightToScale(LARGE_ROW_HEIGHT); + + block.Top = CreateFrame("Frame", nil, block) + block.Top:SetPoint("TOPLEFT", block, "TOPLEFT", 2, -2); + block.Top:SetPoint("TOPRIGHT", block, "TOPRIGHT", -2, -2); + block.Top:SetHeightToScale(INNER_HEIGHT); + + block.Top.Text = block.Top:CreateFontString(nil,"OVERLAY") + block.Top.Text:SetPoint("TOPLEFT", block.Top, "TOPLEFT", 2, 0); + block.Top.Text:SetPoint("BOTTOMLEFT", block.Top, "BOTTOMLEFT", 2, 0); + block.Top.Text:SetFont(SV.Media.font.narrator, 16, "OUTLINE") + block.Top.Text:SetJustifyH('LEFT') + block.Top.Text:SetJustifyV('MIDDLE') + block.Top.Text:SetTextColor(0.28,0.75,1) + block.Top.Text:SetShadowOffset(-1,-1) + block.Top.Text:SetShadowColor(0,0,0,0.5) + block.Top.Text:SetText("Now Tracking...") + + block.CloseButton = CreateFrame("Button", nil, block.Top, "UIPanelCloseButton") + block.CloseButton:RemoveTextures() + block.CloseButton:SetStylePanel("Button", nil, 1, -7, -7, nil, "red") + block.CloseButton:SetFrameLevel(block.CloseButton:GetFrameLevel() + 4) + block.CloseButton:SetNormalTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\CLOSE-BUTTON]]) + block.CloseButton:HookScript("OnEnter", CloseButton_OnEnter) + block.CloseButton:HookScript("OnLeave", CloseButton_OnLeave) + block.CloseButton:SetPointToScale("TOPRIGHT", block.Top, "TOPRIGHT", 8, 8); + block.CloseButton:RegisterForClicks("LeftButtonUp", "RightButtonUp") + block.CloseButton.Parent = active; + block.CloseButton:SetScript("OnClick", ActiveButton_OnClick) + + block.Top.Divider = block.Top:CreateTexture(nil, 'BACKGROUND'); + block.Top.Divider:SetPoint("TOPLEFT", block.Top.Text, "TOPRIGHT", -10, 0); + block.Top.Divider:SetPoint("BOTTOMRIGHT", block.Top, "BOTTOMRIGHT", 0, 0); + block.Top.Divider:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DROPDOWN-DIVIDER]]); + + block.Button = CreateFrame("Button", nil, block) + block.Button:SetPointToScale("TOPLEFT", block, "TOPLEFT", 0, 0); + block.Button:SetPointToScale("BOTTOMRIGHT", block, "BOTTOMRIGHT", 0, 8); + block.Button:SetStylePanel("Framed", "Headline") + block.Button:SetPanelColor("gold") + block.Button:SetID(0) + block.Button.Parent = active; + block.Button:SetScript("OnClick", ViewButton_OnClick) + block.Button:SetScript("OnEnter", ActiveButton_OnEnter) + block.Button:SetScript("OnLeave", ActiveButton_OnLeave) + + block.Badge = CreateFrame("Frame", nil, block.Button) + block.Badge:SetPointToScale("TOPLEFT", block.Top, "BOTTOMLEFT", 4, -4); + block.Badge:SetSizeToScale((LARGE_INNER_HEIGHT - 4), (LARGE_INNER_HEIGHT - 4)); + block.Badge:SetStylePanel("Fixed", "Inset") + + block.Badge.Icon = block.Badge:CreateTexture(nil,"OVERLAY") + block.Badge.Icon:SetAllPointsIn(block.Badge); + block.Badge.Icon:SetTexture(QUEST_ICON) + block.Badge.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + if(SV.AddQuestCompass) then + SV:AddQuestCompass(block, block.Badge, (LARGE_INNER_HEIGHT - 4)) + end + + block.Header = CreateFrame("Frame", nil, block.Button) + block.Header:SetPointToScale("TOPLEFT", block.Badge, "TOPRIGHT", 4, -1); + block.Header:SetPointToScale("TOPRIGHT", block.Top, "BOTTOMRIGHT", -4, 0); + block.Header:SetHeightToScale(INNER_HEIGHT); + block.Header:SetStylePanel("Default", "Headline") + + block.Header.Level = block.Header:CreateFontString(nil,"OVERLAY") + block.Header.Level:SetFont(SV.Media.font.default, 12, "NONE") + block.Header.Level:SetShadowOffset(-1,-1) + block.Header.Level:SetShadowColor(0,0,0,0.5) + block.Header.Level:SetJustifyH('LEFT') + block.Header.Level:SetJustifyV('MIDDLE') + block.Header.Level:SetText('') + block.Header.Level:SetPointToScale("TOPLEFT", block.Header, "TOPLEFT", 4, 0); + block.Header.Level:SetPointToScale("BOTTOMLEFT", block.Header, "BOTTOMLEFT", 4, 0); + + block.Header.Text = block.Header:CreateFontString(nil,"OVERLAY") + block.Header.Text:SetFont(SV.Media.font.default, 13, "NONE") + block.Header.Text:SetTextColor(1,1,0) + block.Header.Text:SetShadowOffset(-1,-1) + block.Header.Text:SetShadowColor(0,0,0,0.5) + block.Header.Text:SetJustifyH('LEFT') + block.Header.Text:SetJustifyV('MIDDLE') + block.Header.Text:SetText('') + block.Header.Text:SetPointToScale("TOPLEFT", block.Header.Level, "TOPRIGHT", 4, 0); + block.Header.Text:SetPointToScale("BOTTOMRIGHT", block.Header, "BOTTOMRIGHT", 0, 0); + + block.Objectives = MOD:NewObjectiveHeader(block); + block.Objectives:SetPointToScale("TOPLEFT", block.Header, "BOTTOMLEFT", 0, -2); + block.Objectives:SetPointToScale("TOPRIGHT", block.Header, "BOTTOMRIGHT", 0, -2); + block.Objectives:SetHeightToScale(1); + + active.Block = block; + + active.ActiveQuestID = 0; + active.Set = SetActiveData; + active.Unset = UnsetActiveData; + active.Refresh = RefreshActiveObjective; + active.RefreshHeight = RefreshActiveHeight; + + self.Headers["Active"] = active; + + self.Headers["Active"]:RefreshHeight() + + self.ActiveQuestID = self.Headers["Active"].ActiveQuestID; + + self:RegisterEvent("SUPER_TRACKED_QUEST_CHANGED", self.UpdateActiveObjective); +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/quest/components/bonus.lua b/Interface/AddOns/SVUI/packages/quest/components/bonus.lua new file mode 100644 index 0000000..81f8bc8 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/quest/components/bonus.lua @@ -0,0 +1,478 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local string = _G.string; +local math = _G.math; +local table = _G.table; +--[[ STRING METHODS ]]-- +local format = string.format; +--[[ MATH METHODS ]]-- +local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; +--[[ TABLE METHODS ]]-- +local tremove, twipe = table.remove, table.wipe; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local LSM = LibStub("LibSharedMedia-3.0") +local MOD = SV.SVQuest; +--[[ +########################################################## +LOCALS +########################################################## +]]-- +local ROW_WIDTH = 300; +local ROW_HEIGHT = 24; +local INNER_HEIGHT = ROW_HEIGHT - 4; +local LARGE_ROW_HEIGHT = ROW_HEIGHT * 2; +local LARGE_INNER_HEIGHT = LARGE_ROW_HEIGHT - 4; + +local NO_ICON = [[Interface\AddOns\SVUI\assets\artwork\Template\EMPTY]]; +local OBJ_ICON_ACTIVE = [[Interface\COMMON\Indicator-Yellow]]; +local OBJ_ICON_COMPLETE = [[Interface\COMMON\Indicator-Green]]; +local OBJ_ICON_INCOMPLETE = [[Interface\COMMON\Indicator-Gray]]; + +local QUEST_ICON = [[Interface\AddOns\SVUI\assets\artwork\Quest\QUEST-INCOMPLETE-ICON]]; +local QUEST_ICON_COMPLETE = [[Interface\AddOns\SVUI\assets\artwork\Quest\QUEST-COMPLETE-ICON]]; + +local CACHED_BONUS_DATA = {}; +local COMPLETED_BONUS_DATA = {}; +--[[ +########################################################## +DATA CACHE HANDLERS +########################################################## +]]-- +local function CacheBonusData(questID, xp, money) + if(not questID or (questID and questID <= 0)) then return; end + + local data = {}; + data.objectives = {}; + local isInArea, isOnMap, numObjectives = GetTaskInfo(questID); + local iscomplete = true; + for objectiveIndex = 1, numObjectives do + local text, objectiveType, finished = GetQuestObjectiveInfo(questID, objectiveIndex); + if not finished then iscomplete = false end + tinsert(data.objectives, text); + data.objectiveType = objectiveType; + end + + data.rewards = {}; + if(not xp) then + xp = GetQuestLogRewardXP(questID); + end + if(xp > 0 and UnitLevel("player") < MAX_PLAYER_LEVEL) then + local t = {}; + t.label = xp; + t.texture = "Interface\\Icons\\XP_Icon"; + t.count = 0; + t.font = "NumberFontNormal"; + tinsert(data.rewards, t); + end + + local numCurrencies = GetNumQuestLogRewardCurrencies(questID); + for i = 1, numCurrencies do + local name, texture, count = GetQuestLogRewardCurrencyInfo(i, questID); + local t = {}; + t.label = name; + t.texture = texture; + t.count = count; + t.font = "GameFontHighlightSmall"; + tinsert(data.rewards, t); + end + + local numItems = GetNumQuestLogRewards(questID); + for i = 1, numItems do + local name, texture, count, quality, isUsable = GetQuestLogRewardInfo(i, questID); + local t = {}; + t.label = name; + t.texture = texture; + t.count = count; + t.font = "GameFontHighlightSmall"; + tinsert(data.rewards, t); + end + + if(not money) then + money = GetQuestLogRewardMoney(questID); + end + if(money > 0) then + local t = {}; + t.label = GetMoneyString(money); + t.texture = "Interface\\Icons\\inv_misc_coin_01"; + t.count = 0; + t.font = "GameFontHighlight"; + tinsert(data.rewards, t); + end + CACHED_BONUS_DATA[questID] = data; + + if(iscomplete or #data.rewards <= 0) then + CACHED_BONUS_DATA[questID] = nil; + COMPLETED_BONUS_DATA[questID] = true; + end +end + +local function GetBonusCache() + local cache = GetTasksTable(); + for questID, data in pairs(CACHED_BONUS_DATA) do + if(questID > 0) then + local found = false; + for i = 1, #cache do + if(cache[i] == questID) then + found = true; + break; + end + end + if(not found) then + tinsert(cache, questID); + end + end + end + return cache; +end + +local function GetCachedTaskInfo(questID) + if(CACHED_BONUS_DATA[questID]) then + return true, true, #CACHED_BONUS_DATA[questID].objectives; + else + return GetTaskInfo(questID); + end +end + +local function GetCachedQuestObjectiveInfo(questID, objectiveIndex) + if(CACHED_BONUS_DATA[questID]) then + return CACHED_BONUS_DATA[questID].objectives[objectiveIndex], CACHED_BONUS_DATA[questID].objectiveType, true; + else + return GetQuestObjectiveInfo(questID, objectiveIndex); + end +end + +local function GetScenarioBonusStep(index) + local cachedObjectives = C_Scenario.GetSupersededObjectives(); + for i = 1, #cachedObjectives do + local pairs = cachedObjectives[i]; + local k,v = unpack(pairs); + if(v == index) then + return k; + end + end +end +--[[ +########################################################## +TRACKER FUNCTIONS +########################################################## +]]-- +local GetBonusRow = function(self, index) + if(not self.Rows[index]) then + local previousFrame = self.Rows[#self.Rows] + local index = #self.Rows + 1; + local yOffset = 0; + + local row = CreateFrame("Frame", nil, self) + if(previousFrame and previousFrame.Objectives) then + row:SetPoint("TOPLEFT", previousFrame.Objectives, "BOTTOMLEFT", 0, -6); + row:SetPoint("TOPRIGHT", previousFrame.Objectives, "BOTTOMRIGHT", 0, -6); + else + row:SetPoint("TOPLEFT", self, "TOPLEFT", 0, 0); + row:SetPoint("TOPRIGHT", self, "TOPRIGHT", 0, 0); + end + row:SetHeightToScale(ROW_HEIGHT); + + row.Header = CreateFrame("Frame", nil, row) + row.Header:SetPointToScale("TOPLEFT", row, "TOPLEFT", 2, -2); + row.Header:SetPointToScale("TOPRIGHT", row, "TOPRIGHT", -2, -2); + row.Header:SetHeightToScale(INNER_HEIGHT); + + row.Header.Text = row.Header:CreateFontString(nil,"OVERLAY") + row.Header.Text:SetFont(SV.Media.font.narrator, 16, "OUTLINE") + row.Header.Text:SetTextColor(0.2,0.75,1) + row.Header.Text:SetShadowOffset(-1,-1) + row.Header.Text:SetShadowColor(0,0,0,0.5) + row.Header.Text:SetJustifyH('LEFT') + row.Header.Text:SetJustifyV('MIDDLE') + row.Header.Text:SetText('') + row.Header.Text:SetPointToScale("TOPLEFT", row.Header, "TOPLEFT", 0, 0); + row.Header.Text:SetPointToScale("BOTTOMRIGHT", row.Header, "BOTTOMRIGHT", 0, 0); + + row.Objectives = MOD:NewObjectiveHeader(row); + row.Objectives:SetPointToScale("TOPLEFT", row, "BOTTOMLEFT", 0, 0); + row.Objectives:SetPointToScale("TOPRIGHT", row, "BOTTOMRIGHT", 0, 0); + row.Objectives:SetHeightToScale(1); + + row.RowID = 0; + + self.Rows[index] = row; + + return row; + end + + return self.Rows[index]; +end + +local SetCriteriaRow = function(self, index, bonusStepIndex, subCount, hasFailed) + index = index + 1 + local objective_rows = 0; + local fill_height = 0; + local iscomplete = true; + + local row = self:Get(index); + row.RowID = questID + row.Header.Text:SetText(TRACKER_HEADER_BONUS_OBJECTIVES) + row:SetHeightToScale(ROW_HEIGHT); + row:SetAlpha(1); + + local objective_block = row.Objectives; + objective_block:Reset() + + for i = 1, subCount do + local text, category, completed, quantity, totalQuantity, flags, assetID, quantityString, criteriaID, duration, elapsed, failed = C_Scenario.GetCriteriaInfoByStep(bonusStepIndex, i); + if(text and text ~= '') then + if not completed then iscomplete = false end + objective_rows = objective_block:SetInfo(objective_rows, text, completed, failed); + fill_height = fill_height + (INNER_HEIGHT + 2); + if(duration > 0 and elapsed <= duration and not (failed or completed)) then + objective_rows = objective_block:SetTimer(objective_rows, duration, elapsed); + fill_height = fill_height + (INNER_HEIGHT + 2); + end + end + end + + if(hasFailed) then + row.Header.Text:SetTextColor(1,0,0) + elseif(iscomplete) then + row.Header.Text:SetTextColor(0.1,0.9,0.1) + else + row.Header.Text:SetTextColor(1,1,1) + end + + if(objective_rows > 0) then + objective_block:SetHeightToScale(fill_height); + end + + fill_height = fill_height + (ROW_HEIGHT + 2); + + return index, fill_height; +end + +local SetBonusRow = function(self, index, questID, subCount) + index = index + 1 + local objective_rows = 0; + local fill_height = 0; + local iscomplete = true; + local row = self:Get(index); + local objective_block = row.Objectives; + + for i = 1, subCount do + local text, category, objective_completed = GetCachedQuestObjectiveInfo(questID, i); + if not objective_completed then iscomplete = false end + if(text and text ~= '') then + objective_rows = objective_block:SetInfo(objective_rows, text, objective_completed); + fill_height = fill_height + (INNER_HEIGHT + 2); + end + if(category and category == 'progressbar') then + objective_rows = objective_block:SetProgress(objective_rows, questID, objective_completed); + fill_height = fill_height + (INNER_HEIGHT + 2); + end + end + + if(not iscomplete) then + row.RowID = questID + row.Header.Text:SetText(TRACKER_HEADER_BONUS_OBJECTIVES) + row:SetHeightToScale(ROW_HEIGHT); + row:FadeIn(); + + if(objective_rows > 0) then + objective_block:SetHeightToScale(fill_height); + end + + fill_height = fill_height + (ROW_HEIGHT + 2); + + return index, fill_height; + else + CACHED_BONUS_DATA[questID] = nil; + COMPLETED_BONUS_DATA[questID] = true; + PlaySoundKitID(45142); + return index, 0; + end +end + +local UpdateBonusObjectives = function(self) + local fill_height = 0; + local rows = 0; + local ALL_EXIST = true; + + if(C_Scenario.IsInScenario()) then + local tblBonusSteps = C_Scenario.GetBonusSteps(); + local cachedToRemove = {}; + for i = 1, #tblBonusSteps do + local bonusStepIndex = tblBonusSteps[i]; + local cachedIndex = GetScenarioBonusStep(bonusStepIndex); + if(cachedIndex) then + local name, description, numCriteria, stepFailed, isBonusStep, isForCurrentStepOnly = C_Scenario.GetStepInfo(bonusStepIndex); + local completed = true; + for criteriaIndex = 1, numCriteria do + local criteriaString, criteriaType, criteriaCompleted, quantity, totalQuantity, flags, assetID, quantityString, criteriaID, duration, elapsed, criteriaFailed = C_Scenario.GetCriteriaInfoByStep(bonusStepIndex, criteriaIndex); + if(criteriaString) then + if(not criteriaCompleted) then + completed = false; + break; + end + end + end + if(not completed) then + tinsert(cachedToRemove, cachedIndex); + end + end + end + for i = 1, #cachedToRemove do + tDeleteItem(tblBonusSteps, cachedToRemove[i]); + end + + for i = 1, #tblBonusSteps do + local bonusStepIndex = tblBonusSteps[i]; + local name, description, numCriteria, stepFailed, isBonusStep, isForCurrentStepOnly = C_Scenario.GetStepInfo(bonusStepIndex); + local add_height = 0; + rows, add_height = self:SetCriteria(rows, bonusStepIndex, numCriteria, stepFailed) + fill_height = fill_height + add_height; + end + else + local cache = GetBonusCache(); + for i = 1, #cache do + local questID = cache[i]; + if(not COMPLETED_BONUS_DATA[questID]) then + local isInArea, isOnMap, numObjectives = GetCachedTaskInfo(questID); + local existingTask = CACHED_BONUS_DATA[questID] + if(not existingTask) then + ALL_EXIST = false; + end + if(isInArea or (isOnMap and existingTask)) then + local add_height = 0; + rows, add_height = self:SetBonus(rows, questID, numObjectives) + fill_height = fill_height + add_height; + end + end + end + end + + if(rows == 0 or (fill_height <= 1)) then + self:SetHeight(1); + self:SetAlpha(0); + self:Reset(); + else + self:SetHeightToScale(fill_height + 2); + self:FadeIn(); + if(not ALL_EXIST) then + PlaySound("UI_Scenario_Stage_End"); + --PlaySoundKitID(45142); + end + end +end + +local RefreshBonusObjectives = function(self, event, ...) + -- print('BONUS-------->') + -- print(event) + -- print(...) + if(event == "CRITERIA_COMPLETE") then + local id = ...; + if(id > 0) then + local tblBonusSteps = C_Scenario.GetBonusSteps(); + for i = 1, #tblBonusSteps do + local bonusStepIndex = tblBonusSteps[i]; + local _, _, numCriteria = C_Scenario.GetStepInfo(bonusStepIndex); + for criteriaIndex = 1, numCriteria do + local _, _, _, _, _, _, _, _, criteriaID = C_Scenario.GetCriteriaInfoByStep(bonusStepIndex, criteriaIndex); + if(id == criteriaID) then + local questID = C_Scenario.GetBonusStepRewardQuestID(bonusStepIndex); + if(questID ~= 0) then + CacheBonusData(questID); + return; + end + end + end + end + end + end + self:UpdateAll(); +end + +local ResetBonusBlock = function(self) + for x = 1, #self.Rows do + local row = self.Rows[x] + if(row) then + row.RowID = 0; + row.Header.Text:SetText(''); + row:SetHeight(1); + row:SetAlpha(0); + row.Objectives:Reset(); + end + end +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +function MOD:UpdateBonusObjective(event, ...) + self.Headers["Bonus"]:Reset() + self.Headers["Bonus"]:Refresh(event, ...) + self:UpdateDimensions(); +end + +function MOD:CacheBonusObjective(event, ...) + CacheBonusData(...) +end + +local function UpdateBonusLocals(...) + ROW_WIDTH, ROW_HEIGHT, INNER_HEIGHT, LARGE_ROW_HEIGHT, LARGE_INNER_HEIGHT = ...; +end + +SV.Events:On("QUEST_UPVALUES_UPDATED", "UpdateBonusLocals", UpdateBonusLocals); + +function MOD:InitializeBonuses() + local scrollChild = self.Docklet.ScrollFrame.ScrollChild; + local bonus = CreateFrame("Frame", nil, scrollChild) + bonus:SetWidth(ROW_WIDTH); + bonus:SetHeight(1); + bonus:SetPoint("TOPLEFT", self.Headers["Scenario"], "BOTTOMLEFT", 0, -4); + + bonus.Rows = {}; + + bonus.Get = GetBonusRow; + bonus.SetBonus = SetBonusRow; + bonus.SetCriteria = SetCriteriaRow; + bonus.Refresh = RefreshBonusObjectives; + bonus.Reset = ResetBonusBlock; + bonus.UpdateAll = UpdateBonusObjectives; + + self.Headers["Bonus"] = bonus + + self:RegisterEvent("CRITERIA_COMPLETE", self.UpdateBonusObjective); +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/quest/components/button.lua b/Interface/AddOns/SVUI/packages/quest/components/button.lua index 46b97a4..1119b26 100644 --- a/Interface/AddOns/SVUI/packages/quest/components/button.lua +++ b/Interface/AddOns/SVUI/packages/quest/components/button.lua @@ -12,6 +12,12 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # ############################################################################## S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## + +QUEST TRACKER BUTTON: + +Originally "ExtraQuestButton" by p3lim, +modified/minimally re-written for SVUI by Munglunch + ########################################################## LOCALIZED LUA FUNCTIONS ########################################################## @@ -48,252 +54,71 @@ local LSM = LibStub("LibSharedMedia-3.0") local MOD = SV.SVQuest; --[[ ########################################################## -EXTRA QUEST ITEM BUTTON +LOCALS ########################################################## ]]-- -local Button = CreateFrame('Button', (...), UIParent, 'SecureActionButtonTemplate, SecureHandlerStateTemplate, SecureHandlerAttributeTemplate') -Button:SetPoint('CENTER', UIParent, 'CENTER', 0, 0) -Button:SetSize(50,50) -Button:SetHighlightTexture([[Interface\Buttons\ButtonHilight-Square]]) -Button:SetPushedTexture([[Interface\Buttons\CheckButtonHilight]]) -Button:GetPushedTexture():SetBlendMode('ADD') -Button:SetScript('OnLeave', GameTooltip_Hide) -Button:SetAttribute('type', 'item') -Button.updateTimer = 0 -Button.rangeTimer = 0 ---Button:Hide() -Button.updateTimer = 0 -Button.rangeTimer = 0 -RegisterStateDriver(Button, 'visible', '[extrabar] hide; show') -Button:SetAttribute('_onattributechanged', [[ - if(name == 'item') then - if(value and not self:IsShown() and not HasExtraActionBar()) then - self:Show() - elseif(not value) then - self:Hide() - self:ClearBindings() - end - elseif(name == 'state-visible') then - if(value == 'show') then - self:CallMethod('Update') - else - self:Hide() - self:ClearBindings() - end - end - - if(self:IsShown() and (name == 'item' or name == 'binding')) then - self:ClearBindings() - - local key = GetBindingKey('EXTRAACTIONBUTTON1') - if(key) then - self:SetBindingClick(1, key, self, 'LeftButton') - end - end -]]) - -local Icon = Button:CreateTexture('$parentIcon', 'BACKGROUND') -Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) -Icon:SetAllPoints() -Button.Icon = Icon - -local HotKey = Button:CreateFontString('$parentHotKey', nil, 'NumberFontNormal') -HotKey:SetPoint('BOTTOMRIGHT', -5, 5) -Button.HotKey = HotKey - -local Cooldown = CreateFrame('Cooldown', '$parentCooldown', Button, 'CooldownFrameTemplate') -Cooldown:ClearAllPoints() -Cooldown:SetPoint('TOPRIGHT', -2, -3) -Cooldown:SetPoint('BOTTOMLEFT', 2, 1) -Cooldown:Hide() -Button.Cooldown = Cooldown - -local Artwork = Button:CreateTexture('$parentArtwork', 'OVERLAY') -Artwork:SetPoint('CENTER', -2, 0) -Artwork:SetSize(256, 128) -Artwork:SetTexture([[Interface\ExtraButton\Amber]]) -Button.Artwork = Artwork - -local function UpdateCooldown(self) - if(self:IsShown()) then - local start, duration, enable = GetItemCooldown(self.itemID) - if(duration > 0) then - self.Cooldown:SetCooldown(start, duration) - self.Cooldown:Show() - else - self.Cooldown:Hide() - end - end -end - -Button:RegisterEvent('UPDATE_BINDINGS') -Button:RegisterEvent('UPDATE_EXTRA_ACTIONBAR') -Button:RegisterEvent('BAG_UPDATE_COOLDOWN') -Button:RegisterEvent('BAG_UPDATE_DELAYED') -Button:RegisterEvent('WORLD_MAP_UPDATE') -Button:RegisterEvent('QUEST_LOG_UPDATE') -Button:RegisterEvent('QUEST_POI_UPDATE') -Button:SetScript('OnEvent', function(self, event) - if(event == 'BAG_UPDATE_COOLDOWN') then - UpdateCooldown(self) - elseif(event == 'PLAYER_REGEN_ENABLED') then - self:SetAttribute('item', self.attribute) - self:UnregisterEvent(event) - UpdateCooldown(self) - elseif(event == 'UPDATE_BINDINGS') then - if(self:IsShown()) then - self:SetItem() - self:SetAttribute('binding', GetTime()) - end - else - self:Update() - end -end) - -Button:SetScript('OnEnter', function(self) - GameTooltip:SetOwner(self, 'ANCHOR_LEFT') - GameTooltip:SetHyperlink(self.itemLink) -end) - --- BUG: IsItemInRange() is broken versus friendly npcs (and possibly others) -Button:SetScript('OnUpdate', function(self, elapsed) - if(self.rangeTimer > 0.2) then - local HotKey = self.HotKey - local inRange = IsItemInRange(self.itemLink, 'target') - if(HotKey:GetText() == RANGE_INDICATOR) then - if(inRange == false) then - HotKey:SetTextColor(1, 0.1, 0.1) - HotKey:Show() - elseif(inRange) then - HotKey:SetTextColor(1, 1, 1) - HotKey:Show() - else - HotKey:Hide() - end - else - if(inRange == false) then - HotKey:SetTextColor(1, 0.1, 0.1) - else - HotKey:SetTextColor(1, 1, 1) - end - end - - self.rangeTimer = 0 - else - self.rangeTimer = self.rangeTimer + elapsed - end - - if(self.updateTimer > 5) then - self:Update() - self.updateTimer = 0 - else - self.updateTimer = self.updateTimer + elapsed - end -end) - -local zoneWide = { +local QuestInZone = { [14108] = 541, [13998] = 11, - [25798] = 61, -- quest is bugged, has no zone - [25799] = 61, -- quest is bugged, has no zone + [25798] = 61, + [25799] = 61, [25112] = 161, [25111] = 161, [24735] = 201, -} - -local blacklist = { - [113191] = true, - [110799] = true, - [109164] = true, -} - -function Button:SetItem(itemLink, texture) - if(itemLink) then - if(itemLink == self.itemLink and self:IsShown()) then - return - end - - self.Icon:SetTexture(texture) - self.itemID, self.itemName = string.match(itemLink, '|Hitem:(.-):.-|h%[(.+)%]|h') - self.itemLink = itemLink - - if(blacklist[self.itemID]) then - return - end - end - - local HotKey = self.HotKey - local key = GetBindingKey('EXTRAACTIONBUTTON1') - if(key) then - HotKey:SetText(GetBindingText(key, 1)) - HotKey:Show() - elseif(ItemHasRange(self.itemLink)) then - HotKey:SetText(RANGE_INDICATOR) - HotKey:Show() - else - HotKey:Hide() - end - - if(InCombatLockdown()) then - self.attribute = self.itemName - self:RegisterEvent('PLAYER_REGEN_ENABLED') - else - self:SetAttribute('item', self.itemName) - UpdateCooldown(self) - end -end - -function Button:RemoveItem() - if(InCombatLockdown()) then - self.attribute = nil - self:RegisterEvent('PLAYER_REGEN_ENABLED') - else - self:SetAttribute('item', nil) - end -end - -local ticker -function Button:Update() - local numItems = 0 - local shortestDistance = 62500 -- 250 yards² - local closestQuestLink, closestQuestTexture - - for index = 1, GetNumQuestWatches() do - local questID, _, questIndex, _, _, isComplete = GetQuestWatchInfo(index) - if(questID and QuestHasPOIInfo(questID)) then - local link, texture, _, showCompleted = GetQuestLogSpecialItemInfo(questIndex) - if(link) then - local areaID = zoneWide[questID] - if(areaID and areaID == GetCurrentMapAreaID()) then - closestQuestLink = link - closestQuestTexture = texture - elseif(not isComplete or (isComplete and showCompleted)) then - local distanceSq, onContinent = GetDistanceSqToQuest(questIndex) - if(onContinent and distanceSq < shortestDistance) then - shortestDistance = distanceSq - closestQuestLink = link - closestQuestTexture = texture - end +}; +--[[ +########################################################## +BUTTON INTERNALS +########################################################## +]]-- +local UpdateButton = function(self) + local shortestDistance = 62500; + local currentAreaID = GetCurrentMapAreaID() + local closestQuest, closestLink, closestTexture, closestLevel, closestCount, closestIndex, closestDuration, closestExpiration, closestID, closestComplete; + + for i = 1, GetNumQuestWatches() do + local questID, _, questLogIndex, numObjectives, requiredMoney, isComplete, startEvent, isAutoComplete, failureTime, timeElapsed, questType, isTask, isStory, isOnMap, hasLocalPOI = GetQuestWatchInfo(i); + if(questID) then + local title, level, suggestedGroup = GetQuestLogTitle(questLogIndex) + if(QuestHasPOIInfo(questID)) then + local link, texture, _, showCompleted = GetQuestLogSpecialItemInfo(questLogIndex) + local areaID = QuestInZone[questID] + if(areaID and (areaID == currentAreaID)) then + closestQuest = title + closestID = questID + closestLink = link + closestTexture = texture + closestLevel = level + closestCount = numObjectives + closestIndex = questLogIndex + closestDuration = failureTime + closestExpiration = timeElapsed + closestComplete = isComplete + elseif(onContinent and (distanceSq < shortestDistance)) then + shortestDistance = distanceSq + closestQuest = title + closestID = questID + closestLink = link + closestTexture = texture + closestLevel = level + closestCount = numObjectives + closestIndex = questLogIndex + closestDuration = failureTime + closestExpiration = timeElapsed + closestComplete = isComplete end - - numItems = numItems + 1 end end end - if(closestQuestLink and not HasExtraActionBar()) then - self:SetItem(closestQuestLink, closestQuestTexture) - elseif(self:IsShown()) then - self:RemoveItem() - end - - if(numItems > 0 and not ticker) then - ticker = C_Timer.NewTicker(30, function() -- might want to lower this - Button:Update() - end) - elseif(numItems == 0 and ticker) then - ticker:Cancel() - ticker = nil + if(closestLink and (MOD.CurrentQuest == 0)) then + self.CurrentQuest = closestIndex; + self:SetAbility(closestLink, closestTexture, closestQuest, closestLevel, closestTexture, closestID, closestIndex, closestCount, closestDuration, closestExpiration, closestComplete); + self.Artwork:SetTexture([[Interface\ExtraButton\Smash]]); + elseif(self:IsShown() and (self.CurrentQuest ~= MOD.CurrentQuest)) then + self.CurrentQuest = 0; + self.Artwork:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\EMPTY]]); + self:RemoveAbility(); end end --[[ @@ -301,25 +126,18 @@ end PACKAGE CALL ########################################################## ]]-- -function MOD:InitializeButton() - Button:SetPoint('CENTER', UIParent, 'CENTER', 0, 0) - Button:SetSize(50,50) - Button:SetHighlightTexture([[Interface\Buttons\ButtonHilight-Square]]) - Button:SetPushedTexture([[Interface\Buttons\CheckButtonHilight]]) - Button:GetPushedTexture():SetBlendMode('ADD') - Button:SetScript('OnLeave', GameTooltip_Hide) - Button:SetAttribute('type', 'item') - Button.updateTimer = 0 - Button.rangeTimer = 0 - Button:Hide() - -Button:RegisterEvent('UPDATE_BINDINGS') -Button:RegisterEvent('UPDATE_EXTRA_ACTIONBAR') -Button:RegisterEvent('BAG_UPDATE_COOLDOWN') -Button:RegisterEvent('BAG_UPDATE_DELAYED') -Button:RegisterEvent('WORLD_MAP_UPDATE') -Button:RegisterEvent('QUEST_LOG_UPDATE') -Button:RegisterEvent('QUEST_POI_UPDATE') +function MOD:InitializeQuestItem() + SV.SuperButton.ItemBlackList[113191] = true + SV.SuperButton.ItemBlackList[110799] = true + SV.SuperButton.ItemBlackList[109164] = true + + local Button = SV.SuperButton:AddItem("SVUI_QuestAutoButton", UpdateButton, nil, 'SVUI_QUESTITEM'); + Button:RegisterEvent('UPDATE_EXTRA_ACTIONBAR') + Button:RegisterEvent('BAG_UPDATE_COOLDOWN') + Button:RegisterEvent('BAG_UPDATE_DELAYED') + Button:RegisterEvent('WORLD_MAP_UPDATE') + Button:RegisterEvent('QUEST_LOG_UPDATE') + Button:RegisterEvent('QUEST_POI_UPDATE') self.QuestItem = Button end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/quest/components/ordering.lua b/Interface/AddOns/SVUI/packages/quest/components/ordering.lua deleted file mode 100644 index 0f92e02..0000000 --- a/Interface/AddOns/SVUI/packages/quest/components/ordering.lua +++ /dev/null @@ -1,223 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local tinsert = _G.tinsert; -local string = _G.string; -local math = _G.math; -local table = _G.table; ---[[ STRING METHODS ]]-- -local format = string.format; ---[[ MATH METHODS ]]-- -local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; ---[[ TABLE METHODS ]]-- -local tremove, twipe = table.remove, table.wipe; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L -local LSM = LibStub("LibSharedMedia-3.0") -local MOD = SV.SVQuest; ---[[ -########################################################## -EXTRA QUEST ITEM BUTTON -########################################################## -]]-- -local function AnchorBlock(block, anchorBlock, checkFit) - local module = block.module; - local blocksFrame = module.BlocksFrame; - local offsetY = module.blockOffsetY; - block:ClearAllPoints(); - if(anchorBlock) then - if(anchorBlock.isHeader) then - offsetY = module.fromHeaderOffsetY; - end - if(checkFit and (blocksFrame.contentsHeight + block.height - offsetY > blocksFrame.maxHeight)) then - return; - end - if(block.isHeader) then - offsetY = offsetY + anchorBlock.module.fromModuleOffsetY; - block:SetPoint("LEFT", OBJECTIVE_TRACKER_HEADER_OFFSET_X, 0); - else - block:SetPoint("LEFT", module.blockOffsetX, 0); - end - block:SetPoint("TOP", anchorBlock, "BOTTOM", 0, offsetY); - else - offsetY = 0; - if(checkFit and (blocksFrame.contentsHeight + block.height > blocksFrame.maxHeight)) then - return; - end - if(block.isHeader) then - block:SetPoint("TOPLEFT", blocksFrame.ScrollContents or blocksFrame, "TOPLEFT", OBJECTIVE_TRACKER_HEADER_OFFSET_X, offsetY); - else - block:SetPoint("TOPLEFT", blocksFrame.ScrollContents or blocksFrame, "TOPLEFT", module.blockOffsetX, offsetY); - end - end - return offsetY; -end - -local function InternalAddBlock(block) - local module = block.module or MOD.Prototype; - local blocksFrame = module.BlocksFrame; - block.nextBlock = nil; - local offsetY = AnchorBlock(block, blocksFrame.currentBlock, true); - if(not offsetY) then - return false; - end - if(not module.firstBlock and not block.isHeader) then - module.firstBlock = block; - end - if(blocksFrame.currentBlock) then - blocksFrame.currentBlock.nextBlock = block; - end - blocksFrame.currentBlock = block; - blocksFrame.contentsHeight = blocksFrame.contentsHeight + block.height - offsetY; - module.contentsAnimHeight = module.contentsAnimHeight + block.height; - module.contentsHeight = module.contentsHeight + block.height - offsetY; - return true; -end - -local function CanFitBlock(block, header) - local module = block.module; - local blocksFrame = module.BlocksFrame; - local offsetY; - if(not blocksFrame.currentBlock) then - offsetY = 0; - elseif(blocksFrame.currentBlock.isHeader) then - offsetY = module.fromHeaderOffsetY; - else - offsetY = block.module.blockOffsetY; - end - local totalHeight; - if(header) then - totalHeight = header.height - offsetY + block.height - module.fromHeaderOffsetY; - else - totalHeight = block.height - offsetY; - end - return (blocksFrame.contentsHeight + totalHeight) <= blocksFrame.maxHeight; -end - -function MOD:AddBlock(block, forceAdd) - local header = block.module.Header; - local blockAdded = false; - if(not header or header.added) then - blockAdded = InternalAddBlock(block); - elseif(CanFitBlock(block, header)) then - if(InternalAddBlock(header)) then - header.added = true; - if(not header:IsShown()) then - header:Show(); - if(header.animateReason and band(OBJECTIVE_TRACKER_UPDATE_REASON, header.animateReason ) > 0 and not header.animating) then - header.animating = true; - header.HeaderOpenAnim:Stop(); - header.HeaderOpenAnim:Play(); - end - end - blockAdded = InternalAddBlock(block); - end - end - if(not blockAdded) then - block.module.hasSkippedBlocks = true; - end - return blockAdded; -end - -function MOD:PushDown() - if(not BONUS_OBJECTIVE_TRACKER_MODULE.firstBlock or (not AUTO_QUEST_POPUP_TRACKER_MODULE.firstBlock and not QUEST_TRACKER_MODULE.firstBlock)) then - return; - end - local otherHeader, otherModule; - if(QUEST_TRACKER_MODULE.firstBlock) then - otherHeader = QUEST_TRACKER_MODULE.Header; - otherModule = QUEST_TRACKER_MODULE; - else - otherHeader = AUTO_QUEST_POPUP_TRACKER_MODULE.Header; - otherModule = AUTO_QUEST_POPUP_TRACKER_MODULE; - end - BONUS_OBJECTIVE_TRACKER_MODULE.Header:ClearAllPoints(); - otherHeader:ClearAllPoints(); - AnchorBlock(BONUS_OBJECTIVE_TRACKER_MODULE.Header, otherModule.lastBlock); - AnchorBlock(otherHeader, nil); - if(ACHIEVEMENT_TRACKER_MODULE.firstBlock) then - ACHIEVEMENT_TRACKER_MODULE.Header:ClearAllPoints(); - AnchorBlock(ACHIEVEMENT_TRACKER_MODULE.Header, BONUS_OBJECTIVE_TRACKER_MODULE.lastBlock); - end -end ---[[ -########################################################## -PACKAGE CALL -########################################################## -]]-- -function MOD:InitializeButton() - Button:SetPoint('CENTER', ExtraActionButton1) - Button:SetSize(ExtraActionButton1:GetSize()) - Button:SetScale(ExtraActionButton1:GetScale()) - Button:SetHighlightTexture([[Interface\Buttons\ButtonHilight-Square]]) - Button:SetPushedTexture([[Interface\Buttons\CheckButtonHilight]]) - Button:GetPushedTexture():SetBlendMode('ADD') - Button:SetScript('OnLeave', GameTooltip_Hide) - Button:SetAttribute('type', 'item') - Button.updateTimer = 0 - Button.rangeTimer = 0 - Button:Hide() - - local Icon = Button:CreateTexture('$parentIcon', 'BACKGROUND') - Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - Icon:SetAllPoints() - Button.Icon = Icon - - local HotKey = Button:CreateFontString('$parentHotKey', nil, 'NumberFontNormal') - HotKey:SetPoint('BOTTOMRIGHT', -5, 5) - Button.HotKey = HotKey - - local Cooldown = CreateFrame('Cooldown', '$parentCooldown', Button, 'CooldownFrameTemplate') - Cooldown:ClearAllPoints() - Cooldown:SetPoint('TOPRIGHT', -2, -3) - Cooldown:SetPoint('BOTTOMLEFT', 2, 1) - Cooldown:Hide() - Button.Cooldown = Cooldown - - local Artwork = Button:CreateTexture('$parentArtwork', 'OVERLAY') - Artwork:SetPoint('CENTER', -2, 0) - Artwork:SetSize(256, 128) - Artwork:SetTexture([[Interface\ExtraButton\Amber]]) - Button.Artwork = Artwork - - Button:RegisterEvent('UPDATE_BINDINGS') - Button:RegisterEvent('UPDATE_EXTRA_ACTIONBAR') - Button:RegisterEvent('BAG_UPDATE_COOLDOWN') - Button:RegisterEvent('BAG_UPDATE_DELAYED') - Button:RegisterEvent('WORLD_MAP_UPDATE') - Button:RegisterEvent('QUEST_LOG_UPDATE') - Button:RegisterEvent('QUEST_POI_UPDATE') - - self.QuestItem = Button -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/quest/components/popups.lua b/Interface/AddOns/SVUI/packages/quest/components/popups.lua new file mode 100644 index 0000000..1e1084b --- /dev/null +++ b/Interface/AddOns/SVUI/packages/quest/components/popups.lua @@ -0,0 +1,269 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local string = _G.string; +local math = _G.math; +local table = _G.table; +--[[ STRING METHODS ]]-- +local format = string.format; +--[[ MATH METHODS ]]-- +local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; +--[[ TABLE METHODS ]]-- +local tremove, twipe = table.remove, table.wipe; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local LSM = LibStub("LibSharedMedia-3.0") +local MOD = SV.SVQuest; +--[[ +########################################################## +LOCALS +########################################################## +]]-- +local ROW_WIDTH = 300; +local ROW_HEIGHT = 24; +local INNER_HEIGHT = ROW_HEIGHT - 4; +local LARGE_ROW_HEIGHT = ROW_HEIGHT * 2; +local LARGE_INNER_HEIGHT = LARGE_ROW_HEIGHT - 4; + +local NO_ICON = [[Interface\AddOns\SVUI\assets\artwork\Template\EMPTY]]; + +local OBJ_ICON_ACTIVE = [[Interface\COMMON\Indicator-Yellow]]; +local OBJ_ICON_COMPLETE = [[Interface\COMMON\Indicator-Green]]; +local OBJ_ICON_INCOMPLETE = [[Interface\COMMON\Indicator-Gray]]; + +local QUEST_ICON = [[Interface\AddOns\SVUI\assets\artwork\Quest\QUEST-INCOMPLETE-ICON]]; +local QUEST_ICON_COMPLETE = [[Interface\AddOns\SVUI\assets\artwork\Quest\QUEST-COMPLETE-ICON]]; +--[[ +########################################################## +SCRIPT HANDLERS +########################################################## +]]-- +local PopUpButton_OnClick = function(self, button) + local questIndex = self:GetID(); + if(questIndex and (questIndex ~= 0) and self.PopUpType) then + local questID = select(8, GetQuestLogTitle(questIndex)); + if(self.PopUpType == "OFFER") then + ShowQuestOffer(questID); + else + ShowQuestComplete(questID); + end + MOD.Headers["Popups"]:RemovePopup(questID) + end +end +--[[ +########################################################## +TRACKER FUNCTIONS +########################################################## +]]-- +local GetPopUpRow = function(self, index) + if(not self.Rows[index]) then + local previousFrame = self.Rows[#self.Rows] + local index = #self.Rows + 1; + local row = CreateFrame("Frame", nil, self) + if(previousFrame) then + row:SetPoint("TOPLEFT", previousFrame, "BOTTOMLEFT", 0, -2); + row:SetPoint("TOPRIGHT", previousFrame, "BOTTOMRIGHT", 0, -2); + else + row:SetPoint("TOPLEFT", self, "TOPLEFT", 0, -2); + row:SetPoint("TOPRIGHT", self, "TOPRIGHT", 0, -2); + end + row:SetHeightToScale(LARGE_ROW_HEIGHT); + row.Button = CreateFrame("Button", nil, row) + row.Button:SetPointToScale("TOPLEFT", row, "TOPLEFT", 0, 0); + row.Button:SetPointToScale("BOTTOMRIGHT", row, "BOTTOMRIGHT", 0, 8); + row.Button:SetStylePanel("Framed", "FramedTop") + row.Button:SetPanelColor("yellow") + row.Button:SetID(0) + row.Button.PopUpType = nil; + row.Button:SetScript("OnClick", PopUpButton_OnClick) + row.Badge = CreateFrame("Frame", nil, row.Button) + row.Badge:SetPointToScale("TOPLEFT", row.Button, "TOPLEFT", 4, -4); + row.Badge:SetSizeToScale((LARGE_INNER_HEIGHT - 4), (LARGE_INNER_HEIGHT - 4)); + row.Badge:SetStylePanel("Fixed", "Inset") + row.Badge.Icon = row.Badge:CreateTexture(nil,"OVERLAY") + row.Badge.Icon:SetAllPointsIn(row.Badge); + row.Badge.Icon:SetTexture(QUEST_ICON) + row.Badge.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + row.Header = CreateFrame("Frame", nil, row.Button) + row.Header:SetPointToScale("TOPLEFT", row.Badge, "TOPRIGHT", 4, -1); + row.Header:SetPointToScale("BOTTOMRIGHT", row.Button, "BOTTOMRIGHT", -2, 2); + row.Header:SetStylePanel("Default") + row.Header.Text = row.Header:CreateFontString(nil,"OVERLAY") + row.Header.Text:SetFont(SV.Media.font.default, 13, "NONE") + row.Header.Text:SetTextColor(1,1,0) + row.Header.Text:SetShadowOffset(-1,-1) + row.Header.Text:SetShadowColor(0,0,0,0.5) + row.Header.Text:SetJustifyH('LEFT') + row.Header.Text:SetJustifyV('MIDDLE') + row.Header.Text:SetText('') + row.Header.Text:SetPointToScale("TOPLEFT", row.Header, "TOPLEFT", 0, 0); + row.Header.Text:SetPointToScale("BOTTOMRIGHT", row.Header, "BOTTOMRIGHT", 0, 0); + row.RowID = 0; + self.Rows[index] = row; + return row; + end + + return self.Rows[index]; +end + +local SetPopupRow = function(self, index, title, popUpType, questID, questLogIndex) + index = index + 1; + local icon = (popUpType == 'COMPLETED') and QUEST_ICON_COMPLETE or QUEST_ICON + local row = self:GetPopup(index); + row.RowID = questID + row.Header:SetAlpha(1); + row.Header.Text:SetText(title) + row.Badge.Icon:SetTexture(icon); + row.Badge:SetAlpha(1); + row.Button:Enable(); + row.Button:SetID(questLogIndex); + row:SetHeightToScale(LARGE_ROW_HEIGHT); + row:FadeIn(); + + local fill_height = LARGE_ROW_HEIGHT + 6; + + return index, fill_height; +end + +local RefreshPopupObjective = function(self, event, ...) + local rows = 0; + local fill_height = 0; + for i = 1, GetNumAutoQuestPopUps() do + local questID, popUpType = GetAutoQuestPopUp(i); + if(questID) then + local questLogIndex = GetQuestLogIndexByID(questID); + local title = GetQuestLogTitle(questLogIndex); + if(title and title ~= '') then + local add_height = 0; + rows, add_height = self:SetPopup(rows, title, popUpType, questID, questLogIndex) + fill_height = fill_height + add_height + end + end + end + + if(rows == 0 or (fill_height <= 1)) then + self:SetHeight(1); + self:SetAlpha(0); + else + self:SetHeightToScale(fill_height + 2); + self:FadeIn(); + end +end + +local ResetPopupBlock = function(self) + for x = 1, #self.Rows do + local row = self.Rows[x] + if(row) then + row.RowID = 0; + row.Header.Text:SetText(''); + row.Header:SetAlpha(0); + row.Button:SetID(0); + row.Button:Disable(); + row.Badge:SetAlpha(0); + row.Badge.Icon:SetTexture(NO_ICON); + row:SetHeight(1); + row:SetAlpha(0); + end + end +end + +local AddAutoPopUp = function(self, questID, popUpType, noCheck) + local checkPassed = true; + if(not noCheck) then + checkPassed = AddAutoQuestPopUp(questID, popUpType) + end + if(checkPassed) then + self:Reset() + self:Refresh(); + MOD:UpdateDimensions(); + PlaySound("UI_AutoQuestComplete"); + end +end + +local RemoveAutoPopUp = function(self, questID, noRemove) + if(not noRemove) then + RemoveAutoQuestPopUp(questID); + end + self:Reset(); + self:Refresh(); + MOD:UpdateDimensions(); +end + +local _hook_AddAutoPopUpQuests = function(questID, popUpType) + MOD.Headers["Popups"]:AddPopup(questID, popUpType, true) +end + +local _hook_RemoveAutoPopUpQuests = function(questID) + MOD.Headers["Popups"]:RemovePopup(questID, true) +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +function MOD:UpdatePopupQuests(event, ...) + local questID = ...; + self.Headers["Popups"]:AddPopup(questID, "COMPLETE"); +end + +local function UpdatePopupLocals(...) + ROW_WIDTH, ROW_HEIGHT, INNER_HEIGHT, LARGE_ROW_HEIGHT, LARGE_INNER_HEIGHT = ...; +end + +SV.Events:On("QUEST_UPVALUES_UPDATED", "UpdatePopupLocals", UpdatePopupLocals); + +function MOD:InitializePopups() + local scrollChild = self.Docklet.ScrollFrame.ScrollChild; + + local popups = CreateFrame("Frame", nil, scrollChild) + popups:SetPoint("TOPLEFT", scrollChild, "TOPLEFT", 0, 0); + popups:SetPoint("TOPRIGHT", scrollChild, "TOPRIGHT", 0, 0); + popups:SetHeight(1); + popups.Rows = {}; + + popups.GetPopup = GetPopUpRow; + popups.SetPopup = SetPopupRow; + popups.AddPopup = AddAutoPopUp; + popups.RemovePopup = RemoveAutoPopUp; + popups.Reset = ResetPopupBlock; + popups.Refresh = RefreshPopupObjective; + + self.Headers["Popups"] = popups; + + self:RegisterEvent("QUEST_AUTOCOMPLETE", self.UpdatePopupQuests); + + hooksecurefunc("AutoQuestPopupTracker_AddPopUp", _hook_AddAutoPopUpQuests); + hooksecurefunc("AutoQuestPopupTracker_RemovePopUp", _hook_RemoveAutoPopUpQuests); +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/quest/components/prototype.lua b/Interface/AddOns/SVUI/packages/quest/components/prototype.lua deleted file mode 100644 index 92ae576..0000000 --- a/Interface/AddOns/SVUI/packages/quest/components/prototype.lua +++ /dev/null @@ -1,459 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local tinsert = _G.tinsert; -local string = _G.string; -local math = _G.math; -local table = _G.table; ---[[ STRING METHODS ]]-- -local format = string.format; ---[[ MATH METHODS ]]-- -local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; ---[[ TABLE METHODS ]]-- -local tremove, twipe = table.remove, table.wipe; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L -local LSM = LibStub("LibSharedMedia-3.0") -local MOD = SV.SVQuest; ---[[ -########################################################## -LOCALS -########################################################## -]]-- -MOD.Prototype = { - blockTemplate = "SVUI_QuestTrackerBlockTemplate", - blockType = "Frame", - lineTemplate = "SVUI_QuestTrackerLineTemplate", - lineSpacing = 2, - freeBlocks = {}, - usedBlocks = {}, - freeLines = {}, - blockOffsetX = 0, - blockOffsetY = -6, - fromHeaderOffsetY = -10, - fromModuleOffsetY = -10, - contentsHeight = 0, - contentsAnimHeight = 0, - oldContentsHeight = 0, - hasSkippedBlocks = false, - usedTimerBars = {}, - freeTimerBars = {}, - usedProgressBars = {}, - freeProgressBars = {}, - updateReasonModule = 0, - updateReasonEvents = 0, -}; ---[[ -########################################################## -MODULE PROTOTYPE -########################################################## -]]-- -function MOD.Prototype:BeginLayout(isStaticReanchor) - self.firstBlock = nil; - self.lastBlock = nil; - self.oldContentsHeight = self.contentsHeight; - self.contentsHeight = 0; - self.contentsAnimHeight = 0; - if(not isStaticReanchor) then - self.hasSkippedBlocks = false; - end - self:MarkBlocksUnused(); -end - -function MOD.Prototype:EndLayout(isStaticReanchor) - self.lastBlock = self.BlocksFrame.currentBlock; - self:FreeUnusedBlocks(); -end - -function MOD.Prototype:SetHeader(block, text, animateReason) - block.module = self; - block.isHeader = true; - block.Text:SetText(text); - block.animateReason = animateReason or 0; - self.Header = block; -end - -function MOD.Prototype:GetBlock(id) - local block = self.usedBlocks[id]; - if(not block) then - local numFreeBlocks = #self.freeBlocks; - if(numFreeBlocks > 0) then - block = self.freeBlocks[numFreeBlocks]; - tremove(self.freeBlocks, numFreeBlocks); - else - block = CreateFrame(self.blockType, nil, self.BlocksFrame or ObjectiveTrackerFrame.BlocksFrame, self.blockTemplate); - block.lines = {}; - end - self.usedBlocks[id] = block; - block.module = self; - block.id = id; - end - block.used = true; - block.height = 0; - block.currentLine = nil; - - if(block.lines) then - for objectiveKey, line in pairs(block.lines) do - line.used = nil; - end - end - - return block; -end - -function MOD.Prototype:GetExistingBlock(id) - return self.usedBlocks[id]; -end - -function MOD.Prototype:MarkBlocksUnused() - for _, block in pairs(self.usedBlocks) do - block.used = nil; - end -end - -function MOD.Prototype:FreeBlock(block) - for _, line in pairs(block.lines) do - self:FreeLine(block, line); - end - block.lines = {}; - tinsert(self.freeBlocks, block); - self.usedBlocks[block.id] = nil; - block:Hide(); - if(self.OnFreeBlock) then - self:OnFreeBlock(block); - end -end - -function MOD.Prototype:FreeUnusedBlocks() - for questID, block in pairs(self.usedBlocks) do - if(not block.used) then - self:FreeBlock(block); - end - end -end - -function MOD.Prototype:FreeLine(block, line) - block.lines[line.objectiveKey] = nil; - local freeLines = (line.type and line.type.freeLines) or self.freeLines; - tinsert(freeLines, line); - if(line.TimerBar) then - self:FreeTimerBar(block, line); - end - if(line.ProgressBar) then - self:FreeProgressBar(block, line); - end - if(line.type and self.OnFreeTypedLine) then - self:OnFreeTypedLine(line); - elseif(self.OnFreeLine) then - self:OnFreeLine(line); - end - line:Hide(); -end - -function MOD.Prototype:FreeUnusedLines(block) - for objectiveKey, line in pairs(block.lines) do - if(not line.used) then - self:FreeLine(block, line); - end - end -end - -function MOD.Prototype:GetLine(block, objectiveKey, lineType) - local line = block.lines[objectiveKey]; - if(line and line.type ~= lineType) then - self:FreeLine(block, line); - line = nil; - end - - if(line) then - line.used = true; - return line; - end - - local freeLines = (lineType and lineType.freeLines) or self.freeLines; - local numFreeLines = #freeLines; - local parent = block.ScrollContents or block; - if(numFreeLines > 0) then - line = freeLines[numFreeLines]; - tremove(freeLines, numFreeLines); - line:SetParent(parent); - line:Show(); - else - line = CreateFrame("Frame", nil, parent, (lineType and lineType.template) or self.lineTemplate); - line.type = lineType; - end - block.lines[objectiveKey] = line; - line.objectiveKey = objectiveKey; - line.used = true; - return line; -end - -function MOD.Prototype:AddObjective(block, objectiveKey, text, lineType, useFullHeight, hideDash, colorStyle) - local line = self:GetLine(block, objectiveKey, lineType); - if(block.lineWidth ~= line.width) then - line.Text:SetWidth(block.lineWidth or self.lineWidth); - line.width = block.lineWidth; -- default should be nil - end - if(hideDash and not line.hideDash) then - line.Dash:Hide(); - line.hideDash = true; - elseif(not hideDash and line.hideDash) then - line.Dash:Show(); - line.hideDash = nil; - end - local height = self:SetStringText(line.Text, text, useFullHeight, colorStyle, block.isHighlighted); - line:SetHeight(height); - block.height = block.height + height + block.module.lineSpacing; - local anchor = block.currentLine or block.HeaderText; - if(anchor) then - line:SetPoint("TOPLEFT", anchor, "BOTTOMLEFT", 0, -block.module.lineSpacing); - else - line:SetPoint("TOPLEFT", 0, -block.module.lineSpacing); - end - block.currentLine = line; - return line; -end - -function MOD.Prototype:SetStringText(fontString, text, useFullHeight, colorStyle, useHighlight) - fontString:SetHeight(0); - fontString:SetText(text); - local stringHeight = fontString:GetHeight(); - if(stringHeight > OBJECTIVE_TRACKER_DOUBLE_LINE_HEIGHT and not useFullHeight) then - fontString:SetHeight(OBJECTIVE_TRACKER_DOUBLE_LINE_HEIGHT); - stringHeight = OBJECTIVE_TRACKER_DOUBLE_LINE_HEIGHT; - end - colorStyle = colorStyle or OBJECTIVE_TRACKER_COLOR["Normal"]; - if(useHighlight and colorStyle.reverse) then - colorStyle = colorStyle.reverse; - end - if(fontString.colorStyle ~= colorStyle) then - fontString:SetTextColor(colorStyle.r, colorStyle.g, colorStyle.b); - fontString.colorStyle = colorStyle; - end - return stringHeight; -end - -function MOD.Prototype:SetBlockHeader(block, text) - local height = self:SetStringText(block.HeaderText, text, nil, OBJECTIVE_TRACKER_COLOR["Header"], block.isHighlighted); - block.height = height; -end - -function MOD.Prototype:OnBlockHeaderClick(block, mouseButton) -end - -function MOD.Prototype:OnBlockHeaderEnter(block) - block.isHighlighted = true; - if(block.HeaderText) then - local headerColorStyle = OBJECTIVE_TRACKER_COLOR["HeaderHighlight"]; - block.HeaderText:SetTextColor(headerColorStyle.r, headerColorStyle.g, headerColorStyle.b); - block.HeaderText.colorStyle = headerColorStyle; - end - for objectiveKey, line in pairs(block.lines) do - local colorStyle = line.Text.colorStyle.reverse; - if(colorStyle) then - line.Text:SetTextColor(colorStyle.r, colorStyle.g, colorStyle.b); - line.Text.colorStyle = colorStyle; - if(line.Dash) then - line.Dash:SetTextColor(OBJECTIVE_TRACKER_COLOR["NormalHighlight"].r, OBJECTIVE_TRACKER_COLOR["NormalHighlight"].g, OBJECTIVE_TRACKER_COLOR["NormalHighlight"].b); - end - end - end -end - -function MOD.Prototype:OnBlockHeaderLeave(block) - block.isHighlighted = nil; - if(block.HeaderText) then - local headerColorStyle = OBJECTIVE_TRACKER_COLOR["Header"]; - block.HeaderText:SetTextColor(headerColorStyle.r, headerColorStyle.g, headerColorStyle.b); - block.HeaderText.colorStyle = headerColorStyle; - end - for objectiveKey, line in pairs(block.lines) do - local colorStyle = line.Text.colorStyle.reverse; - if(colorStyle) then - line.Text:SetTextColor(colorStyle.r, colorStyle.g, colorStyle.b); - line.Text.colorStyle = colorStyle; - if(line.Dash) then - line.Dash:SetTextColor(OBJECTIVE_TRACKER_COLOR["Normal"].r, OBJECTIVE_TRACKER_COLOR["Normal"].g, OBJECTIVE_TRACKER_COLOR["Normal"].b); - end - end - end -end - -function MOD.Prototype:AddTimerBar(block, line, duration, startTime) - local timerBar = self.usedTimerBars[block] and self.usedTimerBars[block][line]; - if(not timerBar) then - local numFreeTimerBars = #self.freeTimerBars; - local parent = block.ScrollContents or block; - if(numFreeTimerBars > 0) then - timerBar = self.freeTimerBars[numFreeTimerBars]; - tremove(self.freeTimerBars, numFreeTimerBars); - timerBar:SetParent(parent); - timerBar:Show(); - else - timerBar = CreateFrame("Frame", nil, parent, "SVUI_QuestTrackerTimerBarTemplate"); - timerBar.Label:SetPoint("LEFT", OBJECTIVE_TRACKER_DASH_WIDTH, 0); - timerBar.height = timerBar:GetHeight(); - end - if(not self.usedTimerBars[block]) then - self.usedTimerBars[block] = {}; - end - self.usedTimerBars[block][line] = timerBar; - timerBar:Show(); - end - local anchor = block.currentLine or block.HeaderText; - if(anchor) then - timerBar:SetPoint("TOPLEFT", anchor, "BOTTOMLEFT", 0, -block.module.lineSpacing); - else - timerBar:SetPoint("TOPLEFT", 0, -block.module.lineSpacing); - end - - timerBar.Bar:SetMinMaxValues(0, duration); - timerBar.duration = duration; - timerBar.startTime = startTime; - timerBar.block = block; - - line.TimerBar = timerBar; - block.height = block.height + timerBar.height + block.module.lineSpacing; - block.currentLine = timerBar; - return timerBar; -end - -function MOD.Prototype:FreeTimerBar(block, line) - local timerBar = line.TimerBar; - if(timerBar) then - self.usedTimerBars[block][line] = nil; - tinsert(self.freeTimerBars, timerBar); - timerBar:Hide(); - line.TimerBar = nil; - end -end - -function MOD.Prototype:AddProgressBar(block, line, questID) - local progressBar = self.usedProgressBars[block] and self.usedProgressBars[block][line]; - if(not progressBar) then - local numFreeProgressBars = #self.freeProgressBars; - local parent = block.ScrollContents or block; - if(numFreeProgressBars > 0) then - progressBar = self.freeProgressBars[numFreeProgressBars]; - tremove(self.freeProgressBars, numFreeProgressBars); - progressBar:SetParent(parent); - progressBar:Show(); - else - progressBar = CreateFrame("Frame", nil, parent, "SVUI_QuestTrackerProgressBarTemplate"); - progressBar.height = progressBar:GetHeight(); - end - if(not self.usedProgressBars[block]) then - self.usedProgressBars[block] = { }; - end - self.usedProgressBars[block][line] = progressBar; - progressBar:RegisterEvent("QUEST_LOG_UPDATE"); - progressBar:Show(); - progressBar.Bar.Label:Hide(); - progressBar.questID = questID; - MOD.SetProgressBarValue(progressBar, GetQuestProgressBarPercent(questID)); - end - local anchor = block.currentLine or block.HeaderText; - if(anchor) then - progressBar:SetPoint("TOPLEFT", anchor, "BOTTOMLEFT", 0, -block.module.lineSpacing); - else - progressBar:SetPoint("TOPLEFT", 0, -block.module.lineSpacing); - end - progressBar.block = block; - progressBar.questID = questID; - line.ProgressBar = progressBar; - block.height = block.height + progressBar.height + block.module.lineSpacing; - block.currentLine = progressBar; - return progressBar; -end - -function MOD.Prototype:FreeProgressBar(block, line) - local progressBar = line.ProgressBar; - if(progressBar) then - self.usedProgressBars[block][line] = nil; - tinsert(self.freeProgressBars, progressBar); - progressBar:Hide(); - line.ProgressBar = nil; - progressBar:UnregisterEvent("QUEST_LOG_UPDATE"); - end -end - -function MOD.Prototype:StaticReanchor() - local block = self.firstBlock; - self:BeginLayout(true); - while(block) do - if(block.module == self) then - local nextBlock = block.nextBlock; - if(ObjectiveTracker_AddBlock(block)) then - block.used = true; - block:Show(); - block = nextBlock; - else - block.used = false; - block:Hide(); - break; - end - else - break; - end - end - self:EndLayout(true); -end ---[[ -########################################################## -PACKAGE CALL -########################################################## -]]-- -function MOD:GetModulePrototype() - local info = {}; - setmetatable(info, { __index = self.Prototype; }); - return info; -end - -function MOD:InitializePrototype() - local tracker = self.Tracker - local line = CreateFrame("Frame", nil, tracker, self.Prototype.lineTemplate); - line.Text:SetText("Double line|ntest"); - tinsert(self.Prototype.freeLines, line); - OBJECTIVE_TRACKER_DOUBLE_LINE_HEIGHT = math.ceil(line.Text:GetStringHeight()); - OBJECTIVE_TRACKER_DASH_WIDTH = line.Dash:GetWidth(); - OBJECTIVE_TRACKER_TEXT_WIDTH = OBJECTIVE_TRACKER_LINE_WIDTH - OBJECTIVE_TRACKER_DASH_WIDTH - 12; - self.Prototype.lineWidth = OBJECTIVE_TRACKER_TEXT_WIDTH; - self.Prototype.BlocksFrame = tracker.BlocksFrame; - line.Text:SetWidth(OBJECTIVE_TRACKER_TEXT_WIDTH); - local frameLevel = tracker.BlocksFrame:GetFrameLevel(); - tracker.HeaderMenu:SetFrameLevel(frameLevel + 2); - tracker:RegisterEvent("PLAYER_ENTERING_WORLD"); - UIDropDownMenu_Initialize(tracker.BlockDropDown, nil, "MENU"); - QuestPOI_Initialize(tracker.BlocksFrame, function(self) self:SetScale(0.9); self:RegisterForClicks("LeftButtonUp", "RightButtonUp"); end ); -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/quest/components/quests.lua b/Interface/AddOns/SVUI/packages/quest/components/quests.lua new file mode 100644 index 0000000..fd314de --- /dev/null +++ b/Interface/AddOns/SVUI/packages/quest/components/quests.lua @@ -0,0 +1,850 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local string = _G.string; +local math = _G.math; +local table = _G.table; +local tinsert = _G.tinsert; +local tremove = _G.tremove; +local wipe = _G.wipe; +--[[ STRING METHODS ]]-- +local format = string.format; +--[[ MATH METHODS ]]-- +local abs, ceil, floor, round, maxNum = math.abs, math.ceil, math.floor, math.round, math.max; +--[[ TABLE METHODS ]]-- +local tsort, tcopy = table.sort, table.copy; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local LSM = LibStub("LibSharedMedia-3.0") +local MOD = SV.SVQuest; +--[[ +########################################################## +LOCALS +########################################################## +]]-- +local ROW_WIDTH = 300; +local ROW_HEIGHT = 20; +local QUEST_ROW_HEIGHT = ROW_HEIGHT + 2; +local INNER_HEIGHT = ROW_HEIGHT - 4; +local LARGE_ROW_HEIGHT = ROW_HEIGHT * 2; +local LARGE_INNER_HEIGHT = LARGE_ROW_HEIGHT - 4; + +local NO_ICON = [[Interface\AddOns\SVUI\assets\artwork\Template\EMPTY]]; +local OBJ_ICON_ACTIVE = [[Interface\COMMON\Indicator-Yellow]]; +local OBJ_ICON_COMPLETE = [[Interface\COMMON\Indicator-Green]]; +local OBJ_ICON_INCOMPLETE = [[Interface\COMMON\Indicator-Gray]]; + +local QUEST_ICON = [[Interface\AddOns\SVUI\assets\artwork\Quest\QUEST-INCOMPLETE-ICON]]; +local QUEST_ICON_COMPLETE = [[Interface\AddOns\SVUI\assets\artwork\Quest\QUEST-COMPLETE-ICON]]; + +local CACHED_QUESTS = {}; +local QUESTS_BY_LOCATION = {}; +local QUEST_HEADER_MAP = {}; +local USED_QUESTIDS = {}; +local CURRENT_MAP_ID = 0; +local WORLDMAP_UPDATE = false; + +local DEFAULT_COLOR = {r = 1, g = 0.68, b = 0.1} + +local QuestInZone = { + [14108] = 541, + [13998] = 11, + [25798] = 61, + [25799] = 61, + [25112] = 161, + [25111] = 161, + [24735] = 201, +}; + +local function CacheQuestHeaders() + wipe(QUEST_HEADER_MAP) + + local currentHeader = "Misc"; + local numEntries, numQuests = GetNumQuestLogEntries(); + + for i = 1, numEntries do + local title, _, _, isHeader, _, _, _, questID = GetQuestLogTitle(i); + if(isHeader) then + currentHeader = title; + else + QUEST_HEADER_MAP[questID] = currentHeader + end + end +end + +local function UpdateCachedQuests(needsSorting) + local s = 62500; + local c = 0; + local li = 0; + local HeadersCached = false; + + wipe(QUESTS_BY_LOCATION) + + for i = 1, GetNumQuestWatches() do + local questID, _, questLogIndex, numObjectives, _, completed, _, _, duration, elapsed, questType, isTask, isStory, isOnMap, hasLocalPOI = GetQuestWatchInfo(i); + if(questID) then -- and (not USED_QUESTIDS[questID]) + local distanceSq, onContinent = GetDistanceSqToQuest(questLogIndex) + local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle(questLogIndex) + if(not CACHED_QUESTS[questID]) then + local link, texture, _, showCompleted = GetQuestLogSpecialItemInfo(questLogIndex) + -- local mapID, floorNumber = 0,0 + -- if(not WorldMapFrame:IsShown()) then + -- mapID, floorNumber = GetQuestWorldMapAreaID(questID) + -- else + -- WORLDMAP_UPDATE = true; + -- end + + CACHED_QUESTS[questID] = {i, title, level, texture, questID, questLogIndex, numObjectives, duration, elapsed, completed, questType, link}; + else + CACHED_QUESTS[questID][7] = numObjectives; -- args: quest objective count + CACHED_QUESTS[questID][8] = duration; -- args: quest timer duration + CACHED_QUESTS[questID][9] = elapsed; -- args: quest timer elapsed + CACHED_QUESTS[questID][10] = completed; -- args: quest is completed + end + + if(questID == MOD.ActiveQuestID) then + MOD:UpdateActiveObjective('FORCED_UPDATE') + end + + if(not QUEST_HEADER_MAP[questID] and (not HeadersCached)) then + CacheQuestHeaders() + HeadersCached = true + end + + local header = QUEST_HEADER_MAP[questID] or "Misc" + + tinsert(QUESTS_BY_LOCATION, {distanceSq, header, questID}); + end + end + + tsort(QUESTS_BY_LOCATION, function(a,b) + if(a[2] and b[2]) then + return a[2] < b[2] + else + return false + end + end); + + tsort(QUESTS_BY_LOCATION, function(a,b) + if(a[1] and b[1]) then + return a[1] < b[1] + else + return false + end + end); +end + +local function UpdateCachedDistance() + local s = 62500; + wipe(QUESTS_BY_LOCATION) + local HeadersCached = false; + for questID,questData in pairs(CACHED_QUESTS) do + local questLogIndex = questData[6]; + local distanceSq, onContinent = GetDistanceSqToQuest(questLogIndex) + if(not QUEST_HEADER_MAP[questID] and (not HeadersCached)) then + CacheQuestHeaders() + HeadersCached = true + end + local header = QUEST_HEADER_MAP[questID] or "Misc" + tinsert(QUESTS_BY_LOCATION, {distanceSq, header, questID}); + end + + tsort(QUESTS_BY_LOCATION, function(a,b) + if(a[2] and b[2]) then + return a[2] < b[2] + else + return false + end + end); + + tsort(QUESTS_BY_LOCATION, function(a,b) + if(a[1] and b[1]) then + return a[1] < b[1] + else + return false + end + end); +end + +local function AddCachedQuest(questLogIndex) + local HeadersCached = false; + if(questLogIndex) then -- and (not USED_QUESTIDS[questID]) + local i = GetQuestWatchIndex(questLogIndex) + if(i) then + local distanceSq, onContinent = GetDistanceSqToQuest(questLogIndex) + local questID, _, _, numObjectives, _, completed, _, _, duration, elapsed, questType, isTask, isStory, isOnMap, hasLocalPOI = GetQuestWatchInfo(i); + + if(not CACHED_QUESTS[questID]) then + local title, level, suggestedGroup = GetQuestLogTitle(questLogIndex) + local link, texture, _, showCompleted = GetQuestLogSpecialItemInfo(questLogIndex) + local mapID, floorNumber = 0,0 + if(not WorldMapFrame:IsShown()) then + mapID, floorNumber = GetQuestWorldMapAreaID(questID) + else + WORLDMAP_UPDATE = true; + end + + CACHED_QUESTS[questID] = {i, title, level, texture, questID, questLogIndex, numObjectives, duration, elapsed, completed, questType, link}; + + if(not QUEST_HEADER_MAP[questID] and (not HeadersCached)) then + CacheQuestHeaders() + HeadersCached = true + end + local header = QUEST_HEADER_MAP[questID] or "Misc" + tinsert(QUESTS_BY_LOCATION, {distanceSq, header, questID}); + + tsort(QUESTS_BY_LOCATION, function(a,b) + if(a[2] and b[2]) then + return a[2] < b[2] + else + return false + end + end); + + tsort(QUESTS_BY_LOCATION, function(a,b) + if(a[1] and b[1]) then + return a[1] < b[1] + else + return false + end + end); + end + + return questID; + end + end + + return false; +end +--[[ +########################################################## +SCRIPT HANDLERS +########################################################## +]]-- +local BadgeButton_OnEnter = function(self, ...) + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) + GameTooltip:ClearLines() + GameTooltip:AddLine("Click to track this quest.") + GameTooltip:Show() +end + +local RowButton_OnEnter = function(self, ...) + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) + GameTooltip:ClearLines() + GameTooltip:AddDoubleLine("[Left-Click]", "View the log entry for this quest.", 0, 1, 0, 1, 1, 1) + GameTooltip:AddLine(" ") + GameTooltip:AddDoubleLine("[Right-Click]", "Remove this quest from the tracker.", 0, 1, 0, 1, 1, 1) + GameTooltip:AddLine(" ") + GameTooltip:AddDoubleLine("[SHIFT+Click]", "Show this quest on the map.", 0, 1, 0, 1, 1, 1) + GameTooltip:Show() +end + +local AnyButton_OnLeave = function(self, ...) + GameTooltip:Hide() +end + +local TimerBar_OnUpdate = function(self, elapsed) + local statusbar = self.Timer.Bar + local timeNow = GetTime(); + local timeRemaining = statusbar.duration - (timeNow - statusbar.startTime); + statusbar:SetValue(timeRemaining); + if(timeRemaining < 0) then + -- hold at 0 for a moment + if(timeRemaining > -1) then + timeRemaining = 0; + else + self:StopTimer(); + end + end + local r,g,b = MOD:GetTimerTextColor(statusbar.duration, statusbar.duration - timeRemaining) + self.Timer.TimeLeft:SetText(GetTimeStringFromSeconds(timeRemaining, nil, true)); + self.Timer.TimeLeft:SetTextColor(r,g,b); +end + +local ActiveButton_OnClick = function(self, button) + local rowIndex = self:GetID(); + if(rowIndex and (rowIndex ~= 0)) then + local questID, _, questLogIndex, numObjectives, requiredMoney, completed, startEvent, isAutoComplete, duration, elapsed, questType, isTask, isStory, isOnMap, hasLocalPOI = GetQuestWatchInfo(rowIndex); + if(questID) then + local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle(questLogIndex) + local icon = self.Icon:GetTexture() + SetSuperTrackedQuestID(questID); + MOD.Headers["Active"]:Set(title, level, icon, questID, questLogIndex, numObjectives, duration, elapsed, isComplete); + end + end +end + +local ViewButton_OnClick = function(self, button) + local questIndex = self:GetID(); + if(questIndex and (questIndex ~= 0)) then + local questID = select(8, GetQuestLogTitle(questIndex)); + if(IsModifiedClick("CHATLINK") and ChatEdit_GetActiveWindow()) then + local questLink = GetQuestLink(questIndex); + if(questLink) then + ChatEdit_InsertLink(questLink); + end + elseif(questID and IsShiftKeyDown()) then + QuestMapFrame_OpenToQuestDetails(questID); + elseif(questID and button ~= "RightButton") then + CloseDropDownMenus(); + if(IsQuestComplete(questID) and GetQuestLogIsAutoComplete(questIndex)) then + AutoQuestPopupTracker_RemovePopUp(questID); + ShowQuestComplete(questIndex); + else + QuestLogPopupDetailFrame_Show(questIndex); + end + elseif(questID) then + RemoveQuestWatch(questIndex); + if(questID == superTrackedQuestID) then + QuestSuperTracking_OnQuestUntracked(); + end + end + end +end +--[[ +########################################################## +TRACKER FUNCTIONS +########################################################## +]]-- +local StartTimer = function(self, duration, elapsed) + local timeNow = GetTime(); + local startTime = timeNow - elapsed; + local timeRemaining = duration - startTime; + + self.Timer:SetHeightToScale(INNER_HEIGHT); + self.Timer:FadeIn(); + self.Timer.Bar.duration = duration or 1; + self.Timer.Bar.startTime = startTime; + self.Timer.Bar:SetMinMaxValues(0, self.Timer.Bar.duration); + self.Timer.Bar:SetValue(timeRemaining); + self.Timer.TimeLeft:SetText(GetTimeStringFromSeconds(duration, nil, true)); + self.Timer.TimeLeft:SetTextColor(MOD:GetTimerTextColor(duration, duration - timeRemaining)); + + self:SetScript("OnUpdate", TimerBar_OnUpdate); +end + +local StopTimer = function(self) + self.Timer:SetHeight(1); + self.Timer:SetAlpha(0); + self.Timer.Bar.duration = 1; + self.Timer.Bar.startTime = 0; + self.Timer.Bar:SetMinMaxValues(0, self.Timer.Bar.duration); + self.Timer.Bar:SetValue(0); + self.Timer.TimeLeft:SetText(''); + self.Timer.TimeLeft:SetTextColor(1,1,1); + + self:SetScript("OnUpdate", nil); +end + +local GetQuestRow = function(self, index) + if(not self.Rows[index]) then + local previousFrame = self.Rows[#self.Rows] + local index = #self.Rows + 1; + local yOffset = -3; + + local anchorFrame; + if(previousFrame and previousFrame.Objectives) then + anchorFrame = previousFrame.Objectives; + yOffset = -6; + else + anchorFrame = self.Header; + end + + local row = CreateFrame("Frame", nil, self) + row:SetPoint("TOPLEFT", anchorFrame, "BOTTOMLEFT", 0, yOffset); + row:SetPoint("TOPRIGHT", anchorFrame, "BOTTOMRIGHT", 0, yOffset); + row:SetHeightToScale(QUEST_ROW_HEIGHT); + + row.Badge = CreateFrame("Frame", nil, row) + row.Badge:SetPoint("TOPLEFT", row, "TOPLEFT", 0, 0); + row.Badge:SetSizeToScale(QUEST_ROW_HEIGHT, QUEST_ROW_HEIGHT); + row.Badge:SetStylePanel("Default", "Headline") + + row.Badge.Icon = row.Badge:CreateTexture(nil,"OVERLAY") + row.Badge.Icon:SetAllPoints(row.Badge); + row.Badge.Icon:SetTexture(QUEST_ICON) + row.Badge.Icon:SetTexCoord(0.05, 0.95, 0.05, 0.95) + + row.Badge.Button = CreateFrame("Button", nil, row.Badge) + row.Badge.Button:SetAllPoints(row.Badge); + row.Badge.Button:SetStylePanel("Button", true, 1, 1, 1) + row.Badge.Button:SetID(0) + row.Badge.Button.Icon = row.Badge.Icon; + row.Badge.Button:RegisterForClicks("LeftButtonUp", "RightButtonUp") + row.Badge.Button:SetScript("OnClick", ActiveButton_OnClick) + row.Badge.Button:SetScript("OnEnter", BadgeButton_OnEnter) + row.Badge.Button:SetScript("OnLeave", AnyButton_OnLeave) + + row.Header = CreateFrame("Frame", nil, row) + row.Header:SetPoint("TOPLEFT", row, "TOPLEFT", (QUEST_ROW_HEIGHT + 6), 0); + row.Header:SetPoint("TOPRIGHT", row, "TOPRIGHT", -2, 0); + row.Header:SetHeightToScale(INNER_HEIGHT); + + row.Header.Level = row.Header:CreateFontString(nil,"OVERLAY") + row.Header.Level:SetFont(SV.Media.font.numbers, 11, "NONE") + row.Header.Level:SetShadowOffset(-1,-1) + row.Header.Level:SetShadowColor(0,0,0,0.5) + row.Header.Level:SetJustifyH('RIGHT') + row.Header.Level:SetJustifyV('MIDDLE') + row.Header.Level:SetText('') + row.Header.Level:SetPoint("TOPRIGHT", row.Header, "TOPRIGHT", -4, 0); + row.Header.Level:SetPoint("BOTTOMRIGHT", row.Header, "BOTTOMRIGHT", -4, 0); + + row.Header.Text = row.Header:CreateFontString(nil,"OVERLAY") + row.Header.Text:SetFont(SV.Media.font.default, 13, "NONE") + row.Header.Text:SetTextColor(1,1,0) + row.Header.Text:SetShadowOffset(-1,-1) + row.Header.Text:SetShadowColor(0,0,0,0.5) + row.Header.Text:SetJustifyH('LEFT') + row.Header.Text:SetJustifyV('MIDDLE') + row.Header.Text:SetText('') + row.Header.Text:SetPoint("TOPLEFT", row.Header, "TOPLEFT", 4, 0); + row.Header.Text:SetPoint("BOTTOMRIGHT", row.Header.Level, "BOTTOMLEFT", 0, 0); + + row.Header.Zone = row:CreateFontString(nil,"OVERLAY") + row.Header.Zone:SetAllPoints(row); + row.Header.Zone:SetFont(SV.Media.font.names, 11, "OUTLINE") + row.Header.Zone:SetJustifyH('LEFT') + row.Header.Zone:SetJustifyV('MIDDLE') + row.Header.Zone:SetTextColor(0.75,0.25,1) + row.Header.Zone:SetShadowOffset(-1,-1) + row.Header.Zone:SetShadowColor(0,0,0,0.5) + row.Header.Zone:SetText("") + + row.Button = CreateFrame("Button", nil, row.Header) + row.Button:SetAllPoints(row.Header); + row.Button:SetStylePanel("Button", "Headline", 1, 1, 1) + row.Button:SetID(0) + row.Button:RegisterForClicks("LeftButtonUp", "RightButtonUp") + row.Button:SetScript("OnClick", ViewButton_OnClick); + row.Button:SetScript("OnEnter", RowButton_OnEnter) + row.Button:SetScript("OnLeave", AnyButton_OnLeave) + + row.Timer = CreateFrame("Frame", nil, row) + row.Timer:SetPointToScale("TOPLEFT", row, "BOTTOMLEFT", 0, 4); + row.Timer:SetPointToScale("TOPRIGHT", row, "BOTTOMRIGHT", 0, 4); + row.Timer:SetHeightToScale(INNER_HEIGHT); + + row.Timer.Bar = CreateFrame("StatusBar", nil, row.Timer); + row.Timer.Bar:SetPointToScale("TOPLEFT", row.Timer, "TOPLEFT", 4, -2); + row.Timer.Bar:SetPointToScale("BOTTOMRIGHT", row.Timer, "BOTTOMRIGHT", -4, 2); + row.Timer.Bar:SetStatusBarTexture(SV.Media.bar.default) + row.Timer.Bar:SetStatusBarColor(0.5,0,1) --1,0.15,0.08 + row.Timer.Bar:SetMinMaxValues(0, 1) + row.Timer.Bar:SetValue(0) + + local bgFrame = CreateFrame("Frame", nil, row.Timer.Bar) + bgFrame:SetAllPointsIn(row.Timer.Bar, -2, -2) + bgFrame:SetFrameLevel(bgFrame:GetFrameLevel() - 1) + + bgFrame.bg = bgFrame:CreateTexture(nil, "BACKGROUND") + bgFrame.bg:SetAllPoints(bgFrame) + bgFrame.bg:SetTexture(SV.Media.bar.default) + bgFrame.bg:SetVertexColor(0,0,0,0.5) + + local borderB = bgFrame:CreateTexture(nil,"OVERLAY") + borderB:SetTexture(0,0,0) + borderB:SetPoint("BOTTOMLEFT") + borderB:SetPoint("BOTTOMRIGHT") + borderB:SetHeight(2) + + local borderT = bgFrame:CreateTexture(nil,"OVERLAY") + borderT:SetTexture(0,0,0) + borderT:SetPoint("TOPLEFT") + borderT:SetPoint("TOPRIGHT") + borderT:SetHeight(2) + + local borderL = bgFrame:CreateTexture(nil,"OVERLAY") + borderL:SetTexture(0,0,0) + borderL:SetPoint("TOPLEFT") + borderL:SetPoint("BOTTOMLEFT") + borderL:SetWidth(2) + + local borderR = bgFrame:CreateTexture(nil,"OVERLAY") + borderR:SetTexture(0,0,0) + borderR:SetPoint("TOPRIGHT") + borderR:SetPoint("BOTTOMRIGHT") + borderR:SetWidth(2) + + row.Timer.TimeLeft = row.Timer.Bar:CreateFontString(nil,"OVERLAY"); + row.Timer.TimeLeft:SetAllPointsIn(row.Timer.Bar); + row.Timer.TimeLeft:SetFont(SV.Media.font.numbers, 12, "OUTLINE") + row.Timer.TimeLeft:SetTextColor(1,1,1) + row.Timer.TimeLeft:SetShadowOffset(-1,-1) + row.Timer.TimeLeft:SetShadowColor(0,0,0,0.5) + row.Timer.TimeLeft:SetJustifyH('CENTER') + row.Timer.TimeLeft:SetJustifyV('MIDDLE') + row.Timer.TimeLeft:SetText('') + + row.Timer:SetHeight(1); + row.Timer:SetAlpha(0); + + row.StartTimer = StartTimer; + row.StopTimer = StopTimer; + + row.Objectives = MOD:NewObjectiveHeader(row); + row.Objectives:SetPoint("TOPLEFT", row.Timer, "BOTTOMLEFT", 0, 0); + row.Objectives:SetPoint("TOPRIGHT", row.Timer, "BOTTOMRIGHT", 0, 0); + row.Objectives:SetHeight(1); + + row.RowID = 0; + self.Rows[index] = row; + return row; + end + + return self.Rows[index]; +end + +local SetQuestRow = function(self, index, watchIndex, title, level, icon, questID, questLogIndex, subCount, duration, elapsed, completed, questType) + if(not watchIndex) then + return index,0 + end + index = index or #self.Rows + index = index + 1; + + local fill_height = 0; + local iscomplete = true; + local objective_rows = 0; + local row = self:Get(index); + + if(not icon) then + icon = completed and QUEST_ICON_COMPLETE or QUEST_ICON + end + local color = DEFAULT_COLOR + if(level and type(level) == 'number') then + color = GetQuestDifficultyColor(level); + end + + row.Header:SetAlpha(1); + row.Header.Zone:SetText('') + row.Header.Level:SetTextColor(color.r, color.g, color.b) + row.Header.Level:SetText(level) + row.Header.Text:SetTextColor(color.r, color.g, color.b) + row.Header.Text:SetText(title) + row.Badge.Icon:SetTexture(icon); + row.Badge.Button:Enable(); + row.Badge.Button:SetID(watchIndex); + row.Badge:SetAlpha(1); + row.Button:SetAlpha(1); + row.Button:Enable(); + row.Button:SetID(questLogIndex); + row:SetHeightToScale(QUEST_ROW_HEIGHT); + row:FadeIn(); + + local objective_block = row.Objectives; + objective_block:Reset(); + + for i = 1, subCount do + local description, category, objective_completed = GetQuestObjectiveInfo(questID, i); + if not objective_completed then iscomplete = false end + if(description) then + fill_height = fill_height + (INNER_HEIGHT + 2); + objective_rows = objective_block:SetInfo(objective_rows, description, objective_completed); + end + end + + if(duration) then + if(elapsed and elapsed < duration) then + fill_height = fill_height + (INNER_HEIGHT + 2); + row:StartTimer(duration, elapsed) + end + end + + if(objective_rows > 0) then + objective_block:SetHeightToScale(fill_height); + objective_block:FadeIn(); + end + + if(iscomplete) then MOD.QuestItem:RemoveAbility(questLogIndex) end + + fill_height = fill_height + (QUEST_ROW_HEIGHT + 6); + + return index, fill_height; +end + +local SetZoneHeader = function(self, index, zoneName) + index = index + 1; + local row = self:Get(index); + row.Header.Level:SetText(''); + row.Header.Text:SetText(''); + row.Badge.Icon:SetTexture(NO_ICON); + row.Badge.Button:SetID(0); + row.Badge:SetAlpha(0); + row.Button:SetID(0); + row.Button:Disable(); + row.Button:SetAlpha(0); + row.Badge.Button:Disable(); +--0.75,0.31,1 + row.Header.Zone:SetTextColor(1,0.31,0.1) + row.Header.Zone:SetText(zoneName); + row:SetHeightToScale(ROW_HEIGHT); + row:SetAlpha(1); + + local objective_block = row.Objectives; + objective_block:Reset(); + return index, zoneName; +end + +local RefreshQuests = function(self, event, ...) + -- print('<-----QUESTS') + -- print(event) + -- print(...) + local rows = 0; + local fill_height = 0; + local zone = 0; + + for i = 1, #QUESTS_BY_LOCATION do + local zoneName = QUESTS_BY_LOCATION[i][2] + local questID = QUESTS_BY_LOCATION[i][3] + local quest = CACHED_QUESTS[questID] + if(quest) then + if(quest[2] and quest[2] ~= '') then + local add_height = 0; + if(zone ~= zoneName) then + rows, zone = self:SetZone(rows, zoneName); + fill_height = fill_height + QUEST_ROW_HEIGHT; + end + rows, add_height = self:Set(rows, quest[1], quest[2], quest[3], quest[4], quest[5], quest[6], quest[7], quest[8], quest[9], quest[10]) + fill_height = fill_height + add_height; + end + end + end + + if(rows == 0 or (fill_height <= 1)) then + self:SetHeight(1); + self:SetAlpha(0); + else + self:SetHeightToScale(fill_height + 2); + self:FadeIn(); + end +end + +local AddOneQuest = function(self, questID) + local rows = 0; + if(questID) then + local fill_height = self:GetHeight(); + local quest = CACHED_QUESTS[questID]; + if(quest[1] and quest[1] ~= '') then + local add_height = 0; + rows, add_height = self:Set(rows, unpack(quest)) + fill_height = fill_height + add_height; + end + + self:SetHeightToScale(fill_height + 2); + end +end + +local ResetQuestBlock = function(self) + for x = 1, #self.Rows do + local row = self.Rows[x] + if(row) then + row.Header.Text:SetText(''); + row.Header:SetAlpha(0); + row.Header.Zone:SetText(''); + row.Button:SetID(0); + row.Button:Disable(); + row.Badge.Button:SetID(0); + row.Badge.Icon:SetTexture(NO_ICON); + row.Badge:SetAlpha(0); + row.Badge.Button:Disable(); + row:SetHeight(1); + row:SetAlpha(0); + row.Objectives:Reset(); + end + end + UpdateCachedQuests(); +end + +local LiteResetQuestBlock = function(self) + for x = 1, #self.Rows do + local row = self.Rows[x] + if(row) then + row.Objectives:Reset(true); + end + end +end + +local _hook_WorldMapFrameOnHide = function() + if(not WORLDMAP_UPDATE) then return end + MOD.Headers["Quests"]:Reset() + MOD.Headers["Quests"]:Refresh() + MOD:UpdateDimensions(); +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +function MOD:UpdateObjectives(event, ...) + -- print('<-----QUESTS') + -- print(event) + -- print(...) + if(event == "ZONE_CHANGED_NEW_AREA") then + if(not WorldMapFrame:IsShown() and GetCVarBool("questPOI")) then + SetMapToCurrentZone(); + CURRENT_MAP_ID = GetCurrentMapAreaID(); + UpdateCachedDistance(); + self.Headers["Quests"]:LiteReset() + self.Headers["Quests"]:Refresh(event, ...) + end + elseif(event == "ZONE_CHANGED") then + local inMicroDungeon = IsPlayerInMicroDungeon(); + if(inMicroDungeon ~= self.inMicroDungeon) then + if(not WorldMapFrame:IsShown() and GetCVarBool("questPOI")) then + SetMapToCurrentZone(); + CURRENT_MAP_ID = GetCurrentMapAreaID(); + UpdateCachedDistance(); + self.Headers["Quests"]:LiteReset() + self.Headers["Quests"]:Refresh(event, ...) + end + self.inMicroDungeon = inMicroDungeon; + end + else + if(event == "QUEST_ACCEPTED" or event == "QUEST_WATCH_LIST_CHANGED") then + local questLogIndex, questID, isTracked; + if(event == "QUEST_ACCEPTED") then + questLogIndex, questID = ...; + if(AUTO_QUEST_WATCH == "1") then + AddQuestWatch(questLogIndex); + QuestSuperTracking_OnQuestTracked(questID); + end + local addedQuest = AddCachedQuest(questLogIndex) + if(addedQuest) then + self.Headers["Quests"]:AddQuest(addedQuest) + self:UpdateDimensions(); + end + elseif(event == "QUEST_WATCH_LIST_CHANGED") then + questID, isTracked = ...; + if(questID) then + local questLogIndex = GetQuestLogIndexByID(questID) + if(isTracked) then + local addedQuest = AddCachedQuest(questLogIndex) + self.Headers["Quests"]:AddQuest(addedQuest) + else + CACHED_QUESTS[questID] = nil; + self:CheckActiveQuest(questID); + self.Headers["Quests"]:Reset(); + self.Headers["Quests"]:Refresh(event, ...) + end + self:UpdateDimensions(); + end + end + elseif(event == "QUEST_TURNED_IN") then + local questID, XP, Money = ... + if(IsQuestTask(questID)) then + self:CacheBonusObjective(event, ...); + end + if(CACHED_QUESTS[questID]) then + CACHED_QUESTS[questID] = nil; + self:CheckActiveQuest(questID); + self.Headers["Quests"]:Reset(); + self.Headers["Quests"]:Refresh(event, ...); + self:UpdateDimensions(); + end + elseif(event == "QUEST_LOG_UPDATE") then + self.Headers["Quests"]:Reset(); + self.Headers["Quests"]:Refresh(event, ...) + self:UpdateBonusObjective(event, ...); + self:UpdateDimensions(); + else + self:UpdateBonusObjective(event, ...) + end + end +end + +local function UpdateQuestLocals(...) + ROW_WIDTH, ROW_HEIGHT, INNER_HEIGHT, LARGE_ROW_HEIGHT, LARGE_INNER_HEIGHT = ...; + QUEST_ROW_HEIGHT = ROW_HEIGHT + 2; +end + +SV.Events:On("QUEST_UPVALUES_UPDATED", "UpdateQuestLocals", UpdateQuestLocals); + +function MOD:InitializeQuests() + local scrollChild = self.Docklet.ScrollFrame.ScrollChild; + + local quests = CreateFrame("Frame", nil, scrollChild) + quests:SetWidth(ROW_WIDTH); + quests:SetHeightToScale(ROW_HEIGHT); + quests:SetPoint("TOPLEFT", self.Headers["Bonus"], "BOTTOMLEFT", 0, -4); + --quests:SetStylePanel() + + quests.Header = CreateFrame("Frame", nil, quests) + quests.Header:SetPoint("TOPLEFT", quests, "TOPLEFT", 2, -2); + quests.Header:SetPoint("TOPRIGHT", quests, "TOPRIGHT", -2, -2); + quests.Header:SetHeightToScale(INNER_HEIGHT); + + quests.Header.Text = quests.Header:CreateFontString(nil,"OVERLAY") + quests.Header.Text:SetPoint("TOPLEFT", quests.Header, "TOPLEFT", 2, 0); + quests.Header.Text:SetPoint("BOTTOMLEFT", quests.Header, "BOTTOMLEFT", 2, 0); + quests.Header.Text:SetFont(SV.Media.font.narrator, 16, "OUTLINE") + quests.Header.Text:SetJustifyH('LEFT') + quests.Header.Text:SetJustifyV('MIDDLE') + quests.Header.Text:SetTextColor(0.28,0.75,1) + quests.Header.Text:SetShadowOffset(-1,-1) + quests.Header.Text:SetShadowColor(0,0,0,0.5) + quests.Header.Text:SetText(TRACKER_HEADER_QUESTS) + + quests.Header.Divider = quests.Header:CreateTexture(nil, 'BACKGROUND'); + quests.Header.Divider:SetPoint("TOPLEFT", quests.Header.Text, "TOPRIGHT", -10, 0); + quests.Header.Divider:SetPoint("BOTTOMRIGHT", quests.Header, "BOTTOMRIGHT", 0, 0); + quests.Header.Divider:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DROPDOWN-DIVIDER]]); + + quests.Rows = {}; + + quests.Get = GetQuestRow; + quests.Set = SetQuestRow; + quests.SetZone = SetZoneHeader; + quests.Refresh = RefreshQuests; + quests.AddQuest = AddOneQuest; + quests.Reset = ResetQuestBlock; + quests.LiteReset = LiteResetQuestBlock; + + self.Headers["Quests"] = quests; + + self:RegisterEvent("QUEST_LOG_UPDATE", self.UpdateObjectives); + self:RegisterEvent("QUEST_WATCH_LIST_CHANGED", self.UpdateObjectives); + self:RegisterEvent("QUEST_ACCEPTED", self.UpdateObjectives); + self:RegisterEvent("QUEST_POI_UPDATE", self.UpdateObjectives); + self:RegisterEvent("QUEST_TURNED_IN", self.UpdateObjectives); + + self:RegisterEvent("ZONE_CHANGED_NEW_AREA", self.UpdateObjectives); + self:RegisterEvent("ZONE_CHANGED", self.UpdateObjectives); + + CacheQuestHeaders() + self.Headers["Quests"]:Reset() + self.Headers["Quests"]:Refresh() + + WorldMapFrame:HookScript("OnHide", _hook_WorldMapFrameOnHide) +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/quest/components/scenario.lua b/Interface/AddOns/SVUI/packages/quest/components/scenario.lua new file mode 100644 index 0000000..fabf194 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/quest/components/scenario.lua @@ -0,0 +1,483 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local string = _G.string; +local math = _G.math; +local table = _G.table; +--[[ STRING METHODS ]]-- +local format = string.format; +--[[ MATH METHODS ]]-- +local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; +--[[ TABLE METHODS ]]-- +local tremove, twipe = table.remove, table.wipe; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local LSM = LibStub("LibSharedMedia-3.0") +local MOD = SV.SVQuest; +--[[ +########################################################## +LOCALS +########################################################## +]]-- +local ROW_WIDTH = 300; +local ROW_HEIGHT = 24; +local INNER_HEIGHT = ROW_HEIGHT - 4; +local LARGE_ROW_HEIGHT = ROW_HEIGHT * 2; +local LARGE_INNER_HEIGHT = LARGE_ROW_HEIGHT - 4; + +local NO_ICON = [[Interface\AddOns\SVUI\assets\artwork\Template\EMPTY]]; +local OBJ_ICON_ACTIVE = [[Interface\COMMON\Indicator-Yellow]]; +local OBJ_ICON_COMPLETE = [[Interface\COMMON\Indicator-Green]]; +local OBJ_ICON_INCOMPLETE = [[Interface\COMMON\Indicator-Gray]]; + +local LINE_FAILED_ICON = [[Interface\ICONS\Ability_Blackhand_Marked4Death]]; +local LINE_SCENARIO_ICON = [[Interface\ICONS\Icon_Scenarios]]; +local LINE_CHALLENGE_ICON = [[Interface\ICONS\Achievement_ChallengeMode_Platinum]]; +--[[ +########################################################## +SCRIPT HANDLERS +########################################################## +]]-- +local TimerBar_OnUpdate = function(self, elapsed) + local statusbar = self.Bar + statusbar.elapsed = statusbar.elapsed + elapsed; + local currentTime = statusbar.duration - statusbar.elapsed + local timeString = GetTimeStringFromSeconds(currentTime) + local r,g,b = MOD:GetTimerTextColor(statusbar.duration, statusbar.elapsed) + if(statusbar.elapsed <= statusbar.duration) then + statusbar:SetValue(currentTime); + statusbar.TimeLeft:SetText(timeString); + statusbar.TimeLeft:SetTextColor(r,g,b); + else + self:StopTimer() + end +end +--[[ +########################################################## +TRACKER FUNCTIONS +########################################################## +]]-- +local SetScenarioData = function(self, title, stageName, currentStage, numStages, stageDescription, numObjectives) + local objective_rows = 0; + local fill_height = 0; + local block = self.Block; + + block.HasData = true; + if(currentStage ~= 0) then + block.Header.Stage:SetText("Stage " .. currentStage) + else + block.Header.Stage:SetText('') + end + block.Header.Text:SetText(title) + block.Icon:SetTexture(LINE_SCENARIO_ICON) + + local objective_block = block.Objectives; + for i = 1, numObjectives do + local description, criteriaType, completed, quantity, totalQuantity, flags, assetID, quantityString, criteriaID, duration, elapsed, failed = C_Scenario.GetCriteriaInfo(i); + if(duration > 0 and elapsed <= duration and not (failed or completed)) then + objective_rows = objective_block:SetTimer(objective_rows, duration, elapsed); + fill_height = fill_height + (INNER_HEIGHT + 2); + elseif(description and description ~= '') then + objective_rows = objective_block:SetInfo(objective_rows, description, completed, failed); + fill_height = fill_height + (INNER_HEIGHT + 2); + end + end + + local timerHeight = self.Timer:GetHeight() + + if(objective_rows > 0) then + objective_block:SetHeightToScale(fill_height); + objective_block:FadeIn(); + end + + fill_height = fill_height + (LARGE_ROW_HEIGHT + 2) + timerHeight; + block:SetHeightToScale(fill_height); + + MOD.Docklet.ScrollFrame.ScrollBar:SetValue(0) +end + +local UnsetScenarioData = function(self) + local block = self.Block; + block:SetHeight(1); + block.Header.Text:SetText(''); + block.Header.Stage:SetText(''); + block.Icon:SetTexture(LINE_SCENARIO_ICON); + block.HasData = false; + block.Objectives:Reset() + self:SetHeight(1); + self:SetAlpha(0); +end + +local RefreshScenarioHeight = function(self) + if(not self.Block.HasData) then + self:Unset(); + else + local h1 = self.Timer:GetHeight() + local h2 = self.Block:GetHeight() + self:SetHeight(h1 + h2 + 2); + self:FadeIn(); + end +end +--[[ +########################################################## +TIMER FUNCTIONS +########################################################## +]]-- +local MEDAL_TIMES = {}; +local LAST_MEDAL; + +local StartTimer = function(self, elapsed, duration, medalIndex, currWave, maxWave) + self:SetHeight(INNER_HEIGHT); + self:FadeIn(); + self.Bar.duration = duration or 1; + self.Bar.elapsed = elapsed or 0; + self.Bar:SetMinMaxValues(0, self.Bar.duration); + self.Bar:SetValue(self.Bar.elapsed); + self:SetScript("OnUpdate", TimerBar_OnUpdate); + local blockHeight = MOD.Headers["Scenario"].Block:GetHeight(); + MOD.Headers["Scenario"].Block:SetHeight(blockHeight + INNER_HEIGHT + 4); + + if (medalIndex < 4) then + self.Bar.Wave:SetFormattedText(GENERIC_FRACTION_STRING, currWave, maxWave); + else + self.Bar.Wave:SetText(currWave); + end +end + +local StopTimer = function(self) + local timerHeight = self:GetHeight(); + self:SetHeight(1); + self:SetAlpha(0); + self.Bar.duration = 1; + self.Bar.elapsed = 0; + self.Bar:SetMinMaxValues(0, self.Bar.duration); + self.Bar:SetValue(0); + self:SetScript("OnUpdate", nil); + local blockHeight = MOD.Headers["Scenario"].Block:GetHeight(); + MOD.Headers["Scenario"].Block:SetHeight((blockHeight - timerHeight) + 1); +end + +local SetChallengeMedals = function(self, elapsedTime, ...) + self:SetHeight(INNER_HEIGHT); + local blockHeight = MOD.Block:GetHeight(); + MOD.Headers["Scenario"].Block:SetHeight(blockHeight + INNER_HEIGHT + 4); + self:FadeIn(); + self.Bar:SetMinMaxValues(0, elapsedTime); + self.Bar:SetValue(elapsedTime); + + for i = 1, select("#", ...) do + MEDAL_TIMES[i] = select(i, ...); + end + LAST_MEDAL = nil; + self:UpdateMedals(elapsedTime); + self:UpdateMedals(elapsedTime); +end + +local UpdateChallengeMedals = function(self, elapsedTime) + local prevMedalTime = 0; + for i = #MEDAL_TIMES, 1, -1 do + local currentMedalTime = MEDAL_TIMES[i]; + if ( elapsedTime < currentMedalTime ) then + self.Bar:SetMinMaxValues(0, currentMedalTime - prevMedalTime); + self.Bar.medalTime = currentMedalTime; + if(CHALLENGE_MEDAL_TEXTURES[i]) then + self.Icon:SetTexture(CHALLENGE_MEDAL_TEXTURES[i]); + end + if(LAST_MEDAL and LAST_MEDAL ~= i) then + if(LAST_MEDAL == CHALLENGE_MEDAL_GOLD) then + PlaySound("UI_Challenges_MedalExpires_GoldtoSilver"); + elseif(LAST_MEDAL == CHALLENGE_MEDAL_SILVER) then + PlaySound("UI_Challenges_MedalExpires_SilvertoBronze"); + else + PlaySound("UI_Challenges_MedalExpires"); + end + end + LAST_MEDAL = i; + return; + else + prevMedalTime = currentMedalTime; + end + end + + self.Bar.TimeLeft:SetText(CHALLENGES_TIMER_NO_MEDAL); + self.Bar:SetValue(0); + self.Bar.medalTime = nil; + self:SetHeight(1) + self.Icon:SetTexture(LINE_FAILED_ICON); + + if(LAST_MEDAL and LAST_MEDAL ~= 0) then + PlaySound("UI_Challenges_MedalExpires"); + end + + LAST_MEDAL = 0; +end + + +local UpdateChallengeTimer = function(self, elapsedTime) + local statusBar = self.Bar; + if ( statusBar.medalTime ) then + local timeLeft = statusBar.medalTime - elapsedTime; + if (timeLeft == 10) then + if (not statusBar.playedSound) then + PlaySoundKitID(34154); + statusBar.playedSound = true; + end + else + statusBar.playedSound = false; + end + if(timeLeft < 0) then + self:UpdateMedals(elapsedTime); + else + statusBar:SetValue(timeLeft); + statusBar.TimeLeft:SetText(GetTimeStringFromSeconds(timeLeft)); + end + end +end + +local UpdateAllTimers = function(self, ...) + local timeLeftFound + for i = 1, select("#", ...) do + local timerID = select(i, ...); + local _, elapsedTime, type = GetWorldElapsedTime(timerID); + if ( type == LE_WORLD_ELAPSED_TIMER_TYPE_CHALLENGE_MODE) then + local _, _, _, _, _, _, _, mapID = GetInstanceInfo(); + if ( mapID ) then + self:SetMedals(elapsedTime, GetChallengeModeMapTimes(mapID)); + return; + end + elseif ( type == LE_WORLD_ELAPSED_TIMER_TYPE_PROVING_GROUND ) then + local diffID, currWave, maxWave, duration = C_Scenario.GetProvingGroundsInfo() + if (duration > 0) then + self:StartTimer(elapsedTime, duration, diffID, currWave, maxWave) + return; + end + end + end + --self:StopTimer() +end + +local RefreshScenarioObjective = function(self, event, ...) + if(C_Scenario.IsInScenario()) then + if(event == "PLAYER_ENTERING_WORLD") then + self.Timer:UpdateTimers(GetWorldElapsedTimers()); + elseif(event == "WORLD_STATE_TIMER_START") then + self.Timer:UpdateTimers(...) + elseif(event == "WORLD_STATE_TIMER_STOP") then + self.Timer:StopTimer() + elseif(event == "PROVING_GROUNDS_SCORE_UPDATE") then + local score = ... + self.Block.Header.Score:SetText(score); + elseif(event == "SCENARIO_COMPLETED" or event == 'SCENARIO_UPDATE' or event == 'SCENARIO_CRITERIA_UPDATE') then + if(event == "SCENARIO_COMPLETED") then + self.Timer:StopTimer() + else + self.Block.Objectives:Reset() + local title, currentStage, numStages, flags, _, _, _, xp, money = C_Scenario.GetInfo(); + if(title) then + local stageName, stageDescription, numObjectives = C_Scenario.GetStepInfo(); + -- local inChallengeMode = bit.band(flags, SCENARIO_FLAG_CHALLENGE_MODE) == SCENARIO_FLAG_CHALLENGE_MODE; + -- local inProvingGrounds = bit.band(flags, SCENARIO_FLAG_PROVING_GROUNDS) == SCENARIO_FLAG_PROVING_GROUNDS; + -- local dungeonDisplay = bit.band(flags, SCENARIO_FLAG_USE_DUNGEON_DISPLAY) == SCENARIO_FLAG_USE_DUNGEON_DISPLAY; + local scenariocompleted = currentStage > numStages; + if(not scenariocompleted) then + self:Set(title, stageName, currentStage, numStages, stageDescription, numObjectives) + if(currentStage > 1) then + PlaySound("UI_Scenario_Stage_End"); + end + else + self.Timer:StopTimer() + self.Block.HasData = false + end + end + end + end + else + self.Timer:StopTimer() + self.Block.HasData = false + end + + self:RefreshHeight() +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +function MOD:UpdateScenarioObjective(event, ...) + self.Headers["Scenario"]:Refresh(event, ...) + self:UpdateDimensions(); +end + +local function UpdateScenarioLocals(...) + ROW_WIDTH, ROW_HEIGHT, INNER_HEIGHT, LARGE_ROW_HEIGHT, LARGE_INNER_HEIGHT = ...; +end + +SV.Events:On("QUEST_UPVALUES_UPDATED", "UpdateScenarioLocals", UpdateScenarioLocals); + +function MOD:InitializeScenarios() + local scrollChild = self.Docklet.ScrollFrame.ScrollChild; + + local scenario = CreateFrame("Frame", nil, scrollChild) + scenario:SetWidth(ROW_WIDTH); + scenario:SetHeight(ROW_HEIGHT); + scenario:SetPoint("TOPLEFT", self.Headers["Active"], "BOTTOMLEFT", 0, -6); + + scenario.Set = SetScenarioData; + scenario.Unset = UnsetScenarioData; + scenario.Refresh = RefreshScenarioObjective; + scenario.RefreshHeight = RefreshScenarioHeight; + + local block = CreateFrame("Frame", nil, scenario) + block:SetPointToScale("TOPLEFT", scenario, "TOPLEFT", 2, -2); + block:SetPointToScale("TOPRIGHT", scenario, "TOPRIGHT", -2, -2); + block:SetHeight(1); + block:SetStylePanel("Framed", "Headline"); + + block.Badge = CreateFrame("Frame", nil, block) + block.Badge:SetPointToScale("TOPLEFT", block, "TOPLEFT", 4, -4); + block.Badge:SetSizeToScale((LARGE_INNER_HEIGHT - 4), (LARGE_INNER_HEIGHT - 4)); + block.Badge:SetStylePanel("Fixed", "Inset") + + block.Icon = block.Badge:CreateTexture(nil,"OVERLAY") + block.Icon:SetAllPointsIn(block.Badge); + block.Icon:SetTexture(LINE_SCENARIO_ICON) + block.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + + block.Header = CreateFrame("Frame", nil, block) + block.Header:SetPointToScale("TOPLEFT", block.Badge, "TOPRIGHT", 4, -1); + block.Header:SetPointToScale("TOPRIGHT", block, "TOPRIGHT", -4, 0); + block.Header:SetHeightToScale(INNER_HEIGHT); + block.Header:SetStylePanel("Default") + + block.Header.Stage = block.Header:CreateFontString(nil,"OVERLAY") + block.Header.Stage:SetFont(SV.Media.font.default, 13, "NONE") + block.Header.Stage:SetShadowOffset(-1,-1) + block.Header.Stage:SetShadowColor(0,0,0,0.5) + block.Header.Stage:SetJustifyH('LEFT') + block.Header.Stage:SetJustifyV('MIDDLE') + block.Header.Stage:SetText('') + block.Header.Stage:SetPointToScale("TOPLEFT", block.Header, "TOPLEFT", 4, 0); + block.Header.Stage:SetPointToScale("BOTTOMLEFT", block.Header, "BOTTOMLEFT", 4, 0); + + block.Header.Score = block.Header:CreateFontString(nil,"OVERLAY") + block.Header.Score:SetFont(SV.Media.font.default, 13, "NONE") + block.Header.Score:SetTextColor(1,1,0) + block.Header.Score:SetShadowOffset(-1,-1) + block.Header.Score:SetShadowColor(0,0,0,0.5) + block.Header.Score:SetJustifyH('RIGHT') + block.Header.Score:SetJustifyV('MIDDLE') + block.Header.Score:SetText('') + block.Header.Score:SetPointToScale("TOPRIGHT", block.Header, "TOPRIGHT", -2, 0); + block.Header.Score:SetPointToScale("BOTTOMRIGHT", block.Header, "BOTTOMRIGHT", -2, 0); + + block.Header.Text = block.Header:CreateFontString(nil,"OVERLAY") + block.Header.Text:SetFont(SV.Media.font.default, 13, "NONE") + block.Header.Text:SetTextColor(1,1,0) + block.Header.Text:SetShadowOffset(-1,-1) + block.Header.Text:SetShadowColor(0,0,0,0.5) + block.Header.Text:SetJustifyH('CENTER') + block.Header.Text:SetJustifyV('MIDDLE') + block.Header.Text:SetText('') + block.Header.Text:SetPointToScale("TOPLEFT", block.Header.Stage, "TOPRIGHT", 4, 0); + block.Header.Text:SetPointToScale("BOTTOMRIGHT", block.Header.Score, "BOTTOMRIGHT", 0, 0); + + local timer = CreateFrame("Frame", nil, block.Header) + timer:SetPointToScale("TOPLEFT", block.Header, "BOTTOMLEFT", 4, -4); + timer:SetPointToScale("TOPRIGHT", block.Header, "BOTTOMRIGHT", -4, -4); + timer:SetHeight(INNER_HEIGHT); + timer:SetStylePanel("Fixed", "Bar"); + + timer.StartTimer = StartTimer; + timer.StopTimer = StopTimer; + timer.UpdateTimers = UpdateAllTimers; + timer.SetMedals = SetChallengeMedals; + timer.UpdateMedals = UpdateChallengeMedals; + timer.UpdateChallenges = UpdateChallengeTimer; + + timer.Bar = CreateFrame("StatusBar", nil, timer); + timer.Bar:SetAllPoints(timer); + timer.Bar:SetStatusBarTexture(SV.Media.bar.default) + timer.Bar:SetStatusBarColor(0.5,0,1) --1,0.15,0.08 + timer.Bar:SetMinMaxValues(0, 1) + timer.Bar:SetValue(0) + + timer.Bar.Wave = timer.Bar:CreateFontString(nil,"OVERLAY") + timer.Bar.Wave:SetPointToScale("TOPLEFT", timer.Bar, "TOPLEFT", 4, 0); + timer.Bar.Wave:SetPointToScale("BOTTOMLEFT", timer.Bar, "BOTTOMLEFT", 4, 0); + timer.Bar.Wave:SetFont(SV.Media.font.default, 11, "NONE") + timer.Bar.Wave:SetTextColor(1,1,0) + timer.Bar.Wave:SetShadowOffset(-1,-1) + timer.Bar.Wave:SetShadowColor(0,0,0,0.5) + timer.Bar.Wave:SetJustifyH('LEFT') + timer.Bar.Wave:SetJustifyV('MIDDLE') + timer.Bar.Wave:SetText('') + + timer.Bar.TimeLeft = timer.Bar:CreateFontString(nil,"OVERLAY"); + timer.Bar.TimeLeft:SetPointToScale("TOPLEFT", timer.Bar.Wave, "TOPRIGHT", 4, 0); + timer.Bar.TimeLeft:SetPointToScale("BOTTOMRIGHT", timer.Bar, "BOTTOMRIGHT", 0, 0); + timer.Bar.TimeLeft:SetFont(SV.Media.font.numbers, 12, "OUTLINE") + timer.Bar.TimeLeft:SetTextColor(1,1,1) + timer.Bar.TimeLeft:SetShadowOffset(-1,-1) + timer.Bar.TimeLeft:SetShadowColor(0,0,0,0.5) + timer.Bar.TimeLeft:SetJustifyH('CENTER') + timer.Bar.TimeLeft:SetJustifyV('MIDDLE') + timer.Bar.TimeLeft:SetText('') + + timer.Icon = block.Icon; + timer:SetHeight(1); + timer:SetAlpha(0) + + block.Objectives = MOD:NewObjectiveHeader(block); + block.Objectives:SetPointToScale("TOPLEFT", timer, "BOTTOMLEFT", -4, -4); + block.Objectives:SetPointToScale("TOPRIGHT", timer, "BOTTOMRIGHT", 4, -4); + block.Objectives:SetHeightToScale(1); + + block.HasData = false; + + scenario.Timer = timer; + scenario.Block = block; + + self.Headers["Scenario"] = scenario; + + self.Headers["Scenario"]:RefreshHeight() + + self:RegisterEvent("PLAYER_ENTERING_WORLD", self.UpdateScenarioObjective); + self:RegisterEvent("PROVING_GROUNDS_SCORE_UPDATE", self.UpdateScenarioObjective); + self:RegisterEvent("WORLD_STATE_TIMER_START", self.UpdateScenarioObjective); + self:RegisterEvent("WORLD_STATE_TIMER_STOP", self.UpdateScenarioObjective); + self:RegisterEvent("SCENARIO_UPDATE", self.UpdateScenarioObjective); + self:RegisterEvent("SCENARIO_CRITERIA_UPDATE", self.UpdateScenarioObjective); + self:RegisterEvent("SCENARIO_COMPLETED", self.UpdateScenarioObjective); +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/quest/components/working_quests.lua b/Interface/AddOns/SVUI/packages/quest/components/working_quests.lua new file mode 100644 index 0000000..180d346 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/quest/components/working_quests.lua @@ -0,0 +1,823 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local string = _G.string; +local math = _G.math; +local table = _G.table; +local tinsert = _G.tinsert; +local tremove = _G.tremove; +local wipe = _G.wipe; +--[[ STRING METHODS ]]-- +local format = string.format; +--[[ MATH METHODS ]]-- +local abs, ceil, floor, round, maxNum = math.abs, math.ceil, math.floor, math.round, math.max; +--[[ TABLE METHODS ]]-- +local tsort, tcopy = table.sort, table.copy; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local LSM = LibStub("LibSharedMedia-3.0") +local MOD = SV.SVQuest; +--[[ +########################################################## +LOCALS +########################################################## +]]-- +local ROW_WIDTH = 300; +local ROW_HEIGHT = 20; +local QUEST_ROW_HEIGHT = ROW_HEIGHT + 2; +local INNER_HEIGHT = ROW_HEIGHT - 4; +local LARGE_ROW_HEIGHT = ROW_HEIGHT * 2; +local LARGE_INNER_HEIGHT = LARGE_ROW_HEIGHT - 4; + +local NO_ICON = [[Interface\AddOns\SVUI\assets\artwork\Template\EMPTY]]; +local OBJ_ICON_ACTIVE = [[Interface\COMMON\Indicator-Yellow]]; +local OBJ_ICON_COMPLETE = [[Interface\COMMON\Indicator-Green]]; +local OBJ_ICON_INCOMPLETE = [[Interface\COMMON\Indicator-Gray]]; + +local QUEST_ICON = [[Interface\AddOns\SVUI\assets\artwork\Quest\QUEST-INCOMPLETE-ICON]]; +local QUEST_ICON_COMPLETE = [[Interface\AddOns\SVUI\assets\artwork\Quest\QUEST-COMPLETE-ICON]]; + +local CACHED_QUESTS = {}; +local USED_QUESTIDS = {}; +local CURRENT_MAP_ID = 0; +local WORLDMAP_UPDATE = false; + +local DEFAULT_COLOR = {r = 1, g = 0.68, b = 0.1} + +local QuestInZone = { + [14108] = 541, + [13998] = 11, + [25798] = 61, + [25799] = 61, + [25112] = 161, + [25111] = 161, + [24735] = 201, +}; + +local function UpdateCachedQuests() + local s = 62500; + local x = 1; + local c = 0; + local li = 0; + + local numWatch = GetNumQuestWatches(); + local numCache = #CACHED_QUESTS; + local numItems = maxNum(numWatch, numCache) + + --wipe(USED_QUESTIDS); + wipe(CACHED_QUESTS); + + for i = 1, GetNumQuestWatches() do + local questID, _, questLogIndex, numObjectives, _, completed, _, _, duration, elapsed, questType, isTask, isStory, isOnMap, hasLocalPOI = GetQuestWatchInfo(i); + if(questID) then -- and (not USED_QUESTIDS[questID]) + local title, level, suggestedGroup = GetQuestLogTitle(questLogIndex) + local link, texture, _, showCompleted = GetQuestLogSpecialItemInfo(questLogIndex) + local distanceSq, onContinent = GetDistanceSqToQuest(questLogIndex) + local mapID, floorNumber = 0,0 + if(not WorldMapFrame:IsShown()) then + mapID, floorNumber = GetQuestWorldMapAreaID(questID) + else + WORLDMAP_UPDATE = true; + end + if(link and QuestHasPOIInfo(questID)) then + local areaID = QuestInZone[questID] + if(areaID and (areaID == CURRENT_MAP_ID)) then + c = x + li = questLogIndex + elseif(onContinent and (distanceSq < s)) then + s = distanceSq + c = x + li = questLogIndex + end + end + + if(not CACHED_QUESTS[x]) then + CACHED_QUESTS[x] = { 0, false, 0, 0, 0, false, {"", 100, QUEST_ICON, 0, 0, 0, 0, 0, false, 0} }; + end + + CACHED_QUESTS[x][1] = i; -- quest watch index + CACHED_QUESTS[x][2] = link; -- quest item link + CACHED_QUESTS[x][3] = mapID; -- quest location map id + CACHED_QUESTS[x][4] = floorNumber; -- quest location floor number + CACHED_QUESTS[x][5] = distanceSq; -- quest distance from player + CACHED_QUESTS[x][6] = false; -- quest closest to player + CACHED_QUESTS[x][7][1] = title; -- args: quest title + CACHED_QUESTS[x][7][2] = level; -- args: quest level + CACHED_QUESTS[x][7][3] = texture; -- args: quest item icon + CACHED_QUESTS[x][7][4] = questID; -- args: quest id + CACHED_QUESTS[x][7][5] = questLogIndex; -- args: quest log index + CACHED_QUESTS[x][7][6] = numObjectives; -- args: quest objective count + CACHED_QUESTS[x][7][7] = duration; -- args: quest timer duration + CACHED_QUESTS[x][7][8] = elapsed; -- args: quest timer elapsed + CACHED_QUESTS[x][7][9] = completed; -- args: quest is completed + CACHED_QUESTS[x][7][10] = questType; -- args: quest type + + --USED_QUESTIDS[questID] = true; + + if(questID == MOD.ActiveQuestID) then + MOD:UpdateActiveObjective('FORCED_UPDATE', CACHED_QUESTS[x][7]) + end + + x = x + 1; + end + end + + if(c ~= 0 and CACHED_QUESTS[c]) then + CACHED_QUESTS[c][6] = true; + MOD.ClosestQuest = li; + end + + tsort(CACHED_QUESTS, function(a,b) + if(a[5] and b[5]) then + return a[5] < b[5] + else + return false + end + end); + tsort(CACHED_QUESTS, function(a,b) + if(a[3] and b[3]) then + return a[3] < b[3] + else + return false + end + end); +end + +local function UpdateCachedDistance() + local s = 62500; + + for i = 1, #CACHED_QUESTS do + local data = CACHED_QUESTS[i][7]; + local questLogIndex = data[5]; + local distanceSq, onContinent = GetDistanceSqToQuest(questLogIndex) + + CACHED_QUESTS[i][5] = distanceSq; -- quest distance from player + CACHED_QUESTS[i][6] = false; -- quest closest to player + end + + tsort(CACHED_QUESTS, function(a,b) + if(a[5] and b[5]) then + return a[5] < b[5] + else + return false + end + end); + tsort(CACHED_QUESTS, function(a,b) + if(a[3] and b[3]) then + return a[3] < b[3] + else + return false + end + end); +end + +local function AddCachedQuest(questLogIndex) + local x = #CACHED_QUESTS + 1; + + if(questLogIndex) then -- and (not USED_QUESTIDS[questID]) + local i = GetQuestWatchIndex(questLogIndex) + if(i) then + local questID, _, _, numObjectives, _, completed, _, _, duration, elapsed, questType, isTask, isStory, isOnMap, hasLocalPOI = GetQuestWatchInfo(i); + local title, level, suggestedGroup = GetQuestLogTitle(questLogIndex) + local link, texture, _, showCompleted = GetQuestLogSpecialItemInfo(questLogIndex) + local distanceSq, onContinent = GetDistanceSqToQuest(questLogIndex) + local mapID, floorNumber = 0,0 + if(not WorldMapFrame:IsShown()) then + mapID, floorNumber = GetQuestWorldMapAreaID(questID) + else + WORLDMAP_UPDATE = true; + end + + if(not CACHED_QUESTS[x]) then + CACHED_QUESTS[x] = { 0, false, 0, 0, 0, false, {"", 100, QUEST_ICON, 0, 0, 0, 0, 0, false, 0} }; + end + + CACHED_QUESTS[x][1] = i; -- quest watch index + CACHED_QUESTS[x][2] = link; -- quest item link + CACHED_QUESTS[x][3] = mapID; -- quest location map id + CACHED_QUESTS[x][4] = floorNumber; -- quest location floor number + CACHED_QUESTS[x][5] = distanceSq; -- quest distance from player + CACHED_QUESTS[x][6] = false; -- quest closest to player + CACHED_QUESTS[x][7][1] = title; -- args: quest title + CACHED_QUESTS[x][7][2] = level; -- args: quest level + CACHED_QUESTS[x][7][3] = texture; -- args: quest item icon + CACHED_QUESTS[x][7][4] = questID; -- args: quest id + CACHED_QUESTS[x][7][5] = questLogIndex; -- args: quest log index + CACHED_QUESTS[x][7][6] = numObjectives; -- args: quest objective count + CACHED_QUESTS[x][7][7] = duration; -- args: quest timer duration + CACHED_QUESTS[x][7][8] = elapsed; -- args: quest timer elapsed + CACHED_QUESTS[x][7][9] = completed; -- args: quest is completed + CACHED_QUESTS[x][7][10] = questType; -- args: quest type + return true; + end + end + + return false; +end +--[[ +########################################################## +SCRIPT HANDLERS +########################################################## +]]-- +local TimerBar_OnUpdate = function(self, elapsed) + local statusbar = self.Timer.Bar + local timeNow = GetTime(); + local timeRemaining = statusbar.duration - (timeNow - statusbar.startTime); + statusbar:SetValue(timeRemaining); + if(timeRemaining < 0) then + -- hold at 0 for a moment + if(timeRemaining > -1) then + timeRemaining = 0; + else + self:StopTimer(); + end + end + local r,g,b = MOD:GetTimerTextColor(statusbar.duration, statusbar.duration - timeRemaining) + self.Timer.TimeLeft:SetText(GetTimeStringFromSeconds(timeRemaining, nil, true)); + self.Timer.TimeLeft:SetTextColor(r,g,b); +end + +local ActiveButton_OnClick = function(self, button) + local rowIndex = self:GetID(); + if(rowIndex and (rowIndex ~= 0)) then + local questID, _, questLogIndex, numObjectives, requiredMoney, completed, startEvent, isAutoComplete, duration, elapsed, questType, isTask, isStory, isOnMap, hasLocalPOI = GetQuestWatchInfo(rowIndex); + if(questID) then + local title, level, suggestedGroup = GetQuestLogTitle(questLogIndex) + local icon = self.Icon:GetTexture() + SetSuperTrackedQuestID(questID); + local link, texture, _, showCompleted = GetQuestLogSpecialItemInfo(questLogIndex) + MOD.QuestItem:SetAbility(link, texture, title, level, icon, questID, questLogIndex, numObjectives, duration, elapsed) + end + end +end + +local ViewButton_OnClick = function(self, button) + local questIndex = self:GetID(); + if(questIndex and (questIndex ~= 0)) then + local questID = select(8, GetQuestLogTitle(questIndex)); + if(IsModifiedClick("CHATLINK") and ChatEdit_GetActiveWindow()) then + local questLink = GetQuestLink(questIndex); + if(questLink) then + ChatEdit_InsertLink(questLink); + end + elseif(questID and button ~= "RightButton") then + CloseDropDownMenus(); + if(IsQuestComplete(questID) and GetQuestLogIsAutoComplete(questIndex)) then + AutoQuestPopupTracker_RemovePopUp(questID); + ShowQuestComplete(questIndex); + else + QuestLogPopupDetailFrame_Show(questIndex); + end + elseif(questID) then + if(IsShiftKeyDown()) then + QuestMapFrame_OpenToQuestDetails(questID); + else + RemoveQuestWatch(questIndex); + if(questID == superTrackedQuestID) then + QuestSuperTracking_OnQuestUntracked(); + end + end + end + end +end +--[[ +########################################################## +TRACKER FUNCTIONS +########################################################## +]]-- +local StartTimer = function(self, duration, elapsed) + local timeNow = GetTime(); + local startTime = timeNow - elapsed; + local timeRemaining = duration - startTime; + + self.Timer:SetHeightToScale(INNER_HEIGHT); + self.Timer:FadeIn(); + self.Timer.Bar.duration = duration or 1; + self.Timer.Bar.startTime = startTime; + self.Timer.Bar:SetMinMaxValues(0, self.Timer.Bar.duration); + self.Timer.Bar:SetValue(timeRemaining); + self.Timer.TimeLeft:SetText(GetTimeStringFromSeconds(duration, nil, true)); + self.Timer.TimeLeft:SetTextColor(MOD:GetTimerTextColor(duration, duration - timeRemaining)); + + self:SetScript("OnUpdate", TimerBar_OnUpdate); +end + +local StopTimer = function(self) + self.Timer:SetHeight(1); + self.Timer:SetAlpha(0); + self.Timer.Bar.duration = 1; + self.Timer.Bar.startTime = 0; + self.Timer.Bar:SetMinMaxValues(0, self.Timer.Bar.duration); + self.Timer.Bar:SetValue(0); + self.Timer.TimeLeft:SetText(''); + self.Timer.TimeLeft:SetTextColor(1,1,1); + + self:SetScript("OnUpdate", nil); +end + +local GetQuestRow = function(self, index) + if(not self.Rows[index]) then + local previousFrame = self.Rows[#self.Rows] + local index = #self.Rows + 1; + local yOffset = -3; + + local anchorFrame; + if(previousFrame and previousFrame.Objectives) then + anchorFrame = previousFrame.Objectives; + yOffset = -6; + else + anchorFrame = self.Header; + end + + local row = CreateFrame("Frame", nil, self) + row:SetPoint("TOPLEFT", anchorFrame, "BOTTOMLEFT", 0, yOffset); + row:SetPoint("TOPRIGHT", anchorFrame, "BOTTOMRIGHT", 0, yOffset); + row:SetHeightToScale(QUEST_ROW_HEIGHT); + + row.Badge = CreateFrame("Frame", nil, row) + row.Badge:SetPoint("TOPLEFT", row, "TOPLEFT", 0, 0); + row.Badge:SetSizeToScale(QUEST_ROW_HEIGHT, QUEST_ROW_HEIGHT); + row.Badge:SetStylePanel("Default", "Headline") + + row.Badge.Icon = row.Badge:CreateTexture(nil,"OVERLAY") + row.Badge.Icon:SetAllPoints(row.Badge); + row.Badge.Icon:SetTexture(QUEST_ICON) + row.Badge.Icon:SetTexCoord(0.05, 0.95, 0.05, 0.95) + + row.Badge.Button = CreateFrame("Button", nil, row.Badge) + row.Badge.Button:SetAllPoints(row.Badge); + row.Badge.Button:SetStylePanel("Button", true, 1, 1, 1) + row.Badge.Button:SetID(0) + row.Badge.Button.Icon = row.Badge.Icon; + row.Badge.Button:RegisterForClicks("LeftButtonUp", "RightButtonUp") + row.Badge.Button:SetScript("OnClick", ActiveButton_OnClick) + + row.Header = CreateFrame("Frame", nil, row) + row.Header:SetPoint("TOPLEFT", row, "TOPLEFT", (QUEST_ROW_HEIGHT + 6), 0); + row.Header:SetPoint("TOPRIGHT", row, "TOPRIGHT", -2, 0); + row.Header:SetHeightToScale(INNER_HEIGHT); + + row.Header.Level = row.Header:CreateFontString(nil,"OVERLAY") + row.Header.Level:SetFont(SV.Media.font.numbers, 11, "NONE") + row.Header.Level:SetShadowOffset(-1,-1) + row.Header.Level:SetShadowColor(0,0,0,0.5) + row.Header.Level:SetJustifyH('RIGHT') + row.Header.Level:SetJustifyV('MIDDLE') + row.Header.Level:SetText('') + row.Header.Level:SetPoint("TOPRIGHT", row.Header, "TOPRIGHT", -4, 0); + row.Header.Level:SetPoint("BOTTOMRIGHT", row.Header, "BOTTOMRIGHT", -4, 0); + + row.Header.Text = row.Header:CreateFontString(nil,"OVERLAY") + row.Header.Text:SetFont(SV.Media.font.default, 13, "NONE") + row.Header.Text:SetTextColor(1,1,0) + row.Header.Text:SetShadowOffset(-1,-1) + row.Header.Text:SetShadowColor(0,0,0,0.5) + row.Header.Text:SetJustifyH('LEFT') + row.Header.Text:SetJustifyV('MIDDLE') + row.Header.Text:SetText('') + row.Header.Text:SetPoint("TOPLEFT", row.Header, "TOPLEFT", 4, 0); + row.Header.Text:SetPoint("BOTTOMRIGHT", row.Header.Level, "BOTTOMLEFT", 0, 0); + + row.Header.Zone = row:CreateFontString(nil,"OVERLAY") + row.Header.Zone:SetAllPoints(row); + row.Header.Zone:SetFont(SV.Media.font.names, 11, "OUTLINE") + row.Header.Zone:SetJustifyH('LEFT') + row.Header.Zone:SetJustifyV('MIDDLE') + row.Header.Zone:SetTextColor(0.75,0.25,1) + row.Header.Zone:SetShadowOffset(-1,-1) + row.Header.Zone:SetShadowColor(0,0,0,0.5) + row.Header.Zone:SetText("") + + row.Button = CreateFrame("Button", nil, row.Header) + row.Button:SetAllPoints(row.Header); + row.Button:SetStylePanel("Button", "Headline", 1, 1, 1) + row.Button:SetID(0) + row.Button:RegisterForClicks("LeftButtonUp", "RightButtonUp") + row.Button:SetScript("OnClick", ViewButton_OnClick); + + row.Timer = CreateFrame("Frame", nil, row) + row.Timer:SetPointToScale("TOPLEFT", row, "BOTTOMLEFT", 0, 4); + row.Timer:SetPointToScale("TOPRIGHT", row, "BOTTOMRIGHT", 0, 4); + row.Timer:SetHeightToScale(INNER_HEIGHT); + + row.Timer.Bar = CreateFrame("StatusBar", nil, row.Timer); + row.Timer.Bar:SetPointToScale("TOPLEFT", row.Timer, "TOPLEFT", 4, -2); + row.Timer.Bar:SetPointToScale("BOTTOMRIGHT", row.Timer, "BOTTOMRIGHT", -4, 2); + row.Timer.Bar:SetStatusBarTexture(SV.Media.bar.default) + row.Timer.Bar:SetStatusBarColor(0.5,0,1) --1,0.15,0.08 + row.Timer.Bar:SetMinMaxValues(0, 1) + row.Timer.Bar:SetValue(0) + + local bgFrame = CreateFrame("Frame", nil, row.Timer.Bar) + bgFrame:SetAllPointsIn(row.Timer.Bar, -2, -2) + bgFrame:SetFrameLevel(bgFrame:GetFrameLevel() - 1) + + bgFrame.bg = bgFrame:CreateTexture(nil, "BACKGROUND") + bgFrame.bg:SetAllPoints(bgFrame) + bgFrame.bg:SetTexture(SV.Media.bar.default) + bgFrame.bg:SetVertexColor(0,0,0,0.5) + + local borderB = bgFrame:CreateTexture(nil,"OVERLAY") + borderB:SetTexture(0,0,0) + borderB:SetPoint("BOTTOMLEFT") + borderB:SetPoint("BOTTOMRIGHT") + borderB:SetHeight(2) + + local borderT = bgFrame:CreateTexture(nil,"OVERLAY") + borderT:SetTexture(0,0,0) + borderT:SetPoint("TOPLEFT") + borderT:SetPoint("TOPRIGHT") + borderT:SetHeight(2) + + local borderL = bgFrame:CreateTexture(nil,"OVERLAY") + borderL:SetTexture(0,0,0) + borderL:SetPoint("TOPLEFT") + borderL:SetPoint("BOTTOMLEFT") + borderL:SetWidth(2) + + local borderR = bgFrame:CreateTexture(nil,"OVERLAY") + borderR:SetTexture(0,0,0) + borderR:SetPoint("TOPRIGHT") + borderR:SetPoint("BOTTOMRIGHT") + borderR:SetWidth(2) + + row.Timer.TimeLeft = row.Timer.Bar:CreateFontString(nil,"OVERLAY"); + row.Timer.TimeLeft:SetAllPointsIn(row.Timer.Bar); + row.Timer.TimeLeft:SetFont(SV.Media.font.numbers, 12, "OUTLINE") + row.Timer.TimeLeft:SetTextColor(1,1,1) + row.Timer.TimeLeft:SetShadowOffset(-1,-1) + row.Timer.TimeLeft:SetShadowColor(0,0,0,0.5) + row.Timer.TimeLeft:SetJustifyH('CENTER') + row.Timer.TimeLeft:SetJustifyV('MIDDLE') + row.Timer.TimeLeft:SetText('') + + row.Timer:SetHeight(1); + row.Timer:SetAlpha(0); + + row.StartTimer = StartTimer; + row.StopTimer = StopTimer; + + row.Objectives = MOD:NewObjectiveHeader(row); + row.Objectives:SetPoint("TOPLEFT", row.Timer, "BOTTOMLEFT", 0, 0); + row.Objectives:SetPoint("TOPRIGHT", row.Timer, "BOTTOMRIGHT", 0, 0); + row.Objectives:SetHeight(1); + + row.RowID = 0; + self.Rows[index] = row; + return row; + end + + return self.Rows[index]; +end + +local SetQuestRow = function(self, index, watchIndex, title, level, icon, questID, questLogIndex, subCount, duration, elapsed, completed, questType) + index = index + 1; + + local fill_height = 0; + local iscomplete = true; + local objective_rows = 0; + local row = self:Get(index); + + if(not icon) then + icon = completed and QUEST_ICON_COMPLETE or QUEST_ICON + end + local color = DEFAULT_COLOR + if(level and type(level) == 'number') then + color = GetQuestDifficultyColor(level); + end + + row.Header:SetAlpha(1); + row.Header.Zone:SetText('') + row.Header.Level:SetTextColor(color.r, color.g, color.b) + row.Header.Level:SetText(level) + row.Header.Text:SetTextColor(color.r, color.g, color.b) + row.Header.Text:SetText(title) + row.Badge.Icon:SetTexture(icon); + row.Badge.Button:Enable(); + row.Badge.Button:SetID(watchIndex); + row.Badge:SetAlpha(1); + row.Button:SetAlpha(1); + row.Button:Enable(); + row.Button:SetID(questLogIndex); + row:SetHeightToScale(QUEST_ROW_HEIGHT); + row:FadeIn(); + + local objective_block = row.Objectives; + objective_block:Reset(); + + for i = 1, subCount do + local description, category, objective_completed = GetQuestObjectiveInfo(questID, i); + if not objective_completed then iscomplete = false end + if(description) then + fill_height = fill_height + (INNER_HEIGHT + 2); + objective_rows = objective_block:SetInfo(objective_rows, description, objective_completed); + end + end + + if(duration) then + if(elapsed and elapsed < duration) then + fill_height = fill_height + (INNER_HEIGHT + 2); + row:StartTimer(duration, elapsed) + end + end + + if(objective_rows > 0) then + objective_block:SetHeightToScale(fill_height); + objective_block:FadeIn(); + end + + if(iscomplete) then MOD.QuestItem:RemoveItem(questLogIndex) end + + fill_height = fill_height + (QUEST_ROW_HEIGHT + 6); + + return index, fill_height; +end + +local SetZoneHeader = function(self, index, mapID) + index = index + 1; + local row = self:Get(index); + row.Header.Level:SetText(''); + row.Header.Text:SetText(''); + row.Badge.Icon:SetTexture(NO_ICON); + row.Badge.Button:SetID(0); + row.Badge:SetAlpha(0); + row.Button:SetID(0); + row.Button:Disable(); + row.Button:SetAlpha(0); + row.Badge.Button:Disable(); + if(not mapID or (mapID and mapID == 0)) then + return index, 4 + end + local zoneName = GetMapNameByID(mapID); +--0.75,0.31,1 + row.Header.Zone:SetTextColor(1,0.31,0.1) + row.Header.Zone:SetText(zoneName); + row:SetHeightToScale(ROW_HEIGHT); + row:SetAlpha(1); + + local objective_block = row.Objectives; + objective_block:Reset(); + return index, mapID; +end + +local RefreshQuests = function(self, event, ...) + -- print('<-----QUESTS') + -- print(event) + -- print(...) + local rows = 0; + local fill_height = 0; + local zone = 0; + + for i = 1, #CACHED_QUESTS do + local quest = CACHED_QUESTS[i]; + local args = quest[7]; + if(quest[1] ~= 0 and args[4] ~= 0) then + local add_height = 0; + if(quest[6] and (not args[9])) then + MOD.QuestItem:SetAbility(quest[2], args[3], unpack(args)) + end + + if(zone ~= quest[3]) then + rows, zone = self:SetZone(rows, quest[3]); + fill_height = fill_height + QUEST_ROW_HEIGHT; + end + rows, add_height = self:Set(rows, quest[1], unpack(args)) + fill_height = fill_height + add_height; + end + end + + if(rows == 0 or (fill_height <= 1)) then + self:SetHeight(1); + self:SetAlpha(0); + else + self:SetHeightToScale(fill_height + 2); + self:FadeIn(); + end +end + +local AddOneQuest = function(self, event, ...) + -- print('<-----QUESTS') + -- print(event) + -- print(...) + local rows = #CACHED_QUESTS; + local fill_height = self:GetHeight(); + + local quest = CACHED_QUESTS[rows]; + local args = quest[7]; + if(quest[1] ~= 0 and args[4] ~= 0) then + local add_height = 0; + rows, add_height = self:Set(rows, quest[1], unpack(args)) + fill_height = fill_height + add_height; + end + + self:SetHeightToScale(fill_height + 2); +end + +local ResetQuestBlock = function(self) + for x = 1, #self.Rows do + local row = self.Rows[x] + if(row) then + row.Header.Text:SetText(''); + row.Header:SetAlpha(0); + row.Header.Zone:SetText(''); + row.Button:SetID(0); + row.Button:Disable(); + row.Badge.Button:SetID(0); + row.Badge.Icon:SetTexture(NO_ICON); + row.Badge:SetAlpha(0); + row.Badge.Button:Disable(); + row:SetHeight(1); + row:SetAlpha(0); + row.Objectives:Reset(); + end + end +end + +local LiteResetQuestBlock = function(self) + for x = 1, #self.Rows do + local row = self.Rows[x] + if(row) then + row.Objectives:Reset(true); + end + end +end + +local _hook_WorldMapFrameOnHide = function() + if(not WORLDMAP_UPDATE) then return end + UpdateCachedQuests(); + MOD.Headers["Quests"]:Reset() + MOD.Headers["Quests"]:Refresh() + MOD:UpdateDimensions(); +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +function MOD:UpdateObjectives(event, ...) + if(event == "ZONE_CHANGED_NEW_AREA") then + if(not WorldMapFrame:IsShown() and GetCVarBool("questPOI")) then + SetMapToCurrentZone(); + CURRENT_MAP_ID = GetCurrentMapAreaID(); + UpdateCachedDistance(); + self.Headers["Quests"]:LiteReset() + end + elseif(event == "ZONE_CHANGED") then + local inMicroDungeon = IsPlayerInMicroDungeon(); + if(inMicroDungeon ~= self.inMicroDungeon) then + if(not WorldMapFrame:IsShown() and GetCVarBool("questPOI")) then + SetMapToCurrentZone(); + CURRENT_MAP_ID = GetCurrentMapAreaID(); + UpdateCachedDistance(); + self.Headers["Quests"]:LiteReset() + end + self.inMicroDungeon = inMicroDungeon; + end + else +-- print('<-----QUESTS') +-- print(event) +-- print(...) + if(event == "QUEST_ACCEPTED" or event == "QUEST_WATCH_LIST_CHANGED") then + local questLogIndex, questID, isTracked; + if(event == "QUEST_ACCEPTED") then + questLogIndex, questID = ...; + if(AUTO_QUEST_WATCH == "1") then + AddQuestWatch(questLogIndex); + QuestSuperTracking_OnQuestTracked(questID); + end + if(AddCachedQuest(questLogIndex)) then + self.Headers["Quests"]:AddQuest(event, ...) + self:UpdateDimensions(); + end + elseif(event == "QUEST_WATCH_LIST_CHANGED") then + questID, isTracked = ...; + if(questID) then + local questLogIndex = GetQuestLogIndexByID(questID) + if(isTracked and AddCachedQuest(questLogIndex)) then + self.Headers["Quests"]:AddQuest(event, ...) + else + UpdateCachedQuests(); + self.Headers["Quests"]:Refresh(event, ...) + end + self:UpdateDimensions(); + end + end + return; + elseif(event == "QUEST_TURNED_IN") then + self.Headers["Quests"]:Reset() + local questID, XP, Money = ... + self:CheckActiveQuest(questID) + UpdateCachedQuests(); + self.Headers["Quests"]:Refresh(event, ...) + self:UpdateDimensions(); + return; + elseif(event == "QUEST_LOG_UPDATE") then + self.Headers["Quests"]:Reset() + UpdateCachedQuests(); + self.Headers["Quests"]:Refresh(event, ...) + self:UpdateDimensions(); + return; + else + self:UpdateBonusObjective(event, ...) + -- UpdateCachedQuests(); + -- self.Headers["Quests"]:Refresh(event, ...) + -- self:UpdateDimensions(); + return; + end + end +end + +local function UpdateQuestLocals(...) + ROW_WIDTH, ROW_HEIGHT, INNER_HEIGHT, LARGE_ROW_HEIGHT, LARGE_INNER_HEIGHT = ...; + QUEST_ROW_HEIGHT = ROW_HEIGHT + 2; +end + +SV.Events:On("QUEST_UPVALUES_UPDATED", "UpdateQuestLocals", UpdateQuestLocals); + +function MOD:InitializeQuests() + local scrollChild = self.Docklet.ScrollFrame.ScrollChild; + + local quests = CreateFrame("Frame", nil, scrollChild) + quests:SetWidth(ROW_WIDTH); + quests:SetHeightToScale(ROW_HEIGHT); + quests:SetPoint("TOPLEFT", self.Headers["Bonus"], "BOTTOMLEFT", 0, -4); + --quests:SetStylePanel() + + quests.Header = CreateFrame("Frame", nil, quests) + quests.Header:SetPoint("TOPLEFT", quests, "TOPLEFT", 2, -2); + quests.Header:SetPoint("TOPRIGHT", quests, "TOPRIGHT", -2, -2); + quests.Header:SetHeightToScale(INNER_HEIGHT); + + quests.Header.Text = quests.Header:CreateFontString(nil,"OVERLAY") + quests.Header.Text:SetPoint("TOPLEFT", quests.Header, "TOPLEFT", 2, 0); + quests.Header.Text:SetPoint("BOTTOMLEFT", quests.Header, "BOTTOMLEFT", 2, 0); + quests.Header.Text:SetFont(SV.Media.font.narrator, 16, "OUTLINE") + quests.Header.Text:SetJustifyH('LEFT') + quests.Header.Text:SetJustifyV('MIDDLE') + quests.Header.Text:SetTextColor(0.28,0.75,1) + quests.Header.Text:SetShadowOffset(-1,-1) + quests.Header.Text:SetShadowColor(0,0,0,0.5) + quests.Header.Text:SetText(TRACKER_HEADER_QUESTS) + + quests.Header.Divider = quests.Header:CreateTexture(nil, 'BACKGROUND'); + quests.Header.Divider:SetPoint("TOPLEFT", quests.Header.Text, "TOPRIGHT", -10, 0); + quests.Header.Divider:SetPoint("BOTTOMRIGHT", quests.Header, "BOTTOMRIGHT", 0, 0); + quests.Header.Divider:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DROPDOWN-DIVIDER]]); + + quests.Rows = {}; + + quests.Get = GetQuestRow; + quests.Set = SetQuestRow; + quests.SetZone = SetZoneHeader; + quests.Refresh = RefreshQuests; + quests.AddQuest = AddOneQuest; + quests.Reset = ResetQuestBlock; + quests.LiteReset = LiteResetQuestBlock; + + self.Headers["Quests"] = quests; + + self:RegisterEvent("QUEST_LOG_UPDATE", self.UpdateObjectives); + self:RegisterEvent("QUEST_WATCH_LIST_CHANGED", self.UpdateObjectives); + self:RegisterEvent("QUEST_ACCEPTED", self.UpdateObjectives); + self:RegisterEvent("QUEST_POI_UPDATE", self.UpdateObjectives); + self:RegisterEvent("QUEST_TURNED_IN", self.UpdateObjectives); + + self:RegisterEvent("ZONE_CHANGED_NEW_AREA", self.UpdateObjectives); + self:RegisterEvent("ZONE_CHANGED", self.UpdateObjectives); + + self.Headers["Quests"]:Refresh() + + WorldMapFrame:HookScript("OnHide", _hook_WorldMapFrameOnHide) +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/SVStats.lua b/Interface/AddOns/SVUI/packages/stats/SVStats.lua deleted file mode 100644 index e6264ba..0000000 --- a/Interface/AddOns/SVUI/packages/stats/SVStats.lua +++ /dev/null @@ -1,666 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local assert = _G.assert; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local print = _G.print; -local ipairs = _G.ipairs; -local pairs = _G.pairs; -local next = _G.next; -local rawset = _G.rawset; -local rawget = _G.rawget; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local string = _G.string; -local math = _G.math; -local table = _G.table; ---[[ STRING METHODS ]]-- -local join, len = string.join, string.len; ---[[ MATH METHODS ]]-- -local min = math.min; ---TABLE -local table = _G.table; -local tsort = table.sort; -local tconcat = table.concat; -local tinsert = _G.tinsert; -local tremove = _G.tremove; -local twipe = _G.wipe; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L -local LSM = LibStub("LibSharedMedia-3.0") -local LDB = LibStub("LibDataBroker-1.1", true) -local MOD = SV:NewPackage("SVStats", L["Statistics"]); - -MOD.Anchors = {}; -MOD.Statistics = {}; -MOD.DisabledList = {}; -MOD.StatListing = {[""] = "None"}; -MOD.tooltip = CreateFrame("GameTooltip", "StatisticTooltip", UIParent, "GameTooltipTemplate") -MOD.BGPanels = { - ["SVUI_DockTopCenterLeft"] = {left = "Honor", middle = "Kills", right = "Assists"}, - ["SVUI_DockTopCenterRight"] = {left = "Damage", middle = "Healing", right = "Deaths"} -}; -MOD.BGStats = { - ["Name"] = {1, NAME}, - ["Kills"] = {2, KILLS}, - ["Assists"] = {3, PET_ASSIST}, - ["Deaths"] = {4, DEATHS}, - ["Honor"] = {5, HONOR}, - ["Faction"] = {6, FACTION}, - ["Race"] = {7, RACE}, - ["Class"] = {8, CLASS}, - ["Damage"] = {10, DAMAGE}, - ["Healing"] = {11, SHOW_COMBAT_HEALING}, - ["Rating"] = {12, BATTLEGROUND_RATING}, - ["Changes"] = {13, RATING_CHANGE}, - ["Spec"] = {16, SPECIALIZATION} -}; -MOD.ListNeedsUpdate = true ---[[ -########################################################## -LOCALIZED GLOBALS -########################################################## -]]-- -local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS -local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS ---[[ -########################################################## -LOCAL VARIABLES -########################################################## -]]-- -local playerName = UnitName("player"); -local playerRealm = GetRealmName(); -local BGStatString = "%s: %s" -local myName = UnitName("player"); -local myClass = select(2,UnitClass("player")); -local classColor = RAID_CLASS_COLORS[myClass]; -local SCORE_CACHE = {}; -local hexHighlight = "FFFFFF"; -local StatMenuListing = {} --- When its vertical then "left" = "top" and "right" = "bottom". Yes I know thats ghetto, bite me! -local positionIndex = {{"middle", "left", "right"}, {"middle", "top", "bottom"}}; ---[[ -########################################################## -LOCAL FUNCTIONS -########################################################## -]]-- -local function GrabPlot(parent, slot, max) - if max == 1 then - return"CENTER", parent, "CENTER" - else - if(parent.vertical) then - if slot == 1 then - return "CENTER", parent, "CENTER" - elseif slot == 2 then - return "BOTTOM", parent.holders["middle"], "TOP", 0, 4 - elseif slot == 3 then - return "TOP", parent.holders["middle"], "BOTTOM", 0, -4 - end - else - if slot == 1 then - return "CENTER", parent, "CENTER" - elseif slot == 2 then - return "RIGHT", parent.holders["middle"], "LEFT", -4, 0 - elseif slot == 3 then - return "LEFT", parent.holders["middle"], "RIGHT", 4, 0 - end - end - end -end - -local UpdateAnchor = function() - local backdrops, width, height = SV.db.SVStats.showBackground - for _, anchor in pairs(MOD.Anchors) do - local numPoints = anchor.numPoints - if(anchor.vertical) then - width = anchor:GetWidth() - 4; - height = anchor:GetHeight() / numPoints - 4; - else - width = anchor:GetWidth() / numPoints - 4; - height = anchor:GetHeight() - 4; - if(backdrops) then - height = height + 6 - end - end - - for i = 1, numPoints do - local this = positionIndex[anchor.useIndex][i] - anchor.holders[this]:Width(width) - anchor.holders[this]:Height(height) - anchor.holders[this]:Point(GrabPlot(anchor, i, numPoints)) - end - end -end - -local _hook_TooltipOnShow = function(self) - self:SetBackdrop({ - bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - edgeSize = 1 - }) - self:SetBackdropColor(0, 0, 0, 0.8) - self:SetBackdropBorderColor(0, 0, 0) -end - -local function TruncateString(value) - if value >= 1e9 then - return ("%.1fb"):format(value/1e9):gsub("%.?0+([kmb])$","%1") - elseif value >= 1e6 then - return ("%.1fm"):format(value/1e6):gsub("%.?0+([kmb])$","%1") - elseif value >= 1e3 or value <= -1e3 then - return ("%.1fk"):format(value/1e3):gsub("%.?0+([kmb])$","%1") - else - return value - end -end ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -function MOD:Tip(stat) - local parent = stat:GetParent() - MOD.tooltip:Hide() - MOD.tooltip:SetOwner(parent, parent.anchor) - MOD.tooltip:ClearLines() - GameTooltip:Hide() -end - -function MOD:ShowTip(noSpace) - if(not noSpace) then - MOD.tooltip:AddLine(" ") - end - MOD.tooltip:AddDoubleLine("[Alt + Click]", "Swap Stats", 0, 1, 0, 0.5, 1, 0.5) - MOD.tooltip:Show() -end - -function MOD:NewAnchor(parent, maxCount, tipAnchor, isTop, customTemplate, isVertical) - self.ListNeedsUpdate = true - - local activeIndex = isVertical and 2 or 1 - local template, strata - - if(customTemplate) then - template = customTemplate - strata = "LOW" - else - template = isTop and "FramedTop" or "FramedBottom" - strata = "MEDIUM" - end - - local parentName = parent:GetName(); - - MOD.Anchors[parentName] = parent; - parent.holders = {}; - parent.vertical = isVertical; - parent.numPoints = maxCount; - parent.anchor = tipAnchor; - parent.useIndex = activeIndex - - local statName = parentName .. 'StatSlot'; - - for i = 1, maxCount do - local position = positionIndex[activeIndex][i] - if not parent.holders[position] then - parent.holders[position] = CreateFrame("Button", statName..i, parent) - parent.holders[position]:RegisterForClicks("AnyUp") - parent.holders[position].barframe = CreateFrame("Frame", nil, parent.holders[position]) - if(SV.db.SVStats.showBackground) then - parent.holders[position].barframe:Point("TOPLEFT", parent.holders[position], "TOPLEFT", 24, -2) - parent.holders[position].barframe:Point("BOTTOMRIGHT", parent.holders[position], "BOTTOMRIGHT", -2, 2) - if(customTemplate) then - parent.holders[position]:SetFixedPanelTemplate(template) - else - parent.holders[position]:SetFramedButtonTemplate(template) - end - else - parent.holders[position].barframe:Point("TOPLEFT", parent.holders[position], "TOPLEFT", 24, 2) - parent.holders[position].barframe:Point("BOTTOMRIGHT", parent.holders[position], "BOTTOMRIGHT", 2, -2) - parent.holders[position].barframe.bg = parent.holders[position].barframe:CreateTexture(nil, "BORDER") - parent.holders[position].barframe.bg:FillInner(parent.holders[position].barframe, 2, 2) - parent.holders[position].barframe.bg:SetTexture([[Interface\BUTTONS\WHITE8X8]]) - parent.holders[position].barframe.bg:SetGradient(unpack(SV.Media.gradient.dark)) - end - parent.holders[position].barframe:SetFrameLevel(parent.holders[position]:GetFrameLevel()-1) - parent.holders[position].barframe:SetBackdrop({ - bgFile = [[Interface\BUTTONS\WHITE8X8]], - edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], - tile = false, - tileSize = 0, - edgeSize = 2, - insets = {left = 0, right = 0, top = 0, bottom = 0} - }) - parent.holders[position].barframe:SetBackdropColor(0, 0, 0, 0.5) - parent.holders[position].barframe:SetBackdropBorderColor(0, 0, 0, 0.8) - parent.holders[position].barframe.icon = CreateFrame("Frame", nil, parent.holders[position].barframe) - parent.holders[position].barframe.icon:Point("TOPLEFT", parent.holders[position], "TOPLEFT", 0, 6) - parent.holders[position].barframe.icon:Point("BOTTOMRIGHT", parent.holders[position], "BOTTOMLEFT", 26, -6) - parent.holders[position].barframe.icon.texture = parent.holders[position].barframe.icon:CreateTexture(nil, "OVERLAY") - parent.holders[position].barframe.icon.texture:FillInner(parent.holders[position].barframe.icon, 2, 2) - parent.holders[position].barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\PLACEHOLDER") - parent.holders[position].barframe.bar = CreateFrame("StatusBar", nil, parent.holders[position].barframe) - parent.holders[position].barframe.bar:FillInner(parent.holders[position].barframe, 2, 2) - parent.holders[position].barframe.bar:SetStatusBarTexture(SV.Media.bar.default) - - parent.holders[position].barframe.bar.extra = CreateFrame("StatusBar", nil, parent.holders[position].barframe.bar) - parent.holders[position].barframe.bar.extra:SetAllPoints() - parent.holders[position].barframe.bar.extra:SetStatusBarTexture(SV.Media.bar.default) - parent.holders[position].barframe.bar.extra:Hide() - parent.holders[position].barframe:Hide() - parent.holders[position].textframe = CreateFrame("Frame", nil, parent.holders[position]) - parent.holders[position].textframe:SetAllPoints(parent.holders[position]) - parent.holders[position].textframe:SetFrameStrata(strata) - parent.holders[position].text = parent.holders[position].textframe:CreateFontString(nil, "OVERLAY", nil, 7) - parent.holders[position].text:SetAllPoints() - if(SV.db.SVStats.showBackground) then - parent.holders[position].text:FontManager(LSM:Fetch("font", SV.db.SVStats.font), SV.db.SVStats.fontSize, "NONE", "CENTER", "MIDDLE") - parent.holders[position].text:SetShadowColor(0, 0, 0, 0.5) - parent.holders[position].text:SetShadowOffset(2, -4) - else - parent.holders[position].text:FontManager(LSM:Fetch("font", SV.db.SVStats.font), SV.db.SVStats.fontSize, SV.db.SVStats.fontOutline) - parent.holders[position].text:SetJustifyH("CENTER") - parent.holders[position].text:SetJustifyV("MIDDLE") - end - end - parent.holders[position].SlotKey = statName..i; - parent.holders[position].TokenKey = 738; - parent.holders[position].MenuList = {}; - parent.holders[position].TokenList = {}; - parent.holders[position]:Point(GrabPlot(parent, i, maxCount)) - end - parent:SetScript("OnSizeChanged", UpdateAnchor) - UpdateAnchor(parent) -end - -function MOD:Extend(newStat, eventList, onEvents, update, click, focus, blur, init) - if not newStat then return end - self.Statistics[newStat] = {} - self.StatListing[newStat] = newStat - tinsert(StatMenuListing, newStat) - if type(eventList) == "table" then - self.Statistics[newStat]["events"] = eventList; - self.Statistics[newStat]["event_handler"] = onEvents - end - if update and type(update) == "function" then - self.Statistics[newStat]["update_handler"] = update - end - if click and type(click) == "function" then - self.Statistics[newStat]["click_handler"] = click - end - if focus and type(focus) == "function" then - self.Statistics[newStat]["focus_handler"] = focus - end - if blur and type(blur) == "function" then - self.Statistics[newStat]["blur_handler"] = blur - end - if init and type(init) == "function" then - self.Statistics[newStat]["init_handler"] = init - end -end - -do - local dataStrings = { - NAME, - KILLING_BLOWS, - HONORABLE_KILLS, - DEATHS, - HONOR, - FACTION, - RACE, - CLASS, - "None", - DAMAGE, - SHOW_COMBAT_HEALING, - BATTLEGROUND_RATING, - RATING_CHANGE, - "None", - "None", - SPECIALIZATION - }; - - local Stat_OnLeave = function() - MOD.tooltip:Hide() - end - - local Parent_OnClick = function(self, button) - if IsAltKeyDown() then - SV.Dropdown:Open(self, self.MenuList); - elseif(self.onClick) then - self.onClick(self, button); - end - end - - local function _load(parent, name, config) - parent.StatParent = name - - if config["init_handler"]then - config["init_handler"](parent) - end - - if config["events"]then - for _, event in pairs(config["events"])do - parent:RegisterEvent(event) - end - end - - if config["event_handler"]then - parent:SetScript("OnEvent", config["event_handler"]) - config["event_handler"](parent, "SVUI_FORCE_RUN") - end - - if config["update_handler"]then - parent:SetScript("OnUpdate", config["update_handler"]) - config["update_handler"](parent, 20000) - end - - if config["click_handler"]then - parent.onClick = config["click_handler"] - end - parent:SetScript("OnClick", Parent_OnClick) - - if config["focus_handler"]then - parent:SetScript("OnEnter", config["focus_handler"]) - end - - if config["blur_handler"]then - parent:SetScript("OnLeave", config["blur_handler"]) - else - parent:SetScript("OnLeave", Stat_OnLeave) - end - - parent:Show() - end - - local BG_OnUpdate = function(self) - local scoreString; - local parentName = self:GetParent():GetName(); - local lookup = self.pointIndex - local pointIndex = MOD.BGPanels[parentName][lookup] - local scoreindex = MOD.BGStats[pointIndex][1] - local scoreType = MOD.BGStats[pointIndex][2] - local scoreCount = GetNumBattlefieldScores() - for i = 1, scoreCount do - SCORE_CACHE = {GetBattlefieldScore(i)} - if(SCORE_CACHE[1] and SCORE_CACHE[1] == myName and SCORE_CACHE[scoreindex]) then - scoreString = TruncateString(SCORE_CACHE[scoreindex]) - self.text:SetFormattedText(BGStatString, scoreType, scoreString) - break - end - end - end - - local BG_OnEnter = function(self) - MOD:Tip(self) - local bgName; - local mapToken = GetCurrentMapAreaID() - local r, g, b; - if(classColor) then - r, g, b = classColor.r, classColor.g, classColor.b - else - r, g, b = 1, 1, 1 - end - - local scoreCount = GetNumBattlefieldScores() - - for i = 1, scoreCount do - bgName = GetBattlefieldScore(i) - if(bgName and bgName == myName) then - MOD.tooltip:AddDoubleLine(L["Stats For:"], bgName, 1, 1, 1, r, g, b) - MOD.tooltip:AddLine(" ") - if(mapToken == 443 or mapToken == 626) then - MOD.tooltip:AddDoubleLine(L["Flags Captured"], GetBattlefieldStatData(i, 1), 1, 1, 1) - MOD.tooltip:AddDoubleLine(L["Flags Returned"], GetBattlefieldStatData(i, 2), 1, 1, 1) - elseif(mapToken == 482) then - MOD.tooltip:AddDoubleLine(L["Flags Captured"], GetBattlefieldStatData(i, 1), 1, 1, 1) - elseif(mapToken == 401) then - MOD.tooltip:AddDoubleLine(L["Graveyards Assaulted"], GetBattlefieldStatData(i, 1), 1, 1, 1) - MOD.tooltip:AddDoubleLine(L["Graveyards Defended"], GetBattlefieldStatData(i, 2), 1, 1, 1) - MOD.tooltip:AddDoubleLine(L["Towers Assaulted"], GetBattlefieldStatData(i, 3), 1, 1, 1) - MOD.tooltip:AddDoubleLine(L["Towers Defended"], GetBattlefieldStatData(i, 4), 1, 1, 1) - elseif(mapToken == 512) then - MOD.tooltip:AddDoubleLine(L["Demolishers Destroyed"], GetBattlefieldStatData(i, 1), 1, 1, 1) - MOD.tooltip:AddDoubleLine(L["Gates Destroyed"], GetBattlefieldStatData(i, 2), 1, 1, 1) - elseif(mapToken == 540 or mapToken == 736 or mapToken == 461) then - MOD.tooltip:AddDoubleLine(L["Bases Assaulted"], GetBattlefieldStatData(i, 1), 1, 1, 1) - MOD.tooltip:AddDoubleLine(L["Bases Defended"], GetBattlefieldStatData(i, 2), 1, 1, 1) - elseif(mapToken == 856) then - MOD.tooltip:AddDoubleLine(L["Orb Possessions"], GetBattlefieldStatData(i, 1), 1, 1, 1) - MOD.tooltip:AddDoubleLine(L["Victory Points"], GetBattlefieldStatData(i, 2), 1, 1, 1) - elseif(mapToken == 860) then - MOD.tooltip:AddDoubleLine(L["Carts Controlled"], GetBattlefieldStatData(i, 1), 1, 1, 1) - end - break - end - end - MOD:ShowTip() - end - - local ForceHideBGStats; - local BG_OnClick = function() - ForceHideBGStats = true; - MOD:Generate() - SV:AddonMessage(L["Battleground statistics temporarily hidden, to show type \"/sv bg\" or \"/sv pvp\""]) - end - - local sortMenuList = function(a, b) return a < b end - - function MOD:SetMenuLists() - local stats = self.Anchors; - local list = StatMenuListing; - local disabled = self.DisabledList; - - tsort(list) - - for place,parent in pairs(stats)do - for i = 1, parent.numPoints do - local this = positionIndex[parent.useIndex][i] - local subList = twipe(parent.holders[this].MenuList) - - tinsert(subList,{text = NONE, func = function() MOD:ChangeDBVar("", this, "docks", place); MOD:Generate() end}); - for _,name in pairs(list) do - if(not disabled[name]) then - tinsert(subList,{text = name, func = function() MOD:ChangeDBVar(name, this, "docks", place); MOD:Generate() end}); - end - end - end - self.ListNeedsUpdate = false; - end - end - - function MOD:Generate() - if(self.ListNeedsUpdate) then - self:SetMenuLists() - end - - local instance, groupType = IsInInstance() - local anchorTable = self.Anchors - local statTable = self.Statistics - local db = SV.db.SVStats - local allowPvP = (db.battleground and not ForceHideBGStats) or false - for place, parent in pairs(anchorTable) do - local pvpTable = allowPvP and self.BGPanels[place] - for i = 1, parent.numPoints do - local position = positionIndex[parent.useIndex][i] - - parent.holders[position]:UnregisterAllEvents() - parent.holders[position]:SetScript("OnUpdate", nil) - parent.holders[position]:SetScript("OnEnter", nil) - parent.holders[position]:SetScript("OnLeave", nil) - parent.holders[position]:SetScript("OnClick", nil) - - if(db.showBackground) then - parent.holders[position].text:SetFont(LSM:Fetch("font", db.font), db.fontSize, "NONE") - else - parent.holders[position].text:SetFont(LSM:Fetch("font", db.font), db.fontSize, db.fontOutline) - end - - parent.holders[position].text:SetText(nil) - - if parent.holders[position].barframe then - parent.holders[position].barframe:Hide() - end - - parent.holders[position].pointIndex = position; - parent.holders[position]:Hide() - - if(pvpTable and ((instance and groupType == "pvp") or parent.lockedOpen)) then - parent.holders[position]:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") - parent.holders[position]:SetScript("OnEvent", BG_OnUpdate) - parent.holders[position]:SetScript("OnEnter", BG_OnEnter) - parent.holders[position]:SetScript("OnLeave", Stat_OnLeave) - parent.holders[position]:SetScript("OnClick", BG_OnClick) - - BG_OnUpdate(parent.holders[position]) - - parent.holders[position]:Show() - else - for name, config in pairs(statTable)do - for panelName, panelData in pairs(db.docks) do - if(panelData and type(panelData) == "table") then - if(panelName == place and panelData[position] and panelData[position] == name) then - _load(parent.holders[position], name, config) - end - elseif(panelData and type(panelData) == "string" and panelData == name) then - if(name == place) then - _load(parent.holders[position], name, config) - end - end - end - end - end - end - end - if ForceHideBGStats then ForceHideBGStats = nil end - end -end - -function MOD:UnSet(parent) - parent:UnregisterAllEvents() - parent:SetScript("OnUpdate", nil) - parent:SetScript("OnEnter", nil) - parent:SetScript("OnLeave", nil) - parent:SetScript("OnClick", nil) - self.DisabledList[parent.StatParent] = true - self:SetMenuLists() -end ---[[ -########################################################## -BUILD FUNCTION / UPDATE -########################################################## -]]-- -function MOD:ReLoad() - self:Generate() -end - -function MOD:Load() - hexHighlight = SV:HexColor("highlight") or "FFFFFF" - local hexClass = classColor.colorStr - BGStatString = "|cff" .. hexHighlight .. "%s: |c" .. hexClass .. "%s|r"; - - self.Accountant = LibSuperVillain("Registry"):NewGlobal("Accountant") - - self.Accountant[playerRealm] = self.Accountant[playerRealm] or {}; - self.Accountant[playerRealm]["gold"] = self.Accountant[playerRealm]["gold"] or {}; - self.Accountant[playerRealm]["gold"][playerName] = self.Accountant[playerRealm]["gold"][playerName] or 0; - self.Accountant[playerRealm]["tokens"] = self.Accountant[playerRealm]["tokens"] or {}; - if(not self.Accountant[playerRealm]["tokens"][playerName] or (self.Accountant[playerRealm]["tokens"][playerName] and type(self.Accountant[playerRealm]["tokens"][playerName]) ~= "table")) then - self.Accountant[playerRealm]["tokens"][playerName] = {}; - end - - self:NewAnchor(SV.Dock.BottomCenter.Left, 3, "ANCHOR_CURSOR") - self:NewAnchor(SV.Dock.BottomCenter.Right, 3, "ANCHOR_CURSOR") - self:NewAnchor(SV.Dock.TopCenter.Left, 3, "ANCHOR_CURSOR") - self:NewAnchor(SV.Dock.TopCenter.Right, 3, "ANCHOR_CURSOR") - - self:LoadServerGold() - self:CacheRepData() - - -- self.tooltip:SetParent(SV.Screen) - self.tooltip:SetFrameStrata("DIALOG") - self.tooltip:HookScript("OnShow", _hook_TooltipOnShow) - - if(LDB) then - for dataName, dataObj in LDB:DataObjectIterator() do - - local OnEnter, OnLeave, OnClick, lastObj; - - if dataObj.OnTooltipShow then - function OnEnter(self) - MOD:Tip(self) - dataObj.OnTooltipShow(MOD.tooltip) - MOD:ShowTip() - end - end - - if dataObj.OnEnter then - function OnEnter(self) - MOD:Tip(self) - dataObj.OnEnter(MOD.tooltip) - MOD:ShowTip() - end - end - - if dataObj.OnLeave then - function OnLeave(self) - dataObj.OnLeave(self) - MOD.tooltip:Hide() - end - end - - if dataObj.OnClick then - function OnClick(self, button) - dataObj.OnClick(self, button) - end - end - - local function textUpdate(event, name, key, value, dataobj) - if value == nil or (len(value) > 5) or value == 'n/a' or name == value then - lastObj.text:SetText(value ~= 'n/a' and value or name) - else - lastObj.text:SetText(name..': '.. '|cff' .. hexHighlight ..value..'|r') - end - end - - local function OnEvent(self) - lastObj = self; - LDB:RegisterCallback("LibDataBroker_AttributeChanged_"..dataName.."_text", textUpdate) - LDB:RegisterCallback("LibDataBroker_AttributeChanged_"..dataName.."_value", textUpdate) - LDB.callbacks:Fire("LibDataBroker_AttributeChanged_"..dataName.."_text", dataName, nil, dataObj.text, dataObj) - end - - MOD:Extend(dataName, {"PLAYER_ENTERING_WORLD"}, OnEvent, nil, OnClick, OnEnter, OnLeave) - end - end - - self:Generate() - self:RegisterEvent("PLAYER_ENTERING_WORLD", "Generate") - - myName = UnitName("player"); -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/SVStats.xml b/Interface/AddOns/SVUI/packages/stats/SVStats.xml deleted file mode 100644 index a909a64..0000000 --- a/Interface/AddOns/SVUI/packages/stats/SVStats.xml +++ /dev/null @@ -1,16 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Script file='SVStats.lua'/> - <Script file="stats\bags.lua"/> - <Script file="stats\cta.lua"/> - <Script file="stats\durability.lua"/> - <Script file="stats\experience.lua"/> - <Script file="stats\friends.lua"/> - <Script file="stats\gold.lua"/> - <Script file="stats\tokens.lua"/> - <Script file="stats\guild.lua"/> - <Script file="stats\reputation.lua"/> - <Script file="stats\system.lua"/> - <Script file="stats\time.lua"/> - <Script file="stats\dps.lua"/> - <Script file="stats\hps.lua"/> -</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/bags.lua b/Interface/AddOns/SVUI/packages/stats/stats/bags.lua deleted file mode 100644 index c59d3a3..0000000 --- a/Interface/AddOns/SVUI/packages/stats/stats/bags.lua +++ /dev/null @@ -1,103 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## - -STATS:Extend EXAMPLE USAGE: MOD:Extend(newStat,eventList,onEvents,update,click,focus,blur) - -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local assert = _G.assert; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local tinsert = _G.tinsert; -local string = _G.string; -local math = _G.math; -local table = _G.table; ---[[ STRING METHODS ]]-- -local lower, upper = string.lower, string.upper; -local find, format, len, split = string.find, string.format, string.len, string.split; -local match, sub, join = string.match, string.sub, string.join; -local gmatch, gsub = string.gmatch, string.gsub; ---[[ MATH METHODS ]]-- -local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; -- Basic ---[[ TABLE METHODS ]]-- -local twipe, tsort = table.wipe, table.sort; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L -local MOD = SV.SVStats; ---[[ -########################################################## -BAG STATS -########################################################## -]]-- -local StatEvents = {"PLAYER_ENTERING_WORLD", "BAG_UPDATE"}; -local hexColor = "FFFFFF" -local bags_text = "%s|cff%s%d / %d|r"; -local currentObject; - -local function bags_events(this, e, ...) - local f, g, h = 0, 0, 0; - currentObject = this; - for i = 0, NUM_BAG_SLOTS do - f, g = f + GetContainerNumFreeSlots(i), - g + GetContainerNumSlots(i) - end - h = g - f; - this.text:SetFormattedText(bags_text, L["Bags"]..": ", hexColor, h, g) -end - -local function bags_click() - ToggleAllBags() -end - -local function bags_focus(this) - MOD:Tip(this) - for i = 1, MAX_WATCHED_TOKENS do - local l, m, n, o, p = GetBackpackCurrencyInfo(i) - if l and i == 1 then - MOD.tooltip:AddLine(CURRENCY) - MOD.tooltip:AddLine(" ") - end - if l and m then - MOD.tooltip:AddDoubleLine(l, m, 1, 1, 1) - end - end - MOD:ShowTip() -end - -local BagsColorUpdate = function() - hexColor = SV:HexColor("highlight") - if currentObject ~= nil then - bags_events(currentObject) - end -end - -LibSuperVillain("Registry"):NewCallback("CORE_MEDIA_UPDATED", "BagsColorUpdates", BagsColorUpdate) -MOD:Extend("Bags", StatEvents, bags_events, nil, bags_click, bags_focus); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/cta.lua b/Interface/AddOns/SVUI/packages/stats/stats/cta.lua deleted file mode 100644 index 1a0e54a..0000000 --- a/Interface/AddOns/SVUI/packages/stats/stats/cta.lua +++ /dev/null @@ -1,160 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## - -STATS:Extend EXAMPLE USAGE: MOD:Extend(newStat,eventList,onEvents,update,click,focus,blur) - -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local assert = _G.assert; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local tinsert = _G.tinsert; -local string = _G.string; -local math = _G.math; -local table = _G.table; ---[[ STRING METHODS ]]-- -local lower, upper = string.lower, string.upper; -local find, format, len, split = string.find, string.format, string.len, string.split; -local match, sub, join = string.match, string.sub, string.join; -local gmatch, gsub = string.gmatch, string.gsub; ---[[ MATH METHODS ]]-- -local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; -- Basic ---[[ TABLE METHODS ]]-- -local twipe, tsort = table.wipe, table.sort; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L -local MOD = SV.SVStats; ---[[ -########################################################## -CALL TO ARMS STATS -########################################################## -]]-- -local StatEvents = {"PLAYER_ENTERING_WORLD", "LFG_UPDATE_RANDOM_INFO"}; - -local tooltipString = ("%s: N/A"):format(BATTLEGROUND_HOLIDAY) -local currentObject; - -local function formatCTAtext(tanks, heals, dps) - local result = "" - if tanks then - result = result.."|TInterface\\AddOns\\SVUI\\assets\\textures\\default\\tank.tga:14:14|t" - end - if heals then - result = result.."|TInterface\\AddOns\\SVUI\\assets\\textures\\default\\healer.tga:14:14|t" - end - if dps then - result = result.."|TInterface\\AddOns\\SVUI\\assets\\textures\\default\\dps.tga:14:14|t" - end - return result -end - -local function CTA_OnEvent(self, ...) - local isTank = false; - local isHeal = false; - local isDPS = false; - local isNormal = true; - for r = 1, GetNumRandomDungeons()do - local id, name = GetLFGRandomDungeonInfo(r) - for i = 1, LFG_ROLE_NUM_SHORTAGE_TYPES do - local eligible, forTank, forHealer, forDamage, itemCount = GetLFGRoleShortageRewards(id, i) - if eligible then - isNormal = false - end - if eligible and forTank and itemCount > 0 then - isTank = true; - end - if eligible and forHealer and itemCount > 0 then - isHeal = true; - end - if eligible and forDamage and itemCount > 0 then - isDPS = true; - end - end - end - if isNormal then - self.text:SetText(tooltipString) - else - self.text:SetText(BATTLEGROUND_HOLIDAY..": "..formatCTAtext(isTank, isHeal, isDPS)) - end - currentObject = self -end - -local function CTA_OnClick() - ToggleFrame(LFDParentFrame) -end - -local function CTA_OnEnter(self) - MOD:Tip(self) - local counter = 0; - for r = 1, GetNumRandomDungeons()do - local isTank = false; - local isHeal = false; - local isDPS = false; - local isNormal = true; - local id, name = GetLFGRandomDungeonInfo(r) - for i = 1, LFG_ROLE_NUM_SHORTAGE_TYPES do - local eligible, forTank, forHealer, forDamage, itemCount = GetLFGRoleShortageRewards(id, i) - if eligible then - isNormal = false - end - if eligible and forTank and itemCount > 0 then - isTank = true; - end - if eligible and forHealer and itemCount > 0 then - isHeal = true; - end - if eligible and forDamage and itemCount > 0 then - isDPS = true; - end - end - if not isNormal then - local text = formatCTAtext(isTank,isHeal,isDPS) - if text ~= "" then - MOD.tooltip:AddDoubleLine(name..":", text, 1, 1, 1) - end - if isTank or isHeal or isDPS then - counter = counter + 1 - end - end - end - MOD:ShowTip() -end - -local CTAColorUpdate = function() - local hexColor = SV:HexColor("highlight"); - tooltipString = ("%s: |cff%sN/A|r"):format(BATTLEGROUND_HOLIDAY, hexColor) - if currentObject ~= nil then - CTA_OnEvent(currentObject) - end -end -LibSuperVillain("Registry"):NewCallback("CORE_MEDIA_UPDATED", "CTAColorUpdates", CTAColorUpdate) - -MOD:Extend('Call to Arms', StatEvents, CTA_OnEvent, nil, CTA_OnClick, CTA_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/dps.lua b/Interface/AddOns/SVUI/packages/stats/stats/dps.lua deleted file mode 100644 index a1f3c03..0000000 --- a/Interface/AddOns/SVUI/packages/stats/stats/dps.lua +++ /dev/null @@ -1,128 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## - -STATS:Extend EXAMPLE USAGE: MOD:Extend(newStat,eventList,onEvents,update,click,focus,blur,load) - -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local string = _G.string; ---[[ STRING METHODS ]]-- -local match, sub, join = string.match, string.sub, string.join; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L -local MOD = SV.SVStats; ---[[ -########################################################## -CALL TO ARMS STATS -########################################################## -]]-- -local StatEvents = {'PLAYER_ENTERING_WORLD', 'COMBAT_LOG_EVENT_UNFILTERED', "PLAYER_LEAVE_COMBAT", 'PLAYER_REGEN_DISABLED', 'UNIT_PET'}; - -local PlayerEvents = {["SWING_DAMAGE"] = true, ["RANGE_DAMAGE"] = true, ["SPELL_DAMAGE"] = true, ["SPELL_PERIODIC_DAMAGE"] = true, ["DAMAGE_SHIELD"] = true, ["DAMAGE_SPLIT"] = true, ["SPELL_EXTRA_ATTACKS"] = true} -local playerID = UnitGUID('player') -local petID -local DMGTotal, lastDMGAmount = 0, 0 -local combatTime = 0 -local timeStamp = 0 -local lastSegment = 0 -local lastPanel -local hexColor = "FFFFFF" -local displayString = "|cff%s%.1f|r"; -local dpsString = "%s |cff00CCFF%s|r"; - -local function Reset() - timeStamp = 0 - combatTime = 0 - DMGTotal = 0 - lastDMGAmount = 0 -end - -local function GetDPS(self) - if DMGTotal == 0 or combatTime == 0 then - self.text:SetText(dpsString:format(L["DPS"], "..PAUSED")) - self.TText = "No Damage Done" - self.TText2 = "Go smack something so \nthat I can do the maths!" - else - local DPS = (DMGTotal) / (combatTime) - self.text:SetFormattedText(displayString, hexColor, DPS) - self.TText = "DPS:" - self.TText2 = DPS - end -end - -local function DPS_OnClick(self) - Reset() - GetDPS(self) -end - -local function DPS_OnEnter(self) - MOD:Tip(self) - MOD.tooltip:AddDoubleLine("Damage Total:", DMGTotal, 1, 1, 1) - MOD.tooltip:AddLine(" ", 1, 1, 1) - MOD.tooltip:AddDoubleLine(self.TText, self.TText2, 1, 1, 1) - MOD.tooltip:AddLine(" ", 1, 1, 1) - MOD.tooltip:AddDoubleLine("[Click]", "Clear DPS", 0,1,0, 0.5,1,0.5) - MOD:ShowTip(true) -end - -local function DPS_OnEvent(self, event, ...) - lastPanel = self - if event == "PLAYER_ENTERING_WORLD" then - playerID = UnitGUID('player') - elseif event == 'PLAYER_REGEN_DISABLED' or event == "PLAYER_LEAVE_COMBAT" then - local now = time() - if now - lastSegment > 20 then --time since the last segment - Reset() - end - lastSegment = now - elseif event == 'COMBAT_LOG_EVENT_UNFILTERED' then - local newTime, event, _, srcGUID, srcName, srcFlags, sourceRaidFlags, dstGUID, dstName, dstFlags, destRaidFlags, lastDMGAmount, spellName = ... - if not PlayerEvents[event] then return end - if(srcGUID == playerID or srcGUID == petID) then - if timeStamp == 0 then timeStamp = newTime end - lastSegment = timeStamp - combatTime = newTime - timeStamp - if event ~= "SWING_DAMAGE" then - lastDMGAmount = select(15, ...) - end - DMGTotal = DMGTotal + lastDMGAmount - end - elseif event == UNIT_PET then - petID = UnitGUID("pet") - end - - GetDPS(self) -end - -local DPSColorUpdate = function() - hexColor = SV:HexColor("highlight") - if lastPanel ~= nil then - DPS_OnEvent(lastPanel) - end -end - -LibSuperVillain("Registry"):NewCallback("CORE_MEDIA_UPDATED", "DPSColorUpdates", DPSColorUpdate) -MOD:Extend('DPS', StatEvents, DPS_OnEvent, nil, DPS_OnClick, DPS_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/durability.lua b/Interface/AddOns/SVUI/packages/stats/stats/durability.lua deleted file mode 100644 index af16df2..0000000 --- a/Interface/AddOns/SVUI/packages/stats/stats/durability.lua +++ /dev/null @@ -1,150 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## - -STATS:Extend EXAMPLE USAGE: MOD:Extend(newStat,eventList,onEvents,update,click,focus,blur) - -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local assert = _G.assert; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local tinsert = _G.tinsert; -local string = _G.string; -local math = _G.math; -local table = _G.table; ---[[ STRING METHODS ]]-- -local lower, upper = string.lower, string.upper; -local find, format, len, split = string.find, string.format, string.len, string.split; -local match, sub, join = string.match, string.sub, string.join; -local gmatch, gsub = string.gmatch, string.gsub; ---[[ MATH METHODS ]]-- -local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; -- Basic ---[[ TABLE METHODS ]]-- -local twipe, tsort = table.wipe, table.sort; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L -local LSM = LibStub("LibSharedMedia-3.0") -local MOD = SV.SVStats; ---[[ -########################################################## -DURABILITY STATS -########################################################## -]]-- -local StatEvents = {"PLAYER_ENTERING_WORLD", "UPDATE_INVENTORY_DURABILITY", "MERCHANT_SHOW"}; - -local hexColor = "FFFFFF" -local displayString = "%s: |cff%s%d%%|r"; -local overall = 0; -local min, max, currentObject; -local equipment = {} -local inventoryMap = { - ["SecondaryHandSlot"] = L["Offhand"], - ["MainHandSlot"] = L["Main Hand"], - ["FeetSlot"] = L["Feet"], - ["LegsSlot"] = L["Legs"], - ["HandsSlot"] = L["Hands"], - ["WristSlot"] = L["Wrist"], - ["WaistSlot"] = L["Waist"], - ["ChestSlot"] = L["Chest"], - ["ShoulderSlot"] = L["Shoulder"], - ["HeadSlot"] = L["Head"] -} - -local function Durability_OnEvent(self, ...) - currentObject = self; - overall = 100; - if self.barframe:IsShown() then - self.text:SetAllPoints(self) - self.text:SetJustifyH("CENTER") - self.barframe:Hide() - self.text:FontManager(LSM:Fetch("font",SV.db.SVStats.font),SV.db.SVStats.fontSize,SV.db.SVStats.fontOutline) - end - for slot,name in pairs(inventoryMap)do - local slotID = GetInventorySlotInfo(slot) - min,max = GetInventoryItemDurability(slotID) - if min then - equipment[name] = min / max * 100; - if min / max * 100 < overall then - overall = min / max * 100 - end - end - end - self.text:SetFormattedText(displayString, DURABILITY, hexColor, overall) -end - -local function DurabilityBar_OnEvent(self, ...) - currentObject = nil; - overall = 100; - if not self.barframe:IsShown() then - self.barframe:Show() - self.barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\STAT-DUR") - self.text:FontManager(LSM:Fetch("font",SV.db.SVStats.font),SV.db.SVStats.fontSize,"NONE") - end - for slot,name in pairs(inventoryMap)do - local slotID = GetInventorySlotInfo(slot) - min,max = GetInventoryItemDurability(slotID) - if min then - equipment[name] = min / max * 100; - if min / max * 100 < overall then - overall = min / max * 100 - end - end - end - local newRed = (100 - overall) * 0.01; - local newGreen = overall * 0.01; - self.barframe.bar:SetMinMaxValues(0, 100) - self.barframe.bar:SetValue(overall) - self.barframe.bar:SetStatusBarColor(newRed, newGreen, 0) - self.text:SetText('') -end - -local function Durability_OnClick() - ToggleCharacter("PaperDollFrame") -end - -local function Durability_OnEnter(self) - MOD:Tip(self) - for name,amt in pairs(equipment)do - MOD.tooltip:AddDoubleLine(name, format("%d%%", amt),1, 1, 1, SV:ColorGradient(amt * 0.01, 1, 0, 0, 1, 1, 0, 0, 1, 0)) - end - MOD:ShowTip() -end - -local DurColorUpdate = function() - hexColor = SV:HexColor("highlight") - if currentObject ~= nil then - Durability_OnEvent(currentObject) - end -end -LibSuperVillain("Registry"):NewCallback("CORE_MEDIA_UPDATED", "DurColorUpdates", DurColorUpdate) - -MOD:Extend("Durability", StatEvents, Durability_OnEvent, nil, Durability_OnClick, Durability_OnEnter) -MOD:Extend("Durability Bar", StatEvents, DurabilityBar_OnEvent, nil, Durability_OnClick, Durability_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/experience.lua b/Interface/AddOns/SVUI/packages/stats/stats/experience.lua deleted file mode 100644 index 9e83014..0000000 --- a/Interface/AddOns/SVUI/packages/stats/stats/experience.lua +++ /dev/null @@ -1,142 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## - -STATS:Extend EXAMPLE USAGE: MOD:Extend(newStat,eventList,onEvents,update,click,focus,blur) - -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local string = _G.string; ---[[ STRING METHODS ]]-- -local format = string.format; -local gsub = string.gsub; ---MATH -local math = _G.math; -local min = math.min ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L; -local LSM = LibStub("LibSharedMedia-3.0") -local MOD = SV.SVStats; ---[[ -########################################################## -EXPERIENCE STATS -########################################################## -]]-- -local StatEvents = {"PLAYER_ENTERING_WORLD", "PLAYER_XP_UPDATE", "PLAYER_LEVEL_UP", "DISABLE_XP_GAIN", "ENABLE_XP_GAIN", "UPDATE_EXHAUSTION"}; - -local function getUnitXP(unit) - if unit == "pet"then - return GetPetExperience() - else - return UnitXP(unit),UnitXPMax(unit) - end -end - -local function TruncateString(value) - if value >= 1e9 then - return ("%.1fb"):format(value/1e9):gsub("%.?0+([kmb])$","%1") - elseif value >= 1e6 then - return ("%.1fm"):format(value/1e6):gsub("%.?0+([kmb])$","%1") - elseif value >= 1e3 or value <= -1e3 then - return ("%.1fk"):format(value/1e3):gsub("%.?0+([kmb])$","%1") - else - return value - end -end - -local function Experience_OnEvent(self, ...) - if self.barframe:IsShown()then - self.text:SetAllPoints(self) - self.text:SetJustifyH("CENTER") - self.barframe:Hide() - self.text:FontManager(LSM:Fetch("font",SV.db.SVStats.font),SV.db.SVStats.fontSize,SV.db.SVStats.fontOutline) - end - local f, g = getUnitXP("player") - local h = GetXPExhaustion() - local i = "" - if h and h > 0 then - i = format("%s - %d%% R:%s [%d%%]", TruncateString(f), f / g * 100, TruncateString(h), h / g * 100) - else - i = format("%s - %d%%", TruncateString(f), f / g * 100) - end - self.text:SetText(i) -end - -local function ExperienceBar_OnEvent(self, ...) - -- if (UnitLevel("player") == GetMaxPlayerLevel())then - -- self:Hide() - -- MOD:UnSet(self) - -- return - -- end - if (not self.barframe:IsShown())then - self.barframe:Show() - self.barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\STAT-XP") - self.text:FontManager(LSM:Fetch("font",SV.db.SVStats.font),SV.db.SVStats.fontSize,"NONE") - end - if not self.barframe.bar.extra:IsShown() then - self.barframe.bar.extra:Show() - end - local k = self.barframe.bar; - local f, g = getUnitXP("player") - k:SetMinMaxValues(0, g) - k:SetValue((f - 1) >= 0 and (f - 1) or 0) - k:SetStatusBarColor(0, 0.5, 1) - local h = GetXPExhaustion() - if h and h>0 then - k.extra:SetMinMaxValues(0, g) - k.extra:SetValue(min(f + h, g)) - k.extra:SetStatusBarColor(0.8, 0.5, 1) - k.extra:SetAlpha(0.5) - else - k.extra:SetMinMaxValues(0, 1) - k.extra:SetValue(0) - end - self.text:SetText("") -end - -local function Experience_OnEnter(self) - MOD:Tip(self) - local XP, maxXP = getUnitXP("player") - local h = GetXPExhaustion() - MOD.tooltip:AddLine(L["Experience"]) - MOD.tooltip:AddLine(" ") - - MOD.tooltip:AddDoubleLine(L["XP:"], (" %d / %d (%d%%)"):format(XP, maxXP, (XP / maxXP) * 100), 1, 1, 1) - MOD.tooltip:AddDoubleLine(L["Remaining:"], (" %d (%d%% - %d "..L["Bars"]..")"):format(maxXP - XP, (maxXP - XP) / maxXP * 100, 20 * (maxXP - XP) / maxXP), 1, 1, 1) - if h then - MOD.tooltip:AddDoubleLine(L["Rested:"], format(" + %d (%d%%)", h, h / maxXP * 100), 1, 1, 1) - end - MOD:ShowTip() -end - -local function ExperienceBar_OnLoad(self) - if (UnitLevel("player") == GetMaxPlayerLevel()) then - self:Hide() - MOD:UnSet(self) - end -end - -MOD:Extend("Experience", StatEvents, Experience_OnEvent, nil, nil, Experience_OnEnter) -MOD:Extend("Experience Bar", StatEvents, ExperienceBar_OnEvent, nil, nil, Experience_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/friends.lua b/Interface/AddOns/SVUI/packages/stats/stats/friends.lua deleted file mode 100644 index 96e8a47..0000000 --- a/Interface/AddOns/SVUI/packages/stats/stats/friends.lua +++ /dev/null @@ -1,385 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## - -STATS:Extend EXAMPLE USAGE: MOD:Extend(newStat,eventList,onEvents,update,click,focus,blur) - -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local assert = _G.assert; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local tinsert = _G.tinsert; -local string = _G.string; -local math = _G.math; -local table = _G.table; ---[[ STRING METHODS ]]-- -local lower, upper = string.lower, string.upper; -local find, format, len, split = string.find, string.format, string.len, string.split; -local match, sub, join = string.match, string.sub, string.join; -local gmatch, gsub = string.gmatch, string.gsub; ---[[ MATH METHODS ]]-- -local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; -- Basic ---[[ TABLE METHODS ]]-- -local wipe, sort = table.wipe, table.sort; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L -local MOD = SV.SVStats; ---[[ -########################################################## -LOCALIZED GLOBALS -########################################################## -]]-- -local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS ---[[ -########################################################## -FRIENDS STATS -########################################################## -]]-- -local StatEvents = { - "PLAYER_ENTERING_WORLD", - "BN_FRIEND_ACCOUNT_ONLINE", - "BN_FRIEND_ACCOUNT_OFFLINE", - "BN_FRIEND_INFO_CHANGED", - "BN_FRIEND_TOON_ONLINE", - "BN_FRIEND_TOON_OFFLINE", - "BN_TOON_NAME_UPDATED", - "FRIENDLIST_UPDATE", - "CHAT_MSG_SYSTEM" -}; - -SV.SystemAlert.SET_BN_BROADCAST={ - text = BN_BROADCAST_TOOLTIP, - button1 = ACCEPT, - button2 = CANCEL, - hasEditBox = 1, - editBoxWidth = 350, - maxLetters = 127, - OnAccept = function(self) BNSetCustomMessage(self.editBox:GetText()) end, - OnShow = function(self) self.editBox:SetText(select(4, BNGetInfo()) ) self.editBox:SetFocus() end, - OnHide = ChatEdit_FocusActiveWindow, - EditBoxOnEnterPressed = function(self) BNSetCustomMessage(self:GetText()) self:GetParent():Hide() end, - EditBoxOnEscapePressed = function(self) self:GetParent():Hide() end, - timeout = 0, - exclusive = 1, - whileDead = 1, - hideOnEscape = 1, - preferredIndex = 3 -}; - -local menuFrame = CreateFrame("Frame", "FriendDatatextRightClickMenu", SV.Screen, "UIDropDownMenuTemplate") -local menuList = { - { text = OPTIONS_MENU, isTitle = true,notCheckable=true}, - { text = INVITE, hasArrow = true,notCheckable=true, }, - { text = CHAT_MSG_WHISPER_INFORM, hasArrow = true,notCheckable=true, }, - { text = PLAYER_STATUS, hasArrow = true, notCheckable=true, - menuList = { - { text = "|cff2BC226"..AVAILABLE.."|r", notCheckable=true, func = function() if IsChatAFK() then SendChatMessage("", "AFK") elseif IsChatDND() then SendChatMessage("", "DND") end end }, - { text = "|cffE7E716"..DND.."|r", notCheckable=true, func = function() if not IsChatDND() then SendChatMessage("", "DND") end end }, - { text = "|cffFF0000"..AFK.."|r", notCheckable=true, func = function() if not IsChatAFK() then SendChatMessage("", "AFK") end end }, - }, - }, - { text = BN_BROADCAST_TOOLTIP, notCheckable=true, func = function() SV:StaticPopup_Show("SET_BN_BROADCAST") end }, -} - -local function inviteClick(self, name) - menuFrame:Hide() - - if type(name) ~= 'number' then - InviteUnit(name) - else - BNInviteFriend(name); - end -end - -local function whisperClick(self, name, battleNet) - menuFrame:Hide() - - if battleNet then - ChatFrame_SendSmartTell(name) - else - SetItemRef( "player:"..name, ("|Hplayer:%1$s|h[%1$s]|h"):format(name), "LeftButton" ) - end -end - -local levelNameString = "|cff%02x%02x%02x%d|r |cff%02x%02x%02x%s|r" -local levelNameClassString = "|cff%02x%02x%02x%d|r %s%s%s" -local worldOfWarcraftString = WORLD_OF_WARCRAFT -local battleNetString = BATTLENET_OPTIONS_LABEL -local wowString, scString, d3String, wtcgString = BNET_CLIENT_WOW, BNET_CLIENT_SC2, BNET_CLIENT_D3, BNET_CLIENT_WTCG -local totalOnlineString = join("", FRIENDS_LIST_ONLINE, ": %s/%s") -local tthead, ttsubh, ttoff = {r=0.4, g=0.78, b=1}, {r=0.75, g=0.9, b=1}, {r=.3,g=1,b=.3} -local activezone, inactivezone = {r=0.3, g=1.0, b=0.3}, {r=0.65, g=0.65, b=0.65} -local hexColor = "FFFFFF" -local displayString = "%s: |cff%s%d|r"; -local statusTable = { "|cffFFFFFF[|r|cffFF0000"..L['AFK'].."|r|cffFFFFFF]|r", "|cffFFFFFF[|r|cffFF0000"..L['DND'].."|r|cffFFFFFF]|r", "" } -local groupedTable = { "|cffaaaaaa*|r", "" } -local friendTable, BNTable, BNTableWoW, BNTableD3, BNTableSC, BNTableWTCG = {}, {}, {}, {}, {}, {} -local tableList = {[wowString] = BNTableWoW, [d3String] = BNTableD3, [scString] = BNTableSC, [wtcgString] = BNTableWTCG} -local friendOnline, friendOffline = gsub(ERR_FRIEND_ONLINE_SS,"\124Hplayer:%%s\124h%[%%s%]\124h",""), gsub(ERR_FRIEND_OFFLINE_S,"%%s","") -local dataValid = false -local lastPanel - -local function BuildFriendTable(total) - wipe(friendTable) - local name, level, class, area, connected, status, note - for i = 1, total do - name, level, class, area, connected, status, note = GetFriendInfo(i) - - if status == "<"..AFK..">" then - status = "|cffFFFFFF[|r|cffFF0000"..L['AFK'].."|r|cffFFFFFF]|r" - elseif status == "<"..DND..">" then - status = "|cffFFFFFF[|r|cffFF0000"..L['DND'].."|r|cffFFFFFF]|r" - end - - if connected then - for k,v in pairs(LOCALIZED_CLASS_NAMES_MALE) do if class == v then class = k end end - for k,v in pairs(LOCALIZED_CLASS_NAMES_FEMALE) do if class == v then class = k end end - friendTable[i] = { name, level, class, area, connected, status, note } - end - end - sort(friendTable, function(a, b) - if a[1] and b[1] then - return a[1] < b[1] - end - end) -end - -local function Sort(a, b) - if a[2] and b[2] and a[3] and b[3] then - if a[2] == b[2] then return a[3] < b[3] end - return a[2] < b[2] - end -end - -local function BuildBNTable(total) - wipe(BNTable) - wipe(BNTableWoW) - wipe(BNTableD3) - wipe(BNTableSC) - wipe(BNTableWTCG) - - local _, presenceID, presenceName, battleTag, isBattleTagPresence, toonName, toonID, client, isOnline, lastOnline, isAFK, isDND, messageText, noteText, isRIDFriend, messageTime, canSoR - local toonName, client, realmName, realmID, faction, race, class, zoneName, level, gameText, broadcastText, broadcastTime - for i = 1, total do - -- presenceID, presenceName, battleTag, isBattleTagPresence, toonName, toonID, client, isOnline, lastOnline, isAFK, isDND, messageText, noteText, isRIDFriend, broadcastTime, canSoR - presenceID, presenceName, battleTag, isBattleTagPresence, toonName, toonID, client, isOnline, lastOnline, isAFK, isDND, messageText, noteText, isRIDFriend, messageTime, canSoR = BNGetFriendInfo(i) - -- unknown, toonName, client, realmName, realmID, faction, race, class, unknown, zoneName, level, gameText, broadcastText, broadcastTime, unknown, presenceID - _, _, _, realmName, realmID, faction, race, class, _, zoneName, level, gameText, broadcastText, broadcastTime, _, _ = BNGetToonInfo(presenceID); - - if isOnline then - for k,v in pairs(LOCALIZED_CLASS_NAMES_MALE) do if class == v then class = k end end - BNTable[i] = { presenceID, presenceName, battleTag, toonName, toonID, client, isOnline, isAFK, isDND, noteText, realmName, faction, race, class, zoneName, level } - - if client == scString then - BNTableSC[#BNTableSC + 1] = { presenceID, presenceName, toonName, toonID, client, isOnline, isAFK, isDND, noteText, realmName, faction, race, class, zoneName, level } - elseif client == d3String then - BNTableD3[#BNTableD3 + 1] = { presenceID, presenceName, toonName, toonID, client, isOnline, isAFK, isDND, noteText, realmName, faction, race, class, zoneName, level } - elseif client == wtcgString then - BNTableWTCG[#BNTableWTCG + 1] = { presenceID, presenceName, toonName, toonID, client, isOnline, isAFK, isDND, noteText, realmName, faction, race, class, zoneName, level } - else - BNTableWoW[#BNTableWoW + 1] = { presenceID, presenceName, toonName, toonID, client, isOnline, isAFK, isDND, noteText, realmName, faction, race, class, zoneName, level } - end - end - end - - --sort(BNTable, Sort) - sort(BNTableWoW, Sort) - sort(BNTableSC, Sort) - sort(BNTableD3, Sort) - sort(BNTableWTCG, Sort) -end - -local function OnEvent(self, event, ...) - local _, onlineFriends = GetNumFriends() - local _, numBNetOnline = BNGetNumFriends() - - -- special handler to detect friend coming online or going offline - -- when this is the case, we invalidate our buffered table and update the - -- datatext information - if event == "CHAT_MSG_SYSTEM" then - local message = select(1, ...) - if not (find(message, friendOnline) or find(message, friendOffline)) then return end - end - - -- force update when showing tooltip - dataValid = false - local amt = onlineFriends + numBNetOnline - self.text:SetFormattedText(displayString, L['Friends'], hexColor, amt) - lastPanel = self -end - -local function Click(self, btn) - MOD.tooltip:Hide() - - if btn == "RightButton" then - local menuCountWhispers = 0 - local menuCountInvites = 0 - local classc, levelc, info - - menuList[2].menuList = {} - menuList[3].menuList = {} - - if #friendTable > 0 then - for i = 1, #friendTable do - info = friendTable[i] - if (info[5]) then - menuCountInvites = menuCountInvites + 1 - menuCountWhispers = menuCountWhispers + 1 - - classc, levelc = RAID_CLASS_COLORS[info[3]], GetQuestDifficultyColor(info[2]) - classc = classc or GetQuestDifficultyColor(info[2]); - - menuList[2].menuList[menuCountInvites] = {text = format(levelNameString,levelc.r*255,levelc.g*255,levelc.b*255,info[2],classc.r*255,classc.g*255,classc.b*255,info[1]), arg1 = info[1],notCheckable=true, func = inviteClick} - menuList[3].menuList[menuCountWhispers] = {text = format(levelNameString,levelc.r*255,levelc.g*255,levelc.b*255,info[2],classc.r*255,classc.g*255,classc.b*255,info[1]), arg1 = info[1],notCheckable=true, func = whisperClick} - end - end - end - if #BNTable > 0 then - local realID, grouped - for i = 1, #BNTable do - info = BNTable[i] - if (info[5]) then - realID = info[2] - menuCountWhispers = menuCountWhispers + 1 - menuList[3].menuList[menuCountWhispers] = {text = realID, arg1 = realID, arg2 = true, notCheckable=true, func = whisperClick} - - if info[6] == wowString and UnitFactionGroup("player") == info[12] then - classc, levelc = RAID_CLASS_COLORS[info[14]], GetQuestDifficultyColor(info[16]) - classc = classc or GetQuestDifficultyColor(info[16]) - - if UnitInParty(info[4]) or UnitInRaid(info[4]) then grouped = 1 else grouped = 2 end - menuCountInvites = menuCountInvites + 1 - - menuList[2].menuList[menuCountInvites] = {text = format(levelNameString,levelc.r*255,levelc.g*255,levelc.b*255,info[16],classc.r*255,classc.g*255,classc.b*255,info[4]), arg1 = info[5], notCheckable=true, func = inviteClick} - end - end - end - end - - EasyMenu(menuList, menuFrame, "cursor", 0, 0, "MENU", 2) - else - ToggleFriendsFrame() - end -end - -local function OnEnter(self) - MOD:Tip(self) - local grouped - local numberOfFriends, onlineFriends = GetNumFriends() - local totalBNet, numBNetOnline = BNGetNumFriends() - - local totalonline = onlineFriends + numBNetOnline - - -- no friends online, quick exit - if totalonline == 0 then return end - - if not dataValid then - -- only retrieve information for all on-line members when we actually view the tooltip - if numberOfFriends > 0 then BuildFriendTable(numberOfFriends) end - if totalBNet > 0 then BuildBNTable(totalBNet) end - dataValid = true - end - - local totalfriends = numberOfFriends + totalBNet - local zonec, classc, levelc, realmc, info - MOD.tooltip:AddDoubleLine(L['Friends List'], format(totalOnlineString, totalonline, totalfriends),tthead.r,tthead.g,tthead.b,tthead.r,tthead.g,tthead.b) - if onlineFriends > 0 then - MOD.tooltip:AddLine(' ') - MOD.tooltip:AddLine(worldOfWarcraftString) - for i = 1, #friendTable do - info = friendTable[i] - if info[5] then - if GetRealZoneText() == info[4] then zonec = activezone else zonec = inactivezone end - classc, levelc = RAID_CLASS_COLORS[info[3]], GetQuestDifficultyColor(info[2]) - - classc = classc or GetQuestDifficultyColor(info[2]) - - if UnitInParty(info[1]) or UnitInRaid(info[1]) then grouped = 1 else grouped = 2 end - MOD.tooltip:AddDoubleLine(format(levelNameClassString,levelc.r*255,levelc.g*255,levelc.b*255,info[2],info[1],groupedTable[grouped]," "..info[6]),info[4],classc.r,classc.g,classc.b,zonec.r,zonec.g,zonec.b) - end - end - end - - if numBNetOnline > 0 then - local status = 0 - for client, list in pairs(tableList) do - if #list > 0 then - MOD.tooltip:AddLine(' ') - MOD.tooltip:AddLine(battleNetString..' ('..client..')') - for i = 1, #list do - info = list[i] - -- for x = 1, #info do - -- print(x) - -- print(info[x]) - -- print("-----") - -- end - if info[6] then - if info[5] == wowString then - if (info[7] == true) then status = 1 elseif (info[8] == true) then status = 2 else status = 3 end - classc = RAID_CLASS_COLORS[info[13]] - - if UnitInParty(info[4]) or UnitInRaid(info[4]) then grouped = 1 else grouped = 2 end - - if info[15] ~= '' then - levelc = GetQuestDifficultyColor(info[15]) - MOD.tooltip:AddDoubleLine(format(levelNameString, levelc.r*255, levelc.g*255, levelc.b*255, info[15], classc.r*255, classc.g*255, classc.b*255, info[3], groupedTable[grouped], 255, 0, 0, statusTable[status]), info[2], 238, 238, 238, 238, 238, 238) - else - classc = classc or RAID_CLASS_COLORS["PRIEST"] - MOD.tooltip:AddDoubleLine(format("|cff%02x%02x%02x%s|r", classc.r*255, classc.g*255, classc.b*255, info[3], groupedTable[grouped], 255, 0, 0, statusTable[status]), info[2], 238, 238, 238, 238, 238, 238) - end - - if IsShiftKeyDown() then - if GetRealZoneText() == info[14] then zonec = activezone else zonec = inactivezone end - if GetRealmName() == info[10] then realmc = activezone else realmc = inactivezone end - MOD.tooltip:AddDoubleLine(info[14], info[10], zonec.r, zonec.g, zonec.b, realmc.r, realmc.g, realmc.b) - end - else - MOD.tooltip:AddDoubleLine(info[3], info[2], .9, .9, .9, .9, .9, .9) - end - end - end - end - end - end - - MOD:ShowTip() -end - -local FriendsColorUpdate = function() - hexColor = SV:HexColor("highlight") - if lastPanel ~= nil then - OnEvent(lastPanel,'SVUI_COLOR_UPDATE') - end -end - -LibSuperVillain("Registry"):NewCallback("CORE_MEDIA_UPDATED", "FriendsColorUpdates", FriendsColorUpdate) - -MOD:Extend('Friends', StatEvents, OnEvent, nil, Click, OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/gold.lua b/Interface/AddOns/SVUI/packages/stats/stats/gold.lua deleted file mode 100644 index 1a59fcf..0000000 --- a/Interface/AddOns/SVUI/packages/stats/stats/gold.lua +++ /dev/null @@ -1,169 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## - -STATS:Extend EXAMPLE USAGE: MOD:Extend(newStat,eventList,onEvents,update,click,focus,blur) - -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local assert = _G.assert; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local tinsert = _G.tinsert; -local string = _G.string; -local math = _G.math; -local table = _G.table; ---[[ STRING METHODS ]]-- -local lower, upper = string.lower, string.upper; -local find, format, len, split = string.find, string.format, string.len, string.split; -local match, sub, join = string.match, string.sub, string.join; -local gmatch, gsub = string.gmatch, string.gsub; ---[[ MATH METHODS ]]-- -local abs, ceil, floor, round, mod = math.abs, math.ceil, math.floor, math.round, math.fmod; -- Basic ---[[ TABLE METHODS ]]-- -local twipe, tsort = table.wipe, table.sort; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L; -local MOD = SV.SVStats; ---[[ -########################################################## -GOLD STATS -########################################################## -]]-- -local playerName = UnitName("player"); -local playerRealm = GetRealmName(); - -local StatEvents = {'PLAYER_ENTERING_WORLD','PLAYER_MONEY','SEND_MAIL_MONEY_CHANGED','SEND_MAIL_COD_CHANGED','PLAYER_TRADE_MONEY','TRADE_MONEY_CHANGED'}; -local gains = 0; -local loss = 0; -local recorded = 0; -local copperFormat = "%d" .. L.copperabbrev -local silverFormat = "%d" .. L.silverabbrev .. " %.2d" .. L.copperabbrev -local goldFormat = "%s" .. L.goldabbrev .. " %.2d" .. L.silverabbrev .. " %.2d" .. L.copperabbrev - -local silverShortFormat = "%d" .. L.silverabbrev -local goldShortFormat = "%s" .. L["goldabbrev"] - -local tiptext = join("","|cffaaaaaa",L["Reset Data: Hold Left Ctrl + Shift then Click"],"|r") -local serverGold = {}; - -local function FormatCurrency(amount, short) - if not amount then return end - local gold, silver, copper = floor(abs(amount/10000)), abs(mod(amount/100,100)), abs(mod(amount,100)) - if(short) then - if gold ~= 0 then - gold = BreakUpLargeNumbers(gold) - return goldShortFormat:format(gold) - elseif silver ~= 0 then - return silverShortFormat:format(silver) - else - return copperFormat:format(copper) - end - else - if gold ~= 0 then - gold = BreakUpLargeNumbers(gold) - return goldFormat:format(gold, silver, copper) - elseif silver ~= 0 then - return silverFormat:format(silver, copper) - else - return copperFormat:format(copper) - end - end -end - -local function Gold_OnEvent(self, event,...) - if not IsLoggedIn() then return end - local current = GetMoney() - recorded = MOD.Accountant[playerRealm]["gold"][playerName] or GetMoney(); - local adjusted = current - recorded; - if recorded > current then - loss = loss - adjusted - else - gains = gains + adjusted - end - self.text:SetText(FormatCurrency(current, SV.db.SVStats.shortGold)) - MOD.Accountant[playerRealm]["gold"][playerName] = GetMoney() -end - -local function Gold_OnClick(self, button) - if IsLeftControlKeyDown() and IsShiftKeyDown() then - MOD.Accountant[playerRealm]["gold"] = {}; - MOD.Accountant[playerRealm]["gold"][playerName] = GetMoney(); - Gold_OnEvent(self) - MOD.tooltip:Hide() - else - ToggleAllBags() - end -end - -local function Gold_OnEnter(self) - MOD:Tip(self) - MOD.tooltip:AddLine(L['Session:']) - MOD.tooltip:AddDoubleLine(L["Earned:"],FormatCurrency(gains),1,1,1,1,1,1) - MOD.tooltip:AddDoubleLine(L["Spent:"],FormatCurrency(loss),1,1,1,1,1,1) - if gains < loss then - MOD.tooltip:AddDoubleLine(L["Deficit:"],FormatCurrency(gains - loss),1,0,0,1,1,1) - elseif (gains - loss) > 0 then - MOD.tooltip:AddDoubleLine(L["Profit:"],FormatCurrency(gains - loss),0,1,0,1,1,1) - end - MOD.tooltip:AddLine(" ") - local cash = MOD.Accountant[playerRealm]["gold"][playerName]; - MOD.tooltip:AddLine(L[playerName..": "]) - MOD.tooltip:AddDoubleLine(L["Total: "], FormatCurrency(cash), 1,1,1,1,1,1) - MOD.tooltip:AddLine(" ") - - MOD.tooltip:AddLine(L["Characters: "]) - for name,amount in pairs(serverGold)do - if(name ~= playerName and name ~= 'total') then - cash = cash + amount; - MOD.tooltip:AddDoubleLine(name, FormatCurrency(amount), 1,1,1,1,1,1) - end - end - MOD.tooltip:AddLine(" ") - MOD.tooltip:AddLine(L["Server: "]) - MOD.tooltip:AddDoubleLine(L["Total: "], FormatCurrency(cash), 1,1,1,1,1,1) - MOD.tooltip:AddLine(" ") - MOD.tooltip:AddLine(tiptext) - MOD:ShowTip() -end - -MOD:Extend('Gold', StatEvents, Gold_OnEvent, nil, Gold_OnClick, Gold_OnEnter); - -function MOD:LoadServerGold() - local SVUI_Global = _G.SVUI_Global - local totalGold = 0; - for name,amount in pairs(self.Accountant[playerRealm]["gold"])do - if self.Accountant[playerRealm]["gold"][name] then - serverGold[name] = amount; - totalGold = totalGold + amount - end - end - serverGold['total'] = totalGold; -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/guild.lua b/Interface/AddOns/SVUI/packages/stats/stats/guild.lua deleted file mode 100644 index 2b75226..0000000 --- a/Interface/AddOns/SVUI/packages/stats/stats/guild.lua +++ /dev/null @@ -1,310 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## - -STATS:Extend EXAMPLE USAGE: MOD:Extend(newStat,eventList,onEvents,update,click,focus,blur) - -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local string = _G.string; -local math = _G.math; -local table = _G.table; ---[[ STRING METHODS ]]-- -local format, join, gsub = string.format, string.join, string.gsub; ---[[ MATH METHODS ]]-- -local ceil = math.ceil; -- Basic -local twipe, tsort = table.wipe, table.sort; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L -local MOD = SV.SVStats; ---[[ -########################################################## -GUILD STATS -########################################################## -]]-- -local playerName = UnitName("player"); -local playerRealm = GetRealmName(); - -local StatEvents = {"PLAYER_ENTERING_WORLD","GUILD_ROSTER_UPDATE","GUILD_XP_UPDATE","PLAYER_GUILD_UPDATE","GUILD_MOTD"}; - -local updatedString = ""; -local patternColor = SV:HexColor(0.75,0.9,1); -local pattern1 = ("|cff%s%s"):format(patternColor, GUILD_EXPERIENCE_CURRENT); -local pattern2 = ("|cff%s%s"):format(patternColor, GUILD_EXPERIENCE_DAILY); -local guildFormattedName = "%s: %d/%d"; -local guildFormattedXP = gsub(pattern1, ": ", ":|r |cffFFFFFF", 1); -local guildFormattedDailyXP = gsub(pattern2, ": ", ":|r |cffFFFFFF", 1); -local guildFormattedFaction = join("|cff", patternColor, "%s:|r |cFFFFFFFF%s/%s (%s%%)"); -local guildFormattedOnline = join("", "+ %d ", FRIENDS_LIST_ONLINE, "..."); -local guildFormattedNote = join("", "|cff999999 ", LABEL_NOTE, ":|r %s"); -local guildFormattedRank = join("", "|cff999999 ", GUILD_RANK1_DESC, ":|r %s"); -local GuildStatMembers,GuildStatMOTD = {},""; -local currentObject; - -local UnitFlagFormat = { - [0] = function()return "" end, - [1] = function()return ("|cffFFFFFF[|r|cffFF0000%s|r|cffFFFFFF]|r"):format(L["AFK"]) end, - [2] = function()return ("|cffFFFFFF[|r|cffFF0000%s|r|cffFFFFFF]|r"):format(L["DND"]) end -}; - -local MobileFlagFormat = { - [0] = function()return ChatFrame_GetMobileEmbeddedTexture(73/255, 177/255, 73/255) end, - [1] = function()return "|TInterface\\ChatFrame\\UI-ChatIcon-ArmoryChat-AwayMobile:14:14:0:0:16:16:0:16:0:16|t" end, - [2] = function()return "|TInterface\\ChatFrame\\UI-ChatIcon-ArmoryChat-BusyMobile:14:14:0:0:16:16:0:16:0:16|t" end -}; - -local GuildDatatTextRightClickMenu = CreateFrame("Frame", "GuildDatatTextRightClickMenu", SV.Screen, "UIDropDownMenuTemplate") - -local MenuMap = { - {text = OPTIONS_MENU, isTitle = true, notCheckable = true}, - {text = INVITE, hasArrow = true, notCheckable = true}, - {text = CHAT_MSG_WHISPER_INFORM, hasArrow = true, notCheckable = true} -}; - -local function TruncateString(value) - if value >= 1e9 then - return ("%.1fb"):format(value/1e9):gsub("%.?0+([kmb])$","%1") - elseif value >= 1e6 then - return ("%.1fm"):format(value/1e6):gsub("%.?0+([kmb])$","%1") - elseif value >= 1e3 or value <= -1e3 then - return ("%.1fk"):format(value/1e3):gsub("%.?0+([kmb])$","%1") - else - return value - end -end - -local function SortGuildStatMembers(shift) - tsort(GuildStatMembers, function(arg1, arg2) - if arg1 and arg2 then - if shift then - return arg1[10] < arg2[10] - else - return arg1[1] < arg2[1] - end - end - end) -end - -local function GetGuildStatMembers() - twipe(GuildStatMembers) - local statusFormat; - local _, name, rank, level, zone, note, officernote, online, status, classFileName, isMobile, rankIndex; - for i = 1, GetNumGuildMembers() do - name, rank, rankIndex, level, _, zone, note, officernote, online, status, classFileName, _, _, isMobile = GetGuildRosterInfo(i) - statusFormat = isMobile and MobileFlagFormat[status]() or UnitFlagFormat[status]() - zone = isMobile and not online and REMOTE_CHAT or zone; - if online or isMobile then - GuildStatMembers[#GuildStatMembers + 1] = { name, rank, level, zone, note, officernote, online, statusFormat, classFileName, rankIndex, isMobile} - end - end -end - -local GuildStatEventHandler = { - ["PLAYER_ENTERING_WORLD"] = function(arg1, arg2) - if not GuildFrame and IsInGuild() then - LoadAddOn("Blizzard_GuildUI") - GuildRoster() - end - end, - ["GUILD_ROSTER_UPDATE"] = function(arg1, arg2) - if arg2 then - GuildRoster() - else - GetGuildStatMembers() - GuildStatMOTD = GetGuildRosterMOTD() - if GetMouseFocus() == arg1 then - arg1:GetScript("OnEnter")(arg1, nil, true) - end - end - end, - ["PLAYER_GUILD_UPDATE"] = function(arg1, arg2) - GuildRoster() - end, - ["GUILD_MOTD"] = function(arg1, arg2) - GuildStatMOTD = arg2 - end, - ["SVUI_FORCE_RUN"] = SV.fubar, - ["SVUI_COLOR_UPDATE"] = SV.fubar -}; - -local function MenuInvite(self, unit) - GuildDatatTextRightClickMenu:Hide() - InviteUnit(unit) -end - -local function MenuRightClick(self, unit) - GuildDatatTextRightClickMenu:Hide() - SetItemRef(("player:%s"):format(unit), ("|Hplayer:%1$s|h[%1$s]|h"):format(unit), "LeftButton") -end - -local function MenuLeftClick() - if IsInGuild() then - if not GuildFrame then - LoadAddOn("Blizzard_GuildUI") - end - GuildFrame_Toggle() - GuildFrame_TabClicked(GuildFrameTab2) - else - if not LookingForGuildFrame then - LoadAddOn("Blizzard_LookingForGuildUI") - end - if LookingForGuildFrame then - LookingForGuildFrame_Toggle() - end - end -end - -local function Guild_OnEvent(self, event, ...) - currentObject = self; - if IsInGuild() and GuildStatEventHandler[event] then - GuildStatEventHandler[event](self, select(1, ...)) - self.text:SetFormattedText(updatedString, #GuildStatMembers) - else - self.text:SetText(L['No Guild']) - end -end - -local function Guild_OnClick(self, button) - if button == "RightButton" and IsInGuild() then - MOD.tooltip:Hide() - - - local classc, levelc, grouped, info - local menuCountWhispers = 0 - local menuCountInvites = 0 - - MenuMap[2].menuList = {} - MenuMap[3].menuList = {} - - for i = 1, #GuildStatMembers do - info = GuildStatMembers[i] - if info[7] and info[1] ~= playerName then - local classc, levelc = RAID_CLASS_COLORS[info[9]], GetQuestDifficultyColor(info[3]) - if UnitInParty(info[1])or UnitInRaid(info[1]) then - grouped = "|cffaaaaaa*|r" - elseif not info[11] then - menuCountInvites = menuCountInvites + 1; - grouped = ""; - MenuMap[2].menuList[menuCountInvites] = { - text = ("|cff%02x%02x%02x%d|r |cff%02x%02x%02x%s|r %s"):format(levelc.r*255, levelc.g*255, levelc.b*255, info[3], classc.r*255, classc.g*255, classc.b*255, info[1], ""), - arg1 = info[1], - notCheckable = true, - func = MenuInvite - } - end - menuCountWhispers = menuCountWhispers + 1; - if not grouped then - grouped = "" - end - MenuMap[3].menuList[menuCountWhispers] = { - text = ("|cff%02x%02x%02x%d|r |cff%02x%02x%02x%s|r %s"):format(levelc.r*255, levelc.g*255, levelc.b*255, info[3], classc.r*255, classc.g*255, classc.b*255, info[1], grouped), - arg1 = info[1], - notCheckable = true, - func = MenuRightClick - } - end - end - EasyMenu(MenuMap, GuildDatatTextRightClickMenu, "cursor", 0, 0, "MENU", 2) - else - MenuLeftClick() - end -end - -local function Guild_OnEnter(self, _, ap) - if not IsInGuild() then - return - end - MOD:Tip(self) - local aq, ar = GetNumGuildMembers() - if #GuildStatMembers == 0 then GetGuildStatMembers() end - SortGuildStatMembers(IsShiftKeyDown()) - local guildName, guildRankName, guildRankIndex = GetGuildInfo('player') - if guildName and guildRankName then - MOD.tooltip:AddDoubleLine(("%s "):format(guildName), guildFormattedName:format(GUILD, ar, aq), 0.4, 0.78, 1, 0.4, 0.78, 1) - MOD.tooltip:AddLine(guildRankName, 0.4, 0.78, 1) - end - if GuildStatMOTD ~= "" then - MOD.tooltip:AddLine(' ') - MOD.tooltip:AddLine(("%s |cffaaaaaa- |cffffffff%s"):format(GUILD_MOTD, GuildStatMOTD), 0.75, 0.9, 1, 1) - end - local av = SV:HexColor(0.75,0.9,1) - local _, _, standingID, barMin, barMax, barValue = GetGuildFactionInfo() - if standingID ~= 8 then - barMax = barMax - barMin; - barValue = barValue - barMin; - barMin = 0; - MOD.tooltip:AddLine(guildFormattedFaction:format(COMBAT_FACTION_CHANGE, TruncateString(barValue), TruncateString(barMax), ceil(barValue / barMax * 100))) - end - local zoneColor, classColor, questColor, member, groupFormat; - local counter = 0; - MOD.tooltip:AddLine(' ') - for X = 1, #GuildStatMembers do - if((30 - counter) <= 1) then - if((ar - 30) > 1) then - MOD.tooltip:AddLine(guildFormattedOnline:format(ar - 30), 0.75, 0.9, 1) - end - break - end - member = GuildStatMembers[X] - if GetRealZoneText() == member[4]then - zoneColor = {r=0.3,g=1.0,b=0.3} - else - zoneColor = {r=0.65,g=0.65,b=0.65} - end - classColor, questColor = RAID_CLASS_COLORS[member[9]], GetQuestDifficultyColor(member[3]) - if UnitInParty(member[1]) or UnitInRaid(member[1]) then - groupFormat = "|cffaaaaaa*|r" - else - groupFormat = "" - end - if IsShiftKeyDown() then - MOD.tooltip:AddDoubleLine(("%s |cff999999-|cffffffff %s"):format(member[1], member[2]), member[4], classColor.r, classColor.g, classColor.b, zoneColor.r, zoneColor.g, zoneColor.b) - if member[5] ~= ""then - MOD.tooltip:AddLine(guildFormattedNote:format(member[5]), 0.75, 0.9, 1, 1) - end - if member[6] ~= ""then - MOD.tooltip:AddLine(guildFormattedRank:format(member[6]), 0.3, 1, 0.3, 1) - end - else - MOD.tooltip:AddDoubleLine(("|cff%02x%02x%02x%d|r %s%s %s"):format(questColor.r*255, questColor.g*255, questColor.b*255, member[3], member[1], groupFormat, member[8]), member[4], classColor.r, classColor.g, classColor.b, zoneColor.r, zoneColor.g, zoneColor.b) - end - counter = counter + 1 - end - MOD:ShowTip() - if not ap then - GuildRoster() - end -end - -local GuildColorUpdate = function() - local hexColor = SV:HexColor("highlight"); - updatedString = join("", GUILD, ": |cff", hexColor, "%d|r") - if currentObject ~= nil then - Guild_OnEvent(currentObject, 'SVUI_COLOR_UPDATE') - end -end -LibSuperVillain("Registry"):NewCallback("CORE_MEDIA_UPDATED", "GuildColorUpdates", GuildColorUpdate) - -MOD:Extend('Guild', StatEvents, Guild_OnEvent, nil, Guild_OnClick, Guild_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/hps.lua b/Interface/AddOns/SVUI/packages/stats/stats/hps.lua deleted file mode 100644 index e5ecbff..0000000 --- a/Interface/AddOns/SVUI/packages/stats/stats/hps.lua +++ /dev/null @@ -1,135 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## - -STATS:Extend EXAMPLE USAGE: MOD:Extend(newStat,eventList,onEvents,update,click,focus,blur) - -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local string = _G.string; ---[[ STRING METHODS ]]-- -local match, sub, join = string.match, string.sub, string.join; -local max = math.max; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L -local MOD = SV.SVStats; ---[[ -########################################################## -CALL TO ARMS STATS -########################################################## -]]-- -local StatEvents = {'PLAYER_ENTERING_WORLD', 'COMBAT_LOG_EVENT_UNFILTERED', "PLAYER_LEAVE_COMBAT", 'PLAYER_REGEN_DISABLED', 'UNIT_PET'}; - -local PlayerEvents = {["SPELL_HEAL"] = true, ["SPELL_PERIODIC_HEAL"] = true} -local playerID = UnitGUID('player') -local petID -local healTotal, totalHeal, totalOverHeal, lastHealAmount = 0, 0, 0, 0 -local combatTime = 0 -local timeStamp = 0 -local lastSegment = 0 -local lastPanel -local hexColor = "FFFFFF"; -local displayString = "|cff%s%.1f|r"; -local dpsString = "%s |cff00CCFF%s|r"; - -local join = string.join -local max = math.max - -local function Reset() - timeStamp = 0 - combatTime = 0 - healTotal = 0 - totalHeal = 0 - totalOverHeal = 0 - lastHealAmount = 0 -end - -local function GetHPS(self) - if healTotal == 0 or combatTime == 0 then - self.text:SetText(dpsString:format(L["HPS"], "..PAUSED")) - self.TText = "No Healing Done" - self.TText2 = "Surely there is someone \nwith an ouchie somewhere!" - else - local HPS = (healTotal) / (combatTime) - self.text:SetFormattedText(displayString, hexColor, HPS) - self.TText = "HPS:" - self.TText2 = HPS - end -end - -local function HPS_OnClick(self) - Reset() - GetHPS(self) -end - -local function HPS_OnEnter(self) - MOD:Tip(self) - MOD.tooltip:AddDoubleLine("Healing Total:", totalHeal, 1, 1, 1) - MOD.tooltip:AddDoubleLine("OverHealing Total:", totalOverHeal, 1, 1, 1) - MOD.tooltip:AddLine(" ", 1, 1, 1) - MOD.tooltip:AddDoubleLine(self.TText, self.TText2, 1, 1, 1) - MOD.tooltip:AddLine(" ", 1, 1, 1) - MOD.tooltip:AddDoubleLine("[Click]", "Clear HPS", 0,1,0, 0.5,1,0.5) - MOD:ShowTip(true) -end - -local function HPS_OnEvent(self, event, ...) - lastPanel = self - - if event == "PLAYER_ENTERING_WORLD" then - playerID = UnitGUID('player') - elseif event == 'PLAYER_REGEN_DISABLED' or event == "PLAYER_LEAVE_COMBAT" then - local now = time() - if now - lastSegment > 20 then --time since the last segment - Reset() - end - lastSegment = now - elseif event == 'COMBAT_LOG_EVENT_UNFILTERED' then - local newTime, event, _, srcGUID, _, _, _, _, _, _, _, _, _, test, lastHealAmount, overHeal = ... - if not PlayerEvents[event] then return end - if(srcGUID == playerID or srcGUID == petID) then - if timeStamp == 0 then timeStamp = newTime end - lastSegment = timeStamp - combatTime = newTime - timeStamp - healTotal = healTotal + (lastHealAmount - overHeal) - totalHeal = totalHeal + lastHealAmount - totalOverHeal = totalOverHeal + overHeal - end - elseif event == UNIT_PET then - petID = UnitGUID("pet") - end - - GetHPS(self) -end - -local HPSColorUpdate = function() - hexColor = SV:HexColor("highlight"); - if lastPanel ~= nil then - HPS_OnEvent(lastPanel) - end -end - -LibSuperVillain("Registry"):NewCallback("CORE_MEDIA_UPDATED", "HPSColorUpdates", HPSColorUpdate) -MOD:Extend('HPS', StatEvents, HPS_OnEvent, nil, HPS_OnClick, HPS_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua b/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua deleted file mode 100644 index 08847af..0000000 --- a/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua +++ /dev/null @@ -1,177 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## - -STATS:Extend EXAMPLE USAGE: MOD:Extend(newStat,eventList,onEvents,update,click,focus,blur) - -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local tinsert = _G.tinsert; -local table = _G.table; -local twipe = table.wipe; -local tsort = table.sort; ---[[ STRING METHODS ]]-- -local format, gsub = string.format, string.gsub; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L; -local MOD = SV.SVStats; ---[[ -########################################################## -REPUTATION STATS -########################################################## -]]-- -local StatEvents = {"PLAYER_ENTERING_WORLD", "UPDATE_FACTION"}; -local RepMenuList = {}; -local standingName = { - [1] = "Hated", - [2] = "Hostile", - [3] = "Unfriendly", - [4] = "Neutral", - [5] = "Friendly", - [6] = "Honored", - [7] = "Revered", - [8] = "Exalted" -} - -local function TruncateString(value) - if value >= 1e9 then - return ("%.1fb"):format(value/1e9):gsub("%.?0+([kmb])$","%1") - elseif value >= 1e6 then - return ("%.1fm"):format(value/1e6):gsub("%.?0+([kmb])$","%1") - elseif value >= 1e3 or value <= -1e3 then - return ("%.1fk"):format(value/1e3):gsub("%.?0+([kmb])$","%1") - else - return value - end -end --- name, description, standingID, barMin, barMax, barValue, _, _, _, _, hasRep, isWatched, isChild -function MOD:CacheRepData() - twipe(RepMenuList) - for factionIndex = 1, GetNumFactions() do - local factionName, description, standingID, barMin, barMax, barValue, _, _, _, _, hasRep, isWatched, isChild = GetFactionInfo(factionIndex) - if(standingID) then - local fn = function() - local active = GetWatchedFactionInfo() - if factionName ~= active then - SetWatchedFactionIndex(factionIndex) - end - end - tinsert(RepMenuList, {text = factionName, func = fn}) - end - end - tsort(RepMenuList, function(a,b) return a.text < b.text end) -end - -local function Reputation_OnEvent(self, ...) - if self.barframe:IsShown()then - self.text:SetAllPoints(self) - self.text:SetJustifyH("CENTER") - self.barframe:Hide() - self.text:SetAlpha(1) - self.text:SetShadowOffset(2, -4) - end - local ID = 100 - local friendText - local name, reaction, min, max, value = GetWatchedFactionInfo() - local numFactions = GetNumFactions(); - if not name then - self.text:SetText("No watched factions") - else - for i=1, numFactions do - local factionName, description, standingID, barMin, barMax, barValue, _, _, _, _, hasRep, isWatched, isChild = GetFactionInfo(i); - local friendID, friendRep, friendMaxRep, _, _, _, friendTextLevel = GetFriendshipReputation(isChild); - if(not factionName or (name == "No watched factions") or (name == factionName)) then - if friendID ~= nil then - friendText = friendTextLevel - else - ID = standingID - end - end - end - friendText = friendText or _G["FACTION_STANDING_LABEL"..ID] or " "; - self.text:SetFormattedText("|cff22EF5F%s|r|cff888888 - [|r%d%%|cff888888]|r", friendText, ((value - min) / (max - min) * 100)) - end -end - -local function ReputationBar_OnEvent(self, ...) - if not self.barframe:IsShown()then - self.barframe:Show() - self.barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\STAT-REP") - self.text:SetAlpha(1) - self.text:SetShadowOffset(1, -2) - end - local bar = self.barframe.bar; - local name, reaction, min, max, value = GetWatchedFactionInfo() - local numFactions = GetNumFactions(); - if not name then - bar:SetStatusBarColor(0,0,0) - bar:SetMinMaxValues(0,1) - bar:SetValue(0) - self.text:SetText("No Faction") - else - for i=1, numFactions do - local factionName, description, standingID, barMin, barMax, barValue, _, _, _, _, hasRep, isWatched, isChild = GetFactionInfo(i); - if(isChild) then - local friendID, friendRep, friendMaxRep, _, _, _, friendTextLevel, friendThreshold, nextFriendThreshold = GetFriendshipReputation(isChild); - if friendID ~= nil then - min = friendThreshold - max = friendMaxRep - value = friendRep - end - end - end - local txt = standingName[reaction]; - local color = FACTION_BAR_COLORS[reaction] - bar:SetStatusBarColor(color.r, color.g, color.b) - bar:SetMinMaxValues(min, max) - bar:SetValue(value) - self.text:SetText(txt) - end -end - -local function Reputation_OnEnter(self) - MOD:Tip(self) - local name, reaction, min, max, value, factionID = GetWatchedFactionInfo() - local friendID, _, _, _, _, _, friendTextLevel = GetFriendshipReputation(factionID); - if not name then - MOD.tooltip:AddLine("No Watched Factions") - else - MOD.tooltip:AddLine(name) - MOD.tooltip:AddLine(' ') - MOD.tooltip:AddDoubleLine(STANDING..':', friendID and friendTextLevel or _G['FACTION_STANDING_LABEL'..reaction], 1, 1, 1) - MOD.tooltip:AddDoubleLine(REPUTATION..':', format('%d / %d (%d%%)', value - min, max - min, (value - min) / (max - min) * 100), 1, 1, 1) - end - MOD.tooltip:AddLine(" ", 1, 1, 1) - MOD.tooltip:AddDoubleLine("[Click]", "Change Watched Faction", 0,1,0, 0.5,1,0.5) - MOD:ShowTip(true) -end - -local function Reputation_OnClick(self, button) - MOD:CacheRepData() - SV.Dropdown:Open(self, RepMenuList) -end - -MOD:Extend("Reputation", StatEvents, Reputation_OnEvent, nil, Reputation_OnClick, Reputation_OnEnter) -MOD:Extend("Reputation Bar", StatEvents, ReputationBar_OnEvent, nil, Reputation_OnClick, Reputation_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/system.lua b/Interface/AddOns/SVUI/packages/stats/stats/system.lua deleted file mode 100644 index 2c88e81..0000000 --- a/Interface/AddOns/SVUI/packages/stats/stats/system.lua +++ /dev/null @@ -1,288 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## - -STATS:Extend EXAMPLE USAGE: MOD:Extend(newStat,eventList,onEvents,update,click,focus,blur) - -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local string = _G.string; -local math = _G.math; -local table = _G.table; ---[[ STRING METHODS ]]-- -local format = string.format; ---[[ MATH METHODS ]]-- -local floor = math.floor ---[[ TABLE METHODS ]]-- -local tsort = table.sort; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L; -local MOD = SV.SVStats; ---[[ -########################################################## -SYSTEM STATS (Credit: Elv) -########################################################## -]]-- -local int, int2 = 6, 5 -local statusColors = { - "|cff0CD809", - "|cffE8DA0F", - "|cffFF9000", - "|cffD80909" -} - -local enteredFrame = false; -local bandwidthString = "%.2f Mbps" -local percentageString = "%.2f%%" -local homeLatencyString = "%d ms" -local kiloByteString = "%d kb" -local megaByteString = "%.2f mb" -local totalMemory = 0 -local bandwidth = 0 - -local function formatMem(memory) - local mult = 10^1 - if memory > 999 then - local mem = ((memory/1024) * mult) / mult - return megaByteString:format(mem) - else - local mem = (memory * mult) / mult - return kiloByteString:format(mem) - end -end - -local memoryTable = {} -local cpuTable = {} ---local eventTable = {"ZONE_CHANGED", "ZONE_CHANGED_NEW_AREA", "PLAYER_ENTERING_WORLD"} - -local function RebuildAddonList() - local addOnCount = GetNumAddOns() - if (addOnCount == #memoryTable) then return end - memoryTable = {} - cpuTable = {} - for i = 1, addOnCount do - local addonName = select(2, GetAddOnInfo(i)) - memoryTable[i] = { i, addonName, 0, IsAddOnLoaded(i) } - cpuTable[i] = { i, addonName, 0, IsAddOnLoaded(i) } - end -end - -local function UpdateMemory() - -- Update the memory usages of the addons - UpdateAddOnMemoryUsage() - -- Load memory usage in table - totalMemory = 0 - for i = 1, #memoryTable do - memoryTable[i][3] = GetAddOnMemoryUsage(memoryTable[i][1]) - totalMemory = totalMemory + memoryTable[i][3] - end - -- Sort the table to put the largest addon on top - tsort(memoryTable, function(a, b) - if a and b then - return a[3] > b[3] - end - end) -end - -local function UpdateCPU() - --Update the CPU usages of the addons - UpdateAddOnCPUUsage() - -- Load cpu usage in table - local addonCPU = 0 - local totalCPU = 0 - for i = 1, #cpuTable do - addonCPU = GetAddOnCPUUsage(cpuTable[i][1]) - cpuTable[i][3] = addonCPU - totalCPU = totalCPU + addonCPU - end - - -- Sort the table to put the largest addon on top - tsort(cpuTable, function(a, b) - if a and b then - return a[3] > b[3] - end - end) - - return totalCPU -end - -local function Click() - collectgarbage("collect"); - ResetCPUUsage(); -end - -local function OnEnter(self) - enteredFrame = true; - local cpuProfiling = false --GetCVar("scriptProfile") == "1" - MOD:Tip(self) - - UpdateMemory() - bandwidth = GetAvailableBandwidth() - - MOD.tooltip:AddDoubleLine(L['Home Latency:'], homeLatencyString:format(select(3, GetNetStats())), 0.69, 0.31, 0.31,0.84, 0.75, 0.65) - - if bandwidth ~= 0 then - local percent = GetDownloadedPercentage() - percent = percent * 100 - MOD.tooltip:AddDoubleLine(L['Bandwidth'] , bandwidthString:format(bandwidth), 0.69, 0.31, 0.31,0.84, 0.75, 0.65) - MOD.tooltip:AddDoubleLine(L['Download'] , percentageString:format(percent), 0.69, 0.31, 0.31, 0.84, 0.75, 0.65) - MOD.tooltip:AddLine(" ") - end - - local totalCPU = nil - MOD.tooltip:AddDoubleLine(L['Total Memory:'], formatMem(totalMemory), 0.69, 0.31, 0.31,0.84, 0.75, 0.65) - if cpuProfiling then - totalCPU = UpdateCPU() - MOD.tooltip:AddDoubleLine(L['Total CPU:'], homeLatencyString:format(totalCPU), 0.69, 0.31, 0.31,0.84, 0.75, 0.65) - end - - local red, green - if IsShiftKeyDown() or not cpuProfiling then - MOD.tooltip:AddLine(" ") - for i = 1, #memoryTable do - if (memoryTable[i][4]) then - red = memoryTable[i][3] / totalMemory - green = 1 - red - MOD.tooltip:AddDoubleLine(memoryTable[i][2], formatMem(memoryTable[i][3]), 1, 1, 1, red, green + .5, 0) - end - end - end - - if cpuProfiling and not IsShiftKeyDown() then - MOD.tooltip:AddLine(" ") - for i = 1, #cpuTable do - if (cpuTable[i][4]) then - red = cpuTable[i][3] / totalCPU - green = 1 - red - MOD.tooltip:AddDoubleLine(cpuTable[i][2], homeLatencyString:format(cpuTable[i][3]), 1, 1, 1, red, green + .5, 0) - end - end - - -- if(MOD.DebugList) then - -- MOD.tooltip:AddLine(" ") - -- for _,schema in pairs(MOD.DebugList) do - -- local obj = SV[schema] - -- if obj and obj.___eventframe then - -- local upTime, numEvents = GetFrameCPUUsage(obj.___eventframe) - -- local eventString = ("%s:"):format(schema) - -- local eventResults = ("Calls: |cffFFFF00%d|r @: |cffFFFF00%dms|r"):format(numEvents, upTime) - -- MOD.tooltip:AddDoubleLine(eventString, eventResults, 1, 0.5, 0, 1, 1, 1) - -- end - -- end - -- end - - -- MOD.tooltip:AddLine(" ") - -- for i = 1, #eventTable do - -- local upTime, numEvents = GetEventCPUUsage(eventTable[i]) - -- local eventString = ("%s:"):format(eventTable[i]) - -- local eventResults = ("Calls: |cffFFFF00%d|r @: |cffFFFF00%dms|r"):format(numEvents, upTime) - -- MOD.tooltip:AddDoubleLine(eventString, eventResults, 1, 0.5, 0, 1, 1, 1) - -- end - - - MOD.tooltip:AddLine(" ") - MOD.tooltip:AddLine(L['(Hold Shift) Memory Usage']) - end - - MOD.tooltip:Show() -end - -local function OnLeave(self) - enteredFrame = false; - MOD.tooltip:Hide() -end - -local Update = function(self, t) - int = int - t - int2 = int2 - t - - if int < 0 then - RebuildAddonList() - int = 10 - end - if int2 < 0 then - local framerate = floor(GetFramerate()) - local latency = select(4, GetNetStats()) - - self.text:SetFormattedText("FPS: %s%d|r MS: %s%d|r", - statusColors[framerate >= 30 and 1 or (framerate >= 20 and framerate < 30) and 2 or (framerate >= 10 and framerate < 20) and 3 or 4], - framerate, - statusColors[latency < 150 and 1 or (latency >= 150 and latency < 300) and 2 or (latency >= 300 and latency < 500) and 3 or 4], - latency) - int2 = 1 - if enteredFrame then - OnEnter(self) - end - end -end --- if(SV.DebugMode) then --- Update = function(self, t) --- int = int - t --- if int < 0 then --- UpdateAddOnMemoryUsage() --- local svuiRAMout = formatMem(GetAddOnMemoryUsage("SVUI")) --- self.text:SetFormattedText("RAM: %s%s|r", statusColors[1], svuiRAMout) --- int = 1 --- if enteredFrame then --- OnEnter(self) --- end --- end --- end --- else --- Update = function(self, t) --- int = int - t --- int2 = int2 - t - --- if int < 0 then --- RebuildAddonList() --- int = 10 --- end --- if int2 < 0 then --- local framerate = floor(GetFramerate()) --- local latency = select(4, GetNetStats()) - --- self.text:SetFormattedText("FPS: %s%d|r MS: %s%d|r", --- statusColors[framerate >= 30 and 1 or (framerate >= 20 and framerate < 30) and 2 or (framerate >= 10 and framerate < 20) and 3 or 4], --- framerate, --- statusColors[latency < 150 and 1 or (latency >= 150 and latency < 300) and 2 or (latency >= 300 and latency < 500) and 3 or 4], --- latency) --- int2 = 1 --- if enteredFrame then --- OnEnter(self) --- end --- end --- end --- end - -MOD:Extend('System', nil, nil, Update, Click, OnEnter, OnLeave) - ---[[ -OTHER CHECKS - -GetScriptCPUUsage() -print(debugstack()) -local usage, calls = GetFunctionCPUUsage(function, includeSubroutines) -local usage, numEvents = GetEventCPUUsage(["event"]) -]]-- \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/time.lua b/Interface/AddOns/SVUI/packages/stats/stats/time.lua deleted file mode 100644 index 1a1dbae..0000000 --- a/Interface/AddOns/SVUI/packages/stats/stats/time.lua +++ /dev/null @@ -1,238 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## - -STATS:Extend EXAMPLE USAGE: MOD:Extend(newStat,eventList,onEvents,update,click,focus,blur) - -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local type = _G.type; -local string = _G.string; -local math = _G.math; ---[[ STRING METHODS ]]-- -local format, join = string.format, string.join; ---[[ MATH METHODS ]]-- -local floor = math.floor; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L -local MOD = SV.SVStats; ---[[ -########################################################## -TIME STATS (Credit: Elv) -########################################################## -]]-- -local APM = { TIMEMANAGER_PM, TIMEMANAGER_AM } -local europeDisplayFormat = ''; -local ukDisplayFormat = ''; -local europeDisplayFormat_nocolor = join("", "%02d", ":|r%02d") -local ukDisplayFormat_nocolor = join("", "", "%d", ":|r%02d", " %s|r") -local timerLongFormat = "%d:%02d:%02d" -local timerShortFormat = "%d:%02d" -local lockoutInfoFormat = "%s%s |cffaaaaaa(%s, %s/%s)" -local lockoutInfoFormatNoEnc = "%s%s |cffaaaaaa(%s)" -local formatBattleGroundInfo = "%s: " -local lockoutColorExtended, lockoutColorNormal = { r=0.3,g=1,b=0.3 }, { r=.8,g=.8,b=.8 } -local lockoutFormatString = { "%dd %02dh %02dm", "%dd %dh %02dm", "%02dh %02dm", "%dh %02dm", "%dh %02dm", "%dm" } -local curHr, curMin, curAmPm -local enteredFrame = false; -local date = _G.date - -local Update, lastPanel; -- UpValue -local localizedName, isActive, canQueue, startTime, canEnter, _ -local name, instanceID, reset, difficultyId, locked, extended, isRaid, maxPlayers, difficulty, numEncounters, encounterProgress - -local function ValueColorUpdate(hex, r, g, b) - europeDisplayFormat = join("", "%02d", hex, ":|r%02d") - ukDisplayFormat = join("", "", "%d", hex, ":|r%02d", hex, " %s|r") - - if lastPanel ~= nil then - Update(lastPanel, 20000) - end -end - -local function ConvertTime(h, m) - local AmPm - if SV.db.SVStats.time24 == true then - return h, m, -1 - else - if h >= 12 then - if h > 12 then h = h - 12 end - AmPm = 1 - else - if h == 0 then h = 12 end - AmPm = 2 - end - end - return h, m, AmPm -end - -local function CalculateTimeValues(tooltip) - if (tooltip and SV.db.SVStats.localtime) or (not tooltip and not SV.db.SVStats.localtime) then - return ConvertTime(GetGameTime()) - else - local dateTable = date("*t") - return ConvertTime(dateTable["hour"], dateTable["min"]) - end -end - -local function Click() - GameTimeFrame:Click(); -end - -local function OnLeave(self) - MOD.tooltip:Hide(); - enteredFrame = false; -end - -local function OnEvent(self, event) - if event == "UPDATE_INSTANCE_INFO" and enteredFrame then - RequestRaidInfo() - end -end - -local function OnEnter(self) - MOD:Tip(self) - - if(not enteredFrame) then - enteredFrame = true; - RequestRaidInfo() - end - - MOD.tooltip:AddLine(VOICE_CHAT_BATTLEGROUND); - for i = 1, GetNumWorldPVPAreas() do - _, localizedName, isActive, canQueue, startTime, canEnter = GetWorldPVPAreaInfo(i) - if canEnter then - if isActive then - startTime = WINTERGRASP_IN_PROGRESS - elseif startTime == nil then - startTime = QUEUE_TIME_UNAVAILABLE - else - startTime = SecondsToTime(startTime, false, nil, 3) - end - MOD.tooltip:AddDoubleLine(format(formatBattleGroundInfo, localizedName), startTime, 1, 1, 1, lockoutColorNormal.r, lockoutColorNormal.g, lockoutColorNormal.b) - end - end - - local oneraid, lockoutColor - for i = 1, GetNumSavedInstances() do - name, _, reset, difficultyId, locked, extended, _, isRaid, maxPlayers, difficulty, numEncounters, encounterProgress = GetSavedInstanceInfo(i) - if isRaid and (locked or extended) and name then - if not oneraid then - MOD.tooltip:AddLine(" ") - MOD.tooltip:AddLine(L["Saved Raid(s)"]) - oneraid = true - end - if extended then - lockoutColor = lockoutColorExtended - else - lockoutColor = lockoutColorNormal - end - - local _, _, isHeroic, _ = GetDifficultyInfo(difficultyId) - if (numEncounters and numEncounters > 0) and (encounterProgress and encounterProgress > 0) then - MOD.tooltip:AddDoubleLine(format(lockoutInfoFormat, maxPlayers, (isHeroic and "H" or "N"), name, encounterProgress, numEncounters), SecondsToTime(reset, false, nil, 3), 1, 1, 1, lockoutColor.r, lockoutColor.g, lockoutColor.b) - else - MOD.tooltip:AddDoubleLine(format(lockoutInfoFormatNoEnc, maxPlayers, (isHeroic and "H" or "N"), name), SecondsToTime(reset, false, nil, 3), 1, 1, 1, lockoutColor.r, lockoutColor.g, lockoutColor.b) - end - end - end - - local addedLine = false - for i = 1, GetNumSavedWorldBosses() do - name, instanceID, reset = GetSavedWorldBossInfo(i) - if(reset) then - if(not addedLine) then - MOD.tooltip:AddLine(' ') - MOD.tooltip:AddLine(RAID_INFO_WORLD_BOSS.."(s)") - addedLine = true - end - MOD.tooltip:AddDoubleLine(name, SecondsToTime(reset, true, nil, 3), 1, 1, 1, 0.8, 0.8, 0.8) - end - end - - local timeText - local Hr, Min, AmPm = CalculateTimeValues(true) - - MOD.tooltip:AddLine(" ") - if AmPm == -1 then - MOD.tooltip:AddDoubleLine(SV.db.SVStats.localtime and TIMEMANAGER_TOOLTIP_REALMTIME or TIMEMANAGER_TOOLTIP_LOCALTIME, - format(europeDisplayFormat_nocolor, Hr, Min), 1, 1, 1, lockoutColorNormal.r, lockoutColorNormal.g, lockoutColorNormal.b) - else - MOD.tooltip:AddDoubleLine(SV.db.SVStats.localtime and TIMEMANAGER_TOOLTIP_REALMTIME or TIMEMANAGER_TOOLTIP_LOCALTIME, - format(ukDisplayFormat_nocolor, Hr, Min, APM[AmPm]), 1, 1, 1, lockoutColorNormal.r, lockoutColorNormal.g, lockoutColorNormal.b) - end - - MOD.tooltip:Show() -end - -local int = 3 -function Update(self, t) - int = int - t - - if int > 0 then return end - - if GameTimeFrame.flashInvite then - SV.Animate:Flash(self, 0.53) - else - SV.Animate:StopFlash(self) - end - - if enteredFrame then - OnEnter(self) - end - - local Hr, Min, AmPm = CalculateTimeValues(false) - - -- no update quick exit - if (Hr == curHr and Min == curMin and AmPm == curAmPm) and not (int < -15000) then - int = 5 - return - end - - curHr = Hr - curMin = Min - curAmPm = AmPm - - if AmPm == -1 then - self.text:SetFormattedText(europeDisplayFormat, Hr, Min) - else - self.text:SetFormattedText(ukDisplayFormat, Hr, Min, APM[AmPm]) - end - lastPanel = self - int = 5 -end - -local TimeColorUpdate = function() - local hexColor = SV:HexColor("highlight") - europeDisplayFormat = join("", "%02d|cff", hexColor, ":|r%02d") - ukDisplayFormat = join("", "", "%d|cff", hexColor, ":|r%02d|cff", hexColor, " %s|r") - if lastPanel ~= nil then - Update(lastPanel, 20000) - end -end - -LibSuperVillain("Registry"):NewCallback("CORE_MEDIA_UPDATED", "TimeColorUpdates", TimeColorUpdate) - -MOD:Extend('Time', {"UPDATE_INSTANCE_INFO"}, OnEvent, Update, Click, OnEnter, OnLeave) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/tokens.lua b/Interface/AddOns/SVUI/packages/stats/stats/tokens.lua deleted file mode 100644 index ff27b78..0000000 --- a/Interface/AddOns/SVUI/packages/stats/stats/tokens.lua +++ /dev/null @@ -1,236 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## - -STATS:Extend EXAMPLE USAGE: MOD:Extend(newStat,eventList,onEvents,update,click,focus,blur) - -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local tinsert = _G.tinsert; -local table = _G.table; -local twipe = table.wipe; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L; -local MOD = SV.SVStats; ---[[ -########################################################## -GOLD STATS -########################################################## -]]-- -local playerName = UnitName("player"); -local playerRealm = GetRealmName(); - -local TokenEvents = {'PLAYER_ENTERING_WORLD','PLAYER_MONEY','CURRENCY_DISPLAY_UPDATE'}; - -local function TokenInquiry(id, weekly, capped) - local name, amount, tex, week, weekmax, maxed, discovered = GetCurrencyInfo(id) - local r, g, b = 1, 1, 1 - for i = 1, GetNumWatchedTokens() do - local _, _, _, itemID = GetBackpackCurrencyInfo(i) - if id == itemID then r, g, b = 0.23, 0.88, 0.27 end - end - local texStr = ("\124T%s:12\124t %s"):format(tex, name) - local altStr = "" - if weekly then - if discovered then - if id == 390 then - altStr = ("Current: %d | Weekly: %d / %d"):format(amount, week, weekmax) - else - altStr = ("Current: %d / %d | Weekly: %d / %d"):format(amount, maxed, week, weekmax) - end - MOD.tooltip:AddDoubleLine(texStr, altStr, r, g, b, r, g, b) - end - elseif capped then - if id == 392 or id == 395 then maxed = 4000 end - if id == 396 then maxed = 3000 end - if discovered then - altStr = ("%d / %d"):format(amount, maxed) - MOD.tooltip:AddDoubleLine(texStr, altStr, r, g, b, r, g, b) - end - else - if discovered then - MOD.tooltip:AddDoubleLine(texStr, amount, r, g, b, r, g, b) - end - end -end - -local function TokensEventHandler(self, event,...) - if(not IsLoggedIn() or (not self)) then return end - local id = self.TokenKey or 738; - local _, current, tex = GetCurrencyInfo(id) - local currentText = ("\124T%s:12\124t %s"):format(tex, current); - self.text:SetText(currentText) -end - -local function AddToTokenMenu(parent, id) - local name, _, tex, _, _, _, _ = GetCurrencyInfo(id) - local itemName = "\124T"..tex..":12\124t "..name; - local fn = function() - MOD.Accountant[playerRealm]["tokens"][playerName][parent.SlotKey] = id; - parent.TokenKey = id - TokensEventHandler(parent) - end - tinsert(parent.TokenList, {text = itemName, func = fn}); -end - -local function CacheTokenData(self) - twipe(self.TokenList) - local prof1, prof2, archaeology, _, cooking = GetProfessions() - if archaeology then - AddToTokenMenu(self, 398) - AddToTokenMenu(self, 384) - AddToTokenMenu(self, 393) - AddToTokenMenu(self, 677) - AddToTokenMenu(self, 400) - AddToTokenMenu(self, 394) - AddToTokenMenu(self, 397) - AddToTokenMenu(self, 676) - AddToTokenMenu(self, 401) - AddToTokenMenu(self, 385) - AddToTokenMenu(self, 399) - AddToTokenMenu(self, 821) - AddToTokenMenu(self, 829) - AddToTokenMenu(self, 944) - end - if cooking then - AddToTokenMenu(self, 81) - AddToTokenMenu(self, 402) - end - if(prof1 == 9 or prof2 == 9) then - AddToTokenMenu(self, 61) - AddToTokenMenu(self, 361) - AddToTokenMenu(self, 698) - - AddToTokenMenu(self, 910) - AddToTokenMenu(self, 999) - AddToTokenMenu(self, 1020) - AddToTokenMenu(self, 1008) - AddToTokenMenu(self, 1017) - end - AddToTokenMenu(self, 697, false, true) - AddToTokenMenu(self, 738) - AddToTokenMenu(self, 615) - AddToTokenMenu(self, 614) - AddToTokenMenu(self, 395, false, true) - AddToTokenMenu(self, 396, false, true) - AddToTokenMenu(self, 390, true) - AddToTokenMenu(self, 392, false, true) - AddToTokenMenu(self, 391) - AddToTokenMenu(self, 241) - AddToTokenMenu(self, 416) - AddToTokenMenu(self, 515) - AddToTokenMenu(self, 776) - AddToTokenMenu(self, 777) - AddToTokenMenu(self, 789) - AddToTokenMenu(self, 823) - AddToTokenMenu(self, 824) -end - -local function Tokens_OnEnter(self) - MOD:Tip(self) - MOD.tooltip:AddLine(playerName .. "\'s Tokens") - - MOD.tooltip:AddLine(" ") - MOD.tooltip:AddLine("Common") - TokenInquiry(241) - TokenInquiry(416) - TokenInquiry(515) - TokenInquiry(776) - TokenInquiry(777) - TokenInquiry(789) - - MOD.tooltip:AddLine(" ") - MOD.tooltip:AddLine("Garrison") - TokenInquiry(823) - TokenInquiry(824) - TokenInquiry(910) - TokenInquiry(999) - TokenInquiry(1020) - TokenInquiry(1008) - TokenInquiry(1017) - - MOD.tooltip:AddLine(" ") - MOD.tooltip:AddLine("Raiding and Dungeons") - TokenInquiry(697, false, true) - TokenInquiry(738) - TokenInquiry(615) - TokenInquiry(614) - TokenInquiry(395, false, true) - TokenInquiry(396, false, true) - - MOD.tooltip:AddLine(" ") - MOD.tooltip:AddLine("PvP") - TokenInquiry(390, true) - TokenInquiry(392, false, true) - TokenInquiry(391) - - local prof1, prof2, archaeology, _, cooking = GetProfessions() - if(archaeology or cooking or prof1 == 9 or prof2 == 9) then - MOD.tooltip:AddLine(" ") - MOD.tooltip:AddLine("Professions") - end - if cooking then - TokenInquiry(81) - TokenInquiry(402) - end - if(prof1 == 9 or prof2 == 9) then - TokenInquiry(61) - TokenInquiry(361) - TokenInquiry(698) - end - if archaeology then - TokenInquiry(821) - TokenInquiry(829) - TokenInquiry(944) - TokenInquiry(398) - TokenInquiry(384) - TokenInquiry(393) - TokenInquiry(677) - TokenInquiry(400) - TokenInquiry(394) - TokenInquiry(397) - TokenInquiry(676) - TokenInquiry(401) - TokenInquiry(385) - TokenInquiry(399) - end - MOD.tooltip:AddLine(" ") - MOD.tooltip:AddDoubleLine("[Shift + Click]", "Change Watched Token", 0,1,0, 0.5,1,0.5) - MOD:ShowTip(true) -end - -local function Tokens_OnClick(self, button) - CacheTokenData(self); - SV.Dropdown:Open(self, self.TokenList) -end - -local function Tokens_OnInit(self) - local key = self.SlotKey - MOD.Accountant[playerRealm]["tokens"][playerName][key] = MOD.Accountant[playerRealm]["tokens"][playerName][key] or 738; - self.TokenKey = MOD.Accountant[playerRealm]["tokens"][playerName][key] - CacheTokenData(self); -end - -MOD:Extend('Tokens', TokenEvents, TokensEventHandler, nil, Tokens_OnClick, Tokens_OnEnter, nil, Tokens_OnInit) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tip/SVTip.lua b/Interface/AddOns/SVUI/packages/tip/SVTip.lua index 4d5338e..015a947 100644 --- a/Interface/AddOns/SVUI/packages/tip/SVTip.lua +++ b/Interface/AddOns/SVUI/packages/tip/SVTip.lua @@ -89,7 +89,7 @@ local tooltips = { BattlePetTooltip, FloatingBattlePetTooltip, FloatingPetBattleAbilityTooltip, FloatingGarrisonFollowerTooltip, GarrisonMissionMechanicTooltip, GarrisonFollowerTooltip, GarrisonMissionMechanicFollowerCounterTooltip, GarrisonFollowerAbilityTooltip, - --StoreTooltip, + SmallTextTooltip, BrowserSettingsTooltip, QueueStatusFrame }; @@ -116,7 +116,7 @@ local VISIBILITY_UNITS = "NONE"; local VISIBILITY_COMBAT = false; local BAR_TEXT = true; local BAR_HEIGHT = 10; -local BAR_FONT = "Roboto"; +local BAR_FONT = "SVUI Clean Font"; local BAR_FONTSIZE = 10; local VisibilityTest = { @@ -203,6 +203,10 @@ CORE FUNCTIONS ########################################################## ]]-- local SetMaskBorderColor = function(self, r, g, b, hasStatusBar) + if(self:GetAlpha() == 0) then + self:FadeIn() + end + self:SetBackdropColor(0, 0, 0, 0.8) if(COMIC_TIPS) then local a = self.ToggleAlpha if(hasStatusBar) then @@ -218,74 +222,68 @@ local SetMaskBorderColor = function(self, r, g, b, hasStatusBar) end end r,g,b = (r * 0.5),(g * 0.5),(b * 0.5) - self[5]:SetTexture(r, g, b) - self[6]:SetTexture(r, g, b) - self[7]:SetTexture(r, g, b) - self[8]:SetTexture(r, g, b) + self[5]:SetTexture(r, g, b, 1) + self[6]:SetTexture(r, g, b, 1) + self[7]:SetTexture(r, g, b, 1) + self[8]:SetTexture(r, g, b, 1) + --print('Set Color') end -local ClearMaskColors = function(self) - self:SetBackdrop({ - bgFile = TT_BG, - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = true, - tileSize = 128, - edgeSize = 1, - insets = {left = 1, right = 1, top = 1, bottom = 1} - }) - self:SetBackdropColor(0, 0, 0, 1) - self:SetBackdropBorderColor(0, 0, 0, 1) - +local ClearMaskColors = function(self, hide) self[1]:SetVertexColor(0, 0, 0, 0) --self[2]:SetVertexColor(0, 0, 0, 0) self[3]:SetVertexColor(0, 0, 0, 0) self[4]:SetVertexColor(0, 0, 0, 0) - self[5]:SetTexture(0, 0, 0) - self[6]:SetTexture(0, 0, 0) - self[7]:SetTexture(0, 0, 0) - self[8]:SetTexture(0, 0, 0) + self[5]:SetTexture(0, 0, 0, 0) + self[6]:SetTexture(0, 0, 0, 0) + self[7]:SetTexture(0, 0, 0, 0) + self[8]:SetTexture(0, 0, 0, 0) + + if(hide) then + self:SetBackdropColor(0, 0, 0, 0) + end end -function MOD:INSPECT_READY(_,guid) - if MOD.lastGUID ~= guid then return end +function MOD:INSPECT_READY(event, GUID) + if(MOD.lastGUID ~= GUID) then return end local unit = "mouseover" - if UnitExists(unit) then + if(UnitExists(unit)) then local itemLevel = SV:ParseGearSlots(unit, true) local spec = GetTalentSpec(unit) - inspectCache[guid] = {time = GetTime()} - if spec then - inspectCache[guid].talent=spec + inspectCache[GUID] = {time = GetTime()} + if(spec) then + inspectCache[GUID].talent = spec end - if itemLevel then - inspectCache[guid].itemLevel = itemLevel + if(itemLevel) then + inspectCache[GUID].itemLevel = itemLevel end GameTooltip:SetUnit(unit) end MOD:UnregisterEvent("INSPECT_READY") end -local function ShowInspectInfo(this,unit,unitLevel,r,g,b,iteration) +local function ShowInspectInfo(this, unit, unitLevel, r, g, b, iteration) local inspectable = CanInspect(unit) - if not inspectable or unitLevel < 10 or iteration > 2 then return end - local guid = UnitGUID(unit) - if guid == playerGUID then - this:AddDoubleLine(L["Talent Specialization:"],GetTalentSpec(unit,true),nil,nil,nil,r,g,b) - this:AddDoubleLine(L["Item Level:"],floor(select(2,GetAverageItemLevel())),nil,nil,nil,1,1,1) - elseif inspectCache[guid] then - local talent = inspectCache[guid].talent; - local itemLevel = inspectCache[guid].itemLevel; - if GetTime() - inspectCache[guid].time > 900 or not talent or not itemLevel then - inspectCache[guid] = nil; + if((not inspectable) or (unitLevel < 10) or (iteration > 2)) then return end + local GUID = UnitGUID(unit) + if(GUID == playerGUID) then + this:AddDoubleLine(L["Talent Specialization:"], GetTalentSpec(unit, true), nil, nil, nil, r, g, b) + this:AddDoubleLine(L["Item Level:"], floor(select(2, GetAverageItemLevel())), nil, nil, nil, 1, 1, 1) + elseif(inspectCache[GUID]) then + local talent = inspectCache[GUID].talent; + local itemLevel = inspectCache[GUID].itemLevel; + if(((GetTime() - inspectCache[GUID].time) > 900) or not talent or not itemLevel) then + inspectCache[GUID] = nil; return ShowInspectInfo(this,unit,unitLevel,r,g,b,iteration+1) end this:AddDoubleLine(L["Talent Specialization:"],talent,nil,nil,nil,r,g,b) this:AddDoubleLine(L["Item Level:"],itemLevel,nil,nil,nil,1,1,1) else - if(not inspectable or (InspectFrame and InspectFrame:IsShown())) then + if((not inspectable) or (InspectFrame and InspectFrame:IsShown())) then return end - MOD.lastGUID = guid; + MOD.lastGUID = GUID; NotifyInspect(unit) MOD:RegisterEvent("INSPECT_READY") end @@ -312,18 +310,9 @@ local function tiplevel(this, start) end local function tipbackground(this) - this:SetBackdrop({ - bgFile = TT_BG, - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = true, - tileSize = 128, - edgeSize = 1, - insets = {left = 1, right = 1, top = 1, bottom = 1} - }) - this:SetBackdropColor(0, 0, 0, 0) - this:SetBackdropBorderColor(0, 0, 0, 0) + this:SetBackdropColor(0, 0, 0, 1) if(this.SuperBorder) then - --this.SuperBorder:ClearMaskColors() + this.SuperBorder:SetBackdropColor(0, 0, 0, 0.8) if(not GameTooltipStatusBar:IsShown()) then this.SuperBorder:ClearAllPoints() this.SuperBorder:SetPoint("TOPLEFT", this, "TOPLEFT", 0, 0) @@ -341,7 +330,6 @@ local function tipupdate(this, color, hasStatusBar) local mask = this.SuperBorder local borderColor = color or NIL_COLOR local yOffset = (hasStatusBar) and mask.ToggleHeight or 0; - mask:ClearMaskColors() mask:ClearAllPoints() mask:SetPoint("TOPLEFT", this, "TOPLEFT", 0, 0) mask:SetPoint("BOTTOMRIGHT", this, "BOTTOMRIGHT", 0, yOffset) @@ -381,7 +369,7 @@ local _hook_GameTooltip_OnTooltipSetUnit = function(self) local pvpName = UnitPVPName(unit) local realmRelation = UnitRealmRelationship(unit) colors = RAID_CLASS_COLORS[classToken] - burst = SVUI_CLASS_COLORS[classToken] + burst = CUSTOM_CLASS_COLORS[classToken] if(PLAYER_INFO and pvpName) then unitName = pvpName @@ -532,13 +520,12 @@ end local _hook_GameTooltip_OnTooltipSetItem = function(self) tipbackground(self) - local key,itemLink = self:GetItem() if(key and (not self.itemCleared)) then local quality = select(3, GetItemInfo(key)) if(quality) then local r,g,b = GetItemQualityColor(quality) - self.SuperBorder:SetMaskBorderColor(r,g,b) + self.SuperBorder:SetMaskBorderColor(r, g, b) end if(SPELL_IDS and (itemLink ~= nil)) then @@ -564,10 +551,10 @@ local _hook_GameTooltip_ShowStatusBar = function(self, ...) if bar and not bar.styled then bar:RemoveTextures() bar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - bar:SetFixedPanelTemplate('Inset',true) + bar:SetStylePanel("Fixed", 'Inset',true) if not bar.border then local border=CreateFrame("Frame",nil,bar) - border:WrapOuter(bar,1,1) + border:SetAllPointsOut(bar,1,1) border:SetFrameLevel(bar:GetFrameLevel() - 1) border:SetBackdrop({ edgeFile=[[Interface\BUTTONS\WHITE8X8]], @@ -583,11 +570,9 @@ end local _hook_OnSetUnitAura = function(self, unit, index, filter) tipbackground(self) - --self.SuperBorder:ClearMaskColors() if(not SPELL_IDS) then return; end local _, _, _, _, _, _, _, caster, _, _, spellID = UnitAura(unit, index, filter) if(spellID) then - --self.SuperBorder:ClearMaskColors() if caster then local name = UnitName(caster) local _, class = UnitClass(caster) @@ -605,7 +590,6 @@ end local _hook_OnSetHyperUnitAura = function(self, unit, index, filter) tipbackground(self) - --self.SuperBorder:ClearMaskColors() if unit ~= "player" then return end local auraName, _, _, _, _, _, _, caster, _, shouldConsolidate, spellID = UnitAura(unit, index, filter) if shouldConsolidate then @@ -639,13 +623,13 @@ local _hook_GameTooltip_OnTooltipSetSpell = function(self) end if not check then tipbackground(self) - self.SuperBorder:ClearMaskColors() self:AddLine(text) self:Show() end end local _hook_GameTooltip_SetDefaultAnchor = function(self, parent) + tipbackground(self) if(self:GetAnchorType() ~= "ANCHOR_NONE") then return end if(InCombatLockdown() and VISIBILITY_COMBAT) then self:Hide() @@ -688,16 +672,10 @@ MOD.GameTooltip_SetDefaultAnchor = _hook_GameTooltip_SetDefaultAnchor local _hook_BNToastOnShow = function(self,anchor,parent,relative,x,y) if parent ~= BattleNetToasts_MOVE then BNToastFrame:ClearAllPoints() - BNToastFrame:Point('TOPLEFT',BattleNetToasts_MOVE,'TOPLEFT') + BNToastFrame:SetPointToScale('TOPLEFT',BattleNetToasts_MOVE,'TOPLEFT') end end -local _hook_OnTipCleared = function(self) - tipbackground(self) - self.SuperBorder:ClearMaskColors() - self.itemCleared = nil -end - local _hook_OnItemRef = function(link, text, button, chatFrame) if link:find("^spell:") then local ref = sub(link,7) @@ -713,27 +691,31 @@ local TooltipModifierChangeHandler = function(self, event, mod) end local Override_BGColor = function(self, r, g, b, a) - if(b ~= 0 or (a and a ~= 0)) then + if(((r ~= 0) and (g ~= 0) and (b ~= 0)) or (a and a ~= 0)) then self:SetBackdropColor(0, 0, 0, 0) - self.SuperBorder:SetBackdropColor(0, 0, 0, 0.8) + self.SuperBorder:SetBackdropColor(r, g, b, 0.8) end end local Override_BorderColor = function(self, r, g, b, a) - if(b ~= 0 or (a and a ~= 0)) then - self:SetBackdropBorderColor(0, 0, 0, 0) - self.SuperBorder:SetBackdropBorderColor(0, 0, 0) - self.SuperBorder:SetMaskBorderColor(r, g, b) - end + self.SuperBorder:SetMaskBorderColor(r, g, b, 1) +end + +local _hook_OnTipCleared = function(self) + tipbackground(self) + self.SuperBorder:ClearMaskColors() + self.itemCleared = nil end local _hook_OnTipShow = function(self) + --print('Show') tipbackground(self) end local _hook_OnTipHide = function(self) + --print('Hide') tipbackground(self) - self.SuperBorder:ClearMaskColors() + self.SuperBorder:ClearMaskColors(true) wipe(self.InjectedDouble) end @@ -835,11 +817,8 @@ local function ApplyTooltipSkins() mask:SetBackdrop({ bgFile = TT_BG, - edgeFile = [[Interface\BUTTONS\WHITE8X8]], tile = true, tileSize = 128, - edgeSize = 1, - insets = {left = 1, right = 1, top = 1, bottom = 1} }) mask:SetBackdropColor(0, 0, 0, 1) mask:SetBackdropBorderColor(0, 0, 0) @@ -893,17 +872,14 @@ local function ApplyTooltipSkins() tooltip:SetBackdrop({ bgFile = TT_BG, - edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = true, tileSize = 128, - tile = true, - edgeSize = 1, - insets = {left = 1, right = 1, top = 1, bottom = 1} }) tooltip:SetBackdropColor(0, 0, 0, 0) - tooltip:SetBackdropBorderColor(0, 0, 0, 0) + --tooltip:SetBackdropBorderColor(0, 0, 0, 0) NewHook(tooltip, "SetBackdropColor", Override_BGColor) - NewHook(tooltip, "SetBackdropBorderColor", Override_BorderColor) + --NewHook(tooltip, "SetBackdropBorderColor", Override_BorderColor) tooltip:HookScript("OnShow", _hook_OnTipShow) tooltip:HookScript("OnHide", _hook_OnTipHide) tooltip:HookScript("OnSizeChanged", _hook_OnSizeChanged) @@ -941,8 +917,8 @@ function MOD:Load() self:UpdateLocals() local anchor = CreateFrame("Frame", "SVUI_ToolTip", UIParent) - anchor:Point("BOTTOMLEFT", SV.Dock.BottomRight, "TOPLEFT", 0, 24) - anchor:Size(130, 20) + anchor:SetPointToScale("BOTTOMLEFT", SV.Dock.BottomRight, "TOPLEFT", 0, 24) + anchor:SetSizeToScale(130, 20) anchor:SetFrameLevel(anchor:GetFrameLevel() + 50) SV.Mentalo:Add(anchor, L["Tooltip"]) @@ -950,7 +926,7 @@ function MOD:Load() GameTooltipStatusBar:SetStatusBarTexture(SV.Media.bar.default) BNToastFrame:ClearAllPoints() - BNToastFrame:Point("BOTTOMRIGHT", SV.Dock.BottomLeft, "TOPRIGHT", 0, 20) + BNToastFrame:SetPointToScale("BOTTOMRIGHT", SV.Dock.BottomLeft, "TOPRIGHT", 0, 20) SV.Mentalo:Add(BNToastFrame, L["BattleNet Frame"], nil, nil, "BattleNetToasts") NewHook(BNToastFrame, "SetPoint", _hook_BNToastOnShow) @@ -960,13 +936,13 @@ function MOD:Load() GameTooltipStatusBar:SetPoint("BOTTOMLEFT", GameTooltip.SuperBorder, "BOTTOMLEFT", 3, 3) GameTooltipStatusBar:SetPoint("BOTTOMRIGHT", GameTooltip.SuperBorder, "BOTTOMRIGHT", -3, 3) GameTooltipStatusBar.text = GameTooltipStatusBar:CreateFontString(nil, "OVERLAY") - GameTooltipStatusBar.text:Point("CENTER", GameTooltipStatusBar, "CENTER", 0, 0) - GameTooltipStatusBar.text:FontManager(LSM:Fetch("font", BAR_FONT), BAR_FONTSIZE, "OUTLINE") + GameTooltipStatusBar.text:SetPointToScale("CENTER", GameTooltipStatusBar, "CENTER", 0, 0) + GameTooltipStatusBar.text:FontManager("default") if not GameTooltipStatusBar.border then local border = CreateFrame("Frame", nil, GameTooltipStatusBar) - border:WrapOuter(GameTooltipStatusBar, 1, 1) + border:SetAllPointsOut(GameTooltipStatusBar, 1, 1) border:SetFrameLevel(GameTooltipStatusBar:GetFrameLevel() - 1) border:SetBackdrop({edgeFile = [[Interface\BUTTONS\WHITE8X8]], edgeSize = 1}) border:SetBackdropBorderColor(0, 0, 0, 1) diff --git a/Interface/AddOns/SVUI/packages/tool/SVTools.lua b/Interface/AddOns/SVUI/packages/tool/SVTools.lua new file mode 100644 index 0000000..b2d1af9 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/SVTools.lua @@ -0,0 +1,103 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local print = _G.print; +local ipairs = _G.ipairs; +local pairs = _G.pairs; +local tostring = _G.tostring; +local tonumber = _G.tonumber; + +--STRING +local string = _G.string; +local upper = string.upper; +local format = string.format; +local find = string.find; +local match = string.match; +local gsub = string.gsub; +--TABLE +local table = _G.table; +local tinsert = _G.tinsert; +local tremove = _G.tremove; +local twipe = _G.wipe; +--MATH +local math = _G.math; +local min = math.min; +local floor = math.floor +local ceil = math.ceil +--BLIZZARD API +local GameTooltip = _G.GameTooltip; +local InCombatLockdown = _G.InCombatLockdown; +local CreateFrame = _G.CreateFrame; +local GetTime = _G.GetTime; +local GetItemCooldown = _G.GetItemCooldown; +local GetItemCount = _G.GetItemCount; +local GetItemInfo = _G.GetItemInfo; +local GetSpellInfo = _G.GetSpellInfo; +local IsSpellKnown = _G.IsSpellKnown; +local GetProfessions = _G.GetProfessions; +local GetProfessionInfo = _G.GetProfessionInfo; +local hooksecurefunc = _G.hooksecurefunc; +--[[ +########################################################## +ADDON +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L + +local MOD = SV:NewPackage("SVTools", L["Docked Tools"]); + +function MOD:PLAYER_REGEN_ENABLED() + self:UnregisterEvent('PLAYER_REGEN_ENABLED') + + if(self.ProfessionNeedsUpdate) then + self.ProfessionNeedsUpdate = nil; + self:UpdateProfessionTools() + end + + if(self.GarrisonNeedsUpdate) then + self.GarrisonNeedsUpdate = nil; + self:UpdateGarrisonTool() + end + + if(self.RaidLeaderNeedsUpdate) then + self.RaidLeaderNeedsUpdate = nil; + self:UpdateRaidLeader() + end +end + +function MOD:ReLoad() + self:UpdateProfessionTools() + self:UpdateGarrisonTool() + self:UpdateRaidLeader() +end + +function MOD:Load() + --self:LoadQuestWatch() + self:LoadProfessionTools() + self:LoadGarrisonTool() + self:LoadRaidLeaderTools() +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tool/SVTools.xml b/Interface/AddOns/SVUI/packages/tool/SVTools.xml new file mode 100644 index 0000000..5d96e63 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/SVTools.xml @@ -0,0 +1,21 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Script file='SVTools.lua'/> + + <Script file="stats\bags.lua"/> + <Script file="stats\cta.lua"/> + <Script file="stats\durability.lua"/> + <Script file="stats\experience.lua"/> + <Script file="stats\friends.lua"/> + <Script file="stats\gold.lua"/> + <Script file="stats\tokens.lua"/> + <Script file="stats\guild.lua"/> + <Script file="stats\reputation.lua"/> + <Script file="stats\system.lua"/> + <Script file="stats\time.lua"/> + <Script file="stats\dps.lua"/> + <Script file="stats\hps.lua"/> + + <Script file="buttons\profession.lua"/> + <Script file="buttons\garrison.lua"/> + <Script file="buttons\raidleader.lua"/> +</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tool/buttons/garrison.lua b/Interface/AddOns/SVUI/packages/tool/buttons/garrison.lua new file mode 100644 index 0000000..d02243b --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/buttons/garrison.lua @@ -0,0 +1,318 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local print = _G.print; +local ipairs = _G.ipairs; +local pairs = _G.pairs; +local tostring = _G.tostring; +local tonumber = _G.tonumber; + +--STRING +local string = _G.string; +local upper = string.upper; +local format = string.format; +local find = string.find; +local match = string.match; +local gsub = string.gsub; +--TABLE +local table = _G.table; +local tinsert = _G.tinsert; +local tremove = _G.tremove; +local twipe = _G.wipe; +--MATH +local math = _G.math; +local min = math.min; +local floor = math.floor +local ceil = math.ceil +--BLIZZARD API +local GameTooltip = _G.GameTooltip; +local InCombatLockdown = _G.InCombatLockdown; +local CreateFrame = _G.CreateFrame; +local GetTime = _G.GetTime; +local GetItemCooldown = _G.GetItemCooldown; +local GetItemCount = _G.GetItemCount; +local GetItemInfo = _G.GetItemInfo; +local GetSpellInfo = _G.GetSpellInfo; +local IsSpellKnown = _G.IsSpellKnown; +local GetGarrison = _G.GetGarrison; +local GetProfessionInfo = _G.GetProfessionInfo; +local hooksecurefunc = _G.hooksecurefunc; +--[[ +########################################################## +ADDON +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L + +local MOD = SV.SVTools; +local GarrisonData = {}; +--[[ +########################################################## +LOCALS +########################################################## +]]-- +local GARRISON_ICON = [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-GARRISON]]; + +local function GetDockCooldown(itemID) + local start,duration = GetItemCooldown(itemID) + local expires = duration - (GetTime() - start) + if expires > 0.05 then + local timeLeft = 0; + local calc = 0; + if expires < 4 then + return format("|cffff0000%.1f|r", expires) + elseif expires < 60 then + return format("|cffffff00%d|r", floor(expires)) + elseif expires < 3600 then + timeLeft = ceil(expires / 60); + calc = floor((expires / 60) + .5); + return format("|cffff9900%dm|r", timeLeft) + elseif expires < 86400 then + timeLeft = ceil(expires / 3600); + calc = floor((expires / 3600) + .5); + return format("|cff66ffff%dh|r", timeLeft) + else + timeLeft = ceil(expires / 86400); + calc = floor((expires / 86400) + .5); + return format("|cff6666ff%dd|r", timeLeft) + end + else + return "|cff6666ffReady|r" + end +end + +local function GarrisonButton_OnEvent(self, event, ...) + if (event == "GARRISON_HIDE_LANDING_PAGE") then + if(not InCombatLockdown() and SVUI_Garrison:IsShown()) then + SVUI_Garrison.Parent:SetWidth(SVUI_Garrison.Parent:GetWidth() - SVUI_Garrison:GetWidth()) + SVUI_Garrison:Hide() + end; + elseif (event == "GARRISON_SHOW_LANDING_PAGE") then + if(not InCombatLockdown() and (not SVUI_Garrison:IsShown())) then + SVUI_Garrison.Parent:SetWidth(SVUI_Garrison.Parent:GetWidth() + SVUI_Garrison:GetWidth()) + SVUI_Garrison:Show() + end; + elseif ( event == "GARRISON_BUILDING_ACTIVATABLE" ) then + SVUI_Garrison:StartAlert(); + elseif ( event == "GARRISON_BUILDING_ACTIVATED" or event == "GARRISON_ARCHITECT_OPENED") then + SVUI_Garrison:StopAlert(); + elseif ( event == "GARRISON_MISSION_FINISHED" ) then + SVUI_Garrison:StartAlert(); + elseif ( event == "GARRISON_MISSION_NPC_OPENED" ) then + SVUI_Garrison:StopAlert(); + elseif (event == "GARRISON_INVASION_AVAILABLE") then + SVUI_Garrison:StartAlert(); + elseif (event == "GARRISON_INVASION_UNAVAILABLE") then + SVUI_Garrison:StopAlert(); + elseif (event == "SHIPMENT_UPDATE") then + local shipmentStarted = ...; + if (shipmentStarted) then + SVUI_Garrison:StartAlert(); + end + end +end + +local function getColoredString(text, color) + local hex = SV:HexColor(color) + return ("|cff%s%s|r"):format(hex, text) +end + +local function GetActiveMissions() + wipe(GarrisonData) + local hasMission = false + + GameTooltip:AddLine(" ", 1, 1, 1) + GameTooltip:AddLine("Active Missions", 1, 0.7, 0) + + for key,data in pairs(C_Garrison.GetInProgressMissions()) do + GarrisonData[data.missionID] = { + name = data.name, + level = data.level, + seconds = data.durationSeconds, + timeLeft = data.timeLeft, + completed = false, + isRare = data.isRare, + type = data.type, + } + hasMission = true + end + + for key,data in pairs(C_Garrison.GetCompleteMissions()) do + if(GarrisonData[data.missionID]) then + GarrisonData[data.missionID].completed = true + end + end + + for key,data in pairs(GarrisonData) do + local hex = data.isRare and "blue" or "green" + local mission = ("%s|cff888888 - |r%s"):format(getColoredString(data.level, "yellow"), getColoredString(data.name, hex)); + local remaining + if (data.completed) then + remaining = L["Complete!"] + else + remaining = ("%s %s"):format(data.timeLeft, getColoredString(" ("..SV:ParseSeconds(data.seconds)..")", "lightgrey")) + end + + GameTooltip:AddDoubleLine(mission, remaining, 0, 1, 0, 1, 1, 1) + hasMission = true + end + + if(not hasMission) then + GameTooltip:AddLine("None", 1, 0, 0) + end +end + +local function GetBuildingData() + local hasBuildings = false + local now = time(); + + GameTooltip:AddLine(" ", 1, 1, 1) + GameTooltip:AddLine("Buildings", 1, 0.7, 0) + + local buildings = C_Garrison.GetBuildings() + for i = 1, #buildings do + local buildingID = buildings[i].buildingID + local plotID = buildings[i].plotID + + local id, name, texPrefix, icon, rank, isBuilding, timeStart, buildTime, canActivate, canUpgrade, isPrebuilt = C_Garrison.GetOwnedBuildingInfoAbbrev(plotID) + + local building = ''; + local remaining + + if(isBuilding) then + building = ("|cffFFFF00%s|r|cff888888 - |r|cffFF5500%s|r"):format(rank, name); + local timeLeft = buildTime - (now - timeStart); + if(canActivate or timeLeft < 0) then + remaining = L["Complete!"] + else + remaining = ("Building %s"):format(getColoredString("("..SV:ParseSeconds(timeLeft)..")", "lightgrey")) + end + GameTooltip:AddDoubleLine(building, remaining, 0, 1, 0, 1, 1, 1) + else + local name, texture, shipmentCapacity, shipmentsReady, shipmentsTotal, creationTime, duration, timeleftString, itemName, itemIcon, itemQuality, itemID = C_Garrison.GetLandingPageShipmentInfo(buildingID) + if(shipmentsReady and shipmentsReady > 0) then + building = ("|cffFFFF00%s|r|cff888888 - |r|cffFF5500%s|r"):format(rank, name); + timeleftString = timeleftString or 'Unknown' + remaining = ("Ready: %s, Next: %s"):format(getColoredString(shipmentsReady, "green"), getColoredString(timeleftString, "lightgrey")) + elseif(timeleftString) then + building = ("|cffFFFF00%s|r|cff888888 - |r|cffFF5500%s|r"):format(rank, name); + remaining = ("Next: %s"):format(getColoredString(timeleftString, "lightgrey")) + end + GameTooltip:AddDoubleLine(building, remaining, 0, 1, 0, 1, 1, 1) + end + + hasBuildings = true + end + + if(not hasBuildings) then + GameTooltip:AddLine("None", 1, 0, 0) + end +end + +local SetGarrisonTooltip = function(self) + if(not InCombatLockdown()) then C_Garrison.RequestLandingPageShipmentInfo() end + local name, amount, tex, week, weekmax, maxed, discovered = GetCurrencyInfo(824) + local texStr = ("\124T%s:12\124t %d"):format(tex, amount) + GameTooltip:AddDoubleLine(name, texStr, 0.23, 0.88, 0.27, 1, 1, 1) + + local text1 = self:GetAttribute("tipText") + local text2 = self:GetAttribute("tipExtraText") + GameTooltip:AddLine(" ", 1, 1, 1) + GameTooltip:AddDoubleLine("[Left-Click]", text1, 0, 1, 0, 1, 1, 1) + if InCombatLockdown() then return end + if(text2) then + local remaining = GetDockCooldown(110560) + GameTooltip:AddDoubleLine("[Right Click]", text2, 0, 1, 0, 1, 1, 1) + GameTooltip:AddDoubleLine(L["Time Remaining"], remaining, 1, 1, 1, 0, 1, 1) + end + + GetActiveMissions() + GetBuildingData() + SVUI_Garrison:StopAlert(); +end + +local function LoadToolBarGarrison() + if((not SV.db.SVTools.garrison) or MOD.GarrisonLoaded) then return end + GarrisonLandingPageMinimapButton:FadeOut() + if(InCombatLockdown()) then + MOD.GarrisonNeedsUpdate = true; + MOD:RegisterEvent("PLAYER_REGEN_ENABLED"); + return + end + + local garrison = SV.Dock:SetDockButton("TopLeft", L["Garrison Landing Page"], GARRISON_ICON, nil, "SVUI_Garrison", SetGarrisonTooltip, "SecureActionButtonTemplate") + garrison:SetAttribute("type1", "click") + garrison:SetAttribute("clickbutton", GarrisonLandingPageMinimapButton) + + local garrisonStone = GetItemInfo(110560); + if(garrisonStone and type(garrisonStone) == "string") then + garrison:SetAttribute("tipExtraText", L["Garrison Hearthstone"]) + garrison:SetAttribute("type2", "macro") + garrison:SetAttribute("macrotext", "/use [nomod] " .. garrisonStone) + end + + GarrisonLandingPageMinimapButton:RemoveTextures() + GarrisonLandingPageMinimapButton:ClearAllPoints() + GarrisonLandingPageMinimapButton:SetAllPoints(garrison) + GarrisonLandingPageMinimapButton:SetNormalTexture("") + GarrisonLandingPageMinimapButton:SetPushedTexture("") + GarrisonLandingPageMinimapButton:SetHighlightTexture("") + + if(not GarrisonLandingPageMinimapButton:IsShown()) then + garrison.Parent:SetWidth(garrison.Parent:GetWidth() - garrison:GetWidth()) + garrison:Hide() + end + + garrison:RegisterEvent("GARRISON_HIDE_LANDING_PAGE"); + garrison:RegisterEvent("GARRISON_SHOW_LANDING_PAGE"); + garrison:RegisterEvent("GARRISON_BUILDING_ACTIVATABLE"); + garrison:RegisterEvent("GARRISON_BUILDING_ACTIVATED"); + garrison:RegisterEvent("GARRISON_ARCHITECT_OPENED"); + garrison:RegisterEvent("GARRISON_MISSION_FINISHED"); + garrison:RegisterEvent("GARRISON_MISSION_NPC_OPENED"); + garrison:RegisterEvent("GARRISON_INVASION_AVAILABLE"); + garrison:RegisterEvent("GARRISON_INVASION_UNAVAILABLE"); + garrison:RegisterEvent("SHIPMENT_UPDATE"); + + garrison:SetScript("OnEvent", GarrisonButton_OnEvent) + + MOD.GarrisonLoaded = true +end +--[[ +########################################################## +BUILD/UPDATE +########################################################## +]]-- +function MOD:UpdateGarrisonTool() + if((not SV.db.SVTools.garrison) or self.GarrisonLoaded) then return end + LoadToolBarGarrison() +end + +function MOD:LoadGarrisonTool() + if((not SV.db.SVTools.garrison) or self.GarrisonLoaded or (not GarrisonLandingPageMinimapButton)) then return end + SV.Timers:ExecuteTimer(LoadToolBarGarrison, 5) +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tool/buttons/profession.lua b/Interface/AddOns/SVUI/packages/tool/buttons/profession.lua new file mode 100644 index 0000000..41821b1 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/buttons/profession.lua @@ -0,0 +1,259 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local print = _G.print; +local ipairs = _G.ipairs; +local pairs = _G.pairs; +local tostring = _G.tostring; +local tonumber = _G.tonumber; + +--STRING +local string = _G.string; +local upper = string.upper; +local format = string.format; +local find = string.find; +local match = string.match; +local gsub = string.gsub; +--TABLE +local table = _G.table; +local tinsert = _G.tinsert; +local tremove = _G.tremove; +local twipe = _G.wipe; +--MATH +local math = _G.math; +local min = math.min; +local floor = math.floor +local ceil = math.ceil +--BLIZZARD API +local GameTooltip = _G.GameTooltip; +local InCombatLockdown = _G.InCombatLockdown; +local CreateFrame = _G.CreateFrame; +local GetTime = _G.GetTime; +local GetItemCooldown = _G.GetItemCooldown; +local GetItemCount = _G.GetItemCount; +local GetItemInfo = _G.GetItemInfo; +local GetSpellInfo = _G.GetSpellInfo; +local IsSpellKnown = _G.IsSpellKnown; +local GetProfessions = _G.GetProfessions; +local GetProfessionInfo = _G.GetProfessionInfo; +local hooksecurefunc = _G.hooksecurefunc; +--[[ +########################################################## +ADDON +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L + +local MOD = SV.SVTools; +--[[ +########################################################## +LOCALS +########################################################## +]]-- +local ICON_SHEET = [[Interface\AddOns\SVUI\assets\artwork\Icons\PROFESSIONS]]; +local HEARTH_ICON = [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-HEARTH]]; + +local TOOL_DATA = { + [171] = {0,0.25,0,0.25}, -- PRO-ALCHEMY + [794] = {0.25,0.5,0,0.25,80451}, -- PRO-ARCHAELOGY + [164] = {0.5,0.75,0,0.25}, -- PRO-BLACKSMITH + [185] = {0.75,1,0,0.25,818,67097}, -- PRO-COOKING + [333] = {0,0.25,0.25,0.5,13262}, -- PRO-ENCHANTING + [202] = {0.25,0.5,0.25,0.5}, -- PRO-ENGINEERING + [129] = {0.5,0.75,0.25,0.5}, -- PRO-FIRSTAID + [773] = {0,0.25,0.5,0.75,51005}, -- PRO-INSCRIPTION + [755] = {0.25,0.5,0.5,0.75,31252}, -- PRO-JEWELCRAFTING + [165] = {0.5,0.75,0.5,0.75}, -- PRO-LEATHERWORKING + [186] = {0.75,1,0.5,0.75}, -- PRO-MINING + [197] = {0.25,0.5,0.75,1}, -- PRO-TAILORING +} +local HEARTH_SPELLS = {556,50977,18960,126892} +local LastAddedMacro; +local MacroCount = 0; + +local function GetMacroCooldown(itemID) + local start,duration = GetItemCooldown(itemID) + local expires = duration - (GetTime() - start) + if expires > 0.05 then + local timeLeft = 0; + local calc = 0; + if expires < 4 then + return format("|cffff0000%.1f|r", expires) + elseif expires < 60 then + return format("|cffffff00%d|r", floor(expires)) + elseif expires < 3600 then + timeLeft = ceil(expires / 60); + calc = floor((expires / 60) + .5); + return format("|cffff9900%dm|r", timeLeft) + elseif expires < 86400 then + timeLeft = ceil(expires / 3600); + calc = floor((expires / 3600) + .5); + return format("|cff66ffff%dh|r", timeLeft) + else + timeLeft = ceil(expires / 86400); + calc = floor((expires / 86400) + .5); + return format("|cff6666ff%dd|r", timeLeft) + end + else + return "|cff6666ffReady|r" + end +end + +local SetMacroTooltip = function(self) + local text1 = self:GetAttribute("tipText") + local text2 = self:GetAttribute("tipExtraText") + GameTooltip:AddDoubleLine("[Left-Click]", text1, 0, 1, 0, 1, 1, 1) + if(text2) then + GameTooltip:AddDoubleLine("[Left-Click]", text1, 0, 1, 0, 1, 1, 1) + GameTooltip:AddDoubleLine("[Right-Click]", "Use " .. text2, 0, 1, 0, 1, 1, 1) + if InCombatLockdown() then return end + if(self.ItemToUse) then + GameTooltip:AddLine(" ", 1, 1, 1) + local remaining = GetMacroCooldown(self.ItemToUse) + GameTooltip:AddDoubleLine(text2, remaining, 1, 0.5, 0, 0, 1, 1) + end + end +end + +local SetHearthTooltip = function(self) + local text1 = self:GetAttribute("tipText") + local text2 = self:GetAttribute("tipExtraText") + GameTooltip:AddDoubleLine("[Left-Click]", text1, 0, 1, 0, 1, 1, 1) + if InCombatLockdown() then return end + local remaining = GetMacroCooldown(6948) + GameTooltip:AddDoubleLine(L["Time Remaining"], remaining, 1, 1, 1, 0, 1, 1) + if(text2) then + GameTooltip:AddLine(" ", 1, 1, 1) + GameTooltip:AddDoubleLine("[Right Click]", text2, 0, 1, 0, 1, 1, 1) + end +end + +local function CreateMacroToolButton(proName, proID, itemID) + local data = TOOL_DATA[proID] + if(not data) then return end + + local globalName = ("SVUI_%s"):format(proName) + local button = SV.Dock:SetDockButton("BottomRight", proName, ICON_SHEET, nil, globalName, SetMacroTooltip, "SecureActionButtonTemplate") + + button.Icon:SetTexCoord(data[1], data[2], data[3], data[4]) + + if proID == 186 then proName = GetSpellInfo(2656) end + + --button:RegisterForClicks("AnyDown") + button:SetAttribute("type1", "macro") + button:SetAttribute("macrotext1", "/cast [nomod]" .. proName) + + if(data[5]) then + local rightClick + if(data[6] and GetItemCount(data[6], true) > 0) then + rightClick = GetItemInfo(data[6]) + button.ItemToUse = data[6] + else + rightClick = GetSpellInfo(data[5]) + end + button:SetAttribute("tipExtraText", rightClick) + button:SetAttribute("type2", "macro") + button:SetAttribute("macrotext2", "/cast [nomod] " .. rightClick) + end +end + +local function LoadToolBarProfessions() + if((not SV.db.SVTools.professions) or MOD.ToolBarLoaded) then return end + if(InCombatLockdown()) then + MOD.ProfessionNeedsUpdate = true; + MOD:RegisterEvent("PLAYER_REGEN_ENABLED"); + return + end + + -- HEARTH BUTTON + local hearthStone = GetItemInfo(6948); + if(hearthStone and type(hearthStone) == "string") then + local hearth = SV.Dock:SetDockButton("BottomLeft", L["Hearthstone"], HEARTH_ICON, nil, "SVUI_Hearth", SetHearthTooltip, "SecureActionButtonTemplate") + hearth.Icon:SetTexCoord(0,0.5,0,1) + hearth:SetAttribute("type1", "macro") + hearth:SetAttribute("macrotext1", "/use [nomod]" .. hearthStone) + local hasRightClick = false; + for i = 1, #HEARTH_SPELLS do + if(IsSpellKnown(HEARTH_SPELLS[i])) then + local rightClickSpell = GetSpellInfo(HEARTH_SPELLS[i]) + hearth:SetAttribute("tipExtraText", rightClickSpell) + hearth:SetAttribute("type2", "macro") + hearth:SetAttribute("macrotext2", "/use [nomod] " .. rightClickSpell) + hasRightClick = true; + end + end + end + + -- PROFESSION BUTTONS + local proName, proID + local prof1, prof2, archaeology, _, cooking, firstAid = GetProfessions() + + if(firstAid ~= nil) then + proName, _, _, _, _, _, proID = GetProfessionInfo(firstAid) + CreateMacroToolButton(proName, proID, firstAid) + end + + if(archaeology ~= nil) then + proName, _, _, _, _, _, proID = GetProfessionInfo(archaeology) + CreateMacroToolButton(proName, proID, archaeology) + end + + if(cooking ~= nil) then + proName, _, _, _, _, _, proID = GetProfessionInfo(cooking) + CreateMacroToolButton(proName, proID, cooking) + end + + if(prof2 ~= nil) then + proName, _, _, _, _, _, proID = GetProfessionInfo(prof2) + if(proID ~= 182 and proID ~= 393) then + CreateMacroToolButton(proName, proID, prof2) + end + end + + if(prof1 ~= nil) then + proName, _, _, _, _, _, proID = GetProfessionInfo(prof1) + if(proID ~= 182 and proID ~= 393) then + CreateMacroToolButton(proName, proID, prof1) + end + end + + MOD.ToolBarLoaded = true +end +--[[ +########################################################## +BUILD/UPDATE +########################################################## +]]-- +function MOD:UpdateProfessionTools() + if((not SV.db.SVTools.professions) or self.ToolBarLoaded) then return end + LoadToolBarProfessions() +end + +function MOD:LoadProfessionTools() + if((not SV.db.SVTools.professions) or self.ToolBarLoaded) then return end + SV.Timers:ExecuteTimer(LoadToolBarProfessions, 5) +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tool/buttons/questwatch.lua b/Interface/AddOns/SVUI/packages/tool/buttons/questwatch.lua new file mode 100644 index 0000000..65e4668 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/buttons/questwatch.lua @@ -0,0 +1,213 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local string = _G.string; +local math = _G.math; +local bit = _G.bit; +local table = _G.table; +--[[ STRING METHODS ]]-- +local lower, upper = string.lower, string.upper; +local find, format, len, split = string.find, string.format, string.len, string.split; +local match, sub, join = string.match, string.sub, string.join; +local gmatch, gsub = string.gmatch, string.gsub; +--[[ MATH METHODS ]]-- +local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; -- Basic +local fmod, modf, sqrt = math.fmod, math.modf, math.sqrt; -- Algebra +local atan2, cos, deg, rad, sin = math.atan2, math.cos, math.deg, math.rad, math.sin; -- Trigonometry +local huge, random = math.huge, math.random; -- Uncommon +--[[ BINARY METHODS ]]-- +local band, bor = bit.band, bit.bor; +--[[ TABLE METHODS ]]-- +local tremove, tcopy, twipe, tsort, tconcat = table.remove, table.copy, table.wipe, table.sort, table.concat; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L + +local MOD = SV.SVTools; +local ObjectiveTrackerFrame = _G.ObjectiveTrackerFrame +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local ICON_FILE = [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-QUESTS]]; +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +local ShowSubDocklet = function(self) + if(InCombatLockdown()) then return end + if(not ObjectiveTrackerFrame:IsShown()) then ObjectiveTrackerFrame:Show() end +end + +local HideSubDocklet = function(self) + if(InCombatLockdown()) then return end + if(ObjectiveTrackerFrame:IsShown()) then ObjectiveTrackerFrame:Hide() end +end + +local UpdateDocklet = function() + local cur = SVUI_QuestWatchFrameScrollBar:GetValue() + if(not InCombatLockdown()) then + ObjectiveTrackerFrame:ClearAllPoints() + ObjectiveTrackerFrame:SetAllPoints(SVUI_QuestWatchFrameScrollFrame) + end + SVUI_QuestWatchFrameScrollBar:SetValue(0) + SVUI_QuestWatchFrameScrollBar:SetValue(cur) +end + +function MOD:LoadQuestWatch() + if(not ObjectiveTrackerFrame) then return end + if(not SV.db.general.questWatch) then + ObjectiveTrackerFrame:RemoveTextures(true) + ObjectiveTrackerFrame.BlocksFrame:RemoveTextures(true) + ObjectiveTrackerFrame.HeaderMenu:RemoveTextures(true) + ObjectiveTrackerFrame.BlockDropDown:RemoveTextures(true) + + if(SV.db.general.questHeaders) then + ObjectiveTrackerFrame.BlocksFrame.QuestHeader:RemoveTextures(true) + ObjectiveTrackerFrame.BlocksFrame.QuestHeader:SetStylePanel("Default", "Headline", true) + ObjectiveTrackerFrame.BlocksFrame.QuestHeader:SetBackdropColor(0, 0, 0, 0.5) + ObjectiveTrackerFrame.BlocksFrame.QuestHeader.Panel:ClearAllPoints() + ObjectiveTrackerFrame.BlocksFrame.QuestHeader.Panel:SetPoint("TOPLEFT", ObjectiveTrackerFrame.BlocksFrame.QuestHeader, "TOPLEFT", -2, -2) + ObjectiveTrackerFrame.BlocksFrame.QuestHeader.Panel:SetPoint("BOTTOMRIGHT", ObjectiveTrackerFrame.BlocksFrame.QuestHeader, "BOTTOMRIGHT", 12, 2) + + ObjectiveTrackerFrame.BlocksFrame.AchievementHeader:RemoveTextures(true) + ObjectiveTrackerFrame.BlocksFrame.AchievementHeader:SetStylePanel("Default", "Headline", true) + ObjectiveTrackerFrame.BlocksFrame.AchievementHeader:SetBackdropColor(0, 0, 0, 0.5) + ObjectiveTrackerFrame.BlocksFrame.AchievementHeader.Panel:ClearAllPoints() + ObjectiveTrackerFrame.BlocksFrame.AchievementHeader.Panel:SetPoint("TOPLEFT", ObjectiveTrackerFrame.BlocksFrame.AchievementHeader, "TOPLEFT", -2, -2) + ObjectiveTrackerFrame.BlocksFrame.AchievementHeader.Panel:SetPoint("BOTTOMRIGHT", ObjectiveTrackerFrame.BlocksFrame.AchievementHeader, "BOTTOMRIGHT", 12, 2) + + ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader:RemoveTextures(true) + ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader:SetStylePanel("Default", "Headline", true) + ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader:SetBackdropColor(0, 0, 0, 0.5) + ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader.Panel:ClearAllPoints() + ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader.Panel:SetPoint("TOPLEFT", ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader, "TOPLEFT", -2, -2) + ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader.Panel:SetPoint("BOTTOMRIGHT", ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader, "BOTTOMRIGHT", 12, 2) + end + else + local bgTex = [[Interface\BUTTONS\WHITE8X8]] + local bdTex = SV.Media.bar.glow + + self.QuestWatch = SV.Dock:NewDocklet("BottomRight", "SVUI_QuestWatchFrame", "Quest Watch", ICON_FILE) + + local WIDTH, HEIGHT = self.QuestWatch:GetSize() + + local listFrame = CreateFrame("ScrollFrame", "SVUI_QuestWatchFrameScrollFrame", self.QuestWatch); + listFrame:SetPoint("TOPLEFT", self.QuestWatch, -62, 0); + listFrame:SetPoint("BOTTOMRIGHT", self.QuestWatch, -31, 21); + listFrame:EnableMouseWheel(true); + + local scrollFrame = CreateFrame("Slider", "SVUI_QuestWatchFrameScrollBar", listFrame); + scrollFrame:SetHeight(listFrame:GetHeight()); + scrollFrame:SetWidth(18); + scrollFrame:SetPoint("TOPRIGHT", self.QuestWatch, "TOPRIGHT", -3, 0); + scrollFrame:SetBackdrop({bgFile = bgTex, edgeFile = bdTex, edgeSize = 4, insets = {left = 3, right = 3, top = 3, bottom = 3}}); + scrollFrame:SetFrameLevel(6) + scrollFrame:SetStylePanel("Fixed", "Transparent", true); + scrollFrame:SetThumbTexture("Interface\\Buttons\\UI-ScrollBar-Knob"); + scrollFrame:SetOrientation("VERTICAL"); + scrollFrame:SetValueStep(5); + scrollFrame:SetMinMaxValues(1, 1420); + scrollFrame:SetValue(1); + scrollFrame:SetScript("OnValueChanged", function(self, argValue) + listFrame:SetVerticalScroll(argValue) + end) + + listFrame.slider = scrollFrame; + listFrame:SetScript("OnMouseWheel", function(self, delta) + local scroll = self:GetVerticalScroll(); + local value = (scroll - (20 * delta)); + if value < -1 then + value = 0 + end + if value > 420 then + value = 420 + end + --self:SetVerticalScroll(value) + self.slider:SetValue(value) + end) + + ObjectiveTrackerFrame:ClearAllPoints() + ObjectiveTrackerFrame:SetClampedToScreen(false) + ObjectiveTrackerFrame:SetHeight(1500) + ObjectiveTrackerFrame:SetWidth(WIDTH) + ObjectiveTrackerFrame:SetPoint("TOPRIGHT", listFrame, "TOPRIGHT", -2, 0) + ObjectiveTrackerFrame:SetFrameLevel(listFrame:GetFrameLevel() + 1) + + ObjectiveTrackerFrame:HookScript("OnEvent", UpdateDocklet) + hooksecurefunc(ObjectiveTrackerFrame, "SetPoint", UpdateDocklet) + + -- hooksecurefunc(ObjectiveTrackerFrame, "SetPoint", function(self, a1, p, a2, x, y) + -- if(p ~= SVUI_QuestWatchFrameScrollFrame) then + -- self:SetPoint("TOPRIGHT", SVUI_QuestWatchFrameScrollFrame, "TOPRIGHT", -2, 0) + -- end + -- end) + --ObjectiveTrackerFrame.SetPoint = function() return end; + + ObjectiveTrackerFrame.HeaderMenu.MinimizeButton:Hide() + + ObjectiveTrackerFrame.BlocksFrame:RemoveTextures(true) + ObjectiveTrackerFrame.BlocksFrame:SetPoint("TOPLEFT", ObjectiveTrackerFrame, "TOPLEFT", 87, 0) + ObjectiveTrackerFrame.BlocksFrame:SetPoint("BOTTOMLEFT", ObjectiveTrackerFrame, "BOTTOMLEFT", 87, 0) + ObjectiveTrackerFrame.BlocksFrame:SetWidth(WIDTH) + + ObjectiveTrackerFrame.BlocksFrame.QuestHeader:SetWidth((WIDTH - 60)) + ObjectiveTrackerFrame.BlocksFrame.AchievementHeader:SetWidth((WIDTH - 60)) + ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader:SetWidth((WIDTH - 60)) + + if(SV.db.general.questHeaders) then + ObjectiveTrackerFrame.BlocksFrame.QuestHeader:RemoveTextures(true) + ObjectiveTrackerFrame.BlocksFrame.QuestHeader:SetStylePanel("Fixed", "Headline", true) + ObjectiveTrackerFrame.BlocksFrame.QuestHeader:SetBackdropColor(0, 0, 0, 0.5) + + ObjectiveTrackerFrame.BlocksFrame.AchievementHeader:RemoveTextures(true) + ObjectiveTrackerFrame.BlocksFrame.AchievementHeader:SetStylePanel("Fixed", "Headline", true) + ObjectiveTrackerFrame.BlocksFrame.AchievementHeader:SetBackdropColor(0, 0, 0, 0.5) + + ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader:RemoveTextures(true) + ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader:SetStylePanel("Fixed", "Headline", true) + ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader:SetBackdropColor(0, 0, 0, 0.5) + end + + self.QuestWatch.DockButton:MakeDefault(); + self.QuestWatch:Show(); + self.QuestWatch:SetScript('OnShow', ShowSubDocklet); + self.QuestWatch:SetScript('OnHide', HideSubDocklet); + + listFrame:SetScrollChild(ObjectiveTrackerFrame) + SV.Timers:ExecuteTimer(UpdateDocklet, 3) + end +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tool/buttons/raidleader.lua b/Interface/AddOns/SVUI/packages/tool/buttons/raidleader.lua new file mode 100644 index 0000000..757124a --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/buttons/raidleader.lua @@ -0,0 +1,235 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L + +local MOD = SV.SVTools; +--[[ +########################################################## +LOCALS +########################################################## +]]-- +local ICON_FILE = [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-RAIDTOOL]]; + +local function CheckRaidStatus() + local inInstance, instanceType = IsInInstance() + if ((IsInGroup() and not IsInRaid()) or UnitIsGroupLeader('player') or UnitIsGroupAssistant("player")) and not (inInstance and (instanceType == "pvp" or instanceType == "arena")) then + return true + else + return false + end +end + +local Button_OnEnter = function(self) + self:SetPanelColor("highlight") +end + +local Button_OnLeave = function(self) + self:SetPanelColor("inverse") + GameTooltip:Hide() +end + +local ToolButton_OnEnter = function(self, ...) + SVUI_RaidToolDockButton:SetPanelColor("highlight") + SVUI_RaidToolDockButton.Icon:SetGradient(unpack(SV.Media.gradient.bizzaro)) + + GameTooltip:SetOwner(self, "ANCHOR_BOTTOMLEFT", 0, 4) + GameTooltip:ClearLines() + GameTooltip:AddDoubleLine("[Left-Click]", RAID_CONTROL, 0, 1, 0, 1, 1, 1) + GameTooltip:Show() +end + +local ToolButton_OnLeave = function(self, ...) + SVUI_RaidToolDockButton:SetPanelColor("default") + SVUI_RaidToolDockButton.Icon:SetGradient(unpack(SV.Media.gradient.icon)) + + GameTooltip:Hide() +end + +local function NewToolButton(name, parent, template, width, height, point, relativeto, point2, xOfs, yOfs, textDisplay) + local button = CreateFrame("Button", name, parent, template) + button:RemoveTextures() + button:SetWidthToScale(width) + button:SetHeightToScale(height) + button:SetPointToScale(point, relativeto, point2, xOfs, yOfs) + button:SetStylePanel("Framed") + + if(textDisplay) then + local text = button:CreateFontString(nil,"OVERLAY") + text:SetFont(SV.Media.font.default, 14, "NONE") + text:SetAllPoints(button) + text:SetJustifyH("CENTER") + text:SetText(textDisplay) + + button:SetFontString(text) + end + + button:HookScript("OnEnter", Button_OnEnter) + button:HookScript("OnLeave", Button_OnLeave) + + return button; +end + +function MOD:UpdateRaidLeader(event) + if InCombatLockdown() then + self.RaidLeaderNeedsUpdate = true; + self:RegisterEvent("PLAYER_REGEN_ENABLED"); + return + end + if CheckRaidStatus() then + SV.Dock.TopLeft.Bar:Add(self.RaidTool) + if self.RaidTool.Menu.toggled == true then + self.RaidTool.Menu:Show() + else + self.RaidTool.Menu:Hide() + end + else + SV.Dock.TopLeft.Bar:Remove(self.RaidTool) + self.RaidTool.Menu:Hide() + end +end + +function MOD:LoadRaidLeaderTools() + local dock = SV.Dock.TopLeft.Bar + + self.RaidTool = SV.Dock:SetDockButton("TopLeft", RAID_CONTROL, ICON_FILE, nil, "SVUI_RaidToolDockButton"); + self.RaidTool:SetAttribute("hasDropDown", false); + + self.RaidTool.Menu = CreateFrame("Frame", "SVUI_RaidToolMenu", self.RaidTool, "SecureHandlerClickTemplate"); + self.RaidTool.Menu:SetStylePanel("Default", 'Transparent'); + self.RaidTool.Menu:SetWidthToScale(120); + self.RaidTool.Menu:SetHeightToScale(140); + self.RaidTool.Menu:SetPoint("TOPLEFT", dock.ToolBar, "BOTTOMLEFT", 0, -2); + self.RaidTool.Menu:SetFrameLevel(3); + self.RaidTool.Menu.toggled = false; + self.RaidTool.Menu:SetFrameStrata("HIGH"); + + local SVUI_RaidToolToggle = CreateFrame("Button", "SVUI_RaidToolToggle", self.RaidTool, "SecureHandlerClickTemplate") + SVUI_RaidToolToggle:SetAllPoints(self.RaidTool) + SVUI_RaidToolToggle:RemoveTextures() + SVUI_RaidToolToggle:SetNormalTexture("") + SVUI_RaidToolToggle:SetPushedTexture("") + SVUI_RaidToolToggle:SetHighlightTexture("") + SVUI_RaidToolToggle:SetFrameRef("SVUI_RaidToolMenu", SVUI_RaidToolMenu) + SVUI_RaidToolToggle:SetAttribute("_onclick", [=[ + local raidUtil = self:GetFrameRef("SVUI_RaidToolMenu"); + local closeButton = self:GetFrameRef("SVUI_RaidToolCloseButton"); + raidUtil:Show(); + local point = self:GetPoint(); + local raidUtilPoint, raidUtilRelative, closeButtonPoint, closeButtonRelative + if point:find("BOTTOM") then + raidUtilPoint = "BOTTOMLEFT" + raidUtilRelative = "TOPLEFT" + else + raidUtilPoint = "TOPLEFT" + raidUtilRelative = "BOTTOMLEFT" + end + + raidUtil:ClearAllPoints() + closeButton:ClearAllPoints() + raidUtil:SetPoint(raidUtilPoint, self, raidUtilRelative, 2, -2) + closeButton:SetPoint("BOTTOM", raidUtil, "BOTTOM", 0, 2) + ]=]); + SVUI_RaidToolToggle:SetScript("PostClick", function(self) self:RemoveTextures(); SVUI_RaidToolMenu.toggled = true end); + SVUI_RaidToolToggle:HookScript("OnEnter", ToolButton_OnEnter) + SVUI_RaidToolToggle:HookScript("OnLeave", ToolButton_OnLeave) + SV:AddToDisplayAudit(self.RaidTool); + + --Close Button + local close = NewToolButton("SVUI_RaidToolCloseButton", self.RaidTool.Menu, "UIMenuButtonStretchTemplate, SecureHandlerClickTemplate", 30, 18, "BOTTOM", self.RaidTool.Menu, "BOTTOM", 0, 2, "X"); + close:SetAttribute("_onclick", [=[ self:GetParent():Hide(); ]=]); + SVUI_RaidToolToggle:SetFrameRef("SVUI_RaidToolCloseButton", close) + close:SetScript("PostClick", function() SVUI_RaidToolMenu.toggled = false end); + + local disband = NewToolButton("SVUI_RaidToolDisbandButton", self.RaidTool.Menu, "UIMenuButtonStretchTemplate", 109, 18, "TOP", self.RaidTool.Menu, "TOP", 0, -5, L['Disband Group']) + disband:SetScript("OnMouseUp", function(self) + if CheckRaidStatus() then + SV:StaticPopup_Show("DISBAND_RAID") + end + end) + + local rolecheck = NewToolButton("SVUI_RaidToolRoleButton", self.RaidTool.Menu, "UIMenuButtonStretchTemplate", 109, 18, "TOP", disband, "BOTTOM", 0, -5, ROLE_POLL) + rolecheck:SetScript("OnMouseUp", function(self) + if CheckRaidStatus() then + InitiateRolePoll() + end + end) + + local ready = NewToolButton("SVUI_RaidToolReadyButton", self.RaidTool.Menu, "UIMenuButtonStretchTemplate", 109, 18, "TOP", rolecheck, "BOTTOM", 0, -5, READY_CHECK) + ready:SetScript("OnMouseUp", function(self) + if CheckRaidStatus() then + DoReadyCheck() + end + end) + + local control = NewToolButton("SVUI_RaidToolControlButton", self.RaidTool.Menu, "UIMenuButtonStretchTemplate", 109, 18, "TOP", ready, "BOTTOM", 0, -5, L['Raid Menu']) + control:SetScript("OnMouseUp", function(self) + ToggleFriendsFrame(4) + end) + + local markerButton = _G["CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton"]; + local oldReadyCheck = _G["CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateReadyCheck"]; + local oldRollCheck = _G["CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateRolePoll"]; + + if(markerButton) then + markerButton:ClearAllPoints() + markerButton:SetPoint("TOP", control, "BOTTOM", 0, -5) + markerButton:SetParent(self.RaidTool.Menu) + markerButton:SetHeightToScale(18) + markerButton:SetWidth(109) + markerButton:RemoveTextures() + markerButton:SetStylePanel("Framed") + + local markersText = markerButton:CreateFontString(nil,"OVERLAY") + markersText:SetFont(SV.Media.font.default, 14, "NONE") + markersText:SetAllPoints(markerButton) + markersText:SetJustifyH("CENTER") + markersText:SetText("World Markers") + + markerButton:SetFontString(markersText) + + markerButton:HookScript("OnEnter", Button_OnEnter) + markerButton:HookScript("OnLeave", Button_OnLeave) + end + + if(oldReadyCheck) then + oldReadyCheck:ClearAllPoints() + oldReadyCheck:SetPoint("BOTTOMLEFT", CompactRaidFrameManagerDisplayFrameLockedModeToggle, "TOPLEFT", 0, 1) + oldReadyCheck:SetPoint("BOTTOMRIGHT", CompactRaidFrameManagerDisplayFrameHiddenModeToggle, "TOPRIGHT", 0, 1) + if(oldRollCheck) then + oldRollCheck:ClearAllPoints() + oldRollCheck:SetPoint("BOTTOMLEFT", oldReadyCheck, "TOPLEFT", 0, 1) + oldRollCheck:SetPoint("BOTTOMRIGHT", oldReadyCheck, "TOPRIGHT", 0, 1) + end + end + + self:RegisterEvent("GROUP_ROSTER_UPDATE", "UpdateRaidLeader") + self:RegisterEvent("PLAYER_ENTERING_WORLD", "UpdateRaidLeader") + self:UpdateRaidLeader() +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tool/stats/bags.lua b/Interface/AddOns/SVUI/packages/tool/stats/bags.lua new file mode 100644 index 0000000..e4dae3b --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/stats/bags.lua @@ -0,0 +1,103 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + +STATS:Extend EXAMPLE USAGE: Dock:NewDataType(newStat,eventList,onEvents,update,click,focus,blur) + +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local assert = _G.assert; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local string = _G.string; +local math = _G.math; +local table = _G.table; +--[[ STRING METHODS ]]-- +local lower, upper = string.lower, string.upper; +local find, format, len, split = string.find, string.format, string.len, string.split; +local match, sub, join = string.match, string.sub, string.join; +local gmatch, gsub = string.gmatch, string.gsub; +--[[ MATH METHODS ]]-- +local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; -- Basic +--[[ TABLE METHODS ]]-- +local twipe, tsort = table.wipe, table.sort; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local Dock = SV.Dock; +--[[ +########################################################## +BAG STATS +########################################################## +]]-- +local StatEvents = {"PLAYER_ENTERING_WORLD", "BAG_UPDATE"}; +local hexColor = "FFFFFF" +local bags_text = "%s|cff%s%d / %d|r"; +local currentObject; + +local function bags_events(this, e, ...) + local f, g, h = 0, 0, 0; + currentObject = this; + for i = 0, NUM_BAG_SLOTS do + f, g = f + GetContainerNumFreeSlots(i), + g + GetContainerNumSlots(i) + end + h = g - f; + this.text:SetFormattedText(bags_text, L["Bags"]..": ", hexColor, h, g) +end + +local function bags_click() + ToggleAllBags() +end + +local function bags_focus(this) + Dock:SetDataTip(this) + for i = 1, MAX_WATCHED_TOKENS do + local l, m, n, o, p = GetBackpackCurrencyInfo(i) + if l and i == 1 then + Dock.DataTooltip:AddLine(CURRENCY) + Dock.DataTooltip:AddLine(" ") + end + if l and m then + Dock.DataTooltip:AddDoubleLine(l, m, 1, 1, 1) + end + end + Dock:ShowDataTip() +end + +local BagsColorUpdate = function() + hexColor = SV:HexColor("highlight") + if currentObject ~= nil then + bags_events(currentObject) + end +end + +SV.Events:On("SVUI_COLORS_UPDATED", "BagsColorUpdates", BagsColorUpdate) +Dock:NewDataType("Bags", StatEvents, bags_events, nil, bags_click, bags_focus); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tool/stats/cta.lua b/Interface/AddOns/SVUI/packages/tool/stats/cta.lua new file mode 100644 index 0000000..f151992 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/stats/cta.lua @@ -0,0 +1,160 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + +STATS:Extend EXAMPLE USAGE: Dock:NewDataType(newStat,eventList,onEvents,update,click,focus,blur) + +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local assert = _G.assert; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local string = _G.string; +local math = _G.math; +local table = _G.table; +--[[ STRING METHODS ]]-- +local lower, upper = string.lower, string.upper; +local find, format, len, split = string.find, string.format, string.len, string.split; +local match, sub, join = string.match, string.sub, string.join; +local gmatch, gsub = string.gmatch, string.gsub; +--[[ MATH METHODS ]]-- +local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; -- Basic +--[[ TABLE METHODS ]]-- +local twipe, tsort = table.wipe, table.sort; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local Dock = SV.Dock; +--[[ +########################################################## +CALL TO ARMS STATS +########################################################## +]]-- +local StatEvents = {"PLAYER_ENTERING_WORLD", "LFG_UPDATE_RANDOM_INFO"}; + +local tooltipString = ("%s: N/A"):format(BATTLEGROUND_HOLIDAY) +local currentObject; + +local function formatCTAtext(tanks, heals, dps) + local result = "" + if tanks then + result = result.."|TInterface\\AddOns\\SVUI\\assets\\textures\\default\\tank.tga:14:14|t" + end + if heals then + result = result.."|TInterface\\AddOns\\SVUI\\assets\\textures\\default\\healer.tga:14:14|t" + end + if dps then + result = result.."|TInterface\\AddOns\\SVUI\\assets\\textures\\default\\dps.tga:14:14|t" + end + return result +end + +local function CTA_OnEvent(self, ...) + local isTank = false; + local isHeal = false; + local isDPS = false; + local isNormal = true; + for r = 1, GetNumRandomDungeons()do + local id, name = GetLFGRandomDungeonInfo(r) + for i = 1, LFG_ROLE_NUM_SHORTAGE_TYPES do + local eligible, forTank, forHealer, forDamage, itemCount = GetLFGRoleShortageRewards(id, i) + if eligible then + isNormal = false + end + if eligible and forTank and itemCount > 0 then + isTank = true; + end + if eligible and forHealer and itemCount > 0 then + isHeal = true; + end + if eligible and forDamage and itemCount > 0 then + isDPS = true; + end + end + end + if isNormal then + self.text:SetText(tooltipString) + else + self.text:SetText(BATTLEGROUND_HOLIDAY..": "..formatCTAtext(isTank, isHeal, isDPS)) + end + currentObject = self +end + +local function CTA_OnClick() + ToggleFrame(LFDParentFrame) +end + +local function CTA_OnEnter(self) + Dock:SetDataTip(self) + local counter = 0; + for r = 1, GetNumRandomDungeons()do + local isTank = false; + local isHeal = false; + local isDPS = false; + local isNormal = true; + local id, name = GetLFGRandomDungeonInfo(r) + for i = 1, LFG_ROLE_NUM_SHORTAGE_TYPES do + local eligible, forTank, forHealer, forDamage, itemCount = GetLFGRoleShortageRewards(id, i) + if eligible then + isNormal = false + end + if eligible and forTank and itemCount > 0 then + isTank = true; + end + if eligible and forHealer and itemCount > 0 then + isHeal = true; + end + if eligible and forDamage and itemCount > 0 then + isDPS = true; + end + end + if not isNormal then + local text = formatCTAtext(isTank,isHeal,isDPS) + if text ~= "" then + Dock.DataTooltip:AddDoubleLine(name..":", text, 1, 1, 1) + end + if isTank or isHeal or isDPS then + counter = counter + 1 + end + end + end + Dock:ShowDataTip() +end + +local CTAColorUpdate = function() + local hexColor = SV:HexColor("highlight"); + tooltipString = ("%s: |cff%sN/A|r"):format(BATTLEGROUND_HOLIDAY, hexColor) + if currentObject ~= nil then + CTA_OnEvent(currentObject) + end +end +SV.Events:On("SVUI_COLORS_UPDATED", "CTAColorUpdates", CTAColorUpdate) + +Dock:NewDataType('Call to Arms', StatEvents, CTA_OnEvent, nil, CTA_OnClick, CTA_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tool/stats/dps.lua b/Interface/AddOns/SVUI/packages/tool/stats/dps.lua new file mode 100644 index 0000000..e7d7d2d --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/stats/dps.lua @@ -0,0 +1,128 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + +STATS:Extend EXAMPLE USAGE: Dock:NewDataType(newStat,eventList,onEvents,update,click,focus,blur,load) + +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local string = _G.string; +--[[ STRING METHODS ]]-- +local match, sub, join = string.match, string.sub, string.join; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local Dock = SV.Dock; +--[[ +########################################################## +CALL TO ARMS STATS +########################################################## +]]-- +local StatEvents = {'PLAYER_ENTERING_WORLD', 'COMBAT_LOG_EVENT_UNFILTERED', "PLAYER_LEAVE_COMBAT", 'PLAYER_REGEN_DISABLED', 'UNIT_PET'}; + +local PlayerEvents = {["SWING_DAMAGE"] = true, ["RANGE_DAMAGE"] = true, ["SPELL_DAMAGE"] = true, ["SPELL_PERIODIC_DAMAGE"] = true, ["DAMAGE_SHIELD"] = true, ["DAMAGE_SPLIT"] = true, ["SPELL_EXTRA_ATTACKS"] = true} +local playerID = UnitGUID('player') +local petID +local DMGTotal, lastDMGAmount = 0, 0 +local combatTime = 0 +local timeStamp = 0 +local lastSegment = 0 +local lastPanel +local hexColor = "FFFFFF" +local displayString = "|cff%s%.1f|r"; +local dpsString = "%s |cff00CCFF%s|r"; + +local function Reset() + timeStamp = 0 + combatTime = 0 + DMGTotal = 0 + lastDMGAmount = 0 +end + +local function GetDPS(self) + if DMGTotal == 0 or combatTime == 0 then + self.text:SetText(dpsString:format(L["DPS"], "..PAUSED")) + self.TText = "No Damage Done" + self.TText2 = "Go smack something so \nthat I can do the maths!" + else + local DPS = (DMGTotal) / (combatTime) + self.text:SetFormattedText(displayString, hexColor, DPS) + self.TText = "DPS:" + self.TText2 = DPS + end +end + +local function DPS_OnClick(self) + Reset() + GetDPS(self) +end + +local function DPS_OnEnter(self) + Dock:SetDataTip(self) + Dock.DataTooltip:AddDoubleLine("Damage Total:", DMGTotal, 1, 1, 1) + Dock.DataTooltip:AddLine(" ", 1, 1, 1) + Dock.DataTooltip:AddDoubleLine(self.TText, self.TText2, 1, 1, 1) + Dock.DataTooltip:AddLine(" ", 1, 1, 1) + Dock.DataTooltip:AddDoubleLine("[Click]", "Clear DPS", 0,1,0, 0.5,1,0.5) + Dock:ShowDataTip(true) +end + +local function DPS_OnEvent(self, event, ...) + lastPanel = self + if event == "PLAYER_ENTERING_WORLD" then + playerID = UnitGUID('player') + elseif event == 'PLAYER_REGEN_DISABLED' or event == "PLAYER_LEAVE_COMBAT" then + local now = time() + if now - lastSegment > 20 then --time since the last segment + Reset() + end + lastSegment = now + elseif event == 'COMBAT_LOG_EVENT_UNFILTERED' then + local newTime, event, _, srcGUID, srcName, srcFlags, sourceRaidFlags, dstGUID, dstName, dstFlags, destRaidFlags, lastDMGAmount, spellName = ... + if not PlayerEvents[event] then return end + if(srcGUID == playerID or srcGUID == petID) then + if timeStamp == 0 then timeStamp = newTime end + lastSegment = timeStamp + combatTime = newTime - timeStamp + if event ~= "SWING_DAMAGE" then + lastDMGAmount = select(15, ...) + end + DMGTotal = DMGTotal + lastDMGAmount + end + elseif event == UNIT_PET then + petID = UnitGUID("pet") + end + + GetDPS(self) +end + +local DPSColorUpdate = function() + hexColor = SV:HexColor("highlight") + if lastPanel ~= nil then + DPS_OnEvent(lastPanel) + end +end + +SV.Events:On("SVUI_COLORS_UPDATED", "DPSColorUpdates", DPSColorUpdate) +Dock:NewDataType('DPS', StatEvents, DPS_OnEvent, nil, DPS_OnClick, DPS_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tool/stats/durability.lua b/Interface/AddOns/SVUI/packages/tool/stats/durability.lua new file mode 100644 index 0000000..f1a2174 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/stats/durability.lua @@ -0,0 +1,150 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + +STATS:Extend EXAMPLE USAGE: Dock:NewDataType(newStat,eventList,onEvents,update,click,focus,blur) + +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local assert = _G.assert; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local string = _G.string; +local math = _G.math; +local table = _G.table; +--[[ STRING METHODS ]]-- +local lower, upper = string.lower, string.upper; +local find, format, len, split = string.find, string.format, string.len, string.split; +local match, sub, join = string.match, string.sub, string.join; +local gmatch, gsub = string.gmatch, string.gsub; +--[[ MATH METHODS ]]-- +local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; -- Basic +--[[ TABLE METHODS ]]-- +local twipe, tsort = table.wipe, table.sort; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local LSM = LibStub("LibSharedMedia-3.0") +local Dock = SV.Dock; +--[[ +########################################################## +DURABILITY STATS +########################################################## +]]-- +local StatEvents = {"PLAYER_ENTERING_WORLD", "UPDATE_INVENTORY_DURABILITY", "MERCHANT_SHOW"}; + +local hexColor = "FFFFFF" +local displayString = "%s: |cff%s%d%%|r"; +local overall = 0; +local min, max, currentObject; +local equipment = {} +local inventoryMap = { + ["SecondaryHandSlot"] = L["Offhand"], + ["MainHandSlot"] = L["Main Hand"], + ["FeetSlot"] = L["Feet"], + ["LegsSlot"] = L["Legs"], + ["HandsSlot"] = L["Hands"], + ["WristSlot"] = L["Wrist"], + ["WaistSlot"] = L["Waist"], + ["ChestSlot"] = L["Chest"], + ["ShoulderSlot"] = L["Shoulder"], + ["HeadSlot"] = L["Head"] +} + +local function Durability_OnEvent(self, ...) + currentObject = self; + overall = 100; + if self.barframe:IsShown() then + self.text:SetAllPoints(self) + self.text:SetJustifyH("CENTER") + self.barframe:Hide() + self.text:FontManager("data") + end + for slot,name in pairs(inventoryMap)do + local slotID = GetInventorySlotInfo(slot) + min,max = GetInventoryItemDurability(slotID) + if min then + equipment[name] = min / max * 100; + if min / max * 100 < overall then + overall = min / max * 100 + end + end + end + self.text:SetFormattedText(displayString, DURABILITY, hexColor, overall) +end + +local function DurabilityBar_OnEvent(self, ...) + currentObject = nil; + overall = 100; + if not self.barframe:IsShown() then + self.barframe:Show() + self.barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\STAT-DUR") + self.text:FontManager("data") + end + for slot,name in pairs(inventoryMap)do + local slotID = GetInventorySlotInfo(slot) + min,max = GetInventoryItemDurability(slotID) + if min then + equipment[name] = min / max * 100; + if min / max * 100 < overall then + overall = min / max * 100 + end + end + end + local newRed = (100 - overall) * 0.01; + local newGreen = overall * 0.01; + self.barframe.bar:SetMinMaxValues(0, 100) + self.barframe.bar:SetValue(overall) + self.barframe.bar:SetStatusBarColor(newRed, newGreen, 0) + self.text:SetText('') +end + +local function Durability_OnClick() + ToggleCharacter("PaperDollFrame") +end + +local function Durability_OnEnter(self) + Dock:SetDataTip(self) + for name,amt in pairs(equipment)do + Dock.DataTooltip:AddDoubleLine(name, format("%d%%", amt),1, 1, 1, SV:ColorGradient(amt * 0.01, 1, 0, 0, 1, 1, 0, 0, 1, 0)) + end + Dock:ShowDataTip() +end + +local DurColorUpdate = function() + hexColor = SV:HexColor("highlight") + if currentObject ~= nil then + Durability_OnEvent(currentObject) + end +end +SV.Events:On("SVUI_COLORS_UPDATED", "DurColorUpdates", DurColorUpdate) + +Dock:NewDataType("Durability", StatEvents, Durability_OnEvent, nil, Durability_OnClick, Durability_OnEnter) +Dock:NewDataType("Durability Bar", StatEvents, DurabilityBar_OnEvent, nil, Durability_OnClick, Durability_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tool/stats/experience.lua b/Interface/AddOns/SVUI/packages/tool/stats/experience.lua new file mode 100644 index 0000000..36b7ee4 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/stats/experience.lua @@ -0,0 +1,130 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + +STATS:Extend EXAMPLE USAGE: Dock:NewDataType(newStat,eventList,onEvents,update,click,focus,blur) + +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local string = _G.string; +--[[ STRING METHODS ]]-- +local format = string.format; +local gsub = string.gsub; +--MATH +local math = _G.math; +local min = math.min +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L; +local LSM = LibStub("LibSharedMedia-3.0") +local Dock = SV.Dock; +--[[ +########################################################## +EXPERIENCE STATS +########################################################## +]]-- +local StatEvents = {"PLAYER_ENTERING_WORLD", "PLAYER_XP_UPDATE", "PLAYER_LEVEL_UP", "DISABLE_XP_GAIN", "ENABLE_XP_GAIN", "UPDATE_EXHAUSTION"}; + +local function getUnitXP(unit) + if unit == "pet"then + return GetPetExperience() + else + return UnitXP(unit),UnitXPMax(unit) + end +end + +local function TruncateString(value) + if value >= 1e9 then + return ("%.1fb"):format(value/1e9):gsub("%.?0+([kmb])$","%1") + elseif value >= 1e6 then + return ("%.1fm"):format(value/1e6):gsub("%.?0+([kmb])$","%1") + elseif value >= 1e3 or value <= -1e3 then + return ("%.1fk"):format(value/1e3):gsub("%.?0+([kmb])$","%1") + else + return value + end +end + +local function Experience_OnEvent(self, ...) + if self.barframe:IsShown()then + self.text:SetAllPoints(self) + self.text:SetJustifyH("CENTER") + self.barframe:Hide() + self.text:FontManager("data") + end + local f, g = getUnitXP("player") + local h = GetXPExhaustion() + local i = "" + if h and h > 0 then + i = format("%s - %d%% R:%s [%d%%]", TruncateString(f), f / g * 100, TruncateString(h), h / g * 100) + else + i = format("%s - %d%%", TruncateString(f), f / g * 100) + end + self.text:SetText(i) +end + +local function ExperienceBar_OnEvent(self, ...) + if (not self.barframe:IsShown())then + self.barframe:Show() + self.barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\STAT-XP") + self.text:FontManager("data") + end + if not self.barframe.bar.extra:IsShown() then + self.barframe.bar.extra:Show() + end + local k = self.barframe.bar; + local f, g = getUnitXP("player") + k:SetMinMaxValues(0, g) + k:SetValue((f - 1) >= 0 and (f - 1) or 0) + k:SetStatusBarColor(0, 0.5, 1) + local h = GetXPExhaustion() + if h and h>0 then + k.extra:SetMinMaxValues(0, g) + k.extra:SetValue(min(f + h, g)) + k.extra:SetStatusBarColor(0.8, 0.5, 1) + k.extra:SetAlpha(0.5) + else + k.extra:SetMinMaxValues(0, 1) + k.extra:SetValue(0) + end + self.text:SetText("") +end + +local function Experience_OnEnter(self) + Dock:SetDataTip(self) + local XP, maxXP = getUnitXP("player") + local h = GetXPExhaustion() + Dock.DataTooltip:AddLine(L["Experience"]) + Dock.DataTooltip:AddLine(" ") + + Dock.DataTooltip:AddDoubleLine(L["XP:"], (" %d / %d (%d%%)"):format(XP, maxXP, (XP / maxXP) * 100), 1, 1, 1) + Dock.DataTooltip:AddDoubleLine(L["Remaining:"], (" %d (%d%% - %d "..L["Bars"]..")"):format(maxXP - XP, (maxXP - XP) / maxXP * 100, 20 * (maxXP - XP) / maxXP), 1, 1, 1) + if h then + Dock.DataTooltip:AddDoubleLine(L["Rested:"], format(" + %d (%d%%)", h, h / maxXP * 100), 1, 1, 1) + end + Dock:ShowDataTip() +end + +Dock:NewDataType("Experience", StatEvents, Experience_OnEvent, nil, nil, Experience_OnEnter) +Dock:NewDataType("Experience Bar", StatEvents, ExperienceBar_OnEvent, nil, nil, Experience_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tool/stats/friends.lua b/Interface/AddOns/SVUI/packages/tool/stats/friends.lua new file mode 100644 index 0000000..0bcb577 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/stats/friends.lua @@ -0,0 +1,385 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + +STATS:Extend EXAMPLE USAGE: Dock:NewDataType(newStat,eventList,onEvents,update,click,focus,blur) + +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local assert = _G.assert; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local string = _G.string; +local math = _G.math; +local table = _G.table; +--[[ STRING METHODS ]]-- +local lower, upper = string.lower, string.upper; +local find, format, len, split = string.find, string.format, string.len, string.split; +local match, sub, join = string.match, string.sub, string.join; +local gmatch, gsub = string.gmatch, string.gsub; +--[[ MATH METHODS ]]-- +local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; -- Basic +--[[ TABLE METHODS ]]-- +local wipe, sort = table.wipe, table.sort; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local Dock = SV.Dock; +--[[ +########################################################## +LOCALIZED GLOBALS +########################################################## +]]-- +local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS +--[[ +########################################################## +FRIENDS STATS +########################################################## +]]-- +local StatEvents = { + "PLAYER_ENTERING_WORLD", + "BN_FRIEND_ACCOUNT_ONLINE", + "BN_FRIEND_ACCOUNT_OFFLINE", + "BN_FRIEND_INFO_CHANGED", + "BN_FRIEND_TOON_ONLINE", + "BN_FRIEND_TOON_OFFLINE", + "BN_TOON_NAME_UPDATED", + "FRIENDLIST_UPDATE", + "CHAT_MSG_SYSTEM" +}; + +SV.SystemAlert.SET_BN_BROADCAST={ + text = BN_BROADCAST_TOOLTIP, + button1 = ACCEPT, + button2 = CANCEL, + hasEditBox = 1, + editBoxWidth = 350, + maxLetters = 127, + OnAccept = function(self) BNSetCustomMessage(self.editBox:GetText()) end, + OnShow = function(self) self.editBox:SetText(select(4, BNGetInfo()) ) self.editBox:SetFocus() end, + OnHide = ChatEdit_FocusActiveWindow, + EditBoxOnEnterPressed = function(self) BNSetCustomMessage(self:GetText()) self:GetParent():Hide() end, + EditBoxOnEscapePressed = function(self) self:GetParent():Hide() end, + timeout = 0, + exclusive = 1, + whileDead = 1, + hideOnEscape = 1, + preferredIndex = 3 +}; + +local menuFrame = CreateFrame("Frame", "FriendDatatextRightClickMenu", SV.Screen, "UIDropDownMenuTemplate") +local menuList = { + { text = OPTIONS_MENU, isTitle = true,notCheckable=true}, + { text = INVITE, hasArrow = true,notCheckable=true, }, + { text = CHAT_MSG_WHISPER_INFORM, hasArrow = true,notCheckable=true, }, + { text = PLAYER_STATUS, hasArrow = true, notCheckable=true, + menuList = { + { text = "|cff2BC226"..AVAILABLE.."|r", notCheckable=true, func = function() if IsChatAFK() then SendChatMessage("", "AFK") elseif IsChatDND() then SendChatMessage("", "DND") end end }, + { text = "|cffE7E716"..DND.."|r", notCheckable=true, func = function() if not IsChatDND() then SendChatMessage("", "DND") end end }, + { text = "|cffFF0000"..AFK.."|r", notCheckable=true, func = function() if not IsChatAFK() then SendChatMessage("", "AFK") end end }, + }, + }, + { text = BN_BROADCAST_TOOLTIP, notCheckable=true, func = function() SV:StaticPopup_Show("SET_BN_BROADCAST") end }, +} + +local function inviteClick(self, name) + menuFrame:Hide() + + if type(name) ~= 'number' then + InviteUnit(name) + else + BNInviteFriend(name); + end +end + +local function whisperClick(self, name, battleNet) + menuFrame:Hide() + + if battleNet then + ChatFrame_SendSmartTell(name) + else + SetItemRef( "player:"..name, ("|Hplayer:%1$s|h[%1$s]|h"):format(name), "LeftButton" ) + end +end + +local levelNameString = "|cff%02x%02x%02x%d|r |cff%02x%02x%02x%s|r" +local levelNameClassString = "|cff%02x%02x%02x%d|r %s%s%s" +local worldOfWarcraftString = WORLD_OF_WARCRAFT +local battleNetString = BATTLENET_OPTIONS_LABEL +local wowString, scString, d3String, wtcgString = BNET_CLIENT_WOW, BNET_CLIENT_SC2, BNET_CLIENT_D3, BNET_CLIENT_WTCG +local totalOnlineString = join("", FRIENDS_LIST_ONLINE, ": %s/%s") +local tthead, ttsubh, ttoff = {r=0.4, g=0.78, b=1}, {r=0.75, g=0.9, b=1}, {r=.3,g=1,b=.3} +local activezone, inactivezone = {r=0.3, g=1.0, b=0.3}, {r=0.65, g=0.65, b=0.65} +local hexColor = "FFFFFF" +local displayString = "%s: |cff%s%d|r"; +local statusTable = { "|cffFFFFFF[|r|cffFF0000"..L['AFK'].."|r|cffFFFFFF]|r", "|cffFFFFFF[|r|cffFF0000"..L['DND'].."|r|cffFFFFFF]|r", "" } +local groupedTable = { "|cffaaaaaa*|r", "" } +local friendTable, BNTable, BNTableWoW, BNTableD3, BNTableSC, BNTableWTCG = {}, {}, {}, {}, {}, {} +local tableList = {[wowString] = BNTableWoW, [d3String] = BNTableD3, [scString] = BNTableSC, [wtcgString] = BNTableWTCG} +local friendOnline, friendOffline = gsub(ERR_FRIEND_ONLINE_SS,"\124Hplayer:%%s\124h%[%%s%]\124h",""), gsub(ERR_FRIEND_OFFLINE_S,"%%s","") +local dataValid = false +local lastPanel + +local function BuildFriendTable(total) + wipe(friendTable) + local name, level, class, area, connected, status, note + for i = 1, total do + name, level, class, area, connected, status, note = GetFriendInfo(i) + + if status == "<"..AFK..">" then + status = "|cffFFFFFF[|r|cffFF0000"..L['AFK'].."|r|cffFFFFFF]|r" + elseif status == "<"..DND..">" then + status = "|cffFFFFFF[|r|cffFF0000"..L['DND'].."|r|cffFFFFFF]|r" + end + + if connected then + for k,v in pairs(LOCALIZED_CLASS_NAMES_MALE) do if class == v then class = k end end + for k,v in pairs(LOCALIZED_CLASS_NAMES_FEMALE) do if class == v then class = k end end + friendTable[i] = { name, level, class, area, connected, status, note } + end + end + sort(friendTable, function(a, b) + if a[1] and b[1] then + return a[1] < b[1] + end + end) +end + +local function Sort(a, b) + if a[2] and b[2] and a[3] and b[3] then + if a[2] == b[2] then return a[3] < b[3] end + return a[2] < b[2] + end +end + +local function BuildBNTable(total) + wipe(BNTable) + wipe(BNTableWoW) + wipe(BNTableD3) + wipe(BNTableSC) + wipe(BNTableWTCG) + + local _, presenceID, presenceName, battleTag, isBattleTagPresence, toonName, toonID, client, isOnline, lastOnline, isAFK, isDND, messageText, noteText, isRIDFriend, messageTime, canSoR + local toonName, client, realmName, realmID, faction, race, class, zoneName, level, gameText, broadcastText, broadcastTime + for i = 1, total do + -- presenceID, presenceName, battleTag, isBattleTagPresence, toonName, toonID, client, isOnline, lastOnline, isAFK, isDND, messageText, noteText, isRIDFriend, broadcastTime, canSoR + presenceID, presenceName, battleTag, isBattleTagPresence, toonName, toonID, client, isOnline, lastOnline, isAFK, isDND, messageText, noteText, isRIDFriend, messageTime, canSoR = BNGetFriendInfo(i) + -- unknown, toonName, client, realmName, realmID, faction, race, class, unknown, zoneName, level, gameText, broadcastText, broadcastTime, unknown, presenceID + _, _, _, realmName, realmID, faction, race, class, _, zoneName, level, gameText, broadcastText, broadcastTime, _, _ = BNGetToonInfo(presenceID); + + if isOnline then + for k,v in pairs(LOCALIZED_CLASS_NAMES_MALE) do if class == v then class = k end end + BNTable[i] = { presenceID, presenceName, battleTag, toonName, toonID, client, isOnline, isAFK, isDND, noteText, realmName, faction, race, class, zoneName, level } + + if client == scString then + BNTableSC[#BNTableSC + 1] = { presenceID, presenceName, toonName, toonID, client, isOnline, isAFK, isDND, noteText, realmName, faction, race, class, zoneName, level } + elseif client == d3String then + BNTableD3[#BNTableD3 + 1] = { presenceID, presenceName, toonName, toonID, client, isOnline, isAFK, isDND, noteText, realmName, faction, race, class, zoneName, level } + elseif client == wtcgString then + BNTableWTCG[#BNTableWTCG + 1] = { presenceID, presenceName, toonName, toonID, client, isOnline, isAFK, isDND, noteText, realmName, faction, race, class, zoneName, level } + else + BNTableWoW[#BNTableWoW + 1] = { presenceID, presenceName, toonName, toonID, client, isOnline, isAFK, isDND, noteText, realmName, faction, race, class, zoneName, level } + end + end + end + + --sort(BNTable, Sort) + sort(BNTableWoW, Sort) + sort(BNTableSC, Sort) + sort(BNTableD3, Sort) + sort(BNTableWTCG, Sort) +end + +local function OnEvent(self, event, ...) + local _, onlineFriends = GetNumFriends() + local _, numBNetOnline = BNGetNumFriends() + + -- special handler to detect friend coming online or going offline + -- when this is the case, we invalidate our buffered table and update the + -- datatext information + if event == "CHAT_MSG_SYSTEM" then + local message = select(1, ...) + if not (find(message, friendOnline) or find(message, friendOffline)) then return end + end + + -- force update when showing tooltip + dataValid = false + local amt = onlineFriends + numBNetOnline + self.text:SetFormattedText(displayString, L['Friends'], hexColor, amt) + lastPanel = self +end + +local function Click(self, btn) + Dock.DataTooltip:Hide() + + if btn == "RightButton" then + local menuCountWhispers = 0 + local menuCountInvites = 0 + local classc, levelc, info + + menuList[2].menuList = {} + menuList[3].menuList = {} + + if #friendTable > 0 then + for i = 1, #friendTable do + info = friendTable[i] + if (info[5]) then + menuCountInvites = menuCountInvites + 1 + menuCountWhispers = menuCountWhispers + 1 + + classc, levelc = RAID_CLASS_COLORS[info[3]], GetQuestDifficultyColor(info[2]) + classc = classc or GetQuestDifficultyColor(info[2]); + + menuList[2].menuList[menuCountInvites] = {text = format(levelNameString,levelc.r*255,levelc.g*255,levelc.b*255,info[2],classc.r*255,classc.g*255,classc.b*255,info[1]), arg1 = info[1],notCheckable=true, func = inviteClick} + menuList[3].menuList[menuCountWhispers] = {text = format(levelNameString,levelc.r*255,levelc.g*255,levelc.b*255,info[2],classc.r*255,classc.g*255,classc.b*255,info[1]), arg1 = info[1],notCheckable=true, func = whisperClick} + end + end + end + if #BNTable > 0 then + local realID, grouped + for i = 1, #BNTable do + info = BNTable[i] + if (info[5]) then + realID = info[2] + menuCountWhispers = menuCountWhispers + 1 + menuList[3].menuList[menuCountWhispers] = {text = realID, arg1 = realID, arg2 = true, notCheckable=true, func = whisperClick} + + if info[6] == wowString and UnitFactionGroup("player") == info[12] then + classc, levelc = RAID_CLASS_COLORS[info[14]], GetQuestDifficultyColor(info[16]) + classc = classc or GetQuestDifficultyColor(info[16]) + + if UnitInParty(info[4]) or UnitInRaid(info[4]) then grouped = 1 else grouped = 2 end + menuCountInvites = menuCountInvites + 1 + + menuList[2].menuList[menuCountInvites] = {text = format(levelNameString,levelc.r*255,levelc.g*255,levelc.b*255,info[16],classc.r*255,classc.g*255,classc.b*255,info[4]), arg1 = info[5], notCheckable=true, func = inviteClick} + end + end + end + end + + EasyMenu(menuList, menuFrame, "cursor", 0, 0, "MENU", 2) + else + ToggleFriendsFrame() + end +end + +local function OnEnter(self) + Dock:SetDataTip(self) + local grouped + local numberOfFriends, onlineFriends = GetNumFriends() + local totalBNet, numBNetOnline = BNGetNumFriends() + + local totalonline = onlineFriends + numBNetOnline + + -- no friends online, quick exit + if totalonline == 0 then return end + + if not dataValid then + -- only retrieve information for all on-line members when we actually view the tooltip + if numberOfFriends > 0 then BuildFriendTable(numberOfFriends) end + if totalBNet > 0 then BuildBNTable(totalBNet) end + dataValid = true + end + + local totalfriends = numberOfFriends + totalBNet + local zonec, classc, levelc, realmc, info + Dock.DataTooltip:AddDoubleLine(L['Friends List'], format(totalOnlineString, totalonline, totalfriends),tthead.r,tthead.g,tthead.b,tthead.r,tthead.g,tthead.b) + if onlineFriends > 0 then + Dock.DataTooltip:AddLine(' ') + Dock.DataTooltip:AddLine(worldOfWarcraftString) + for i = 1, #friendTable do + info = friendTable[i] + if info[5] then + if GetRealZoneText() == info[4] then zonec = activezone else zonec = inactivezone end + classc, levelc = RAID_CLASS_COLORS[info[3]], GetQuestDifficultyColor(info[2]) + + classc = classc or GetQuestDifficultyColor(info[2]) + + if UnitInParty(info[1]) or UnitInRaid(info[1]) then grouped = 1 else grouped = 2 end + Dock.DataTooltip:AddDoubleLine(format(levelNameClassString,levelc.r*255,levelc.g*255,levelc.b*255,info[2],info[1],groupedTable[grouped]," "..info[6]),info[4],classc.r,classc.g,classc.b,zonec.r,zonec.g,zonec.b) + end + end + end + + if numBNetOnline > 0 then + local status = 0 + for client, list in pairs(tableList) do + if #list > 0 then + Dock.DataTooltip:AddLine(' ') + Dock.DataTooltip:AddLine(battleNetString..' ('..client..')') + for i = 1, #list do + info = list[i] + -- for x = 1, #info do + -- print(x) + -- print(info[x]) + -- print("-----") + -- end + if info[6] then + if info[5] == wowString then + if (info[7] == true) then status = 1 elseif (info[8] == true) then status = 2 else status = 3 end + classc = RAID_CLASS_COLORS[info[13]] + + if UnitInParty(info[4]) or UnitInRaid(info[4]) then grouped = 1 else grouped = 2 end + + if info[15] ~= '' then + levelc = GetQuestDifficultyColor(info[15]) + Dock.DataTooltip:AddDoubleLine(format(levelNameString, levelc.r*255, levelc.g*255, levelc.b*255, info[15], classc.r*255, classc.g*255, classc.b*255, info[3], groupedTable[grouped], 255, 0, 0, statusTable[status]), info[2], 238, 238, 238, 238, 238, 238) + else + classc = classc or RAID_CLASS_COLORS["PRIEST"] + Dock.DataTooltip:AddDoubleLine(format("|cff%02x%02x%02x%s|r", classc.r*255, classc.g*255, classc.b*255, info[3], groupedTable[grouped], 255, 0, 0, statusTable[status]), info[2], 238, 238, 238, 238, 238, 238) + end + + if IsShiftKeyDown() then + if GetRealZoneText() == info[14] then zonec = activezone else zonec = inactivezone end + if GetRealmName() == info[10] then realmc = activezone else realmc = inactivezone end + Dock.DataTooltip:AddDoubleLine(info[14], info[10], zonec.r, zonec.g, zonec.b, realmc.r, realmc.g, realmc.b) + end + else + Dock.DataTooltip:AddDoubleLine(info[3], info[2], .9, .9, .9, .9, .9, .9) + end + end + end + end + end + end + + Dock:ShowDataTip() +end + +local FriendsColorUpdate = function() + hexColor = SV:HexColor("highlight") + if lastPanel ~= nil then + OnEvent(lastPanel,'SVUI_COLOR_UPDATE') + end +end + +SV.Events:On("SVUI_COLORS_UPDATED", "FriendsColorUpdates", FriendsColorUpdate) + +Dock:NewDataType('Friends', StatEvents, OnEvent, nil, Click, OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tool/stats/gold.lua b/Interface/AddOns/SVUI/packages/tool/stats/gold.lua new file mode 100644 index 0000000..3de15b4 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/stats/gold.lua @@ -0,0 +1,171 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + +STATS:Extend EXAMPLE USAGE: Dock:NewDataType(newStat,eventList,onEvents,update,click,focus,blur) + +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local assert = _G.assert; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local string = _G.string; +local math = _G.math; +local table = _G.table; +--[[ STRING METHODS ]]-- +local lower, upper = string.lower, string.upper; +local find, format, len, split = string.find, string.format, string.len, string.split; +local match, sub, join = string.match, string.sub, string.join; +local gmatch, gsub = string.gmatch, string.gsub; +--[[ MATH METHODS ]]-- +local abs, ceil, floor, round, mod = math.abs, math.ceil, math.floor, math.round, math.fmod; -- Basic +--[[ TABLE METHODS ]]-- +local twipe, tsort = table.wipe, table.sort; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L; +local Dock = SV.Dock; +--[[ +########################################################## +GOLD STATS +########################################################## +]]-- +local playerName = UnitName("player"); +local playerRealm = GetRealmName(); + +local StatEvents = {'PLAYER_ENTERING_WORLD','PLAYER_MONEY','SEND_MAIL_MONEY_CHANGED','SEND_MAIL_COD_CHANGED','PLAYER_TRADE_MONEY','TRADE_MONEY_CHANGED'}; +local gains = 0; +local loss = 0; +local recorded = 0; +local copperFormat = "%d" .. L.copperabbrev +local silverFormat = "%d" .. L.silverabbrev .. " %.2d" .. L.copperabbrev +local goldFormat = "%s" .. L.goldabbrev .. " %.2d" .. L.silverabbrev .. " %.2d" .. L.copperabbrev + +local silverShortFormat = "%d" .. L.silverabbrev +local goldShortFormat = "%s" .. L["goldabbrev"] + +local tiptext = join("","|cffaaaaaa",L["Reset Data: Hold Left Ctrl + Shift then Click"],"|r") +local serverGold = {}; + +local function FormatCurrency(amount, short) + if not amount then return end + local gold, silver, copper = floor(abs(amount/10000)), abs(mod(amount/100,100)), abs(mod(amount,100)) + if(short) then + if gold ~= 0 then + gold = BreakUpLargeNumbers(gold) + return goldShortFormat:format(gold) + elseif silver ~= 0 then + return silverShortFormat:format(silver) + else + return copperFormat:format(copper) + end + else + if gold ~= 0 then + gold = BreakUpLargeNumbers(gold) + return goldFormat:format(gold, silver, copper) + elseif silver ~= 0 then + return silverFormat:format(silver, copper) + else + return copperFormat:format(copper) + end + end +end + +local function Gold_OnEvent(self, event,...) + if not IsLoggedIn() then return end + local current = GetMoney() + recorded = Dock.Accountant["gold"][playerName] or GetMoney(); + local adjusted = current - recorded; + if recorded > current then + loss = loss - adjusted + else + gains = gains + adjusted + end + self.text:SetText(FormatCurrency(current, SV.db.Dock.shortGold)) + Dock.Accountant["gold"][playerName] = GetMoney() +end + +local function Gold_OnClick(self, button) + if IsLeftControlKeyDown() and IsShiftKeyDown() then + Dock.Accountant["gold"] = {}; + Dock.Accountant["gold"][playerName] = GetMoney(); + Gold_OnEvent(self) + Dock.DataTooltip:Hide() + else + ToggleAllBags() + end +end + +local function Gold_OnEnter(self) + Dock:SetDataTip(self) + Dock.DataTooltip:AddLine(L['Session:']) + Dock.DataTooltip:AddDoubleLine(L["Earned:"],FormatCurrency(gains),1,1,1,1,1,1) + Dock.DataTooltip:AddDoubleLine(L["Spent:"],FormatCurrency(loss),1,1,1,1,1,1) + if gains < loss then + Dock.DataTooltip:AddDoubleLine(L["Deficit:"],FormatCurrency(gains - loss),1,0,0,1,1,1) + elseif (gains - loss) > 0 then + Dock.DataTooltip:AddDoubleLine(L["Profit:"],FormatCurrency(gains - loss),0,1,0,1,1,1) + end + Dock.DataTooltip:AddLine(" ") + local cash = Dock.Accountant["gold"][playerName]; + Dock.DataTooltip:AddLine(L[playerName..": "]) + Dock.DataTooltip:AddDoubleLine(L["Total: "], FormatCurrency(cash), 1,1,1,1,1,1) + Dock.DataTooltip:AddLine(" ") + + Dock.DataTooltip:AddLine(L["Characters: "]) + for name,amount in pairs(serverGold)do + if(name ~= playerName and name ~= 'total') then + cash = cash + amount; + Dock.DataTooltip:AddDoubleLine(name, FormatCurrency(amount), 1,1,1,1,1,1) + end + end + Dock.DataTooltip:AddLine(" ") + Dock.DataTooltip:AddLine(L["Server: "]) + Dock.DataTooltip:AddDoubleLine(L["Total: "], FormatCurrency(cash), 1,1,1,1,1,1) + Dock.DataTooltip:AddLine(" ") + Dock.DataTooltip:AddLine(tiptext) + Dock:ShowDataTip() +end + +local function Gold_OnInit(self) + Dock:SetAccountantData('gold', 'number', 0); + + local totalGold = 0; + for name,amount in pairs(Dock.Accountant["gold"])do + if Dock.Accountant["gold"][name] then + serverGold[name] = amount; + totalGold = totalGold + amount + end + end + + serverGold['total'] = totalGold; +end + +Dock:NewDataType('Gold', StatEvents, Gold_OnEvent, nil, Gold_OnClick, Gold_OnEnter, nil, Gold_OnInit); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tool/stats/guild.lua b/Interface/AddOns/SVUI/packages/tool/stats/guild.lua new file mode 100644 index 0000000..f7ddb31 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/stats/guild.lua @@ -0,0 +1,310 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + +STATS:Extend EXAMPLE USAGE: Dock:NewDataType(newStat,eventList,onEvents,update,click,focus,blur) + +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local string = _G.string; +local math = _G.math; +local table = _G.table; +--[[ STRING METHODS ]]-- +local format, join, gsub = string.format, string.join, string.gsub; +--[[ MATH METHODS ]]-- +local ceil = math.ceil; -- Basic +local twipe, tsort = table.wipe, table.sort; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local Dock = SV.Dock; +--[[ +########################################################## +GUILD STATS +########################################################## +]]-- +local playerName = UnitName("player"); +local playerRealm = GetRealmName(); + +local StatEvents = {"PLAYER_ENTERING_WORLD","GUILD_ROSTER_UPDATE","GUILD_XP_UPDATE","PLAYER_GUILD_UPDATE","GUILD_MOTD"}; + +local updatedString = ""; +local patternColor = SV:HexColor(0.75,0.9,1); +local pattern1 = ("|cff%s%s"):format(patternColor, GUILD_EXPERIENCE_CURRENT); +local pattern2 = ("|cff%s%s"):format(patternColor, GUILD_EXPERIENCE_DAILY); +local guildFormattedName = "%s: %d/%d"; +local guildFormattedXP = gsub(pattern1, ": ", ":|r |cffFFFFFF", 1); +local guildFormattedDailyXP = gsub(pattern2, ": ", ":|r |cffFFFFFF", 1); +local guildFormattedFaction = join("|cff", patternColor, "%s:|r |cFFFFFFFF%s/%s (%s%%)"); +local guildFormattedOnline = join("", "+ %d ", FRIENDS_LIST_ONLINE, "..."); +local guildFormattedNote = join("", "|cff999999 ", LABEL_NOTE, ":|r %s"); +local guildFormattedRank = join("", "|cff999999 ", GUILD_RANK1_DESC, ":|r %s"); +local GuildStatMembers,GuildStatMOTD = {},""; +local currentObject; + +local UnitFlagFormat = { + [0] = function()return "" end, + [1] = function()return ("|cffFFFFFF[|r|cffFF0000%s|r|cffFFFFFF]|r"):format(L["AFK"]) end, + [2] = function()return ("|cffFFFFFF[|r|cffFF0000%s|r|cffFFFFFF]|r"):format(L["DND"]) end +}; + +local MobileFlagFormat = { + [0] = function()return ChatFrame_GetMobileEmbeddedTexture(73/255, 177/255, 73/255) end, + [1] = function()return "|TInterface\\ChatFrame\\UI-ChatIcon-ArmoryChat-AwayMobile:14:14:0:0:16:16:0:16:0:16|t" end, + [2] = function()return "|TInterface\\ChatFrame\\UI-ChatIcon-ArmoryChat-BusyMobile:14:14:0:0:16:16:0:16:0:16|t" end +}; + +local GuildDatatTextRightClickMenu = CreateFrame("Frame", "GuildDatatTextRightClickMenu", SV.Screen, "UIDropDownMenuTemplate") + +local MenuMap = { + {text = OPTIONS_MENU, isTitle = true, notCheckable = true}, + {text = INVITE, hasArrow = true, notCheckable = true}, + {text = CHAT_MSG_WHISPER_INFORM, hasArrow = true, notCheckable = true} +}; + +local function TruncateString(value) + if value >= 1e9 then + return ("%.1fb"):format(value/1e9):gsub("%.?0+([kmb])$","%1") + elseif value >= 1e6 then + return ("%.1fm"):format(value/1e6):gsub("%.?0+([kmb])$","%1") + elseif value >= 1e3 or value <= -1e3 then + return ("%.1fk"):format(value/1e3):gsub("%.?0+([kmb])$","%1") + else + return value + end +end + +local function SortGuildStatMembers(shift) + tsort(GuildStatMembers, function(arg1, arg2) + if arg1 and arg2 then + if shift then + return arg1[10] < arg2[10] + else + return arg1[1] < arg2[1] + end + end + end) +end + +local function GetGuildStatMembers() + twipe(GuildStatMembers) + local statusFormat; + local _, name, rank, level, zone, note, officernote, online, status, classFileName, isMobile, rankIndex; + for i = 1, GetNumGuildMembers() do + name, rank, rankIndex, level, _, zone, note, officernote, online, status, classFileName, _, _, isMobile = GetGuildRosterInfo(i) + statusFormat = isMobile and MobileFlagFormat[status]() or UnitFlagFormat[status]() + zone = isMobile and not online and REMOTE_CHAT or zone; + if online or isMobile then + GuildStatMembers[#GuildStatMembers + 1] = { name, rank, level, zone, note, officernote, online, statusFormat, classFileName, rankIndex, isMobile} + end + end +end + +local GuildStatEventHandler = { + ["PLAYER_ENTERING_WORLD"] = function(arg1, arg2) + if not GuildFrame and IsInGuild() then + LoadAddOn("Blizzard_GuildUI") + GuildRoster() + end + end, + ["GUILD_ROSTER_UPDATE"] = function(arg1, arg2) + if arg2 then + GuildRoster() + else + GetGuildStatMembers() + GuildStatMOTD = GetGuildRosterMOTD() + if GetMouseFocus() == arg1 then + arg1:GetScript("OnEnter")(arg1, nil, true) + end + end + end, + ["PLAYER_GUILD_UPDATE"] = function(arg1, arg2) + GuildRoster() + end, + ["GUILD_MOTD"] = function(arg1, arg2) + GuildStatMOTD = arg2 + end, + ["SVUI_FORCE_RUN"] = SV.fubar, + ["SVUI_COLOR_UPDATE"] = SV.fubar +}; + +local function MenuInvite(self, unit) + GuildDatatTextRightClickMenu:Hide() + InviteUnit(unit) +end + +local function MenuRightClick(self, unit) + GuildDatatTextRightClickMenu:Hide() + SetItemRef(("player:%s"):format(unit), ("|Hplayer:%1$s|h[%1$s]|h"):format(unit), "LeftButton") +end + +local function MenuLeftClick() + if IsInGuild() then + if not GuildFrame then + LoadAddOn("Blizzard_GuildUI") + end + GuildFrame_Toggle() + GuildFrame_TabClicked(GuildFrameTab2) + else + if not LookingForGuildFrame then + LoadAddOn("Blizzard_LookingForGuildUI") + end + if LookingForGuildFrame then + LookingForGuildFrame_Toggle() + end + end +end + +local function Guild_OnEvent(self, event, ...) + currentObject = self; + if IsInGuild() and GuildStatEventHandler[event] then + GuildStatEventHandler[event](self, select(1, ...)) + self.text:SetFormattedText(updatedString, #GuildStatMembers) + else + self.text:SetText(L['No Guild']) + end +end + +local function Guild_OnClick(self, button) + if button == "RightButton" and IsInGuild() then + Dock.DataTooltip:Hide() + + + local classc, levelc, grouped, info + local menuCountWhispers = 0 + local menuCountInvites = 0 + + MenuMap[2].menuList = {} + MenuMap[3].menuList = {} + + for i = 1, #GuildStatMembers do + info = GuildStatMembers[i] + if info[7] and info[1] ~= playerName then + local classc, levelc = RAID_CLASS_COLORS[info[9]], GetQuestDifficultyColor(info[3]) + if UnitInParty(info[1])or UnitInRaid(info[1]) then + grouped = "|cffaaaaaa*|r" + elseif not info[11] then + menuCountInvites = menuCountInvites + 1; + grouped = ""; + MenuMap[2].menuList[menuCountInvites] = { + text = ("|cff%02x%02x%02x%d|r |cff%02x%02x%02x%s|r %s"):format(levelc.r*255, levelc.g*255, levelc.b*255, info[3], classc.r*255, classc.g*255, classc.b*255, info[1], ""), + arg1 = info[1], + notCheckable = true, + func = MenuInvite + } + end + menuCountWhispers = menuCountWhispers + 1; + if not grouped then + grouped = "" + end + MenuMap[3].menuList[menuCountWhispers] = { + text = ("|cff%02x%02x%02x%d|r |cff%02x%02x%02x%s|r %s"):format(levelc.r*255, levelc.g*255, levelc.b*255, info[3], classc.r*255, classc.g*255, classc.b*255, info[1], grouped), + arg1 = info[1], + notCheckable = true, + func = MenuRightClick + } + end + end + EasyMenu(MenuMap, GuildDatatTextRightClickMenu, "cursor", 0, 0, "MENU", 2) + else + MenuLeftClick() + end +end + +local function Guild_OnEnter(self, _, ap) + if not IsInGuild() then + return + end + Dock:SetDataTip(self) + local aq, ar = GetNumGuildMembers() + if #GuildStatMembers == 0 then GetGuildStatMembers() end + SortGuildStatMembers(IsShiftKeyDown()) + local guildName, guildRankName, guildRankIndex = GetGuildInfo('player') + if guildName and guildRankName then + Dock.DataTooltip:AddDoubleLine(("%s "):format(guildName), guildFormattedName:format(GUILD, ar, aq), 0.4, 0.78, 1, 0.4, 0.78, 1) + Dock.DataTooltip:AddLine(guildRankName, 0.4, 0.78, 1) + end + if GuildStatMOTD ~= "" then + Dock.DataTooltip:AddLine(' ') + Dock.DataTooltip:AddLine(("%s |cffaaaaaa- |cffffffff%s"):format(GUILD_MOTD, GuildStatMOTD), 0.75, 0.9, 1, 1) + end + local av = SV:HexColor(0.75,0.9,1) + local _, _, standingID, barMin, barMax, barValue = GetGuildFactionInfo() + if standingID ~= 8 then + barMax = barMax - barMin; + barValue = barValue - barMin; + barMin = 0; + Dock.DataTooltip:AddLine(guildFormattedFaction:format(COMBAT_FACTION_CHANGE, TruncateString(barValue), TruncateString(barMax), ceil(barValue / barMax * 100))) + end + local zoneColor, classColor, questColor, member, groupFormat; + local counter = 0; + Dock.DataTooltip:AddLine(' ') + for X = 1, #GuildStatMembers do + if((30 - counter) <= 1) then + if((ar - 30) > 1) then + Dock.DataTooltip:AddLine(guildFormattedOnline:format(ar - 30), 0.75, 0.9, 1) + end + break + end + member = GuildStatMembers[X] + if GetRealZoneText() == member[4]then + zoneColor = {r=0.3,g=1.0,b=0.3} + else + zoneColor = {r=0.65,g=0.65,b=0.65} + end + classColor, questColor = RAID_CLASS_COLORS[member[9]], GetQuestDifficultyColor(member[3]) + if UnitInParty(member[1]) or UnitInRaid(member[1]) then + groupFormat = "|cffaaaaaa*|r" + else + groupFormat = "" + end + if IsShiftKeyDown() then + Dock.DataTooltip:AddDoubleLine(("%s |cff999999-|cffffffff %s"):format(member[1], member[2]), member[4], classColor.r, classColor.g, classColor.b, zoneColor.r, zoneColor.g, zoneColor.b) + if member[5] ~= ""then + Dock.DataTooltip:AddLine(guildFormattedNote:format(member[5]), 0.75, 0.9, 1, 1) + end + if member[6] ~= ""then + Dock.DataTooltip:AddLine(guildFormattedRank:format(member[6]), 0.3, 1, 0.3, 1) + end + else + Dock.DataTooltip:AddDoubleLine(("|cff%02x%02x%02x%d|r %s%s %s"):format(questColor.r*255, questColor.g*255, questColor.b*255, member[3], member[1], groupFormat, member[8]), member[4], classColor.r, classColor.g, classColor.b, zoneColor.r, zoneColor.g, zoneColor.b) + end + counter = counter + 1 + end + Dock:ShowDataTip() + if not ap then + GuildRoster() + end +end + +local GuildColorUpdate = function() + local hexColor = SV:HexColor("highlight"); + updatedString = join("", GUILD, ": |cff", hexColor, "%d|r") + if currentObject ~= nil then + Guild_OnEvent(currentObject, 'SVUI_COLOR_UPDATE') + end +end +SV.Events:On("SVUI_COLORS_UPDATED", "GuildColorUpdates", GuildColorUpdate) + +Dock:NewDataType('Guild', StatEvents, Guild_OnEvent, nil, Guild_OnClick, Guild_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tool/stats/hps.lua b/Interface/AddOns/SVUI/packages/tool/stats/hps.lua new file mode 100644 index 0000000..e88f32b --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/stats/hps.lua @@ -0,0 +1,135 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + +STATS:Extend EXAMPLE USAGE: Dock:NewDataType(newStat,eventList,onEvents,update,click,focus,blur) + +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local string = _G.string; +--[[ STRING METHODS ]]-- +local match, sub, join = string.match, string.sub, string.join; +local max = math.max; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local Dock = SV.Dock; +--[[ +########################################################## +CALL TO ARMS STATS +########################################################## +]]-- +local StatEvents = {'PLAYER_ENTERING_WORLD', 'COMBAT_LOG_EVENT_UNFILTERED', "PLAYER_LEAVE_COMBAT", 'PLAYER_REGEN_DISABLED', 'UNIT_PET'}; + +local PlayerEvents = {["SPELL_HEAL"] = true, ["SPELL_PERIODIC_HEAL"] = true} +local playerID = UnitGUID('player') +local petID +local healTotal, totalHeal, totalOverHeal, lastHealAmount = 0, 0, 0, 0 +local combatTime = 0 +local timeStamp = 0 +local lastSegment = 0 +local lastPanel +local hexColor = "FFFFFF"; +local displayString = "|cff%s%.1f|r"; +local dpsString = "%s |cff00CCFF%s|r"; + +local join = string.join +local max = math.max + +local function Reset() + timeStamp = 0 + combatTime = 0 + healTotal = 0 + totalHeal = 0 + totalOverHeal = 0 + lastHealAmount = 0 +end + +local function GetHPS(self) + if healTotal == 0 or combatTime == 0 then + self.text:SetText(dpsString:format(L["HPS"], "..PAUSED")) + self.TText = "No Healing Done" + self.TText2 = "Surely there is someone \nwith an ouchie somewhere!" + else + local HPS = (healTotal) / (combatTime) + self.text:SetFormattedText(displayString, hexColor, HPS) + self.TText = "HPS:" + self.TText2 = HPS + end +end + +local function HPS_OnClick(self) + Reset() + GetHPS(self) +end + +local function HPS_OnEnter(self) + Dock:SetDataTip(self) + Dock.DataTooltip:AddDoubleLine("Healing Total:", totalHeal, 1, 1, 1) + Dock.DataTooltip:AddDoubleLine("OverHealing Total:", totalOverHeal, 1, 1, 1) + Dock.DataTooltip:AddLine(" ", 1, 1, 1) + Dock.DataTooltip:AddDoubleLine(self.TText, self.TText2, 1, 1, 1) + Dock.DataTooltip:AddLine(" ", 1, 1, 1) + Dock.DataTooltip:AddDoubleLine("[Click]", "Clear HPS", 0,1,0, 0.5,1,0.5) + Dock:ShowDataTip(true) +end + +local function HPS_OnEvent(self, event, ...) + lastPanel = self + + if event == "PLAYER_ENTERING_WORLD" then + playerID = UnitGUID('player') + elseif event == 'PLAYER_REGEN_DISABLED' or event == "PLAYER_LEAVE_COMBAT" then + local now = time() + if now - lastSegment > 20 then --time since the last segment + Reset() + end + lastSegment = now + elseif event == 'COMBAT_LOG_EVENT_UNFILTERED' then + local newTime, event, _, srcGUID, _, _, _, _, _, _, _, _, _, test, lastHealAmount, overHeal = ... + if not PlayerEvents[event] then return end + if(srcGUID == playerID or srcGUID == petID) then + if timeStamp == 0 then timeStamp = newTime end + lastSegment = timeStamp + combatTime = newTime - timeStamp + healTotal = healTotal + (lastHealAmount - overHeal) + totalHeal = totalHeal + lastHealAmount + totalOverHeal = totalOverHeal + overHeal + end + elseif event == UNIT_PET then + petID = UnitGUID("pet") + end + + GetHPS(self) +end + +local HPSColorUpdate = function() + hexColor = SV:HexColor("highlight"); + if lastPanel ~= nil then + HPS_OnEvent(lastPanel) + end +end + +SV.Events:On("SVUI_COLORS_UPDATED", "HPSColorUpdates", HPSColorUpdate) +Dock:NewDataType('HPS', StatEvents, HPS_OnEvent, nil, HPS_OnClick, HPS_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tool/stats/reputation.lua b/Interface/AddOns/SVUI/packages/tool/stats/reputation.lua new file mode 100644 index 0000000..ebfcd11 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/stats/reputation.lua @@ -0,0 +1,181 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + +STATS:Extend EXAMPLE USAGE: Dock:NewDataType(newStat,eventList,onEvents,update,click,focus,blur) + +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local tinsert = _G.tinsert; +local table = _G.table; +local twipe = table.wipe; +local tsort = table.sort; +--[[ STRING METHODS ]]-- +local format, gsub = string.format, string.gsub; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L; +local Dock = SV.Dock; +--[[ +########################################################## +REPUTATION STATS +########################################################## +]]-- +local StatEvents = {"PLAYER_ENTERING_WORLD", "UPDATE_FACTION"}; +local RepMenuList = {}; +local standingName = { + [1] = "Hated", + [2] = "Hostile", + [3] = "Unfriendly", + [4] = "Neutral", + [5] = "Friendly", + [6] = "Honored", + [7] = "Revered", + [8] = "Exalted" +} + +local function TruncateString(value) + if value >= 1e9 then + return ("%.1fb"):format(value/1e9):gsub("%.?0+([kmb])$","%1") + elseif value >= 1e6 then + return ("%.1fm"):format(value/1e6):gsub("%.?0+([kmb])$","%1") + elseif value >= 1e3 or value <= -1e3 then + return ("%.1fk"):format(value/1e3):gsub("%.?0+([kmb])$","%1") + else + return value + end +end +-- name, description, standingID, barMin, barMax, barValue, _, _, _, _, hasRep, isWatched, isChild +local function CacheRepData() + twipe(RepMenuList) + for factionIndex = 1, GetNumFactions() do + local factionName, description, standingID, barMin, barMax, barValue, _, _, _, _, hasRep, isWatched, isChild = GetFactionInfo(factionIndex) + if(standingID) then + local fn = function() + local active = GetWatchedFactionInfo() + if factionName ~= active then + SetWatchedFactionIndex(factionIndex) + end + end + tinsert(RepMenuList, {text = factionName, func = fn}) + end + end + tsort(RepMenuList, function(a,b) return a.text < b.text end) +end + +local function Reputation_OnEvent(self, ...) + if self.barframe:IsShown()then + self.text:SetAllPoints(self) + self.text:SetJustifyH("CENTER") + self.barframe:Hide() + self.text:SetAlpha(1) + self.text:SetShadowOffset(2, -4) + end + local ID = 100 + local friendText + local name, reaction, min, max, value = GetWatchedFactionInfo() + local numFactions = GetNumFactions(); + if not name then + self.text:SetText("No watched factions") + else + for i=1, numFactions do + local factionName, description, standingID, barMin, barMax, barValue, _, _, _, _, hasRep, isWatched, isChild = GetFactionInfo(i); + local friendID, friendRep, friendMaxRep, _, _, _, friendTextLevel = GetFriendshipReputation(isChild); + if(not factionName or (name == "No watched factions") or (name == factionName)) then + if friendID ~= nil then + friendText = friendTextLevel + else + ID = standingID + end + end + end + friendText = friendText or _G["FACTION_STANDING_LABEL"..ID] or " "; + self.text:SetFormattedText("|cff22EF5F%s|r|cff888888 - [|r%d%%|cff888888]|r", friendText, ((value - min) / (max - min) * 100)) + end +end + +local function ReputationBar_OnEvent(self, ...) + if not self.barframe:IsShown()then + self.barframe:Show() + self.barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\STAT-REP") + self.text:SetAlpha(1) + self.text:SetShadowOffset(1, -2) + end + local bar = self.barframe.bar; + local name, reaction, min, max, value = GetWatchedFactionInfo() + local numFactions = GetNumFactions(); + if not name then + bar:SetStatusBarColor(0,0,0) + bar:SetMinMaxValues(0,1) + bar:SetValue(0) + self.text:SetText("No Faction") + else + for i=1, numFactions do + local factionName, description, standingID, barMin, barMax, barValue, _, _, _, _, hasRep, isWatched, isChild = GetFactionInfo(i); + if(isChild) then + local friendID, friendRep, friendMaxRep, _, _, _, friendTextLevel, friendThreshold, nextFriendThreshold = GetFriendshipReputation(isChild); + if friendID ~= nil then + min = friendThreshold + max = friendMaxRep + value = friendRep + end + end + end + local txt = standingName[reaction]; + local color = FACTION_BAR_COLORS[reaction] + bar:SetStatusBarColor(color.r, color.g, color.b) + bar:SetMinMaxValues(min, max) + bar:SetValue(value) + self.text:SetText(txt) + end +end + +local function Reputation_OnEnter(self) + Dock:SetDataTip(self) + local name, reaction, min, max, value, factionID = GetWatchedFactionInfo() + local friendID, _, _, _, _, _, friendTextLevel = GetFriendshipReputation(factionID); + if not name then + Dock.DataTooltip:AddLine("No Watched Factions") + else + Dock.DataTooltip:AddLine(name) + Dock.DataTooltip:AddLine(' ') + Dock.DataTooltip:AddDoubleLine(STANDING..':', friendID and friendTextLevel or _G['FACTION_STANDING_LABEL'..reaction], 1, 1, 1) + Dock.DataTooltip:AddDoubleLine(REPUTATION..':', format('%d / %d (%d%%)', value - min, max - min, (value - min) / (max - min) * 100), 1, 1, 1) + end + Dock.DataTooltip:AddLine(" ", 1, 1, 1) + Dock.DataTooltip:AddDoubleLine("[Click]", "Change Watched Faction", 0,1,0, 0.5,1,0.5) + Dock:ShowDataTip(true) +end + +local function Reputation_OnClick(self, button) + CacheRepData() + SV.Dropdown:Open(self, RepMenuList) +end + +local function Reputation_OnInit(self) + CacheRepData() +end + +Dock:NewDataType("Reputation", StatEvents, Reputation_OnEvent, nil, Reputation_OnClick, Reputation_OnEnter, nil, Reputation_OnInit) +Dock:NewDataType("Reputation Bar", StatEvents, ReputationBar_OnEvent, nil, Reputation_OnClick, Reputation_OnEnter, nil, Reputation_OnInit) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tool/stats/system.lua b/Interface/AddOns/SVUI/packages/tool/stats/system.lua new file mode 100644 index 0000000..f104d91 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/stats/system.lua @@ -0,0 +1,288 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + +STATS:Extend EXAMPLE USAGE: Dock:NewDataType(newStat,eventList,onEvents,update,click,focus,blur) + +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local string = _G.string; +local math = _G.math; +local table = _G.table; +--[[ STRING METHODS ]]-- +local format = string.format; +--[[ MATH METHODS ]]-- +local floor = math.floor +--[[ TABLE METHODS ]]-- +local tsort = table.sort; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L; +local Dock = SV.Dock; +--[[ +########################################################## +SYSTEM STATS (Credit: Elv) +########################################################## +]]-- +local int, int2 = 6, 5 +local statusColors = { + "|cff0CD809", + "|cffE8DA0F", + "|cffFF9000", + "|cffD80909" +} + +local enteredFrame = false; +local bandwidthString = "%.2f Mbps" +local percentageString = "%.2f%%" +local homeLatencyString = "%d ms" +local kiloByteString = "%d kb" +local megaByteString = "%.2f mb" +local totalMemory = 0 +local bandwidth = 0 + +local function formatMem(memory) + local mult = 10^1 + if memory > 999 then + local mem = ((memory/1024) * mult) / mult + return megaByteString:format(mem) + else + local mem = (memory * mult) / mult + return kiloByteString:format(mem) + end +end + +local memoryTable = {} +local cpuTable = {} +--local eventTable = {"ZONE_CHANGED", "ZONE_CHANGED_NEW_AREA", "PLAYER_ENTERING_WORLD"} + +local function RebuildAddonList() + local addOnCount = GetNumAddOns() + if (addOnCount == #memoryTable) then return end + memoryTable = {} + cpuTable = {} + for i = 1, addOnCount do + local addonName = select(2, GetAddOnInfo(i)) + memoryTable[i] = { i, addonName, 0, IsAddOnLoaded(i) } + cpuTable[i] = { i, addonName, 0, IsAddOnLoaded(i) } + end +end + +local function UpdateMemory() + -- Update the memory usages of the addons + UpdateAddOnMemoryUsage() + -- Load memory usage in table + totalMemory = 0 + for i = 1, #memoryTable do + memoryTable[i][3] = GetAddOnMemoryUsage(memoryTable[i][1]) + totalMemory = totalMemory + memoryTable[i][3] + end + -- Sort the table to put the largest addon on top + tsort(memoryTable, function(a, b) + if a and b then + return a[3] > b[3] + end + end) +end + +local function UpdateCPU() + --Update the CPU usages of the addons + UpdateAddOnCPUUsage() + -- Load cpu usage in table + local addonCPU = 0 + local totalCPU = 0 + for i = 1, #cpuTable do + addonCPU = GetAddOnCPUUsage(cpuTable[i][1]) + cpuTable[i][3] = addonCPU + totalCPU = totalCPU + addonCPU + end + + -- Sort the table to put the largest addon on top + tsort(cpuTable, function(a, b) + if a and b then + return a[3] > b[3] + end + end) + + return totalCPU +end + +local function Click() + collectgarbage("collect"); + ResetCPUUsage(); +end + +local function OnEnter(self) + enteredFrame = true; + local cpuProfiling = false --GetCVar("scriptProfile") == "1" + Dock:SetDataTip(self) + + UpdateMemory() + bandwidth = GetAvailableBandwidth() + + Dock.DataTooltip:AddDoubleLine(L['Home Latency:'], homeLatencyString:format(select(3, GetNetStats())), 0.69, 0.31, 0.31,0.84, 0.75, 0.65) + + if bandwidth ~= 0 then + local percent = GetDownloadedPercentage() + percent = percent * 100 + Dock.DataTooltip:AddDoubleLine(L['Bandwidth'] , bandwidthString:format(bandwidth), 0.69, 0.31, 0.31,0.84, 0.75, 0.65) + Dock.DataTooltip:AddDoubleLine(L['Download'] , percentageString:format(percent), 0.69, 0.31, 0.31, 0.84, 0.75, 0.65) + Dock.DataTooltip:AddLine(" ") + end + + local totalCPU = nil + Dock.DataTooltip:AddDoubleLine(L['Total Memory:'], formatMem(totalMemory), 0.69, 0.31, 0.31,0.84, 0.75, 0.65) + if cpuProfiling then + totalCPU = UpdateCPU() + Dock.DataTooltip:AddDoubleLine(L['Total CPU:'], homeLatencyString:format(totalCPU), 0.69, 0.31, 0.31,0.84, 0.75, 0.65) + end + + local red, green + if IsShiftKeyDown() or not cpuProfiling then + Dock.DataTooltip:AddLine(" ") + for i = 1, #memoryTable do + if (memoryTable[i][4]) then + red = memoryTable[i][3] / totalMemory + green = 1 - red + Dock.DataTooltip:AddDoubleLine(memoryTable[i][2], formatMem(memoryTable[i][3]), 1, 1, 1, red, green + .5, 0) + end + end + end + + if cpuProfiling and not IsShiftKeyDown() then + Dock.DataTooltip:AddLine(" ") + for i = 1, #cpuTable do + if (cpuTable[i][4]) then + red = cpuTable[i][3] / totalCPU + green = 1 - red + Dock.DataTooltip:AddDoubleLine(cpuTable[i][2], homeLatencyString:format(cpuTable[i][3]), 1, 1, 1, red, green + .5, 0) + end + end + + -- if(Dock.DebugList) then + -- Dock.DataTooltip:AddLine(" ") + -- for _,schema in pairs(Dock.DebugList) do + -- local obj = SV[schema] + -- if obj and obj.___eventframe then + -- local upTime, numEvents = GetFrameCPUUsage(obj.___eventframe) + -- local eventString = ("%s:"):format(schema) + -- local eventResults = ("Calls: |cffFFFF00%d|r @: |cffFFFF00%dms|r"):format(numEvents, upTime) + -- Dock.DataTooltip:AddDoubleLine(eventString, eventResults, 1, 0.5, 0, 1, 1, 1) + -- end + -- end + -- end + + -- Dock.DataTooltip:AddLine(" ") + -- for i = 1, #eventTable do + -- local upTime, numEvents = GetEventCPUUsage(eventTable[i]) + -- local eventString = ("%s:"):format(eventTable[i]) + -- local eventResults = ("Calls: |cffFFFF00%d|r @: |cffFFFF00%dms|r"):format(numEvents, upTime) + -- Dock.DataTooltip:AddDoubleLine(eventString, eventResults, 1, 0.5, 0, 1, 1, 1) + -- end + + + Dock.DataTooltip:AddLine(" ") + Dock.DataTooltip:AddLine(L['(Hold Shift) Memory Usage']) + end + + Dock.DataTooltip:Show() +end + +local function OnLeave(self) + enteredFrame = false; + Dock.DataTooltip:Hide() +end + +local Update = function(self, t) + int = int - t + int2 = int2 - t + + if int < 0 then + RebuildAddonList() + int = 10 + end + if int2 < 0 then + local framerate = floor(GetFramerate()) + local latency = select(4, GetNetStats()) + + self.text:SetFormattedText("FPS: %s%d|r MS: %s%d|r", + statusColors[framerate >= 30 and 1 or (framerate >= 20 and framerate < 30) and 2 or (framerate >= 10 and framerate < 20) and 3 or 4], + framerate, + statusColors[latency < 150 and 1 or (latency >= 150 and latency < 300) and 2 or (latency >= 300 and latency < 500) and 3 or 4], + latency) + int2 = 1 + if enteredFrame then + OnEnter(self) + end + end +end +-- if(SV.DebugMode) then +-- Update = function(self, t) +-- int = int - t +-- if int < 0 then +-- UpdateAddOnMemoryUsage() +-- local svuiRAMout = formatMem(GetAddOnMemoryUsage("SVUI")) +-- self.text:SetFormattedText("RAM: %s%s|r", statusColors[1], svuiRAMout) +-- int = 1 +-- if enteredFrame then +-- OnEnter(self) +-- end +-- end +-- end +-- else +-- Update = function(self, t) +-- int = int - t +-- int2 = int2 - t + +-- if int < 0 then +-- RebuildAddonList() +-- int = 10 +-- end +-- if int2 < 0 then +-- local framerate = floor(GetFramerate()) +-- local latency = select(4, GetNetStats()) + +-- self.text:SetFormattedText("FPS: %s%d|r MS: %s%d|r", +-- statusColors[framerate >= 30 and 1 or (framerate >= 20 and framerate < 30) and 2 or (framerate >= 10 and framerate < 20) and 3 or 4], +-- framerate, +-- statusColors[latency < 150 and 1 or (latency >= 150 and latency < 300) and 2 or (latency >= 300 and latency < 500) and 3 or 4], +-- latency) +-- int2 = 1 +-- if enteredFrame then +-- OnEnter(self) +-- end +-- end +-- end +-- end + +Dock:NewDataType('System', nil, nil, Update, Click, OnEnter, OnLeave) + +--[[ +OTHER CHECKS + +GetScriptCPUUsage() +print(debugstack()) +local usage, calls = GetFunctionCPUUsage(function, includeSubroutines) +local usage, numEvents = GetEventCPUUsage(["event"]) +]]-- \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tool/stats/time.lua b/Interface/AddOns/SVUI/packages/tool/stats/time.lua new file mode 100644 index 0000000..602668e --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/stats/time.lua @@ -0,0 +1,238 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + +STATS:Extend EXAMPLE USAGE: Dock:NewDataType(newStat,eventList,onEvents,update,click,focus,blur) + +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local type = _G.type; +local string = _G.string; +local math = _G.math; +--[[ STRING METHODS ]]-- +local format, join = string.format, string.join; +--[[ MATH METHODS ]]-- +local floor = math.floor; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L +local Dock = SV.Dock; +--[[ +########################################################## +TIME STATS (Credit: Elv) +########################################################## +]]-- +local APM = { TIMEMANAGER_PM, TIMEMANAGER_AM } +local europeDisplayFormat = ''; +local ukDisplayFormat = ''; +local europeDisplayFormat_nocolor = join("", "%02d", ":|r%02d") +local ukDisplayFormat_nocolor = join("", "", "%d", ":|r%02d", " %s|r") +local timerLongFormat = "%d:%02d:%02d" +local timerShortFormat = "%d:%02d" +local lockoutInfoFormat = "%s%s |cffaaaaaa(%s, %s/%s)" +local lockoutInfoFormatNoEnc = "%s%s |cffaaaaaa(%s)" +local formatBattleGroundInfo = "%s: " +local lockoutColorExtended, lockoutColorNormal = { r=0.3,g=1,b=0.3 }, { r=.8,g=.8,b=.8 } +local lockoutFormatString = { "%dd %02dh %02dm", "%dd %dh %02dm", "%02dh %02dm", "%dh %02dm", "%dh %02dm", "%dm" } +local curHr, curMin, curAmPm +local enteredFrame = false; +local date = _G.date + +local Update, lastPanel; -- UpValue +local localizedName, isActive, canQueue, startTime, canEnter, _ +local name, instanceID, reset, difficultyId, locked, extended, isRaid, maxPlayers, difficulty, numEncounters, encounterProgress + +local function ValueColorUpdate(hex, r, g, b) + europeDisplayFormat = join("", "%02d", hex, ":|r%02d") + ukDisplayFormat = join("", "", "%d", hex, ":|r%02d", hex, " %s|r") + + if lastPanel ~= nil then + Update(lastPanel, 20000) + end +end + +local function ConvertTime(h, m) + local AmPm + if SV.db.Dock.time24 == true then + return h, m, -1 + else + if h >= 12 then + if h > 12 then h = h - 12 end + AmPm = 1 + else + if h == 0 then h = 12 end + AmPm = 2 + end + end + return h, m, AmPm +end + +local function CalculateTimeValues(tooltip) + if (tooltip and SV.db.Dock.localtime) or (not tooltip and not SV.db.Dock.localtime) then + return ConvertTime(GetGameTime()) + else + local dateTable = date("*t") + return ConvertTime(dateTable["hour"], dateTable["min"]) + end +end + +local function Click() + GameTimeFrame:Click(); +end + +local function OnLeave(self) + Dock.DataTooltip:Hide(); + enteredFrame = false; +end + +local function OnEvent(self, event) + if event == "UPDATE_INSTANCE_INFO" and enteredFrame then + RequestRaidInfo() + end +end + +local function OnEnter(self) + Dock:SetDataTip(self) + + if(not enteredFrame) then + enteredFrame = true; + RequestRaidInfo() + end + + Dock.DataTooltip:AddLine(VOICE_CHAT_BATTLEGROUND); + for i = 1, GetNumWorldPVPAreas() do + _, localizedName, isActive, canQueue, startTime, canEnter = GetWorldPVPAreaInfo(i) + if canEnter then + if isActive then + startTime = WINTERGRASP_IN_PROGRESS + elseif startTime == nil then + startTime = QUEUE_TIME_UNAVAILABLE + else + startTime = SecondsToTime(startTime, false, nil, 3) + end + Dock.DataTooltip:AddDoubleLine(format(formatBattleGroundInfo, localizedName), startTime, 1, 1, 1, lockoutColorNormal.r, lockoutColorNormal.g, lockoutColorNormal.b) + end + end + + local oneraid, lockoutColor + for i = 1, GetNumSavedInstances() do + name, _, reset, difficultyId, locked, extended, _, isRaid, maxPlayers, difficulty, numEncounters, encounterProgress = GetSavedInstanceInfo(i) + if isRaid and (locked or extended) and name then + if not oneraid then + Dock.DataTooltip:AddLine(" ") + Dock.DataTooltip:AddLine(L["Saved Raid(s)"]) + oneraid = true + end + if extended then + lockoutColor = lockoutColorExtended + else + lockoutColor = lockoutColorNormal + end + + local _, _, isHeroic, _ = GetDifficultyInfo(difficultyId) + if (numEncounters and numEncounters > 0) and (encounterProgress and encounterProgress > 0) then + Dock.DataTooltip:AddDoubleLine(format(lockoutInfoFormat, maxPlayers, (isHeroic and "H" or "N"), name, encounterProgress, numEncounters), SecondsToTime(reset, false, nil, 3), 1, 1, 1, lockoutColor.r, lockoutColor.g, lockoutColor.b) + else + Dock.DataTooltip:AddDoubleLine(format(lockoutInfoFormatNoEnc, maxPlayers, (isHeroic and "H" or "N"), name), SecondsToTime(reset, false, nil, 3), 1, 1, 1, lockoutColor.r, lockoutColor.g, lockoutColor.b) + end + end + end + + local addedLine = false + for i = 1, GetNumSavedWorldBosses() do + name, instanceID, reset = GetSavedWorldBossInfo(i) + if(reset) then + if(not addedLine) then + Dock.DataTooltip:AddLine(' ') + Dock.DataTooltip:AddLine(RAID_INFO_WORLD_BOSS.."(s)") + addedLine = true + end + Dock.DataTooltip:AddDoubleLine(name, SecondsToTime(reset, true, nil, 3), 1, 1, 1, 0.8, 0.8, 0.8) + end + end + + local timeText + local Hr, Min, AmPm = CalculateTimeValues(true) + + Dock.DataTooltip:AddLine(" ") + if AmPm == -1 then + Dock.DataTooltip:AddDoubleLine(SV.db.Dock.localtime and TIMEMANAGER_TOOLTIP_REALMTIME or TIMEMANAGER_TOOLTIP_LOCALTIME, + format(europeDisplayFormat_nocolor, Hr, Min), 1, 1, 1, lockoutColorNormal.r, lockoutColorNormal.g, lockoutColorNormal.b) + else + Dock.DataTooltip:AddDoubleLine(SV.db.Dock.localtime and TIMEMANAGER_TOOLTIP_REALMTIME or TIMEMANAGER_TOOLTIP_LOCALTIME, + format(ukDisplayFormat_nocolor, Hr, Min, APM[AmPm]), 1, 1, 1, lockoutColorNormal.r, lockoutColorNormal.g, lockoutColorNormal.b) + end + + Dock.DataTooltip:Show() +end + +local int = 3 +function Update(self, t) + int = int - t + + if int > 0 then return end + + if GameTimeFrame.flashInvite then + SV.Animate:Flash(self, 0.53) + else + SV.Animate:StopFlash(self) + end + + if enteredFrame then + OnEnter(self) + end + + local Hr, Min, AmPm = CalculateTimeValues(false) + + -- no update quick exit + if (Hr == curHr and Min == curMin and AmPm == curAmPm) and not (int < -15000) then + int = 5 + return + end + + curHr = Hr + curMin = Min + curAmPm = AmPm + + if AmPm == -1 then + self.text:SetFormattedText(europeDisplayFormat, Hr, Min) + else + self.text:SetFormattedText(ukDisplayFormat, Hr, Min, APM[AmPm]) + end + lastPanel = self + int = 5 +end + +local TimeColorUpdate = function() + local hexColor = SV:HexColor("highlight") + europeDisplayFormat = join("", "%02d|cff", hexColor, ":|r%02d") + ukDisplayFormat = join("", "", "%d|cff", hexColor, ":|r%02d|cff", hexColor, " %s|r") + if lastPanel ~= nil then + Update(lastPanel, 20000) + end +end + +SV.Events:On("SVUI_COLORS_UPDATED", "TimeColorUpdates", TimeColorUpdate) + +Dock:NewDataType('Time', {"UPDATE_INSTANCE_INFO"}, OnEvent, Update, Click, OnEnter, OnLeave) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tool/stats/tokens.lua b/Interface/AddOns/SVUI/packages/tool/stats/tokens.lua new file mode 100644 index 0000000..27eb32e --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tool/stats/tokens.lua @@ -0,0 +1,238 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + +STATS:Extend EXAMPLE USAGE: Dock:NewDataType(newStat,eventList,onEvents,update,click,focus,blur) + +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local tinsert = _G.tinsert; +local table = _G.table; +local twipe = table.wipe; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L; +local Dock = SV.Dock; +--[[ +########################################################## +GOLD STATS +########################################################## +]]-- +local playerName = UnitName("player"); +local playerRealm = GetRealmName(); + +local TokenEvents = {'PLAYER_ENTERING_WORLD','PLAYER_MONEY','CURRENCY_DISPLAY_UPDATE'}; + +local function TokenInquiry(id, weekly, capped) + local name, amount, tex, week, weekmax, maxed, discovered = GetCurrencyInfo(id) + local r, g, b = 1, 1, 1 + for i = 1, GetNumWatchedTokens() do + local _, _, _, itemID = GetBackpackCurrencyInfo(i) + if id == itemID then r, g, b = 0.23, 0.88, 0.27 end + end + local texStr = ("\124T%s:12\124t %s"):format(tex, name) + local altStr = "" + if weekly then + if discovered then + if id == 390 then + altStr = ("Current: %d | Weekly: %d / %d"):format(amount, week, weekmax) + else + altStr = ("Current: %d / %d | Weekly: %d / %d"):format(amount, maxed, week, weekmax) + end + Dock.DataTooltip:AddDoubleLine(texStr, altStr, r, g, b, r, g, b) + end + elseif capped then + if id == 392 or id == 395 then maxed = 4000 end + if id == 396 then maxed = 3000 end + if discovered then + altStr = ("%d / %d"):format(amount, maxed) + Dock.DataTooltip:AddDoubleLine(texStr, altStr, r, g, b, r, g, b) + end + else + if discovered then + Dock.DataTooltip:AddDoubleLine(texStr, amount, r, g, b, r, g, b) + end + end +end + +local function TokensEventHandler(self, event,...) + if(not IsLoggedIn() or (not self)) then return end + local id = self.TokenKey or 738; + local _, current, tex = GetCurrencyInfo(id) + local currentText = ("\124T%s:12\124t %s"):format(tex, current); + self.text:SetText(currentText) +end + +local function AddToTokenMenu(parent, id, key) + local name, _, tex, _, _, _, _ = GetCurrencyInfo(id) + local itemName = "\124T"..tex..":12\124t "..name; + local fn = function() + Dock.Accountant["tokens"][playerName][key] = id; + parent.TokenKey = id + TokensEventHandler(parent) + end + tinsert(parent.TokenList, {text = itemName, func = fn}); +end + +local function CacheTokenData(self) + twipe(self.TokenList); + local prof1, prof2, archaeology, _, cooking = GetProfessions(); + local key = self:GetName(); + if archaeology then + AddToTokenMenu(self, 398, key) + AddToTokenMenu(self, 384, key) + AddToTokenMenu(self, 393, key) + AddToTokenMenu(self, 677, key) + AddToTokenMenu(self, 400, key) + AddToTokenMenu(self, 394, key) + AddToTokenMenu(self, 397, key) + AddToTokenMenu(self, 676, key) + AddToTokenMenu(self, 401, key) + AddToTokenMenu(self, 385, key) + AddToTokenMenu(self, 399, key) + AddToTokenMenu(self, 821, key) + AddToTokenMenu(self, 829, key) + AddToTokenMenu(self, 944, key) + end + if cooking then + AddToTokenMenu(self, 81, key) + AddToTokenMenu(self, 402, key) + end + if(prof1 == 9 or prof2 == 9) then + AddToTokenMenu(self, 61, key) + AddToTokenMenu(self, 361, key) + AddToTokenMenu(self, 698, key) + + AddToTokenMenu(self, 910, key) + AddToTokenMenu(self, 999, key) + AddToTokenMenu(self, 1020, key) + AddToTokenMenu(self, 1008, key) + AddToTokenMenu(self, 1017, key) + end + AddToTokenMenu(self, 697, key) + AddToTokenMenu(self, 738, key) + AddToTokenMenu(self, 615, key) + AddToTokenMenu(self, 614, key) + AddToTokenMenu(self, 395, key) + AddToTokenMenu(self, 396, key) + AddToTokenMenu(self, 390, key) + AddToTokenMenu(self, 392, key) + AddToTokenMenu(self, 391, key) + AddToTokenMenu(self, 241, key) + AddToTokenMenu(self, 416, key) + AddToTokenMenu(self, 515, key) + AddToTokenMenu(self, 776, key) + AddToTokenMenu(self, 777, key) + AddToTokenMenu(self, 789, key) + AddToTokenMenu(self, 823, key) + AddToTokenMenu(self, 824, key) +end + +local function Tokens_OnEnter(self) + Dock:SetDataTip(self) + Dock.DataTooltip:AddLine(playerName .. "\'s Tokens") + + Dock.DataTooltip:AddLine(" ") + Dock.DataTooltip:AddLine("Common") + TokenInquiry(241) + TokenInquiry(416) + TokenInquiry(515) + TokenInquiry(776) + TokenInquiry(777) + TokenInquiry(789) + + Dock.DataTooltip:AddLine(" ") + Dock.DataTooltip:AddLine("Garrison") + TokenInquiry(823) + TokenInquiry(824) + TokenInquiry(910) + TokenInquiry(999) + TokenInquiry(1020) + TokenInquiry(1008) + TokenInquiry(1017) + + Dock.DataTooltip:AddLine(" ") + Dock.DataTooltip:AddLine("Raiding and Dungeons") + TokenInquiry(697, false, true) + TokenInquiry(738) + TokenInquiry(615) + TokenInquiry(614) + TokenInquiry(395, false, true) + TokenInquiry(396, false, true) + + Dock.DataTooltip:AddLine(" ") + Dock.DataTooltip:AddLine("PvP") + TokenInquiry(390, true) + TokenInquiry(392, false, true) + TokenInquiry(391) + + local prof1, prof2, archaeology, _, cooking = GetProfessions() + if(archaeology or cooking or prof1 == 9 or prof2 == 9) then + Dock.DataTooltip:AddLine(" ") + Dock.DataTooltip:AddLine("Professions") + end + if cooking then + TokenInquiry(81) + TokenInquiry(402) + end + if(prof1 == 9 or prof2 == 9) then + TokenInquiry(61) + TokenInquiry(361) + TokenInquiry(698) + end + if archaeology then + TokenInquiry(821) + TokenInquiry(829) + TokenInquiry(944) + TokenInquiry(398) + TokenInquiry(384) + TokenInquiry(393) + TokenInquiry(677) + TokenInquiry(400) + TokenInquiry(394) + TokenInquiry(397) + TokenInquiry(676) + TokenInquiry(401) + TokenInquiry(385) + TokenInquiry(399) + end + Dock.DataTooltip:AddLine(" ") + Dock.DataTooltip:AddDoubleLine("[Shift + Click]", "Change Watched Token", 0,1,0, 0.5,1,0.5) + Dock:ShowDataTip(true) +end + +local function Tokens_OnClick(self, button) + CacheTokenData(self); + SV.Dropdown:Open(self, self.TokenList) +end + +local function Tokens_OnInit(self) + Dock:SetAccountantData('tokens', 'table', {}) + local key = self:GetName() + Dock.Accountant["tokens"][playerName][key] = Dock.Accountant["tokens"][playerName][key] or 738; + self.TokenKey = Dock.Accountant["tokens"][playerName][key] + CacheTokenData(self); +end + +Dock:NewDataType('Tokens', TokenEvents, TokensEventHandler, nil, Tokens_OnClick, Tokens_OnEnter, nil, Tokens_OnInit) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tools/SVTools.lua b/Interface/AddOns/SVUI/packages/tools/SVTools.lua deleted file mode 100644 index e96fb44..0000000 --- a/Interface/AddOns/SVUI/packages/tools/SVTools.lua +++ /dev/null @@ -1,103 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local assert = _G.assert; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local print = _G.print; -local ipairs = _G.ipairs; -local pairs = _G.pairs; -local tostring = _G.tostring; -local tonumber = _G.tonumber; - ---STRING -local string = _G.string; -local upper = string.upper; -local format = string.format; -local find = string.find; -local match = string.match; -local gsub = string.gsub; ---TABLE -local table = _G.table; -local tinsert = _G.tinsert; -local tremove = _G.tremove; -local twipe = _G.wipe; ---MATH -local math = _G.math; -local min = math.min; -local floor = math.floor -local ceil = math.ceil ---BLIZZARD API -local GameTooltip = _G.GameTooltip; -local InCombatLockdown = _G.InCombatLockdown; -local CreateFrame = _G.CreateFrame; -local GetTime = _G.GetTime; -local GetItemCooldown = _G.GetItemCooldown; -local GetItemCount = _G.GetItemCount; -local GetItemInfo = _G.GetItemInfo; -local GetSpellInfo = _G.GetSpellInfo; -local IsSpellKnown = _G.IsSpellKnown; -local GetProfessions = _G.GetProfessions; -local GetProfessionInfo = _G.GetProfessionInfo; -local hooksecurefunc = _G.hooksecurefunc; ---[[ -########################################################## -ADDON -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L - -local MOD = SV:NewPackage("SVTools", L["Docked Tools"]); - -function MOD:PLAYER_REGEN_ENABLED() - self:UnregisterEvent('PLAYER_REGEN_ENABLED') - - if(self.ProfessionNeedsUpdate) then - self.ProfessionNeedsUpdate = nil; - self:UpdateProfessionTools() - end - - if(self.GarrisonNeedsUpdate) then - self.GarrisonNeedsUpdate = nil; - self:UpdateGarrisonTool() - end - - if(self.RaidLeaderNeedsUpdate) then - self.RaidLeaderNeedsUpdate = nil; - self:UpdateRaidLeader() - end -end - -function MOD:ReLoad() - self:UpdateProfessionTools() - self:UpdateGarrisonTool() - self:UpdateRaidLeader() -end - -function MOD:Load() - self:LoadQuestWatch() - self:LoadProfessionTools() - self:LoadGarrisonTool() - self:LoadRaidLeaderTools() -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tools/SVTools.xml b/Interface/AddOns/SVUI/packages/tools/SVTools.xml deleted file mode 100644 index 6172c7d..0000000 --- a/Interface/AddOns/SVUI/packages/tools/SVTools.xml +++ /dev/null @@ -1,7 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Script file='SVTools.lua'/> - <Script file="components\questwatch.lua"/> - <Script file="components\profession.lua"/> - <Script file="components\garrison.lua"/> - <Script file="components\raidleader.lua"/> -</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tools/components/garrison.lua b/Interface/AddOns/SVUI/packages/tools/components/garrison.lua deleted file mode 100644 index 9b47aeb..0000000 --- a/Interface/AddOns/SVUI/packages/tools/components/garrison.lua +++ /dev/null @@ -1,317 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local assert = _G.assert; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local print = _G.print; -local ipairs = _G.ipairs; -local pairs = _G.pairs; -local tostring = _G.tostring; -local tonumber = _G.tonumber; - ---STRING -local string = _G.string; -local upper = string.upper; -local format = string.format; -local find = string.find; -local match = string.match; -local gsub = string.gsub; ---TABLE -local table = _G.table; -local tinsert = _G.tinsert; -local tremove = _G.tremove; -local twipe = _G.wipe; ---MATH -local math = _G.math; -local min = math.min; -local floor = math.floor -local ceil = math.ceil ---BLIZZARD API -local GameTooltip = _G.GameTooltip; -local InCombatLockdown = _G.InCombatLockdown; -local CreateFrame = _G.CreateFrame; -local GetTime = _G.GetTime; -local GetItemCooldown = _G.GetItemCooldown; -local GetItemCount = _G.GetItemCount; -local GetItemInfo = _G.GetItemInfo; -local GetSpellInfo = _G.GetSpellInfo; -local IsSpellKnown = _G.IsSpellKnown; -local GetGarrison = _G.GetGarrison; -local GetProfessionInfo = _G.GetProfessionInfo; -local hooksecurefunc = _G.hooksecurefunc; ---[[ -########################################################## -ADDON -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L - -local MOD = SV.SVTools; -local GarrisonData = {}; ---[[ -########################################################## -LOCALS -########################################################## -]]-- -local GARRISON_ICON = [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-GARRISON]]; - -local function GetDockCooldown(itemID) - local start,duration = GetItemCooldown(itemID) - local expires = duration - (GetTime() - start) - if expires > 0.05 then - local timeLeft = 0; - local calc = 0; - if expires < 4 then - return format("|cffff0000%.1f|r", expires) - elseif expires < 60 then - return format("|cffffff00%d|r", floor(expires)) - elseif expires < 3600 then - timeLeft = ceil(expires / 60); - calc = floor((expires / 60) + .5); - return format("|cffff9900%dm|r", timeLeft) - elseif expires < 86400 then - timeLeft = ceil(expires / 3600); - calc = floor((expires / 3600) + .5); - return format("|cff66ffff%dh|r", timeLeft) - else - timeLeft = ceil(expires / 86400); - calc = floor((expires / 86400) + .5); - return format("|cff6666ff%dd|r", timeLeft) - end - else - return "|cff6666ffReady|r" - end -end - -local function GarrisonButton_OnEvent(self, event, ...) - if (event == "GARRISON_HIDE_LANDING_PAGE") then - if(not InCombatLockdown() and SVUI_Garrison:IsShown()) then - SVUI_Garrison.Parent:SetWidth(SVUI_Garrison.Parent:GetWidth() - SVUI_Garrison:GetWidth()) - SVUI_Garrison:Hide() - end; - elseif (event == "GARRISON_SHOW_LANDING_PAGE") then - if(not InCombatLockdown() and (not SVUI_Garrison:IsShown())) then - SVUI_Garrison.Parent:SetWidth(SVUI_Garrison.Parent:GetWidth() + SVUI_Garrison:GetWidth()) - SVUI_Garrison:Show() - end; - elseif ( event == "GARRISON_BUILDING_ACTIVATABLE" ) then - SVUI_Garrison:StartAlert(); - elseif ( event == "GARRISON_BUILDING_ACTIVATED" or event == "GARRISON_ARCHITECT_OPENED") then - SVUI_Garrison:StopAlert(); - elseif ( event == "GARRISON_MISSION_FINISHED" ) then - SVUI_Garrison:StartAlert(); - elseif ( event == "GARRISON_MISSION_NPC_OPENED" ) then - SVUI_Garrison:StopAlert(); - elseif (event == "GARRISON_INVASION_AVAILABLE") then - SVUI_Garrison:StartAlert(); - elseif (event == "GARRISON_INVASION_UNAVAILABLE") then - SVUI_Garrison:StopAlert(); - elseif (event == "SHIPMENT_UPDATE") then - local shipmentStarted = ...; - if (shipmentStarted) then - SVUI_Garrison:StartAlert(); - end - end -end - -local function getColoredString(text, color) - local hex = SV:HexColor(color) - return ("|cff%s%s|r"):format(hex, text) -end - -local function GetActiveMissions() - wipe(GarrisonData) - local hasMission = false - - GameTooltip:AddLine(" ", 1, 1, 1) - GameTooltip:AddLine("Active Missions", 1, 0.7, 0) - - for key,data in pairs(C_Garrison.GetInProgressMissions()) do - GarrisonData[data.missionID] = { - name = data.name, - level = data.level, - seconds = data.durationSeconds, - timeLeft = data.timeLeft, - completed = false, - isRare = data.isRare, - type = data.type, - } - hasMission = true - end - - for key,data in pairs(C_Garrison.GetCompleteMissions()) do - if(GarrisonData[data.missionID]) then - GarrisonData[data.missionID].completed = true - end - end - - for key,data in pairs(GarrisonData) do - local hex = data.isRare and "blue" or "green" - local mission = ("%s|cff888888 - |r%s"):format(getColoredString(data.level, "yellow"), getColoredString(data.name, hex)); - local remaining - if (data.completed) then - remaining = L["Complete!"] - else - remaining = ("%s %s"):format(data.timeLeft, getColoredString(" ("..SV:ParseSeconds(data.seconds)..")", "lightgrey")) - end - - GameTooltip:AddDoubleLine(mission, remaining, 0, 1, 0, 1, 1, 1) - hasMission = true - end - - if(not hasMission) then - GameTooltip:AddLine("None", 1, 0, 0) - end -end - -local function GetBuildingData() - local hasBuildings = false - local now = time(); - - GameTooltip:AddLine(" ", 1, 1, 1) - GameTooltip:AddLine("Buildings", 1, 0.7, 0) - - local buildings = C_Garrison.GetBuildings() - for i = 1, #buildings do - local buildingID = buildings[i].buildingID - local plotID = buildings[i].plotID - - local id, name, texPrefix, icon, rank, isBuilding, timeStart, buildTime, canActivate, canUpgrade, isPrebuilt = C_Garrison.GetOwnedBuildingInfoAbbrev(plotID) - - local building = ''; - local remaining - - if(isBuilding) then - building = ("|cffFFFF00%s|r|cff888888 - |r|cffFF5500%s|r"):format(rank, name); - local timeLeft = buildTime - (now - timeStart); - if(canActivate or timeLeft < 0) then - remaining = L["Complete!"] - else - remaining = ("Building %s"):format(getColoredString("("..SV:ParseSeconds(timeLeft)..")", "lightgrey")) - end - GameTooltip:AddDoubleLine(building, remaining, 0, 1, 0, 1, 1, 1) - else - local name, texture, shipmentCapacity, shipmentsReady, shipmentsTotal, creationTime, duration, timeleftString, itemName, itemIcon, itemQuality, itemID = C_Garrison.GetLandingPageShipmentInfo(buildingID) - if(shipmentsReady and shipmentsReady > 0) then - building = ("|cffFFFF00%s|r|cff888888 - |r|cffFF5500%s|r"):format(rank, name); - timeleftString = timeleftString or 'Unknown' - remaining = ("Ready: %s, Next: %s"):format(getColoredString(shipmentsReady, "green"), getColoredString(timeleftString, "lightgrey")) - elseif(timeleftString) then - building = ("|cffFFFF00%s|r|cff888888 - |r|cffFF5500%s|r"):format(rank, name); - remaining = ("Next: %s"):format(getColoredString(timeleftString, "lightgrey")) - end - GameTooltip:AddDoubleLine(building, remaining, 0, 1, 0, 1, 1, 1) - end - - hasBuildings = true - end - - if(not hasBuildings) then - GameTooltip:AddLine("None", 1, 0, 0) - end -end - -local SetGarrisonTooltip = function(self) - if(not InCombatLockdown()) then C_Garrison.RequestLandingPageShipmentInfo() end - local name, amount, tex, week, weekmax, maxed, discovered = GetCurrencyInfo(824) - local texStr = ("\124T%s:12\124t %d"):format(tex, amount) - GameTooltip:AddDoubleLine(name, texStr, 0.23, 0.88, 0.27, 1, 1, 1) - - local text1 = self:GetAttribute("tipText") - local text2 = self:GetAttribute("tipExtraText") - GameTooltip:AddLine(" ", 1, 1, 1) - GameTooltip:AddDoubleLine("[Left-Click]", text1, 0, 1, 0, 1, 1, 1) - if InCombatLockdown() then return end - if(text2) then - local remaining = GetDockCooldown(110560) - GameTooltip:AddDoubleLine("[Right Click]", text2, 0, 1, 0, 1, 1, 1) - GameTooltip:AddDoubleLine(L["Time Remaining"], remaining, 1, 1, 1, 0, 1, 1) - end - - GetActiveMissions() - GetBuildingData() - SVUI_Garrison:StopAlert(); -end - -local function LoadToolBarGarrison() - if((not SV.db.SVTools.garrison) or MOD.GarrisonLoaded) then return end - if(InCombatLockdown()) then - MOD.GarrisonNeedsUpdate = true; - MOD:RegisterEvent("PLAYER_REGEN_ENABLED"); - return - end - - local garrison = SV.Dock:SetDockButton("TopLeft", L["Garrison Landing Page"], GARRISON_ICON, nil, "SVUI_Garrison", SetGarrisonTooltip, "SecureActionButtonTemplate") - garrison:SetAttribute("type1", "click") - garrison:SetAttribute("clickbutton", GarrisonLandingPageMinimapButton) - - local garrisonStone = GetItemInfo(110560); - if(garrisonStone and type(garrisonStone) == "string") then - garrison:SetAttribute("tipExtraText", L["Garrison Hearthstone"]) - garrison:SetAttribute("type2", "macro") - garrison:SetAttribute("macrotext", "/use [nomod] " .. garrisonStone) - end - - GarrisonLandingPageMinimapButton:RemoveTextures() - GarrisonLandingPageMinimapButton:ClearAllPoints() - GarrisonLandingPageMinimapButton:SetAllPoints(garrison) - GarrisonLandingPageMinimapButton:SetNormalTexture("") - GarrisonLandingPageMinimapButton:SetPushedTexture("") - GarrisonLandingPageMinimapButton:SetHighlightTexture("") - - if(not GarrisonLandingPageMinimapButton:IsShown()) then - garrison.Parent:SetWidth(garrison.Parent:GetWidth() - garrison:GetWidth()) - garrison:Hide() - end - - garrison:RegisterEvent("GARRISON_HIDE_LANDING_PAGE"); - garrison:RegisterEvent("GARRISON_SHOW_LANDING_PAGE"); - garrison:RegisterEvent("GARRISON_BUILDING_ACTIVATABLE"); - garrison:RegisterEvent("GARRISON_BUILDING_ACTIVATED"); - garrison:RegisterEvent("GARRISON_ARCHITECT_OPENED"); - garrison:RegisterEvent("GARRISON_MISSION_FINISHED"); - garrison:RegisterEvent("GARRISON_MISSION_NPC_OPENED"); - garrison:RegisterEvent("GARRISON_INVASION_AVAILABLE"); - garrison:RegisterEvent("GARRISON_INVASION_UNAVAILABLE"); - garrison:RegisterEvent("SHIPMENT_UPDATE"); - - garrison:SetScript("OnEvent", GarrisonButton_OnEvent) - - MOD.GarrisonLoaded = true -end ---[[ -########################################################## -BUILD/UPDATE -########################################################## -]]-- -function MOD:UpdateGarrisonTool() - if((not SV.db.SVTools.garrison) or self.GarrisonLoaded) then return end - LoadToolBarGarrison() -end - -function MOD:LoadGarrisonTool() - if((not SV.db.SVTools.garrison) or self.GarrisonLoaded or (not GarrisonLandingPageMinimapButton)) then return end - SV.Timers:ExecuteTimer(LoadToolBarGarrison, 5) -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tools/components/profession.lua b/Interface/AddOns/SVUI/packages/tools/components/profession.lua deleted file mode 100644 index 41821b1..0000000 --- a/Interface/AddOns/SVUI/packages/tools/components/profession.lua +++ /dev/null @@ -1,259 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local assert = _G.assert; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local print = _G.print; -local ipairs = _G.ipairs; -local pairs = _G.pairs; -local tostring = _G.tostring; -local tonumber = _G.tonumber; - ---STRING -local string = _G.string; -local upper = string.upper; -local format = string.format; -local find = string.find; -local match = string.match; -local gsub = string.gsub; ---TABLE -local table = _G.table; -local tinsert = _G.tinsert; -local tremove = _G.tremove; -local twipe = _G.wipe; ---MATH -local math = _G.math; -local min = math.min; -local floor = math.floor -local ceil = math.ceil ---BLIZZARD API -local GameTooltip = _G.GameTooltip; -local InCombatLockdown = _G.InCombatLockdown; -local CreateFrame = _G.CreateFrame; -local GetTime = _G.GetTime; -local GetItemCooldown = _G.GetItemCooldown; -local GetItemCount = _G.GetItemCount; -local GetItemInfo = _G.GetItemInfo; -local GetSpellInfo = _G.GetSpellInfo; -local IsSpellKnown = _G.IsSpellKnown; -local GetProfessions = _G.GetProfessions; -local GetProfessionInfo = _G.GetProfessionInfo; -local hooksecurefunc = _G.hooksecurefunc; ---[[ -########################################################## -ADDON -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L - -local MOD = SV.SVTools; ---[[ -########################################################## -LOCALS -########################################################## -]]-- -local ICON_SHEET = [[Interface\AddOns\SVUI\assets\artwork\Icons\PROFESSIONS]]; -local HEARTH_ICON = [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-HEARTH]]; - -local TOOL_DATA = { - [171] = {0,0.25,0,0.25}, -- PRO-ALCHEMY - [794] = {0.25,0.5,0,0.25,80451}, -- PRO-ARCHAELOGY - [164] = {0.5,0.75,0,0.25}, -- PRO-BLACKSMITH - [185] = {0.75,1,0,0.25,818,67097}, -- PRO-COOKING - [333] = {0,0.25,0.25,0.5,13262}, -- PRO-ENCHANTING - [202] = {0.25,0.5,0.25,0.5}, -- PRO-ENGINEERING - [129] = {0.5,0.75,0.25,0.5}, -- PRO-FIRSTAID - [773] = {0,0.25,0.5,0.75,51005}, -- PRO-INSCRIPTION - [755] = {0.25,0.5,0.5,0.75,31252}, -- PRO-JEWELCRAFTING - [165] = {0.5,0.75,0.5,0.75}, -- PRO-LEATHERWORKING - [186] = {0.75,1,0.5,0.75}, -- PRO-MINING - [197] = {0.25,0.5,0.75,1}, -- PRO-TAILORING -} -local HEARTH_SPELLS = {556,50977,18960,126892} -local LastAddedMacro; -local MacroCount = 0; - -local function GetMacroCooldown(itemID) - local start,duration = GetItemCooldown(itemID) - local expires = duration - (GetTime() - start) - if expires > 0.05 then - local timeLeft = 0; - local calc = 0; - if expires < 4 then - return format("|cffff0000%.1f|r", expires) - elseif expires < 60 then - return format("|cffffff00%d|r", floor(expires)) - elseif expires < 3600 then - timeLeft = ceil(expires / 60); - calc = floor((expires / 60) + .5); - return format("|cffff9900%dm|r", timeLeft) - elseif expires < 86400 then - timeLeft = ceil(expires / 3600); - calc = floor((expires / 3600) + .5); - return format("|cff66ffff%dh|r", timeLeft) - else - timeLeft = ceil(expires / 86400); - calc = floor((expires / 86400) + .5); - return format("|cff6666ff%dd|r", timeLeft) - end - else - return "|cff6666ffReady|r" - end -end - -local SetMacroTooltip = function(self) - local text1 = self:GetAttribute("tipText") - local text2 = self:GetAttribute("tipExtraText") - GameTooltip:AddDoubleLine("[Left-Click]", text1, 0, 1, 0, 1, 1, 1) - if(text2) then - GameTooltip:AddDoubleLine("[Left-Click]", text1, 0, 1, 0, 1, 1, 1) - GameTooltip:AddDoubleLine("[Right-Click]", "Use " .. text2, 0, 1, 0, 1, 1, 1) - if InCombatLockdown() then return end - if(self.ItemToUse) then - GameTooltip:AddLine(" ", 1, 1, 1) - local remaining = GetMacroCooldown(self.ItemToUse) - GameTooltip:AddDoubleLine(text2, remaining, 1, 0.5, 0, 0, 1, 1) - end - end -end - -local SetHearthTooltip = function(self) - local text1 = self:GetAttribute("tipText") - local text2 = self:GetAttribute("tipExtraText") - GameTooltip:AddDoubleLine("[Left-Click]", text1, 0, 1, 0, 1, 1, 1) - if InCombatLockdown() then return end - local remaining = GetMacroCooldown(6948) - GameTooltip:AddDoubleLine(L["Time Remaining"], remaining, 1, 1, 1, 0, 1, 1) - if(text2) then - GameTooltip:AddLine(" ", 1, 1, 1) - GameTooltip:AddDoubleLine("[Right Click]", text2, 0, 1, 0, 1, 1, 1) - end -end - -local function CreateMacroToolButton(proName, proID, itemID) - local data = TOOL_DATA[proID] - if(not data) then return end - - local globalName = ("SVUI_%s"):format(proName) - local button = SV.Dock:SetDockButton("BottomRight", proName, ICON_SHEET, nil, globalName, SetMacroTooltip, "SecureActionButtonTemplate") - - button.Icon:SetTexCoord(data[1], data[2], data[3], data[4]) - - if proID == 186 then proName = GetSpellInfo(2656) end - - --button:RegisterForClicks("AnyDown") - button:SetAttribute("type1", "macro") - button:SetAttribute("macrotext1", "/cast [nomod]" .. proName) - - if(data[5]) then - local rightClick - if(data[6] and GetItemCount(data[6], true) > 0) then - rightClick = GetItemInfo(data[6]) - button.ItemToUse = data[6] - else - rightClick = GetSpellInfo(data[5]) - end - button:SetAttribute("tipExtraText", rightClick) - button:SetAttribute("type2", "macro") - button:SetAttribute("macrotext2", "/cast [nomod] " .. rightClick) - end -end - -local function LoadToolBarProfessions() - if((not SV.db.SVTools.professions) or MOD.ToolBarLoaded) then return end - if(InCombatLockdown()) then - MOD.ProfessionNeedsUpdate = true; - MOD:RegisterEvent("PLAYER_REGEN_ENABLED"); - return - end - - -- HEARTH BUTTON - local hearthStone = GetItemInfo(6948); - if(hearthStone and type(hearthStone) == "string") then - local hearth = SV.Dock:SetDockButton("BottomLeft", L["Hearthstone"], HEARTH_ICON, nil, "SVUI_Hearth", SetHearthTooltip, "SecureActionButtonTemplate") - hearth.Icon:SetTexCoord(0,0.5,0,1) - hearth:SetAttribute("type1", "macro") - hearth:SetAttribute("macrotext1", "/use [nomod]" .. hearthStone) - local hasRightClick = false; - for i = 1, #HEARTH_SPELLS do - if(IsSpellKnown(HEARTH_SPELLS[i])) then - local rightClickSpell = GetSpellInfo(HEARTH_SPELLS[i]) - hearth:SetAttribute("tipExtraText", rightClickSpell) - hearth:SetAttribute("type2", "macro") - hearth:SetAttribute("macrotext2", "/use [nomod] " .. rightClickSpell) - hasRightClick = true; - end - end - end - - -- PROFESSION BUTTONS - local proName, proID - local prof1, prof2, archaeology, _, cooking, firstAid = GetProfessions() - - if(firstAid ~= nil) then - proName, _, _, _, _, _, proID = GetProfessionInfo(firstAid) - CreateMacroToolButton(proName, proID, firstAid) - end - - if(archaeology ~= nil) then - proName, _, _, _, _, _, proID = GetProfessionInfo(archaeology) - CreateMacroToolButton(proName, proID, archaeology) - end - - if(cooking ~= nil) then - proName, _, _, _, _, _, proID = GetProfessionInfo(cooking) - CreateMacroToolButton(proName, proID, cooking) - end - - if(prof2 ~= nil) then - proName, _, _, _, _, _, proID = GetProfessionInfo(prof2) - if(proID ~= 182 and proID ~= 393) then - CreateMacroToolButton(proName, proID, prof2) - end - end - - if(prof1 ~= nil) then - proName, _, _, _, _, _, proID = GetProfessionInfo(prof1) - if(proID ~= 182 and proID ~= 393) then - CreateMacroToolButton(proName, proID, prof1) - end - end - - MOD.ToolBarLoaded = true -end ---[[ -########################################################## -BUILD/UPDATE -########################################################## -]]-- -function MOD:UpdateProfessionTools() - if((not SV.db.SVTools.professions) or self.ToolBarLoaded) then return end - LoadToolBarProfessions() -end - -function MOD:LoadProfessionTools() - if((not SV.db.SVTools.professions) or self.ToolBarLoaded) then return end - SV.Timers:ExecuteTimer(LoadToolBarProfessions, 5) -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tools/components/questwatch.lua b/Interface/AddOns/SVUI/packages/tools/components/questwatch.lua deleted file mode 100644 index 6838c4f..0000000 --- a/Interface/AddOns/SVUI/packages/tools/components/questwatch.lua +++ /dev/null @@ -1,213 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local tinsert = _G.tinsert; -local string = _G.string; -local math = _G.math; -local bit = _G.bit; -local table = _G.table; ---[[ STRING METHODS ]]-- -local lower, upper = string.lower, string.upper; -local find, format, len, split = string.find, string.format, string.len, string.split; -local match, sub, join = string.match, string.sub, string.join; -local gmatch, gsub = string.gmatch, string.gsub; ---[[ MATH METHODS ]]-- -local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; -- Basic -local fmod, modf, sqrt = math.fmod, math.modf, math.sqrt; -- Algebra -local atan2, cos, deg, rad, sin = math.atan2, math.cos, math.deg, math.rad, math.sin; -- Trigonometry -local huge, random = math.huge, math.random; -- Uncommon ---[[ BINARY METHODS ]]-- -local band, bor = bit.band, bit.bor; ---[[ TABLE METHODS ]]-- -local tremove, tcopy, twipe, tsort, tconcat = table.remove, table.copy, table.wipe, table.sort, table.concat; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L - -local MOD = SV.SVTools; -local ObjectiveTrackerFrame = _G.ObjectiveTrackerFrame ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local ICON_FILE = [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-QUESTS]]; ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -local ShowSubDocklet = function(self) - if(InCombatLockdown()) then return end - if(not ObjectiveTrackerFrame:IsShown()) then ObjectiveTrackerFrame:Show() end -end - -local HideSubDocklet = function(self) - if(InCombatLockdown()) then return end - if(ObjectiveTrackerFrame:IsShown()) then ObjectiveTrackerFrame:Hide() end -end - -local UpdateDocklet = function() - local cur = SVUI_QuestWatchFrameScrollBar:GetValue() - if(not InCombatLockdown()) then - ObjectiveTrackerFrame:ClearAllPoints() - ObjectiveTrackerFrame:SetAllPoints(SVUI_QuestWatchFrameScrollFrame) - end - SVUI_QuestWatchFrameScrollBar:SetValue(0) - SVUI_QuestWatchFrameScrollBar:SetValue(cur) -end - -function MOD:LoadQuestWatch() - if(not ObjectiveTrackerFrame) then return end - if(not SV.db.general.questWatch) then - ObjectiveTrackerFrame:RemoveTextures(true) - ObjectiveTrackerFrame.BlocksFrame:RemoveTextures(true) - ObjectiveTrackerFrame.HeaderMenu:RemoveTextures(true) - ObjectiveTrackerFrame.BlockDropDown:RemoveTextures(true) - - if(SV.db.general.questHeaders) then - ObjectiveTrackerFrame.BlocksFrame.QuestHeader:RemoveTextures(true) - ObjectiveTrackerFrame.BlocksFrame.QuestHeader:SetPanelTemplate("Headline", true) - ObjectiveTrackerFrame.BlocksFrame.QuestHeader:SetBackdropColor(0, 0, 0, 0.5) - ObjectiveTrackerFrame.BlocksFrame.QuestHeader.Panel:ClearAllPoints() - ObjectiveTrackerFrame.BlocksFrame.QuestHeader.Panel:SetPoint("TOPLEFT", ObjectiveTrackerFrame.BlocksFrame.QuestHeader, "TOPLEFT", -2, -2) - ObjectiveTrackerFrame.BlocksFrame.QuestHeader.Panel:SetPoint("BOTTOMRIGHT", ObjectiveTrackerFrame.BlocksFrame.QuestHeader, "BOTTOMRIGHT", 12, 2) - - ObjectiveTrackerFrame.BlocksFrame.AchievementHeader:RemoveTextures(true) - ObjectiveTrackerFrame.BlocksFrame.AchievementHeader:SetPanelTemplate("Headline", true) - ObjectiveTrackerFrame.BlocksFrame.AchievementHeader:SetBackdropColor(0, 0, 0, 0.5) - ObjectiveTrackerFrame.BlocksFrame.AchievementHeader.Panel:ClearAllPoints() - ObjectiveTrackerFrame.BlocksFrame.AchievementHeader.Panel:SetPoint("TOPLEFT", ObjectiveTrackerFrame.BlocksFrame.AchievementHeader, "TOPLEFT", -2, -2) - ObjectiveTrackerFrame.BlocksFrame.AchievementHeader.Panel:SetPoint("BOTTOMRIGHT", ObjectiveTrackerFrame.BlocksFrame.AchievementHeader, "BOTTOMRIGHT", 12, 2) - - ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader:RemoveTextures(true) - ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader:SetPanelTemplate("Headline", true) - ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader:SetBackdropColor(0, 0, 0, 0.5) - ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader.Panel:ClearAllPoints() - ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader.Panel:SetPoint("TOPLEFT", ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader, "TOPLEFT", -2, -2) - ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader.Panel:SetPoint("BOTTOMRIGHT", ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader, "BOTTOMRIGHT", 12, 2) - end - else - local bgTex = [[Interface\BUTTONS\WHITE8X8]] - local bdTex = SV.Media.bar.glow - - self.QuestWatch = SV.Dock:NewDocklet("BottomRight", "SVUI_QuestWatchFrame", "Quest Watch", ICON_FILE) - - local WIDTH, HEIGHT = self.QuestWatch:GetSize() - - local listFrame = CreateFrame("ScrollFrame", "SVUI_QuestWatchFrameScrollFrame", self.QuestWatch); - listFrame:SetPoint("TOPLEFT", self.QuestWatch, -62, 0); - listFrame:SetPoint("BOTTOMRIGHT", self.QuestWatch, -31, 21); - listFrame:EnableMouseWheel(true); - - local scrollFrame = CreateFrame("Slider", "SVUI_QuestWatchFrameScrollBar", listFrame); - scrollFrame:SetHeight(listFrame:GetHeight()); - scrollFrame:SetWidth(18); - scrollFrame:SetPoint("TOPRIGHT", self.QuestWatch, "TOPRIGHT", -3, 0); - scrollFrame:SetBackdrop({bgFile = bgTex, edgeFile = bdTex, edgeSize = 4, insets = {left = 3, right = 3, top = 3, bottom = 3}}); - scrollFrame:SetFrameLevel(6) - scrollFrame:SetFixedPanelTemplate("Transparent", true); - scrollFrame:SetThumbTexture("Interface\\Buttons\\UI-ScrollBar-Knob"); - scrollFrame:SetOrientation("VERTICAL"); - scrollFrame:SetValueStep(5); - scrollFrame:SetMinMaxValues(1, 1420); - scrollFrame:SetValue(1); - scrollFrame:SetScript("OnValueChanged", function(self, argValue) - listFrame:SetVerticalScroll(argValue) - end) - - listFrame.slider = scrollFrame; - listFrame:SetScript("OnMouseWheel", function(self, delta) - local scroll = self:GetVerticalScroll(); - local value = (scroll - (20 * delta)); - if value < -1 then - value = 0 - end - if value > 420 then - value = 420 - end - --self:SetVerticalScroll(value) - self.slider:SetValue(value) - end) - - ObjectiveTrackerFrame:ClearAllPoints() - ObjectiveTrackerFrame:SetClampedToScreen(false) - ObjectiveTrackerFrame:SetHeight(1500) - ObjectiveTrackerFrame:SetWidth(WIDTH) - ObjectiveTrackerFrame:SetPoint("TOPRIGHT", listFrame, "TOPRIGHT", -2, 0) - ObjectiveTrackerFrame:SetFrameLevel(listFrame:GetFrameLevel() + 1) - - ObjectiveTrackerFrame:HookScript("OnEvent", UpdateDocklet) - hooksecurefunc(ObjectiveTrackerFrame, "SetPoint", UpdateDocklet) - - -- hooksecurefunc(ObjectiveTrackerFrame, "SetPoint", function(self, a1, p, a2, x, y) - -- if(p ~= SVUI_QuestWatchFrameScrollFrame) then - -- self:SetPoint("TOPRIGHT", SVUI_QuestWatchFrameScrollFrame, "TOPRIGHT", -2, 0) - -- end - -- end) - --ObjectiveTrackerFrame.SetPoint = function() return end; - - ObjectiveTrackerFrame.HeaderMenu.MinimizeButton:Hide() - - ObjectiveTrackerFrame.BlocksFrame:RemoveTextures(true) - ObjectiveTrackerFrame.BlocksFrame:SetPoint("TOPLEFT", ObjectiveTrackerFrame, "TOPLEFT", 87, 0) - ObjectiveTrackerFrame.BlocksFrame:SetPoint("BOTTOMLEFT", ObjectiveTrackerFrame, "BOTTOMLEFT", 87, 0) - ObjectiveTrackerFrame.BlocksFrame:SetWidth(WIDTH) - - ObjectiveTrackerFrame.BlocksFrame.QuestHeader:SetWidth((WIDTH - 60)) - ObjectiveTrackerFrame.BlocksFrame.AchievementHeader:SetWidth((WIDTH - 60)) - ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader:SetWidth((WIDTH - 60)) - - if(SV.db.general.questHeaders) then - ObjectiveTrackerFrame.BlocksFrame.QuestHeader:RemoveTextures(true) - ObjectiveTrackerFrame.BlocksFrame.QuestHeader:SetFixedPanelTemplate("Headline", true) - ObjectiveTrackerFrame.BlocksFrame.QuestHeader:SetBackdropColor(0, 0, 0, 0.5) - - ObjectiveTrackerFrame.BlocksFrame.AchievementHeader:RemoveTextures(true) - ObjectiveTrackerFrame.BlocksFrame.AchievementHeader:SetFixedPanelTemplate("Headline", true) - ObjectiveTrackerFrame.BlocksFrame.AchievementHeader:SetBackdropColor(0, 0, 0, 0.5) - - ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader:RemoveTextures(true) - ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader:SetFixedPanelTemplate("Headline", true) - ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader:SetBackdropColor(0, 0, 0, 0.5) - end - - self.QuestWatch.DockButton:MakeDefault(); - self.QuestWatch:Show(); - self.QuestWatch:SetScript('OnShow', ShowSubDocklet); - self.QuestWatch:SetScript('OnHide', HideSubDocklet); - - listFrame:SetScrollChild(ObjectiveTrackerFrame) - SV.Timers:ExecuteTimer(UpdateDocklet, 3) - end -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tools/components/raidleader.lua b/Interface/AddOns/SVUI/packages/tools/components/raidleader.lua deleted file mode 100644 index 87ec692..0000000 --- a/Interface/AddOns/SVUI/packages/tools/components/raidleader.lua +++ /dev/null @@ -1,235 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L - -local MOD = SV.SVTools; ---[[ -########################################################## -LOCALS -########################################################## -]]-- -local ICON_FILE = [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-RAIDTOOL]]; - -local function CheckRaidStatus() - local inInstance, instanceType = IsInInstance() - if ((IsInGroup() and not IsInRaid()) or UnitIsGroupLeader('player') or UnitIsGroupAssistant("player")) and not (inInstance and (instanceType == "pvp" or instanceType == "arena")) then - return true - else - return false - end -end - -local Button_OnEnter = function(self) - self:SetPanelColor("highlight") -end - -local Button_OnLeave = function(self) - self:SetPanelColor("inverse") - GameTooltip:Hide() -end - -local ToolButton_OnEnter = function(self, ...) - SVUI_RaidToolDockButton:SetPanelColor("highlight") - SVUI_RaidToolDockButton.Icon:SetGradient(unpack(SV.Media.gradient.bizzaro)) - - GameTooltip:SetOwner(self, "ANCHOR_BOTTOMLEFT", 0, 4) - GameTooltip:ClearLines() - GameTooltip:AddDoubleLine("[Left-Click]", RAID_CONTROL, 0, 1, 0, 1, 1, 1) - GameTooltip:Show() -end - -local ToolButton_OnLeave = function(self, ...) - SVUI_RaidToolDockButton:SetPanelColor("default") - SVUI_RaidToolDockButton.Icon:SetGradient(unpack(SV.Media.gradient.icon)) - - GameTooltip:Hide() -end - -local function NewToolButton(name, parent, template, width, height, point, relativeto, point2, xOfs, yOfs, textDisplay) - local button = CreateFrame("Button", name, parent, template) - button:RemoveTextures() - button:Width(width) - button:Height(height) - button:Point(point, relativeto, point2, xOfs, yOfs) - button:SetFramedButtonTemplate() - - if(textDisplay) then - local text = button:CreateFontString(nil,"OVERLAY") - text:SetFont(SV.Media.font.roboto, 14, "NONE") - text:SetAllPoints(button) - text:SetJustifyH("CENTER") - text:SetText(textDisplay) - - button:SetFontString(text) - end - - button:HookScript("OnEnter", Button_OnEnter) - button:HookScript("OnLeave", Button_OnLeave) - - return button; -end - -function MOD:UpdateRaidLeader(event) - if InCombatLockdown() then - self.RaidLeaderNeedsUpdate = true; - self:RegisterEvent("PLAYER_REGEN_ENABLED"); - return - end - if CheckRaidStatus() then - SV.Dock.TopLeft.Bar:Add(self.RaidTool) - if self.RaidTool.Menu.toggled == true then - self.RaidTool.Menu:Show() - else - self.RaidTool.Menu:Hide() - end - else - SV.Dock.TopLeft.Bar:Remove(self.RaidTool) - self.RaidTool.Menu:Hide() - end -end - -function MOD:LoadRaidLeaderTools() - local dock = SV.Dock.TopLeft.Bar - - self.RaidTool = SV.Dock:SetDockButton("TopLeft", RAID_CONTROL, ICON_FILE, nil, "SVUI_RaidToolDockButton"); - self.RaidTool:SetAttribute("hasDropDown", false); - - self.RaidTool.Menu = CreateFrame("Frame", "SVUI_RaidToolMenu", self.RaidTool, "SecureHandlerClickTemplate"); - self.RaidTool.Menu:SetPanelTemplate('Transparent'); - self.RaidTool.Menu:Width(120); - self.RaidTool.Menu:Height(140); - self.RaidTool.Menu:SetPoint("TOPLEFT", dock.ToolBar, "BOTTOMLEFT", 0, -2); - self.RaidTool.Menu:SetFrameLevel(3); - self.RaidTool.Menu.toggled = false; - self.RaidTool.Menu:SetFrameStrata("HIGH"); - - local SVUI_RaidToolToggle = CreateFrame("Button", "SVUI_RaidToolToggle", self.RaidTool, "SecureHandlerClickTemplate") - SVUI_RaidToolToggle:SetAllPoints(self.RaidTool) - SVUI_RaidToolToggle:RemoveTextures() - SVUI_RaidToolToggle:SetNormalTexture("") - SVUI_RaidToolToggle:SetPushedTexture("") - SVUI_RaidToolToggle:SetHighlightTexture("") - SVUI_RaidToolToggle:SetFrameRef("SVUI_RaidToolMenu", SVUI_RaidToolMenu) - SVUI_RaidToolToggle:SetAttribute("_onclick", [=[ - local raidUtil = self:GetFrameRef("SVUI_RaidToolMenu"); - local closeButton = self:GetFrameRef("SVUI_RaidToolCloseButton"); - raidUtil:Show(); - local point = self:GetPoint(); - local raidUtilPoint, raidUtilRelative, closeButtonPoint, closeButtonRelative - if point:find("BOTTOM") then - raidUtilPoint = "BOTTOMLEFT" - raidUtilRelative = "TOPLEFT" - else - raidUtilPoint = "TOPLEFT" - raidUtilRelative = "BOTTOMLEFT" - end - - raidUtil:ClearAllPoints() - closeButton:ClearAllPoints() - raidUtil:SetPoint(raidUtilPoint, self, raidUtilRelative, 2, -2) - closeButton:SetPoint("BOTTOM", raidUtil, "BOTTOM", 0, 2) - ]=]); - SVUI_RaidToolToggle:SetScript("PostClick", function(self) self:RemoveTextures(); SVUI_RaidToolMenu.toggled = true end); - SVUI_RaidToolToggle:HookScript("OnEnter", ToolButton_OnEnter) - SVUI_RaidToolToggle:HookScript("OnLeave", ToolButton_OnLeave) - SV:AddToDisplayAudit(self.RaidTool); - - --Close Button - local close = NewToolButton("SVUI_RaidToolCloseButton", self.RaidTool.Menu, "UIMenuButtonStretchTemplate, SecureHandlerClickTemplate", 30, 18, "BOTTOM", self.RaidTool.Menu, "BOTTOM", 0, 2, "X"); - close:SetAttribute("_onclick", [=[ self:GetParent():Hide(); ]=]); - SVUI_RaidToolToggle:SetFrameRef("SVUI_RaidToolCloseButton", close) - close:SetScript("PostClick", function() SVUI_RaidToolMenu.toggled = false end); - - local disband = NewToolButton("SVUI_RaidToolDisbandButton", self.RaidTool.Menu, "UIMenuButtonStretchTemplate", 109, 18, "TOP", self.RaidTool.Menu, "TOP", 0, -5, L['Disband Group']) - disband:SetScript("OnMouseUp", function(self) - if CheckRaidStatus() then - SV:StaticPopup_Show("DISBAND_RAID") - end - end) - - local rolecheck = NewToolButton("SVUI_RaidToolRoleButton", self.RaidTool.Menu, "UIMenuButtonStretchTemplate", 109, 18, "TOP", disband, "BOTTOM", 0, -5, ROLE_POLL) - rolecheck:SetScript("OnMouseUp", function(self) - if CheckRaidStatus() then - InitiateRolePoll() - end - end) - - local ready = NewToolButton("SVUI_RaidToolReadyButton", self.RaidTool.Menu, "UIMenuButtonStretchTemplate", 109, 18, "TOP", rolecheck, "BOTTOM", 0, -5, READY_CHECK) - ready:SetScript("OnMouseUp", function(self) - if CheckRaidStatus() then - DoReadyCheck() - end - end) - - local control = NewToolButton("SVUI_RaidToolControlButton", self.RaidTool.Menu, "UIMenuButtonStretchTemplate", 109, 18, "TOP", ready, "BOTTOM", 0, -5, L['Raid Menu']) - control:SetScript("OnMouseUp", function(self) - ToggleFriendsFrame(4) - end) - - local markerButton = _G["CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton"]; - local oldReadyCheck = _G["CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateReadyCheck"]; - local oldRollCheck = _G["CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateRolePoll"]; - - if(markerButton) then - markerButton:ClearAllPoints() - markerButton:SetPoint("TOP", control, "BOTTOM", 0, -5) - markerButton:SetParent(self.RaidTool.Menu) - markerButton:Height(18) - markerButton:SetWidth(109) - markerButton:RemoveTextures() - markerButton:SetFramedButtonTemplate() - - local markersText = markerButton:CreateFontString(nil,"OVERLAY") - markersText:SetFont(SV.Media.font.roboto, 14, "NONE") - markersText:SetAllPoints(markerButton) - markersText:SetJustifyH("CENTER") - markersText:SetText("World Markers") - - markerButton:SetFontString(markersText) - - markerButton:HookScript("OnEnter", Button_OnEnter) - markerButton:HookScript("OnLeave", Button_OnLeave) - end - - if(oldReadyCheck) then - oldReadyCheck:ClearAllPoints() - oldReadyCheck:SetPoint("BOTTOMLEFT", CompactRaidFrameManagerDisplayFrameLockedModeToggle, "TOPLEFT", 0, 1) - oldReadyCheck:SetPoint("BOTTOMRIGHT", CompactRaidFrameManagerDisplayFrameHiddenModeToggle, "TOPRIGHT", 0, 1) - if(oldRollCheck) then - oldRollCheck:ClearAllPoints() - oldRollCheck:SetPoint("BOTTOMLEFT", oldReadyCheck, "TOPLEFT", 0, 1) - oldRollCheck:SetPoint("BOTTOMRIGHT", oldReadyCheck, "TOPRIGHT", 0, 1) - end - end - - self:RegisterEvent("GROUP_ROSTER_UPDATE", "UpdateRaidLeader") - self:RegisterEvent("PLAYER_ENTERING_WORLD", "UpdateRaidLeader") - self:UpdateRaidLeader() -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua index ae3c12e..ae8ca19 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua @@ -68,8 +68,6 @@ local MOD = SV:NewPackage("SVUnit", L["UnitFrames"]) MOD.Units = {} MOD.Headers = {} MOD.Dispellable = {} - -oUF_Villain.SVConfigs = {} --[[ ########################################################## LOCALS @@ -84,7 +82,7 @@ local ReversedUnit = { ["focustarget"] = true, ["boss"] = true, ["arena"] = true, -} +}; do local hugeMath = math.huge @@ -231,8 +229,8 @@ end function MOD:GetActiveSize(db, token) local width, height, best = 0,0,0 - if(SV.db.SVUnit.grid.enable and db.gridAllowed) then - width = SV.db.SVUnit.grid.size + if(db.grid and db.grid.enable) then + width = db.grid.size height = width best = width elseif(db) then @@ -270,10 +268,6 @@ function MOD:RefreshUnitColors() end local r, g, b = db.health[1], db.health[2], db.health[3] oUF_Villain.colors.smooth = {1, 0, 0, 1, 1, 0, r, g, b} - - oUF_Villain.SVConfigs.classbackdrop = SV.db.SVUnit.classbackdrop - oUF_Villain.SVConfigs.healthclass = SV.db.SVUnit.healthclass - oUF_Villain.SVConfigs.colorhealthbyvalue = SV.db.SVUnit.colorhealthbyvalue end function MOD:RefreshAllUnitMedia() @@ -331,36 +325,31 @@ function MOD:RefreshUnitMedia(unitName) if(not (db and db.enable) or not self) then return end local CURRENT_BAR_TEXTURE = LSM:Fetch("statusbar", db.statusbar) local CURRENT_AURABAR_TEXTURE = LSM:Fetch("statusbar", db.auraBarStatusbar); - local CURRENT_FONT = LSM:Fetch("font", db.font) local CURRENT_AURABAR_FONT = LSM:Fetch("font", db.auraFont); local CURRENT_AURABAR_FONTSIZE = db.auraFontSize local CURRENT_AURABAR_FONTOUTLINE = db.auraFontOutline local unitDB = db[key] if(unitDB and unitDB.enable) then - local panel = self.InfoPanel + local panel = self.TextGrip if(panel) then if(panel.Name and unitDB.name) then - if(db.grid.enable and unitDB.gridAllowed) then + if(unitDB.grid and unitDB.grid.enable) then panel.Name:SetFont(SV.Media.font.pixel, 8, "MONOCHROMEOUTLINE") panel.Name:SetShadowOffset(1, -1) panel.Name:SetShadowColor(0, 0, 0, 0.75) else panel.Name:SetFont(LSM:Fetch("font", unitDB.name.font), unitDB.name.fontSize, unitDB.name.fontOutline) - panel.Name:SetShadowOffset(2, -2) - panel.Name:SetShadowColor(0, 0, 0, 1) + if(unitDB.name.fontOutline == 'NONE') then + panel.Name:SetShadowOffset(1, -1) + panel.Name:SetShadowColor(0, 0, 0, 1) + else + panel.Name:SetShadowOffset(2, -2) + panel.Name:SetShadowColor(0, 0, 0, 0.75) + end end end - if(panel.Health) then - panel.Health:SetFont(CURRENT_FONT, db.fontSize, db.fontOutline) - end - if(panel.Power) then - panel.Power:SetFont(CURRENT_FONT, db.fontSize, db.fontOutline) - end - if(panel.Misc) then - panel.Misc:SetFont(CURRENT_FONT, db.fontSize, db.fontOutline) - end end - if(self.Health and (unitDB.health and unitDB.health.enable)) then + if(self.Health) then self.Health:SetStatusBarTexture(CURRENT_BAR_TEXTURE) end if(self.Power and (unitDB.power and unitDB.power.enable)) then @@ -378,9 +367,6 @@ function MOD:RefreshUnitMedia(unitName) if(self.AuraBars and (unitDB.aurabar and unitDB.aurabar.enable)) then local ab = self.AuraBars ab.auraBarTexture = CURRENT_AURABAR_TEXTURE - ab.textFont = CURRENT_AURABAR_FONT - ab.textSize = db.auraFontSize - ab.textOutline = db.auraFontOutline ab.buffColor = oUF_Villain.colors.buff_bars if SV.db.SVUnit.auraBarByType then @@ -391,23 +377,6 @@ function MOD:RefreshUnitMedia(unitName) ab.defaultDebuffColor = nil end end - if(self.Buffs and (unitDB.buffs and unitDB.buffs.enable)) then - local buffs = self.Buffs - buffs.textFont = CURRENT_AURABAR_FONT - buffs.textSize = db.auraFontSize - buffs.textOutline = db.auraFontOutline - end - if(self.Debuffs and (unitDB.debuffs and unitDB.debuffs.enable)) then - local debuffs = self.Debuffs - debuffs.textFont = CURRENT_AURABAR_FONT - debuffs.textSize = db.auraFontSize - debuffs.textOutline = db.auraFontOutline - end - if(self.RaidDebuffs and (unitDB.rdebuffs and unitDB.rdebuffs.enable)) then - local rdebuffs = self.RaidDebuffs; - rdebuffs.count:SetFont(CURRENT_AURABAR_FONT, db.auraFontSize, db.auraFontOutline) - rdebuffs.time:SetFont(CURRENT_AURABAR_FONT, db.auraFontSize, db.auraFontOutline) - end end end @@ -425,51 +394,70 @@ function MOD:RefreshUnitLayout(frame, template) BOTTOM_MODIFIER = 1 end - local UNIT_WIDTH, UNIT_HEIGHT, BEST_SIZE = self:GetActiveSize(db) - local POWER_HEIGHT = (db.power and db.power.enable) and (db.power.height - 1) or 1; - local PORTRAIT_WIDTH = (1 * TOP_MODIFIER) - local GRID_MODE = (SV.db.SVUnit.grid.enable and db.gridAllowed) or false - local MINI_GRID = (GRID_MODE and SV.db.SVUnit.grid.size < 26) or false + local MASTER_GRIP = frame.MasterGrip; + local TEXT_GRIP = frame.TextGrip; - local healthPanel = frame.HealthPanel - local infoPanel = frame.InfoPanel - local portraitOverlay = false - local overlayAnimation = false + local UNIT_WIDTH, UNIT_HEIGHT, BEST_SIZE = self:GetActiveSize(db); + local GRID_MODE = (db.grid and db.grid.enable); + local MINI_GRID = (GRID_MODE and BEST_SIZE < 26); - if(db.portrait and db.portrait.enable) then - if(not db.portrait.overlay) then - PORTRAIT_WIDTH = ((db.portrait.width * TOP_MODIFIER) + (1 * TOP_MODIFIER)) - else - portraitOverlay = true - overlayAnimation = SV.db.SVUnit.overlayAnimation - end + local POWER_GRIP = frame.Power; + local POWER_ENABLED = false; + local POWER_HEIGHT = 1; + if(POWER_GRIP and db.power) then + POWER_ENABLED = (GRID_MODE and db.grid.powerEnable) or db.power.enable; + POWER_HEIGHT = POWER_ENABLED and (db.power.height - 1) or 1; end - if GRID_MODE then portraitOverlay = false end + local PORTRAIT_GRIP = false; + local PORTRAIT_ENABLED = false; + local PORTRAIT_OVERLAY = false; + local PORTRAIT_OVERLAY_ANIMATION = false; + local PORTRAIT_WIDTH = (1 * TOP_MODIFIER); + local PORTRAIT_STYLE = 'None'; + if(db.portrait) then + PORTRAIT_ENABLED = (not GRID_MODE and db.portrait.enable); + PORTRAIT_OVERLAY = (not GRID_MODE and PORTRAIT_ENABLED and db.portrait.overlay); + PORTRAIT_OVERLAY_ANIMATION = (PORTRAIT_OVERLAY) and SV.db.SVUnit.overlayAnimation or false; + if(PORTRAIT_ENABLED and (not PORTRAIT_OVERLAY)) then + PORTRAIT_WIDTH = ((db.portrait.width * TOP_MODIFIER) + (1 * TOP_MODIFIER)); + end + PORTRAIT_STYLE = db.portrait.style; - if frame.Portrait then - frame.Portrait:Hide() - frame.Portrait:ClearAllPoints() - end - if db.portrait and frame.PortraitTexture and frame.PortraitModel then - if db.portrait.style == '2D' then - frame.Portrait = frame.PortraitTexture - else - frame.PortraitModel.UserRotation = db.portrait.rotation; - frame.PortraitModel.UserCamDistance = db.portrait.camDistanceScale; - frame.Portrait = frame.PortraitModel + if(frame.Portrait) then + frame.Portrait:Hide() + frame.Portrait:ClearAllPoints() + end + if(frame.PortraitTexture and frame.PortraitModel) then + if(PORTRAIT_STYLE == '2D') then + frame.Portrait = frame.PortraitTexture + else + frame.PortraitModel.UserRotation = db.portrait.rotation; + frame.PortraitModel.UserCamDistance = db.portrait.camDistanceScale; + frame.Portrait = frame.PortraitModel + end end - end - healthPanel:ClearAllPoints() - healthPanel:Point(TOP_ANCHOR1, frame, TOP_ANCHOR1, (1 * BOTTOM_MODIFIER), -1) - healthPanel:Point(BOTTOM_ANCHOR1, frame, BOTTOM_ANCHOR1, PORTRAIT_WIDTH, POWER_HEIGHT) + PORTRAIT_GRIP = frame.Portrait; + end + + local BUFF_GRIP = frame.Buffs; + local BUFF_ENABLED = (db.buffs and db.buffs.enable) or false; + local DEBUFF_GRIP = frame.Debuffs; + local DEBUFF_ENABLED = (db.debuffs and db.debuffs.enable) or false; + local AURABAR_GRIP = frame.AuraBars; + local AURABAR_ENABLED = (db.aurabar and db.aurabar.enable) or false; + + + MASTER_GRIP:ClearAllPoints(); + MASTER_GRIP:SetPointToScale(TOP_ANCHOR1, frame, TOP_ANCHOR1, (1 * BOTTOM_MODIFIER), -1); + MASTER_GRIP:SetPointToScale(BOTTOM_ANCHOR1, frame, BOTTOM_ANCHOR1, PORTRAIT_WIDTH, POWER_HEIGHT); if(frame.StatusPanel) then if(template ~= "player" and template ~= "pet" and template ~= "target" and template ~= "targettarget" and template ~= "focus" and template ~= "focustarget") then - local size = healthPanel:GetHeight() + local size = MASTER_GRIP:GetHeight() frame.StatusPanel:SetSize(size, size) - frame.StatusPanel:SetPoint("CENTER", healthPanel, "CENTER", 0, 0) + frame.StatusPanel:SetPoint("CENTER", MASTER_GRIP, "CENTER", 0, 0) end end @@ -491,33 +479,31 @@ function MOD:RefreshUnitLayout(frame, template) if frame.TargetGlow then local glow = frame.TargetGlow; glow:ClearAllPoints() - glow:Point("TOPLEFT", -3, 3) - glow:Point("TOPRIGHT", 3, 3) - glow:Point("BOTTOMLEFT", -3, -3) - glow:Point("BOTTOMRIGHT", 3, -3) + glow:SetPointToScale("TOPLEFT", -3, 3) + glow:SetPointToScale("TOPRIGHT", 3, 3) + glow:SetPointToScale("BOTTOMLEFT", -3, -3) + glow:SetPointToScale("BOTTOMRIGHT", 3, -3) end --[[ INFO TEXTS ]]-- local point,cX,cY; - if(infoPanel.Name and db.name) then - local nametext = infoPanel.Name + if(TEXT_GRIP.Name and db.name) then + local nametext = TEXT_GRIP.Name if(GRID_MODE) then - if(SV.db.SVUnit.grid.shownames and SV.db.SVUnit.grid.size >= 30) then - if(not nametext:IsShown()) then nametext:Show() end - nametext:Point("CENTER", frame, "CENTER", 0, 0) - nametext:SetJustifyH("CENTER") - nametext:SetJustifyV("MIDDLE") + nametext:ClearAllPoints() + nametext:SetPointToScale("CENTER", frame, "CENTER", 0, 0) + nametext:SetJustifyH("CENTER") + nametext:SetJustifyV("MIDDLE") + if(db.name.tags ~= nil and db.name.tags ~= '') then frame:Tag(nametext, "[name:grid]") - else - nametext:Hide() end else point = db.name.position cX = db.name.xOffset cY = db.name.yOffset nametext:ClearAllPoints() - SV:SetReversePoint(nametext, point, infoPanel, cX, cY) + SV:SetReversePoint(nametext, point, TEXT_GRIP, cX, cY) if(nametext.initialAnchor:find("RIGHT")) then nametext:SetJustifyH("RIGHT") @@ -539,49 +525,49 @@ function MOD:RefreshUnitLayout(frame, template) end end - if(frame.Health and infoPanel.Health and db.health) then + if(frame.Health and TEXT_GRIP.Health and db.health) then if(GRID_MODE) then - infoPanel.Health:Hide() + TEXT_GRIP.Health:Hide() else - if(not infoPanel.Health:IsShown()) then infoPanel.Health:Show() end - local healthtext = infoPanel.Health + if(not TEXT_GRIP.Health:IsShown()) then TEXT_GRIP.Health:Show() end + local healthtext = TEXT_GRIP.Health point = db.health.position cX = db.health.xOffset cY = db.health.yOffset healthtext:ClearAllPoints() - SV:SetReversePoint(healthtext, point, infoPanel, cX, cY) + SV:SetReversePoint(healthtext, point, TEXT_GRIP, cX, cY) frame:Tag(healthtext, db.health.tags) end end - if(frame.Power and infoPanel.Power and db.power) then + if(POWER_GRIP and TEXT_GRIP.Power and db.power) then if(GRID_MODE) then - infoPanel.Power:Hide() + TEXT_GRIP.Power:Hide() else - if(not infoPanel.Power:IsShown()) then infoPanel.Power:Show() end - local powertext = infoPanel.Power - if db.power.tags ~= nil and db.power.tags ~= '' then + if(not TEXT_GRIP.Power:IsShown()) then TEXT_GRIP.Power:Show() end + local powertext = TEXT_GRIP.Power + if(db.power.tags ~= nil and db.power.tags ~= '') then point = db.power.position cX = db.power.xOffset cY = db.power.yOffset powertext:ClearAllPoints() - SV:SetReversePoint(powertext, point, infoPanel, cX, cY) + SV:SetReversePoint(powertext, point, TEXT_GRIP, cX, cY) if db.power.attachTextToPower then - powertext:SetParent(frame.Power) + powertext:SetParent(POWER_GRIP) else - powertext:SetParent(infoPanel) + powertext:SetParent(TEXT_GRIP) end end frame:Tag(powertext, db.power.tags) end end - if(infoPanel.Misc and db.misc) then + if(TEXT_GRIP.Misc and db.misc) then if(GRID_MODE) then - infoPanel.Misc:Hide() + TEXT_GRIP.Misc:Hide() else - if(not infoPanel.Misc:IsShown()) then infoPanel.Misc:Show() end - frame:Tag(infoPanel.Misc, db.misc.tags) + if(not TEXT_GRIP.Misc:IsShown()) then TEXT_GRIP.Misc:Show() end + frame:Tag(TEXT_GRIP.Misc, db.misc.tags) end end @@ -599,40 +585,30 @@ function MOD:RefreshUnitLayout(frame, template) health.colorSmooth = nil; health.colorHealth = nil; health.colorClass = nil; + health.colorBackdrop = nil; health.colorReaction = nil; health.colorOverlay = nil; - health.overlayAnimation = overlayAnimation + health.overlayAnimation = PORTRAIT_OVERLAY_ANIMATION; if((not GRID_MODE) and frame.HealPrediction) then frame.HealPrediction["frequentUpdates"] = health.frequentUpdates end - if((not GRID_MODE) and portraitOverlay and SV.db.SVUnit.forceHealthColor) then + + if((not GRID_MODE) and PORTRAIT_OVERLAY and SV.db.SVUnit.forceHealthColor) then health.colorOverlay = true; else - if(GRID_MODE or (db.colorOverride and db.colorOverride == "FORCE_ON")) then - health.colorClass = true; - health.colorReaction = true - elseif(db.colorOverride and db.colorOverride == "FORCE_OFF") then - if SV.db.SVUnit.colorhealthbyvalue == true then - health.colorSmooth = true - else - health.colorHealth = true - end - else - if(not SV.db.SVUnit.healthclass) then - if SV.db.SVUnit.colorhealthbyvalue == true then - health.colorSmooth = true - else - health.colorHealth = true - end - else - health.colorClass = true; - health.colorReaction = true - end - end + local CLASSCOLOR = db.health.classColor or false; + local VALUECOLOR = (not CLASSCOLOR and db.health.valueColor) or false; + + health.colorClass = CLASSCOLOR; + health.colorReaction = CLASSCOLOR; + health.colorSmooth = VALUECOLOR; + health.colorHealth = ((not CLASSCOLOR) and (not VALUECOLOR)) or false; + health.colorBackdrop = (CLASSCOLOR and db.health.classBackdrop) or false; end + health:ClearAllPoints() - health:SetAllPoints(healthPanel) + health:SetAllPoints(MASTER_GRIP) health.gridMode = GRID_MODE; @@ -640,63 +616,60 @@ function MOD:RefreshUnitLayout(frame, template) health:SetOrientation(GRID_MODE and "VERTICAL" or db.health.orientation) end - self:RefreshHealthBar(frame, portraitOverlay) + self:RefreshHealthBar(frame, PORTRAIT_OVERLAY) end --[[ POWER LAYOUT ]]-- do - if frame.Power then - local power = frame.Power; - if db.power.enable then - if not frame:IsElementEnabled('Power')then + if(POWER_GRIP) then + if(POWER_ENABLED) then + if(not frame:IsElementEnabled('Power')) then frame:EnableElement('Power') - power:Show() + POWER_GRIP:Show() end - power.Smooth = SV.db.SVUnit.smoothbars; + POWER_GRIP.Smooth = SV.db.SVUnit.smoothbars; - power.colorClass = nil; - power.colorReaction = nil; - power.colorPower = nil; - if SV.db.SVUnit.powerclass then - power.colorClass = true; - power.colorReaction = true - else - power.colorPower = true - end - if(db.power.frequentUpdates) then - power.frequentUpdates = db.power.frequentUpdates - end - power:ClearAllPoints() - power:Height(POWER_HEIGHT - 2) - power:Point(BOTTOM_ANCHOR1, frame, BOTTOM_ANCHOR1, (PORTRAIT_WIDTH - (1 * BOTTOM_MODIFIER)), 2) - power:Point(BOTTOM_ANCHOR2, frame, BOTTOM_ANCHOR2, (2 * BOTTOM_MODIFIER), 2) - elseif frame:IsElementEnabled('Power')then + POWER_GRIP.colorClass = nil; + POWER_GRIP.colorReaction = nil; + POWER_GRIP.colorPower = nil; + + local CLASSCOLOR = db.power.classColor or false; + POWER_GRIP.colorClass = CLASSCOLOR; + POWER_GRIP.colorReaction = CLASSCOLOR; + POWER_GRIP.colorPower = (not CLASSCOLOR); + POWER_GRIP.frequentUpdates = db.power.frequentUpdates; + + POWER_GRIP:ClearAllPoints() + POWER_GRIP:SetHeightToScale(POWER_HEIGHT - 2) + POWER_GRIP:SetPointToScale(BOTTOM_ANCHOR1, frame, BOTTOM_ANCHOR1, (PORTRAIT_WIDTH - (1 * BOTTOM_MODIFIER)), 2) + POWER_GRIP:SetPointToScale(BOTTOM_ANCHOR2, frame, BOTTOM_ANCHOR2, (2 * BOTTOM_MODIFIER), 2) + elseif(frame:IsElementEnabled('Power')) then frame:DisableElement('Power') - power:Hide() + POWER_GRIP:Hide() end end --[[ ALTPOWER LAYOUT ]]-- - if frame.AltPowerBar then + if(frame.AltPowerBar) then local altPower = frame.AltPowerBar; local Alt_OnShow = function() - healthPanel:Point(TOP_ANCHOR2, PORTRAIT_WIDTH, -(POWER_HEIGHT + 1)) + MASTER_GRIP:SetPointToScale(TOP_ANCHOR2, PORTRAIT_WIDTH, -(POWER_HEIGHT + 1)) end local Alt_OnHide = function() - healthPanel:Point(TOP_ANCHOR2, PORTRAIT_WIDTH, -1) + MASTER_GRIP:SetPointToScale(TOP_ANCHOR2, PORTRAIT_WIDTH, -1) altPower.text:SetText("") end if db.power.enable then frame:EnableElement('AltPowerBar') - if(infoPanel.Health) then - altPower.text:SetFont(infoPanel.Health:GetFont()) + if(TEXT_GRIP.Health) then + altPower.text:SetFont(TEXT_GRIP.Health:GetFont()) end altPower.text:SetAlpha(1) - altPower:Point(TOP_ANCHOR2, frame, TOP_ANCHOR2, PORTRAIT_WIDTH, -1) - altPower:Point(TOP_ANCHOR1, frame, TOP_ANCHOR1, (1 * BOTTOM_MODIFIER), -1) + altPower:SetPointToScale(TOP_ANCHOR2, frame, TOP_ANCHOR2, PORTRAIT_WIDTH, -1) + altPower:SetPointToScale(TOP_ANCHOR1, frame, TOP_ANCHOR1, (1 * BOTTOM_MODIFIER), -1) altPower:SetHeight(POWER_HEIGHT) altPower.Smooth = SV.db.SVUnit.smoothbars; altPower:HookScript("OnShow", Alt_OnShow) @@ -711,50 +684,50 @@ function MOD:RefreshUnitLayout(frame, template) --[[ PORTRAIT LAYOUT ]]-- - if db.portrait and frame.Portrait then + if(PORTRAIT_GRIP) then local portrait = frame.Portrait; - if(not GRID_MODE and db.portrait.enable) then - portrait:Show() + if(PORTRAIT_ENABLED) then + PORTRAIT_GRIP:Show() if not frame:IsElementEnabled('Portrait')then frame:EnableElement('Portrait') end - portrait:ClearAllPoints() - portrait:SetAlpha(1) + PORTRAIT_GRIP:ClearAllPoints() + PORTRAIT_GRIP:SetAlpha(1) - if db.portrait.overlay then - if db.portrait.style == '3D' then - portrait:SetFrameLevel(frame.ActionPanel:GetFrameLevel()) - portrait:SetCamDistanceScale(db.portrait.camDistanceScale) - elseif db.portrait.style == '2D' then - portrait.anchor:SetFrameLevel(frame.ActionPanel:GetFrameLevel()) + if(PORTRAIT_OVERLAY) then + if(PORTRAIT_STYLE == '3D') then + PORTRAIT_GRIP:SetFrameLevel(frame.ActionPanel:GetFrameLevel()) + PORTRAIT_GRIP:SetCamDistanceScale(db.portrait.camDistanceScale) + elseif(PORTRAIT_STYLE == '2D') then + PORTRAIT_GRIP.anchor:SetFrameLevel(frame.ActionPanel:GetFrameLevel()) end - portrait:Point(TOP_ANCHOR2, healthPanel, TOP_ANCHOR2, (1 * TOP_MODIFIER), -1) - portrait:Point(BOTTOM_ANCHOR2, healthPanel, BOTTOM_ANCHOR2, (1 * BOTTOM_MODIFIER), 1) + PORTRAIT_GRIP:SetPointToScale(TOP_ANCHOR2, MASTER_GRIP, TOP_ANCHOR2, (1 * TOP_MODIFIER), -1) + PORTRAIT_GRIP:SetPointToScale(BOTTOM_ANCHOR2, MASTER_GRIP, BOTTOM_ANCHOR2, (1 * BOTTOM_MODIFIER), 1) - portrait.Panel:Show() + PORTRAIT_GRIP.Panel:Show() else - portrait.Panel:Show() - if db.portrait.style == '3D' then - portrait:SetFrameLevel(frame.ActionPanel:GetFrameLevel()) - portrait:SetCamDistanceScale(db.portrait.camDistanceScale) - elseif db.portrait.style == '2D' then - portrait.anchor:SetFrameLevel(frame.ActionPanel:GetFrameLevel()) + PORTRAIT_GRIP.Panel:Show() + if(PORTRAIT_STYLE == '3D') then + PORTRAIT_GRIP:SetFrameLevel(frame.ActionPanel:GetFrameLevel()) + PORTRAIT_GRIP:SetCamDistanceScale(db.portrait.camDistanceScale) + elseif(PORTRAIT_STYLE == '2D') then + PORTRAIT_GRIP.anchor:SetFrameLevel(frame.ActionPanel:GetFrameLevel()) end - if not frame.Power or not db.power.enable then - portrait:Point(TOP_ANCHOR2, frame, TOP_ANCHOR2, (1 * TOP_MODIFIER), -1) - portrait:Point(BOTTOM_ANCHOR2, healthPanel, BOTTOM_ANCHOR1, (4 * BOTTOM_MODIFIER), 0) + if(not POWER_ENABLED) then + PORTRAIT_GRIP:SetPointToScale(TOP_ANCHOR2, frame, TOP_ANCHOR2, (1 * TOP_MODIFIER), -1) + PORTRAIT_GRIP:SetPointToScale(BOTTOM_ANCHOR2, MASTER_GRIP, BOTTOM_ANCHOR1, (4 * BOTTOM_MODIFIER), 0) else - portrait:Point(TOP_ANCHOR2, frame, TOP_ANCHOR2, (1 * TOP_MODIFIER), -1) - portrait:Point(BOTTOM_ANCHOR2, frame.Power, BOTTOM_ANCHOR1, (4 * BOTTOM_MODIFIER), 0) + PORTRAIT_GRIP:SetPointToScale(TOP_ANCHOR2, frame, TOP_ANCHOR2, (1 * TOP_MODIFIER), -1) + PORTRAIT_GRIP:SetPointToScale(BOTTOM_ANCHOR2, POWER_GRIP, BOTTOM_ANCHOR1, (4 * BOTTOM_MODIFIER), 0) end end else - portrait:Hide() - portrait.Panel:Hide() + PORTRAIT_GRIP:Hide() + PORTRAIT_GRIP.Panel:Hide() if frame:IsElementEnabled('Portrait') then frame:DisableElement('Portrait') @@ -764,7 +737,7 @@ function MOD:RefreshUnitLayout(frame, template) --[[ CASTBAR LAYOUT ]]-- - if db.castbar and frame.Castbar then + if(db.castbar and frame.Castbar) then local castbar = frame.Castbar; local castHeight = db.castbar.height; local castWidth @@ -773,7 +746,7 @@ function MOD:RefreshUnitLayout(frame, template) else castWidth = db.castbar.width end - local sparkSize = castHeight * 4; + local sparkSize = castHeight * 3; local adjustedWidth = castWidth - 2; local lazerScale = castHeight * 1.8; @@ -790,14 +763,14 @@ function MOD:RefreshUnitLayout(frame, template) castbar.Spark:SetSize(sparkSize, sparkSize) if castbar.Spark[1] and castbar.Spark[2] then castbar.Spark[1]:SetAllPoints(castbar.Spark) - castbar.Spark[2]:FillInner(castbar.Spark, 4, 4) + castbar.Spark[2]:SetAllPointsIn(castbar.Spark, 4, 4) end castbar.Spark.SetHeight = SV.fubar end castbar:SetFrameStrata("HIGH") if castbar.Holder then - castbar.Holder:Width(castWidth + 2) - castbar.Holder:Height(castHeight + 6) + castbar.Holder:SetWidthToScale(castWidth + 2) + castbar.Holder:SetHeightToScale(castHeight + 6) local holderUpdate = castbar.Holder:GetScript('OnSizeChanged') if holderUpdate then holderUpdate(castbar.Holder) @@ -813,8 +786,8 @@ function MOD:RefreshUnitLayout(frame, template) end if castbar.Organizer then - castbar.Organizer:Width(castHeight + 2) - castbar.Organizer:Height(castHeight + 2) + castbar.Organizer:SetWidthToScale(castHeight + 2) + castbar.Organizer:SetHeightToScale(castHeight + 2) end if castbar.Icon then @@ -847,9 +820,9 @@ function MOD:RefreshUnitLayout(frame, template) --[[ AURA LAYOUT ]]-- - if frame.Buffs and frame.Debuffs then + if(BUFF_GRIP or DEBUFF_GRIP) then do - if db.debuffs.enable or db.buffs.enable then + if(BUFF_ENABLED or DEBUFF_ENABLED) then if not frame:IsElementEnabled('Aura')then frame:EnableElement('Aura') end @@ -857,88 +830,88 @@ function MOD:RefreshUnitLayout(frame, template) if frame:IsElementEnabled('Aura')then frame:DisableElement('Aura') end - end - frame.Buffs:ClearAllPoints() - frame.Debuffs:ClearAllPoints() + end end - do + if(BUFF_GRIP) then local buffs = frame.Buffs; local numRows = db.buffs.numrows; local perRow = db.buffs.perrow; local buffCount = perRow * numRows; - buffs.forceShow = frame.forceShowAuras; - buffs.num = GRID_MODE and 0 or buffCount; + BUFF_GRIP.forceShow = frame.forceShowAuras; + BUFF_GRIP.num = GRID_MODE and 0 or buffCount; - local tempSize = (((UNIT_WIDTH + 2) - (buffs.spacing * (perRow - 1))) / perRow); + local tempSize = (((UNIT_WIDTH + 2) - (BUFF_GRIP.spacing * (perRow - 1))) / perRow); local auraSize = min(BEST_SIZE, tempSize) + --print(template .. ' ' .. auraSize .. ' / ' .. tempSize) if(db.buffs.sizeOverride and db.buffs.sizeOverride > 0) then auraSize = db.buffs.sizeOverride - buffs:SetWidth(perRow * db.buffs.sizeOverride) + BUFF_GRIP:SetWidth(perRow * db.buffs.sizeOverride) end - buffs.size = auraSize; + BUFF_GRIP.size = auraSize; local attachTo = FindAnchorFrame(frame, db.buffs.attachTo, db.debuffs.attachTo == 'BUFFS' and db.buffs.attachTo == 'DEBUFFS') - - SV:SetReversePoint(buffs, db.buffs.anchorPoint, attachTo, db.buffs.xOffset + BOTTOM_MODIFIER, db.buffs.yOffset) - buffs:SetWidth((auraSize + buffs.spacing) * perRow) - buffs:Height((auraSize + buffs.spacing) * numRows) - buffs["growth-y"] = db.buffs.verticalGrowth; - buffs["growth-x"] = db.buffs.horizontalGrowth; - - if db.buffs.enable then - buffs:Show() + BUFF_GRIP:ClearAllPoints() + SV:SetReversePoint(BUFF_GRIP, db.buffs.anchorPoint, attachTo, db.buffs.xOffset + BOTTOM_MODIFIER, db.buffs.yOffset) + BUFF_GRIP:SetWidth((auraSize + BUFF_GRIP.spacing) * perRow) + BUFF_GRIP:SetHeightToScale((auraSize + BUFF_GRIP.spacing) * numRows) + BUFF_GRIP["growth-y"] = db.buffs.verticalGrowth; + BUFF_GRIP["growth-x"] = db.buffs.horizontalGrowth; + + if(BUFF_ENABLED) then + BUFF_GRIP:Show() else - buffs:Hide() + BUFF_GRIP:Hide() end - end - do - local debuffs = frame.Debuffs; + end + + if(DEBUFF_GRIP) then local numRows = db.debuffs.numrows; local perRow = db.debuffs.perrow; local debuffCount = perRow * numRows; - debuffs.forceShow = frame.forceShowAuras; - debuffs.num = GRID_MODE and 0 or debuffCount; + DEBUFF_GRIP.forceShow = frame.forceShowAuras; + DEBUFF_GRIP.num = GRID_MODE and 0 or debuffCount; - local tempSize = (((UNIT_WIDTH + 2) - (debuffs.spacing * (perRow - 1))) / perRow); - local auraSize = min(BEST_SIZE,tempSize) + local tempSize = (((UNIT_WIDTH + 2) - (DEBUFF_GRIP.spacing * (perRow - 1))) / perRow); + local auraSize = min(BEST_SIZE, tempSize) if(db.debuffs.sizeOverride and db.debuffs.sizeOverride > 0) then auraSize = db.debuffs.sizeOverride - debuffs:SetWidth(perRow * db.debuffs.sizeOverride) + DEBUFF_GRIP:SetWidth(perRow * db.debuffs.sizeOverride) end - debuffs.size = auraSize; + DEBUFF_GRIP.size = auraSize; local attachTo = FindAnchorFrame(frame, db.debuffs.attachTo, db.debuffs.attachTo == 'BUFFS' and db.buffs.attachTo == 'DEBUFFS') - - SV:SetReversePoint(debuffs, db.debuffs.anchorPoint, attachTo, db.debuffs.xOffset + BOTTOM_MODIFIER, db.debuffs.yOffset) - debuffs:SetWidth((auraSize + debuffs.spacing) * perRow) - debuffs:Height((auraSize + debuffs.spacing) * numRows) - debuffs["growth-y"] = db.debuffs.verticalGrowth; - debuffs["growth-x"] = db.debuffs.horizontalGrowth; - - if db.debuffs.enable then - debuffs:Show() + DEBUFF_GRIP:ClearAllPoints() + SV:SetReversePoint(DEBUFF_GRIP, db.debuffs.anchorPoint, attachTo, db.debuffs.xOffset + BOTTOM_MODIFIER, db.debuffs.yOffset) + DEBUFF_GRIP:SetWidth((auraSize + DEBUFF_GRIP.spacing) * perRow) + DEBUFF_GRIP:SetHeightToScale((auraSize + DEBUFF_GRIP.spacing) * numRows) + DEBUFF_GRIP["growth-y"] = db.debuffs.verticalGrowth; + DEBUFF_GRIP["growth-x"] = db.debuffs.horizontalGrowth; + + if(DEBUFF_ENABLED) then + DEBUFF_GRIP:Show() else - debuffs:Hide() + DEBUFF_GRIP:Hide() end end end --[[ AURABAR LAYOUT ]]-- - if frame.AuraBars then - local auraBar = frame.AuraBars; - if db.aurabar.enable then - if not frame:IsElementEnabled("AuraBars") then frame:EnableElement("AuraBars") end - auraBar:Show() + if(AURABAR_GRIP) then + if(AURABAR_ENABLED) then + if(not frame:IsElementEnabled("AuraBars")) then + frame:EnableElement("AuraBars") + end + AURABAR_GRIP:Show() - auraBar.forceShow = frame.forceShowAuras; - auraBar.friendlyAuraType = db.aurabar.friendlyAuraType - auraBar.enemyAuraType = db.aurabar.enemyAuraType + AURABAR_GRIP.forceShow = frame.forceShowAuras; + AURABAR_GRIP.friendlyAuraType = db.aurabar.friendlyAuraType + AURABAR_GRIP.enemyAuraType = db.aurabar.enemyAuraType local attachTo = frame.ActionPanel; local preOffset = 1; @@ -948,36 +921,39 @@ function MOD:RefreshUnitLayout(frame, template) elseif(db.aurabar.attachTo == "DEBUFFS" and frame.Debuffs and frame.Debuffs:IsShown()) then attachTo = frame.Debuffs preOffset = 10 - elseif template ~= "player" and SVUI_Player and db.aurabar.attachTo == "PLAYER_AURABARS" then + elseif(template ~= "player" and SVUI_Player and db.aurabar.attachTo == "PLAYER_AURABARS") then attachTo = SVUI_Player.AuraBars preOffset = 10 end - auraBar.auraBarHeight = db.aurabar.height; - auraBar:ClearAllPoints() - auraBar:SetSize(UNIT_WIDTH, db.aurabar.height) + AURABAR_GRIP.auraBarHeight = db.aurabar.height; + AURABAR_GRIP:ClearAllPoints() + AURABAR_GRIP:SetSize(UNIT_WIDTH, db.aurabar.height) - if db.aurabar.anchorPoint == "BELOW" then - auraBar:Point("TOPLEFT", attachTo, "BOTTOMLEFT", 1, -preOffset) - auraBar.down = true + if(db.aurabar.anchorPoint == "BELOW") then + AURABAR_GRIP:SetPointToScale("TOPLEFT", attachTo, "BOTTOMLEFT", 1, -preOffset) + AURABAR_GRIP.down = true else - auraBar:Point("BOTTOMLEFT", attachTo, "TOPLEFT", 1, preOffset) - auraBar.down = false + AURABAR_GRIP:SetPointToScale("BOTTOMLEFT", attachTo, "TOPLEFT", 1, preOffset) + AURABAR_GRIP.down = false end - auraBar.buffColor = oUF_Villain.colors.buff_bars + AURABAR_GRIP.buffColor = oUF_Villain.colors.buff_bars - if SV.db.SVUnit.auraBarByType then - auraBar.debuffColor = nil; - auraBar.defaultDebuffColor = oUF_Villain.colors.debuff_bars + if(SV.db.SVUnit.auraBarByType) then + AURABAR_GRIP.debuffColor = nil; + AURABAR_GRIP.defaultDebuffColor = oUF_Villain.colors.debuff_bars else - auraBar.debuffColor = oUF_Villain.colors.debuff_bars - auraBar.defaultDebuffColor = nil + AURABAR_GRIP.debuffColor = oUF_Villain.colors.debuff_bars + AURABAR_GRIP.defaultDebuffColor = nil end - SortAuraBars(auraBar, db.aurabar.sort) - auraBar:SetAnchors() + SortAuraBars(AURABAR_GRIP, db.aurabar.sort) + AURABAR_GRIP:SetAnchors() else - if frame:IsElementEnabled("AuraBars")then frame:DisableElement("AuraBars")auraBar:Hide()end + if(frame:IsElementEnabled("AuraBars")) then + frame:DisableElement("AuraBars") + AURABAR_GRIP:Hide() + end end end @@ -997,8 +973,8 @@ function MOD:RefreshUnitLayout(frame, template) classIcon:ClearAllPoints() classIcon:SetAlpha(1) - classIcon:Size(size) - SV:SetReversePoint(classIcon, ico.classIcon.attachTo, healthPanel, ico.classIcon.xOffset, ico.classIcon.yOffset) + classIcon:SetSizeToScale(size) + SV:SetReversePoint(classIcon, ico.classIcon.attachTo, MASTER_GRIP, ico.classIcon.xOffset, ico.classIcon.yOffset) else classIcon:Hide() end @@ -1016,12 +992,12 @@ function MOD:RefreshUnitLayout(frame, template) if(GRID_MODE) then raidIcon:SetAlpha(0.7) - raidIcon:Size(10) - raidIcon:Point("TOP", healthPanel, "TOP", 0, 0) + raidIcon:SetSizeToScale(10) + raidIcon:SetPointToScale("TOP", MASTER_GRIP, "TOP", 0, 0) else raidIcon:SetAlpha(1) - raidIcon:Size(size) - SV:SetReversePoint(raidIcon, ico.raidicon.attachTo, healthPanel, ico.raidicon.xOffset, ico.raidicon.yOffset) + raidIcon:SetSizeToScale(size) + SV:SetReversePoint(raidIcon, ico.raidicon.attachTo, MASTER_GRIP, ico.raidicon.xOffset, ico.raidicon.yOffset) end else frame:DisableElement('RaidIcon') @@ -1041,12 +1017,12 @@ function MOD:RefreshUnitLayout(frame, template) if(GRID_MODE) then lfd:SetAlpha(0.7) - lfd:Size(10) - lfd:Point("BOTTOM", healthPanel, "BOTTOM", 0, 0) + lfd:SetSizeToScale(10) + lfd:SetPointToScale("BOTTOM", MASTER_GRIP, "BOTTOM", 0, 0) else lfd:SetAlpha(1) - lfd:Size(size) - SV:SetReversePoint(lfd, ico.roleIcon.attachTo, healthPanel, ico.roleIcon.xOffset, ico.roleIcon.yOffset) + lfd:SetSizeToScale(size) + SV:SetReversePoint(lfd, ico.roleIcon.attachTo, MASTER_GRIP, ico.roleIcon.xOffset, ico.roleIcon.yOffset) end else frame:DisableElement('LFDRole') @@ -1067,12 +1043,12 @@ function MOD:RefreshUnitLayout(frame, template) if(GRID_MODE) then roles:SetAlpha(0.7) - roles:Size(10) - roles:Point("CENTER", healthPanel, "TOPLEFT", 0, 2) + roles:SetSizeToScale(10) + roles:SetPointToScale("CENTER", MASTER_GRIP, "TOPLEFT", 0, 2) else roles:SetAlpha(1) - roles:Size(size) - SV:SetReversePoint(roles, ico.raidRoleIcons.attachTo, healthPanel, ico.raidRoleIcons.xOffset, ico.raidRoleIcons.yOffset) + roles:SetSizeToScale(size) + SV:SetReversePoint(roles, ico.raidRoleIcons.attachTo, MASTER_GRIP, ico.raidRoleIcons.xOffset, ico.raidRoleIcons.yOffset) end else roles:Hide() diff --git a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua index 2842bf7..6598388 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua @@ -66,7 +66,7 @@ local MOD = SV.SVUnit if(not MOD) then return end -local AURA_FONT = [[Interface\AddOns\SVUI\assets\fonts\Display.ttf]]; +local AURA_FONT = [[Interface\AddOns\SVUI\assets\fonts\Numbers.ttf]]; local AURA_FONTSIZE = 11; local AURA_OUTLINE = "OUTLINE"; local BASIC_TEXTURE = [[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]; @@ -92,7 +92,7 @@ local textCounterOffsets = { ["BOTTOM"] = {"RIGHT", "LEFT", 2, 0}, } -local CanSteal = (SV.class == "MAGE") +local CanSteal = (SV.class == "MAGE"); --[[ ########################################################## LOCAL FUNCTIONS @@ -102,8 +102,8 @@ local AuraIcon_OnClick = function(self) if not IsShiftKeyDown() then return end local name = self.name; if name then - SV:AddonMessage((L["The spell '%s' has been added to the Blocked unitframe aura filter."]):format(name)) - SV.filters["Blocked"][name] = {["enable"] = true, ["priority"] = 0} + SV:AddonMessage((L["The spell '%s' has been added to the BlackList unitframe aura filter."]):format(name)) + SV.filters["BlackList"][name] = {["enable"] = true} MOD:RefreshUnitFrames() end end @@ -124,13 +124,14 @@ local Aura_UpdateTooltip = function(self) end local CreateAuraIcon = function(icons, index) + local baseSize = icons.size or 16 local aura = CreateFrame("Button", nil, icons) aura:RemoveTextures() aura:EnableMouse(true) aura:RegisterForClicks('RightButtonUp') - aura:SetWidth(icons.size or 16) - aura:SetHeight(icons.size or 16) + aura:SetWidth(baseSize) + aura:SetHeight(baseSize) aura:SetBackdrop({ bgFile = [[Interface\BUTTONS\WHITE8X8]], @@ -148,25 +149,32 @@ local CreateAuraIcon = function(icons, index) aura:SetBackdropColor(0, 0, 0, 0) aura:SetBackdropBorderColor(0, 0, 0) + local fontgroup = "unitauralarge"; + if(baseSize < 18) then + fontgroup = "unitaurasmall"; + elseif(baseSize < 24) then + fontgroup = "unitauramedium"; + end + local cd = CreateFrame("Cooldown", nil, aura, "CooldownFrameTemplate"); - cd:FillInner(aura, 1, 1); + cd:SetAllPointsIn(aura, 1, 1); cd.noOCC = true; cd.noCooldownCount = true; cd:SetReverse(true); cd:SetHideCountdownNumbers(true); local text = cd:CreateFontString(nil, 'OVERLAY'); - text:SetFontObject(NumberFontNormal); + text:FontManager(fontgroup); text:SetPoint('CENTER', aura, 'CENTER', 1, 1); text:SetJustifyH('CENTER'); - local count = aura:CreateFontString(nil, "OVERLAY"); - count:SetFontObject(NumberFontNormal); - count:SetPoint("BOTTOMRIGHT", aura, "BOTTOMRIGHT", -1, 0); + local count = cd:CreateFontString(nil, "OVERLAY"); + count:FontManager(fontgroup); + count:SetPoint("BOTTOMRIGHT", aura, "BOTTOMRIGHT", 3, -3); local icon = aura:CreateTexture(nil, "BORDER"); icon:SetAllPoints(aura); - icon:FillInner(aura, 1, 1); + icon:SetAllPointsIn(aura, 1, 1); icon:SetTexCoord(0.1, 0.9, 0.1, 0.9); local overlay = aura:CreateTexture(nil, "OVERLAY"); @@ -200,44 +208,49 @@ end local UpdateAuraTimer = function(self, elapsed) self.expiration = self.expiration - elapsed; + if(self.nextUpdate > 0) then - self.nextUpdate = self.nextUpdate - elapsed; - elseif(self.expiration <= 0) then + self.nextUpdate = self.nextUpdate - elapsed; + return; + end + + if(self.expiration <= 0) then self:SetScript("OnUpdate", nil) self.text:SetText('') - else - local expires = self.expiration; - local calc, timeLeft = 0, 0; - local timeFormat; - if expires < 60 then - if expires >= 4 then - timeLeft = floor(expires) - timeFormat = "|cffffff00%d|r" - self.nextUpdate = 0.51 - else - timeLeft = expires - timeFormat = "|cffff0000%.1f|r" - self.nextUpdate = 0.051 - end - elseif expires < 3600 then - timeFormat = "|cffffffff%dm|r" - timeLeft = ceil(expires / 60); - calc = floor((expires / 60) + .5); - self.nextUpdate = calc > 1 and ((expires - calc) * 29.5) or (expires - 59.5); - elseif expires < 86400 then - timeFormat = "|cff66ffff%dh|r" - timeLeft = ceil(expires / 3600); - calc = floor((expires / 3600) + .5); - self.nextUpdate = calc > 1 and ((expires - calc) * 1799.5) or (expires - 3570); + return; + end + + local expires = self.expiration; + local calc, timeLeft = 0, 0; + local timeFormat; + if expires < 60 then + if expires >= 4 then + timeLeft = floor(expires) + timeFormat = "|cffffff00%d|r" + self.nextUpdate = 0.51 else - timeFormat = "|cff6666ff%dd|r" - timeLeft = ceil(expires / 86400); - calc = floor((expires / 86400) + .5); - self.nextUpdate = calc > 1 and ((expires - calc) * 43199.5) or (expires - 86400); - end + timeLeft = expires + timeFormat = "|cffff0000%.1f|r" + self.nextUpdate = 0.051 + end + elseif expires < 3600 then + timeFormat = "|cffffffff%d|r|cffCC8811m|r" + timeLeft = ceil(expires / 60); + calc = floor((expires / 60) + 0.5); + self.nextUpdate = calc > 1 and ((expires - calc) * 29.5) or (expires - 59.5); + elseif expires < 86400 then + timeFormat = "|cff66ffff%d|r|cffAA5511h|r" + timeLeft = ceil(expires / 3600); + calc = floor((expires / 3600) + 0.5); + self.nextUpdate = calc > 1 and ((expires - calc) * 1799.5) or (expires - 3570); + else + timeFormat = "|cff6666ff%d|r|cff991100d|r" + timeLeft = ceil(expires / 86400); + calc = floor((expires / 86400) + 0.5); + self.nextUpdate = calc > 1 and ((expires - calc) * 43199.5) or (expires - 86400); + end - self.text:SetFormattedText(timeFormat, timeLeft) - end + self.text:SetFormattedText(timeFormat, timeLeft) end local PostUpdateAuraIcon = function(self, unit, button, index, offset) @@ -266,7 +279,7 @@ local PostUpdateAuraIcon = function(self, unit, button, index, offset) local size = button:GetParent().size if size then - button:Size(size) + button:SetSizeToScale(size) end button.spell = name @@ -296,13 +309,31 @@ local AuraBar_OnClick = function(self) if not IsShiftKeyDown() then return end local name = self:GetParent().aura.name if name then - SV:AddonMessage((L["The spell '%s' has been added to the Blocked unitframe aura filter."]):format(name)) - SV.filters["Blocked"][name] = {["enable"] = true, ["priority"] = 0} + SV:AddonMessage((L["The spell '%s' has been added to the BlackList unitframe aura filter."]):format(name)) + SV.filters["BlackList"][name] = {["enable"] = true} MOD:RefreshUnitFrames() end end local PostCreateAuraBars = function(self) + self.spelltime = self:CreateFontString(nil, 'ARTWORK') + self.spelltime:FontManager("unitauramedium") + self.spelltime:SetTextColor(1 ,1, 1) + self.spelltime:SetShadowOffset(1, -1) + self.spelltime:SetShadowColor(0, 0, 0) + self.spelltime:SetJustifyH'RIGHT' + self.spelltime:SetJustifyV'CENTER' + self.spelltime:SetPoint'RIGHT' + + self.spellname = self:CreateFontString(nil, 'ARTWORK') + self.spellname:FontManager("unitaurabar") + self.spellname:SetTextColor(1, 1, 1) + self.spellname:SetShadowOffset(1, -1) + self.spellname:SetShadowColor(0, 0, 0) + self.spellname:SetJustifyH'LEFT' + self.spellname:SetJustifyV'CENTER' + self.spellname:SetPoint'LEFT' + self.spellname:SetPoint('RIGHT', self.spelltime, 'LEFT') self.iconHolder:RegisterForClicks("RightButtonUp") self.iconHolder:SetScript("OnClick", AuraBar_OnClick) end @@ -330,9 +361,9 @@ local ColorizeAuraBars = function(self) end end ---[[ PLAYER AURA FILTERING ]]-- +--[[ AURA FILTERING ]]-- -local PlayerAuraFilter = function(self, unit, icon, auraName, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossAura) +local CommonAuraFilter = function(self, unit, icon, auraName, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossAura) local db = SV.db.SVUnit[self.___key] local auraType = self.type; if(not auraType) then return true end @@ -344,11 +375,14 @@ local PlayerAuraFilter = function(self, unit, icon, auraName, _, _, _, debuffTyp local isEnemy = UnitIsEnemy("player", unit); icon.isPlayer = isPlayer; + icon.priority = 0; icon.owner = caster; icon.name = auraName; - if(SV.filters.Blocked[auraName] and SV.filters.Blocked[auraName].enable) then - return false + if(auraDB.filterWhiteList and (not SV.filters.WhiteList[auraName])) then + return false; + elseif(SV.filters.BlackList[auraName] and SV.filters.BlackList[auraName].enable) then + return false; else if(auraDB.filterPlayer and (not isPlayer)) then return false @@ -377,7 +411,7 @@ local PlayerAuraFilter = function(self, unit, icon, auraName, _, _, _, debuffTyp return true end -local PlayerBarFilter = function(self, unit, auraName, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID) +local CommonBarFilter = function(self, unit, auraName, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID) local db = SV.db.SVUnit[self.___key] if((not db) or (db and not db.aurabar)) then return false; @@ -386,7 +420,9 @@ local PlayerBarFilter = function(self, unit, auraName, _, _, _, debuffType, dura local isPlayer = caster == "player" or caster == "vehicle"; local isEnemy = UnitIsEnemy("player", unit); - if(SV.filters.Blocked[auraName] and SV.filters.Blocked[auraName].enable) then + if(auraDB.filterWhiteList and (not SV.filters.WhiteList[auraName])) then + return false; + elseif(SV.filters.BlackList[auraName] and SV.filters.BlackList[auraName].enable) then return false else if(auraDB.filterPlayer and (not isPlayer)) then @@ -416,19 +452,19 @@ local PlayerBarFilter = function(self, unit, auraName, _, _, _, debuffType, dura return true end ---[[ NON-PLAYER AURA FILTERING ]]-- +--[[ DETAILED AURA FILTERING ]]-- -local function filter_test(setting, harmful) +local function filter_test(setting, isEnemy) if((not setting) or (setting and type(setting) ~= "table")) then return false; end - if((setting.enemy and harmful) or (setting.friendly and (not harmful))) then + if((setting.enemy and isEnemy) or (setting.friendly and (not isEnemy))) then return true; end return false end -local CommonAuraFilter = function(self, unit, icon, auraName, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossAura) +local DetailedAuraFilter = function(self, unit, icon, auraName, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossAura) local db = SV.db.SVUnit[self.___key] local auraType = self.type; if(not auraType) then return true end @@ -440,12 +476,15 @@ local CommonAuraFilter = function(self, unit, icon, auraName, _, _, _, debuffTyp local isEnemy = UnitIsEnemy("player", unit); icon.isPlayer = isPlayer; + icon.priority = 0; icon.owner = caster; icon.name = auraName; if(filter_test(auraDB.filterAll, isEnemy)) then return false - elseif(SV.filters.Blocked[auraName] and SV.filters.Blocked[auraName].enable) then + elseif(filter_test(auraDB.filterWhiteList, isEnemy) and (not SV.filters.WhiteList[auraName])) then + return false; + elseif(SV.filters.BlackList[auraName] and SV.filters.BlackList[auraName].enable) then return false else if(filter_test(auraDB.filterPlayer, isEnemy) and (not isPlayer)) then @@ -473,7 +512,7 @@ local CommonAuraFilter = function(self, unit, icon, auraName, _, _, _, debuffTyp return true end -local CommonBarFilter = function(self, unit, auraName, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID) +local DetailedBarFilter = function(self, unit, auraName, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID) local db = SV.db.SVUnit[self.___key] if((not db) or (db and not db.aurabar)) then return false; @@ -484,7 +523,9 @@ local CommonBarFilter = function(self, unit, auraName, _, _, _, debuffType, dura if(filter_test(auraDB.filterAll, isEnemy)) then return false - elseif(SV.filters.Blocked[auraName] and SV.filters.Blocked[auraName].enable) then + elseif(filter_test(auraDB.filterWhiteList, isEnemy) and (not SV.filters.WhiteList[auraName])) then + return false; + elseif(SV.filters.BlackList[auraName] and SV.filters.BlackList[auraName].enable) then return false else if(filter_test(auraDB.filterPlayer, isEnemy) and (not isPlayer)) then @@ -515,22 +556,29 @@ end BUILD FUNCTION ########################################################## ]]-- +local BoolFilters = { + ['player'] = true, + ['pet'] = true, + ['boss'] = true, + ['arena'] = true, + ['party'] = true, + ['raid'] = true, + ['raidpet'] = true, +}; + function MOD:CreateBuffs(frame, unit) local aura = CreateFrame("Frame", nil, frame) aura.___key = unit aura.spacing = 2; aura.CreateIcon = CreateAuraIcon; aura.PostUpdateIcon = PostUpdateAuraIcon; - if(unit == "player") then - aura.CustomFilter = PlayerAuraFilter; - else + if(BoolFilters[unit]) then aura.CustomFilter = CommonAuraFilter; + else + aura.CustomFilter = DetailedAuraFilter; end aura:SetFrameLevel(10) aura.type = "buffs" - aura.textFont = LSM:Fetch("font", SV.db.SVUnit.auraFont) - aura.textSize = SV.db.SVUnit.auraFontSize - aura.textOutline = SV.db.SVUnit.auraFontOutline return aura end @@ -540,16 +588,13 @@ function MOD:CreateDebuffs(frame, unit) aura.spacing = 2; aura.CreateIcon = CreateAuraIcon; aura.PostUpdateIcon = PostUpdateAuraIcon; - if(unit == "player") then - aura.CustomFilter = PlayerAuraFilter; - else + if(BoolFilters[unit]) then aura.CustomFilter = CommonAuraFilter; + else + aura.CustomFilter = DetailedAuraFilter; end aura.type = "debuffs" aura:SetFrameLevel(10) - aura.textFont = LSM:Fetch("font", SV.db.SVUnit.auraFont) - aura.textSize = SV.db.SVUnit.auraFontSize - aura.textOutline = SV.db.SVUnit.auraFontOutline return aura end @@ -572,16 +617,12 @@ function MOD:CreateAuraBarHeader(frame, unit) auraBarParent.spacing = 1; auraBarParent.spark = true; if(unit == "player") then - auraBarParent.filter = PlayerBarFilter; - else auraBarParent.filter = CommonBarFilter; + else + auraBarParent.filter = DetailedBarFilter; end auraBarParent.PostUpdate = ColorizeAuraBars; auraBarParent.barTexture = LSM:Fetch("statusbar", SV.db.SVUnit.auraBarStatusbar) - auraBarParent.timeFont = LSM:Fetch("font", "Roboto") - auraBarParent.textFont = LSM:Fetch("font", SV.db.SVUnit.auraFont) - auraBarParent.textSize = SV.db.SVUnit.auraFontSize - auraBarParent.textOutline = SV.db.SVUnit.auraFontOutline return auraBarParent end --[[ @@ -629,10 +670,6 @@ function MOD:UpdateAuraWatch(frame, key, override) end if WATCH_CACHE then - local fontFile = LSM:Fetch("font", SV.db.SVUnit.auraFont) - local fontSize = SV.db.SVUnit.auraFontSize - local fontOutline = SV.db.SVUnit.auraFontOutline - if AW.icons then for i = 1, #AW.icons do local iconTest = false; @@ -669,8 +706,8 @@ function MOD:UpdateAuraWatch(frame, key, override) watchedAura.missingAlpha = watchedAura.onlyShowMissing and 1 or 0; watchedAura.textThreshold = WATCH_CACHE[i].textThreshold or -1; watchedAura.displayText = WATCH_CACHE[i].displayText; - watchedAura:Width(db.size) - watchedAura:Height(db.size) + watchedAura:SetWidthToScale(db.size) + watchedAura:SetHeightToScale(db.size) watchedAura:ClearAllPoints() watchedAura:SetPoint(WATCH_CACHE[i].point, frame.Health, WATCH_CACHE[i].point, WATCH_CACHE[i].xOffset, WATCH_CACHE[i].yOffset) @@ -685,8 +722,8 @@ function MOD:UpdateAuraWatch(frame, key, override) end if not watchedAura.border then watchedAura.border = watchedAura:CreateTexture(nil, "BACKGROUND") - watchedAura.border:Point("TOPLEFT", -1, 1) - watchedAura.border:Point("BOTTOMRIGHT", 1, -1) + watchedAura.border:SetPointToScale("TOPLEFT", -1, 1) + watchedAura.border:SetPointToScale("BOTTOMRIGHT", 1, -1) watchedAura.border:SetTexture([[Interface\BUTTONS\WHITE8X8]]) watchedAura.border:SetVertexColor(0, 0, 0) end @@ -740,9 +777,11 @@ function MOD:UpdateAuraWatch(frame, key, override) watchedAura.count:SetPoint("CENTER", unpack(counterOffsets[WATCH_CACHE[i].point])) end - watchedAura.count:SetFont(fontFile, fontSize, fontOutline) - watchedAura.text:SetFont(fontFile, fontSize, fontOutline) - watchedAura.text:ClearAllPoints() + watchedAura.count:FontManager("unitaurasmall"); + watchedAura.text:FontManager("unitaurasmall"); + + watchedAura.text:ClearAllPoints(); + watchedAura.text:SetPoint(WATCH_CACHE[i].point, watchedAura, WATCH_CACHE[i].point) if WATCH_CACHE[i].enabled then AW.icons[WATCH_CACHE[i].id] = watchedAura; diff --git a/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua b/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua index 251f395..1adbdab 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua @@ -61,6 +61,9 @@ local L = SV.L; local MOD = SV.SVUnit if(not MOD) then return end + +SV.SpecialFX:Register("overlay_castbar", [[Spells\Eastern_plaguelands_beam_effect.m2]], 2, -2, -2, 2, 0.95, -1, 0) +SV.SpecialFX:Register("underlay_castbar", [[Spells\Xplosion_twilight_impact_noflash.m2]], 1, -1, -1, 1, 0.9, 0, 0) --[[ ########################################################## LOCAL VARIABLES @@ -136,7 +139,7 @@ local function SetCastTicks(bar,count,mod) ticks[i] = bar:CreateTexture(nil,'OVERLAY') ticks[i]:SetTexture(SV.Media.bar.lazer) ticks[i]:SetVertexColor(0,0,0,0.8) - ticks[i]:Width(1) + ticks[i]:SetWidthToScale(1) ticks[i]:SetHeight(bar:GetHeight()) end ticks[i]:ClearAllPoints() @@ -157,7 +160,7 @@ local Fader_OnEvent = function(self, event, arg) self.mask:SetAlpha(1) if self.anim:IsPlaying() then self.anim:Stop() - end + end elseif event == "UNIT_SPELLCAST_CHANNEL_START" then self:SetAlpha(0) self.mask:SetAlpha(1) @@ -211,7 +214,7 @@ end local function SetCastbarFading(castbar, texture) local fader = CreateFrame("Frame", nil, castbar) fader:SetFrameLevel(2) - fader:FillInner(castbar) + fader:SetAllPointsIn(castbar) fader:SetBackdrop({bgFile = texture}) fader:SetBackdropColor(0, 0, 0, 0) fader:SetAlpha(0) @@ -225,7 +228,7 @@ local function SetCastbarFading(castbar, texture) fader:RegisterEvent("UNIT_SPELLCAST_FAILED_QUIET") fader.mask = CreateFrame("Frame", nil, castbar) fader.mask:SetBackdrop({bgFile = texture}) - fader.mask:FillInner(castbar) + fader.mask:SetAllPointsIn(castbar) fader.mask:SetFrameLevel(2) fader.mask:SetBackdropColor(0, 0, 0, 0) fader.mask:SetAlpha(0) @@ -494,7 +497,7 @@ end BUILD FUNCTION ########################################################## ]]-- -function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) +function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss, hasModel) local colors = oUF_Villain.colors; local castbar = CreateFrame("StatusBar", nil, frame) castbar.OnUpdate = CustomCastBarUpdate; @@ -511,6 +514,7 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) castbar:SetFrameLevel(2) castbar.LatencyTexture = castbar:CreateTexture(nil, "OVERLAY") + local cbName = frame:GetName().."Castbar" local castbarHolder = CreateFrame("Frame", cbName, castbar) @@ -518,17 +522,17 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) organizer:SetFrameStrata("HIGH") local iconHolder = CreateFrame("Frame", nil, organizer) - iconHolder:SetFixedPanelTemplate("Inset", false) + iconHolder:SetStylePanel("Fixed", "Inset", false) organizer.Icon = iconHolder local buttonIcon = iconHolder:CreateTexture(nil, "BORDER") - buttonIcon:FillInner() + buttonIcon:SetAllPointsIn() buttonIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) castbar.Icon = buttonIcon; local shieldIcon = iconHolder:CreateTexture(nil, "ARTWORK") - shieldIcon:Point("TOPLEFT", buttonIcon, "TOPLEFT", -7, 7) - shieldIcon:Point("BOTTOMRIGHT", buttonIcon, "BOTTOMRIGHT", 7, -8) + shieldIcon:SetPointToScale("TOPLEFT", buttonIcon, "TOPLEFT", -7, 7) + shieldIcon:SetPointToScale("BOTTOMRIGHT", buttonIcon, "BOTTOMRIGHT", 7, -8) shieldIcon:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Castbar\\SHIELD") castbar.Shield = shieldIcon; @@ -539,7 +543,6 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) castbar.Text:SetDrawLayer("OVERLAY", 7) castbar.Organizer = organizer - local bgFrame = CreateFrame("Frame", nil, castbar) local hadouken = CreateFrame("Frame", nil, castbar) @@ -548,13 +551,13 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) castbar.Time:SetFont(SV.Media.font.numbers, 12, "OUTLINE") castbar.Time:SetShadowOffset(1, -1) castbar.Time:SetTextColor(1, 1, 1) - castbar.Text:SetFont(SV.Media.font.alert, 13, "OUTLINE") - castbar.Text:SetShadowOffset(1, -1) + castbar.Text:SetFont(SV.Media.font.alert, 12, "OUTLINE") + castbar.Text:SetShadowOffset(0, 0) castbar.Text:SetTextColor(1, 1, 1) castbar:SetStatusBarTexture(SV.Media.bar.lazer) - bgFrame:FillInner(castbar, -2, 10) + bgFrame:SetAllPointsIn(castbar, -2, 10) bgFrame:SetFrameLevel(bgFrame:GetFrameLevel() - 1) castbar.LatencyTexture:SetTexture(SV.Media.bar.lazer) @@ -565,7 +568,7 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) hadouken:SetWidth(50) hadouken:SetAlpha(0.9) - castbarHolder:Point("TOP", frame, "BOTTOM", 0, isBoss and -4 or -35) + castbarHolder:SetPointToScale("TOP", frame, "BOTTOM", 0, isBoss and -4 or -35) if reversed then castbar:SetReverseFill(true) @@ -582,10 +585,10 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) hadouken[1].overlay:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Castbar\\SKULLS-REVERSED") hadouken[1].overlay:SetVertexColor(1, 1, 1) - SV.Animate:Sprite(hadouken[1],false,false,true) + SV.Animate:Sprite4(hadouken[1],false,false,true) hadouken[2] = hadouken:CreateTexture(nil, "ARTWORK") - hadouken[2]:FillInner(hadouken, 4, 4) + hadouken[2]:SetAllPointsIn(hadouken, 4, 4) hadouken[2]:SetBlendMode("ADD") hadouken[2]:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Castbar\\CHANNEL-REVERSED") hadouken[2]:SetVertexColor(colors.spark[1],colors.spark[2],colors.spark[3]) @@ -597,12 +600,12 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) hadouken[2].overlay:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Castbar\\CHANNEL-REVERSED") hadouken[2].overlay:SetVertexColor(1, 1, 1) - SV.Animate:Sprite(hadouken[2],false,false,true) + SV.Animate:Sprite4(hadouken[2],false,false,true) - castbar:Point("BOTTOMLEFT", castbarHolder, "BOTTOMLEFT", 1, 1) - organizer:Point("LEFT", castbar, "RIGHT", 4, 0) + castbar:SetPointToScale("BOTTOMLEFT", castbarHolder, "BOTTOMLEFT", 1, 1) + organizer:SetPointToScale("LEFT", castbar, "RIGHT", 4, 0) - castbar.Time:Point("RIGHT", castbar, "LEFT", -4, 0) + castbar.Time:SetPointToScale("RIGHT", castbar, "LEFT", -4, 0) castbar.Time:SetJustifyH("CENTER") else hadouken[1] = hadouken:CreateTexture(nil, "ARTWORK") @@ -618,10 +621,10 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) hadouken[1].overlay:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Castbar\\HADOUKEN") hadouken[1].overlay:SetVertexColor(1, 1, 1) - SV.Animate:Sprite(hadouken[1],false,false,true) + SV.Animate:Sprite4(hadouken[1],false,false,true) hadouken[2] = hadouken:CreateTexture(nil, "ARTWORK") - hadouken[2]:FillInner(hadouken, 4, 4) + hadouken[2]:SetAllPointsIn(hadouken, 4, 4) hadouken[2]:SetBlendMode("ADD") hadouken[2]:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Castbar\\CHANNEL") hadouken[2]:SetVertexColor(colors.spark[1],colors.spark[2],colors.spark[3]) @@ -633,38 +636,38 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) hadouken[2].overlay:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Castbar\\CHANNEL") hadouken[2].overlay:SetVertexColor(1, 1, 1) - SV.Animate:Sprite(hadouken[2],false,false,true) + SV.Animate:Sprite4(hadouken[2],false,false,true) - castbar:Point("BOTTOMRIGHT", castbarHolder, "BOTTOMRIGHT", -1, 1) - organizer:Point("RIGHT", castbar, "LEFT", -4, 0) + castbar:SetPointToScale("BOTTOMRIGHT", castbarHolder, "BOTTOMRIGHT", -1, 1) + organizer:SetPointToScale("RIGHT", castbar, "LEFT", -4, 0) - castbar.Time:Point("LEFT", castbar, "RIGHT", 4, 0) + castbar.Time:SetPointToScale("LEFT", castbar, "RIGHT", 4, 0) castbar.Time:SetJustifyH("CENTER") end - -- castbar.Time:Point("CENTER", organizer, "CENTER", 0, 0) + -- castbar.Time:SetPointToScale("CENTER", organizer, "CENTER", 0, 0) -- castbar.Time:SetJustifyH("CENTER") - castbar.Text:SetPoint("CENTER", castbar, "CENTER", 0, 0) + castbar.Text:SetAllPoints(castbar) castbar.Text:SetJustifyH("CENTER") else - castbar.Time:SetFont(SV.Media.font.roboto, 11) + castbar.Time:SetFont(SV.Media.font.default, 11) castbar.Time:SetShadowOffset(1, -1) castbar.Time:SetTextColor(1, 1, 1, 0.9) castbar.Time:SetPoint("RIGHT", castbar, "LEFT", -1, 0) castbar.Time:SetJustifyH("RIGHT") - castbar.Text:SetFont(SV.Media.font.roboto, 11) + castbar.Text:SetFont(SV.Media.font.default, 11) castbar.Text:SetShadowOffset(1, -1) castbar.Text:SetTextColor(1, 1, 1, 0.9) - castbar.Text:Point("CENTER", castbar, "CENTER", 0, 0) + castbar.Text:SetAllPoints(castbar) castbar.Text:SetJustifyH("CENTER") castbar.pewpew = false castbar:SetStatusBarTexture(SV.Media.bar.glow) - castbarHolder:Point("TOP", frame, "BOTTOM", 0, -4) - castbar:FillInner(castbarHolder, 2, 2) + castbarHolder:SetPointToScale("TOP", frame, "BOTTOM", 0, -4) + castbar:SetAllPointsIn(castbarHolder, 2, 2) bgFrame:SetAllPoints(castbarHolder) bgFrame:SetFrameLevel(bgFrame:GetFrameLevel() - 1) @@ -673,17 +676,23 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) if reversed then castbar:SetReverseFill(true) - organizer:Point("LEFT", castbar, "RIGHT", 6, 0) + organizer:SetPointToScale("LEFT", castbar, "RIGHT", 6, 0) else - organizer:Point("RIGHT", castbar, "LEFT", -6, 0) + organizer:SetPointToScale("RIGHT", castbar, "LEFT", -6, 0) end - end + end + + if(hasModel) then + SV.SpecialFX:SetFXFrame(bgFrame, "underlay_castbar") + bgFrame.FX:SetFrameLevel(0) + SV.SpecialFX:SetFXFrame(castbar, "overlay_castbar", nil, bgFrame) + end - castbar.bg = bgFrame:CreateTexture(nil, "BACKGROUND") + castbar.bg = bgFrame:CreateTexture(nil, "BACKGROUND", nil, -2) castbar.bg:SetAllPoints(bgFrame) castbar.bg:SetTexture(SV.Media.bar.default) castbar.bg:SetVertexColor(0,0,0,0.5) - + local borderB = bgFrame:CreateTexture(nil,"OVERLAY") borderB:SetTexture(0,0,0) borderB:SetPoint("BOTTOMLEFT") @@ -747,7 +756,7 @@ function MOD:PostCastStart(unit, index, ...) if unit == "player" or unit == "target" then CustomChannelUpdate(self, unit, index, unitDB.ticks) CustomInterruptible(self, unit, db.castClassColor) - end + end end function MOD:PostCastStop(unit, ...) diff --git a/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua b/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua index 6f1bc2e..1e4b817 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua @@ -66,6 +66,23 @@ if(not MOD) then return end LOCALS ########################################################## ]]-- +local FontMapping = { + ["player"] = "unitprimary", + ["target"] = "unitprimary", + ["targettarget"] = "unitsecondary", + ["pet"] = "unitprimary", + ["pettarget"] = "unitsecondary", + ["focus"] = "unitprimary", + ["focustarget"] = "unitsecondary", + ["boss"] = "unitprimary", + ["arena"] = "unitprimary", + ["party"] = "unitsecondary", + ["raid"] = "unitsecondary", + ["raidpet"] = "unitsecondary", + ["tank"] = "unitsecondary", + ["assist"] = "unitsecondary", +}; + local _hook_ActionPanel_OnSizeChanged = function(self) local width,height = self:GetSize() local widthScale = min(128, width) @@ -246,7 +263,7 @@ local function CreateThreat(frame, unit) aggro:SetFrameStrata("HIGH") aggro:SetFrameLevel(30) aggro:SetSize(40,40) - aggro:SetPoint("TOPRIGHT", frame, "TOPRIGHT", 6, 6) + aggro:SetPoint("CENTER", frame, "TOPRIGHT", -6, -6) aggro.texture = aggro:CreateTexture(nil, "OVERLAY") aggro.texture:SetAllPoints(aggro) aggro.texture:SetTexture(AGGRO_TEXTURE) @@ -269,8 +286,8 @@ local function CreateActionPanel(frame, offset) offset = offset or 2 local panel = CreateFrame('Frame', nil, frame) - panel:Point('TOPLEFT', frame, 'TOPLEFT', -1, 1) - panel:Point('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', 1, -1) + panel:SetPointToScale('TOPLEFT', frame, 'TOPLEFT', -1, 1) + panel:SetPointToScale('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', 1, -1) panel:SetBackdrop({ bgFile = [[Interface\BUTTONS\WHITE8X8]], tile = false, @@ -373,19 +390,25 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) local info = CreateFrame("Frame", nil, frame) info:SetFrameStrata("BACKGROUND") info:SetFrameLevel(0) - info:Point("TOPLEFT", frame.ActionPanel, "BOTTOMLEFT", -1, 1) - info:Point("TOPRIGHT", frame.ActionPanel, "BOTTOMRIGHT", 1, 1) + info:SetPointToScale("TOPLEFT", frame.ActionPanel, "BOTTOMLEFT", -1, 1) + info:SetPointToScale("TOPRIGHT", frame.ActionPanel, "BOTTOMRIGHT", 1, 1) info:SetHeight(30) local bg = info:CreateTexture(nil, "BACKGROUND") - bg:FillInner(info) + bg:SetAllPointsIn(info) bg:SetTexture(1, 1, 1, 1) bg:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 0.7) - frame.InfoPanel = CreateFrame("Frame", nil, info) - frame.InfoPanel:SetFrameStrata("LOW") - frame.InfoPanel:SetFrameLevel(20) - frame.InfoPanel:SetAllPoints(info) + -- local effectFrame = CreateFrame("PlayerModel", nil, info) + -- effectFrame:SetAllPoints(info) + -- effectFrame:SetCamDistanceScale(0.5) + -- effectFrame:SetPortraitZoom(0) + -- effectFrame:SetModel([[Spells\Monk_travelingmist_missile.m2]]) + + frame.TextGrip = CreateFrame("Frame", nil, info) + frame.TextGrip:SetFrameStrata("LOW") + frame.TextGrip:SetFrameLevel(20) + frame.TextGrip:SetAllPoints(info) if(unit == "target") then frame.ActionPanel:SetFrameLevel(1) @@ -421,10 +444,10 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) frame.ActionPanel:SetScript("OnSizeChanged", _hook_ActionPanel_OnSizeChanged) end - frame.ActionPanel.class = CreateFrame("Frame", nil, frame.InfoPanel) - frame.ActionPanel.class:Size(18) - frame.ActionPanel.class:Point("TOPLEFT", frame.ActionPanel, "TOPLEFT", 2, -2) - frame.ActionPanel.class:SetPanelTemplate("Default", true, 2, 0, 0) + frame.ActionPanel.class = CreateFrame("Frame", nil, frame.TextGrip) + frame.ActionPanel.class:SetSizeToScale(18) + frame.ActionPanel.class:SetPointToScale("TOPLEFT", frame.ActionPanel, "TOPLEFT", 2, -2) + frame.ActionPanel.class:SetStylePanel("Default", "Default", true, 2, 0, 0) frame.ActionPanel.class.texture = frame.ActionPanel.class.Panel:CreateTexture(nil, "BORDER") frame.ActionPanel.class.texture:SetAllPoints(frame.ActionPanel.class.Panel) @@ -454,7 +477,7 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) border4:SetPoint("BOTTOMLEFT") border4:SetWidth(2) else - frame.LossOfControl = CreateFrame("Frame", nil, frame.InfoPanel) + frame.LossOfControl = CreateFrame("Frame", nil, frame.TextGrip) frame.LossOfControl:SetAllPoints(frame) frame.LossOfControl:SetFrameStrata("DIALOG") frame.LossOfControl:SetFrameLevel(99) @@ -464,7 +487,7 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) stunned:SetSize(96, 96) stunned:SetTexture(STUNNED_ANIM) stunned:SetBlendMode("ADD") - SV.Animate:Sprite(stunned, 0.12, false, true) + SV.Animate:Sprite4(stunned, 0.12, false, true) stunned:Hide() frame.LossOfControl.stunned = stunned @@ -479,50 +502,69 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) end end) end + elseif(unit == 'pet') then + frame.ActionPanel = CreateActionPanel(frame, 2) + + local info = CreateFrame("Frame", nil, frame) + info:SetFrameStrata("BACKGROUND") + info:SetFrameLevel(0) + info:SetPointToScale("TOPLEFT", frame.ActionPanel, "BOTTOMLEFT", -1, 1) + info:SetPointToScale("TOPRIGHT", frame.ActionPanel, "BOTTOMRIGHT", 1, 1) + info:SetHeight(30) + + local bg = info:CreateTexture(nil, "BACKGROUND") + bg:SetAllPointsIn(info) + bg:SetTexture(1, 1, 1, 1) + bg:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 0.7) + + frame.TextGrip = CreateFrame("Frame", nil, info) + frame.TextGrip:SetFrameStrata("LOW") + frame.TextGrip:SetFrameLevel(20) + frame.TextGrip:SetAllPoints(info) else frame.ActionPanel = CreateActionPanel(frame, 2) - frame.InfoPanel = CreateFrame("Frame", nil, frame) - frame.InfoPanel:SetFrameStrata("LOW") - frame.InfoPanel:SetFrameLevel(20) - frame.InfoPanel:Point("TOPLEFT", frame.ActionPanel, "TOPLEFT", 2, -2) - frame.InfoPanel:Point("BOTTOMRIGHT", frame.ActionPanel, "BOTTOMRIGHT", -2, 2) + frame.TextGrip = CreateFrame("Frame", nil, frame) + frame.TextGrip:SetFrameStrata("LOW") + frame.TextGrip:SetFrameLevel(20) + frame.TextGrip:SetPointToScale("TOPLEFT", frame.ActionPanel, "TOPLEFT", 2, -2) + frame.TextGrip:SetPointToScale("BOTTOMRIGHT", frame.ActionPanel, "BOTTOMRIGHT", -2, 2) end - frame.InfoPanel.Name = CreateNameText(frame.InfoPanel, unit) + frame.TextGrip.Name = CreateNameText(frame.TextGrip, unit) local reverse = unit and (unit == "target" or unit == "focus" or unit == "boss" or unit == "arena") or false; local offset, direction - + local fontgroup = FontMapping[unit] if(not noHealthText) then - frame.InfoPanel.Health = frame.InfoPanel:CreateFontString(nil, "OVERLAY") - frame.InfoPanel.Health:SetFont(LSM:Fetch("font", SV.db.SVUnit.font), SV.db.SVUnit.fontSize, SV.db.SVUnit.fontOutline) + frame.TextGrip.Health = frame.TextGrip:CreateFontString(nil, "OVERLAY") + frame.TextGrip.Health:FontManager(fontgroup) offset = reverse and 2 or -2; direction = reverse and "LEFT" or "RIGHT"; - frame.InfoPanel.Health:Point(direction, frame.InfoPanel, direction, offset, 0) + frame.TextGrip.Health:SetPointToScale(direction, frame.TextGrip, direction, offset, 0) end if(not noPowerText) then - frame.InfoPanel.Power = frame.InfoPanel:CreateFontString(nil, "OVERLAY") - frame.InfoPanel.Power:SetFont(LSM:Fetch("font", SV.db.SVUnit.font), SV.db.SVUnit.fontSize, SV.db.SVUnit.fontOutline) + frame.TextGrip.Power = frame.TextGrip:CreateFontString(nil, "OVERLAY") + frame.TextGrip.Power:FontManager(fontgroup) offset = reverse and -2 or 2; direction = reverse and "RIGHT" or "LEFT"; - frame.InfoPanel.Power:Point(direction, frame.InfoPanel, direction, offset, 0) + frame.TextGrip.Power:SetPointToScale(direction, frame.TextGrip, direction, offset, 0) end if(not noMiscText) then - frame.InfoPanel.Misc = frame.InfoPanel:CreateFontString(nil, "OVERLAY") - frame.InfoPanel.Misc:SetFont(LSM:Fetch("font", SV.db.SVUnit.font), SV.db.SVUnit.fontSize, SV.db.SVUnit.fontOutline) - frame.InfoPanel.Misc:Point("CENTER", frame, "CENTER", 0, 0) + frame.TextGrip.Misc = frame.TextGrip:CreateFontString(nil, "OVERLAY") + frame.TextGrip.Misc:FontManager(fontgroup) + frame.TextGrip.Misc:SetPointToScale("CENTER", frame, "CENTER", 0, 0) end - frame.HealthPanel = CreateFrame("Frame", nil, frame) - frame.HealthPanel:SetAllPoints(frame) + frame.MasterGrip = CreateFrame("Frame", nil, frame) + frame.MasterGrip:SetAllPoints(frame) - frame.StatusPanel = CreateFrame("Frame", nil, frame.HealthPanel) + frame.StatusPanel = CreateFrame("Frame", nil, frame.MasterGrip) frame.StatusPanel:EnableMouse(false) if(unit and (unit == "player" or unit == "pet" or unit == "target" or unit == "targettarget" or unit == "focus" or unit == "focustarget")) then - frame.StatusPanel:SetAllPoints(frame.HealthPanel) + frame.StatusPanel:SetAllPoints(frame.MasterGrip) frame.StatusPanel.media = { [[Interface\Addons\SVUI\assets\artwork\Unitframe\TARGET-DC]], [[Interface\Addons\SVUI\assets\artwork\Unitframe\TARGET-DEAD]], @@ -530,7 +572,7 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) } else frame.StatusPanel:SetSize(50, 50) - frame.StatusPanel:SetPoint("CENTER", frame.HealthPanel, "CENTER", 0, 0) + frame.StatusPanel:SetPoint("CENTER", frame.MasterGrip, "CENTER", 0, 0) frame.StatusPanel.media = { [[Interface\Addons\SVUI\assets\artwork\Unitframe\UNIT-DC]], [[Interface\Addons\SVUI\assets\artwork\Unitframe\UNIT-DEAD]], @@ -540,11 +582,6 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) frame.StatusPanel.texture = frame.StatusPanel:CreateTexture(nil, "OVERLAY") frame.StatusPanel.texture:SetAllPoints() - -- frame.StatusPanel.texture:SetTexture([[Interface\BUTTONS\WHITE8X8]]) - -- frame.StatusPanel.texture:SetBlendMode("ADD") - -- frame.StatusPanel.texture:SetGradient("VERTICAL",1,1,0,1,0,0) - -- frame.StatusPanel.texture:SetAlpha(0) - frame.StatusPanel:SetFrameStrata("LOW") frame.StatusPanel:SetFrameLevel(28) @@ -559,7 +596,8 @@ function MOD:CreateHealthBar(frame, hasbg, reverse) local healthBar = CreateFrame("StatusBar", nil, frame) healthBar:SetFrameStrata("LOW") healthBar:SetFrameLevel(4) - healthBar:SetStatusBarTexture(SV.Media.bar.default) + healthBar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]); + if hasbg then healthBar.bg = healthBar:CreateTexture(nil, "BORDER") healthBar.bg:SetAllPoints() @@ -623,10 +661,10 @@ local PostUpdateAltPower = function(self, min, current, max) end elseif(unit and unit:find("boss%d") and self.text) then self.text:SetTextColor(self:GetStatusBarColor()) - if not parent.InfoPanel.Power:GetText() or parent.InfoPanel.Power:GetText() == "" then - self.text:Point("BOTTOMRIGHT", parent.Health, "BOTTOMRIGHT") + if not parent.TextGrip.Power:GetText() or parent.TextGrip.Power:GetText() == "" then + self.text:SetPointToScale("BOTTOMRIGHT", parent.Health, "BOTTOMRIGHT") else - self.text:Point("RIGHT", parent.InfoPanel.Power, "LEFT", 2, 0) + self.text:SetPointToScale("RIGHT", parent.TextGrip.Power, "LEFT", 2, 0) end if remaining > 0 then self.text:SetText("|cffD7BEA5[|r"..format("%d%%", remaining).."|cffD7BEA5]|r") @@ -639,7 +677,7 @@ end function MOD:CreatePowerBar(frame, bg) local power = CreateFrame("StatusBar", nil, frame) power:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) - power:SetPanelTemplate("Bar") + power:SetStylePanel("Default", "Bar") power:SetFrameStrata("LOW") power:SetFrameLevel(6) if bg then @@ -657,14 +695,14 @@ end function MOD:CreateAltPowerBar(frame) local altPower = CreateFrame("StatusBar", nil, frame) altPower:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) - altPower:SetPanelTemplate("Bar") + altPower:SetStylePanel("Default", "Bar") altPower:GetStatusBarTexture():SetHorizTile(false) altPower:SetFrameStrata("LOW") altPower:SetFrameLevel(8) altPower.text = altPower:CreateFontString(nil, "OVERLAY") altPower.text:SetPoint("CENTER") altPower.text:SetJustifyH("CENTER") - altPower.text:SetFont(LSM:Fetch("font", SV.db.SVUnit.font), SV.db.SVUnit.fontSize, SV.db.SVUnit.fontOutline) + altPower.text:FontManager("unitprimary") altPower.PostUpdate = PostUpdateAltPower; return altPower end @@ -704,9 +742,9 @@ function MOD:CreatePortrait(frame,smallUnit,isPlayer) portrait3D:SetFrameLevel(2) if smallUnit then - portrait3D:SetPanelTemplate("UnitSmall") + portrait3D:SetStylePanel("Default", "UnitSmall") else - portrait3D:SetPanelTemplate("UnitLarge") + portrait3D:SetStylePanel("Default", "UnitLarge") end local overlay = CreateFrame("Frame",nil,portrait3D) @@ -726,9 +764,9 @@ function MOD:CreatePortrait(frame,smallUnit,isPlayer) portrait2D:SetAllPoints(portrait2Danchor) portrait2D.anchor = portrait2Danchor; if smallUnit then - portrait2Danchor:SetFixedPanelTemplate("UnitSmall") + portrait2Danchor:SetStylePanel("Fixed", "UnitSmall") else - portrait2Danchor:SetFixedPanelTemplate("UnitLarge") + portrait2Danchor:SetStylePanel("Fixed", "UnitLarge") end portrait2D.Panel = portrait2Danchor.Panel; diff --git a/Interface/AddOns/SVUI/packages/unit/elements/misc.lua b/Interface/AddOns/SVUI/packages/unit/elements/misc.lua index 98e63cc..858d45d 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/misc.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/misc.lua @@ -60,7 +60,7 @@ LOCAL VARIABLES ########################################################## ]]-- local STATE_ICON_FILE = [[Interface\Addons\SVUI\assets\artwork\Unitframe\UNIT-PLAYER-STATE]] -local AURA_FONT = [[Interface\AddOns\SVUI\assets\fonts\Display.ttf]] +local AURA_FONT = [[Interface\AddOns\SVUI\assets\fonts\Numbers.ttf]] local AURA_FONTSIZE = 10 local AURA_OUTLINE = "OUTLINE" local LML_ICON_FILE = [[Interface\Addons\SVUI\assets\artwork\Unitframe\UNIT-LML]] @@ -96,19 +96,19 @@ RAID DEBUFFS / DEBUFF HIGHLIGHT ]]-- function MOD:CreateRaidDebuffs(frame) local raidDebuff = CreateFrame("Frame", nil, frame) - raidDebuff:SetFixedPanelTemplate("Slot") + raidDebuff:SetStylePanel("Fixed", "Slot") raidDebuff.icon = raidDebuff:CreateTexture(nil, "OVERLAY") raidDebuff.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - raidDebuff.icon:FillInner(raidDebuff) + raidDebuff.icon:SetAllPointsIn(raidDebuff) raidDebuff.count = raidDebuff:CreateFontString(nil, "OVERLAY") - raidDebuff.count:FontManager(AURA_FONT, AURA_FONTSIZE, AURA_OUTLINE) + raidDebuff.count:FontManager("aura") raidDebuff.count:SetPoint("BOTTOMRIGHT", 0, 2) raidDebuff.count:SetTextColor(1, .9, 0) raidDebuff.time = raidDebuff:CreateFontString(nil, "OVERLAY") - raidDebuff.time:FontManager(AURA_FONT, AURA_FONTSIZE, AURA_OUTLINE) + raidDebuff.time:FontManager("aura") raidDebuff.time:SetPoint("CENTER") raidDebuff.time:SetTextColor(1, .9, 0) - raidDebuff:SetParent(frame.InfoPanel) + raidDebuff:SetParent(frame.TextGrip) return raidDebuff end @@ -117,7 +117,7 @@ function MOD:CreateAfflicted(frame) holder:SetFrameLevel(30) holder:SetAllPoints(frame.Health) local afflicted = holder:CreateTexture(nil, "OVERLAY", nil, 7) - afflicted:FillInner(holder) + afflicted:SetAllPointsIn(holder) afflicted:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\UNIT-AFFLICTED") afflicted:SetVertexColor(0, 0, 0, 0) afflicted:SetBlendMode("ADD") @@ -132,17 +132,17 @@ VARIOUS ICONS ########################################################## ]]-- function MOD:CreateResurectionIcon(frame) - local rez = frame.InfoPanel:CreateTexture(nil, "OVERLAY") - rez:Point("CENTER", frame.InfoPanel.Health, "CENTER") - rez:Size(30, 25) + local rez = frame.TextGrip:CreateTexture(nil, "OVERLAY") + rez:SetPointToScale("CENTER", frame.TextGrip.Health, "CENTER") + rez:SetSizeToScale(30, 25) rez:SetDrawLayer("OVERLAY", 7) return rez end function MOD:CreateReadyCheckIcon(frame) - local rdy = frame.InfoPanel:CreateTexture(nil, "OVERLAY", nil, 7) - rdy:Size(12) - rdy:Point("BOTTOM", frame.Health, "BOTTOM", 0, 2) + local rdy = frame.TextGrip:CreateTexture(nil, "OVERLAY", nil, 7) + rdy:SetSizeToScale(12) + rdy:SetPointToScale("BOTTOM", frame.Health, "BOTTOM", 0, 2) return rdy end @@ -153,7 +153,7 @@ function MOD:CreateCombatant(frame) local trinket = CreateFrame("Frame", nil, pvp) BasicBG(trinket) trinket.Icon = trinket:CreateTexture(nil, "BORDER") - trinket.Icon:FillInner(trinket, 2, 2) + trinket.Icon:SetAllPointsIn(trinket, 2, 2) trinket.Icon:SetTexture([[Interface\Icons\INV_MISC_QUESTIONMARK]]) trinket.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) @@ -171,7 +171,7 @@ function MOD:CreateCombatant(frame) local badge = CreateFrame("Frame", nil, pvp) BasicBG(badge) badge.Icon = badge:CreateTexture(nil, "OVERLAY") - badge.Icon:FillInner(badge, 2, 2) + badge.Icon:SetAllPointsIn(badge, 2, 2) badge.Icon:SetTexture([[Interface\Icons\INV_MISC_QUESTIONMARK]]) badge.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) @@ -201,10 +201,10 @@ CONFIGURABLE ICONS ########################################################## ]]-- function MOD:CreateRaidIcon(frame) - local rIcon = frame.InfoPanel:CreateTexture(nil, "OVERLAY", nil, 2) + local rIcon = frame.TextGrip:CreateTexture(nil, "OVERLAY", nil, 2) rIcon:SetTexture([[Interface\TargetingFrame\UI-RaidTargetingIcons]]) - rIcon:Size(18) - rIcon:Point("CENTER", frame.InfoPanel, "TOP", 0, 2) + rIcon:SetSizeToScale(18) + rIcon:SetPointToScale("CENTER", frame.TextGrip, "TOP", 0, 2) return rIcon end @@ -234,37 +234,37 @@ local UpdateRoleIcon = function(self) end function MOD:CreateRoleIcon(frame) - local parent = frame.InfoPanel or frame; + local parent = frame.TextGrip or frame; local rIconHolder = CreateFrame("Frame", nil, parent) rIconHolder:SetAllPoints() local rIcon = rIconHolder:CreateTexture(nil, "ARTWORK", nil, 2) - rIcon:Size(14) - rIcon:Point("BOTTOMRIGHT", rIconHolder, "BOTTOMRIGHT") + rIcon:SetSizeToScale(14) + rIcon:SetPointToScale("BOTTOMRIGHT", rIconHolder, "BOTTOMRIGHT") rIcon.Override = UpdateRoleIcon; frame:RegisterEvent("UNIT_CONNECTION", UpdateRoleIcon) return rIcon end function MOD:CreateRaidRoleFrames(frame) - local parent = frame.InfoPanel or frame; + local parent = frame.TextGrip or frame; local raidRoles = CreateFrame("Frame", nil, frame) - raidRoles:Size(24, 12) - raidRoles:Point("TOPLEFT", frame.ActionPanel, "TOPLEFT", -2, 4) + raidRoles:SetSizeToScale(24, 12) + raidRoles:SetPointToScale("TOPLEFT", frame.ActionPanel, "TOPLEFT", -2, 4) raidRoles:SetFrameLevel(parent:GetFrameLevel() + 50) frame.Leader = raidRoles:CreateTexture(nil, "OVERLAY") - frame.Leader:Size(12, 12) + frame.Leader:SetSizeToScale(12, 12) frame.Leader:SetTexture(LML_ICON_FILE) frame.Leader:SetTexCoord(0, 0.5, 0, 0.5) frame.Leader:SetVertexColor(1, 0.85, 0) - frame.Leader:Point("LEFT") + frame.Leader:SetPointToScale("LEFT") frame.MasterLooter = raidRoles:CreateTexture(nil, "OVERLAY") - frame.MasterLooter:Size(12, 12) + frame.MasterLooter:SetSizeToScale(12, 12) frame.MasterLooter:SetTexture(LML_ICON_FILE) frame.MasterLooter:SetTexCoord(0.5, 1, 0, 0.5) frame.MasterLooter:SetVertexColor(1, 0.6, 0) - frame.MasterLooter:Point("RIGHT") + frame.MasterLooter:SetPointToScale("RIGHT") frame.Leader.PostUpdate = MOD.RaidRoleUpdate; frame.MasterLooter.PostUpdate = MOD.RaidRoleUpdate; @@ -285,15 +285,15 @@ function MOD:RaidRoleUpdate() if db and db.icons and db.icons.raidRoleIcons then local settings = db.icons.raidRoleIcons if leaderShown and settings.position == "TOPLEFT"then - leaderIcon:Point("LEFT", frame, "LEFT") - looterIcon:Point("RIGHT", frame, "RIGHT") + leaderIcon:SetPointToScale("LEFT", frame, "LEFT") + looterIcon:SetPointToScale("RIGHT", frame, "RIGHT") elseif leaderShown and settings.position == "TOPRIGHT" then - leaderIcon:Point("RIGHT", frame, "RIGHT") - looterIcon:Point("LEFT", frame, "LEFT") + leaderIcon:SetPointToScale("RIGHT", frame, "RIGHT") + looterIcon:SetPointToScale("LEFT", frame, "LEFT") elseif looterShown and settings.position == "TOPLEFT" then - looterIcon:Point("LEFT", frame, "LEFT") + looterIcon:SetPointToScale("LEFT", frame, "LEFT") else - looterIcon:Point("RIGHT", frame, "RIGHT") + looterIcon:SetPointToScale("RIGHT", frame, "RIGHT") end end end @@ -306,8 +306,8 @@ function MOD:CreateRestingIndicator(frame) local resting = CreateFrame("Frame",nil,frame) resting:SetFrameStrata("MEDIUM") resting:SetFrameLevel(20) - resting:Size(26,26) - resting:Point("TOPRIGHT",frame,3,3) + resting:SetSizeToScale(26,26) + resting:SetPointToScale("TOPRIGHT",frame,3,3) resting.bg = resting:CreateTexture(nil,"OVERLAY",nil,1) resting.bg:SetAllPoints(resting) resting.bg:SetTexture(STATE_ICON_FILE) @@ -319,8 +319,8 @@ function MOD:CreateCombatIndicator(frame) local combat = CreateFrame("Frame",nil,frame) combat:SetFrameStrata("MEDIUM") combat:SetFrameLevel(30) - combat:Size(26,26) - combat:Point("TOPRIGHT",frame,3,3) + combat:SetSizeToScale(26,26) + combat:SetPointToScale("TOPRIGHT",frame,3,3) combat.bg = combat:CreateTexture(nil,"OVERLAY",nil,5) combat.bg:SetAllPoints(combat) combat.bg:SetTexture(STATE_ICON_FILE) @@ -342,8 +342,8 @@ function MOD:CreateExperienceRepBar(frame) if db.playerExpBar then local xp = CreateFrame("StatusBar", "PlayerFrameExperienceBar", frame.Power) - xp:FillInner(frame.Power, 0, 0) - xp:SetPanelTemplate() + xp:SetAllPointsIn(frame.Power, 0, 0) + xp:SetStylePanel("Default") xp:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) xp:SetStatusBarColor(0, 0.1, 0.6) --xp:SetBackdropColor(1, 1, 1, 0.8) @@ -355,7 +355,7 @@ function MOD:CreateExperienceRepBar(frame) xp.Rested:SetStatusBarColor(1, 0, 1, 0.6) xp.Value = xp:CreateFontString(nil, "TOOLTIP") xp.Value:SetAllPoints(xp) - xp.Value:FontManager(SV.Media.font.roboto, 10, "NONE") + xp.Value:FontManager("default") xp.Value:SetTextColor(0.2, 0.75, 1) xp.Value:SetShadowColor(0, 0, 0, 0) xp.Value:SetShadowOffset(0, 0) @@ -370,8 +370,8 @@ function MOD:CreateExperienceRepBar(frame) if db.playerRepBar then local rep = CreateFrame("StatusBar", "PlayerFrameReputationBar", frame.Power) - rep:FillInner(frame.Power, 0, 0) - rep:SetPanelTemplate() + rep:SetAllPointsIn(frame.Power, 0, 0) + rep:SetStylePanel("Default") rep:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) rep:SetStatusBarColor(0, 0.6, 0) --rep:SetBackdropColor(1, 1, 1, 0.8) @@ -379,7 +379,7 @@ function MOD:CreateExperienceRepBar(frame) rep.Tooltip = true; rep.Value = rep:CreateFontString(nil, "TOOLTIP") rep.Value:SetAllPoints(rep) - rep.Value:FontManager(SV.Media.font.roboto, 10, "NONE") + rep.Value:FontManager("default") rep.Value:SetTextColor(0.1, 1, 0.2) rep.Value:SetShadowColor(0, 0, 0, 0) rep.Value:SetShadowOffset(0, 0) @@ -396,53 +396,48 @@ TARGET ONLY COMPONENTS ########################################################## ]]-- function MOD:CreateXRay(frame) - local xray = CreateFrame("BUTTON","XRayFocus",frame,"SecureActionButtonTemplate") + local xray = CreateFrame("Button", "SVUI_XRayFocus", frame, "SecureActionButtonTemplate") xray:EnableMouse(true) xray:RegisterForClicks("AnyUp") - xray:SetAttribute("type","macro") - xray:SetAttribute("macrotext","/focus") - xray:Size(64,64) + xray:SetAttribute("type", "macro") + xray:SetAttribute("macrotext", "/focus") + xray:SetSizeToScale(64,64) xray:SetFrameStrata("MEDIUM") xray.icon = xray:CreateTexture(nil,"ARTWORK") xray.icon:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\UNIT-XRAY") xray.icon:SetAllPoints(xray) xray.icon:SetAlpha(0) - xray:SetScript("OnLeave", function() GameTooltip:Hide() xray.icon:SetAlpha(0) end) + xray:SetScript("OnLeave", function(self) GameTooltip:Hide() self.icon:SetAlpha(0) end) xray:SetScript("OnEnter", function(self) - xray.icon:SetAlpha(1) - local r,s,b,m = GetScreenHeight(),GetScreenWidth(),self:GetCenter() - local t,u,v = "RIGHT","TOP","BOTTOM" - if (b < (r / 2)) then t = "LEFT" end - if (m < (s / 2)) then u,v = v,u end - GameTooltip:SetOwner(self,"ANCHOR_NONE") - GameTooltip:SetPoint(u..t,self,v..t) - GameTooltip:SetText(FOCUSTARGET.."\n") + self.icon:SetAlpha(1) + local anchor1, anchor2 = SV:GetScreenXY(self) + GameTooltip:SetOwner(self, "ANCHOR_NONE") + GameTooltip:SetPoint(anchor1, self, anchor2) + GameTooltip:SetText(FOCUSTARGET) end) return xray end function MOD:CreateXRay_Closer(frame) - local close = CreateFrame("BUTTON","ClearXRay",frame,"SecureActionButtonTemplate") + local close = CreateFrame("Button", "SVUI_XRayFocusClear", frame, "SecureActionButtonTemplate") close:EnableMouse(true) close:RegisterForClicks("AnyUp") - close:SetAttribute("type","macro") - close:SetAttribute("macrotext","/clearfocus") - close:Size(50,50) + close:SetAttribute("type", "macro") + close:SetAttribute("macrotext", "/clearfocus") + close:SetSizeToScale(50,50) close:SetFrameStrata("MEDIUM") close.icon = close:CreateTexture(nil,"ARTWORK") close.icon:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\UNIT-XRAY-CLOSE") close.icon:SetAllPoints(close) + close.icon:SetAlpha(0) close.icon:SetVertexColor(1,0.2,0.1) - close:SetScript("OnLeave",function()GameTooltip:Hide()close.icon:SetVertexColor(1,0.2,0.1)end) + close:SetScript("OnLeave", function(self) GameTooltip:Hide() self.icon:SetAlpha(0) end) close:SetScript("OnEnter",function(self) - close.icon:SetVertexColor(1,1,0.2) - local r,s,b,m=GetScreenHeight(),GetScreenWidth(),self:GetCenter() - local t,u,v="RIGHT","TOP","BOTTOM" - if b<r/2 then t="LEFT"end - if m<s/2 then u,v=v,u end - GameTooltip:SetOwner(self,"ANCHOR_NONE") - GameTooltip:SetPoint(u..t,self,v..t) - GameTooltip:SetText(CLEAR_FOCUS.."\n") + self.icon:SetAlpha(1) + local anchor1, anchor2 = SV:GetScreenXY(self) + GameTooltip:SetOwner(self, "ANCHOR_NONE") + GameTooltip:SetPoint(anchor1, self, anchor2) + GameTooltip:SetText(CLEAR_FOCUS) end) return close end diff --git a/Interface/AddOns/SVUI/packages/unit/frames.lua b/Interface/AddOns/SVUI/packages/unit/frames.lua index f483f38..06dcf7e 100644 --- a/Interface/AddOns/SVUI/packages/unit/frames.lua +++ b/Interface/AddOns/SVUI/packages/unit/frames.lua @@ -148,17 +148,17 @@ local UpdatePlayerFrame = function(self) local USE_CLASSBAR = db.classbar.enable; local classBarHeight = db.classbar.height; local classBarWidth = db.width * 0.4; - local healthPanel = self.HealthPanel + local MASTER_GRIP = self.MasterGrip local iconDB = db.icons self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "player") self.colors = oUF_Villain.colors; - self:Size(UNIT_WIDTH, UNIT_HEIGHT) + self:SetSizeToScale(UNIT_WIDTH, UNIT_HEIGHT) local lossSize = UNIT_WIDTH * 0.6 self.LossOfControl.stunned:SetSize(lossSize, lossSize) - _G[self:GetName().."_MOVE"]:Size(self:GetSize()) + _G[self:GetName().."_MOVE"]:SetSizeToScale(self:GetSize()) MOD:RefreshUnitLayout(self, "player") @@ -168,8 +168,8 @@ local UpdatePlayerFrame = function(self) if iconDB and iconDB.restIcon and iconDB.restIcon.enable then local size = iconDB.restIcon.size; resting:ClearAllPoints() - resting:Size(size) - SV:SetReversePoint(resting, iconDB.restIcon.attachTo, healthPanel, iconDB.restIcon.xOffset, iconDB.restIcon.yOffset) + resting:SetSizeToScale(size) + SV:SetReversePoint(resting, iconDB.restIcon.attachTo, MASTER_GRIP, iconDB.restIcon.xOffset, iconDB.restIcon.yOffset) if not self:IsElementEnabled("Resting")then self:EnableElement("Resting") end @@ -185,8 +185,8 @@ local UpdatePlayerFrame = function(self) if iconDB and iconDB.combatIcon and iconDB.combatIcon.enable then local size = iconDB.combatIcon.size; combat:ClearAllPoints() - combat:Size(size) - SV:SetReversePoint(combat, iconDB.combatIcon.attachTo, healthPanel, iconDB.combatIcon.xOffset, iconDB.combatIcon.yOffset) + combat:SetSizeToScale(size) + SV:SetReversePoint(combat, iconDB.combatIcon.attachTo, MASTER_GRIP, iconDB.combatIcon.xOffset, iconDB.combatIcon.yOffset) if not self:IsElementEnabled("Combat")then self:EnableElement("Combat") end @@ -200,7 +200,7 @@ local UpdatePlayerFrame = function(self) local pvp = self.PvPText; local point = db.pvp.position; pvp:ClearAllPoints() - pvp:Point(db.pvp.position, healthPanel, db.pvp.position) + pvp:SetPointToScale(db.pvp.position, MASTER_GRIP, db.pvp.position) self:Tag(pvp, db.pvp.tags) end do @@ -307,19 +307,19 @@ CONSTRUCTORS["player"] = function(self, unit) MOD:CreatePortrait(self, false, true) self.Buffs = MOD:CreateBuffs(self, key) self.Debuffs = MOD:CreateDebuffs(self, key) - self.Castbar = MOD:CreateCastbar(self, false, L["Player Castbar"], true, true) + self.Castbar = MOD:CreateCastbar(self, false, L["Player Castbar"], true, true, false, true) MOD:CreateExperienceRepBar(self) self.ClassBar = MOD:CreateClassBar(self) self.RaidIcon = MOD:CreateRaidIcon(self) self.Resting = MOD:CreateRestingIndicator(self) self.Combat = MOD:CreateCombatIndicator(self) - self.PvPText = self.InfoPanel:CreateFontString(nil,'OVERLAY') - self.PvPText:FontManager(LSM:Fetch("font", SV.db.SVUnit.font), SV.db.SVUnit.fontSize, SV.db.SVUnit.fontOutline) + self.PvPText = self.TextGrip:CreateFontString(nil,'OVERLAY') + self.PvPText:FontManager("name") self.Afflicted = MOD:CreateAfflicted(self) self.HealPrediction = MOD:CreateHealPrediction(self, true) self.AuraBars = MOD:CreateAuraBarHeader(self, key) self.CombatFade = true; - self:Point("BOTTOMLEFT", SV.Screen, "BOTTOM", -413, 182) + self:SetPointToScale("BOTTOMLEFT", SV.Screen, "BOTTOM", -413, 182) SV.Mentalo:Add(self, L["Player Frame"]) self.MediaUpdate = MOD.RefreshUnitMedia @@ -342,8 +342,8 @@ local UpdateTargetFrame = function(self) MOD.RefreshUnitMedia(self, "target") self.colors = oUF_Villain.colors; - self:Size(UNIT_WIDTH, UNIT_HEIGHT) - _G[self:GetName().."_MOVE"]:Size(self:GetSize()) + self:SetSizeToScale(UNIT_WIDTH, UNIT_HEIGHT) + _G[self:GetName().."_MOVE"]:SetSizeToScale(self:GetSize()) if not self:IsElementEnabled("ActionPanel")then self:EnableElement("ActionPanel") end @@ -433,7 +433,7 @@ CONSTRUCTORS["target"] = function(self, unit) self.Range = { insideAlpha = 1, outsideAlpha = 1 } self.XRay = MOD:CreateXRay(self) self.XRay:SetPoint("TOPRIGHT", 12, 12) - self:Point("BOTTOMRIGHT", SV.Screen, "BOTTOM", 413, 182) + self:SetPointToScale("BOTTOMRIGHT", SV.Screen, "BOTTOM", 413, 182) SV.Mentalo:Add(self, L["Target Frame"]) self.MediaUpdate = MOD.RefreshUnitMedia @@ -452,8 +452,8 @@ local UpdateTargetTargetFrame = function(self) self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "targettarget") self.colors = oUF_Villain.colors; - self:Size(UNIT_WIDTH, UNIT_HEIGHT) - _G[self:GetName().."_MOVE"]:Size(self:GetSize()) + self:SetSizeToScale(UNIT_WIDTH, UNIT_HEIGHT) + _G[self:GetName().."_MOVE"]:SetSizeToScale(self:GetSize()) MOD:RefreshUnitLayout(self, "targettarget") self:UpdateAllElements() end @@ -475,7 +475,7 @@ CONSTRUCTORS["targettarget"] = function(self, unit) self.Debuffs = MOD:CreateDebuffs(self, key) self.RaidIcon = MOD:CreateRaidIcon(self) self.Range = { insideAlpha = 1, outsideAlpha = 1 } - self:Point("BOTTOM", SV.Screen, "BOTTOM", 0, 213) + self:SetPointToScale("BOTTOM", SV.Screen, "BOTTOM", 0, 192) SV.Mentalo:Add(self, L["TargetTarget Frame"]) self.MediaUpdate = MOD.RefreshUnitMedia @@ -494,8 +494,8 @@ local UpdatePetFrame = function(self) self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "pet") self.colors = oUF_Villain.colors; - self:Size(UNIT_WIDTH, UNIT_HEIGHT) - _G[self:GetName().."_MOVE"]:Size(self:GetSize()) + self:SetSizeToScale(UNIT_WIDTH, UNIT_HEIGHT) + _G[self:GetName().."_MOVE"]:SetSizeToScale(self:GetSize()) MOD:RefreshUnitLayout(self, "pet") do if SVUI_Player and not InCombatLockdown()then @@ -526,7 +526,7 @@ CONSTRUCTORS["pet"] = function(self, unit) self.AuraWatch = MOD:CreateAuraWatch(self, key) self.RaidIcon = MOD:CreateRaidIcon(self) self.Range = { insideAlpha = 1, outsideAlpha = 1 } - self:Point("BOTTOM", SV.Screen, "BOTTOM", 0, 182) + self:SetPointToScale("RIGHT", SVUI_Player, "LEFT", -2, 0) SV.Mentalo:Add(self, L["Pet Frame"]) self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdatePetFrame @@ -544,8 +544,8 @@ local UpdatePetTargetFrame = function(self) self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "pettarget") self.colors = oUF_Villain.colors; - self:Size(UNIT_WIDTH, UNIT_HEIGHT) - _G[self:GetName().."_MOVE"]:Size(self:GetSize()) + self:SetSizeToScale(UNIT_WIDTH, UNIT_HEIGHT) + _G[self:GetName().."_MOVE"]:SetSizeToScale(self:GetSize()) MOD:RefreshUnitLayout(self, "pettarget") do if SVUI_Pet and not InCombatLockdown()then @@ -570,7 +570,7 @@ CONSTRUCTORS["pettarget"] = function(self, unit) self.Buffs = MOD:CreateBuffs(self, key) self.Debuffs = MOD:CreateDebuffs(self, key) self.Range = { insideAlpha = 1, outsideAlpha = 1 } - self:Point("BOTTOM", SVUI_Pet, "TOP", 0, 7) + self:SetPointToScale("BOTTOM", SVUI_Pet, "TOP", 0, 7) SV.Mentalo:Add(self, L["PetTarget Frame"], -7) self.MediaUpdate = MOD.RefreshUnitMedia @@ -589,8 +589,8 @@ local UpdateFocusFrame = function(self) self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "focus") self.colors = oUF_Villain.colors; - self:Size(UNIT_WIDTH, UNIT_HEIGHT) - _G[self:GetName().."_MOVE"]:Size(self:GetSize()) + self:SetSizeToScale(UNIT_WIDTH, UNIT_HEIGHT) + _G[self:GetName().."_MOVE"]:SetSizeToScale(self:GetSize()) MOD:RefreshUnitLayout(self, "focus") if(SV.db.SVUnit.xrayFocus) then @@ -632,7 +632,7 @@ CONSTRUCTORS["focus"] = function(self, unit) self.Range = { insideAlpha = 1, outsideAlpha = 1 } self.XRay = MOD:CreateXRay_Closer(self) self.XRay:SetPoint("RIGHT", 20, 0) - self:Point("BOTTOMRIGHT", SVUI_Target, "TOPRIGHT", 0, 220) + self:SetPointToScale("BOTTOMRIGHT", SVUI_Target, "TOPRIGHT", 0, 220) SV.Mentalo:Add(self, L["Focus Frame"]) self.MediaUpdate = MOD.RefreshUnitMedia @@ -651,8 +651,8 @@ local UpdateFocusTargetFrame = function(self) self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "focustarget") self.colors = oUF_Villain.colors; - self:Size(UNIT_WIDTH, UNIT_HEIGHT) - _G[self:GetName().."_MOVE"]:Size(self:GetSize()) + self:SetSizeToScale(UNIT_WIDTH, UNIT_HEIGHT) + _G[self:GetName().."_MOVE"]:SetSizeToScale(self:GetSize()) MOD:RefreshUnitLayout(self, "focustarget") self:UpdateAllElements() end @@ -673,7 +673,7 @@ CONSTRUCTORS["focustarget"] = function(self, unit) self.Debuffs = MOD:CreateDebuffs(self, key) self.RaidIcon = MOD:CreateRaidIcon(self) self.Range = { insideAlpha = 1, outsideAlpha = 1 } - self:Point("BOTTOM", SVUI_Focus, "TOP", 0, 7) + self:SetPointToScale("LEFT", SVUI_Focus, "RIGHT", 12, 0) SV.Mentalo:Add(self, L["FocusTarget Frame"], -7) self.MediaUpdate = MOD.RefreshUnitMedia @@ -695,23 +695,23 @@ local UpdateBossFrame = function(self) MOD.RefreshUnitMedia(self, "boss") self.colors = oUF_Villain.colors; - self:Size(UNIT_WIDTH, UNIT_HEIGHT) + self:SetSizeToScale(UNIT_WIDTH, UNIT_HEIGHT) self:ClearAllPoints() if(tonumber(INDEX) == 1) then - holder:Width(UNIT_WIDTH) - holder:Height(UNIT_HEIGHT + (UNIT_HEIGHT + 12 + db.castbar.height) * 4) + holder:SetWidthToScale(UNIT_WIDTH) + holder:SetHeightToScale(UNIT_HEIGHT + (UNIT_HEIGHT + 12 + db.castbar.height) * 4) if db.showBy == "UP"then - self:Point("BOTTOMRIGHT", holder, "BOTTOMRIGHT") + self:SetPointToScale("BOTTOMRIGHT", holder, "BOTTOMRIGHT") else - self:Point("TOPRIGHT", holder, "TOPRIGHT") + self:SetPointToScale("TOPRIGHT", holder, "TOPRIGHT") end else local yOffset = (UNIT_HEIGHT + 12 + db.castbar.height) * (INDEX - 1) if db.showBy == "UP"then - self:Point("BOTTOMRIGHT", holder, "BOTTOMRIGHT", 0, yOffset) + self:SetPointToScale("BOTTOMRIGHT", holder, "BOTTOMRIGHT", 0, yOffset) else - self:Point("TOPRIGHT", holder, "TOPRIGHT", 0, -yOffset) + self:SetPointToScale("TOPRIGHT", holder, "TOPRIGHT", 0, -yOffset) end end @@ -750,10 +750,10 @@ CONSTRUCTORS["boss"] = function(self, unit) self:SetAttribute("type2", "focus") if(not _G["SVUI_Boss_MOVE"]) then - self:Point("RIGHT", SV.Screen, "RIGHT", -105, 0) + self:SetPointToScale("RIGHT", SV.Screen, "RIGHT", -105, 0) SV.Mentalo:Add(self, L["Boss Frames"], nil, nil, "SVUI_Boss") else - self:Point("TOPRIGHT", lastBossFrame, "BOTTOMRIGHT", 0, -20) + self:SetPointToScale("TOPRIGHT", lastBossFrame, "BOTTOMRIGHT", 0, -20) end self.MediaUpdate = MOD.RefreshUnitMedia @@ -776,25 +776,25 @@ local UpdateArenaFrame = function(self) MOD.RefreshUnitMedia(self, "arena") self.colors = oUF_Villain.colors; - self:Size(UNIT_WIDTH, UNIT_HEIGHT) + self:SetSizeToScale(UNIT_WIDTH, UNIT_HEIGHT) self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") self:ClearAllPoints() if(tonumber(INDEX) == 1) then - holder:Width(UNIT_WIDTH) - holder:Height(UNIT_HEIGHT + (UNIT_HEIGHT + 12 + db.castbar.height) * 4) + holder:SetWidthToScale(UNIT_WIDTH) + holder:SetHeightToScale(UNIT_HEIGHT + (UNIT_HEIGHT + 12 + db.castbar.height) * 4) if(db.showBy == "UP") then - self:Point("BOTTOMRIGHT", holder, "BOTTOMRIGHT") + self:SetPointToScale("BOTTOMRIGHT", holder, "BOTTOMRIGHT") else - self:Point("TOPRIGHT", holder, "TOPRIGHT") + self:SetPointToScale("TOPRIGHT", holder, "TOPRIGHT") end else local yOffset = (UNIT_HEIGHT + 12 + db.castbar.height) * (INDEX - 1) if(db.showBy == "UP") then - self:Point("BOTTOMRIGHT", holder, "BOTTOMRIGHT", 0, yOffset) + self:SetPointToScale("BOTTOMRIGHT", holder, "BOTTOMRIGHT", 0, yOffset) else - self:Point("TOPRIGHT", holder, "TOPRIGHT", 0, -yOffset) + self:SetPointToScale("TOPRIGHT", holder, "TOPRIGHT", 0, -yOffset) end end @@ -808,23 +808,23 @@ local UpdateArenaFrame = function(self) local leftAnchor = self local rightAnchor = self - trinket:Size(db.pvp.trinketSize) + trinket:SetSizeToScale(db.pvp.trinketSize) trinket:ClearAllPoints() if(db.pvp.trinketPosition == "RIGHT") then - trinket:Point("LEFT", rightAnchor, "RIGHT", db.pvp.trinketX, db.pvp.trinketY) + trinket:SetPointToScale("LEFT", rightAnchor, "RIGHT", db.pvp.trinketX, db.pvp.trinketY) rightAnchor = trinket else - trinket:Point("RIGHT", leftAnchor, "LEFT", db.pvp.trinketX, db.pvp.trinketY) + trinket:SetPointToScale("RIGHT", leftAnchor, "LEFT", db.pvp.trinketX, db.pvp.trinketY) leftAnchor = trinket end - badge:Size(db.pvp.specSize) + badge:SetSizeToScale(db.pvp.specSize) badge:ClearAllPoints() if(db.pvp.specPosition == "RIGHT") then - badge:Point("LEFT", rightAnchor, "RIGHT", db.pvp.specX, db.pvp.specY) + badge:SetPointToScale("LEFT", rightAnchor, "RIGHT", db.pvp.specX, db.pvp.specY) rightAnchor = badge else - badge:Point("RIGHT", leftAnchor, "LEFT", db.pvp.specX, db.pvp.specY) + badge:SetPointToScale("RIGHT", leftAnchor, "LEFT", db.pvp.specX, db.pvp.specY) leftAnchor = badge end @@ -878,7 +878,7 @@ CONSTRUCTORS["arena"] = function(self, unit) prep:SetFrameStrata("MEDIUM") prep:SetAllPoints(self) prep:SetID(selfID) - prep:SetPanelTemplate("Bar", true, 3, 1, 1) + prep:SetStylePanel("Default", "Bar", true, 3, 1, 1) local health = CreateFrame("StatusBar", nil, prep) health:SetAllPoints(prep) @@ -905,7 +905,7 @@ CONSTRUCTORS["arena"] = function(self, unit) icon:SetBackdropBorderColor(0, 0, 0) icon.Icon = icon:CreateTexture(nil, "OVERLAY") icon.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - icon.Icon:FillInner(icon, 2, 2) + icon.Icon:SetAllPointsIn(icon, 2, 2) prep.SpecIcon = icon local text = prep.Health:CreateFontString(nil, "OVERLAY") @@ -918,10 +918,10 @@ CONSTRUCTORS["arena"] = function(self, unit) end if(not _G["SVUI_Arena_MOVE"]) then - self:Point("RIGHT", SV.Screen, "RIGHT", -105, 0) + self:SetPointToScale("RIGHT", SV.Screen, "RIGHT", -105, 0) SV.Mentalo:Add(self, L["Arena Frames"], nil, nil, "SVUI_Arena") else - self:Point("TOPRIGHT", lastArenaFrame, "BOTTOMRIGHT", 0, -20) + self:SetPointToScale("TOPRIGHT", lastArenaFrame, "BOTTOMRIGHT", 0, -20) end self.MediaUpdate = MOD.RefreshUnitMedia @@ -969,7 +969,7 @@ local ArenaPrepHandler_OnEvent = function(self, event) prepframe.SpecClass:SetText(spec .. " - " .. LOCALIZED_CLASS_NAMES_MALE[class]) prepframe.SpecIcon.Icon:SetTexture(icon or [[INTERFACE\ICONS\INV_MISC_QUESTIONMARK]]) - local color = SVUI_CLASS_COLORS[class] + local color = CUSTOM_CLASS_COLORS[class] local textcolor = RAID_CLASS_COLORS[class] or color if color then prepframe.Health:SetStatusBarColor(color.r, color.g, color.b) diff --git a/Interface/AddOns/SVUI/packages/unit/groups.lua b/Interface/AddOns/SVUI/packages/unit/groups.lua index ddf354f..93f7869 100644 --- a/Interface/AddOns/SVUI/packages/unit/groups.lua +++ b/Interface/AddOns/SVUI/packages/unit/groups.lua @@ -61,18 +61,40 @@ if(not MOD) then return end LOCAL DATA ########################################################## ]]-- +local GROUP_ICON_FILE = [[Interface\AddOns\SVUI\assets\artwork\Numbers\TYPE1\NUM]]; + +local GroupCounts = { + ['raid'] = 8, + ['raidpet'] = 2, + ['party'] = 1 +}; + local sortMapping = { - ["DOWN_RIGHT"] = {[1]="TOP",[2]="TOPLEFT",[3]="LEFT",[4]=1,[5]=-1,[6]=false}, - ["DOWN_LEFT"] = {[1]="TOP",[2]="TOPRIGHT",[3]="RIGHT",[4]=1,[5]=-1,[6]=false}, - ["UP_RIGHT"] = {[1]="BOTTOM",[2]="BOTTOMLEFT",[3]="LEFT",[4]=1,[5]=1,[6]=false}, - ["UP_LEFT"] = {[1]="BOTTOM",[2]="BOTTOMRIGHT",[3]="RIGHT",[4]=-1,[5]=1,[6]=false}, - ["RIGHT_DOWN"] = {[1]="LEFT",[2]="TOPLEFT",[3]="TOP",[4]=1,[5]=-1,[6]=true}, - ["RIGHT_UP"] = {[1]="LEFT",[2]="BOTTOMLEFT",[3]="BOTTOM",[4]=1,[5]=1,[6]=true}, - ["LEFT_DOWN"] = {[1]="RIGHT",[2]="TOPRIGHT",[3]="TOP",[4]=-1,[5]=-1,[6]=true}, - ["LEFT_UP"] = {[1]="RIGHT",[2]="BOTTOMRIGHT",[3]="BOTTOM",[4]=-1,[5]=1,[6]=true}, - ["UP"] = {[1]="BOTTOM",[2]="BOTTOM",[3]="BOTTOM",[4]=1,[5]=1,[6]=false}, - ["DOWN"] = {[1]="TOP",[2]="TOP",[3]="TOP",[4]=1,[5]=1,[6]=false}, -} + ["DOWN_RIGHT"] = { [1] = "TOP", [2] = "TOPLEFT", [3] = "LEFT", [4] = 1, [5] = -1, [6] = false }, + ["DOWN_LEFT"] = { [1] = "TOP", [2] = "TOPRIGHT", [3] = "RIGHT", [4] = 1, [5] = -1, [6] = false }, + ["UP_RIGHT"] = { [1] = "BOTTOM", [2] = "BOTTOMLEFT", [3] = "LEFT", [4] = 1, [5] = 1, [6] = false }, + ["UP_LEFT"] = { [1] = "BOTTOM", [2] = "BOTTOMRIGHT", [3] = "RIGHT", [4] = -1, [5] = 1, [6] = false }, + ["RIGHT_DOWN"] = { [1] = "LEFT", [2] = "TOPLEFT", [3] = "TOP", [4] = 1, [5] = -1, [6] = true }, + ["RIGHT_UP"] = { [1] = "LEFT", [2] = "BOTTOMLEFT", [3] = "BOTTOM", [4] = 1, [5] = 1, [6] = true }, + ["LEFT_DOWN"] = { [1] = "RIGHT", [2] = "TOPRIGHT", [3] = "TOP", [4] = -1, [5] = -1, [6] = true }, + ["LEFT_UP"] = { [1] = "RIGHT", [2] = "BOTTOMRIGHT", [3] = "BOTTOM", [4] = -1, [5] = 1, [6] = true }, + ["UP"] = { [1] = "BOTTOM", [2] = "BOTTOM", [3] = "BOTTOM", [4] = 1, [5] = 1, [6] = false }, + ["DOWN"] = { [1] = "TOP", [2] = "TOP", [3] = "TOP", [4] = 1, [5] = 1, [6] = false }, +}; + +local groupTagPoints = { + ["DOWN_RIGHT"] = { [1] = "BOTTOM", [2] = "TOP", [3] = 1 }, + ["DOWN_LEFT"] = { [1] = "BOTTOM", [2] = "TOP", [3] = 1 }, + ["UP_RIGHT"] = { [1] = "TOP", [2] = "BOTTOM", [3] = -1 }, + ["UP_LEFT"] = { [1] = "TOP", [2] = "BOTTOM", [3] = -1 }, + ["RIGHT_DOWN"] = { [1] = "RIGHT", [2] = "LEFT", [3] = -1 }, + ["RIGHT_UP"] = { [1] = "RIGHT", [2] = "LEFT", [3] = -1 }, + ["LEFT_DOWN"] = { [1] = "LEFT", [2] = "RIGHT", [3] = 1 }, + ["LEFT_UP"] = { [1] = "LEFT", [2] = "RIGHT", [3] = 1 }, + ["UP"] = { [1] = "TOP", [2] = "BOTTOM", [3] = -1 }, + ["DOWN"] = { [1] = "BOTTOM", [2] = "TOP", [3] = 1 }, +}; + local GroupDistributor = { ["CLASS"] = function(x) x:SetAttribute("groupingOrder","DEATHKNIGHT,DRUID,HUNTER,MAGE,PALADIN,PRIEST,SHAMAN,WARLOCK,WARRIOR,MONK") @@ -235,7 +257,7 @@ local PartyUnitUpdate = function(self) if altDB.enable then local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(altDB) self:SetParent(self.originalParent) - self:Size(UNIT_WIDTH, UNIT_HEIGHT) + self:SetSizeToScale(UNIT_WIDTH, UNIT_HEIGHT) self:ClearAllPoints() SV:SetReversePoint(self, altDB.anchorPoint, self.originalParent, altDB.xOffset, altDB.yOffset) else @@ -251,17 +273,17 @@ local PartyUnitUpdate = function(self) health.colorClass = true; health.colorReaction = true; health:ClearAllPoints() - health:Point("TOPRIGHT", self, "TOPRIGHT", -1, -1) - health:Point("BOTTOMLEFT", self, "BOTTOMLEFT", 1, 1) + health:SetPointToScale("TOPRIGHT", self, "TOPRIGHT", -1, -1) + health:SetPointToScale("BOTTOMLEFT", self, "BOTTOMLEFT", 1, 1) end do - local nametext = self.InfoPanel.Name + local nametext = self.TextGrip.Name self:Tag(nametext, altDB.tags) end else if not InCombatLockdown() then local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db, "party") - self:Size(UNIT_WIDTH, UNIT_HEIGHT) + self:SetSizeToScale(UNIT_WIDTH, UNIT_HEIGHT) end MOD:RefreshUnitLayout(self, "party") MOD:UpdateAuraWatch(self, "party") @@ -277,7 +299,7 @@ UpdateTemplates["party"] = function(self) if not groupFrame.positioned then groupFrame:ClearAllPoints() - groupFrame:Point("BOTTOMLEFT", SV.Dock.BottomLeft, "TOPLEFT", 0, 80) + groupFrame:SetPointToScale("BOTTOMLEFT", SV.Dock.BottomLeft, "TOPLEFT", 0, 80) RegisterStateDriver(groupFrame, "visibility", "[group:raid][nogroup] hide;show") SV.Mentalo:Add(groupFrame, L['Party Frames']); groupFrame.positioned = true; @@ -339,7 +361,7 @@ BuildTemplates["party"] = function(self, unit) local shadow = CreateFrame("Frame", nil, self) shadow:SetFrameLevel(1) shadow:SetFrameStrata(self:GetFrameStrata()) - shadow:WrapOuter(self, 3, 3) + shadow:SetAllPointsOut(self, 3, 3) shadow:SetBackdrop({ edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], edgeSize = 3, @@ -381,7 +403,7 @@ local RaidUnitUpdate = function(self) local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db) if not InCombatLockdown() then - self:Size(UNIT_WIDTH, UNIT_HEIGHT) + self:SetSizeToScale(UNIT_WIDTH, UNIT_HEIGHT) end do @@ -391,8 +413,8 @@ local RaidUnitUpdate = function(self) self:EnableElement("RaidDebuffs") end local actualSz = numMin(db.rdebuffs.size, (UNIT_HEIGHT - 8)) - rdBuffs:Size(actualSz) - rdBuffs:Point("CENTER", self, "CENTER", db.rdebuffs.xOffset, db.rdebuffs.yOffset) + rdBuffs:SetSizeToScale(actualSz) + rdBuffs:SetPointToScale("CENTER", self, "CENTER", db.rdebuffs.xOffset, db.rdebuffs.yOffset) rdBuffs:Show() else self:DisableElement("RaidDebuffs") @@ -413,12 +435,12 @@ end UpdateTemplates["raid"] = function(self) if(SV.NeedsFrameAudit) then return end local db = SV.db.SVUnit.raid - local groupFrame = self:GetParent() + local groupFrame = self:GetParent() if not groupFrame.positioned then groupFrame:ClearAllPoints() - groupFrame:Point("BOTTOMLEFT", SV.Dock.BottomLeft, "TOPLEFT", 0, 80) - RegisterStateDriver(groupFrame, "visibility", "[group:raid] show; hide") + groupFrame:SetPointToScale("BOTTOMLEFT", SV.Dock.BottomLeft, "TOPLEFT", 0, 80) + RegisterStateDriver(groupFrame, "visibility", "[group:raid] show;hide") SV.Mentalo:Add(groupFrame, "Raid Frames") groupFrame.positioned = true end @@ -477,7 +499,7 @@ BuildTemplates["raid"] = function(self, unit) local shadow = CreateFrame("Frame", nil, self) shadow:SetFrameLevel(1) shadow:SetFrameStrata(self:GetFrameStrata()) - shadow:WrapOuter(self, 3, 3) + shadow:SetAllPointsOut(self, 3, 3) shadow:SetBackdrop({ edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], edgeSize = 3, @@ -514,8 +536,8 @@ UpdateTemplates["raidpet"] = function(self) if not groupFrame.positioned then groupFrame:ClearAllPoints() - groupFrame:Point("BOTTOMLEFT", SV.Screen, "BOTTOMLEFT", 4, 433) - RegisterStateDriver(groupFrame, "visibility", "[group:raid] show; hide") + groupFrame:SetPointToScale("BOTTOMLEFT", SV.Screen, "BOTTOMLEFT", 4, 433) + RegisterStateDriver(groupFrame, "visibility", "[group:raid] show;hide") SV.Mentalo:Add(groupFrame, L["Raid Pet Frames"]) groupFrame.positioned = true; end @@ -567,7 +589,7 @@ BuildTemplates["raidpet"] = function(self, unit) local shadow = CreateFrame("Frame", nil, self) shadow:SetFrameLevel(1) shadow:SetFrameStrata(self:GetFrameStrata()) - shadow:WrapOuter(self, 3, 3) + shadow:SetAllPointsOut(self, 3, 3) shadow:SetBackdrop({ edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], edgeSize = 3, @@ -608,7 +630,7 @@ local TankUnitUpdate = function(self) if targets.enable then local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(targets) self:SetParent(self.originalParent) - self:Size(UNIT_WIDTH, UNIT_HEIGHT) + self:SetSizeToScale(UNIT_WIDTH, UNIT_HEIGHT) self:ClearAllPoints() SV:SetReversePoint(self, targets.anchorPoint, self.originalParent, targets.xOffset, targets.yOffset) else @@ -617,11 +639,11 @@ local TankUnitUpdate = function(self) end elseif not InCombatLockdown() then local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db) - self:Size(UNIT_WIDTH, UNIT_HEIGHT) + self:SetSizeToScale(UNIT_WIDTH, UNIT_HEIGHT) end MOD:RefreshUnitLayout(self, "tank") do - local nametext = self.InfoPanel.Name; + local nametext = self.TextGrip.Name; if oUF_Villain.colors.healthclass then self:Tag(nametext, "[name:10]") else @@ -646,7 +668,7 @@ UpdateTemplates["tank"] = function(self) self:SetAttribute("startingIndex", -1) RegisterAttributeDriver(self, "state-visibility", "show") self.dirtyWidth, self.dirtyHeight = self:GetSize() - RegisterAttributeDriver(self, "state-visibility", "[@raid1, exists] show;hide") + RegisterAttributeDriver(self, "state-visibility", "[group:raid] show;hide") self:SetAttribute("startingIndex", 1) self:SetAttribute("point", "BOTTOM") self:SetAttribute("columnAnchorPoint", "LEFT") @@ -655,7 +677,7 @@ UpdateTemplates["tank"] = function(self) if not self.positioned then self:ClearAllPoints() - self:Point("BOTTOMLEFT", SV.Dock.TopLeft, "BOTTOMLEFT", 0, 0) + self:SetPointToScale("BOTTOMLEFT", SV.Dock.TopLeft, "BOTTOMLEFT", 0, 0) SV.Mentalo:Add(self, L["Tank Frames"]) self.Grip.positionOverride = "TOPLEFT" self:SetAttribute("minHeight", self.dirtyHeight) @@ -722,7 +744,7 @@ local AssistUnitUpdate = function(self) if targets.enable then local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(targets) self:SetParent(self.originalParent) - self:Size(UNIT_WIDTH, UNIT_HEIGHT) + self:SetSizeToScale(UNIT_WIDTH, UNIT_HEIGHT) self:ClearAllPoints() SV:SetReversePoint(self, targets.anchorPoint, self.originalParent, targets.xOffset, targets.yOffset) else @@ -731,13 +753,13 @@ local AssistUnitUpdate = function(self) end elseif not InCombatLockdown() then local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db) - self:Size(UNIT_WIDTH, UNIT_HEIGHT) + self:SetSizeToScale(UNIT_WIDTH, UNIT_HEIGHT) end MOD:RefreshUnitLayout(self, "assist") do - local nametext = self.InfoPanel.Name; + local nametext = self.TextGrip.Name; if oUF_Villain.colors.healthclass then self:Tag(nametext, "[name:10]") else @@ -756,7 +778,7 @@ UpdateTemplates["assist"] = function(self) self:SetAttribute("startingIndex", -1) RegisterAttributeDriver(self, "state-visibility", "show") self.dirtyWidth, self.dirtyHeight = self:GetSize() - RegisterAttributeDriver(self, "state-visibility", "[@raid1, exists] show;hide") + RegisterAttributeDriver(self, "state-visibility", "[group:raid] show;hide") self:SetAttribute("startingIndex", 1) self:SetAttribute("point", "BOTTOM") self:SetAttribute("columnAnchorPoint", "LEFT") @@ -765,7 +787,7 @@ UpdateTemplates["assist"] = function(self) if not self.positioned then self:ClearAllPoints() - self:Point("TOPLEFT", SV.Dock.TopLeft, "BOTTOMLEFT", 0, -10) + self:SetPointToScale("TOPLEFT", SV.Dock.TopLeft, "BOTTOMLEFT", 0, -10) SV.Mentalo:Add(self, L["Assist Frames"]) self.Grip.positionOverride = "TOPLEFT" self:SetAttribute("minHeight", self.dirtyHeight) @@ -893,7 +915,7 @@ local HeaderDisableChildren = function(self) end end -function MOD:SetGroupHeader(parentFrame, filter, layout, headerName, token) +function MOD:SetGroupHeader(parentFrame, filter, layout, headerName, token, groupTag) local db = SV.db.SVUnit[token] local template1, template2 @@ -919,13 +941,25 @@ function MOD:SetGroupHeader(parentFrame, filter, layout, headerName, token) "showSolo", true, template1 and "template", template1 ) - groupHeader.___groupkey = token - groupHeader:SetParent(parentFrame) - groupHeader.Update = UpdateTemplates[token] - groupHeader.MediaUpdate = HeaderMediaUpdate - groupHeader.UnsetAttributes = HeaderUnsetAttributes - groupHeader.EnableChildren = HeaderEnableChildren - groupHeader.DisableChildren = HeaderDisableChildren + groupHeader.___groupkey = token; + groupHeader:SetParent(parentFrame); + groupHeader.Update = UpdateTemplates[token]; + groupHeader.MediaUpdate = HeaderMediaUpdate; + groupHeader.UnsetAttributes = HeaderUnsetAttributes; + groupHeader.EnableChildren = HeaderEnableChildren; + groupHeader.DisableChildren = HeaderDisableChildren; + + if(groupTag) then + local icon = GROUP_ICON_FILE .. groupTag + local tag = CreateFrame("Frame", nil, groupHeader); + tag:SetSize(16,16) + tag:SetPoint('RIGHT', groupHeader, 'LEFT', -10, 0) + tag.Icon = tag:CreateTexture(nil, 'BORDER') + tag.Icon:SetAllPoints(tag) + tag.Icon:SetTexture(icon) + + groupHeader.GroupTag = tag + end return groupHeader end @@ -957,9 +991,9 @@ local GroupSetVisibility = function(self) local token = self.___groupkey local db = SV.db.SVUnit[token] if(db) then - for i=1,#self.groups do + for i=1, #self.groups do local frame = self.groups[i] - if(i <= db.groupCount) then + if(db.allowedGroup[i]) then frame:Show() else if frame.forceShow then @@ -977,19 +1011,20 @@ end local GroupConfigure = function(self) local token = self.___groupkey + local groupCount = self.___groupcount local settings = SV.db.SVUnit[token] local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(settings) local sorting = settings.showBy local sortMethod = settings.sortMethod local widthCalc, heightCalc, xCalc, yCalc = 0, 0, 0, 0; local point, anchorPoint, columnAnchor, horizontal, vertical, isHorizontal = unpack(sortMapping[sorting]); - local groupCount = settings.groupCount + local tagPoint1, tagPoint2, mod = unpack(groupTagPoints[sorting]); self.groupCount = groupCount for i = 1, groupCount do - local frame = self.groups[i] + local frameEnabled = true; if(frame) then if(settings.showBy == "UP") then @@ -1035,53 +1070,81 @@ local GroupConfigure = function(self) end frame:SetAttribute("groupFilter", tostring(i)) - end - if (i - 1) % settings.gRowCol == 0 then - if isHorizontal then - if(frame) then - frame:SetPoint(anchorPoint, self, anchorPoint, 0, heightCalc * vertical) + if(frame.GroupTag) then + if(settings.showGroupNumber) then + local x,y = 0,0; + local size = settings.height * 0.65; + if(isHorizontal) then + x,y = (10 * mod),0; + widthCalc = size + 10 + else + x,y = 0,(10 * mod); + heightCalc = size + 10 + end + frame.GroupTag:Show() + frame.GroupTag:SetSizeToScale(size) + frame.GroupTag:SetPoint(tagPoint1, frame, tagPoint2, x, y) + else + frame.GroupTag:Hide() end + end - heightCalc = heightCalc + UNIT_HEIGHT + settings.wrapYOffset; - yCalc = yCalc + 1 - else - if(frame) then frame:SetPoint(anchorPoint, self, anchorPoint, widthCalc * horizontal, 0) end + if(not settings.allowedGroup[i]) then + frame:Hide() + frameEnabled = false; + else + frame:Show() + end + end - widthCalc = widthCalc + UNIT_WIDTH + settings.wrapXOffset; - xCalc = xCalc + 1 - end - else - if isHorizontal then - if yCalc == 1 then - if(frame) then - frame:SetPoint(anchorPoint, self, anchorPoint, widthCalc * horizontal, 0) - end - - widthCalc = widthCalc + (UNIT_WIDTH + settings.wrapXOffset) * 5; - xCalc = xCalc + 1 - elseif(frame) then - frame:SetPoint(anchorPoint, self, anchorPoint, (((UNIT_WIDTH + settings.wrapXOffset) * 5) * ((i - 1) % settings.gRowCol)) * horizontal, ((UNIT_HEIGHT + settings.wrapYOffset) * (yCalc - 1)) * vertical) - end - else - if xCalc == 1 then + if(frameEnabled) then + if (i - 1) % settings.gRowCol == 0 then + if isHorizontal then if(frame) then frame:SetPoint(anchorPoint, self, anchorPoint, 0, heightCalc * vertical) end - heightCalc = heightCalc + (UNIT_HEIGHT + settings.wrapYOffset) * 5; + heightCalc = heightCalc + UNIT_HEIGHT + settings.wrapYOffset; yCalc = yCalc + 1 - elseif(frame) then - frame:SetPoint(anchorPoint, self, anchorPoint, ((UNIT_WIDTH + settings.wrapXOffset) * (xCalc - 1)) * horizontal, (((UNIT_HEIGHT + settings.wrapYOffset) * 5) * ((i - 1) % settings.gRowCol)) * vertical) + else + if(frame) then frame:SetPoint(anchorPoint, self, anchorPoint, widthCalc * horizontal, 0) end + + widthCalc = widthCalc + UNIT_WIDTH + settings.wrapXOffset; + xCalc = xCalc + 1 end - end - end + else + if isHorizontal then + if yCalc == 1 then + if(frame) then + frame:SetPoint(anchorPoint, self, anchorPoint, widthCalc * horizontal, 0) + end + + widthCalc = widthCalc + (UNIT_WIDTH + settings.wrapXOffset) * 5; + xCalc = xCalc + 1 + elseif(frame) then + frame:SetPoint(anchorPoint, self, anchorPoint, (((UNIT_WIDTH + settings.wrapXOffset) * 5) * ((i - 1) % settings.gRowCol)) * horizontal, ((UNIT_HEIGHT + settings.wrapYOffset) * (yCalc - 1)) * vertical) + end + else + if xCalc == 1 then + if(frame) then + frame:SetPoint(anchorPoint, self, anchorPoint, 0, heightCalc * vertical) + end + + heightCalc = heightCalc + (UNIT_HEIGHT + settings.wrapYOffset) * 5; + yCalc = yCalc + 1 + elseif(frame) then + frame:SetPoint(anchorPoint, self, anchorPoint, ((UNIT_WIDTH + settings.wrapXOffset) * (xCalc - 1)) * horizontal, (((UNIT_HEIGHT + settings.wrapYOffset) * 5) * ((i - 1) % settings.gRowCol)) * vertical) + end + end + end - if heightCalc == 0 then - heightCalc = heightCalc + (UNIT_HEIGHT + settings.wrapYOffset) * 5 - elseif widthCalc == 0 then - widthCalc = widthCalc + (UNIT_WIDTH + settings.wrapXOffset) * 5 - end + if heightCalc == 0 then + heightCalc = heightCalc + (UNIT_HEIGHT + settings.wrapYOffset) * 5 + elseif widthCalc == 0 then + widthCalc = widthCalc + (UNIT_WIDTH + settings.wrapXOffset) * 5 + end + end end self:SetSize(widthCalc - settings.wrapXOffset, heightCalc - settings.wrapYOffset) @@ -1093,6 +1156,7 @@ function MOD:GetGroupFrame(token, layout) oUF_Villain:SetActiveStyle(layout) local groupFrame = CreateFrame("Frame", layout, SVUI_UnitFrameParent, "SecureHandlerStateTemplate") groupFrame.___groupkey = token; + groupFrame.___groupcount = GroupCounts[token] or 1 groupFrame.groups = {} groupFrame.Update = GroupUpdate groupFrame.MediaUpdate = GroupMediaUpdate @@ -1135,11 +1199,12 @@ function MOD:SetGroupFrame(token, forceUpdate) return end - local groupName - for i = 1, settings.groupCount do + local groupCount = GroupCounts[token] or 1 + local groupName; + for i = 1, groupCount do if(not groupFrame.groups[i]) then - groupName = layout .. "Group" .. i - groupFrame.groups[i] = self:SetGroupHeader(groupFrame, i, layout, groupName, token) + groupName = layout .. "Group" .. i; + groupFrame.groups[i] = self:SetGroupHeader(groupFrame, i, layout, groupName, token, i) groupFrame.groups[i]:Show() end end diff --git a/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua b/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua index fe3148a..8db2fe6 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua @@ -70,7 +70,7 @@ local Reposition = function(self) local size = db.classbar.height local width = size * max; - bar.Holder:Size(width, size) + bar.Holder:SetSizeToScale(width, size) if(not db.classbar.detachFromFrame) then SV.Mentalo:Reset(L["Classbar"]) end @@ -89,9 +89,9 @@ local Reposition = function(self) if i==1 then bar[i]:SetPoint("TOPLEFT", bar, "TOPLEFT", 0, 0) elseif i == 2 then - bar[i]:Point("LEFT", bar[1], "RIGHT", -6, 0) + bar[i]:SetPointToScale("LEFT", bar[1], "RIGHT", -6, 0) else - bar[i]:Point("LEFT", bar[i - 1], "RIGHT", -2, 0) + bar[i]:SetPointToScale("LEFT", bar[i - 1], "RIGHT", -2, 0) end end if bar.UpdateAllRuneTypes then @@ -106,7 +106,7 @@ DEATHKNIGHT function MOD:CreateClassBar(playerFrame) local max = 6 local bar = CreateFrame("Frame", nil, playerFrame) - bar:SetFrameLevel(playerFrame.InfoPanel:GetFrameLevel() + 30) + bar:SetFrameLevel(playerFrame.TextGrip:GetFrameLevel() + 30) for i=1, max do local graphic = runeTextures[i] bar[i] = CreateFrame("StatusBar", nil, bar) @@ -122,7 +122,7 @@ function MOD:CreateClassBar(playerFrame) end local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) - classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) + classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder SV.Mentalo:Add(bar.Holder, L["Classbar"]) diff --git a/Interface/AddOns/SVUI/packages/unit/resources/druid.lua b/Interface/AddOns/SVUI/packages/unit/resources/druid.lua index d72b96f..bf4a6ae 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/druid.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/druid.lua @@ -54,7 +54,7 @@ DRUID ALT MANA local TRACKER_FONT = [[Interface\AddOns\SVUI\assets\fonts\Combo.ttf]] local UpdateAltPower = function(self, unit, arg1, arg2) - local value = self:GetParent().InfoPanel.Power; + local value = self:GetParent().TextGrip.Power; if(arg1 ~= arg2) then local color = oUF_Villain.colors.power.MANA color = SV:HexColor(color[1],color[2],color[3]) @@ -81,21 +81,21 @@ local function CreateAltMana(playerFrame, eclipse) bar:SetPoint("TOPLEFT", eclipse, "TOPLEFT", 38, -2) bar:SetPoint("TOPRIGHT", eclipse, "TOPRIGHT", 0, -2) bar:SetHeight(18) - bar:SetFixedPanelTemplate("Default") + bar:SetStylePanel("Fixed", "Default") bar:SetFrameLevel(bar:GetFrameLevel() + 1) bar.colorPower = true; bar.PostUpdatePower = UpdateAltPower; bar.ManaBar = CreateFrame("StatusBar", nil, bar) bar.ManaBar.noupdate = true; bar.ManaBar:SetStatusBarTexture(SV.Media.bar.glow) - bar.ManaBar:FillInner(bar) + bar.ManaBar:SetAllPointsIn(bar) bar.bg = bar:CreateTexture(nil, "BORDER") bar.bg:SetAllPoints(bar.ManaBar) bar.bg:SetTexture([[Interface\BUTTONS\WHITE8X8]]) bar.bg.multiplier = 0.3; bar.Text = bar.ManaBar:CreateFontString(nil, "OVERLAY") bar.Text:SetAllPoints(bar.ManaBar) - bar.Text:SetFont(LSM:Fetch("font", SV.db.SVUnit.font), SV.db.SVUnit.fontSize, SV.db.SVUnit.fontOutline) + bar.Text:FontManager("unitprimary") return bar end --[[ @@ -114,7 +114,7 @@ local Reposition = function(self) local scaled = (height * 0.8) local width = db.width * 0.4; - bar.Holder:Size(width, height) + bar.Holder:SetSizeToScale(width, height) if(not db.classbar.detachFromFrame) then SV.Mentalo:Reset(L["Classbar"]) end @@ -126,21 +126,21 @@ local Reposition = function(self) bar:ClearAllPoints() bar:SetAllPoints(bar.Holder) - bar.LunarBar:Size(width, adjustedBar) + bar.LunarBar:SetSizeToScale(width, adjustedBar) bar.LunarBar:SetMinMaxValues(0,0) bar.LunarBar:SetStatusBarColor(.13,.32,1) - bar.Moon:Size(height, height) - bar.Moon[1]:Size(adjustedAnim, adjustedAnim) - bar.Moon[2]:Size(scaled, scaled) + bar.Moon:SetSizeToScale(height, height) + bar.Moon[1]:SetSizeToScale(adjustedAnim, adjustedAnim) + bar.Moon[2]:SetSizeToScale(scaled, scaled) - bar.SolarBar:Size(width, adjustedBar) + bar.SolarBar:SetSizeToScale(width, adjustedBar) bar.SolarBar:SetMinMaxValues(0,0) bar.SolarBar:SetStatusBarColor(1,1,0.21) - bar.Sun:Size(height, height) - bar.Sun[1]:Size(adjustedAnim, adjustedAnim) - bar.Sun[2]:Size(scaled, scaled) + bar.Sun:SetSizeToScale(height, height) + bar.Sun[1]:SetSizeToScale(adjustedAnim, adjustedAnim) + bar.Sun[2]:SetSizeToScale(scaled, scaled) bar.Text:SetPoint("TOPLEFT", bar, "TOPLEFT", 10, 0) bar.Text:SetPoint("BOTTOMRIGHT", bar, "BOTTOMRIGHT", -10, 0) @@ -153,16 +153,16 @@ DRUID ECLIPSE BAR ]]-- function MOD:CreateClassBar(playerFrame) local bar = CreateFrame('Frame', nil, playerFrame) - bar:SetFrameLevel(playerFrame.InfoPanel:GetFrameLevel() + 30) - bar:Size(100,40) + bar:SetFrameLevel(playerFrame.TextGrip:GetFrameLevel() + 30) + bar:SetSizeToScale(100,40) local moon = CreateFrame('Frame', nil, bar) moon:SetFrameLevel(bar:GetFrameLevel() + 2) - moon:Size(40, 40) + moon:SetSizeToScale(40, 40) moon:SetPoint("TOPLEFT", bar, "TOPLEFT", 0, 0) moon[1] = moon:CreateTexture(nil, "BACKGROUND", nil, 1) - moon[1]:Size(40, 40) + moon[1]:SetSizeToScale(40, 40) moon[1]:SetPoint("CENTER") moon[1]:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\VORTEX") moon[1]:SetBlendMode("ADD") @@ -170,14 +170,14 @@ function MOD:CreateClassBar(playerFrame) SV.Animate:Orbit(moon[1], 10, false) moon[2] = moon:CreateTexture(nil, "OVERLAY", nil, 2) - moon[2]:Size(30, 30) + moon[2]:SetSizeToScale(30, 30) moon[2]:SetPoint("CENTER") moon[2]:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\DRUID-MOON") moon[1]:Hide() local lunar = CreateFrame('StatusBar', nil, bar) lunar:SetPoint("LEFT", moon, "RIGHT", -10, 0) - lunar:Size(100,40) + lunar:SetSizeToScale(100,40) lunar:SetStatusBarTexture(SV.Media.bar.lazer) lunar.noupdate = true; @@ -187,16 +187,16 @@ function MOD:CreateClassBar(playerFrame) local solar = CreateFrame('StatusBar', nil, bar) solar:SetPoint('LEFT', lunar:GetStatusBarTexture(), 'RIGHT') - solar:Size(100,40) + solar:SetSizeToScale(100,40) solar:SetStatusBarTexture(SV.Media.bar.lazer) solar.noupdate = true; local sun = CreateFrame('Frame', nil, bar) sun:SetFrameLevel(bar:GetFrameLevel() + 2) - sun:Size(40, 40) + sun:SetSizeToScale(40, 40) sun:SetPoint("LEFT", lunar, "RIGHT", -10, 0) sun[1] = sun:CreateTexture(nil, "BACKGROUND", nil, 1) - sun[1]:Size(40, 40) + sun[1]:SetSizeToScale(40, 40) sun[1]:SetPoint("CENTER") sun[1]:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\VORTEX") sun[1]:SetBlendMode("ADD") @@ -204,7 +204,7 @@ function MOD:CreateClassBar(playerFrame) SV.Animate:Orbit(sun[1], 10, false) sun[2] = sun:CreateTexture(nil, "OVERLAY", nil, 2) - sun[2]:Size(30, 30) + sun[2]:SetSizeToScale(30, 30) sun[2]:SetPoint("CENTER") sun[2]:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\DRUID-SUN") sun[1]:Hide() @@ -215,13 +215,13 @@ function MOD:CreateClassBar(playerFrame) bar.Text = lunar:CreateFontString(nil, 'OVERLAY') bar.Text:SetPoint("TOPLEFT", bar, "TOPLEFT", 10, 0) bar.Text:SetPoint("BOTTOMRIGHT", bar, "BOTTOMRIGHT", -10, 0) - bar.Text:SetFont(SV.Media.font.roboto, 16, "NONE") + bar.Text:SetFont(SV.Media.font.default, 16, "NONE") bar.Text:SetShadowOffset(0,0) local hyper = CreateFrame("Frame",nil,playerFrame) hyper:SetFrameStrata("DIALOG") - hyper:Size(45,30) - hyper:Point("TOPLEFT", playerFrame.InfoPanel, "TOPLEFT", 0, -2) + hyper:SetSizeToScale(45,30) + hyper:SetPointToScale("TOPLEFT", playerFrame.TextGrip, "TOPLEFT", 0, -2) local points = CreateFrame('Frame',nil,hyper) points:SetFrameStrata("DIALOG") @@ -268,7 +268,7 @@ function MOD:CreateClassBar(playerFrame) } local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) - classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) + classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder SV.Mentalo:Add(bar.Holder, L["Classbar"]) @@ -323,11 +323,11 @@ local RepositionCombo = function(self) local size = isSmall and 22 or (height - 4) local width = (size + 4) * max; bar:ClearAllPoints() - bar:Size(width, height) - bar:Point("TOPLEFT", self.ActionPanel, "TOPLEFT", 2, (height * 0.25)) + bar:SetSizeToScale(width, height) + bar:SetPointToScale("TOPLEFT", self.ActionPanel, "TOPLEFT", 2, (height * 0.25)) for i = 1, max do bar[i]:ClearAllPoints() - bar[i]:Size(size, size) + bar[i]:SetSizeToScale(size, size) bar[i].Icon:ClearAllPoints() bar[i].Icon:SetAllPoints(bar[i]) if(bar[i].Blood) then @@ -337,7 +337,7 @@ local RepositionCombo = function(self) if i==1 then bar[i]:SetPoint("LEFT", bar) else - bar[i]:Point("LEFT", bar[i - 1], "RIGHT", -2, 0) + bar[i]:SetPointToScale("LEFT", bar[i - 1], "RIGHT", -2, 0) end end end @@ -350,10 +350,10 @@ function MOD:CreateDruidCombobar(targetFrame, isSmall) bar.CPoints = CreateFrame("Frame",nil,bar) for i = 1, max do local cpoint = CreateFrame('Frame',nil,bar.CPoints) - cpoint:Size(size,size) + cpoint:SetSizeToScale(size,size) local icon = cpoint:CreateTexture(nil,"OVERLAY",nil,1) - icon:Size(size,size) + icon:SetSizeToScale(size,size) icon:SetPoint("CENTER") icon:SetBlendMode("BLEND") @@ -361,13 +361,13 @@ function MOD:CreateDruidCombobar(targetFrame, isSmall) icon:SetTexture(comboTextures[random(1,3)]) local blood = cpoint:CreateTexture(nil,"OVERLAY",nil,2) - blood:Size(size,size) + blood:SetSizeToScale(size,size) blood:SetPoint("BOTTOMRIGHT",cpoint,12,-12) blood:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\COMBO-ANIMATION]]) blood:SetBlendMode("ADD") cpoint.Blood = blood - SV.Animate:SmallSprite(blood,0.08,2,true) + SV.Animate:Sprite8(blood,0.08,2,true) else icon:SetTexture([[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\COMBO-POINT-SMALL]]) end diff --git a/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua b/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua index f35072b..0bb9180 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua @@ -35,11 +35,120 @@ local L = SV.L; if(SV.class ~= "HUNTER") then return end local MOD = SV.SVUnit if(not MOD) then return end + +SV.SpecialFX:Register("trap_fire", [[Spells\Fireshot_missile.m2]], -12, 12, 12, -12, 0.4, 0, 0.2) +SV.SpecialFX:Register("trap_ice", [[Spells\Frostshot_missile.m2]], -12, 12, 12, -12, 0.4, 0, 0.18) +SV.SpecialFX:Register("trap_frost", [[Spells\Blindingshot_missile.m2]], -12, 12, 12, -12, 0.4, 0, 0.2) +SV.SpecialFX:Register("trap_snake", [[Spells\Poisonshot_missile.m2]], -12, 12, 12, -12, 0.4, 0, -0.21) +local specEffects = { + [1] = "trap_fire", + [2] = "trap_ice", + [3] = "trap_frost" +}; +local HAS_SNAKE_TRAP = false; +--[[ +########################################################## +POSITIONING +########################################################## +]]-- +local Reposition = function(self) + local db = SV.db.SVUnit.player + local bar = self.HunterTraps; + local max = self.MaxClassPower; + local size = db.classbar.height + 10 + local width = size * max; + bar.Holder:SetSizeToScale(width, size) + if(not db.classbar.detachFromFrame) then + SV.Mentalo:Reset(L["Classbar"]) + end + local holderUpdate = bar.Holder:GetScript('OnSizeChanged') + if holderUpdate then + holderUpdate(bar.Holder) + end + + bar:ClearAllPoints() + bar:SetAllPoints(bar.Holder) + for i = 1, max do + bar[i]:ClearAllPoints() + bar[i]:SetHeight(size) + bar[i]:SetWidth(size) + if i==1 then + bar[i]:SetPoint("TOPLEFT", bar, "TOPLEFT", 0, 0) + else + bar[i]:SetPointToScale("LEFT", bar[i - 1], "RIGHT", -1, 0) + end + end +end --[[ ########################################################## -PLACEHOLDER +MAGE CHARGES ########################################################## ]]-- +local TrapUpdate = function(self, isReady) + if(isReady) then + if(not self.FX:IsShown()) then + self.FX:Show() + end + self.FX:UpdateEffect() + else + self.FX:Hide() + end +end + +local SnakeTrapUpdate = function(self, isReady, isSnake) + if(isReady) then + if(not self.FX:IsShown()) then + self.FX:Show() + end + if((isSnake ~= nil) and (isSnake ~= HAS_SNAKE_TRAP)) then + if(isSnake == true) then + specEffects[3] = "trap_snake" + else + specEffects[3] = "trap_frost" + end + HAS_SNAKE_TRAP = isSnake + + self.FX:SetEffect(specEffects[3]) + else + self.FX:UpdateEffect() + end + else + self.FX:Hide() + end +end + function MOD:CreateClassBar(playerFrame) - return -end \ No newline at end of file + local max = 3 + local bar = CreateFrame("Frame",nil,playerFrame) + bar:SetFrameLevel(playerFrame.TextGrip:GetFrameLevel() + 30) + + for i = 1, max do + bar[i] = CreateFrame("StatusBar", nil, bar) + bar[i]:SetStatusBarTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\HUNTER-TRAP") + bar[i]:GetStatusBarTexture():SetHorizTile(false) + bar[i]:SetOrientation("VERTICAL") + bar[i].noupdate = true; + + bar[i].bg = bar[i]:CreateTexture(nil, "BACKGROUND") + bar[i].bg:SetAllPoints(bar[i]) + bar[i].bg:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\HUNTER-TRAP-BG"); + + local effectName = specEffects[i] + SV.SpecialFX:SetFXFrame(bar[i], effectName) + end + + bar[1].Update = TrapUpdate + bar[2].Update = TrapUpdate + bar[3].Update = SnakeTrapUpdate + + local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) + classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) + bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) + bar.Holder = classBarHolder + SV.Mentalo:Add(bar.Holder, L["Classbar"]) + + playerFrame.MaxClassPower = max; + playerFrame.ClassBarRefresh = Reposition; + playerFrame.HunterTraps = bar + return 'HunterTraps' +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/resources/mage.lua b/Interface/AddOns/SVUI/packages/unit/resources/mage.lua index 29e5597..51468c7 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/mage.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/mage.lua @@ -45,6 +45,8 @@ local L = SV.L; if(SV.class ~= "MAGE") then return end local MOD = SV.SVUnit if(not MOD) then return end + +local specEffects = { [1] = "arcane", [2] = "none", [3] = "none" }; --[[ ########################################################## POSITIONING @@ -56,7 +58,7 @@ local Reposition = function(self) local max = self.MaxClassPower; local size = db.classbar.height local width = size * max; - bar.Holder:Size(width, size) + bar.Holder:SetSizeToScale(width, size) if(not db.classbar.detachFromFrame) then SV.Mentalo:Reset(L["Classbar"]) end @@ -71,11 +73,11 @@ local Reposition = function(self) bar[i]:ClearAllPoints() bar[i]:SetHeight(size) bar[i]:SetWidth(size) - bar[i]:SetStatusBarColor(0,0.6,0.9) + bar[i]:SetStatusBarColor(0.15, 0.65, 0.85) if i==1 then bar[i]:SetPoint("TOPLEFT", bar, "TOPLEFT", 0, 0) else - bar[i]:Point("LEFT", bar[i - 1], "RIGHT", -1, 0) + bar[i]:SetPointToScale("LEFT", bar[i - 1], "RIGHT", -1, 0) end end end @@ -84,74 +86,32 @@ end MAGE CHARGES ########################################################## ]]-- -local function UpdateBar(self, elapsed) - if not self.expirationTime then return end - self.elapsed = (self.elapsed or 0) + elapsed - if self.elapsed >= 0.5 then - local timeLeft = self.expirationTime - GetTime() - if timeLeft > 0 then - self:SetValue(timeLeft) +local PreUpdate = function(self, spec) + if(self.CurrentSpec ~= spec) then + local effectName = specEffects[spec] + if(effectName and effectName ~= 'none') then + if(not self:IsShown()) then + self:Show() + end + for i = 1, 4 do + self[i].FX:SetEffect(effectName) + end else - self:SetScript("OnUpdate", nil) + self:Hide() end - end -end - -local Update = function(self, event) - local unit = self.unit or 'player' - local bar = self.ArcaneChargeBar - local talentSpecialization = GetSpecialization() - if talentSpecialization == 1 then - bar:Show() - else - bar:Hide() + self.CurrentSpec = spec end - - local arcaneCharges, maxCharges, duration, expirationTime = 0, 4 - if bar:IsShown() then - for index=1, 30 do - local _, _, _, count, _, start, timeLeft, _, _, _, spellID = UnitDebuff(unit, index) - if spellID == 36032 then - arcaneCharges = count or 0 - duration = start - expirationTime = timeLeft - break - end - end +end - for i = 1, maxCharges do - if duration and expirationTime then - bar[i]:SetMinMaxValues(0, duration) - bar[i].duration = duration - bar[i].expirationTime = expirationTime - end - if i <= arcaneCharges then - bar[i]:Show() - bar[i]:SetValue(duration) - if not bar[i].sparks:IsShown() then bar[i].sparks:Show()end - if not bar[i].charge:IsShown() then bar[i].charge:Show()end - if not bar[i].under.anim:IsPlaying()then bar[i].under.anim:Play()end - if not bar[i].sparks.anim:IsPlaying()then bar[i].sparks.anim:Play()end - if not bar[i].charge.anim:IsPlaying()then bar[i].charge.anim:Play()end - bar[i]:SetScript('OnUpdate', UpdateBar) - else - bar[i]:SetValue(0) - if bar[i].under.anim:IsPlaying()then bar[i].under.anim:Stop()end - if bar[i].sparks.anim:IsPlaying()then bar[i].sparks.anim:Stop()end - if bar[i].charge.anim:IsPlaying()then bar[i].charge.anim:Stop()end - bar[i].sparks:Hide() - bar[i].charge:Hide() - bar[i]:SetScript('OnUpdate', nil) - bar[i]:Hide() - end - end - end +local ChargeUpdate = function(self) + if not self.fg:IsShown() then self.fg:Show() end + if not self.fg.anim:IsPlaying() then self.fg.anim:Play() end end function MOD:CreateClassBar(playerFrame) local max = 4 local bar = CreateFrame("Frame",nil,playerFrame) - bar:SetFrameLevel(playerFrame.InfoPanel:GetFrameLevel() + 30) + bar:SetFrameLevel(playerFrame.TextGrip:GetFrameLevel() + 30) for i = 1, max do bar[i] = CreateFrame("StatusBar", nil, bar) @@ -159,36 +119,28 @@ function MOD:CreateClassBar(playerFrame) bar[i]:GetStatusBarTexture():SetHorizTile(false) bar[i]:SetOrientation("VERTICAL") bar[i].noupdate = true; - local under = CreateFrame("Frame", nil, bar[i]) - under:SetAllPoints() - under.under = under:CreateTexture(nil, "BORDER") - under.under:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\ORB-BG") - under.bg = under:CreateTexture(nil, "BORDER") - under.bg:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\ORB-BG") - local sparks = under:CreateTexture(nil, "OVERLAY") - sparks:WrapOuter(under, 3, 3) - sparks:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\MAGE-FG-ANIMATION") - sparks:SetBlendMode("ADD") - sparks:SetVertexColor(1, 1, 0) - local charge = under:CreateTexture(nil, "OVERLAY", nil, 2) - charge:SetAllPoints(under) - charge:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\MAGE-BG-ANIMATION") - charge:SetBlendMode("ADD") - charge:SetVertexColor(0.5, 1, 1) - SV.Animate:Sprite(charge, 10, false, true) - charge.anim:Play() - SV.Animate:Sprite(sparks, 0.08, 5, true) - sparks.anim:Play() - bar[i].charge = charge; - bar[i].sparks = sparks; - SV.Animate:Orbit(under, 15, false) - bar[i].under = under; - bar[i].bg = under.bg; + + bar[i].bg = bar[i]:CreateTexture(nil, "BACKGROUND") + bar[i].bg:SetAllPoints(bar[i]) + bar[i].bg:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\ORB-BG"); + + bar[i].fg = bar[i]:CreateTexture(nil, "OVERLAY") + bar[i].fg:SetAllPoints(bar[i]) + bar[i].fg:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\MAGE-BG-ANIMATION") + bar[i].fg:SetBlendMode("ADD") + bar[i].fg:SetVertexColor(0.5,0.6,0.6) + bar[i].fg:SetTexCoord(0,0.25,0,1) + + --bar[i].Update = ChargeUpdate + + local spec = GetSpecialization() + local effectName = specEffects[spec] + SV.SpecialFX:SetFXFrame(bar[i], effectName) end - bar.Override = Update; + bar.PreUpdate = PreUpdate; local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) - classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) + classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder SV.Mentalo:Add(bar.Holder, L["Classbar"]) diff --git a/Interface/AddOns/SVUI/packages/unit/resources/monk.lua b/Interface/AddOns/SVUI/packages/unit/resources/monk.lua index 9894c67..84d7b30 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/monk.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/monk.lua @@ -44,7 +44,7 @@ assert(oUF_Villain, "SVUI was unable to locate oUF.") local L = SV.L; if(SV.class ~= "MONK") then return end local MOD = SV.SVUnit -if(not MOD) then return end +if(not MOD) then return end --[[ ########################################################## POSITIONING @@ -56,7 +56,7 @@ local Reposition = function(self) local max = self.MaxClassPower; local size = db.classbar.height local width = size * max; - bar.Holder:Size(width, size) + bar.Holder:SetSizeToScale(width, size) if(not db.classbar.detachFromFrame) then SV.Mentalo:Reset(L["Classbar"]) end @@ -77,7 +77,7 @@ local Reposition = function(self) if i==1 then bar[i]:SetPoint("TOPLEFT", bar, "TOPLEFT", 0, 0) else - bar[i]:Point("LEFT", bar[i - 1], "RIGHT", -2, 0) + bar[i]:SetPointToScale("LEFT", bar[i - 1], "RIGHT", -2, 0) end end end @@ -92,21 +92,25 @@ MONK STAGGER BAR local function CreateDrunkenMasterBar(playerFrame) local stagger = CreateFrame("Statusbar",nil,playerFrame) stagger:SetSize(45,90) - stagger:Point('BOTTOMLEFT', playerFrame, 'BOTTOMRIGHT', 6, 0) + stagger:SetPointToScale('BOTTOMLEFT', playerFrame, 'BOTTOMRIGHT', 6, 0) stagger:SetOrientation("VERTICAL") stagger:SetStatusBarTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\MONK-STAGGER-BAR") stagger:GetStatusBarTexture():SetHorizTile(false) - stagger.backdrop = stagger:CreateTexture(nil,'BORDER',nil,1) - stagger.backdrop:SetAllPoints(stagger) - stagger.backdrop:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\MONK-STAGGER-BG") - stagger.backdrop:SetVertexColor(1,1,1,0.6) + + stagger.bg = stagger:CreateTexture(nil,'BORDER',nil,1) + stagger.bg:SetAllPoints(stagger) + stagger.bg:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\MONK-STAGGER-BG") + stagger.bg:SetVertexColor(1,1,1,0.6) + stagger.overlay = stagger:CreateTexture(nil,'OVERLAY') stagger.overlay:SetAllPoints(stagger) stagger.overlay:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\MONK-STAGGER-FG") stagger.overlay:SetVertexColor(1,1,1) + stagger.icon = stagger:CreateTexture(nil,'OVERLAY') stagger.icon:SetAllPoints(stagger) stagger.icon:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\MONK-STAGGER-ICON") + stagger:Hide() return stagger end @@ -127,16 +131,18 @@ local CHI_DATA = { function MOD:CreateClassBar(playerFrame) local max = 6 local bar = CreateFrame("Frame",nil,playerFrame) - bar:SetFrameLevel(playerFrame.InfoPanel:GetFrameLevel() + 30) + bar:SetFrameLevel(playerFrame.TextGrip:GetFrameLevel() + 30) for i=1, max do local coords = CHI_DATA[i] bar[i] = CreateFrame("StatusBar", nil, bar) bar[i]:SetStatusBarTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\ORB") bar[i]:GetStatusBarTexture():SetHorizTile(false) bar[i].noupdate = true; - bar[i].backdrop = bar[i]:CreateTexture(nil, "BACKGROUND") - bar[i].backdrop:SetAllPoints(bar[i]) - bar[i].backdrop:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\ORB-BG") + + bar[i].bg = bar[i]:CreateTexture(nil, "BACKGROUND") + bar[i].bg:SetAllPoints(bar[i]) + bar[i].bg:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\ORB-BG") + bar[i].glow = bar[i]:CreateTexture(nil, "OVERLAY") bar[i].glow:SetAllPoints(bar[i]) bar[i].glow:SetTexture(CHI_FILE) @@ -147,12 +153,15 @@ function MOD:CreateClassBar(playerFrame) bar[i].overlay:SetTexture(CHI_FILE) bar[i].overlay:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) bar[i].overlay:SetVertexColor(0, 0, 0) + bar[i]:SetScript("OnShow", StartFlash) bar[i]:SetScript("OnHide", StopFlash) + + SV.SpecialFX:SetFXFrame(bar[i], "chi") end local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) - classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) + classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder SV.Mentalo:Add(bar.Holder, L["Classbar"]) diff --git a/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua b/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua index 6d1d0a5..8069713 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua @@ -45,6 +45,10 @@ local L = SV.L; if(SV.class ~= "PALADIN") then return end local MOD = SV.SVUnit if(not MOD) then return end + +--SV.SpecialFX:Register("holypower", [[Spells\Holy_missile_low.m2]], -12, 12, 12, -12, 1.5, 0, 0) +SV.SpecialFX:Register("holypower", [[Spells\Holylight_impact_head.m2]], -12, 12, 12, -12, 0.8, 0, -0.4) +--SV.SpecialFX:Register("holypower", [[Spells\Paladin_healinghands_state_01.m2]], -12, 12, 12, -12, 1.2, 0, 0) --[[ ########################################################## LOCAL FUNCTIONS @@ -60,9 +64,9 @@ local Reposition = function(self) local db = SV.db.SVUnit.player local bar = self.HolyPower; local max = self.MaxClassPower; - local size = db.classbar.height + local size = db.classbar.height + 4; local width = size * max; - bar.Holder:Size(width, size) + bar.Holder:SetSizeToScale(width, size) if(not db.classbar.detachFromFrame) then SV.Mentalo:Reset(L["Classbar"]) end @@ -74,14 +78,14 @@ local Reposition = function(self) bar:ClearAllPoints() bar:SetAllPoints(bar.Holder) for i = 1, max do - bar[i]:ClearAllPoints() - bar[i]:SetHeight(size) - bar[i]:SetWidth(size) + bar[i].holder:ClearAllPoints() + bar[i].holder:SetHeight(size) + bar[i].holder:SetWidth(size) bar[i]:GetStatusBarTexture():SetHorizTile(false) if i==1 then - bar[i]:SetPoint("TOPLEFT", bar, "TOPLEFT", 0, 0) + bar[i].holder:SetPoint("TOPLEFT", bar, "TOPLEFT", 0, 0) else - bar[i]:Point("LEFT", bar[i - 1], "RIGHT", -1, 0) + bar[i].holder:SetPointToScale("LEFT", bar[i - 1].holder, "RIGHT", -4, 0) end end end @@ -94,93 +98,60 @@ local Update = function(self, event, unit, powerType) for i=1,maxCount do if i <= baseCount then bar[i]:SetAlpha(1) + if(not bar[i].holder.FX:IsShown()) then + bar[i].holder.FX:Show() + bar[i].holder.FX:UpdateEffect() + end else bar[i]:SetAlpha(0) + bar[i].holder.FX:Hide() end if i > maxCount then bar[i]:Hide() else bar[i]:Show() - if(not bar[i].swirl[3].anim:IsPlaying()) then - bar[i].swirl[3].anim:Play() - end end end self.MaxClassPower = maxCount -end - -local AlphaHook = function(self,value) - self.swirl[3].anim:Finish() - if value < 1 then - self.swirl[1].anim:Finish() - self.swirl[2].anim:Finish() - else - if(not self.swirl[1].anim:IsPlaying()) then - self.swirl[1].anim:Play() - end - if(not self.swirl[2].anim:IsPlaying()) then - self.swirl[2].anim:Play() - end - self.swirl[3].anim:Play() - end end --[[ ########################################################## PALADIN ########################################################## ]]-- +local ShowLink = function(self) self.holder:Show() end +local HideLink = function(self) self.holder:Hide() end + function MOD:CreateClassBar(playerFrame) local max = 5 local bar = CreateFrame("Frame", nil, playerFrame) - bar:SetFrameLevel(playerFrame.InfoPanel:GetFrameLevel() + 30) + bar:SetFrameLevel(playerFrame.TextGrip:GetFrameLevel() + 30) + + for i = 1, max do + local underlay = CreateFrame("Frame", nil, bar); + SV.SpecialFX:SetFXFrame(underlay, "holypower", true) + underlay.FX:SetFrameStrata("BACKGROUND") + underlay.FX:SetFrameLevel(0) - for i = 1, max do - bar[i] = CreateFrame("StatusBar", nil, bar) - bar[i]:SetStatusBarTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\PALADIN-HAMMER") + bar[i] = CreateFrame("StatusBar", nil, underlay) + bar[i]:SetAllPoints(underlay) + bar[i]:SetStatusBarTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\PALADIN-HAMMER-FG") bar[i]:GetStatusBarTexture():SetHorizTile(false) bar[i]:SetStatusBarColor(0.9,0.9,0.8) - bar[i].backdrop = bar[i]:CreateTexture(nil,"BACKGROUND") - bar[i].backdrop:SetAllPoints(bar[i]) - bar[i].backdrop:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\PALADIN-HAMMER") - bar[i].backdrop:SetVertexColor(0,0,0) - - local barAnimation = CreateFrame('Frame',nil,bar[i]) - barAnimation:Size(40,40) - barAnimation:SetPoint("CENTER",bar[i],"CENTER",0,0) - barAnimation:SetFrameLevel(0) - - barAnimation[1] = barAnimation:CreateTexture(nil,"BACKGROUND",nil,1) - barAnimation[1]:Size(40,40) - barAnimation[1]:SetPoint("CENTER") - barAnimation[1]:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\SWIRL") - barAnimation[1]:SetBlendMode("ADD") - barAnimation[1]:SetVertexColor(0.5,0.5,0.15) - SV.Animate:Orbit(barAnimation[1],10) - - barAnimation[2] = barAnimation:CreateTexture(nil,"BACKGROUND",nil,2) - barAnimation[2]:Size(40,40) - barAnimation[2]:SetPoint("CENTER") - barAnimation[2]:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\SWIRL") - barAnimation[2]:SetTexCoord(1,0,1,1,0,0,0,1) - barAnimation[2]:SetBlendMode("ADD") - barAnimation[2]:SetVertexColor(0.5,0.5,0.15) - SV.Animate:Orbit(barAnimation[2],10,true) - - barAnimation[3] = barAnimation:CreateTexture(nil, "OVERLAY") - barAnimation[3]:WrapOuter(barAnimation, 3, 3) - barAnimation[3]:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\MAGE-FG-ANIMATION") - barAnimation[3]:SetBlendMode("ADD") - barAnimation[3]:SetVertexColor(1, 1, 0) - SV.Animate:Sprite(barAnimation[3], 0.08, 2, true) + bar[i].bg = underlay:CreateTexture(nil,"BORDER") + bar[i].bg:SetAllPoints(underlay) + bar[i].bg:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\PALADIN-HAMMER-BG") + bar[i].bg:SetVertexColor(0,0,0) - bar[i].swirl = barAnimation; - hooksecurefunc(bar[i], "SetAlpha", AlphaHook) + bar[i].holder = underlay + bar[i]:SetScript("OnShow", ShowLink) + bar[i]:SetScript("OnHide", HideLink) end bar.Override = Update; local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) - classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) + classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder SV.Mentalo:Add(bar.Holder, L["Classbar"]) diff --git a/Interface/AddOns/SVUI/packages/unit/resources/priest.lua b/Interface/AddOns/SVUI/packages/unit/resources/priest.lua index 97cd3dc..aeb5251 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/priest.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/priest.lua @@ -31,6 +31,8 @@ local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; +local CreateFrame = _G.CreateFrame; +local GetSpecialization = _G.GetSpecialization; --[[ ########################################################## GET ADDON DATA @@ -47,6 +49,7 @@ local MOD = SV.SVUnit if(not MOD) then return end local ICON_FILE = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\PRIEST]] +local specEffects = { [1] = "holy", [2] = "holy", [3] = "shadow" }; --[[ ########################################################## POSITIONING @@ -59,7 +62,7 @@ local Reposition = function(self) local size = db.classbar.height local width = size * max; - bar.Holder:Size(width, size) + bar.Holder:SetSizeToScale(width, size) if(not db.classbar.detachFromFrame) then SV.Mentalo:Reset(L["Classbar"]) end @@ -78,7 +81,7 @@ local Reposition = function(self) if i==1 then bar[i]:SetPoint("TOPLEFT", bar, "TOPLEFT", 0, 0) else - bar[i]:Point("LEFT", bar[i - 1], "RIGHT", -1, 0) + bar[i]:SetPointToScale("LEFT", bar[i - 1], "RIGHT", -1, 0) end end end @@ -87,72 +90,39 @@ end PRIEST ########################################################## ]]-- -local innerOrbs = { - [1] = {1, 0.7, 0, 0.2, 0.08, 0.01}, - [2] = {0, 0.5, 0.9, 0.02, 0.1, 0.1}, - [3] = {0.7, 0.5, 1, 0.1, 0.02, 0.4} -}; - local PreUpdate = function(self, spec) - local color = innerOrbs[spec] or {0.7, 0.5, 1, 1, 1, 0.5}; + if(self.CurrentSpec and (self.CurrentSpec == spec)) then return end + local effectName = specEffects[spec] for i = 1, 5 do - self[i].swirl[1]:SetVertexColor(color[1], color[2], color[3]) - self[i].swirl[2]:SetVertexColor(color[4], color[5], color[6]) - end + self[i].FX:SetEffect(effectName) + end + self.CurrentSpec = spec end function MOD:CreateClassBar(playerFrame) local max = 5 local bar = CreateFrame("Frame", nil, playerFrame) - bar:SetFrameLevel(playerFrame.InfoPanel:GetFrameLevel() + 30) + bar:SetFrameLevel(playerFrame.TextGrip:GetFrameLevel() + 30) for i=1, max do bar[i] = CreateFrame("StatusBar", nil, bar) bar[i]:SetStatusBarTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\ORB") bar[i]:GetStatusBarTexture():SetHorizTile(false) bar[i].noupdate = true; - bar[i].backdrop = bar[i]:CreateTexture(nil, "BACKGROUND") - bar[i].backdrop:SetAllPoints(bar[i]) - bar[i].backdrop:SetTexture(ICON_FILE) - bar[i].backdrop:SetTexCoord(0,0.5,0,0.5) - local swirl = CreateFrame('Frame', nil, bar[i]) - swirl:Size(30, 30) - swirl:SetPoint("CENTER", bar[i], "CENTER", 0, 0) - swirl[1] = swirl:CreateTexture(nil, "OVERLAY", nil, 2) - swirl[1]:Size(30, 30) - swirl[1]:SetPoint("CENTER") - swirl[1]:SetTexture(ICON_FILE) - swirl[1]:SetTexCoord(0.5,1,0.5,1) - swirl[1]:SetBlendMode("ADD") - swirl[1]:SetVertexColor(0.7, 0.5, 1) - SV.Animate:Orbit(swirl[1], 10, false) - swirl[2] = swirl:CreateTexture(nil, "OVERLAY", nil, 1) - swirl[2]:Size(30, 30) - swirl[2]:SetPoint("CENTER") - swirl[2]:SetTexture(ICON_FILE) - swirl[2]:SetTexCoord(0.5,1,0.5,1) - swirl[2]:SetBlendMode("BLEND") - swirl[2]:SetVertexColor(0.2, 0.08, 0.01) - SV.Animate:Orbit(swirl[2], 10, true) - bar[i].swirl = swirl; - bar[i]:SetScript("OnShow", function(self) - if not self.swirl[1].anim:IsPlaying() then - self.swirl[1].anim:Play() - end - if not self.swirl[2].anim:IsPlaying() then - self.swirl[2].anim:Play() - end - end) - bar[i]:SetScript("OnHide", function(self) - self.swirl[1].anim:Finish() - self.swirl[2].anim:Finish() - end) + + bar[i].bg = bar[i]:CreateTexture(nil, "BACKGROUND") + bar[i].bg:SetAllPoints(bar[i]) + bar[i].bg:SetTexture(ICON_FILE) + bar[i].bg:SetTexCoord(0,0.5,0,0.5) + local spec = GetSpecialization() + local effectName = specEffects[spec] + SV.SpecialFX:SetFXFrame(bar[i], effectName) end bar.PreUpdate = PreUpdate local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) - classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) + classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder SV.Mentalo:Add(bar.Holder, L["Classbar"]) diff --git a/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua b/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua index 3acb49d..61c55c3 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua @@ -79,11 +79,11 @@ local Reposition = function(self) local size = isSmall and 22 or (height - 4) local width = (size + 4) * max; bar:ClearAllPoints() - bar:Size(width, height) - bar:Point("TOPLEFT", self.ActionPanel, "TOPLEFT", 2, (height * 0.25)) + bar:SetSizeToScale(width, height) + bar:SetPointToScale("TOPLEFT", self.ActionPanel, "TOPLEFT", 2, (height * 0.25)) for i = 1, max do bar[i]:ClearAllPoints() - bar[i]:Size(size, size) + bar[i]:SetSizeToScale(size, size) bar[i].Icon:ClearAllPoints() bar[i].Icon:SetAllPoints(bar[i]) if(bar[i].Blood) then @@ -93,7 +93,7 @@ local Reposition = function(self) if i==1 then bar[i]:SetPoint("LEFT", bar) else - bar[i]:Point("LEFT", bar[i - 1], "RIGHT", -2, 0) + bar[i]:SetPointToScale("LEFT", bar[i - 1], "RIGHT", -2, 0) end end end @@ -130,10 +130,10 @@ function MOD:CreateRogueCombobar(targetFrame, isSmall) bar.CPoints = CreateFrame("Frame",nil,bar) for i = 1, max do local cpoint = CreateFrame('Frame',nil,bar.CPoints) - cpoint:Size(size,size) + cpoint:SetSizeToScale(size,size) local icon = cpoint:CreateTexture(nil,"OVERLAY",nil,1) - icon:Size(size,size) + icon:SetSizeToScale(size,size) icon:SetPoint("CENTER") icon:SetBlendMode("BLEND") icon:SetTexture(ICON_FILE) @@ -143,13 +143,13 @@ function MOD:CreateRogueCombobar(targetFrame, isSmall) icon:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) local blood = cpoint:CreateTexture(nil,"OVERLAY",nil,2) - blood:Size(size,size) + blood:SetSizeToScale(size,size) blood:SetPoint("BOTTOMRIGHT",cpoint,12,-12) blood:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\COMBO-ANIMATION]]) blood:SetBlendMode("ADD") cpoint.Blood = blood - SV.Animate:SmallSprite(blood,0.08,2,true) + SV.Animate:Sprite8(blood,0.08,2,true) else coords = ICON_COORDS[1] icon:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) @@ -177,7 +177,7 @@ local RepositionTracker = function(self) local size = db.classbar.height local width = size * 3; local textwidth = size * 1.25; - bar.Holder:Size(width, size) + bar.Holder:SetSizeToScale(width, size) if(not db.classbar.detachFromFrame) then SV.Mentalo:Reset(L["Classbar"]) end @@ -220,10 +220,10 @@ end function MOD:CreateClassBar(playerFrame) local bar = CreateFrame("Frame",nil,playerFrame) bar:SetFrameStrata("DIALOG") - bar:Size(150, 30) + bar:SetSizeToScale(150, 30) local points = CreateFrame('Frame',nil,bar) points:SetFrameStrata("DIALOG") - points:Size(30,30) + points:SetSizeToScale(30,30) points.Text = points:CreateFontString(nil,'OVERLAY') points.Text:SetAllPoints(points) @@ -234,7 +234,7 @@ function MOD:CreateClassBar(playerFrame) local anticipation = CreateFrame('Frame',nil,bar) anticipation:SetFrameStrata("DIALOG") - anticipation:Size(30,30) + anticipation:SetSizeToScale(30,30) anticipation.Text = anticipation:CreateFontString(nil,'OVERLAY') anticipation.Text:SetAllPoints(anticipation) @@ -245,7 +245,7 @@ function MOD:CreateClassBar(playerFrame) local guile = CreateFrame('Frame',nil,bar) guile:SetFrameStrata("DIALOG") - guile:Size(30,30) + guile:SetSizeToScale(30,30) guile.Text = guile:CreateFontString(nil,'OVERLAY') guile.Text:SetAllPoints(guile) @@ -255,7 +255,7 @@ function MOD:CreateClassBar(playerFrame) bar.Guile = guile; local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) - classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) + classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder SV.Mentalo:Add(bar.Holder, L["Classbar"]) diff --git a/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua b/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua index 8a4c9e8..5317f4f 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua @@ -68,7 +68,7 @@ local Reposition = function(self) local bar = self.TotemBars local size = db.classbar.height local width = size * totemMax - bar.Holder:Size(width, size) + bar.Holder:SetSizeToScale(width, size) if(not db.classbar.detachFromFrame) then SV.Mentalo:Reset(L["Classbar"]) end @@ -87,7 +87,7 @@ local Reposition = function(self) if i==1 then bar[i]:SetPoint("TOPLEFT", bar, "TOPLEFT", 0, 0) else - bar[i]:Point("LEFT", bar[i - 1], "RIGHT", -1, 0) + bar[i]:SetPointToScale("LEFT", bar[i - 1], "RIGHT", -1, 0) end end end @@ -98,7 +98,7 @@ SHAMAN ]]-- function MOD:CreateClassBar(playerFrame) local bar = CreateFrame("Frame",nil,playerFrame) - bar:SetFrameLevel(playerFrame.InfoPanel:GetFrameLevel() + 30) + bar:SetFrameLevel(playerFrame.TextGrip:GetFrameLevel() + 30) for i=1, totemMax do local iconfile = totemTextures[totemPriorities[i]] bar[i] = CreateFrame("StatusBar",nil,bar) @@ -114,7 +114,7 @@ function MOD:CreateClassBar(playerFrame) end local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) - classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) + classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder SV.Mentalo:Add(bar.Holder, L["Classbar"]) diff --git a/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua b/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua index 3b937aa..6335a78 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua @@ -31,6 +31,8 @@ local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random, floor = math.random, math.floor; +local CreateFrame = _G.CreateFrame; +local GetSpecialization = _G.GetSpecialization; --[[ ########################################################## GET ADDON DATA @@ -45,23 +47,23 @@ local L = SV.L; if(SV.class ~= "WARLOCK") then return end local MOD = SV.SVUnit if(not MOD) then return end + +SV.SpecialFX:Register("affliction", [[Spells\Warlock_bodyofflames_medium_state_shoulder_right_purple.m2]], -12, 12, 12, -12, 0.22, 0, 0.52) +SV.SpecialFX:Register("overlay_demonbar", [[Spells\Warlock_destructioncharge_impact_chest.m2]], -20, -1, 20, -50, 0.9, 0, 0.8) +SV.SpecialFX:Register("underlay_demonbar", [[Spells\Fill_fire_cast_01.m2]], 3, -2, -3, 2, 0.5, -0.45, 1) +local specEffects = { [1] = "affliction", [2] = "none", [3] = "fire" }; --[[ ########################################################## LOCAL FUNCTIONS ########################################################## ]]-- local shardColor = { - [1] = {0.6,0,1}, + [1] = {0.57,0.08,1}, [2] = {1,0,0}, - [3] = {1,0.5,0} -} -local shardUnderColor = { - [1] = {0.4,0.1,1}, - [2] = {0,0,0}, - [3] = {0.5,0.5,0.5} + [3] = {1,0.25,0} } local shardOverColor = { - [1] = {0.87,0.42,0.93}, + [1] = {0.67,0.42,0.93}, [2] = {0,0,0}, [3] = {1,1,0} } @@ -85,7 +87,7 @@ local Reposition = function(self) local size = db.classbar.height local width = size * max; local dbOffset = (size * 0.15) - bar.Holder:Size(width, size) + bar.Holder:SetSizeToScale(width, size) if(not db.classbar.detachFromFrame) then SV.Mentalo:Reset(L["Classbar"]) end @@ -97,9 +99,9 @@ local Reposition = function(self) bar:ClearAllPoints() bar:SetAllPoints(bar.Holder) - bar.DemonBar:ClearAllPoints() - bar.DemonBar:Size(width, (size * 1.25)) - bar.DemonBar:SetPoint("LEFT", bar, "LEFT", 0, dbOffset) + bar.DemonicFury:ClearAllPoints() + bar.DemonicFury:SetAllPointsIn(bar.Holder, 1, 3) + --bar.DemonicFury:SetPoint("LEFT", bar, "LEFT", 0, dbOffset) for i = 1, max do bar[i]:ClearAllPoints() bar[i]:SetHeight(size) @@ -107,7 +109,7 @@ local Reposition = function(self) if(i == 1) then bar[i]:SetPoint("LEFT", bar) else - bar[i]:Point("LEFT", bar[i - 1], "RIGHT", -2, 0) + bar[i]:SetPointToScale("LEFT", bar[i - 1], "RIGHT", -2, 0) end end end @@ -116,65 +118,48 @@ end CUSTOM HANDLERS ########################################################## ]]-- -local UpdateTextures = function(bar, spec, max) +local UpdateTextures = function(self, spec, max) if max == 0 then max = 4 end + local effectName = specEffects[spec] if spec == SPEC_WARLOCK_DEMONOLOGY then - bar[1].overlay:SetTexture(0,0,0,0) - bar[1].underlay:SetTexture(0,0,0,0) - SV.Animate:StopFlash(bar[1].overlay) - bar[1].underlay.anim:Finish() - - bar[2].overlay:SetTexture(0,0,0,0) - bar[2].underlay:SetTexture(0,0,0,0) - SV.Animate:StopFlash(bar[2].overlay) - bar[2].underlay.anim:Finish() - - bar[3].overlay:SetTexture(0,0,0,0) - bar[3].underlay:SetTexture(0,0,0,0) - SV.Animate:StopFlash(bar[3].overlay) - bar[3].underlay.anim:Finish() - - bar[4].overlay:SetTexture(0,0,0,0) - bar[4].underlay:SetTexture(0,0,0,0) - SV.Animate:StopFlash(bar[4].overlay) - bar[4].underlay.anim:Finish() - bar.CurrentSpec = spec + self[1].overlay:SetTexture(0,0,0,0) + self[2].overlay:SetTexture(0,0,0,0) + self[3].overlay:SetTexture(0,0,0,0) + self[4].overlay:SetTexture(0,0,0,0) + self.CurrentSpec = spec elseif spec == SPEC_WARLOCK_AFFLICTION then for i = 1, max do - bar[i]:SetStatusBarTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-SHARD") - bar[i]:GetStatusBarTexture():SetHorizTile(false) - bar[i].backdrop:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-SHARD-BG") - bar[i].overlay:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-SHARD-FG") - bar[i].underlay:SetTexture('Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-SOUL-ANIMATION') - bar[i].backdrop:SetVertexColor(unpack(shardBGColor[spec])) - bar[i].overlay:SetVertexColor(unpack(shardOverColor[spec])) - bar[i].underlay:SetVertexColor(unpack(shardUnderColor[spec])) + self[i]:SetStatusBarTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-SHARD") + self[i]:GetStatusBarTexture():SetHorizTile(false) + self[i].bg:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-SHARD-BG") + self[i].overlay:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-SHARD-FG") + self[i].bg:SetVertexColor(unpack(shardBGColor[spec])) + self[i].overlay:SetVertexColor(unpack(shardOverColor[spec])) + self[i].FX:SetEffect(effectName) end - bar.CurrentSpec = spec + self.CurrentSpec = spec elseif spec == SPEC_WARLOCK_DESTRUCTION then for i = 1, max do - bar[i]:SetStatusBarTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-EMBER") - bar[i]:GetStatusBarTexture():SetHorizTile(false) - bar[i].backdrop:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-EMBER") - bar[i].overlay:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-EMBER-FG") - bar[i].underlay:SetTexture('Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-FIRE-ANIMATION') + self[i]:SetStatusBarTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-EMBER") + self[i]:GetStatusBarTexture():SetHorizTile(false) + self[i].bg:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-EMBER") + self[i].overlay:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-EMBER-FG") if GetSpecialization() == SPEC_WARLOCK_DESTRUCTION and IsSpellKnown(101508) then -- GREEN FIRE (Codex of Xeroth): 101508 - bar[i].backdrop:SetVertexColor(0,0.15,0) - bar[i].overlay:SetVertexColor(0.5,1,0) - bar[i].underlay:SetVertexColor(0,1,0.2,0.8) + self[i].bg:SetVertexColor(0,0.15,0) + self[i].overlay:SetVertexColor(0.5,1,0) else - bar[i].backdrop:SetVertexColor(unpack(shardBGColor[spec])) - bar[i].overlay:SetVertexColor(unpack(shardOverColor[spec])) - bar[i].underlay:SetVertexColor(unpack(shardUnderColor[spec])) + self[i].bg:SetVertexColor(unpack(shardBGColor[spec])) + self[i].overlay:SetVertexColor(unpack(shardOverColor[spec])) end + self[i].FX:SetEffect(effectName) end - bar.CurrentSpec = spec + self.CurrentSpec = spec end end local Update = function(self, event, unit, powerType) local bar = self.WarlockShards; - local fury = bar.DemonBar; + local fury = bar.DemonicFury; if UnitHasVehicleUI("player") then bar:Hide() else @@ -185,13 +170,7 @@ local Update = function(self, event, unit, powerType) if not bar:IsShown() then bar:Show() end - if not fury:IsShown() then - fury:Show() - end - for i = 1, 4 do - bar[i]:Show() - bar[i]:SetStatusBarColor(unpack(shardColor[spec])) - end + if (spec == SPEC_WARLOCK_DESTRUCTION) then fury:Hide() local maxPower = UnitPowerMax("player", SPELL_POWER_BURNING_EMBERS, true) @@ -199,27 +178,31 @@ local Update = function(self, event, unit, powerType) local numEmbers = power / MAX_POWER_PER_EMBER local numBars = floor(maxPower / MAX_POWER_PER_EMBER) bar.number = numBars - if numBars == 3 then - bar[4]:Hide() - else - bar[4]:Show() + + for i = 1, 4 do + if((i == 4) and (numBars == 3)) then + bar[i]:Hide() + else + bar[i]:Show() + bar[i]:SetStatusBarColor(unpack(shardColor[spec])) + end end + if bar.CurrentSpec ~= spec then UpdateTextures(bar, spec, numBars) end + for i = 1, numBars do bar[i]:SetMinMaxValues((MAX_POWER_PER_EMBER * i) - MAX_POWER_PER_EMBER, MAX_POWER_PER_EMBER * i) bar[i]:SetValue(power) if (power >= MAX_POWER_PER_EMBER * i) then bar[i].overlay:Show() - bar[i].underlay:Show() + bar[i].FX:Show() SV.Animate:Flash(bar[i].overlay,1,true) - if not bar[i].underlay.anim:IsPlaying() then bar[i].underlay.anim:Play() end else SV.Animate:StopFlash(bar[i].overlay) bar[i].overlay:Hide() - bar[i].underlay.anim:Stop() - bar[i].underlay:Hide() + bar[i].FX:Hide() end end elseif ( spec == SPEC_WARLOCK_AFFLICTION ) then @@ -227,33 +210,43 @@ local Update = function(self, event, unit, powerType) local numShards = UnitPower("player", SPELL_POWER_SOUL_SHARDS) local maxShards = UnitPowerMax("player", SPELL_POWER_SOUL_SHARDS) bar.number = maxShards - if maxShards == 3 then - bar[4]:Hide() - else - bar[4]:Show() + + for i = 1, 4 do + if((i == 4) and (maxShards == 3)) then + bar[i]:Hide() + else + bar[i]:Show() + bar[i]:SetStatusBarColor(unpack(shardColor[spec])) + end end + if bar.CurrentSpec ~= spec then UpdateTextures(bar, spec, maxShards) end + for i = 1, maxShards do bar[i]:SetMinMaxValues(0, 1) if i <= numShards then bar[i]:SetValue(1) bar[i]:SetAlpha(1) bar[i].overlay:Show() - bar[i].underlay:Show() + bar[i].FX:Show() SV.Animate:Flash(bar[i].overlay,1,true) - if not bar[i].underlay.anim:IsPlaying() then bar[i].underlay.anim:Play() end else bar[i]:SetValue(0) bar[i]:SetAlpha(0) SV.Animate:StopFlash(bar[i].overlay) + bar[i].FX:Hide() end end elseif spec == SPEC_WARLOCK_DEMONOLOGY then - fury:SetStatusBarColor(unpack(shardColor[spec])) + if not fury:IsShown() then + fury:Show() + end + fury.bar:SetStatusBarColor(unpack(shardColor[spec])) local power = UnitPower("player", SPELL_POWER_DEMONIC_FURY) local maxPower = UnitPowerMax("player", SPELL_POWER_DEMONIC_FURY) + local percent = (power / maxPower) * 100 bar.number = 1 if bar.CurrentSpec ~= spec then UpdateTextures(bar, spec, 1) @@ -262,13 +255,23 @@ local Update = function(self, event, unit, powerType) bar[2]:Hide() bar[3]:Hide() bar[4]:Hide() - fury:SetMinMaxValues(0, maxPower) - fury:SetValue(power) + fury.bar:SetMinMaxValues(0, maxPower) + fury.bar:SetValue(power) + if(percent > 80) then + if(not fury.bar.FX:IsShown()) then + fury.bar.FX:Show() + end + else + fury.bar.FX:Hide() + end end else if bar:IsShown() then bar:Hide() end + if fury:IsShown() then + fury:Hide() + end end if(bar.PostUpdate) then return bar:PostUpdate(unit, spec) @@ -279,20 +282,24 @@ end WARLOCK ########################################################## ]]-- +local EffectModel_OnShow = function(self) + self:SetEffect("overlay_demonbar"); +end + function MOD:CreateClassBar(playerFrame) local max = 4 local bar = CreateFrame("Frame",nil,playerFrame) - bar:SetFrameLevel(playerFrame.InfoPanel:GetFrameLevel() + 30) + bar:SetFrameLevel(playerFrame.TextGrip:GetFrameLevel() + 30) for i = 1, max do - bar[i]=CreateFrame("StatusBar", nil, bar) + bar[i] = CreateFrame("StatusBar", nil, bar) bar[i].noupdate = true; bar[i]:SetOrientation("VERTICAL") bar[i]:SetStatusBarTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\SHARD") bar[i]:GetStatusBarTexture():SetHorizTile(false) - bar[i].backdrop = bar[i]:CreateTexture(nil,'BORDER',nil,1) - bar[i].backdrop:SetAllPoints(bar[i]) - bar[i].backdrop:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\SHARD-BG") + bar[i].bg = bar[i]:CreateTexture(nil,'BORDER',nil,1) + bar[i].bg:SetAllPoints(bar[i]) + bar[i].bg:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\SHARD-BG") bar[i].overlay = bar[i]:CreateTexture(nil,'OVERLAY') bar[i].overlay:SetAllPoints(bar[i]) @@ -300,32 +307,28 @@ function MOD:CreateClassBar(playerFrame) bar[i].overlay:SetBlendMode("BLEND") bar[i].overlay:Hide() - bar[i].underlay = bar[i]:CreateTexture(nil,'BORDER') - bar[i].underlay:Height(100) - bar[i].underlay:Width(100) - bar[i].underlay:SetPoint("CENTER",bar[i]) - bar[i].underlay:SetTexture('Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-SOUL-ANIMATION') - bar[i].underlay:SetBlendMode('ADD') - bar[i].underlay:Hide() - SV.Animate:Sprite(bar[i].underlay,0.15,false,true) - - bar[i].backdrop:SetVertexColor(unpack(shardBGColor[1])) + bar[i].bg:SetVertexColor(unpack(shardBGColor[1])) bar[i].overlay:SetVertexColor(unpack(shardOverColor[1])) - bar[i].underlay:SetVertexColor(unpack(shardUnderColor[1])) + + local spec = GetSpecialization() + local effectName = specEffects[spec] + SV.SpecialFX:SetFXFrame(bar[i], effectName, true) + bar[i].FX:SetScript("OnShow", EffectModel_OnShow) end - local demonBar = CreateFrame("StatusBar",nil,bar) - demonBar.noupdate = true; - demonBar:SetOrientation("HORIZONTAL") - demonBar:SetStatusBarTexture(SV.Media.bar.lazer) + local demonicFury = CreateFrame("Frame", nil, bar) + demonicFury:SetFrameStrata("BACKGROUND") + demonicFury:SetFrameLevel(0) + SV.SpecialFX:SetFXFrame(demonicFury, "underlay_demonbar") + demonicFury.FX:SetFrameStrata("BACKGROUND") + demonicFury.FX:SetFrameLevel(0) - local bgFrame = CreateFrame("Frame", nil, demonBar) - bgFrame:FillInner(demonBar, 0, 8) - bgFrame:SetFrameLevel(bgFrame:GetFrameLevel() - 1) + local bgFrame = CreateFrame("Frame", nil, demonicFury) + bgFrame:SetAllPointsIn(demonicFury) - demonBar.bg = bgFrame:CreateTexture(nil, "BACKGROUND") - demonBar.bg:SetAllPoints(bgFrame) - demonBar.bg:SetTexture(0.2,0,0,0.5) + local bgTexture = bgFrame:CreateTexture(nil, "BACKGROUND") + bgTexture:SetAllPoints(bgFrame) + bgTexture:SetTexture(0.2,0,0,0.5) local borderB = bgFrame:CreateTexture(nil,"OVERLAY") borderB:SetTexture(0,0,0) @@ -351,13 +354,24 @@ function MOD:CreateClassBar(playerFrame) borderR:SetPoint("BOTTOMRIGHT") borderR:SetWidth(2) - bar.DemonBar = demonBar; + local demonBar = CreateFrame("StatusBar", nil, bgFrame) + demonBar.noupdate = true; + demonBar:SetAllPointsIn(bgFrame) + demonBar:SetOrientation("HORIZONTAL") + demonBar:SetStatusBarTexture(SV.Media.bar.glow) + + SV.SpecialFX:SetFXFrame(demonBar, "overlay_demonbar", true) + demonBar.FX:SetScript("OnShow", EffectModel_OnShow) + + demonicFury.bg = bgTexture; + demonicFury.bar = demonBar; + bar.DemonicFury = demonicFury; bar.CurrentSpec = 0; bar.Override = Update; local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) - classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) + classBarHolder:SetPointToScale("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder SV.Mentalo:Add(bar.Holder, L["Classbar"]) diff --git a/Interface/AddOns/SVUI/scripts/misc.lua b/Interface/AddOns/SVUI/scripts/misc.lua index c5ac8ce..bb762e7 100644 --- a/Interface/AddOns/SVUI/scripts/misc.lua +++ b/Interface/AddOns/SVUI/scripts/misc.lua @@ -114,7 +114,7 @@ CHAT BUBBLES -- frame:SetFrameStrata("BACKGROUND") -- end -- if(frame.text) then --- frame.text:SetFont(SV.Media.font.dialog, 10, "NONE") +-- frame.text:SetFont(SV.Media.font.narrator, 10, "NONE") -- frame.text:SetShadowColor(0,0,0,1) -- frame.text:SetShadowOffset(1,-1) -- end @@ -270,7 +270,7 @@ local function LoadDressupHelper() helmet = CreateFrame('CheckButton', nil, CharacterModelFrame, "OptionsCheckButtonTemplate") helmet:SetSize(16, 16) --helmet:RemoveTextures() - --helmet:SetCheckboxTemplate() + --helmet:SetStylePanel("Checkbox") helmet.text = helmet:CreateFontString(nil, 'OVERLAY', "GameFontNormal") helmet.text:SetPoint("LEFT", 24, 0) helmet.TText = "Show/Hide Helmet" @@ -281,7 +281,7 @@ local function LoadDressupHelper() cloak = CreateFrame('CheckButton', nil, CharacterModelFrame, "OptionsCheckButtonTemplate") cloak:SetSize(16, 16) --cloak:RemoveTextures() - --cloak:SetCheckboxTemplate() + --cloak:SetStylePanel("Checkbox") cloak.text = cloak:CreateFontString(nil, 'OVERLAY', "GameFontNormal") cloak.text:SetPoint("LEFT", 24, 0) cloak.TText = "Show/Hide Cloak" @@ -315,8 +315,8 @@ RaidMarkFrame:SetFrameStrata("DIALOG") local RaidMarkButton_OnEnter = function(self) self.Texture:ClearAllPoints() - self.Texture:Point("TOPLEFT",-10,10) - self.Texture:Point("BOTTOMRIGHT",10,-10) + self.Texture:SetPointToScale("TOPLEFT",-10,10) + self.Texture:SetPointToScale("BOTTOMRIGHT",10,-10) end local RaidMarkButton_OnLeave = function(self) @@ -441,7 +441,7 @@ function SV:UpdateTotems() for i = 1, MAX_TOTEMS do local button = TotemBar[i] local lastButton = TotemBar[i - 1] - button:Size(totemSize) + button:SetSizeToScale(totemSize) button:ClearAllPoints() if(totemGrowth == "HORIZONTAL" and totemSort == "ASCENDING") then if(i == 1) then @@ -473,7 +473,7 @@ function SV:UpdateTotems() local tS2 = (totemSize + (totemSpace * 2)); local tW = (totemGrowth == "HORIZONTAL" and tS1 or tS2); local tH = (totemGrowth == "HORIZONTAL" and tS2 or tS1); - TotemBar:Size(tW, tH); + TotemBar:SetSizeToScale(tW, tH); Totems_OnEvent() end @@ -499,7 +499,7 @@ local function CreateTotemBar() totem:Hide() totem.Icon = totem:CreateTexture(nil, "ARTWORK") - totem.Icon:FillInner() + totem.Icon:SetAllPointsIn() totem.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) totem.CD = CreateFrame("Cooldown", "TotemBarTotem"..id.."Cooldown", totem, "CooldownFrameTemplate") totem.CD:SetReverse(true) @@ -507,7 +507,7 @@ local function CreateTotemBar() totem.Anchor = CreateFrame("Frame", nil, totem) totem.Anchor:SetAllPoints() - totem:SetButtonTemplate() + totem:SetStylePanel("Button") totem:EnableMouse(true) totem:SetScript('OnEnter', Totem_OnEnter) @@ -647,9 +647,9 @@ local function LoadThreatBar() ThreatBar:SetOrientation("VERTICAL") ThreatBar:SetMinMaxValues(0, 100) if(anchor) then - ThreatBar:Point('LEFT', _G.SVUI_Target, 'RIGHT', 0, 10) + ThreatBar:SetPointToScale('LEFT', _G.SVUI_Target, 'RIGHT', 0, 10) else - ThreatBar:Point('LEFT', UIParent, 'CENTER', 50, -50) + ThreatBar:SetPointToScale('LEFT', UIParent, 'CENTER', 50, -50) end ThreatBar.backdrop = ThreatBar:CreateTexture(nil,"BACKGROUND") ThreatBar.backdrop:SetAllPoints(ThreatBar) diff --git a/Interface/AddOns/SVUI/scripts/mounts.lua b/Interface/AddOns/SVUI/scripts/mounts.lua index bb1b4c0..918feb1 100644 --- a/Interface/AddOns/SVUI/scripts/mounts.lua +++ b/Interface/AddOns/SVUI/scripts/mounts.lua @@ -260,6 +260,7 @@ ADDING CHECKBOXES TO JOURNAL ########################################################## ]]-- local function SetMountCheckButtons() + LoadAddOn("Blizzard_PetJournal") SV.cache.Mounts = SV.cache.Mounts or {} if not SV.cache.Mounts.types then @@ -301,7 +302,7 @@ local function SetMountCheckButtons() buttonBar["GROUND"]:SetSize(width,height) buttonBar["GROUND"]:SetPoint("BOTTOMLEFT", buttonBar, "BOTTOMLEFT", 6, 4) buttonBar["GROUND"]:RemoveTextures() - buttonBar["GROUND"]:SetColorCheckboxTemplate() + buttonBar["GROUND"]:SetStylePanel("Colored") buttonBar["GROUND"]:SetPanelColor(0.2, 0.7, 0.1, 0.15) buttonBar["GROUND"]:GetCheckedTexture():SetVertexColor(0.2, 0.7, 0.1, 1) buttonBar["GROUND"].key = "GROUND" @@ -314,7 +315,7 @@ local function SetMountCheckButtons() buttonBar["FLYING"]:SetSize(width,height) buttonBar["FLYING"]:SetPoint("BOTTOMLEFT", buttonBar["GROUND"], "BOTTOMRIGHT", 2, 0) buttonBar["FLYING"]:RemoveTextures() - buttonBar["FLYING"]:SetColorCheckboxTemplate() + buttonBar["FLYING"]:SetStylePanel("Colored") buttonBar["FLYING"]:SetPanelColor(1, 1, 0.2, 0.15) buttonBar["FLYING"]:GetCheckedTexture():SetVertexColor(1, 1, 0.2, 1) buttonBar["FLYING"].key = "FLYING" @@ -327,7 +328,7 @@ local function SetMountCheckButtons() buttonBar["SWIMMING"]:SetSize(width,height) buttonBar["SWIMMING"]:SetPoint("BOTTOMLEFT", buttonBar["FLYING"], "BOTTOMRIGHT", 2, 0) buttonBar["SWIMMING"]:RemoveTextures() - buttonBar["SWIMMING"]:SetColorCheckboxTemplate() + buttonBar["SWIMMING"]:SetStylePanel("Colored") buttonBar["SWIMMING"]:SetPanelColor(0.2, 0.42, 0.76, 0.15) buttonBar["SWIMMING"]:GetCheckedTexture():SetVertexColor(0.2, 0.42, 0.76, 1) buttonBar["SWIMMING"].key = "SWIMMING" @@ -340,7 +341,7 @@ local function SetMountCheckButtons() buttonBar["SPECIAL"]:SetSize(width,height) buttonBar["SPECIAL"]:SetPoint("BOTTOMLEFT", buttonBar["SWIMMING"], "BOTTOMRIGHT", 2, 0) buttonBar["SPECIAL"]:RemoveTextures() - buttonBar["SPECIAL"]:SetColorCheckboxTemplate() + buttonBar["SPECIAL"]:SetStylePanel("Colored") buttonBar["SPECIAL"]:SetPanelColor(0.7, 0.1, 0.1, 0.15) buttonBar["SPECIAL"]:GetCheckedTexture():SetVertexColor(0.7, 0.1, 0.1, 1) buttonBar["SPECIAL"].key = "SPECIAL" @@ -397,7 +398,7 @@ _G.SVUILetsRide = function() local continent = GetCurrentMapContinent() local checkList = SV.cache.Mounts.types - local letsFly = (IsFlyableArea() and (continent ~= 7)) + local letsFly = (IsFlyableArea() and (continent ~= 962 and continent ~= 7)) local letsSwim = IsSwimming() if(IsModifierKeyDown() and checkList["SPECIAL"]) then diff --git a/Interface/AddOns/SVUI/scripts/spellbind.lua b/Interface/AddOns/SVUI/scripts/spellbind.lua index df40ed0..6fcdb73 100644 --- a/Interface/AddOns/SVUI/scripts/spellbind.lua +++ b/Interface/AddOns/SVUI/scripts/spellbind.lua @@ -434,15 +434,15 @@ local function LoadSpellBinder() SVUI_SpellBinderInset:RemoveTextures() - SpellBinder:SetPanelTemplate("Action") + SpellBinder:SetStylePanel("Default", "Action") SpellBinder.Panel:SetPoint("TOPLEFT", -18, 0) SpellBinder.Panel:SetPoint("BOTTOMRIGHT", 0, 0) SpellBinder.list:RemoveTextures() - SpellBinder.list:SetPanelTemplate("Inset") + SpellBinder.list:SetStylePanel("Default", "Inset") SpellBinder.tab:RemoveTextures() - SpellBinder.tab:SetButtonTemplate() + SpellBinder.tab:SetStylePanel("Button") SpellBinder.tab:SetNormalTexture("Interface\\ICONS\\Achievement_Guild_Doctorisin") SpellBinder.tab:GetNormalTexture():ClearAllPoints() SpellBinder.tab:GetNormalTexture():SetPoint("TOPLEFT", 2, -2) diff --git a/Interface/AddOns/SVUI/setup/installer.lua b/Interface/AddOns/SVUI/setup/installer.lua index 155c6e4..b82bb18 100644 --- a/Interface/AddOns/SVUI/setup/installer.lua +++ b/Interface/AddOns/SVUI/setup/installer.lua @@ -55,9 +55,9 @@ local mungs = false; local user_music_vol = GetCVar("Sound_MusicVolume") or 0; local musicIsPlaying; local PageData, OnClickData -local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS +local CUSTOM_CLASS_COLORS = _G.CUSTOM_CLASS_COLORS local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS -local scc = SVUI_CLASS_COLORS[SV.class]; +local scc = CUSTOM_CLASS_COLORS[SV.class]; local rcc = RAID_CLASS_COLORS[SV.class]; local r2 = .1 + (rcc.r * .1) local g2 = .1 + (rcc.g * .1) @@ -160,7 +160,7 @@ local function UFMoveBottomQuadrant(toggle) anchors.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM-278122" anchors.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM278182" anchors.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM278122" - anchors.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM0181" + --anchors.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM0181" anchors.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM0214" anchors.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM310432" anchors.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495182" @@ -169,7 +169,7 @@ local function UFMoveBottomQuadrant(toggle) anchors.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM-278150" anchors.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM278210" anchors.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM278150" - anchors.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM0209" + --anchors.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM0209" anchors.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM0242" anchors.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM310432" anchors.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495210" @@ -181,7 +181,7 @@ local function UFMoveBottomQuadrant(toggle) anchors.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..(d-60); anchors.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..d; anchors.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..(d-60); - anchors.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..e; + --anchors.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..e; anchors.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..e; anchors.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..(d + 150); anchors.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495"..d; @@ -458,7 +458,7 @@ function SV.Setup:ColorTheme(style, preserve) if(not mungs) then SV:MediaUpdate() - SVLib:RefreshModule('SVStats') + SVLib:RefreshModule('Dock') SVLib:RefreshModule('SVUnit') if(not preserve) then SV:SavedPopup() @@ -471,7 +471,7 @@ function SV.Setup:UnitframeLayout(style, preserve) if not preserve then SV:ResetData("SVUnit") - SV:ResetData("SVStats") + SV:ResetData("Dock") if okToResetMOVE then SV.Mentalo:Reset('') okToResetMOVE = false @@ -494,7 +494,7 @@ function SV.Setup:UnitframeLayout(style, preserve) end SV.Mentalo:SetPositions() end - SVLib:RefreshModule('SVStats') + SVLib:RefreshModule('Dock') SVLib:RefreshModule('SVUnit') if(not preserve) then SV:SavedPopup() @@ -542,7 +542,7 @@ function SV.Setup:BarLayout(style, preserve) BarShuffle() SV.Mentalo:SetPositions() end - SVLib:RefreshModule('SVStats') + SVLib:RefreshModule('Dock') SVLib:RefreshModule('SVBar') if(not preserve) then SV:SavedPopup() @@ -557,7 +557,7 @@ function SV.Setup:Auralayout(style, preserve) SV.db.LAYOUT.aurastyle = style; if(not mungs) then - SVLib:RefreshModule('SVStats') + SVLib:RefreshModule('Dock') SVLib:RefreshModule('SVAura') SVLib:RefreshModule('SVUnit') if(not preserve) then @@ -579,12 +579,82 @@ end function SV.Setup:EZDefault() mungs = true; okToResetMOVE = false; + + self:SetAllDefaults() + self:ChatConfigs(true); - self:UserScreen('high'); + self:UserScreen() self:ColorTheme("default", true); self:UnitframeLayout("default", true); + self:GroupframeLayout("default", true); + self:BarLayout("default", true); + self:Auralayout("default", true); + + SV.db.general.comix = true; + SV.db.general.gamemenu = true; + SV.db.general.afk = true; + SV.db.general.woot = true; + + SV.db.general.arenadrink = true; + SV.db.general.stupidhat = true; + SV.db.SVAura.hyperBuffs.enable = true; + SV.db.SVBag.bagTools = true; + SV.db.Dock.leftDockBackdrop = true; + SV.db.Dock.rightDockBackdrop = true; + SV.db.Dock.dataBackdrop = true; + + SV.db.SVGear.enable = true; + SV.db.SVMap.customIcons = true; + SV.db.SVMap.bordersize = 6; + SV.db.SVMap.locationText = ""; + SV.db.SVMap.playercoords = ""; + SV.db.SVPlate.comicStyle = true; + SV.db.SVTip.comicStyle = true; + SV.db.SVTools.enable = true; + SV.db.SVUnit.comicStyle = true; + + SVLib:SaveSafeData("install_version", SV.Version) + StopMusic() + SetCVar("Sound_MusicVolume", user_music_vol or 0) + ReloadUI() +end + +function SV.Setup:Minimalist() + mungs = true; + okToResetMOVE = false; + self:SetAllDefaults() + self:ChatConfigs(true); + self:UserScreen() + self:ColorTheme("classy", true); + self:UnitframeLayout("compact", true); + self:GroupframeLayout("grid", true); self:BarLayout("default", true); self:Auralayout("default", true); + + SV.db.general.comix = false; + SV.db.general.gamemenu = false; + SV.db.general.afk = false; + SV.db.general.woot = false; + + SV.db.general.arenadrink = false; + SV.db.general.stupidhat = false; + SV.db.SVAura.hyperBuffs.enable = false; + SV.db.SVBag.bagTools = false; + --SV.db.Dock.leftDockBackdrop = false; + --SV.db.Dock.rightDockBackdrop = false; + SV.db.Dock.dataBackdrop = false; + + SV.db.SVGear.enable = false; + SV.db.SVMap.customIcons = false; + SV.db.SVMap.bordersize = 2; + SV.db.SVMap.bordercolor = "dark"; + SV.db.SVMap.locationText = "HIDE"; + SV.db.SVMap.playercoords = "HIDE"; + SV.db.SVPlate.comicStyle = false; + SV.db.SVTip.comicStyle = false; + --SV.db.SVTools.enable = false; + SV.db.SVUnit.comicStyle = false; + SVLib:SaveSafeData("install_version", SV.Version) StopMusic() SetCVar("Sound_MusicVolume", user_music_vol or 0) @@ -619,7 +689,7 @@ local InstallerFrame_PreparePage = function(self) self.Option01.Arg = nil self.Option01.ClickIndex = nil self.Option01:SetWidth(160) - self.Option01.texture:Size(160, 160) + self.Option01.texture:SetSizeToScale(160, 160) self.Option01.texture:SetPoint("CENTER", self.Option01, "BOTTOM", 0, -(160 * 0.09)) self.Option01:ClearAllPoints() self.Option01:SetPoint("BOTTOM", 0, 15) @@ -647,7 +717,7 @@ local InstallerFrame_PreparePage = function(self) self.Option1.Arg = nil self.Option1.ClickIndex = nil self.Option1:SetWidth(160) - self.Option1.texture:Size(160, 160) + self.Option1.texture:SetSizeToScale(160, 160) self.Option1.texture:SetPoint("CENTER", self.Option1, "BOTTOM", 0, -(160 * 0.09)) self.Option1:ClearAllPoints() self.Option1:SetPoint("BOTTOM", 0, 15) @@ -659,7 +729,7 @@ local InstallerFrame_PreparePage = function(self) self.Option2.Arg = nil self.Option2.ClickIndex = nil self.Option2:SetWidth(120) - self.Option2.texture:Size(120, 120) + self.Option2.texture:SetSizeToScale(120, 120) self.Option2.texture:SetPoint("CENTER", self.Option2, "BOTTOM", 0, -(120 * 0.09)) self.Option2:ClearAllPoints() self.Option2:SetPoint("BOTTOMLEFT", self, "BOTTOM", 4, 15) @@ -671,7 +741,7 @@ local InstallerFrame_PreparePage = function(self) self.Option3.Arg = nil self.Option3.ClickIndex = nil self.Option3:SetWidth(120) - self.Option3.texture:Size(120, 120) + self.Option3.texture:SetSizeToScale(120, 120) self.Option3.texture:SetPoint("CENTER", self.Option3, "BOTTOM", 0, -(120 * 0.09)) self.Option3:ClearAllPoints() self.Option3:SetPoint("LEFT", self.Option2, "RIGHT", 4, 0) @@ -683,7 +753,7 @@ local InstallerFrame_PreparePage = function(self) self.Option4.Arg = nil self.Option4.ClickIndex = nil self.Option4:SetWidth(110) - self.Option4.texture:Size(110, 110) + self.Option4.texture:SetSizeToScale(110, 110) self.Option4.texture:SetPoint("CENTER", self.Option4, "BOTTOM", 0, -(110 * 0.09)) self.Option4:ClearAllPoints() self.Option4:SetPoint("LEFT", self.Option3, "RIGHT", 4, 0) @@ -704,11 +774,11 @@ local InstallerFrame_PreparePage = function(self) if CURRENT_PAGE == MAX_PAGE then self.Next:Disable() self.Next:Hide() - self:Size(550, 350) + self:SetSizeToScale(550, 350) else self.Next:Enable() self.Next:Show() - self:Size(550,400) + self:SetSizeToScale(550,400) end end @@ -815,8 +885,8 @@ function SV.Setup:Install(autoLoaded) if not SVUI_InstallerFrame then local frame = CreateFrame("Button", "SVUI_InstallerFrame", UIParent) - frame:Size(550, 400) - frame:SetPanelTemplate("Action") + frame:SetSizeToScale(550, 400) + frame:SetStylePanel("Default", "Action") frame:SetPoint("TOP", SV.Screen, "TOP", 0, -150) frame:SetFrameStrata("TOOLTIP") @@ -827,16 +897,16 @@ function SV.Setup:Install(autoLoaded) frame.Next = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate") frame.Next:RemoveTextures() - frame.Next:Size(110, 25) + frame.Next:SetSizeToScale(110, 25) frame.Next:SetPoint("BOTTOMRIGHT", 50, 5) SetInstallButton(frame.Next) frame.Next.texture = frame.Next:CreateTexture(nil, "BORDER") - frame.Next.texture:Size(110, 75) + frame.Next.texture:SetSizeToScale(110, 75) frame.Next.texture:SetPoint("RIGHT") frame.Next.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION-ARROW") frame.Next.texture:SetVertexColor(1, 0.5, 0) frame.Next.text = frame.Next:CreateFontString(nil, "OVERLAY") - frame.Next.text:SetFont(SV.Media.font.action, 18, "OUTLINE") + frame.Next.text:SetFont(SV.Media.font.flash, 18, "OUTLINE") frame.Next.text:SetPoint("CENTER") frame.Next.text:SetText(CONTINUE) frame.Next:Disable() @@ -853,17 +923,17 @@ function SV.Setup:Install(autoLoaded) frame.Prev = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate") frame.Prev:RemoveTextures() - frame.Prev:Size(110, 25) + frame.Prev:SetSizeToScale(110, 25) frame.Prev:SetPoint("BOTTOMLEFT", -50, 5) SetInstallButton(frame.Prev) frame.Prev.texture = frame.Prev:CreateTexture(nil, "BORDER") - frame.Prev.texture:Size(110, 75) + frame.Prev.texture:SetSizeToScale(110, 75) frame.Prev.texture:SetPoint("LEFT") frame.Prev.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION-ARROW") frame.Prev.texture:SetTexCoord(1, 0, 1, 1, 0, 0, 0, 1) frame.Prev.texture:SetVertexColor(1, 0.5, 0) frame.Prev.text = frame.Prev:CreateFontString(nil, "OVERLAY") - frame.Prev.text:SetFont(SV.Media.font.action, 18, "OUTLINE") + frame.Prev.text:SetFont(SV.Media.font.flash, 18, "OUTLINE") frame.Prev.text:SetPoint("CENTER") frame.Prev.text:SetText(PREVIOUS) frame.Prev:Disable() @@ -880,12 +950,12 @@ function SV.Setup:Install(autoLoaded) frame.Option01 = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate") frame.Option01:RemoveTextures() - frame.Option01:Size(160, 30) + frame.Option01:SetSizeToScale(160, 30) frame.Option01:SetPoint("BOTTOM", 0, 15) frame.Option01:SetText("") SetInstallButton(frame.Option01) frame.Option01.texture = frame.Option01:CreateTexture(nil, "BORDER") - frame.Option01.texture:Size(160, 160) + frame.Option01.texture:SetSizeToScale(160, 160) frame.Option01.texture:SetPoint("CENTER", frame.Option01, "BOTTOM", 0, -15) frame.Option01.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") frame.Option01.texture:SetGradient("VERTICAL", 0, 0.3, 0, 0, 0.7, 0) @@ -902,25 +972,25 @@ function SV.Setup:Install(autoLoaded) frame.Option02 = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate") frame.Option02:RemoveTextures() - frame.Option02:Size(130, 30) + frame.Option02:SetSizeToScale(130, 30) frame.Option02:SetPoint("BOTTOMLEFT", frame, "BOTTOM", 4, 15) frame.Option02:SetText("") SetInstallButton(frame.Option02) frame.Option02.texture = frame.Option02:CreateTexture(nil, "BORDER") - frame.Option02.texture:Size(130, 110) + frame.Option02.texture:SetSizeToScale(130, 110) frame.Option02.texture:SetPoint("CENTER", frame.Option02, "BOTTOM", 0, -15) frame.Option02.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") - frame.Option02.texture:SetGradient("VERTICAL", 0.3, 0, 0, 0.7, 0, 0) + frame.Option02.texture:SetGradient("VERTICAL", 0, 0.1, 0.3, 0, 0.5, 0.7) frame.Option02:SetScript("OnEnter", function(this) this.texture:SetVertexColor(0.5, 1, 0.4) end) frame.Option02:SetScript("OnLeave", function(this) - this.texture:SetGradient("VERTICAL", 0.3, 0, 0, 0.7, 0, 0) + this.texture:SetGradient("VERTICAL", 0, 0.1, 0.3, 0, 0.5, 0.7) end) frame.Option02:SetScript("OnShow", function() if(not frame.Option03:IsShown()) then frame.Option01:SetWidth(130) - frame.Option01.texture:Size(130, 130) + frame.Option01.texture:SetSizeToScale(130, 130) frame.Option01.texture:SetPoint("CENTER", frame.Option01, "BOTTOM", 0, -(130 * 0.09)) frame.Option01:ClearAllPoints() frame.Option01:SetPoint("BOTTOMRIGHT", frame, "BOTTOM", -4, 15) @@ -933,34 +1003,34 @@ function SV.Setup:Install(autoLoaded) frame.Option03 = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate") frame.Option03:RemoveTextures() - frame.Option03:Size(130, 30) + frame.Option03:SetSizeToScale(130, 30) frame.Option03:SetPoint("BOTTOM", frame, "BOTTOM", 0, 15) frame.Option03:SetText("") SetInstallButton(frame.Option03) frame.Option03.texture = frame.Option03:CreateTexture(nil, "BORDER") - frame.Option03.texture:Size(130, 110) + frame.Option03.texture:SetSizeToScale(130, 110) frame.Option03.texture:SetPoint("CENTER", frame.Option03, "BOTTOM", 0, -15) frame.Option03.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") - frame.Option03.texture:SetGradient("VERTICAL", 0, 0.1, 0.3, 0, 0.5, 0.7) + frame.Option03.texture:SetGradient("VERTICAL", 0.3, 0, 0, 0.7, 0, 0) frame.Option03:SetScript("OnEnter", function(this) this.texture:SetVertexColor(0.2, 0.5, 1) end) frame.Option03:SetScript("OnLeave", function(this) - this.texture:SetGradient("VERTICAL", 0, 0.1, 0.3, 0, 0.5, 0.7) + this.texture:SetGradient("VERTICAL", 0.3, 0, 0, 0.7, 0, 0) end) frame.Option03:SetScript("OnShow", function(this) this:SetWidth(130) - this.texture:Size(130, 130) + this.texture:SetSizeToScale(130, 130) this.texture:SetPoint("CENTER", this, "BOTTOM", 0, -(130 * 0.09)) frame.Option01:SetWidth(130) - frame.Option01.texture:Size(130, 130) + frame.Option01.texture:SetSizeToScale(130, 130) frame.Option01.texture:SetPoint("CENTER", frame.Option01, "BOTTOM", 0, -(130 * 0.09)) frame.Option01:ClearAllPoints() frame.Option01:SetPoint("RIGHT", this, "LEFT", -8, 0) frame.Option02:SetWidth(130) - frame.Option02.texture:Size(130, 130) + frame.Option02.texture:SetSizeToScale(130, 130) frame.Option02.texture:SetPoint("CENTER", frame.Option02, "BOTTOM", 0, -(130 * 0.09)) frame.Option02:ClearAllPoints() frame.Option02:SetPoint("LEFT", this, "RIGHT", 8, 0) @@ -972,12 +1042,12 @@ function SV.Setup:Install(autoLoaded) frame.Option1 = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate") frame.Option1:RemoveTextures() - frame.Option1:Size(160, 30) + frame.Option1:SetSizeToScale(160, 30) frame.Option1:SetPoint("BOTTOM", 0, 15) frame.Option1:SetText("") SetInstallButton(frame.Option1) frame.Option1.texture = frame.Option1:CreateTexture(nil, "BORDER") - frame.Option1.texture:Size(160, 160) + frame.Option1.texture:SetSizeToScale(160, 160) frame.Option1.texture:SetPoint("CENTER", frame.Option1, "BOTTOM", 0, -15) frame.Option1.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") frame.Option1.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) @@ -994,12 +1064,12 @@ function SV.Setup:Install(autoLoaded) frame.Option2 = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate") frame.Option2:RemoveTextures() - frame.Option2:Size(120, 30) + frame.Option2:SetSizeToScale(120, 30) frame.Option2:SetPoint("BOTTOMLEFT", frame, "BOTTOM", 4, 15) frame.Option2:SetText("") SetInstallButton(frame.Option2) frame.Option2.texture = frame.Option2:CreateTexture(nil, "BORDER") - frame.Option2.texture:Size(120, 110) + frame.Option2.texture:SetSizeToScale(120, 110) frame.Option2.texture:SetPoint("CENTER", frame.Option2, "BOTTOM", 0, -15) frame.Option2.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") frame.Option2.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) @@ -1012,7 +1082,7 @@ function SV.Setup:Install(autoLoaded) frame.Option2:SetScript("OnShow", function() if(not frame.Option3:IsShown() and (not frame.Option4:IsShown())) then frame.Option1:SetWidth(120) - frame.Option1.texture:Size(120, 120) + frame.Option1.texture:SetSizeToScale(120, 120) frame.Option1.texture:SetPoint("CENTER", frame.Option1, "BOTTOM", 0, -(120 * 0.09)) frame.Option1:ClearAllPoints() frame.Option1:SetPoint("BOTTOMRIGHT", frame, "BOTTOM", -4, 15) @@ -1025,12 +1095,12 @@ function SV.Setup:Install(autoLoaded) frame.Option3 = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate") frame.Option3:RemoveTextures() - frame.Option3:Size(110, 30) + frame.Option3:SetSizeToScale(110, 30) frame.Option3:SetPoint("LEFT", frame.Option2, "RIGHT", 4, 0) frame.Option3:SetText("") SetInstallButton(frame.Option3) frame.Option3.texture = frame.Option3:CreateTexture(nil, "BORDER") - frame.Option3.texture:Size(110, 100) + frame.Option3.texture:SetSizeToScale(110, 100) frame.Option3.texture:SetPoint("CENTER", frame.Option3, "BOTTOM", 0, -9) frame.Option3.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") frame.Option3.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) @@ -1043,19 +1113,19 @@ function SV.Setup:Install(autoLoaded) frame.Option3:SetScript("OnShow", function(this) if(not frame.Option4:IsShown()) then frame.Option2:SetWidth(110) - frame.Option2.texture:Size(110, 110) + frame.Option2.texture:SetSizeToScale(110, 110) frame.Option2.texture:SetPoint("CENTER", frame.Option2, "BOTTOM", 0, -(110 * 0.09)) frame.Option2:ClearAllPoints() frame.Option2:SetPoint("BOTTOM", frame, "BOTTOM", 0, 15) frame.Option1:SetWidth(110) - frame.Option1.texture:Size(110, 110) + frame.Option1.texture:SetSizeToScale(110, 110) frame.Option1.texture:SetPoint("CENTER", frame.Option1, "BOTTOM", 0, -(110 * 0.09)) frame.Option1:ClearAllPoints() frame.Option1:SetPoint("RIGHT", frame.Option2, "LEFT", -4, 0) this:SetWidth(110) - this.texture:Size(110, 110) + this.texture:SetSizeToScale(110, 110) this.texture:SetPoint("CENTER", this, "BOTTOM", 0, -(110 * 0.09)) this:ClearAllPoints() this:SetPoint("LEFT", frame.Option2, "RIGHT", 4, 0) @@ -1068,12 +1138,12 @@ function SV.Setup:Install(autoLoaded) frame.Option4 = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate") frame.Option4:RemoveTextures() - frame.Option4:Size(110, 30) + frame.Option4:SetSizeToScale(110, 30) frame.Option4:SetPoint("LEFT", frame.Option3, "RIGHT", 4, 0) frame.Option4:SetText("") SetInstallButton(frame.Option4) frame.Option4.texture = frame.Option4:CreateTexture(nil, "BORDER") - frame.Option4.texture:Size(110, 100) + frame.Option4.texture:SetSizeToScale(110, 100) frame.Option4.texture:SetPoint("CENTER", frame.Option4, "BOTTOM", 0, -9) frame.Option4.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") frame.Option4.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) @@ -1085,20 +1155,20 @@ function SV.Setup:Install(autoLoaded) end) frame.Option4:SetScript("OnShow", function() - frame.Option2:Width(110) - frame.Option2.texture:Size(110, 110) + frame.Option2:SetWidthToScale(110) + frame.Option2.texture:SetSizeToScale(110, 110) frame.Option2.texture:SetPoint("CENTER", frame.Option2, "BOTTOM", 0, -(110 * 0.09)) frame.Option2:ClearAllPoints() frame.Option2:SetPoint("BOTTOMRIGHT", frame, "BOTTOM", -4, 15) - frame.Option1:Width(110) - frame.Option1.texture:Size(110, 110) + frame.Option1:SetWidthToScale(110) + frame.Option1.texture:SetSizeToScale(110, 110) frame.Option1.texture:SetPoint("CENTER", frame.Option1, "BOTTOM", 0, -(110 * 0.09)) frame.Option1:ClearAllPoints() frame.Option1:SetPoint("RIGHT", frame.Option2, "LEFT", -4, 0) frame.Option3:SetWidth(110) - frame.Option3.texture:Size(110, 110) + frame.Option3.texture:SetSizeToScale(110, 110) frame.Option3.texture:SetPoint("CENTER", frame.Option3, "BOTTOM", 0, -(110 * 0.09)) frame.Option3:ClearAllPoints() frame.Option3:SetPoint("LEFT", frame.Option2, "RIGHT", 4, 0) @@ -1111,8 +1181,8 @@ function SV.Setup:Install(autoLoaded) local statusHolder = CreateFrame("Frame", nil, frame) statusHolder:SetFrameLevel(statusHolder:GetFrameLevel() + 2) - statusHolder:Size(150, 30) - statusHolder:Point("BOTTOM", frame, "TOP", 0, 2) + statusHolder:SetSizeToScale(150, 30) + statusHolder:SetPointToScale("BOTTOM", frame, "TOP", 0, 2) frame.Status = statusHolder:CreateFontString(nil, "OVERLAY") frame.Status:SetFont(SV.Media.font.numbers, 22, "OUTLINE") @@ -1120,28 +1190,28 @@ function SV.Setup:Install(autoLoaded) frame.Status:SetText(CURRENT_PAGE.." / "..MAX_PAGE) local titleHolder = frame:CreateFontString(nil, "OVERLAY") - titleHolder:SetFont(SV.Media.font.narrator, 22, "OUTLINE") - titleHolder:Point("TOP", 0, -5) + titleHolder:SetFont(SV.Media.font.names, 22, "OUTLINE") + titleHolder:SetPointToScale("TOP", 0, -5) titleHolder:SetText(L["Supervillain UI Installation"]) frame.SubTitle = frame:CreateFontString(nil, "OVERLAY") - frame.SubTitle:SetFont(SV.Media.font.roboto, 16, "OUTLINE") - frame.SubTitle:Point("TOP", 0, -40) + frame.SubTitle:SetFont(SV.Media.font.alert, 16, "OUTLINE") + frame.SubTitle:SetPointToScale("TOP", 0, -40) frame.Desc1 = frame:CreateFontString(nil, "OVERLAY") - frame.Desc1:SetFont(SV.Media.font.roboto, 14, "OUTLINE") - frame.Desc1:Point("TOPLEFT", 20, -75) - frame.Desc1:Width(frame:GetWidth()-40) + frame.Desc1:SetFont(SV.Media.font.default, 14, "OUTLINE") + frame.Desc1:SetPointToScale("TOPLEFT", 20, -75) + frame.Desc1:SetWidthToScale(frame:GetWidth()-40) frame.Desc2 = frame:CreateFontString(nil, "OVERLAY") - frame.Desc2:SetFont(SV.Media.font.roboto, 14, "OUTLINE") - frame.Desc2:Point("TOPLEFT", 20, -125) - frame.Desc2:Width(frame:GetWidth()-40) + frame.Desc2:SetFont(SV.Media.font.default, 14, "OUTLINE") + frame.Desc2:SetPointToScale("TOPLEFT", 20, -125) + frame.Desc2:SetWidthToScale(frame:GetWidth()-40) frame.Desc3 = frame:CreateFontString(nil, "OVERLAY") - frame.Desc3:SetFont(SV.Media.font.roboto, 14, "OUTLINE") - frame.Desc3:Point("TOPLEFT", 20, -175) - frame.Desc3:Width(frame:GetWidth()-40) + frame.Desc3:SetFont(SV.Media.font.default, 14, "OUTLINE") + frame.Desc3:SetPointToScale("TOPLEFT", 20, -175) + frame.Desc3:SetWidthToScale(frame:GetWidth()-40) --[[ MISC ]]-- @@ -1150,9 +1220,9 @@ function SV.Setup:Install(autoLoaded) closeButton:SetScript("OnClick", function() frame:Hide() end) local tutorialImage = frame:CreateTexture(nil, "OVERLAY") - tutorialImage:Size(256, 128) + tutorialImage:SetSizeToScale(256, 128) tutorialImage:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\SPLASH") - tutorialImage:Point("BOTTOM", 0, 70) + tutorialImage:SetPointToScale("BOTTOM", 0, 70) end SVUI_InstallerFrame:SetScript("OnHide", function() diff --git a/Interface/AddOns/SVUI/setup/presets.lua b/Interface/AddOns/SVUI/setup/presets.lua index d63ea73..2891ebc 100644 --- a/Interface/AddOns/SVUI/setup/presets.lua +++ b/Interface/AddOns/SVUI/setup/presets.lua @@ -49,14 +49,14 @@ local L = SV.L; LOCAL VARS ########################################################## ]]-- -local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS +local CUSTOM_CLASS_COLORS = _G.CUSTOM_CLASS_COLORS local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS local CONTINUED = _G.CONTINUED local SETTINGS = _G.SETTINGS local HIGH = _G.HIGH local LOW = _G.LOW -local scc = SVUI_CLASS_COLORS[SV.class]; +local scc = CUSTOM_CLASS_COLORS[SV.class]; local rcc = RAID_CLASS_COLORS[SV.class]; local r2 = .1 + (rcc.r * .1) local g2 = .1 + (rcc.g * .1) @@ -162,15 +162,15 @@ local function LoadPresetData() ["default"] = { ["player"] = { ["buffs"] = { - enable = false, - attachTo = "DEBUFFS", + enable = true, + attachTo = "FRAME", anchorPoint = 'TOPLEFT', verticalGrowth = 'UP', horizontalGrowth = 'RIGHT', }, ["debuffs"] = { - enable = false, - attachTo = "FRAME", + enable = true, + attachTo = "BUFFS", anchorPoint = 'TOPLEFT', verticalGrowth = 'UP', horizontalGrowth = 'RIGHT', @@ -198,47 +198,23 @@ local function LoadPresetData() enable = false } }, - ["focus"] = { + ["targettarget"] = { ["buffs"] = { - enable = false, - attachTo = "FRAME", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["debuffs"] = { enable = true, attachTo = "FRAME", anchorPoint = 'TOPRIGHT', verticalGrowth = 'UP', horizontalGrowth = 'LEFT', }, - ["aurabar"] = { - enable = false - } - } - }, - ["icons"] = { - ["player"] = { - ["buffs"] = { - enable = true, - attachTo = "FRAME", - anchorPoint = 'TOPLEFT', - verticalGrowth = 'UP', - horizontalGrowth = 'RIGHT', - }, ["debuffs"] = { enable = true, attachTo = "BUFFS", - anchorPoint = 'TOPLEFT', + anchorPoint = 'TOPRIGHT', verticalGrowth = 'UP', - horizontalGrowth = 'RIGHT', + horizontalGrowth = 'LEFT', }, - ["aurabar"] = { - enable = false - } }, - ["target"] = { + ["focus"] = { ["buffs"] = { enable = true, attachTo = "FRAME", @@ -257,9 +233,9 @@ local function LoadPresetData() enable = false } }, - ["focus"] = { + ["focustarget"] = { ["buffs"] = { - enable = false, + enable = true, attachTo = "FRAME", anchorPoint = 'TOPRIGHT', verticalGrowth = 'UP', @@ -267,25 +243,20 @@ local function LoadPresetData() }, ["debuffs"] = { enable = true, - attachTo = "FRAME", + attachTo = "BUFFS", anchorPoint = 'TOPRIGHT', verticalGrowth = 'UP', horizontalGrowth = 'LEFT', }, - ["aurabar"] = { - enable = false - } } }, ["bars"] = { ["player"] = { ["buffs"] = { enable = false, - attachTo = "FRAME" }, ["debuffs"] = { enable = false, - attachTo = "FRAME" }, ["aurabar"] = { enable = true, @@ -295,30 +266,58 @@ local function LoadPresetData() ["target"] = { ["buffs"] = { enable = false, - attachTo = "FRAME" }, ["debuffs"] = { enable = false, - attachTo = "FRAME" }, ["aurabar"] = { enable = true, attachTo = "FRAME" } }, + ["targettarget"] = { + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + }, ["focus"] = { ["buffs"] = { enable = false, - attachTo = "FRAME" }, ["debuffs"] = { enable = false, - attachTo = "FRAME" }, ["aurabar"] = { enable = true, attachTo = "FRAME" } + }, + ["focustarget"] = { + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, } }, ["theworks"] = { @@ -362,6 +361,22 @@ local function LoadPresetData() attachTo = "DEBUFFS" } }, + ["targettarget"] = { + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + }, ["focus"] = { ["buffs"] = { enable = true, @@ -381,6 +396,22 @@ local function LoadPresetData() enable = true, attachTo = "DEBUFFS" } + }, + ["focustarget"] = { + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, } }, }, @@ -473,8 +504,6 @@ local function LoadPresetData() ["link"] = "SVUnit", ["default"] = { ["player"] = { - width = 215, - height = 60, portrait = { enable = true, overlay = true, @@ -482,8 +511,6 @@ local function LoadPresetData() } }, ["target"] = { - width = 215, - height = 60, portrait = { enable = true, overlay = true, @@ -491,32 +518,20 @@ local function LoadPresetData() } }, ["pet"] = { - width = 130, - height = 30, portrait = { enable = true, overlay = true, style = "3D", }, - name = { - position = "CENTER" - }, }, ["targettarget"] = { - width = 130, - height = 30, portrait = { enable = true, overlay = true, style = "3D", }, - name = { - position = "CENTER" - }, }, ["boss"] = { - width = 200, - height = 45, portrait = { enable = true, overlay = true, @@ -524,30 +539,15 @@ local function LoadPresetData() } }, ["party"] = { - width = 75, - height = 60, - wrapXOffset = 9, - wrapYOffset = 13, portrait = { enable = true, overlay = true, style = "3D", }, - name = { - position = "INNERTOPLEFT" - }, - }, - ["raid"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, }, }, ["super"] = { ["player"] = { - width = 215, - height = 60, portrait = { enable = true, overlay = true, @@ -555,8 +555,6 @@ local function LoadPresetData() } }, ["target"] = { - width = 215, - height = 60, portrait = { enable = true, overlay = true, @@ -564,32 +562,20 @@ local function LoadPresetData() } }, ["pet"] = { - width = 150, - height = 30, portrait = { enable = true, overlay = true, style = "3D", }, - name = { - position = "CENTER" - }, }, ["targettarget"] = { - width = 150, - height = 30, portrait = { - enable = true, + enable = false, overlay = true, style = "3D", }, - name = { - position = "CENTER" - }, }, ["boss"] = { - width = 200, - height = 45, portrait = { enable = true, overlay = true, @@ -597,164 +583,87 @@ local function LoadPresetData() } }, ["party"] = { - width = 75, - height = 60, - wrapXOffset = 9, - wrapYOffset = 13, portrait = { enable = true, overlay = true, style = "3D", }, - name = { - position = "INNERTOPLEFT" - }, - }, - ["raid"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, }, }, ["simple"] = { ["player"] = { - width = 215, - height = 60, portrait = { enable = true, overlay = false, style = "2D", - width = 60, } }, ["target"] = { - width = 215, - height = 60, portrait = { enable = true, overlay = false, style = "2D", - width = 60, } }, ["pet"] = { - width = 150, - height = 30, portrait = { enable = true, overlay = false, style = "2D", - width = 30, - }, - name = { - position = "INNERLEFT" }, }, ["targettarget"] = { - width = 150, - height = 30, portrait = { - enable = true, + enable = false, overlay = false, style = "2D", - width = 30, - }, - name = { - position = "INNERLEFT" }, }, ["boss"] = { - width = 200, - height = 45, portrait = { enable = true, overlay = false, style = "2D", - width = 45, } }, ["party"] = { - width = 100, - height = 35, - wrapXOffset = 9, - wrapYOffset = 13, portrait = { enable = true, overlay = false, style = "2D", - width = 35, }, - name = { - position = "INNERRIGHT" - }, - }, - ["raid"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, }, }, ["compact"] = { ["player"] = { - width = 215, - height = 50, portrait = { enable = false } }, ["target"] = { - width = 215, - height = 50, portrait = { enable = false } }, ["pet"] = { - width = 130, - height = 30, portrait = { enable = false }, - name = { - position = "CENTER" - }, }, ["targettarget"] = { - width = 130, - height = 30, portrait = { enable = false }, - name = { - position = "CENTER" - }, }, ["boss"] = { - width = 200, - height = 45, portrait = { enable = false } }, ["party"] = { - width = 70, - height = 30, - wrapXOffset = 9, - wrapYOffset = 13, portrait = { enable = false }, - name = { - position = "INNERTOPLEFT" - }, - }, - ["raid"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, }, }, }, @@ -894,7 +803,7 @@ local function LoadPresetData() }, }, ["name"] = { - ["font"] = "Roboto", + ["font"] = "SVUI Clean Font", ["fontOutline"] = "NONE", ["position"] = "CENTER", ["xOffset"] = 0, @@ -917,7 +826,7 @@ local function LoadPresetData() }, }, ["name"] = { - ["font"] = "Roboto", + ["font"] = "SVUI Clean Font", ["position"] = "CENTER", ["xOffset"] = 0, ["yOffset"] = 1, @@ -927,28 +836,52 @@ local function LoadPresetData() }, }, ["grid"] = { - ["grid"] = { - ["enable"] = true, - ["size"] = 34, - ["shownames"] = true, - }, ["party"] = { - ["gridAllowed"] = true, - ["wrapXOffset"] = 1, - ["wrapYOffset"] = 1, + ["wrapXOffset"] = 6, + ["wrapYOffset"] = 6, + ["showBy"] = "RIGHT_DOWN", ["power"] = { ["enable"] = false, }, portrait = { enable = false, }, + ["grid"] = { + ["enable"] = true, + ["size"] = 45, + }, }, ["raid"] = { - ["gridAllowed"] = true, - ["wrapXOffset"] = 1, - ["wrapYOffset"] = 1, + ["wrapXOffset"] = 6, + ["wrapYOffset"] = 6, ["gRowCol"] = 1, ["showBy"] = "RIGHT_DOWN", + ["grid"] = { + ["enable"] = true, + ["size"] = 34, + }, + }, + ["raidpet"] = { + ["wrapXOffset"] = 6, + ["wrapYOffset"] = 6, + ["gRowCol"] = 1, + ["showBy"] = "RIGHT_DOWN", + ["grid"] = { + ["enable"] = true, + ["size"] = 34, + }, + }, + ["tank"] = { + ["grid"] = { + ["enable"] = true, + ["size"] = 45, + }, + }, + ["assist"] = { + ["grid"] = { + ["enable"] = true, + ["size"] = 45, + }, }, }, } @@ -966,7 +899,8 @@ local function LoadPageData() ["Desc3"] = L["CHOOSE_OR_DIE"], ["Option01"] = {USE.."\n"..DEFAULT.."\n"..SETTINGS, "EZDefault"}, - ["Option02"] = {"PRETEND YOU\nDID THIS\nALREADY", "Complete"}, + ["Option02"] = {USE.."\nMINIMALIST\n" .. SETTINGS, "Minimalist"}, + --["Option02"] = {"PRETEND YOU\nDID THIS\nALREADY", "Complete"}, ["Option03"] = {"Keep\nSaved\n"..SETTINGS, "Complete", nil, hasOldConfigs}, }, --PAGE 2 @@ -1049,10 +983,9 @@ local function LoadPageData() ["Desc2"] = L["If you have an aura that you don't want to display simply hold down shift and right click the icon for it to suffer a painful death."], ["Desc3"] = L["CHOOSE_OR_DIE"], - ["Option1"] = {L["Vintage"], "Auralayout"}, - ["Option2"] = {L["Icons"], "Auralayout", "icons"}, - ["Option3"] = {L["Bars"], "Auralayout", "bars"}, - ["Option4"] = {L["The" .. "\n" .. "Works!"], "Auralayout", "theworks"}, + ["Option1"] = {L["Icons"], "Auralayout", "default"}, + ["Option2"] = {L["Bars"], "Auralayout", "bars"}, + ["Option3"] = {L["The" .. "\n" .. "Works!"], "Auralayout", "theworks"}, }, --PAGE 9 { @@ -1176,6 +1109,10 @@ local function _copyPresets(saved, preset) end end +function SV.Setup:SetAllDefaults() + _copyPresets(SV.db, SV.defaults) +end + function SV.Setup:CopyPreset(category, theme) if(not PRESET_DATA) then LoadPresetData() end if(PRESET_DATA and PRESET_DATA[category] and PRESET_DATA[category]["link"]) then diff --git a/Interface/AddOns/SVUI/system/alerts.lua b/Interface/AddOns/SVUI/system/alerts.lua index 160566f..6b8414b 100644 --- a/Interface/AddOns/SVUI/system/alerts.lua +++ b/Interface/AddOns/SVUI/system/alerts.lua @@ -913,13 +913,13 @@ function SV:LoadSystemAlerts() local configAlert = CreateFrame("Frame", "SVUI_ConfigAlert", UIParent) configAlert:SetFrameStrata("TOOLTIP") configAlert:SetFrameLevel(979) - configAlert:Size(300, 300) - configAlert:Point("CENTER", 200, -150) + configAlert:SetSizeToScale(300, 300) + configAlert:SetPointToScale("CENTER", 200, -150) configAlert:Hide() configAlert.bg = CreateFrame("Frame", nil, configAlert) - configAlert.bg:Size(300, 300) - configAlert.bg:Point("CENTER") + configAlert.bg:SetSizeToScale(300, 300) + configAlert.bg:SetPointToScale("CENTER") configAlert.bg:SetFrameStrata("TOOLTIP") configAlert.bg:SetFrameLevel(979) local bgtex = configAlert.bg:CreateTexture(nil, "BACKGROUND") @@ -928,8 +928,8 @@ function SV:LoadSystemAlerts() SetConfigAlertAnim(configAlert.bg) configAlert.fg = CreateFrame("Frame", nil, configAlert) - configAlert.fg:Size(300, 300) - configAlert.fg:Point("CENTER", bgtex, "CENTER") + configAlert.fg:SetSizeToScale(300, 300) + configAlert.fg:SetPointToScale("CENTER", bgtex, "CENTER") configAlert.fg:SetFrameStrata("TOOLTIP") configAlert.fg:SetFrameLevel(999) local fgtex = configAlert.fg:CreateTexture(nil, "ARTWORK") @@ -961,8 +961,8 @@ function SV:LoadSystemAlerts() end _G["SVUI_SystemAlert"..i.."ItemFrameNameFrame"]:Die() _G["SVUI_SystemAlert"..i.."ItemFrame"]:GetNormalTexture():Die() - _G["SVUI_SystemAlert"..i.."ItemFrame"]:SetButtonTemplate() + _G["SVUI_SystemAlert"..i.."ItemFrame"]:SetStylePanel("Button") _G["SVUI_SystemAlert"..i.."ItemFrameIconTexture"]:SetTexCoord(0.1, 0.9, 0.1, 0.9) - _G["SVUI_SystemAlert"..i.."ItemFrameIconTexture"]:FillInner() + _G["SVUI_SystemAlert"..i.."ItemFrameIconTexture"]:SetAllPointsIn() end end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/core.lua b/Interface/AddOns/SVUI/system/core.lua index 7919e48..fc2fea4 100644 --- a/Interface/AddOns/SVUI/system/core.lua +++ b/Interface/AddOns/SVUI/system/core.lua @@ -180,14 +180,14 @@ local function DispatchCallbacks() end end ---[[ BUILD CLASS COLOR GLOBAL ]]-- +--[[ BUILD CLASS COLOR GLOBAL, CAN BE OVERRIDDEN BY THE ADDON !ClassColors ]]-- -local SVUI_CLASS_COLORS; +local CUSTOM_CLASS_COLORS = _G.CUSTOM_CLASS_COLORS; -do +if(not CUSTOM_CLASS_COLORS) then local env = getfenv(0) - env.SVUI_CLASS_COLORS = {} - SVUI_CLASS_COLORS = env.SVUI_CLASS_COLORS + env.CUSTOM_CLASS_COLORS = {} + CUSTOM_CLASS_COLORS = env.CUSTOM_CLASS_COLORS local classes = {}; local supercolors = { @@ -207,7 +207,7 @@ do tinsert(classes, class) end tsort(classes) - setmetatable(SVUI_CLASS_COLORS,{ + setmetatable(CUSTOM_CLASS_COLORS,{ __index = function(t, k) if k == "RegisterCallback" then return RegisterCallback end if k == "UnregisterCallback" then return UnregisterCallback end @@ -218,8 +218,8 @@ do local color = supercolors[class] local r, g, b = color.r, color.g, color.b local hex = ("ff%02x%02x%02x"):format(r * 255, g * 255, b * 255) - if not SVUI_CLASS_COLORS[class] or not SVUI_CLASS_COLORS[class].r or not SVUI_CLASS_COLORS[class].g or not SVUI_CLASS_COLORS[class].b then - SVUI_CLASS_COLORS[class] = { + if not CUSTOM_CLASS_COLORS[class] or not CUSTOM_CLASS_COLORS[class].r or not CUSTOM_CLASS_COLORS[class].g or not CUSTOM_CLASS_COLORS[class].b then + CUSTOM_CLASS_COLORS[class] = { r = r, g = g, b = b, @@ -245,8 +245,11 @@ SVUI.ConfigurationMode = false; --[[ EMBEDDED LIBS ]]-- SVUI.L = LibSuperVillain("Linguist"):Lang(); +SVUI.Events = LibSuperVillain("Events"); SVUI.Animate = LibSuperVillain("Animate"); SVUI.Timers = LibSuperVillain("Timers"); +SVUI.Sounds = LibSuperVillain("Sounds"); +SVUI.SpecialFX = LibSuperVillain("SpecialFX"); SVUI.Screen = CreateFrame("Frame", "SVUIParent", UIParent); SVUI.Screen:SetFrameLevel(UIParent:GetFrameLevel()); @@ -525,7 +528,7 @@ function SVUI:Initialize() self:UI_SCALE_CHANGED() - self:RefreshSystemFonts(); + --self:RefreshSystemFonts(); self:LoadSystemAlerts(); self.Timers:Initialize(); @@ -545,6 +548,8 @@ function SVUI:Initialize() SVLib:RefreshModule("SVMap"); + self.Dock:UpdateAllDocks() + collectgarbage("collect") if self.db.general.loginmessage then diff --git a/Interface/AddOns/SVUI/system/media.lua b/Interface/AddOns/SVUI/system/media.lua index 1f7f300..bbcfbfc 100644 --- a/Interface/AddOns/SVUI/system/media.lua +++ b/Interface/AddOns/SVUI/system/media.lua @@ -23,6 +23,7 @@ local unpack = _G.unpack; local pairs = _G.pairs; local ipairs = _G.ipairs; local type = _G.type; +local print = _G.print; local string = _G.string; local math = _G.math; local table = _G.table; @@ -52,7 +53,7 @@ local CHAT_FONT_HEIGHTS = _G.CHAT_FONT_HEIGHTS local STANDARD_TEXT_FONT = _G.STANDARD_TEXT_FONT local UNIT_NAME_FONT = _G.UNIT_NAME_FONT local DAMAGE_TEXT_FONT = _G.DAMAGE_TEXT_FONT -local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS +local CUSTOM_CLASS_COLORS = _G.CUSTOM_CLASS_COLORS local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS local UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT = _G.UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT --[[ @@ -60,26 +61,71 @@ local UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT = _G.UIDROPDOWNMENU_DEFAULT_TEXT_HEIGH PRE VARS/FUNCTIONS ########################################################## ]]-- -local function SetFont(globalName, font, fontSize, fontOutline, fontAlpha, color, shadowColor, offsetX, offsetY) +local function SetFont(globalName, font, fontSize, fontOutline, cR, cG, cB) if not font then return end local fontObject = _G[globalName] if not fontObject then return end - fontObject:SetFont(font,fontSize,fontOutline); - if fontAlpha then - fontObject:SetAlpha(fontAlpha) - end - if color and type(color) == "table" then - fontObject:SetTextColor(unpack(color)) - end - if shadowColor and type(shadowColor) == "table" then + fontObject:SetFont(font, fontSize, fontOutline); + if(cR and cG and cB) then + fontObject:SetTextColor(1, 1, 1); + end +end + +local function AlterFont(shadowColor, offsetX, offsetY, fontAlpha) + if not font then return end + local fontObject = _G[globalName] + if not fontObject then print(globalName) return end + if(shadowColor and type(shadowColor) == "table") then fontObject:SetShadowColor(unpack(shadowColor)) end - if offsetX and offsetY then + if(offsetX and offsetY) then fontObject:SetShadowOffset(offsetX,offsetY) end + if(fontAlpha) then + fontObject:SetAlpha(fontAlpha) + end end --[[ ########################################################## +DEFINE SOUND EFFECTS +########################################################## +]]-- +local SOUND = SV.Sounds; + +SOUND:Register("Buttons", [[sound\interface\uchatscrollbutton.ogg]]) + +SOUND:Register("Levers", [[sound\interface\ui_blizzardstore_buynow.ogg]]) +SOUND:Register("Levers", [[sound\doodad\g_levermetalcustom0.ogg]]) +SOUND:Register("Levers", [[sound\item\weapons\gun\gunload01.ogg]]) +SOUND:Register("Levers", [[sound\item\weapons\gun\gunload02.ogg]]) +SOUND:Register("Levers", [[sound\creature\gyrocopter\gyrocoptergearshift2.ogg]]) + +SOUND:Register("Gears", [[sound\creature\gyrocopter\gyrocoptergearshift3.ogg]]) +SOUND:Register("Gears", [[sound\doodad\g_buttonbigredcustom0.ogg]]) + +SOUND:Register("Sparks", [[sound\doodad\fx_electricitysparkmedium_02.ogg]]) +SOUND:Register("Sparks", [[sound\doodad\fx_electrical_zaps01.ogg]]) +SOUND:Register("Sparks", [[sound\doodad\fx_electrical_zaps02.ogg]]) +SOUND:Register("Sparks", [[sound\doodad\fx_electrical_zaps03.ogg]]) +SOUND:Register("Sparks", [[sound\doodad\fx_electrical_zaps04.ogg]]) +SOUND:Register("Sparks", [[sound\doodad\fx_electrical_zaps05.ogg]]) + +SOUND:Register("Static", [[sound\spells\uni_fx_radiostatic_01.ogg]]) +SOUND:Register("Static", [[sound\spells\uni_fx_radiostatic_02.ogg]]) +SOUND:Register("Static", [[sound\spells\uni_fx_radiostatic_03.ogg]]) +SOUND:Register("Static", [[sound\spells\uni_fx_radiostatic_04.ogg]]) +SOUND:Register("Static", [[sound\spells\uni_fx_radiostatic_05.ogg]]) +SOUND:Register("Static", [[sound\spells\uni_fx_radiostatic_06.ogg]]) +SOUND:Register("Static", [[sound\spells\uni_fx_radiostatic_07.ogg]]) +SOUND:Register("Static", [[sound\spells\uni_fx_radiostatic_08.ogg]]) + +SOUND:Register("Wired", [[sound\doodad\goblin_christmaslight_green_01.ogg]]) +SOUND:Register("Wired", [[sound\doodad\goblin_christmaslight_green_02.ogg]]) +SOUND:Register("Wired", [[sound\doodad\goblin_christmaslight_green_03.ogg]]) + +SOUND:Register("Phase", [[sound\doodad\be_scryingorb_explode.ogg]]) +--[[ +########################################################## DEFINE SHARED MEDIA ########################################################## ]]-- @@ -104,6 +150,7 @@ LSM:Register("background","SVUI Small BG 1",[[Interface\AddOns\SVUI\assets\artwo LSM:Register("background","SVUI Small BG 2",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG2]]) LSM:Register("background","SVUI Small BG 3",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG3]]) LSM:Register("background","SVUI Small BG 4",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG4]]) + LSM:Register("statusbar","SVUI BasicBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) LSM:Register("statusbar","SVUI MultiColorBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\GRADIENT]]) LSM:Register("statusbar","SVUI SmoothBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\SMOOTH]]) @@ -112,19 +159,21 @@ LSM:Register("statusbar","SVUI FancyBar",[[Interface\AddOns\SVUI\assets\artwork\ LSM:Register("statusbar","SVUI GlossBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\GLOSS]]) LSM:Register("statusbar","SVUI GlowBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\GLOWING]]) LSM:Register("statusbar","SVUI LazerBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\LAZER]]) + LSM:Register("sound", "Whisper Alert", [[Interface\AddOns\SVUI\assets\sounds\whisper.mp3]]) LSM:Register("sound", "Toasty", [[Interface\AddOns\SVUI\assets\sounds\toasty.mp3]]) -LSM:Register("font","SVUI Default Font",[[Interface\AddOns\SVUI\assets\fonts\Default.ttf]]) -LSM:Register("font","SVUI System Font",[[Interface\AddOns\SVUI\assets\fonts\System.ttf]]) -LSM:Register("font","SVUI Dialog Font",[[Interface\AddOns\SVUI\assets\fonts\Dialog.ttf]]) -LSM:Register("font","SVUI Narrator Font",[[Interface\AddOns\SVUI\assets\fonts\Narrative.ttf]]) -LSM:Register("font","SVUI Number Font",[[Interface\AddOns\SVUI\assets\fonts\Numbers.ttf]]) + +LSM:Register("font","SVUI Default Font",[[Interface\AddOns\SVUI\assets\fonts\Default.ttf]],LSM.LOCALE_BIT_ruRU+LSM.LOCALE_BIT_western) +LSM:Register("font","SVUI Pixel Font",[[Interface\AddOns\SVUI\assets\fonts\Pixel.ttf]],LSM.LOCALE_BIT_ruRU+LSM.LOCALE_BIT_western) +LSM:Register("font","SVUI Caps Font",[[Interface\AddOns\SVUI\assets\fonts\Caps.ttf]],LSM.LOCALE_BIT_ruRU+LSM.LOCALE_BIT_western) +LSM:Register("font","SVUI Classic Font",[[Interface\AddOns\SVUI\assets\fonts\Classic.ttf]]) LSM:Register("font","SVUI Combat Font",[[Interface\AddOns\SVUI\assets\fonts\Combat.ttf]]) -LSM:Register("font","SVUI Action Font",[[Interface\AddOns\SVUI\assets\fonts\Action.ttf]]) LSM:Register("font","SVUI Name Font",[[Interface\AddOns\SVUI\assets\fonts\Names.ttf]]) +LSM:Register("font","SVUI Number Font",[[Interface\AddOns\SVUI\assets\fonts\Numbers.ttf]]) +LSM:Register("font","SVUI Zone Font",[[Interface\AddOns\SVUI\assets\fonts\Zone.ttf]]) +LSM:Register("font","SVUI Flash Font",[[Interface\AddOns\SVUI\assets\fonts\Flash.ttf]]) LSM:Register("font","SVUI Alert Font",[[Interface\AddOns\SVUI\assets\fonts\Alert.ttf]]) -LSM:Register("font","SVUI Pixel Font",[[Interface\AddOns\SVUI\assets\fonts\Pixel.ttf]],LSM.LOCALE_BIT_ruRU+LSM.LOCALE_BIT_western) -LSM:Register("font","Roboto",[[Interface\AddOns\SVUI\assets\fonts\Roboto.ttf]],LSM.LOCALE_BIT_ruRU+LSM.LOCALE_BIT_western) +LSM:Register("font","SVUI Narrator Font",[[Interface\AddOns\SVUI\assets\fonts\Narrative.ttf]]) --[[ ########################################################## CREATE AND POPULATE MEDIA DATA @@ -135,13 +184,20 @@ SV.Media = {} do local myclass = select(2,UnitClass("player")) - local cColor1 = SVUI_CLASS_COLORS[myclass] + local cColor1 = CUSTOM_CLASS_COLORS[myclass] local cColor2 = RAID_CLASS_COLORS[myclass] local r1,g1,b1 = cColor1.r,cColor1.g,cColor1.b local r2,g2,b2 = cColor2.r*.25, cColor2.g*.25, cColor2.b*.25 local ir1,ig1,ib1 = (1 - r1), (1 - g1), (1 - b1) local ir2,ig2,ib2 = (1 - cColor2.r)*.25, (1 - cColor2.g)*.25, (1 - cColor2.b)*.25 local Shared = LSM + + local NAMEFONT; + if(GetLocale() ~= "enUS") then + NAMEFONT = Shared:Fetch("font", "SVUI Clean Font") + else + NAMEFONT = Shared:Fetch("font", "SVUI Name Font") + end SV.Media["color"] = { ["default"] = {0.2, 0.2, 0.2, 1}, @@ -154,29 +210,30 @@ do ["darkest"] = {0, 0, 0, 1}, ["light"] = {0.95, 0.95, 0.95, 1}, ["lightgrey"] = {0.32, 0.35, 0.38, 1}, - ["highlight"] = {0.1, 0.8, 0.8, 1}, + ["highlight"] = {0.28, 0.75, 1, 1}, ["green"] = {0.25, 0.9, 0.08, 1}, ["blue"] = {0.08, 0.25, 0.82, 1}, ["tan"] = {0.4, 0.32, 0.23, 1}, ["red"] = {0.9, 0.08, 0.08, 1}, ["yellow"] = {1, 1, 0, 1}, + ["gold"] = {1, 0.68, 0.1, 1}, ["transparent"] = {0, 0, 0, 0.5}, ["hinted"] = {0, 0, 0, 0.35}, + ["invisible"] = {0, 0, 0, 0}, ["white"] = {1, 1, 1, 1}, } SV.Media["font"] = { ["default"] = Shared:Fetch("font", "SVUI Default Font"), - ["system"] = Shared:Fetch("font", "SVUI System Font"), ["combat"] = Shared:Fetch("font", "SVUI Combat Font"), - ["dialog"] = Shared:Fetch("font", "SVUI Dialog Font"), ["narrator"] = Shared:Fetch("font", "SVUI Narrator Font"), - ["action"] = Shared:Fetch("font", "SVUI Action Font"), - ["names"] = Shared:Fetch("font", "SVUI Name Font"), + ["zones"] = Shared:Fetch("font", "SVUI Zone Font"), ["alert"] = Shared:Fetch("font", "SVUI Alert Font"), ["numbers"] = Shared:Fetch("font", "SVUI Number Font"), ["pixel"] = Shared:Fetch("font", "SVUI Pixel Font"), - ["roboto"] = Shared:Fetch("font", "Roboto") + ["caps"] = Shared:Fetch("font", "SVUI Caps Font"), + ["flash"] = Shared:Fetch("font", "SVUI Flash Font"), + ["names"] = NAMEFONT, } SV.Media["bar"] = { @@ -206,8 +263,8 @@ do ["darkest"] = {"VERTICAL", 0.15, 0.15, 0.15, 0, 0, 0}, ["darkest2"] = {"VERTICAL", 0, 0, 0, 0.12, 0.12, 0.12}, ["light"] = {"VERTICAL", 0.65, 0.65, 0.65, 0.95, 0.95, 0.95}, - ["highlight"] = {"VERTICAL", 0.1, 0.8, 0.8, 0.2, 0.5, 1}, - ["green"] = {"VERTICAL", 0.08, 0.5, 0, 0.25, 0.9, 0.08}, + ["highlight"] = {"VERTICAL", 0.3, 0.8, 1, 0.1, 0.9, 1}, + ["green"] = {"VERTICAL", 0.08, 0.9, 0.25, 0.25, 0.9, 0.08}, ["red"] = {"VERTICAL", 0.5, 0, 0, 0.9, 0.08, 0.08}, ["yellow"] = {"VERTICAL", 1, 0.3, 0, 1, 1, 0}, ["tan"] = {"VERTICAL", 0.15, 0.08, 0, 0.37, 0.22, 0.1}, @@ -273,144 +330,109 @@ function SV:MediaUpdate() self.Media.gradient.special = {"VERTICAL",r1,g1,b1,r2,g2,b2} - SVLib:Trigger("CORE_MEDIA_UPDATED"); + self.Events:Trigger("SVUI_COLORS_UPDATED"); end function SV:RefreshSystemFonts() - local fontsize = self.db.media.fonts.size - local unicodesize = self.db.media.fonts.unicodeSize - - local NUMBER_TEXT_FONT = LSM:Fetch("font", self.db.media.fonts.number); - local GIANT_TEXT_FONT = LSM:Fetch("font", self.db.media.fonts.giant); - STANDARD_TEXT_FONT = LSM:Fetch("font", self.db.media.fonts.default); - UNIT_NAME_FONT = LSM:Fetch("font", self.db.media.fonts.name); - DAMAGE_TEXT_FONT = LSM:Fetch("font", self.db.media.fonts.combat); + local fontsize = self.db.font.default.size + local highlight_fontsize = fontsize + 1; + local caps_fontsize = self.db.font.caps.size; + local number_fontsize = self.db.font.number.size; + local name_fontsize = self.db.font.name.size; + local zone_fontsize = self.db.font.zone.size; + local alert_fontsize = self.db.font.alert.size; + local combat_fontsize = self.db.font.combat.size; + + local NUMBER_TEXT_FONT = LSM:Fetch("font", self.db.font.number.file); + local ALERT_TEXT_FONT = LSM:Fetch("font", self.db.font.alert.file); + local ZONE_TEXT_FONT = LSM:Fetch("font", self.db.font.zone.file); + local CAPS_TEXT_FONT = LSM:Fetch("font", self.db.font.caps.file); + STANDARD_TEXT_FONT = LSM:Fetch("font", self.db.font.default.file); + UNIT_NAME_FONT = LSM:Fetch("font", self.db.font.name.file); + DAMAGE_TEXT_FONT = LSM:Fetch("font", self.db.font.combat.file); + NAMEPLATE_FONT = STANDARD_TEXT_FONT CHAT_FONT_HEIGHTS = {8,9,10,11,12,13,14,15,16,17,18,19,20} UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT = fontsize - SetFont("QuestFont_Large", UNIT_NAME_FONT, fontsize+4) - SetFont("ZoneTextString", UNIT_NAME_FONT, fontsize*4.2, "OUTLINE") - SetFont("SubZoneTextString", UNIT_NAME_FONT, fontsize*3.2, "OUTLINE") - SetFont("PVPInfoTextString", UNIT_NAME_FONT, fontsize*1.9, "OUTLINE") - SetFont("PVPArenaTextString", UNIT_NAME_FONT, fontsize*1.9, "OUTLINE") - SetFont("SystemFont_Shadow_Outline_Huge2", UNIT_NAME_FONT, fontsize*1.8, "OUTLINE") - - SetFont("NumberFont_OutlineThick_Mono_Small", NUMBER_TEXT_FONT, fontsize, "OUTLINE") - SetFont("NumberFont_Outline_Huge", NUMBER_TEXT_FONT, fontsize*2, "THICKOUTLINE", 28) - SetFont("NumberFont_Outline_Large", NUMBER_TEXT_FONT, fontsize+4, "OUTLINE") - SetFont("NumberFont_Outline_Med", NUMBER_TEXT_FONT, fontsize+2, "OUTLINE") - SetFont("NumberFontNormal", NUMBER_TEXT_FONT, fontsize, "OUTLINE") - - SetFont("GameFontHighlight", STANDARD_TEXT_FONT, fontsize) - SetFont("GameFontWhite", STANDARD_TEXT_FONT, fontsize, 'OUTLINE', 1, {1,1,1}) - SetFont("GameFontWhiteSmall", STANDARD_TEXT_FONT, fontsize, 'NONE', 1, {1,1,1}) - SetFont("GameFontBlack", STANDARD_TEXT_FONT, fontsize, 'NONE', 1, {0,0,0}) - SetFont("GameFontBlackSmall", STANDARD_TEXT_FONT, fontsize, 'NONE', 1, {0,0,0}) - SetFont("GameFontNormal", STANDARD_TEXT_FONT, fontsize) - SetFont("QuestFont", STANDARD_TEXT_FONT, fontsize) - SetFont("SystemFont_Large", STANDARD_TEXT_FONT, fontsize+2) - SetFont("GameFontNormalMed3", STANDARD_TEXT_FONT, fontsize+1) + SetFont("Game18Font", NUMBER_TEXT_FONT, 12) + SetFont("Game24Font", NUMBER_TEXT_FONT, 14) + SetFont("Game27Font", NUMBER_TEXT_FONT, 16) + SetFont("Game30Font", NUMBER_TEXT_FONT, 18) + SetFont("Game32Font", NUMBER_TEXT_FONT, 20) + + --SetFont("GameFontNormal", STANDARD_TEXT_FONT, fontsize - 2) + SetFont("GameFontWhite", STANDARD_TEXT_FONT, fontsize, 'OUTLINE', 1, 1, 1) + SetFont("GameFontWhiteSmall", STANDARD_TEXT_FONT, fontsize, 'NONE', 1, 1, 1) + SetFont("GameFontBlack", STANDARD_TEXT_FONT, fontsize, 'NONE', 0, 0, 0) + SetFont("GameFontBlackSmall", STANDARD_TEXT_FONT, fontsize - 1, 'NONE', 0, 0, 0) + SetFont("GameFontNormalMed2", STANDARD_TEXT_FONT, fontsize + 2) + --SetFont("GameFontNormalMed1", STANDARD_TEXT_FONT, fontsize) + SetFont("GameFontNormalLarge", STANDARD_TEXT_FONT, fontsize) + SetFont("GameFontHighlightSmall", STANDARD_TEXT_FONT, fontsize) + SetFont("GameFontHighlight", STANDARD_TEXT_FONT, fontsize+1) + SetFont("GameFontHighlightLeft", STANDARD_TEXT_FONT, fontsize+1) + SetFont("GameFontHighlightRight", STANDARD_TEXT_FONT, fontsize+1) + SetFont("GameFontHighlightLarge2", STANDARD_TEXT_FONT, fontsize+2) SetFont("SystemFont_Med1", STANDARD_TEXT_FONT, fontsize) SetFont("SystemFont_Med3", STANDARD_TEXT_FONT, fontsize) SetFont("SystemFont_Outline_Small", STANDARD_TEXT_FONT, fontsize, "OUTLINE") - SetFont("SystemFont_Shadow_Large", STANDARD_TEXT_FONT, fontsize+2) + SetFont("FriendsFont_Normal", STANDARD_TEXT_FONT, fontsize) + SetFont("FriendsFont_Small", STANDARD_TEXT_FONT, fontsize) + SetFont("FriendsFont_Large", STANDARD_TEXT_FONT, fontsize + 3) + SetFont("FriendsFont_UserText", STANDARD_TEXT_FONT, fontsize - 1) + SetFont("SystemFont_Small", STANDARD_TEXT_FONT, fontsize - 1) + SetFont("GameTooltipHeader", STANDARD_TEXT_FONT, fontsize) + SetFont("Tooltip_Med", STANDARD_TEXT_FONT, fontsize - 1) + SetFont("Tooltip_Small", STANDARD_TEXT_FONT, fontsize - 1) + SetFont("GameFontNormalSmall", STANDARD_TEXT_FONT, fontsize - 1) + SetFont("NumberFont_Shadow_Med", STANDARD_TEXT_FONT, fontsize - 1, "OUTLINE") + SetFont("NumberFont_Shadow_Small", STANDARD_TEXT_FONT, fontsize - 1, "OUTLINE") + SetFont("SystemFont_Tiny", STANDARD_TEXT_FONT, fontsize - 1) SetFont("SystemFont_Shadow_Med1", STANDARD_TEXT_FONT, fontsize) + SetFont("SystemFont_Shadow_Med1_Outline", STANDARD_TEXT_FONT, fontsize) + SetFont("SystemFont_Shadow_Med2", STANDARD_TEXT_FONT, fontsize) SetFont("SystemFont_Shadow_Med3", STANDARD_TEXT_FONT, fontsize) + SetFont("SystemFont_Large", STANDARD_TEXT_FONT, fontsize) + SetFont("SystemFont_Huge1", STANDARD_TEXT_FONT, fontsize+4) + SetFont("SystemFont_Huge1_Outline", STANDARD_TEXT_FONT, fontsize+4) SetFont("SystemFont_Shadow_Small", STANDARD_TEXT_FONT, fontsize) - SetFont("SystemFont_Small", STANDARD_TEXT_FONT, fontsize) - SetFont("FriendsFont_Normal", STANDARD_TEXT_FONT, fontsize) - SetFont("FriendsFont_Small", STANDARD_TEXT_FONT, fontsize-2) - SetFont("FriendsFont_Large", STANDARD_TEXT_FONT, fontsize) - SetFont("FriendsFont_UserText", STANDARD_TEXT_FONT, fontsize) - - SetFont("GameFont_Gigantic", GIANT_TEXT_FONT, 32, "THICKOUTLINE", 32) - SetFont("SystemFont_Shadow_Huge1", GIANT_TEXT_FONT, 32, "OUTLINE") - SetFont("SystemFont_OutlineThick_Huge2", GIANT_TEXT_FONT, 32, "THICKOUTLINE") - - SetFont("SystemFont_Shadow_Huge3", DAMAGE_TEXT_FONT, 32, "THICKOUTLINE") - SetFont("CombatTextFont", DAMAGE_TEXT_FONT, 32, "THICKOUTLINE") - - local UNICODE_FONT = self.Media.font.roboto; - - SetFont("GameTooltipHeader", UNICODE_FONT, unicodesize+2) - SetFont("Tooltip_Med", UNICODE_FONT, unicodesize) - SetFont("Tooltip_Small", UNICODE_FONT, unicodesize) - SetFont("GameFontNormalSmall", UNICODE_FONT, unicodesize) - SetFont("GameFontHighlightSmall", UNICODE_FONT, unicodesize) - SetFont("NumberFont_Shadow_Med", UNICODE_FONT, unicodesize, "OUTLINE") - SetFont("NumberFont_Shadow_Small", UNICODE_FONT, unicodesize, "OUTLINE") - SetFont("SystemFont_Tiny", UNICODE_FONT, unicodesize) - - self:UpdateManagedFonts() + SetFont("SystemFont_Shadow_Large", STANDARD_TEXT_FONT, fontsize+3) + + SetFont("QuestFont", UNIT_NAME_FONT, name_fontsize); + SetFont("SpellFont_Small", UNIT_NAME_FONT, name_fontsize, "OUTLINE", 1, 1, 1); + SetFont("SystemFont_Shadow_Outline_Huge2", UNIT_NAME_FONT, name_fontsize+14, "OUTLINE"); + + SetFont("NumberFont_OutlineThick_Mono_Small", NUMBER_TEXT_FONT, number_fontsize, "OUTLINE") + SetFont("NumberFont_Outline_Huge", NUMBER_TEXT_FONT, number_fontsize+6, "OUTLINE", 28) + SetFont("NumberFont_Outline_Large", NUMBER_TEXT_FONT, number_fontsize+6, "OUTLINE") + SetFont("NumberFont_Outline_Med", NUMBER_TEXT_FONT, number_fontsize+1, "OUTLINE") + SetFont("NumberFontNormal", NUMBER_TEXT_FONT, number_fontsize, "OUTLINE") + SetFont("NumberFont_GameNormal", NUMBER_TEXT_FONT, number_fontsize, "OUTLINE") + SetFont("NumberFontNormalRight", NUMBER_TEXT_FONT, number_fontsize, "OUTLINE") + SetFont("NumberFontNormalRightRed", NUMBER_TEXT_FONT, number_fontsize, "OUTLINE") + SetFont("NumberFontNormalRightYellow", NUMBER_TEXT_FONT, number_fontsize, "OUTLINE") + + SetFont("GameFont_Gigantic", ALERT_TEXT_FONT, alert_fontsize, "OUTLINE", 32) + SetFont("SystemFont_Shadow_Huge1", ALERT_TEXT_FONT, alert_fontsize, "OUTLINE") + --SetFont("SystemFont_OutlineThick_Huge2", ALERT_TEXT_FONT, alert_fontsize, "THICKOUTLINE") + + SetFont("SystemFont_Shadow_Huge3", DAMAGE_TEXT_FONT, combat_fontsize, "OUTLINE") + SetFont("CombatTextFont", DAMAGE_TEXT_FONT, combat_fontsize * 3, "OUTLINE") + + SetFont("SystemFont_OutlineThick_Huge4", ZONE_TEXT_FONT, zone_fontsize+6, "OUTLINE"); + SetFont("SystemFont_OutlineThick_WTF", ZONE_TEXT_FONT, zone_fontsize+9, "OUTLINE"); + SetFont("SystemFont_OutlineThick_WTF2", ZONE_TEXT_FONT, zone_fontsize+15, "OUTLINE"); + SetFont("QuestFont_Large", ZONE_TEXT_FONT, zone_fontsize - 3); + SetFont("QuestFont_Huge", ZONE_TEXT_FONT, zone_fontsize - 2); + SetFont("QuestFont_Super_Huge", ZONE_TEXT_FONT, zone_fontsize); + SetFont("SystemFont_OutlineThick_Huge2", ZONE_TEXT_FONT, zone_fontsize+2, "OUTLINE"); + + self.Events:Trigger("SVUI_FONTS_UPDATED"); end function SV:RefreshAllSystemMedia() - local fontsize = self.db.media.fonts.size - local unicodesize = self.db.media.fonts.unicodeSize - - local NUMBER_TEXT_FONT = LSM:Fetch("font", self.db.media.fonts.number); - local GIANT_TEXT_FONT = LSM:Fetch("font", self.db.media.fonts.giant); - STANDARD_TEXT_FONT = LSM:Fetch("font", self.db.media.fonts.default); - UNIT_NAME_FONT = LSM:Fetch("font", self.db.media.fonts.name); - DAMAGE_TEXT_FONT = LSM:Fetch("font", self.db.media.fonts.combat); - NAMEPLATE_FONT = STANDARD_TEXT_FONT - CHAT_FONT_HEIGHTS = {8,9,10,11,12,13,14,15,16,17,18,19,20} - UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT = fontsize - - SetFont("QuestFont_Large", UNIT_NAME_FONT, fontsize+4) - SetFont("ZoneTextString", UNIT_NAME_FONT, fontsize*4.2, "OUTLINE") - SetFont("SubZoneTextString", UNIT_NAME_FONT, fontsize*3.2, "OUTLINE") - SetFont("PVPInfoTextString", UNIT_NAME_FONT, fontsize*1.9, "OUTLINE") - SetFont("PVPArenaTextString", UNIT_NAME_FONT, fontsize*1.9, "OUTLINE") - SetFont("SystemFont_Shadow_Outline_Huge2", UNIT_NAME_FONT, fontsize*1.8, "OUTLINE") - - SetFont("NumberFont_OutlineThick_Mono_Small", NUMBER_TEXT_FONT, fontsize, "OUTLINE") - SetFont("NumberFont_Outline_Huge", NUMBER_TEXT_FONT, fontsize*2, "THICKOUTLINE", 28) - SetFont("NumberFont_Outline_Large", NUMBER_TEXT_FONT, fontsize+4, "OUTLINE") - SetFont("NumberFont_Outline_Med", NUMBER_TEXT_FONT, fontsize+2, "OUTLINE") - SetFont("NumberFontNormal", NUMBER_TEXT_FONT, fontsize, "OUTLINE") - - SetFont("GameFontHighlight", STANDARD_TEXT_FONT, fontsize) - SetFont("GameFontWhite", STANDARD_TEXT_FONT, fontsize, 'OUTLINE', 1, {1,1,1}) - SetFont("GameFontWhiteSmall", STANDARD_TEXT_FONT, fontsize, 'NONE', 1, {1,1,1}) - SetFont("GameFontBlack", STANDARD_TEXT_FONT, fontsize, 'NONE', 1, {0,0,0}) - SetFont("GameFontBlackSmall", STANDARD_TEXT_FONT, fontsize, 'NONE', 1, {0,0,0}) - SetFont("GameFontNormal", STANDARD_TEXT_FONT, fontsize) - SetFont("QuestFont", STANDARD_TEXT_FONT, fontsize) - SetFont("SystemFont_Large", STANDARD_TEXT_FONT, fontsize+2) - SetFont("GameFontNormalMed3", STANDARD_TEXT_FONT, fontsize+1) - SetFont("SystemFont_Med1", STANDARD_TEXT_FONT, fontsize) - SetFont("SystemFont_Med3", STANDARD_TEXT_FONT, fontsize) - SetFont("SystemFont_Outline_Small", STANDARD_TEXT_FONT, fontsize, "OUTLINE") - SetFont("SystemFont_Shadow_Large", STANDARD_TEXT_FONT, fontsize+2) - SetFont("SystemFont_Shadow_Med1", STANDARD_TEXT_FONT, fontsize) - SetFont("SystemFont_Shadow_Med3", STANDARD_TEXT_FONT, fontsize) - SetFont("SystemFont_Shadow_Small", STANDARD_TEXT_FONT, fontsize) - SetFont("SystemFont_Small", STANDARD_TEXT_FONT, fontsize) - SetFont("FriendsFont_Normal", STANDARD_TEXT_FONT, fontsize) - SetFont("FriendsFont_Small", STANDARD_TEXT_FONT, fontsize-2) - SetFont("FriendsFont_Large", STANDARD_TEXT_FONT, fontsize) - SetFont("FriendsFont_UserText", STANDARD_TEXT_FONT, fontsize) - - SetFont("GameFont_Gigantic", GIANT_TEXT_FONT, 32, "THICKOUTLINE", 32) - SetFont("SystemFont_Shadow_Huge1", GIANT_TEXT_FONT, 32, "OUTLINE") - SetFont("SystemFont_OutlineThick_Huge2", GIANT_TEXT_FONT, 32, "THICKOUTLINE") - - SetFont("SystemFont_Shadow_Huge3", DAMAGE_TEXT_FONT, 32, "THICKOUTLINE") - SetFont("CombatTextFont", DAMAGE_TEXT_FONT, 32, "THICKOUTLINE") - - local UNICODE_FONT = self.Media.font.roboto; - - SetFont("GameTooltipHeader", UNICODE_FONT, unicodesize+2) - SetFont("Tooltip_Med", UNICODE_FONT, unicodesize) - SetFont("Tooltip_Small", UNICODE_FONT, unicodesize) - SetFont("GameFontNormalSmall", UNICODE_FONT, unicodesize) - SetFont("GameFontHighlightSmall", UNICODE_FONT, unicodesize) - SetFont("NumberFont_Shadow_Med", UNICODE_FONT, unicodesize) - SetFont("NumberFont_Shadow_Small", UNICODE_FONT, unicodesize) - SetFont("SystemFont_Tiny", UNICODE_FONT, unicodesize) - + self:RefreshSystemFonts() self:MediaUpdate() self.MediaInitialized = true end diff --git a/Interface/AddOns/SVUI/system/slash.lua b/Interface/AddOns/SVUI/system/slash.lua index 49d4393..6371779 100644 --- a/Interface/AddOns/SVUI/system/slash.lua +++ b/Interface/AddOns/SVUI/system/slash.lua @@ -91,9 +91,9 @@ local function SVUIMasterCommand(msg) elseif (msg == "reset" or msg == "resetui") then SV:ResetAllUI() elseif (msg == "bg" or msg == "pvp") then - local MOD = SV.SVStats + local MOD = SV.Dock MOD.ForceHideBGStats = nil; - MOD:Generate() + MOD:UpdateDataSlots() SV:AddonMessage(L['Battleground statistics will now show again if you are inside a battleground.']) else SV:ToggleConfig() diff --git a/Interface/AddOns/SVUI/system/utilities.lua b/Interface/AddOns/SVUI/system/utilities.lua index 499ce24..6b197c3 100644 --- a/Interface/AddOns/SVUI/system/utilities.lua +++ b/Interface/AddOns/SVUI/system/utilities.lua @@ -242,6 +242,26 @@ do end end +function SV:GetScreenXY(frame) + local screenHeight = GetScreenHeight(); + local screenWidth = GetScreenWidth(); + local screenX, screenY = frame:GetCenter(); + local isLeft = (screenX < (screenHeight * 0.5)); + if (screenY < (screenWidth * 0.5)) then + if(isLeft) then + return "BOTTOMLEFT", "TOPLEFT" + else + return "BOTTOMRIGHT", "TOPRIGHT" + end + else + if(isLeft) then + return "TOPLEFT", "BOTTOMLEFT" + else + return "TOPRIGHT", "BOTTOMRIGHT" + end + end +end + function SV:AnchorToCursor(frame) local x, y = GetCursorPosition() local vHold = (UIParent:GetHeight() * 0.33) @@ -384,9 +404,9 @@ do function SV:ParseGearSlots(unit, inspecting, firstCallback, secondCallback) local category = (inspecting) and "Inspect" or "Character"; - local averageLevel,totalSlots,upgradeAdjust,globalName = 0,0,0; - for slotName,flags in pairs(_slots) do - globalName = ("%s%s"):format(category, slotName) + local averageLevel,totalSlots,upgradeAdjust = 0,0,0; + for slotName, flags in pairs(_slots) do + local globalName = ("%s%s"):format(category, slotName) local slotId = GetInventorySlotInfo(slotName) local iLink = GetInventoryItemLink(unit, slotId) if(iLink and type(iLink) == "string") then @@ -400,7 +420,7 @@ do end end if(slotId ~= nil) then - if(not inspecting and flags[2] and secondCallback and type(secondCallback) == "function") then + if((not inspecting) and flags[2] and secondCallback and type(secondCallback) == "function") then secondCallback(globalName, slotId) end end @@ -599,7 +619,7 @@ function SV:CreateButton(frame, label, anchor, x, y, width, height, tooltip) button:SetHitRectInsets(0, 0, 0, 0); button:SetFrameStrata("FULLSCREEN_DIALOG"); button.TText = tooltip - button:SetButtonTemplate() + button:SetStylePanel("Button") button:SetScript("OnEnter", Button_OnEnter) button:SetScript("OnLeave", GameTooltip_Hide) return button diff --git a/Interface/AddOns/SVUI/system/visibility.lua b/Interface/AddOns/SVUI/system/visibility.lua index 4f09406..e7e9f4b 100644 --- a/Interface/AddOns/SVUI/system/visibility.lua +++ b/Interface/AddOns/SVUI/system/visibility.lua @@ -36,8 +36,7 @@ local L = SV.L; LOCALS ########################################################## ]]-- -local SecureFadeManager = CreateFrame("Frame"); -local DisplayFrames, SecureFadeFrames = {}, {}; +local DisplayFrames = {}; --[[ ########################################################## FRAME VISIBILITY MANAGEMENT @@ -63,133 +62,4 @@ function SV:PushDisplayAudit() frame:SetParent(parent or UIParent) end self.NeedsFrameAudit = false -end - -local function SafeFrameRemoval(table, item) - local index = 1; - while table[index] do - if ( item == table[index] ) then - tremove(table, index); - else - index = index + 1; - end - end -end - -local function SecureFadeRemoveFrame(frame) - SafeFrameRemoval(SecureFadeFrames, frame); -end - -local SecureFade_OnUpdate = function(self, elasped) - local i = 1; - local this, safeFadeState; - - while SecureFadeFrames[i] do - this = SecureFadeFrames[i] - - safeFadeState = this._secureFade; - safeFadeState.fadeTimer = (safeFadeState.fadeTimer or 0) + elasped; - safeFadeState.fadeTimer = safeFadeState.fadeTimer + elasped; - if safeFadeState.fadeTimer < safeFadeState.timeToFade then - - if(safeFadeState.mode == "IN") then - this:SetAlpha((safeFadeState.fadeTimer / safeFadeState.timeToFade) * (safeFadeState.endAlpha - safeFadeState.startAlpha) + safeFadeState.startAlpha) - elseif(safeFadeState.mode == "OUT") then - this:SetAlpha(((safeFadeState.timeToFade - safeFadeState.fadeTimer) / safeFadeState.timeToFade) * (safeFadeState.startAlpha - safeFadeState.endAlpha) + safeFadeState.endAlpha) - end - - else - this:SetAlpha(safeFadeState.endAlpha) - SecureFadeRemoveFrame(this) - - if not this:IsProtected() and safeFadeState.hideOnFinished and this:IsShown() then - this:Hide() - end - - if (safeFadeState.finishedFunc) then - safeFadeState.finishedFunc(safeFadeState.finishedArg1, safeFadeState.finishedArg2, safeFadeState.finishedArg3, safeFadeState.finishedArg4) - safeFadeState.finishedFunc = nil - end - end - i = i + 1 - end - if #SecureFadeFrames == 0 then - SecureFadeManager:SetScript("OnUpdate", nil) - end -end - -local function HandleFading(this, safeFadeState) - if not this then return end - if not safeFadeState.mode then - safeFadeState.mode = "IN" - end - - if safeFadeState.mode == "IN" then - if not this:IsProtected() and not this:IsShown() then this:Show() end - if not safeFadeState.startAlpha then - safeFadeState.startAlpha = 0 - end - if not safeFadeState.endAlpha then - safeFadeState.endAlpha = 1.0 - end - elseif safeFadeState.mode == "OUT" then - if not safeFadeState.startAlpha then - safeFadeState.startAlpha = 1.0 - end - if not safeFadeState.endAlpha then - safeFadeState.endAlpha = 0 - end - end - - this:SetAlpha(safeFadeState.startAlpha) - this._secureFade = safeFadeState - local i=1; - while SecureFadeFrames[i] do - if SecureFadeFrames[i] == this then - return - end - i = i + 1; - end - SecureFadeFrames[#SecureFadeFrames + 1] = this; - SecureFadeManager:SetScript("OnUpdate", SecureFade_OnUpdate) -end - -function SV:SecureFadeIn(this, duration, startAlpha, endAlpha) - local safeFadeState = {} - safeFadeState.mode = "IN" - safeFadeState.timeToFade = duration; - safeFadeState.startAlpha = startAlpha or 0; - safeFadeState.endAlpha = endAlpha or 1; - safeFadeState.hideOnFinished = false; - safeFadeState.finishedFunc = nil - - this._secureFade = safeFadeState - - HandleFading(this, safeFadeState) -end - -function SV:SecureFadeOut(this, duration, startAlpha, endAlpha, hideOnFinished) - local safeFadeState = {} - safeFadeState.mode = "OUT" - safeFadeState.timeToFade = duration; - safeFadeState.startAlpha = startAlpha or 1; - safeFadeState.endAlpha = endAlpha or 0; - safeFadeState.hideOnFinished = hideOnFinished; - safeFadeState.finishedFunc = nil - - this._secureFade = safeFadeState - - HandleFading(this, safeFadeState) -end - -function SV:SecureFadeRemoval(this) - local i = 1; - while SecureFadeFrames[i] do - if this == SecureFadeFrames[i] then - tremove(SecureFadeFrames, i) - break - else - i = i + 1; - end - end -end \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ChatOMatic/SVUI_ChatOMatic.toc b/Interface/AddOns/SVUI_ChatOMatic/SVUI_ChatOMatic.toc index 0f1028a..6a89be5 100644 --- a/Interface/AddOns/SVUI_ChatOMatic/SVUI_ChatOMatic.toc +++ b/Interface/AddOns/SVUI_ChatOMatic/SVUI_ChatOMatic.toc @@ -1,6 +1,6 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 5.3.9 +## Version: 5.4.08 ## Title: |cffFF9900SVUI |r|cffFFEF00Chat-O-Matic|r ## Notes: Supervillain UI [|cff9911FFVarious Chat Gadgets|r] ## SavedVariables: ChatOMatic_Data diff --git a/Interface/AddOns/SVUI_ChatOMatic/components/answering_service.lua b/Interface/AddOns/SVUI_ChatOMatic/components/answering_service.lua index ffae20e..6829ac0 100644 --- a/Interface/AddOns/SVUI_ChatOMatic/components/answering_service.lua +++ b/Interface/AddOns/SVUI_ChatOMatic/components/answering_service.lua @@ -740,8 +740,8 @@ function PLUGIN:AddCaller(caller) if self.db.autoAnswer == true then PhoneLines[caller].InUse = true; btn:SetPanelColor("green"); - self.Docklet:SetPanelColor("green"); - self.Docklet.stateColor = GREEN_GRADIENT + self.Docklet.DockButton:SetPanelColor("green"); + self.Docklet.DockButton.stateColor = GREEN_GRADIENT state_text = "on the line."; PlaySoundFile("Sound\\interface\\iQuestUpdate.wav") end @@ -771,17 +771,17 @@ function PLUGIN:GetServiceState() if inUse then if onHold then - self.Docklet:SetPanelColor("yellow") - self.Docklet.Icon:SetGradient(unpack(YELLOW_GRADIENT)) - self.Docklet.stateColor = YELLOW_GRADIENT + self.Docklet.DockButton:SetPanelColor("yellow") + self.Docklet.DockButton.Icon:SetGradient(unpack(YELLOW_GRADIENT)) + self.Docklet.DockButton.stateColor = YELLOW_GRADIENT else - self.Docklet:SetPanelColor("green") - self.Docklet.Icon:SetGradient(unpack(GREEN_GRADIENT)) - self.Docklet.stateColor = GREEN_GRADIENT + self.Docklet.DockButton:SetPanelColor("green") + self.Docklet.DockButton.Icon:SetGradient(unpack(GREEN_GRADIENT)) + self.Docklet.DockButton.stateColor = GREEN_GRADIENT end else - self.Docklet:SetPanelColor("default") - self.Docklet.stateColor = DEFAULT_GRADIENT + self.Docklet.DockButton:SetPanelColor("default") + self.Docklet.DockButton.stateColor = DEFAULT_GRADIENT end return inUse,onHold end @@ -904,16 +904,12 @@ function PLUGIN:EnableAnsweringService() self:RegisterUpdate("PhoneTimeUpdate", 4) self.Docklet = SV.Dock:NewDocklet("BottomLeft", "SVUI_ChatOMaticDock", "Answering Service", ICON_FILE, AnsweringOnClick) + self.Docklet:SetFrameStrata("HIGH") + self.Docklet:SetStylePanel("Default") - local window = CreateFrame("Frame", nil, self.Docklet) - window:SetPoint("TOPLEFT", self.Docklet, "TOPLEFT", -4, 4) - window:SetPoint("BOTTOMRIGHT", self.Docklet, "BOTTOMRIGHT", 4, -4) - window:SetFrameStrata("HIGH") - window:SetPanelTemplate() - - local title = window:CreateFontString("HenchmenOperatorText") - title:SetPoint("TOPLEFT", window, "TOPLEFT", 0, -2) - title:SetPoint("TOPRIGHT", window, "TOPRIGHT", 0, -2) + local title = self.Docklet:CreateFontString("HenchmenOperatorText") + title:SetPoint("TOPLEFT", self.Docklet, "TOPLEFT", 0, -2) + title:SetPoint("TOPRIGHT", self.Docklet, "TOPRIGHT", 0, -2) title:SetHeight(50) title:SetFontObject(GameFontNormal) title:SetTextColor(0.5, 0.5, 1, 1) @@ -922,13 +918,13 @@ function PLUGIN:EnableAnsweringService() title:SetText("Henchman Answering Service") for x = 1, 5 do - local phLn = CreateFrame("Button", "HenchmenPhoneLine"..x, window) - phLn:SetPoint("TOPLEFT", window, "TOPLEFT", 8, ((-20) - (x * 25))) - phLn:SetPoint("TOPRIGHT", window, "TOPRIGHT", -8, ((-20) - (x * 25))) + local phLn = CreateFrame("Button", "HenchmenPhoneLine"..x, self.Docklet) + phLn:SetPoint("TOPLEFT", self.Docklet, "TOPLEFT", 8, ((-20) - (x * 25))) + phLn:SetPoint("TOPRIGHT", self.Docklet, "TOPRIGHT", -8, ((-20) - (x * 25))) phLn:SetHeight(20) phLn:RegisterForClicks("AnyUp") phLn:SetScript("OnClick", PhoneLineClick) - phLn:SetFixedPanelTemplate("Button") + phLn:SetStylePanel("Fixed", "Button") phLn.Text = phLn:CreateFontString() phLn.Text:SetPoint("TOPLEFT", phLn, "TOPLEFT", 0, 0) phLn.Text:SetPoint("TOPRIGHT", phLn, "TOPRIGHT", 0, 0) @@ -940,7 +936,7 @@ function PLUGIN:EnableAnsweringService() phLn.Text:SetText("Empty Phone Line") end - self.Docklet:Hide() + --self.Docklet:Hide() local strMsg if self.db.autoAnswer == true then diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua index 0ccbc16..ee718e8 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua @@ -34,75 +34,14 @@ local L = SV.L; local Ace3Config = LibStub("AceConfig-3.0"); local Ace3ConfigDialog = LibStub("AceConfigDialog-3.0"); Ace3Config:RegisterOptionsTable(SV.NameID, SV.Options); -Ace3ConfigDialog:SetDefaultSize(SV.NameID, 890, 651); +local GUIWidth = SV.LowRez and 890 or 1090 +Ace3ConfigDialog:SetDefaultSize(SV.NameID, GUIWidth, 651); local AceGUI = LibStub("AceGUI-3.0", true); - -local sortingFunction = function(arg1, arg2) return arg1 < arg2 end - -local function CommonFontSizeUpdate() - local STANDARDFONTSIZE = SV.db.media.fonts.size; - local smallfont = STANDARDFONTSIZE - 2; - local largefont = STANDARDFONTSIZE + 2; - SV.db.SVAura.fontSize = STANDARDFONTSIZE; - SV.db.SVStats.fontSize = STANDARDFONTSIZE; - SV.db.SVUnit.fontSize = STANDARDFONTSIZE; - SV.db.SVUnit.auraFontSize = smallfont; - - SV.db.SVBar.fontSize = smallfont; - SV.db.SVPlate.fontSize = smallfont; - - SV.db.SVUnit.player.health.fontSize = largefont; - SV.db.SVUnit.player.power.fontSize = largefont; - SV.db.SVUnit.player.name.fontSize = largefont; - SV.db.SVUnit.player.aurabar.fontSize = STANDARDFONTSIZE; - - SV.db.SVUnit.target.health.fontSize = largefont; - SV.db.SVUnit.target.power.fontSize = largefont; - SV.db.SVUnit.target.name.fontSize = largefont; - SV.db.SVUnit.target.aurabar.fontSize = STANDARDFONTSIZE; - - SV.db.SVUnit.focus.health.fontSize = largefont; - SV.db.SVUnit.focus.power.fontSize = largefont; - SV.db.SVUnit.focus.name.fontSize = largefont; - SV.db.SVUnit.focus.aurabar.fontSize = STANDARDFONTSIZE; - - SV.db.SVUnit.targettarget.health.fontSize = largefont; - SV.db.SVUnit.targettarget.power.fontSize = largefont; - SV.db.SVUnit.targettarget.name.fontSize = largefont; - - SV.db.SVUnit.focustarget.health.fontSize = largefont; - SV.db.SVUnit.focustarget.power.fontSize = largefont; - SV.db.SVUnit.focustarget.name.fontSize = largefont; - - SV.db.SVUnit.pet.health.fontSize = largefont; - SV.db.SVUnit.pet.power.fontSize = largefont; - SV.db.SVUnit.pet.name.fontSize = largefont; - - SV.db.SVUnit.pettarget.health.fontSize = largefont; - SV.db.SVUnit.pettarget.power.fontSize = largefont; - SV.db.SVUnit.pettarget.name.fontSize = largefont; - - SV.db.SVUnit.party.health.fontSize = largefont; - SV.db.SVUnit.party.power.fontSize = largefont; - SV.db.SVUnit.party.name.fontSize = largefont; - - SV.db.SVUnit.boss.health.fontSize = largefont; - SV.db.SVUnit.boss.power.fontSize = largefont; - SV.db.SVUnit.boss.name.fontSize = largefont; - - SV.db.SVUnit.arena.health.fontSize = largefont; - SV.db.SVUnit.arena.power.fontSize = largefont; - SV.db.SVUnit.arena.name.fontSize = largefont; - - SV.db.SVUnit.raid.health.fontSize = largefont; - SV.db.SVUnit.raid.power.fontSize = largefont; - SV.db.SVUnit.raid.name.fontSize = largefont; - - SV.db.SVUnit.tank.health.fontSize = largefont; - SV.db.SVUnit.assist.health.fontSize = largefont; - - SV:RefreshSystemFonts() -end +local AceGUIWidgetLSMlists = AceGUIWidgetLSMlists; +local GameTooltip = GameTooltip; +local GetNumEquipmentSets = GetNumEquipmentSets; +local GetEquipmentSetInfo = GetEquipmentSetInfo; +local sortingFunction = function(arg1, arg2) return arg1 < arg2 end --[[ ########################################################## SET PACKAGE OPTIONS @@ -119,8 +58,8 @@ SV.Options.args.primary = { type = "group", order = 1, name = L["Main"], - get = function(j)return SV.db[j[#j]]end, - set = function(j, value)SV.db[j[#j]] = value end, + get = function(j) return SV.db[j[#j]] end, + set = function(j, value) SV.db[j[#j]] = value end, args = { introGroup1 = { order = 1, @@ -321,14 +260,6 @@ SV.Options.args.common = { get = function(j)return SV.db.general.comix end, set = function(j,value) SV.db.general.comix = value; SV.Comix:Toggle() end }, - bigComix = { - order = 1, - type = 'toggle', - name = L["Include Large Comics"], - disabled = function() return not SV.db.general.comix end, - get = function(j) return SV.db.general.bigComix end, - set = function(j,value) SV.db.general.bigComix = value end - }, bubbles = { order = 2, type = "toggle", @@ -385,20 +316,33 @@ SV.Options.args.common = { get = function(j)return SV.db.general.reactionEmote end, set = function(j,value)SV.db.general.reactionEmote = value;SV:ToggleReactions()end }, - gamemenu = { - order = 9, - type = 'toggle', - name = L["Awesome Game Menu"], - get = function(j)return SV.db.general.gamemenu end, - set = function(j,value) SV.db.general.gamemenu = value; SV.GameMenu:Toggle() end - }, afk = { - order = 10, + order = 9, type = 'toggle', name = L["Awesome AFK Screen"], get = function(j)return SV.db.general.afk end, set = function(j,value) SV.db.general.afk = value; SV.AFK:Toggle() end }, + afkNoMove = { + order = 10, + type = 'toggle', + name = L["Non-Spinning AFK"], + desc = L["Uses the awesome AFK screen without the camera spinning."], + get = function(j)return SV.db.general.afkNoMove end, + set = function(j,value) SV.db.general.afkNoMove = value; SV.AFK:Toggle() end + }, + gamemenu = { + order = 11, + type = 'select', + name = L["Awesome Game Menu"], + get = function(j)return SV.db.general.gamemenu end, + set = function(j,value) SV.db.general.gamemenu = value; SV:StaticPopup_Show("RL_CLIENT") end, + values = { + ['NONE'] = NONE, + ['1'] = 'You + Henchman', + ['2'] = 'You x2', + } + }, } }, otherGroup = { @@ -534,106 +478,8 @@ SV.Options.args.common = { } } }, - fonts = { - order = 2, - type = "group", - name = L["Fonts"], - guiInline = true, - args = { - size = { - order = 1, - name = L["Font Size"], - desc = L["Set/Override the global UI font size. |cffFF0000NOTE:|r |cffFF9900This WILL affect configurable fonts.|r"], - type = "range", - width = "full", - min = 6, - max = 22, - step = 1, - get = function(key) - return SV.db.media.fonts[key[#key]] - end, - set = function(key,value)SV.db.media.fonts[key[#key]] = value; CommonFontSizeUpdate() end - }, - unicodeSize = { - order = 2, - name = L["Unicode Font Size"], - desc = L["Set/Override the global font size used by unstyled text. |cffFF0000(ie, Character stats, tooltips, other smaller texts)|r"], - type = "range", - width = "full", - min = 6, - max = 22, - step = 1, - get = function(key) - return SV.db.media.fonts[key[#key]] - end, - set = function(key,value)SV.db.media.fonts[key[#key]] = value; CommonFontSizeUpdate() end - }, - fontSpacer1 = { - order = 3, - type = "description", - name = "", - desc = "", - }, - fontSpacer2 = { - order = 4, - type = "description", - name = "", - desc = "", - }, - default = { - type = "select", - dialogControl = 'LSM30_Font', - order = 5, - name = L["Default Font"], - desc = L["Set/Override the global UI font. |cff00FF00NOTE:|r |cff00FF99This WILL NOT affect configurable fonts.|r"], - values = AceGUIWidgetLSMlists.font, - get = function(j)return SV.db.media.fonts[j[#j]]end, - set = function(j,value)SV.db.media.fonts[j[#j]] = value;SV:RefreshSystemFonts();SV:StaticPopup_Show("RL_CLIENT")end - }, - name = { - type = "select", - dialogControl = 'LSM30_Font', - order = 6, - name = L["Unit Name Font"], - desc = L["Set/Override the global name font. |cff00FF00NOTE:|r |cff00FF99This WILL NOT affect styled nameplates or unitframes.|r"], - values = AceGUIWidgetLSMlists.font, - get = function(j)return SV.db.media.fonts[j[#j]]end, - set = function(j,value)SV.db.media.fonts[j[#j]] = value;SV:RefreshSystemFonts();SV:StaticPopup_Show("RL_CLIENT")end - }, - combat = { - type = "select", - dialogControl = 'LSM30_Font', - order = 7, - name = L["CombatText Font"], - desc = L["Set/Override the font that combat text will use. |cffFF0000NOTE:|r |cffFF9900This requires a game restart or re-log for this change to take effect.|r"], - values = AceGUIWidgetLSMlists.font, - get = function(j)return SV.db.media.fonts[j[#j]]end, - set = function(j,value)SV.db.media.fonts[j[#j]] = value;SV:RefreshSystemFonts();SV:StaticPopup_Show("RL_CLIENT")end - }, - number = { - type = "select", - dialogControl = 'LSM30_Font', - order = 8, - name = L["Numbers Font"], - desc = L["Set/Override the global font used for numbers. |cff00FF00NOTE:|r |cff00FF99This WILL NOT affect all numbers.|r"], - values = AceGUIWidgetLSMlists.font, - get = function(j)return SV.db.media.fonts[j[#j]]end, - set = function(j,value)SV.db.media.fonts[j[#j]] = value;SV:RefreshSystemFonts();SV:StaticPopup_Show("RL_CLIENT")end - }, - giant = { - type = "select", - dialogControl = 'LSM30_Font', - order = 9, - name = L["Alert Font"], - desc = L["Set/Override the global font used for alerts and warnings."], - values = AceGUIWidgetLSMlists.font, - get = function(j)return SV.db.media.fonts[j[#j]]end, - set = function(j,value)SV.db.media.fonts[j[#j]] = value;SV:RefreshSystemFonts();SV:StaticPopup_Show("RL_CLIENT")end - }, - } - }, colors = { - order = 3, + order = 2, type = "group", name = L["Colors"], guiInline = true, @@ -680,7 +526,7 @@ SV.Options.args.common = { end } } - } + }, } }, gear = { @@ -845,9 +691,9 @@ SV.Options.args.common = { name = L["Miscellaneous"], guiInline = true, order = 8, - get = function(e)return SV.db.SVGear.misc[e[#e]]end, - set = function(e,value)SV.db.SVGear.misc[e[#e]] = value end, - disabled = function()return not SV.db.SVBag.enable end, + get = function(e) return SV.db.SVGear.misc[e[#e]] end, + set = function(e,value) SV.db.SVGear.misc[e[#e]] = value end, + disabled = function() return not SV.db.SVBag.enable end, args = { setoverlay = { type = "toggle", @@ -856,7 +702,7 @@ SV.Options.args.common = { desc = L["Show the associated equipment sets for the items in your bags (or bank)."], set = function(e,value) SV.db.SVGear.misc[e[#e]] = value; - SV.SVBag:ToggleEquipmentOverlay() + SV:StaticPopup_Show("RL_CLIENT"); end } } @@ -900,6 +746,7 @@ SV.Options.args.common = { } }; + if(SV.db.SVOverride.errorFilters) then local listIndex = 1 for errorName, state in pairs(SV.db.SVOverride.errorFilters) do diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc index 97185a3..a331e48 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc +++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc @@ -1,6 +1,6 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 5.3.9 +## Version: 5.4.08 ## Title: |cffFF9900SVUI |r|cffFFEF00Config-O-Matic|r ## Notes: Supervillain UI [|cff9911FFConfig Options|r] ## RequiredDeps: SVUI diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/_load.xml b/Interface/AddOns/SVUI_ConfigOMatic/components/_load.xml index 8d30609..2a87e07 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/_load.xml +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/_load.xml @@ -1,4 +1,5 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Script file='fonts.lua'/> <Script file='map.lua'/> <Script file='bar.lua'/> <Script file='aura.lua'/> @@ -6,8 +7,7 @@ <Script file='dock.lua'/> <Script file='chat.lua'/> <Script file='henchmen.lua'/> - <Script file='stat.lua'/> - <Script file='filter.lua'/> + <Include file='filters\_load.xml'/> <Script file='plate.lua'/> <Script file='tip.lua'/> <Include file='units\_load.xml'/> diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/aura.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/aura.lua index db67dce..af0d883 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/aura.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/aura.lua @@ -208,35 +208,8 @@ SV.Options.args.SVAura = { step = 1, order = 1 }, - font = { - type = "select", - dialogControl = "LSM30_Font", - order = 2, - name = L["Font"], - values = AceGUIWidgetLSMlists.font - }, - fontSize = { - order = 3, - name = L["Font Size"], - type = "range", - min = 6, - max = 22, - step = 1 - }, - fontOutline = { - order = 4, - name = L["Font Outline"], - desc = L["Set the font outline."], - type = "select", - values = { - ["NONE"] = L["None"], - ["OUTLINE"] = "OUTLINE", - ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", - ["THICKOUTLINE"] = "THICKOUTLINE" - } - }, timeOffsetH = { - order = 5, + order = 2, name = L["Time xOffset"], type = "range", min = -60, @@ -244,7 +217,7 @@ SV.Options.args.SVAura = { step = 1 }, timeOffsetV = { - order = 6, + order = 3, name = L["Time yOffset"], type = "range", min = -60, @@ -252,7 +225,7 @@ SV.Options.args.SVAura = { step = 1 }, countOffsetH = { - order = 7, + order = 4, name = L["Count xOffset"], type = "range", min = -60, @@ -260,7 +233,7 @@ SV.Options.args.SVAura = { step = 1 }, countOffsetV = { - order = 8, + order = 5, name = L["Count yOffset"], type = "range", min = -60, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/bag.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/bag.lua index 3781d9f..52ec7ff 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/bag.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/bag.lua @@ -142,15 +142,6 @@ SV.Options.args.SVBag = { desc = L["Enable/Disable Prospecting, Disenchanting and Milling buttons on the bag frame."], set = function(a,b)MOD:ChangeDBVar(b,a[#a])SV:StaticPopup_Show("RL_CLIENT")end }, - ignoreItems = { - order = 100, - name = L["Ignore Items"], - desc = L["List of items to ignore when sorting. If you wish to add multiple items you must seperate the word with a comma."], - type = "input", - width = "full", - multiline = true, - set = function(a,b) SV.db.SVBag[a[#a]] = b end - } } }, position = { diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/bar.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/bar.lua index 9666dd6..871029b 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/bar.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/bar.lua @@ -711,86 +711,18 @@ SV.Options.args.SVBar = { name = L["Self Cast"], desc = L["Right-click any action button to self cast"], order = 9 - } - } - }, - fontGroup = { - order = 2, - type = "group", - disabled = function()return not SV.db.SVBar.enable end, - name = L["Fonts"], - args = { - font = { - type = "select", - width = "full", - dialogControl = "LSM30_Font", - order = 1, - name = L["Font"], - values = AceGUIWidgetLSMlists.font - }, - fontSize = { - order = 2, - width = "full", - name = L["Font Size"], - type = "range", - min = 6, - max = 22, - step = 1 - }, - fontOutline = { - order = 3, - width = "full", - name = L["Font Outline"], - desc = L["Set the font outline."], - type = "select", - values = { - ["NONE"] = L["None"], - ["OUTLINE"] = "OUTLINE", - ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", - ["THICKOUTLINE"] = "THICKOUTLINE" - } - }, - countFont = { - type = "select", - width = "full", - dialogControl = "LSM30_Font", - order = 4, - name = L["Count Font"], - values = AceGUIWidgetLSMlists.font - }, - countFontSize = { - order = 5, - width = "full", - name = L["Count Font Size"], - type = "range", - min = 6, - max = 22, - step = 1 - }, - countFontOutline = { - order = 6, - width = "full", - name = L["Count Font Outline"], - desc = L["Set the font outline."], - type = "select", - values = { - ["NONE"] = L["None"], - ["OUTLINE"] = "OUTLINE", - ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", - ["THICKOUTLINE"] = "THICKOUTLINE" - } }, cooldownSize = { - order = 7, + order = 10, width = "full", name = L["Cooldown Font Size"], type = "range", min = 6, max = 22, step = 1 - }, + }, } - } + }, } } } diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/chat.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/chat.lua index 490d6d0..6974679 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/chat.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/chat.lua @@ -135,66 +135,5 @@ SV.Options.args.SVChat={ }, } }, - fontGroup = { - order = 4, - type = "group", - guiInline = true, - name = L["Fonts"], - set = function(a,b)MOD:ChangeDBVar(b,a[#a]);MOD:RefreshChatFrames()end, - args = { - font = { - type = "select", - dialogControl = "LSM30_Font", - order = 1, - name = L["Font"], - values = AceGUIWidgetLSMlists.font - }, - fontOutline = { - order = 2, - name = L["Font Outline"], - desc = L["Set the font outline."], - type = "select", - values = { - ["NONE"] = L["None"], - ["OUTLINE"] = "OUTLINE", - ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", - ["THINOUTLINE"] = "THINOUTLINE", - ["THICKOUTLINE"] = "THICKOUTLINE" - } - }, - fontSpacer = { - type = "description", - order = 3, - name = "", - }, - tabFont = { - type = "select", - dialogControl = "LSM30_Font", - order = 4, - name = L["Tab Font"], - values = AceGUIWidgetLSMlists.font - }, - tabFontSize = { - order = 5, - name = L["Tab Font Size"], - type = "range", - min = 6, - max = 22, - step = 1 - }, - tabFontOutline = { - order = 6, - name = L["Tab Font Outline"], - desc = L["Set the font outline."], - type = "select", - values = { - ["NONE"] = L["None"], - ["OUTLINE"] = "OUTLINE", - ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", - ["THICKOUTLINE"] = "THICKOUTLINE" - } - } - } - } } } \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/dock.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/dock.lua index 8f5df2d..72de82d 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/dock.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/dock.lua @@ -52,6 +52,11 @@ SV.Options.args.Dock.args["common"] = { type = "group", name = "General", guiInline = true, + get = function(key)return SV.db.Dock[key[#key]];end, + set = function(key,value) + MOD:ChangeDBVar(value,key[#key]); + MOD:Refresh() + end, args = { bottomPanel = { order = 1, @@ -69,8 +74,44 @@ SV.Options.args.Dock.args["common"] = { get = function(j)return SV.db.Dock.topPanel end, set = function(key,value)MOD:ChangeDBVar(value,key[#key]);MOD:TopBorderVisibility()end }, + time24 = { + order = 3, + type = "toggle", + name = L["24-Hour Time"], + desc = L["Toggle 24-hour mode for the time datatext."], + }, + localtime = { + order = 4, + type = "toggle", + name = L["Local Time"], + desc = L["If not set to true then the server time will be displayed instead."] + }, + battleground = { + order = 5, + type = "toggle", + name = L["Battleground Texts"], + desc = L["When inside a battleground display personal scoreboard information on the main datatext bars."] + }, + dataBackdrop = { + order = 6, + name = "Show Backgrounds", + desc = L["Display statistic background textures"], + type = "toggle", + set = function(key, value) MOD:ChangeDBVar(value, key[#key]); SV:StaticPopup_Show("RL_CLIENT") end, + }, + shortGold = { + order = 7, + type = "toggle", + name = L["Shortened Gold Text"], + }, + spacer1 = { + order = 9, + name = "", + type = "description", + width = "full", + }, dockCenterWidth = { - order = 3, + order = 10, type = 'range', name = L['Stat Panel Width'], desc = L["PANEL_DESC"], @@ -84,8 +125,14 @@ SV.Options.args.Dock.args["common"] = { MOD:Refresh() end, }, + spacer2 = { + order = 11, + name = "", + type = "description", + width = "full", + }, buttonSize = { - order = 4, + order = 12, type = "range", name = L["Dock Button Size"], desc = L["PANEL_DESC"], @@ -209,44 +256,92 @@ SV.Options.args.Dock.args["rightDockGroup"] = { BAG.BankFrame:UpdateLayout() end, }, - quest = { - order = 4, - type = "group", - name = L['Quest Watch Docklet'], - args = { - enable = { - order = 1, - type = "toggle", - name = L["Enable"], - get = function()return SV.db.general.questWatch end, - set = function(j, value) SV.db.general.questWatch = value; SV:StaticPopup_Show("RL_CLIENT") end - } - } - }, - questHeaders = { - order = 5, - type = "group", - name = L['Quest Header Styled'], - args = { - enable = { - order = 1, - type = "toggle", - name = L["Enable"], - get = function()return SV.db.general.questHeaders end, - set = function(j, value) SV.db.general.questHeaders = value; SV:StaticPopup_Show("RL_CLIENT") end, - disabled = function()return (not SV.db.general.questWatch) end, - } - } - } + -- quest = { + -- order = 4, + -- type = "group", + -- name = L['Quest Watch Docklet'], + -- args = { + -- enable = { + -- order = 1, + -- type = "toggle", + -- name = L["Enable"], + -- get = function()return SV.db.general.questWatch end, + -- set = function(j, value) SV.db.general.questWatch = value; SV:StaticPopup_Show("RL_CLIENT") end + -- } + -- } + -- }, + -- questHeaders = { + -- order = 5, + -- type = "group", + -- name = L['Quest Header Styled'], + -- args = { + -- enable = { + -- order = 1, + -- type = "toggle", + -- name = L["Enable"], + -- get = function()return SV.db.general.questHeaders end, + -- set = function(j, value) SV.db.general.questHeaders = value; SV:StaticPopup_Show("RL_CLIENT") end, + -- disabled = function()return (not SV.db.general.questWatch) end, + -- } + -- } + -- } } }; +SV.Options.args.Dock.args["SVUI_DockTopCenter"] = { + order = 5, + type = "group", + name = L["Top Dock"], + guiInline = true, + args = {} +}; + +SV.Options.args.Dock.args["SVUI_DockBottomCenter"] = { + order = 6, + type = "group", + name = L["Bottom Dock"], + guiInline = true, + args = {} +} + + +do + local statValues = {[""] = "None"}; + local configTable = SV.db.Dock.dataHolders; + + for name, _ in pairs(MOD.DataTypes) do + statValues[name] = name; + end + + for panelName, panelPositions in pairs(configTable) do + local optionTable = SV.Options.args.Dock.args; + if(not _G[panelName]) then + print(panelName) + optionTable[panelName] = nil; + return + end + if(type(panelPositions) == "table") then + for i = 1, #panelPositions do + local slotName = 'Slot' .. i; + optionTable[panelName].args[slotName] = { + order = i, + type = 'select', + name = 'Slot '..i, + values = statValues, + get = function(key) return SV.db.Dock.dataHolders[panelName][i] end, + set = function(key, value) MOD:ChangeDBVar(value, i, "dataHolders", panelName); MOD:UpdateDataSlots() end + } + end + end + end +end + if(MOD.CustomOptions) then - SV.Options.args.Dock.args.custom = { - order = 5, - type = 'group', - name = 'Custom Docks', - guiInline = true, + SV.Options.args.Dock.args["AddonDocklets"] = { + order = 7, + type = "group", + name = L["Docked Addons"], + guiInline = true, args = MOD.CustomOptions - } + }; end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/filter.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/filter.lua deleted file mode 100644 index 5ebde6f..0000000 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/filter.lua +++ /dev/null @@ -1,800 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local assert = _G.assert; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local print = _G.print; -local ipairs = _G.ipairs; -local pairs = _G.pairs; -local next = _G.next; -local rawset = _G.rawset; -local rawget = _G.rawget; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local getmetatable = _G.getmetatable; -local setmetatable = _G.setmetatable; -local tinsert = _G.tinsert; -local table = _G.table; ---[[ TABLE METHODS ]]-- -local tsort = table.sort; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = _G["SVUI"]; -local L = SV.L; -local MOD = SV.SVUnit -if(not MOD) then return end - -local _, ns = ...; -local tempFilterTable = {}; -local watchedBuffs = {} - -local privateFilters = { - ["CC"] = "Crowd Control Auras", - ["Defense"] = "Defensive Auras", - ["Custom"] = "Custom Filtering", -} - -local publicFilters = { - ["Player"] = "Player Only Auras", - ["Blocked"] = "Blocked Auras", - ["Allowed"] = "Allowed Auras", - ["Raid"] = "Raid Debuffs", - ["AuraBars"] = "AuraBar Auras", - ["BuffWatch"] = "(AuraWatch) Player Buffs", - ["PetBuffWatch"] = "(AuraWatch) Pet Buffs", -} - -local NONE = _G.NONE; -local GetSpellInfo = _G.GetSpellInfo; -local collectgarbage = _G.collectgarbage; - -local function generateFilterOptions(filterType, selectedSpell) - - local FILTER - if(SV.filters.Custom[filterType]) then - FILTER = SV.filters.Custom[filterType] - else - FILTER = SV.filters[filterType] - end - - if((not filterType) or (filterType == "") or (not FILTER)) then - SV.Options.args.filters.args.filterGroup = nil; - SV.Options.args.filters.args.spellGroup = nil; - return - end - - local PROTECTED = publicFilters[filterType]; - - if(filterType == 'AuraBars') then - - SV.Options.args.filters.args.filterGroup = { - type = "group", - name = filterType, - guiInline = true, - order = 10, - args = { - addSpell = { - order = 1, - name = L["Add Spell"], - desc = L["Add a spell to the filter."], - type = "input", - guiInline = true, - get = function(e)return""end, - set = function(e, arg) - if not SV.db.media.unitframes.spellcolor[arg] then - SV.db.media.unitframes.spellcolor[arg] = false - end - MOD:SetUnitFrame("player") - MOD:SetUnitFrame("target") - MOD:SetUnitFrame("focus") - generateFilterOptions(filterType, arg) - end - }, - removeSpell = { - order = 2, - name = L["Remove Spell"], - desc = L["Remove a spell from the filter."], - type = "input", - guiInline = true, - get = function(e)return""end, - set = function(e, arg) - if SV.db.media.unitframes.spellcolor[arg]then - SV.db.media.unitframes.spellcolor[arg] = false; - SV:AddonMessage(L["You may not remove a spell from a default filter that is not customly added. Setting spell to false instead."]) - else - SV.db.media.unitframes.spellcolor[arg] = nil - end - MOD:SetUnitFrame("player") - MOD:SetUnitFrame("target") - MOD:SetUnitFrame("focus") - generateFilterOptions(filterType) - end - }, - selectSpell = { - name = L["Select Spell"], - type = "select", - order = 3, - guiInline = true, - get = function(e) return selectedSpell end, - set = function(e, arg) - generateFilterOptions(filterType, arg) - end, - values = function() - wipe(tempFilterTable) - tempFilterTable[""] = NONE; - for g in pairs(SV.db.media.unitframes.spellcolor)do - tempFilterTable[g] = g - end - return tempFilterTable - end - } - } - } - - if not selectedSpell or SV.db.media.unitframes.spellcolor[selectedSpell] == nil then - SV.Options.args.filters.args.spellGroup = nil; - return - end - - SV.Options.args.filters.args.spellGroup = { - type = "group", - name = selectedSpell, - order = 15, - guiInline = true, - args = { - color = { - name = L["Color"], - type = "color", - order = 1, - get = function(e) - local abColor = SV.db.media.unitframes.spellcolor[selectedSpell] - if type(abColor) == "boolean"then - return 0, 0, 0, 1 - else - return abColor[1], abColor[2], abColor[3], abColor[4] - end - end, - set = function(e, r, g, b) - if type(SV.db.media.unitframes.spellcolor[selectedSpell]) ~= "table"then - SV.db.media.unitframes.spellcolor[selectedSpell] = {} - end - local abColor = {r, g, b} - SV.db.media.unitframes.spellcolor[selectedSpell] = abColor - MOD:SetUnitFrame("player") - MOD:SetUnitFrame("target") - MOD:SetUnitFrame("focus") - end - }, - removeColor = { - type = "execute", - order = 2, - name = L["Restore Defaults"], - func = function(e, arg) - SV.db.media.unitframes.spellcolor[selectedSpell] = false; - MOD:SetUnitFrame("player") - MOD:SetUnitFrame("target") - MOD:SetUnitFrame("focus") - end - } - } - } - - elseif(filterType == 'PetBuffWatch') then - - wipe(watchedBuffs) - - if not SV.filters.PetBuffWatch then - SV.filters.PetBuffWatch = {} - end - - for o,f in pairs(SV.filters.PetBuffWatch)do - tinsert(watchedBuffs,f) - end - - SV.Options.args.filters.args.filterGroup = { - type = "group", - name = filterType, - guiInline = true, - order = -10, - childGroups = "tab", - args = { - addSpellID = { - order = 1, - name = L["Add SpellID"], - desc = L["Add a spell to the filter."], - type = "input", - get = function(e)return""end, - set = function(e, arg) - if not tonumber(arg) then - SV:AddonMessage(L["Value must be a number"]) - elseif not GetSpellInfo(arg)then - SV:AddonMessage(L["Not valid spell id"]) - else - tinsert(SV.filters.PetBuffWatch, {["enable"] = true, ["id"] = tonumber(arg), ["point"] = "TOPRIGHT", ["color"] = {["r"] = 1, ["g"] = 0, ["b"] = 0}, ["anyUnit"] = true}) - MOD:SetUnitFrame("pet") - generateFilterOptions(filterType, selectedSpell) - end - end - }, - removeSpellID = { - order = 2, - name = L["Remove SpellID"], - desc = L["Remove a spell from the filter."], - type = "input", - get = function(e)return""end, - set = function(e, arg) - if not tonumber(arg)then - SV:AddonMessage(L["Value must be a number"]) - elseif not GetSpellInfo(arg)then - SV:AddonMessage(L["Not valid spell id"]) - else - local p; - for q, r in pairs(SV.filters.PetBuffWatch)do - if r["id"] == tonumber(arg)then - p = r; - if SV.filters.PetBuffWatch[q]then - SV.filters.PetBuffWatch[q].enable = false; - else - SV.filters.PetBuffWatch[q] = nil - end - end - end - if p == nil then - SV:AddonMessage(L["Spell not found in list."]) - else - generateFilterOptions() - end - end - MOD:SetUnitFrame("pet") - generateFilterOptions(filterType, selectedSpell) - end - }, - selectSpell = { - name = L["Select Spell"], - type = "select", - order = 3, - values = function() - local v = {} - wipe(watchedBuffs) - for o, f in pairs(SV.filters.PetBuffWatch)do - tinsert(watchedBuffs, f) - end - for o, l in pairs(watchedBuffs)do - if l.id then - local name = GetSpellInfo(l.id) - v[l.id] = name - end - end - return v - end, - get = function(e)return selectedSpell end, - set = function(e, arg) generateFilterOptions(filterType, selectedSpell) end - } - } - } - - local registeredSpell; - - for t,l in pairs(SV.filters.PetBuffWatch)do - if l.id == selectedSpell then - registeredSpell = t - end - end - - if selectedSpell and registeredSpell then - local currentSpell = GetSpellInfo(selectedSpell) - SV.Options.args.filters.args.filterGroup.args[currentSpell] = { - name = currentSpell.." ("..selectedSpell..")", - type = "group", - get = function(e)return SV.filters.PetBuffWatch[registeredSpell][e[#e]] end, - set = function(e, arg) - SV.filters.PetBuffWatch[registeredSpell][e[#e]] = arg; - MOD:SetUnitFrame("pet") - end, - order = -10, - args = { - enable = { - name = L["Enable"], - order = 0, - type = "toggle" - }, - point = { - name = L["Anchor Point"], - order = 1, - type = "select", - values = { - ["TOPLEFT"] = "TOPLEFT", - ["TOPRIGHT"] = "TOPRIGHT", - ["BOTTOMLEFT"] = "BOTTOMLEFT", - ["BOTTOMRIGHT"] = "BOTTOMRIGHT", - ["LEFT"] = "LEFT", - ["RIGHT"] = "RIGHT", - ["TOP"] = "TOP", - ["BOTTOM"] = "BOTTOM" - } - }, - xOffset = {order = 2, type = "range", name = L["xOffset"], min = -75, max = 75, step = 1}, - yOffset = {order = 2, type = "range", name = L["yOffset"], min = -75, max = 75, step = 1}, - style = { - name = L["Style"], - order = 3, - type = "select", - values = {["coloredIcon"] = L["Colored Icon"], ["texturedIcon"] = L["Textured Icon"], [""] = NONE} - }, - color = { - name = L["Color"], - type = "color", - order = 4, - get = function(e) - local abColor = SV.filters.PetBuffWatch[registeredSpell][e[#e]] - return abColor.r, abColor.g, abColor.b, abColor.a - end, - set = function(e, i, j, k) - local abColor = SV.filters.PetBuffWatch[registeredSpell][e[#e]] - abColor.r, abColor.g, abColor.b = i, j, k; - MOD:SetUnitFrame("pet") - end - }, - displayText = { - name = L["Display Text"], - type = "toggle", - order = 5 - }, - textColor = { - name = L["Text Color"], - type = "color", - order = 6, - get = function(e) - local abColor = SV.filters.PetBuffWatch[registeredSpell][e[#e]] - if abColor then - return abColor.r,abColor.g,abColor.b,abColor.a - else - return 1,1,1,1 - end - end, - set = function(e,i,j,k) - local abColor = SV.filters.PetBuffWatch[registeredSpell][e[#e]] - abColor.r,abColor.g,abColor.b = i,j,k; - MOD:SetUnitFrame("pet") - end - }, - textThreshold = { - name = L["Text Threshold"], - desc = L["At what point should the text be displayed. Set to -1 to disable."], - type = "range", - order = 6, - min = -1, - max = 60, - step = 1 - }, - anyUnit = { - name = L["Show Aura From Other Players"], - order = 7, - type = "toggle" - }, - onlyShowMissing = { - name = L["Show When Not Active"], - order = 8, - type = "toggle", - disabled = function()return SV.filters.PetBuffWatch[registeredSpell].style == "text"end - } - } - } - end - - elseif(filterType == 'BuffWatch') then - - if not SV.filters.BuffWatch then - SV.filters.BuffWatch = {} - end - for o,f in pairs(SV.filters.BuffWatch) do - tinsert(watchedBuffs,f) - end - - SV.Options.args.filters.args.filterGroup = { - type = "group", - name = filterType, - guiInline = true, - order = -10, - childGroups = "tab", - args = { - addSpellID = { - order = 1, - name = L["Add SpellID"], - desc = L["Add a spell to the filter."], - type = "input", - get = function(e)return""end, - set = function(e, arg) - if(not tonumber(arg)) then - SV:AddonMessage(L["Value must be a number"]) - elseif(not GetSpellInfo(arg)) then - SV:AddonMessage(L["Not valid spell id"]) - else - tinsert(SV.filters.BuffWatch, {["enable"] = true, ["id"] = tonumber(arg), ["point"] = "TOPRIGHT", ["color"] = {["r"] = 1, ["g"] = 0, ["b"] = 0}, ["anyUnit"] = false}) - for t = 10, 40, 15 do - MOD:UpdateGroupAuraWatch("raid"..t) - end - MOD:UpdateGroupAuraWatch("party") - MOD:UpdateGroupAuraWatch("raidpet", true) - generateFilterOptions(filterType) - end - end - }, - removeSpellID = { - order = 2, - name = L["Remove SpellID"], - desc = L["Remove a spell from the filter."], - type = "input", - get = function(e)return""end, - set = function(e, arg) - if not tonumber(arg)then - SV:AddonMessage(L["Value must be a number"]) - elseif not GetSpellInfo(arg)then - SV:AddonMessage(L["Not valid spell id"]) - else - local p; - for q, r in pairs(SV.filters.BuffWatch)do - if r["id"] == tonumber(arg)then - p = r; - if SV.filters.BuffWatch[q]then - SV.filters.BuffWatch[q].enable = false; - else - SV.filters.BuffWatch[q] = nil - end - end - end - if p == nil then - SV:AddonMessage(L["Spell not found in list."]) - else - generateFilterOptions() - end - end - for t = 10, 40, 15 do - MOD:UpdateGroupAuraWatch("raid"..t) - end - MOD:UpdateGroupAuraWatch("party") - MOD:UpdateGroupAuraWatch("raidpet", true) - generateFilterOptions(filterType) - end - }, - selectSpell = { - name = L["Select Spell"], - type = "select", - order = 3, - values = function() - local v = {} - wipe(watchedBuffs) - for o, f in pairs(SV.filters.BuffWatch)do - tinsert(watchedBuffs, f) - end - for o, l in pairs(watchedBuffs)do - if l.id then - local name = GetSpellInfo(l.id) - v[l.id] = name - end - end - return v - end, - get = function(e) return selectedSpell end, - set = function(e, arg) generateFilterOptions(filterType, selectedSpell) end - } - } - } - - local registeredSpell; - - for t,l in pairs(SV.filters.BuffWatch)do if l.id==selectedSpell then registeredSpell=t end end - - if selectedSpell and registeredSpell then - local currentSpell=GetSpellInfo(selectedSpell) - SV.Options.args.filters.args.filterGroup.args[currentSpell] = { - name = currentSpell.." ("..selectedSpell..")", - type = "group", - get = function(e)return SV.filters.BuffWatch[registeredSpell][e[#e]]end, - set = function(e, arg) - SV.filters.BuffWatch[registeredSpell][e[#e]] = arg; - for t = 10, 40, 15 do - MOD:UpdateGroupAuraWatch("raid"..t) - end - MOD:UpdateGroupAuraWatch("party") - MOD:UpdateGroupAuraWatch("raidpet", true) - end, - order = -10, - args = { - enable = {name = L["Enable"], order = 0, type = "toggle"}, - point = { - name = L["Anchor Point"], - order = 1, - type = "select", - values = { - ["TOPLEFT"] = "TOPLEFT", - ["TOPRIGHT"] = "TOPRIGHT", - ["BOTTOMLEFT"] = "BOTTOMLEFT", - ["BOTTOMRIGHT"] = "BOTTOMRIGHT", - ["LEFT"] = "LEFT", - ["RIGHT"] = "RIGHT", - ["TOP"] = "TOP", - ["BOTTOM"] = "BOTTOM" - } - }, - xOffset = {order = 2, type = "range", name = L["xOffset"], min = -75, max = 75, step = 1}, - yOffset = {order = 2, type = "range", name = L["yOffset"], min = -75, max = 75, step = 1}, - style = {name = L["Style"], order = 3, type = "select", values = {["coloredIcon"] = L["Colored Icon"], ["texturedIcon"] = L["Textured Icon"], [""] = NONE}}, - color = { - name = L["Color"], - type = "color", - order = 4, - get = function(e) - local abColor = SV.filters.BuffWatch[registeredSpell][e[#e]] - return abColor.r, abColor.g, abColor.b, abColor.a - end, - set = function(e, i, j, k) - local abColor = SV.filters.BuffWatch[registeredSpell][e[#e]] - abColor.r, abColor.g, abColor.b = i, j, k; - for t = 10, 40, 15 do - MOD:UpdateGroupAuraWatch("raid"..t) - end - MOD:UpdateGroupAuraWatch("party") - MOD:UpdateGroupAuraWatch("raidpet", true) - end - }, - displayText = { - name = L["Display Text"], - type = "toggle", - order = 5 - }, - textColor = { - name = L["Text Color"], - type = "color", - order = 6, - get = function(e) - local abColor = SV.filters.BuffWatch[registeredSpell][e[#e]] - if abColor then - return abColor.r, abColor.g, abColor.b, abColor.a - else - return 1, 1, 1, 1 - end - end, - set = function(e, i, j, k) - SV.filters.BuffWatch[registeredSpell][e[#e]] = SV.filters.BuffWatch[registeredSpell][e[#e]] or {} - local abColor = SV.filters.BuffWatch[registeredSpell][e[#e]] - abColor.r, abColor.g, abColor.b = i, j, k; - for t = 10, 40, 15 do - MOD:UpdateGroupAuraWatch("raid"..t) - end - MOD:UpdateGroupAuraWatch("party") - MOD:UpdateGroupAuraWatch("raidpet", true) - end - }, - textThreshold = { - name = L["Text Threshold"], - desc = L["At what point should the text be displayed. Set to -1 to disable."], - type = "range", - order = 6, - min = -1, - max = 60, - step = 1 - }, - anyUnit = { - name = L["Show Aura From Other Players"], - order = 7, - type = "toggle" - }, - onlyShowMissing = { - name = L["Show When Not Active"], - order = 8, - type = "toggle", - disabled = function()return SV.filters.BuffWatch[registeredSpell].style == "text" end - } - } - } - end - - wipe(watchedBuffs) - - else - - SV.Options.args.filters.args.filterGroup = { - type = "group", - name = filterType, - guiInline = true, - order = 10, - args = { - addSpell = { - order = 1, - name = L["Add Spell"], - desc = L["Add a spell to the filter."], - type = "input", - get = function(e) return "" end, - set = function(e, arg) - if(not FILTER[arg]) then - FILTER[arg] = { - ["enable"] = true, - ["priority"] = 0 - } - end - generateFilterOptions(filterType, arg) - MOD:RefreshUnitFrames() - end - }, - removeSpell = { - order = 2, - name = L["Remove Spell"], - desc = L["Remove a spell from the filter."], - type = "input", - get = function(e)return "" end, - set = function(e, arg) - if(FILTER[arg]) then - if(FILTER[arg].isDefault) then - FILTER[arg].enable = false; - SV:AddonMessage(L["You may not remove a spell from a default filter that is not customly added. Setting spell to false instead."]) - else - FILTER[arg] = nil - end - end - generateFilterOptions(filterType) - MOD:RefreshUnitFrames() - end - }, - selectSpell = { - name = L["Select Spell"], - type = "select", - order = 3, - guiInline = true, - get = function(e) return selectedSpell end, - set = function(e, arg) generateFilterOptions(filterType, arg) end, - values = function() - wipe(tempFilterTable) - tempFilterTable[""] = NONE; - for g in pairs(FILTER)do - tempFilterTable[g] = g - end - return tempFilterTable - end - } - } - } - - if not selectedSpell or not FILTER[selectedSpell] then - SV.Options.args.filters.args.spellGroup = nil; - return - end - - SV.Options.args.filters.args.spellGroup = { - type = "group", - name = selectedSpell, - order = 15, - guiInline = true, - args = { - enable = { - name = L["Enable"], - type = "toggle", - get = function() - if not selectedSpell then - return false - else - return FILTER[selectedSpell].enable - end - end, - set = function(e, arg) - FILTER[selectedSpell].enable = arg; - generateFilterOptions() - MOD:RefreshUnitFrames() - end - }, - priority = { - name = L["Priority"], - type = "range", - get = function() - if not selectedSpell then - return 0 - else - return FILTER[selectedSpell].priority - end - end, - set = function(e, arg) - FILTER[selectedSpell].priority = arg; - generateFilterOptions() - MOD:RefreshUnitFrames() - end, - min = 0, - max = 99, - step = 1, - desc = L["Set the priority order of the spell, please note that prioritys are only used for the raid debuff package, not the standard buff/debuff package. If you want to disable set to zero."] - } - } - } - end - - MOD:RefreshUnitFrames() - - collectgarbage("collect") -end - -SV.Options.args.filters = { - type = "group", - name = L["Filters"], - order = -10, - args = { - createFilter = { - order = 1, - name = L["Create Filter"], - desc = L["Create a custom filter."], - type = "input", - get = function(e) return "" end, - set = function(e, arg) - SV.filters.Custom[arg] = {} - end - }, - deleteFilter = { - type = "select", - order = 2, - name = L["Delete Filter"], - desc = L["Delete a custom filter."], - get = function(e) return "" end, - set = function(e, arg) - SV.filters.Custom[arg] = nil; - SV.Options.args.filters.args.filterGroup = nil - end, - values = function() - wipe(tempFilterTable) - tempFilterTable[""] = NONE; - for g in pairs(SV.filters.Custom) do - tempFilterTable[g] = g - end - return tempFilterTable - end - }, - selectFilter = { - order = 3, - type = "select", - name = L["Select Filter"], - get = function(e) return filterType end, - set = function(e, arg) generateFilterOptions(arg) end, - values = function() - wipe(tempFilterTable) - tempFilterTable[""] = NONE; - for g in pairs(SV.filters) do - if(publicFilters[g]) then - tempFilterTable[g] = publicFilters[g] - end - end - for g in pairs(SV.filters.Custom) do - tempFilterTable[g] = g - end - return tempFilterTable - end - } - } -} - - -function ns:SetToFilterConfig(newFilter) - local filter = newFilter or "BuffWatch" - generateFilterOptions(filter) - _G.LibStub("AceConfigDialog-3.0"):SelectGroup(SV.NameID, "filters") -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/filters/_deprecated.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/filters/_deprecated.lua new file mode 100644 index 0000000..65261a7 --- /dev/null +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/filters/_deprecated.lua @@ -0,0 +1,800 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local print = _G.print; +local ipairs = _G.ipairs; +local pairs = _G.pairs; +local next = _G.next; +local rawset = _G.rawset; +local rawget = _G.rawget; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local getmetatable = _G.getmetatable; +local setmetatable = _G.setmetatable; +local tinsert = _G.tinsert; +local table = _G.table; +--[[ TABLE METHODS ]]-- +local tsort = table.sort; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = _G["SVUI"]; +local L = SV.L; +local MOD = SV.SVUnit +if(not MOD) then return end + +local _, ns = ...; +local tempFilterTable = {}; +local watchedBuffs = {} + +local privateFilters = { + ["CC"] = "Crowd Control Auras", + ["Defense"] = "Defensive Auras", + ["Custom"] = "Custom Filtering", +} + +local publicFilters = { + ["Player"] = "Player Only Auras", + ["BlackList"] = "BlackList Auras", + ["Allowed"] = "Allowed Auras", + ["Raid"] = "Raid Debuffs", + ["AuraBars"] = "AuraBar Auras", + ["BuffWatch"] = "(AuraWatch) Player Buffs", + ["PetBuffWatch"] = "(AuraWatch) Pet Buffs", +} + +local NONE = _G.NONE; +local GetSpellInfo = _G.GetSpellInfo; +local collectgarbage = _G.collectgarbage; + +local function generateFilterOptions(filterType, selectedSpell) + + local FILTER + if(SV.filters.Custom[filterType]) then + FILTER = SV.filters.Custom[filterType] + else + FILTER = SV.filters[filterType] + end + + if((not filterType) or (filterType == "") or (not FILTER)) then + SV.Options.args.filters.args.filterGroup = nil; + SV.Options.args.filters.args.spellGroup = nil; + return + end + + local PROTECTED = publicFilters[filterType]; + + if(filterType == 'AuraBars') then + + SV.Options.args.filters.args.filterGroup = { + type = "group", + name = filterType, + guiInline = true, + order = 10, + args = { + addSpell = { + order = 1, + name = L["Add Spell"], + desc = L["Add a spell to the filter."], + type = "input", + guiInline = true, + get = function(e)return""end, + set = function(e, arg) + if not SV.db.media.unitframes.spellcolor[arg] then + SV.db.media.unitframes.spellcolor[arg] = false + end + MOD:SetUnitFrame("player") + MOD:SetUnitFrame("target") + MOD:SetUnitFrame("focus") + generateFilterOptions(filterType, arg) + end + }, + removeSpell = { + order = 2, + name = L["Remove Spell"], + desc = L["Remove a spell from the filter."], + type = "input", + guiInline = true, + get = function(e)return""end, + set = function(e, arg) + if SV.db.media.unitframes.spellcolor[arg]then + SV.db.media.unitframes.spellcolor[arg] = false; + SV:AddonMessage(L["You may not remove a spell from a default filter that is not customly added. Setting spell to false instead."]) + else + SV.db.media.unitframes.spellcolor[arg] = nil + end + MOD:SetUnitFrame("player") + MOD:SetUnitFrame("target") + MOD:SetUnitFrame("focus") + generateFilterOptions(filterType) + end + }, + selectSpell = { + name = L["Select Spell"], + type = "select", + order = 3, + guiInline = true, + get = function(e) return selectedSpell end, + set = function(e, arg) + generateFilterOptions(filterType, arg) + end, + values = function() + wipe(tempFilterTable) + tempFilterTable[""] = NONE; + for g in pairs(SV.db.media.unitframes.spellcolor)do + tempFilterTable[g] = g + end + return tempFilterTable + end + } + } + } + + if not selectedSpell or SV.db.media.unitframes.spellcolor[selectedSpell] == nil then + SV.Options.args.filters.args.spellGroup = nil; + return + end + + SV.Options.args.filters.args.spellGroup = { + type = "group", + name = selectedSpell, + order = 15, + guiInline = true, + args = { + color = { + name = L["Color"], + type = "color", + order = 1, + get = function(e) + local abColor = SV.db.media.unitframes.spellcolor[selectedSpell] + if type(abColor) == "boolean"then + return 0, 0, 0, 1 + else + return abColor[1], abColor[2], abColor[3], abColor[4] + end + end, + set = function(e, r, g, b) + if type(SV.db.media.unitframes.spellcolor[selectedSpell]) ~= "table"then + SV.db.media.unitframes.spellcolor[selectedSpell] = {} + end + local abColor = {r, g, b} + SV.db.media.unitframes.spellcolor[selectedSpell] = abColor + MOD:SetUnitFrame("player") + MOD:SetUnitFrame("target") + MOD:SetUnitFrame("focus") + end + }, + removeColor = { + type = "execute", + order = 2, + name = L["Restore Defaults"], + func = function(e, arg) + SV.db.media.unitframes.spellcolor[selectedSpell] = false; + MOD:SetUnitFrame("player") + MOD:SetUnitFrame("target") + MOD:SetUnitFrame("focus") + end + } + } + } + + elseif(filterType == 'PetBuffWatch') then + + wipe(watchedBuffs) + + if not SV.filters.PetBuffWatch then + SV.filters.PetBuffWatch = {} + end + + for o,f in pairs(SV.filters.PetBuffWatch)do + tinsert(watchedBuffs,f) + end + + SV.Options.args.filters.args.filterGroup = { + type = "group", + name = filterType, + guiInline = true, + order = -10, + childGroups = "tab", + args = { + addSpellID = { + order = 1, + name = L["Add SpellID"], + desc = L["Add a spell to the filter."], + type = "input", + get = function(e)return""end, + set = function(e, arg) + if not tonumber(arg) then + SV:AddonMessage(L["Value must be a number"]) + elseif not GetSpellInfo(arg)then + SV:AddonMessage(L["Not valid spell id"]) + else + tinsert(SV.filters.PetBuffWatch, {["enable"] = true, ["id"] = tonumber(arg), ["point"] = "TOPRIGHT", ["color"] = {["r"] = 1, ["g"] = 0, ["b"] = 0}, ["anyUnit"] = true}) + MOD:SetUnitFrame("pet") + generateFilterOptions(filterType, selectedSpell) + end + end + }, + removeSpellID = { + order = 2, + name = L["Remove SpellID"], + desc = L["Remove a spell from the filter."], + type = "input", + get = function(e)return""end, + set = function(e, arg) + if not tonumber(arg)then + SV:AddonMessage(L["Value must be a number"]) + elseif not GetSpellInfo(arg)then + SV:AddonMessage(L["Not valid spell id"]) + else + local p; + for q, r in pairs(SV.filters.PetBuffWatch)do + if r["id"] == tonumber(arg)then + p = r; + if SV.filters.PetBuffWatch[q]then + SV.filters.PetBuffWatch[q].enable = false; + else + SV.filters.PetBuffWatch[q] = nil + end + end + end + if p == nil then + SV:AddonMessage(L["Spell not found in list."]) + else + generateFilterOptions() + end + end + MOD:SetUnitFrame("pet") + generateFilterOptions(filterType, selectedSpell) + end + }, + selectSpell = { + name = L["Select Spell"], + type = "select", + order = 3, + values = function() + local v = {} + wipe(watchedBuffs) + for o, f in pairs(SV.filters.PetBuffWatch)do + tinsert(watchedBuffs, f) + end + for o, l in pairs(watchedBuffs)do + if l.id then + local name = GetSpellInfo(l.id) + v[l.id] = name + end + end + return v + end, + get = function(e)return selectedSpell end, + set = function(e, arg) generateFilterOptions(filterType, selectedSpell) end + } + } + } + + local registeredSpell; + + for t,l in pairs(SV.filters.PetBuffWatch)do + if l.id == selectedSpell then + registeredSpell = t + end + end + + if selectedSpell and registeredSpell then + local currentSpell = GetSpellInfo(selectedSpell) + SV.Options.args.filters.args.filterGroup.args[currentSpell] = { + name = currentSpell.." ("..selectedSpell..")", + type = "group", + get = function(e)return SV.filters.PetBuffWatch[registeredSpell][e[#e]] end, + set = function(e, arg) + SV.filters.PetBuffWatch[registeredSpell][e[#e]] = arg; + MOD:SetUnitFrame("pet") + end, + order = -10, + args = { + enable = { + name = L["Enable"], + order = 0, + type = "toggle" + }, + point = { + name = L["Anchor Point"], + order = 1, + type = "select", + values = { + ["TOPLEFT"] = "TOPLEFT", + ["TOPRIGHT"] = "TOPRIGHT", + ["BOTTOMLEFT"] = "BOTTOMLEFT", + ["BOTTOMRIGHT"] = "BOTTOMRIGHT", + ["LEFT"] = "LEFT", + ["RIGHT"] = "RIGHT", + ["TOP"] = "TOP", + ["BOTTOM"] = "BOTTOM" + } + }, + xOffset = {order = 2, type = "range", name = L["xOffset"], min = -75, max = 75, step = 1}, + yOffset = {order = 2, type = "range", name = L["yOffset"], min = -75, max = 75, step = 1}, + style = { + name = L["Style"], + order = 3, + type = "select", + values = {["coloredIcon"] = L["Colored Icon"], ["texturedIcon"] = L["Textured Icon"], [""] = NONE} + }, + color = { + name = L["Color"], + type = "color", + order = 4, + get = function(e) + local abColor = SV.filters.PetBuffWatch[registeredSpell][e[#e]] + return abColor.r, abColor.g, abColor.b, abColor.a + end, + set = function(e, i, j, k) + local abColor = SV.filters.PetBuffWatch[registeredSpell][e[#e]] + abColor.r, abColor.g, abColor.b = i, j, k; + MOD:SetUnitFrame("pet") + end + }, + displayText = { + name = L["Display Text"], + type = "toggle", + order = 5 + }, + textColor = { + name = L["Text Color"], + type = "color", + order = 6, + get = function(e) + local abColor = SV.filters.PetBuffWatch[registeredSpell][e[#e]] + if abColor then + return abColor.r,abColor.g,abColor.b,abColor.a + else + return 1,1,1,1 + end + end, + set = function(e,i,j,k) + local abColor = SV.filters.PetBuffWatch[registeredSpell][e[#e]] + abColor.r,abColor.g,abColor.b = i,j,k; + MOD:SetUnitFrame("pet") + end + }, + textThreshold = { + name = L["Text Threshold"], + desc = L["At what point should the text be displayed. Set to -1 to disable."], + type = "range", + order = 6, + min = -1, + max = 60, + step = 1 + }, + anyUnit = { + name = L["Show Aura From Other Players"], + order = 7, + type = "toggle" + }, + onlyShowMissing = { + name = L["Show When Not Active"], + order = 8, + type = "toggle", + disabled = function()return SV.filters.PetBuffWatch[registeredSpell].style == "text"end + } + } + } + end + + elseif(filterType == 'BuffWatch') then + + if not SV.filters.BuffWatch then + SV.filters.BuffWatch = {} + end + for o,f in pairs(SV.filters.BuffWatch) do + tinsert(watchedBuffs,f) + end + + SV.Options.args.filters.args.filterGroup = { + type = "group", + name = filterType, + guiInline = true, + order = -10, + childGroups = "tab", + args = { + addSpellID = { + order = 1, + name = L["Add SpellID"], + desc = L["Add a spell to the filter."], + type = "input", + get = function(e)return""end, + set = function(e, arg) + if(not tonumber(arg)) then + SV:AddonMessage(L["Value must be a number"]) + elseif(not GetSpellInfo(arg)) then + SV:AddonMessage(L["Not valid spell id"]) + else + tinsert(SV.filters.BuffWatch, {["enable"] = true, ["id"] = tonumber(arg), ["point"] = "TOPRIGHT", ["color"] = {["r"] = 1, ["g"] = 0, ["b"] = 0}, ["anyUnit"] = false}) + for t = 10, 40, 15 do + MOD:UpdateGroupAuraWatch("raid"..t) + end + MOD:UpdateGroupAuraWatch("party") + MOD:UpdateGroupAuraWatch("raidpet", true) + generateFilterOptions(filterType) + end + end + }, + removeSpellID = { + order = 2, + name = L["Remove SpellID"], + desc = L["Remove a spell from the filter."], + type = "input", + get = function(e)return""end, + set = function(e, arg) + if not tonumber(arg)then + SV:AddonMessage(L["Value must be a number"]) + elseif not GetSpellInfo(arg)then + SV:AddonMessage(L["Not valid spell id"]) + else + local p; + for q, r in pairs(SV.filters.BuffWatch)do + if r["id"] == tonumber(arg)then + p = r; + if SV.filters.BuffWatch[q]then + SV.filters.BuffWatch[q].enable = false; + else + SV.filters.BuffWatch[q] = nil + end + end + end + if p == nil then + SV:AddonMessage(L["Spell not found in list."]) + else + generateFilterOptions() + end + end + for t = 10, 40, 15 do + MOD:UpdateGroupAuraWatch("raid"..t) + end + MOD:UpdateGroupAuraWatch("party") + MOD:UpdateGroupAuraWatch("raidpet", true) + generateFilterOptions(filterType) + end + }, + selectSpell = { + name = L["Select Spell"], + type = "select", + order = 3, + values = function() + local v = {} + wipe(watchedBuffs) + for o, f in pairs(SV.filters.BuffWatch)do + tinsert(watchedBuffs, f) + end + for o, l in pairs(watchedBuffs)do + if l.id then + local name = GetSpellInfo(l.id) + v[l.id] = name + end + end + return v + end, + get = function(e) return selectedSpell end, + set = function(e, arg) generateFilterOptions(filterType, selectedSpell) end + } + } + } + + local registeredSpell; + + for t,l in pairs(SV.filters.BuffWatch)do if l.id==selectedSpell then registeredSpell=t end end + + if selectedSpell and registeredSpell then + local currentSpell=GetSpellInfo(selectedSpell) + SV.Options.args.filters.args.filterGroup.args[currentSpell] = { + name = currentSpell.." ("..selectedSpell..")", + type = "group", + get = function(e)return SV.filters.BuffWatch[registeredSpell][e[#e]]end, + set = function(e, arg) + SV.filters.BuffWatch[registeredSpell][e[#e]] = arg; + for t = 10, 40, 15 do + MOD:UpdateGroupAuraWatch("raid"..t) + end + MOD:UpdateGroupAuraWatch("party") + MOD:UpdateGroupAuraWatch("raidpet", true) + end, + order = -10, + args = { + enable = {name = L["Enable"], order = 0, type = "toggle"}, + point = { + name = L["Anchor Point"], + order = 1, + type = "select", + values = { + ["TOPLEFT"] = "TOPLEFT", + ["TOPRIGHT"] = "TOPRIGHT", + ["BOTTOMLEFT"] = "BOTTOMLEFT", + ["BOTTOMRIGHT"] = "BOTTOMRIGHT", + ["LEFT"] = "LEFT", + ["RIGHT"] = "RIGHT", + ["TOP"] = "TOP", + ["BOTTOM"] = "BOTTOM" + } + }, + xOffset = {order = 2, type = "range", name = L["xOffset"], min = -75, max = 75, step = 1}, + yOffset = {order = 2, type = "range", name = L["yOffset"], min = -75, max = 75, step = 1}, + style = {name = L["Style"], order = 3, type = "select", values = {["coloredIcon"] = L["Colored Icon"], ["texturedIcon"] = L["Textured Icon"], [""] = NONE}}, + color = { + name = L["Color"], + type = "color", + order = 4, + get = function(e) + local abColor = SV.filters.BuffWatch[registeredSpell][e[#e]] + return abColor.r, abColor.g, abColor.b, abColor.a + end, + set = function(e, i, j, k) + local abColor = SV.filters.BuffWatch[registeredSpell][e[#e]] + abColor.r, abColor.g, abColor.b = i, j, k; + for t = 10, 40, 15 do + MOD:UpdateGroupAuraWatch("raid"..t) + end + MOD:UpdateGroupAuraWatch("party") + MOD:UpdateGroupAuraWatch("raidpet", true) + end + }, + displayText = { + name = L["Display Text"], + type = "toggle", + order = 5 + }, + textColor = { + name = L["Text Color"], + type = "color", + order = 6, + get = function(e) + local abColor = SV.filters.BuffWatch[registeredSpell][e[#e]] + if abColor then + return abColor.r, abColor.g, abColor.b, abColor.a + else + return 1, 1, 1, 1 + end + end, + set = function(e, i, j, k) + SV.filters.BuffWatch[registeredSpell][e[#e]] = SV.filters.BuffWatch[registeredSpell][e[#e]] or {} + local abColor = SV.filters.BuffWatch[registeredSpell][e[#e]] + abColor.r, abColor.g, abColor.b = i, j, k; + for t = 10, 40, 15 do + MOD:UpdateGroupAuraWatch("raid"..t) + end + MOD:UpdateGroupAuraWatch("party") + MOD:UpdateGroupAuraWatch("raidpet", true) + end + }, + textThreshold = { + name = L["Text Threshold"], + desc = L["At what point should the text be displayed. Set to -1 to disable."], + type = "range", + order = 6, + min = -1, + max = 60, + step = 1 + }, + anyUnit = { + name = L["Show Aura From Other Players"], + order = 7, + type = "toggle" + }, + onlyShowMissing = { + name = L["Show When Not Active"], + order = 8, + type = "toggle", + disabled = function()return SV.filters.BuffWatch[registeredSpell].style == "text" end + } + } + } + end + + wipe(watchedBuffs) + + else + + SV.Options.args.filters.args.filterGroup = { + type = "group", + name = filterType, + guiInline = true, + order = 10, + args = { + addSpell = { + order = 1, + name = L["Add Spell"], + desc = L["Add a spell to the filter."], + type = "input", + get = function(e) return "" end, + set = function(e, arg) + if(not FILTER[arg]) then + FILTER[arg] = { + ["enable"] = true, + ["priority"] = 0 + } + end + generateFilterOptions(filterType, arg) + MOD:RefreshUnitFrames() + end + }, + removeSpell = { + order = 2, + name = L["Remove Spell"], + desc = L["Remove a spell from the filter."], + type = "input", + get = function(e)return "" end, + set = function(e, arg) + if(FILTER[arg]) then + if(FILTER[arg].isDefault) then + FILTER[arg].enable = false; + SV:AddonMessage(L["You may not remove a spell from a default filter that is not customly added. Setting spell to false instead."]) + else + FILTER[arg] = nil + end + end + generateFilterOptions(filterType) + MOD:RefreshUnitFrames() + end + }, + selectSpell = { + name = L["Select Spell"], + type = "select", + order = 3, + guiInline = true, + get = function(e) return selectedSpell end, + set = function(e, arg) generateFilterOptions(filterType, arg) end, + values = function() + wipe(tempFilterTable) + tempFilterTable[""] = NONE; + for g in pairs(FILTER)do + tempFilterTable[g] = g + end + return tempFilterTable + end + } + } + } + + if not selectedSpell or not FILTER[selectedSpell] then + SV.Options.args.filters.args.spellGroup = nil; + return + end + + SV.Options.args.filters.args.spellGroup = { + type = "group", + name = selectedSpell, + order = 15, + guiInline = true, + args = { + enable = { + name = L["Enable"], + type = "toggle", + get = function() + if not selectedSpell then + return false + else + return FILTER[selectedSpell].enable + end + end, + set = function(e, arg) + FILTER[selectedSpell].enable = arg; + generateFilterOptions() + MOD:RefreshUnitFrames() + end + }, + priority = { + name = L["Priority"], + type = "range", + get = function() + if not selectedSpell then + return 0 + else + return FILTER[selectedSpell].priority + end + end, + set = function(e, arg) + FILTER[selectedSpell].priority = arg; + generateFilterOptions() + MOD:RefreshUnitFrames() + end, + min = 0, + max = 99, + step = 1, + desc = L["Set the priority order of the spell, please note that prioritys are only used for the raid debuff package, not the standard buff/debuff package. If you want to disable set to zero."] + } + } + } + end + + MOD:RefreshUnitFrames() + + collectgarbage("collect") +end + +SV.Options.args.filters = { + type = "group", + name = L["Filters"], + order = -10, + args = { + createFilter = { + order = 1, + name = L["Create Filter"], + desc = L["Create a custom filter."], + type = "input", + get = function(e) return "" end, + set = function(e, arg) + SV.filters.Custom[arg] = {} + end + }, + deleteFilter = { + type = "select", + order = 2, + name = L["Delete Filter"], + desc = L["Delete a custom filter."], + get = function(e) return "" end, + set = function(e, arg) + SV.filters.Custom[arg] = nil; + SV.Options.args.filters.args.filterGroup = nil + end, + values = function() + wipe(tempFilterTable) + tempFilterTable[""] = NONE; + for g in pairs(SV.filters.Custom) do + tempFilterTable[g] = g + end + return tempFilterTable + end + }, + selectFilter = { + order = 3, + type = "select", + name = L["Select Filter"], + get = function(e) return filterType end, + set = function(e, arg) generateFilterOptions(arg) end, + values = function() + wipe(tempFilterTable) + tempFilterTable[""] = NONE; + for g in pairs(SV.filters) do + if(publicFilters[g]) then + tempFilterTable[g] = publicFilters[g] + end + end + for g in pairs(SV.filters.Custom) do + tempFilterTable[g] = g + end + return tempFilterTable + end + } + } +} + + +function ns:SetToFilterConfig(newFilter) + local filter = newFilter or "BuffWatch" + generateFilterOptions(filter) + _G.LibStub("AceConfigDialog-3.0"):SelectGroup(SV.NameID, "filters") +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/filters/_load.xml b/Interface/AddOns/SVUI_ConfigOMatic/components/filters/_load.xml new file mode 100644 index 0000000..786d8da --- /dev/null +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/filters/_load.xml @@ -0,0 +1,6 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Script file='core.lua'/> + <Script file='aurabar.lua'/> + <Script file='buffwatch.lua'/> + <Script file='aura.lua'/> +</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/filters/aura.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/filters/aura.lua new file mode 100644 index 0000000..ff7a169 --- /dev/null +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/filters/aura.lua @@ -0,0 +1,167 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local print = _G.print; +local ipairs = _G.ipairs; +local pairs = _G.pairs; +local next = _G.next; +local rawset = _G.rawset; +local rawget = _G.rawget; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local getmetatable = _G.getmetatable; +local setmetatable = _G.setmetatable; +local tinsert = _G.tinsert; +local table = _G.table; +--[[ TABLE METHODS ]]-- +local tsort = table.sort; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = _G["SVUI"]; +local MOD = SV.SVUnit; +if(not MOD) then return end +local L = SV.L; +local _, ns = ...; +local tempFilterTable = {}; + +local NONE = _G.NONE; +local GetSpellInfo = _G.GetSpellInfo; +local collectgarbage = _G.collectgarbage; + +ns.FilterOptionGroups['_NEW'] = function(filterType) + return function(selectedSpell) + local RESULT, FILTER + if(SV.filters.Custom[filterType]) then + FILTER = SV.filters.Custom[filterType] + else + FILTER = SV.filters[filterType] + end + + if(FILTER) then + RESULT = { + type = "group", + name = filterType, + guiInline = true, + order = 4, + args = { + addSpell = { + order = 1, + name = L["Add Spell"], + desc = L["Add a spell to the filter."], + type = "input", + get = function(key) return "" end, + set = function(key, value) + if(not FILTER[value]) then + FILTER[value] = { + ["enable"] = true, + ["priority"] = 0 + } + end + ns:SetFilterOptions(filterType) + MOD:RefreshUnitFrames() + end + }, + removeSpell = { + order = 2, + name = L["Remove Spell"], + desc = L["Remove a spell from the filter."], + type = "select", + disabled = function() + local EMPTY = true; + for g in pairs(FILTER) do + EMPTY = false; + end + return EMPTY + end, + values = function() + wipe(tempFilterTable) + for g in pairs(FILTER) do + tempFilterTable[g] = g + end + return tempFilterTable + end, + get = function(key) return "" end, + set = function(key, value) + if(FILTER[value]) then + if(FILTER[value].isDefault) then + FILTER[value].enable = false; + SV:AddonMessage(L["You may not remove a spell from a default filter that is not customly added. Setting spell to false instead."]) + else + FILTER[value] = nil + end + end + ns:SetFilterOptions(filterType) + MOD:RefreshUnitFrames() + end + }, + } + }; + end; + + return RESULT; + end; +end; + +ns.FilterSpellGroups['_NEW'] = function(filterType) + return function() + local RESULT, FILTER + if(SV.filters.Custom[filterType]) then + FILTER = SV.filters.Custom[filterType] + else + FILTER = SV.filters[filterType] + end + + if(FILTER) then + RESULT = { + type = "group", + name = filterType .. " - " .. L["Spells"], + order = 5, + guiInline = true, + args = {} + }; + + for aura, filterData in pairs(FILTER) do + RESULT.args[aura] = { + name = aura, + type = "toggle", + get = function() + return FILTER[aura].enable + end, + set = function(key, value) + FILTER[aura].enable = value; + MOD:RefreshUnitFrames() + ns:SetFilterOptions() + end + }; + end + end + + return RESULT; + end; +end; \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/filters/aurabar.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/filters/aurabar.lua new file mode 100644 index 0000000..3340c91 --- /dev/null +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/filters/aurabar.lua @@ -0,0 +1,185 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local print = _G.print; +local ipairs = _G.ipairs; +local pairs = _G.pairs; +local next = _G.next; +local rawset = _G.rawset; +local rawget = _G.rawget; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local getmetatable = _G.getmetatable; +local setmetatable = _G.setmetatable; +local tinsert = _G.tinsert; +local table = _G.table; +--[[ TABLE METHODS ]]-- +local tsort = table.sort; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = _G["SVUI"]; +local MOD = SV.SVUnit; +if(not MOD) then return end +local L = SV.L; +local _, ns = ...; +local tempFilterTable = {}; +local NONE = _G.NONE; + +ns.FilterOptionGroups['AuraBars'] = function(selectedSpell) + local RESULT = { + type = "group", + name = 'AuraBars', + guiInline = true, + order = 10, + args = { + addSpell = { + order = 1, + name = L["Add Spell"], + desc = L["Add a spell to the filter."], + type = "input", + guiInline = true, + get = function(key) return "" end, + set = function(key, value) + if not SV.db.media.unitframes.spellcolor[value] then + SV.db.media.unitframes.spellcolor[value] = false + end + MOD:SetUnitFrame("player") + MOD:SetUnitFrame("target") + MOD:SetUnitFrame("focus") + ns:SetFilterOptions('AuraBars', value) + end + }, + removeSpell = { + order = 2, + name = L["Remove Spell"], + desc = L["Remove a spell from the filter."], + type = "select", + guiInline = true, + disabled = function() + local EMPTY = true; + for g in pairs(SV.db.media.unitframes.spellcolor) do + EMPTY = false; + end + return EMPTY + end, + values = function() + wipe(tempFilterTable) + for g in pairs(SV.db.media.unitframes.spellcolor)do + tempFilterTable[g] = g + end + return tempFilterTable + end, + get = function(key) return "" end, + set = function(key, value) + if SV.db.media.unitframes.spellcolor[value] then + SV.db.media.unitframes.spellcolor[value] = false; + SV:AddonMessage(L["You may not remove a spell from a default filter that is not customly added. Setting spell to false instead."]) + else + SV.db.media.unitframes.spellcolor[value] = nil + end + MOD:SetUnitFrame("player") + MOD:SetUnitFrame("target") + MOD:SetUnitFrame("focus") + ns:SetFilterOptions('AuraBars') + end + }, + selectSpell = { + name = L["Select Spell"], + type = "select", + order = 3, + guiInline = true, + get = function(key) return selectedSpell end, + set = function(key, value) + ns:SetFilterOptions('AuraBars', value) + end, + values = function() + wipe(tempFilterTable) + tempFilterTable[""] = NONE; + for g in pairs(SV.db.media.unitframes.spellcolor)do + tempFilterTable[g] = g + end + return tempFilterTable + end + } + } + }; + + return RESULT; +end; + +ns.FilterSpellGroups['AuraBars'] = function(selectedSpell) + local RESULT; + + if(selectedSpell and (SV.db.media.unitframes.spellcolor[selectedSpell] ~= nil)) then + RESULT = { + type = "group", + name = selectedSpell, + order = 15, + guiInline = true, + args = { + color = { + name = L["Color"], + type = "color", + order = 1, + get = function(key) + local abColor = SV.db.media.unitframes.spellcolor[selectedSpell] + if type(abColor) == "boolean"then + return 0, 0, 0, 1 + else + return abColor[1], abColor[2], abColor[3], abColor[4] + end + end, + set = function(key, r, g, b) + if type(SV.db.media.unitframes.spellcolor[selectedSpell]) ~= "table"then + SV.db.media.unitframes.spellcolor[selectedSpell] = {} + end + local abColor = {r, g, b} + SV.db.media.unitframes.spellcolor[selectedSpell] = abColor + MOD:SetUnitFrame("player") + MOD:SetUnitFrame("target") + MOD:SetUnitFrame("focus") + end + }, + removeColor = { + type = "execute", + order = 2, + name = L["Restore Defaults"], + func = function(key, value) + SV.db.media.unitframes.spellcolor[selectedSpell] = false; + MOD:SetUnitFrame("player") + MOD:SetUnitFrame("target") + MOD:SetUnitFrame("focus") + end + } + } + }; + end + + return RESULT; +end; \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/filters/buffwatch.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/filters/buffwatch.lua new file mode 100644 index 0000000..92e505b --- /dev/null +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/filters/buffwatch.lua @@ -0,0 +1,485 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local print = _G.print; +local ipairs = _G.ipairs; +local pairs = _G.pairs; +local next = _G.next; +local rawset = _G.rawset; +local rawget = _G.rawget; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local getmetatable = _G.getmetatable; +local setmetatable = _G.setmetatable; +local tinsert = _G.tinsert; +local table = _G.table; +--[[ TABLE METHODS ]]-- +local tsort = table.sort; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = _G["SVUI"]; +local MOD = SV.SVUnit; +if(not MOD) then return end +local L = SV.L; +local _, ns = ...; +local tempFilterTable = {}; +local watchedBuffs = {}; + +local NONE = _G.NONE; +local GetSpellInfo = _G.GetSpellInfo; +local collectgarbage = _G.collectgarbage; + +local function CacheWatchedBuffs(data) + wipe(watchedBuffs) + for _, watchData in pairs(data)do + tinsert(watchedBuffs, watchData) + end +end + +if(not SV.filters.PetBuffWatch) then + SV.filters.PetBuffWatch = {} +end +if(not SV.filters.BuffWatch) then + SV.filters.BuffWatch = {} +end + +ns.FilterOptionGroups['BuffWatch'] = function(selectedSpell) + CacheWatchedBuffs(SV.filters.BuffWatch) + local RESULT = { + type = "group", + name = 'BuffWatch', + guiInline = true, + order = 4, + args = { + addSpellID = { + order = 1, + name = L["Add SpellID"], + desc = L["Add a spell to the filter."], + type = "input", + get = function(key)return""end, + set = function(key, value) + if(not tonumber(value)) then + SV:AddonMessage(L["Value must be a number"]) + elseif(not GetSpellInfo(value)) then + SV:AddonMessage(L["Not valid spell id"]) + else + tinsert(SV.filters.BuffWatch, {["enable"] = true, ["id"] = tonumber(value), ["point"] = "TOPRIGHT", ["color"] = {["r"] = 1, ["g"] = 0, ["b"] = 0}, ["anyUnit"] = false}) + MOD:UpdateGroupAuraWatch("raid") + MOD:UpdateGroupAuraWatch("party") + MOD:UpdateGroupAuraWatch("raidpet", true) + ns:SetFilterOptions('BuffWatch') + end + end + }, + removeSpellID = { + order = 2, + name = L["Remove SpellID"], + desc = L["Remove a spell from the filter."], + type = "input", + get = function(key)return""end, + set = function(key, value) + if not tonumber(value)then + SV:AddonMessage(L["Value must be a number"]) + elseif not GetSpellInfo(value)then + SV:AddonMessage(L["Not valid spell id"]) + else + local p; + for q, r in pairs(SV.filters.BuffWatch)do + if r["id"] == tonumber(value) then + p = r; + if SV.filters.BuffWatch[q]then + SV.filters.BuffWatch[q].enable = false; + else + SV.filters.BuffWatch[q] = nil + end + end + end + if p == nil then + SV:AddonMessage(L["Spell not found in list."]) + else + ns:SetFilterOptions() + end + end + MOD:UpdateGroupAuraWatch("raid") + MOD:UpdateGroupAuraWatch("party") + MOD:UpdateGroupAuraWatch("raidpet", true) + ns:SetFilterOptions('BuffWatch') + end + }, + selectSpell = { + name = L["Select Spell"], + type = "select", + order = 3, + values = function() + CacheWatchedBuffs(SV.filters.BuffWatch) + wipe(tempFilterTable) + for _, watchData in pairs(watchedBuffs)do + if(watchData.id) then + local name = GetSpellInfo(watchData.id) + tempFilterTable[watchData.id] = name + end + end + return tempFilterTable + end, + get = function(key) return selectedSpell end, + set = function(key, value) ns:SetFilterOptions('BuffWatch', value) end + } + } + } + return RESULT; +end; + +ns.FilterSpellGroups['BuffWatch'] = function(selectedSpell) + local RESULT; + + if(selectedSpell) then + local registeredSpell; + + for watchIndex, watchData in pairs(SV.filters.BuffWatch)do + if(watchData.id == selectedSpell) then + registeredSpell = watchIndex + end + end + + local currentSpell = GetSpellInfo(selectedSpell) + + if(currentSpell and registeredSpell) then + + RESULT = { + name = currentSpell.." (Spell ID#: "..selectedSpell..")", + type = "group", + guiInline = true, + get = function(key)return SV.filters.BuffWatch[registeredSpell][key[#key]]end, + set = function(key, value) + SV.filters.BuffWatch[registeredSpell][key[#key]] = value; + MOD:UpdateGroupAuraWatch("raid") + MOD:UpdateGroupAuraWatch("party") + MOD:UpdateGroupAuraWatch("raidpet", true) + end, + order = 5, + args = { + enable = { + name = L["Enable"], + width = 'full', + order = 0, + type = "toggle" + }, + displayText = { + name = L["Display Text"], + width = 'full', + type = "toggle", + order = 1, + }, + anyUnit = { + name = L["Show Aura From Other Players"], + width = 'full', + order = 2, + type = "toggle" + }, + onlyShowMissing = { + name = L["Show When Not Active"], + width = 'full', + order = 3, + type = "toggle", + disabled = function()return SV.filters.BuffWatch[registeredSpell].style == "text" end + }, + point = { + name = L["Anchor Point"], + order = 4, + type = "select", + values = { + ["TOPLEFT"] = "TOPLEFT", + ["TOPRIGHT"] = "TOPRIGHT", + ["BOTTOMLEFT"] = "BOTTOMLEFT", + ["BOTTOMRIGHT"] = "BOTTOMRIGHT", + ["LEFT"] = "LEFT", + ["RIGHT"] = "RIGHT", + ["TOP"] = "TOP", + ["BOTTOM"] = "BOTTOM" + } + }, + style = {name = L["Style"], order = 5, type = "select", values = {["coloredIcon"] = L["Colored Icon"], ["texturedIcon"] = L["Textured Icon"], [""] = NONE}}, + color = { + name = L["Color"], + type = "color", + order = 6, + get = function(key) + local abColor = SV.filters.BuffWatch[registeredSpell][key[#key]] + return abColor.r, abColor.g, abColor.b, abColor.a + end, + set = function(key, r, g, b) + local abColor = SV.filters.BuffWatch[registeredSpell][key[#key]] + abColor.r, abColor.g, abColor.b = r, g, b; + MOD:UpdateGroupAuraWatch("raid") + MOD:UpdateGroupAuraWatch("party") + MOD:UpdateGroupAuraWatch("raidpet", true) + end + }, + textColor = { + name = L["Text Color"], + type = "color", + order = 7, + get = function(key) + local abColor = SV.filters.BuffWatch[registeredSpell][key[#key]] + if abColor then + return abColor.r, abColor.g, abColor.b, abColor.a + else + return 1, 1, 1, 1 + end + end, + set = function(key, r, g, b) + SV.filters.BuffWatch[registeredSpell][key[#key]] = SV.filters.BuffWatch[registeredSpell][key[#key]] or {} + local abColor = SV.filters.BuffWatch[registeredSpell][key[#key]] + abColor.r, abColor.g, abColor.b = r, g, b; + MOD:UpdateGroupAuraWatch("raid") + MOD:UpdateGroupAuraWatch("party") + MOD:UpdateGroupAuraWatch("raidpet", true) + end + }, + textThreshold = { + name = L["Text Threshold"], + desc = L["At what point should the text be displayed. Set to -1 to disable."], + type = "range", + order = 8, + width = 'full', + min = -1, + max = 60, + step = 1 + }, + xOffset = {order = 9, type = "range", width = 'full', name = L["xOffset"], min = -75, max = 75, step = 1}, + yOffset = {order = 10, type = "range", width = 'full', name = L["yOffset"], min = -75, max = 75, step = 1}, + } + } + end + end + return RESULT; +end; + +ns.FilterOptionGroups['PetBuffWatch'] = function(selectedSpell) + CacheWatchedBuffs(SV.filters.PetBuffWatch) + local RESULT = { + type = "group", + name = 'PetBuffWatch', + guiInline = true, + order = 4, + args = { + addSpellID = { + order = 1, + name = L["Add SpellID"], + desc = L["Add a spell to the filter."], + type = "input", + get = function(key) return "" end, + set = function(key, value) + if not tonumber(value) then + SV:AddonMessage(L["Value must be a number"]) + elseif(not GetSpellInfo(value)) then + SV:AddonMessage(L["Not valid spell id"]) + else + tinsert(SV.filters.PetBuffWatch, {["enable"] = true, ["id"] = tonumber(value), ["point"] = "TOPRIGHT", ["color"] = {["r"] = 1, ["g"] = 0, ["b"] = 0}, ["anyUnit"] = true}) + MOD:SetUnitFrame("pet") + ns:SetFilterOptions('PetBuffWatch', selectedSpell) + end + end + }, + removeSpellID = { + order = 2, + name = L["Remove SpellID"], + desc = L["Remove a spell from the filter."], + type = "input", + get = function(key) return "" end, + set = function(key, value) + if not tonumber(value)then + SV:AddonMessage(L["Value must be a number"]) + elseif not GetSpellInfo(value) then + SV:AddonMessage(L["Not valid spell id"]) + else + local p; + for q, r in pairs(SV.filters.PetBuffWatch)do + if r["id"] == tonumber(value) then + p = r; + if SV.filters.PetBuffWatch[q] then + SV.filters.PetBuffWatch[q].enable = false; + else + SV.filters.PetBuffWatch[q] = nil + end + end + end + if p == nil then + SV:AddonMessage(L["Spell not found in list."]) + else + ns:SetFilterOptions() + end + end + MOD:SetUnitFrame("pet") + ns:SetFilterOptions('PetBuffWatch', selectedSpell) + end + }, + selectSpell = { + name = L["Select Spell"], + type = "select", + order = 3, + values = function() + CacheWatchedBuffs(SV.filters.PetBuffWatch) + wipe(tempFilterTable) + for _, watchData in pairs(watchedBuffs)do + if(watchData.id) then + local name = GetSpellInfo(watchData.id) + tempFilterTable[watchData.id] = name + end + end + return tempFilterTable + end, + get = function(key) return selectedSpell end, + set = function(key, value) ns:SetFilterOptions('PetBuffWatch', selectedSpell) end + } + } + }; + + return RESULT; +end; + +ns.FilterSpellGroups['PetBuffWatch'] = function(selectedSpell) + local RESULT; + + if(selectedSpell) then + local registeredSpell; + + for watchIndex, watchData in pairs(SV.filters.PetBuffWatch)do + if(watchData.id == selectedSpell) then + registeredSpell = watchIndex + end + end + + local currentSpell = GetSpellInfo(selectedSpell) + + if(currentSpell and registeredSpell) then + + RESULT = { + name = currentSpell.." ("..selectedSpell..")", + type = "group", + get = function(key)return SV.filters.PetBuffWatch[registeredSpell][key[#key]] end, + set = function(key, value) + SV.filters.PetBuffWatch[registeredSpell][key[#key]] = value; + MOD:SetUnitFrame("pet") + end, + order = 5, + guiInline = true, + args = { + enable = { + name = L["Enable"], + order = 0, + type = "toggle" + }, + point = { + name = L["Anchor Point"], + order = 1, + type = "select", + values = { + ["TOPLEFT"] = "TOPLEFT", + ["TOPRIGHT"] = "TOPRIGHT", + ["BOTTOMLEFT"] = "BOTTOMLEFT", + ["BOTTOMRIGHT"] = "BOTTOMRIGHT", + ["LEFT"] = "LEFT", + ["RIGHT"] = "RIGHT", + ["TOP"] = "TOP", + ["BOTTOM"] = "BOTTOM" + } + }, + xOffset = {order = 2, type = "range", name = L["xOffset"], min = -75, max = 75, step = 1}, + yOffset = {order = 2, type = "range", name = L["yOffset"], min = -75, max = 75, step = 1}, + style = { + name = L["Style"], + order = 3, + type = "select", + values = {["coloredIcon"] = L["Colored Icon"], ["texturedIcon"] = L["Textured Icon"], [""] = NONE} + }, + color = { + name = L["Color"], + type = "color", + order = 4, + get = function(key) + local abColor = SV.filters.PetBuffWatch[registeredSpell][key[#key]] + return abColor.r, abColor.g, abColor.b, abColor.a + end, + set = function(key, r, g, b) + local abColor = SV.filters.PetBuffWatch[registeredSpell][key[#key]] + abColor.r, abColor.g, abColor.b = r, g, b; + MOD:SetUnitFrame("pet") + end + }, + displayText = { + name = L["Display Text"], + type = "toggle", + order = 5 + }, + textColor = { + name = L["Text Color"], + type = "color", + order = 6, + get = function(key) + local abColor = SV.filters.PetBuffWatch[registeredSpell][key[#key]] + if abColor then + return abColor.r,abColor.g,abColor.b,abColor.a + else + return 1,1,1,1 + end + end, + set = function(key, r, g, b) + local abColor = SV.filters.PetBuffWatch[registeredSpell][key[#key]] + abColor.r,abColor.g,abColor.b = r, g, b; + MOD:SetUnitFrame("pet") + end + }, + textThreshold = { + name = L["Text Threshold"], + desc = L["At what point should the text be displayed. Set to -1 to disable."], + type = "range", + order = 6, + min = -1, + max = 60, + step = 1 + }, + anyUnit = { + name = L["Show Aura From Other Players"], + order = 7, + type = "toggle" + }, + onlyShowMissing = { + name = L["Show When Not Active"], + order = 8, + type = "toggle", + disabled = function()return SV.filters.PetBuffWatch[registeredSpell].style == "text"end + } + } + } + end + end + + return RESULT; +end; \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/filters/core.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/filters/core.lua new file mode 100644 index 0000000..cdcc9a6 --- /dev/null +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/filters/core.lua @@ -0,0 +1,177 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local print = _G.print; +local ipairs = _G.ipairs; +local pairs = _G.pairs; +local next = _G.next; +local rawset = _G.rawset; +local rawget = _G.rawget; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local getmetatable = _G.getmetatable; +local setmetatable = _G.setmetatable; +local tinsert = _G.tinsert; +local table = _G.table; +--[[ TABLE METHODS ]]-- +local tsort = table.sort; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = _G["SVUI"]; +local L = SV.L; +local MOD = SV.SVUnit +if(not MOD) then return end + +local _, ns = ...; + +ns.FilterOptionGroups = {}; +ns.FilterSpellGroups = {}; + +local tempFilterTable = {}; +local CURRENT_FILTER_TYPE = NONE; +local publicFilters = { + ["BlackList"] = "Blacklisted Auras", + ["WhiteList"] = "Whitelisted Auras", + ["Raid"] = "Consolidated Auras", + ["AuraBars"] = "Aura Bars", + ["Player"] = "Player Auras", + ["BuffWatch"] = "(AuraWatch) Player Auras", + ["PetBuffWatch"] = "(AuraWatch) Pet Auras", +}; + +local templateFilters = { + [""] = NONE, + ["BlackList"] = "BlackList", + ["WhiteList"] = "WhiteList", + ["Raid"] = "Raid", + ["AuraBars"] = "AuraBars", + ["Player"] = "Player", + ["BuffWatch"] = "BuffWatch", + ["PetBuffWatch"] = "PetBuffWatch", +}; + +local NONE = _G.NONE; +local GetSpellInfo = _G.GetSpellInfo; +local collectgarbage = _G.collectgarbage; + +SV.Options.args.filters = { + type = "group", + name = L["Filters"], + order = -10, + args = { + createFilter = { + order = 1, + name = L["Create Filter"], + desc = L["Create a custom filter."], + type = "input", + get = function(key) return "" end, + set = function(key, value) + SV.filters.Custom[value] = {} + end + }, + deleteFilter = { + type = "select", + order = 2, + name = L["Delete Filter"], + desc = L["Delete a custom filter."], + get = function(key) return "" end, + set = function(key, value) + SV.filters.Custom[value] = nil; + SV.Options.args.filters.args.filterGroup = nil + end, + values = function() + wipe(tempFilterTable) + tempFilterTable[""] = NONE; + for g in pairs(SV.filters.Custom) do + tempFilterTable[g] = g + end + return tempFilterTable + end + }, + selectFilter = { + order = 3, + type = "select", + name = L["Select Filter"], + get = function(key) return CURRENT_FILTER_TYPE end, + set = function(key, value) ns:SetFilterOptions(value) end, + values = function() + wipe(tempFilterTable) + tempFilterTable = templateFilters; + for g in pairs(SV.filters) do + if(publicFilters[g]) then + tempFilterTable[g] = publicFilters[g] + end + end + for g in pairs(SV.filters.Custom) do + tempFilterTable[g] = g + end + return tempFilterTable + end + } + } +}; + +function ns:SetFilterOptions(filterType, selectedSpell) + local FILTER + CURRENT_FILTER_TYPE = filterType + if(SV.filters.Custom[filterType]) then + FILTER = SV.filters.Custom[filterType] + else + FILTER = SV.filters[filterType] + end + if((not filterType) or (filterType == "") or (not FILTER)) then + SV.Options.args.filters.args.filterGroup = nil; + SV.Options.args.filters.args.spellGroup = nil; + return + end + + if(not self.FilterOptionGroups[filterType]) then + self.FilterOptionGroups[filterType] = self.FilterOptionGroups['_NEW'](filterType); + end + + SV.Options.args.filters.args.filterGroup = self.FilterOptionGroups[filterType](selectedSpell) + + if(not self.FilterSpellGroups[filterType]) then + self.FilterSpellGroups[filterType] = self.FilterSpellGroups['_NEW'](filterType); + end + + SV.Options.args.filters.args.spellGroup = self.FilterSpellGroups[filterType](selectedSpell); + + + MOD:RefreshUnitFrames() + + collectgarbage("collect") +end + + +function ns:SetToFilterConfig(newFilter) + local filter = newFilter or "BuffWatch"; + self:SetFilterOptions(filter); + _G.LibStub("AceConfigDialog-3.0"):SelectGroup(SV.NameID, "filters"); +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/fonts.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/fonts.lua new file mode 100644 index 0000000..61cd5cc --- /dev/null +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/fonts.lua @@ -0,0 +1,153 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local pairs = _G.pairs; +local tinsert = _G.tinsert; +local table = _G.table; +--[[ TABLE METHODS ]]-- +local tsort = table.sort; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = _G["SVUI"]; +local L = SV.L; +local _, ns = ...; + +local AceGUIWidgetLSMlists = AceGUIWidgetLSMlists; + +local FONT_GROUP_SORT = { + {"Default", 1, {"default"}}, + {"General", 2, {"name", "number", "aura"}}, + {"Large", 3, {"combat", "alert", "zone", "title"}}, + {"Docking", 4, {"data"}}, + {"Misc", 5, {"narrator", "caps"}}, + {"NamePlate", 6, {"platename", "plateaura"}}, + {"UnitFrame", 7, {"unitprimary", "unitsecondary", "unitaurabar", "unitaurasmall", "unitauramedium", "unitauralarge"}}, +} + +local function GenerateFontGroup() + local fontGroupArgs = {}; + + for _, listData in pairs(FONT_GROUP_SORT) do + local orderCount = 1; + local groupName = listData[1]; + local groupCount = listData[2]; + local groupList = listData[3]; + fontGroupArgs[groupName] = { + order = groupCount, + type = "group", + name = groupName, + args = {}, + }; + for _, template in pairs(groupList) do + local data = SV.db.font[template] + fontGroupArgs[groupName].args[template] = { + order = orderCount, + type = "group", + guiInline = true, + name = data.optionName, + get = function(key) + return SV.db.font[template][key[#key]] + end, + set = function(key,value) + SV.db.font[template][key[#key]] = value; + SV:RefreshSystemFonts(); + end, + args = { + description = { + order = 1, + name = data.optionDesc, + type = "description", + width = "full", + }, + spacer1 = { + order = 2, + name = "", + type = "description", + width = "full", + }, + spacer2 = { + order = 3, + name = "", + type = "description", + width = "full", + }, + file = { + type = "select", + dialogControl = 'LSM30_Font', + order = 4, + name = L["Font File"], + desc = L["Set the font file to use with this font-type."], + values = AceGUIWidgetLSMlists.font, + }, + outline = { + order = 5, + name = L["Font Outline"], + desc = L["Set the outlining to use with this font-type."], + type = "select", + values = { + ["NONE"] = L["None"], + ["OUTLINE"] = "OUTLINE", + ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", + ["THICKOUTLINE"] = "THICKOUTLINE" + }, + }, + size = { + order = 6, + name = L["Font Size"], + desc = L["Set the font size to use with this font-type."], + type = "range", + min = 6, + max = 22, + step = 1, + width = 'full', + }, + } + } + orderCount = orderCount + 1; + end + end + + return fontGroupArgs; +end + +SV.Options.args.fonts = { + order = 3, + type = "group", + name = L['Fonts'], + childGroups = "tab", + args = { + commonGroup = { + order = 1, + type = 'group', + name = L['Font Options'], + childGroups = "tree", + args = GenerateFontGroup() + } + } +}; + +function ns:SetToFontConfig(font) + font = font or "Default"; + _G.LibStub("AceConfigDialog-3.0"):SelectGroup(SV.NameID, "fonts", "commonGroup", font); +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/plate.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/plate.lua index 87d9fcf..011b0de 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/plate.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/plate.lua @@ -190,41 +190,6 @@ SV.Options.args.SVPlate = { step = 0.01, isPercent = true }, - fontGroup = { - order = 100, - type = "group", - guiInline = true, - name = L["Fonts"], - args = { - font = { - type = "select", - dialogControl = "LSM30_Font", - order = 4, - name = L["Font"], - values = AceGUIWidgetLSMlists.font - }, - fontSize = { - order = 5, - name = L["Font Size"], - type = "range", - min = 6, - max = 22, - step = 1 - }, - fontOutline = { - order = 6, - name = L["Font Outline"], - desc = L["Set the font outline."], - type = "select", - values = { - ["NONE"] = L["None"], - ["OUTLINE"] = "OUTLINE", - ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", - ["THICKOUTLINE"] = "THICKOUTLINE" - } - } - } - }, reactions = { order = 200, type = "group", diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/profiles.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/profiles.lua index 36c4968..d3e3b9a 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/profiles.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/profiles.lua @@ -83,13 +83,18 @@ local function RefreshProfileOptions() SV.Options.args.profiles.args.save = { order = 5, type = "execute", - name = SAVE, + name = _G.SAVE .. " " .. L["current"] .. " |cffFFFF00" .. currentProfile .. "|r", width = "full", - desc = function() return _G.SAVE .. " " .. L["current"] .. " |cffFFFF00" .. currentProfile .. "|r" end, func = function() SVLib:ExportDatabase(currentProfile) SV:SavedPopup() RefreshProfileOptions() end, } else - SV.Options.args.profiles.args.save = nil + SV.Options.args.profiles.args.save = { + order = 5, + type = "execute", + name = "Unlink from current profile: |cffFFFF00" .. currentProfile .. "|r", + width = "full", + func = function() SVLib:UnsetProfile() SV:SavedPopup() RefreshProfileOptions() end, + } end SV.Options.args.profiles.args.export = { diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/stat.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/stat.lua deleted file mode 100644 index b55bcc6..0000000 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/stat.lua +++ /dev/null @@ -1,159 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local pairs = _G.pairs; -local tinsert = _G.tinsert; -local string = _G.string; -local upper = string.upper; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = _G["SVUI"]; -local L = SV.L; -local MOD = SV.SVStats; ---[[ -########################################################## -SET PACKAGE OPTIONS -########################################################## -]]-- -SV.Options.args.SVStats = { - type = "group", - name = MOD.TitleID, - childGroups = "tab", - get = function(key) return SV.db.SVStats[key[#key]] end, - set = function(key, value) MOD:ChangeDBVar(value, key[#key]); MOD:Generate() end, - args = { - intro = { - order = 1, - type = "description", - name = L["STATS_DESC"] - }, - time24 = { - order = 2, - type = "toggle", - name = L["24-Hour Time"], - desc = L["Toggle 24-hour mode for the time datatext."] - }, - localtime = { - order = 3, - type = "toggle", - name = L["Local Time"], - desc = L["If not set to true then the server time will be displayed instead."] - }, - battleground = { - order = 4, - type = "toggle", - name = L["Battleground Texts"], - desc = L["When inside a battleground display personal scoreboard information on the main datatext bars."] - }, - showBackground = { - order = 5, - name = "Show Backgrounds", - desc = L["Display statistic background textures"], - type = "toggle", - set = function(key, value) MOD:ChangeDBVar(value, key[#key]); SV:StaticPopup_Show("RL_CLIENT") end, - }, - shortGold = { - order = 6, - type = "toggle", - name = L["Shortened Gold Text"], - }, - fontGroup = { - order = 7, - type = "group", - guiInline = true, - name = L["Fonts"], - set = function(key, value) MOD:ChangeDBVar(value, key[#key]); MOD:Generate() end, - args = { - font = { - type = "select", - dialogControl = "LSM30_Font", - order = 4, - name = L["Font"], - values = AceGUIWidgetLSMlists.font - }, - fontSize = { - order = 5, - name = L["Font Size"], - type = "range", - min = 6, - max = 22, - step = 1 - }, - fontOutline = { - order = 6, - name = L["Font Outline"], - desc = L["Set the font outline."], - type = "select", - values = { - ["NONE"] = L["None"], - ["OUTLINE"] = "OUTLINE", - ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", - ["THICKOUTLINE"] = "THICKOUTLINE" - } - } - } - }, - panels = { - type = "group", - name = L["Panels"], - order = 100, - args = {}, - guiInline = true - }, - } -} - -do - local orderIncrement = 0; - local statValues = MOD.StatListing - local configTable = SV.db.SVStats.docks; - local optionTable = SV.Options.args.SVStats.args.panels.args; - - for panelName, panelPositions in pairs(configTable)do - orderIncrement = orderIncrement + 1; - if(not _G[panelName]) then - print(panelName) - optionTable[panelName] = nil; - return - end - if(type(panelPositions) == "table") then - optionTable[panelName] = { - type = 'group', - args = {}, - name = L[panelName] or panelName, - guiInline = true, - order = (orderIncrement + 10) - } - for position,_ in pairs(panelPositions) do - optionTable[panelName].args[position] = { - type = 'select', - name = L[position] or upper(position), - values = statValues, - get = function(key) return SV.db.SVStats.docks[panelName][key[#key]] end, - set = function(key, value) MOD:ChangeDBVar(value, key[#key], "docks", panelName); MOD:Generate() end - } - end - end - end -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/tip.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/tip.lua index 573edb0..31ef726 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/tip.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/tip.lua @@ -136,41 +136,8 @@ SV.Options.args.SVTip = { max = 15, step = 1, width = "full", - set = function(a,b)SV.db.SVTip.healthBar.height = b;GameTooltipStatusBar:Height(b)end + set = function(a,b)SV.db.SVTip.healthBar.height = b;GameTooltipStatusBar:SetHeightToScale(b)end }, - fontGroup = { - order = 2, - name = L["Fonts"], - type = "group", - guiInline = true, - args = { - text = { - order = 1, - type = "toggle", - name = L["Text"], - set = function(a,b)SV.db.SVTip.healthBar.text = b;if b then GameTooltipStatusBar.text:Show()else GameTooltipStatusBar.text:Hide()end end - }, - font = { - type = "select", - dialogControl = "LSM30_Font", - order = 2, - width = "full", - name = L["Font"], - values = AceGUIWidgetLSMlists.font, - set = function(a,b)SV.db.SVTip.healthBar.font = b;GameTooltipStatusBar.text:FontManager(LSM:Fetch("font",SV.db.SVTip.healthBar.font), SV.db.SVTip.healthBar.fontSize,"OUTLINE")end - }, - fontSize = { - order = 3, - name = L["Font Size"], - type = "range", - min = 6, - max = 22, - step = 1, - width = "full", - set = function(a,b)SV.db.SVTip.healthBar.fontSize = b;GameTooltipStatusBar.text:FontManager(LSM:Fetch("font",SV.db.SVTip.healthBar.font),SV.db.SVTip.healthBar.fontSize,"OUTLINE")end - } - } - } } } } diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/_load.xml b/Interface/AddOns/SVUI_ConfigOMatic/components/units/_load.xml index e835fb5..6c99aea 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/_load.xml +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/_load.xml @@ -7,5 +7,4 @@ <Script file='party.lua'/> <Script file='raid.lua'/> <Script file='other.lua'/> - <Script file='grid.lua'/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/core.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/core.lua index 6a32d2e..45678ea 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/core.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/core.lua @@ -57,6 +57,113 @@ local textStringFormats = { SET PACKAGE OPTIONS ########################################################## ]]-- +function ns:SetSizeConfigGroup(gridMode, unitName) + local sizeGroup = { + order = 2, + guiInline = true, + type = "group", + name = L["Size Settings"], + args = {} + } + + if(gridMode) then + sizeGroup.args = { + size = { + order = 1, + name = L["Grid Size"], + type = "range", + min = 10, + max = 100, + step = 1, + width = 'full', + get = function(key) return SV.db.SVUnit[unitName].grid[key[#key]] end, + set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "grid"); MOD:SetGroupFrame(unitName) end, + }, + spacer1 = { + order = 2, + name = "", + type = "description", + width = "full", + }, + wrapXOffset = { + order = 3, + type = "range", + name = L["Horizontal Spacing"], + min = 0, + max = 50, + step = 1, + get = function(key) return SV.db.SVUnit[unitName][key[#key]] end, + set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName); MOD:SetGroupFrame(unitName) end, + }, + wrapYOffset = { + order = 4, + type = "range", + name = L["Vertical Spacing"], + min = 0, + max = 50, + step = 1, + get = function(key) return SV.db.SVUnit[unitName][key[#key]] end, + set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName); MOD:SetGroupFrame(unitName) end, + }, + } + else + sizeGroup.args = { + width = { + order = 1, + name = L["Width"], + type = "range", + min = 10, + max = 500, + step = 1, + width = 'full', + get = function(key) return SV.db.SVUnit[unitName][key[#key]] end, + set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName); MOD:SetGroupFrame(unitName) end, + }, + height = { + order = 2, + name = L["Height"], + type = "range", + min = 10, + max = 500, + step = 1, + width = 'full', + get = function(key) return SV.db.SVUnit[unitName][key[#key]] end, + set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName); MOD:SetGroupFrame(unitName) end, + }, + spacer1 = { + order = 3, + name = "", + type = "description", + width = "full", + }, + wrapXOffset = { + order = 4, + type = "range", + name = L["Horizontal Spacing"], + min = 0, + max = 50, + step = 1, + width = 'full', + get = function(key) return SV.db.SVUnit[unitName][key[#key]] end, + set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName); MOD:SetGroupFrame(unitName) end, + }, + wrapYOffset = { + order = 5, + type = "range", + name = L["Vertical Spacing"], + min = 0, + max = 50, + step = 1, + width = 'full', + get = function(key) return SV.db.SVUnit[unitName][key[#key]] end, + set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName); MOD:SetGroupFrame(unitName) end, + }, + } + end + + return sizeGroup +end + function ns:SetCastbarConfigGroup(updateFunction, unitName, count) local configTable = { order = 800, @@ -337,17 +444,64 @@ function ns:SetHealthConfigGroup(partyRaid, updateFunction, unitName, count) guiInline = true, name = L["Base Settings"], args = { - reversed = {type = "toggle", order = 1, name = L["Reverse Fill"], desc = L["Invert this bars fill direction"]}, - position = {type = "select", order = 2, name = L["Text Position"], desc = L["Set the anchor for this bars value text"], values = SV.PointIndexes}, configureButton = { - order = 4, + order = 1, width = "full", name = L["Coloring"], type = "execute", func = function() ACD:SelectGroup(SV.NameID, "SVUnit", "common", "allColorsGroup", "healthGroup") end }, - xOffset = {order = 5, type = "range", width = "full", name = L["Text xOffset"], desc = L["Offset position for text."], min = -300, max = 300, step = 1}, - yOffset = {order = 6, type = "range", width = "full", name = L["Text yOffset"], desc = L["Offset position for text."], min = -300, max = 300, step = 1}, + classColor = { + order = 2, + type = "toggle", + name = L["Class Health"], + desc = L["Color health by classcolor or reaction."], + }, + valueColor = { + order = 3, + type = "toggle", + name = L["Health By Value"], + desc = L["Color health by amount remaining."], + }, + classBackdrop = { + order = 4, + type = "toggle", + name = L["Class Backdrop"], + desc = L["Color the health backdrop by class or reaction."], + }, + reversed = { + type = "toggle", + order = 5, + name = L["Reverse Fill"], + desc = L["Invert this bars fill direction"] + }, + position = { + type = "select", + order = 6, + name = L["Text Position"], + desc = L["Set the anchor for this bars value text"], + values = SV.PointIndexes + }, + xOffset = { + order = 7, + type = "range", + width = "full", + name = L["Text xOffset"], + desc = L["Offset position for text."], + min = -300, + max = 300, + step = 1 + }, + yOffset = { + order = 8, + type = "range", + width = "full", + name = L["Text yOffset"], + desc = L["Offset position for text."], + min = -300, + max = 300, + step = 1 + }, } }, formatGroup = { @@ -427,25 +581,55 @@ function ns:SetPowerConfigGroup(playerTarget, updateFunction, unitName, count) guiInline = true, name = L["Base Settings"], args = { - position = {type = "select", order = 3, name = L["Text Position"], desc = L["Set the anchor for this bars value text"], values = SV.PointIndexes}, configureButton = { - order = 4, + order = 1, name = L["Coloring"], width = "full", type = "execute", func = function()ACD:SelectGroup(SV.NameID, "SVUnit", "common", "allColorsGroup", "powerGroup")end }, + classColor = { + order = 2, + type = "toggle", + name = L["Class Power"], + desc = L["Color power by classcolor or reaction."], + }, + position = { + type = "select", + order = 3, + name = L["Text Position"], + desc = L["Set the anchor for this bars value text"], + values = SV.PointIndexes + }, height = { type = "range", name = L["Height"], - order = 5, + order = 4, width = "full", min = 3, max = 50, step = 1 }, - xOffset = {order = 6, type = "range", width = "full", name = L["Text xOffset"], desc = L["Offset position for text."], min = -300, max = 300, step = 1}, - yOffset = {order = 7, type = "range", width = "full", name = L["Text yOffset"], desc = L["Offset position for text."], min = -300, max = 300, step = 1}, + xOffset = { + order = 5, + type = "range", + width = "full", + name = L["Text xOffset"], + desc = L["Offset position for text."], + min = -300, + max = 300, + step = 1 + }, + yOffset = { + order = 6, + type = "range", + width = "full", + name = L["Text yOffset"], + desc = L["Offset position for text."], + min = -300, + max = 300, + step = 1 + }, } }, formatGroup = { @@ -960,48 +1144,79 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) return k end +local BoolFilters = { + ['player'] = true, + ['pet'] = true, + ['boss'] = true, + ['arena'] = true, + ['party'] = true, + ['raid'] = true, + ['raidpet'] = true, +}; + local function setAuraFilteringOptions(configTable, unitName, auraType, updateFunction, isPlayer) - if isPlayer then + if BoolFilters[unitName] then configTable.filterGroup = { order = 10, guiInline = true, type = "group", name = L["Filter Options"], args = { - filterPlayer = { + filterWhiteList = { order = 1, type = "toggle", + name = L["Only White Listed"], + desc = L["Only show auras that are on the whitelist."], + get = function(key)return SV.db.SVUnit[unitName][auraType].filterWhiteList end, + set = function(key, value) + SV.db.SVUnit[unitName][auraType].filterWhiteList = value; + if(value) then + SV.db.SVUnit[unitName][auraType].filterPlayer = false; + SV.db.SVUnit[unitName][auraType].filterDispellable = false; + SV.db.SVUnit[unitName][auraType].filterInfinite = false; + SV.db.SVUnit[unitName][auraType].filterRaid = false; + end + updateFunction(MOD, unitName) + end, + }, + filterPlayer = { + order = 2, + type = "toggle", name = L["From You"], desc = L["Only show auras that were cast by you."], get = function(key) return SV.db.SVUnit[unitName][auraType].filterPlayer end, set = function(key, value) SV.db.SVUnit[unitName][auraType].filterPlayer = value; updateFunction(MOD, unitName) end, + disabled = function() return SV.db.SVUnit[unitName][auraType].filterWhiteList end, }, filterDispellable = { - order = 2, + order = 3, type = "toggle", name = L["You Can Remove"], desc = L["Only show auras that can be removed by you. (example: Purge, Dispel)"], get = function(key) return SV.db.SVUnit[unitName][auraType].filterDispellable end, set = function(key, value) SV.db.SVUnit[unitName][auraType].filterDispellable = value; updateFunction(MOD, unitName) end, + disabled = function() return SV.db.SVUnit[unitName][auraType].filterWhiteList end, }, filterInfinite = { - order = 3, + order = 4, type = "toggle", name = L["No Duration"], desc = L["Don't display auras that have no duration."], get = function(key) return SV.db.SVUnit[unitName][auraType].filterInfinite end, set = function(key, value) SV.db.SVUnit[unitName][auraType].filterInfinite = value; updateFunction(MOD, unitName) end, + disabled = function() return SV.db.SVUnit[unitName][auraType].filterWhiteList end, }, filterRaid = { - order = 4, + order = 5, type = "toggle", name = L["Consolidated Buffs"], desc = L["Don't display consolidated buffs"], get = function(key) return SV.db.SVUnit[unitName][auraType].filterRaid end, set = function(key, value) SV.db.SVUnit[unitName][auraType].filterRaid = value; updateFunction(MOD, unitName) end, + disabled = function() return SV.db.SVUnit[unitName][auraType].filterWhiteList end, }, useFilter = { - order = 5, + order = 6, type = "select", name = L["Custom Filter"], desc = L["Select a custom filter to include."], @@ -1015,6 +1230,7 @@ local function setAuraFilteringOptions(configTable, unitName, auraType, updateFu end, get = function(key) return SV.db.SVUnit[unitName][auraType].useFilter end, set = function(key, value) SV.db.SVUnit[unitName][auraType].useFilter = value; updateFunction(MOD, unitName) end, + disabled = function() return not SV.db.SVUnit.arena.pvp.enable end, } } } @@ -1036,32 +1252,76 @@ local function setAuraFilteringOptions(configTable, unitName, auraType, updateFu type = "toggle", name = L["Hide All"], desc = L["Don't display any " .. auraType .. "."], - get = function(key) return SV.db.SVUnit[unitName][auraType].filterAll.friendly end, - set = function(key, value) SV.db.SVUnit[unitName][auraType].filterAll.friendly = value; updateFunction(MOD, unitName) end, + get = function(key) return SV.db.SVUnit[unitName][auraType].filterAll.friendly end, + set = function(key, value) + SV.db.SVUnit[unitName][auraType].filterAll.friendly = value; + if(value) then + SV.db.SVUnit[unitName][auraType].filterWhiteList.friendly = false; + SV.db.SVUnit[unitName][auraType].filterPlayer.friendly = false; + SV.db.SVUnit[unitName][auraType].filterDispellable.friendly = false; + SV.db.SVUnit[unitName][auraType].filterInfinite.friendly = false; + if(SV.db.SVUnit[unitName][auraType].filterRaid) then + SV.db.SVUnit[unitName][auraType].filterRaid.friendly = false; + end + end + updateFunction(MOD, unitName) + end, }, - filterPlayer = { + filterWhiteList = { order = 2, type = "toggle", + name = L["Only White Listed"], + desc = L["Only show auras that are on the whitelist."], + get = function(key)return SV.db.SVUnit[unitName][auraType].filterWhiteList.friendly end, + set = function(key, value)SV.db.SVUnit[unitName][auraType].filterWhiteList.friendly = value; updateFunction(MOD, unitName) end, + set = function(key, value) + SV.db.SVUnit[unitName][auraType].filterWhiteList.friendly = value; + if(value) then + SV.db.SVUnit[unitName][auraType].filterPlayer.friendly = false; + SV.db.SVUnit[unitName][auraType].filterDispellable.friendly = false; + SV.db.SVUnit[unitName][auraType].filterInfinite.friendly = false; + if(SV.db.SVUnit[unitName][auraType].filterRaid) then + SV.db.SVUnit[unitName][auraType].filterRaid.friendly = false; + end + end + updateFunction(MOD, unitName) + end, + disabled = function() + return SV.db.SVUnit[unitName][auraType].filterAll.friendly + end, + }, + filterPlayer = { + order = 3, + type = "toggle", name = L["From You"], desc = L["Only show auras that were cast by you."], get = function(key)return SV.db.SVUnit[unitName][auraType].filterPlayer.friendly end, set = function(key, value)SV.db.SVUnit[unitName][auraType].filterPlayer.friendly = value; updateFunction(MOD, unitName) end, + disabled = function() + return (SV.db.SVUnit[unitName][auraType].filterAll.friendly or SV.db.SVUnit[unitName][auraType].filterWhiteList.friendly) + end, }, filterDispellable = { - order = 3, + order = 4, type = "toggle", name = L["You Can Remove"], desc = L["Only show auras that can be removed by you. (example: Purge, Dispel)"], get = function(key)return SV.db.SVUnit[unitName][auraType].filterDispellable.friendly end, set = function(key, value)SV.db.SVUnit[unitName][auraType].filterDispellable.friendly = value; updateFunction(MOD, unitName) end, + disabled = function() + return (SV.db.SVUnit[unitName][auraType].filterAll.friendly or SV.db.SVUnit[unitName][auraType].filterWhiteList.friendly) + end, }, filterInfinite = { - order = 4, + order = 5, type = "toggle", name = L["No Duration"], desc = L["Don't display auras that have no duration."], get = function(key)return SV.db.SVUnit[unitName][auraType].filterInfinite.friendly end, - set = function(key, value)SV.db.SVUnit[unitName][auraType].filterInfinite.friendly = value; updateFunction(MOD, unitName) end + set = function(key, value)SV.db.SVUnit[unitName][auraType].filterInfinite.friendly = value; updateFunction(MOD, unitName) end, + disabled = function() + return (SV.db.SVUnit[unitName][auraType].filterAll.friendly or SV.db.SVUnit[unitName][auraType].filterWhiteList.friendly) + end, }, }, }, @@ -1077,31 +1337,74 @@ local function setAuraFilteringOptions(configTable, unitName, auraType, updateFu name = L["Hide All"], desc = L["Don't display any " .. auraType .. "."], get = function(key)return SV.db.SVUnit[unitName][auraType].filterAll.enemy end, - set = function(key, value)SV.db.SVUnit[unitName][auraType].filterAll.enemy = value; updateFunction(MOD, unitName) end, + set = function(key, value) + SV.db.SVUnit[unitName][auraType].filterAll.enemy = value; + if(value) then + SV.db.SVUnit[unitName][auraType].filterWhiteList.enemy = false; + SV.db.SVUnit[unitName][auraType].filterPlayer.enemy = false; + SV.db.SVUnit[unitName][auraType].filterDispellable.enemy = false; + SV.db.SVUnit[unitName][auraType].filterInfinite.enemy = false; + if(SV.db.SVUnit[unitName][auraType].filterRaid) then + SV.db.SVUnit[unitName][auraType].filterRaid.enemy = false; + end + end + updateFunction(MOD, unitName) + end, }, - filterPlayer = { + filterWhiteList = { order = 2, type = "toggle", + name = L["Only White Listed"], + desc = L["Only show auras that are on the whitelist."], + get = function(key)return SV.db.SVUnit[unitName][auraType].filterPlayer.enemy end, + set = function(key, value) + SV.db.SVUnit[unitName][auraType].filterWhiteList.enemy = value; + if(value) then + SV.db.SVUnit[unitName][auraType].filterPlayer.enemy = false; + SV.db.SVUnit[unitName][auraType].filterDispellable.enemy = false; + SV.db.SVUnit[unitName][auraType].filterInfinite.enemy = false; + if(SV.db.SVUnit[unitName][auraType].filterRaid) then + SV.db.SVUnit[unitName][auraType].filterRaid.enemy = false; + end + end + updateFunction(MOD, unitName) + end, + disabled = function() + return SV.db.SVUnit[unitName][auraType].filterAll.enemy + end, + }, + filterPlayer = { + order = 3, + type = "toggle", name = L["From You"], desc = L["Only show auras that were cast by you."], get = function(key)return SV.db.SVUnit[unitName][auraType].filterPlayer.enemy end, set = function(key, value)SV.db.SVUnit[unitName][auraType].filterPlayer.enemy = value; updateFunction(MOD, unitName) end, + disabled = function() + return (SV.db.SVUnit[unitName][auraType].filterAll.enemy or SV.db.SVUnit[unitName][auraType].filterWhiteList.enemy) + end, }, filterDispellable = { - order = 3, + order = 4, type = "toggle", name = L["You Can Remove"], desc = L["Only show auras that can be removed by you. (example: Purge, Dispel)"], get = function(key)return SV.db.SVUnit[unitName][auraType].filterDispellable.enemy end, set = function(key, value)SV.db.SVUnit[unitName][auraType].filterDispellable.enemy = value; updateFunction(MOD, unitName) end, + disabled = function() + return (SV.db.SVUnit[unitName][auraType].filterAll.enemy or SV.db.SVUnit[unitName][auraType].filterWhiteList.enemy) + end, }, filterInfinite = { - order = 4, + order = 5, type = "toggle", name = L["No Duration"], desc = L["Don't display auras that have no duration."], get = function(key)return SV.db.SVUnit[unitName][auraType].filterInfinite.enemy end, - set = function(key, value)SV.db.SVUnit[unitName][auraType].filterInfinite.enemy = value; updateFunction(MOD, unitName) end + set = function(key, value)SV.db.SVUnit[unitName][auraType].filterInfinite.enemy = value; updateFunction(MOD, unitName) end, + disabled = function() + return (SV.db.SVUnit[unitName][auraType].filterAll.enemy or SV.db.SVUnit[unitName][auraType].filterWhiteList.enemy) + end, }, }, }, @@ -1120,26 +1423,35 @@ local function setAuraFilteringOptions(configTable, unitName, auraType, updateFu end, get = function(key) return SV.db.SVUnit[unitName][auraType].useFilter end, set = function(key, value) SV.db.SVUnit[unitName][auraType].useFilter = value; updateFunction(MOD, unitName) end, + disabled = function() + return (SV.db.SVUnit[unitName][auraType].filterAll.enemy or SV.db.SVUnit[unitName][auraType].filterWhiteList.enemy) + end, } } } if(SV.db.SVUnit[unitName][auraType].filterRaid) then configTable.filterGroup.args.friendlyGroup.args.filterRaid = { - order = 5, + order = 6, type = "toggle", name = L["Consolidated Buffs"], desc = L["Don't display consolidated buffs"], get = function(key)return SV.db.SVUnit[unitName][auraType].filterRaid.friendly end, - set = function(key, value)SV.db.SVUnit[unitName][auraType].filterRaid.friendly = value; updateFunction(MOD, unitName) end + set = function(key, value)SV.db.SVUnit[unitName][auraType].filterRaid.friendly = value; updateFunction(MOD, unitName) end, + disabled = function() + return (SV.db.SVUnit[unitName][auraType].filterAll.friendly or SV.db.SVUnit[unitName][auraType].filterWhiteList.friendly) + end, }; configTable.filterGroup.args.enemyGroup.args.filterRaid = { - order = 5, + order = 6, type = "toggle", name = L["Consolidated Buffs"], desc = L["Don't display consolidated buffs"], get = function(key)return SV.db.SVUnit[unitName][auraType].filterRaid.enemy end, - set = function(key, value)SV.db.SVUnit[unitName][auraType].filterRaid.enemy = value; updateFunction(MOD, unitName) end + set = function(key, value)SV.db.SVUnit[unitName][auraType].filterRaid.enemy = value; updateFunction(MOD, unitName) end, + disabled = function() + return (SV.db.SVUnit[unitName][auraType].filterAll.enemy or SV.db.SVUnit[unitName][auraType].filterWhiteList.enemy) + end, }; end end @@ -1368,10 +1680,11 @@ function ns:SetAurabarConfigGroup(isPlayer, updateFunction, unitName) return configTable end + SV.Options.args.SVUnit = { type = "group", name = MOD.TitleID, - childGroups = "tree", + childGroups = "tab", get = function(key) return SV.db.SVUnit[key[#key]] end, @@ -1383,618 +1696,520 @@ SV.Options.args.SVUnit = { enable = { order = 1, type = "toggle", - name = L["Enable"], + name = L["Enable SVUI UnitFrames"], get = function(l) return SV.db.SVUnit.enable end, set = function(l, m) SV.db.SVUnit.enable = m; SV:StaticPopup_Show("RL_CLIENT") end - }, - common = { + }, + spacer1 = { order = 2, - type = "group", - name = L["General"], - guiInline = true, - disabled = function() - return not SV.db.SVUnit.enable - end, + name = "", + type = "description", + width = "full", + }, + spacer2 = { + order = 3, + name = "", + type = "description", + width = "full", + }, + commonGroup = { + order = 4, + type = 'group', + name = '', + childGroups = "tree", + disabled = function() return not SV.db.SVUnit.enable end, args = { - commonGroup = { + baseGroup = { order = 1, type = "group", - guiInline = true, name = L["General"], args = { - disableBlizzard = { - order = 1, - name = L["Disable Blizzard"], - desc = L["Disables the blizzard party/raid frames."], - type = "toggle", - get = function(key) - return SV.db.SVUnit.disableBlizzard - end, - set = function(key, value) - MOD:ChangeDBVar(value, "disableBlizzard"); - SV:StaticPopup_Show("RL_CLIENT") - end - }, - fastClickTarget = { - order = 2, - name = L["Fast Clicks"], - desc = L["Immediate mouse-click-targeting"], - type = "toggle" - }, - debuffHighlighting = { - order = 3, - name = L["Debuff Highlight"], - desc = L["Color the unit if there is a debuff that can be dispelled by your class."], - type = "toggle" - }, - xrayFocus = { - order = 4, - name = L["X-Ray Specs"], - desc = L["Use handy graphics to focus the current target, or clear the current focus"], - type = "toggle" - }, - OORAlpha = { - order = 5, - name = L["Range Fading"], - desc = L["The transparency of units that are out of range."], - type = "range", - min = 0, - max = 1, - step = 0.01, - width = "full", - set = function(key, value) - MOD:ChangeDBVar(value, key[#key]); - end - }, - groupOORAlpha = { - order = 6, - name = L["Group Range Fading"], - desc = L["The transparency of group units that are out of range."], - type = "range", - min = 0, - max = 1, - step = 0.01, - width = "full", - set = function(key, value) - MOD:ChangeDBVar(value, key[#key]); - end - }, - } - }, - backgroundGroup = { - order = 2, - type = "group", - guiInline = true, - name = "Unit Backgrounds (3D Portraits Only)", - get = function(key) - return SV.db.media.textures[key[#key]] - end, - set = function(key, value) - SV.db.media.textures[key[#key]] = value - SV:RefreshEverything(true) - end, - args = { - unitlarge = { - type = "select", - dialogControl = "LSM30_Background", - order = 2, - name = "Unit Background", - values = AceGUIWidgetLSMlists.background, - }, - unitsmall = { - type = "select", - dialogControl = "LSM30_Background", - order = 3, - name = "Small Unit Background", - values = AceGUIWidgetLSMlists.background, - } - } - }, - barGroup = { - order = 3, - type = "group", - guiInline = true, - name = L["Bars"], - get = function(key) - return SV.db.SVUnit[key[#key]] - end, - set = function(key, value) - MOD:ChangeDBVar(value, key[#key]); - MOD:RefreshAllUnitMedia() - end, - args = { - smoothbars = { - type = "toggle", - order = 1, - name = L["Smooth Bars"], - desc = L["Bars will transition smoothly."] - }, - statusbar = { - type = "select", - dialogControl = "LSM30_Statusbar", - order = 2, - name = L["StatusBar Texture"], - desc = L["Main statusbar texture."], - values = AceGUIWidgetLSMlists.statusbar - }, - auraBarStatusbar = { - type = "select", - dialogControl = "LSM30_Statusbar", - order = 3, - name = L["AuraBar Texture"], - desc = L["Main statusbar texture."], - values = AceGUIWidgetLSMlists.statusbar - }, - } - }, - fontGroup = { - order = 4, - type = "group", - guiInline = true, - name = L["Fonts"], - set = function(key, value) - MOD:ChangeDBVar(value, key[#key]); - MOD:RefreshAllUnitMedia() - end, - args = { - font = { - type = "select", - dialogControl = "LSM30_Font", + commonGroup = { order = 1, - name = L["Default Font"], - desc = L["The font that the unitframes will use."], - values = AceGUIWidgetLSMlists.font, - }, - fontOutline = { - order = 2, - name = L["Font Outline"], - desc = L["Set the font outline."], - type = "select", - values = { - ["NONE"] = L["None"], ["OUTLINE"] = "OUTLINE", ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", ["THICKOUTLINE"] = "THICKOUTLINE" - }, - }, - fontSize = { - order = 3, - name = L["Font Size"], - desc = L["Set the font size for unitframes."], - type = "range", - min = 6, - max = 22, - step = 1, - }, - auraFont = { - type = "select", - dialogControl = "LSM30_Font", - order = 4, - name = L["Aura Font"], - desc = L["The font that the aura icons and aurabar will use."], - values = AceGUIWidgetLSMlists.font, - set = function(key, value) - MOD:ChangeDBVar(value, key[#key]); - MOD:RefreshAllUnitMedia() - end, - }, - auraFontOutline = { - order = 5, - name = L["Aura Font Outline"], - desc = L["Set the aura icons and aurabar font outline."], - type = "select", - values = { - ["NONE"] = L["None"], ["OUTLINE"] = "OUTLINE", ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", ["THICKOUTLINE"] = "THICKOUTLINE" - }, - set = function(key, value) - MOD:ChangeDBVar(value, key[#key]); - MOD:RefreshAllUnitMedia() - end, - }, - auraFontSize = { - order = 6, - name = L["Aura Font Size"], - desc = L["Set the font size for aura icons and aurabars."], - type = "range", - min = 6, - max = 22, - step = 1, - set = function(key, value) - MOD:ChangeDBVar(value, key[#key]); - MOD:RefreshAllUnitMedia() - end, - }, - } - }, - allColorsGroup = { - order = 5, - type = "group", - guiInline = true, - name = L["Colors"], - args = { - healthGroup = { - order = 9, - type = "group", guiInline = true, - name = HEALTH, - args = { - healthclass = { + type = "group", + guiInline = true, + name = L["General"], + args = { + disableBlizzard = { order = 1, + name = L["Disable Blizzard"], + desc = L["Disables the blizzard party/raid frames."], type = "toggle", - name = L["Class Health"], - desc = L["Color health by classcolor or reaction."], get = function(key) - return SV.db.SVUnit[key[#key]] + return SV.db.SVUnit.disableBlizzard end, set = function(key, value) - MOD:ChangeDBVar(value, key[#key]); - MOD:RefreshUnitFrames() + MOD:ChangeDBVar(value, "disableBlizzard"); + SV:StaticPopup_Show("RL_CLIENT") end }, - colorhealthbyvalue = { + fastClickTarget = { order = 2, - type = "toggle", - name = L["Health By Value"], - desc = L["Color health by amount remaining."], - get = function(key) - return SV.db.SVUnit[key[#key]] - end, - set = function(key, value) - MOD:ChangeDBVar(value, key[#key]); - MOD:RefreshUnitFrames() - end + name = L["Fast Clicks"], + desc = L["Immediate mouse-click-targeting"], + type = "toggle" }, - classbackdrop = { + debuffHighlighting = { order = 3, - type = "toggle", - name = L["Class Backdrop"], - desc = L["Color the health backdrop by class or reaction."], - get = function(key) - return SV.db.SVUnit[key[#key]] - end, - set = function(key, value) - MOD:ChangeDBVar(value, key[#key]); - MOD:RefreshUnitFrames() - end + name = L["Debuff Highlight"], + desc = L["Color the unit if there is a debuff that can be dispelled by your class."], + type = "toggle" }, - forceHealthColor = { + xrayFocus = { order = 4, - type = "toggle", - name = L["Overlay Health Color"], - desc = L["Force custom health color when using portrait overlays."], - get = function(key) - return SV.db.SVUnit[key[#key]] - end, + name = L["X-Ray Specs"], + desc = L["Use handy graphics to focus the current target, or clear the current focus"], + type = "toggle" + }, + OORAlpha = { + order = 5, + name = L["Range Fading"], + desc = L["The transparency of units that are out of range."], + type = "range", + min = 0, + max = 1, + step = 0.01, + width = "full", set = function(key, value) MOD:ChangeDBVar(value, key[#key]); - MOD:RefreshUnitFrames() end }, - overlayAnimation = { - order = 5, - type = "toggle", - name = L["Overlay Animations"], - desc = L["Toggle health animations on portrait overlays."], - get = function(key) - return SV.db.SVUnit[key[#key]] - end, + groupOORAlpha = { + order = 6, + name = L["Group Range Fading"], + desc = L["The transparency of group units that are out of range."], + type = "range", + min = 0, + max = 1, + step = 0.01, + width = "full", set = function(key, value) MOD:ChangeDBVar(value, key[#key]); - MOD:RefreshUnitFrames() end }, - health = { - order = 7, - type = "color", - name = L["Health"], - get = function(key) - local color = SV.db.media.unitframes.health - return color[1],color[2],color[3] - end, - set = function(key, rValue, gValue, bValue) - SV.db.media.unitframes.health = {rValue, gValue, bValue} - MOD:RefreshAllUnitMedia() - end, - }, - tapped = { - order = 8, - type = "color", - name = L["Tapped"], - get = function(key) - local color = SV.db.media.unitframes.tapped - return color[1],color[2],color[3] - end, - set = function(key, rValue, gValue, bValue) - SV.db.media.unitframes.tapped = {rValue, gValue, bValue} - MOD:RefreshAllUnitMedia() - end, - }, - disconnected = { - order = 9, - type = "color", - name = L["Disconnected"], - get = function(key) - local color = SV.db.media.unitframes.disconnected - return color[1],color[2],color[3] - end, - set = function(key, rValue, gValue, bValue) - SV.db.media.unitframes.disconnected = {rValue, gValue, bValue} - MOD:RefreshAllUnitMedia() - end, - } } }, - powerGroup = { - order = 10, + backgroundGroup = { + order = 2, type = "group", guiInline = true, - name = L["Powers"], + name = "Unit Backgrounds (3D Portraits Only)", + get = function(key) + return SV.db.media.textures[key[#key]] + end, + set = function(key, value) + SV.db.media.textures[key[#key]] = value + SV:RefreshEverything(true) + end, args = { - powerclass = { - order = 0, - type = "toggle", - name = L["Class Power"], - desc = L["Color power by classcolor or reaction."], - get = function(key) - return SV.db.SVUnit[key[#key]] - end, - set = function(key, value) - MOD:ChangeDBVar(value, key[#key]); - MOD:RefreshUnitFrames() - end - }, - MANA = { + unitlarge = { + type = "select", + dialogControl = "LSM30_Background", order = 2, - name = MANA, - type = "color", - get = function(key) - local color = SV.db.media.unitframes.power["MANA"] - return color[1],color[2],color[3] - end, - set = function(key, rValue, gValue, bValue) - SV.db.media.unitframes.power["MANA"] = {rValue, gValue, bValue} - MOD:RefreshAllUnitMedia() - end, + name = "Unit Background", + values = AceGUIWidgetLSMlists.background, }, - RAGE = { + unitsmall = { + type = "select", + dialogControl = "LSM30_Background", order = 3, - name = RAGE, - type = "color", - get = function(key) - local color = SV.db.media.unitframes.power["RAGE"] - return color[1],color[2],color[3] - end, - set = function(key, rValue, gValue, bValue) - SV.db.media.unitframes.power["RAGE"] = {rValue, gValue, bValue} - MOD:RefreshAllUnitMedia() - end, - }, - FOCUS = { - order = 4, - name = FOCUS, - type = "color", - get = function(key) - local color = SV.db.media.unitframes.power["FOCUS"] - return color[1],color[2],color[3] - end, - set = function(key, rValue, gValue, bValue) - SV.db.media.unitframes.power["FOCUS"] = {rValue, gValue, bValue} - MOD:RefreshAllUnitMedia() - end, - }, - ENERGY = { - order = 5, - name = ENERGY, - type = "color", - get = function(key) - local color = SV.db.media.unitframes.power["ENERGY"] - return color[1],color[2],color[3] - end, - set = function(key, rValue, gValue, bValue) - SV.db.media.unitframes.power["ENERGY"] = {rValue, gValue, bValue} - MOD:RefreshAllUnitMedia() - end, - }, - RUNIC_POWER = { - order = 6, - name = RUNIC_POWER, - type = "color", - get = function(key) - local color = SV.db.media.unitframes.power["RUNIC_POWER"] - return color[1],color[2],color[3] - end, - set = function(key, rValue, gValue, bValue) - SV.db.media.unitframes.power["RUNIC_POWER"] = {rValue, gValue, bValue} - MOD:RefreshAllUnitMedia() - end, + name = "Small Unit Background", + values = AceGUIWidgetLSMlists.background, } } }, - castBars = { - order = 11, + barGroup = { + order = 3, type = "group", guiInline = true, - name = L["Castbar"], + name = L["Bars"], + get = function(key) + return SV.db.SVUnit[key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key]); + MOD:RefreshAllUnitMedia() + end, args = { - castClassColor = { - order = 0, + smoothbars = { type = "toggle", - name = L["Class Castbars"], - desc = L["Color castbars by the class or reaction type of the unit."], - get = function(key) - return SV.db.SVUnit[key[#key]] - end, - set = function(key, value) - MOD:ChangeDBVar(value, key[#key]); - MOD:RefreshUnitFrames() - end + order = 1, + name = L["Smooth Bars"], + desc = L["Bars will transition smoothly."] }, - casting = { + statusbar = { + type = "select", + dialogControl = "LSM30_Statusbar", + order = 2, + name = L["StatusBar Texture"], + desc = L["Main statusbar texture."], + values = AceGUIWidgetLSMlists.statusbar + }, + auraBarStatusbar = { + type = "select", + dialogControl = "LSM30_Statusbar", order = 3, - name = L["Interruptable"], - type = "color", - get = function(key) - local color = SV.db.media.unitframes.casting - return color[1],color[2],color[3] - end, - set = function(key, rValue, gValue, bValue) - SV.db.media.unitframes.casting = {rValue, gValue, bValue} - MOD:RefreshAllUnitMedia() - end, - }, - spark = { - order = 4, - name = "Spark Color", - type = "color", - get = function(key) - local color = SV.db.media.unitframes.spark - return color[1],color[2],color[3] - end, - set = function(key, rValue, gValue, bValue) - SV.db.media.unitframes.spark = {rValue, gValue, bValue} - MOD:RefreshAllUnitMedia() - end, - }, - interrupt = { - order = 5, - name = L["Non-Interruptable"], - type = "color", - get = function(key) - local color = SV.db.media.unitframes.interrupt - return color[1],color[2],color[3] - end, - set = function(key, rValue, gValue, bValue) - SV.db.media.unitframes.interrupt = {rValue, gValue, bValue} - MOD:RefreshAllUnitMedia() - end, - } + name = L["AuraBar Texture"], + desc = L["Main statusbar texture."], + values = AceGUIWidgetLSMlists.statusbar + }, } - }, - auraBars = { - order = 11, + }, + fontGroup = { + order = 4, type = "group", guiInline = true, - name = L["Aura Bars"], + name = L["Fonts"], args = { - auraBarByType = { + fontConfigButton = { order = 1, - name = L["By Type"], - desc = L["Color aurabar debuffs by type."], - type = "toggle", - get = function(key) - return SV.db.SVUnit[key[#key]] - end, - set = function(key, value) - MOD:ChangeDBVar(value, key[#key]); - MOD:RefreshUnitFrames() - end - }, - auraBarShield = { - order = 2, - name = L["Color Shield Buffs"], - desc = L["Color all buffs that reduce incoming damage."], - type = "toggle", - get = function(key) - return SV.db.SVUnit[key[#key]] - end, - set = function(key, value) - MOD:ChangeDBVar(value, key[#key]); - MOD:RefreshUnitFrames() - end + name = L["Set UnitFrame Fonts"], + type = "execute", func = function() ns:SetToFontConfig("UnitFrame") end + }, + } + }, + allColorsGroup = { + order = 5, + type = "group", + guiInline = true, + name = L["Colors"], + args = { + healthGroup = { + order = 9, + type = "group", guiInline = true, + name = HEALTH, + args = { + forceHealthColor = { + order = 1, + type = "toggle", + name = L["Overlay Health Color"], + desc = L["Allow custom health colors when using portrait overlays."], + get = function(key) + return SV.db.SVUnit[key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key]); + MOD:RefreshUnitFrames() + end + }, + overlayAnimation = { + order = 2, + type = "toggle", + name = L["Overlay Animations"], + desc = L["Toggle health animations on portrait overlays."], + get = function(key) + return SV.db.SVUnit[key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key]); + MOD:RefreshUnitFrames() + end + }, + health = { + order = 3, + type = "color", + name = L["Health"], + get = function(key) + local color = SV.db.media.unitframes.health + return color[1],color[2],color[3] + end, + set = function(key, rValue, gValue, bValue) + SV.db.media.unitframes.health = {rValue, gValue, bValue} + MOD:RefreshAllUnitMedia() + end, + }, + tapped = { + order = 4, + type = "color", + name = L["Tapped"], + get = function(key) + local color = SV.db.media.unitframes.tapped + return color[1],color[2],color[3] + end, + set = function(key, rValue, gValue, bValue) + SV.db.media.unitframes.tapped = {rValue, gValue, bValue} + MOD:RefreshAllUnitMedia() + end, + }, + disconnected = { + order = 5, + type = "color", + name = L["Disconnected"], + get = function(key) + local color = SV.db.media.unitframes.disconnected + return color[1],color[2],color[3] + end, + set = function(key, rValue, gValue, bValue) + SV.db.media.unitframes.disconnected = {rValue, gValue, bValue} + MOD:RefreshAllUnitMedia() + end, + } + } }, - buff_bars = { + powerGroup = { order = 10, - name = L["Buffs"], - type = "color", - get = function(key) - local color = SV.db.media.unitframes.buff_bars - return color[1],color[2],color[3] - end, - set = function(key, rValue, gValue, bValue) - SV.db.media.unitframes.buff_bars = {rValue, gValue, bValue} - MOD:RefreshAllUnitMedia() - end, + type = "group", + guiInline = true, + name = L["Powers"], + args = { + MANA = { + order = 1, + name = MANA, + type = "color", + get = function(key) + local color = SV.db.media.unitframes.power["MANA"] + return color[1],color[2],color[3] + end, + set = function(key, rValue, gValue, bValue) + SV.db.media.unitframes.power["MANA"] = {rValue, gValue, bValue} + MOD:RefreshAllUnitMedia() + end, + }, + RAGE = { + order = 2, + name = RAGE, + type = "color", + get = function(key) + local color = SV.db.media.unitframes.power["RAGE"] + return color[1],color[2],color[3] + end, + set = function(key, rValue, gValue, bValue) + SV.db.media.unitframes.power["RAGE"] = {rValue, gValue, bValue} + MOD:RefreshAllUnitMedia() + end, + }, + FOCUS = { + order = 3, + name = FOCUS, + type = "color", + get = function(key) + local color = SV.db.media.unitframes.power["FOCUS"] + return color[1],color[2],color[3] + end, + set = function(key, rValue, gValue, bValue) + SV.db.media.unitframes.power["FOCUS"] = {rValue, gValue, bValue} + MOD:RefreshAllUnitMedia() + end, + }, + ENERGY = { + order = 4, + name = ENERGY, + type = "color", + get = function(key) + local color = SV.db.media.unitframes.power["ENERGY"] + return color[1],color[2],color[3] + end, + set = function(key, rValue, gValue, bValue) + SV.db.media.unitframes.power["ENERGY"] = {rValue, gValue, bValue} + MOD:RefreshAllUnitMedia() + end, + }, + RUNIC_POWER = { + order = 5, + name = RUNIC_POWER, + type = "color", + get = function(key) + local color = SV.db.media.unitframes.power["RUNIC_POWER"] + return color[1],color[2],color[3] + end, + set = function(key, rValue, gValue, bValue) + SV.db.media.unitframes.power["RUNIC_POWER"] = {rValue, gValue, bValue} + MOD:RefreshAllUnitMedia() + end, + } + } }, - debuff_bars = { + castBars = { order = 11, - name = L["Debuffs"], - type = "color", - get = function(key) - local color = SV.db.media.unitframes.debuff_bars - return color[1],color[2],color[3] - end, - set = function(key, rValue, gValue, bValue) - SV.db.media.unitframes.debuff_bars = {rValue, gValue, bValue} - MOD:RefreshAllUnitMedia() - end, - }, - shield_bars = { - order = 12, - name = L["Shield Buffs Color"], - type = "color", - get = function(key) - local color = SV.db.media.unitframes.shield_bars - return color[1],color[2],color[3] - end, - set = function(key, rValue, gValue, bValue) - SV.db.media.unitframes.shield_bars = {rValue, gValue, bValue} - MOD:RefreshAllUnitMedia() - end, - } - } - }, - predict = { - order = 12, - name = L["Heal Prediction"], - type = "group", - args = { - personal = { - order = 1, - name = L["Personal"], - type = "color", - hasAlpha = true, - get = function(key) - local color = SV.db.media.unitframes.predict["personal"] - return color[1],color[2],color[3] - end, - set = function(key, rValue, gValue, bValue) - SV.db.media.unitframes.predict["personal"] = {rValue, gValue, bValue} - MOD:RefreshUnitFrames() - end, + type = "group", + guiInline = true, + name = L["Castbar"], + args = { + castClassColor = { + order = 0, + type = "toggle", + name = L["Class Castbars"], + desc = L["Color castbars by the class or reaction type of the unit."], + get = function(key) + return SV.db.SVUnit[key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key]); + MOD:RefreshUnitFrames() + end + }, + casting = { + order = 3, + name = L["Interruptable"], + type = "color", + get = function(key) + local color = SV.db.media.unitframes.casting + return color[1],color[2],color[3] + end, + set = function(key, rValue, gValue, bValue) + SV.db.media.unitframes.casting = {rValue, gValue, bValue} + MOD:RefreshAllUnitMedia() + end, + }, + spark = { + order = 4, + name = "Spark Color", + type = "color", + get = function(key) + local color = SV.db.media.unitframes.spark + return color[1],color[2],color[3] + end, + set = function(key, rValue, gValue, bValue) + SV.db.media.unitframes.spark = {rValue, gValue, bValue} + MOD:RefreshAllUnitMedia() + end, + }, + interrupt = { + order = 5, + name = L["Non-Interruptable"], + type = "color", + get = function(key) + local color = SV.db.media.unitframes.interrupt + return color[1],color[2],color[3] + end, + set = function(key, rValue, gValue, bValue) + SV.db.media.unitframes.interrupt = {rValue, gValue, bValue} + MOD:RefreshAllUnitMedia() + end, + } + } }, - others = { - order = 2, - name = L["Others"], - type = "color", - hasAlpha = true, - get = function(key) - local color = SV.db.media.unitframes.predict["others"] - return color[1],color[2],color[3] - end, - set = function(key, rValue, gValue, bValue) - SV.db.media.unitframes.predict["others"] = {rValue, gValue, bValue} - MOD:RefreshUnitFrames() - end, + auraBars = { + order = 11, + type = "group", + guiInline = true, + name = L["Aura Bars"], + args = { + auraBarByType = { + order = 1, + name = L["By Type"], + desc = L["Color aurabar debuffs by type."], + type = "toggle", + get = function(key) + return SV.db.SVUnit[key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key]); + MOD:RefreshUnitFrames() + end + }, + auraBarShield = { + order = 2, + name = L["Color Shield Buffs"], + desc = L["Color all buffs that reduce incoming damage."], + type = "toggle", + get = function(key) + return SV.db.SVUnit[key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key]); + MOD:RefreshUnitFrames() + end + }, + buff_bars = { + order = 10, + name = L["Buffs"], + type = "color", + get = function(key) + local color = SV.db.media.unitframes.buff_bars + return color[1],color[2],color[3] + end, + set = function(key, rValue, gValue, bValue) + SV.db.media.unitframes.buff_bars = {rValue, gValue, bValue} + MOD:RefreshAllUnitMedia() + end, + }, + debuff_bars = { + order = 11, + name = L["Debuffs"], + type = "color", + get = function(key) + local color = SV.db.media.unitframes.debuff_bars + return color[1],color[2],color[3] + end, + set = function(key, rValue, gValue, bValue) + SV.db.media.unitframes.debuff_bars = {rValue, gValue, bValue} + MOD:RefreshAllUnitMedia() + end, + }, + shield_bars = { + order = 12, + name = L["Shield Buffs Color"], + type = "color", + get = function(key) + local color = SV.db.media.unitframes.shield_bars + return color[1],color[2],color[3] + end, + set = function(key, rValue, gValue, bValue) + SV.db.media.unitframes.shield_bars = {rValue, gValue, bValue} + MOD:RefreshAllUnitMedia() + end, + } + } }, - absorbs = { - order = 2, - name = L["Absorbs"], - type = "color", - hasAlpha = true, - get = function(key) - local color = SV.db.media.unitframes.predict["absorbs"] - return color[1],color[2],color[3] - end, - set = function(key, rValue, gValue, bValue) - SV.db.media.unitframes.predict["absorbs"] = {rValue, gValue, bValue} - MOD:RefreshUnitFrames() - end, + predict = { + order = 12, + name = L["Heal Prediction"], + type = "group", + args = { + personal = { + order = 1, + name = L["Personal"], + type = "color", + hasAlpha = true, + get = function(key) + local color = SV.db.media.unitframes.predict["personal"] + return color[1],color[2],color[3] + end, + set = function(key, rValue, gValue, bValue) + SV.db.media.unitframes.predict["personal"] = {rValue, gValue, bValue} + MOD:RefreshUnitFrames() + end, + }, + others = { + order = 2, + name = L["Others"], + type = "color", + hasAlpha = true, + get = function(key) + local color = SV.db.media.unitframes.predict["others"] + return color[1],color[2],color[3] + end, + set = function(key, rValue, gValue, bValue) + SV.db.media.unitframes.predict["others"] = {rValue, gValue, bValue} + MOD:RefreshUnitFrames() + end, + }, + absorbs = { + order = 2, + name = L["Absorbs"], + type = "color", + hasAlpha = true, + get = function(key) + local color = SV.db.media.unitframes.predict["absorbs"] + return color[1],color[2],color[3] + end, + set = function(key, rValue, gValue, bValue) + SV.db.media.unitframes.predict["absorbs"] = {rValue, gValue, bValue} + MOD:RefreshUnitFrames() + end, + } + } } } } } - } - } + }, + }, } - } + }, } \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/focus.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/focus.lua index 8c4364f..a991088 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/focus.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/focus.lua @@ -39,105 +39,109 @@ local _, ns = ... ################################################################################################## ################################################################################################## ]] -SV.Options.args.SVUnit.args.focus = { +SV.Options.args.SVUnit.args.commonGroup.args.focus = { name = L["Focus"], type = "group", order = 9, - childGroups = "tab", + childGroups = "select", get = function(l)return SV.db.SVUnit["focus"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "focus");MOD:SetUnitFrame("focus")end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, - resetSettings = {type = "execute", order = 2, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("focus");SV.Mentalo:Reset("Focus Frame")end}, - tabGroups = { + resetSettings = {type = "execute", order = 2, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("focus");SV.Mentalo:Reset("Focus Frame")end}, + spacer1 = { order = 3, + name = "", + type = "description", + width = "full", + }, + spacer2 = { + order = 4, + name = "", + type = "description", + width = "full", + }, + commonGroup = { + order = 5, type = "group", - name = L["Unit Options"], - childGroups = "tree", + name = L["General Settings"], args = { - commonGroup = { + baseGroup = { order = 1, type = "group", - name = L["General Settings"], + guiInline = true, + name = L["Base Settings"], args = { - baseGroup = { + showAuras = { order = 1, - type = "group", - guiInline = true, - name = L["Base Settings"], - args = { - showAuras = { - order = 1, - type = "execute", - name = L["Show Auras"], - func = function()local U = SVUI_Focus;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("focus")end - }, - rangeCheck = { - order = 2, - name = L["Range Check"], - desc = L["Check if you are in range to cast spells on this specific unit."], - type = "toggle" - }, - predict = { - order = 3, - name = L["Heal Prediction"], - desc = L["Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."], - type = "toggle" - }, - hideonnpc = { - type = "toggle", - order = 4, - name = L["Text Toggle On NPC"], - desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], - get = function(l)return SV.db.SVUnit["focus"]["power"].hideonnpc end, - set = function(l, m)SV.db.SVUnit["focus"]["power"].hideonnpc = m;MOD:SetUnitFrame("focus")end - }, - threatEnabled = { - type = "toggle", - order = 5, - name = L["Show Threat"] - } - } + type = "execute", + name = L["Show Auras"], + func = function()local U = SVUI_Focus;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("focus")end }, - sizeGroup = { + rangeCheck = { order = 2, - guiInline = true, - type = "group", - name = L["Size Settings"], - args = { - width = { - order = 1, - name = L["Width"], - type = "range", - width = "full", - min = 50, - max = 500, - step = 1, - }, - height = { - order = 2, - name = L["Height"], - type = "range", - width = "full", - min = 10, - max = 250, - step = 1 - }, - } + name = L["Range Check"], + desc = L["Check if you are in range to cast spells on this specific unit."], + type = "toggle" + }, + predict = { + order = 3, + name = L["Heal Prediction"], + desc = L["Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."], + type = "toggle" + }, + hideonnpc = { + type = "toggle", + order = 4, + name = L["Text Toggle On NPC"], + desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], + get = function(l)return SV.db.SVUnit["focus"]["power"].hideonnpc end, + set = function(l, m)SV.db.SVUnit["focus"]["power"].hideonnpc = m;MOD:SetUnitFrame("focus")end + }, + threatEnabled = { + type = "toggle", + order = 5, + name = L["Show Threat"] + } + } + }, + sizeGroup = { + order = 2, + guiInline = true, + type = "group", + name = L["Size Settings"], + args = { + width = { + order = 1, + name = L["Width"], + type = "range", + width = "full", + min = 50, + max = 500, + step = 1, + }, + height = { + order = 2, + name = L["Height"], + type = "range", + width = "full", + min = 10, + max = 250, + step = 1 }, } - }, - misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "focus"), - health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "focus"), - power = ns:SetPowerConfigGroup(nil, MOD.SetUnitFrame, "focus"), - name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "focus"), - buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetUnitFrame, "focus"), - debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetUnitFrame, "focus"), - castbar = ns:SetCastbarConfigGroup(MOD.SetUnitFrame, "focus"), - aurabar = ns:SetAurabarConfigGroup(false, MOD.SetUnitFrame, "focus"), - icons = ns:SetIconConfigGroup(MOD.SetUnitFrame, "focus") + }, } - } + }, + misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "focus"), + health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "focus"), + power = ns:SetPowerConfigGroup(nil, MOD.SetUnitFrame, "focus"), + name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "focus"), + buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetUnitFrame, "focus"), + debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetUnitFrame, "focus"), + castbar = ns:SetCastbarConfigGroup(MOD.SetUnitFrame, "focus"), + aurabar = ns:SetAurabarConfigGroup(false, MOD.SetUnitFrame, "focus"), + icons = ns:SetIconConfigGroup(MOD.SetUnitFrame, "focus") } } --[[ @@ -145,76 +149,80 @@ SV.Options.args.SVUnit.args.focus = { ################################################################################################## ################################################################################################## ]] -SV.Options.args.SVUnit.args.focustarget = { +SV.Options.args.SVUnit.args.commonGroup.args.focustarget = { name = L["FocusTarget"], type = "group", order = 10, - childGroups = "tab", + childGroups = "select", get = function(l)return SV.db.SVUnit["focustarget"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "focustarget");MOD:SetUnitFrame("focustarget")end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, resetSettings = {type = "execute", order = 2, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("focustarget")SV.Mentalo:Reset("FocusTarget Frame")end}, - tabGroups = { + spacer1 = { order = 3, + name = "", + type = "description", + width = "full", + }, + spacer2 = { + order = 4, + name = "", + type = "description", + width = "full", + }, + commonGroup = { + order = 5, type = "group", - name = L["Unit Options"], - childGroups = "tree", + name = L["General Settings"], args = { - commonGroup = { + baseGroup = { order = 1, type = "group", - name = L["General Settings"], + guiInline = true, + name = L["Base Settings"], args = { - baseGroup = { + showAuras = { order = 1, - type = "group", - guiInline = true, - name = L["Base Settings"], - args = { - showAuras = { - order = 1, - type = "execute", - name = L["Show Auras"], - func = function() - if(SVUI_FocusTarget.forceShowAuras == true) then - SVUI_FocusTarget.forceShowAuras = nil - else - SVUI_FocusTarget.forceShowAuras = true - end - MOD:SetUnitFrame("focustarget") - end - }, - spacer1 = { - order = 2, - type = "description", - name = "", - }, - rangeCheck = {order = 3, name = L["Range Check"], desc = L["Check if you are in range to cast spells on this specific unit."], type = "toggle"}, - hideonnpc = {type = "toggle", order = 4, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], get = function(l)return SV.db.SVUnit["focustarget"]["power"].hideonnpc end, set = function(l, m)SV.db.SVUnit["focustarget"]["power"].hideonnpc = m;MOD:SetUnitFrame("focustarget")end}, - threatEnabled = {type = "toggle", order = 5, name = L["Show Threat"]} - } - }, - sizeGroup = { - order = 2, - guiInline = true, - type = "group", - name = L["Size Settings"], - args = { - width = {order = 1, width = "full", name = L["Width"], type = "range", min = 50, max = 500, step = 1}, - height = {order = 2, width = "full", name = L["Height"], type = "range", min = 10, max = 250, step = 1}, - } + type = "execute", + name = L["Show Auras"], + func = function() + if(SVUI_FocusTarget.forceShowAuras == true) then + SVUI_FocusTarget.forceShowAuras = nil + else + SVUI_FocusTarget.forceShowAuras = true + end + MOD:SetUnitFrame("focustarget") + end + }, + spacer1 = { + order = 2, + type = "description", + name = "", }, + rangeCheck = {order = 3, name = L["Range Check"], desc = L["Check if you are in range to cast spells on this specific unit."], type = "toggle"}, + hideonnpc = {type = "toggle", order = 4, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], get = function(l)return SV.db.SVUnit["focustarget"]["power"].hideonnpc end, set = function(l, m)SV.db.SVUnit["focustarget"]["power"].hideonnpc = m;MOD:SetUnitFrame("focustarget")end}, + threatEnabled = {type = "toggle", order = 5, name = L["Show Threat"]} + } + }, + sizeGroup = { + order = 2, + guiInline = true, + type = "group", + name = L["Size Settings"], + args = { + width = {order = 1, width = "full", name = L["Width"], type = "range", min = 50, max = 500, step = 1}, + height = {order = 2, width = "full", name = L["Height"], type = "range", min = 10, max = 250, step = 1}, } }, - misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "focustarget"), - health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "focustarget"), - power = ns:SetPowerConfigGroup(false, MOD.SetUnitFrame, "focustarget"), - name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "focustarget"), - buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetUnitFrame, "focustarget"), - debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetUnitFrame, "focustarget"), - icons = ns:SetIconConfigGroup(MOD.SetUnitFrame, "focustarget") } - } + }, + misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "focustarget"), + health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "focustarget"), + power = ns:SetPowerConfigGroup(false, MOD.SetUnitFrame, "focustarget"), + name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "focustarget"), + buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetUnitFrame, "focustarget"), + debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetUnitFrame, "focustarget"), + icons = ns:SetIconConfigGroup(MOD.SetUnitFrame, "focustarget") } } \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/grid.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/grid.lua deleted file mode 100644 index 67fba04..0000000 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/grid.lua +++ /dev/null @@ -1,157 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local pairs = _G.pairs; -local tinsert = _G.tinsert; -local table = _G.table; ---[[ TABLE METHODS ]]-- -local tsort = table.sort; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = _G["SVUI"]; -local L = SV.L; -local MOD = SV.SVUnit -if(not MOD) then return end -local _, ns = ... ---[[ -################################################################################################## -################################################################################################## -################################################################################################## -]] -SV.Options.args.SVUnit.args.grid = { - name = L["Grid"], - type = "group", - order = 1200, - childGroups = "tab", - args = { - configureToggle = { - order = 1, - type = "execute", - name = L["Display Frames"], - func = function()MOD:ViewGroupFrames(_G["SVUI_Raid"], _G["SVUI_Raid"].forceShow ~= true or nil, "raid")end, - }, - gridCommon = { - order = 2, - type = "group", - guiInline = true, - name = L["General Settings"], - get = function(key) - return SV.db.SVUnit.grid[key[#key]] - end, - set = function(key, value) - MOD:ChangeDBVar(value, key[#key] , "grid"); - MOD:RefreshUnitFrames(); - end, - args = { - enable = { - order = 1, - name = L["Enable Grid Mode"], - desc = L["Converts party, party pet, raid, raid pet, tank and assist frames into symmetrical squares. Ideal for healers."], - type = "toggle" - }, - shownames = { - order = 2, - name = L["Show Grid Names"], - desc = L["Grid frames will show name texts."], - type = "toggle", - set = function(key, value) - if(SV.db.SVUnit.grid.size < 30) then MOD:ChangeDBVar(30, "size", "grid"); end - MOD:ChangeDBVar(value, "shownames", "grid"); - MOD:RefreshUnitFrames(); - end - }, - size = { - order = 3, - name = L["Grid Size"], - desc = L["The universal size of grid squares."], - type = "range", - min = 10, - max = 70, - step = 1, - width = "full" - }, - } - }, - gridAllowed = { - order = 3, - type = "group", - guiInline = true, - name = L["Allowed Frames"], - get = function(key) - return SV.db.SVUnit.grid[key[#key]] - end, - set = function(key, value) - MOD:ChangeDBVar(value, key[#key] , "grid"); - MOD:RefreshUnitFrames(); - end, - args = { - party = { - type = 'toggle', - order = 1, - name = L['Party Grid'], - desc = L['If grid-mode is enabled, these units will be changed.'], - get = function(key) return SV.db.SVUnit.party.gridAllowed end, - set = function(key, value) SV.db.SVUnit.party.gridAllowed = value; MOD:SetGroupFrame() end, - }, - partypets = { - type = 'toggle', - order = 2, - name = L['Party Pets Grid'], - desc = L['If grid-mode is enabled, these units will be changed.'], - get = function(key) return SV.db.SVUnit.party.petsGroup.gridAllowed end, - set = function(key, value) SV.db.SVUnit.party.petsGroup.gridAllowed = value; MOD:SetGroupFrame() end, - }, - partytargets = { - type = 'toggle', - order = 3, - name = L['Party Targets Grid'], - desc = L['If grid-mode is enabled, these units will be changed.'], - get = function(key) return SV.db.SVUnit.party.targetsGroup.gridAllowed end, - set = function(key, value) SV.db.SVUnit.party.targetsGroup.gridAllowed = value; MOD:SetGroupFrame() end, - }, - raid = { - type = 'toggle', - order = 4, - name = L['Raid Grid'], - desc = L['If grid-mode is enabled, these units will be changed.'], - get = function(key) return SV.db.SVUnit.raid.gridAllowed end, - set = function(key, value) SV.db.SVUnit.raid.gridAllowed = value; MOD:SetGroupFrame("raid"); end, - }, - raidpet = { - type = 'toggle', - order = 7, - name = L['Raid Pet Grid'], - desc = L['If grid-mode is enabled, these units will be changed.'], - get = function(key) return SV.db.SVUnit.raidpet.gridAllowed end, - set = function(key, value) SV.db.SVUnit.raidpet.gridAllowed = value; MOD:SetGroupFrame() end, - }, - } - }, - } -} ---[[ -################################################################################################## -################################################################################################## -################################################################################################## -]] \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/other.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/other.lua index 543e445..ff4426c 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/other.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/other.lua @@ -39,68 +39,72 @@ local _, ns = ... ################################################################################################## ################################################################################################## ]] -SV.Options.args.SVUnit.args.boss = { +SV.Options.args.SVUnit.args.commonGroup.args.boss = { name = L["Boss"], type = "group", order = 1000, - childGroups = "tab", + childGroups = "select", get = function(l)return SV.db.SVUnit["boss"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "boss");MOD:SetEnemyFrame("boss", MAX_BOSS_FRAMES)end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, displayFrames = {type = "execute", order = 2, name = L["Display Frames"], desc = L["Force the frames to show, they will act as if they are the player frame."], func = function()MOD:ViewEnemyFrames("boss", 4)end}, - resetSettings = {type = "execute", order = 3, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("boss")SV.Mentalo:Reset("Boss Frames")end}, - tabGroups = { - order = 3, + resetSettings = {type = "execute", order = 3, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("boss")SV.Mentalo:Reset("Boss Frames")end}, + spacer1 = { + order = 4, + name = "", + type = "description", + width = "full", + }, + spacer2 = { + order = 5, + name = "", + type = "description", + width = "full", + }, + commonGroup = { + order = 6, type = "group", - name = L["Unit Options"], - childGroups = "tree", + name = L["General Settings"], args = { - commonGroup = { + baseGroup = { order = 1, type = "group", - name = L["General Settings"], + guiInline = true, + name = L["Base Settings"], args = { - baseGroup = { - order = 1, - type = "group", - guiInline = true, - name = L["Base Settings"], - args = { - showBy = {order = 1, name = L["Growth Direction"], type = "select", values = {["UP"] = L["Up"], ["DOWN"] = L["Down"]}}, - spacer1 = { - order = 2, - type = "description", - name = "", - }, - rangeCheck = {order = 3, name = L["Range Check"], desc = L["Check if you are in range to cast spells on this specific unit."], type = "toggle"}, - hideonnpc = {type = "toggle", order = 4, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], get = function(l)return SV.db.SVUnit["boss"]["power"].hideonnpc end, set = function(l, m)SV.db.SVUnit["boss"]["power"].hideonnpc = m;MOD:SetEnemyFrame("boss")end}, - threatEnabled = {type = "toggle", order = 5, name = L["Show Threat"]} - } - }, - sizeGroup = { - order = 2, - guiInline = true, - type = "group", - name = L["Size Settings"], - args = { - width = {order = 1, width = "full", name = L["Width"], type = "range", min = 50, max = 500, step = 1}, - height = {order = 2, width = "full", name = L["Height"], type = "range", min = 10, max = 250, step = 1}, - } + showBy = {order = 1, name = L["Growth Direction"], type = "select", values = {["UP"] = L["Up"], ["DOWN"] = L["Down"]}}, + spacer1 = { + order = 2, + type = "description", + name = "", }, + rangeCheck = {order = 3, name = L["Range Check"], desc = L["Check if you are in range to cast spells on this specific unit."], type = "toggle"}, + hideonnpc = {type = "toggle", order = 4, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], get = function(l)return SV.db.SVUnit["boss"]["power"].hideonnpc end, set = function(l, m)SV.db.SVUnit["boss"]["power"].hideonnpc = m;MOD:SetEnemyFrame("boss")end}, + threatEnabled = {type = "toggle", order = 5, name = L["Show Threat"]} + } + }, + sizeGroup = { + order = 2, + guiInline = true, + type = "group", + name = L["Size Settings"], + args = { + width = {order = 1, width = "full", name = L["Width"], type = "range", min = 50, max = 500, step = 1}, + height = {order = 2, width = "full", name = L["Height"], type = "range", min = 10, max = 250, step = 1}, } }, - misc = ns:SetMiscConfigGroup(false, MOD.SetEnemyFrame, "boss", MAX_BOSS_FRAMES), - health = ns:SetHealthConfigGroup(false, MOD.SetEnemyFrame, "boss", MAX_BOSS_FRAMES), - power = ns:SetPowerConfigGroup(false, MOD.SetEnemyFrame, "boss", MAX_BOSS_FRAMES), - name = ns:SetNameConfigGroup(MOD.SetEnemyFrame, "boss", MAX_BOSS_FRAMES), - portrait = ns:SetPortraitConfigGroup(MOD.SetEnemyFrame, "boss", MAX_BOSS_FRAMES), - buffs = ns:SetAuraConfigGroup(true, "buffs", false, MOD.SetEnemyFrame, "boss", MAX_BOSS_FRAMES), - debuffs = ns:SetAuraConfigGroup(true, "debuffs", false, MOD.SetEnemyFrame, "boss", MAX_BOSS_FRAMES), - castbar = ns:SetCastbarConfigGroup(MOD.SetEnemyFrame, "boss", MAX_BOSS_FRAMES), - icons = ns:SetIconConfigGroup(MOD.SetEnemyFrame, "boss", MAX_BOSS_FRAMES) } - } + }, + misc = ns:SetMiscConfigGroup(false, MOD.SetEnemyFrame, "boss", MAX_BOSS_FRAMES), + health = ns:SetHealthConfigGroup(false, MOD.SetEnemyFrame, "boss", MAX_BOSS_FRAMES), + power = ns:SetPowerConfigGroup(false, MOD.SetEnemyFrame, "boss", MAX_BOSS_FRAMES), + name = ns:SetNameConfigGroup(MOD.SetEnemyFrame, "boss", MAX_BOSS_FRAMES), + portrait = ns:SetPortraitConfigGroup(MOD.SetEnemyFrame, "boss", MAX_BOSS_FRAMES), + buffs = ns:SetAuraConfigGroup(true, "buffs", false, MOD.SetEnemyFrame, "boss", MAX_BOSS_FRAMES), + debuffs = ns:SetAuraConfigGroup(true, "debuffs", false, MOD.SetEnemyFrame, "boss", MAX_BOSS_FRAMES), + castbar = ns:SetCastbarConfigGroup(MOD.SetEnemyFrame, "boss", MAX_BOSS_FRAMES), + icons = ns:SetIconConfigGroup(MOD.SetEnemyFrame, "boss", MAX_BOSS_FRAMES) } } --[[ @@ -108,170 +112,174 @@ SV.Options.args.SVUnit.args.boss = { ################################################################################################## ################################################################################################## ]] -SV.Options.args.SVUnit.args.arena = { +SV.Options.args.SVUnit.args.commonGroup.args.arena = { name = L["Arena"], type = "group", order = 1100, - childGroups = "tab", + childGroups = "select", get = function(l)return SV.db.SVUnit["arena"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "arena");MOD:SetEnemyFrame("arena", 5)end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, displayFrames = {type = "execute", order = 2, name = L["Display Frames"], desc = L["Force the frames to show, they will act as if they are the player frame."], func = function()MOD:ViewEnemyFrames("arena", 5)end}, - resetSettings = {type = "execute", order = 3, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("arena")SV.Mentalo:Reset("Arena Frames")end}, - tabGroups = { - order = 3, + resetSettings = {type = "execute", order = 3, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("arena")SV.Mentalo:Reset("Arena Frames")end}, + spacer1 = { + order = 4, + name = "", + type = "description", + width = "full", + }, + spacer2 = { + order = 5, + name = "", + type = "description", + width = "full", + }, + commonGroup = { + order = 6, type = "group", - name = L["Unit Options"], - childGroups = "tree", + name = L["General Settings"], args = { - commonGroup = { + baseGroup = { order = 1, type = "group", - name = L["General Settings"], + guiInline = true, + name = L["Base Settings"], + args = { + showBy = {order = 1, name = L["Growth Direction"], type = "select", values = {["UP"] = L["Up"], ["DOWN"] = L["Down"]}}, + spacer1 = { + order = 2, + type = "description", + name = "", + }, + predict = {order = 3, name = L["Heal Prediction"], desc = L["Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."], type = "toggle"}, + rangeCheck = {order = 4, name = L["Range Check"], desc = L["Check if you are in range to cast spells on this specific unit."], type = "toggle"}, + hideonnpc = {type = "toggle", order = 5, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], get = function(l)return SV.db.SVUnit["arena"]["power"].hideonnpc end, set = function(l, m)SV.db.SVUnit["arena"]["power"].hideonnpc = m;MOD:SetEnemyFrame("arena")end}, + threatEnabled = {type = "toggle", order = 6, name = L["Show Threat"]} + } + }, + sizeGroup = { + order = 2, + guiInline = true, + type = "group", + name = L["Size Settings"], args = { - baseGroup = { + width = {order = 1, width = "full", name = L["Width"], type = "range", min = 50, max = 500, step = 1}, + height = {order = 2, width = "full", name = L["Height"], type = "range", min = 10, max = 250, step = 1}, + } + }, + pvp = { + order = 3, + guiInline = true, + type = "group", + name = L["PVP Indicators"], + args = { + enable = { + type = "toggle", order = 1, - type = "group", - guiInline = true, - name = L["Base Settings"], - args = { - showBy = {order = 1, name = L["Growth Direction"], type = "select", values = {["UP"] = L["Up"], ["DOWN"] = L["Down"]}}, - spacer1 = { - order = 2, - type = "description", - name = "", - }, - predict = {order = 3, name = L["Heal Prediction"], desc = L["Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."], type = "toggle"}, - rangeCheck = {order = 4, name = L["Range Check"], desc = L["Check if you are in range to cast spells on this specific unit."], type = "toggle"}, - hideonnpc = {type = "toggle", order = 5, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], get = function(l)return SV.db.SVUnit["arena"]["power"].hideonnpc end, set = function(l, m)SV.db.SVUnit["arena"]["power"].hideonnpc = m;MOD:SetEnemyFrame("arena")end}, - threatEnabled = {type = "toggle", order = 6, name = L["Show Threat"]} - } + name = L["Enable"], + get = function(l)return SV.db.SVUnit.arena.pvp.enable end, + set = function(l, m)MOD:ChangeDBVar(m, "enable", "arena", "pvp");MOD:SetEnemyFrame("arena", 5)end, }, - sizeGroup = { - order = 2, + trinketGroup = { + order = 2, guiInline = true, type = "group", - name = L["Size Settings"], + name = L["Trinkets"], + get = function(l)return SV.db.SVUnit.arena.pvp[l[#l]]end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "arena", "pvp");MOD:SetEnemyFrame("arena", 5)end, + disabled = function() return not SV.db.SVUnit.arena.pvp.enable end, args = { - width = {order = 1, width = "full", name = L["Width"], type = "range", min = 50, max = 500, step = 1}, - height = {order = 2, width = "full", name = L["Height"], type = "range", min = 10, max = 250, step = 1}, + trinketPosition = { + type = "select", + order = 1, + name = L["Position"], + values = { + ["LEFT"] = L["Left"], + ["RIGHT"] = L["Right"] + } + }, + trinketSize = { + order = 2, + type = "range", + name = L["Size"], + min = 10, + max = 60, + step = 1 + }, + trinketX = { + order = 3, + type = "range", + name = L["xOffset"], + min = -60, + max = 60, + step = 1 + }, + trinketY = { + order = 4, + type = "range", + name = L["yOffset"], + min = -60, + max = 60, + step = 1 + } } }, - pvp = { + specGroup = { order = 3, guiInline = true, type = "group", - name = L["PVP Indicators"], + name = L["Enemy Specs"], + get = function(l)return SV.db.SVUnit.arena.pvp[l[#l]]end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "arena", "pvp");MOD:SetEnemyFrame("arena", 5)end, + disabled = function() return not SV.db.SVUnit.arena.pvp.enable end, args = { - enable = { - type = "toggle", + specPosition = { + type = "select", order = 1, - name = L["Enable"], - get = function(l)return SV.db.SVUnit.arena.pvp.enable end, - set = function(l, m)MOD:ChangeDBVar(m, "enable", "arena", "pvp");MOD:SetEnemyFrame("arena", 5)end, - }, - trinketGroup = { - order = 2, - guiInline = true, - type = "group", - name = L["Trinkets"], - get = function(l)return SV.db.SVUnit.arena.pvp[l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "arena", "pvp");MOD:SetEnemyFrame("arena", 5)end, - disabled = function() return not SV.db.SVUnit.arena.pvp.enable end, - args = { - trinketPosition = { - type = "select", - order = 1, - name = L["Position"], - values = { - ["LEFT"] = L["Left"], - ["RIGHT"] = L["Right"] - } - }, - trinketSize = { - order = 2, - type = "range", - name = L["Size"], - min = 10, - max = 60, - step = 1 - }, - trinketX = { - order = 3, - type = "range", - name = L["xOffset"], - min = -60, - max = 60, - step = 1 - }, - trinketY = { - order = 4, - type = "range", - name = L["yOffset"], - min = -60, - max = 60, - step = 1 - } + name = L["Position"], + values = { + ["LEFT"] = L["Left"], + ["RIGHT"] = L["Right"] } }, - specGroup = { - order = 3, - guiInline = true, - type = "group", - name = L["Enemy Specs"], - get = function(l)return SV.db.SVUnit.arena.pvp[l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "arena", "pvp");MOD:SetEnemyFrame("arena", 5)end, - disabled = function() return not SV.db.SVUnit.arena.pvp.enable end, - args = { - specPosition = { - type = "select", - order = 1, - name = L["Position"], - values = { - ["LEFT"] = L["Left"], - ["RIGHT"] = L["Right"] - } - }, - specSize = { - order = 2, - type = "range", - name = L["Size"], - min = 10, - max = 60, - step = 1 - }, - specX = { - order = 3, - type = "range", - name = L["xOffset"], - min = -60, - max = 60, - step = 1 - }, - specY = { - order = 4, - type = "range", - name = L["yOffset"], - min = -60, - max = 60, - step = 1 - } - } + specSize = { + order = 2, + type = "range", + name = L["Size"], + min = 10, + max = 60, + step = 1 + }, + specX = { + order = 3, + type = "range", + name = L["xOffset"], + min = -60, + max = 60, + step = 1 + }, + specY = { + order = 4, + type = "range", + name = L["yOffset"], + min = -60, + max = 60, + step = 1 } } - }, + } } }, - misc = ns:SetMiscConfigGroup(false, MOD.SetEnemyFrame, "arena", 5), - health = ns:SetHealthConfigGroup(false, MOD.SetEnemyFrame, "arena", 5), - power = ns:SetPowerConfigGroup(false, MOD.SetEnemyFrame, "arena", 5), - name = ns:SetNameConfigGroup(MOD.SetEnemyFrame, "arena", 5), - buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetEnemyFrame, "arena", 5), - debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetEnemyFrame, "arena", 5), - castbar = ns:SetCastbarConfigGroup(MOD.SetEnemyFrame, "arena", 5) } - } + }, + misc = ns:SetMiscConfigGroup(false, MOD.SetEnemyFrame, "arena", 5), + health = ns:SetHealthConfigGroup(false, MOD.SetEnemyFrame, "arena", 5), + power = ns:SetPowerConfigGroup(false, MOD.SetEnemyFrame, "arena", 5), + name = ns:SetNameConfigGroup(MOD.SetEnemyFrame, "arena", 5), + buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetEnemyFrame, "arena", 5), + debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetEnemyFrame, "arena", 5), + castbar = ns:SetCastbarConfigGroup(MOD.SetEnemyFrame, "arena", 5) } } --[[ @@ -279,7 +287,7 @@ SV.Options.args.SVUnit.args.arena = { ################################################################################################## ################################################################################################## ]] -SV.Options.args.SVUnit.args.tank = { +SV.Options.args.SVUnit.args.commonGroup.args.tank = { name = L["Tank"], type = "group", order = 1200, @@ -295,15 +303,34 @@ SV.Options.args.SVUnit.args.tank = { name = L["Unit Options"], childGroups = "tree", args = { - commonGroup = { + general = { order = 1, + name = L["General Layout"], type = "group", - name = L["General Settings"], + guiInline = true, args = { - width = {order = 2, name = L["Width"], type = "range", min = 50, max = 500, step = 1}, - height = {order = 3, name = L["Height"], type = "range", min = 10, max = 250, step = 1} + enable = { + order = 1, + name = L["Enable Grid Mode"], + desc = L["Converts frames into symmetrical squares. Ideal for healers."], + type = "toggle", + get = function(key) return SV.db.SVUnit["tank"].grid.enable end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], "tank", "grid"); + MOD:SetGroupFrame("tank"); + SV.Options.args.SVUnit.args.commonGroup.args.tank.args.tabGroups.args.sizing = ns:SetSizeConfigGroup(value, "tank"); + end, + }, + invertGroupingOrder = { + order = 2, + type = "toggle", + name = L["Invert Grouping Order"], + desc = L["Enabling this inverts the grouping order."], + disabled = function() return not SV.db.SVUnit["tank"].customSorting end, + }, } - }, + }, + sizing = ns:SetSizeConfigGroup(SV.db.SVUnit.tank.grid.enable, "tank"), targetsGroup = { order = 2, type = "group", @@ -329,7 +356,7 @@ SV.Options.args.SVUnit.args.tank = { ################################################################################################## ################################################################################################## ]] -SV.Options.args.SVUnit.args.assist = { +SV.Options.args.SVUnit.args.commonGroup.args.assist = { name = L["Assist"], type = "group", order = 1300, @@ -345,17 +372,36 @@ SV.Options.args.SVUnit.args.assist = { name = L["Unit Options"], childGroups = "tree", args = { - commonGroup = { + general = { order = 1, + name = L["General Layout"], type = "group", - name = L["General Settings"], + guiInline = true, args = { - width = {order = 2, name = L["Width"], type = "range", min = 50, max = 500, step = 1}, - height = {order = 3, name = L["Height"], type = "range", min = 10, max = 250, step = 1} + enable = { + order = 1, + name = L["Enable Grid Mode"], + desc = L["Converts frames into symmetrical squares. Ideal for healers."], + type = "toggle", + get = function(key) return SV.db.SVUnit["assist"].grid.enable end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], "assist", "grid"); + MOD:SetGroupFrame("assist"); + SV.Options.args.SVUnit.args.commonGroup.args.assist.args.tabGroups.args.sizing = ns:SetSizeConfigGroup(value, "assist"); + end, + }, + invertGroupingOrder = { + order = 2, + type = "toggle", + name = L["Invert Grouping Order"], + desc = L["Enabling this inverts the grouping order."], + disabled = function() return not SV.db.SVUnit["assist"].customSorting end, + }, } - }, + }, + sizing = ns:SetSizeConfigGroup(SV.db.SVUnit.assist.grid.enable, "assist"), targetsGroup = { - order = 4, + order = 2, type = "group", name = L["Assist Target"], guiInline = true, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/party.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/party.lua index 6f795fa..ba5c2a3 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/party.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/party.lua @@ -35,14 +35,13 @@ local MOD = SV.SVUnit if(not MOD) then return end local _, ns = ... -SV.Options.args.SVUnit.args.party = { +SV.Options.args.SVUnit.args.commonGroup.args.party = { name = L['Party'], type = 'group', order = 11, - childGroups = "tab", - get = function(l)return - SV.db.SVUnit['party'][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party");MOD:SetGroupFrame('party')end, + childGroups = "select", + get = function(l) return SV.db.SVUnit['party'][l[#l]] end, + set = function(l, m) MOD:ChangeDBVar(m, l[#l], "party"); MOD:SetGroupFrame('party') end, args = { enable = { type = 'toggle', @@ -63,363 +62,333 @@ SV.Options.args.SVUnit.args.party = { name = L['Restore Defaults'], func = function(l, m)MOD:ResetUnitOptions('party')SV.Mentalo:Reset('Party Frames')end, }, - tabGroups= { - order=3, - type='group', - name=L['Unit Options'], - childGroups="tree", - args= { - common = { - order = 4, - type = 'group', - name = L['General'], + spacer1 = { + order = 4, + name = "", + type = "description", + width = "full", + }, + spacer2 = { + order = 5, + name = "", + type = "description", + width = "full", + }, + general = { + order = 6, + type = "group", + name = L["General Settings"], + args = { + commonGroup = { + order = 1, + name = L["Basic Options"], + type = "group", + guiInline = true, args = { - showPlayer = { + rangeCheck = { order = 1, - type = 'toggle', - name = L['Display Player'], - desc = L['When true, always show player in party frames'], - get = function(l)return SV.db.SVUnit.party.showPlayer end, - set = function(l, m) MOD:ChangeDBVar(m, l[#l], "party"); MOD:SetGroupFrame("party", true) end, + type = "toggle", + name = L["Range Check"], + desc = L["Check if you are in range to cast spells on this specific unit."], }, - hideonnpc = { - type = 'toggle', + predict = { order = 2, - name = L['Text Toggle On NPC'], - desc = L['Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point.'], - get = function(l)return SV.db.SVUnit['party']['power'].hideonnpc end, - set = function(l, m)SV.db.SVUnit['party']['power'].hideonnpc = m;MOD:SetGroupFrame('party')end, - }, - rangeCheck = { - order = 3, - name = L["Range Check"], - desc = L["Check if you are in range to cast spells on this specific unit."], - type = "toggle", - }, - gps = { - order = 4, - name = "GPS Tracking", - desc = "Show an arrow giving the direction and distance to the frames unit.", type = "toggle", + name = L["Heal Prediction"], + desc = L["Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."], }, - predict = { - order = 5, - name = L['Heal Prediction'], - desc = L['Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals.'], - type = 'toggle', - }, threatEnabled = { - type = 'toggle', - order = 6, - name = L['Show Threat'], - }, - colorOverride = { - order = 7, - name = L['Class Color Override'], - desc = L['Override the default class color setting.'], - type = 'select', - values = { - ['USE_DEFAULT'] = L['Use Default'], - ['FORCE_ON'] = L['Force On'], - ['FORCE_OFF'] = L['Force Off'], - }, - }, - positionsGroup = { - order = 100, - name = L['Size and Positions'], - type = 'group', - guiInline = true, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party");MOD:SetGroupFrame('party', true)end, + order = 3, + type = "toggle", + name = L["Show Threat"], + }, + } + }, + layoutGroup = { + order = 2, + name = L["Layout Options"], + type = "group", + guiInline = true, + set = function(key, value) MOD:ChangeDBVar(value, key[#key], "party"); MOD:SetGroupFrame("party", true) end, + args = { + common = { + order = 1, + name = L["General Layout"], + type = "group", + guiInline = true, args = { - width = { - order = 1, - name = L['Width'], - type = 'range', - min = 10, - max = 500, - step = 1, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party");MOD:SetGroupFrame('party')end, + enable = { + order = 1, + name = L["Enable Grid Mode"], + desc = L["Converts frames into symmetrical squares. Ideal for healers."], + type = "toggle", + get = function(key) return SV.db.SVUnit["party"].grid.enable end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], "party", "grid"); + MOD:SetGroupFrame("party", true); + SV.Options.args.SVUnit.args.commonGroup.args.party.args.tabGroups.args.general.args.layoutGroup.args.sizing = ns:SetSizeConfigGroup(value, "party"); + end, }, - height = { + invertGroupingOrder = { order = 2, - name = L['Height'], - type = 'range', - min = 10, - max = 500, - step = 1, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party");MOD:SetGroupFrame('party')end, + type = "toggle", + name = L["Invert Grouping Order"], + desc = L["Enabling this inverts the grouping order."], + disabled = function() return not SV.db.SVUnit["party"].customSorting end, }, - spacer = { - order = 3, - name = '', - type = 'description', + } + }, + sizing = ns:SetSizeConfigGroup(SV.db.SVUnit.party.grid.enable, "party"), + sorting = { + order = 3, + name = L["Sorting"], + type = "group", + guiInline = true, + args = { + gRowCol = { + order = 1, + type = "range", + name = L["Groups Per Row / Column"], + min = 1, + max = 8, + step = 1, width = 'full', + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], "party"); + MOD:SetGroupFrame("party") + if(_G["SVUI_Raid"] and _G["SVUI_Raid"].isForced) then + MOD:ViewGroupFrames(_G["SVUI_Raid"]) + MOD:ViewGroupFrames(_G["SVUI_Raid"], true) + end + end, }, showBy = { - order = 4, - name = L['Growth Direction'], - desc = L['Growth direction from the first unitframe.'], - type = 'select', + order = 2, + name = L["Growth Direction"], + desc = L["Growth direction from the first unitframe."], + type = "select", values = { - DOWN_RIGHT = format(L['%s and then %s'], L['Down'], L['Right']), - DOWN_LEFT = format(L['%s and then %s'], L['Down'], L['Left']), - UP_RIGHT = format(L['%s and then %s'], L['Up'], L['Right']), - UP_LEFT = format(L['%s and then %s'], L['Up'], L['Left']), - RIGHT_DOWN = format(L['%s and then %s'], L['Right'], L['Down']), - RIGHT_UP = format(L['%s and then %s'], L['Right'], L['Up']), - LEFT_DOWN = format(L['%s and then %s'], L['Left'], L['Down']), - LEFT_UP = format(L['%s and then %s'], L['Left'], L['Up']), - }, - }, - wrapXOffset = { - order = 5, - type = 'range', - name = L['Horizontal Spacing'], - min = 0, - max = 50, - step = 1, - }, - wrapYOffset = { - order = 6, - type = 'range', - name = L['Vertical Spacing'], - min = 0, - max = 50, - step = 1, - }, - }, - }, - sortingGroup = { - order = 300, - type = 'group', - guiInline = true, - name = L['Grouping & Sorting'], - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party");MOD:SetGroupFrame('party', true)end, - args = { + DOWN_RIGHT = format(L["%s and then %s"], L["Down"], L["Right"]), + DOWN_LEFT = format(L["%s and then %s"], L["Down"], L["Left"]), + UP_RIGHT = format(L["%s and then %s"], L["Up"], L["Right"]), + UP_LEFT = format(L["%s and then %s"], L["Up"], L["Left"]), + RIGHT_DOWN = format(L["%s and then %s"], L["Right"], L["Down"]), + RIGHT_UP = format(L["%s and then %s"], L["Right"], L["Up"]), + LEFT_DOWN = format(L["%s and then %s"], L["Left"], L["Down"]), + LEFT_UP = format(L["%s and then %s"], L["Left"], L["Up"]), + }, + }, sortMethod = { - order = 1, - name = L['Group By'], - desc = L['Set the order that the group will sort.'], - type = 'select', + order = 3, + name = L["Group By"], + desc = L["Set the order that the group will sort."], + type = "select", values = { ["CLASS"] = CLASS, ["ROLE"] = ROLE.."(Tanks, Healers, DPS)", ["ROLE_TDH"] = ROLE.."(Tanks, DPS, Healers)", ["ROLE_HDT"] = ROLE.."(Healers, DPS, Tanks)", ["ROLE_HTD"] = ROLE.."(Healers, Tanks, DPS)", - ["NAME"] = NAME, + ["NAME"] = NAME, + ["MTMA"] = L["Main Tanks / Main Assist"], ["GROUP"] = GROUP, - }, - }, + }, + }, sortDir = { - order = 2, - name = L['Sort Direction'], - desc = L['Defines the sort order of the selected sort method.'], - type = 'select', + order = 4, + name = L["Sort Direction"], + desc = L["Defines the sort order of the selected sort method."], + type = "select", values = { - ['ASC'] = L['Ascending'], - ['DESC'] = L['Descending'], - }, + ["ASC"] = L["Ascending"], + ["DESC"] = L["Descending"], + }, }, - spacer = { - order = 3, - type = 'description', - width = 'full', - name = ' ', - }, - invertGroupingOrder = { - order = 4, - name = L['Invert Grouping Order'], - desc = L['Enabling this inverts the sorting order.'], - disabled = function()return not SV.db.SVUnit['party'].customSorting end, - type = 'toggle', - }, - }, - }, - - }, + } + } + }, + }, + } + }, + auraWatch = { + order = 600, + type = 'group', + name = L['Aura Watch'], + get = function(l)return + SV.db.SVUnit['party']['auraWatch'][l[#l]]end, + set = function(l, m) MOD:ChangeDBVar(m, l[#l], "party", "auraWatch"); MOD:SetGroupFrame('party')end, + args = { + enable = { + type = 'toggle', + name = L['Enable'], + order = 1, + }, + size = { + type = 'range', + name = L['Size'], + desc = L['Size of the indicator icon.'], + order = 2, + min = 4, + max = 15, + step = 1, + }, + configureButton = { + type = 'execute', + name = L['Configure Auras'], + func = function()ns:SetToFilterConfig('BuffWatch')end, + order = 3, }, - auraWatch = { - order = 600, - type = 'group', - name = L['Aura Watch'], - get = function(l)return - SV.db.SVUnit['party']['auraWatch'][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party", "auraWatch");MOD:SetGroupFrame('party')end, - args = { - enable = { - type = 'toggle', - name = L['Enable'], - order = 1, - }, - size = { - type = 'range', - name = L['Size'], - desc = L['Size of the indicator icon.'], - order = 2, - min = 4, - max = 15, - step = 1, - }, - configureButton = { - type = 'execute', - name = L['Configure Auras'], - func = function()ns:SetToFilterConfig('BuffWatch')end, - order = 3, - }, - }, + }, + }, + misc = ns:SetMiscConfigGroup(true, MOD.SetGroupFrame, 'party'), + health = ns:SetHealthConfigGroup(true, MOD.SetGroupFrame, 'party'), + power = ns:SetPowerConfigGroup(false, MOD.SetGroupFrame, 'party'), + name = ns:SetNameConfigGroup(MOD.SetGroupFrame, 'party'), + portrait = ns:SetPortraitConfigGroup(MOD.SetGroupFrame, 'party'), + buffs = ns:SetAuraConfigGroup(true, 'buffs', true, MOD.SetGroupFrame, 'party'), + debuffs = ns:SetAuraConfigGroup(true, 'debuffs', true, MOD.SetGroupFrame, 'party'), + petsGroup = { + order = 800, + type = 'group', + name = L['Party Pets'], + get = function(l)return SV.db.SVUnit['party']['petsGroup'][l[#l]]end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party", "petsGroup");MOD:SetGroupFrame('party')end, + args = { + enable = { + type = 'toggle', + name = L['Enable'], + order = 1, }, - misc = ns:SetMiscConfigGroup(true, MOD.SetGroupFrame, 'party'), - health = ns:SetHealthConfigGroup(true, MOD.SetGroupFrame, 'party'), - power = ns:SetPowerConfigGroup(false, MOD.SetGroupFrame, 'party'), - name = ns:SetNameConfigGroup(MOD.SetGroupFrame, 'party'), - portrait = ns:SetPortraitConfigGroup(MOD.SetGroupFrame, 'party'), - buffs = ns:SetAuraConfigGroup(true, 'buffs', true, MOD.SetGroupFrame, 'party'), - debuffs = ns:SetAuraConfigGroup(true, 'debuffs', true, MOD.SetGroupFrame, 'party'), - petsGroup = { - order = 800, - type = 'group', - name = L['Party Pets'], - get = function(l)return SV.db.SVUnit['party']['petsGroup'][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party", "petsGroup");MOD:SetGroupFrame('party')end, - args = { - enable = { - type = 'toggle', - name = L['Enable'], - order = 1, - }, - width = { - order = 3, - name = L['Width'], - type = 'range', - min = 10, - max = 500, - step = 1, - }, - height = { - order = 4, - name = L['Height'], - type = 'range', - min = 10, - max = 250, - step = 1, - }, - anchorPoint = { - type = 'select', - order = 5, - name = L['Anchor Point'], - desc = L['What point to anchor to the frame you set to attach to.'], - values = {TOPLEFT='TOPLEFT',LEFT='LEFT',BOTTOMLEFT='BOTTOMLEFT',RIGHT='RIGHT',TOPRIGHT='TOPRIGHT',BOTTOMRIGHT='BOTTOMRIGHT',CENTER='CENTER',TOP='TOP',BOTTOM='BOTTOM'}, - }, - xOffset = { - order = 6, - type = 'range', - name = L['xOffset'], - desc = L['An X offset (in pixels) to be used when anchoring new frames.'], - min = - 500, - max = 500, - step = 1, - }, - yOffset = { - order = 7, - type = 'range', - name = L['yOffset'], - desc = L['An Y offset (in pixels) to be used when anchoring new frames.'], - min = - 500, - max = 500, - step = 1, - }, - name_length = { - order = 8, - name = L["Name Length"], - desc = L["TEXT_FORMAT_DESC"], - type = "range", - width = "full", - min = 1, - max = 30, - step = 1, - set = function(key, value) - MOD:ChangeDBVar(value, key[#key], "party", "petsGroup"); - local tag = "[name:" .. value .. "]"; - MOD:ChangeDBVar(tag, "tags", "party", "petsGroup"); - end, - } - }, + width = { + order = 3, + name = L['Width'], + type = 'range', + min = 10, + max = 500, + step = 1, }, - targetsGroup = { - order = 900, - type = 'group', - name = L['Party Targets'], - get = function(l)return - SV.db.SVUnit['party']['targetsGroup'][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party", "targetsGroup");MOD:SetGroupFrame('party')end, - args = { - enable = { - type = 'toggle', - name = L['Enable'], - order = 1, - }, - width = { - order = 3, - name = L['Width'], - type = 'range', - min = 10, - max = 500, - step = 1, - }, - height = { - order = 4, - name = L['Height'], - type = 'range', - min = 10, - max = 250, - step = 1, - }, - anchorPoint = { - type = 'select', - order = 5, - name = L['Anchor Point'], - desc = L['What point to anchor to the frame you set to attach to.'], - values = {TOPLEFT='TOPLEFT',LEFT='LEFT',BOTTOMLEFT='BOTTOMLEFT',RIGHT='RIGHT',TOPRIGHT='TOPRIGHT',BOTTOMRIGHT='BOTTOMRIGHT',CENTER='CENTER',TOP='TOP',BOTTOM='BOTTOM'}, - }, - xOffset = { - order = 6, - type = 'range', - name = L['xOffset'], - desc = L['An X offset (in pixels) to be used when anchoring new frames.'], - min = - 500, - max = 500, - step = 1, - }, - yOffset = { - order = 7, - type = 'range', - name = L['yOffset'], - desc = L['An Y offset (in pixels) to be used when anchoring new frames.'], - min = - 500, - max = 500, - step = 1, - }, - name_length = { - order = 8, - name = L["Name Length"], - desc = L["TEXT_FORMAT_DESC"], - type = "range", - width = "full", - min = 1, - max = 30, - step = 1, - set = function(key, value) - MOD:ChangeDBVar(value, key[#key], "party", "targetsGroup"); - local tag = "[name:" .. value .. "]"; - MOD:ChangeDBVar(tag, "tags", "party", "targetsGroup"); - end, - } - }, + height = { + order = 4, + name = L['Height'], + type = 'range', + min = 10, + max = 250, + step = 1, }, - icons = ns:SetIconConfigGroup(MOD.SetGroupFrame, 'party') - } - } + anchorPoint = { + type = 'select', + order = 5, + name = L['Anchor Point'], + desc = L['What point to anchor to the frame you set to attach to.'], + values = {TOPLEFT='TOPLEFT',LEFT='LEFT',BOTTOMLEFT='BOTTOMLEFT',RIGHT='RIGHT',TOPRIGHT='TOPRIGHT',BOTTOMRIGHT='BOTTOMRIGHT',CENTER='CENTER',TOP='TOP',BOTTOM='BOTTOM'}, + }, + xOffset = { + order = 6, + type = 'range', + name = L['xOffset'], + desc = L['An X offset (in pixels) to be used when anchoring new frames.'], + min = - 500, + max = 500, + step = 1, + }, + yOffset = { + order = 7, + type = 'range', + name = L['yOffset'], + desc = L['An Y offset (in pixels) to be used when anchoring new frames.'], + min = - 500, + max = 500, + step = 1, + }, + name_length = { + order = 8, + name = L["Name Length"], + desc = L["TEXT_FORMAT_DESC"], + type = "range", + width = "full", + min = 1, + max = 30, + step = 1, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], "party", "petsGroup"); + local tag = "[name:" .. value .. "]"; + MOD:ChangeDBVar(tag, "tags", "party", "petsGroup"); + end, + } + }, + }, + targetsGroup = { + order = 900, + type = 'group', + name = L['Party Targets'], + get = function(l)return + SV.db.SVUnit['party']['targetsGroup'][l[#l]]end, + set = function(l, m) MOD:ChangeDBVar(m, l[#l], "party", "targetsGroup"); MOD:SetGroupFrame('party') end, + args = { + enable = { + type = 'toggle', + name = L['Enable'], + order = 1, + }, + width = { + order = 3, + name = L['Width'], + type = 'range', + min = 10, + max = 500, + step = 1, + }, + height = { + order = 4, + name = L['Height'], + type = 'range', + min = 10, + max = 250, + step = 1, + }, + anchorPoint = { + type = 'select', + order = 5, + name = L['Anchor Point'], + desc = L['What point to anchor to the frame you set to attach to.'], + values = {TOPLEFT='TOPLEFT',LEFT='LEFT',BOTTOMLEFT='BOTTOMLEFT',RIGHT='RIGHT',TOPRIGHT='TOPRIGHT',BOTTOMRIGHT='BOTTOMRIGHT',CENTER='CENTER',TOP='TOP',BOTTOM='BOTTOM'}, + }, + xOffset = { + order = 6, + type = 'range', + name = L['xOffset'], + desc = L['An X offset (in pixels) to be used when anchoring new frames.'], + min = - 500, + max = 500, + step = 1, + }, + yOffset = { + order = 7, + type = 'range', + name = L['yOffset'], + desc = L['An Y offset (in pixels) to be used when anchoring new frames.'], + min = - 500, + max = 500, + step = 1, + }, + name_length = { + order = 8, + name = L["Name Length"], + desc = L["TEXT_FORMAT_DESC"], + type = "range", + width = "full", + min = 1, + max = 30, + step = 1, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], "party", "targetsGroup"); + local tag = "[name:" .. value .. "]"; + MOD:ChangeDBVar(tag, "tags", "party", "targetsGroup"); + end, + } + }, + }, + icons = ns:SetIconConfigGroup(MOD.SetGroupFrame, 'party') }, } \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/pet.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/pet.lua index 1a649ab..7b7b937 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/pet.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/pet.lua @@ -39,111 +39,115 @@ local _, ns = ... ################################################################################################## ################################################################################################## ]] -SV.Options.args.SVUnit.args.pet = { +SV.Options.args.SVUnit.args.commonGroup.args.pet = { name = L["Pet"], type = "group", order = 4, - childGroups = "tab", + childGroups = "select", get = function(l)return SV.db.SVUnit["pet"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "pet");MOD:SetUnitFrame("pet")end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, resetSettings = {type = "execute", order = 2, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("pet")SV.Mentalo:Reset("Pet Frame")end}, - tabGroups = { + spacer1 = { order = 3, + name = "", + type = "description", + width = "full", + }, + spacer2 = { + order = 4, + name = "", + type = "description", + width = "full", + }, + commonGroup = { + order = 5, type = "group", - name = L["Unit Options"], - childGroups = "tree", + name = L["General Settings"], args = { - commonGroup = { + showAuras = { order = 1, + type = "execute", + name = L["Show Auras"], + func = function()local U = SVUI_Pet;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("pet")end + }, + miscGroup = { + order = 2, type = "group", - name = L["General Settings"], + guiInline = true, + name = L["Base Settings"], args = { - showAuras = { - order = 1, - type = "execute", - name = L["Show Auras"], - func = function()local U = SVUI_Pet;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("pet")end - }, - miscGroup = { + rangeCheck = { order = 2, - type = "group", - guiInline = true, - name = L["Base Settings"], - args = { - rangeCheck = { - order = 2, - name = L["Range Check"], - desc = L["Check if you are in range to cast spells on this specific unit."], - type = "toggle" - }, - predict = { - order = 3, - name = L["Heal Prediction"], - desc = L["Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."], - type = "toggle" - }, - hideonnpc = { - type = "toggle", - order = 4, - name = L["Text Toggle On NPC"], - desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], - get = function(l)return SV.db.SVUnit["pet"]["power"].hideonnpc end, - set = function(l, m)SV.db.SVUnit["pet"]["power"].hideonnpc = m;MOD:SetUnitFrame("pet")end - }, - threatEnabled = { - type = "toggle", - order = 5, - name = L["Show Threat"] - }, - } - }, - scaleGroup = { - order = 6, - type = "group", - guiInline = true, - name = L["Frame Size"], - args = { - width = {order = 1, name = L["Width"], width = "full", type = "range", min = 50, max = 500, step = 1}, - height = {order = 2, name = L["Height"], width = "full", type = "range", min = 10, max = 250, step = 1}, - } + name = L["Range Check"], + desc = L["Check if you are in range to cast spells on this specific unit."], + type = "toggle" + }, + predict = { + order = 3, + name = L["Heal Prediction"], + desc = L["Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."], + type = "toggle" + }, + hideonnpc = { + type = "toggle", + order = 4, + name = L["Text Toggle On NPC"], + desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], + get = function(l)return SV.db.SVUnit["pet"]["power"].hideonnpc end, + set = function(l, m)SV.db.SVUnit["pet"]["power"].hideonnpc = m;MOD:SetUnitFrame("pet")end }, - watchGroup = { - order = 8, - type = "group", - guiInline = true, - name = L["Aura Watch"], - get = function(l)return SV.db.SVUnit["pet"]["auraWatch"][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "pet", "auraWatch");MOD:SetUnitFrame("pet")end, - args = { - enable = { - type = "toggle", - name = L["Enable"], - order = 1 - }, - size = { - type = "range", - name = L["Size"], - desc = L["Size of the indicator icon."], - order = 2, - min = 4, - max = 15, - step = 1 - } - } - }, - }, + threatEnabled = { + type = "toggle", + order = 5, + name = L["Show Threat"] + }, + } }, - misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "pet"), - health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "pet"), - power = ns:SetPowerConfigGroup(false, MOD.SetUnitFrame, "pet"), - portrait = ns:SetPortraitConfigGroup(MOD.SetUnitFrame, "pet"), - name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "pet"), - buffs = ns:SetAuraConfigGroup(true, "buffs", false, MOD.SetUnitFrame, "pet"), - debuffs = ns:SetAuraConfigGroup(true, "debuffs", false, MOD.SetUnitFrame, "pet") - } - } + scaleGroup = { + order = 6, + type = "group", + guiInline = true, + name = L["Frame Size"], + args = { + width = {order = 1, name = L["Width"], width = "full", type = "range", min = 50, max = 500, step = 1}, + height = {order = 2, name = L["Height"], width = "full", type = "range", min = 10, max = 250, step = 1}, + } + }, + watchGroup = { + order = 8, + type = "group", + guiInline = true, + name = L["Aura Watch"], + get = function(l)return SV.db.SVUnit["pet"]["auraWatch"][l[#l]]end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "pet", "auraWatch");MOD:SetUnitFrame("pet")end, + args = { + enable = { + type = "toggle", + name = L["Enable"], + order = 1 + }, + size = { + type = "range", + name = L["Size"], + desc = L["Size of the indicator icon."], + order = 2, + min = 4, + max = 15, + step = 1 + } + } + }, + }, + }, + misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "pet"), + health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "pet"), + power = ns:SetPowerConfigGroup(false, MOD.SetUnitFrame, "pet"), + portrait = ns:SetPortraitConfigGroup(MOD.SetUnitFrame, "pet"), + name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "pet"), + buffs = ns:SetAuraConfigGroup(true, "buffs", false, MOD.SetUnitFrame, "pet"), + debuffs = ns:SetAuraConfigGroup(true, "debuffs", false, MOD.SetUnitFrame, "pet") } } --[[ @@ -151,103 +155,83 @@ SV.Options.args.SVUnit.args.pet = { ################################################################################################## ################################################################################################## ]] -SV.Options.args.SVUnit.args.pettarget = { +SV.Options.args.SVUnit.args.commonGroup.args.pettarget = { name = L["Pet Target"], - type = "group", order = 5, - childGroups = "tab", + type = "group", + order = 5, + childGroups = "select", get = function(l)return SV.db.SVUnit["pettarget"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "pettarget");MOD:SetUnitFrame("pettarget")end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, - resetSettings = {type = "execute", order = 2, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("pettarget")SV.Mentalo:Reset("PetTarget Frame")end}, - tabGroups = { + resetSettings = {type = "execute", order = 2, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("pettarget")SV.Mentalo:Reset("PetTarget Frame")end}, + spacer1 = { order = 3, + name = "", + type = "description", + width = "full", + }, + spacer2 = { + order = 4, + name = "", + type = "description", + width = "full", + }, + commonGroup = { + order = 5, type = "group", - name = L["Unit Options"], - childGroups = "tree", + name = L["General Settings"], args = { - commonGroup = { + showAuras = { order = 1, + type = "execute", + name = L["Show Auras"], + func = function()local U = SVUI_PetTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("pettarget")end + }, + miscGroup = { + order = 2, type = "group", - name = L["General Settings"], + guiInline = true, + name = L["Base Settings"], args = { - showAuras = { - order = 3, - type = "execute", - name = L["Show Auras"], - func = function()local U = SVUI_PetTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("pettarget")end - }, - width = {order = 4, name = L["Width"], type = "range", min = 50, max = 500, step = 1}, - height = {order = 5, name = L["Height"], type = "range", min = 10, max = 250, step = 1}, - rangeCheck = {order = 6, name = L["Range Check"], desc = L["Check if you are in range to cast spells on this specific unit."], type = "toggle"}, + rangeCheck = { + order = 2, + name = L["Range Check"], + desc = L["Check if you are in range to cast spells on this specific unit."], + type = "toggle" + }, hideonnpc = { type = "toggle", - order = 7, + order = 4, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], get = function(l)return SV.db.SVUnit["pettarget"]["power"].hideonnpc end, set = function(l, m)SV.db.SVUnit["pettarget"]["power"].hideonnpc = m;MOD:SetUnitFrame("pettarget")end }, - threatEnabled = {type = "toggle", order = 13, name = L["Show Threat"]} + threatEnabled = { + type = "toggle", + order = 5, + name = L["Show Threat"] + }, } }, - commonGroup = { - order = 1, + scaleGroup = { + order = 3, type = "group", - name = L["General Settings"], + guiInline = true, + name = L["Frame Size"], args = { - showAuras = { - order = 1, - type = "execute", - name = L["Show Auras"], - func = function()local U = SVUI_PetTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("pettarget")end - }, - miscGroup = { - order = 2, - type = "group", - guiInline = true, - name = L["Base Settings"], - args = { - rangeCheck = { - order = 2, - name = L["Range Check"], - desc = L["Check if you are in range to cast spells on this specific unit."], - type = "toggle" - }, - hideonnpc = { - type = "toggle", - order = 4, - name = L["Text Toggle On NPC"], - desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], - get = function(l)return SV.db.SVUnit["pettarget"]["power"].hideonnpc end, - set = function(l, m)SV.db.SVUnit["pettarget"]["power"].hideonnpc = m;MOD:SetUnitFrame("pettarget")end - }, - threatEnabled = { - type = "toggle", - order = 5, - name = L["Show Threat"] - }, - } - }, - scaleGroup = { - order = 3, - type = "group", - guiInline = true, - name = L["Frame Size"], - args = { - width = {order = 1, name = L["Width"], width = "full", type = "range", min = 50, max = 500, step = 1}, - height = {order = 2, name = L["Height"], width = "full", type = "range", min = 10, max = 250, step = 1}, - } - }, - }, - }, - misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "pettarget"), - health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "pettarget"), - power = ns:SetPowerConfigGroup(false, MOD.SetUnitFrame, "pettarget"), - name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "pettarget"), - buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetUnitFrame, "pettarget"), - debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetUnitFrame, "pettarget") - } - } + width = {order = 1, name = L["Width"], width = "full", type = "range", min = 50, max = 500, step = 1}, + height = {order = 2, name = L["Height"], width = "full", type = "range", min = 10, max = 250, step = 1}, + } + }, + }, + }, + misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "pettarget"), + health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "pettarget"), + power = ns:SetPowerConfigGroup(false, MOD.SetUnitFrame, "pettarget"), + name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "pettarget"), + buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetUnitFrame, "pettarget"), + debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetUnitFrame, "pettarget") } } \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/player.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/player.lua index ea331a6..31f49f9 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/player.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/player.lua @@ -39,11 +39,11 @@ local _, ns = ... ################################################################################################## ################################################################################################## ]] -SV.Options.args.SVUnit.args.player={ +SV.Options.args.SVUnit.args.commonGroup.args.player={ name = L['Player'], type = 'group', order = 3, - childGroups = "tab", + childGroups = "select", get = function(l)return SV.db.SVUnit['player'][l[#l]]end, set = function(l,m)MOD:ChangeDBVar(m, l[#l], "player");MOD:SetUnitFrame('player')end, args = { @@ -61,234 +61,238 @@ SV.Options.args.SVUnit.args.player={ SV.Mentalo:Reset('Player Frame') end }, - tabGroups = { - order = 3, + spacer1 = { + order = 3, + name = "", + type = "description", + width = "full", + }, + spacer2 = { + order = 4, + name = "", + type = "description", + width = "full", + }, + commonGroup = { + order = 5, type = 'group', - name = L['Unit Options'], - childGroups = "tree", + name = L['General Settings'], args = { - commonGroup = { - order = 1, - type = 'group', - name = L['General Settings'], + baseGroup = { + order = 1, + type = "group", + guiInline = true, + name = L["Base Settings"], args = { - baseGroup = { - order = 1, - type = "group", - guiInline = true, - name = L["Base Settings"], - args = { - showAuras = { - order = 1, - type = "execute", - name = L["Show Auras"], - func = function()local U = SVUI_Player;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("player")end - }, - lowmana = { - order = 2, - name = L["Low Mana Threshold"], - desc = L["When you mana falls below this point, text will flash on the player frame."], - type = "range", - min = 0, - max = 100, - step = 1 - }, - combatfade = { - order = 3, - name = L["Combat Fade"], - desc = L["Fade the unitframe when out of combat, not casting, no target exists."], - type = "toggle", - set = function(l, m) - MOD:ChangeDBVar(m, l[#l], "player"); - MOD:SetUnitFrame("player") - if m == true then - SVUI_Pet:SetParent(SVUI_Player) - else - SVUI_Pet:SetParent(SVUI_UnitFrameParent) - end - end - }, - predict = { - order = 4, - name = L["Heal Prediction"], - desc = L["Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."], - type = "toggle" - }, - hideonnpc = { - type = "toggle", - order = 5, - name = L["Text Toggle On NPC"], - desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], - get = function(l)return SV.db.SVUnit["player"]["power"].hideonnpc end, - set = function(l, m)SV.db.SVUnit["player"]["power"].hideonnpc = m;MOD:SetUnitFrame("player")end - }, - threatEnabled = { - type = "toggle", - order = 6, - name = L["Show Threat"] - }, - playerExpBar = { - order = 7, - name = "Playerframe Experience Bar", - desc = "Show player experience on power bar mouseover", - type = "toggle", - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "player");SV:StaticPopup_Show("RL_CLIENT")end - }, - playerRepBar = { - order = 8, - name = "Playerframe Reputation Bar", - desc = "Show player reputations on power bar mouseover", - type = "toggle", - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "player");SV:StaticPopup_Show("RL_CLIENT")end - } - } + showAuras = { + order = 1, + type = "execute", + name = L["Show Auras"], + func = function()local U = SVUI_Player;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("player")end }, - sizeGroup = { - order = 2, - guiInline = true, - type = "group", - name = L["Size Settings"], - args = { - width = { - order = 1, - name = L["Width"], - type = "range", - width = "full", - min = 50, - max = 500, - step = 1, - set = function(l, m) - if SV.db.SVUnit["player"].castbar.width == SV.db.SVUnit["player"][l[#l]] then - SV.db.SVUnit["player"].castbar.width = m - end - MOD:ChangeDBVar(m, l[#l], "player"); - MOD:SetUnitFrame("player") - end - }, - height = { - order = 2, - name = L["Height"], - type = "range", - width = "full", - min = 10, - max = 250, - step = 1 - }, - } + lowmana = { + order = 2, + name = L["Low Mana Threshold"], + desc = L["When you mana falls below this point, text will flash on the player frame."], + type = "range", + min = 0, + max = 100, + step = 1 }, - pvpGroup = { + combatfade = { order = 3, - type = "group", - guiInline = true, - name = PVP, - get = function(l)return SV.db.SVUnit["player"]["pvp"][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "player", "pvp");MOD:SetUnitFrame("player")end, - args = { - position = { - type = "select", - order = 2, - name = L["Position"], - values = { - TOPLEFT = "TOPLEFT", - LEFT = "LEFT", - BOTTOMLEFT = "BOTTOMLEFT", - RIGHT = "RIGHT", - TOPRIGHT = "TOPRIGHT", - BOTTOMRIGHT = "BOTTOMRIGHT", - CENTER = "CENTER", - TOP = "TOP", - BOTTOM = "BOTTOM" - } - }, - tags = { - order = 100, - name = L["Text Format"], - type = "input", - width = "full", - desc = L["TEXT_FORMAT_DESC"] - } - } + name = L["Combat Fade"], + desc = L["Fade the unitframe when out of combat, not casting, no target exists."], + type = "toggle", + set = function(l, m) + MOD:ChangeDBVar(m, l[#l], "player"); + MOD:SetUnitFrame("player") + if m == true then + SVUI_Pet:SetParent(SVUI_Player) + else + SVUI_Pet:SetParent(SVUI_UnitFrameParent) + end + end + }, + predict = { + order = 4, + name = L["Heal Prediction"], + desc = L["Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."], + type = "toggle" + }, + hideonnpc = { + type = "toggle", + order = 5, + name = L["Text Toggle On NPC"], + desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], + get = function(l)return SV.db.SVUnit["player"]["power"].hideonnpc end, + set = function(l, m)SV.db.SVUnit["player"]["power"].hideonnpc = m;MOD:SetUnitFrame("player")end + }, + threatEnabled = { + type = "toggle", + order = 6, + name = L["Show Threat"] + }, + playerExpBar = { + order = 7, + name = "Playerframe Experience Bar", + desc = "Show player experience on power bar mouseover", + type = "toggle", + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "player");SV:StaticPopup_Show("RL_CLIENT")end + }, + playerRepBar = { + order = 8, + name = "Playerframe Reputation Bar", + desc = "Show player reputations on power bar mouseover", + type = "toggle", + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "player");SV:StaticPopup_Show("RL_CLIENT")end } } }, - misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "player"), - health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "player"), - power = ns:SetPowerConfigGroup(true, MOD.SetUnitFrame, "player"), - name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "player"), - portrait = ns:SetPortraitConfigGroup(MOD.SetUnitFrame, "player"), - buffs = ns:SetAuraConfigGroup(true, "buffs", false, MOD.SetUnitFrame, "player"), - debuffs = ns:SetAuraConfigGroup(true, "debuffs", false, MOD.SetUnitFrame, "player"), - castbar = ns:SetCastbarConfigGroup(MOD.SetUnitFrame, "player"), - aurabar = ns:SetAurabarConfigGroup(true, MOD.SetUnitFrame, "player"), - icons = ns:SetIconConfigGroup(MOD.SetUnitFrame, "player"), - classbar = { - order = 1000, + sizeGroup = { + order = 2, + guiInline = true, + type = "group", + name = L["Size Settings"], + args = { + width = { + order = 1, + name = L["Width"], + type = "range", + width = "full", + min = 50, + max = 500, + step = 1, + set = function(l, m) + if SV.db.SVUnit["player"].castbar.width == SV.db.SVUnit["player"][l[#l]] then + SV.db.SVUnit["player"].castbar.width = m + end + MOD:ChangeDBVar(m, l[#l], "player"); + MOD:SetUnitFrame("player") + end + }, + height = { + order = 2, + name = L["Height"], + type = "range", + width = "full", + min = 10, + max = 250, + step = 1 + }, + } + }, + pvpGroup = { + order = 3, type = "group", - name = L["Classbar"], - get = function(l)return SV.db.SVUnit["player"]["classbar"][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "player", "classbar");MOD:SetUnitFrame("player")end, + guiInline = true, + name = PVP, + get = function(l)return SV.db.SVUnit["player"]["pvp"][l[#l]]end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "player", "pvp");MOD:SetUnitFrame("player")end, args = { - enable = { + position = { + type = "select", + order = 2, + name = L["Position"], + values = { + TOPLEFT = "TOPLEFT", + LEFT = "LEFT", + BOTTOMLEFT = "BOTTOMLEFT", + RIGHT = "RIGHT", + TOPRIGHT = "TOPRIGHT", + BOTTOMRIGHT = "BOTTOMRIGHT", + CENTER = "CENTER", + TOP = "TOP", + BOTTOM = "BOTTOM" + } + }, + tags = { + order = 100, + name = L["Text Format"], + type = "input", + width = "full", + desc = L["TEXT_FORMAT_DESC"] + } + } + } + } + }, + misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "player"), + health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "player"), + power = ns:SetPowerConfigGroup(true, MOD.SetUnitFrame, "player"), + name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "player"), + portrait = ns:SetPortraitConfigGroup(MOD.SetUnitFrame, "player"), + buffs = ns:SetAuraConfigGroup(true, "buffs", false, MOD.SetUnitFrame, "player"), + debuffs = ns:SetAuraConfigGroup(true, "debuffs", false, MOD.SetUnitFrame, "player"), + castbar = ns:SetCastbarConfigGroup(MOD.SetUnitFrame, "player"), + aurabar = ns:SetAurabarConfigGroup(true, MOD.SetUnitFrame, "player"), + icons = ns:SetIconConfigGroup(MOD.SetUnitFrame, "player"), + classbar = { + order = 1000, + type = "group", + name = L["Classbar"], + get = function(l)return SV.db.SVUnit["player"]["classbar"][l[#l]]end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "player", "classbar");MOD:SetUnitFrame("player")end, + args = { + enable = { + type = "toggle", + order = 1, + name = L["Enable"] + }, + commonGroup = { + order = 2, + type = "group", + guiInline = true, + name = L["Base Settings"], + args = { + slideLeft = { type = "toggle", order = 1, - name = L["Enable"] + name = L["Slide Left"] }, - commonGroup = { - order = 2, - type = "group", - guiInline = true, - name = L["Base Settings"], - args = { - slideLeft = { - type = "toggle", - order = 1, - name = L["Slide Left"] - }, - detachFromFrame = { - type = "toggle", - order = 2, - name = L["Detach From Frame"] - }, - stagger = { - type = "toggle", - order = 3, - name = L["Stagger Bar"], - get = function(l)return SV.db.SVUnit["player"]["stagger"].enable end, - set = function(l, m)MOD:ChangeDBVar(m, "enable", "player", "stagger");MOD:SetUnitFrame("player")end, - disabled = SV.class ~= "MONK", - }, - druidMana = { - type = "toggle", - order = 12, - name = L["Druid Mana"], - desc = L["Display druid mana bar when in cat or bear form and when mana is not 100%."], - get = function(key) - return SV.db.SVUnit["player"]["power"].druidMana - end, - set = function(key, value) - MOD:ChangeDBVar(value, "druidMana", "player", "power"); - MOD:SetUnitFrame("player") - end, - disabled = SV.class ~= "DRUID", - } - } + detachFromFrame = { + type = "toggle", + order = 2, + name = L["Detach From Frame"] }, - sizeGroup = { - order = 3, - guiInline = true, - type = "group", - name = L["Size Settings"], - args = { - height = { - type = "range", - order = 4, - width = "full", - name = L["Size"], - min = 15, - max = 45, - step = 1 - } - } + stagger = { + type = "toggle", + order = 3, + name = L["Stagger Bar"], + get = function(l)return SV.db.SVUnit["player"]["stagger"].enable end, + set = function(l, m)MOD:ChangeDBVar(m, "enable", "player", "stagger");MOD:SetUnitFrame("player")end, + disabled = SV.class ~= "MONK", + }, + druidMana = { + type = "toggle", + order = 12, + name = L["Druid Mana"], + desc = L["Display druid mana bar when in cat or bear form and when mana is not 100%."], + get = function(key) + return SV.db.SVUnit["player"]["power"].druidMana + end, + set = function(key, value) + MOD:ChangeDBVar(value, "druidMana", "player", "power"); + MOD:SetUnitFrame("player") + end, + disabled = SV.class ~= "DRUID", + } + } + }, + sizeGroup = { + order = 3, + guiInline = true, + type = "group", + name = L["Size Settings"], + args = { + height = { + type = "range", + order = 4, + width = "full", + name = L["Size"], + min = 15, + max = 45, + step = 1 } } } diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/raid.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/raid.lua index 7c0b888..a877c38 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/raid.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/raid.lua @@ -35,11 +35,11 @@ local MOD = SV.SVUnit if(not MOD) then return end local _, ns = ... -SV.Options.args.SVUnit.args["raid"] = { +SV.Options.args.SVUnit.args.commonGroup.args["raid"] = { name = "Raid", type = "group", order = 12, - childGroups = "tab", + childGroups = "select", get = function(l) return SV.db.SVUnit["raid"][l[#l]] end, set = function(l, m) MOD:ChangeDBVar(m, l[#l], "raid"); MOD:SetGroupFrame("raid") end, args = { @@ -63,113 +63,120 @@ SV.Options.args.SVUnit.args["raid"] = { name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("raid") SV.Mentalo:Reset("Raid Frames") end, }, - tabGroups = { - order = 3, + spacer1 = { + order = 4, + name = "", + type = "description", + width = "full", + }, + spacer2 = { + order = 5, + name = "", + type = "description", + width = "full", + }, + general = { + order = 6, type = "group", - name = L["Unit Options"], - childGroups = "tree", + name = L["General Settings"], args = { commonGroup = { order = 1, + name = L["Basic Options"], type = "group", - name = L["General Settings"], + guiInline = true, args = { - showPlayer = - { - order = 1, - type = "toggle", - name = L["Display Player"], - desc = L["When true, always show player in raid frames."], - get = function(l)return SV.db.SVUnit["raid"].showPlayer end, - set = function(l, m) MOD:ChangeDBVar(m, l[#l], "raid"); MOD:SetGroupFrame("raid", true) end, - }, - hideonnpc = - { - type = "toggle", - order = 2, - name = L["Text Toggle On NPC"], - desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], - get = function(l)return SV.db.SVUnit["raid"]["power"].hideonnpc end, - set = function(l, m) SV.db.SVUnit["raid"]["power"].hideonnpc = m; MOD:SetGroupFrame("raid")end, - }, rangeCheck = { - order = 3, - name = L["Range Check"], - desc = L["Check if you are in range to cast spells on this specific unit."], + order = 1, type = "toggle", + name = L["Range Check"], + desc = L["Check if you are in range to cast spells on this specific unit."], }, - gps = { - order = 4, - name = "GPS Tracking", - desc = "Show an arrow giving the direction and distance to the frames unit.", - type = "toggle", - }, predict = { - order = 5, + order = 2, + type = "toggle", name = L["Heal Prediction"], desc = L["Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."], - type = "toggle", }, threatEnabled = { + order = 3, type = "toggle", - order = 6, name = L["Show Threat"], }, - colorOverride = { - order = 7, - name = L["Class Color Override"], - desc = L["Override the default class color setting."], - type = "select", - values = - { - ["USE_DEFAULT"] = L["Use Default"], - ["FORCE_ON"] = L["Force On"], - ["FORCE_OFF"] = L["Force Off"], - }, - }, - positionsGroup = { - order = 100, - name = L["Size and Positions"], + } + }, + layoutGroup = { + order = 2, + name = L["Layout Options"], + type = "group", + guiInline = true, + set = function(key, value) MOD:ChangeDBVar(value, key[#key], "raid"); MOD:SetGroupFrame("raid", true) end, + args = { + common = { + order = 1, + name = L["General Layout"], type = "group", guiInline = true, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raid");MOD:SetGroupFrame("raid", true)end, - args = - { - width = - { + args = { + enable = { order = 1, - name = L["Width"], - type = "range", - min = 10, - max = 500, - step = 1, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raid");MOD:SetGroupFrame("raid")end, - }, - height = - { + name = L["Enable Grid Mode"], + desc = L["Converts frames into symmetrical squares. Ideal for healers."], + type = "toggle", + get = function(key) return SV.db.SVUnit["raid"].grid.enable end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], "raid", "grid"); + MOD:SetGroupFrame("raid", true); + SV.Options.args.SVUnit.args.commonGroup.args.raid.args.tabGroups.args.general.args.layoutGroup.args.sizing = ns:SetSizeConfigGroup(value, "raid"); + end, + }, + showPlayer = { order = 2, - name = L["Height"], + type = "toggle", + name = L["Display Player"], + desc = L["When true, always show player in raid frames."], + get = function(l)return SV.db.SVUnit["raid"].showPlayer end, + set = function(l, m) MOD:ChangeDBVar(m, l[#l], "raid"); MOD:SetGroupFrame("raid", true) end, + }, + invertGroupingOrder = { + order = 3, + type = "toggle", + name = L["Invert Grouping Order"], + desc = L["Enabling this inverts the grouping order when the raid is not full, this will reverse the direction it starts from."], + disabled = function() return not SV.db.SVUnit["raid"].customSorting end, + }, + } + }, + sizing = ns:SetSizeConfigGroup(SV.db.SVUnit.raid.grid.enable, "raid"), + sorting = { + order = 3, + name = L["Sorting"], + type = "group", + guiInline = true, + args = { + gRowCol = { + order = 1, type = "range", - min = 10, - max = 500, + name = L["Groups Per Row / Column"], + min = 1, + max = 8, step = 1, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raid");MOD:SetGroupFrame("raid")end, - }, - spacer = - { - order = 3, - name = "", - type = "description", - width = "full", - }, - showBy = - { - order = 4, + width = 'full', + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], "raid"); + MOD:SetGroupFrame("raid") + if(_G["SVUI_Raid"] and _G["SVUI_Raid"].isForced) then + MOD:ViewGroupFrames(_G["SVUI_Raid"]) + MOD:ViewGroupFrames(_G["SVUI_Raid"], true) + end + end, + }, + showBy = { + order = 2, name = L["Growth Direction"], desc = L["Growth direction from the first unitframe."], type = "select", - values = - { + values = { DOWN_RIGHT = format(L["%s and then %s"], L["Down"], L["Right"]), DOWN_LEFT = format(L["%s and then %s"], L["Down"], L["Left"]), UP_RIGHT = format(L["%s and then %s"], L["Up"], L["Right"]), @@ -179,60 +186,13 @@ SV.Options.args.SVUnit.args["raid"] = { LEFT_DOWN = format(L["%s and then %s"], L["Left"], L["Down"]), LEFT_UP = format(L["%s and then %s"], L["Left"], L["Up"]), }, - }, - gRowCol = - { - order = 5, - type = "range", - name = L["Groups Per Row / Column"], - min = 1, - max = 8, - step = 1, - set = function(l, m) - MOD:ChangeDBVar(m, l[#l], "raid"); - MOD:SetGroupFrame("raid") - if(_G["SVUI_Raid"] and _G["SVUI_Raid"].isForced) then - MOD:ViewGroupFrames(_G["SVUI_Raid"]) - MOD:ViewGroupFrames(_G["SVUI_Raid"], true) - end - end, - }, - wrapXOffset = - { - order = 6, - type = "range", - name = L["Horizontal Spacing"], - min = 0, - max = 50, - step = 1, }, - wrapYOffset = - { - order = 7, - type = "range", - name = L["Vertical Spacing"], - min = 0, - max = 50, - step = 1, - }, - }, - }, - sortingGroup = { - order = 300, - type = "group", - guiInline = true, - name = L["Sorting"], - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raid");MOD:SetGroupFrame("raid", true)end, - args = - { - sortMethod = - { - order = 1, + sortMethod = { + order = 3, name = L["Group By"], desc = L["Set the order that the group will sort."], type = "select", - values = - { + values = { ["CLASS"] = CLASS, ["ROLE"] = ROLE.."(Tanks, Healers, DPS)", ["ROLE_TDH"] = ROLE.."(Tanks, DPS, Healers)", @@ -243,142 +203,224 @@ SV.Options.args.SVUnit.args["raid"] = { ["GROUP"] = GROUP, }, }, - sortDir = - { - order = 2, + sortDir = { + order = 4, name = L["Sort Direction"], desc = L["Defines the sort order of the selected sort method."], type = "select", - values = - { + values = { ["ASC"] = L["Ascending"], ["DESC"] = L["Descending"], }, - }, - spacer = - { - order = 3, + }, + spacer3 = { + order = 5, type = "description", width = "full", name = " ", - }, - invertGroupingOrder = - { - order = 4, - name = L["Invert Grouping Order"], - desc = L["Enabling this inverts the grouping order when the raid is not full, this will reverse the direction it starts from."], - disabled = function()return not SV.db.SVUnit["raid"].customSorting end, - type = "toggle", - }, - }, + }, + allowedGroup = { + order = 6, + name = L["Enabled Groups"], + type = "group", + guiInline = true, + args = { + showGroupNumber = { + type = "toggle", + order = 1, + name = L["Show Group Number Icons"], + width = 'full', + }, + one = { + type = "toggle", + order = 2, + name = L["Group 1"], + get = function(key) return SV.db.SVUnit["raid"]["allowedGroup"][1] end, + set = function(key, value) + SV.db.SVUnit["raid"]["allowedGroup"][1] = value; + MOD:SetGroupFrame("raid") + end, + }, + two = { + type = "toggle", + order = 3, + name = L["Group 2"], + get = function(key) return SV.db.SVUnit["raid"]["allowedGroup"][2] end, + set = function(key, value) + SV.db.SVUnit["raid"]["allowedGroup"][2] = value; + MOD:SetGroupFrame("raid") + end, + }, + three = { + type = "toggle", + order = 4, + name = L["Group 3"], + get = function(key) return SV.db.SVUnit["raid"]["allowedGroup"][3] end, + set = function(key, value) + SV.db.SVUnit["raid"]["allowedGroup"][3] = value; + MOD:SetGroupFrame("raid") + end, + }, + four = { + type = "toggle", + order = 5, + name = L["Group 4"], + get = function(key) return SV.db.SVUnit["raid"]["allowedGroup"][4] end, + set = function(key, value) + SV.db.SVUnit["raid"]["allowedGroup"][4] = value; + MOD:SetGroupFrame("raid") + end, + }, + five = { + type = "toggle", + order = 6, + name = L["Group 5"], + get = function(key) return SV.db.SVUnit["raid"]["allowedGroup"][5] end, + set = function(key, value) + SV.db.SVUnit["raid"]["allowedGroup"][5] = value; + MOD:SetGroupFrame("raid") + end, + }, + six = { + type = "toggle", + order = 7, + name = L["Group 6"], + get = function(key) return SV.db.SVUnit["raid"]["allowedGroup"][6] end, + set = function(key, value) + SV.db.SVUnit["raid"]["allowedGroup"][6] = value; + MOD:SetGroupFrame("raid") + end, + }, + seven = { + type = "toggle", + order = 8, + name = L["Group 7"], + get = function(key) return SV.db.SVUnit["raid"]["allowedGroup"][7] end, + set = function(key, value) + SV.db.SVUnit["raid"]["allowedGroup"][7] = value; + MOD:SetGroupFrame("raid") + end, + }, + eight = { + type = "toggle", + order = 9, + name = L["Group 8"], + get = function(key) return SV.db.SVUnit["raid"]["allowedGroup"][8] end, + set = function(key, value) + SV.db.SVUnit["raid"]["allowedGroup"][8] = value; + MOD:SetGroupFrame("raid") + end, + }, + }, + }, + } } - } + }, + }, + } + }, + misc = ns:SetMiscConfigGroup(true, MOD.SetGroupFrame, "raid"), + health = ns:SetHealthConfigGroup(true, MOD.SetGroupFrame, "raid"), + power = ns:SetPowerConfigGroup(false, MOD.SetGroupFrame, "raid"), + name = ns:SetNameConfigGroup(MOD.SetGroupFrame, "raid"), + buffs = ns:SetAuraConfigGroup(true, "buffs", true, MOD.SetGroupFrame, "raid"), + debuffs = ns:SetAuraConfigGroup(true, "debuffs", true, MOD.SetGroupFrame, "raid"), + auraWatch = { + order = 600, + type = "group", + name = L["Aura Watch"], + args = { + enable = { + type = "toggle", + name = L["Enable"], + order = 1, + get = function(l)return SV.db.SVUnit["raid"].auraWatch.enable end, + set = function(l, m)MOD:ChangeDBVar(m, "enable", "raid", "auraWatch");MOD:SetGroupFrame("raid")end, + }, + size = { + type = "range", + name = L["Size"], + desc = L["Size of the indicator icon."], + order = 2, + min = 4, + max = 15, + step = 1, + get = function(l)return SV.db.SVUnit["raid"].auraWatch.size end, + set = function(l, m)MOD:ChangeDBVar(m, "size", "raid", "auraWatch");MOD:SetGroupFrame("raid")end, + }, + configureButton = { + type = "execute", + name = L["Configure Auras"], + func = function()ns:SetToFilterConfig("BuffWatch")end, + order = 3, }, - misc = ns:SetMiscConfigGroup(true, MOD.SetGroupFrame, "raid"), - health = ns:SetHealthConfigGroup(true, MOD.SetGroupFrame, "raid"), - power = ns:SetPowerConfigGroup(false, MOD.SetGroupFrame, "raid"), - name = ns:SetNameConfigGroup(MOD.SetGroupFrame, "raid"), - buffs = ns:SetAuraConfigGroup(true, "buffs", true, MOD.SetGroupFrame, "raid"), - debuffs = ns:SetAuraConfigGroup(true, "debuffs", true, MOD.SetGroupFrame, "raid"), - auraWatch = { - order = 600, - type = "group", - name = L["Aura Watch"], - args = { - enable = { - type = "toggle", - name = L["Enable"], - order = 1, - get = function(l)return SV.db.SVUnit["raid"].auraWatch.enable end, - set = function(l, m)MOD:ChangeDBVar(m, "enable", "raid", "auraWatch");MOD:SetGroupFrame("raid")end, - }, - size = { - type = "range", - name = L["Size"], - desc = L["Size of the indicator icon."], - order = 2, - min = 4, - max = 15, - step = 1, - get = function(l)return SV.db.SVUnit["raid"].auraWatch.size end, - set = function(l, m)MOD:ChangeDBVar(m, "size", "raid", "auraWatch");MOD:SetGroupFrame("raid")end, - }, - configureButton = { - type = "execute", - name = L["Configure Auras"], - func = function()ns:SetToFilterConfig("BuffWatch")end, - order = 3, - }, - }, + }, + }, + rdebuffs = { + order = 800, + type = "group", + name = L["RaidDebuff Indicator"], + get = function(l)return + SV.db.SVUnit["raid"]["rdebuffs"][l[#l]]end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raid", "rdebuffs");MOD:SetGroupFrame("raid")end, + args = { + enable = { + type = "toggle", + name = L["Enable"], + order = 1, }, - rdebuffs = { - order = 800, - type = "group", - name = L["RaidDebuff Indicator"], - get = function(l)return - SV.db.SVUnit["raid"]["rdebuffs"][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raid", "rdebuffs");MOD:SetGroupFrame("raid")end, - args = { - enable = { - type = "toggle", - name = L["Enable"], - order = 1, - }, - size = { - type = "range", - name = L["Size"], - order = 2, - min = 8, - max = 35, - step = 1, - }, - fontSize = { - type = "range", - name = L["Font Size"], - order = 3, - min = 7, - max = 22, - step = 1, - }, - xOffset = { - order = 4, - type = "range", - name = L["xOffset"], - min = - 300, - max = 300, - step = 1, - }, - yOffset = { - order = 5, - type = "range", - name = L["yOffset"], - min = - 300, - max = 300, - step = 1, - }, - configureButton = { - type = "execute", - name = L["Configure Auras"], - func = function()ns:SetToFilterConfig("Raid")end, - order = 7, - }, - }, + size = { + type = "range", + name = L["Size"], + order = 2, + min = 8, + max = 35, + step = 1, + }, + fontSize = { + type = "range", + name = L["Font Size"], + order = 3, + min = 7, + max = 22, + step = 1, + }, + xOffset = { + order = 4, + type = "range", + name = L["xOffset"], + min = - 300, + max = 300, + step = 1, + }, + yOffset = { + order = 5, + type = "range", + name = L["yOffset"], + min = - 300, + max = 300, + step = 1, + }, + configureButton = { + type = "execute", + name = L["Configure Auras"], + func = function()ns:SetToFilterConfig("Raid")end, + order = 7, }, - icons = ns:SetIconConfigGroup(MOD.SetGroupFrame, "raid"), }, }, + icons = ns:SetIconConfigGroup(MOD.SetGroupFrame, "raid"), }, } -SV.Options.args.SVUnit.args.raidpet = { +SV.Options.args.SVUnit.args.commonGroup.args.raidpet = { order = 13, type = 'group', name = L['Raid Pets'], - childGroups = "tab", - get = function(l)return - SV.db.SVUnit['raidpet'][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raidpet");MOD:SetGroupFrame('raidpet')end, + childGroups = "select", + get = function(l) return SV.db.SVUnit['raidpet'][l[#l]] end, + set = function(l, m) MOD:ChangeDBVar(m, l[#l], "raidpet"); MOD:SetGroupFrame('raidpet'); end, args = { enable = { type = 'toggle', @@ -389,273 +431,243 @@ SV.Options.args.SVUnit.args.raidpet = { order = 2, type = 'execute', name = L['Display Frames'], - func = function()MOD:ViewGroupFrames(SVUI_Raidpet, SVUI_Raidpet.forceShow ~= true or nil)end, + func = function() MOD:ViewGroupFrames(SVUI_Raidpet, SVUI_Raidpet.forceShow ~= true or nil); end, }, resetSettings = { type = 'execute', order = 3, name = L['Restore Defaults'], - func = function(l, m)MOD:ResetUnitOptions('raidpet')SV.Mentalo:Reset('Raid Pet Frames')MOD:SetGroupFrame('raidpet', true)end, + func = function(l, m) MOD:ResetUnitOptions('raidpet'); SV.Mentalo:Reset('Raid Pet Frames'); MOD:SetGroupFrame('raidpet', true); end, }, - tabGroups= { - order=3, - type='group', - name=L['Unit Options'], - childGroups="tree", - args= { - commonGroup= { - order=1, - type='group', - name=L['General Settings'], - args= { + spacer1 = { + order = 4, + name = "", + type = "description", + width = "full", + }, + spacer2 = { + order = 5, + name = "", + type = "description", + width = "full", + }, + general = { + order = 6, + type = "group", + name = L["General Settings"], + args = { + commonGroup = { + order = 1, + name = L["Basic Options"], + type = "group", + guiInline = true, + args = { rangeCheck = { - order = 3, - name = L["Range Check"], - desc = L["Check if you are in range to cast spells on this specific unit."], - type = "toggle", + order = 1, + type = "toggle", + name = L["Range Check"], + desc = L["Check if you are in range to cast spells on this specific unit."], }, predict = { - order = 4, - name = L['Heal Prediction'], - desc = L['Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals.'], - type = 'toggle', - }, + order = 2, + type = "toggle", + name = L["Heal Prediction"], + desc = L["Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."], + }, threatEnabled = { - type = 'toggle', - order = 5, - name = L['Show Threat'], - }, - colorOverride = { - order = 6, - name = L['Class Color Override'], - desc = L['Override the default class color setting.'], - type = 'select', - values = { - ['USE_DEFAULT'] = L['Use Default'], - ['FORCE_ON'] = L['Force On'], - ['FORCE_OFF'] = L['Force Off'], - }, - }, - positionsGroup = { - order = 100, - name = L['Size and Positions'], - type = 'group', - guiInline = true, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raidpet");MOD:SetGroupFrame('raidpet', true)end, + order = 3, + type = "toggle", + name = L["Show Threat"], + }, + } + }, + layoutGroup = { + order = 2, + name = L["Layout Options"], + type = "group", + guiInline = true, + set = function(key, value) MOD:ChangeDBVar(value, key[#key], "raidpet"); MOD:SetGroupFrame("raidpet", true) end, + args = { + common = { + order = 1, + name = L["General Layout"], + type = "group", + guiInline = true, args = { - width = { - order = 1, - name = L['Width'], - type = 'range', - min = 10, - max = 500, - step = 1, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raidpet");MOD:SetGroupFrame('raidpet')end, + enable = { + order = 1, + name = L["Enable Grid Mode"], + desc = L["Converts frames into symmetrical squares. Ideal for healers."], + type = "toggle", + get = function(key) return SV.db.SVUnit["raidpet"].grid.enable end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], "raidpet", "grid"); + MOD:SetGroupFrame("raidpet", true); + SV.Options.args.SVUnit.args.commonGroup.args.raidpet.args.tabGroups.args.general.args.layoutGroup.args.sizing = ns:SetSizeConfigGroup(value, "raidpet"); + end, }, - height = { + invertGroupingOrder = { order = 2, - name = L['Height'], - type = 'range', - min = 10, - max = 500, - step = 1, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raidpet");MOD:SetGroupFrame('raidpet')end, - }, - spacer = { - order = 3, - name = '', - type = 'description', - width = 'full', - }, - showBy = { - order = 4, - name = L['Growth Direction'], - desc = L['Growth direction from the first unitframe.'], - type = 'select', - values = { - DOWN_RIGHT = format(L['%s and then %s'], L['Down'], L['Right']), - DOWN_LEFT = format(L['%s and then %s'], L['Down'], L['Left']), - UP_RIGHT = format(L['%s and then %s'], L['Up'], L['Right']), - UP_LEFT = format(L['%s and then %s'], L['Up'], L['Left']), - RIGHT_DOWN = format(L['%s and then %s'], L['Right'], L['Down']), - RIGHT_UP = format(L['%s and then %s'], L['Right'], L['Up']), - LEFT_DOWN = format(L['%s and then %s'], L['Left'], L['Down']), - LEFT_UP = format(L['%s and then %s'], L['Left'], L['Up']), - }, - }, - gRowCol = { - order = 5, - type = 'range', - name = L['Groups Per Row/Column'], - min = 1, - max = 8, - step = 1, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raidpet");MOD:SetGroupFrame('raidpet')if - SVUI_Raidpet.isForced then MOD:ViewGroupFrames(SVUI_Raidpet)MOD:ViewGroupFrames(SVUI_Raidpet, true)end end, - }, - wrapXOffset = { - order = 6, - type = 'range', - name = L['Horizontal Spacing'], - min = 0, - max = 50, - step = 1, - }, - wrapYOffset = { - order = 7, - type = 'range', - name = L['Vertical Spacing'], - min = 0, - max = 50, - step = 1, + type = "toggle", + name = L["Invert Grouping Order"], + desc = L["Enabling this inverts the grouping order."], + disabled = function() return not SV.db.SVUnit["raidpet"].customSorting end, }, - }, + } }, - visibilityGroup = { - order = 200, - name = L['Visibility'], - type = 'group', - guiInline = true, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raidpet");MOD:SetGroupFrame('raidpet', true)end, + sizing = ns:SetSizeConfigGroup(SV.db.SVUnit.raidpet.grid.enable, "raidpet"), + sorting = { + order = 3, + name = L["Sorting"], + type = "group", + guiInline = true, args = { - visibility = { - order = 2, - type = 'input', - name = L['Visibility'], - desc = L['The following macro must be true in order for the group to be shown, in addition to any filter that may already be set.'], + gRowCol = { + order = 1, + type = "range", + name = L["Groups Per Row / Column"], + min = 1, + max = 8, + step = 1, width = 'full', - desc = L['TEXT_FORMAT_DESC'], + set = function(key, value) + MOD:ChangeDBVar(value, key[#key], "raidpet"); + MOD:SetGroupFrame("raidpet") + if(_G["SVUI_Raid"] and _G["SVUI_Raid"].isForced) then + MOD:ViewGroupFrames(_G["SVUI_Raid"]) + MOD:ViewGroupFrames(_G["SVUI_Raid"], true) + end + end, }, - }, - }, - sortingGroup = { - order = 300, - type = 'group', - guiInline = true, - name = L['Grouping & Sorting'], - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raidpet");MOD:SetGroupFrame('raidpet', true)end, - args = { + showBy = { + order = 2, + name = L["Growth Direction"], + desc = L["Growth direction from the first unitframe."], + type = "select", + values = { + DOWN_RIGHT = format(L["%s and then %s"], L["Down"], L["Right"]), + DOWN_LEFT = format(L["%s and then %s"], L["Down"], L["Left"]), + UP_RIGHT = format(L["%s and then %s"], L["Up"], L["Right"]), + UP_LEFT = format(L["%s and then %s"], L["Up"], L["Left"]), + RIGHT_DOWN = format(L["%s and then %s"], L["Right"], L["Down"]), + RIGHT_UP = format(L["%s and then %s"], L["Right"], L["Up"]), + LEFT_DOWN = format(L["%s and then %s"], L["Left"], L["Down"]), + LEFT_UP = format(L["%s and then %s"], L["Left"], L["Up"]), + }, + }, sortMethod = { - order = 1, - name = L['Group By'], - desc = L['Set the order that the group will sort.'], - type = 'select', + order = 3, + name = L["Group By"], + desc = L["Set the order that the group will sort."], + type = "select", values = { - ['NAME'] = L['Owners Name'], - ['PETNAME'] = L['Pet Name'], - ['GROUP'] = GROUP, - }, - }, + ["CLASS"] = CLASS, + ["ROLE"] = ROLE.."(Tanks, Healers, DPS)", + ["ROLE_TDH"] = ROLE.."(Tanks, DPS, Healers)", + ["ROLE_HDT"] = ROLE.."(Healers, DPS, Tanks)", + ["ROLE_HTD"] = ROLE.."(Healers, Tanks, DPS)", + ["NAME"] = NAME, + ["MTMA"] = L["Main Tanks / Main Assist"], + ["GROUP"] = GROUP, + }, + }, sortDir = { - order = 2, - name = L['Sort Direction'], - desc = L['Defines the sort order of the selected sort method.'], - type = 'select', + order = 4, + name = L["Sort Direction"], + desc = L["Defines the sort order of the selected sort method."], + type = "select", values = { - ['ASC'] = L['Ascending'], - ['DESC'] = L['Descending'], - }, - }, - spacer = { - order = 3, - type = 'description', - width = 'full', - name = ' ', - }, - invertGroupingOrder = { - order = 4, - name = L['Invert Grouping Order'], - desc = L['Enabling this inverts the grouping order when the raid is not full, this will reverse the direction it starts from.'], - disabled = function()return not SV.db.SVUnit['raidpet'].customSorting end, - type = 'toggle', + ["ASC"] = L["Ascending"], + ["DESC"] = L["Descending"], + }, }, - }, + } } - } + }, }, - misc = ns:SetMiscConfigGroup(true, MOD.SetGroupFrame, 'raidpet'), - health = ns:SetHealthConfigGroup(true, MOD.SetGroupFrame, 'raidpet'), - name = ns:SetNameConfigGroup(MOD.SetGroupFrame, 'raidpet'), - buffs = ns:SetAuraConfigGroup(true, 'buffs', true, MOD.SetGroupFrame, 'raidpet'), - debuffs = ns:SetAuraConfigGroup(true, 'debuffs', true, MOD.SetGroupFrame, 'raidpet'), - auraWatch = { - order = 600, - type = 'group', - name = L['Aura Watch'], - args = { - enable = { - type = "toggle", - name = L["Enable"], - order = 1, - get = function(l)return SV.db.SVUnit["raidpet"].auraWatch.enable end, - set = function(l, m)MOD:ChangeDBVar(m, "enable", "raidpet", "auraWatch");MOD:SetGroupFrame('raidpet')end, - }, - size = { - type = "range", - name = L["Size"], - desc = L["Size of the indicator icon."], - order = 2, - min = 4, - max = 15, - step = 1, - get = function(l)return SV.db.SVUnit["raidpet"].auraWatch.size end, - set = function(l, m)MOD:ChangeDBVar(m, "size", "raidpet", "auraWatch");MOD:SetGroupFrame('raidpet')end, - }, - configureButton = { - type = 'execute', - name = L['Configure Auras'], - func = function()ns:SetToFilterConfig('BuffWatch')end, - order = 3, - }, - }, + } + }, + misc = ns:SetMiscConfigGroup(true, MOD.SetGroupFrame, 'raidpet'), + health = ns:SetHealthConfigGroup(true, MOD.SetGroupFrame, 'raidpet'), + name = ns:SetNameConfigGroup(MOD.SetGroupFrame, 'raidpet'), + buffs = ns:SetAuraConfigGroup(true, 'buffs', true, MOD.SetGroupFrame, 'raidpet'), + debuffs = ns:SetAuraConfigGroup(true, 'debuffs', true, MOD.SetGroupFrame, 'raidpet'), + auraWatch = { + order = 600, + type = 'group', + name = L['Aura Watch'], + args = { + enable = { + type = "toggle", + name = L["Enable"], + order = 1, + get = function(l)return SV.db.SVUnit["raidpet"].auraWatch.enable end, + set = function(l, m)MOD:ChangeDBVar(m, "enable", "raidpet", "auraWatch");MOD:SetGroupFrame('raidpet')end, + }, + size = { + type = "range", + name = L["Size"], + desc = L["Size of the indicator icon."], + order = 2, + min = 4, + max = 15, + step = 1, + get = function(l)return SV.db.SVUnit["raidpet"].auraWatch.size end, + set = function(l, m)MOD:ChangeDBVar(m, "size", "raidpet", "auraWatch");MOD:SetGroupFrame('raidpet')end, + }, + configureButton = { + type = 'execute', + name = L['Configure Auras'], + func = function()ns:SetToFilterConfig('BuffWatch')end, + order = 3, }, - rdebuffs = { - order = 700, - type = 'group', - name = L['RaidDebuff Indicator'], - get = function(l)return - SV.db.SVUnit['raidpet']['rdebuffs'][l[#l]]end, - set = function(l, m) MOD:ChangeDBVar(m, l[#l], "raidpet", "rdebuffs"); MOD:SetGroupFrame('raidpet')end, - args = { - enable = { - type = 'toggle', - name = L['Enable'], - order = 1, - }, - size = { - type = 'range', - name = L['Size'], - order = 2, - min = 8, - max = 35, - step = 1, - }, - xOffset = { - order = 3, - type = 'range', - name = L['xOffset'], - min = - 300, - max = 300, - step = 1, - }, - yOffset = { - order = 4, - type = 'range', - name = L['yOffset'], - min = - 300, - max = 300, - step = 1, - }, - configureButton = { - type = 'execute', - name = L['Configure Auras'], - func = function()ns:SetToFilterConfig('Raid')end, - order = 5, - }, - }, + }, + }, + rdebuffs = { + order = 700, + type = 'group', + name = L['RaidDebuff Indicator'], + get = function(l)return + SV.db.SVUnit['raidpet']['rdebuffs'][l[#l]]end, + set = function(l, m) MOD:ChangeDBVar(m, l[#l], "raidpet", "rdebuffs"); MOD:SetGroupFrame('raidpet')end, + args = { + enable = { + type = 'toggle', + name = L['Enable'], + order = 1, + }, + size = { + type = 'range', + name = L['Size'], + order = 2, + min = 8, + max = 35, + step = 1, + }, + xOffset = { + order = 3, + type = 'range', + name = L['xOffset'], + min = - 300, + max = 300, + step = 1, + }, + yOffset = { + order = 4, + type = 'range', + name = L['yOffset'], + min = - 300, + max = 300, + step = 1, + }, + configureButton = { + type = 'execute', + name = L['Configure Auras'], + func = function()ns:SetToFilterConfig('Raid')end, + order = 5, }, - icons = ns:SetIconConfigGroup(MOD.SetGroupFrame, 'raidpet'), }, }, + icons = ns:SetIconConfigGroup(MOD.SetGroupFrame, 'raidpet'), }, } \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/target.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/target.lua index 682a160..c71d528 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/target.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/target.lua @@ -39,153 +39,157 @@ local _, ns = ... ################################################################################################## ################################################################################################## ]] -SV.Options.args.SVUnit.args.target={ +SV.Options.args.SVUnit.args.commonGroup.args.target={ name = L['Target'], type = 'group', order = 6, - childGroups = "tab", + childGroups = "select", get=function(l)return SV.db.SVUnit['target'][l[#l]]end, set=function(l,m)MOD:ChangeDBVar(m, l[#l], "target");MOD:SetUnitFrame('target')end, args={ enable={type='toggle',order=1,name=L['Enable']}, resetSettings={type='execute',order=2,name=L['Restore Defaults'],func=function(l,m)MOD:ResetUnitOptions('target')SV.Mentalo:Reset('Target Frame')end}, - tabGroups={ - order=3, - type='group', - name=L['Unit Options'], - childGroups="tree", - args={ - commonGroup = { - order = 1, - type = 'group', - name = L['General Settings'], + spacer1 = { + order = 3, + name = "", + type = "description", + width = "full", + }, + spacer2 = { + order = 4, + name = "", + type = "description", + width = "full", + }, + commonGroup = { + order = 5, + type = 'group', + name = L['General Settings'], + args = { + baseGroup = { + order = 1, + type = "group", + guiInline = true, + name = L["Base Settings"], args = { - baseGroup = { - order = 1, - type = "group", - guiInline = true, - name = L["Base Settings"], - args = { - showAuras = { - order = 1, - type = "execute", - name = L["Show Auras"], - func = function()local U = SVUI_Target;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("target")end - }, - gps = { - order = 2, - name = "GPS Tracking", - desc = "Show an arrow giving the direction and distance to the frames unit.", - type = "toggle", - }, - predict = { - order = 3, - name = L["Heal Prediction"], - desc = L["Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."], - type = "toggle" - }, - hideonnpc = { - type = "toggle", - order = 4, - name = L["Text Toggle On NPC"], - desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], - get = function(l)return SV.db.SVUnit["target"]["power"].hideonnpc end, - set = function(l, m)SV.db.SVUnit["target"]["power"].hideonnpc = m;MOD:SetUnitFrame("target")end - }, - threatEnabled = { - type = "toggle", - order = 5, - name = L["Show Threat"] - }, - middleClickFocus = { - order = 6, - name = L["Middle Click - Set Focus"], - desc = L["Middle clicking the unit frame will cause your focus to match the unit."], - type = "toggle", - disabled = function()return IsAddOnLoaded("Clique")end - }, - - } + showAuras = { + order = 1, + type = "execute", + name = L["Show Auras"], + func = function()local U = SVUI_Target;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("target")end }, - sizeGroup = { + gps = { order = 2, - guiInline = true, - type = "group", - name = L["Size Settings"], - args = { - width = { - order = 1, - name = L["Width"], - type = "range", - width = "full", - min = 50, - max = 500, - step = 1, - set = function(l, m) - if SV.db.SVUnit["target"].castbar.width == SV.db.SVUnit["target"][l[#l]] then - SV.db.SVUnit["target"].castbar.width = m - end - MOD:ChangeDBVar(m, l[#l], "target"); - MOD:SetUnitFrame("target") - end - }, - height = { - order = 2, - name = L["Height"], - type = "range", - width = "full", - min = 10, - max = 250, - step = 1 - }, - } - } + name = "GPS Tracking", + desc = "Show an arrow giving the direction and distance to the frames unit.", + type = "toggle", + }, + predict = { + order = 3, + name = L["Heal Prediction"], + desc = L["Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."], + type = "toggle" + }, + hideonnpc = { + type = "toggle", + order = 4, + name = L["Text Toggle On NPC"], + desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], + get = function(l)return SV.db.SVUnit["target"]["power"].hideonnpc end, + set = function(l, m)SV.db.SVUnit["target"]["power"].hideonnpc = m;MOD:SetUnitFrame("target")end + }, + threatEnabled = { + type = "toggle", + order = 5, + name = L["Show Threat"] + }, + middleClickFocus = { + order = 6, + name = L["Middle Click - Set Focus"], + desc = L["Middle clicking the unit frame will cause your focus to match the unit."], + type = "toggle", + disabled = function()return IsAddOnLoaded("Clique")end + }, + } }, - combobar = { - order = 800, - type = "group", - name = L["Combobar"], - get = function(l)return SV.db.SVUnit["target"]["combobar"][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "target", "combobar");MOD:SetUnitFrame("target")end, + sizeGroup = { + order = 2, + guiInline = true, + type = "group", + name = L["Size Settings"], args = { - enable = { - type = "toggle", + width = { order = 1, - name = L["Enable"] - }, - smallIcons = { - type = "toggle", - name = L["Small Points"], - order = 2 + name = L["Width"], + type = "range", + width = "full", + min = 50, + max = 500, + step = 1, + set = function(l, m) + if SV.db.SVUnit["target"].castbar.width == SV.db.SVUnit["target"][l[#l]] then + SV.db.SVUnit["target"].castbar.width = m + end + MOD:ChangeDBVar(m, l[#l], "target"); + MOD:SetUnitFrame("target") + end }, height = { - type = "range", - order = 3, + order = 2, name = L["Height"], - min = 15, - max = 45, + type = "range", + width = "full", + min = 10, + max = 250, step = 1 }, - autoHide = { - type = "toggle", - name = L["Auto-Hide"], - order = 4 - } } + } + } + }, + combobar = { + order = 800, + type = "group", + name = L["Combobar"], + get = function(l)return SV.db.SVUnit["target"]["combobar"][l[#l]]end, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "target", "combobar");MOD:SetUnitFrame("target")end, + args = { + enable = { + type = "toggle", + order = 1, + name = L["Enable"] + }, + smallIcons = { + type = "toggle", + name = L["Small Points"], + order = 2 + }, + height = { + type = "range", + order = 3, + name = L["Height"], + min = 15, + max = 45, + step = 1 }, - misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "target"), - health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "target"), - power = ns:SetPowerConfigGroup(true, MOD.SetUnitFrame, "target"), - name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "target"), - portrait = ns:SetPortraitConfigGroup(MOD.SetUnitFrame, "target"), - buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetUnitFrame, "target"), - debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetUnitFrame, "target"), - castbar = ns:SetCastbarConfigGroup(MOD.SetUnitFrame, "target"), - aurabar = ns:SetAurabarConfigGroup(false, MOD.SetUnitFrame, "target"), - icons = ns:SetIconConfigGroup(MOD.SetUnitFrame, "target") + autoHide = { + type = "toggle", + name = L["Auto-Hide"], + order = 4 + } } - } + }, + misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "target"), + health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "target"), + power = ns:SetPowerConfigGroup(true, MOD.SetUnitFrame, "target"), + name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "target"), + portrait = ns:SetPortraitConfigGroup(MOD.SetUnitFrame, "target"), + buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetUnitFrame, "target"), + debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetUnitFrame, "target"), + castbar = ns:SetCastbarConfigGroup(MOD.SetUnitFrame, "target"), + aurabar = ns:SetAurabarConfigGroup(false, MOD.SetUnitFrame, "target"), + icons = ns:SetIconConfigGroup(MOD.SetUnitFrame, "target") } } --[[ @@ -193,102 +197,106 @@ SV.Options.args.SVUnit.args.target={ ################################################################################################## ################################################################################################## ]] -SV.Options.args.SVUnit.args.targettarget={ +SV.Options.args.SVUnit.args.commonGroup.args.targettarget={ name=L['Target of Target'], type='group', order=7, - childGroups="tab", + childGroups="select", get=function(l)return SV.db.SVUnit['targettarget'][l[#l]]end, set=function(l,m)MOD:ChangeDBVar(m, l[#l], "targettarget");MOD:SetUnitFrame('targettarget')end, args={ enable={type='toggle',order=1,name=L['Enable']}, resetSettings={type='execute',order=2,name=L['Restore Defaults'],func=function(l,m)MOD:ResetUnitOptions('targettarget')SV.Mentalo:Reset('TargetTarget Frame')end}, - tabGroups={ - order=3, - type='group', - name=L['Unit Options'], - childGroups="tree", - args={ - commonGroup = { - order = 1, - type = 'group', - name = L['General Settings'], + spacer1 = { + order = 3, + name = "", + type = "description", + width = "full", + }, + spacer2 = { + order = 4, + name = "", + type = "description", + width = "full", + }, + commonGroup = { + order = 5, + type = 'group', + name = L['General Settings'], + args = { + baseGroup = { + order = 1, + type = "group", + guiInline = true, + name = L["Base Settings"], args = { - baseGroup = { - order = 1, - type = "group", - guiInline = true, - name = L["Base Settings"], - args = { - showAuras = { - order = 1, - type = "execute", - name = L["Show Auras"], - func = function()local U = SVUI_TargetTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("targettarget")end - }, - spacer1 = { - order = 2, - type = "description", - name = "", - }, - rangeCheck = { - order = 3, - name = L["Range Check"], - desc = L["Check if you are in range to cast spells on this specific unit."], - type = "toggle" - }, - hideonnpc = { - type = "toggle", - order = 4, - name = L["Text Toggle On NPC"], - desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], - get = function(l)return SV.db.SVUnit["target"]["power"].hideonnpc end, - set = function(l, m)SV.db.SVUnit["target"]["power"].hideonnpc = m;MOD:SetUnitFrame("target")end - }, - threatEnabled = { - type = "toggle", - order = 5, - name = L["Show Threat"] - } - } + showAuras = { + order = 1, + type = "execute", + name = L["Show Auras"], + func = function()local U = SVUI_TargetTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("targettarget")end }, - sizeGroup = { - order = 2, - guiInline = true, - type = "group", - name = L["Size Settings"], - args = { - width = { - order = 1, - name = L["Width"], - type = "range", - width = "full", - min = 50, - max = 500, - step = 1, - }, - height = { - order = 2, - name = L["Height"], - type = "range", - width = "full", - min = 10, - max = 250, - step = 1 - }, - } + spacer1 = { + order = 2, + type = "description", + name = "", + }, + rangeCheck = { + order = 3, + name = L["Range Check"], + desc = L["Check if you are in range to cast spells on this specific unit."], + type = "toggle" + }, + hideonnpc = { + type = "toggle", + order = 4, + name = L["Text Toggle On NPC"], + desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], + get = function(l)return SV.db.SVUnit["target"]["power"].hideonnpc end, + set = function(l, m)SV.db.SVUnit["target"]["power"].hideonnpc = m;MOD:SetUnitFrame("target")end + }, + threatEnabled = { + type = "toggle", + order = 5, + name = L["Show Threat"] } } }, - misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "targettarget"), - health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "targettarget"), - power = ns:SetPowerConfigGroup(nil, MOD.SetUnitFrame, "targettarget"), - name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "targettarget"), - portrait = ns:SetPortraitConfigGroup(MOD.SetUnitFrame, "targettarget"), - buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetUnitFrame, "targettarget"), - debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetUnitFrame, "targettarget"), - icons = ns:SetIconConfigGroup(MOD.SetUnitFrame, "targettarget") + sizeGroup = { + order = 2, + guiInline = true, + type = "group", + name = L["Size Settings"], + args = { + width = { + order = 1, + name = L["Width"], + type = "range", + width = "full", + min = 50, + max = 500, + step = 1, + }, + height = { + order = 2, + name = L["Height"], + type = "range", + width = "full", + min = 10, + max = 250, + step = 1 + }, + } + } } - } + }, + misc = ns:SetMiscConfigGroup(false, MOD.SetUnitFrame, "targettarget"), + health = ns:SetHealthConfigGroup(false, MOD.SetUnitFrame, "targettarget"), + power = ns:SetPowerConfigGroup(nil, MOD.SetUnitFrame, "targettarget"), + name = ns:SetNameConfigGroup(MOD.SetUnitFrame, "targettarget"), + portrait = ns:SetPortraitConfigGroup(MOD.SetUnitFrame, "targettarget"), + buffs = ns:SetAuraConfigGroup(false, "buffs", false, MOD.SetUnitFrame, "targettarget"), + debuffs = ns:SetAuraConfigGroup(false, "debuffs", false, MOD.SetUnitFrame, "targettarget"), + icons = ns:SetIconConfigGroup(MOD.SetUnitFrame, "targettarget") } } \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua b/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua index 30d7653..755457e 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua @@ -50,10 +50,8 @@ if gameLocale == "enUS" then L["reset"] = "Reset Profile" L["reset_desc"] = "Reset the current profile back to its default values, in case your configuration is broken, or you simply want to start over." L["reset_sub"] = "Reset the current profile to the default" - L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" - L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" - L["SVUI_DockTopCenterLeft"] = "Top Bar Left" - L["SVUI_DockTopCenterRight"] = "Top Bar Right" + L["SVUI_DockBottomCenter"] = "Bottom Data Dock" + L["SVUI_DockTopCenter"] = "Top Data Dock" end if gameLocale == "frFR" then L["AURAS_DESC"] = "Configure les icônes qui apparaissent près de la Minicarte." @@ -86,10 +84,8 @@ if gameLocale == "frFR" then L["reset"] = "Réinitialiser le profil" L["reset_desc"] = "Réinitialise le profil actuel au cas où votre configuration est corrompue ou si vous voulez tout simplement faire table rase." L["reset_sub"] = "Réinitialise le profil actuel avec les paramètres par défaut." - L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" - L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" - L["SVUI_DockTopCenterLeft"] = "Top Bar Left" - L["SVUI_DockTopCenterRight"] = "Top Bar Right" + L["SVUI_DockBottomCenter"] = "Bottom Data Dock" + L["SVUI_DockTopCenter"] = "Top Data Dock" end if gameLocale == "deDE" then L["AURAS_DESC"] = "Konfiguriere die Symbole für die Stärkungs- und Schwächungszauber nahe der Minimap." @@ -121,10 +117,8 @@ if gameLocale == "deDE" then L["reset"] = "Profil zurücksetzen" L["reset_desc"] = "Setzt das momentane Profil auf Standardwerte zurück, für den Fall das mit der Konfiguration etwas schief lief oder weil du einfach neu starten willst." L["reset_sub"] = "Das aktuelle Profil auf Standard zurücksetzen." - L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" - L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" - L["SVUI_DockTopCenterLeft"] = "Top Bar Left" - L["SVUI_DockTopCenterRight"] = "Top Bar Right" + L["SVUI_DockBottomCenter"] = "Bottom Data Dock" + L["SVUI_DockTopCenter"] = "Top Data Dock" end if gameLocale == "itIT" then L["AURAS_DESC"] = "Configure the aura icons that appear near the minimap." @@ -157,10 +151,8 @@ if gameLocale == "itIT" then L["reset"] = "Reimposta Profilo" L["reset_desc"] = "Riporta il tuo profilo attivo alle sue impostazioni di default, nel caso in cui la tua configurazione si sia corrotta, o semplicemente tu voglia re-inizializzarla." L["reset_sub"] = "Reimposta il profilo ai suoi valori di default." - L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" - L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" - L["SVUI_DockTopCenterLeft"] = "Top Bar Left" - L["SVUI_DockTopCenterRight"] = "Top Bar Right" + L["SVUI_DockBottomCenter"] = "Bottom Data Dock" + L["SVUI_DockTopCenter"] = "Top Data Dock" end if gameLocale == "koKR" then L["AURAS_DESC"] = "Configure the aura icons that appear near the minimap." @@ -193,10 +185,8 @@ if gameLocale == "koKR" then L["reset"] = "프로필 초기화" L["reset_desc"] = "단순히 다시 새롭게 구성을 원하는 경우, 현재 프로필을 기본값으로 초기화 합니다." L["reset_sub"] = "현재의 프로필을 기본값으로 초기화 합니다" - L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" - L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" - L["SVUI_DockTopCenterLeft"] = "Top Bar Left" - L["SVUI_DockTopCenterRight"] = "Top Bar Right" + L["SVUI_DockBottomCenter"] = "Bottom Data Dock" + L["SVUI_DockTopCenter"] = "Top Data Dock" end if gameLocale == "ptBR" then L["AURAS_DESC"] = "Configurar os ícones das auras que aparecem perto do minimapa." @@ -210,10 +200,8 @@ if gameLocale == "ptBR" then L["TOGGLEART_DESC"] = "Ativa / Desativa a aparência deste quadro." L["TOOLTIP_DESC"] = "Opções de configuração para a Tooltip." L["TEXT_FORMAT_DESC"] = "Select the formatting of this text" - L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" - L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" - L["SVUI_DockTopCenterLeft"] = "Top Bar Left" - L["SVUI_DockTopCenterRight"] = "Top Bar Right" + L["SVUI_DockBottomCenter"] = "Bottom Data Dock" + L["SVUI_DockTopCenter"] = "Top Data Dock" end if gameLocale == "ruRU" then L["AURAS_DESC"] = "Настройка иконок эффектов, находящихся у миникарты." @@ -246,10 +234,8 @@ if gameLocale == "ruRU" then L["reset"] = "Сброс профиля" L["reset_desc"] = "Если ваша конфигурации испорчена или если вы хотите настроить всё заново - сбросьте текущий профиль на стандартные значения." L["reset_sub"] = "Сброс текущего профиля на стандартный" - L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" - L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" - L["SVUI_DockTopCenterLeft"] = "Top Bar Left" - L["SVUI_DockTopCenterRight"] = "Top Bar Right" + L["SVUI_DockBottomCenter"] = "Bottom Data Dock" + L["SVUI_DockTopCenter"] = "Top Data Dock" end if gameLocale == "esES" or gameLocale == "esMX" then L["AURAS_DESC"] = "Configura los iconos de las auras que aparecen cerca del minimapa." @@ -282,10 +268,8 @@ if gameLocale == "esES" or gameLocale == "esMX" then L["reset"] = "Reiniciar Perfil" L["reset_desc"] = "Reinicia el perfil actual a los valores por defectos, en caso de que se haya estropeado la configuración o quieras volver a empezar de nuevo." L["reset_sub"] = "Reinicar el perfil actual al de por defecto" - L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" - L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" - L["SVUI_DockTopCenterLeft"] = "Top Bar Left" - L["SVUI_DockTopCenterRight"] = "Top Bar Right" + L["SVUI_DockBottomCenter"] = "Bottom Data Dock" + L["SVUI_DockTopCenter"] = "Top Data Dock" end if gameLocale == "zhTW" then L["AURAS_DESC"] = "小地圖旁的光環圖示設定." @@ -318,10 +302,8 @@ if gameLocale == "zhTW" then L["reset"] = "重置設定檔" L["reset_desc"] = "將當前的設定檔恢復到它的預設值,用於你的設定檔損壞,或者你只是想重來的情況。" L["reset_sub"] = "將當前的設定檔恢復為預設值" - L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" - L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" - L["SVUI_DockTopCenterLeft"] = "Top Bar Left" - L["SVUI_DockTopCenterRight"] = "Top Bar Right" + L["SVUI_DockBottomCenter"] = "Bottom Data Dock" + L["SVUI_DockTopCenter"] = "Top Data Dock" end if gameLocale == "zhCN" then L["AURAS_DESC"] = "小地图旁的光环图标设置." @@ -354,8 +336,6 @@ if gameLocale == "zhCN" then L["reset"] = "重置配置文件" L["reset_desc"] = "将当前的配置文件恢复到它的默认值,用于你的配置文件损坏,或者你只是想重来的情况。" L["reset_sub"] = "将当前的配置文件恢复为默认值" - L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" - L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" - L["SVUI_DockTopCenterLeft"] = "Top Bar Left" - L["SVUI_DockTopCenterRight"] = "Top Bar Right" + L["SVUI_DockBottomCenter"] = "Bottom Data Dock" + L["SVUI_DockTopCenter"] = "Top Data Dock" end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua index 37a9d10..c9f36e5 100644 --- a/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua +++ b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua @@ -93,7 +93,7 @@ LOCAL VARS ]]-- local currentModeKey = false; local ModeLogsFrame = CreateFrame("Frame", "SVUI_ModeLogsFrame", UIParent) -local classColors = SVUI_CLASS_COLORS[SV.class] +local classColors = CUSTOM_CLASS_COLORS[SV.class] local classR, classG, classB = classColors.r, classColors.g, classColors.b local classA = 0.35 local lastClickTime; @@ -270,7 +270,7 @@ function PLUGIN:EndJobModes() self[currentModeKey].Disable() end currentModeKey = false; - if self.Docklet:IsShown() then self.Docklet.DockButton:Click() end + --if self.Docklet:IsShown() then self.Docklet.DockButton:Click() end self:ChangeModeGear() self.ModeAlert:Hide(); SendModeMessage("Mode Disabled", CombatText_StandardScroll, 1, 0.35, 0); @@ -306,7 +306,7 @@ function PLUGIN:ChangeModeGear() end function PLUGIN:UpdateLogWindow() - self.LogWindow:SetFont(SV.Media.font.system, self.db.fontSize, "OUTLINE") + self.LogWindow:SetFont(SV.Media.font.names, self.db.fontSize, "OUTLINE") end function PLUGIN:SKILL_LINES_CHANGED() @@ -349,16 +349,14 @@ end local ModeAlert_OnShow = function(self) if InCombatLockdown() then SV:AddonMessage(ERR_NOT_IN_COMBAT); - self:Hide() return; end - SV:SecureFadeIn(self, 0.3, 0, 1) PLUGIN.Docklet.Parent.Alert:Activate(self) end local ModeAlert_OnMouseDown = function(self) PLUGIN:EndJobModes() - SV:SecureFadeOut(self, 0.5, 1, 0, true) + self:FadeOut(0.5, 1, 0, true) end local ModeButton_OnEnter = function(self) @@ -397,7 +395,7 @@ local function ResizeCraftingDock() SVUI_ModeButton1:SetSize(BUTTON_SIZE,BUTTON_SIZE); end -LibSuperVillain("Registry"):NewCallback("DOCKS_UPDATED", "ResizeCraftingDock", ResizeCraftingDock); +SV.Events:On("DOCKS_UPDATED", "ResizeCraftingDock", ResizeCraftingDock); --[[ ########################################################## BUILD FUNCTION @@ -424,7 +422,7 @@ function PLUGIN:Load() mode4Button:SetSize(BUTTON_SIZE,BUTTON_SIZE) mode4Button.icon = mode4Button:CreateTexture(nil, 'OVERLAY') mode4Button.icon:SetTexture(FARM_ICON) - mode4Button.icon:FillInner(mode4Button) + mode4Button.icon:SetAllPointsIn(mode4Button) mode4Button.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) mode4Button.modeName = "Farming" mode4Button:SetScript('OnEnter', ModeButton_OnEnter) @@ -436,7 +434,7 @@ function PLUGIN:Load() mode3Button:SetSize(BUTTON_SIZE,BUTTON_SIZE) mode3Button.icon = mode3Button:CreateTexture(nil, 'OVERLAY') mode3Button.icon:SetTexture(ARCH_ICON) - mode3Button.icon:FillInner(mode3Button) + mode3Button.icon:SetAllPointsIn(mode3Button) mode3Button.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) mode3Button.modeName = "Archaeology" mode3Button:SetScript('OnEnter', ModeButton_OnEnter) @@ -448,7 +446,7 @@ function PLUGIN:Load() mode2Button:SetSize(BUTTON_SIZE,BUTTON_SIZE) mode2Button.icon = mode2Button:CreateTexture(nil, 'OVERLAY') mode2Button.icon:SetTexture(FISH_ICON) - mode2Button.icon:FillInner(mode2Button) + mode2Button.icon:SetAllPointsIn(mode2Button) mode2Button.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) mode2Button.modeName = "Fishing" mode2Button:SetScript('OnEnter', ModeButton_OnEnter) @@ -460,7 +458,7 @@ function PLUGIN:Load() mode1Button:SetSize(BUTTON_SIZE,BUTTON_SIZE) mode1Button.icon = mode1Button:CreateTexture(nil, 'OVERLAY') mode1Button.icon:SetTexture(COOK_ICON) - mode1Button.icon:FillInner(mode1Button) + mode1Button.icon:SetAllPointsIn(mode1Button) mode1Button.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) mode1Button.modeName = "Cooking" mode1Button:SetScript('OnEnter', ModeButton_OnEnter) @@ -511,7 +509,7 @@ function PLUGIN:Load() title:SetFrameStrata("MEDIUM") title:SetPoint("TOPLEFT",ModeLogsFrame,"TOPLEFT",0,0) title:SetPoint("BOTTOMRIGHT",ModeLogsFrame,"TOPRIGHT",0,-20) - title:FontManager(UNIT_NAME_FONT, 16, "OUTLINE", "CENTER", "MIDDLE") + title:FontManager("title") title:SetMaxLines(1) title:EnableMouseWheel(false) title:SetFading(false) @@ -535,7 +533,7 @@ function PLUGIN:Load() log:SetFrameStrata("MEDIUM") log:SetPoint("TOPLEFT",title,"BOTTOMLEFT",0,0) log:SetPoint("BOTTOMRIGHT",ModeLogsFrame,"BOTTOMRIGHT",0,0) - log:FontManager(nil, self.db.fontSize, "OUTLINE") + log:FontManager("default") log:SetJustifyH("CENTER") log:SetJustifyV("MIDDLE") log:SetShadowColor(0, 0, 0, 0) @@ -554,7 +552,7 @@ function PLUGIN:Load() self.ModeAlert = ModeAlert self.TitleWindow = title self.LogWindow = log - self.Docklet:Hide() + --self.Docklet:Hide() self.ListenerEnabled = false; self:CraftingReset() self:LoadCookingMode() diff --git a/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.toc b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.toc index e29e0f6..8b59697 100644 --- a/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.toc +++ b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.toc @@ -1,6 +1,6 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 5.3.9 +## Version: 5.4.08 ## Title: |cffFF9900SVUI |r|cffFFEF00Craft-O-Matic|r ## Notes: Supervillain UI [|cff9911FFProfession Tools|r]. ## SavedVariablesPerCharacter: CraftOMatic_Profile, CraftOMatic_Cache diff --git a/Interface/AddOns/SVUI_CraftOMatic/components/archaeology.lua b/Interface/AddOns/SVUI_CraftOMatic/components/archaeology.lua index c3101ce..ce80d6d 100644 --- a/Interface/AddOns/SVUI_CraftOMatic/components/archaeology.lua +++ b/Interface/AddOns/SVUI_CraftOMatic/components/archaeology.lua @@ -58,7 +58,7 @@ local ModeLogsFrame; local ArchRaces = GetNumArchaeologyRaces() -local COUNT_TEX = [[Interface\AddOns\SVUI\assets\artwork\icons\NUMBER-]] +local COUNT_TEX = [[Interface\AddOns\SVUI\assets\artwork\Numbers\TYPE2\NUM]] local refArtifacts = {}; for i = 1, ArchRaces do @@ -438,7 +438,7 @@ function PLUGIN:LoadArchaeologyMode() ArchCrafting:SetParent(ModeLogsFrame) ArchCrafting:SetFrameStrata("MEDIUM") - ArchCrafting:FillInner(ModeLogsFrame) + ArchCrafting:SetAllPointsIn(ModeLogsFrame) local BAR_WIDTH = (ArchCrafting:GetWidth() * 0.33) - 4 local BAR_HEIGHT = (ArchCrafting:GetHeight() / 5) - 4 @@ -448,7 +448,7 @@ function PLUGIN:LoadArchaeologyMode() local solve = CreateFrame("Button", nil, bar, "SecureHandlerClickTemplate") local yOffset,xOffset = 0,0; - bar:SetPanelTemplate("Bar") + bar:SetStylePanel("Default", "Bar") bar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) bar:SetSize(BAR_WIDTH,BAR_HEIGHT) if(i > 10) then @@ -473,7 +473,7 @@ function PLUGIN:LoadArchaeologyMode() -- Progress Text local progress = bar:CreateFontString() - progress:SetFont(SV.Media.font.roboto, 11, "OUTLINE") + progress:SetFont(SV.Media.font.default, 11, "OUTLINE") progress:SetText("") progress:SetPoint("BOTTOMRIGHT", bar, "BOTTOMRIGHT", -1, 1) @@ -486,7 +486,7 @@ function PLUGIN:LoadArchaeologyMode() solve.bg:SetVertexColor(0.1,0.5,0) solve.text = solve:CreateFontString(nil,"OVERLAY") - solve.text:SetFont(SV.Media.font.roboto, 14, "NONE") + solve.text:SetFont(SV.Media.font.default, 14, "NONE") solve.text:SetShadowOffset(-1,-1) solve.text:SetShadowColor(0,0,0,0.5) solve.text:SetText(SOLVE) diff --git a/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua b/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua index 017f85b..ae7f86d 100644 --- a/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua +++ b/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua @@ -271,10 +271,10 @@ do local function CreateFarmingButton(index, owner, buttonName, buttonType, name, texture, allowDrop, showCount) local BUTTONSIZE = owner.ButtonSize; local button = CreateFrame("Button", ("FarmingButton"..buttonName.."%d"):format(index), owner, "SecureActionButtonTemplate") - button:SetFixedPanelTemplate("Transparent") + button:SetStylePanel("Fixed", "Transparent") button.Panel:SetFrameLevel(0) button:SetNormalTexture(nil) - button:Size(BUTTONSIZE, BUTTONSIZE) + button:SetSizeToScale(BUTTONSIZE, BUTTONSIZE) button.sortname = name button.itemId = index button.allowDrop = allowDrop @@ -283,10 +283,10 @@ do button.icon = button:CreateTexture(nil, "OVERLAY", nil, 2) button.icon:SetTexture(texture) button.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - button.icon:FillInner(button,2,2) + button.icon:SetAllPointsIn(button,2,2) if showCount then button.text = button:CreateFontString(nil, "OVERLAY") - button.text:SetFont(SV.Media.font.action, 12, "OUTLINE") + button.text:SetFont(SV.Media.font.numbers, 12, "OUTLINE") button.text:SetPoint("BOTTOMRIGHT", button, 1, 2) end button.cooldown = CreateFrame("Cooldown", ("FarmingButton"..buttonName.."%dCooldown"):format(index), button) @@ -439,8 +439,8 @@ function PLUGIN:RefreshFarmingTools() count = 0 for i, button in ipairs(seedButtons[i]) do local BUTTONSIZE = seedBar.ButtonSize; - button:Point("TOPLEFT", seedBar, "TOPLEFT", horizontal and (count * (BUTTONSIZE + BUTTONSPACE) + 1) or 1, horizontal and -1 or -(count * (BUTTONSIZE + BUTTONSPACE) + 1)) - button:Size(BUTTONSIZE,BUTTONSIZE) + button:SetPointToScale("TOPLEFT", seedBar, "TOPLEFT", horizontal and (count * (BUTTONSIZE + BUTTONSPACE) + 1) or 1, horizontal and -1 or -(count * (BUTTONSIZE + BUTTONSPACE) + 1)) + button:SetSizeToScale(BUTTONSIZE,BUTTONSIZE) if (not self.db.farming.onlyactive or (self.db.farming.onlyactive and button.items > 0)) then button.icon:SetVertexColor(1,1,1) count = count + 1 @@ -472,8 +472,8 @@ function PLUGIN:RefreshFarmingTools() FarmToolBar:SetAllPoints(FarmToolBarAnchor) for i, button in ipairs(farmToolButtons) do local BUTTONSIZE = FarmToolBar.ButtonSize; - button:Point("TOPLEFT", FarmToolBar, "TOPLEFT", horizontal and (count * (BUTTONSIZE + BUTTONSPACE) + 1) or 1, horizontal and -1 or -(count * (BUTTONSIZE + BUTTONSPACE) + 1)) - button:Size(BUTTONSIZE,BUTTONSIZE) + button:SetPointToScale("TOPLEFT", FarmToolBar, "TOPLEFT", horizontal and (count * (BUTTONSIZE + BUTTONSPACE) + 1) or 1, horizontal and -1 or -(count * (BUTTONSIZE + BUTTONSPACE) + 1)) + button:SetSizeToScale(BUTTONSIZE,BUTTONSIZE) if (not self.db.farming.onlyactive or (self.db.farming.onlyactive and button.items > 0)) then button:Show() button.icon:SetVertexColor(1,1,1) @@ -500,8 +500,8 @@ function PLUGIN:RefreshFarmingTools() FarmPortalBar:SetAllPoints(FarmPortalBarAnchor) for i, button in ipairs(portalButtons) do local BUTTONSIZE = FarmPortalBar.ButtonSize; - button:Point("TOPLEFT", FarmPortalBar, "TOPLEFT", horizontal and (count * (BUTTONSIZE + BUTTONSPACE) + 1) or 1, horizontal and -1 or -(count * (BUTTONSIZE + BUTTONSPACE) + 1)) - button:Size(BUTTONSIZE,BUTTONSIZE) + button:SetPointToScale("TOPLEFT", FarmPortalBar, "TOPLEFT", horizontal and (count * (BUTTONSIZE + BUTTONSPACE) + 1) or 1, horizontal and -1 or -(count * (BUTTONSIZE + BUTTONSPACE) + 1)) + button:SetSizeToScale(BUTTONSIZE,BUTTONSIZE) if (not self.db.farming.onlyactive or (self.db.farming.onlyactive and button.items > 0)) then button:Show() button.icon:SetVertexColor(1,1,1) @@ -552,7 +552,7 @@ function PLUGIN:PrepareFarmingTools() slotSlider:SetPoint("BOTTOMLEFT", farmingDocklet, -28, 0); slotSlider:SetBackdrop({bgFile = bgTex, edgeFile = bdTex, edgeSize = 4, insets = {left = 3, right = 3, top = 3, bottom = 3}}); slotSlider:SetFrameLevel(6) - slotSlider:SetFixedPanelTemplate("Transparent", true); + slotSlider:SetStylePanel("Fixed", "Transparent", true); slotSlider:SetThumbTexture("Interface\\Buttons\\UI-ScrollBar-Knob"); slotSlider:SetOrientation("VERTICAL"); slotSlider:SetValueStep(5); @@ -569,33 +569,33 @@ function PLUGIN:PrepareFarmingTools() -- FARM TOOLS local farmToolBarAnchor = CreateFrame("Frame", "FarmToolBarAnchor", farmingDockletSlots) - farmToolBarAnchor:Point("TOPLEFT", farmingDockletSlots, "TOPLEFT", 0, 0) - farmToolBarAnchor:Size(horizontal and ((TOOLSIZE + BUTTONSPACE) * 4) or (TOOLSIZE + BUTTONSPACE), horizontal and (TOOLSIZE + BUTTONSPACE) or ((TOOLSIZE + BUTTONSPACE) * 4)) + farmToolBarAnchor:SetPointToScale("TOPLEFT", farmingDockletSlots, "TOPLEFT", 0, 0) + farmToolBarAnchor:SetSizeToScale(horizontal and ((TOOLSIZE + BUTTONSPACE) * 4) or (TOOLSIZE + BUTTONSPACE), horizontal and (TOOLSIZE + BUTTONSPACE) or ((TOOLSIZE + BUTTONSPACE) * 4)) local farmToolBar = CreateFrame("Frame", "FarmToolBar", farmToolBarAnchor) - farmToolBar:Size(horizontal and ((TOOLSIZE + BUTTONSPACE) * 4) or (TOOLSIZE + BUTTONSPACE), horizontal and (TOOLSIZE + BUTTONSPACE) or ((TOOLSIZE + BUTTONSPACE) * 4)) + farmToolBar:SetSizeToScale(horizontal and ((TOOLSIZE + BUTTONSPACE) * 4) or (TOOLSIZE + BUTTONSPACE), horizontal and (TOOLSIZE + BUTTONSPACE) or ((TOOLSIZE + BUTTONSPACE) * 4)) farmToolBar:SetPoint("TOPLEFT", farmToolBarAnchor, "TOPLEFT", (horizontal and BUTTONSPACE or (TOOLSIZE + BUTTONSPACE)), (horizontal and -(TOOLSIZE + BUTTONSPACE) or -BUTTONSPACE)) farmToolBar.ButtonSize = TOOLSIZE; -- PORTALS local farmPortalBarAnchor = CreateFrame("Frame", "FarmPortalBarAnchor", farmingDockletSlots) - farmPortalBarAnchor:Point("TOPLEFT", farmToolBarAnchor, "TOPRIGHT", 0, 0) - farmPortalBarAnchor:Size(horizontal and ((TOOLSIZE + BUTTONSPACE) * 4) or (TOOLSIZE + BUTTONSPACE), horizontal and (TOOLSIZE + BUTTONSPACE) or ((TOOLSIZE + BUTTONSPACE) * 4)) + farmPortalBarAnchor:SetPointToScale("TOPLEFT", farmToolBarAnchor, "TOPRIGHT", 0, 0) + farmPortalBarAnchor:SetSizeToScale(horizontal and ((TOOLSIZE + BUTTONSPACE) * 4) or (TOOLSIZE + BUTTONSPACE), horizontal and (TOOLSIZE + BUTTONSPACE) or ((TOOLSIZE + BUTTONSPACE) * 4)) local farmPortalBar = CreateFrame("Frame", "FarmPortalBar", farmPortalBarAnchor) - farmPortalBar:Size(horizontal and ((TOOLSIZE + BUTTONSPACE) * 4) or (TOOLSIZE + BUTTONSPACE), horizontal and (TOOLSIZE + BUTTONSPACE) or ((TOOLSIZE + BUTTONSPACE) * 4)) + farmPortalBar:SetSizeToScale(horizontal and ((TOOLSIZE + BUTTONSPACE) * 4) or (TOOLSIZE + BUTTONSPACE), horizontal and (TOOLSIZE + BUTTONSPACE) or ((TOOLSIZE + BUTTONSPACE) * 4)) farmPortalBar:SetPoint("TOPLEFT", farmPortalBarAnchor, "TOPLEFT", (horizontal and BUTTONSPACE or (TOOLSIZE + BUTTONSPACE)), (horizontal and -(TOOLSIZE + BUTTONSPACE) or -BUTTONSPACE)) farmPortalBar.ButtonSize = TOOLSIZE; -- SEEDS local farmSeedBarAnchor = CreateFrame("Frame", "FarmSeedBarAnchor", farmingDockletSlots) - farmSeedBarAnchor:Point("TOPLEFT", farmPortalBarAnchor, horizontal and "BOTTOMLEFT" or "TOPRIGHT", 0, 0) - farmSeedBarAnchor:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 10) or ((BUTTONSIZE + BUTTONSPACE) * 8), horizontal and ((BUTTONSIZE + BUTTONSPACE) * 8) or ((BUTTONSIZE + BUTTONSPACE) * 10)) + farmSeedBarAnchor:SetPointToScale("TOPLEFT", farmPortalBarAnchor, horizontal and "BOTTOMLEFT" or "TOPRIGHT", 0, 0) + farmSeedBarAnchor:SetSizeToScale(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 10) or ((BUTTONSIZE + BUTTONSPACE) * 8), horizontal and ((BUTTONSIZE + BUTTONSPACE) * 8) or ((BUTTONSIZE + BUTTONSPACE) * 10)) for i = 1, NUM_SEED_BARS do local seedBar = CreateFrame("Frame", "FarmSeedBar"..i, farmSeedBarAnchor) seedBar.ButtonSize = BUTTONSIZE; - seedBar:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 10) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 10)) + seedBar:SetSizeToScale(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 10) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 10)) if i == 1 then seedBar:SetPoint("TOPLEFT", farmSeedBarAnchor, "TOPLEFT", 0, 0) else @@ -609,11 +609,11 @@ function PLUGIN:PrepareFarmingTools() -- SEEDS local farmSeedBarAnchor = CreateFrame("Frame", "FarmSeedBarAnchor", UIParent) - farmSeedBarAnchor:Point("TOPRIGHT", SV.Screen, "TOPRIGHT", -40, -300) - farmSeedBarAnchor:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 10) or ((BUTTONSIZE + BUTTONSPACE) * 8), horizontal and ((BUTTONSIZE + BUTTONSPACE) * 8) or ((BUTTONSIZE + BUTTONSPACE) * 10)) + farmSeedBarAnchor:SetPointToScale("TOPRIGHT", SV.Screen, "TOPRIGHT", -40, -300) + farmSeedBarAnchor:SetSizeToScale(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 10) or ((BUTTONSIZE + BUTTONSPACE) * 8), horizontal and ((BUTTONSIZE + BUTTONSPACE) * 8) or ((BUTTONSIZE + BUTTONSPACE) * 10)) for i = 1, NUM_SEED_BARS do local seedBar = CreateFrame("Frame", "FarmSeedBar"..i, farmSeedBarAnchor) - seedBar:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 10) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 10)) + seedBar:SetSizeToScale(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 10) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 10)) seedBar:SetPoint("TOPRIGHT", _G["FarmSeedBarAnchor"], "TOPRIGHT", (horizontal and 0 or -((BUTTONSIZE + BUTTONSPACE) * i)), (horizontal and -((BUTTONSIZE + BUTTONSPACE) * i) or 0)) seedBar.ButtonSize = BUTTONSIZE; end @@ -621,20 +621,20 @@ function PLUGIN:PrepareFarmingTools() -- FARM TOOLS local farmToolBarAnchor = CreateFrame("Frame", "FarmToolBarAnchor", UIParent) - farmToolBarAnchor:Point("TOPRIGHT", farmSeedBarAnchor, horizontal and "BOTTOMRIGHT" or "TOPLEFT", horizontal and 0 or -(BUTTONSPACE * 2), horizontal and -(BUTTONSPACE * 2) or 0) - farmToolBarAnchor:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) + farmToolBarAnchor:SetPointToScale("TOPRIGHT", farmSeedBarAnchor, horizontal and "BOTTOMRIGHT" or "TOPLEFT", horizontal and 0 or -(BUTTONSPACE * 2), horizontal and -(BUTTONSPACE * 2) or 0) + farmToolBarAnchor:SetSizeToScale(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) local farmToolBar = CreateFrame("Frame", "FarmToolBar", farmToolBarAnchor) - farmToolBar:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) + farmToolBar:SetSizeToScale(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) farmToolBar:SetPoint("TOPRIGHT", farmToolBarAnchor, "TOPRIGHT", (horizontal and -BUTTONSPACE or -(BUTTONSIZE + BUTTONSPACE)), (horizontal and -(BUTTONSIZE + BUTTONSPACE) or -BUTTONSPACE)) farmToolBar.ButtonSize = BUTTONSIZE; SV.Mentalo:Add(farmToolBarAnchor, "Farming Tools") -- PORTALS local farmPortalBarAnchor = CreateFrame("Frame", "FarmPortalBarAnchor", UIParent) - farmPortalBarAnchor:Point("TOPRIGHT", farmToolBarAnchor, horizontal and "BOTTOMRIGHT" or "TOPLEFT", horizontal and 0 or -(BUTTONSPACE * 2), horizontal and -(BUTTONSPACE * 2) or 0) - farmPortalBarAnchor:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) + farmPortalBarAnchor:SetPointToScale("TOPRIGHT", farmToolBarAnchor, horizontal and "BOTTOMRIGHT" or "TOPLEFT", horizontal and 0 or -(BUTTONSPACE * 2), horizontal and -(BUTTONSPACE * 2) or 0) + farmPortalBarAnchor:SetSizeToScale(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) local farmPortalBar = CreateFrame("Frame", "FarmPortalBar", farmPortalBarAnchor) - farmPortalBar:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) + farmPortalBar:SetSizeToScale(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) farmPortalBar:SetPoint("TOPRIGHT", farmPortalBarAnchor, "TOPRIGHT", (horizontal and -BUTTONSPACE or -(BUTTONSIZE + BUTTONSPACE)), (horizontal and -(BUTTONSIZE + BUTTONSPACE) or -BUTTONSPACE)) farmPortalBar.ButtonSize = BUTTONSIZE; SV.Mentalo:Add(farmPortalBarAnchor, "Farming Portals") diff --git a/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua index 5b4b42f..f502744 100644 --- a/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua +++ b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua @@ -60,6 +60,7 @@ local SV = _G["SVUI"]; local L = SV.L; local NewHook = hooksecurefunc; +local RadioSound = SV.Sounds:Blend("Static", "Sparks"); --[[ ########################################################## GLOBAL SLASH FUNCTIONS @@ -195,7 +196,7 @@ local EnemyCache, AlertedCache = {},{} local playerGUID = UnitGUID('player') local playerFaction = UnitFactionGroup("player") local classColor = RAID_CLASS_COLORS -local classColors = SVUI_CLASS_COLORS[SV.class] +local classColors = CUSTOM_CLASS_COLORS[SV.class] local classR, classG, classB = classColors.r, classColors.g, classColors.b local classA = 0.35 local fallbackColor = {r=1,g=1,b=1} @@ -709,7 +710,7 @@ local function MakeLogWindow() output:SetClampedToScreen(false) output:SetFrameStrata("MEDIUM") output:SetAllPoints(frame) - output:SetFont(SV.Media.font.system, 11, "OUTLINE") + output:SetFont(SV.Media.font.names, 11, "OUTLINE") output:SetJustifyH("CENTER") output:SetJustifyV("MIDDLE") output:SetShadowColor(0, 0, 0, 0) @@ -748,7 +749,7 @@ local function MakeCommWindow() local fbText = fallback:CreateFontString(nil, "OVERLAY") fbText:SetAllPoints(fallback) - fbText:SetFont(SV.Media.font.roboto, 12, "NONE") + fbText:SetFont(SV.Media.font.default, 12, "NONE") fbText:SetText("Nothing To Broadcast Right Now") frame.Unavailable = fallback @@ -767,12 +768,12 @@ local function MakeCommWindow() local poi = CreateFrame("Frame", poiName, frame) poi:SetSize((DOCK_WIDTH - 2), sectionHeight) poi:SetPoint("TOP", frame, "TOP", 0, -yOffset) - poi:SetPanelTemplate("Transparent") + poi:SetStylePanel("Default", "Transparent") local safe = CreateFrame("Button", nil, poi) safe:SetSize(sectionWidth, sectionHeight) safe:SetPoint("RIGHT", poi, "RIGHT", -2, 0) - safe:SetButtonTemplate() + safe:SetStylePanel("Button") safe:SetPanelColor("green") local sicon = safe:CreateTexture(nil, "OVERLAY") sicon:SetPoint("CENTER", safe, "CENTER", 0, 0) @@ -788,7 +789,7 @@ local function MakeCommWindow() local help = CreateFrame("Button", nil, poi) help:SetSize(sectionWidth, sectionHeight) help:SetPoint("RIGHT", safe, "LEFT", -2, 0) - help:SetButtonTemplate() + help:SetStylePanel("Button") help:SetPanelColor("red") local hicon = help:CreateTexture(nil, "OVERLAY") hicon:SetPoint("CENTER", help, "CENTER", 0, 0) @@ -802,7 +803,7 @@ local function MakeCommWindow() poi.Help = help poi.Text = poi:CreateFontString(nil,"OVERLAY") - poi.Text:SetFont(SV.Media.font.roboto, 12, "NONE") + poi.Text:SetFont(SV.Media.font.default, 12, "NONE") poi.Text:SetPoint("TOPLEFT", poi, "TOPLEFT", 2, 0) poi.Text:SetPoint("BOTTOMRIGHT", help, "BOTTOMLEFT", -2, 0) poi.Text:SetJustifyH("CENTER") @@ -827,7 +828,7 @@ local function MakeUtilityWindow() local fbText = frame:CreateFontString(nil, "OVERLAY") fbText:SetAllPoints(frame) - fbText:SetFont(SV.Media.font.roboto, 12, "NONE") + fbText:SetFont(SV.Media.font.default, 12, "NONE") fbText:SetText("Utilities Coming Soon....") PLUGIN.TOOL = frame @@ -849,29 +850,29 @@ local function MakeInfoWindow() local DATA_HEIGHT = frame:GetHeight() - 2; local leftColumn = CreateFrame("Frame", "SVUI_FightOMaticInfoLeft", frame) - leftColumn:Size(DATA_WIDTH, DATA_HEIGHT) - leftColumn:Point("LEFT", frame, "LEFT", 0, 0) + leftColumn:SetSizeToScale(DATA_WIDTH, DATA_HEIGHT) + leftColumn:SetPointToScale("LEFT", frame, "LEFT", 0, 0) leftColumn.lockedOpen = true - SV.SVStats:NewAnchor(leftColumn, 3, "ANCHOR_CURSOR", nil, "Transparent", true) + SV.Dock:NewDataHolder(leftColumn, 3, "ANCHOR_CURSOR", nil, "Transparent", true) leftColumn:SetFrameLevel(0) local rightColumn = CreateFrame("Frame", "SVUI_FightOMaticInfoRight", frame) - rightColumn:Size(DATA_WIDTH, DATA_HEIGHT) - rightColumn:Point("LEFT", leftColumn, "RIGHT", 2, 0) + rightColumn:SetSizeToScale(DATA_WIDTH, DATA_HEIGHT) + rightColumn:SetPointToScale("LEFT", leftColumn, "RIGHT", 2, 0) rightColumn.lockedOpen = true - SV.SVStats:NewAnchor(rightColumn, 3, "ANCHOR_CURSOR", nil, "Transparent", true) + SV.Dock:NewDataHolder(rightColumn, 3, "ANCHOR_CURSOR", nil, "Transparent", true) rightColumn:SetFrameLevel(0) PLUGIN.INFO = frame _G["SVUI_FightOMaticTool4"].Window = PLUGIN.INFO - SV.SVStats.BGPanels = { + SV.Dock.BGPanels = { ["SVUI_FightOMaticInfoLeft"] = {top = "Honor", middle = "Kills", bottom = "Assists"}, ["SVUI_FightOMaticInfoRight"] = {top = "Damage", middle = "Healing", bottom = "Deaths"} } - SV.SVStats:Generate() + SV.Dock:UpdateDataSlots() PLUGIN.INFO:Hide() end @@ -909,13 +910,13 @@ local FightOMaticAlert_OnShow = function(self) self:Hide() return; end - SV:SecureFadeIn(self, 0.3, 0, 1) + self:FadeIn(0.3, 0, 1) SV.Dock.BottomRight.Alert:Activate(self) end local FightOMaticAlert_OnMouseDown = function(self) -- DO STUFF - SV:SecureFadeOut(self, 0.5, 1, 0, true) + self:FadeOut(0.5, 1, 0, true) end local FightOMaticTool_OnEnter = function(self) @@ -934,21 +935,23 @@ local FightOMaticTool_OnLeave = function(self) end local FightOMaticTool_OnMouseDown = function(self) - SV:SecureFadeOut(PLUGIN.LOG, 0.5, 1, 0, true) - SV:SecureFadeOut(PLUGIN.COMM, 0.5, 1, 0, true) - SV:SecureFadeOut(PLUGIN.TOOL, 0.5, 1, 0, true) - SV:SecureFadeOut(PLUGIN.INFO, 0.5, 1, 0, true) - SV:SecureFadeIn(self.Window, 0.3, 0, 1) + RadioSound() + PLUGIN.LOG:FadeOut(0.5, 1, 0, true) + PLUGIN.COMM:FadeOut(0.5, 1, 0, true) + PLUGIN.TOOL:FadeOut(0.5, 1, 0, true) + PLUGIN.INFO:FadeOut(0.5, 1, 0, true) + self.Window:FadeIn(0.3, 0, 1) PLUGIN.Title:Clear(); PLUGIN.Title:AddMessage(self.TTitle, 1, 1, 0); end local Scanner_OnMouseDown = function(self) - SV:SecureFadeOut(PLUGIN.LOG, 0.5, 1, 0, true) - SV:SecureFadeOut(PLUGIN.COMM, 0.5, 1, 0, true) - SV:SecureFadeOut(PLUGIN.TOOL, 0.5, 1, 0, true) - SV:SecureFadeOut(PLUGIN.INFO, 0.5, 1, 0, true) - SV:SecureFadeIn(self.Window, 0.3, 0, 1) + RadioSound() + PLUGIN.LOG:FadeOut(0.5, 1, 0, true) + PLUGIN.COMM:FadeOut(0.5, 1, 0, true) + PLUGIN.TOOL:FadeOut(0.5, 1, 0, true) + PLUGIN.INFO:FadeOut(0.5, 1, 0, true) + self.Window:FadeIn(0.3, 0, 1) PLUGIN:PopulateScans() end @@ -1022,7 +1025,7 @@ function PLUGIN:Load() tool4:SetSize(BUTTON_SIZE,BUTTON_SIZE) tool4.icon = tool4:CreateTexture(nil, 'OVERLAY') tool4.icon:SetTexture(INFO_ICON) - tool4.icon:FillInner(tool4) + tool4.icon:SetAllPointsIn(tool4) tool4.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) tool4.TText = "Stats" tool4.TTitle = "Statistics and Information" @@ -1035,7 +1038,7 @@ function PLUGIN:Load() tool3:SetSize(BUTTON_SIZE,BUTTON_SIZE) tool3.icon = tool3:CreateTexture(nil, 'OVERLAY') tool3.icon:SetTexture(UTILITY_ICON) - tool3.icon:FillInner(tool3) + tool3.icon:SetAllPointsIn(tool3) tool3.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) tool3.TText = "Tools" tool3.TTitle = "Tools and Utilities" @@ -1048,7 +1051,7 @@ function PLUGIN:Load() tool2:SetSize(BUTTON_SIZE,BUTTON_SIZE) tool2.icon = tool2:CreateTexture(nil, 'OVERLAY') tool2.icon:SetTexture(RADIO_ICON) - tool2.icon:FillInner(tool2) + tool2.icon:SetAllPointsIn(tool2) tool2.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) tool2.TText = "Radio" tool2.TTitle = "Radio Communicator" @@ -1061,7 +1064,7 @@ function PLUGIN:Load() tool1:SetSize(BUTTON_SIZE,BUTTON_SIZE) tool1.icon = tool1:CreateTexture(nil, 'OVERLAY') tool1.icon:SetTexture(SCANNER_ICON) - tool1.icon:FillInner(tool1) + tool1.icon:SetAllPointsIn(tool1) tool1.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) tool1.TText = "Scanner" tool1.TTitle = "Enemy Scanner" @@ -1075,7 +1078,7 @@ function PLUGIN:Load() title:SetFrameStrata("MEDIUM") title:SetPoint("TOPLEFT", toolBar, "TOPRIGHT",0,0) title:SetPoint("BOTTOMRIGHT", self.Docklet, "TOPRIGHT",0,-16) - title:FontManager(SV.Media.font.names, 16, "OUTLINE", "CENTER", "MIDDLE") + title:FontManager("title") title:SetMaxLines(1) title:EnableMouseWheel(false) title:SetFading(false) @@ -1092,7 +1095,7 @@ function PLUGIN:Load() local listbutton = CreateFrame("Button", nil, self.Docklet) listbutton:SetPoint("TOPLEFT", title, "BOTTOMLEFT",0,0) listbutton:SetPoint("BOTTOMRIGHT", title, "BOTTOMRIGHT",0,-14) - listbutton:SetButtonTemplate(true) + listbutton:SetStylePanel("Button", true, 1, 1, 1) listbutton.ShowingKOS = false listbutton:SetScript("OnEnter", Switch_OnEnter) listbutton:SetScript("OnLeave", Switch_OnLeave) @@ -1106,7 +1109,7 @@ function PLUGIN:Load() summary:SetFrameStrata("MEDIUM") summary:SetPoint("TOPLEFT", title, "BOTTOMLEFT",0,0) summary:SetPoint("BOTTOMRIGHT", title, "BOTTOMRIGHT",0,-14) - summary:FontManager(SV.Media.font.system, 12, "OUTLINE", "CENTER", "MIDDLE") + summary:FontManager("default") summary:SetMaxLines(1) summary:EnableMouse(false) summary:SetFading(false) @@ -1125,7 +1128,7 @@ function PLUGIN:Load() MakeUtilityWindow() MakeInfoWindow() - self.Docklet:Hide() + --self.Docklet:Hide() self:ResetLogs() diff --git a/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.toc b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.toc index 03e89e3..26c16d0 100644 --- a/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.toc +++ b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.toc @@ -1,6 +1,6 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 5.3.9 +## Version: 5.4.08 ## Title: |cffFF9900SVUI |r|cffFFEF00Fight-O-Matic|r ## Notes: Supervillain UI [|cff9911FFPvP Tools|r]. ## SavedVariablesPerCharacter: FightOMatic_Profile, FightOMatic_Cache diff --git a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua index a6010a9..4d5420c 100644 --- a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua +++ b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua @@ -67,76 +67,65 @@ PLUGIN.HasAltInventory = false; LOCAL FUNCTIONS ########################################################## ]]-- -local RefreshLoggedSlot = function(self, slotID, save) - if(not self[slotID]) then return end - --print(self[slotID]:GetName()) - local bag = self:GetID(); - local slot = self[slotID]; - local bagType = self.bagFamily; - - slot:Show() - - local texture, count, locked, rarity = GetContainerItemInfo(bag, slotID); - local start, duration, enable = GetContainerItemCooldown(bag, slotID); - local itemLink = GetContainerItemLink(bag, slotID); - - CooldownFrame_SetTimer(slot.cooldown, start, duration, enable); - - if(duration > 0 and enable == 0) then - SetItemButtonTextureVertexColor(slot, 0.4, 0.4, 0.4) - else - SetItemButtonTextureVertexColor(slot, 1, 1, 1) - end - - if(bagType) then - local r, g, b = bagType[1], bagType[2], bagType[3]; - slot:SetBackdropColor(r, g, b, 0.5) - slot:SetBackdropBorderColor(r, g, b, 1) - elseif(itemLink) then - local key, _, rarity, _, _, class, subclass, maxStack = GetItemInfo(itemLink) - if(rarity and rarity > 1) then - local r, g, b = GetItemQualityColor(rarity) - slot:SetBackdropBorderColor(r, g, b) - else - slot:SetBackdropBorderColor(0, 0, 0) +local RefreshLoggedSlots = function(self, bagID, save) + local id = bagID or self:GetID() + if(not id or (not self.SlotUpdate)) then return end + local maxcount = GetContainerNumSlots(id) + for slotID = 1, maxcount do + self:SlotUpdate(slotID) + local itemLink = GetContainerItemLink(bagID, slotID); + if(itemLink) then + local key = GetItemInfo(itemLink) + if(key) then + local id = GetContainerItemID(bagID, slotID) + if id ~= 6948 then PLUGIN.myStash[bagID][key] = GetItemCount(id,true) end + end end + end +end - if(key and save) then - local id = GetContainerItemID(bag,slotID) - if id ~= 6948 then PLUGIN.myStash[bag][key] = GetItemCount(id,true) end +local RefreshLoggedBags = function(self) + for id,bag in pairs(self.Bags)do + if PLUGIN.myStash[id] then + twipe(PLUGIN.myStash[id]) + else + PLUGIN.myStash[id] = {}; end - else - slot:SetBackdropBorderColor(0, 0, 0) + RefreshLoggedSlots(bag, id, true) end - - if(C_NewItems.IsNewItem(bag, slotID)) then - ActionButton_ShowOverlayGlow(slot) - else - ActionButton_HideOverlayGlow(slot) + for id,items in pairs(PLUGIN.myStash) do + for id,amt in pairs(items) do + PLUGIN.BagItemCache[id] = PLUGIN.BagItemCache[id] or {} + PLUGIN.BagItemCache[id][nameKey] = amt + end end +end - SetItemButtonTexture(slot, texture) - SetItemButtonCount(slot, count) - SetItemButtonDesaturated(slot, locked, 0.5, 0.5, 0.5) -end - -local RefreshLoggedSlots = function(self, bagID, save) +local RefreshLoggedReagentSlots = function(self, bagID, save) local id = bagID or self:GetID() if(not id or (not self.SlotUpdate)) then return end - local maxcount = GetContainerNumSlots(id) - for i = 1, maxcount do - RefreshLoggedSlot(self, i, save) + local maxcount = self.numSlots + for slotID = 1, maxcount do + self:SlotUpdate(slotID) + local itemLink = GetContainerItemLink(bagID, slotID); + if(itemLink) then + local key = GetItemInfo(itemLink) + if(key) then + local id = GetContainerItemID(bagID, slotID) + if id ~= 6948 then PLUGIN.myStash[bagID][key] = GetItemCount(id,true) end + end + end end -end +end -local RefreshLoggedBags = function(self) +local RefreshLoggedReagentBags = function(self) for id,bag in pairs(self.Bags)do if PLUGIN.myStash[id] then twipe(PLUGIN.myStash[id]) else PLUGIN.myStash[id] = {}; end - RefreshLoggedSlots(bag, id, true) + RefreshLoggedReagentSlots(bag, id, true) end for id,items in pairs(PLUGIN.myStash) do for id,amt in pairs(items) do @@ -171,6 +160,9 @@ function PLUGIN:AppendBankFunctions() if(BAGS.BankFrame) then BAGS.BankFrame.RefreshBags = RefreshLoggedBags end + if(BAGS.ReagentFrame) then + BAGS.ReagentFrame.RefreshBags = RefreshLoggedReagentBags + end end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.toc b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.toc index b4bfc5a..5bb1dd0 100644 --- a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.toc +++ b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.toc @@ -1,6 +1,6 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 5.3.9 +## Version: 5.4.08 ## Title: |cffFF9900SVUI |r|cffFFEF00Log-O-Matic|r ## Notes: Supervillain UI [|cff9911FFData Logging|r]. ## SavedVariables: LogOMatic_Data diff --git a/Interface/AddOns/SVUI_StyleOMatic/Loader.lua b/Interface/AddOns/SVUI_StyleOMatic/Loader.lua index 6388a76..5e7e08e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/Loader.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/Loader.lua @@ -89,32 +89,34 @@ AddonObject.defaults = { }, ["addons"] = { ["enable"] = true, - ['AceGUI.lua'] = true, - ['ACP.lua'] = true, - ['AdiBags.lua'] = true, - ['Altoholic.lua'] = true, - ['AtlasLoot.lua'] = true, - ['AuctionLite.lua'] = true, - ['alDamageMeter.lua'] = true, - ['BigWigs.lua'] = true, - ['Bugsack.lua'] = true, - ['Clique.lua'] = true, - ['Cooline.lua'] = true, - ['DBM.lua'] = true, - ['DXE.lua'] = true, - ['LightHeaded.lua'] = true, - ['Mogit.lua'] = true, - ['Omen.lua'] = true, - ['Outfitter.lua'] = true, - ['Postal.lua'] = true, - ['Quartz.lua'] = true, - ['Recount.lua'] = true, - ['SexyCooldown.lua'] = true, - ['Skada.lua'] = true, - ['TinyDPS.lua'] = true, - ['TomTom.lua'] = true, - ['TradeSkillDW.lua'] = true, - ['VEM.lua'] = true, + ['AceGUI'] = true, + ['ACP'] = true, + ['AdiBags'] = true, + ['Altoholic'] = true, + ['AtlasLoot'] = true, + ['AuctionLite'] = true, + ['alDamageMeter'] = true, + ['BigWigs'] = true, + ['Bugsack'] = true, + ['Clique'] = true, + ['Cooline'] = true, + ['Details'] = true, + ['DBM'] = true, + ['DXE'] = true, + ['LightHeaded'] = true, + ['MasterPlan'] = true, + ['Mogit'] = true, + ['Omen'] = true, + ['Outfitter'] = true, + ['Postal'] = true, + ['Quartz'] = true, + ['Recount'] = true, + ['SexyCooldown'] = true, + ['Skada'] = true, + ['TinyDPS'] = true, + ['TomTom'] = true, + ['TradeSkillDW'] = true, + ['VEM'] = true, }, }; diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua index d1fe6d7..fa0ef46 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua @@ -104,8 +104,10 @@ function PLUGIN:Style(style, fn, ...) end if(pass and (not style:find("Blizzard")) and not self.StyledAddons[style]) then self.StyledAddons[style] = true - local verb = charming[math.random(1,#charming)] - self:AddonMessage(styleMessage:format(style, verb)) + if(SV.db.general.loginmessage) then + local verb = charming[math.random(1,#charming)] + self:AddonMessage(styleMessage:format(style, verb)) + end self.AddOnQueue[style] = nil end self.Debugging = false @@ -238,7 +240,7 @@ function PLUGIN:PLAYER_ENTERING_WORLD(event, ...) end function PLUGIN:ADDON_LOADED(event, addon) - -- print(addon) + --print(addon) for name, fn in pairs(self.OnLoadAddons) do if(addon:find(name)) then self:Style(name, fn, event, addon) @@ -264,7 +266,7 @@ function PLUGIN:FetchDocklets() local dock1 = self.cache.Docks[1] or "None"; local dock2 = self.cache.Docks[2] or "None"; local enabled1 = (dock1 ~= "None") - local enabled2 = (dock2 ~= "None") + local enabled2 = ((dock2 ~= "None") and (dock2 ~= dock1)) return dock1, dock2, enabled1, enabled2 end @@ -290,70 +292,71 @@ end function PLUGIN:RegisterAddonDocklets() local dock1,dock2,enabled1,enabled2 = self:FetchDocklets(); local tipLeft, tipRight = "", ""; - local activated = false; + local active1, active2 = false, false; self.Docklet.Dock1.FrameLink = nil; self.Docklet.Dock2.FrameLink = nil; if(enabled1) then local width = self.Docklet:GetWidth(); + if(enabled2) then self.Docklet.Dock1:SetWidth(width * 0.5) self.Docklet.Dock2:SetWidth(width * 0.5) - else + + if(self:DockletReady("Skada", dock2)) then + tipRight = " and Skada"; + self:Docklet_Skada() + active2 = true + elseif(self:DockletReady("Omen", dock2)) then + tipRight = " and Omen"; + self:Docklet_Omen(self.Docklet.Dock2) + active2 = true + elseif(self:DockletReady("Recount", dock2)) then + tipRight = " and Recount"; + self:Docklet_Recount(self.Docklet.Dock2) + active2 = true + elseif(self:DockletReady("TinyDPS", dock2)) then + tipRight = " and TinyDPS"; + self:Docklet_TinyDPS(self.Docklet.Dock2) + active2 = true + elseif(self:DockletReady("alDamageMeter", dock2)) then + tipRight = " and alDamageMeter"; + self:Docklet_alDamageMeter(self.Docklet.Dock2) + active2 = true + end + end + + if(not active2) then self.Docklet.Dock1:SetWidth(width) end if(self:DockletReady("Skada", dock1)) then tipLeft = "Skada"; self:Docklet_Skada() - activated = true + active1 = true elseif(self:DockletReady("Omen", dock1)) then tipLeft = "Omen"; self:Docklet_Omen(self.Docklet.Dock1) - activated = true + active1 = true elseif(self:DockletReady("Recount", dock1)) then tipLeft = "Recount"; self:Docklet_Recount(self.Docklet.Dock1) - activated = true + active1 = true elseif(self:DockletReady("TinyDPS", dock1)) then tipLeft = "TinyDPS"; self:Docklet_TinyDPS(self.Docklet.Dock1) - activated = true + active1 = true elseif(self:DockletReady("alDamageMeter", dock1)) then tipLeft = "alDamageMeter"; self:Docklet_alDamageMeter(self.Docklet.Dock1) - activated = true - end - - if(enabled2) then - if(self:DockletReady("Skada", dock2)) then - tipRight = " and Skada"; - self:Docklet_Skada() - activated = true - elseif(self:DockletReady("Omen", dock2)) then - tipRight = " and Omen"; - self:Docklet_Omen(self.Docklet.Dock2) - activated = true - elseif(self:DockletReady("Recount", dock2)) then - tipRight = " and Recount"; - self:Docklet_Recount(self.Docklet.Dock2) - activated = true - elseif(self:DockletReady("TinyDPS", dock2)) then - tipRight = " and TinyDPS"; - self:Docklet_TinyDPS(self.Docklet.Dock2) - activated = true - elseif(self:DockletReady("alDamageMeter", dock2)) then - tipRight = " and alDamageMeter"; - self:Docklet_alDamageMeter(self.Docklet.Dock2) - activated = true - end + active1 = true end end - if(activated) then + if(active1) then self.Docklet:Enable(); - if(enabled2) then + if(active2) then self.Docklet.Dock1:Show() self.Docklet.Dock2:Show() else @@ -494,7 +497,7 @@ local function DockFadeInDocklet() PLUGIN.Docklet.Dock2:Show() end end -LibSuperVillain("Registry"):NewCallback("DOCKS_FADE_IN", "DockFadeInDocklet", DockFadeInDocklet); +SV.Events:On("DOCKS_FADE_IN", "DockFadeInDocklet", DockFadeInDocklet); local function DockFadeOutDocklet() local active = PLUGIN.Docklet.DockButton:GetAttribute("isActive") @@ -503,7 +506,7 @@ local function DockFadeOutDocklet() PLUGIN.Docklet.Dock2:Hide() end end -LibSuperVillain("Registry"):NewCallback("DOCKS_FADE_OUT", "DockFadeOutDocklet", DockFadeOutDocklet); +SV.Events:On("DOCKS_FADE_OUT", "DockFadeOutDocklet", DockFadeOutDocklet); --[[ ########################################################## BUILD FUNCTION @@ -517,18 +520,18 @@ function PLUGIN:Load() self.cache.Docks = self.cache.Docks or {"None", "None"} local alert = CreateFrame('Frame', nil, UIParent); - alert:SetFixedPanelTemplate('Transparent'); + alert:SetStylePanel("Fixed", 'Transparent'); alert:SetSize(250, 70); alert:SetPoint('CENTER', UIParent, 'CENTER'); alert:SetFrameStrata('DIALOG'); alert.Text = alert:CreateFontString(nil, "OVERLAY"); - alert.Text:SetFont(SV.Media.font.default, 12); + alert.Text:SetFont(SV.Media.font.names, 12); alert.Text:SetPoint('TOP', alert, 'TOP', 0, -10); alert.Accept = CreateFrame('Button', nil, alert); alert.Accept:SetSize(70, 25); alert.Accept:SetPoint('RIGHT', alert, 'BOTTOM', -10, 20); alert.Accept.Text = alert.Accept:CreateFontString(nil, "OVERLAY"); - alert.Accept.Text:SetFont(SV.Media.font.default, 10); + alert.Accept.Text:SetFont(SV.Media.font.names, 10); alert.Accept.Text:SetPoint('CENTER'); alert.Accept.Text:SetText(_G.YES); alert.Close = CreateFrame('Button', nil, alert); @@ -536,11 +539,11 @@ function PLUGIN:Load() alert.Close:SetPoint('LEFT', alert, 'BOTTOM', 10, 20); alert.Close:SetScript('OnClick', function(this) this:GetParent():Hide() end); alert.Close.Text = alert.Close:CreateFontString(nil, "OVERLAY"); - alert.Close.Text:SetFont(SV.Media.font.default, 10); + alert.Close.Text:SetFont(SV.Media.font.names, 10); alert.Close.Text:SetPoint('CENTER'); alert.Close.Text:SetText(_G.NO); - alert.Accept:SetButtonTemplate(); - alert.Close:SetButtonTemplate(); + alert.Accept:SetStylePanel("Button"); + alert.Close:SetStylePanel("Button"); alert:Hide(); self.Alert = alert; diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc index a8dfbfb..c01b8e9 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc @@ -1,6 +1,6 @@ ## Interface: 60000 ## Author: Munglunch, Azilroka, Sortokk -## Version: 5.3.9 +## Version: 5.4.08 ## Title: |cffFF9900SVUI |r|cffFFEF00Style-O-Matic|r ## Notes: Supervillain UI [|cff9911FFAddon Skins|r]. ## SavedVariables: StyleOMatic_Global diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/ACP.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/ACP.lua index 271f1ec..f6d215b 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/ACP.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/ACP.lua @@ -72,8 +72,8 @@ local function StyleACP() PLUGIN:ApplyFrameStyle(ACP_AddonList) PLUGIN:ApplyFrameStyle(ACP_AddonList_ScrollFrame) local h={"ACP_AddonListSetButton","ACP_AddonListDisableAll","ACP_AddonListEnableAll","ACP_AddonList_ReloadUI","ACP_AddonListBottomClose"} - for i,j in pairs(h)do _G[j]:SetButtonTemplate()end - for c=1,20 do _G["ACP_AddonListEntry"..c.."LoadNow"]:SetButtonTemplate()end + for i,j in pairs(h)do _G[j]:SetStylePanel("Button")end + for c=1,20 do _G["ACP_AddonListEntry"..c.."LoadNow"]:SetStylePanel("Button")end PLUGIN:ApplyCloseButtonStyle(ACP_AddonListCloseButton) for c=1,20,1 do local k=_G["ACP_AddonList"] @@ -81,26 +81,26 @@ local function StyleACP() k:SetScript("OnUpdate",cbResize) end for c=1,20 do - _G["ACP_AddonListEntry"..c.."Enabled"]:SetCheckboxTemplate(true) + _G["ACP_AddonListEntry"..c.."Enabled"]:SetStylePanel("Checkbox", true) end - ACP_AddonList_NoRecurse:SetCheckboxTemplate(true) + ACP_AddonList_NoRecurse:SetStylePanel("Checkbox", true) PLUGIN:ApplyScrollFrameStyle(ACP_AddonList_ScrollFrameScrollBar) PLUGIN:ApplyDropdownStyle(ACP_AddonListSortDropDown) - ACP_AddonListSortDropDown:Width(130) + ACP_AddonListSortDropDown:SetWidthToScale(130) ACP_AddonList_ScrollFrame:SetWidth(590) ACP_AddonList_ScrollFrame:SetHeight(412) ACP_AddonList:SetHeight(502) - ACP_AddonListEntry1:Point("TOPLEFT",ACP_AddonList,"TOPLEFT",47,-62) - ACP_AddonList_ScrollFrame:Point("TOPLEFT",ACP_AddonList,"TOPLEFT",20,-53) - ACP_AddonListCloseButton:Point("TOPRIGHT",ACP_AddonList,"TOPRIGHT",4,5) - ACP_AddonListSetButton:Point("BOTTOMLEFT",ACP_AddonList,"BOTTOMLEFT",20,8) + ACP_AddonListEntry1:SetPointToScale("TOPLEFT",ACP_AddonList,"TOPLEFT",47,-62) + ACP_AddonList_ScrollFrame:SetPointToScale("TOPLEFT",ACP_AddonList,"TOPLEFT",20,-53) + ACP_AddonListCloseButton:SetPointToScale("TOPRIGHT",ACP_AddonList,"TOPRIGHT",4,5) + ACP_AddonListSetButton:SetPointToScale("BOTTOMLEFT",ACP_AddonList,"BOTTOMLEFT",20,8) ACP_AddonListSetButton:SetHeight(25) - ACP_AddonListDisableAll:Point("BOTTOMLEFT",ACP_AddonList,"BOTTOMLEFT",90,8) + ACP_AddonListDisableAll:SetPointToScale("BOTTOMLEFT",ACP_AddonList,"BOTTOMLEFT",90,8) ACP_AddonListDisableAll:SetHeight(25) - ACP_AddonListEnableAll:Point("BOTTOMLEFT",ACP_AddonList,"BOTTOMLEFT",175,8) + ACP_AddonListEnableAll:SetPointToScale("BOTTOMLEFT",ACP_AddonList,"BOTTOMLEFT",175,8) ACP_AddonListEnableAll:SetHeight(25) - ACP_AddonList_ReloadUI:Point("BOTTOMRIGHT",ACP_AddonList,"BOTTOMRIGHT",-160,8) - ACP_AddonListBottomClose:Point("BOTTOMRIGHT",ACP_AddonList,"BOTTOMRIGHT",-50,8) + ACP_AddonList_ReloadUI:SetPointToScale("BOTTOMRIGHT",ACP_AddonList,"BOTTOMRIGHT",-160,8) + ACP_AddonListBottomClose:SetPointToScale("BOTTOMRIGHT",ACP_AddonList,"BOTTOMRIGHT",-50,8) ACP_AddonListBottomClose:SetHeight(25)ACP_AddonList:SetParent(UIParent) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Ace3.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Ace3.lua index b19bc80..ceb9044 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Ace3.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Ace3.lua @@ -67,7 +67,7 @@ local function Widget_ButtonStyle(frame, strip, bypass) if frame.SetDisabledTexture then frame:SetDisabledTexture("") end if strip then frame:RemoveTextures() end if not bypass then - frame:SetButtonTemplate() + frame:SetStylePanel("Button") end end @@ -124,7 +124,7 @@ local function StyleAceGUI(event, addon) widget.highlight:Die() if not widget.styledCheckBG then widget.styledCheckBG = CreateFrame("Frame", nil, widget.frame) - widget.styledCheckBG:FillInner(widget.check) + widget.styledCheckBG:SetAllPointsIn(widget.check) PLUGIN:ApplyFixedFrameStyle(widget.styledCheckBG, "Inset") end widget.check:SetParent(widget.styledCheckBG) @@ -135,7 +135,7 @@ local function StyleAceGUI(event, addon) widgetDropdown:RemoveTextures() widgetButton:ClearAllPoints() - widgetButton:Point("RIGHT", widgetDropdown, "RIGHT", -20, 0) + widgetButton:SetPointToScale("RIGHT", widgetDropdown, "RIGHT", -20, 0) widgetButton:SetFrameLevel(widgetButton:GetFrameLevel() + 1) Widget_PaginationStyle(widgetButton, true) @@ -160,11 +160,11 @@ local function StyleAceGUI(event, addon) PLUGIN:ApplyFixedFrameStyle(widgetSlider, "Bar") - widgetSlider:Height(20) + widgetSlider:SetHeightToScale(20) widgetSlider:SetThumbTexture("Interface\\Buttons\\UI-ScrollBar-Knob") widgetSlider:GetThumbTexture():SetVertexColor(0.8, 0.8, 0.8) - widgetEditbox:Height(15) + widgetEditbox:SetHeightToScale(15) widgetEditbox:SetPoint("TOP", widgetSlider, "BOTTOM", 0, -1) widget.lowtext:SetPoint("TOPLEFT", widgetSlider, "BOTTOMLEFT", 2, -2) @@ -177,9 +177,9 @@ local function StyleAceGUI(event, addon) widgetFrame:RemoveTextures() Widget_PaginationStyle(dropButton, true) widgetFrame.text:ClearAllPoints() - widgetFrame.text:Point("RIGHT", dropButton, "LEFT", -2, 0) + widgetFrame.text:SetPointToScale("RIGHT", dropButton, "LEFT", -2, 0) dropButton:ClearAllPoints() - dropButton:Point("RIGHT", widgetFrame, "RIGHT", -10, -6) + dropButton:SetPointToScale("RIGHT", widgetFrame, "RIGHT", -10, -6) if(not widgetFrame.Panel) then if(widgetType == "LSM30_Font") then PLUGIN:ApplyAdjustedFrameStyle(widgetFrame, "Transparent", 20, -17, 2, -2) @@ -187,15 +187,15 @@ local function StyleAceGUI(event, addon) PLUGIN:ApplyAdjustedFrameStyle(widgetFrame, "Transparent", 20, -17, 2, -2) widget.soundbutton:SetParent(widgetFrame.Panel) widget.soundbutton:ClearAllPoints() - widget.soundbutton:Point("LEFT", widgetFrame.Panel, "LEFT", 2, 0) + widget.soundbutton:SetPointToScale("LEFT", widgetFrame.Panel, "LEFT", 2, 0) elseif(widgetType == "LSM30_Statusbar") then PLUGIN:ApplyAdjustedFrameStyle(widgetFrame, "Transparent", 20, -17, 2, -2) widget.bar:SetParent(widgetFrame.Panel) - widget.bar:FillInner() + widget.bar:SetAllPointsIn() elseif(widgetType == "LSM30_Border" or widgetType == "LSM30_Background") then PLUGIN:ApplyAdjustedFrameStyle(widgetFrame, "Transparent", 42, -16, 2, -2) end - widgetFrame.Panel:Point("BOTTOMRIGHT", dropButton, "BOTTOMRIGHT", 2, -2) + widgetFrame.Panel:SetPointToScale("BOTTOMRIGHT", dropButton, "BOTTOMRIGHT", 2, -2) PLUGIN:ApplyAdjustedFrameStyle(widgetFrame, "Transparent", 20, -2, 2, -2) end dropButton:SetParent(widgetFrame.Panel) @@ -234,9 +234,9 @@ local function StyleAceGUI(event, addon) newButton.toggle:RemoveTextures() newButton.toggle.SetNormalTexture = NOOP; newButton.toggle.SetPushedTexture = NOOP; - newButton.toggle:SetButtonTemplate() + newButton.toggle:SetStylePanel("Button") newButton.toggleText = newButton.toggle:CreateFontString(nil, "OVERLAY") - newButton.toggleText:SetFont([[Interface\AddOns\SVUI\assets\fonts\Roboto.ttf]], 19) + newButton.toggleText:SetFont([[Interface\AddOns\SVUI\assets\fonts\Default.ttf]], 19) newButton.toggleText:SetPoint("CENTER") newButton.toggleText:SetText("*") return newButton diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/AdiBags.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/AdiBags.lua index 3d54a55..2679161 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/AdiBags.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/AdiBags.lua @@ -45,10 +45,10 @@ local function StyleAdiBags(event) local function SkinFrame(frame) local region = frame.HeaderRightRegion - frame:SetBasicPanel() - _G[frame:GetName()..'Bags']:SetPanelTemplate("Default") + frame:SetStylePanel("Default", 'Transparent') + _G[frame:GetName()..'Bags']:SetStylePanel("Default", "Default") for i = 1, 3 do - region.widgets[i].widget:SetButtonTemplate() + region.widgets[i].widget:SetStylePanel("Button") end end @@ -57,8 +57,8 @@ local function StyleAdiBags(event) if not AdiBagsContainer1 then ToggleBackpack() ToggleBackpack() end if AdiBagsContainer1 then SkinFrame(AdiBagsContainer1) - AdiBagsContainer1SearchBox:SetEditboxTemplate() - AdiBagsContainer1SearchBox:Point('TOPRIGHT', AdiBagsSimpleLayeredRegion2, 'TOPRIGHT', -75, -1) + AdiBagsContainer1SearchBox:SetStylePanel("Editbox") + AdiBagsContainer1SearchBox:SetPointToScale('TOPRIGHT', AdiBagsSimpleLayeredRegion2, 'TOPRIGHT', -75, -1) end end, 1) elseif event == 'BANKFRAME_OPENED' then diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Altoholic.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Altoholic.lua index 1855ee0..c3da9c7 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Altoholic.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Altoholic.lua @@ -64,11 +64,11 @@ local function StyleAltoholic(event, addon) PLUGIN:ApplyButtonStyle(AltoholicFrame_ResetButton) PLUGIN:ApplyButtonStyle(AltoholicFrame_SearchButton) - AltoholicFrameTab1:Point("TOPLEFT", AltoholicFrame, "BOTTOMLEFT", -5, 2) - AltoholicFrame_ResetButton:Point("TOPLEFT", AltoholicFrame, "TOPLEFT", 25, -77) - AltoholicFrame_SearchEditBox:Point("TOPLEFT", AltoholicFrame, "TOPLEFT", 37, -56) - AltoholicFrame_ResetButton:Size(85, 24) - AltoholicFrame_SearchButton:Size(85, 24) + AltoholicFrameTab1:SetPointToScale("TOPLEFT", AltoholicFrame, "BOTTOMLEFT", -5, 2) + AltoholicFrame_ResetButton:SetPointToScale("TOPLEFT", AltoholicFrame, "TOPLEFT", 25, -77) + AltoholicFrame_SearchEditBox:SetPointToScale("TOPLEFT", AltoholicFrame, "TOPLEFT", 37, -56) + AltoholicFrame_ResetButton:SetSizeToScale(85, 24) + AltoholicFrame_SearchButton:SetSizeToScale(85, 24) end if addon == "Altoholic_Summary" then @@ -175,7 +175,7 @@ local function StyleAltoholic(event, addon) PLUGIN:ApplyScrollBarStyle(AltoholicFrameAchievementsScrollFrameScrollBar) PLUGIN:ApplyScrollBarStyle(AltoholicAchievementsMenuScrollFrameScrollBar) PLUGIN:ApplyDropdownStyle(AltoholicTabAchievements_SelectRealm) - AltoholicTabAchievements_SelectRealm:Point("TOPLEFT", AltoholicFrame, "TOPLEFT", 205, -57) + AltoholicTabAchievements_SelectRealm:SetPointToScale("TOPLEFT", AltoholicFrame, "TOPLEFT", 205, -57) for i = 1, 15 do PLUGIN:ApplyButtonStyle(_G["AltoholicTabAchievementsMenuItem"..i], true) @@ -264,9 +264,9 @@ local function StyleAltoholic(event, addon) PLUGIN:ApplyDropdownStyle(AltoholicTabSearch_SelectRarity) PLUGIN:ApplyDropdownStyle(AltoholicTabSearch_SelectSlot) PLUGIN:ApplyDropdownStyle(AltoholicTabSearch_SelectLocation) - AltoholicTabSearch_SelectRarity:Size(125, 32) - AltoholicTabSearch_SelectSlot:Size(125, 32) - AltoholicTabSearch_SelectLocation:Size(175, 32) + AltoholicTabSearch_SelectRarity:SetSizeToScale(125, 32) + AltoholicTabSearch_SelectSlot:SetSizeToScale(125, 32) + AltoholicTabSearch_SelectLocation:SetSizeToScale(175, 32) PLUGIN:ApplyEditBoxStyle(_G["AltoholicTabSearch_MinLevel"]) PLUGIN:ApplyEditBoxStyle(_G["AltoholicTabSearch_MaxLevel"]) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/AtlasLoot.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/AtlasLoot.lua index 28ca016..12e2eed 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/AtlasLoot.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/AtlasLoot.lua @@ -44,38 +44,38 @@ local SetTemplateDefault = {"AtlasLootCompareFrameSortButton_Name","AtlasLootCom local buttons = {"AtlasLoot_AtlasInfoFrame_ToggleALButton","AtlasLootPanelSearch_SearchButton","AtlasLootDefaultFrame_CompareFrame","AtlasLootPanelSearch_ClearButton","AtlasLootPanelSearch_LastResultButton","AtlasLoot10Man25ManSwitch","AtlasLootItemsFrame_BACK","AtlasLootCompareFrameSearch_ClearButton","AtlasLootCompareFrameSearch_SearchButton","AtlasLootCompareFrame_WishlistButton","AtlasLootCompareFrame_CloseButton2"} local function AL_OnShow(self, event, ...) - AtlasLootPanel:Point("TOP", AtlasLootDefaultFrame, "BOTTOM", 0, -1) - AtlasLootQuickLooksButton:Point("BOTTOM", AtlasLootItemsFrame, "BOTTOM", 53, 33) + AtlasLootPanel:SetPointToScale("TOP", AtlasLootDefaultFrame, "BOTTOM", 0, -1) + AtlasLootQuickLooksButton:SetPointToScale("BOTTOM", AtlasLootItemsFrame, "BOTTOM", 53, 33) AtlasLootPanelSearch_Box:ClearAllPoints() - AtlasLootPanelSearch_Box:Point("TOP", AtlasLoot_PanelButton_7, "BOTTOM", 80, -10) - AtlasLootPanelSearch_SearchButton:Point("LEFT", AtlasLootPanelSearch_Box, "RIGHT", 5, 0) - AtlasLootPanelSearch_SelectModuel:Point("LEFT", AtlasLootPanelSearch_SearchButton, "RIGHT", 5, 0) - AtlasLootPanelSearch_ClearButton:Point("LEFT", AtlasLootPanelSearch_SelectModuel, "RIGHT", 5, 0) - AtlasLootPanelSearch_LastResultButton:Point("LEFT", AtlasLootPanelSearch_ClearButton, "RIGHT", 5, 0) - AtlasLoot10Man25ManSwitch:Point("BOTTOM", AtlasLootItemsFrame, "BOTTOM", -130, 4) - if AtlasLoot_PanelButton_2 then AtlasLoot_PanelButton_2:Point("LEFT", AtlasLoot_PanelButton_1, "RIGHT", 1, 0) end - if AtlasLoot_PanelButton_3 then AtlasLoot_PanelButton_3:Point("LEFT", AtlasLoot_PanelButton_2, "RIGHT", 1, 0) end - if AtlasLoot_PanelButton_4 then AtlasLoot_PanelButton_4:Point("LEFT", AtlasLoot_PanelButton_3, "RIGHT", 1, 0) end - if AtlasLoot_PanelButton_5 then AtlasLoot_PanelButton_5:Point("LEFT", AtlasLoot_PanelButton_4, "RIGHT", 1, 0) end - if AtlasLoot_PanelButton_6 then AtlasLoot_PanelButton_6:Point("LEFT", AtlasLoot_PanelButton_5, "RIGHT", 1, 0) end - if AtlasLoot_PanelButton_8 then AtlasLoot_PanelButton_8:Point("LEFT", AtlasLoot_PanelButton_7, "RIGHT", 1, 0) end - if AtlasLoot_PanelButton_9 then AtlasLoot_PanelButton_9:Point("LEFT", AtlasLoot_PanelButton_8, "RIGHT", 1, 0) end - if AtlasLoot_PanelButton_10 then AtlasLoot_PanelButton_10:Point("LEFT", AtlasLoot_PanelButton_9, "RIGHT", 1, 0) end - if AtlasLoot_PanelButton_11 then AtlasLoot_PanelButton_11:Point("LEFT", AtlasLoot_PanelButton_10, "RIGHT", 1, 0) end - if AtlasLoot_PanelButton_12 then AtlasLoot_PanelButton_12:Point("LEFT", AtlasLoot_PanelButton_11, "RIGHT", 1, 0) end - AtlasLootCompareFrameSortButton_Rarity:Point("LEFT", AtlasLootCompareFrameSortButton_Name, "RIGHT", 1, 0) - AtlasLootCompareFrameSortButton_Rarity:Width(80) - AtlasLootCompareFrameSortButton_Name:Width(80) - AtlasLootCompareFrameSortButton_1:Point("LEFT", AtlasLootCompareFrameSortButton_Rarity, "RIGHT", 1, 0) - AtlasLootCompareFrameSortButton_2:Point("LEFT", AtlasLootCompareFrameSortButton_1, "RIGHT", 1, 0) - AtlasLootCompareFrameSortButton_3:Point("LEFT", AtlasLootCompareFrameSortButton_2, "RIGHT", 1, 0) - AtlasLootCompareFrameSortButton_4:Point("LEFT", AtlasLootCompareFrameSortButton_3, "RIGHT", 1, 0) - AtlasLootCompareFrameSortButton_5:Point("LEFT", AtlasLootCompareFrameSortButton_4, "RIGHT", 1, 0) - AtlasLootCompareFrameSortButton_6:Point("LEFT", AtlasLootCompareFrameSortButton_5, "RIGHT", 1, 0) - AtlasLootCompareFrame_CloseButton2:Point("BOTTOMRIGHT", AtlasLootCompareFrame, "BOTTOMRIGHT", -7, 10) - AtlasLootCompareFrame_WishlistButton:Point("RIGHT", AtlasLootCompareFrame_CloseButton2, "LEFT", -1, 0) - AtlasLootCompareFrameSearch_SearchButton:Point("LEFT", AtlasLootCompareFrameSearch_Box, "RIGHT", 5, 0) - AtlasLootCompareFrameSearch_SelectModuel:Point("LEFT", AtlasLootCompareFrameSearch_SearchButton, "RIGHT", 5, 0) + AtlasLootPanelSearch_Box:SetPointToScale("TOP", AtlasLoot_PanelButton_7, "BOTTOM", 80, -10) + AtlasLootPanelSearch_SearchButton:SetPointToScale("LEFT", AtlasLootPanelSearch_Box, "RIGHT", 5, 0) + AtlasLootPanelSearch_SelectModuel:SetPointToScale("LEFT", AtlasLootPanelSearch_SearchButton, "RIGHT", 5, 0) + AtlasLootPanelSearch_ClearButton:SetPointToScale("LEFT", AtlasLootPanelSearch_SelectModuel, "RIGHT", 5, 0) + AtlasLootPanelSearch_LastResultButton:SetPointToScale("LEFT", AtlasLootPanelSearch_ClearButton, "RIGHT", 5, 0) + AtlasLoot10Man25ManSwitch:SetPointToScale("BOTTOM", AtlasLootItemsFrame, "BOTTOM", -130, 4) + if AtlasLoot_PanelButton_2 then AtlasLoot_PanelButton_2:SetPointToScale("LEFT", AtlasLoot_PanelButton_1, "RIGHT", 1, 0) end + if AtlasLoot_PanelButton_3 then AtlasLoot_PanelButton_3:SetPointToScale("LEFT", AtlasLoot_PanelButton_2, "RIGHT", 1, 0) end + if AtlasLoot_PanelButton_4 then AtlasLoot_PanelButton_4:SetPointToScale("LEFT", AtlasLoot_PanelButton_3, "RIGHT", 1, 0) end + if AtlasLoot_PanelButton_5 then AtlasLoot_PanelButton_5:SetPointToScale("LEFT", AtlasLoot_PanelButton_4, "RIGHT", 1, 0) end + if AtlasLoot_PanelButton_6 then AtlasLoot_PanelButton_6:SetPointToScale("LEFT", AtlasLoot_PanelButton_5, "RIGHT", 1, 0) end + if AtlasLoot_PanelButton_8 then AtlasLoot_PanelButton_8:SetPointToScale("LEFT", AtlasLoot_PanelButton_7, "RIGHT", 1, 0) end + if AtlasLoot_PanelButton_9 then AtlasLoot_PanelButton_9:SetPointToScale("LEFT", AtlasLoot_PanelButton_8, "RIGHT", 1, 0) end + if AtlasLoot_PanelButton_10 then AtlasLoot_PanelButton_10:SetPointToScale("LEFT", AtlasLoot_PanelButton_9, "RIGHT", 1, 0) end + if AtlasLoot_PanelButton_11 then AtlasLoot_PanelButton_11:SetPointToScale("LEFT", AtlasLoot_PanelButton_10, "RIGHT", 1, 0) end + if AtlasLoot_PanelButton_12 then AtlasLoot_PanelButton_12:SetPointToScale("LEFT", AtlasLoot_PanelButton_11, "RIGHT", 1, 0) end + AtlasLootCompareFrameSortButton_Rarity:SetPointToScale("LEFT", AtlasLootCompareFrameSortButton_Name, "RIGHT", 1, 0) + AtlasLootCompareFrameSortButton_Rarity:SetWidthToScale(80) + AtlasLootCompareFrameSortButton_Name:SetWidthToScale(80) + AtlasLootCompareFrameSortButton_1:SetPointToScale("LEFT", AtlasLootCompareFrameSortButton_Rarity, "RIGHT", 1, 0) + AtlasLootCompareFrameSortButton_2:SetPointToScale("LEFT", AtlasLootCompareFrameSortButton_1, "RIGHT", 1, 0) + AtlasLootCompareFrameSortButton_3:SetPointToScale("LEFT", AtlasLootCompareFrameSortButton_2, "RIGHT", 1, 0) + AtlasLootCompareFrameSortButton_4:SetPointToScale("LEFT", AtlasLootCompareFrameSortButton_3, "RIGHT", 1, 0) + AtlasLootCompareFrameSortButton_5:SetPointToScale("LEFT", AtlasLootCompareFrameSortButton_4, "RIGHT", 1, 0) + AtlasLootCompareFrameSortButton_6:SetPointToScale("LEFT", AtlasLootCompareFrameSortButton_5, "RIGHT", 1, 0) + AtlasLootCompareFrame_CloseButton2:SetPointToScale("BOTTOMRIGHT", AtlasLootCompareFrame, "BOTTOMRIGHT", -7, 10) + AtlasLootCompareFrame_WishlistButton:SetPointToScale("RIGHT", AtlasLootCompareFrame_CloseButton2, "LEFT", -1, 0) + AtlasLootCompareFrameSearch_SearchButton:SetPointToScale("LEFT", AtlasLootCompareFrameSearch_Box, "RIGHT", 5, 0) + AtlasLootCompareFrameSearch_SelectModuel:SetPointToScale("LEFT", AtlasLootCompareFrameSearch_SearchButton, "RIGHT", 5, 0) AtlasLootDefaultFrame_CloseButton:ClearAllPoints() AtlasLootDefaultFrame_CloseButton:SetPoint("TOPRIGHT", AtlasLootDefaultFrame, "TOPRIGHT", -5 -2) AtlasLootDefaultFrame:SetFrameLevel(0) @@ -101,9 +101,9 @@ local function Nine_IsThere(self, elapsed) end for i = 1, 9 do local f = _G["AtlasLootCompareFrameSortButton_"..i]f:SetWidth(44.44)end for _, object in pairs(nineisthere) do PLUGIN:ApplyFrameStyle(_G[object]) end - AtlasLootCompareFrameSortButton_7:Point("LEFT", AtlasLootCompareFrameSortButton_6, "RIGHT", 1, 0) - AtlasLootCompareFrameSortButton_8:Point("LEFT", AtlasLootCompareFrameSortButton_7, "RIGHT", 1, 0) - AtlasLootCompareFrameSortButton_9:Point("LEFT", AtlasLootCompareFrameSortButton_8, "RIGHT", 1, 0) + AtlasLootCompareFrameSortButton_7:SetPointToScale("LEFT", AtlasLootCompareFrameSortButton_6, "RIGHT", 1, 0) + AtlasLootCompareFrameSortButton_8:SetPointToScale("LEFT", AtlasLootCompareFrameSortButton_7, "RIGHT", 1, 0) + AtlasLootCompareFrameSortButton_9:SetPointToScale("LEFT", AtlasLootCompareFrameSortButton_8, "RIGHT", 1, 0) end local function Compare_OnShow(self, event, ...) @@ -138,7 +138,7 @@ local function StyleAtlasLoot(event, addon) for _, object in pairs(StripAllTextures) do _G[object]:RemoveTextures()end for _, object in pairs(SetTemplateDefault) do PLUGIN:ApplyFrameStyle(_G[object], "Default")end - for _, button in pairs(buttons) do _G[button]:SetButtonTemplate()end + for _, button in pairs(buttons) do _G[button]:SetStylePanel("Button")end -- Manipulate the main frames PLUGIN:ApplyFrameStyle(_G["AtlasLootDefaultFrame"], "Action"); @@ -149,18 +149,18 @@ local function StyleAtlasLoot(event, addon) _G["AtlasLootPanel"]:SetPoint("TOP",_G["AtlasLootDefaultFrame"],"BOTTOM",0,-1); -- Back to the rest PLUGIN:ApplyFrameStyle(_G["AtlasLootCompareFrame"], "Transparent"); - if AtlasLoot_PanelButton_1 then AtlasLoot_PanelButton_1:SetButtonTemplate() end - if AtlasLoot_PanelButton_2 then AtlasLoot_PanelButton_2:SetButtonTemplate() end - if AtlasLoot_PanelButton_3 then AtlasLoot_PanelButton_3:SetButtonTemplate() end - if AtlasLoot_PanelButton_4 then AtlasLoot_PanelButton_4:SetButtonTemplate() end - if AtlasLoot_PanelButton_5 then AtlasLoot_PanelButton_5:SetButtonTemplate() end - if AtlasLoot_PanelButton_6 then AtlasLoot_PanelButton_6:SetButtonTemplate() end - if AtlasLoot_PanelButton_7 then AtlasLoot_PanelButton_7:SetButtonTemplate() end - if AtlasLoot_PanelButton_8 then AtlasLoot_PanelButton_8:SetButtonTemplate() end - if AtlasLoot_PanelButton_9 then AtlasLoot_PanelButton_9:SetButtonTemplate() end - if AtlasLoot_PanelButton_10 then AtlasLoot_PanelButton_10:SetButtonTemplate() end - if AtlasLoot_PanelButton_11 then AtlasLoot_PanelButton_11:SetButtonTemplate() end - if AtlasLoot_PanelButton_12 then AtlasLoot_PanelButton_12:SetButtonTemplate() end + if AtlasLoot_PanelButton_1 then AtlasLoot_PanelButton_1:SetStylePanel("Button") end + if AtlasLoot_PanelButton_2 then AtlasLoot_PanelButton_2:SetStylePanel("Button") end + if AtlasLoot_PanelButton_3 then AtlasLoot_PanelButton_3:SetStylePanel("Button") end + if AtlasLoot_PanelButton_4 then AtlasLoot_PanelButton_4:SetStylePanel("Button") end + if AtlasLoot_PanelButton_5 then AtlasLoot_PanelButton_5:SetStylePanel("Button") end + if AtlasLoot_PanelButton_6 then AtlasLoot_PanelButton_6:SetStylePanel("Button") end + if AtlasLoot_PanelButton_7 then AtlasLoot_PanelButton_7:SetStylePanel("Button") end + if AtlasLoot_PanelButton_8 then AtlasLoot_PanelButton_8:SetStylePanel("Button") end + if AtlasLoot_PanelButton_9 then AtlasLoot_PanelButton_9:SetStylePanel("Button") end + if AtlasLoot_PanelButton_10 then AtlasLoot_PanelButton_10:SetStylePanel("Button") end + if AtlasLoot_PanelButton_11 then AtlasLoot_PanelButton_11:SetStylePanel("Button") end + if AtlasLoot_PanelButton_12 then AtlasLoot_PanelButton_12:SetStylePanel("Button") end for i = 1, 15 do local f = _G["AtlasLootCompareFrameMainFilterButton"..i]f:RemoveTextures() end @@ -190,22 +190,22 @@ local function StyleAtlasLoot(event, addon) AtlasLootCompareFrameSearch_StatsListDropDown:SetWidth(240) PLUGIN:ApplyDropdownStyle(AtlasLootCompareFrame_WishlistDropDown) AtlasLootCompareFrame_WishlistDropDown:SetWidth(240) - AtlasLootPanelSearch_Box:SetEditboxTemplate() - AtlasLootCompareFrameSearch_Box:SetEditboxTemplate() + AtlasLootPanelSearch_Box:SetStylePanel("Editbox") + AtlasLootCompareFrameSearch_Box:SetStylePanel("Editbox") if AtlasLootFilterCheck then - AtlasLootFilterCheck:SetCheckboxTemplate(true) + AtlasLootFilterCheck:SetStylePanel("Checkbox", true) end if AtlasLootItemsFrame_Heroic then - AtlasLootItemsFrame_Heroic:SetCheckboxTemplate(true) + AtlasLootItemsFrame_Heroic:SetStylePanel("Checkbox", true) end - if AtlasLootCompareFrameSearch_FilterCheck then AtlasLootCompareFrameSearch_FilterCheck:SetCheckboxTemplate(true) + if AtlasLootCompareFrameSearch_FilterCheck then AtlasLootCompareFrameSearch_FilterCheck:SetStylePanel("Checkbox", true) end if AtlasLootItemsFrame_RaidFinder then - AtlasLootItemsFrame_RaidFinder:SetCheckboxTemplate(true) + AtlasLootItemsFrame_RaidFinder:SetStylePanel("Checkbox", true) end if AtlasLootItemsFrame_Thunderforged then - AtlasLootItemsFrame_Thunderforged:SetCheckboxTemplate(true) + AtlasLootItemsFrame_Thunderforged:SetStylePanel("Checkbox", true) end AtlasLootPanel.Titel:SetTextColor(23/255, 132/255, 209/255) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/AuctionLite.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/AuctionLite.lua index f505a7e..3f0c6e4 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/AuctionLite.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/AuctionLite.lua @@ -40,9 +40,9 @@ AUCTIONLITE ]]-- local function BGHelper(parent) parent.bg = CreateFrame("Frame", nil, parent) - parent.bg:SetFixedPanelTemplate("Inset") - parent.bg:Point("TOPLEFT", parent, "TOPLEFT", 16, -103) - parent.bg:Point("BOTTOMRIGHT", AuctionFrame, "BOTTOMRIGHT", -8, 36) + parent.bg:SetStylePanel("Fixed", "Inset") + parent.bg:SetPointToScale("TOPLEFT", parent, "TOPLEFT", 16, -103) + parent.bg:SetPointToScale("BOTTOMRIGHT", AuctionFrame, "BOTTOMRIGHT", -8, 36) parent.bg:SetFrameLevel(parent.bg:GetFrameLevel() - 1) end @@ -50,24 +50,24 @@ local function StyleAuctionLite(event, ...) assert(AuctionFrameTab4, "AddOn Not Loaded") if(not event or (event and event == 'PLAYER_ENTERING_WORLD')) then return; end - BuyName:SetEditboxTemplate() - BuyQuantity:SetEditboxTemplate() - SellStacks:SetEditboxTemplate() - SellSize:SetEditboxTemplate() - SellBidPriceGold:SetEditboxTemplate() - SellBidPriceSilver:SetEditboxTemplate() - SellBidPriceCopper:SetEditboxTemplate() - SellBuyoutPriceGold:SetEditboxTemplate() - SellBuyoutPriceSilver:SetEditboxTemplate() - SellBuyoutPriceCopper:SetEditboxTemplate() + BuyName:SetStylePanel("Editbox") + BuyQuantity:SetStylePanel("Editbox") + SellStacks:SetStylePanel("Editbox") + SellSize:SetStylePanel("Editbox") + SellBidPriceGold:SetStylePanel("Editbox") + SellBidPriceSilver:SetStylePanel("Editbox") + SellBidPriceCopper:SetStylePanel("Editbox") + SellBuyoutPriceGold:SetStylePanel("Editbox") + SellBuyoutPriceSilver:SetStylePanel("Editbox") + SellBuyoutPriceCopper:SetStylePanel("Editbox") - BuySearchButton:SetButtonTemplate() - BuyBidButton:SetButtonTemplate() - BuyBuyoutButton:SetButtonTemplate() - BuyCancelSearchButton:SetButtonTemplate() - BuyCancelAuctionButton:SetButtonTemplate() - BuyScanButton:SetButtonTemplate() - SellCreateAuctionButton:SetButtonTemplate() + BuySearchButton:SetStylePanel("Button") + BuyBidButton:SetStylePanel("Button") + BuyBuyoutButton:SetStylePanel("Button") + BuyCancelSearchButton:SetStylePanel("Button") + BuyCancelAuctionButton:SetStylePanel("Button") + BuyScanButton:SetStylePanel("Button") + SellCreateAuctionButton:SetStylePanel("Button") PLUGIN:ApplyPaginationStyle(BuyAdvancedButton) PLUGIN:ApplyPaginationStyle(SellRememberButton) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/BigWigs.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/BigWigs.lua index c81ae03..0a93ce2 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/BigWigs.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/BigWigs.lua @@ -73,16 +73,16 @@ end local function applystyle(bar) if not FreeBG then FreeBG = {} end - bar:Height(20) + bar:SetHeightToScale(20) local bg = nil if #FreeBG > 0 then bg = tremove(FreeBG) else bg = CreateFrame("Frame") end - bg:SetFixedPanelTemplate('Transparent', true) + bg:SetStylePanel("Fixed", 'Transparent', true) bg:SetParent(bar) - bg:WrapOuter(bar) + bg:SetAllPointsOut(bar) bg:SetFrameLevel(bar:GetFrameLevel() - 1) bg:SetFrameStrata(bar:GetFrameStrata()) bg:Show() @@ -95,9 +95,9 @@ local function applystyle(bar) ibg = CreateFrame("Frame") end ibg:SetParent(bar) - ibg:SetFixedPanelTemplate('Transparent', true) + ibg:SetStylePanel("Fixed", 'Transparent', true) ibg:SetBackdropColor(0, 0, 0, 0) - ibg:WrapOuter(bar.candyBarIconFrame) + ibg:SetAllPointsOut(bar.candyBarIconFrame) ibg:SetFrameLevel(bar:GetFrameLevel() - 1) ibg:SetFrameStrata(bar:GetFrameStrata()) ibg:Show() @@ -107,8 +107,8 @@ local function applystyle(bar) bar.candyBarLabel:ClearAllPoints() bar.candyBarDuration:SetJustifyH("RIGHT") bar.candyBarDuration:ClearAllPoints() - bar.candyBarLabel:Point("LEFT", bar, "LEFT", 4, 0) - bar.candyBarDuration:Point("RIGHT", bar, "RIGHT", -4, 0) + bar.candyBarLabel:SetPointToScale("LEFT", bar, "LEFT", 4, 0) + bar.candyBarDuration:SetPointToScale("RIGHT", bar, "RIGHT", -4, 0) bar.candyBarBar:ClearAllPoints() bar.candyBarBar:SetAllPoints(bar) bar.candyBarBar.OldSetPoint = bar.candyBarBar.SetPoint @@ -116,7 +116,7 @@ local function applystyle(bar) bar.candyBarIconFrame.OldSetWidth = bar.candyBarIconFrame.SetWidth bar.candyBarIconFrame.SetWidth = SV.fubar bar.candyBarIconFrame:ClearAllPoints() - bar.candyBarIconFrame:Point("BOTTOMRIGHT", bar, "BOTTOMLEFT", -1, 0) + bar.candyBarIconFrame:SetPointToScale("BOTTOMRIGHT", bar, "BOTTOMLEFT", -1, 0) bar.candyBarIconFrame:SetSize(20, 20) bar.candyBarIconFrame:SetTexCoord(0.1,0.9,0.1,0.9) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Bugsack.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Bugsack.lua index 5f5b832..04a9e8d 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Bugsack.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Bugsack.lua @@ -43,14 +43,14 @@ local function StyleBugSack(event, addon) hooksecurefunc(BugSack, "OpenSack", function() if BugSackFrame.Panel then return end BugSackFrame:RemoveTextures() - BugSackFrame:SetBasicPanel() + BugSackFrame:SetStylePanel("Default", 'Transparent') PLUGIN:ApplyTabStyle(BugSackTabAll) BugSackTabAll:SetPoint("TOPLEFT", BugSackFrame, "BOTTOMLEFT", 0, 1) PLUGIN:ApplyTabStyle(BugSackTabSession) PLUGIN:ApplyTabStyle(BugSackTabLast) - BugSackNextButton:SetButtonTemplate() - BugSackSendButton:SetButtonTemplate() - BugSackPrevButton:SetButtonTemplate() + BugSackNextButton:SetStylePanel("Button") + BugSackSendButton:SetStylePanel("Button") + BugSackPrevButton:SetStylePanel("Button") PLUGIN:ApplyScrollBarStyle(BugSackScrollScrollBar) end) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Clique.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Clique.lua index 5378487..01945bb 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Clique.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Clique.lua @@ -121,7 +121,7 @@ local function StyleClique() for _, gName in pairs(CliqueButtons) do local button = _G[gName] if(button) then - button:SetButtonTemplate() + button:SetStylePanel("Button") end end @@ -146,7 +146,7 @@ local function StyleClique() CliqueSpellTab:GetRegions():SetSize(.1,.1) CliqueSpellTab:GetNormalTexture():SetTexCoord(0.1,0.9,0.1,0.9) CliqueSpellTab:GetNormalTexture():ClearAllPoints() - CliqueSpellTab:GetNormalTexture():FillInner() + CliqueSpellTab:GetNormalTexture():SetAllPointsIn() end PLUGIN:SaveAddonStyle("Clique", StyleClique) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/DBM.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/DBM.lua index 40fb4f0..8d31f14 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/DBM.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/DBM.lua @@ -54,18 +54,18 @@ local function StyleBars(self) if not icon1.overlay then icon1.overlay = CreateFrame('Frame', '$parentIcon1Overlay', tbar) - icon1.overlay:Size(28) - icon1.overlay:SetPanelTemplate("Button") + icon1.overlay:SetSizeToScale(28) + icon1.overlay:SetStylePanel("Default", "Button") icon1.overlay:SetFrameLevel(0) - icon1.overlay:Point('BOTTOMRIGHT', frame, 'BOTTOMLEFT', -4, 0) + icon1.overlay:SetPointToScale('BOTTOMRIGHT', frame, 'BOTTOMLEFT', -4, 0) end if not icon2.overlay then icon2.overlay = CreateFrame('Frame', '$parentIcon2Overlay', tbar) - icon2.overlay:Size(28) - icon2.overlay:SetPanelTemplate("Button") + icon2.overlay:SetSizeToScale(28) + icon2.overlay:SetStylePanel("Default", "Button") icon2.overlay:SetFrameLevel(0) - icon2.overlay:Point('BOTTOMLEFT', frame, 'BOTTOMRIGHT', 4, 0) + icon2.overlay:SetPointToScale('BOTTOMLEFT', frame, 'BOTTOMRIGHT', 4, 0) end if bar.color then @@ -99,23 +99,23 @@ local function StyleBars(self) texture:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) tbar:SetWidth(sharedWidth) tbar:SetHeight(10) - tbar:Point('BOTTOMLEFT', frame, 'BOTTOMLEFT', 0, 0) - tbar:SetPanelTemplate("Bar") + tbar:SetPointToScale('BOTTOMLEFT', frame, 'BOTTOMLEFT', 0, 0) + tbar:SetStylePanel("Default", "Bar") name:ClearAllPoints() name:SetHeight(8) name:SetWidth(sharedWidth) name:SetJustifyH('LEFT') name:SetShadowColor(0, 0, 0, 0) - name:Point('TOPLEFT', frame, 'TOPLEFT', 0, 0) - name:SetFont(SV.Media.font.roboto, 12, 'OUTLINE') + name:SetPointToScale('TOPLEFT', frame, 'TOPLEFT', 0, 0) + name:SetFont(SV.Media.font.default, 12, 'OUTLINE') name:SetTextColor(bar.owner.options.TextColorR, bar.owner.options.TextColorG, bar.owner.options.TextColorB) timer:ClearAllPoints() timer:SetJustifyH('RIGHT') timer:SetShadowColor(0, 0, 0, 0) - timer:Point('TOPRIGHT', frame, 'TOPRIGHT', 0, 0) - timer:SetFont(SV.Media.font.roboto, 12, 'OUTLINE') + timer:SetPointToScale('TOPRIGHT', frame, 'TOPRIGHT', 0, 0) + timer:SetFont(SV.Media.font.default, 12, 'OUTLINE') timer:SetTextColor(bar.owner.options.TextColorR, bar.owner.options.TextColorG, bar.owner.options.TextColorB) if bar.owner.options.IconLeft then icon1:Show() icon1.overlay:Show() else icon1:Hide() icon1.overlay:Hide() end @@ -141,7 +141,7 @@ local StyleBossTitle = function() if not anchor.styled then local header = {anchor:GetRegions()} if header[1]:IsObjectType('FontString') then - header[1]:FontManager(SV.Media.font.default, 12, 'OUTLINE') + header[1]:FontManager("default") header[1]:SetTextColor(1, 1, 1) header[1]:SetShadowColor(0, 0, 0, 0) anchor.styled = true @@ -164,22 +164,22 @@ local StyleBoss = function() bar:ClearAllPoints() if count == 1 then if DBM_SavedOptions.HealthFrameGrowUp then - bar:Point('BOTTOM', anch, 'TOP' , 0 , 12) + bar:SetPointToScale('BOTTOM', anch, 'TOP' , 0 , 12) else - bar:Point('TOP', anch, 'BOTTOM' , 0, -22) + bar:SetPointToScale('TOP', anch, 'BOTTOM' , 0, -22) end else if DBM_SavedOptions.HealthFrameGrowUp then - bar:Point('TOPLEFT', prev, 'TOPLEFT', 0, 22 + 4) + bar:SetPointToScale('TOPLEFT', prev, 'TOPLEFT', 0, 22 + 4) else - bar:Point('TOPLEFT', prev, 'TOPLEFT', 0, -(22 + 4)) + bar:SetPointToScale('TOPLEFT', prev, 'TOPLEFT', 0, -(22 + 4)) end end - bar:SetFixedPanelTemplate('Transparent') + bar:SetStylePanel("Fixed", 'Transparent') background:SetNormalTexture(nil) progress:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) progress:ClearAllPoints() - progress:FillInner(bar) + progress:SetAllPointsIn(bar) name:ClearAllPoints() name:SetJustifyH('LEFT') name:SetShadowColor(0, 0, 0, 0) @@ -187,10 +187,10 @@ local StyleBoss = function() timer:SetJustifyH('RIGHT') timer:SetShadowColor(0, 0, 0, 0) bar:SetHeight(22) - name:Point('LEFT', bar, 'LEFT', 4, 0) - timer:Point('RIGHT', bar, 'RIGHT', -4, 0) - name:FontManager(SV.Media.font.default, 12, 'OUTLINE') - timer:FontManager(SV.Media.font.default, 12, 'OUTLINE') + name:SetPointToScale('LEFT', bar, 'LEFT', 4, 0) + timer:SetPointToScale('RIGHT', bar, 'RIGHT', -4, 0) + name:FontManager("name") + timer:FontManager("default") count = count + 1 end end @@ -210,15 +210,15 @@ local function StyleDBM(event, addon) if((not RangeSet) and DBMRangeCheck and (not DBM_SavedOptions['DontShowRangeFrame'])) then DBM.RangeCheck:Show() DBM.RangeCheck:Hide() - DBMRangeCheck:HookScript('OnShow', function(self) self:SetFixedPanelTemplate('Transparent') end) - DBMRangeCheckRadar:SetFixedPanelTemplate('Transparent') + DBMRangeCheck:HookScript('OnShow', function(self) self:SetStylePanel("Fixed", 'Transparent') end) + DBMRangeCheckRadar:SetStylePanel("Fixed", 'Transparent') RangeSet = true end if((not InfoSet) and DBMInfoFrame and (not DBM_SavedOptions['DontShowInfoFrame'])) then DBM.InfoFrame:Show(5, 'test') DBM.InfoFrame:Hide() - DBMInfoFrame:HookScript('OnShow', function(self) self:SetFixedPanelTemplate('Transparent') end) + DBMInfoFrame:HookScript('OnShow', function(self) self:SetStylePanel("Fixed", 'Transparent') end) InfoSet = true end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/DXE.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/DXE.lua index 0b2c9c5..f93510f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/DXE.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/DXE.lua @@ -42,30 +42,30 @@ DXE ########################################################## ]]-- local function StyleDXEBar(bar) - bar:SetFixedPanelTemplate("Transparent") + bar:SetStylePanel("Fixed", "Transparent") bar.bg:SetTexture(0,0,0,0) bar.border.Show = SV.fubar bar.border:Hide() bar.statusbar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) bar.statusbar:ClearAllPoints() - bar.statusbar:FillInner() - bar.righticon:SetFixedPanelTemplate("Default") + bar.statusbar:SetAllPointsIn() + bar.righticon:SetStylePanel("Fixed", "Default") bar.righticon.border.Show = SV.fubar bar.righticon.border:Hide() bar.righticon:ClearAllPoints() bar.righticon:SetPoint("LEFT", bar, "RIGHT", 2, 0) bar.righticon.t:SetTexCoord(0.1,0.9,0.1,0.9) bar.righticon.t:ClearAllPoints() - bar.righticon.t:FillInner() + bar.righticon.t:SetAllPointsIn() bar.righticon.t:SetDrawLayer("ARTWORK") - bar.lefticon:SetFixedPanelTemplate("Default") + bar.lefticon:SetStylePanel("Fixed", "Default") bar.lefticon.border.Show = SV.fubar bar.lefticon.border:Hide() bar.lefticon:ClearAllPoints() bar.lefticon:SetPoint("RIGHT", bar, "LEFT", -2, 0) bar.lefticon.t:SetTexCoord(0.1,0.9,0.1,0.9) bar.lefticon.t:ClearAllPoints() - bar.lefticon.t:FillInner() + bar.lefticon.t:SetAllPointsIn() bar.lefticon.t:SetDrawLayer("ARTWORK") end @@ -96,7 +96,7 @@ local function StyleDXE() DXE:LayoutHealthWatchers_() for i,hw in ipairs(frame.HW) do if hw:IsShown() then - hw:SetFixedPanelTemplate("Transparent") + hw:SetStylePanel("Fixed", "Transparent") hw.border.Show = SV.fubar hw.border:Hide() hw.healthbar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) @@ -129,7 +129,7 @@ local function StyleDXE() DXEDB["profiles"][playerKey]["Globals"]["BackgroundTexture"] = [[Interface\BUTTONS\WHITE8X8]] DXEDB["profiles"][playerKey]["Globals"]["BarTexture"] = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]] DXEDB["profiles"][playerKey]["Globals"]["Border"] = "None" - DXEDB["profiles"][playerKey]["Globals"]["Font"] = SV.Media.font.default - DXEDB["profiles"][playerKey]["Globals"]["TimerFont"] = SV.Media.font.default + DXEDB["profiles"][playerKey]["Globals"]["Font"] = SV.Media.font.names + DXEDB["profiles"][playerKey]["Globals"]["TimerFont"] = SV.Media.font.names end PLUGIN:SaveAddonStyle("DXE", StyleDXE) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Details.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Details.lua new file mode 100644 index 0000000..db93318 --- /dev/null +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Details.lua @@ -0,0 +1,125 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +--]] +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local ipairs = _G.ipairs; +local pairs = _G.pairs; +--[[ ADDON ]]-- +local SV = _G.SVUI; +local L = SV.L; +local PLUGIN = select(2, ...); +local Schema = PLUGIN.Schema; +--[[ +########################################################## +STYLE +########################################################## +]]-- +local function StyleDetails() + assert(_detalhes, "AddOn Not Loaded") + + local _detalhes = _G._detalhes + local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" ) + + local reset_tooltip = function() + _detalhes:SetTooltipBackdrop ("Blizzard Tooltip", 16, {1, 1, 1, 1}) + _detalhes:DelayOptionsRefresh() + end + + _detalhes:InstallSkin ("SuperVillain Style", { + file = [[Interface\AddOns\Details\images\skins\elvui.tga]], + author = "SuperVillain UI", + version = "1.0", + site = "unknown", + desc = "Style to match SuperVillain UI!", + + --general + can_change_alpha_head = true, + + --icon anchors + icon_anchor_main = {-4, -5}, + icon_anchor_plugins = {-7, -13}, + icon_plugins_size = {19, 18}, + + --micro frames + micro_frames = {color = {0.525490, 0.525490, 0.525490, 1}, font = "SVUI Caps Font", size = 11}, + + -- the four anchors (for when the toolbar is on the top side) + icon_point_anchor = {-35, -0.5}, + left_corner_anchor = {-107, 0}, + right_corner_anchor = {96, 0}, + + -- the four anchors (for when the toolbar is on the bottom side) + icon_point_anchor_bottom = {-37, 12}, + left_corner_anchor_bottom = {-107, 0}, + right_corner_anchor_bottom = {96, 0}, + callback = function (self, instance) end, + control_script_on_start = nil, + control_script = nil, + instance_cprops = { + menu_icons_size = 0.90, + menu_anchor = {16, 2, side = 2}, + menu_anchor_down = {16, -2}, + plugins_grow_direction = 1, + menu_icons = {shadow = true}, + attribute_text = {enabled = true, anchor = {-20, 5}, text_face = "SVUI Default Font", text_size = 12, text_color = {1, 1, 1, .7}, side = 1, shadow = true}, + hide_icon = true, + desaturated_menu = false, + bg_alpha = 0.51, + bg_r = 0.3294, + bg_g = 0.3294, + bg_b = 0.3294, + show_statusbar = false, + + row_info = { + texture = "Skyline", + texture_class_colors = true, + alpha = 0.80, + texture_background_class_color = false, + texture_background = "Details D'ictum", + fixed_texture_color = {0, 0, 0}, + fixed_texture_background_color = {0, 0, 0, 0.471}, + space = {left = 1, right = -2, between = 0}, + backdrop = {enabled = true, size = 4, color = {0, 0, 0, 1}, texture = "Details BarBorder 2"}, + icon_file = [[Interface\AddOns\Details\images\classes_small_alpha]], + start_after_icon = false, + }, + + wallpaper = { + overlay = {1, 1, 1}, + width = 256, + texcoord = {49/1024, 305/1024, 774/1024, 646/1024}, + enabled = true, + anchor = "all", + height = 128, + alpha = 0.8, + texture = [[Interface\AddOns\Details\images\skins\elvui]], + } + }, + + skin_options = { + {type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON2"], func = reset_tooltip, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON2_DESC"]}, + {type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3"], func = reset_tooltip, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3_DESC"]}, + } + }) +end +--[[ +########################################################## +PLUGIN LOADING +########################################################## +]]-- +PLUGIN:SaveAddonStyle("Details", StyleDetails) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/LightHeaded.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/LightHeaded.lua index 7773676..17fe091 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/LightHeaded.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/LightHeaded.lua @@ -87,7 +87,7 @@ local function StyleLightHeaded() if lhopts:IsVisible() then for i = 1, 9 do local cbox = _G["LightHeaded_Panel_Toggle"..i] - cbox:SetCheckboxTemplate(true) + cbox:SetStylePanel("Checkbox", true) end local buttons = { "LightHeaded_Panel_Button1", @@ -95,7 +95,7 @@ local function StyleLightHeaded() } for _, button in pairs(buttons) do - _G[button]:SetButtonTemplate() + _G[button]:SetStylePanel("Button") end LightHeaded_Panel_Button2:Disable() diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/MasterPlan.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/MasterPlan.lua new file mode 100644 index 0000000..30f658d --- /dev/null +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/MasterPlan.lua @@ -0,0 +1,51 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +--]] +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local ipairs = _G.ipairs; +local pairs = _G.pairs; +--[[ ADDON ]]-- +local SV = _G.SVUI; +local L = SV.L; +local PLUGIN = select(2, ...); +local Schema = PLUGIN.Schema; +--[[ +########################################################## +HELPERS +########################################################## +]]-- +local RING_TEXTURE = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\FOLLOWER-RING]] +local LVL_TEXTURE = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\FOLLOWER-LEVEL]] +local DEFAULT_COLOR = {r = 0.25, g = 0.25, b = 0.25}; +--[[ +########################################################## +STYLE +########################################################## +]]-- +local function StyleMasterPlan() + assert(MasterPlan, "AddOn Not Loaded") + + PLUGIN:ApplyTabStyle(GarrisonMissionFrameTab3) + PLUGIN:ApplyTabStyle(GarrisonMissionFrameTab4) +end +--[[ +########################################################## +PLUGIN LOADING +########################################################## +]]-- +PLUGIN:SaveAddonStyle("MasterPlan", StyleMasterPlan, false, true) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Mogit.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Mogit.lua index 82430b7..ec34ceb 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Mogit.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Mogit.lua @@ -65,7 +65,7 @@ local function StyleMogItPreview() if _G["MogItPreview"..i] then PLUGIN:ApplyFrameStyle(_G["MogItPreview"..i]) end if _G["MogItPreview"..i.."CloseButton"] then PLUGIN:ApplyCloseButtonStyle(_G["MogItPreview"..i.."CloseButton"]) end if _G["MogItPreview"..i.."Inset"] then _G["MogItPreview"..i.."Inset"]:RemoveTextures(true) end - if _G["MogItPreview"..i.."Activate"] then _G["MogItPreview"..i.."Activate"]:SetButtonTemplate() end + if _G["MogItPreview"..i.."Activate"] then _G["MogItPreview"..i.."Activate"]:SetStylePanel("Button") end end end @@ -82,7 +82,7 @@ local function StyleMogIt() PLUGIN:ApplyCloseButtonStyle(MogItFrameCloseButton) PLUGIN:ApplyCloseButtonStyle(MogItFiltersCloseButton) MogItFrameFiltersDefaults:RemoveTextures(true) - MogItFrameFiltersDefaults:SetButtonTemplate() + MogItFrameFiltersDefaults:SetStylePanel("Button") PLUGIN:ApplyScrollFrameStyle(MogItScroll) PLUGIN:ApplyScrollFrameStyle(MogItFiltersScrollScrollBar) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Omen.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Omen.lua index 0b746db..0d8e881 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Omen.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Omen.lua @@ -45,7 +45,7 @@ local function StyleOmen() Omen.db.profile.Background.Texture = "None" --[[ Bar Settings ]]-- - Omen.db.profile.Bar.Font = "Roboto" + Omen.db.profile.Bar.Font = "SVUI Clean Font" Omen.db.profile.Bar.FontOutline = "None" Omen.db.profile.Bar.FontSize = 11 Omen.db.profile.Bar.Height = 14 @@ -70,7 +70,7 @@ local function StyleOmen() if(not PLUGIN:ValidateDocklet("Omen")) then PLUGIN:ApplyFrameStyle(self.BarList, 'Transparent') self.Title:RemoveTextures() - self.Title:SetPanelTemplate("Default") + self.Title:SetStylePanel("Default", "Default") self.Title:SetPanelColor("class") end self.BarList:SetPoint('TOPLEFT', self.Title, 'BOTTOMLEFT', 0, 1) @@ -98,7 +98,7 @@ function PLUGIN:Docklet_Omen(parent) db.profile.Background.Texture = "None" --[[ Bar Settings ]]-- - db.profile.Bar.Font = "Roboto"; + db.profile.Bar.Font = "SVUI Clean Font"; db.profile.Bar.FontOutline = "None"; db.profile.Bar.FontSize = 11; db.profile.Bar.Height = 14; @@ -122,11 +122,11 @@ function PLUGIN:Docklet_Omen(parent) Omen:OnProfileChanged(nil,db) OmenTitle:RemoveTextures() OmenTitle.Panel = nil - OmenTitle:SetPanelTemplate("Transparent") + OmenTitle:SetStylePanel("Default", "Transparent") --OmenTitle:SetPanelColor("class") - --OmenTitle:GetFontString():SetFont(SVUI.Media.font.roboto, 12, "OUTLINE") + --OmenTitle:GetFontString():SetFont(SVUI.Media.font.default, 12, "OUTLINE") OmenBarList:RemoveTextures() - OmenAnchor:SetFixedPanelTemplate('Transparent') + OmenAnchor:SetStylePanel("Fixed", 'Transparent') OmenAnchor:ClearAllPoints() OmenAnchor:SetAllPoints(parent) OmenAnchor:SetParent(parent) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Outfitter.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Outfitter.lua index dd0b0f7..c946209 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Outfitter.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Outfitter.lua @@ -44,16 +44,16 @@ local function StyleOutfitter() CharacterFrame:HookScript("OnShow", function(self) PaperDollSidebarTabs:SetPoint("BOTTOMRIGHT", CharacterFrameInsetRight, "TOPRIGHT", -14, 0) end) OutfitterFrame:HookScript("OnShow", function(self) PLUGIN:ApplyFrameStyle(OutfitterFrame) - OutfitterFrameTab1:Size(60, 25) - OutfitterFrameTab2:Size(60, 25) - OutfitterFrameTab3:Size(60, 25) + OutfitterFrameTab1:SetSizeToScale(60, 25) + OutfitterFrameTab2:SetSizeToScale(60, 25) + OutfitterFrameTab3:SetSizeToScale(60, 25) OutfitterMainFrame:RemoveTextures(true) for i = 0, 13 do if _G["OutfitterItem"..i.."OutfitSelected"] then - _G["OutfitterItem"..i.."OutfitSelected"]:SetButtonTemplate() + _G["OutfitterItem"..i.."OutfitSelected"]:SetStylePanel("Button") _G["OutfitterItem"..i.."OutfitSelected"]:ClearAllPoints() - _G["OutfitterItem"..i.."OutfitSelected"]:Size(16) - _G["OutfitterItem"..i.."OutfitSelected"]:Point("LEFT", _G["OutfitterItem"..i.."Outfit"], "LEFT", 8, 0) + _G["OutfitterItem"..i.."OutfitSelected"]:SetSizeToScale(16) + _G["OutfitterItem"..i.."OutfitSelected"]:SetPointToScale("LEFT", _G["OutfitterItem"..i.."Outfit"], "LEFT", 8, 0) end end end) @@ -61,54 +61,54 @@ local function StyleOutfitter() OutfitterFrameTab1:ClearAllPoints() OutfitterFrameTab2:ClearAllPoints() OutfitterFrameTab3:ClearAllPoints() - OutfitterFrameTab1:Point("TOPLEFT", OutfitterFrame, "BOTTOMRIGHT", -65, -2) - OutfitterFrameTab2:Point("LEFT", OutfitterFrameTab1, "LEFT", -65, 0) - OutfitterFrameTab3:Point("LEFT", OutfitterFrameTab2, "LEFT", -65, 0) - OutfitterFrameTab1:SetButtonTemplate() - OutfitterFrameTab2:SetButtonTemplate() - OutfitterFrameTab3:SetButtonTemplate() + OutfitterFrameTab1:SetPointToScale("TOPLEFT", OutfitterFrame, "BOTTOMRIGHT", -65, -2) + OutfitterFrameTab2:SetPointToScale("LEFT", OutfitterFrameTab1, "LEFT", -65, 0) + OutfitterFrameTab3:SetPointToScale("LEFT", OutfitterFrameTab2, "LEFT", -65, 0) + OutfitterFrameTab1:SetStylePanel("Button") + OutfitterFrameTab2:SetStylePanel("Button") + OutfitterFrameTab3:SetStylePanel("Button") PLUGIN:ApplyScrollFrameStyle(OutfitterMainFrameScrollFrameScrollBar) PLUGIN:ApplyCloseButtonStyle(OutfitterCloseButton) - OutfitterNewButton:SetButtonTemplate() - OutfitterEnableNone:SetButtonTemplate() - OutfitterEnableAll:SetButtonTemplate() + OutfitterNewButton:SetStylePanel("Button") + OutfitterEnableNone:SetStylePanel("Button") + OutfitterEnableAll:SetStylePanel("Button") OutfitterButton:ClearAllPoints() OutfitterButton:SetPoint("RIGHT", PaperDollSidebarTabs, "RIGHT", 26, -2) OutfitterButton:SetHighlightTexture(nil) OutfitterSlotEnables:SetFrameStrata("HIGH") - OutfitterEnableHeadSlot:SetCheckboxTemplate(true) - OutfitterEnableNeckSlot:SetCheckboxTemplate(true) - OutfitterEnableShoulderSlot:SetCheckboxTemplate(true) - OutfitterEnableBackSlot:SetCheckboxTemplate(true) - OutfitterEnableChestSlot:SetCheckboxTemplate(true) - OutfitterEnableShirtSlot:SetCheckboxTemplate(true) - OutfitterEnableTabardSlot:SetCheckboxTemplate(true) - OutfitterEnableWristSlot:SetCheckboxTemplate(true) - OutfitterEnableMainHandSlot:SetCheckboxTemplate(true) - OutfitterEnableSecondaryHandSlot:SetCheckboxTemplate(true) - OutfitterEnableHandsSlot:SetCheckboxTemplate(true) - OutfitterEnableWaistSlot:SetCheckboxTemplate(true) - OutfitterEnableLegsSlot:SetCheckboxTemplate(true) - OutfitterEnableFeetSlot:SetCheckboxTemplate(true) - OutfitterEnableFinger0Slot:SetCheckboxTemplate(true) - OutfitterEnableFinger1Slot:SetCheckboxTemplate(true) - OutfitterEnableTrinket0Slot:SetCheckboxTemplate(true) - OutfitterEnableTrinket1Slot:SetCheckboxTemplate(true) - OutfitterItemComparisons:SetButtonTemplate() - OutfitterTooltipInfo:SetButtonTemplate() - OutfitterShowHotkeyMessages:SetButtonTemplate() - OutfitterShowMinimapButton:SetButtonTemplate() - OutfitterShowOutfitBar:SetButtonTemplate() - OutfitterAutoSwitch:SetButtonTemplate() - OutfitterItemComparisons:Size(20) - OutfitterTooltipInfo:Size(20) - OutfitterShowHotkeyMessages:Size(20) - OutfitterShowMinimapButton:Size(20) - OutfitterShowOutfitBar:Size(20) - OutfitterAutoSwitch:Size(20) - OutfitterShowOutfitBar:Point("TOPLEFT", OutfitterAutoSwitch, "BOTTOMLEFT", 0, -5) - OutfitterEditScriptDialogDoneButton:SetButtonTemplate() - OutfitterEditScriptDialogCancelButton:SetButtonTemplate() + OutfitterEnableHeadSlot:SetStylePanel("Checkbox", true) + OutfitterEnableNeckSlot:SetStylePanel("Checkbox", true) + OutfitterEnableShoulderSlot:SetStylePanel("Checkbox", true) + OutfitterEnableBackSlot:SetStylePanel("Checkbox", true) + OutfitterEnableChestSlot:SetStylePanel("Checkbox", true) + OutfitterEnableShirtSlot:SetStylePanel("Checkbox", true) + OutfitterEnableTabardSlot:SetStylePanel("Checkbox", true) + OutfitterEnableWristSlot:SetStylePanel("Checkbox", true) + OutfitterEnableMainHandSlot:SetStylePanel("Checkbox", true) + OutfitterEnableSecondaryHandSlot:SetStylePanel("Checkbox", true) + OutfitterEnableHandsSlot:SetStylePanel("Checkbox", true) + OutfitterEnableWaistSlot:SetStylePanel("Checkbox", true) + OutfitterEnableLegsSlot:SetStylePanel("Checkbox", true) + OutfitterEnableFeetSlot:SetStylePanel("Checkbox", true) + OutfitterEnableFinger0Slot:SetStylePanel("Checkbox", true) + OutfitterEnableFinger1Slot:SetStylePanel("Checkbox", true) + OutfitterEnableTrinket0Slot:SetStylePanel("Checkbox", true) + OutfitterEnableTrinket1Slot:SetStylePanel("Checkbox", true) + OutfitterItemComparisons:SetStylePanel("Button") + OutfitterTooltipInfo:SetStylePanel("Button") + OutfitterShowHotkeyMessages:SetStylePanel("Button") + OutfitterShowMinimapButton:SetStylePanel("Button") + OutfitterShowOutfitBar:SetStylePanel("Button") + OutfitterAutoSwitch:SetStylePanel("Button") + OutfitterItemComparisons:SetSizeToScale(20) + OutfitterTooltipInfo:SetSizeToScale(20) + OutfitterShowHotkeyMessages:SetSizeToScale(20) + OutfitterShowMinimapButton:SetSizeToScale(20) + OutfitterShowOutfitBar:SetSizeToScale(20) + OutfitterAutoSwitch:SetSizeToScale(20) + OutfitterShowOutfitBar:SetPointToScale("TOPLEFT", OutfitterAutoSwitch, "BOTTOMLEFT", 0, -5) + OutfitterEditScriptDialogDoneButton:SetStylePanel("Button") + OutfitterEditScriptDialogCancelButton:SetStylePanel("Button") PLUGIN:ApplyScrollFrameStyle(OutfitterEditScriptDialogSourceScriptScrollBar) PLUGIN:ApplyFrameStyle(OutfitterEditScriptDialogSourceScript,"Transparent") PLUGIN:ApplyFrameStyle(OutfitterEditScriptDialog) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Postal.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Postal.lua index 294c5f0..0ebcaf9 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Postal.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Postal.lua @@ -41,8 +41,8 @@ POSTAL local function StylePostal() assert(PostalOpenAllButton, "AddOn Not Loaded") - InboxPrevPageButton:Point("CENTER", InboxFrame, "BOTTOMLEFT", 45, 112) - InboxNextPageButton:Point("CENTER", InboxFrame, "BOTTOMLEFT", 295, 112) + InboxPrevPageButton:SetPointToScale("CENTER", InboxFrame, "BOTTOMLEFT", 45, 112) + InboxNextPageButton:SetPointToScale("CENTER", InboxFrame, "BOTTOMLEFT", 295, 112) for i = 1, INBOXITEMS_TO_DISPLAY do local b = _G["MailItem"..i.."ExpireTime"] @@ -51,14 +51,14 @@ local function StylePostal() b.returnicon:SetPoint("TOPRIGHT", b, "TOPRIGHT", 20, 0) end if _G['PostalInboxCB'..i] and not _G['PostalInboxCB'..i].handled then - _G['PostalInboxCB'..i]:SetCheckboxTemplate(true) + _G['PostalInboxCB'..i]:SetStylePanel("Checkbox", true) _G['PostalInboxCB'..i].handled = true end end if PostalSelectOpenButton and not PostalSelectOpenButton.handled then - PostalSelectOpenButton:SetButtonTemplate() + PostalSelectOpenButton:SetStylePanel("Button") PostalSelectOpenButton.handled = true - PostalSelectOpenButton:Point("RIGHT", InboxFrame, "TOP", -41, -48) + PostalSelectOpenButton:SetPointToScale("RIGHT", InboxFrame, "TOP", -41, -48) end if Postal_OpenAllMenuButton and not Postal_OpenAllMenuButton.handled then PLUGIN:ApplyPaginationStyle(Postal_OpenAllMenuButton, true) @@ -66,14 +66,14 @@ local function StylePostal() Postal_OpenAllMenuButton.handled = true end if PostalOpenAllButton and not PostalOpenAllButton.handled then - PostalOpenAllButton:SetButtonTemplate() + PostalOpenAllButton:SetStylePanel("Button") PostalOpenAllButton.handled = true - PostalOpenAllButton:Point("CENTER", InboxFrame, "TOP", -34, -400) + PostalOpenAllButton:SetPointToScale("CENTER", InboxFrame, "TOP", -34, -400) end if PostalSelectReturnButton and not PostalSelectReturnButton.handled then - PostalSelectReturnButton:SetButtonTemplate() + PostalSelectReturnButton:SetStylePanel("Button") PostalSelectReturnButton.handled = true - PostalSelectReturnButton:Point("LEFT", InboxFrame, "TOP", -5, -48) + PostalSelectReturnButton:SetPointToScale("LEFT", InboxFrame, "TOP", -5, -48) end if Postal_PackageMenuButton and not Postal_PackageMenuButton.handled then PLUGIN:ApplyPaginationStyle(Postal_PackageMenuButton, true) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Quartz.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Quartz.lua index fd3c1b7..d5f87fa 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Quartz.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Quartz.lua @@ -52,7 +52,7 @@ local function StyleQuartz() self.IconBorder = CreateFrame("Frame", nil, self) PLUGIN:ApplyFrameStyle(self.IconBorder,"Transparent") self.IconBorder:SetFrameLevel(0) - self.IconBorder:WrapOuter(self.Icon) + self.IconBorder:SetAllPointsOut(self.Icon) PLUGIN:ApplyFrameStyle(self.Bar,"Transparent",true) self.isStyled = true end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Recount.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Recount.lua index 3ffdcc8..36bda5e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Recount.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Recount.lua @@ -60,7 +60,7 @@ local function StyleFrame(frame) frame:SetBackdrop(nil) frame.TitleBackground = CreateFrame('Frame', nil, frame) - frame.TitleBackground:SetFixedPanelTemplate("Transparent") + frame.TitleBackground:SetStylePanel("Fixed", "Transparent") --frame.TitleBackground:SetPanelColor("class") frame.TitleBackground:SetPoint('TOP', frame, 'TOP', 0, -8) frame.TitleBackground.timeLapse = 0 @@ -114,9 +114,9 @@ local function StyleRecount() if Recount_ReportWindow.isStyled then return end Recount_ReportWindow.isStyled = true PLUGIN:ApplyFrameStyle(Recount_ReportWindow.Whisper) - Recount_ReportWindow.ReportButton:SetButtonTemplate() + Recount_ReportWindow.ReportButton:SetStylePanel("Button") PLUGIN:ApplyScrollBarStyle(Recount_ReportWindow_Slider) - Recount_ReportWindow_Slider:GetThumbTexture():Size(6,6) + Recount_ReportWindow_Slider:GetThumbTexture():SetSizeToScale(6,6) end) end PLUGIN:SaveAddonStyle("Recount", StyleRecount) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/SexyCooldown.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/SexyCooldown.lua index 38d77fc..482e550 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/SexyCooldown.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/SexyCooldown.lua @@ -59,8 +59,8 @@ local function StyleSexyCooldownBar(bar) SV:AddToDisplayAudit(bar) if PLUGIN:IsAddonReady("DockletSexyCooldown") then bar:ClearAllPoints() - bar:Point('BOTTOMRIGHT', SVUI_ActionBar1, 'TOPRIGHT', 0, 2) - bar:Point("BOTTOMLEFT", SVUI_ActionBar1, "TOPLEFT", 0, 2) + bar:SetPointToScale('BOTTOMRIGHT', SVUI_ActionBar1, 'TOPRIGHT', 0, 2) + bar:SetPointToScale("BOTTOMLEFT", SVUI_ActionBar1, "TOPLEFT", 0, 2) bar:SetHeight(SVUI_ActionBar1Button1:GetHeight()) end end @@ -76,7 +76,7 @@ local function StyleSexyCooldownIcon(bar, icon) end local function StyleSexyCooldownBackdrop(bar) - bar:SetFixedPanelTemplate("Transparent") + bar:SetStylePanel("Fixed", "Transparent") end local function HookSCDBar(bar) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Skada.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Skada.lua index 8d1c6e4..cdc3c14 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Skada.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Skada.lua @@ -48,13 +48,13 @@ local function skada_panel_loader(dock, window) window.db.spark = false; window.db.barslocked = true; window.bargroup:ClearAllPoints() - window.bargroup:FillInner(dock, 3, 3) + window.bargroup:SetAllPointsIn(dock, 3, 3) window.bargroup:SetFrameStrata('LOW') local bgroup = window.bargroup.backdrop; if bgroup then bgroup:Show() - bgroup:SetFixedPanelTemplate('Transparent', true) + bgroup:SetStylePanel("Fixed", 'Transparent', true) end dock.FrameLink = window; @@ -111,9 +111,9 @@ local function StyleSkada() if(window.db.enabletitle) then panelAnchor = skada.button - skada.button:Height(22) + skada.button:SetHeightToScale(22) skada.button:RemoveTextures() - skada.button:SetPanelTemplate("Transparent") + skada.button:SetStylePanel("Default", "Transparent") --skada.button:SetPanelColor("class") local titleFont = skada.button:GetFontString() titleFont:SetFont(SVUI.Media.font.names, 13, "NONE") @@ -121,7 +121,7 @@ local function StyleSkada() titleFont:SetShadowOffset(1, -1) end - skada:SetPanelTemplate("Transparent") + skada:SetStylePanel("Default", "Transparent") skada.Panel:ClearAllPoints() skada.Panel:SetPoint('TOPLEFT', panelAnchor, 'TOPLEFT', -3, 3) skada.Panel:SetPoint('BOTTOMRIGHT', skada, 'BOTTOMRIGHT', 3, -3) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/TradeSkillDW.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/TradeSkillDW.lua index b4cfdcf..f4dc862 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/TradeSkillDW.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/TradeSkillDW.lua @@ -41,7 +41,7 @@ TSDW local function StyleTradeSkillDW() assert(TradeSkillDW_QueueFrame, "AddOn Not Loaded") - TradeSkillFrame:SetPanelTemplate("Action") + TradeSkillFrame:SetStylePanel("Default", "Action") TradeSkillListScrollFrame:RemoveTextures(true) TradeSkillDetailScrollFrame:RemoveTextures(true) TradeSkillFrameInset:RemoveTextures(true) @@ -50,7 +50,7 @@ local function StyleTradeSkillDW() TradeSkillListScrollFrame:RemoveTextures(true) PLUGIN:ApplyFrameStyle(TradeSkillGuildFrame,"Transparent") PLUGIN:ApplyFrameStyle(TradeSkillGuildFrameContainer,"Transparent") - TradeSkillGuildFrame:Point("BOTTOMLEFT", TradeSkillFrame, "BOTTOMRIGHT", 3, 19) + TradeSkillGuildFrame:SetPointToScale("BOTTOMLEFT", TradeSkillFrame, "BOTTOMRIGHT", 3, 19) PLUGIN:ApplyCloseButtonStyle(TradeSkillGuildFrameCloseButton) TradeSkillFrame:HookScript("OnShow", function() @@ -63,34 +63,34 @@ local function StyleTradeSkillDW() end end) - TradeSkillFrame:Height(TradeSkillFrame:GetHeight() + 12) - TradeSkillRankFrame:SetBasicPanel() + TradeSkillFrame:SetHeightToScale(TradeSkillFrame:GetHeight() + 12) + TradeSkillRankFrame:SetStylePanel("Default", 'Transparent') TradeSkillRankFrame:SetStatusBarTexture(SV.Media.bar.default) - TradeSkillCreateButton:SetButtonTemplate() - TradeSkillCancelButton:SetButtonTemplate() - TradeSkillFilterButton:SetButtonTemplate() - TradeSkillCreateAllButton:SetButtonTemplate() - TradeSkillViewGuildCraftersButton:SetButtonTemplate() + TradeSkillCreateButton:SetStylePanel("Button") + TradeSkillCancelButton:SetStylePanel("Button") + TradeSkillFilterButton:SetStylePanel("Button") + TradeSkillCreateAllButton:SetStylePanel("Button") + TradeSkillViewGuildCraftersButton:SetStylePanel("Button") TradeSkillLinkButton:GetNormalTexture():SetTexCoord(0.25, 0.7, 0.37, 0.75) TradeSkillLinkButton:GetPushedTexture():SetTexCoord(0.25, 0.7, 0.45, 0.8) TradeSkillLinkButton:GetHighlightTexture():Die() PLUGIN:ApplyFrameStyle(TradeSkillLinkButton,"Transparent") - TradeSkillLinkButton:Size(17, 14) - TradeSkillLinkButton:Point("LEFT", TradeSkillLinkFrame, "LEFT", 5, -1) - TradeSkillFrameSearchBox:SetEditboxTemplate() - TradeSkillInputBox:SetEditboxTemplate() - TradeSkillIncrementButton:Point("RIGHT", TradeSkillCreateButton, "LEFT", -13, 0) + TradeSkillLinkButton:SetSizeToScale(17, 14) + TradeSkillLinkButton:SetPointToScale("LEFT", TradeSkillLinkFrame, "LEFT", 5, -1) + TradeSkillFrameSearchBox:SetStylePanel("Editbox") + TradeSkillInputBox:SetStylePanel("Editbox") + TradeSkillIncrementButton:SetPointToScale("RIGHT", TradeSkillCreateButton, "LEFT", -13, 0) PLUGIN:ApplyCloseButtonStyle(TradeSkillFrameCloseButton) PLUGIN:ApplyScrollFrameStyle(TradeSkillDetailScrollFrameScrollBar) local once = false hooksecurefunc("TradeSkillFrame_SetSelection", function(id) - TradeSkillSkillIcon:SetButtonTemplate() + TradeSkillSkillIcon:SetStylePanel("Button") if TradeSkillSkillIcon:GetNormalTexture() then TradeSkillSkillIcon:GetNormalTexture():SetTexCoord(0.1,0.9,0.1,0.9) TradeSkillSkillIcon:GetNormalTexture():ClearAllPoints() - TradeSkillSkillIcon:GetNormalTexture():Point("TOPLEFT", 2, -2) - TradeSkillSkillIcon:GetNormalTexture():Point("BOTTOMRIGHT", -2, 2) + TradeSkillSkillIcon:GetNormalTexture():SetPointToScale("TOPLEFT", 2, -2) + TradeSkillSkillIcon:GetNormalTexture():SetPointToScale("BOTTOMRIGHT", -2, 2) end for i = 1, MAX_TRADE_SKILL_REAGENTS do @@ -103,8 +103,8 @@ local function StyleTradeSkillDW() icon.backdrop = CreateFrame("Frame", nil, button) icon.backdrop:SetFrameLevel(button:GetFrameLevel() - 1) PLUGIN:ApplyFrameStyle(icon.backdrop,"Transparent") - icon.backdrop:Point("TOPLEFT", icon, "TOPLEFT", -2, 2) - icon.backdrop:Point("BOTTOMRIGHT", icon, "BOTTOMRIGHT", 2, -2) + icon.backdrop:SetPointToScale("TOPLEFT", icon, "TOPLEFT", -2, 2) + icon.backdrop:SetPointToScale("BOTTOMRIGHT", icon, "BOTTOMRIGHT", 2, -2) end icon:SetParent(icon.backdrop) count:SetParent(icon.backdrop) @@ -112,7 +112,7 @@ local function StyleTradeSkillDW() if i > 2 and once == false then local point, anchoredto, point2, x, y = button:GetPoint() button:ClearAllPoints() - button:Point(point, anchoredto, point2, x, y - 3) + button:SetPointToScale(point, anchoredto, point2, x, y - 3) once = true end _G["TradeSkillReagent"..i.."NameFrame"]:Die() @@ -124,10 +124,10 @@ local function StyleTradeSkillDW() PLUGIN:ApplyCloseButtonStyle(TradeSkillDW_QueueFrameCloseButton) TradeSkillDW_QueueFrameInset:RemoveTextures() - TradeSkillDW_QueueFrameClear:SetButtonTemplate() - TradeSkillDW_QueueFrameDown:SetButtonTemplate() - TradeSkillDW_QueueFrameUp:SetButtonTemplate() - TradeSkillDW_QueueFrameDo:SetButtonTemplate() + TradeSkillDW_QueueFrameClear:SetStylePanel("Button") + TradeSkillDW_QueueFrameDown:SetStylePanel("Button") + TradeSkillDW_QueueFrameUp:SetStylePanel("Button") + TradeSkillDW_QueueFrameDo:SetStylePanel("Button") TradeSkillDW_QueueFrameDetailScrollFrame:RemoveTextures() TradeSkillDW_QueueFrameDetailScrollFrameChildFrame:RemoveTextures() TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent1:RemoveTextures() diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/VEM.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/VEM.lua index 419539a..ad54f0a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/VEM.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/VEM.lua @@ -56,17 +56,17 @@ local function StyleBars(self) if not icon1.overlay then icon1.overlay = CreateFrame('Frame', '$parentIcon1Overlay', tbar) - icon1.overlay:SetFixedPanelTemplate() + icon1.overlay:SetStylePanel("Fixed") icon1.overlay:SetFrameLevel(0) - icon1.overlay:Size(22) - icon1.overlay:Point('BOTTOMRIGHT', frame, 'BOTTOMLEFT', -2, 0) + icon1.overlay:SetSizeToScale(22) + icon1.overlay:SetPointToScale('BOTTOMRIGHT', frame, 'BOTTOMLEFT', -2, 0) end if not icon2.overlay then icon2.overlay = CreateFrame('Frame', '$parentIcon2Overlay', tbar) - icon2.overlay:SetFixedPanelTemplate() + icon2.overlay:SetStylePanel("Fixed") icon2.overlay:SetFrameLevel(0) - icon2.overlay:Size(22) - icon2.overlay:Point('BOTTOMLEFT', frame, 'BOTTOMRIGHT', 2, 0) + icon2.overlay:SetSizeToScale(22) + icon2.overlay:SetPointToScale('BOTTOMLEFT', frame, 'BOTTOMRIGHT', 2, 0) end if bar.color then @@ -90,16 +90,16 @@ local function StyleBars(self) icon1:SetTexCoord(0.1,0.9,0.1,0.9) icon1:ClearAllPoints() - icon1:FillInner(icon1.overlay) + icon1:SetAllPointsIn(icon1.overlay) icon2:SetTexCoord(0.1,0.9,0.1,0.9) icon2:ClearAllPoints() - icon2:FillInner(icon2.overlay) + icon2:SetAllPointsIn(icon2.overlay) texture:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - tbar:FillInner(frame) + tbar:SetAllPointsIn(frame) - frame:SetFixedPanelTemplate() + frame:SetStylePanel("Fixed") name:ClearAllPoints() name:SetWidth(165) @@ -111,11 +111,11 @@ local function StyleBars(self) timer:SetShadowColor(0, 0, 0, 0) frame:SetHeight(22) - name:Point('LEFT', frame, 'LEFT', 4, 0) - timer:Point('RIGHT', frame, 'RIGHT', -4, 0) + name:SetPointToScale('LEFT', frame, 'LEFT', 4, 0) + timer:SetPointToScale('RIGHT', frame, 'RIGHT', -4, 0) - name:SetFont(SV.Media.font.default, 12, 'OUTLINE') - timer:SetFont(SV.Media.font.default, 12, 'OUTLINE') + name:SetFont(SV.Media.font.names, 12, 'OUTLINE') + timer:SetFont(SV.Media.font.names, 12, 'OUTLINE') name:SetTextColor(bar.owner.options.TextColorR, bar.owner.options.TextColorG, bar.owner.options.TextColorB) timer:SetTextColor(bar.owner.options.TextColorR, bar.owner.options.TextColorG, bar.owner.options.TextColorB) @@ -140,7 +140,7 @@ local StyleBossTitle = function() if not anchor.styled then local header = {anchor:GetRegions()} if header[1]:IsObjectType('FontString') then - header[1]:SetFont(SV.Media.font.default, 12, 'OUTLINE') + header[1]:SetFont(SV.Media.font.names, 12, 'OUTLINE') header[1]:SetTextColor(1, 1, 1) header[1]:SetShadowColor(0, 0, 0, 0) anchor.styled = true @@ -163,22 +163,22 @@ local StyleBoss = function() bar:ClearAllPoints() if count == 1 then if VEM_SavedOptions.HealthFrameGrowUp then - bar:Point('BOTTOM', anch, 'TOP' , 0 , 12) + bar:SetPointToScale('BOTTOM', anch, 'TOP' , 0 , 12) else - bar:Point('TOP', anch, 'BOTTOM' , 0, -22) + bar:SetPointToScale('TOP', anch, 'BOTTOM' , 0, -22) end else if VEM_SavedOptions.HealthFrameGrowUp then - bar:Point('TOPLEFT', prev, 'TOPLEFT', 0, 26) + bar:SetPointToScale('TOPLEFT', prev, 'TOPLEFT', 0, 26) else - bar:Point('TOPLEFT', prev, 'TOPLEFT', 0, -26) + bar:SetPointToScale('TOPLEFT', prev, 'TOPLEFT', 0, -26) end end - bar:SetFixedPanelTemplate('Transparent') + bar:SetStylePanel("Fixed", 'Transparent') background:SetNormalTexture(nil) progress:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) progress:ClearAllPoints() - progress:FillInner(bar) + progress:SetAllPointsIn(bar) name:ClearAllPoints() name:SetJustifyH('LEFT') name:SetShadowColor(0, 0, 0, 0) @@ -187,18 +187,18 @@ local StyleBoss = function() timer:SetShadowColor(0, 0, 0, 0) bar:SetHeight(22) - name:Point('LEFT', bar, 'LEFT', 4, 0) - timer:Point('RIGHT', bar, 'RIGHT', -4, 0) + name:SetPointToScale('LEFT', bar, 'LEFT', 4, 0) + timer:SetPointToScale('RIGHT', bar, 'RIGHT', -4, 0) - name:SetFont(SV.Media.font.default, 12, 'OUTLINE') - timer:SetFont(SV.Media.font.default, 12, 'OUTLINE') + name:SetFont(SV.Media.font.names, 12, 'OUTLINE') + timer:SetFont(SV.Media.font.names, 12, 'OUTLINE') count = count + 1 end end local _hook_OnShow = function(self) if(not self.Panel) then - self:SetFixedPanelTemplate('Transparent') + self:SetStylePanel("Fixed", 'Transparent') end end @@ -215,7 +215,7 @@ local function StyleVEM(event, addon) VEM.RangeCheck:Show() VEM.RangeCheck:Hide() VEMRangeCheck:HookScript('OnShow', _hook_OnShow) - VEMRangeCheckRadar:SetFixedPanelTemplate('Transparent') + VEMRangeCheckRadar:SetStylePanel("Fixed", 'Transparent') end if not VEM_SavedOptions['DontShowInfoFrame'] then @@ -241,8 +241,8 @@ local function StyleVEM(event, addon) end) PLUGIN:ApplyTabStyle(VEM_GUI_OptionsFrameTab1) PLUGIN:ApplyTabStyle(VEM_GUI_OptionsFrameTab2) - VEM_GUI_OptionsFrameOkay:SetButtonTemplate() - VEM_GUI_OptionsFrameWebsiteButton:SetButtonTemplate() + VEM_GUI_OptionsFrameOkay:SetStylePanel("Button") + VEM_GUI_OptionsFrameWebsiteButton:SetStylePanel("Button") PLUGIN:ApplyScrollFrameStyle(VEM_GUI_OptionsFramePanelContainerFOVScrollBar) PLUGIN:SafeEventRemoval("VEM", event) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/_load.xml b/Interface/AddOns/SVUI_StyleOMatic/components/addons/_load.xml index c9d2037..b1be5cc 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/_load.xml +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/_load.xml @@ -10,9 +10,11 @@ <Script file='Bugsack.lua'/> <Script file='Clique.lua'/> <Script file='Cooline.lua'/> + <Script file='Details.lua'/> <Script file='DBM.lua'/> <Script file='DXE.lua'/> <Script file='LightHeaded.lua'/> + <Script file='MasterPlan.lua'/> <Script file='Mogit.lua'/> <Script file='Omen.lua'/> <Script file='Outfitter.lua'/> diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/alDamageMeter.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/alDamageMeter.lua index 0a5fb08..0445449 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/alDamageMeter.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/alDamageMeter.lua @@ -59,7 +59,7 @@ function PLUGIN:Docklet_alDamageMeter(parent) dmconf.width=parentFrame:GetWidth() alDamageMeterFrame:ClearAllPoints() alDamageMeterFrame:SetAllPoints(parent) - alDamageMeterFrame.backdrop:SetFixedPanelTemplate('Transparent',true) + alDamageMeterFrame.backdrop:SetStylePanel("Fixed", 'Transparent',true) alDamageMeterFrame.bg:Die() alDamageMeterFrame:SetFrameStrata('LOW') diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/achievement.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/achievement.lua index 73a0e9b..014086e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/achievement.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/achievement.lua @@ -82,7 +82,7 @@ local _hook_TrackingPoint = function(self, anchor, parent, relative, x, y) local actual = self.ListParent if(anchor ~= "BOTTOMLEFT" or parent ~= actual or relative ~= "BOTTOMLEFT" or x ~= 5 or y ~= 5) then self:ClearAllPoints() - self:Point("BOTTOMLEFT", actual, "BOTTOMLEFT", 5, 5) + self:SetPointToScale("BOTTOMLEFT", actual, "BOTTOMLEFT", 5, 5) end end @@ -92,7 +92,7 @@ local _hook_AchievementsUpdate = function() local summary = _G[globalName] if(summary) then summary:RemoveTextures() - summary:SetButtonTemplate() + summary:SetStylePanel("Button") local highlight = _G[("%sHighlight"):format(globalName)] local desc = _G[("%sDescription"):format(globalName)] @@ -107,14 +107,14 @@ local _hook_AchievementsUpdate = function() if(iconover) then iconover:Die() end if(icontex) then icontex:SetTexCoord(0.1, 0.9, 0.1, 0.9) - icontex:FillInner() + icontex:SetAllPointsIn() end if(icon and not icon.Panel) then - icon:SetFixedPanelTemplate("Slot") - icon:Height(icon:GetHeight() - 14) - icon:Width(icon:GetWidth() - 14) + icon:SetStylePanel("Fixed", "Slot") + icon:SetHeightToScale(icon:GetHeight() - 14) + icon:SetWidthToScale(icon:GetWidth() - 14) icon:ClearAllPoints() - icon:Point("LEFT", 6, 0) + icon:SetPointToScale("LEFT", 6, 0) end if summary.accountWide then @@ -130,7 +130,7 @@ local function BarStyleHelper(bar) bar:RemoveTextures() bar:SetStatusBarTexture(SV.Media.bar.default) bar:SetStatusBarColor(4/255, 179/255, 30/255) - bar:SetPanelTemplate("Default") + bar:SetStylePanel("Default", "Default") if _G[bar:GetName().."Title"]then _G[bar:GetName().."Title"]:SetPoint("LEFT", 4, 0) end @@ -176,18 +176,18 @@ local function AchievementStyle() PLUGIN:ApplyWindowStyle(AchievementFrame) AchievementFrameSummaryAchievements:RemoveTextures(true) - AchievementFrameSummaryAchievements:SetPanelTemplate('Inset') + AchievementFrameSummaryAchievements:SetStylePanel("Default", 'Inset') AchievementFrameHeaderTitle:ClearAllPoints() - AchievementFrameHeaderTitle:Point("TOPLEFT", AchievementFrame.Panel, "TOPLEFT", -30, -8) + AchievementFrameHeaderTitle:SetPointToScale("TOPLEFT", AchievementFrame.Panel, "TOPLEFT", -30, -8) AchievementFrameHeaderPoints:ClearAllPoints() - AchievementFrameHeaderPoints:Point("LEFT", AchievementFrameHeaderTitle, "RIGHT", 2, 0) - AchievementFrameCategoriesContainer:SetPanelTemplate("Inset", true, 2, -2, 2) - AchievementFrameAchievementsContainer:SetPanelTemplate("Default") - AchievementFrameAchievementsContainer.Panel:Point("TOPLEFT", 0, 2) - AchievementFrameAchievementsContainer.Panel:Point("BOTTOMRIGHT", -3, -3) + AchievementFrameHeaderPoints:SetPointToScale("LEFT", AchievementFrameHeaderTitle, "RIGHT", 2, 0) + AchievementFrameCategoriesContainer:SetStylePanel("Default", "Inset", true, 2, -2, 2) + AchievementFrameAchievementsContainer:SetStylePanel("Default", "Default") + AchievementFrameAchievementsContainer.Panel:SetPointToScale("TOPLEFT", 0, 2) + AchievementFrameAchievementsContainer.Panel:SetPointToScale("BOTTOMRIGHT", -3, -3) PLUGIN:ApplyCloseButtonStyle(AchievementFrameCloseButton, AchievementFrame.Panel) PLUGIN:ApplyDropdownStyle(AchievementFrameFilterDropDown) - AchievementFrameFilterDropDown:Point("TOPRIGHT", AchievementFrame, "TOPRIGHT", -44, 5) + AchievementFrameFilterDropDown:SetPointToScale("TOPRIGHT", AchievementFrame, "TOPRIGHT", -44, 5) PLUGIN:ApplyScrollFrameStyle(AchievementFrameCategoriesContainerScrollBar, 5) PLUGIN:ApplyScrollFrameStyle(AchievementFrameAchievementsContainerScrollBar, 5) @@ -209,7 +209,7 @@ local function AchievementStyle() AchievementFrameComparisonSummaryFriendStatusBar.text:ClearAllPoints() AchievementFrameComparisonSummaryFriendStatusBar.text:SetPoint("CENTER") - AchievementFrameComparisonHeader:Point("BOTTOMRIGHT", AchievementFrameComparison, "TOPRIGHT", 45, -20) + AchievementFrameComparisonHeader:SetPointToScale("BOTTOMRIGHT", AchievementFrameComparison, "TOPRIGHT", 45, -20) for i = 1, 12 do local categoryName = ("AchievementFrameSummaryCategoriesCategory%d"):format(i) @@ -264,12 +264,12 @@ local function AchievementStyle() button.bg1 = button:CreateTexture(nil, "BACKGROUND", nil, 4) button.bg1:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) button.bg1:SetVertexColor(unpack(SV.Media.color.default)) - button.bg1:Point("TOPLEFT", 1, -1) - button.bg1:Point("BOTTOMRIGHT", -1, 1) + button.bg1:SetPointToScale("TOPLEFT", 1, -1) + button.bg1:SetPointToScale("BOTTOMRIGHT", -1, 1) button.bg3 = button:CreateTexture(nil, "BACKGROUND", nil, 2) button.bg3:SetTexture(unpack(SV.Media.color.default)) - button.bg3:WrapOuter(1) + button.bg3:SetAllPointsOut(1) if(desc) then desc:SetTextColor(0.6, 0.6, 0.6) @@ -289,21 +289,21 @@ local function AchievementStyle() if(over) then over:Die() end if(tex) then tex:SetTexCoord(0.1, 0.9, 0.1, 0.9) - tex:FillInner() + tex:SetAllPointsIn() end - icon:SetFixedPanelTemplate("Default") - icon:Height(icon:GetHeight()-14) - icon:Width(icon:GetWidth()-14) + icon:SetStylePanel("Fixed", "Default") + icon:SetHeightToScale(icon:GetHeight()-14) + icon:SetWidthToScale(icon:GetWidth()-14) icon:ClearAllPoints() - icon:Point("LEFT", 6, 0) + icon:SetPointToScale("LEFT", 6, 0) end if(track) then track:ClearAllPoints() - track:Point("BOTTOMLEFT", 1, 1) + track:SetPointToScale("BOTTOMLEFT", 1, 1) track:RemoveTextures() - track:SetCheckboxTemplate(true) + track:SetStylePanel("Checkbox", true) track.ListParent = button end end @@ -323,37 +323,37 @@ local function AchievementStyle() _G[d].bg1:SetDrawLayer("BACKGROUND", 4) _G[d].bg1:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) _G[d].bg1:SetVertexColor(unpack(SV.Media.color.default)) - _G[d].bg1:Point("TOPLEFT", 4, -4) - _G[d].bg1:Point("BOTTOMRIGHT", -4, 4) + _G[d].bg1:SetPointToScale("TOPLEFT", 4, -4) + _G[d].bg1:SetPointToScale("BOTTOMRIGHT", -4, 4) _G[d].bg2 = _G[d]:CreateTexture(nil, "BACKGROUND") _G[d].bg2:SetDrawLayer("BACKGROUND", 3) _G[d].bg2:SetTexture(0, 0, 0) - _G[d].bg2:Point("TOPLEFT", 3, -3) - _G[d].bg2:Point("BOTTOMRIGHT", -3, 3) + _G[d].bg2:SetPointToScale("TOPLEFT", 3, -3) + _G[d].bg2:SetPointToScale("BOTTOMRIGHT", -3, 3) _G[d].bg3 = _G[d]:CreateTexture(nil, "BACKGROUND") _G[d].bg3:SetDrawLayer("BACKGROUND", 2) _G[d].bg3:SetTexture(0,0,0,1) - _G[d].bg3:Point("TOPLEFT", 2, -2) - _G[d].bg3:Point("BOTTOMRIGHT", -2, 2) + _G[d].bg3:SetPointToScale("TOPLEFT", 2, -2) + _G[d].bg3:SetPointToScale("BOTTOMRIGHT", -2, 2) _G[d].bg4 = _G[d]:CreateTexture(nil, "BACKGROUND") _G[d].bg4:SetDrawLayer("BACKGROUND", 1) _G[d].bg4:SetTexture(0, 0, 0) - _G[d].bg4:Point("TOPLEFT", 1, -1) - _G[d].bg4:Point("BOTTOMRIGHT", -1, 1) + _G[d].bg4:SetPointToScale("TOPLEFT", 1, -1) + _G[d].bg4:SetPointToScale("BOTTOMRIGHT", -1, 1) if v == "Friend"then - _G[d.."Shield"]:Point("TOPRIGHT", _G["AchievementFrameComparisonContainerButton"..f.."Friend"], "TOPRIGHT", -20, -3) + _G[d.."Shield"]:SetPointToScale("TOPRIGHT", _G["AchievementFrameComparisonContainerButton"..f.."Friend"], "TOPRIGHT", -20, -3) end _G[d.."IconBling"]:Die() _G[d.."IconOverlay"]:Die() - _G[d.."Icon"]:SetFixedPanelTemplate("Default") - _G[d.."Icon"]:Height(_G[d.."Icon"]:GetHeight()-14) - _G[d.."Icon"]:Width(_G[d.."Icon"]:GetWidth()-14) + _G[d.."Icon"]:SetStylePanel("Fixed", "Default") + _G[d.."Icon"]:SetHeightToScale(_G[d.."Icon"]:GetHeight()-14) + _G[d.."Icon"]:SetWidthToScale(_G[d.."Icon"]:GetWidth()-14) _G[d.."Icon"]:ClearAllPoints() - _G[d.."Icon"]:Point("LEFT", 6, 0) + _G[d.."Icon"]:SetPointToScale("LEFT", 6, 0) _G[d.."IconTexture"]:SetTexCoord(0.1, 0.9, 0.1, 0.9) - _G[d.."IconTexture"]:FillInner() + _G[d.."IconTexture"]:SetAllPointsIn() end end @@ -386,7 +386,7 @@ local function AchievementStyle() _G["AchievementFrameStatsContainerButton"..f.."HeaderMiddle"]:Die() local d = "AchievementFrameComparisonStatsContainerButton"..f; _G[d]:RemoveTextures() - _G[d]:SetPanelTemplate("Default") + _G[d]:SetStylePanel("Default", "Default") _G[d.."BG"]:SetTexture(1, 1, 1, 0.2) _G[d.."HeaderLeft"]:Die() _G[d.."HeaderRight"]:Die() @@ -401,7 +401,7 @@ local function AchievementStyle() d:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) d:SetStatusBarColor(4/255, 179/255, 30/255) d:SetFrameLevel(d:GetFrameLevel()+3) - d:Height(d:GetHeight()-2) + d:SetHeightToScale(d:GetHeight()-2) d.bg1 = d:CreateTexture(nil, "BACKGROUND") d.bg1:SetDrawLayer("BACKGROUND", 4) d.bg1:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) @@ -410,14 +410,14 @@ local function AchievementStyle() d.bg3 = d:CreateTexture(nil, "BACKGROUND") d.bg3:SetDrawLayer("BACKGROUND", 2) d.bg3:SetTexture(0,0,0,1) - d.bg3:Point("TOPLEFT", -1, 1) - d.bg3:Point("BOTTOMRIGHT", 1, -1); + d.bg3:SetPointToScale("TOPLEFT", -1, 1) + d.bg3:SetPointToScale("BOTTOMRIGHT", 1, -1); d.text:ClearAllPoints() d.text:SetPoint("CENTER", d, "CENTER", 0, -1) d.text:SetJustifyH("CENTER") if y>1 then d:ClearAllPoints() - d:Point("TOP", _G["AchievementFrameProgressBar"..y-1], "BOTTOM", 0, -5) + d:SetPointToScale("TOP", _G["AchievementFrameProgressBar"..y-1], "BOTTOM", 0, -5) hooksecurefunc(d, "SetPoint", function(k, p, q, r, s, t, z) if not z then k:ClearAllPoints()k:SetPoint("TOP", _G["AchievementFrameProgressBar"..y-1], "BOTTOM", 0, -5, true) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/alert.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/alert.lua index 92adf04..e8862ae 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/alert.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/alert.lua @@ -63,11 +63,12 @@ local function StyleAlertIcon(frame, icon) if((not frame) or (not icon)) then return end icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - + icon:SetDrawLayer("BORDER") + if(not frame.IconSlot) then frame.IconSlot = CreateFrame("Frame", nil, frame) - frame.IconSlot:WrapOuter(icon) - frame.IconSlot:SetSlotTemplate() + frame.IconSlot:SetAllPointsOut(icon) + frame.IconSlot:SetStylePanel("Icon") icon:SetParent(frame.IconSlot) end end @@ -295,17 +296,17 @@ local function AlertStyle() PLUGIN:ApplyAlertStyle(frame) - frame.buttons[1]:SetButtonTemplate() - frame.buttons[2]:SetButtonTemplate() - frame.buttons[3]:SetButtonTemplate() + frame.buttons[1]:SetStylePanel("Button") + frame.buttons[2]:SetStylePanel("Button") + frame.buttons[3]:SetStylePanel("Button") - frame.gold:SetEditboxTemplate() - frame.silver:SetEditboxTemplate() - frame.copper:SetEditboxTemplate() + frame.gold:SetStylePanel("Editbox") + frame.silver:SetStylePanel("Editbox") + frame.copper:SetStylePanel("Editbox") - frame.input:SetEditboxTemplate() - frame.input.Panel:Point("TOPLEFT", -2, -4) - frame.input.Panel:Point("BOTTOMRIGHT", 2, 4) + frame.input:SetStylePanel("Editbox") + frame.input.Panel:SetPointToScale("TOPLEFT", -2, -4) + frame.input.Panel:SetPointToScale("BOTTOMRIGHT", 2, 4) end end @@ -412,6 +413,7 @@ local function AlertStyle() frame.IconBG:ClearAllPoints() frame.IconBG:SetPoint("CENTER", frame.AlertPanel.icon, "CENTER", 0, 0) frame.IconBG:SetTexture('') + frame.IconBG:SetDrawLayer("BORDER") frame.MissionType:ClearAllPoints() frame.MissionType:SetPoint("CENTER", frame.AlertPanel.icon, "CENTER", 0, 0) frame.Title:SetTextColor(1, 1, 1) @@ -432,6 +434,7 @@ local function AlertStyle() frame.Icon:ClearAllPoints() frame.Icon:SetPoint("CENTER", frame.AlertPanel.icon, "CENTER", 0, 0) frame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + frame.Icon:SetDrawLayer("BORDER") frame.Title:SetTextColor(1, 1, 1) if(_G[frameName .. 'Glow']) then _G[frameName .. 'Glow']:Die() end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/archeology.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/archeology.lua index fb1a3e4..64177dc 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/archeology.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/archeology.lua @@ -32,14 +32,14 @@ local function ArchaeologyStyle() ArchaeologyFrame:RemoveTextures() ArchaeologyFrameInset:RemoveTextures() - ArchaeologyFrame:SetPanelTemplate("Halftone") + ArchaeologyFrame:SetStylePanel("Default", "Halftone") ArchaeologyFrame.Panel:SetAllPoints() ArchaeologyFrame.portrait:SetAlpha(0) - ArchaeologyFrameInset:SetPanelTemplate("Inset") + ArchaeologyFrameInset:SetStylePanel("Default", "Inset") ArchaeologyFrameInset.Panel:SetPoint("TOPLEFT") ArchaeologyFrameInset.Panel:SetPoint("BOTTOMRIGHT", -3, -1) - ArchaeologyFrameArtifactPageSolveFrameSolveButton:SetButtonTemplate() - ArchaeologyFrameArtifactPageBackButton:SetButtonTemplate() + ArchaeologyFrameArtifactPageSolveFrameSolveButton:SetStylePanel("Button") + ArchaeologyFrameArtifactPageBackButton:SetStylePanel("Button") ArchaeologyFrameRaceFilter:SetFrameLevel(ArchaeologyFrameRaceFilter:GetFrameLevel()+2) PLUGIN:ApplyDropdownStyle(ArchaeologyFrameRaceFilter, 125) PLUGIN:ApplyPaginationStyle(ArchaeologyFrameCompletedPageNextPageButton) @@ -47,12 +47,12 @@ local function ArchaeologyStyle() ArchaeologyFrameRankBar:RemoveTextures() ArchaeologyFrameRankBar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) ArchaeologyFrameRankBar:SetFrameLevel(ArchaeologyFrameRankBar:GetFrameLevel()+2) - ArchaeologyFrameRankBar:SetPanelTemplate("Default") + ArchaeologyFrameRankBar:SetStylePanel("Default", "Default") ArchaeologyFrameArtifactPageSolveFrameStatusBar:RemoveTextures() ArchaeologyFrameArtifactPageSolveFrameStatusBar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) ArchaeologyFrameArtifactPageSolveFrameStatusBar:SetStatusBarColor(0.7, 0.2, 0) ArchaeologyFrameArtifactPageSolveFrameStatusBar:SetFrameLevel(ArchaeologyFrameArtifactPageSolveFrameStatusBar:GetFrameLevel()+2) - ArchaeologyFrameArtifactPageSolveFrameStatusBar:SetPanelTemplate("Default") + ArchaeologyFrameArtifactPageSolveFrameStatusBar:SetStylePanel("Default", "Default") for b = 1, ARCHAEOLOGY_MAX_COMPLETED_SHOWN do local c = _G["ArchaeologyFrameCompletedPageArtifact"..b] @@ -61,8 +61,8 @@ local function ArchaeologyStyle() _G["ArchaeologyFrameCompletedPageArtifact"..b.."Bg"]:Die() _G["ArchaeologyFrameCompletedPageArtifact"..b.."Icon"]:SetTexCoord(0.1, 0.9, 0.1, 0.9) _G["ArchaeologyFrameCompletedPageArtifact"..b.."Icon"].backdrop = CreateFrame("Frame", nil, c) - _G["ArchaeologyFrameCompletedPageArtifact"..b.."Icon"].backdrop:SetFixedPanelTemplate("Default") - _G["ArchaeologyFrameCompletedPageArtifact"..b.."Icon"].backdrop:WrapOuter(_G["ArchaeologyFrameCompletedPageArtifact"..b.."Icon"]) + _G["ArchaeologyFrameCompletedPageArtifact"..b.."Icon"].backdrop:SetStylePanel("Fixed", "Default") + _G["ArchaeologyFrameCompletedPageArtifact"..b.."Icon"].backdrop:SetAllPointsOut(_G["ArchaeologyFrameCompletedPageArtifact"..b.."Icon"]) _G["ArchaeologyFrameCompletedPageArtifact"..b.."Icon"].backdrop:SetFrameLevel(c:GetFrameLevel()-2) _G["ArchaeologyFrameCompletedPageArtifact"..b.."Icon"]:SetDrawLayer("OVERLAY") end @@ -70,8 +70,8 @@ local function ArchaeologyStyle() ArchaeologyFrameArtifactPageIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) ArchaeologyFrameArtifactPageIcon.backdrop = CreateFrame("Frame", nil, ArchaeologyFrameArtifactPage) - ArchaeologyFrameArtifactPageIcon.backdrop:SetFixedPanelTemplate("Default") - ArchaeologyFrameArtifactPageIcon.backdrop:WrapOuter(ArchaeologyFrameArtifactPageIcon) + ArchaeologyFrameArtifactPageIcon.backdrop:SetStylePanel("Fixed", "Default") + ArchaeologyFrameArtifactPageIcon.backdrop:SetAllPointsOut(ArchaeologyFrameArtifactPageIcon) ArchaeologyFrameArtifactPageIcon.backdrop:SetFrameLevel(ArchaeologyFrameArtifactPage:GetFrameLevel()) ArchaeologyFrameArtifactPageIcon:SetParent(ArchaeologyFrameArtifactPageIcon.backdrop) ArchaeologyFrameArtifactPageIcon:SetDrawLayer("OVERLAY") diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/auctionhouse.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/auctionhouse.lua index c2caf4c..a56be8e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/auctionhouse.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/auctionhouse.lua @@ -104,43 +104,43 @@ local function AuctionStyle() PLUGIN:ApplyDropdownStyle(DurationDropDown) PLUGIN:ApplyScrollFrameStyle(BrowseFilterScrollFrameScrollBar) PLUGIN:ApplyScrollFrameStyle(BrowseScrollFrameScrollBar) - IsUsableCheckButton:SetCheckboxTemplate(true) - ShowOnPlayerCheckButton:SetCheckboxTemplate(true) + IsUsableCheckButton:SetStylePanel("Checkbox", true) + ShowOnPlayerCheckButton:SetStylePanel("Checkbox", true) - --ExactMatchCheckButton:SetCheckboxTemplate(true) + --ExactMatchCheckButton:SetStylePanel("Checkbox", true) SideDressUpFrame:RemoveTextures(true) SideDressUpFrame:ClearAllPoints() - SideDressUpFrame:Size(300, 400) + SideDressUpFrame:SetSizeToScale(300, 400) SideDressUpFrame:SetPoint("LEFT", AuctionFrame, "RIGHT", 16, 0) SideDressUpFrame.SetPoint = SV.fubar SideDressUpModel:RemoveTextures(true) SideDressUpModel:SetAllPoints(SideDressUpFrame) - SideDressUpModel:SetFixedPanelTemplate("ModelBorder") - SideDressUpModelResetButton:SetButtonTemplate() + SideDressUpModel:SetStylePanel("Fixed", "ModelBorder") + SideDressUpModelResetButton:SetStylePanel("Button") SideDressUpModelResetButton:SetPoint("BOTTOM", SideDressUpModel, "BOTTOM", 0, 20) PLUGIN:ApplyCloseButtonStyle(SideDressUpModelCloseButton) AuctionProgressFrame:RemoveTextures() - AuctionProgressFrame:SetFixedPanelTemplate("Transparent", true) - AuctionProgressFrameCancelButton:SetButtonTemplate() - AuctionProgressFrameCancelButton:SetFixedPanelTemplate("Default") + AuctionProgressFrame:SetStylePanel("Fixed", "Transparent", true) + AuctionProgressFrameCancelButton:SetStylePanel("Button") + AuctionProgressFrameCancelButton:SetStylePanel("Fixed", "Default") AuctionProgressFrameCancelButton:SetHitRectInsets(0, 0, 0, 0) - AuctionProgressFrameCancelButton:GetNormalTexture():FillInner() + AuctionProgressFrameCancelButton:GetNormalTexture():SetAllPointsIn() AuctionProgressFrameCancelButton:GetNormalTexture():SetTexCoord(0.67, 0.37, 0.61, 0.26) - AuctionProgressFrameCancelButton:Size(28, 28) - AuctionProgressFrameCancelButton:Point("LEFT", AuctionProgressBar, "RIGHT", 8, 0) + AuctionProgressFrameCancelButton:SetSizeToScale(28, 28) + AuctionProgressFrameCancelButton:SetPointToScale("LEFT", AuctionProgressBar, "RIGHT", 8, 0) AuctionProgressBarIcon:SetTexCoord(0.67, 0.37, 0.61, 0.26) local AuctionProgressBarBG = CreateFrame("Frame", nil, AuctionProgressBarIcon:GetParent()) - AuctionProgressBarBG:WrapOuter(AuctionProgressBarIcon) - AuctionProgressBarBG:SetFixedPanelTemplate("Default") + AuctionProgressBarBG:SetAllPointsOut(AuctionProgressBarIcon) + AuctionProgressBarBG:SetStylePanel("Fixed", "Default") AuctionProgressBarIcon:SetParent(AuctionProgressBarBG) AuctionProgressBarText:ClearAllPoints() AuctionProgressBarText:SetPoint("CENTER") AuctionProgressBar:RemoveTextures() - AuctionProgressBar:SetPanelTemplate("Default") + AuctionProgressBar:SetStylePanel("Default", "Default") AuctionProgressBar:SetStatusBarTexture(SV.Media.bar.default) AuctionProgressBar:SetStatusBarColor(1, 1, 0) @@ -150,25 +150,25 @@ local function AuctionStyle() for _,gName in pairs(AuctionBidButtons) do if(_G[gName]) then _G[gName]:RemoveTextures() - _G[gName]:SetButtonTemplate() + _G[gName]:SetStylePanel("Button") end end - AuctionsCloseButton:Point("BOTTOMRIGHT", AuctionFrameAuctions, "BOTTOMRIGHT", 66, 10) - AuctionsCancelAuctionButton:Point("RIGHT", AuctionsCloseButton, "LEFT", -4, 0) + AuctionsCloseButton:SetPointToScale("BOTTOMRIGHT", AuctionFrameAuctions, "BOTTOMRIGHT", 66, 10) + AuctionsCancelAuctionButton:SetPointToScale("RIGHT", AuctionsCloseButton, "LEFT", -4, 0) - BidBuyoutButton:Point("RIGHT", BidCloseButton, "LEFT", -4, 0) - BidBidButton:Point("RIGHT", BidBuyoutButton, "LEFT", -4, 0) + BidBuyoutButton:SetPointToScale("RIGHT", BidCloseButton, "LEFT", -4, 0) + BidBidButton:SetPointToScale("RIGHT", BidBuyoutButton, "LEFT", -4, 0) - BrowseBuyoutButton:Point("RIGHT", BrowseCloseButton, "LEFT", -4, 0) - BrowseBidButton:Point("RIGHT", BrowseBuyoutButton, "LEFT", -4, 0) + BrowseBuyoutButton:SetPointToScale("RIGHT", BrowseCloseButton, "LEFT", -4, 0) + BrowseBidButton:SetPointToScale("RIGHT", BrowseBuyoutButton, "LEFT", -4, 0) AuctionsItemButton:RemoveTextures() - AuctionsItemButton:SetButtonTemplate() + AuctionsItemButton:SetStylePanel("Button") AuctionsItemButton:SetScript("OnUpdate", function() if AuctionsItemButton:GetNormalTexture()then AuctionsItemButton:GetNormalTexture():SetTexCoord(0.1, 0.9, 0.1, 0.9) - AuctionsItemButton:GetNormalTexture():FillInner() + AuctionsItemButton:GetNormalTexture():SetAllPointsIn() end end) @@ -183,41 +183,41 @@ local function AuctionStyle() PLUGIN:ApplyTabStyle(_G["AuctionFrameTab3"]) AuctionFrameBrowse.bg1 = CreateFrame("Frame", nil, AuctionFrameBrowse) - AuctionFrameBrowse.bg1:Point("TOPLEFT", 20, -103) - AuctionFrameBrowse.bg1:Point("BOTTOMRIGHT", -575, 40) - AuctionFrameBrowse.bg1:SetFixedPanelTemplate("Inset") + AuctionFrameBrowse.bg1:SetPointToScale("TOPLEFT", 20, -103) + AuctionFrameBrowse.bg1:SetPointToScale("BOTTOMRIGHT", -575, 40) + AuctionFrameBrowse.bg1:SetStylePanel("Fixed", "Inset") BrowseNoResultsText:SetParent(AuctionFrameBrowse.bg1) BrowseSearchCountText:SetParent(AuctionFrameBrowse.bg1) - BrowseSearchButton:Point("TOPRIGHT", AuctionFrameBrowse, "TOPRIGHT", 25, -34) - BrowseResetButton:Point("TOPRIGHT", BrowseSearchButton, "TOPLEFT", -4, 0) + BrowseSearchButton:SetPointToScale("TOPRIGHT", AuctionFrameBrowse, "TOPRIGHT", 25, -34) + BrowseResetButton:SetPointToScale("TOPRIGHT", BrowseSearchButton, "TOPLEFT", -4, 0) AuctionFrameBrowse.bg1:SetFrameLevel(AuctionFrameBrowse.bg1:GetFrameLevel()-1) - BrowseFilterScrollFrame:Height(300) + BrowseFilterScrollFrame:SetHeightToScale(300) AuctionFrameBrowse.bg2 = CreateFrame("Frame", nil, AuctionFrameBrowse) - AuctionFrameBrowse.bg2:SetFixedPanelTemplate("Inset") - AuctionFrameBrowse.bg2:Point("TOPLEFT", AuctionFrameBrowse.bg1, "TOPRIGHT", 4, 0) - AuctionFrameBrowse.bg2:Point("BOTTOMRIGHT", AuctionFrame, "BOTTOMRIGHT", -8, 40) + AuctionFrameBrowse.bg2:SetStylePanel("Fixed", "Inset") + AuctionFrameBrowse.bg2:SetPointToScale("TOPLEFT", AuctionFrameBrowse.bg1, "TOPRIGHT", 4, 0) + AuctionFrameBrowse.bg2:SetPointToScale("BOTTOMRIGHT", AuctionFrame, "BOTTOMRIGHT", -8, 40) AuctionFrameBrowse.bg2:SetFrameLevel(AuctionFrameBrowse.bg2:GetFrameLevel() - 1) for i = 1, NUM_FILTERS_TO_DISPLAY do local header = _G[("AuctionFilterButton%d"):format(i)] if(header) then header:RemoveTextures() - header:SetButtonTemplate() + header:SetStylePanel("Button") end end for _,field in pairs(AuctionTextFields)do - _G[field]:SetEditboxTemplate() + _G[field]:SetStylePanel("Editbox") _G[field]:SetTextInsets(-1, -1, -2, -2) end BrowseMinLevel:ClearAllPoints() - BrowseMinLevel:Point("LEFT", BrowseName, "RIGHT", 8, 0) + BrowseMinLevel:SetPointToScale("LEFT", BrowseName, "RIGHT", 8, 0) BrowseMaxLevel:ClearAllPoints() - BrowseMaxLevel:Point("LEFT", BrowseMinLevel, "RIGHT", 8, 0) + BrowseMaxLevel:SetPointToScale("LEFT", BrowseMinLevel, "RIGHT", 8, 0) AuctionsStackSizeEntry.Panel:SetAllPoints() AuctionsNumStacksEntry.Panel:SetAllPoints() @@ -228,23 +228,24 @@ local function AuctionStyle() if(button and (not button.Panel)) then button:RemoveTextures() - button:SetButtonTemplate(false, 1, 1, 1) + button:SetStylePanel("Button", false, 1, 1, 1) button.Panel:ClearAllPoints() button.Panel:SetPoint("TOPLEFT", button, "TOPLEFT", 0, 0) button.Panel:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", 0, 5) if(buttonItem) then buttonItem:RemoveTextures() - buttonItem:SetSlotTemplate(false, 2, 0, 0) + buttonItem:SetStylePanel("Icon", false, 2, 0, 0) if(buttonTex) then buttonTex:SetParent(buttonItem.Panel) - buttonTex:FillInner(buttonItem.Panel, 2, 2) + buttonTex:SetAllPointsIn(buttonItem.Panel, 2, 2) buttonTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) + buttonTex:SetDesaturated(false) end local highLight = button:GetHighlightTexture() highLight:ClearAllPoints() - highLight:Point("TOPLEFT", buttonItem, "TOPRIGHT", 2, -2) + highLight:SetPointToScale("TOPLEFT", buttonItem, "TOPRIGHT", 2, -2) highLight:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 7) button:GetPushedTexture():SetAllPoints(highLight) _G["BrowseButton"..h.."Highlight"] = highLight @@ -260,14 +261,15 @@ local function AuctionStyle() if(button) then if(buttonTex) then buttonTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) - buttonTex:FillInner() + buttonTex:SetAllPointsIn() + buttonTex:SetDesaturated(false) end button:RemoveTextures() - button:SetButtonTemplate() + button:SetStylePanel("Button") if(buttonItem) then - buttonItem:SetButtonTemplate() + buttonItem:SetStylePanel("Button") buttonItem.Panel:SetAllPoints() buttonItem:HookScript("OnUpdate", function() buttonItem:GetNormalTexture():Die() @@ -276,7 +278,7 @@ local function AuctionStyle() local highLight = button:GetHighlightTexture() _G["AuctionsButton"..h.."Highlight"] = highLight highLight:ClearAllPoints() - highLight:Point("TOPLEFT", buttonItem, "TOPRIGHT", 2, 0) + highLight:SetPointToScale("TOPLEFT", buttonItem, "TOPRIGHT", 2, 0) highLight:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 5) button:GetPushedTexture():SetAllPoints(highLight) end @@ -291,14 +293,15 @@ local function AuctionStyle() if(button) then if(buttonTex) then buttonTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) - buttonTex:FillInner() + buttonTex:SetAllPointsIn() + buttonTex:SetDesaturated(false) end button:RemoveTextures() - button:SetButtonTemplate() + button:SetStylePanel("Button") if(buttonItem) then - buttonItem:SetButtonTemplate() + buttonItem:SetStylePanel("Button") buttonItem.Panel:SetAllPoints() buttonItem:HookScript("OnUpdate", function() buttonItem:GetNormalTexture():Die() @@ -307,30 +310,30 @@ local function AuctionStyle() local highLight = button:GetHighlightTexture() _G["BidButton"..h.."Highlight"] = highLight highLight:ClearAllPoints() - highLight:Point("TOPLEFT", buttonItem, "TOPRIGHT", 2, 0) + highLight:SetPointToScale("TOPLEFT", buttonItem, "TOPRIGHT", 2, 0) highLight:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 5) button:GetPushedTexture():SetAllPoints(highLight) end end end - BrowseScrollFrame:Height(300) + BrowseScrollFrame:SetHeightToScale(300) AuctionFrameBid.bg = CreateFrame("Frame", nil, AuctionFrameBid) - AuctionFrameBid.bg:SetFixedPanelTemplate("Inset") - AuctionFrameBid.bg:Point("TOPLEFT", 22, -72) - AuctionFrameBid.bg:Point("BOTTOMRIGHT", 66, 39) + AuctionFrameBid.bg:SetStylePanel("Fixed", "Inset") + AuctionFrameBid.bg:SetPointToScale("TOPLEFT", 22, -72) + AuctionFrameBid.bg:SetPointToScale("BOTTOMRIGHT", 66, 39) AuctionFrameBid.bg:SetFrameLevel(AuctionFrameBid.bg:GetFrameLevel()-1) - BidScrollFrame:Height(332) - AuctionsScrollFrame:Height(336) + BidScrollFrame:SetHeightToScale(332) + AuctionsScrollFrame:SetHeightToScale(336) AuctionFrameAuctions.bg1 = CreateFrame("Frame", nil, AuctionFrameAuctions) - AuctionFrameAuctions.bg1:SetFixedPanelTemplate("Inset") - AuctionFrameAuctions.bg1:Point("TOPLEFT", 15, -70) - AuctionFrameAuctions.bg1:Point("BOTTOMRIGHT", -545, 35) + AuctionFrameAuctions.bg1:SetStylePanel("Fixed", "Inset") + AuctionFrameAuctions.bg1:SetPointToScale("TOPLEFT", 15, -70) + AuctionFrameAuctions.bg1:SetPointToScale("BOTTOMRIGHT", -545, 35) AuctionFrameAuctions.bg1:SetFrameLevel(AuctionFrameAuctions.bg1:GetFrameLevel() - 2) AuctionFrameAuctions.bg2 = CreateFrame("Frame", nil, AuctionFrameAuctions) - AuctionFrameAuctions.bg2:SetFixedPanelTemplate("Inset") - AuctionFrameAuctions.bg2:Point("TOPLEFT", AuctionFrameAuctions.bg1, "TOPRIGHT", 3, 0) - AuctionFrameAuctions.bg2:Point("BOTTOMRIGHT", AuctionFrame, -8, 35) + AuctionFrameAuctions.bg2:SetStylePanel("Fixed", "Inset") + AuctionFrameAuctions.bg2:SetPointToScale("TOPLEFT", AuctionFrameAuctions.bg1, "TOPRIGHT", 3, 0) + AuctionFrameAuctions.bg2:SetPointToScale("BOTTOMRIGHT", AuctionFrame, -8, 35) AuctionFrameAuctions.bg2:SetFrameLevel(AuctionFrameAuctions.bg2:GetFrameLevel() - 2) end --[[ diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/barbershop.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/barbershop.lua index 7ffaf5b..0aca4eb 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/barbershop.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/barbershop.lua @@ -32,16 +32,16 @@ local function BarberShopStyle() local buttons = {"BarberShopFrameOkayButton", "BarberShopFrameCancelButton", "BarberShopFrameResetButton"} - BarberShopFrameOkayButton:Point("RIGHT", BarberShopFrameSelector4, "BOTTOM", 2, -50) + BarberShopFrameOkayButton:SetPointToScale("RIGHT", BarberShopFrameSelector4, "BOTTOM", 2, -50) for b = 1, #buttons do _G[buttons[b]]:RemoveTextures() - _G[buttons[b]]:SetButtonTemplate() + _G[buttons[b]]:SetStylePanel("Button") end BarberShopFrame:RemoveTextures() - BarberShopFrame:SetPanelTemplate("Halftone") - BarberShopFrame:Size(BarberShopFrame:GetWidth()-30, BarberShopFrame:GetHeight()-56) + BarberShopFrame:SetStylePanel("Default", "Halftone") + BarberShopFrame:SetSizeToScale(BarberShopFrame:GetWidth()-30, BarberShopFrame:GetHeight()-56) local lastframe; for i = 1, 5 do @@ -52,9 +52,9 @@ local function BarberShopStyle() selector:ClearAllPoints() if lastframe then - selector:Point("TOP", lastframe, "BOTTOM", 0, -3) + selector:SetPointToScale("TOP", lastframe, "BOTTOM", 0, -3) else - selector:Point("TOP", BarberShopFrame, "TOP", 0, -12) + selector:SetPointToScale("TOP", BarberShopFrame, "TOP", 0, -12) end selector:RemoveTextures() @@ -65,20 +65,20 @@ local function BarberShopStyle() end BarberShopFrameMoneyFrame:RemoveTextures() - BarberShopFrameMoneyFrame:SetPanelTemplate("Inset") - BarberShopFrameMoneyFrame:Point("TOP", lastframe, "BOTTOM", 0, -10) + BarberShopFrameMoneyFrame:SetStylePanel("Default", "Inset") + BarberShopFrameMoneyFrame:SetPointToScale("TOP", lastframe, "BOTTOM", 0, -10) BarberShopFrameBackground:Die() BarberShopBannerFrameBGTexture:Die() BarberShopBannerFrame:Die() BarberShopAltFormFrameBorder:RemoveTextures() - BarberShopAltFormFrame:Point("BOTTOM", BarberShopFrame, "TOP", 0, 5) + BarberShopAltFormFrame:SetPointToScale("BOTTOM", BarberShopFrame, "TOP", 0, 5) BarberShopAltFormFrame:RemoveTextures() - BarberShopAltFormFrame:SetPanelTemplate("Action") + BarberShopAltFormFrame:SetStylePanel("Default", "Action") BarberShopFrameResetButton:ClearAllPoints() - BarberShopFrameResetButton:Point("BOTTOM", BarberShopFrame.Panel, "BOTTOM", 0, 4) + BarberShopFrameResetButton:SetPointToScale("BOTTOM", BarberShopFrame.Panel, "BOTTOM", 0, 4) end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/battlefield.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/battlefield.lua index da1a42d..7928104 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/battlefield.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/battlefield.lua @@ -36,8 +36,8 @@ local function BattlefieldStyle() BattlefieldMinimapTabLeft:Die() BattlefieldMinimapTabMiddle:Die() BattlefieldMinimapTabRight:Die() - BattlefieldMinimap:SetFixedPanelTemplate("Transparent") - BattlefieldMinimap.Panel:Point("BOTTOMRIGHT", -4, 2) + BattlefieldMinimap:SetStylePanel("Fixed", "Transparent") + BattlefieldMinimap.Panel:SetPointToScale("BOTTOMRIGHT", -4, 2) BattlefieldMinimap:SetFrameStrata("LOW") BattlefieldMinimapCloseButton:ClearAllPoints() BattlefieldMinimapCloseButton:SetPoint("TOPRIGHT", -4, 0) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/blackmarket.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/blackmarket.lua index 79ef869..5889155 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/blackmarket.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/blackmarket.lua @@ -41,9 +41,9 @@ local function BlackMarketStyle() end BlackMarketFrame:RemoveTextures() - BlackMarketFrame:SetPanelTemplate("Halftone") + BlackMarketFrame:SetStylePanel("Default", "Halftone") BlackMarketFrame.Inset:RemoveTextures() - BlackMarketFrame.Inset:SetFixedPanelTemplate("Inset") + BlackMarketFrame.Inset:SetStylePanel("Fixed", "Inset") PLUGIN:ApplyCloseButtonStyle(BlackMarketFrame.CloseButton) PLUGIN:ApplyScrollFrameStyle(BlackMarketScrollFrameScrollBar, 4) @@ -55,10 +55,10 @@ local function BlackMarketStyle() ChangeTab(BlackMarketFrame.ColumnCurrentBid) BlackMarketFrame.MoneyFrameBorder:RemoveTextures() - BlackMarketBidPriceGold:SetEditboxTemplate() - BlackMarketBidPriceGold.Panel:Point("TOPLEFT", -2, 0) - BlackMarketBidPriceGold.Panel:Point("BOTTOMRIGHT", -2, 0) - BlackMarketFrame.BidButton:SetButtonTemplate() + BlackMarketBidPriceGold:SetStylePanel("Editbox") + BlackMarketBidPriceGold.Panel:SetPointToScale("TOPLEFT", -2, 0) + BlackMarketBidPriceGold.Panel:SetPointToScale("BOTTOMRIGHT", -2, 0) + BlackMarketFrame.BidButton:SetStylePanel("Button") hooksecurefunc("BlackMarketScrollFrame_Update", function() local buttons = BlackMarketScrollFrame.buttons; local r = #buttons; @@ -69,7 +69,7 @@ local function BlackMarketStyle() local v = s+b; if not u.styled then u:RemoveTextures() - u:SetButtonTemplate() + u:SetStylePanel("Button") PLUGIN:ApplyItemButtonStyle(u.Item) u.styled = true end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/calendar.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/calendar.lua index c1c40a6..9d63008 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/calendar.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/calendar.lua @@ -57,8 +57,8 @@ local function CalendarStyle() if(cfframe) then cfframe:RemoveTextures() - cfframe:Width(155) - cfframe:SetPanelTemplate("Default") + cfframe:SetWidthToScale(155) + cfframe:SetStylePanel("Default", "Default") local cfbutton = _G["CalendarFilterButton"]; if(cfbutton) then @@ -78,10 +78,10 @@ local function CalendarStyle() end local l = CreateFrame("Frame", "CalendarFrameBackdrop", CalendarFrame) - l:SetFixedPanelTemplate("Default") + l:SetStylePanel("Fixed", "Default") l:SetPoint("TOPLEFT", 10, -72) l:SetPoint("BOTTOMRIGHT", -8, 3) - CalendarContextMenu:SetFixedPanelTemplate("Default") + CalendarContextMenu:SetStylePanel("Fixed", "Default") hooksecurefunc(CalendarContextMenu, "SetBackdropColor", function(f, r, g, b, a) if r ~= 0 or g ~= 0 or b ~= 0 or a ~= 0.5 then f:SetBackdropColor(0, 0, 0, 0.5) @@ -96,23 +96,23 @@ local function CalendarStyle() _G["CalendarDayButton"..u]:SetFrameLevel(_G["CalendarDayButton"..u]:GetFrameLevel()+1) end CalendarCreateEventFrame:RemoveTextures() - CalendarCreateEventFrame:SetFixedPanelTemplate("Transparent", true) + CalendarCreateEventFrame:SetStylePanel("Fixed", "Transparent", true) CalendarCreateEventFrame:SetPoint("TOPLEFT", CalendarFrame, "TOPRIGHT", 3, -24) CalendarCreateEventTitleFrame:RemoveTextures() - CalendarCreateEventCreateButton:SetButtonTemplate() - CalendarCreateEventMassInviteButton:SetButtonTemplate() - CalendarCreateEventInviteButton:SetButtonTemplate() + CalendarCreateEventCreateButton:SetStylePanel("Button") + CalendarCreateEventMassInviteButton:SetStylePanel("Button") + CalendarCreateEventInviteButton:SetStylePanel("Button") CalendarCreateEventInviteButton:SetPoint("TOPLEFT", CalendarCreateEventInviteEdit, "TOPRIGHT", 4, 1) - CalendarCreateEventInviteEdit:Width(CalendarCreateEventInviteEdit:GetWidth()-2) + CalendarCreateEventInviteEdit:SetWidthToScale(CalendarCreateEventInviteEdit:GetWidth()-2) CalendarCreateEventInviteList:RemoveTextures() - CalendarCreateEventInviteList:SetFixedPanelTemplate("Default") - CalendarCreateEventInviteEdit:SetEditboxTemplate() - CalendarCreateEventTitleEdit:SetEditboxTemplate() + CalendarCreateEventInviteList:SetStylePanel("Fixed", "Default") + CalendarCreateEventInviteEdit:SetStylePanel("Editbox") + CalendarCreateEventTitleEdit:SetStylePanel("Editbox") PLUGIN:ApplyDropdownStyle(CalendarCreateEventTypeDropDown, 120) CalendarCreateEventDescriptionContainer:RemoveTextures() - CalendarCreateEventDescriptionContainer:SetFixedPanelTemplate("Default") + CalendarCreateEventDescriptionContainer:SetStylePanel("Fixed", "Default") PLUGIN:ApplyCloseButtonStyle(CalendarCreateEventCloseButton) - CalendarCreateEventLockEventCheck:SetCheckboxTemplate(true) + CalendarCreateEventLockEventCheck:SetStylePanel("Checkbox", true) PLUGIN:ApplyDropdownStyle(CalendarCreateEventHourDropDown, 68) PLUGIN:ApplyDropdownStyle(CalendarCreateEventMinuteDropDown, 68) PLUGIN:ApplyDropdownStyle(CalendarCreateEventAMPMDropDown, 68) @@ -128,7 +128,7 @@ local function CalendarStyle() CalendarClassButtonContainer:HookScript("OnShow", function() for u, D in ipairs(CLASS_SORT_ORDER)do local e = _G["CalendarClassButton"..u]e:RemoveTextures() - e:SetPanelTemplate("Default") + e:SetStylePanel("Default", "Default") local E = CLASS_ICON_TCOORDS[D] local F = e:GetNormalTexture() F:SetTexture("Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes") @@ -136,53 +136,53 @@ local function CalendarStyle() end CalendarClassButton1:SetPoint("TOPLEFT", CalendarClassButtonContainer, "TOPLEFT", 5, 0) CalendarClassTotalsButton:RemoveTextures() - CalendarClassTotalsButton:SetPanelTemplate("Default") + CalendarClassTotalsButton:SetStylePanel("Default", "Default") end) CalendarTexturePickerFrame:RemoveTextures() CalendarTexturePickerTitleFrame:RemoveTextures() - CalendarTexturePickerFrame:SetFixedPanelTemplate("Transparent", true) + CalendarTexturePickerFrame:SetStylePanel("Fixed", "Transparent", true) PLUGIN:ApplyScrollFrameStyle(CalendarTexturePickerScrollBar) - CalendarTexturePickerAcceptButton:SetButtonTemplate() - CalendarTexturePickerCancelButton:SetButtonTemplate() - CalendarCreateEventInviteButton:SetButtonTemplate() - CalendarCreateEventRaidInviteButton:SetButtonTemplate() + CalendarTexturePickerAcceptButton:SetStylePanel("Button") + CalendarTexturePickerCancelButton:SetStylePanel("Button") + CalendarCreateEventInviteButton:SetStylePanel("Button") + CalendarCreateEventRaidInviteButton:SetStylePanel("Button") CalendarMassInviteFrame:RemoveTextures() - CalendarMassInviteFrame:SetFixedPanelTemplate("Transparent", true) + CalendarMassInviteFrame:SetStylePanel("Fixed", "Transparent", true) CalendarMassInviteTitleFrame:RemoveTextures() PLUGIN:ApplyCloseButtonStyle(CalendarMassInviteCloseButton) - CalendarMassInviteGuildAcceptButton:SetButtonTemplate() + CalendarMassInviteGuildAcceptButton:SetStylePanel("Button") PLUGIN:ApplyDropdownStyle(CalendarMassInviteGuildRankMenu, 130) - CalendarMassInviteGuildMinLevelEdit:SetEditboxTemplate() - CalendarMassInviteGuildMaxLevelEdit:SetEditboxTemplate() + CalendarMassInviteGuildMinLevelEdit:SetStylePanel("Editbox") + CalendarMassInviteGuildMaxLevelEdit:SetStylePanel("Editbox") CalendarViewRaidFrame:RemoveTextures() - CalendarViewRaidFrame:SetFixedPanelTemplate("Transparent", true) + CalendarViewRaidFrame:SetStylePanel("Fixed", "Transparent", true) CalendarViewRaidFrame:SetPoint("TOPLEFT", CalendarFrame, "TOPRIGHT", 3, -24) CalendarViewRaidTitleFrame:RemoveTextures() PLUGIN:ApplyCloseButtonStyle(CalendarViewRaidCloseButton) CalendarViewHolidayFrame:RemoveTextures(true) - CalendarViewHolidayFrame:SetFixedPanelTemplate("Transparent", true) + CalendarViewHolidayFrame:SetStylePanel("Fixed", "Transparent", true) CalendarViewHolidayFrame:SetPoint("TOPLEFT", CalendarFrame, "TOPRIGHT", 3, -24) CalendarViewHolidayTitleFrame:RemoveTextures() PLUGIN:ApplyCloseButtonStyle(CalendarViewHolidayCloseButton) CalendarViewEventFrame:RemoveTextures() - CalendarViewEventFrame:SetFixedPanelTemplate("Transparent", true) + CalendarViewEventFrame:SetStylePanel("Fixed", "Transparent", true) CalendarViewEventFrame:SetPoint("TOPLEFT", CalendarFrame, "TOPRIGHT", 3, -24) CalendarViewEventTitleFrame:RemoveTextures() CalendarViewEventDescriptionContainer:RemoveTextures() - CalendarViewEventDescriptionContainer:SetFixedPanelTemplate("Transparent", true) + CalendarViewEventDescriptionContainer:SetStylePanel("Fixed", "Transparent", true) CalendarViewEventInviteList:RemoveTextures() - CalendarViewEventInviteList:SetFixedPanelTemplate("Transparent", true) + CalendarViewEventInviteList:SetStylePanel("Fixed", "Transparent", true) CalendarViewEventInviteListSection:RemoveTextures() PLUGIN:ApplyCloseButtonStyle(CalendarViewEventCloseButton) PLUGIN:ApplyScrollFrameStyle(CalendarViewEventInviteListScrollFrameScrollBar) for _,btn in pairs(CalendarButtons)do - _G[btn]:SetButtonTemplate() + _G[btn]:SetStylePanel("Button") end CalendarEventPickerFrame:RemoveTextures() CalendarEventPickerTitleFrame:RemoveTextures() - CalendarEventPickerFrame:SetFixedPanelTemplate("Transparent", true) + CalendarEventPickerFrame:SetStylePanel("Fixed", "Transparent", true) PLUGIN:ApplyScrollFrameStyle(CalendarEventPickerScrollBar) - CalendarEventPickerCloseButton:SetButtonTemplate() + CalendarEventPickerCloseButton:SetStylePanel("Button") PLUGIN:ApplyScrollFrameStyle(CalendarCreateEventDescriptionScrollFrameScrollBar) PLUGIN:ApplyScrollFrameStyle(CalendarCreateEventInviteListScrollFrameScrollBar) PLUGIN:ApplyScrollFrameStyle(CalendarViewEventDescriptionScrollFrameScrollBar) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/challenges.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/challenges.lua index 24995dc..4f65fa4 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/challenges.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/challenges.lua @@ -32,7 +32,8 @@ local function ChallengesFrameStyle() ChallengesFrameInset:RemoveTextures() ChallengesFrameInsetBg:Hide() ChallengesFrameDetails.bg:Hide() - ChallengesFrameLeaderboard:SetButtonTemplate() + ChallengesFrameDetails:SetStylePanel("Default", "Inset") + ChallengesFrameLeaderboard:SetStylePanel("Button") select(2, ChallengesFrameDetails:GetRegions()):Hide() select(9, ChallengesFrameDetails:GetRegions()):Hide() select(10, ChallengesFrameDetails:GetRegions()):Hide() @@ -41,7 +42,7 @@ local function ChallengesFrameStyle() for u = 1, 9 do local v = ChallengesFrame["button"..u] - v:SetButtonTemplate() + v:SetStylePanel("Button") v:SetHighlightTexture("") v.selectedTex:SetAlpha(.2) v.selectedTex:SetPoint("TOPLEFT", 1, -1) @@ -53,7 +54,7 @@ local function ChallengesFrameStyle() local F = ChallengesFrame["RewardRow"..u] for A = 1, 2 do local v = F["Reward"..A] - v:SetPanelTemplate() + v:SetStylePanel("Default") v.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/character.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/character.lua index b3afcc0..c554c50 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/character.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/character.lua @@ -106,13 +106,13 @@ local function StyleCharacterSlots() if(not charSlot.Panel) then charSlot:RemoveTextures() charSlot.ignoreTexture:SetTexture([[Interface\PaperDollInfoFrame\UI-GearManager-LeaveItem-Transparent]]) - charSlot:SetSlotTemplate(true, 2, 0, 0) + charSlot:SetStylePanel("Slot", true, 2, 0, 0) local iconTex = _G[globalName.."IconTexture"] if(iconTex) then iconTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) iconTex:SetParent(charSlot.Panel) - iconTex:FillInner(charSlot.Panel, 2, 2) + iconTex:SetAllPointsIn(charSlot.Panel, 2, 2) end end @@ -140,13 +140,13 @@ local function EquipmentFlyout_OnShow() local button = _G["EquipmentFlyoutFrameButton"..counter] while button do local texture = _G["EquipmentFlyoutFrameButton"..counter.."IconTexture"] - button:SetButtonTemplate() + button:SetStylePanel("Button") texture:SetTexCoord(0.1, 0.9, 0.1, 0.9) button:GetNormalTexture():SetTexture(0,0,0,0) - texture:FillInner() + texture:SetAllPointsIn() button:SetFrameLevel(button:GetFrameLevel() + 2) if not button.Panel then - button:SetPanelTemplate("Default") + button:SetStylePanel("Default", "Default") button.Panel:SetAllPoints() end counter = counter + 1; @@ -159,23 +159,29 @@ local function PaperDoll_UpdateTabs() local tab = _G["PaperDollSidebarTab"..i] if tab then tab.Highlight:SetTexture(1, 1, 1, 0.3) - tab.Highlight:Point("TOPLEFT", 3, -4) - tab.Highlight:Point("BOTTOMRIGHT", -1, 0) + tab.Highlight:SetPointToScale("TOPLEFT", 3, -4) + tab.Highlight:SetPointToScale("BOTTOMRIGHT", -1, 0) tab.Hider:SetTexture(0.4, 0.4, 0.4, 0.4) - tab.Hider:Point("TOPLEFT", 3, -4) - tab.Hider:Point("BOTTOMRIGHT", -1, 0) + tab.Hider:SetPointToScale("TOPLEFT", 3, -4) + tab.Hider:SetPointToScale("BOTTOMRIGHT", -1, 0) tab.TabBg:Die() - if i == 1 then - for i = 1, tab:GetNumRegions()do - local texture = select(i, tab:GetRegions()) + if i == 1 then + for x = 1, tab:GetNumRegions()do + local texture = select(x, tab:GetRegions()) texture:SetTexCoord(0.16, 0.86, 0.16, 0.86) end end - tab:SetPanelTemplate("Default", true, 2) - tab.Panel:Point("TOPLEFT", 2, -3) - tab.Panel:Point("BOTTOMRIGHT", 0, -2) + tab:SetStylePanel("Default", "Default", true, 2) + tab.Panel:SetPointToScale("TOPLEFT", 2, -3) + tab.Panel:SetPointToScale("BOTTOMRIGHT", 0, -2) end - end + end + PaperDollSidebarTab1:ClearAllPoints() + PaperDollSidebarTab1:SetPoint("BOTTOM", CharacterFrameInsetRight, "TOP", 0, 4) + PaperDollSidebarTab2:ClearAllPoints() + PaperDollSidebarTab2:SetPoint("LEFT", PaperDollSidebarTab1, "RIGHT", 4, 0) + PaperDollSidebarTab3:ClearAllPoints() + PaperDollSidebarTab3:SetPoint("LEFT", PaperDollSidebarTab2, "RIGHT", 4, 0) end local function Reputation_OnShow() @@ -184,7 +190,7 @@ local function Reputation_OnShow() if bar then bar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) if not bar.Panel then - bar:SetPanelTemplate("Inset") + bar:SetStylePanel("Default", "Inset") end _G["ReputationBar"..i.."Background"]:SetTexture(0,0,0,0) _G["ReputationBar"..i.."ReputationBarHighlight1"]:SetTexture(0,0,0,0) @@ -205,8 +211,8 @@ local function PaperDollTitlesPane_OnShow() btn.BgBottom:SetTexture(0,0,0,0) btn.BgMiddle:SetTexture(0,0,0,0) btn.Check:SetTexture(0,0,0,0) - btn.text:FillInner(btn) - btn.text:SetFont(SV.Media.font.roboto,10,"NONE","LEFT") + btn.text:SetAllPointsIn(btn) + btn.text:SetFont(SV.Media.font.default,10,"NONE","LEFT") end end end @@ -218,7 +224,7 @@ local function PaperDollEquipmentManagerPane_OnShow() btn.BgTop:SetTexture(0,0,0,0) btn.BgBottom:SetTexture(0,0,0,0) btn.BgMiddle:SetTexture(0,0,0,0) - btn.icon:Size(36, 36) + btn.icon:SetSizeToScale(36, 36) btn.Check:SetTexture(0,0,0,0) btn.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) btn.icon:SetPoint("LEFT", btn, "LEFT", 4, 0) @@ -229,24 +235,24 @@ local function PaperDollEquipmentManagerPane_OnShow() end GearManagerDialogPopup:RemoveTextures() - GearManagerDialogPopup:SetPanelTemplate("Inset", true) - GearManagerDialogPopup:Point("LEFT", PaperDollFrame, "RIGHT", 4, 0) + GearManagerDialogPopup:SetStylePanel("Default", "Inset", true) + GearManagerDialogPopup:SetPointToScale("LEFT", PaperDollFrame, "RIGHT", 4, 0) GearManagerDialogPopupScrollFrame:RemoveTextures() GearManagerDialogPopupEditBox:RemoveTextures() - GearManagerDialogPopupEditBox:SetPanelTemplate('Inset') - GearManagerDialogPopupOkay:SetButtonTemplate() - GearManagerDialogPopupCancel:SetButtonTemplate() + GearManagerDialogPopupEditBox:SetStylePanel("Default", 'Inset') + GearManagerDialogPopupOkay:SetStylePanel("Button") + GearManagerDialogPopupCancel:SetStylePanel("Button") for i = 1, NUM_GEARSET_ICONS_SHOWN do local btn = _G["GearManagerDialogPopupButton"..i] if(btn and (not btn.Panel)) then btn:RemoveTextures() btn:SetFrameLevel(btn:GetFrameLevel() + 2) - btn:SetButtonTemplate() + btn:SetStylePanel("Button") if(btn.icon) then btn.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) btn.icon:SetTexture(0,0,0,0) - btn.icon:FillInner() + btn.icon:SetAllPointsIn() end end end @@ -275,7 +281,7 @@ local function CharacterFrameStyle() SlotListener:SetScript("OnEvent", StyleCharacterSlots) CharacterFrame:HookScript("OnShow", StyleCharacterSlots) - CharacterFrameExpandButton:Size(CharacterFrameExpandButton:GetWidth() - 7, CharacterFrameExpandButton:GetHeight() - 7) + CharacterFrameExpandButton:SetSizeToScale(CharacterFrameExpandButton:GetWidth() - 7, CharacterFrameExpandButton:GetHeight() - 7) PLUGIN:ApplyPaginationStyle(CharacterFrameExpandButton) hooksecurefunc('CharacterFrame_Collapse', function() @@ -296,12 +302,12 @@ local function CharacterFrameStyle() PLUGIN:ApplyCloseButtonStyle(ReputationDetailCloseButton) PLUGIN:ApplyCloseButtonStyle(TokenFramePopupCloseButton) - ReputationDetailAtWarCheckBox:SetCheckboxTemplate(true) - ReputationDetailMainScreenCheckBox:SetCheckboxTemplate(true) - ReputationDetailInactiveCheckBox:SetCheckboxTemplate(true) - ReputationDetailLFGBonusReputationCheckBox:SetCheckboxTemplate(true) - TokenFramePopupInactiveCheckBox:SetCheckboxTemplate(true) - TokenFramePopupBackpackCheckBox:SetCheckboxTemplate(true) + ReputationDetailAtWarCheckBox:SetStylePanel("Checkbox", true) + ReputationDetailMainScreenCheckBox:SetStylePanel("Checkbox", true) + ReputationDetailInactiveCheckBox:SetStylePanel("Checkbox", true) + ReputationDetailLFGBonusReputationCheckBox:SetStylePanel("Checkbox", true) + TokenFramePopupInactiveCheckBox:SetStylePanel("Checkbox", true) + TokenFramePopupBackpackCheckBox:SetStylePanel("Checkbox", true) EquipmentFlyoutFrameHighlight:Die() EquipmentFlyoutFrame:HookScript("OnShow", EquipmentFlyout_OnShow) hooksecurefunc("EquipmentFlyout_Show", EquipmentFlyout_OnShow) @@ -313,7 +319,7 @@ local function CharacterFrameStyle() if(_G[gName]) then _G[gName]:RemoveTextures(true) end end - CharacterFrameInsetRight:SetPanelTemplate('Inset') + CharacterFrameInsetRight:SetStylePanel("Default", 'Inset') for i=1, 6 do local pane = _G["CharacterStatsPaneCategory"..i] @@ -327,20 +333,20 @@ local function CharacterFrameStyle() CharacterModelFrameBackgroundBotLeft:SetTexture(0,0,0,0) CharacterModelFrameBackgroundBotRight:SetTexture(0,0,0,0) - CharacterModelFrame:SetFixedPanelTemplate("Model") + CharacterModelFrame:SetStylePanel("Fixed", "Model") CharacterFrameExpandButton:SetFrameLevel(CharacterModelFrame:GetFrameLevel() + 5) - PaperDollTitlesPane:SetPanelTemplate('Inset') + PaperDollTitlesPane:SetStylePanel("Default", 'Inset') PaperDollTitlesPane:HookScript("OnShow", PaperDollTitlesPane_OnShow) - PaperDollEquipmentManagerPane:SetPanelTemplate('Inset') - PaperDollEquipmentManagerPaneEquipSet:SetButtonTemplate() - PaperDollEquipmentManagerPaneSaveSet:SetButtonTemplate() - PaperDollEquipmentManagerPaneEquipSet:Width(PaperDollEquipmentManagerPaneEquipSet:GetWidth()-8) - PaperDollEquipmentManagerPaneSaveSet:Width(PaperDollEquipmentManagerPaneSaveSet:GetWidth()-8) - PaperDollEquipmentManagerPaneEquipSet:Point("TOPLEFT", PaperDollEquipmentManagerPane, "TOPLEFT", 8, 0) - PaperDollEquipmentManagerPaneSaveSet:Point("LEFT", PaperDollEquipmentManagerPaneEquipSet, "RIGHT", 4, 0) + PaperDollEquipmentManagerPane:SetStylePanel("Default", 'Inset') + PaperDollEquipmentManagerPaneEquipSet:SetStylePanel("Button") + PaperDollEquipmentManagerPaneSaveSet:SetStylePanel("Button") + PaperDollEquipmentManagerPaneEquipSet:SetWidthToScale(PaperDollEquipmentManagerPaneEquipSet:GetWidth()-8) + PaperDollEquipmentManagerPaneSaveSet:SetWidthToScale(PaperDollEquipmentManagerPaneSaveSet:GetWidth()-8) + PaperDollEquipmentManagerPaneEquipSet:SetPointToScale("TOPLEFT", PaperDollEquipmentManagerPane, "TOPLEFT", 8, 0) + PaperDollEquipmentManagerPaneSaveSet:SetPointToScale("LEFT", PaperDollEquipmentManagerPaneEquipSet, "RIGHT", 4, 0) PaperDollEquipmentManagerPaneEquipSet.ButtonBackground:SetTexture(0,0,0,0) PaperDollEquipmentManagerPane:HookScript("OnShow", PaperDollEquipmentManagerPane_OnShow) @@ -353,14 +359,14 @@ local function CharacterFrameStyle() ReputationFrame:RemoveTextures(true) ReputationListScrollFrame:RemoveTextures() - ReputationListScrollFrame:SetPanelTemplate("Inset") + ReputationListScrollFrame:SetStylePanel("Default", "Inset") ReputationDetailFrame:RemoveTextures() - ReputationDetailFrame:SetPanelTemplate("Inset", true) - ReputationDetailFrame:Point("TOPLEFT", ReputationFrame, "TOPRIGHT", 4, -28) + ReputationDetailFrame:SetStylePanel("Default", "Inset", true) + ReputationDetailFrame:SetPointToScale("TOPLEFT", ReputationFrame, "TOPRIGHT", 4, -28) ReputationFrame:HookScript("OnShow", Reputation_OnShow) hooksecurefunc("ExpandFactionHeader", Reputation_OnShow) hooksecurefunc("CollapseFactionHeader", Reputation_OnShow) - TokenFrameContainer:SetPanelTemplate('Inset') + TokenFrameContainer:SetStylePanel("Default", 'Inset') TokenFrame:HookScript("OnShow", function() for i = 1, GetCurrencyListSize() do @@ -376,16 +382,16 @@ local function CharacterFrameStyle() end end TokenFramePopup:RemoveTextures() - TokenFramePopup:SetPanelTemplate("Inset", true) - TokenFramePopup:Point("TOPLEFT", TokenFrame, "TOPRIGHT", 4, -28) + TokenFramePopup:SetStylePanel("Default", "Inset", true) + TokenFramePopup:SetPointToScale("TOPLEFT", TokenFrame, "TOPRIGHT", 4, -28) end) - PetModelFrame:SetPanelTemplate("Comic",false,1,-7,-7) + PetModelFrame:SetStylePanel("Default", "Comic",false,1,-7,-7) PetPaperDollPetInfo:GetRegions():SetTexCoord(.12, .63, .15, .55) PetPaperDollPetInfo:SetFrameLevel(PetPaperDollPetInfo:GetFrameLevel() + 10) - PetPaperDollPetInfo:SetPanelTemplate("Slot") + PetPaperDollPetInfo:SetStylePanel("Default", "Slot") PetPaperDollPetInfo.Panel:SetFrameLevel(0) - PetPaperDollPetInfo:Size(24, 24) + PetPaperDollPetInfo:SetSizeToScale(24, 24) end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/chat.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/chat.lua index 8e68933..bde3ab4 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/chat.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/chat.lua @@ -144,16 +144,16 @@ HELPERS ]]-- local ChatGeneric_OnShow = function(self) if(not self.Panel) then - self:SetPanelTemplate("Halftone") + self:SetStylePanel("Default", "Halftone") end end local ChatMenu_OnShow = function(self) if(not self.Panel) then - self:SetPanelTemplate("Halftone") + self:SetStylePanel("Default", "Halftone") end self:ClearAllPoints() - self:Point("BOTTOMLEFT", ChatFrame1, "TOPLEFT", 0, 30) + self:SetPointToScale("BOTTOMLEFT", ChatFrame1, "TOPLEFT", 0, 30) end local ChatConfigChannelSettingsLeft_OnEvent = function(self) @@ -167,20 +167,20 @@ local ChatConfigChannelSettingsLeft_OnEvent = function(self) if(checkbox) then if(not checkbox.Panel) then checkbox:RemoveTextures() - checkbox:SetBasicPanel() + checkbox:SetStylePanel("Default", 'Transparent') end checkbox:SetHeight(boxHeight) - checkbox.Panel:Point("TOPLEFT",3,-1) - checkbox.Panel:Point("BOTTOMRIGHT",-3,1) + checkbox.Panel:SetPointToScale("TOPLEFT",3,-1) + checkbox.Panel:SetPointToScale("BOTTOMRIGHT",-3,1) local check = _G[("%sCheck"):format(gName)] if(check) then - check:SetCheckboxTemplate(true) + check:SetStylePanel("Checkbox", true) end local colors = _G[("%sColorClasses"):format(gName)] if(colors) then - colors:SetCheckboxTemplate(true) + colors:SetStylePanel("Checkbox", true) colors:SetHeight(colorsHeight) end end @@ -198,20 +198,20 @@ local ChatConfigBackgroundFrame_OnShow = function(self) if(checkbox) then if(not checkbox.Panel) then checkbox:RemoveTextures() - checkbox:SetPanelTemplate("Default") + checkbox:SetStylePanel("Default", "Default") end - checkbox.Panel:Point("TOPLEFT", 3, -1) - checkbox.Panel:Point("BOTTOMRIGHT", -3, 1) + checkbox.Panel:SetPointToScale("TOPLEFT", 3, -1) + checkbox.Panel:SetPointToScale("BOTTOMRIGHT", -3, 1) checkbox:SetHeight(boxHeight) check = _G[("%sCheck"):format(gName)] if(check) then - check:SetCheckboxTemplate(true) + check:SetStylePanel("Checkbox", true) end colors = _G[("%sColorClasses"):format(gName)] if(colors) then - colors:SetCheckboxTemplate(true) + colors:SetStylePanel("Checkbox", true) colors:SetHeight(colorsHeight) end end @@ -222,14 +222,14 @@ local ChatConfigBackgroundFrame_OnShow = function(self) if(checkbox) then if(not checkbox.Panel) then checkbox:RemoveTextures() - checkbox:SetPanelTemplate("Default") + checkbox:SetStylePanel("Default", "Default") end - checkbox.Panel:Point("TOPLEFT", 3, -1) - checkbox.Panel:Point("BOTTOMRIGHT", -3, 1) + checkbox.Panel:SetPointToScale("TOPLEFT", 3, -1) + checkbox.Panel:SetPointToScale("BOTTOMRIGHT", -3, 1) check = _G[("%sCheck"):format(gName)] if(check) then - check:SetCheckboxTemplate(true) + check:SetStylePanel("Checkbox", true) end end end @@ -239,14 +239,14 @@ local ChatConfigBackgroundFrame_OnShow = function(self) if(checkbox) then if(not checkbox.Panel) then checkbox:RemoveTextures() - checkbox:SetPanelTemplate("Default") + checkbox:SetStylePanel("Default", "Default") end - checkbox.Panel:Point("TOPLEFT", 3, -1) - checkbox.Panel:Point("BOTTOMRIGHT", -3, 1) + checkbox.Panel:SetPointToScale("TOPLEFT", 3, -1) + checkbox.Panel:SetPointToScale("BOTTOMRIGHT", -3, 1) check = _G[("%sCheck"):format(gName)] if(check) then - check:SetCheckboxTemplate(true) + check:SetStylePanel("Checkbox", true) end end end @@ -256,14 +256,14 @@ local ChatConfigBackgroundFrame_OnShow = function(self) if(checkbox) then if(not checkbox.Panel) then checkbox:RemoveTextures() - checkbox:SetPanelTemplate("Default") + checkbox:SetStylePanel("Default", "Default") end - checkbox.Panel:Point("TOPLEFT", 3, -1) - checkbox.Panel:Point("BOTTOMRIGHT", -3, 1) + checkbox.Panel:SetPointToScale("TOPLEFT", 3, -1) + checkbox.Panel:SetPointToScale("BOTTOMRIGHT", -3, 1) check = _G[("%sCheck"):format(gName)] if(check) then - check:SetCheckboxTemplate(true) + check:SetStylePanel("Checkbox", true) end end end @@ -273,14 +273,14 @@ local ChatConfigBackgroundFrame_OnShow = function(self) if(checkbox) then if(not checkbox.Panel) then checkbox:RemoveTextures() - checkbox:SetPanelTemplate("Default") + checkbox:SetStylePanel("Default", "Default") end - checkbox.Panel:Point("TOPLEFT", 3, -1) - checkbox.Panel:Point("BOTTOMRIGHT", -3, 1) + checkbox.Panel:SetPointToScale("TOPLEFT", 3, -1) + checkbox.Panel:SetPointToScale("BOTTOMRIGHT", -3, 1) check = _G[("%sCheck"):format(gName)] if(check) then - check:SetCheckboxTemplate(true) + check:SetStylePanel("Checkbox", true) end end end @@ -290,14 +290,14 @@ local ChatConfigBackgroundFrame_OnShow = function(self) if(checkbox) then if(not checkbox.Panel) then checkbox:RemoveTextures() - checkbox:SetPanelTemplate("Default") + checkbox:SetStylePanel("Default", "Default") end - checkbox.Panel:Point("TOPLEFT", 3, -1) - checkbox.Panel:Point("BOTTOMRIGHT", -3, 1) + checkbox.Panel:SetPointToScale("TOPLEFT", 3, -1) + checkbox.Panel:SetPointToScale("BOTTOMRIGHT", -3, 1) check = _G[("%sCheck"):format(gName)] if(check) then - check:SetCheckboxTemplate(true) + check:SetStylePanel("Checkbox", true) end end end @@ -307,14 +307,14 @@ local ChatConfigBackgroundFrame_OnShow = function(self) if(checkbox) then if(not checkbox.Panel) then checkbox:RemoveTextures() - checkbox:SetPanelTemplate("Default") + checkbox:SetStylePanel("Default", "Default") end - checkbox.Panel:Point("TOPLEFT", 3, -1) - checkbox.Panel:Point("BOTTOMRIGHT", -3, 1) + checkbox.Panel:SetPointToScale("TOPLEFT", 3, -1) + checkbox.Panel:SetPointToScale("BOTTOMRIGHT", -3, 1) check = _G[("%sCheck"):format(gName)] if(check) then - check:SetCheckboxTemplate(true) + check:SetStylePanel("Checkbox", true) end end end @@ -324,10 +324,10 @@ local ChatConfigBackgroundFrame_OnShow = function(self) if(checkbox) then if(not checkbox.Panel) then checkbox:RemoveTextures() - checkbox:SetPanelTemplate("Default") + checkbox:SetStylePanel("Default", "Default") end - checkbox.Panel:Point("TOPLEFT", 3, -1) - checkbox.Panel:Point("BOTTOMRIGHT", -3, 1) + checkbox.Panel:SetPointToScale("TOPLEFT", 3, -1) + checkbox.Panel:SetPointToScale("BOTTOMRIGHT", -3, 1) end end for i = 1, 4 do @@ -335,8 +335,8 @@ local ChatConfigBackgroundFrame_OnShow = function(self) for j = 1, 4 do local gName2 = ("%s_%d"):format(gName, j) if(_G[gName] and _G[gName2]) then - _G[gName]:SetCheckboxTemplate(true) - _G[gName2]:SetCheckboxTemplate(true) + _G[gName]:SetStylePanel("Checkbox", true) + _G[gName2]:SetStylePanel("Checkbox", true) end end @@ -344,14 +344,14 @@ local ChatConfigBackgroundFrame_OnShow = function(self) for j = 1, 10 do local gName2 = ("%s_%d"):format(gName, j) if(_G[gName] and _G[gName2]) then - _G[gName]:SetCheckboxTemplate(true) - _G[gName2]:SetCheckboxTemplate(true) + _G[gName]:SetStylePanel("Checkbox", true) + _G[gName2]:SetStylePanel("Checkbox", true) end end gName = ("CombatConfigMessageTypesMiscCheckBox%d"):format(i) if(_G[gName]) then - _G[gName]:SetCheckboxTemplate(true) + _G[gName]:SetStylePanel("Checkbox", true) end end end @@ -393,10 +393,10 @@ local function ChatStyle() end end - ChatConfigFrameOkayButton:Point("RIGHT", ChatConfigFrameCancelButton, "RIGHT", -11, -1) - ChatConfigCombatSettingsFiltersDeleteButton:Point("TOPRIGHT", ChatConfigCombatSettingsFilters, "BOTTOMRIGHT", 0, -1) - ChatConfigCombatSettingsFiltersAddFilterButton:Point("RIGHT", ChatConfigCombatSettingsFiltersDeleteButton, "LEFT", -1, 0) - ChatConfigCombatSettingsFiltersCopyFilterButton:Point("RIGHT", ChatConfigCombatSettingsFiltersAddFilterButton, "LEFT", -1, 0) + ChatConfigFrameOkayButton:SetPointToScale("RIGHT", ChatConfigFrameCancelButton, "RIGHT", -11, -1) + ChatConfigCombatSettingsFiltersDeleteButton:SetPointToScale("TOPRIGHT", ChatConfigCombatSettingsFilters, "BOTTOMRIGHT", 0, -1) + ChatConfigCombatSettingsFiltersAddFilterButton:SetPointToScale("RIGHT", ChatConfigCombatSettingsFiltersDeleteButton, "LEFT", -1, 0) + ChatConfigCombatSettingsFiltersCopyFilterButton:SetPointToScale("RIGHT", ChatConfigCombatSettingsFiltersAddFilterButton, "LEFT", -1, 0) if(_G["CombatConfigTab1"]) then _G["CombatConfigTab1"]:RemoveTextures() end if(_G["CombatConfigTab2"]) then _G["CombatConfigTab2"]:RemoveTextures() end @@ -404,14 +404,14 @@ local function ChatStyle() if(_G["CombatConfigTab4"]) then _G["CombatConfigTab4"]:RemoveTextures() end if(_G["CombatConfigTab5"]) then _G["CombatConfigTab5"]:RemoveTextures() end - CombatConfigSettingsNameEditBox:SetEditboxTemplate() - ChatConfigFrame:SetPanelTemplate("Halftone", true) + CombatConfigSettingsNameEditBox:SetStylePanel("Editbox") + ChatConfigFrame:SetStylePanel("Default", "Halftone", true) for i = 1, #ChatFrameList3 do local frame = _G[ChatFrameList3[i]] if(frame) then frame:RemoveTextures() - frame:SetBasicPanel() + frame:SetStylePanel("Default", 'Transparent') end end @@ -420,9 +420,9 @@ local function ChatStyle() if(this) then this:ClearAllPoints() if this == CombatConfigColorsColorizeSpellNames then - this:Point("TOP",CombatConfigColorsColorizeUnitName,"BOTTOM",0,-2) + this:SetPointToScale("TOP",CombatConfigColorsColorizeUnitName,"BOTTOM",0,-2) else - this:Point("TOP",_G[ChatFrameList4[i-1]],"BOTTOM",0,-2) + this:SetPointToScale("TOP",_G[ChatFrameList4[i-1]],"BOTTOM",0,-2) end end end @@ -457,7 +457,7 @@ local function ChatStyle() for i = 1, #ChatFrameList5 do local this = _G[ChatFrameList5[i]] if(this) then - this:SetButtonTemplate() + this:SetStylePanel("Button") end end @@ -471,7 +471,7 @@ local function ChatStyle() for i = 1, #ChatFrameList6 do local this = _G[ChatFrameList6[i]] if(this) then - this:SetCheckboxTemplate(true) + this:SetStylePanel("Checkbox", true) end end @@ -483,9 +483,9 @@ local function ChatStyle() ChatConfigMoveFilterUpButton:SetPoint("TOPLEFT",ChatConfigCombatSettingsFilters,"BOTTOMLEFT",3,0) ChatConfigMoveFilterDownButton:SetPoint("LEFT",ChatConfigMoveFilterUpButton,24,0) - CombatConfigSettingsNameEditBox:SetEditboxTemplate() + CombatConfigSettingsNameEditBox:SetStylePanel("Editbox") - ChatConfigFrame:Size(680,596) + ChatConfigFrame:SetSizeToScale(680,596) ChatConfigFrameHeader:ClearAllPoints() ChatConfigFrameHeader:SetPoint("TOP", ChatConfigFrame, "TOP", 0, -5) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/dressup (Failbox's conflicted copy 2014-12-26).lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/dressup (Failbox's conflicted copy 2014-12-26).lua new file mode 100644 index 0000000..b131f6c --- /dev/null +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/dressup (Failbox's conflicted copy 2014-12-26).lua @@ -0,0 +1,57 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +--]] +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +--[[ ADDON ]]-- +local SV = _G.SVUI; +local L = SV.L; +local PLUGIN = select(2, ...); +local Schema = PLUGIN.Schema; +--[[ +########################################################## +DRESSUP PLUGINR +########################################################## +]]-- +local function DressUpStyle() + if PLUGIN.db.blizzard.enable ~= true or PLUGIN.db.blizzard.dressingroom ~= true then + return + end + + DressUpFrame:SetSizeToScale(600, 700) + PLUGIN:ApplyWindowStyle(DressUpFrame, true, true) + + DressUpModel:ClearAllPoints() + DressUpModel:SetPointToScale("TOPLEFT", DressUpFrame, "TOPLEFT", 12, -76) + DressUpModel:SetPointToScale("BOTTOMRIGHT", DressUpFrame, "BOTTOMRIGHT", -12, 36) + + DressUpModel:SetStylePanel("Fixed", "Model") + + DressUpFrameCancelButton:SetPointToScale("BOTTOMRIGHT", DressUpFrame, "BOTTOMRIGHT", -12, 12) + DressUpFrameCancelButton:SetStylePanel("Button") + + DressUpFrameResetButton:SetPointToScale("RIGHT", DressUpFrameCancelButton, "LEFT", -12, 0) + DressUpFrameResetButton:SetStylePanel("Button") + + PLUGIN:ApplyCloseButtonStyle(DressUpFrameCloseButton, DressUpFrame.Panel) +end +--[[ +########################################################## +PLUGIN LOADING +########################################################## +]]-- +PLUGIN:SaveCustomStyle(DressUpStyle) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/dressup.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/dressup.lua index f818fe9..d754eca 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/dressup.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/dressup.lua @@ -32,20 +32,20 @@ local function DressUpStyle() return end - DressUpFrame:Size(600, 700) + DressUpFrame:SetSizeToScale(500, 600) PLUGIN:ApplyWindowStyle(DressUpFrame, true, true) DressUpModel:ClearAllPoints() - DressUpModel:Point("TOPLEFT", DressUpFrame, "TOPLEFT", 12, -76) - DressUpModel:Point("BOTTOMRIGHT", DressUpFrame, "BOTTOMRIGHT", -12, 36) + DressUpModel:SetPointToScale("TOPLEFT", DressUpFrame, "TOPLEFT", 12, -76) + DressUpModel:SetPointToScale("BOTTOMRIGHT", DressUpFrame, "BOTTOMRIGHT", -12, 36) - DressUpModel:SetFixedPanelTemplate("Model") + DressUpModel:SetStylePanel("Fixed", "Model") - DressUpFrameCancelButton:Point("BOTTOMRIGHT", DressUpFrame, "BOTTOMRIGHT", -12, 12) - DressUpFrameCancelButton:SetButtonTemplate() + DressUpFrameCancelButton:SetPointToScale("BOTTOMRIGHT", DressUpFrame, "BOTTOMRIGHT", -12, 12) + DressUpFrameCancelButton:SetStylePanel("Button") - DressUpFrameResetButton:Point("RIGHT", DressUpFrameCancelButton, "LEFT", -12, 0) - DressUpFrameResetButton:SetButtonTemplate() + DressUpFrameResetButton:SetPointToScale("RIGHT", DressUpFrameCancelButton, "LEFT", -12, 0) + DressUpFrameResetButton:SetStylePanel("Button") PLUGIN:ApplyCloseButtonStyle(DressUpFrameCloseButton, DressUpFrame.Panel) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/encounterjournal.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/encounterjournal.lua index 4d95241..6f1c3a2 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/encounterjournal.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/encounterjournal.lua @@ -48,17 +48,17 @@ local function ChangeTabHelper(this, xOffset, yOffset) this:SetHighlightTexture([[Interface\Addons\SVUI\assets\artwork\Template\EMPTY]]) this.backdrop = CreateFrame("Frame", nil, this) - this.backdrop:FillInner(this) + this.backdrop:SetAllPointsIn(this) this.backdrop:SetFrameLevel(0) - this.backdrop:SetPanelTemplate("Component", true) + this.backdrop:SetStylePanel("Default", "Component", true) this.backdrop:SetPanelColor("dark") this:HookScript("OnEnter",Tab_OnEnter) this:HookScript("OnLeave",Tab_OnLeave) local initialAnchor, anchorParent, relativeAnchor, xPosition, yPosition = this:GetPoint() this:ClearAllPoints() - this:Point(initialAnchor, anchorParent, relativeAnchor, xOffset or 0, yOffset or 0) + this:SetPointToScale(initialAnchor, anchorParent, relativeAnchor, xOffset or 0, yOffset or 0) end local function Outline(frame, noHighlight) @@ -67,8 +67,8 @@ local function Outline(frame, noHighlight) local mod = noHighlight and 50 or 5 local panel = CreateFrame('Frame', nil, frame) - panel:Point('TOPLEFT', frame, 'TOPLEFT', 1, -1) - panel:Point('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', -1, 1) + panel:SetPointToScale('TOPLEFT', frame, 'TOPLEFT', 1, -1) + panel:SetPointToScale('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', -1, 1) --[[ UNDERLAY BORDER ]]-- local borderLeft = panel:CreateTexture(nil, "BORDER") @@ -153,33 +153,33 @@ local function EncounterJournalStyle() EncounterJournalSearchResults:RemoveTextures(true) - EncounterJournal:SetPanelTemplate("Action") + EncounterJournal:SetStylePanel("Default", "Action") EncounterJournal:SetPanelColor("dark") - EncounterJournalInset:SetFixedPanelTemplate("Inset") + EncounterJournalInset:SetStylePanel("Fixed", "Inset") - EncounterJournalInstanceSelectScrollFrameScrollChild:SetFixedPanelTemplate("Default") + EncounterJournalInstanceSelectScrollFrameScrollChild:SetStylePanel("Fixed", "Default") EncounterJournalInstanceSelectScrollFrameScrollChild:SetPanelColor("dark") - EncounterJournalInstanceSelectScrollDownButton:SetButtonTemplate() + EncounterJournalInstanceSelectScrollDownButton:SetStylePanel("Button") EncounterJournalInstanceSelectScrollDownButton:SetNormalTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\MOVE-DOWN]]) - EncounterJournalEncounterFrameInstanceFrame:SetFixedPanelTemplate("Inset") + EncounterJournalEncounterFrameInstanceFrame:SetStylePanel("Fixed", "Inset") local comicHolder = CreateFrame('Frame', nil, EncounterJournal.encounter) comicHolder:SetPoint("TOPLEFT", EncounterJournalEncounterFrameInfoBossesScrollFrame, "TOPLEFT", -20, 40) comicHolder:SetPoint("BOTTOMRIGHT", EncounterJournalEncounterFrameInfoBossesScrollFrame, "BOTTOMRIGHT", 0, 0) - comicHolder:SetPanelTemplate("Comic") + comicHolder:SetStylePanel("Default", "Comic") comicHolder:SetPanelColor("dark") EncounterJournal.encounter.info.encounterTitle:SetParent(comicHolder) EncounterJournal.searchResults.TitleText:SetParent(comicHolder) - EncounterJournalNavBarHomeButton:SetButtonTemplate() - EncounterJournalEncounterFrameInfoDifficulty:SetButtonTemplate() + EncounterJournalNavBarHomeButton:SetStylePanel("Button") + EncounterJournalEncounterFrameInfoDifficulty:SetStylePanel("Button") EncounterJournalEncounterFrameInfoDifficulty:SetFrameLevel(EncounterJournalEncounterFrameInfoDifficulty:GetFrameLevel() + 10) - EncounterJournalEncounterFrameInfoLootScrollFrameFilterToggle:SetButtonTemplate() + EncounterJournalEncounterFrameInfoLootScrollFrameFilterToggle:SetStylePanel("Button") EncounterJournalEncounterFrameInfoLootScrollFrameFilterToggle:SetFrameLevel(EncounterJournalEncounterFrameInfoLootScrollFrameFilterToggle:GetFrameLevel() + 10) - EncounterJournalInstanceSelectDungeonTab:SetButtonTemplate() - EncounterJournalInstanceSelectRaidTab:SetButtonTemplate() + EncounterJournalInstanceSelectDungeonTab:SetStylePanel("Button") + EncounterJournalInstanceSelectRaidTab:SetStylePanel("Button") PLUGIN:ApplyScrollBarStyle(EncounterJournalEncounterFrameInfoLootScrollBar) @@ -189,7 +189,7 @@ local function EncounterJournalStyle() bgParent.loreBG:SetPoint("TOPLEFT", bgParent, "TOPLEFT", 0, 0) bgParent.loreBG:SetPoint("BOTTOMRIGHT", bgParent, "BOTTOMRIGHT", 0, 90) - loreParent:SetPanelTemplate("Pattern", true, 1, 1, 5) + loreParent:SetStylePanel("Default", "Pattern", true, 1, 1, 5) loreParent:SetPanelColor("dark") loreParent.child.lore:SetTextColor(1, 1, 1) EncounterJournal.encounter.infoFrame.description:SetTextColor(1, 1, 1) @@ -225,7 +225,7 @@ local function EncounterJournalStyle() if(not used.button.Panel) then used:RemoveTextures(true) used.button:RemoveTextures(true) - used.button:SetButtonTemplate() + used.button:SetStylePanel("Button") end used.description:SetTextColor(1, 1, 1) --used.button.portrait.icon:Hide() @@ -246,7 +246,7 @@ local function EncounterJournalStyle() if index <= numLoot then item.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) if(not item.Panel) then - item:SetFixedPanelTemplate("Slot") + item:SetStylePanel("Fixed", "Slot") end item.slot:SetTextColor(0.5, 1, 0) item.armorType:SetTextColor(1, 1, 0) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/friends.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/friends.lua index aed0623..e07ff68 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/friends.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/friends.lua @@ -102,10 +102,10 @@ local function TabCustomHelper(this) end this:GetHighlightTexture():SetTexture(0,0,0,0) this.backdrop = CreateFrame("Frame", nil, this) - this.backdrop:SetFixedPanelTemplate("Default") + this.backdrop:SetStylePanel("Fixed", "Default") this.backdrop:SetFrameLevel(this:GetFrameLevel()-1) - this.backdrop:Point("TOPLEFT", 3, -8) - this.backdrop:Point("BOTTOMRIGHT", -6, 0) + this.backdrop:SetPointToScale("TOPLEFT", 3, -8) + this.backdrop:SetPointToScale("BOTTOMRIGHT", -6, 0) end local function ChannelList_OnUpdate() @@ -114,7 +114,7 @@ local function ChannelList_OnUpdate() if btn then btn:RemoveTextures() btn:SetHighlightTexture("Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight") - _G["ChannelButton"..i.."Text"]:FontManager(nil, 12) + _G["ChannelButton"..i.."Text"]:FontManager("default") end end end @@ -140,19 +140,19 @@ local function FriendsFrameStyle() PLUGIN:ApplyEditBoxStyle(WhoFrameEditBoxInset) ChannelFrameRightInset:RemoveTextures() ChannelFrameLeftInset:RemoveTextures() - ChannelFrameRightInset:SetFixedPanelTemplate("ModelBorder") - ChannelFrameLeftInset:SetFixedPanelTemplate("ModelBorder") + ChannelFrameRightInset:SetStylePanel("Fixed", "ModelBorder") + ChannelFrameLeftInset:SetStylePanel("Fixed", "ModelBorder") LFRQueueFrameListInset:RemoveTextures() LFRQueueFrameRoleInset:RemoveTextures() LFRQueueFrameCommentInset:RemoveTextures() - LFRQueueFrameListInset:SetFixedPanelTemplate("Inset") - FriendsFrameInset:SetPanelTemplate("Inset", true, 6) - FriendsFrameFriendsScrollFrame:SetFixedPanelTemplate("Model") - WhoFrameListInset:SetFixedPanelTemplate("ModelBorder") - RaidFrame:SetFixedPanelTemplate("ModelBorder") + LFRQueueFrameListInset:SetStylePanel("Fixed", "ModelBorder") + FriendsFrameInset:SetStylePanel("Fixed", "ModelBorder") + FriendsFrameFriendsScrollFrame:SetStylePanel("Fixed", "Model") + WhoFrameListInset:SetStylePanel("Fixed", "ModelBorder") + RaidFrame:SetStylePanel("Fixed", "ModelBorder") for c, e in pairs(FriendsFrameButtons)do - _G[e]:SetButtonTemplate() + _G[e]:SetStylePanel("Button") end -- for c, texture in pairs(FriendsFrameList2)do @@ -176,7 +176,7 @@ local function FriendsFrameStyle() FriendsFrameBattlenetFrame:RemoveTextures() FriendsFrameBattlenetFrame:SetHeight(22) FriendsFrameBattlenetFrame:SetPoint('TOPLEFT', FriendsFrameStatusDropDown, 'TOPRIGHT', 0, -1) - FriendsFrameBattlenetFrame:SetFixedPanelTemplate("Inset") + FriendsFrameBattlenetFrame:SetStylePanel("Fixed", "Inset") FriendsFrameBattlenetFrame:SetBackdropColor(0,0,0,0.8) -- FriendsFrameBattlenetFrame.BroadcastButton:GetNormalTexture():SetTexCoord(.28, .72, .28, .72) @@ -185,23 +185,23 @@ local function FriendsFrameStyle() FriendsFrameBattlenetFrame.BroadcastButton:RemoveTextures() FriendsFrameBattlenetFrame.BroadcastButton:SetSize(22,22) FriendsFrameBattlenetFrame.BroadcastButton:SetPoint('TOPLEFT', FriendsFrameBattlenetFrame, 'TOPRIGHT', 8, 0) - FriendsFrameBattlenetFrame.BroadcastButton:SetButtonTemplate() + FriendsFrameBattlenetFrame.BroadcastButton:SetStylePanel("Button") FriendsFrameBattlenetFrame.BroadcastButton:SetBackdropColor(0.4,0.4,0.4) FriendsFrameBattlenetFrame.BroadcastButton:SetNormalTexture([[Interface\FriendsFrame\UI-Toast-BroadcastIcon]]) FriendsFrameBattlenetFrame.BroadcastButton:SetPushedTexture([[Interface\FriendsFrame\UI-Toast-BroadcastIcon]]) FriendsFrameBattlenetFrame.BroadcastButton:SetScript('OnClick', function() SV:StaticPopup_Show("SET_BN_BROADCAST") end) - FriendsFrameBattlenetFrame.Tag:FontManager(SV.Media.font.narrator,16,"NONE") - AddFriendNameEditBox:SetEditboxTemplate() - AddFriendFrame:SetFixedPanelTemplate("Transparent", true) - ScrollOfResurrectionSelectionFrame:SetFixedPanelTemplate('Transparent') - ScrollOfResurrectionSelectionFrameList:SetFixedPanelTemplate('Default') + FriendsFrameBattlenetFrame.Tag:FontManager("narrator") + AddFriendNameEditBox:SetStylePanel("Editbox") + AddFriendFrame:SetStylePanel("Fixed", "Transparent", true) + ScrollOfResurrectionSelectionFrame:SetStylePanel("Fixed", 'Transparent') + ScrollOfResurrectionSelectionFrameList:SetStylePanel("Fixed", 'Default') PLUGIN:ApplyScrollFrameStyle(ScrollOfResurrectionSelectionFrameListScrollFrameScrollBar, 4) - ScrollOfResurrectionSelectionFrameTargetEditBox:SetEditboxTemplate() - FriendsFrameBroadcastInput:SetPanelTemplate("Default") - ChannelFrameDaughterFrameChannelName:SetPanelTemplate("Default") - ChannelFrameDaughterFrameChannelPassword:SetPanelTemplate("Default") + ScrollOfResurrectionSelectionFrameTargetEditBox:SetStylePanel("Editbox") + FriendsFrameBroadcastInput:SetStylePanel("Default", "Default") + ChannelFrameDaughterFrameChannelName:SetStylePanel("Default", "Default") + ChannelFrameDaughterFrameChannelPassword:SetStylePanel("Default", "Default") ChannelFrame:HookScript("OnShow", function() ChannelRosterScrollFrame:RemoveTextures() @@ -219,7 +219,7 @@ local function FriendsFrameStyle() WhoListScrollFrame:RemoveTextures() end) - ChannelFrameDaughterFrame:SetPanelTemplate('Inset') + ChannelFrameDaughterFrame:SetStylePanel("Default", 'Inset') PLUGIN:ApplyCloseButtonStyle(ChannelFrameDaughterFrameDetailCloseButton, ChannelFrameDaughterFrame) PLUGIN:ApplyCloseButtonStyle(FriendsFrameCloseButton, FriendsFrame.Panel) PLUGIN:ApplyDropdownStyle(WhoFrameDropDown, 150) @@ -233,55 +233,55 @@ local function FriendsFrameStyle() end hooksecurefunc("ChannelList_Update", ChannelList_OnUpdate) - FriendsFriendsFrame:SetPanelTemplate('Inset') + FriendsFriendsFrame:SetStylePanel("Default", 'Inset') _G["FriendsFriendsFrame"]:RemoveTextures() _G["FriendsFriendsList"]:RemoveTextures() _G["FriendsFriendsNoteFrame"]:RemoveTextures() - _G["FriendsFriendsSendRequestButton"]:SetButtonTemplate() - _G["FriendsFriendsCloseButton"]:SetButtonTemplate() + _G["FriendsFriendsSendRequestButton"]:SetStylePanel("Button") + _G["FriendsFriendsCloseButton"]:SetStylePanel("Button") - FriendsFriendsList:SetEditboxTemplate() - FriendsFriendsNoteFrame:SetEditboxTemplate() + FriendsFriendsList:SetStylePanel("Editbox") + FriendsFriendsNoteFrame:SetStylePanel("Editbox") PLUGIN:ApplyDropdownStyle(FriendsFriendsFrameDropDown, 150) BNConversationInviteDialog:RemoveTextures() - BNConversationInviteDialog:SetPanelTemplate('Transparent') + BNConversationInviteDialog:SetStylePanel("Default", 'Transparent') BNConversationInviteDialogList:RemoveTextures() - BNConversationInviteDialogList:SetFixedPanelTemplate('Default') - BNConversationInviteDialogInviteButton:SetButtonTemplate() - BNConversationInviteDialogCancelButton:SetButtonTemplate() + BNConversationInviteDialogList:SetStylePanel("Fixed", 'Default') + BNConversationInviteDialogInviteButton:SetStylePanel("Button") + BNConversationInviteDialogCancelButton:SetStylePanel("Button") for i = 1, BN_CONVERSATION_INVITE_NUM_DISPLAYED do - _G["BNConversationInviteDialogListFriend"..i].checkButton:SetCheckboxTemplate(true) + _G["BNConversationInviteDialogListFriend"..i].checkButton:SetStylePanel("Checkbox", true) end - FriendsTabHeaderSoRButton:SetFixedPanelTemplate('Default') - FriendsTabHeaderSoRButton:SetButtonTemplate() + FriendsTabHeaderSoRButton:SetStylePanel("Fixed", 'Default') + FriendsTabHeaderSoRButton:SetStylePanel("Button") FriendsTabHeaderSoRButtonIcon:SetDrawLayer('OVERLAY') FriendsTabHeaderSoRButtonIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - FriendsTabHeaderSoRButtonIcon:FillInner() - FriendsTabHeaderSoRButton:Point('TOPRIGHT', FriendsTabHeader, 'TOPRIGHT', -8, -56) - FriendsTabHeaderRecruitAFriendButton:SetFixedPanelTemplate('Default') - FriendsTabHeaderRecruitAFriendButton:SetButtonTemplate() + FriendsTabHeaderSoRButtonIcon:SetAllPointsIn() + FriendsTabHeaderSoRButton:SetPointToScale('TOPRIGHT', FriendsTabHeader, 'TOPRIGHT', -8, -56) + FriendsTabHeaderRecruitAFriendButton:SetStylePanel("Fixed", 'Default') + FriendsTabHeaderRecruitAFriendButton:SetStylePanel("Button") FriendsTabHeaderRecruitAFriendButtonIcon:SetDrawLayer('OVERLAY') FriendsTabHeaderRecruitAFriendButtonIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - FriendsTabHeaderRecruitAFriendButtonIcon:FillInner() + FriendsTabHeaderRecruitAFriendButtonIcon:SetAllPointsIn() - FriendsFrameIgnoreScrollFrame:SetFixedPanelTemplate("Inset") + FriendsFrameIgnoreScrollFrame:SetStylePanel("Fixed", "ModelBorder") PLUGIN:ApplyScrollFrameStyle(FriendsFrameIgnoreScrollFrameScrollBar, 4) - FriendsFramePendingScrollFrame:SetFixedPanelTemplate("Inset") + FriendsFramePendingScrollFrame:SetStylePanel("Fixed", "Inset") PLUGIN:ApplyScrollFrameStyle(FriendsFramePendingScrollFrameScrollBar, 4) IgnoreListFrame:RemoveTextures() PendingListFrame:RemoveTextures() ScrollOfResurrectionFrame:RemoveTextures() - ScrollOfResurrectionFrameAcceptButton:SetButtonTemplate() - ScrollOfResurrectionFrameCancelButton:SetButtonTemplate() + ScrollOfResurrectionFrameAcceptButton:SetStylePanel("Button") + ScrollOfResurrectionFrameCancelButton:SetStylePanel("Button") ScrollOfResurrectionFrameTargetEditBoxLeft:SetTexture(0,0,0,0) ScrollOfResurrectionFrameTargetEditBoxMiddle:SetTexture(0,0,0,0) ScrollOfResurrectionFrameTargetEditBoxRight:SetTexture(0,0,0,0) ScrollOfResurrectionFrameNoteFrame:RemoveTextures() - ScrollOfResurrectionFrameNoteFrame:SetFixedPanelTemplate() - ScrollOfResurrectionFrameTargetEditBox:SetFixedPanelTemplate() - ScrollOfResurrectionFrame:SetFixedPanelTemplate('Transparent') + ScrollOfResurrectionFrameNoteFrame:SetStylePanel("Fixed") + ScrollOfResurrectionFrameTargetEditBox:SetStylePanel("Fixed") + ScrollOfResurrectionFrame:SetStylePanel("Fixed", 'Transparent') end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/garrison.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/garrison.lua index b855270..4a51729 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/garrison.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/garrison.lua @@ -50,28 +50,29 @@ local function StyleItemIcon(item) item.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) if(not item.IconSlot) then item.IconSlot = CreateFrame("Frame", nil, item) - item.IconSlot:WrapOuter(item.Icon) - item.IconSlot:SetSlotTemplate() + item.IconSlot:SetAllPointsOut(item.Icon) + item.IconSlot:SetStylePanel("Icon") item.Icon:SetParent(item.IconSlot) end end local function StyleListItem(item) if(not item) then return; end - if(item.Icon and (not item.Panel)) then + if(item.Icon) then local size = item:GetHeight() - 8 local texture = item.Icon:GetTexture() item:RemoveTextures() - item:SetSlotTemplate() + item:SetStylePanel("Inset") item.Icon:SetTexture(texture) item.Icon:ClearAllPoints() item.Icon:SetPoint("TOPLEFT", item, "TOPLEFT", 4, -4) item.Icon:SetSize(size, size) item.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + item.Icon:SetDesaturated(false) if(not item.IconSlot) then item.IconSlot = CreateFrame("Frame", nil, item) - item.IconSlot:WrapOuter(item.Icon) - item.IconSlot:SetSlotTemplate() + item.IconSlot:SetAllPointsOut(item.Icon) + item.IconSlot:SetStylePanel("Icon") item.Icon:SetParent(item.IconSlot) end end @@ -97,7 +98,7 @@ local _hook_ReagentUpdate = function(self) for i = 1, #reagents do if(reagents[i] and (not reagents[i].Panel)) then reagents[i]:RemoveTextures() - reagents[i]:SetSlotTemplate(true, 2, 0, 0, 0.5) + reagents[i]:SetStylePanel("Slot", true, 2, 0, 0, 0.5) if(reagents[i].Icon) then reagents[i].Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) end @@ -133,7 +134,7 @@ local _hook_GarrisonFollowerListUpdate = function(self) local follower = followers[followersList[index]]; if(not button.Panel) then button:RemoveTextures() - button:SetPanelTemplate('Blackout', true, 1, 0, 0) + button:SetStylePanel("Default", 'Blackout', true, 1, 0, 0) if(button.XPBar) then button.XPBar:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) button.XPBar:SetGradient('HORIZONTAL', 0.5, 0, 1, 1, 0, 1) @@ -167,6 +168,19 @@ local _hook_GarrisonMissionFrame_SetFollowerPortrait = function(portraitFrame, f StyleFollowerPortrait(portraitFrame, color) end +local _hook_GarrisonRecruitSelectFrame_UpdateRecruits = function() + local recruitFrame = GarrisonRecruitSelectFrame.FollowerSelection; + local followers = C_Garrison.GetAvailableRecruits(); + for i=1, 3 do + local follower = followers[i]; + local frame = recruitFrame["Recruit"..i]; + if(follower)then + local color = ITEM_QUALITY_COLORS[follower.quality]; + StyleFollowerPortrait(frame.PortraitFrame, color); + end + end +end + local _hook_GarrisonMissionComplete_SetFollowerLevel = function(followerFrame, level, quality) local color = ITEM_QUALITY_COLORS[quality]; followerFrame.PortraitFrame.PortraitRing:SetVertexColor(color.r, color.g, color.b) @@ -177,14 +191,15 @@ local _hook_GarrisonFollowerPage_ShowFollower = function(self, followerID) if(not self.XPBar.Panel) then self.XPBar:RemoveTextures() self.XPBar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) - self.XPBar:SetFixedPanelTemplate("Bar") + self.XPBar:SetStylePanel("Fixed", "Bar") end for i=1, #self.AbilitiesFrame.Abilities do local abilityFrame = self.AbilitiesFrame.Abilities[i]; abilityFrame.IconButton.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9); + abilityFrame.IconButton.Icon:SetDesaturated(false) if(not abilityFrame.IconButton.Panel) then - abilityFrame.IconButton:SetFixedPanelTemplate("Slot", true, 4) + abilityFrame.IconButton:SetStylePanel("Fixed", "Slot", true, 4) end end end @@ -203,17 +218,19 @@ local function StyleListButtons(listButtons) local size = frame:GetHeight() - 6 local texture = frame.Icon:GetTexture() frame:RemoveTextures() - frame:SetFixedPanelTemplate('Blackout', true, 3) + frame:SetStylePanel("Fixed", 'Blackout', true, 3) frame.Icon:SetTexture(texture) frame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) frame.Icon:ClearAllPoints() frame.Icon:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -3, -3) frame.Icon:SetSize(size, size) + frame.Icon:SetDesaturated(false) end end end -local function StyleUpdateRewards(self) +local function StyleUpdateRewards() + local self = GarrisonMissionFrame local missionButtons = self.MissionTab.MissionList.listScroll.buttons; for i = 1, #missionButtons do PLUGIN:ApplyItemButtonStyle(missionButtons[i]) @@ -236,43 +253,43 @@ local function LoadGarrisonStyle() PLUGIN:ApplyTabStyle(GarrisonMissionFrameTab2) GarrisonBuildingFrameFollowers:RemoveTextures() - GarrisonBuildingFrameFollowers:SetPanelTemplate('Inset', true, 1, -5, -5) + GarrisonBuildingFrameFollowers:SetStylePanel("Default", 'Inset', true, 1, -5, -5) GarrisonBuildingFrameFollowers:ClearAllPoints() GarrisonBuildingFrameFollowers:SetPoint("LEFT", GarrisonBuildingFrame, "LEFT", 10, 0) GarrisonBuildingFrame.BuildingList:RemoveTextures() - GarrisonBuildingFrame.BuildingList:SetFixedPanelTemplate('Inset') + GarrisonBuildingFrame.BuildingList:SetStylePanel("Fixed", 'Inset') GarrisonBuildingFrame.TownHallBox:RemoveTextures() - GarrisonBuildingFrame.TownHallBox:SetFixedPanelTemplate('Inset') + GarrisonBuildingFrame.TownHallBox:SetStylePanel("Fixed", 'Inset') GarrisonBuildingFrame.InfoBox:RemoveTextures() - GarrisonBuildingFrame.InfoBox:SetFixedPanelTemplate('Inset') + GarrisonBuildingFrame.InfoBox:SetStylePanel("Fixed", 'Inset') --PLUGIN:ApplyTabStyle(GarrisonBuildingFrame.BuildingList.Tab1) GarrisonBuildingFrame.BuildingList.Tab1:GetNormalTexture().SetAtlas = function() return end GarrisonBuildingFrame.BuildingList.Tab1:RemoveTextures(true) - GarrisonBuildingFrame.BuildingList.Tab1:SetButtonTemplate(false, 1, -4, -10) + GarrisonBuildingFrame.BuildingList.Tab1:SetStylePanel("Button", false, 1, -4, -10) --PLUGIN:ApplyTabStyle(GarrisonBuildingFrame.BuildingList.Tab2) GarrisonBuildingFrame.BuildingList.Tab2:GetNormalTexture().SetAtlas = function() return end GarrisonBuildingFrame.BuildingList.Tab2:RemoveTextures(true) - GarrisonBuildingFrame.BuildingList.Tab2:SetButtonTemplate(false, 1, -4, -10) + GarrisonBuildingFrame.BuildingList.Tab2:SetStylePanel("Button", false, 1, -4, -10) --PLUGIN:ApplyTabStyle(GarrisonBuildingFrame.BuildingList.Tab3) GarrisonBuildingFrame.BuildingList.Tab3:GetNormalTexture().SetAtlas = function() return end GarrisonBuildingFrame.BuildingList.Tab3:RemoveTextures(true) - GarrisonBuildingFrame.BuildingList.Tab3:SetButtonTemplate(false, 1, -4, -10) + GarrisonBuildingFrame.BuildingList.Tab3:SetStylePanel("Button", false, 1, -4, -10) GarrisonBuildingFrame.BuildingList.MaterialFrame:RemoveTextures() - GarrisonBuildingFrame.BuildingList.MaterialFrame:SetPanelTemplate("Inset", true, 1, -5, -7) + GarrisonBuildingFrame.BuildingList.MaterialFrame:SetStylePanel("Default", "Inset", true, 1, -5, -7) GarrisonBuildingFrameTutorialButton:Die() - StyleUpdateRewards(GarrisonMissionFrame) + StyleUpdateRewards() GarrisonLandingPage.FollowerTab:RemoveTextures() GarrisonLandingPage.FollowerTab.AbilitiesFrame:RemoveTextures() - GarrisonLandingPage.FollowerTab:SetPanelTemplate("ModelBorder") + GarrisonLandingPage.FollowerTab:SetStylePanel("Default", "ModelBorder") GarrisonLandingPage.FollowerTab.Panel:ClearAllPoints() GarrisonLandingPage.FollowerTab.Panel:SetPoint("TOPLEFT", GarrisonLandingPage.FollowerList.SearchBox, "TOPRIGHT", 10, 6) GarrisonLandingPage.FollowerTab.Panel:SetPoint("BOTTOMRIGHT", GarrisonLandingPage, "BOTTOMRIGHT", -38, 30) GarrisonLandingPage.FollowerList:RemoveTextures() - GarrisonLandingPage.FollowerList:SetPanelTemplate('Inset', false, 4, 0, 0) + GarrisonLandingPage.FollowerList:SetStylePanel("Default", 'Inset', false, 4, 0, 0) PLUGIN:ApplyTabStyle(GarrisonLandingPageTab1, nil, 10, 4) PLUGIN:ApplyTabStyle(GarrisonLandingPageTab2, nil, 10, 4) @@ -281,24 +298,24 @@ local function LoadGarrisonStyle() GarrisonLandingPageTab1:SetPoint(a1, p, a2, x, (y - 15)) GarrisonLandingPageReportList:RemoveTextures() - GarrisonLandingPageReportList:SetPanelTemplate('Inset', false, 4, 0, 0) + GarrisonLandingPageReportList:SetStylePanel("Default", 'Inset', false, 4, 0, 0) GarrisonLandingPageReport.Available:RemoveTextures(true) - GarrisonLandingPageReport.Available:SetButtonTemplate() + GarrisonLandingPageReport.Available:SetStylePanel("Button") GarrisonLandingPageReport.Available:GetNormalTexture().SetAtlas = function() return end GarrisonLandingPageReport.InProgress:RemoveTextures(true) - GarrisonLandingPageReport.InProgress:SetButtonTemplate() + GarrisonLandingPageReport.InProgress:SetStylePanel("Button") GarrisonLandingPageReport.InProgress:GetNormalTexture().SetAtlas = function() return end GarrisonMissionFrameMissions:RemoveTextures() - GarrisonMissionFrameMissions:SetFixedPanelTemplate("Inset") + GarrisonMissionFrameMissions:SetStylePanel("Fixed", "Inset") GarrisonMissionFrameMissions.CompleteDialog.BorderFrame:RemoveTextures() - GarrisonMissionFrameMissions.CompleteDialog.BorderFrame:SetPanelTemplate('Halftone', false, 4, 0, 0) + GarrisonMissionFrameMissions.CompleteDialog.BorderFrame:SetStylePanel("Default", 'Halftone', false, 4, 0, 0) GarrisonMissionFrameMissions.CompleteDialog.BorderFrame.Stage:RemoveTextures() - GarrisonMissionFrameMissions.CompleteDialog.BorderFrame.Stage:SetFixedPanelTemplate("Model") + GarrisonMissionFrameMissions.CompleteDialog.BorderFrame.Stage:SetStylePanel("Fixed", "Model") GarrisonMissionFrameMissions.CompleteDialog.BorderFrame.ViewButton:RemoveTextures(true) - GarrisonMissionFrameMissions.CompleteDialog.BorderFrame.ViewButton:SetButtonTemplate() + GarrisonMissionFrameMissions.CompleteDialog.BorderFrame.ViewButton:SetStylePanel("Button") GarrisonMissionFrameMissionsListScrollFrame:RemoveTextures() PLUGIN:ApplyScrollFrameStyle(GarrisonMissionFrameMissionsListScrollFrame) @@ -309,10 +326,10 @@ local function LoadGarrisonStyle() GarrisonMissionFrameMissionsTab1:SetPoint(a1, p, a2, x, (y + 8)) GarrisonMissionFrameMissions.MaterialFrame:RemoveTextures() - GarrisonMissionFrameMissions.MaterialFrame:SetPanelTemplate("Inset", true, 1, -3, -3) + GarrisonMissionFrameMissions.MaterialFrame:SetStylePanel("Default", "Inset", true, 1, -3, -3) GarrisonMissionFrame.FollowerTab:RemoveTextures() - GarrisonMissionFrame.FollowerTab:SetFixedPanelTemplate("ModelBorder") + GarrisonMissionFrame.FollowerTab:SetStylePanel("Fixed", "ModelBorder") GarrisonMissionFrame.FollowerTab.ItemWeapon:RemoveTextures() StyleListItem(GarrisonMissionFrame.FollowerTab.ItemWeapon) @@ -321,7 +338,7 @@ local function LoadGarrisonStyle() GarrisonMissionFrame.MissionTab:RemoveTextures() GarrisonMissionFrame.MissionTab.MissionPage:RemoveTextures() - GarrisonMissionFrame.MissionTab.MissionPage:SetPanelTemplate('Paper', false, 4, 0, 0) + GarrisonMissionFrame.MissionTab.MissionPage:SetStylePanel("Default", 'Paper', false, 4, 0, 0) GarrisonMissionFrame.MissionTab.MissionPage:SetPanelColor("special") @@ -332,12 +349,12 @@ local function LoadGarrisonStyle() GarrisonMissionFrame.MissionTab.MissionPage.Stage:RemoveTextures() AddFadeBanner(GarrisonMissionFrame.MissionTab.MissionPage.Stage) GarrisonMissionFrame.MissionTab.MissionPage.StartMissionButton:RemoveTextures(true) - GarrisonMissionFrame.MissionTab.MissionPage.StartMissionButton:SetButtonTemplate() + GarrisonMissionFrame.MissionTab.MissionPage.StartMissionButton:SetStylePanel("Button") GarrisonMissionFrameFollowers:RemoveTextures() - GarrisonMissionFrameFollowers:SetPanelTemplate('Inset', false, 4, 0, 0) + GarrisonMissionFrameFollowers:SetStylePanel("Default", 'Inset', false, 4, 0, 0) GarrisonMissionFrameFollowers.MaterialFrame:RemoveTextures() - GarrisonMissionFrameFollowers.MaterialFrame:SetPanelTemplate("Inset", true, 1, -5, -7) + GarrisonMissionFrameFollowers.MaterialFrame:SetStylePanel("Default", "Inset", true, 1, -5, -7) PLUGIN:ApplyEditBoxStyle(GarrisonMissionFrameFollowers.SearchBox) --GarrisonMissionFrameFollowersListScrollFrame @@ -347,7 +364,7 @@ local function LoadGarrisonStyle() local mFollowers = mStage.FollowersFrame; mComplete:RemoveTextures() - mComplete:SetPanelTemplate('Paper', false, 4, 0, 0) + mComplete:SetStylePanel("Default", 'Paper', false, 4, 0, 0) mComplete:SetPanelColor("special") mStage:RemoveTextures() mStage.MissionInfo:RemoveTextures() @@ -364,33 +381,34 @@ local function LoadGarrisonStyle() AddFadeBanner(mStage) mComplete.NextMissionButton:RemoveTextures(true) - mComplete.NextMissionButton:SetButtonTemplate() + mComplete.NextMissionButton:SetStylePanel("Button") --GarrisonMissionFrame.MissionComplete.BonusRewards:RemoveTextures() - --GarrisonMissionFrame.MissionComplete.BonusRewards:SetFixedPanelTemplate("Model") + --GarrisonMissionFrame.MissionComplete.BonusRewards:SetStylePanel("Fixed", "Model") --print("Test") local display = GarrisonCapacitiveDisplayFrame display:RemoveTextures(true) GarrisonCapacitiveDisplayFrameInset:RemoveTextures(true) display.CapacitiveDisplay:RemoveTextures(true) - display.CapacitiveDisplay:SetPanelTemplate('Transparent') - display.CapacitiveDisplay.ShipmentIconFrame:SetSlotTemplate(true, 2, 0, 0, 0.5) + display.CapacitiveDisplay:SetStylePanel("Default", 'Transparent') + display.CapacitiveDisplay.ShipmentIconFrame:SetStylePanel("Slot", true, 2, 0, 0, 0.5) display.CapacitiveDisplay.ShipmentIconFrame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - display:SetPanelTemplate('Action') + display:SetStylePanel("Default", 'Action') --print("Test") local reagents = display.CapacitiveDisplay.Reagents; for i = 1, #reagents do if(reagents[i]) then reagents[i]:RemoveTextures() - reagents[i]:SetSlotTemplate(true, 2, 0, 0, 0.5) + reagents[i]:SetStylePanel("Slot", true, 2, 0, 0, 0.5) if(reagents[i].Icon) then reagents[i].Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) end end end + hooksecurefunc("GarrisonMissionList_UpdateMissions", StyleUpdateRewards) hooksecurefunc("GarrisonCapacitiveDisplayFrame_Update", _hook_ReagentUpdate) hooksecurefunc("GarrisonFollowerList_Update", _hook_GarrisonFollowerListUpdate) hooksecurefunc("GarrisonMissionFrame_SetFollowerPortrait", _hook_GarrisonMissionFrame_SetFollowerPortrait) @@ -405,7 +423,7 @@ local function LoadGarrisonStyle() --print("Test") if(GarrisonCapacitiveDisplayFrame.StartWorkOrderButton) then GarrisonCapacitiveDisplayFrame.StartWorkOrderButton:RemoveTextures(true) - GarrisonCapacitiveDisplayFrame.StartWorkOrderButton:SetButtonTemplate() + GarrisonCapacitiveDisplayFrame.StartWorkOrderButton:SetStylePanel("Button") end --print("Test") @@ -419,12 +437,43 @@ local function LoadGarrisonStyle() for j = 1, child:GetNumChildren() do local childC = select(j, child:GetChildren()) childC.Icon:SetTexCoord(0.1,0.9,0.1,0.9) + childC.Icon:SetDesaturated(false) end end --print("Test") PLUGIN:ApplyScrollFrameStyle(GarrisonLandingPageListScrollFrameScrollBar) + PLUGIN:ApplyWindowStyle(GarrisonRecruiterFrame, true) + GarrisonRecruiterFrameInset:RemoveTextures() + GarrisonRecruiterFrameInset:SetStylePanel("Fixed", "Inset") + PLUGIN:ApplyDropdownStyle(GarrisonRecruiterFramePickThreatDropDown) + GarrisonRecruiterFrame.Pick.Radio1:SetStylePanel("Colored", true, -3, -3) + GarrisonRecruiterFrame.Pick.Radio2:SetStylePanel("Colored", true, -3, -3) + + PLUGIN:ApplyWindowStyle(GarrisonRecruitSelectFrame, true) + GarrisonRecruitSelectFrame.FollowerSelection:RemoveTextures() + + GarrisonRecruitSelectFrame.FollowerList:RemoveTextures() + GarrisonRecruitSelectFrame.FollowerList:SetStylePanel("Default", 'Inset', false, 4, 0, 0) + + GarrisonRecruitSelectFrame.FollowerSelection.Recruit1:RemoveTextures() + GarrisonRecruitSelectFrame.FollowerSelection.Recruit2:RemoveTextures() + GarrisonRecruitSelectFrame.FollowerSelection.Recruit3:RemoveTextures() + + GarrisonRecruitSelectFrame.FollowerSelection.Recruit1:SetStylePanel("Default", 'Inset') + GarrisonRecruitSelectFrame.FollowerSelection.Recruit2:SetStylePanel("Default", 'Inset') + GarrisonRecruitSelectFrame.FollowerSelection.Recruit3:SetStylePanel("Default", 'Inset') + + StyleFollowerPortrait(GarrisonRecruitSelectFrame.FollowerSelection.Recruit1.PortraitFrame) + StyleFollowerPortrait(GarrisonRecruitSelectFrame.FollowerSelection.Recruit2.PortraitFrame) + StyleFollowerPortrait(GarrisonRecruitSelectFrame.FollowerSelection.Recruit3.PortraitFrame) + + GarrisonRecruitSelectFrame.FollowerSelection.Recruit1.HireRecruits:SetStylePanel("Button") + GarrisonRecruitSelectFrame.FollowerSelection.Recruit2.HireRecruits:SetStylePanel("Button") + GarrisonRecruitSelectFrame.FollowerSelection.Recruit3.HireRecruits:SetStylePanel("Button") + + hooksecurefunc("GarrisonRecruitSelectFrame_UpdateRecruits", _hook_GarrisonRecruitSelectFrame_UpdateRecruits) --print("Test Done") end --[[ diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/gossip.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/gossip.lua index be73102..6dea61d 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/gossip.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/gossip.lua @@ -45,7 +45,7 @@ local function GossipStyle() ItemTextPageText:SetTextColor(1, 1, 1) end end) - ItemTextFrame:SetPanelTemplate("Pattern") + ItemTextFrame:SetStylePanel("Default", "Pattern") ItemTextFrameInset:Die() PLUGIN:ApplyScrollFrameStyle(ItemTextScrollFrameScrollBar) PLUGIN:ApplyCloseButtonStyle(ItemTextFrameCloseButton) @@ -54,26 +54,26 @@ local function GossipStyle() for s, t in pairs(r)do _G[t]:RemoveTextures() end - GossipFrame:SetPanelTemplate("Halftone") - GossipGreetingScrollFrame:SetFixedPanelTemplate("Inset", true) + GossipFrame:SetStylePanel("Default", "Halftone") + GossipGreetingScrollFrame:SetStylePanel("Fixed", "Inset", true) GossipGreetingScrollFrame.spellTex = GossipGreetingScrollFrame:CreateTexture(nil, "ARTWORK") GossipGreetingScrollFrame.spellTex:SetTexture([[Interface\QuestFrame\QuestBG]]) GossipGreetingScrollFrame.spellTex:SetPoint("TOPLEFT", 2, -2) - GossipGreetingScrollFrame.spellTex:Size(506, 615) + GossipGreetingScrollFrame.spellTex:SetSizeToScale(506, 615) GossipGreetingScrollFrame.spellTex:SetTexCoord(0, 1, 0.02, 1) _G["GossipFramePortrait"]:Die() _G["GossipFrameGreetingGoodbyeButton"]:RemoveTextures() - _G["GossipFrameGreetingGoodbyeButton"]:SetButtonTemplate() + _G["GossipFrameGreetingGoodbyeButton"]:SetStylePanel("Button") PLUGIN:ApplyCloseButtonStyle(GossipFrameCloseButton, GossipFrame.Panel) NPCFriendshipStatusBar:RemoveTextures() NPCFriendshipStatusBar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - NPCFriendshipStatusBar:SetPanelTemplate("Bar") + NPCFriendshipStatusBar:SetStylePanel("Default", "Bar") NPCFriendshipStatusBar:ClearAllPoints() NPCFriendshipStatusBar:SetPoint("TOPLEFT", GossipFrame, "TOPLEFT", 58, -34) - NPCFriendshipStatusBar.icon:Size(32,32) + NPCFriendshipStatusBar.icon:SetSizeToScale(32,32) NPCFriendshipStatusBar.icon:ClearAllPoints() NPCFriendshipStatusBar.icon:SetPoint("RIGHT", NPCFriendshipStatusBar, "LEFT", 0, -2) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/guild.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/guild.lua index bf77ac8..7dad096 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/guild.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/guild.lua @@ -111,7 +111,7 @@ local function GCTabHelper(tab) tab.bg1:SetDrawLayer("BACKGROUND",4) tab.bg1:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) tab.bg1:SetVertexColor(unpack(SV.Media.color.default)) - tab.bg1:FillInner(tab.Panel,1) + tab.bg1:SetAllPointsIn(tab.Panel,1) tab.bg3 = tab:CreateTexture(nil,"BACKGROUND") tab.bg3:SetDrawLayer("BACKGROUND",2) tab.bg3:SetTexture(0,0,0,1) @@ -133,13 +133,13 @@ local function ChangeTabHelper(this) local nTex = this:GetNormalTexture() if(nTex) then nTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) - nTex:FillInner() + nTex:SetAllPointsIn() end this.pushed = true; this.backdrop = CreateFrame("Frame", nil, this) - this.backdrop:WrapOuter(this,1,1) + this.backdrop:SetAllPointsOut(this,1,1) this.backdrop:SetFrameLevel(0) this.backdrop:SetBackdrop({ bgFile = [[Interface\BUTTONS\WHITE8X8]], @@ -160,14 +160,14 @@ local function ChangeTabHelper(this) this:SetScript("OnLeave", Tab_OnLeave) local a,b,c,d,e = this:GetPoint() - this:Point(a,b,c,1,e) + this:SetPointToScale(a,b,c,1,e) end local function StyleSortingButton(button) if button.styled then return end local outer = button:CreateTexture(nil, "OVERLAY") - outer:WrapOuter(button, 6, 6) + outer:SetAllPointsOut(button, 6, 6) outer:SetTexture([[Interface\Addons\SVUI\assets\artwork\Template\ROUND]]) outer:SetGradient("VERTICAL", 0.4, 0.47, 0.5, 0.3, 0.33, 0.35) @@ -177,18 +177,18 @@ local function StyleSortingButton(button) end local icon = button:CreateTexture(nil, "OVERLAY") - icon:WrapOuter(button, 6, 6) + icon:SetAllPointsOut(button, 6, 6) SetPortraitToTexture(icon, iconTex) hooksecurefunc(icon, "SetTexture", SetPortraitToTexture) local hover = button:CreateTexture(nil, "HIGHLIGHT") - hover:WrapOuter(button, 6, 6) + hover:SetAllPointsOut(button, 6, 6) hover:SetTexture([[Interface\Addons\SVUI\assets\artwork\Template\ROUND]]) hover:SetGradient(unpack(SV.Media.gradient.yellow)) if button.SetPushedTexture then local pushed = button:CreateTexture(nil, "BORDER") - pushed:WrapOuter(button, 6, 6) + pushed:SetAllPointsOut(button, 6, 6) pushed:SetTexture([[Interface\Addons\SVUI\assets\artwork\Template\ROUND]]) pushed:SetGradient(unpack(SV.Media.gradient.highlight)) button:SetPushedTexture(pushed) @@ -196,7 +196,7 @@ local function StyleSortingButton(button) if button.SetCheckedTexture then local checked = button:CreateTexture(nil, "BORDER") - checked:WrapOuter(button, 6, 6) + checked:SetAllPointsOut(button, 6, 6) checked:SetTexture([[Interface\Addons\SVUI\assets\artwork\Template\ROUND]]) checked:SetGradient(unpack(SV.Media.gradient.green)) button:SetCheckedTexture(checked) @@ -204,7 +204,7 @@ local function StyleSortingButton(button) if button.SetDisabledTexture then local disabled = button:CreateTexture(nil, "BORDER") - disabled:WrapOuter(button, 6, 6) + disabled:SetAllPointsOut(button, 6, 6) disabled:SetTexture([[Interface\Addons\SVUI\assets\artwork\Template\ROUND]]) disabled:SetGradient(unpack(SV.Media.gradient.default)) button:SetDisabledTexture(disabled) @@ -213,7 +213,7 @@ local function StyleSortingButton(button) local cd = button:GetName() and _G[button:GetName().."Cooldown"] if cd then cd:ClearAllPoints() - cd:FillInner() + cd:SetAllPointsIn() end button.styled = true end @@ -222,14 +222,14 @@ local _hook_RankOrder_OnUpdate = function() for i = 1, GuildControlGetNumRanks()do local frame = _G["GuildControlUIRankOrderFrameRank"..i] if frame then - frame.downButton:SetButtonTemplate() - frame.upButton:SetButtonTemplate() - frame.deleteButton:SetButtonTemplate() + frame.downButton:SetStylePanel("Button") + frame.upButton:SetStylePanel("Button") + frame.deleteButton:SetStylePanel("Button") if not frame.nameBox.Panel then - frame.nameBox:SetEditboxTemplate() + frame.nameBox:SetStylePanel("Editbox") end - frame.nameBox.Panel:Point("TOPLEFT",-2,-4) - frame.nameBox.Panel:Point("BOTTOMRIGHT",-4,4) + frame.nameBox.Panel:SetPointToScale("TOPLEFT",-2,-4) + frame.nameBox.Panel:SetPointToScale("BOTTOMRIGHT",-4,4) end end end @@ -318,31 +318,31 @@ local _hook_BankTabPermissions = function(self) if(tab) then if(tab.tabIcon) then tab.tabIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) end - if(tab.editBox) then tab.editBox:SetEditboxTemplate() end + if(tab.editBox) then tab.editBox:SetStylePanel("Editbox") end if internalTest == false then purchase = _G[baseName.."BuyPurchaseButton"] if(purchase) then - purchase:SetButtonTemplate() + purchase:SetStylePanel("Button") end view = _G[ownedName.."ViewCheck"] if(view) then - view:SetCheckboxTemplate(true) + view:SetStylePanel("Checkbox", true) GCTabHelper(view) end stack = _G[ownedName.."StackBox"] if(stack) then - stack:SetEditboxTemplate() + stack:SetStylePanel("Editbox") GCTabHelper(stack) end deposit = _G[ownedName.."DepositCheck"] if(deposit) then - deposit:SetCheckboxTemplate(true) + deposit:SetStylePanel("Checkbox", true) GCTabHelper(deposit) end update = _G[ownedName.."UpdateInfoCheck"] if(update) then - update:SetCheckboxTemplate(true) + update:SetStylePanel("Checkbox", true) GCTabHelper(update) end end @@ -373,25 +373,25 @@ local function GuildBankStyle() end end - GuildBankFrameDepositButton:SetButtonTemplate() - GuildBankFrameWithdrawButton:SetButtonTemplate() - GuildBankInfoSaveButton:SetButtonTemplate() - GuildBankFramePurchaseButton:SetButtonTemplate() + GuildBankFrameDepositButton:SetStylePanel("Button") + GuildBankFrameWithdrawButton:SetStylePanel("Button") + GuildBankInfoSaveButton:SetStylePanel("Button") + GuildBankFramePurchaseButton:SetStylePanel("Button") local sortButton = CreateFrame("Button", nil, GuildBankFrame) - sortButton:Point("BOTTOMLEFT", GuildBankFrame, "BOTTOMRIGHT", 2, 0) - sortButton:Size(36, 36) - sortButton:SetFramedButtonTemplate() + sortButton:SetPointToScale("BOTTOMLEFT", GuildBankFrame, "BOTTOMRIGHT", 2, 0) + sortButton:SetSizeToScale(36, 36) + sortButton:SetStylePanel("Framed") sortButton:SetNormalTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\BAGS-CLEANUP]]) --StyleSortingButton(sortButton) local Sort_OnClick = BAGS:RunSortingProcess(BAGS.Sort, "guild") sortButton:SetScript("OnClick", Sort_OnClick) - GuildBankFrameWithdrawButton:Point("RIGHT", GuildBankFrameDepositButton, "LEFT", -2, 0) - GuildBankInfoScrollFrame:Point('TOPLEFT', GuildBankInfo, 'TOPLEFT', -10, 12) + GuildBankFrameWithdrawButton:SetPointToScale("RIGHT", GuildBankFrameDepositButton, "LEFT", -2, 0) + GuildBankInfoScrollFrame:SetPointToScale('TOPLEFT', GuildBankInfo, 'TOPLEFT', -10, 12) GuildBankInfoScrollFrame:RemoveTextures() - GuildBankInfoScrollFrame:Width(GuildBankInfoScrollFrame:GetWidth()-8) + GuildBankInfoScrollFrame:SetWidthToScale(GuildBankInfoScrollFrame:GetWidth()-8) GuildBankTransactionsScrollFrame:RemoveTextures() for i = 1, NUM_GUILDBANK_COLUMNS do @@ -408,11 +408,11 @@ local function GuildBankStyle() texture:SetTexture(0,0,0,0) end button:RemoveTextures() - button:SetSlotTemplate(true, 2, 0, 0) + button:SetStylePanel("Slot", true, 2, 0, 0) local icon = _G[btnName.."IconTexture"] if(icon) then - icon:FillInner() + icon:SetAllPointsIn() icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) end end @@ -429,10 +429,10 @@ local function GuildBankStyle() local button = _G[btnName] if(button) then button:RemoveTextures() - button:SetButtonTemplate() + button:SetStylePanel("Button") local texture = _G[btnName.."IconTexture"] if(texture) then - texture:FillInner() + texture:SetAllPointsIn() texture:SetTexCoord(0.1, 0.9, 0.1, 0.9) end end @@ -451,30 +451,30 @@ local function GuildBankStyle() GuildBankPopupFrame:RemoveTextures() GuildBankPopupScrollFrame:RemoveTextures() - GuildBankPopupFrame:SetFixedPanelTemplate("Transparent", true) - GuildBankPopupFrame:Point("TOPLEFT", GuildBankFrame, "TOPRIGHT", 1, -30) - GuildBankPopupOkayButton:SetButtonTemplate() - GuildBankPopupCancelButton:SetButtonTemplate() - GuildBankPopupEditBox:SetEditboxTemplate() + GuildBankPopupFrame:SetStylePanel("Fixed", "Transparent", true) + GuildBankPopupFrame:SetPointToScale("TOPLEFT", GuildBankFrame, "TOPRIGHT", 1, -30) + GuildBankPopupOkayButton:SetStylePanel("Button") + GuildBankPopupCancelButton:SetStylePanel("Button") + GuildBankPopupEditBox:SetStylePanel("Editbox") GuildBankPopupNameLeft:Die() GuildBankPopupNameRight:Die() GuildBankPopupNameMiddle:Die() GuildItemSearchBox:RemoveTextures() - GuildItemSearchBox:SetPanelTemplate("Overlay") - GuildItemSearchBox.Panel:Point("TOPLEFT", 10, -1) - GuildItemSearchBox.Panel:Point("BOTTOMRIGHT", 4, 1) + GuildItemSearchBox:SetStylePanel("Default", "Overlay") + GuildItemSearchBox.Panel:SetPointToScale("TOPLEFT", 10, -1) + GuildItemSearchBox.Panel:SetPointToScale("BOTTOMRIGHT", 4, 1) for i = 1, 16 do local btnName = ("GuildBankPopupButton%d"):format(i) local button = _G[btnName] if(button) then button:RemoveTextures() - button:SetFixedPanelTemplate("Default") - button:SetButtonTemplate() + button:SetStylePanel("Fixed", "Default") + button:SetStylePanel("Button") local icon = _G[btnName.."Icon"] if(icon) then - icon:FillInner() + icon:SetAllPointsIn() icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) end end @@ -507,13 +507,13 @@ local function GuildFrameStyle() local button = _G[GuildButtonList[i]] if(button) then button:RemoveTextures(true) - button:SetButtonTemplate() + button:SetStylePanel("Button") end end for i = 1, #GuildCheckBoxList do local check = _G[GuildCheckBoxList[i]] - if(check) then check:SetCheckboxTemplate(true) end + if(check) then check:SetStylePanel("Checkbox", true) end end for i = 1, 5 do @@ -521,29 +521,29 @@ local function GuildFrameStyle() if(tab) then PLUGIN:ApplyTabStyle(tab) if i == 1 then - tab:Point("TOPLEFT", GuildFrame, "BOTTOMLEFT", -10, 3) + tab:SetPointToScale("TOPLEFT", GuildFrame, "BOTTOMLEFT", -10, 3) end end end - GuildNewsBossModel:SetBasicPanel() - GuildNewsBossModelTextFrame:SetPanelTemplate("Default") - GuildNewsBossModelTextFrame.Panel:Point("TOPLEFT", GuildNewsBossModel.Panel, "BOTTOMLEFT", 0, -1) + GuildNewsBossModel:SetStylePanel("Default", 'Transparent') + GuildNewsBossModelTextFrame:SetStylePanel("Default", "Default") + GuildNewsBossModelTextFrame.Panel:SetPointToScale("TOPLEFT", GuildNewsBossModel.Panel, "BOTTOMLEFT", 0, -1) GuildNewsBossModel:SetPoint("TOPLEFT", GuildFrame, "TOPRIGHT", 4, -43) - GuildRecruitmentTankButton.checkButton:SetCheckboxTemplate(true) - GuildRecruitmentHealerButton.checkButton:SetCheckboxTemplate(true) - GuildRecruitmentDamagerButton.checkButton:SetCheckboxTemplate(true) + GuildRecruitmentTankButton.checkButton:SetStylePanel("Checkbox", true) + GuildRecruitmentHealerButton.checkButton:SetStylePanel("Checkbox", true) + GuildRecruitmentDamagerButton.checkButton:SetStylePanel("Checkbox", true) GuildFactionBar:RemoveTextures() GuildFactionBar.progress:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - GuildFactionBar:SetPanelTemplate("Inset") - GuildFactionBar.Panel:Point("TOPLEFT", GuildFactionBar.progress, "TOPLEFT", -1, 1) - GuildFactionBar.Panel:Point("BOTTOMRIGHT", GuildFactionBar, "BOTTOMRIGHT", 1, 1) + GuildFactionBar:SetStylePanel("Default", "Inset") + GuildFactionBar.Panel:SetPointToScale("TOPLEFT", GuildFactionBar.progress, "TOPLEFT", -1, 1) + GuildFactionBar.Panel:SetPointToScale("BOTTOMRIGHT", GuildFactionBar, "BOTTOMRIGHT", 1, 1) - GuildRosterContainer:SetBasicPanel(-2, 2, -1, -2) + GuildRosterContainer:SetStylePanel("Default", "Inset") PLUGIN:ApplyScrollFrameStyle(GuildRosterContainerScrollBar, 4, -4) - GuildRosterShowOfflineButton:SetCheckboxTemplate(true) + GuildRosterShowOfflineButton:SetStylePanel("Checkbox", true) for i = 1, 4 do local btn = _G["GuildRosterColumnButton"..i] @@ -558,40 +558,41 @@ local function GuildFrameStyle() local btn = _G["GuildRosterContainerButton"..i.."HeaderButton"] if(btn) then btn:RemoveTextures() - btn:SetButtonTemplate() + btn:SetStylePanel("Button") end end - GuildMemberDetailFrame:SetPanelTemplate("Default", true) - GuildMemberNoteBackground:SetBasicPanel() - GuildMemberOfficerNoteBackground:SetBasicPanel() + GuildMemberDetailFrame:SetStylePanel("Default", "Default", true) + GuildMemberNoteBackground:SetStylePanel("Default", 'Transparent') + GuildMemberOfficerNoteBackground:SetStylePanel("Default", 'Transparent') PLUGIN:ApplyDropdownStyle(GuildMemberRankDropdown, 182) - GuildMemberDetailRankText:Hide() + GuildMemberRankDropdown:HookScript("OnShow", function() GuildMemberDetailRankText:Hide() end) + GuildMemberRankDropdown:HookScript("OnHide", function() GuildMemberDetailRankText:Show() end) GuildNewsFrame:RemoveTextures() - GuildNewsContainer:SetBasicPanel(-2, 2, 0, -2) + GuildNewsContainer:SetStylePanel("Default", "Inset") for i = 1, 17 do local btn = _G["GuildNewsContainerButton"..i] if(btn) then if(btn.header) then btn.header:Die() end btn:RemoveTextures() - btn:SetButtonTemplate() + btn:SetStylePanel("Button") end end GuildNewsFiltersFrame:RemoveTextures() - GuildNewsFiltersFrame:SetFixedPanelTemplate("Transparent", true) + GuildNewsFiltersFrame:SetStylePanel("Fixed", "Transparent", true) PLUGIN:ApplyCloseButtonStyle(GuildNewsFiltersFrameCloseButton) for i = 1, 7 do local btn = _G["GuildNewsFilterButton"..i] if(btn) then - btn:SetCheckboxTemplate(true) + btn:SetStylePanel("Checkbox", true) end end - GuildNewsFiltersFrame:Point("TOPLEFT", GuildFrame, "TOPRIGHT", 4, -20) + GuildNewsFiltersFrame:SetPointToScale("TOPLEFT", GuildFrame, "TOPRIGHT", 4, -20) PLUGIN:ApplyScrollFrameStyle(GuildNewsContainerScrollBar, 4, 4) PLUGIN:ApplyScrollFrameStyle(GuildInfoDetailsFrameScrollBar, 4, 4) @@ -605,22 +606,22 @@ local function GuildFrameStyle() local panel1 = CreateFrame("Frame", nil, GuildInfoFrameInfo) panel1:SetPoint("TOPLEFT", GuildInfoFrameInfo, "TOPLEFT", 2, -22) panel1:SetPoint("BOTTOMRIGHT", GuildInfoFrameInfo, "BOTTOMRIGHT", 0, 200) - panel1:SetBasicPanel() + panel1:SetStylePanel("Default", 'Transparent') local panel2 = CreateFrame("Frame", nil, GuildInfoFrameInfo) panel2:SetPoint("TOPLEFT", GuildInfoFrameInfo, "TOPLEFT", 2, -158) panel2:SetPoint("BOTTOMRIGHT", GuildInfoFrameInfo, "BOTTOMRIGHT", 0, 118) - panel2:SetBasicPanel() + panel2:SetStylePanel("Default", 'Transparent') local panel3 = CreateFrame("Frame", nil, GuildInfoFrameInfo) panel3:SetPoint("TOPLEFT", GuildInfoFrameInfo, "TOPLEFT", 2, -233) panel3:SetPoint("BOTTOMRIGHT", GuildInfoFrameInfo, "BOTTOMRIGHT", 0, 3) - panel3:SetBasicPanel() + panel3:SetStylePanel("Default", 'Transparent') - GuildRecruitmentCommentInputFrame:SetFixedPanelTemplate("Default") - GuildTextEditFrame:SetFixedPanelTemplate("Transparent", true) + GuildRecruitmentCommentInputFrame:SetStylePanel("Fixed", "Default") + GuildTextEditFrame:SetStylePanel("Fixed", "Transparent", true) PLUGIN:ApplyScrollFrameStyle(GuildTextEditScrollFrameScrollBar, 4, 4) - GuildTextEditContainer:SetFixedPanelTemplate("Default") + GuildTextEditContainer:SetStylePanel("Fixed", "Default") local editChildren = GuildTextEditFrame:GetNumChildren() @@ -630,13 +631,13 @@ local function GuildFrameStyle() if(child:GetWidth() < 33) then PLUGIN:ApplyCloseButtonStyle(child) else - child:SetButtonTemplate() + child:SetStylePanel("Button") end end end PLUGIN:ApplyScrollFrameStyle(GuildLogScrollFrameScrollBar, 4, 4) - GuildLogFrame:SetBasicPanel() + GuildLogFrame:SetStylePanel("Default", 'Transparent') local logChildren = GuildLogFrame:GetNumChildren() @@ -646,17 +647,13 @@ local function GuildFrameStyle() if(child:GetWidth() < 33) then PLUGIN:ApplyCloseButtonStyle(child) else - child:SetButtonTemplate() + child:SetStylePanel("Button") end end end - GuildRewardsFrame:SetBasicPanel(2, 0, -22, 18) + GuildRewardsFrame:SetStylePanel("Default", "Inset") PLUGIN:ApplyScrollFrameStyle(GuildRewardsContainerScrollBar, 4, -4) - - --GuildNewPerksFrame:SetBasicPanel(-1, 0, 1, 0) - --GuildPerksContainer:SetBasicPanel(-3, 0, 26, -3) - PLUGIN:ApplyScrollFrameStyle(GuildPerksContainerScrollBar, 4, 2) for i = 1, 8 do @@ -668,7 +665,7 @@ local function GuildFrameStyle() if icon then icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) icon:ClearAllPoints() - icon:Point("TOPLEFT", button, "TOPLEFT", 2, -2) + icon:SetPointToScale("TOPLEFT", button, "TOPLEFT", 2, -2) icon:SetParent(button.Panel) end end @@ -713,18 +710,18 @@ local function GuildControlStyle() PLUGIN:ApplyDropdownStyle(GuildControlUINavigationDropDown) PLUGIN:ApplyDropdownStyle(GuildControlUIRankSettingsFrameRankDropDown,180) - GuildControlUINavigationDropDownButton:Width(20) - GuildControlUIRankSettingsFrameRankDropDownButton:Width(20) + GuildControlUINavigationDropDownButton:SetWidthToScale(20) + GuildControlUIRankSettingsFrameRankDropDownButton:SetWidthToScale(20) for i=1, NUM_RANK_FLAGS do local check = _G["GuildControlUIRankSettingsFrameCheckbox"..i] - if(check) then check:SetCheckboxTemplate(true) end + if(check) then check:SetStylePanel("Checkbox", true) end end - GuildControlUIRankOrderFrameNewButton:SetButtonTemplate() - GuildControlUIRankSettingsFrameGoldBox:SetEditboxTemplate() - GuildControlUIRankSettingsFrameGoldBox.Panel:Point("TOPLEFT",-2,-4) - GuildControlUIRankSettingsFrameGoldBox.Panel:Point("BOTTOMRIGHT",2,4) + GuildControlUIRankOrderFrameNewButton:SetStylePanel("Button") + GuildControlUIRankSettingsFrameGoldBox:SetStylePanel("Editbox") + GuildControlUIRankSettingsFrameGoldBox.Panel:SetPointToScale("TOPLEFT",-2,-4) + GuildControlUIRankSettingsFrameGoldBox.Panel:SetPointToScale("BOTTOMRIGHT",2,4) GuildControlUIRankSettingsFrameGoldBox:RemoveTextures() GuildControlUIRankBankFrame:RemoveTextures() @@ -732,7 +729,7 @@ local function GuildControlStyle() PLUGIN:ApplyDropdownStyle(GuildControlUIRankBankFrameRankDropDown, 180) - GuildControlUIRankBankFrameRankDropDownButton:Width(20) + GuildControlUIRankBankFrameRankDropDownButton:SetWidthToScale(20) end @@ -747,11 +744,11 @@ local function GuildRegistrarStyle() GuildRegistrarFrameEditBox:RemoveTextures() GuildRegistrarGreetingFrame:RemoveTextures() - GuildRegistrarFrameGoodbyeButton:SetButtonTemplate() - GuildRegistrarFrameCancelButton:SetButtonTemplate() - GuildRegistrarFramePurchaseButton:SetButtonTemplate() + GuildRegistrarFrameGoodbyeButton:SetStylePanel("Button") + GuildRegistrarFrameCancelButton:SetStylePanel("Button") + GuildRegistrarFramePurchaseButton:SetStylePanel("Button") PLUGIN:ApplyCloseButtonStyle(GuildRegistrarFrameCloseButton) - GuildRegistrarFrameEditBox:SetEditboxTemplate() + GuildRegistrarFrameEditBox:SetStylePanel("Editbox") for i = 1, GuildRegistrarFrameEditBox:GetNumRegions() do local region = select(i, GuildRegistrarFrameEditBox:GetRegions()) @@ -762,7 +759,7 @@ local function GuildRegistrarStyle() end end - GuildRegistrarFrameEditBox:Height(20) + GuildRegistrarFrameEditBox:SetHeightToScale(20) if(_G["GuildRegistrarButton1"]) then _G["GuildRegistrarButton1"]:GetFontString():SetTextColor(1, 1, 1) @@ -782,22 +779,22 @@ local function LFGuildFrameStyle() for i = 1, #LFGFrameList do local check = _G[LFGFrameList[i]] - if(check) then check:SetCheckboxTemplate(true) end + if(check) then check:SetStylePanel("Checkbox", true) end end - LookingForGuildTankButton.checkButton:SetCheckboxTemplate(true) - LookingForGuildHealerButton.checkButton:SetCheckboxTemplate(true) - LookingForGuildDamagerButton.checkButton:SetCheckboxTemplate(true) + LookingForGuildTankButton.checkButton:SetStylePanel("Checkbox", true) + LookingForGuildHealerButton.checkButton:SetStylePanel("Checkbox", true) + LookingForGuildDamagerButton.checkButton:SetStylePanel("Checkbox", true) LookingForGuildFrameInset:RemoveTextures(false) LookingForGuildBrowseButton_LeftSeparator:Die() LookingForGuildRequestButton_RightSeparator:Die() PLUGIN:ApplyScrollFrameStyle(LookingForGuildBrowseFrameContainerScrollBar) - LookingForGuildBrowseButton:SetButtonTemplate() - LookingForGuildRequestButton:SetButtonTemplate() + LookingForGuildBrowseButton:SetStylePanel("Button") + LookingForGuildRequestButton:SetStylePanel("Button") PLUGIN:ApplyCloseButtonStyle(LookingForGuildFrameCloseButton) - LookingForGuildCommentInputFrame:SetPanelTemplate("Default") + LookingForGuildCommentInputFrame:SetStylePanel("Default", "Default") LookingForGuildCommentInputFrame:RemoveTextures(false) for u = 1, 5 do @@ -815,11 +812,11 @@ local function LFGuildFrameStyle() end GuildFinderRequestMembershipFrame:RemoveTextures(true) - GuildFinderRequestMembershipFrame:SetFixedPanelTemplate("Transparent", true) - GuildFinderRequestMembershipFrameAcceptButton:SetButtonTemplate() - GuildFinderRequestMembershipFrameCancelButton:SetButtonTemplate() + GuildFinderRequestMembershipFrame:SetStylePanel("Fixed", "Transparent", true) + GuildFinderRequestMembershipFrameAcceptButton:SetStylePanel("Button") + GuildFinderRequestMembershipFrameCancelButton:SetStylePanel("Button") GuildFinderRequestMembershipFrameInputFrame:RemoveTextures() - GuildFinderRequestMembershipFrameInputFrame:SetFixedPanelTemplate("Default") + GuildFinderRequestMembershipFrameInputFrame:SetStylePanel("Fixed", "Default") end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/help.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/help.lua index a79059b..d1b88e7 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/help.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/help.lua @@ -78,14 +78,14 @@ local function HelpFrameStyle() tinsert(HelpFrameButtonList, "HelpFrameReportBugSubmit") for d = 1, #HelpFrameList do _G[HelpFrameList[d]]:RemoveTextures(true) - _G[HelpFrameList[d]]:SetPanelTemplate("Default") + _G[HelpFrameList[d]]:SetStylePanel("Default", "Default") end HelpFrameHeader:SetFrameLevel(HelpFrameHeader:GetFrameLevel()+2) HelpFrameKnowledgebaseErrorFrame:SetFrameLevel(HelpFrameKnowledgebaseErrorFrame:GetFrameLevel()+2) HelpFrameReportBugScrollFrame:RemoveTextures() - HelpFrameReportBugScrollFrame:SetPanelTemplate("Default") - HelpFrameReportBugScrollFrame.Panel:Point("TOPLEFT", -4, 4) - HelpFrameReportBugScrollFrame.Panel:Point("BOTTOMRIGHT", 6, -4) + HelpFrameReportBugScrollFrame:SetStylePanel("Default", "Default") + HelpFrameReportBugScrollFrame.Panel:SetPointToScale("TOPLEFT", -4, 4) + HelpFrameReportBugScrollFrame.Panel:SetPointToScale("BOTTOMRIGHT", 6, -4) for d = 1, HelpFrameReportBug:GetNumChildren()do local e = select(d, HelpFrameReportBug:GetChildren()) if not e:GetName() then @@ -94,9 +94,9 @@ local function HelpFrameStyle() end PLUGIN:ApplyScrollFrameStyle(HelpFrameReportBugScrollFrameScrollBar) HelpFrameSubmitSuggestionScrollFrame:RemoveTextures() - HelpFrameSubmitSuggestionScrollFrame:SetPanelTemplate("Default") - HelpFrameSubmitSuggestionScrollFrame.Panel:Point("TOPLEFT", -4, 4) - HelpFrameSubmitSuggestionScrollFrame.Panel:Point("BOTTOMRIGHT", 6, -4) + HelpFrameSubmitSuggestionScrollFrame:SetStylePanel("Default", "Default") + HelpFrameSubmitSuggestionScrollFrame.Panel:SetPointToScale("TOPLEFT", -4, 4) + HelpFrameSubmitSuggestionScrollFrame.Panel:SetPointToScale("BOTTOMRIGHT", 6, -4) for d = 1, HelpFrameSubmitSuggestion:GetNumChildren()do local e = select(d, HelpFrameSubmitSuggestion:GetChildren()) if not e:GetName() then @@ -105,9 +105,9 @@ local function HelpFrameStyle() end PLUGIN:ApplyScrollFrameStyle(HelpFrameSubmitSuggestionScrollFrameScrollBar) HelpFrameTicketScrollFrame:RemoveTextures() - HelpFrameTicketScrollFrame:SetPanelTemplate("Default") - HelpFrameTicketScrollFrame.Panel:Point("TOPLEFT", -4, 4) - HelpFrameTicketScrollFrame.Panel:Point("BOTTOMRIGHT", 6, -4) + HelpFrameTicketScrollFrame:SetStylePanel("Default", "Default") + HelpFrameTicketScrollFrame.Panel:SetPointToScale("TOPLEFT", -4, 4) + HelpFrameTicketScrollFrame.Panel:SetPointToScale("BOTTOMRIGHT", 6, -4) for d = 1, HelpFrameTicket:GetNumChildren()do local e = select(d, HelpFrameTicket:GetChildren()) if not e:GetName() then @@ -117,7 +117,7 @@ local function HelpFrameStyle() PLUGIN:ApplyScrollFrameStyle(HelpFrameKnowledgebaseScrollFrame2ScrollBar) for d = 1, #HelpFrameButtonList do _G[HelpFrameButtonList[d]]:RemoveTextures(true) - _G[HelpFrameButtonList[d]]:SetButtonTemplate() + _G[HelpFrameButtonList[d]]:SetStylePanel("Button") if _G[HelpFrameButtonList[d]].text then _G[HelpFrameButtonList[d]].text:ClearAllPoints() _G[HelpFrameButtonList[d]].text:SetPoint("CENTER") @@ -126,7 +126,7 @@ local function HelpFrameStyle() end for d = 1, 6 do local f = _G["HelpFrameButton"..d] - f:SetButtonTemplate() + f:SetStylePanel("Button") f.text:ClearAllPoints() f.text:SetPoint("CENTER") f.text:SetJustifyH("CENTER") @@ -134,27 +134,27 @@ local function HelpFrameStyle() for d = 1, HelpFrameKnowledgebaseScrollFrameScrollChild:GetNumChildren()do local f = _G["HelpFrameKnowledgebaseScrollFrameButton"..d] f:RemoveTextures(true) - f:SetButtonTemplate() + f:SetStylePanel("Button") end HelpFrameKnowledgebaseSearchBox:ClearAllPoints() - HelpFrameKnowledgebaseSearchBox:Point("TOPLEFT", HelpFrameMainInset, "TOPLEFT", 13, -10) + HelpFrameKnowledgebaseSearchBox:SetPointToScale("TOPLEFT", HelpFrameMainInset, "TOPLEFT", 13, -10) HelpFrameKnowledgebaseNavBarOverlay:Die() HelpFrameKnowledgebaseNavBar:RemoveTextures() HelpFrame:RemoveTextures(true) - HelpFrame:SetPanelTemplate("Halftone") - HelpFrameKnowledgebaseSearchBox:SetEditboxTemplate() + HelpFrame:SetStylePanel("Default", "Halftone") + HelpFrameKnowledgebaseSearchBox:SetStylePanel("Editbox") PLUGIN:ApplyScrollFrameStyle(HelpFrameKnowledgebaseScrollFrameScrollBar, 5) PLUGIN:ApplyScrollFrameStyle(HelpFrameTicketScrollFrameScrollBar, 4) PLUGIN:ApplyCloseButtonStyle(HelpFrameCloseButton, HelpFrame.Panel) PLUGIN:ApplyCloseButtonStyle(HelpFrameKnowledgebaseErrorFrameCloseButton, HelpFrameKnowledgebaseErrorFrame.Panel) - HelpFrameCharacterStuckHearthstone:SetButtonTemplate() - HelpFrameCharacterStuckHearthstone:SetFixedPanelTemplate("Default") - HelpFrameCharacterStuckHearthstone.IconTexture:FillInner() + HelpFrameCharacterStuckHearthstone:SetStylePanel("Button") + HelpFrameCharacterStuckHearthstone:SetStylePanel("Fixed", "Default") + HelpFrameCharacterStuckHearthstone.IconTexture:SetAllPointsIn() HelpFrameCharacterStuckHearthstone.IconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) hooksecurefunc("NavBar_AddButton", function(h, k) local i = h.navList[#h.navList] if not i.styled then - i:SetButtonTemplate() + i:SetStylePanel("Button") i.styled = true; i:HookScript("OnClick", function() NavBarHelper(h) @@ -162,14 +162,14 @@ local function HelpFrameStyle() end NavBarHelper(h) end) - HelpFrameGM_ResponseNeedMoreHelp:SetButtonTemplate() - HelpFrameGM_ResponseCancel:SetButtonTemplate() + HelpFrameGM_ResponseNeedMoreHelp:SetStylePanel("Button") + HelpFrameGM_ResponseCancel:SetStylePanel("Button") for d = 1, HelpFrameGM_Response:GetNumChildren()do local e = select(d, HelpFrameGM_Response:GetChildren()) if e and e:GetObjectType() == "Frame"and not e:GetName() then - e:SetFixedPanelTemplate("Default") + e:SetStylePanel("Fixed", "Default") end end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/inspect.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/inspect.lua index 56889c8..19e32b6 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/inspect.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/inspect.lua @@ -60,7 +60,7 @@ local function InspectStyle() end InspectFrame:RemoveTextures(true) InspectFrameInset:RemoveTextures(true) - InspectFrame:SetPanelTemplate('Action') + InspectFrame:SetStylePanel("Default", 'Action') PLUGIN:ApplyCloseButtonStyle(InspectFrameCloseButton) for d = 1, 4 do PLUGIN:ApplyTabStyle(_G["InspectFrameTab"..d]) @@ -75,16 +75,16 @@ local function InspectStyle() InspectModelFrameBorderBottom:Die() InspectModelFrameBorderBottom2:Die() InspectModelFrameBackgroundOverlay:Die() - InspectModelFrame:SetPanelTemplate("Default") + InspectModelFrame:SetStylePanel("Default", "Default") for _, slot in pairs(InspectSlotList)do local texture = _G["Inspect"..slot.."IconTexture"] local frame = _G["Inspect"..slot] frame:RemoveTextures() - frame:SetButtonTemplate() + frame:SetStylePanel("Button") texture:SetTexCoord(0.1, 0.9, 0.1, 0.9) - texture:FillInner() + texture:SetAllPointsIn() frame:SetFrameLevel(frame:GetFrameLevel() + 1) - frame:SetFixedPanelTemplate() + frame:SetStylePanel("Fixed") end hooksecurefunc('InspectPaperDollItemSlotButton_Update', function(q) local unit = InspectFrame.unit; diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/itemsocketing.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/itemsocketing.lua index ab6da42..0f7387f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/itemsocketing.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/itemsocketing.lua @@ -30,10 +30,10 @@ ITEMSOCKETING PLUGINR local function ItemSocketStyle() if PLUGIN.db.blizzard.enable ~= true or PLUGIN.db.blizzard.socket ~= true then return end ItemSocketingFrame:RemoveTextures() - ItemSocketingFrame:SetPanelTemplate("Action") + ItemSocketingFrame:SetStylePanel("Default", "Action") ItemSocketingFrameInset:Die() ItemSocketingScrollFrame:RemoveTextures() - ItemSocketingScrollFrame:SetPanelTemplate("Inset", true) + ItemSocketingScrollFrame:SetStylePanel("Default", "Inset", true) PLUGIN:ApplyScrollFrameStyle(ItemSocketingScrollFrameScrollBar, 2) for j = 1, MAX_NUM_SOCKETS do local i = _G[("ItemSocketingSocket%d"):format(j)]; @@ -41,12 +41,12 @@ local function ItemSocketStyle() local D = _G[("ItemSocketingSocket%dBackground"):format(j)]; local E = _G[("ItemSocketingSocket%dIconTexture"):format(j)]; i:RemoveTextures() - i:SetButtonTemplate() - i:SetFixedPanelTemplate("Button", true) + i:SetStylePanel("Button") + i:SetStylePanel("Fixed", "Button", true) C:Die() D:Die() E:SetTexCoord(0.1, 0.9, 0.1, 0.9) - E:FillInner() + E:SetAllPointsIn() end hooksecurefunc("ItemSocketingFrame_Update", function() local max = GetNumSockets() @@ -60,8 +60,8 @@ local function ItemSocketStyle() end) ItemSocketingFramePortrait:Die() ItemSocketingSocketButton:ClearAllPoints() - ItemSocketingSocketButton:Point("BOTTOMRIGHT", ItemSocketingFrame, "BOTTOMRIGHT", -5, 5) - ItemSocketingSocketButton:SetButtonTemplate() + ItemSocketingSocketButton:SetPointToScale("BOTTOMRIGHT", ItemSocketingFrame, "BOTTOMRIGHT", -5, 5) + ItemSocketingSocketButton:SetStylePanel("Button") PLUGIN:ApplyCloseButtonStyle(ItemSocketingFrameCloseButton) end --[[ diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/itemupgrade.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/itemupgrade.lua index ff5a0c5..e312c1a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/itemupgrade.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/itemupgrade.lua @@ -36,10 +36,10 @@ local function ItemUpgradeStyle() PLUGIN:ApplyCloseButtonStyle(ItemUpgradeFrameCloseButton) ItemUpgradeFrameUpgradeButton:RemoveTextures() - ItemUpgradeFrameUpgradeButton:SetButtonTemplate() + ItemUpgradeFrameUpgradeButton:SetStylePanel("Button") ItemUpgradeFrame.ItemButton:RemoveTextures() - ItemUpgradeFrame.ItemButton:SetSlotTemplate(true) - ItemUpgradeFrame.ItemButton.IconTexture:FillInner() + ItemUpgradeFrame.ItemButton:SetStylePanel("Slot", true) + ItemUpgradeFrame.ItemButton.IconTexture:SetAllPointsIn() hooksecurefunc('ItemUpgradeFrame_Update', function() if GetItemUpgradeItemInfo() then ItemUpgradeFrame.ItemButton.IconTexture:SetAlpha(1) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/keybinding.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/keybinding.lua index 62e6577..3f2c22e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/keybinding.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/keybinding.lua @@ -43,7 +43,7 @@ local function BindingStyle() local btn = _G[gName] if(btn) then btn:RemoveTextures() - btn:SetButtonTemplate() + btn:SetStylePanel("Button") end end @@ -51,19 +51,19 @@ local function BindingStyle() local button1 = _G["KeyBindingFrameBinding"..i.."Key1Button"] if(button1) then button1:RemoveTextures(true) - button1:SetEditboxTemplate() + button1:SetStylePanel("Editbox") end local button2 = _G["KeyBindingFrameBinding"..i.."Key2Button"] if(button2) then button2:RemoveTextures(true) - button2:SetEditboxTemplate() + button2:SetStylePanel("Editbox") end end PLUGIN:ApplyScrollFrameStyle(KeyBindingFrameScrollFrameScrollBar) KeyBindingFrame:RemoveTextures() - KeyBindingFrame:SetPanelTemplate("Halftone") + KeyBindingFrame:SetStylePanel("Default", "Halftone") end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lfd.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lfd.lua index ac7583b..56d75e1 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lfd.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lfd.lua @@ -51,12 +51,18 @@ local function StyleMoneyRewards(frameName) local size = frame:GetHeight() - 6 local texture = icon:GetTexture() frame:RemoveTextures() - frame:SetFixedPanelTemplate('Blackout', true, 3) + frame:SetStylePanel("Fixed", "Inset") icon:SetTexture(texture) icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) icon:ClearAllPoints() icon:SetPoint("TOPLEFT", frame, "TOPLEFT", 3, -3) icon:SetSize(size, size) + if(not frame.IconSlot) then + frame.IconSlot = CreateFrame("Frame", nil, frame) + frame.IconSlot:SetAllPointsOut(icon) + frame.IconSlot:SetStylePanel("Icon") + icon:SetParent(frame.IconSlot) + end end end @@ -89,8 +95,8 @@ local LFDQueueRandom_OnUpdate = function() z:SetSize(118, 39) x:SetAlpha(0) t.border = CreateFrame("Frame", nil, t) - t.border:SetFixedPanelTemplate() - t.border:WrapOuter(icon) + t.border:SetStylePanel("Fixed") + t.border:SetAllPointsOut(icon) icon:SetParent(t.border) y:SetParent(t.border) t.restyled = true; @@ -121,8 +127,8 @@ local ScenarioQueueRandom_OnUpdate = function() z:SetSize(118, 39) x:SetAlpha(0) t.border = CreateFrame("Frame", nil, t) - t.border:SetFixedPanelTemplate() - t.border:WrapOuter(icon) + t.border:SetStylePanel("Fixed") + t.border:SetAllPointsOut(icon) icon:SetParent(t.border) y:SetParent(t.border) t.restyled = true @@ -155,10 +161,10 @@ local function LFDFrameStyle() PVEFrameLeftInsetBg:Hide() PVEFrame.shadows:Hide() - LFDQueueFramePartyBackfillBackfillButton:SetButtonTemplate() - LFDQueueFramePartyBackfillNoBackfillButton:SetButtonTemplate() - LFDQueueFrameRandomScrollFrameChildFrameBonusRepFrame.ChooseButton:SetButtonTemplate() - ScenarioQueueFrameRandomScrollFrameChildFrameBonusRepFrame.ChooseButton:SetButtonTemplate() + LFDQueueFramePartyBackfillBackfillButton:SetStylePanel("Button") + LFDQueueFramePartyBackfillNoBackfillButton:SetStylePanel("Button") + LFDQueueFrameRandomScrollFrameChildFrameBonusRepFrame.ChooseButton:SetStylePanel("Button") + ScenarioQueueFrameRandomScrollFrameChildFrameBonusRepFrame.ChooseButton:SetStylePanel("Button") PLUGIN:ApplyScrollFrameStyle(ScenarioQueueFrameRandomScrollFrameScrollBar) @@ -168,12 +174,12 @@ local function LFDFrameStyle() GroupFinderFrameGroupButton4.icon:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\SVUI-ICON") LFGDungeonReadyDialogBackground:Die() - LFGDungeonReadyDialogEnterDungeonButton:SetButtonTemplate() - LFGDungeonReadyDialogLeaveQueueButton:SetButtonTemplate() + LFGDungeonReadyDialogEnterDungeonButton:SetStylePanel("Button") + LFGDungeonReadyDialogLeaveQueueButton:SetStylePanel("Button") PLUGIN:ApplyCloseButtonStyle(LFGDungeonReadyDialogCloseButton) LFGDungeonReadyStatus:RemoveTextures() - LFGDungeonReadyStatus:SetPanelTemplate("Pattern", true, 2, 4, 4) + LFGDungeonReadyStatus:SetStylePanel("Default", "Pattern", true, 2, 4, 4) LFGDungeonReadyDialogRoleIconTexture:SetTexture("Interface\\LFGFrame\\UI-LFG-ICONS-ROLEBACKGROUNDS") LFGDungeonReadyDialogRoleIconTexture:SetAlpha(0.5) @@ -217,12 +223,12 @@ local function LFDFrameStyle() LFDQueueFrameRoleButtonLeader.leadIcon = LFDQueueFrameRoleButtonLeader:CreateTexture(nil, 'BACKGROUND') LFDQueueFrameRoleButtonLeader.leadIcon:SetTexture([[Interface\GroupFrame\UI-Group-LeaderIcon]]) LFDQueueFrameRoleButtonLeader.leadIcon:SetPoint(LFDQueueFrameRoleButtonLeader:GetNormalTexture():GetPoint()) - LFDQueueFrameRoleButtonLeader.leadIcon:Size(50) + LFDQueueFrameRoleButtonLeader.leadIcon:SetSizeToScale(50) LFDQueueFrameRoleButtonLeader.leadIcon:SetAlpha(0.4) RaidFinderQueueFrameRoleButtonLeader.leadIcon = RaidFinderQueueFrameRoleButtonLeader:CreateTexture(nil, 'BACKGROUND') RaidFinderQueueFrameRoleButtonLeader.leadIcon:SetTexture([[Interface\GroupFrame\UI-Group-LeaderIcon]]) RaidFinderQueueFrameRoleButtonLeader.leadIcon:SetPoint(RaidFinderQueueFrameRoleButtonLeader:GetNormalTexture():GetPoint()) - RaidFinderQueueFrameRoleButtonLeader.leadIcon:Size(50) + RaidFinderQueueFrameRoleButtonLeader.leadIcon:SetSizeToScale(50) RaidFinderQueueFrameRoleButtonLeader.leadIcon:SetAlpha(0.4) hooksecurefunc('LFG_DisableRoleButton', function(self) @@ -259,21 +265,21 @@ local function LFDFrameStyle() button.ring:Hide() button.bg:SetTexture(0,0,0,0) button.bg:SetAllPoints() - button:SetPanelTemplate('Button') - button:SetButtonTemplate() + button:SetStylePanel("Default", 'Button') + button:SetStylePanel("Button") button.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) button.icon:SetDrawLayer("OVERLAY") - button.icon:Size(40) + button.icon:SetSizeToScale(40) button.icon:ClearAllPoints() button.icon:SetPoint("LEFT", 10, 0) button.border = CreateFrame("Frame", nil, button) - button.border:SetFixedPanelTemplate('Default') - button.border:WrapOuter(button.icon) + button.border:SetStylePanel("Fixed", 'Default') + button.border:SetAllPointsOut(button.icon) button.icon:SetParent(button.border) end end - for u = 1, 2 do + for u = 1, 3 do PLUGIN:ApplyTabStyle(_G['PVEFrameTab'..u]) end @@ -283,7 +289,7 @@ local function LFDFrameStyle() LFDQueueFrameFindGroupButton:RemoveTextures() LFDParentFrameInset:RemoveTextures() LFDQueueFrameSpecificListScrollFrame:RemoveTextures() - LFDQueueFrameFindGroupButton:SetButtonTemplate() + LFDQueueFrameFindGroupButton:SetStylePanel("Button") hooksecurefunc("LFDQueueFrameRandom_UpdateFrame", LFDQueueRandom_OnUpdate) PLUGIN:ApplyDropdownStyle(LFDQueueFrameTypeDropDown) @@ -298,7 +304,7 @@ local function LFDFrameStyle() RaidFinderFrameButtonBottomBorder:Hide() PLUGIN:ApplyDropdownStyle(RaidFinderQueueFrameSelectionDropDown) RaidFinderFrameFindRaidButton:RemoveTextures() - RaidFinderFrameFindRaidButton:SetButtonTemplate() + RaidFinderFrameFindRaidButton:SetStylePanel("Button") RaidFinderQueueFrame:RemoveTextures() for u = 1, LFD_MAX_REWARDS do @@ -317,8 +323,8 @@ local function LFDFrameStyle() z:SetSize(118, 39) x:SetAlpha(0) t.border = CreateFrame("Frame", nil, t) - t.border:SetFixedPanelTemplate() - t.border:WrapOuter(icon) + t.border:SetStylePanel("Fixed") + t.border:SetAllPointsOut(icon) icon:SetParent(t.border) y:SetParent(t.border) t.restyled = true @@ -339,7 +345,7 @@ local function LFDFrameStyle() ScenarioFinderFrameInset:GetRegions():Hide() hooksecurefunc("ScenarioQueueFrameRandom_UpdateFrame", ScenarioQueueRandom_OnUpdate) ScenarioQueueFrameFindGroupButton:RemoveTextures() - ScenarioQueueFrameFindGroupButton:SetButtonTemplate() + ScenarioQueueFrameFindGroupButton:SetStylePanel("Button") PLUGIN:ApplyDropdownStyle(ScenarioQueueFrameTypeDropDown) LFRBrowseFrameRoleInset:DisableDrawLayer("BORDER") RaidBrowserFrameBg:Hide() @@ -353,10 +359,10 @@ local function LFDFrameStyle() end end - RaidBrowserFrame:SetPanelTemplate('Pattern') + RaidBrowserFrame:SetStylePanel("Default", 'Pattern') PLUGIN:ApplyCloseButtonStyle(RaidBrowserFrameCloseButton) - LFRQueueFrameFindGroupButton:SetButtonTemplate() - LFRQueueFrameAcceptCommentButton:SetButtonTemplate() + LFRQueueFrameFindGroupButton:SetStylePanel("Button") + LFRQueueFrameAcceptCommentButton:SetStylePanel("Button") PLUGIN:ApplyScrollFrameStyle(LFRQueueFrameCommentScrollFrameScrollBar) PLUGIN:ApplyScrollFrameStyle(LFDQueueFrameSpecificListScrollFrameScrollBar) @@ -368,11 +374,11 @@ local function LFDFrameStyle() local C = _G['LFRParentFrameSideTab'..u] C:DisableDrawLayer('BACKGROUND') C:GetNormalTexture():SetTexCoord(0.1, 0.9, 0.1, 0.9) - C:GetNormalTexture():FillInner() + C:GetNormalTexture():SetAllPointsIn() C.pushed = true; - C:SetPanelTemplate("Default") + C:SetStylePanel("Default", "Default") C.Panel:SetAllPoints() - C:SetPanelTemplate() + C:SetStylePanel("Default") hooksecurefunc(C:GetHighlightTexture(), "SetTexture", function(o, D) if D ~= nil then o:SetTexture(0,0,0,0) @@ -384,36 +390,36 @@ local function LFDFrameStyle() C:DisableDrawLayer('BACKGROUND') end PLUGIN:ApplyDropdownStyle(LFRBrowseFrameRaidDropDown) - LFRBrowseFrameRefreshButton:SetButtonTemplate() - LFRBrowseFrameInviteButton:SetButtonTemplate() - LFRBrowseFrameSendMessageButton:SetButtonTemplate() + LFRBrowseFrameRefreshButton:SetStylePanel("Button") + LFRBrowseFrameInviteButton:SetStylePanel("Button") + LFRBrowseFrameSendMessageButton:SetStylePanel("Button") LFRQueueFrameSpecificListScrollFrameScrollBar.styled = true end end) LFGInvitePopup:RemoveTextures() - LFGInvitePopup:SetPanelTemplate("Pattern", true, 2, 4, 4) - LFGInvitePopupAcceptButton:SetButtonTemplate() - LFGInvitePopupDeclineButton:SetButtonTemplate() - - _G[LFDQueueFrame.PartyBackfill:GetName().."BackfillButton"]:SetButtonTemplate() - _G[LFDQueueFrame.PartyBackfill:GetName().."NoBackfillButton"]:SetButtonTemplate() - _G[RaidFinderQueueFrame.PartyBackfill:GetName().."BackfillButton"]:SetButtonTemplate() - _G[RaidFinderQueueFrame.PartyBackfill:GetName().."NoBackfillButton"]:SetButtonTemplate() - _G[ScenarioQueueFrame.PartyBackfill:GetName().."BackfillButton"]:SetButtonTemplate() - _G[ScenarioQueueFrame.PartyBackfill:GetName().."NoBackfillButton"]:SetButtonTemplate() + LFGInvitePopup:SetStylePanel("Default", "Pattern", true, 2, 4, 4) + LFGInvitePopupAcceptButton:SetStylePanel("Button") + LFGInvitePopupDeclineButton:SetStylePanel("Button") + + _G[LFDQueueFrame.PartyBackfill:GetName().."BackfillButton"]:SetStylePanel("Button") + _G[LFDQueueFrame.PartyBackfill:GetName().."NoBackfillButton"]:SetStylePanel("Button") + _G[RaidFinderQueueFrame.PartyBackfill:GetName().."BackfillButton"]:SetStylePanel("Button") + _G[RaidFinderQueueFrame.PartyBackfill:GetName().."NoBackfillButton"]:SetStylePanel("Button") + _G[ScenarioQueueFrame.PartyBackfill:GetName().."BackfillButton"]:SetStylePanel("Button") + _G[ScenarioQueueFrame.PartyBackfill:GetName().."NoBackfillButton"]:SetStylePanel("Button") PLUGIN:ApplyScrollFrameStyle(LFDQueueFrameRandomScrollFrameScrollBar) PLUGIN:ApplyScrollFrameStyle(ScenarioQueueFrameSpecificScrollFrameScrollBar) - LFDQueueFrameRandomScrollFrame:SetBasicPanel() - ScenarioQueueFrameRandomScrollFrame:SetBasicPanel() - RaidFinderQueueFrameScrollFrame:SetBasicPanel() + LFDQueueFrameRandomScrollFrame:SetStylePanel("Default", 'Transparent') + ScenarioQueueFrameRandomScrollFrame:SetStylePanel("Default", 'Transparent') + RaidFinderQueueFrameScrollFrame:SetStylePanel("Default", 'Transparent') -- for u = 1, NUM_LFD_CHOICE_BUTTONS do -- local box = _G["LFDQueueFrameSpecificListButton"..u.."EnableButton"] -- if(box and (not box.Panel)) then -- box:RemoveTextures() - -- box:SetCheckboxTemplate(true, -2, -3) + -- box:SetStylePanel("Checkbox", true, -2, -3) -- box:SetFrameLevel(box:GetFrameLevel() + 50) -- end -- end @@ -422,16 +428,16 @@ local function LFDFrameStyle() -- local box = _G["LFRQueueFrameSpecificListButton"..u.."EnableButton"] -- if(box and (not box.Panel)) then -- box:RemoveTextures() - -- box:SetCheckboxTemplate(true, -2, -3) + -- box:SetStylePanel("Checkbox", true, -2, -3) -- box:SetFrameLevel(box:GetFrameLevel() + 50) -- end -- end LFGListFrame.CategorySelection:RemoveTextures() LFGListFrame.CategorySelection.StartGroupButton:RemoveTextures() - LFGListFrame.CategorySelection.StartGroupButton:SetButtonTemplate() + LFGListFrame.CategorySelection.StartGroupButton:SetStylePanel("Button") LFGListFrame.CategorySelection.FindGroupButton:RemoveTextures() - LFGListFrame.CategorySelection.FindGroupButton:SetButtonTemplate() + LFGListFrame.CategorySelection.FindGroupButton:SetStylePanel("Button") end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/loothistory.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/loothistory.lua index 96cf282..6ef01a7 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/loothistory.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/loothistory.lua @@ -58,8 +58,8 @@ local LootHistoryFrame_OnUpdate = function(self) frame.Icon:SetTexture(Icon) frame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - frame:SetFixedPanelTemplate("Button") - frame.Panel:WrapOuter(frame.Icon) + frame:SetStylePanel("Fixed", "Button") + frame.Panel:SetAllPointsOut(frame.Icon) frame.Icon:SetParent(frame.Panel) frame.isStyled = true @@ -78,8 +78,8 @@ local _hook_MasterLootFrame_OnShow = function() item:RemoveTextures() icon:SetTexture(tex) icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - item:SetPanelTemplate("Pattern") - item.Panel:WrapOuter(icon) + item:SetStylePanel("Default", "Pattern") + item.Panel:SetAllPointsOut(icon) item:SetBackdropBorderColor(colors.r, colors.g, colors.b) end for i = 1, MasterLooterFrame:GetNumChildren()do @@ -89,8 +89,8 @@ local _hook_MasterLootFrame_OnShow = function() if child:GetPushedTexture() then PLUGIN:ApplyCloseButtonStyle(child) else - child:SetFixedPanelTemplate() - child:SetButtonTemplate() + child:SetStylePanel("Fixed") + child:SetStylePanel("Button") end child.isStyled = true end @@ -114,24 +114,24 @@ local function LootHistoryStyle() LootHistoryFrame:SetFrameStrata('HIGH') MissingLootFrame:RemoveTextures() - MissingLootFrame:SetPanelTemplate("Pattern") + MissingLootFrame:SetStylePanel("Default", "Pattern") PLUGIN:ApplyCloseButtonStyle(MissingLootFramePassButton) hooksecurefunc("MissingLootFrame_Show", MissingLootFrame_OnShow) LootHistoryFrame:RemoveTextures() PLUGIN:ApplyCloseButtonStyle(LootHistoryFrame.CloseButton) LootHistoryFrame:RemoveTextures() - LootHistoryFrame:SetFixedPanelTemplate('Transparent') + LootHistoryFrame:SetStylePanel("Fixed", 'Transparent') PLUGIN:ApplyCloseButtonStyle(LootHistoryFrame.ResizeButton) - LootHistoryFrame.ResizeButton:SetFixedPanelTemplate() - LootHistoryFrame.ResizeButton:Width(LootHistoryFrame:GetWidth()) - LootHistoryFrame.ResizeButton:Height(19) + LootHistoryFrame.ResizeButton:SetStylePanel("Fixed") + LootHistoryFrame.ResizeButton:SetWidthToScale(LootHistoryFrame:GetWidth()) + LootHistoryFrame.ResizeButton:SetHeightToScale(19) LootHistoryFrame.ResizeButton:ClearAllPoints() - LootHistoryFrame.ResizeButton:Point("TOP", LootHistoryFrame, "BOTTOM", 0, -2) + LootHistoryFrame.ResizeButton:SetPointToScale("TOP", LootHistoryFrame, "BOTTOM", 0, -2) LootHistoryFrame.ResizeButton:SetNormalTexture("") local txt = LootHistoryFrame.ResizeButton:CreateFontString(nil,"OVERLAY") - txt:SetFont(SV.Media.font.roboto, 14, "NONE") + txt:SetFont(SV.Media.font.default, 14, "NONE") txt:SetAllPoints(LootHistoryFrame.ResizeButton) txt:SetJustifyH("CENTER") txt:SetText("RESIZE") @@ -141,7 +141,7 @@ local function LootHistoryStyle() hooksecurefunc("LootHistoryFrame_FullUpdate", LootHistoryFrame_OnUpdate) MasterLooterFrame:RemoveTextures() - MasterLooterFrame:SetFixedPanelTemplate() + MasterLooterFrame:SetStylePanel("Fixed") MasterLooterFrame:SetFrameStrata('FULLSCREEN_DIALOG') hooksecurefunc("MasterLooterFrame_Show", _hook_MasterLootFrame_OnShow) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lossofcontrol.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lossofcontrol.lua index 532dfb5..98c7cd7 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lossofcontrol.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lossofcontrol.lua @@ -41,7 +41,7 @@ local _hook_LossOfControl = function(self, ...) self.TimeLeft.SecondsText:ClearAllPoints() self.TimeLeft.SecondsText:SetPoint("BOTTOM", self, 0, -80) self.TimeLeft.SecondsText.scrollTime = nil; - self.TimeLeft.SecondsText:SetFont(SV.Media.font.roboto, 20, 'OUTLINE') + self.TimeLeft.SecondsText:SetFont(SV.Media.font.default, 20, 'OUTLINE') if self.Anim:IsPlaying() then self.Anim:Stop() end @@ -50,13 +50,13 @@ end local function LossOfControlStyle() if PLUGIN.db.blizzard.enable ~= true or PLUGIN.db.blizzard.losscontrol ~= true then return end local IconBackdrop = CreateFrame("Frame", nil, LossOfControlFrame) - IconBackdrop:WrapOuter(LossOfControlFrame.Icon) + IconBackdrop:SetAllPointsOut(LossOfControlFrame.Icon) IconBackdrop:SetFrameLevel(LossOfControlFrame:GetFrameLevel()-1) - IconBackdrop:SetPanelTemplate("Slot") + IconBackdrop:SetStylePanel("Default", "Slot") LossOfControlFrame.Icon:SetTexCoord(.1, .9, .1, .9) LossOfControlFrame:RemoveTextures() LossOfControlFrame.AbilityName:ClearAllPoints() - LossOfControlFrame:Size(LossOfControlFrame.Icon:GetWidth() + 50) + LossOfControlFrame:SetSizeToScale(LossOfControlFrame.Icon:GetWidth() + 50) --local bg = CreateFrame("Frame", nil, LossOfControlFrame) hooksecurefunc("LossOfControlFrame_SetUpDisplay", _hook_LossOfControl) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/macro.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/macro.lua index e2dce85..0acae62 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/macro.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/macro.lua @@ -48,7 +48,7 @@ local function MacroUIStyle() PLUGIN:ApplyScrollFrameStyle(MacroFrameScrollFrameScrollBar) PLUGIN:ApplyScrollFrameStyle(MacroPopupScrollFrameScrollBar) - MacroFrame:Width(360) + MacroFrame:SetWidthToScale(360) local parentStrata = MacroFrame:GetFrameStrata() local parentLevel = MacroFrame:GetFrameLevel() @@ -59,7 +59,7 @@ local function MacroUIStyle() button:SetFrameStrata(parentStrata) button:SetFrameLevel(parentLevel + 1) button:RemoveTextures() - button:SetButtonTemplate(false, 1, 1, 1) + button:SetStylePanel("Button", false, 1, 1, 1) end end @@ -75,28 +75,28 @@ local function MacroUIStyle() for i = 1, 2 do local tab = _G[("MacroFrameTab%d"):format(i)] if(tab) then - tab:Height(22) + tab:SetHeightToScale(22) if(i == 1) then - tab:Point("TOPLEFT", MacroFrame, "TOPLEFT", 85, -39) + tab:SetPointToScale("TOPLEFT", MacroFrame, "TOPLEFT", 85, -39) firstTab = tab elseif(firstTab) then - tab:Point("LEFT", firstTab, "RIGHT", 4, 0) + tab:SetPointToScale("LEFT", firstTab, "RIGHT", 4, 0) end end end - MacroFrameText:SetFont(SV.Media.font.roboto, 10, "OUTLINE") + MacroFrameText:SetFont(SV.Media.font.default, 10, "OUTLINE") MacroFrameTextBackground:RemoveTextures() - MacroFrameTextBackground:SetBasicPanel() + MacroFrameTextBackground:SetStylePanel("Default", 'Transparent') MacroPopupFrame:RemoveTextures() - MacroPopupFrame:SetBasicPanel() + MacroPopupFrame:SetStylePanel("Default", 'Transparent') MacroPopupScrollFrame:RemoveTextures() - MacroPopupScrollFrame:SetPanelTemplate("Pattern") - MacroPopupScrollFrame.Panel:Point("TOPLEFT", 51, 2) - MacroPopupScrollFrame.Panel:Point("BOTTOMRIGHT", -4, 4) - MacroPopupEditBox:SetEditboxTemplate() + MacroPopupScrollFrame:SetStylePanel("Default", "Pattern") + MacroPopupScrollFrame.Panel:SetPointToScale("TOPLEFT", 51, 2) + MacroPopupScrollFrame.Panel:SetPointToScale("BOTTOMRIGHT", -4, 4) + MacroPopupEditBox:SetStylePanel("Editbox") MacroPopupNameLeft:SetTexture(0,0,0,0) MacroPopupNameMiddle:SetTexture(0,0,0,0) MacroPopupNameRight:SetTexture(0,0,0,0) @@ -105,48 +105,48 @@ local function MacroUIStyle() MacroButtonContainer:RemoveTextures() PLUGIN:ApplyScrollFrameStyle(MacroButtonScrollFrame) - MacroButtonScrollFrame:SetFixedPanelTemplate("Inset") + MacroButtonScrollFrame:SetStylePanel("Fixed", "Inset") MacroPopupFrame:HookScript("OnShow", function(c) c:ClearAllPoints() - c:Point("TOPLEFT", MacroFrame, "TOPRIGHT", 5, -2) + c:SetPointToScale("TOPLEFT", MacroFrame, "TOPRIGHT", 5, -2) end) MacroFrameSelectedMacroButton:SetFrameStrata(parentStrata) MacroFrameSelectedMacroButton:SetFrameLevel(parentLevel + 1) MacroFrameSelectedMacroButton:RemoveTextures() - MacroFrameSelectedMacroButton:SetSlotTemplate(true) + MacroFrameSelectedMacroButton:SetStylePanel("Slot", true) MacroFrameSelectedMacroButtonIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - MacroFrameSelectedMacroButtonIcon:FillInner() + MacroFrameSelectedMacroButtonIcon:SetAllPointsIn() MacroEditButton:ClearAllPoints() - MacroEditButton:Point("BOTTOMLEFT", MacroFrameSelectedMacroButton.Panel, "BOTTOMRIGHT", 10, 0) + MacroEditButton:SetPointToScale("BOTTOMLEFT", MacroFrameSelectedMacroButton.Panel, "BOTTOMRIGHT", 10, 0) MacroFrameCharLimitText:ClearAllPoints() - MacroFrameCharLimitText:Point("BOTTOM", MacroFrameTextBackground, -25, -35) + MacroFrameCharLimitText:SetPointToScale("BOTTOM", MacroFrameTextBackground, -25, -35) for i = 1, MAX_ACCOUNT_MACROS do local button = _G["MacroButton"..i] if(button) then button:RemoveTextures() - button:SetSlotTemplate() + button:SetStylePanel("Slot") local icon = _G["MacroButton"..i.."Icon"] if(icon) then icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - icon:FillInner() + icon:SetAllPointsIn() icon:SetDrawLayer("OVERLAY") end local popup = _G["MacroPopupButton"..i] if(popup) then popup:RemoveTextures() - popup:SetButtonTemplate() + popup:SetStylePanel("Button") popup:SetBackdropColor(0, 0, 0, 0) local popupIcon = _G["MacroPopupButton"..i.."Icon"] if(popupIcon) then - popupIcon:FillInner() + popupIcon:SetAllPointsIn() popupIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/mailbox.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/mailbox.lua index 4ed6ebc..80d2ac8 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/mailbox.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/mailbox.lua @@ -31,14 +31,14 @@ local function MailFrame_OnUpdate() for b = 1, ATTACHMENTS_MAX_SEND do local d = _G["SendMailAttachment"..b] if not d.styled then - d:RemoveTextures()d:SetFixedPanelTemplate("Default") - d:SetButtonTemplate() + d:RemoveTextures()d:SetStylePanel("Fixed", "Default") + d:SetStylePanel("Button") d.styled = true end local e = d:GetNormalTexture() if e then e:SetTexCoord(0.1, 0.9, 0.1, 0.9) - e:FillInner() + e:SetAllPointsIn() end end end @@ -55,15 +55,15 @@ local function MailBoxStyle() for b = 1, INBOXITEMS_TO_DISPLAY do local i = _G["MailItem"..b] i:RemoveTextures() - i:SetPanelTemplate("Inset") - i.Panel:Point("TOPLEFT", 2, 1) - i.Panel:Point("BOTTOMRIGHT", -2, 2) + i:SetStylePanel("Default", "Inset") + i.Panel:SetPointToScale("TOPLEFT", 2, 1) + i.Panel:SetPointToScale("BOTTOMRIGHT", -2, 2) local d = _G["MailItem"..b.."Button"] d:RemoveTextures() - d:SetButtonTemplate() + d:SetStylePanel("Button") local e = _G["MailItem"..b.."ButtonIcon"] e:SetTexCoord(0.1, 0.9, 0.1, 0.9) - e:FillInner() + e:SetAllPointsIn() end PLUGIN:ApplyCloseButtonStyle(MailFrameCloseButton) PLUGIN:ApplyPaginationStyle(InboxPrevPageButton) @@ -73,73 +73,73 @@ local function MailBoxStyle() PLUGIN:ApplyTabStyle(MailFrameTab1) PLUGIN:ApplyTabStyle(MailFrameTab2) SendMailScrollFrame:RemoveTextures(true) - SendMailScrollFrame:SetFixedPanelTemplate("Inset") + SendMailScrollFrame:SetStylePanel("Fixed", "Inset") PLUGIN:ApplyScrollFrameStyle(SendMailScrollFrameScrollBar) - SendMailNameEditBox:SetEditboxTemplate() - SendMailSubjectEditBox:SetEditboxTemplate() - SendMailMoneyGold:SetEditboxTemplate() - SendMailMoneySilver:SetEditboxTemplate() - SendMailMoneyCopper:SetEditboxTemplate() + SendMailNameEditBox:SetStylePanel("Editbox") + SendMailSubjectEditBox:SetStylePanel("Editbox") + SendMailMoneyGold:SetStylePanel("Editbox") + SendMailMoneySilver:SetStylePanel("Editbox") + SendMailMoneyCopper:SetStylePanel("Editbox") SendMailMoneyBg:Die() SendMailMoneyInset:RemoveTextures() - _G["SendMailMoneySilver"]:SetEditboxTemplate() - _G["SendMailMoneySilver"].Panel:Point("TOPLEFT", -2, 1) - _G["SendMailMoneySilver"].Panel:Point("BOTTOMRIGHT", -12, -1) + _G["SendMailMoneySilver"]:SetStylePanel("Editbox") + _G["SendMailMoneySilver"].Panel:SetPointToScale("TOPLEFT", -2, 1) + _G["SendMailMoneySilver"].Panel:SetPointToScale("BOTTOMRIGHT", -12, -1) _G["SendMailMoneySilver"]:SetTextInsets(-1, -1, -2, -2) - _G["SendMailMoneyCopper"]:SetEditboxTemplate() - _G["SendMailMoneyCopper"].Panel:Point("TOPLEFT", -2, 1) - _G["SendMailMoneyCopper"].Panel:Point("BOTTOMRIGHT", -12, -1) + _G["SendMailMoneyCopper"]:SetStylePanel("Editbox") + _G["SendMailMoneyCopper"].Panel:SetPointToScale("TOPLEFT", -2, 1) + _G["SendMailMoneyCopper"].Panel:SetPointToScale("BOTTOMRIGHT", -12, -1) _G["SendMailMoneyCopper"]:SetTextInsets(-1, -1, -2, -2) - SendMailNameEditBox.Panel:Point("BOTTOMRIGHT", 2, 4) - SendMailSubjectEditBox.Panel:Point("BOTTOMRIGHT", 2, 0) + SendMailNameEditBox.Panel:SetPointToScale("BOTTOMRIGHT", 2, 4) + SendMailSubjectEditBox.Panel:SetPointToScale("BOTTOMRIGHT", 2, 0) SendMailFrame:RemoveTextures() hooksecurefunc("SendMailFrame_Update", MailFrame_OnUpdate) - SendMailMailButton:SetButtonTemplate() - SendMailCancelButton:SetButtonTemplate() + SendMailMailButton:SetStylePanel("Button") + SendMailCancelButton:SetStylePanel("Button") OpenMailFrame:RemoveTextures(true) - OpenMailFrame:SetFixedPanelTemplate("Transparent", true) + OpenMailFrame:SetStylePanel("Fixed", "Transparent", true) OpenMailFrameInset:Die() PLUGIN:ApplyCloseButtonStyle(OpenMailFrameCloseButton) - OpenMailReportSpamButton:SetButtonTemplate() - OpenMailReplyButton:SetButtonTemplate() - OpenMailDeleteButton:SetButtonTemplate() - OpenMailCancelButton:SetButtonTemplate() + OpenMailReportSpamButton:SetStylePanel("Button") + OpenMailReplyButton:SetStylePanel("Button") + OpenMailDeleteButton:SetStylePanel("Button") + OpenMailCancelButton:SetStylePanel("Button") InboxFrame:RemoveTextures() MailFrameInset:Die() OpenMailScrollFrame:RemoveTextures(true) - OpenMailScrollFrame:SetFixedPanelTemplate("Default") + OpenMailScrollFrame:SetStylePanel("Fixed", "Default") PLUGIN:ApplyScrollFrameStyle(OpenMailScrollFrameScrollBar) SendMailBodyEditBox:SetTextColor(1, 1, 1) OpenMailBodyText:SetTextColor(1, 1, 1) InvoiceTextFontNormal:SetTextColor(1, 1, 1) OpenMailArithmeticLine:Die() OpenMailLetterButton:RemoveTextures() - OpenMailLetterButton:SetFixedPanelTemplate("Default") - OpenMailLetterButton:SetButtonTemplate() + OpenMailLetterButton:SetStylePanel("Fixed", "Default") + OpenMailLetterButton:SetStylePanel("Button") OpenMailLetterButtonIconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) - OpenMailLetterButtonIconTexture:FillInner() + OpenMailLetterButtonIconTexture:SetAllPointsIn() OpenMailMoneyButton:RemoveTextures() - OpenMailMoneyButton:SetFixedPanelTemplate("Default") - OpenMailMoneyButton:SetButtonTemplate() + OpenMailMoneyButton:SetStylePanel("Fixed", "Default") + OpenMailMoneyButton:SetStylePanel("Button") OpenMailMoneyButtonIconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) - OpenMailMoneyButtonIconTexture:FillInner() + OpenMailMoneyButtonIconTexture:SetAllPointsIn() for b = 1, ATTACHMENTS_MAX_SEND do local d = _G["OpenMailAttachmentButton"..b] d:RemoveTextures() - d:SetButtonTemplate() + d:SetStylePanel("Button") local e = _G["OpenMailAttachmentButton"..b.."IconTexture"] if e then e:SetTexCoord(0.1, 0.9, 0.1, 0.9) - e:FillInner() + e:SetAllPointsIn() end end - OpenMailReplyButton:Point("RIGHT", OpenMailDeleteButton, "LEFT", -2, 0) - OpenMailDeleteButton:Point("RIGHT", OpenMailCancelButton, "LEFT", -2, 0) - SendMailMailButton:Point("RIGHT", SendMailCancelButton, "LEFT", -2, 0) + OpenMailReplyButton:SetPointToScale("RIGHT", OpenMailDeleteButton, "LEFT", -2, 0) + OpenMailDeleteButton:SetPointToScale("RIGHT", OpenMailCancelButton, "LEFT", -2, 0) + SendMailMailButton:SetPointToScale("RIGHT", SendMailCancelButton, "LEFT", -2, 0) end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/merchant.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/merchant.lua index 95a6525..6edfb2c 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/merchant.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/merchant.lua @@ -30,7 +30,7 @@ FRAME PLUGINR local function MerchantStyle() if PLUGIN.db.blizzard.enable ~= true or PLUGIN.db.blizzard.merchant ~= true then return end MerchantFrame:RemoveTextures(true) - MerchantFrame:SetPanelTemplate("Halftone", false, nil, 2, 4) + MerchantFrame:SetStylePanel("Default", "Halftone", false, nil, 2, 4) local level = MerchantFrame:GetFrameLevel() if(level > 0) then MerchantFrame:SetFrameLevel(level - 1) @@ -38,16 +38,16 @@ local function MerchantStyle() MerchantFrame:SetFrameLevel(0) end MerchantBuyBackItem:RemoveTextures(true) - MerchantBuyBackItem:SetPanelTemplate("Inset", true, 2, 2, 3) + MerchantBuyBackItem:SetStylePanel("Default", "Inset", true, 2, 2, 3) MerchantBuyBackItem.Panel:SetFrameLevel(MerchantBuyBackItem.Panel:GetFrameLevel() + 1) MerchantBuyBackItemItemButton:RemoveTextures() - MerchantBuyBackItemItemButton:SetButtonTemplate() + MerchantBuyBackItemItemButton:SetStylePanel("Button") MerchantExtraCurrencyInset:RemoveTextures() MerchantExtraCurrencyBg:RemoveTextures() MerchantFrameInset:RemoveTextures() MerchantMoneyBg:RemoveTextures() MerchantMoneyInset:RemoveTextures() - MerchantFrameInset:SetPanelTemplate("Inset") + MerchantFrameInset:SetStylePanel("Default", "Inset") MerchantFrameInset.Panel:SetFrameLevel(MerchantFrameInset.Panel:GetFrameLevel() + 1) PLUGIN:ApplyDropdownStyle(MerchantFrameLootFilter) for b = 1, 2 do @@ -57,33 +57,33 @@ local function MerchantStyle() local d = _G["MerchantItem"..b.."ItemButton"] local e = _G["MerchantItem"..b.."ItemButtonIconTexture"] local o = _G["MerchantItem"..b]o:RemoveTextures(true) - o:SetFixedPanelTemplate("Inset") + o:SetStylePanel("Fixed", "Inset") d:RemoveTextures() - d:SetButtonTemplate() - d:Point("TOPLEFT", o, "TOPLEFT", 4, -4) + d:SetStylePanel("Button") + d:SetPointToScale("TOPLEFT", o, "TOPLEFT", 4, -4) e:SetTexCoord(0.1, 0.9, 0.1, 0.9) - e:FillInner() + e:SetAllPointsIn() _G["MerchantItem"..b.."MoneyFrame"]:ClearAllPoints() - _G["MerchantItem"..b.."MoneyFrame"]:Point("BOTTOMLEFT", d, "BOTTOMRIGHT", 3, 0) + _G["MerchantItem"..b.."MoneyFrame"]:SetPointToScale("BOTTOMLEFT", d, "BOTTOMRIGHT", 3, 0) end MerchantBuyBackItemItemButton:RemoveTextures() - MerchantBuyBackItemItemButton:SetButtonTemplate() + MerchantBuyBackItemItemButton:SetStylePanel("Button") MerchantBuyBackItemItemButtonIconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) - MerchantBuyBackItemItemButtonIconTexture:FillInner() - MerchantRepairItemButton:SetButtonTemplate() + MerchantBuyBackItemItemButtonIconTexture:SetAllPointsIn() + MerchantRepairItemButton:SetStylePanel("Button") for b = 1, MerchantRepairItemButton:GetNumRegions()do local p = select(b, MerchantRepairItemButton:GetRegions()) if p:GetObjectType() == "Texture"then p:SetTexCoord(0.04, 0.24, 0.06, 0.5) - p:FillInner() + p:SetAllPointsIn() end - end MerchantGuildBankRepairButton:SetButtonTemplate() + end MerchantGuildBankRepairButton:SetStylePanel("Button") MerchantGuildBankRepairButtonIcon:SetTexCoord(0.61, 0.82, 0.1, 0.52) - MerchantGuildBankRepairButtonIcon:FillInner() - MerchantRepairAllButton:SetButtonTemplate() + MerchantGuildBankRepairButtonIcon:SetAllPointsIn() + MerchantRepairAllButton:SetStylePanel("Button") MerchantRepairAllIcon:SetTexCoord(0.34, 0.1, 0.34, 0.535, 0.535, 0.1, 0.535, 0.535) - MerchantRepairAllIcon:FillInner() - MerchantFrame:Width(360) + MerchantRepairAllIcon:SetAllPointsIn() + MerchantFrame:SetWidthToScale(360) PLUGIN:ApplyCloseButtonStyle(MerchantFrameCloseButton, MerchantFrame.Panel) PLUGIN:ApplyPaginationStyle(MerchantNextPageButton) PLUGIN:ApplyPaginationStyle(MerchantPrevPageButton) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petbattle.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petbattle.lua index ce62eb9..30d03ad 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petbattle.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petbattle.lua @@ -36,15 +36,15 @@ local PetBattleActionBar = CreateFrame("Frame", "SVUI_PetBattleActionBar", UIPar local ITEM_QUALITY_COLORS = _G.ITEM_QUALITY_COLORS; local function PetBattleButtonHelper(frame) - frame:SetPanelTemplate("Blackout") + frame:SetStylePanel("Default", "Blackout") frame:SetNormalTexture("") frame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) frame.Icon:SetDrawLayer('BORDER') frame.Icon:SetParent(frame.Panel) if(frame.SelectedHighlight) then frame.SelectedHighlight:SetAlpha(0) end if(frame.checked) then frame.checked = true end - if(frame.pushed) then frame.pushed:FillInner(frame.Panel) end - if(frame.hover) then frame.hover:FillInner(frame.Panel) end + if(frame.pushed) then frame.pushed:SetAllPointsIn(frame.Panel) end + if(frame.hover) then frame.hover:SetAllPointsIn(frame.Panel) end frame:SetFrameStrata('LOW') end @@ -99,8 +99,8 @@ local _hook_AuraHolderUpdate = function(self) local frame = self.frames[nextFrame] frame.DebuffBorder:Hide() if not frame.isStyled then - frame:SetSlotTemplate(true, 2, -8,-2) - frame.Icon:FillInner(frame.Panel, 2, 2) + frame:SetStylePanel("Slot", true, 2, -8,-2) + frame.Icon:SetAllPointsIn(frame.Panel, 2, 2) frame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) frame.isStyled = true end @@ -223,50 +223,50 @@ local function PetBattleStyle() frame.IconBackdrop = CreateFrame("Frame", nil, frame) frame.IconBackdrop:SetFrameLevel(0) frame.IconBackdrop:SetAllPoints(frame.Icon) - frame.IconBackdrop:SetSlotTemplate(true, 1, 0, 0, 0.5); + frame.IconBackdrop:SetStylePanel("Slot", true, 1, 0, 0, 0.5); - frame.IconBackdrop.Panel:SetFixedPanelTemplate("Blackout") + frame.IconBackdrop.Panel:SetStylePanel("Fixed", "Blackout") frame.BorderFlash:Die() frame.HealthBarBG:Die() frame.HealthBarFrame:Die() frame.HealthBarBackdrop = CreateFrame("Frame", nil, frame) frame.HealthBarBackdrop:SetFrameLevel(frame:GetFrameLevel()-1) - frame.HealthBarBackdrop:SetFixedPanelTemplate("Blackout") - frame.HealthBarBackdrop:Width(frame.healthBarWidth+(2)) + frame.HealthBarBackdrop:SetStylePanel("Fixed", "Blackout") + frame.HealthBarBackdrop:SetWidthToScale(frame.healthBarWidth+(2)) frame.ActualHealthBar:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) frame.PetTypeFrame = CreateFrame("Frame", nil, frame) - frame.PetTypeFrame:Size(100, 23) + frame.PetTypeFrame:SetSizeToScale(100, 23) frame.PetTypeFrame.text = frame.PetTypeFrame:CreateFontString(nil, 'OVERLAY') - frame.PetTypeFrame.text:SetFont(SV.Media.font.roboto, 12, "OUTLINE") + frame.PetTypeFrame.text:SetFont(SV.Media.font.default, 12, "OUTLINE") frame.PetTypeFrame.text:SetText("") frame.ActualHealthBar:ClearAllPoints() frame.Name:SetFontObject(SystemFont_Shadow_Outline_Huge2) frame.Name:ClearAllPoints() frame.FirstAttack = frame:CreateTexture(nil, "ARTWORK") - frame.FirstAttack:Size(30) + frame.FirstAttack:SetSizeToScale(30) frame.FirstAttack:SetTexture("Interface\\PetBattles\\PetBattle-StatIcons") if i == 1 then - frame.HealthBarBackdrop:Point('TOPLEFT', frame.ActualHealthBar, 'TOPLEFT', -1, 1) - frame.HealthBarBackdrop:Point('BOTTOMLEFT', frame.ActualHealthBar, 'BOTTOMLEFT', -1, -1) + frame.HealthBarBackdrop:SetPointToScale('TOPLEFT', frame.ActualHealthBar, 'TOPLEFT', -1, 1) + frame.HealthBarBackdrop:SetPointToScale('BOTTOMLEFT', frame.ActualHealthBar, 'BOTTOMLEFT', -1, -1) frame.ActualHealthBar:SetVertexColor(171/255, 214/255, 116/255) PetBattleFrame.Ally2.iconPoint = frame.IconBackdrop; PetBattleFrame.Ally3.iconPoint = frame.IconBackdrop; - frame.ActualHealthBar:Point('BOTTOMLEFT', frame.Icon, 'BOTTOMRIGHT', 10, 0) - frame.Name:Point('BOTTOMLEFT', frame.ActualHealthBar, 'TOPLEFT', 0, 8) + frame.ActualHealthBar:SetPointToScale('BOTTOMLEFT', frame.Icon, 'BOTTOMRIGHT', 10, 0) + frame.Name:SetPointToScale('BOTTOMLEFT', frame.ActualHealthBar, 'TOPLEFT', 0, 8) frame.PetTypeFrame:SetPoint("BOTTOMRIGHT", frame.HealthBarBackdrop, "TOPRIGHT", 0, 4) frame.PetTypeFrame.text:SetPoint("RIGHT") frame.FirstAttack:SetPoint("LEFT", frame.HealthBarBackdrop, "RIGHT", 5, 0) frame.FirstAttack:SetTexCoord(frame.SpeedIcon:GetTexCoord()) frame.FirstAttack:SetVertexColor(.1, .1, .1, 1) else - frame.HealthBarBackdrop:Point('TOPRIGHT', frame.ActualHealthBar, 'TOPRIGHT', 1, 1) - frame.HealthBarBackdrop:Point('BOTTOMRIGHT', frame.ActualHealthBar, 'BOTTOMRIGHT', 1, -1) + frame.HealthBarBackdrop:SetPointToScale('TOPRIGHT', frame.ActualHealthBar, 'TOPRIGHT', 1, 1) + frame.HealthBarBackdrop:SetPointToScale('BOTTOMRIGHT', frame.ActualHealthBar, 'BOTTOMRIGHT', 1, -1) frame.ActualHealthBar:SetVertexColor(196/255, 30/255, 60/255) PetBattleFrame.Enemy2.iconPoint = frame.IconBackdrop; PetBattleFrame.Enemy3.iconPoint = frame.IconBackdrop; - frame.ActualHealthBar:Point('BOTTOMRIGHT', frame.Icon, 'BOTTOMLEFT', -10, 0) - frame.Name:Point('BOTTOMRIGHT', frame.ActualHealthBar, 'TOPRIGHT', 0, 8) + frame.ActualHealthBar:SetPointToScale('BOTTOMRIGHT', frame.Icon, 'BOTTOMLEFT', -10, 0) + frame.Name:SetPointToScale('BOTTOMRIGHT', frame.ActualHealthBar, 'TOPRIGHT', 0, 8) frame.PetTypeFrame:SetPoint("BOTTOMLEFT", frame.HealthBarBackdrop, "TOPLEFT", 2, 4) frame.PetTypeFrame.text:SetPoint("LEFT") frame.FirstAttack:SetPoint("RIGHT", frame.HealthBarBackdrop, "LEFT", -5, 0) @@ -282,7 +282,7 @@ local function PetBattleStyle() frame.LevelUnderlay:SetAlpha(0) frame.Level:SetFontObject(NumberFont_Outline_Huge) frame.Level:ClearAllPoints() - frame.Level:Point('BOTTOMLEFT', frame.Icon, 'BOTTOMLEFT', -2, -2) + frame.Level:SetPointToScale('BOTTOMLEFT', frame.Icon, 'BOTTOMLEFT', -2, -2) if frame.SpeedIcon then frame.SpeedIcon:ClearAllPoints() frame.SpeedIcon:SetPoint("CENTER") @@ -298,14 +298,14 @@ local function PetBattleStyle() frame.BorderAlive:SetAlpha(0) frame.HealthBarBG:SetAlpha(0) frame.HealthDivider:SetAlpha(0) - frame:Size(40) + frame:SetSizeToScale(40) frame.IconBackdrop = CreateFrame("Frame", nil, frame) frame.IconBackdrop:SetFrameLevel(0) frame.IconBackdrop:SetAllPoints(frame) - frame.IconBackdrop:SetSlotTemplate(true, 1, 0, 0, 0.5); + frame.IconBackdrop:SetStylePanel("Slot", true, 1, 0, 0, 0.5); - frame.IconBackdrop.Panel:SetFixedPanelTemplate("Blackout") + frame.IconBackdrop.Panel:SetStylePanel("Fixed", "Blackout") frame:ClearAllPoints() frame.healthBarWidth = 40; @@ -314,10 +314,10 @@ local function PetBattleStyle() frame.ActualHealthBar:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) frame.HealthBarBackdrop = CreateFrame("Frame", nil, frame) frame.HealthBarBackdrop:SetFrameLevel(frame:GetFrameLevel()-1) - frame.HealthBarBackdrop:SetFixedPanelTemplate("Blackout") - frame.HealthBarBackdrop:Width(frame.healthBarWidth+2) - frame.HealthBarBackdrop:Point('TOPLEFT', frame.ActualHealthBar, 'TOPLEFT', -1, 1) - frame.HealthBarBackdrop:Point('BOTTOMLEFT', frame.ActualHealthBar, 'BOTTOMLEFT', -1, -1) + frame.HealthBarBackdrop:SetStylePanel("Fixed", "Blackout") + frame.HealthBarBackdrop:SetWidthToScale(frame.healthBarWidth+2) + frame.HealthBarBackdrop:SetPointToScale('TOPLEFT', frame.ActualHealthBar, 'TOPLEFT', -1, 1) + frame.HealthBarBackdrop:SetPointToScale('BOTTOMLEFT', frame.ActualHealthBar, 'BOTTOMLEFT', -1, -1) frame.hasTempBG = true end end @@ -327,7 +327,7 @@ local function PetBattleStyle() PetBattleActionBar:EnableMouse(true) PetBattleActionBar:SetFrameLevel(0) PetBattleActionBar:SetFrameStrata('BACKGROUND') - PetBattleActionBar:SetFixedPanelTemplate("Blackout") + PetBattleActionBar:SetStylePanel("Fixed", "Blackout") local SVUI_DockBottomCenter = _G.SVUI_DockBottomCenter; if(SVUI_DockBottomCenter) then @@ -349,11 +349,11 @@ local function PetBattleStyle() BottomFrame.TurnTimer.SkipButton:ClearAllPoints() BottomFrame.TurnTimer.SkipButton:SetParent(PetBattleActionBar) - BottomFrame.TurnTimer.SkipButton:Size((PBAB_WIDTH * 0.2) - 4, 18) + BottomFrame.TurnTimer.SkipButton:SetSizeToScale((PBAB_WIDTH * 0.2) - 4, 18) BottomFrame.TurnTimer.SkipButton:SetPoint("BOTTOMLEFT", PetBattleActionBar.Panel, "TOPLEFT", 2, 2) - BottomFrame.TurnTimer.SkipButton:SetButtonTemplate() + BottomFrame.TurnTimer.SkipButton:SetStylePanel("Button") - BottomFrame.TurnTimer:Size(BottomFrame.TurnTimer.SkipButton:GetWidth(), BottomFrame.TurnTimer.SkipButton:GetHeight()) + BottomFrame.TurnTimer:SetSizeToScale(BottomFrame.TurnTimer.SkipButton:GetWidth(), BottomFrame.TurnTimer.SkipButton:GetHeight()) BottomFrame.TurnTimer:ClearAllPoints() BottomFrame.TurnTimer:SetPoint("TOP", SV.Screen, "TOP", 0, -140) BottomFrame.TurnTimer.TimerText:SetPoint("CENTER") @@ -365,9 +365,9 @@ local function PetBattleStyle() BottomFrame.xpBar:ClearAllPoints() BottomFrame.xpBar:RemoveTextures() BottomFrame.xpBar:SetParent(PetBattleActionBar) - BottomFrame.xpBar:Size((PBAB_WIDTH * 0.8) - 4, 16) + BottomFrame.xpBar:SetSizeToScale((PBAB_WIDTH * 0.8) - 4, 16) BottomFrame.xpBar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) - BottomFrame.xpBar:SetPanelTemplate("Bar") + BottomFrame.xpBar:SetStylePanel("Default", "Bar") BottomFrame.xpBar:SetPoint("BOTTOMRIGHT", PetBattleActionBar.Panel, "TOPRIGHT", -3, 3) BottomFrame.xpBar:SetScript("OnShow", function(self) self:RemoveTextures() @@ -392,9 +392,9 @@ local function PetBattleStyle() local PetBattleQueueReadyFrame = _G.PetBattleQueueReadyFrame; PetBattleQueueReadyFrame:RemoveTextures() - PetBattleQueueReadyFrame:SetBasicPanel() - PetBattleQueueReadyFrame.AcceptButton:SetButtonTemplate() - PetBattleQueueReadyFrame.DeclineButton:SetButtonTemplate() + PetBattleQueueReadyFrame:SetStylePanel("Default", 'Transparent') + PetBattleQueueReadyFrame.AcceptButton:SetStylePanel("Button") + PetBattleQueueReadyFrame.DeclineButton:SetStylePanel("Button") PetBattleQueueReadyFrame.Art:SetTexture([[Interface\PetBattles\PetBattlesQueue]]) --[[ TOO MANY GOD DAMN HOOKS ]]-- diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petition.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petition.lua index e64bb53..ba8aac4 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petition.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petition.lua @@ -35,10 +35,10 @@ local function PetitionFrameStyle() PLUGIN:ApplyWindowStyle(PetitionFrame, nil, true) PetitionFrameInset:Die() - PetitionFrameSignButton:SetButtonTemplate() - PetitionFrameRequestButton:SetButtonTemplate() - PetitionFrameRenameButton:SetButtonTemplate() - PetitionFrameCancelButton:SetButtonTemplate() + PetitionFrameSignButton:SetStylePanel("Button") + PetitionFrameRequestButton:SetStylePanel("Button") + PetitionFrameRenameButton:SetStylePanel("Button") + PetitionFrameCancelButton:SetStylePanel("Button") PLUGIN:ApplyCloseButtonStyle(PetitionFrameCloseButton) @@ -58,8 +58,8 @@ local function PetitionFrameStyle() PetitionFrameInstructions:SetTextColor(1, 1, 1) - PetitionFrameRenameButton:Point("LEFT", PetitionFrameRequestButton, "RIGHT", 3, 0) - PetitionFrameRenameButton:Point("RIGHT", PetitionFrameCancelButton, "LEFT", -3, 0) + PetitionFrameRenameButton:SetPointToScale("LEFT", PetitionFrameRequestButton, "RIGHT", 3, 0) + PetitionFrameRenameButton:SetPointToScale("RIGHT", PetitionFrameCancelButton, "LEFT", -3, 0) end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petjournal.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petjournal.lua index 4f0f97c..6cc600a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petjournal.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petjournal.lua @@ -28,6 +28,8 @@ HELPERS ########################################################## ]]-- local FAV_ICON = [[Interface\Addons\SVUI\assets\artwork\Icons\GENERIC-STAR]] +local NORMAL_COLOR = {r = 1, g = 1, b = 1} +local SELECTED_COLOR = {r = 1, g = 1, b = 0} local function PetJournal_UpdateMounts() for b = 1, #MountJournal.ListScrollFrame.buttons do @@ -66,27 +68,23 @@ local function PetJournal_UpdatePets() local w, x, y, z, level, favorite, A, B, C, D, E, F, G, H, I = C_PetJournal.GetPetInfoByIndex(v, isWild) if w ~= nil then local J, K, L, M, N = C_PetJournal.GetPetStats(w) - if d.selectedTexture:IsShown() then - e:SetTextColor(1, 1, 0) - else - e:SetTextColor(1, 1, 1) - end - if N then - local color = ITEM_QUALITY_COLORS[N-1] - if d.Panel then - d:SetBackdropBorderColor(color.r, color.g, color.b) - end + local color = NORMAL_COLOR + if(N) then + color = ITEM_QUALITY_COLORS[N-1] + end + d:SetBackdropBorderColor(0,0,0,1) + if(d.selectedTexture:IsShown() and d.Panel) then + d:SetBackdropBorderColor(1,1,0,1) if d.IconShadow then - d.IconShadow:SetBackdropBorderColor(color.r, color.g, color.b) - end + d.IconShadow:SetBackdropBorderColor(1,1,0) + end else - if d.Panel then - d:SetBackdropBorderColor(1, 1, 0, 0.5) - end if d.IconShadow then - d.IconShadow:SetBackdropBorderColor(1, 1, 0, 0.5) - end - end + d.IconShadow:SetBackdropBorderColor(color.r, color.g, color.b) + end + end + + e:SetTextColor(color.r, color.g, color.b) end end end @@ -113,11 +111,11 @@ local function PetJournalStyle() MountJournal.MountCount:RemoveTextures() MountJournalListScrollFrame:RemoveTextures() MountJournalMountButton:RemoveTextures() - MountJournalMountButton:SetButtonTemplate() - MountJournalSearchBox:SetEditboxTemplate() + MountJournalMountButton:SetStylePanel("Button") + MountJournalSearchBox:SetStylePanel("Editbox") PLUGIN:ApplyScrollFrameStyle(MountJournalListScrollFrameScrollBar) - MountJournal.MountDisplay:SetFixedPanelTemplate("Model") + MountJournal.MountDisplay:SetStylePanel("Fixed", "Model") local buttons = MountJournal.ListScrollFrame.buttons for i = 1, #buttons do @@ -141,8 +139,8 @@ local function PetJournalStyle() MountJournalListScrollFrame:HookScript("OnMouseWheel", PetJournal_UpdateMounts) PetJournalSummonButton:RemoveTextures() PetJournalFindBattle:RemoveTextures() - PetJournalSummonButton:SetButtonTemplate() - PetJournalFindBattle:SetButtonTemplate() + PetJournalSummonButton:SetStylePanel("Button") + PetJournalFindBattle:SetStylePanel("Button") PetJournalRightInset:RemoveTextures() PetJournalLeftInset:RemoveTextures() @@ -153,9 +151,9 @@ local function PetJournalStyle() PetJournalTutorialButton:Die() PetJournal.PetCount:RemoveTextures() - PetJournalSearchBox:SetEditboxTemplate() + PetJournalSearchBox:SetStylePanel("Editbox") PetJournalFilterButton:RemoveTextures(true) - PetJournalFilterButton:SetButtonTemplate() + PetJournalFilterButton:SetStylePanel("Button") PetJournalListScrollFrame:RemoveTextures() PLUGIN:ApplyScrollFrameStyle(PetJournalListScrollFrameScrollBar) @@ -190,24 +188,24 @@ local function PetJournalStyle() local pjPet = _G['PetJournalLoadoutPet'..b] pjPet:RemoveTextures() pjPet.petTypeIcon:SetPoint('BOTTOMLEFT', 2, 2) - pjPet.dragButton:WrapOuter(_G['PetJournalLoadoutPet'..b..'Icon']) + pjPet.dragButton:SetAllPointsOut(_G['PetJournalLoadoutPet'..b..'Icon']) pjPet.hover = true; pjPet.pushed = true; pjPet.checked = true; PLUGIN:ApplyItemButtonStyle(pjPet, nil, nil, true) pjPet.setButton:RemoveTextures() _G['PetJournalLoadoutPet'..b..'HealthFrame'].healthBar:RemoveTextures() - _G['PetJournalLoadoutPet'..b..'HealthFrame'].healthBar:SetPanelTemplate('Default') + _G['PetJournalLoadoutPet'..b..'HealthFrame'].healthBar:SetStylePanel("Default", 'Default') _G['PetJournalLoadoutPet'..b..'HealthFrame'].healthBar:SetStatusBarTexture(SV.Media.bar.default) _G['PetJournalLoadoutPet'..b..'XPBar']:RemoveTextures() - _G['PetJournalLoadoutPet'..b..'XPBar']:SetPanelTemplate('Default') + _G['PetJournalLoadoutPet'..b..'XPBar']:SetStylePanel("Default", 'Default') _G['PetJournalLoadoutPet'..b..'XPBar']:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) _G['PetJournalLoadoutPet'..b..'XPBar']:SetFrameLevel(_G['PetJournalLoadoutPet'..b..'XPBar']:GetFrameLevel()+2) for v = 1, 3 do local s = _G['PetJournalLoadoutPet'..b..'Spell'..v] PLUGIN:ApplyItemButtonStyle(s) s.FlyoutArrow:SetTexture([[Interface\Buttons\ActionBarFlyoutButton]]) - _G['PetJournalLoadoutPet'..b..'Spell'..v..'Icon']:FillInner(s) + _G['PetJournalLoadoutPet'..b..'Spell'..v..'Icon']:SetAllPointsIn(s) s.Panel:SetFrameLevel(s:GetFrameLevel() + 1) _G['PetJournalLoadoutPet'..b..'Spell'..v..'Icon']:SetParent(s.Panel) end @@ -218,7 +216,7 @@ local function PetJournalStyle() for b = 1, 2 do local Q = _G['PetJournalSpellSelectSpell'..b] PLUGIN:ApplyItemButtonStyle(Q) - _G['PetJournalSpellSelectSpell'..b..'Icon']:FillInner(Q) + _G['PetJournalSpellSelectSpell'..b..'Icon']:SetAllPointsIn(Q) _G['PetJournalSpellSelectSpell'..b..'Icon']:SetDrawLayer('BORDER') end @@ -235,7 +233,7 @@ local function PetJournalStyle() fg:SetFrameLevel(PetJournalPetCardPetInfo:GetFrameLevel() + 30) PetJournalPetCardPetInfo.favorite:SetParent(fg) - PetJournalPetCardPetInfo.Panel:WrapOuter(PetJournalPetCardPetInfoIcon) + PetJournalPetCardPetInfo.Panel:SetAllPointsOut(PetJournalPetCardPetInfoIcon) PetJournalPetCardPetInfoIcon:SetParent(PetJournalPetCardPetInfo.Panel) PetJournalPetCardPetInfo.level:SetParent(PetJournalPetCardPetInfo.Panel) @@ -253,39 +251,39 @@ local function PetJournalStyle() R.BorderBottom:SetTexture(0,0,0,0) R.BorderBottomRight:SetTexture(0,0,0,0) R.BorderBottomLeft:SetTexture(0,0,0,0) - R:SetFixedPanelTemplate("Transparent", true) + R:SetStylePanel("Fixed", "Transparent", true) for b = 1, 6 do local S = _G['PetJournalPetCardSpell'..b] S:SetFrameLevel(S:GetFrameLevel() + 2) S:DisableDrawLayer('BACKGROUND') - S:SetPanelTemplate('Transparent') + S:SetStylePanel("Default", 'Transparent') S.Panel:SetAllPoints() S.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - S.icon:FillInner(S.Panel) + S.icon:SetAllPointsIn(S.Panel) end PetJournalPetCardHealthFrame.healthBar:RemoveTextures() - PetJournalPetCardHealthFrame.healthBar:SetPanelTemplate('Default') + PetJournalPetCardHealthFrame.healthBar:SetStylePanel("Default", 'Default') PetJournalPetCardHealthFrame.healthBar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) PetJournalPetCardXPBar:RemoveTextures() - PetJournalPetCardXPBar:SetPanelTemplate('Default') + PetJournalPetCardXPBar:SetStylePanel("Default", 'Default') PetJournalPetCardXPBar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) PLUGIN:ApplyTabStyle(PetJournalParentTab3) ToyBox:RemoveTextures() - ToyBoxProgressBar:SetPanelTemplate("Bar", true) - ToyBoxSearchBox:SetEditboxTemplate() + ToyBoxProgressBar:SetStylePanel("Default", "Bar", true) + ToyBoxSearchBox:SetStylePanel("Editbox") ToyBoxFilterButton:RemoveTextures() - ToyBoxFilterButton:SetButtonTemplate() + ToyBoxFilterButton:SetStylePanel("Button") ToyBoxIconsFrame:RemoveTextures() - ToyBoxIconsFrame:SetFixedPanelTemplate('Model') + ToyBoxIconsFrame:SetStylePanel("Fixed", 'Model') MountJournalFilterButton:RemoveTextures() - MountJournalFilterButton:SetButtonTemplate() + MountJournalFilterButton:SetStylePanel("Button") MountJournal.SummonRandomFavoriteButton:RemoveTextures() - MountJournal.SummonRandomFavoriteButton:SetSlotTemplate(true, 2, 0, 0, 0.5) + MountJournal.SummonRandomFavoriteButton:SetStylePanel("Slot", true, 2, 0, 0, 0.5) MountJournal.SummonRandomFavoriteButton.texture:SetTexture([[Interface\ICONS\ACHIEVEMENT_GUILDPERK_MOUNTUP]]) MountJournal.SummonRandomFavoriteButton.texture:SetTexCoord(0.1, 0.9, 0.1, 0.9) @@ -293,7 +291,7 @@ local function PetJournalStyle() local gName = ("ToySpellButton%d"):format(i) local button = _G[gName] if(button) then - button:SetButtonTemplate() + button:SetStylePanel("Button") end end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petstable.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petstable.lua index f78daef..66c54d5 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petstable.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petstable.lua @@ -33,11 +33,11 @@ local function PetStableStyle() PetStableFrameInset:RemoveTextures() PetStableLeftInset:RemoveTextures() PetStableBottomInset:RemoveTextures() - PetStableFrame:SetPanelTemplate("Halftone") - PetStableFrameInset:SetFixedPanelTemplate('Inset') + PetStableFrame:SetStylePanel("Default", "Halftone") + PetStableFrameInset:SetStylePanel("Fixed", 'Inset') PLUGIN:ApplyCloseButtonStyle(PetStableFrameCloseButton) - PetStablePrevPageButton:SetButtonTemplate() - PetStableNextPageButton:SetButtonTemplate() + PetStablePrevPageButton:SetStylePanel("Button") + PetStableNextPageButton:SetStylePanel("Button") PLUGIN:ApplyPaginationStyle(PetStablePrevPageButton) PLUGIN:ApplyPaginationStyle(PetStableNextPageButton) for j = 1, NUM_PET_ACTIVE_SLOTS do diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/pvp.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/pvp.lua index 5ca7300..7dcc7af 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/pvp.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/pvp.lua @@ -64,36 +64,36 @@ local function PVPFrameStyle() if(btn) then btn.Background:Die() btn.Ring:Die() - btn:SetButtonTemplate() - btn.Icon:Size(45) + btn:SetStylePanel("Button") + btn.Icon:SetSizeToScale(45) btn.Icon:SetTexCoord(.15, .85, .15, .85) btn.Icon:SetDrawLayer("OVERLAY", nil, 7) - btn.Panel:WrapOuter(btn.Icon) + btn.Panel:SetAllPointsOut(btn.Icon) end end PLUGIN:ApplyDropdownStyle(HonorFrameTypeDropDown) HonorFrame.Inset:RemoveTextures() - HonorFrame.Inset:SetFixedPanelTemplate("Inset") + HonorFrame.Inset:SetStylePanel("Fixed", "Inset") PLUGIN:ApplyScrollFrameStyle(HonorFrameSpecificFrameScrollBar) HonorFrameSoloQueueButton:RemoveTextures() HonorFrameGroupQueueButton:RemoveTextures() - HonorFrameSoloQueueButton:SetButtonTemplate() - HonorFrameGroupQueueButton:SetButtonTemplate() + HonorFrameSoloQueueButton:SetStylePanel("Button") + HonorFrameGroupQueueButton:SetStylePanel("Button") HonorFrame.BonusFrame:RemoveTextures() HonorFrame.BonusFrame.ShadowOverlay:RemoveTextures() HonorFrame.BonusFrame.RandomBGButton:RemoveTextures() - HonorFrame.BonusFrame.RandomBGButton:SetFixedPanelTemplate("Button") - HonorFrame.BonusFrame.RandomBGButton:SetButtonTemplate() - HonorFrame.BonusFrame.RandomBGButton.SelectedTexture:FillInner() + HonorFrame.BonusFrame.RandomBGButton:SetStylePanel("Fixed", "Button") + HonorFrame.BonusFrame.RandomBGButton:SetStylePanel("Button") + HonorFrame.BonusFrame.RandomBGButton.SelectedTexture:SetAllPointsIn() HonorFrame.BonusFrame.RandomBGButton.SelectedTexture:SetTexture(1, 1, 0, 0.1) HonorFrame.BonusFrame.DiceButton:DisableDrawLayer("ARTWORK") HonorFrame.BonusFrame.DiceButton:SetHighlightTexture("") HonorFrame.RoleInset:RemoveTextures() - HonorFrame.RoleInset.DPSIcon.checkButton:SetCheckboxTemplate(true) - HonorFrame.RoleInset.TankIcon.checkButton:SetCheckboxTemplate(true) - HonorFrame.RoleInset.HealerIcon.checkButton:SetCheckboxTemplate(true) + HonorFrame.RoleInset.DPSIcon.checkButton:SetStylePanel("Checkbox", true) + HonorFrame.RoleInset.TankIcon.checkButton:SetStylePanel("Checkbox", true) + HonorFrame.RoleInset.HealerIcon.checkButton:SetStylePanel("Checkbox", true) HonorFrame.RoleInset.TankIcon:DisableDrawLayer("OVERLAY") HonorFrame.RoleInset.TankIcon:DisableDrawLayer("BACKGROUND") HonorFrame.RoleInset.HealerIcon:DisableDrawLayer("OVERLAY") @@ -115,37 +115,37 @@ local function PVPFrameStyle() ConquestPointsBarBG:Die() ConquestPointsBarShadow:Die() ConquestPointsBar.progress:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - ConquestPointsBar:SetFixedPanelTemplate('Inset') - ConquestPointsBar.Panel:WrapOuter(ConquestPointsBar, nil, -2) + ConquestPointsBar:SetStylePanel("Fixed", 'Inset') + ConquestPointsBar.Panel:SetAllPointsOut(ConquestPointsBar, nil, -2) ConquestFrame:RemoveTextures() ConquestFrame.ShadowOverlay:RemoveTextures() ConquestJoinButton:RemoveTextures() - ConquestJoinButton:SetButtonTemplate() + ConquestJoinButton:SetStylePanel("Button") ConquestFrame.RatedBG:RemoveTextures() - ConquestFrame.RatedBG:SetFixedPanelTemplate("Inset") - ConquestFrame.RatedBG:SetButtonTemplate() - ConquestFrame.RatedBG.SelectedTexture:FillInner() + ConquestFrame.RatedBG:SetStylePanel("Fixed", "Inset") + ConquestFrame.RatedBG:SetStylePanel("Button") + ConquestFrame.RatedBG.SelectedTexture:SetAllPointsIn() ConquestFrame.RatedBG.SelectedTexture:SetTexture(1, 1, 0, 0.1) WarGamesFrame:RemoveTextures() WarGamesFrame.RightInset:RemoveTextures() WarGamesFrameInfoScrollFrame:RemoveTextures() WarGamesFrameInfoScrollFrameScrollBar:RemoveTextures() WarGameStartButton:RemoveTextures() - WarGameStartButton:SetButtonTemplate() + WarGameStartButton:SetStylePanel("Button") PLUGIN:ApplyScrollFrameStyle(WarGamesFrameScrollFrameScrollBar) PLUGIN:ApplyScrollFrameStyle(WarGamesFrameInfoScrollFrameScrollBar) WarGamesFrame.HorizontalBar:RemoveTextures() PVPReadyDialog:RemoveTextures() - PVPReadyDialog:SetPanelTemplate("Pattern") - PVPReadyDialogEnterBattleButton:SetButtonTemplate() - PVPReadyDialogLeaveQueueButton:SetButtonTemplate() + PVPReadyDialog:SetStylePanel("Default", "Pattern") + PVPReadyDialogEnterBattleButton:SetStylePanel("Button") + PVPReadyDialogLeaveQueueButton:SetStylePanel("Button") PLUGIN:ApplyCloseButtonStyle(PVPReadyDialogCloseButton) PVPReadyDialogRoleIcon.texture:SetTexture("Interface\\LFGFrame\\UI-LFG-ICONS-ROLEBACKGROUNDS") PVPReadyDialogRoleIcon.texture:SetAlpha(0.5) - ConquestFrame.Inset:SetFixedPanelTemplate("Inset") - WarGamesFrameScrollFrame:SetPanelTemplate("Inset",false,2,2,6) + ConquestFrame.Inset:SetStylePanel("Fixed", "Inset") + WarGamesFrameScrollFrame:SetStylePanel("Default", "Inset",false,2,2,6) hooksecurefunc("PVPReadyDialog_Display", _hook_PVPReadyDialogDisplay) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/quest.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/quest.lua index 5e34603..849ed6f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/quest.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/quest.lua @@ -43,7 +43,7 @@ local QuestFrameList = { }; local function QuestScrollHelper(b, c, d, e) - b:SetPanelTemplate("Inset") + b:SetStylePanel("Default", "Inset") b.spellTex = b:CreateTexture(nil, 'ARTWORK') b.spellTex:SetTexture([[Interface\QuestFrame\QuestBG]]) if e then @@ -51,25 +51,25 @@ local function QuestScrollHelper(b, c, d, e) else b.spellTex:SetPoint("TOPLEFT") end - b.spellTex:Size(c or 506, d or 615) + b.spellTex:SetSizeToScale(c or 506, d or 615) b.spellTex:SetTexCoord(0, 1, 0.02, 1) end local QuestRewardScrollFrame_OnShow = function(self) if(not self.Panel) then - self:SetPanelTemplate("Default") + self:SetStylePanel("Default", "Default") QuestScrollHelper(self, 509, 630, false) - self:Height(self:GetHeight() - 2) + self:SetHeightToScale(self:GetHeight() - 2) end if(self.spellTex) then - self.spellTex:Height(self:GetHeight() + 217) + self.spellTex:SetHeightToScale(self:GetHeight() + 217) end end local function StyleReward(item) if(item and (not item.Panel)) then item:RemoveTextures() - item:SetSlotTemplate(true, 2, 0, 0, 0.5) + item:SetStylePanel("Slot", true, 2, 0, 0, 0.5) local name = item:GetName() if(name) then @@ -97,7 +97,7 @@ local function StyleDisplayReward(item) oldIcon = item.Icon:GetTexture() end item:RemoveTextures() - item:SetSlotTemplate(true, 2, 0, 0, 0.5) + item:SetStylePanel("Slot", true, 2, 0, 0, 0.5) if(oldIcon) then item.Icon:SetTexture(oldIcon) @@ -136,30 +136,30 @@ end local _hook_GreetingPanelShow = function(self) self:RemoveTextures() - _G.QuestFrameGreetingGoodbyeButton:SetButtonTemplate() + _G.QuestFrameGreetingGoodbyeButton:SetStylePanel("Button") _G.QuestGreetingFrameHorizontalBreak:Die() end local _hook_DetailScrollShow = function(self) if not self.Panel then - self:SetPanelTemplate("Default") + self:SetStylePanel("Default", "Default") QuestScrollHelper(self, 509, 630, false) end - self.spellTex:Height(self:GetHeight() + 217) + self.spellTex:SetHeightToScale(self:GetHeight() + 217) end local _hook_QuestLogPopupDetailFrameShow = function(self) local QuestLogPopupDetailFrameScrollFrame = _G.QuestLogPopupDetailFrameScrollFrame; if not QuestLogPopupDetailFrameScrollFrame.spellTex then - QuestLogPopupDetailFrameScrollFrame:SetFixedPanelTemplate("Default") + QuestLogPopupDetailFrameScrollFrame:SetStylePanel("Fixed", "Default") QuestLogPopupDetailFrameScrollFrame.spellTex = QuestLogPopupDetailFrameScrollFrame:CreateTexture(nil, 'ARTWORK') QuestLogPopupDetailFrameScrollFrame.spellTex:SetTexture([[Interface\QuestFrame\QuestBookBG]]) QuestLogPopupDetailFrameScrollFrame.spellTex:SetPoint("TOPLEFT", 2, -2) - QuestLogPopupDetailFrameScrollFrame.spellTex:Size(514, 616) + QuestLogPopupDetailFrameScrollFrame.spellTex:SetSizeToScale(514, 616) QuestLogPopupDetailFrameScrollFrame.spellTex:SetTexCoord(0, 1, 0.02, 1) QuestLogPopupDetailFrameScrollFrame.spellTex2 = QuestLogPopupDetailFrameScrollFrame:CreateTexture(nil, 'BORDER') QuestLogPopupDetailFrameScrollFrame.spellTex2:SetTexture([[Interface\FrameGeneral\UI-Background-Rock]]) - QuestLogPopupDetailFrameScrollFrame.spellTex2:FillInner() + QuestLogPopupDetailFrameScrollFrame.spellTex2:SetAllPointsIn() end end --[[ @@ -185,7 +185,7 @@ local function QuestFrameStyle() local width = QuestLogPopupDetailFrameScrollFrame:GetWidth() QuestLogPopupDetailFrame.ShowMapButton:SetWidth(width) - QuestLogPopupDetailFrame.ShowMapButton:SetButtonTemplate() + QuestLogPopupDetailFrame.ShowMapButton:SetStylePanel("Button") PLUGIN:ApplyWindowStyle(QuestLogPopupDetailFrame) @@ -193,7 +193,7 @@ local function QuestFrameStyle() for _,i in pairs(QuestFrameList)do if(_G[i]) then - _G[i]:SetButtonTemplate() + _G[i]:SetStylePanel("Button") _G[i]:SetFrameLevel(_G[i]:GetFrameLevel() + 2) end end @@ -218,22 +218,22 @@ local function QuestFrameStyle() end QuestInfoSkillPointFrame:RemoveTextures() - QuestInfoSkillPointFrame:Width(QuestInfoSkillPointFrame:GetWidth() - 4) + QuestInfoSkillPointFrame:SetWidthToScale(QuestInfoSkillPointFrame:GetWidth() - 4) local curLvl = QuestInfoSkillPointFrame:GetFrameLevel() + 1 QuestInfoSkillPointFrame:SetFrameLevel(curLvl) - QuestInfoSkillPointFrame:SetFixedPanelTemplate("Slot") + QuestInfoSkillPointFrame:SetStylePanel("Fixed", "Slot") QuestInfoSkillPointFrame:SetBackdropColor(1, 1, 0, 0.5) QuestInfoSkillPointFrameIconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) QuestInfoSkillPointFrameIconTexture:SetDrawLayer("OVERLAY") QuestInfoSkillPointFrameIconTexture:SetPoint("TOPLEFT", 2, -2) - QuestInfoSkillPointFrameIconTexture:Size(QuestInfoSkillPointFrameIconTexture:GetWidth()-2, QuestInfoSkillPointFrameIconTexture:GetHeight()-2) + QuestInfoSkillPointFrameIconTexture:SetSizeToScale(QuestInfoSkillPointFrameIconTexture:GetWidth()-2, QuestInfoSkillPointFrameIconTexture:GetHeight()-2) QuestInfoSkillPointFrameCount:SetDrawLayer("OVERLAY") QuestInfoItemHighlight:RemoveTextures() - QuestInfoItemHighlight:SetFixedPanelTemplate("Slot") + QuestInfoItemHighlight:SetStylePanel("Fixed", "Slot") QuestInfoItemHighlight:SetBackdropBorderColor(1, 1, 0) QuestInfoItemHighlight:SetBackdropColor(0, 0, 0, 0) - QuestInfoItemHighlight:Size(142, 40) + QuestInfoItemHighlight:SetSizeToScale(142, 40) hooksecurefunc("QuestInfoItem_OnClick", Hook_QuestInfoItem_OnClick) hooksecurefunc("QuestInfo_Display", StyleQuestRewards) @@ -244,9 +244,9 @@ local function QuestFrameStyle() QuestFrameDetailPanel:RemoveTextures(true) QuestDetailScrollFrame:RemoveTextures(true) QuestScrollHelper(QuestDetailScrollFrame, 506, 615, true) - QuestProgressScrollFrame:SetFixedPanelTemplate() + QuestProgressScrollFrame:SetStylePanel("Fixed") QuestScrollHelper(QuestProgressScrollFrame, 506, 615, true) - QuestGreetingScrollFrame:SetFixedPanelTemplate() + QuestGreetingScrollFrame:SetStylePanel("Fixed") QuestScrollHelper(QuestGreetingScrollFrame, 506, 615, true) QuestDetailScrollChildFrame:RemoveTextures(true) QuestRewardScrollFrame:RemoveTextures(true) @@ -254,11 +254,11 @@ local function QuestFrameStyle() QuestFrameProgressPanel:RemoveTextures(true) QuestFrameRewardPanel:RemoveTextures(true) - QuestFrameAcceptButton:SetButtonTemplate() - QuestFrameDeclineButton:SetButtonTemplate() - QuestFrameCompleteButton:SetButtonTemplate() - QuestFrameGoodbyeButton:SetButtonTemplate() - QuestFrameCompleteQuestButton:SetButtonTemplate() + QuestFrameAcceptButton:SetStylePanel("Button") + QuestFrameDeclineButton:SetStylePanel("Button") + QuestFrameCompleteButton:SetStylePanel("Button") + QuestFrameGoodbyeButton:SetStylePanel("Button") + QuestFrameCompleteQuestButton:SetStylePanel("Button") PLUGIN:ApplyCloseButtonStyle(QuestFrameCloseButton, QuestFrame.Panel) @@ -266,24 +266,48 @@ local function QuestFrameStyle() local i = _G["QuestProgressItem"..j] local texture = _G["QuestProgressItem"..j.."IconTexture"] i:RemoveTextures() - i:SetFixedPanelTemplate("Inset") - i:Width(_G["QuestProgressItem"..j]:GetWidth() - 4) + i:SetStylePanel("Fixed", "Inset") + i:SetWidthToScale(_G["QuestProgressItem"..j]:GetWidth() - 4) texture:SetTexCoord(0.1, 0.9, 0.1, 0.9) texture:SetDrawLayer("OVERLAY") texture:SetPoint("TOPLEFT", 2, -2) - texture:Size(texture:GetWidth() - 2, texture:GetHeight() - 2) + texture:SetSizeToScale(texture:GetWidth() - 2, texture:GetHeight() - 2) _G["QuestProgressItem"..j.."Count"]:SetDrawLayer("OVERLAY") end QuestNPCModel:RemoveTextures() - QuestNPCModel:SetPanelTemplate("Comic") + QuestNPCModel:SetStylePanel("Default", "Comic") QuestNPCModelTextFrame:RemoveTextures() - QuestNPCModelTextFrame:SetPanelTemplate("Default") + QuestNPCModelTextFrame:SetStylePanel("Default", "Default") QuestNPCModelTextFrame.Panel:SetPoint("TOPLEFT", QuestNPCModel.Panel, "BOTTOMLEFT", 0, -2) hooksecurefunc("QuestFrame_ShowQuestPortrait", Hook_QuestNPCModel) +end + +local function QuestChoiceFrameStyle() + if PLUGIN.db.blizzard.enable ~= true or PLUGIN.db.blizzard.quest ~= true then return end + + PLUGIN:ApplyWindowStyle(QuestChoiceFrame, true, true) + + local bgFrameTop = CreateFrame("Frame", nil, QuestChoiceFrame) + bgFrameTop:SetPoint("TOPLEFT", QuestChoiceFrame, "TOPLEFT", 42, -44) + bgFrameTop:SetPoint("TOPRIGHT", QuestChoiceFrame, "TOPRIGHT", -42, -44) + bgFrameTop:SetHeight(85) + bgFrameTop:SetStylePanel("Default", "Inset") + + local bgFrameBottom = CreateFrame("Frame", nil, QuestChoiceFrame) + bgFrameBottom:SetPoint("TOPLEFT", QuestChoiceFrame, "TOPLEFT", 42, -140) + bgFrameBottom:SetPoint("BOTTOMRIGHT", QuestChoiceFrame, "BOTTOMRIGHT", -42, 44) + bgFrameBottom:SetStylePanel("Default", "Inset") + + + PLUGIN:ApplyCloseButtonStyle(QuestChoiceFrame.CloseButton) + --QuestChoiceFrame.Option1:SetStylePanel("Default", "Inset") + QuestChoiceFrame.Option1.OptionButton:SetStylePanel("Button") + --QuestChoiceFrame.Option2:SetStylePanel("Default", "Inset") + QuestChoiceFrame.Option2.OptionButton:SetStylePanel("Button") end --[[ ########################################################## @@ -291,4 +315,5 @@ PLUGIN LOADING ########################################################## ]]-- PLUGIN:SaveCustomStyle(QuestFrameStyle) -PLUGIN:SaveCustomStyle(QuestGreetingStyle) \ No newline at end of file +PLUGIN:SaveCustomStyle(QuestGreetingStyle) +PLUGIN:SaveBlizzardStyle('Blizzard_QuestChoice', QuestChoiceFrameStyle) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/raid.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/raid.lua index ec2db63..7e3c00c 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/raid.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/raid.lua @@ -63,7 +63,7 @@ local function RaidUIStyle() local slot = _G[name] if(slot) then slot:RemoveTextures() - slot:SetPanelTemplate("Inset", true) + slot:SetStylePanel("Default", "Inset", true) end end end @@ -85,20 +85,20 @@ local function RaidInfoStyle() for g = 1, #RaidInfoFrameList do if _G[RaidInfoFrameList[g]] then - _G[RaidInfoFrameList[g]]:SetButtonTemplate() + _G[RaidInfoFrameList[g]]:SetStylePanel("Button") end end RaidInfoScrollFrame:RemoveTextures() - RaidInfoFrame:SetBasicPanel() - RaidInfoFrame.Panel:Point("TOPLEFT", RaidInfoFrame, "TOPLEFT") - RaidInfoFrame.Panel:Point("BOTTOMRIGHT", RaidInfoFrame, "BOTTOMRIGHT") + RaidInfoFrame:SetStylePanel("Default", 'Transparent') + RaidInfoFrame.Panel:SetPointToScale("TOPLEFT", RaidInfoFrame, "TOPLEFT") + RaidInfoFrame.Panel:SetPointToScale("BOTTOMRIGHT", RaidInfoFrame, "BOTTOMRIGHT") PLUGIN:ApplyCloseButtonStyle(RaidInfoCloseButton, RaidInfoFrame) PLUGIN:ApplyScrollFrameStyle(RaidInfoScrollFrameScrollBar) - if RaidFrameRaidBrowserButton then RaidFrameRaidBrowserButton:SetButtonTemplate() end - RaidFrameAllAssistCheckButton:SetCheckboxTemplate(true) + if RaidFrameRaidBrowserButton then RaidFrameRaidBrowserButton:SetStylePanel("Button") end + RaidFrameAllAssistCheckButton:SetStylePanel("Checkbox", true) end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/reforging.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/reforging.lua index b536414..35eab31 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/reforging.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/reforging.lua @@ -34,18 +34,18 @@ local function ReforgingStyle() ReforgingFrame.ButtonFrame:RemoveTextures() ReforgingFrameReforgeButton:ClearAllPoints() - ReforgingFrameReforgeButton:Point("LEFT", ReforgingFrameRestoreButton, "RIGHT", 2, 0) - ReforgingFrameReforgeButton:Point("BOTTOMRIGHT", -3, 3) + ReforgingFrameReforgeButton:SetPointToScale("LEFT", ReforgingFrameRestoreButton, "RIGHT", 2, 0) + ReforgingFrameReforgeButton:SetPointToScale("BOTTOMRIGHT", -3, 3) ReforgingFrame.RestoreMessage:SetTextColor(1, 1, 1) ReforgingFrameRestoreButton:RemoveTextures() ReforgingFrameReforgeButton:RemoveTextures() - ReforgingFrameRestoreButton:SetButtonTemplate() - ReforgingFrameReforgeButton:SetButtonTemplate() + ReforgingFrameRestoreButton:SetStylePanel("Button") + ReforgingFrameReforgeButton:SetStylePanel("Button") ReforgingFrame.ItemButton:RemoveTextures() - ReforgingFrame.ItemButton:SetSlotTemplate(true) - ReforgingFrame.ItemButton.IconTexture:FillInner() + ReforgingFrame.ItemButton:SetStylePanel("Slot", true) + ReforgingFrame.ItemButton.IconTexture:SetAllPointsIn() hooksecurefunc("ReforgingFrame_Update", function(k) local w, x, u, y, z, A = GetReforgeItemInfo() if x then diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/spellbook.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/spellbook.lua index 560e424..6ee8f61 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/spellbook.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/spellbook.lua @@ -82,13 +82,13 @@ local function ChangeTabHelper(tab) tab:RemoveTextures() if(nTex) then nTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) - nTex:FillInner() + nTex:SetAllPointsIn() end tab.pushed = true; tab.backdrop = CreateFrame("Frame", nil, tab) - tab.backdrop:WrapOuter(tab,1,1) + tab.backdrop:SetAllPointsOut(tab,1,1) tab.backdrop:SetFrameLevel(0) tab.backdrop:SetBackdrop({ bgFile = [[Interface\BUTTONS\WHITE8X8]], @@ -109,7 +109,7 @@ local function ChangeTabHelper(tab) tab:SetScript("OnLeave", Tab_OnLeave) local a1, p, a2, x, y = tab:GetPoint() - tab:Point(a1, p, a2, 1, y) + tab:SetPointToScale(a1, p, a2, 1, y) end local function GetSpecTabHelper(index) @@ -137,12 +137,12 @@ local function AbilityButtonHelper(index) end button:RemoveTextures() - button:SetPanelTemplate("Slot", true, 2, 0, 0) + button:SetStylePanel("Default", "Slot", true, 2, 0, 0) if(button.iconTexture) then button.iconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) button.iconTexture:ClearAllPoints() - button.iconTexture:FillInner(button, 1, 1) + button.iconTexture:SetAllPointsIn(button, 1, 1) end if(button.Name) then @@ -157,45 +157,48 @@ local function AbilityButtonHelper(index) end end -local function ButtonUpdateHelper() - for i=1, SPELLS_PER_PAGE do - local name = "SpellButton"..i; - local button = _G[name]; +local ButtonUpdateHelper = function(self) + local name = self:GetName(); + local icon = _G[name.."IconTexture"]; - if(button and (not button.Panel)) then - local icon = _G[name.."IconTexture"] - local spellString = _G[name.."SpellName"]; - local subSpellString = _G[name.."SubSpellName"]; - --local highlight = _G[name.."Highlight"]; + if(not self.Panel) then + local iconTex; - if(not InCombatLockdown()) then - button:SetFrameLevel(SpellBookFrame:GetFrameLevel() + 5) - end + if(not InCombatLockdown()) then + self:SetFrameLevel(SpellBookFrame:GetFrameLevel() + 5) + end - button:RemoveTextures() - button:SetPanelTemplate("Slot", true, 2, 0, 0) + if(icon) then + iconTex = icon:GetTexture() + end - if(icon) then - icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - icon:ClearAllPoints() - icon:FillInner(button, 1, 1) - end + self:RemoveTextures() + self:SetStylePanel("Default", "Slot", true, 2, 0, 0) - if(spellString) then - spellString:SetFontObject(NumberFontNormal) - spellString:SetTextColor(1,1,0) - end + if(icon) then + icon:SetTexture(iconTex) + icon:ClearAllPoints() + icon:SetAllPointsIn(self, 1, 1) + end - if(subSpellString) then - subSpellString:SetFontObject(NumberFont_Shadow_Small) - subSpellString:SetTextColor(0.9,0.9,0.9) - end + self.SpellName:SetFontObject(NumberFontNormal) - if(button.FlyoutArrow) then - button.FlyoutArrow:SetTexture([[Interface\Buttons\ActionBarFlyoutButton]]) - end + if(self.FlyoutArrow) then + self.FlyoutArrow:SetTexture([[Interface\Buttons\ActionBarFlyoutButton]]) end - end + end + + if(icon) then + icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + end + + if(self.SpellName) then + self.SpellName:SetTextColor(1,1,0) + end + + if(self.SpellSubName) then + self.SpellSubName:SetTextColor(0.9,0.9,0.9) + end end --[[ ########################################################## @@ -210,7 +213,7 @@ local function SpellBookStyle() if(SpellBookFrameInset) then SpellBookFrameInset:RemoveTextures() - SpellBookFrameInset:SetFixedPanelTemplate("Inset", true, 6) + SpellBookFrameInset:SetStylePanel("Fixed", "Inset", true, 6) end if(SpellBookSpellIconsFrame) then SpellBookSpellIconsFrame:RemoveTextures() end if(SpellBookSideTabsFrame) then SpellBookSideTabsFrame:RemoveTextures() end @@ -228,8 +231,6 @@ local function SpellBookStyle() PLUGIN:ApplyPaginationStyle(SpellBookPrevPageButton) PLUGIN:ApplyPaginationStyle(SpellBookNextPageButton) - ButtonUpdateHelper() - hooksecurefunc("SpellButton_UpdateButton", ButtonUpdateHelper) hooksecurefunc("SpellBook_GetCoreAbilityButton", AbilityButtonHelper) @@ -279,15 +280,20 @@ local function SpellBookStyle() button:RemoveTextures() if(buttonTex) then buttonTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) - buttonTex:FillInner() + buttonTex:SetAllPointsIn() button:SetFrameLevel(button:GetFrameLevel() + 2) if not button.Panel then - button:SetPanelTemplate("Inset", false, 3, 3, 3) + button:SetStylePanel("Default", "Inset", false, 3, 3, 3) button.Panel:SetAllPoints() end end - if(button.spellString) then button.spellString:SetFontObject(NumberFontNormal) button.spellString:SetTextColor(1,1,0) end - if(button.subSpellString) then button.subSpellString:SetFontObject(NumberFont_Shadow_Small) button.subSpellString:SetTextColor(0.9,0.9,0.9) end + if(button.spellString) then + button.spellString:SetFontObject(NumberFontNormal) + button.spellString:SetTextColor(1,1,0) + end + if(button.subSpellString) then + button.subSpellString:SetFontObject(SubSpellFont) + end end end @@ -298,7 +304,7 @@ local function SpellBookStyle() bar:SetHeight(12) bar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) bar:SetStatusBarColor(0, 220/255, 0) - bar:SetPanelTemplate("Default") + bar:SetStylePanel("Default", "Default") bar.rankText:ClearAllPoints() bar.rankText:SetPoint("CENTER") end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/system.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/system.lua index 95e4109..b9510ab 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/system.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/system.lua @@ -434,7 +434,7 @@ local function SystemPanelQue() local this = _G[SystemDropDownList[i]] if(this) then this:RemoveTextures() - this:SetPanelTemplate("FramedTop") + this:SetStylePanel("Default", "FramedTop") end end for i = 1, #SystemFrameList1 do @@ -445,60 +445,62 @@ local function SystemPanelQue() end LFDRoleCheckPopup:RemoveTextures() - LFDRoleCheckPopup:SetFixedPanelTemplate() - LFDRoleCheckPopupAcceptButton:SetButtonTemplate() - LFDRoleCheckPopupDeclineButton:SetButtonTemplate() - LFDRoleCheckPopupRoleButtonTank.checkButton:SetCheckboxTemplate(true) - LFDRoleCheckPopupRoleButtonDPS.checkButton:SetCheckboxTemplate(true) - LFDRoleCheckPopupRoleButtonHealer.checkButton:SetCheckboxTemplate(true) + LFDRoleCheckPopup:SetStylePanel("Fixed") + LFDRoleCheckPopupAcceptButton:SetStylePanel("Button") + LFDRoleCheckPopupDeclineButton:SetStylePanel("Button") + LFDRoleCheckPopupRoleButtonTank.checkButton:SetStylePanel("Checkbox", true) + LFDRoleCheckPopupRoleButtonDPS.checkButton:SetStylePanel("Checkbox", true) + LFDRoleCheckPopupRoleButtonHealer.checkButton:SetStylePanel("Checkbox", true) LFDRoleCheckPopupRoleButtonTank.checkButton:SetFrameLevel(LFDRoleCheckPopupRoleButtonTank.checkButton:GetFrameLevel() + 1) LFDRoleCheckPopupRoleButtonDPS.checkButton:SetFrameLevel(LFDRoleCheckPopupRoleButtonDPS.checkButton:GetFrameLevel() + 1) LFDRoleCheckPopupRoleButtonHealer.checkButton:SetFrameLevel(LFDRoleCheckPopupRoleButtonHealer.checkButton:GetFrameLevel() + 1) for i = 1, 3 do for j = 1, 3 do - _G["StaticPopup"..i.."Button"..j]:SetButtonTemplate() - _G["StaticPopup"..i.."EditBox"]:SetEditboxTemplate() - _G["StaticPopup"..i.."MoneyInputFrameGold"]:SetEditboxTemplate() - _G["StaticPopup"..i.."MoneyInputFrameSilver"]:SetEditboxTemplate() - _G["StaticPopup"..i.."MoneyInputFrameCopper"]:SetEditboxTemplate() - _G["StaticPopup"..i.."EditBox"].Panel:Point("TOPLEFT", -2, -4) - _G["StaticPopup"..i.."EditBox"].Panel:Point("BOTTOMRIGHT", 2, 4) + _G["StaticPopup"..i.."Button"..j]:SetStylePanel("Button") + _G["StaticPopup"..i.."EditBox"]:SetStylePanel("Editbox") + _G["StaticPopup"..i.."MoneyInputFrameGold"]:SetStylePanel("Editbox") + _G["StaticPopup"..i.."MoneyInputFrameSilver"]:SetStylePanel("Editbox") + _G["StaticPopup"..i.."MoneyInputFrameCopper"]:SetStylePanel("Editbox") + _G["StaticPopup"..i.."EditBox"].Panel:SetPointToScale("TOPLEFT", -2, -4) + _G["StaticPopup"..i.."EditBox"].Panel:SetPointToScale("BOTTOMRIGHT", 2, 4) _G["StaticPopup"..i.."ItemFrameNameFrame"]:Die() _G["StaticPopup"..i.."ItemFrame"]:GetNormalTexture():Die() - _G["StaticPopup"..i.."ItemFrame"]:SetFixedPanelTemplate("Default") - _G["StaticPopup"..i.."ItemFrame"]:SetButtonTemplate() + _G["StaticPopup"..i.."ItemFrame"]:SetStylePanel("Fixed", "Default") + _G["StaticPopup"..i.."ItemFrame"]:SetStylePanel("Button") _G["StaticPopup"..i.."ItemFrameIconTexture"]:SetTexCoord(0.1,0.9,0.1,0.9 ) - _G["StaticPopup"..i.."ItemFrameIconTexture"]:FillInner() + _G["StaticPopup"..i.."ItemFrameIconTexture"]:SetAllPointsIn() end end + local CAPS_TEXT_FONT = LibStub("LibSharedMedia-3.0"):Fetch("font", SV.db.font.caps.file); + local caps_fontsize = SV.db.font.caps.size; for i = 1, #SystemFrameList4 do local this = _G["GameMenuButton"..SystemFrameList4[i]] if(this) then - this:SetButtonTemplate() + this:SetStylePanel("Button") end end if IsAddOnLoaded("OptionHouse") then - GameMenuButtonOptionHouse:SetButtonTemplate() + GameMenuButtonOptionHouse:SetStylePanel("Button") end do - GhostFrame:SetButtonTemplate() + GhostFrame:SetStylePanel("Button") GhostFrame:SetBackdropColor(0,0,0,0) GhostFrame:SetBackdropBorderColor(0,0,0,0) hooksecurefunc(GhostFrame, "SetBackdropColor", _hook_GhostFrameBackdropColor) hooksecurefunc(GhostFrame, "SetBackdropBorderColor", _hook_GhostFrameBackdropColor) GhostFrame:ClearAllPoints() - GhostFrame:SetPoint("TOP", SV.Screen, "TOP", 0, -150) - GhostFrameContentsFrame:SetButtonTemplate() + GhostFrame:SetPoint("CENTER", SVUI_SpecialAbility, "CENTER", 0, 0) + GhostFrameContentsFrame:SetStylePanel("Button") GhostFrameContentsFrameIcon:SetTexture(0,0,0,0) local x = CreateFrame("Frame", nil, GhostFrame) x:SetFrameStrata("MEDIUM") - x:SetFixedPanelTemplate("Default") - x:WrapOuter(GhostFrameContentsFrameIcon) + x:SetStylePanel("Fixed", "Default") + x:SetAllPointsOut(GhostFrameContentsFrameIcon) local tex = x:CreateTexture(nil, "OVERLAY") tex:SetTexture("Interface\\Icons\\spell_holy_guardianspirit") tex:SetTexCoord(0.1, 0.9, 0.1, 0.9) - tex:FillInner() + tex:SetAllPointsIn() end for i = 1, #SystemFrameList5 do local this = _G[SystemFrameList5[i].."Header"] @@ -515,7 +517,7 @@ local function SystemPanelQue() for i = 1, #SystemFrameList6 do local this = _G[SystemFrameList6[i]] if(this) then - this:SetButtonTemplate() + this:SetStylePanel("Button") end end VideoOptionsFrameCancel:ClearAllPoints() @@ -536,7 +538,7 @@ local function SystemPanelQue() ReadyCheckListenerFrame:SetAlpha(0) ReadyCheckFrame:HookScript("OnShow", function(self) if UnitIsUnit("player", self.initiator) then self:Hide() end end) StackSplitFrame:GetRegions():Hide() - RolePollPopup:SetFixedPanelTemplate("Transparent", true) + RolePollPopup:SetStylePanel("Fixed", "Transparent", true) InterfaceOptionsFrame:SetClampedToScreen(true) InterfaceOptionsFrame:SetMovable(true) InterfaceOptionsFrame:EnableMouse(true) @@ -551,54 +553,54 @@ local function SystemPanelQue() self:StopMovingOrSizing() end) if IsMacClient() then - MacOptionsFrame:SetFixedPanelTemplate("Default") + MacOptionsFrame:SetStylePanel("Fixed", "Default") MacOptionsFrameHeader:SetTexture(0,0,0,0) MacOptionsFrameHeader:ClearAllPoints() MacOptionsFrameHeader:SetPoint("TOP", MacOptionsFrame, 0, 0) - MacOptionsFrameMovieRecording:SetFixedPanelTemplate("Default") - MacOptionsITunesRemote:SetFixedPanelTemplate("Default") - MacOptionsFrameCancel:SetButtonTemplate() - MacOptionsFrameOkay:SetButtonTemplate() - MacOptionsButtonKeybindings:SetButtonTemplate() - MacOptionsFrameDefaults:SetButtonTemplate() - MacOptionsButtonCompress:SetButtonTemplate() + MacOptionsFrameMovieRecording:SetStylePanel("Fixed", "Default") + MacOptionsITunesRemote:SetStylePanel("Fixed", "Default") + MacOptionsFrameCancel:SetStylePanel("Button") + MacOptionsFrameOkay:SetStylePanel("Button") + MacOptionsButtonKeybindings:SetStylePanel("Button") + MacOptionsFrameDefaults:SetStylePanel("Button") + MacOptionsButtonCompress:SetStylePanel("Button") local tPoint, tRTo, tRP, tX, tY = MacOptionsButtonCompress:GetPoint() MacOptionsButtonCompress:SetWidth(136) MacOptionsButtonCompress:ClearAllPoints() - MacOptionsButtonCompress:Point(tPoint, tRTo, tRP, 4, tY) + MacOptionsButtonCompress:SetPointToScale(tPoint, tRTo, tRP, 4, tY) MacOptionsFrameCancel:SetWidth(96) MacOptionsFrameCancel:SetHeight(22) tPoint, tRTo, tRP, tX, tY = MacOptionsFrameCancel:GetPoint() MacOptionsFrameCancel:ClearAllPoints() - MacOptionsFrameCancel:Point(tPoint, tRTo, tRP, -14, tY) + MacOptionsFrameCancel:SetPointToScale(tPoint, tRTo, tRP, -14, tY) MacOptionsFrameOkay:ClearAllPoints() MacOptionsFrameOkay:SetWidth(96) MacOptionsFrameOkay:SetHeight(22) - MacOptionsFrameOkay:Point("LEFT",MacOptionsFrameCancel, -99,0) + MacOptionsFrameOkay:SetPointToScale("LEFT",MacOptionsFrameCancel, -99,0) MacOptionsButtonKeybindings:ClearAllPoints() MacOptionsButtonKeybindings:SetWidth(96) MacOptionsButtonKeybindings:SetHeight(22) - MacOptionsButtonKeybindings:Point("LEFT",MacOptionsFrameOkay, -99,0) + MacOptionsButtonKeybindings:SetPointToScale("LEFT",MacOptionsFrameOkay, -99,0) MacOptionsFrameDefaults:SetWidth(96) MacOptionsFrameDefaults:SetHeight(22) end OpacityFrame:RemoveTextures() - OpacityFrame:SetFixedPanelTemplate("Transparent", true) + OpacityFrame:SetStylePanel("Fixed", "Transparent", true) hooksecurefunc("UIDropDownMenu_InitializeHelper", function(self) for i = 1, UIDROPDOWNMENU_MAXLEVELS do local name = ("DropDownList%d"):format(i) local bg = _G[("%sBackdrop"):format(name)] - bg:SetBasicPanel() + bg:SetStylePanel("Default", 'Transparent') local menu = _G[("%sMenuBackdrop"):format(name)] - menu:SetBasicPanel() + menu:SetStylePanel("Default", 'Transparent') end end) for i=1, BattleTagInviteFrame:GetNumChildren() do local child = select(i, BattleTagInviteFrame:GetChildren()) if child:GetObjectType() == 'Button' then - child:SetButtonTemplate() + child:SetStylePanel("Button") end end @@ -606,7 +608,7 @@ local function SystemPanelQue() local frame = _G[SystemFrameList13[i]] if(frame) then frame:RemoveTextures() - frame:SetBasicPanel() + frame:SetStylePanel("Default", 'Transparent') end end @@ -629,7 +631,7 @@ local function SystemPanelQue() for i = 1, #SystemFrameList15 do local this = _G["InterfaceOptions"..SystemFrameList15[i]] if(this) then - this:SetCheckboxTemplate(true) + this:SetStylePanel("Checkbox", true) end end for i = 1, #SystemFrameList16 do @@ -638,11 +640,11 @@ local function SystemPanelQue() PLUGIN:ApplyDropdownStyle(this) end end - InterfaceOptionsHelpPanelResetTutorials:SetButtonTemplate() + InterfaceOptionsHelpPanelResetTutorials:SetStylePanel("Button") for i = 1, #SystemFrameList17 do local this = _G[SystemFrameList17[i]] if(this) then - this:SetCheckboxTemplate(true) + this:SetStylePanel("Checkbox", true) end end for i = 1, #SystemFrameList18 do @@ -654,18 +656,18 @@ local function SystemPanelQue() for i = 1, #SystemFrameList19 do local this = _G[SystemFrameList19[i]] if(this) then - this:SetButtonTemplate() + this:SetStylePanel("Button") end end AudioOptionsVoicePanelChatMode1KeyBindingButton:ClearAllPoints() - AudioOptionsVoicePanelChatMode1KeyBindingButton:Point("CENTER", AudioOptionsVoicePanelBinding, "CENTER", 0, -10) - CompactUnitFrameProfilesRaidStylePartyFrames:SetCheckboxTemplate(true) - CompactUnitFrameProfilesGeneralOptionsFrameResetPositionButton:SetButtonTemplate() + AudioOptionsVoicePanelChatMode1KeyBindingButton:SetPointToScale("CENTER", AudioOptionsVoicePanelBinding, "CENTER", 0, -10) + CompactUnitFrameProfilesRaidStylePartyFrames:SetStylePanel("Checkbox", true) + CompactUnitFrameProfilesGeneralOptionsFrameResetPositionButton:SetStylePanel("Button") for i = 1, #SystemFrameList20 do local this = _G["CompactUnitFrameProfilesGeneralOptionsFrame"..SystemFrameList20[i]] if(this) then - this:SetCheckboxTemplate(true) + this:SetStylePanel("Checkbox", true) this:SetFrameLevel(40) end end @@ -680,12 +682,12 @@ local function SystemPanelQue() Graphics_RightQuality:Die() MacOptionsFrame:RemoveTextures() - MacOptionsFrame:SetFixedPanelTemplate() - MacOptionsButtonCompress:SetButtonTemplate() - MacOptionsButtonKeybindings:SetButtonTemplate() - MacOptionsFrameDefaults:SetButtonTemplate() - MacOptionsFrameOkay:SetButtonTemplate() - MacOptionsFrameCancel:SetButtonTemplate() + MacOptionsFrame:SetStylePanel("Fixed") + MacOptionsButtonCompress:SetStylePanel("Button") + MacOptionsButtonKeybindings:SetStylePanel("Button") + MacOptionsFrameDefaults:SetStylePanel("Button") + MacOptionsFrameOkay:SetStylePanel("Button") + MacOptionsFrameCancel:SetStylePanel("Button") MacOptionsFrameMovieRecording:RemoveTextures() MacOptionsITunesRemote:RemoveTextures() MacOptionsFrameMisc:RemoveTextures() @@ -696,7 +698,7 @@ local function SystemPanelQue() for i = 1, 11 do local this = _G["MacOptionsFrameCheckButton"..i] if(this) then - this:SetCheckboxTemplate(true) + this:SetStylePanel("Checkbox", true) end end MacOptionsButtonKeybindings:ClearAllPoints() @@ -708,18 +710,18 @@ local function SystemPanelQue() MacOptionsFrameCancel:SetWidth(MacOptionsFrameCancel:GetWidth() - 6) ReportCheatingDialog:RemoveTextures() ReportCheatingDialogCommentFrame:RemoveTextures() - ReportCheatingDialogReportButton:SetButtonTemplate() - ReportCheatingDialogCancelButton:SetButtonTemplate() - ReportCheatingDialog:SetFixedPanelTemplate("Transparent", true) - ReportCheatingDialogCommentFrameEditBox:SetEditboxTemplate() + ReportCheatingDialogReportButton:SetStylePanel("Button") + ReportCheatingDialogCancelButton:SetStylePanel("Button") + ReportCheatingDialog:SetStylePanel("Fixed", "Transparent", true) + ReportCheatingDialogCommentFrameEditBox:SetStylePanel("Editbox") ReportPlayerNameDialog:RemoveTextures() ReportPlayerNameDialogCommentFrame:RemoveTextures() - ReportPlayerNameDialogCommentFrameEditBox:SetEditboxTemplate() - ReportPlayerNameDialog:SetFixedPanelTemplate("Transparent", true) - ReportPlayerNameDialogReportButton:SetButtonTemplate() - ReportPlayerNameDialogCancelButton:SetButtonTemplate() + ReportPlayerNameDialogCommentFrameEditBox:SetStylePanel("Editbox") + ReportPlayerNameDialog:SetStylePanel("Fixed", "Transparent", true) + ReportPlayerNameDialogReportButton:SetStylePanel("Button") + ReportPlayerNameDialogCancelButton:SetStylePanel("Button") PLUGIN:ApplyCloseButtonStyle(SideDressUpModelCloseButton) - SideDressUpModelResetButton:SetButtonTemplate() + SideDressUpModelResetButton:SetStylePanel("Button") end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tabard.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tabard.lua index c13fc8c..6930f14 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tabard.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tabard.lua @@ -58,10 +58,10 @@ local function TabardFrameStyle() return end cleanT(TabardFrame, true) - TabardFrame:SetPanelTemplate("Action", false) - TabardModel:SetFixedPanelTemplate("Transparent") - TabardFrameCancelButton:SetButtonTemplate() - TabardFrameAcceptButton:SetButtonTemplate() + TabardFrame:SetStylePanel("Default", "Action", false) + TabardModel:SetStylePanel("Fixed", "Transparent") + TabardFrameCancelButton:SetStylePanel("Button") + TabardFrameAcceptButton:SetStylePanel("Button") PLUGIN:ApplyCloseButtonStyle(TabardFrameCloseButton) TabardFrameCostFrame:RemoveTextures() TabardFrameCustomizationFrame:RemoveTextures() @@ -74,10 +74,10 @@ local function TabardFrameStyle() PLUGIN:ApplyPaginationStyle(_G[c.."RightButton"]) if b > 1 then _G[c]:ClearAllPoints() - _G[c]:Point("TOP", _G["TabardFrameCustomization"..b-1], "BOTTOM", 0, -6) + _G[c]:SetPointToScale("TOP", _G["TabardFrameCustomization"..b-1], "BOTTOM", 0, -6) else local d, e, f, g, h = _G[c]:GetPoint() - _G[c]:Point(d, e, f, g, h + 4) + _G[c]:SetPointToScale(d, e, f, g, h + 4) end end TabardCharacterModelRotateLeftButton:SetPoint("BOTTOMLEFT", 4, 4) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/talents.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/talents.lua index 3f4e598..14101c4 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/talents.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/talents.lua @@ -53,13 +53,13 @@ local function ChangeTabHelper(this) local nTex = this:GetNormalTexture() if(nTex) then nTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) - nTex:FillInner() + nTex:SetAllPointsIn() end this.pushed = true; this.backdrop = CreateFrame("Frame", nil, this) - this.backdrop:WrapOuter(this,1,1) + this.backdrop:SetAllPointsOut(this,1,1) this.backdrop:SetFrameLevel(0) this.backdrop:SetBackdrop({ bgFile = [[Interface\BUTTONS\WHITE8X8]], @@ -84,19 +84,19 @@ local function StyleGlyphHolder(holder, offset) if holder.styled then return end local outer = holder:CreateTexture(nil, "OVERLAY") - outer:WrapOuter(holder, offset, offset) + outer:SetAllPointsOut(holder, offset, offset) outer:SetTexture(borderTex) outer:SetGradient(unpack(SV.Media.gradient.class)) local hover = holder:CreateTexture(nil, "HIGHLIGHT") - hover:WrapOuter(holder, offset, offset) + hover:SetAllPointsOut(holder, offset, offset) hover:SetTexture(borderTex) hover:SetGradient(unpack(SV.Media.gradient.yellow)) holder.hover = hover if holder.SetDisabledTexture then local disabled = holder:CreateTexture(nil, "BORDER") - disabled:WrapOuter(holder, offset, offset) + disabled:SetAllPointsOut(holder, offset, offset) disabled:SetTexture(borderTex) disabled:SetGradient(unpack(SV.Media.gradient.default)) holder:SetDisabledTexture(disabled) @@ -105,7 +105,7 @@ local function StyleGlyphHolder(holder, offset) local cd = holder:GetName() and _G[holder:GetName().."Cooldown"] if cd then cd:ClearAllPoints() - cd:FillInner() + cd:SetAllPointsIn() end holder.styled = true end @@ -123,42 +123,42 @@ local function TalentFrameStyle() PlayerTalentFrameTalents:RemoveTextures() PlayerTalentFrameTalentsClearInfoFrame:RemoveTextures() - PlayerTalentFrame.Panel:Point("BOTTOMRIGHT", PlayerTalentFrame, "BOTTOMRIGHT", 0, -5) + PlayerTalentFrame.Panel:SetPointToScale("BOTTOMRIGHT", PlayerTalentFrame, "BOTTOMRIGHT", 0, -5) PlayerTalentFrameSpecializationTutorialButton:Die() PlayerTalentFrameTalentsTutorialButton:Die() PlayerTalentFramePetSpecializationTutorialButton:Die() PLUGIN:ApplyCloseButtonStyle(PlayerTalentFrameCloseButton) - PlayerTalentFrameActivateButton:SetButtonTemplate() + PlayerTalentFrameActivateButton:SetStylePanel("Button") for _,name in pairs(SpecButtonList)do local button = _G[name]; if(button) then button:RemoveTextures() - button:SetButtonTemplate() + button:SetStylePanel("Button") local initialAnchor, anchorParent, relativeAnchor, xPosition, yPosition = button:GetPoint() button:SetPoint(initialAnchor, anchorParent, relativeAnchor, xPosition, -28) end end - PlayerTalentFrameTalents:SetFixedPanelTemplate("Inset") + PlayerTalentFrameTalents:SetStylePanel("Fixed", "Inset") PlayerTalentFrameTalentsClearInfoFrame.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - PlayerTalentFrameTalentsClearInfoFrame:Width(PlayerTalentFrameTalentsClearInfoFrame:GetWidth()-2) - PlayerTalentFrameTalentsClearInfoFrame:Height(PlayerTalentFrameTalentsClearInfoFrame:GetHeight()-2) - PlayerTalentFrameTalentsClearInfoFrame.icon:Size(PlayerTalentFrameTalentsClearInfoFrame:GetSize()) - PlayerTalentFrameTalentsClearInfoFrame:Point('TOPLEFT', PlayerTalentFrameTalents, 'BOTTOMLEFT', 8, -8) + PlayerTalentFrameTalentsClearInfoFrame:SetWidthToScale(PlayerTalentFrameTalentsClearInfoFrame:GetWidth()-2) + PlayerTalentFrameTalentsClearInfoFrame:SetHeightToScale(PlayerTalentFrameTalentsClearInfoFrame:GetHeight()-2) + PlayerTalentFrameTalentsClearInfoFrame.icon:SetSizeToScale(PlayerTalentFrameTalentsClearInfoFrame:GetSize()) + PlayerTalentFrameTalentsClearInfoFrame:SetPointToScale('TOPLEFT', PlayerTalentFrameTalents, 'BOTTOMLEFT', 8, -8) for i = 1, 4 do PLUGIN:ApplyTabStyle(_G["PlayerTalentFrameTab"..i]) if i == 1 then local d, e, k, g = _G["PlayerTalentFrameTab"..i]:GetPoint() - _G["PlayerTalentFrameTab"..i]:Point(d, e, k, g, -4) + _G["PlayerTalentFrameTab"..i]:SetPointToScale(d, e, k, g, -4) end end hooksecurefunc("PlayerTalentFrame_UpdateTabs", function() for i = 1, 4 do local d, e, k, g = _G["PlayerTalentFrameTab"..i]:GetPoint() - _G["PlayerTalentFrameTab"..i]:Point(d, e, k, g, -4) + _G["PlayerTalentFrameTab"..i]:SetPointToScale(d, e, k, g, -4) end end) @@ -173,7 +173,7 @@ local function TalentFrameStyle() hooksecurefunc("PlayerTalentFrame_UpdateSpecs", function() local d, x, f, g, h = PlayerSpecTab1:GetPoint() - PlayerSpecTab1:Point(d, x, f, -1, h) + PlayerSpecTab1:SetPointToScale(d, x, f, -1, h) end) local maxTiers = MAX_TALENT_TIERS @@ -187,8 +187,8 @@ local function TalentFrameStyle() rowFrame:DisableDrawLayer("BORDER") rowFrame:RemoveTextures() - rowFrame.TopLine:Point("TOP", 0, 4) - rowFrame.BottomLine:Point("BOTTOM", 0, -4) + rowFrame.TopLine:SetPointToScale("TOP", 0, 4) + rowFrame.BottomLine:SetPointToScale("BOTTOM", 0, -4) for z = 1, NUM_TALENT_COLUMNS do local talentItem = _G[("%sTalent%d"):format(gName, z)] @@ -225,50 +225,58 @@ local function TalentFrameStyle() local C = _G["PlayerTalentFrameSpecializationSpellScrollFrameScrollChild"] C.ring:Hide() - C:SetFixedPanelTemplate("Inset") - C.Panel:WrapOuter(C.specIcon) + C:SetStylePanel("Fixed", "Inset") + C.Panel:SetAllPointsOut(C.specIcon) C.specIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) local D = _G["PlayerTalentFramePetSpecializationSpellScrollFrameScrollChild"] D.ring:Hide() - D:SetFixedPanelTemplate("Inset") - D.Panel:WrapOuter(D.specIcon) + D:SetStylePanel("Fixed", "Inset") + D.Panel:SetAllPointsOut(D.specIcon) D.specIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - hooksecurefunc("PlayerTalentFrame_UpdateSpecFrame", function(i, E) - local F = GetSpecialization(nil, i.isPet, PlayerSpecTab2:GetChecked() and 2 or 1) - local G = E or F or 1; - local H, p, p, icon = GetSpecializationInfo(G, nil, i.isPet) - local I = i.spellsScroll.child; - I.specIcon:SetTexture(icon) - local J = 1; - local K; - if i.isPet then - K = { GetSpecializationSpells(G, nil, i.isPet) } + hooksecurefunc("PlayerTalentFrame_UpdateSpecFrame", function(self, arg1) + local arg2 = GetSpecialization(nil, self.isPet, PlayerSpecTab2:GetChecked() and 2 or 1) + local spec = arg1 or arg2 or 1; + local arg3, _, _, icon = GetSpecializationInfo(spec, nil, self.isPet) + local scrollChild = self.spellsScroll.child; + scrollChild.specIcon:SetTexture(icon) + + local cache; + if self.isPet then + cache = { GetSpecializationSpells(spec, nil, self.isPet) } else - K = SPEC_SPELLS_DISPLAY[H] - end - for b = 1, #K, 2 do - local L = I["abilityButton"..J] - local p, icon = GetSpellTexture(K[b]) - L.icon:SetTexture(icon) - if not L.restyled then - L.restyled = true;L:Size(30, 30) - L.ring:Hide() - L:SetFixedPanelTemplate("Inset") - L.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - L.icon:FillInner() - end - J = J+1 - end - for b = 1, GetNumSpecializations(nil, i.isPet)do - local A = i["specButton"..b] - A.SelectedTexture:FillInner(A.Panel) - if A.selected then - A.SelectedTexture:Show() - else - A.SelectedTexture:Hide() - end + cache = SPEC_SPELLS_DISPLAY[arg3] + end + + local indexOffset = 1; + for i = 1, #cache, 2 do + local button = scrollChild["abilityButton" .. indexOffset] + if(button) then + local _, icon = GetSpellTexture(cache[i]) + button.icon:SetTexture(icon) + if not button.restyled then + button.restyled = true; + button:SetSizeToScale(30, 30) + button.ring:Hide() + button:SetStylePanel("Fixed", "Inset") + button.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + button.icon:SetAllPointsIn() + end + end + indexOffset = indexOffset + 1 + end + + for i = 1, GetNumSpecializations(nil, self.isPet)do + local specButton = self["specButton"..i] + if(specButton) then + specButton.SelectedTexture:SetAllPointsIn(specButton.Panel) + if specButton.selected then + specButton.SelectedTexture:Show() + else + specButton.SelectedTexture:Hide() + end + end end end) @@ -280,7 +288,7 @@ local function TalentFrameStyle() button.specIcon:SetTexture(icon) button.specIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) button.specIcon:SetSize(50, 50) - button.specIcon:Point("LEFT", button, "LEFT", 15, 0) + button.specIcon:SetPointToScale("LEFT", button, "LEFT", 15, 0) button.SelectedTexture = button:CreateTexture(nil, 'ARTWORK') button.SelectedTexture:SetTexture(1, 1, 0, 0.1) end @@ -301,8 +309,8 @@ local function TalentFrameStyle() button.bg:SetAlpha(0) button.learnedTex:SetAlpha(0) button.selectedTex:SetAlpha(0) - button:SetFixedPanelTemplate("Button") - button:GetHighlightTexture():FillInner(button.Panel) + button:SetStylePanel("Fixed", "Button") + button:GetHighlightTexture():SetAllPointsIn(button.Panel) end end end @@ -327,7 +335,7 @@ local function TalentFrameStyle() A.specIcon:SetTexture(icon) A.specIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) A.specIcon:SetSize(50, 50) - A.specIcon:Point("LEFT", A, "LEFT", 15, 0) + A.specIcon:SetPointToScale("LEFT", A, "LEFT", 15, 0) A.SelectedTexture = A:CreateTexture(nil, 'ARTWORK') A.SelectedTexture:SetTexture(1, 1, 0, 0.1) end @@ -356,16 +364,16 @@ local function GlyphStyle() GlyphFrame:RemoveTextures() --GlyphFrame.background:ClearAllPoints() --GlyphFrame.background:SetAllPoints(PlayerTalentFrameInset) - GlyphFrame:SetFixedPanelTemplate("Comic", false, 0, 3, 3) + GlyphFrame:SetStylePanel("Fixed", "Comic", false, 0, 3, 3) GlyphFrameSideInset:RemoveTextures() GlyphFrameClearInfoFrame:RemoveTextures() GlyphFrameClearInfoFrame.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9 ) - GlyphFrameClearInfoFrame:Width(GlyphFrameClearInfoFrame:GetWidth()-2) - GlyphFrameClearInfoFrame:Height(GlyphFrameClearInfoFrame:GetHeight()-2) - GlyphFrameClearInfoFrame.icon:Size(GlyphFrameClearInfoFrame:GetSize()) - GlyphFrameClearInfoFrame:Point("TOPLEFT", GlyphFrame, "BOTTOMLEFT", 6, -10) + GlyphFrameClearInfoFrame:SetWidthToScale(GlyphFrameClearInfoFrame:GetWidth()-2) + GlyphFrameClearInfoFrame:SetHeightToScale(GlyphFrameClearInfoFrame:GetHeight()-2) + GlyphFrameClearInfoFrame.icon:SetSizeToScale(GlyphFrameClearInfoFrame:GetSize()) + GlyphFrameClearInfoFrame:SetPointToScale("TOPLEFT", GlyphFrame, "BOTTOMLEFT", 6, -10) PLUGIN:ApplyDropdownStyle(GlyphFrameFilterDropDown, 212) - GlyphFrameSearchBox:SetEditboxTemplate() + GlyphFrameSearchBox:SetStylePanel("Editbox") PLUGIN:ApplyScrollFrameStyle(GlyphFrameScrollFrameScrollBar, 5) for b = 1, 10 do @@ -390,7 +398,7 @@ local function GlyphStyle() GlyphFrameHeader1:RemoveTextures() GlyphFrameHeader2:RemoveTextures() - GlyphFrameScrollFrame:SetPanelTemplate("Inset", false, 3, 2, 2) + GlyphFrameScrollFrame:SetStylePanel("Default", "Inset", false, 3, 2, 2) end PLUGIN:SaveBlizzardStyle("Blizzard_GlyphUI", GlyphStyle) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/taxi.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/taxi.lua index 9c2cbb1..9e874ab 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/taxi.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/taxi.lua @@ -34,8 +34,8 @@ local function TaxiStyle() PLUGIN:ApplyWindowStyle(TaxiFrame) - --TaxiRouteMap:SetPanelTemplate("Blackout") - --TaxiRouteMap.Panel:WrapOuter(TaxiRouteMap, 4, 4) + --TaxiRouteMap:SetStylePanel("Default", "Blackout") + --TaxiRouteMap.Panel:SetAllPointsOut(TaxiRouteMap, 4, 4) PLUGIN:ApplyCloseButtonStyle(TaxiFrame.CloseButton) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/timemanager.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/timemanager.lua index 261a7a4..86b1446 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/timemanager.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/timemanager.lua @@ -39,32 +39,32 @@ local function TimeManagerStyle() PLUGIN:ApplyDropdownStyle(TimeManagerAlarmHourDropDown, 80) PLUGIN:ApplyDropdownStyle(TimeManagerAlarmMinuteDropDown, 80) PLUGIN:ApplyDropdownStyle(TimeManagerAlarmAMPMDropDown, 80) - TimeManagerAlarmMessageEditBox:SetEditboxTemplate() - TimeManagerAlarmEnabledButton:SetCheckboxTemplate(true) - TimeManagerMilitaryTimeCheck:SetCheckboxTemplate(true) - TimeManagerLocalTimeCheck:SetCheckboxTemplate(true) + TimeManagerAlarmMessageEditBox:SetStylePanel("Editbox") + TimeManagerAlarmEnabledButton:SetStylePanel("Checkbox", true) + TimeManagerMilitaryTimeCheck:SetStylePanel("Checkbox", true) + TimeManagerLocalTimeCheck:SetStylePanel("Checkbox", true) TimeManagerStopwatchFrame:RemoveTextures() - TimeManagerStopwatchCheck:SetFixedPanelTemplate("Default") + TimeManagerStopwatchCheck:SetStylePanel("Fixed", "Default") TimeManagerStopwatchCheck:GetNormalTexture():SetTexCoord(0.1, 0.9, 0.1, 0.9) - TimeManagerStopwatchCheck:GetNormalTexture():FillInner() + TimeManagerStopwatchCheck:GetNormalTexture():SetAllPointsIn() local sWatch = TimeManagerStopwatchCheck:CreateTexture(nil, "OVERLAY") sWatch:SetTexture(1, 1, 1, 0.3) - sWatch:Point("TOPLEFT", TimeManagerStopwatchCheck, 2, -2) - sWatch:Point("BOTTOMRIGHT", TimeManagerStopwatchCheck, -2, 2) + sWatch:SetPointToScale("TOPLEFT", TimeManagerStopwatchCheck, 2, -2) + sWatch:SetPointToScale("BOTTOMRIGHT", TimeManagerStopwatchCheck, -2, 2) TimeManagerStopwatchCheck:SetHighlightTexture(sWatch) StopwatchFrame:RemoveTextures() - StopwatchFrame:SetBasicPanel() - StopwatchFrame.Panel:Point("TOPLEFT", 0, -17) - StopwatchFrame.Panel:Point("BOTTOMRIGHT", 0, 2) + StopwatchFrame:SetStylePanel("Default", 'Transparent') + StopwatchFrame.Panel:SetPointToScale("TOPLEFT", 0, -17) + StopwatchFrame.Panel:SetPointToScale("BOTTOMRIGHT", 0, 2) StopwatchTabFrame:RemoveTextures() PLUGIN:ApplyCloseButtonStyle(StopwatchCloseButton) PLUGIN:ApplyPaginationStyle(StopwatchPlayPauseButton) PLUGIN:ApplyPaginationStyle(StopwatchResetButton) - StopwatchPlayPauseButton:Point("RIGHT", StopwatchResetButton, "LEFT", -4, 0) - StopwatchResetButton:Point("BOTTOMRIGHT", StopwatchFrame, "BOTTOMRIGHT", -4, 6) + StopwatchPlayPauseButton:SetPointToScale("RIGHT", StopwatchResetButton, "LEFT", -4, 0) + StopwatchResetButton:SetPointToScale("BOTTOMRIGHT", StopwatchFrame, "BOTTOMRIGHT", -4, 6) end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/trade.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/trade.lua index ce09649..cfc4c42 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/trade.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/trade.lua @@ -38,12 +38,12 @@ local function TradeFrameStyle() PLUGIN:ApplyWindowStyle(TradeFrame, true) TradeFrameInset:Die() - TradeFrameTradeButton:SetButtonTemplate() - TradeFrameCancelButton:SetButtonTemplate() + TradeFrameTradeButton:SetStylePanel("Button") + TradeFrameCancelButton:SetStylePanel("Button") PLUGIN:ApplyCloseButtonStyle(TradeFrameCloseButton, TradeFrame.Panel) - TradePlayerInputMoneyFrameGold:SetEditboxTemplate() - TradePlayerInputMoneyFrameSilver:SetEditboxTemplate() - TradePlayerInputMoneyFrameCopper:SetEditboxTemplate() + TradePlayerInputMoneyFrameGold:SetStylePanel("Editbox") + TradePlayerInputMoneyFrameSilver:SetStylePanel("Editbox") + TradePlayerInputMoneyFrameCopper:SetStylePanel("Editbox") TradeRecipientItemsInset:Die() TradePlayerItemsInset:Die() TradePlayerInputMoneyInset:Die() @@ -56,9 +56,9 @@ local function TradeFrameStyle() "TradePlayerInputMoneyFrameCopper" } for _,frame in pairs(inputs)do - _G[frame]:SetEditboxTemplate() - _G[frame].Panel:Point("TOPLEFT", -2, 1) - _G[frame].Panel:Point("BOTTOMRIGHT", -12, -1) + _G[frame]:SetStylePanel("Editbox") + _G[frame].Panel:SetPointToScale("TOPLEFT", -2, 1) + _G[frame].Panel:SetPointToScale("BOTTOMRIGHT", -12, -1) _G[frame]:SetTextInsets(-1, -1, -2, -2) end for i = 1, 7 do @@ -73,22 +73,22 @@ local function TradeFrameStyle() X:RemoveTextures() Y:RemoveTextures() Z:RemoveTextures() - b:FillInner(Y) + b:SetAllPointsIn(Y) b:SetTexCoord(0.1, 0.9, 0.1, 0.9) - Y:SetFixedPanelTemplate("Button", true) - Y:SetButtonTemplate() + Y:SetStylePanel("Fixed", "Button", true) + Y:SetStylePanel("Button") Y.bg = CreateFrame("Frame", nil, Y) - Y.bg:SetPanelTemplate("Inset") + Y.bg:SetStylePanel("Default", "Inset") Y.bg:SetPoint("TOPLEFT", Y, "TOPRIGHT", 4, 0) Y.bg:SetPoint("BOTTOMRIGHT", _G["TradePlayerItem"..i.."NameFrame"], "BOTTOMRIGHT", 0, 14) Y.bg:SetFrameLevel(Y:GetFrameLevel()-3) Y:SetFrameLevel(Y:GetFrameLevel()-1) - z:FillInner(Z) + z:SetAllPointsIn(Z) z:SetTexCoord(0.1, 0.9, 0.1, 0.9) - Z:SetFixedPanelTemplate("Button", true) - Z:SetButtonTemplate() + Z:SetStylePanel("Fixed", "Button", true) + Z:SetStylePanel("Button") Z.bg = CreateFrame("Frame", nil, Z) - Z.bg:SetPanelTemplate("Inset") + Z.bg:SetStylePanel("Default", "Inset") Z.bg:SetPoint("TOPLEFT", Z, "TOPRIGHT", 4, 0) Z.bg:SetPoint("BOTTOMRIGHT", _G["TradeRecipientItem"..i.."NameFrame"], "BOTTOMRIGHT", 0, 14) Z.bg:SetFrameLevel(Z:GetFrameLevel()-3) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tradeskill (Failbox's conflicted copy 2014-12-26).lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tradeskill (Failbox's conflicted copy 2014-12-26).lua new file mode 100644 index 0000000..5dc3908 --- /dev/null +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tradeskill (Failbox's conflicted copy 2014-12-26).lua @@ -0,0 +1,127 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +--]] +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +--[[ ADDON ]]-- +local SV = _G.SVUI; +local L = SV.L; +local PLUGIN = select(2, ...); +local Schema = PLUGIN.Schema; +--[[ +########################################################## +TRADESKILL PLUGINR +########################################################## +]]-- +local function TradeSkillStyle() + if PLUGIN.db.blizzard.enable ~= true or PLUGIN.db.blizzard.tradeskill ~= true then + return + end + + TradeSkillListScrollFrame:RemoveTextures() + TradeSkillDetailScrollFrame:RemoveTextures() + TradeSkillFrameInset:RemoveTextures() + TradeSkillExpandButtonFrame:RemoveTextures() + TradeSkillDetailScrollChildFrame:RemoveTextures() + TradeSkillRankFrame:RemoveTextures() + TradeSkillCreateButton:RemoveTextures(true) + TradeSkillCancelButton:RemoveTextures(true) + TradeSkillFilterButton:RemoveTextures(true) + TradeSkillCreateAllButton:RemoveTextures(true) + TradeSkillViewGuildCraftersButton:RemoveTextures(true) + + PLUGIN:ApplyWindowStyle(TradeSkillFrame, true, true) + PLUGIN:ApplyWindowStyle(TradeSkillGuildFrame) + + TradeSkillGuildFrame:SetPointToScale("BOTTOMLEFT", TradeSkillFrame, "BOTTOMRIGHT", 3, 19) + TradeSkillGuildFrameContainer:RemoveTextures() + TradeSkillGuildFrameContainer:SetStylePanel("Default", "Inset") + PLUGIN:ApplyCloseButtonStyle(TradeSkillGuildFrameCloseButton) + + TradeSkillRankFrame:SetStylePanel("Default", "Bar", true) + TradeSkillRankFrame:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) + TradeSkillListScrollFrame:SetStylePanel("Default", "Inset") + TradeSkillDetailScrollFrame:SetStylePanel("Default", "Inset") + + TradeSkillCreateButton:SetStylePanel("Button") + TradeSkillCancelButton:SetStylePanel("Button") + TradeSkillFilterButton:SetStylePanel("Button") + TradeSkillCreateAllButton:SetStylePanel("Button") + TradeSkillViewGuildCraftersButton:SetStylePanel("Button") + + PLUGIN:ApplyScrollFrameStyle(TradeSkillListScrollFrameScrollBar) + PLUGIN:ApplyScrollFrameStyle(TradeSkillDetailScrollFrameScrollBar) + + TradeSkillLinkButton:SetSizeToScale(17, 14) + TradeSkillLinkButton:SetPointToScale("LEFT", TradeSkillLinkFrame, "LEFT", 5, -1) + TradeSkillLinkButton:SetStylePanel("Button", nil, nil, nil, nil, true) + TradeSkillLinkButton:GetNormalTexture():SetTexCoord(0.25, 0.7, 0.45, 0.8) + + TradeSkillFrameSearchBox:SetStylePanel("Editbox") + TradeSkillInputBox:SetStylePanel("Editbox") + + PLUGIN:ApplyPaginationStyle(TradeSkillDecrementButton) + PLUGIN:ApplyPaginationStyle(TradeSkillIncrementButton) + + TradeSkillIncrementButton:SetPointToScale("RIGHT", TradeSkillCreateButton, "LEFT", -13, 0) + PLUGIN:ApplyCloseButtonStyle(TradeSkillFrameCloseButton) + + TradeSkillSkillIcon:SetStylePanel("Fixed", "Slot") + + local internalTest = false; + + hooksecurefunc("TradeSkillFrame_SetSelection", function(_) + TradeSkillSkillIcon:SetStylePanel("Fixed", "Slot") + if TradeSkillSkillIcon:GetNormalTexture() then + TradeSkillSkillIcon:GetNormalTexture():SetTexCoord(0.1, 0.9, 0.1, 0.9) + end + for i=1, MAX_TRADE_SKILL_REAGENTS do + local u = _G["TradeSkillReagent"..i] + local icon = _G["TradeSkillReagent"..i.."IconTexture"] + local a1 = _G["TradeSkillReagent"..i.."Count"] + icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + icon:SetDrawLayer("OVERLAY") + if not icon.backdrop then + local a2 = CreateFrame("Frame", nil, u) + if u:GetFrameLevel()-1 >= 0 then + a2:SetFrameLevel(u:GetFrameLevel()-1) + else + a2:SetFrameLevel(0) + end + a2:SetAllPointsOut(icon) + a2:SetStylePanel("Fixed", "Slot") + icon:SetParent(a2) + icon.backdrop = a2 + end + a1:SetParent(icon.backdrop) + a1:SetDrawLayer("OVERLAY") + if i > 2 and internalTest == false then + local d, a3, f, g, h = u:GetPoint() + u:ClearAllPoints() + u:SetPointToScale(d, a3, f, g, h-3) + internalTest = true + end + _G["TradeSkillReagent"..i.."NameFrame"]:Die() + end + end) +end +--[[ +########################################################## +PLUGIN LOADING +########################################################## +]]-- +PLUGIN:SaveBlizzardStyle("Blizzard_TradeSkillUI",TradeSkillStyle) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tradeskill.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tradeskill.lua index ed9f8eb..25a34ff 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tradeskill.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tradeskill.lua @@ -44,48 +44,61 @@ local function TradeSkillStyle() TradeSkillCreateAllButton:RemoveTextures(true) TradeSkillViewGuildCraftersButton:RemoveTextures(true) + for i = 9, 18 do + local lastLine = "TradeSkillSkill" .. (i - 1); + local newLine = CreateFrame("Button", "TradeSkillSkill" .. i, TradeSkillFrame, "TradeSkillSkillButtonTemplate") + newLine:SetPoint("TOPLEFT", lastLine, "BOTTOMLEFT", 0, 0) + end + _G.TRADE_SKILLS_DISPLAYED = 18; + + local curWidth,curHeight = TradeSkillFrame:GetSize() + local enlargedHeight = curHeight + 170; + TradeSkillFrame:SetSizeToScale(curWidth + 30, curHeight + 166) PLUGIN:ApplyWindowStyle(TradeSkillFrame, true, true) PLUGIN:ApplyWindowStyle(TradeSkillGuildFrame) - TradeSkillGuildFrame:Point("BOTTOMLEFT", TradeSkillFrame, "BOTTOMRIGHT", 3, 19) + TradeSkillGuildFrame:SetPointToScale("BOTTOMLEFT", TradeSkillFrame, "BOTTOMRIGHT", 3, 19) TradeSkillGuildFrameContainer:RemoveTextures() - TradeSkillGuildFrameContainer:SetPanelTemplate("Inset") + TradeSkillGuildFrameContainer:SetStylePanel("Default", "Inset") PLUGIN:ApplyCloseButtonStyle(TradeSkillGuildFrameCloseButton) - TradeSkillRankFrame:SetPanelTemplate("Bar", true) + TradeSkillRankFrame:SetStylePanel("Default", "Bar", true) TradeSkillRankFrame:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) - TradeSkillListScrollFrame:SetPanelTemplate("Inset") - TradeSkillDetailScrollFrame:SetPanelTemplate("Inset") - TradeSkillCreateButton:SetButtonTemplate() - TradeSkillCancelButton:SetButtonTemplate() - TradeSkillFilterButton:SetButtonTemplate() - TradeSkillCreateAllButton:SetButtonTemplate() - TradeSkillViewGuildCraftersButton:SetButtonTemplate() + TradeSkillListScrollFrame:SetSizeToScale(327, 290) + TradeSkillListScrollFrame:SetStylePanel("Default", "Inset") + TradeSkillDetailScrollFrame:SetSizeToScale(327, 180) + TradeSkillDetailScrollFrame:SetStylePanel("Default", "Inset") + + TradeSkillCreateButton:SetStylePanel("Button") + TradeSkillCancelButton:SetStylePanel("Button") + TradeSkillFilterButton:SetStylePanel("Button") + TradeSkillCreateAllButton:SetStylePanel("Button") + TradeSkillViewGuildCraftersButton:SetStylePanel("Button") PLUGIN:ApplyScrollFrameStyle(TradeSkillListScrollFrameScrollBar) PLUGIN:ApplyScrollFrameStyle(TradeSkillDetailScrollFrameScrollBar) - TradeSkillLinkButton:Size(17, 14) - TradeSkillLinkButton:Point("LEFT", TradeSkillLinkFrame, "LEFT", 5, -1) - TradeSkillLinkButton:SetButtonTemplate(nil, nil, nil, nil, true) + TradeSkillLinkButton:SetSizeToScale(17, 14) + TradeSkillLinkButton:SetPointToScale("LEFT", TradeSkillLinkFrame, "LEFT", 5, -1) + TradeSkillLinkButton:SetStylePanel("Button", nil, nil, nil, nil, true) TradeSkillLinkButton:GetNormalTexture():SetTexCoord(0.25, 0.7, 0.45, 0.8) - TradeSkillFrameSearchBox:SetEditboxTemplate() - TradeSkillInputBox:SetEditboxTemplate() + TradeSkillFrameSearchBox:SetStylePanel("Editbox") + TradeSkillInputBox:SetStylePanel("Editbox") PLUGIN:ApplyPaginationStyle(TradeSkillDecrementButton) PLUGIN:ApplyPaginationStyle(TradeSkillIncrementButton) - TradeSkillIncrementButton:Point("RIGHT", TradeSkillCreateButton, "LEFT", -13, 0) + TradeSkillIncrementButton:SetPointToScale("RIGHT", TradeSkillCreateButton, "LEFT", -13, 0) PLUGIN:ApplyCloseButtonStyle(TradeSkillFrameCloseButton) - TradeSkillSkillIcon:SetFixedPanelTemplate("Slot") + TradeSkillSkillIcon:SetStylePanel("Fixed", "Slot") local internalTest = false; hooksecurefunc("TradeSkillFrame_SetSelection", function(_) - TradeSkillSkillIcon:SetFixedPanelTemplate("Slot") + TradeSkillSkillIcon:SetStylePanel("Fixed", "Slot") if TradeSkillSkillIcon:GetNormalTexture() then TradeSkillSkillIcon:GetNormalTexture():SetTexCoord(0.1, 0.9, 0.1, 0.9) end @@ -102,8 +115,8 @@ local function TradeSkillStyle() else a2:SetFrameLevel(0) end - a2:WrapOuter(icon) - a2:SetFixedPanelTemplate("Slot") + a2:SetAllPointsOut(icon) + a2:SetStylePanel("Fixed", "Slot") icon:SetParent(a2) icon.backdrop = a2 end @@ -112,7 +125,7 @@ local function TradeSkillStyle() if i > 2 and internalTest == false then local d, a3, f, g, h = u:GetPoint() u:ClearAllPoints() - u:Point(d, a3, f, g, h-3) + u:SetPointToScale(d, a3, f, g, h-3) internalTest = true end _G["TradeSkillReagent"..i.."NameFrame"]:Die() diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/trainer.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/trainer.lua index 6d0cf9c..3e1bad6 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/trainer.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/trainer.lua @@ -57,13 +57,13 @@ local function TrainerStyle() for i=1, 8 do _G["ClassTrainerScrollFrameButton"..i]:RemoveTextures() - _G["ClassTrainerScrollFrameButton"..i]:SetFixedPanelTemplate() - _G["ClassTrainerScrollFrameButton"..i]:SetButtonTemplate() + _G["ClassTrainerScrollFrameButton"..i]:SetStylePanel("Fixed") + _G["ClassTrainerScrollFrameButton"..i]:SetStylePanel("Button") _G["ClassTrainerScrollFrameButton"..i.."Icon"]:SetTexCoord(0.1, 0.9, 0.1, 0.9) - _G["ClassTrainerScrollFrameButton"..i].Panel:WrapOuter(_G["ClassTrainerScrollFrameButton"..i.."Icon"]) + _G["ClassTrainerScrollFrameButton"..i].Panel:SetAllPointsOut(_G["ClassTrainerScrollFrameButton"..i.."Icon"]) _G["ClassTrainerScrollFrameButton"..i.."Icon"]:SetParent(_G["ClassTrainerScrollFrameButton"..i].Panel) _G["ClassTrainerScrollFrameButton"..i].selectedTex:SetTexture(1, 1, 1, 0.3) - _G["ClassTrainerScrollFrameButton"..i].selectedTex:FillInner() + _G["ClassTrainerScrollFrameButton"..i].selectedTex:SetAllPointsIn() end PLUGIN:ApplyScrollFrameStyle(ClassTrainerScrollFrameScrollBar, 5) @@ -77,19 +77,19 @@ local function TrainerStyle() end _G["ClassTrainerTrainButton"]:RemoveTextures() - _G["ClassTrainerTrainButton"]:SetButtonTemplate() + _G["ClassTrainerTrainButton"]:SetStylePanel("Button") PLUGIN:ApplyDropdownStyle(ClassTrainerFrameFilterDropDown, 155) - ClassTrainerScrollFrame:SetFixedPanelTemplate("Inset") + ClassTrainerScrollFrame:SetStylePanel("Fixed", "Inset") PLUGIN:ApplyCloseButtonStyle(ClassTrainerFrameCloseButton, ClassTrainerFrame) ClassTrainerFrameSkillStepButton.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - ClassTrainerFrameSkillStepButton:SetFixedPanelTemplate("Button", true) - --ClassTrainerFrameSkillStepButton.Panel:WrapOuter(ClassTrainerFrameSkillStepButton.icon) + ClassTrainerFrameSkillStepButton:SetStylePanel("Fixed", "Button", true) + --ClassTrainerFrameSkillStepButton.Panel:SetAllPointsOut(ClassTrainerFrameSkillStepButton.icon) --ClassTrainerFrameSkillStepButton.icon:SetParent(ClassTrainerFrameSkillStepButton.Panel) ClassTrainerFrameSkillStepButtonHighlight:SetTexture(1, 1, 1, 0.3) ClassTrainerFrameSkillStepButton.selectedTex:SetTexture(1, 1, 1, 0.3) ClassTrainerStatusBar:RemoveTextures() ClassTrainerStatusBar:SetStatusBarTexture(SV.Media.bar.default) - ClassTrainerStatusBar:SetPanelTemplate("Slot", true, 1, 2, 2) + ClassTrainerStatusBar:SetStylePanel("Default", "Slot", true, 1, 2, 2) ClassTrainerStatusBar.rankText:ClearAllPoints() ClassTrainerStatusBar.rankText:SetPoint("CENTER", ClassTrainerStatusBar, "CENTER") end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/transmog.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/transmog.lua index 4a3189c..03d11f6 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/transmog.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/transmog.lua @@ -60,7 +60,7 @@ TRANSMOG PLUGINR local function TransmogStyle() if PLUGIN.db.blizzard.enable ~= true or PLUGIN.db.blizzard.transmogrify ~= true then return end - TransmogrifyFrame:Size(500, 600) + TransmogrifyFrame:SetSizeToScale(500, 600) PLUGIN:ApplyWindowStyle(TransmogrifyFrame, true) for p, texture in pairs(TransmogFrameList)do @@ -70,14 +70,14 @@ local function TransmogStyle() select(2, TransmogrifyModelFrame:GetRegions()):Die() TransmogrifyModelFrame:ClearAllPoints() - TransmogrifyModelFrame:Point("TOPLEFT", TransmogrifyFrame, "TOPLEFT", 12, -22) - TransmogrifyModelFrame:Point("BOTTOMRIGHT", TransmogrifyFrame, "BOTTOMRIGHT", -12, 36) - TransmogrifyModelFrame:SetFixedPanelTemplate("Model") + TransmogrifyModelFrame:SetPointToScale("TOPLEFT", TransmogrifyFrame, "TOPLEFT", 12, -22) + TransmogrifyModelFrame:SetPointToScale("BOTTOMRIGHT", TransmogrifyFrame, "BOTTOMRIGHT", -12, 36) + TransmogrifyModelFrame:SetStylePanel("Fixed", "Model") TransmogrifyFrameButtonFrame:GetRegions():Die() TransmogrifyApplyButton:RemoveTextures() - TransmogrifyApplyButton:SetButtonTemplate() - TransmogrifyApplyButton:Point("BOTTOMRIGHT", TransmogrifyFrame, "BOTTOMRIGHT", -4, 4) + TransmogrifyApplyButton:SetStylePanel("Button") + TransmogrifyApplyButton:SetPointToScale("BOTTOMRIGHT", TransmogrifyFrame, "BOTTOMRIGHT", -4, 4) PLUGIN:ApplyCloseButtonStyle(TransmogrifyArtFrameCloseButton) TransmogrifyArtFrame:RemoveTextures() @@ -86,21 +86,21 @@ local function TransmogStyle() local a9 = _G["TransmogrifyFrame"..a9 .."Slot"] if a9 then a9:RemoveTextures() - a9:SetSlotTemplate(true) + a9:SetStylePanel("Slot", true) a9:SetFrameLevel(a9:GetFrameLevel()+2) a9.Panel:SetAllPoints() icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) icon:ClearAllPoints() - icon:FillInner() + icon:SetAllPointsIn() end end TransmogrifyConfirmationPopup:SetParent(UIParent) TransmogrifyConfirmationPopup:RemoveTextures() - TransmogrifyConfirmationPopup:SetPanelTemplate("Pattern") - TransmogrifyConfirmationPopup.Button1:SetButtonTemplate() - TransmogrifyConfirmationPopup.Button2:SetButtonTemplate() + TransmogrifyConfirmationPopup:SetStylePanel("Default", "Pattern") + TransmogrifyConfirmationPopup.Button1:SetStylePanel("Button") + TransmogrifyConfirmationPopup.Button2:SetStylePanel("Button") PLUGIN:ApplyItemButtonStyle(TransmogrifyConfirmationPopupItemFrame1, true) PLUGIN:ApplyItemButtonStyle(TransmogrifyConfirmationPopupItemFrame2, true) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/voidstorage.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/voidstorage.lua index ff3e5c6..f592e92 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/voidstorage.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/voidstorage.lua @@ -56,14 +56,14 @@ local function ChangeTabHelper(this) if(nTex) then nTex:SetTexture([[Interface\ICONS\INV_Enchant_VoidSphere]]) nTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) - nTex:FillInner() + nTex:SetAllPointsIn() end this.pushed = true; this.backdrop = CreateFrame("Frame", nil, this) - this.backdrop:WrapOuter(this,1,1) + this.backdrop:SetAllPointsOut(this,1,1) this.backdrop:SetFrameLevel(0) this.backdrop:SetBackdrop({ @@ -86,7 +86,7 @@ local function ChangeTabHelper(this) this:SetScript("OnLeave", Tab_OnLeave) local a,b,c,d,e = this:GetPoint() - this:Point(a,b,c,1,e) + this:SetPointToScale(a,b,c,1,e) end local function VoidSlotStyler(name, index) @@ -96,10 +96,10 @@ local function VoidSlotStyler(name, index) local bg = _G[gName .. "Bg"] if(button) then if(bg) then bg:Hide() end - button:SetSlotTemplate(true, 2, 0, 0) + button:SetStylePanel("Slot", true, 2, 0, 0) if(icon) then icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - icon:FillInner() + icon:SetAllPointsIn() end end end @@ -124,21 +124,21 @@ local function VoidStorageStyle() end VoidStoragePurchaseFrame:SetFrameStrata('DIALOG') - VoidStoragePurchaseFrame:SetFixedPanelTemplate("Button", true) + VoidStoragePurchaseFrame:SetStylePanel("Fixed", "Button", true) VoidStorageFrameMarbleBg:Die() VoidStorageFrameLines:Die() select(2, VoidStorageFrame:GetRegions()):Die() - VoidStoragePurchaseButton:SetButtonTemplate() - VoidStorageHelpBoxButton:SetButtonTemplate() - VoidStorageTransferButton:SetButtonTemplate() + VoidStoragePurchaseButton:SetStylePanel("Button") + VoidStorageHelpBoxButton:SetStylePanel("Button") + VoidStorageTransferButton:SetStylePanel("Button") PLUGIN:ApplyCloseButtonStyle(VoidStorageBorderFrame.CloseButton) - VoidItemSearchBox:SetPanelTemplate("Inset") - VoidItemSearchBox.Panel:Point("TOPLEFT", 10, -1) - VoidItemSearchBox.Panel:Point("BOTTOMRIGHT", 4, 1) + VoidItemSearchBox:SetStylePanel("Default", "Inset") + VoidItemSearchBox.Panel:SetPointToScale("TOPLEFT", 10, -1) + VoidItemSearchBox.Panel:SetPointToScale("BOTTOMRIGHT", 4, 1) for i=1, 9 do VoidSlotStyler("VoidStorageDeposit", i) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldmap.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldmap.lua index 794abe0..a0d1fb8 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldmap.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldmap.lua @@ -42,8 +42,8 @@ end local function WorldMap_SmallView() local WorldMapFrame = _G.WorldMapFrame; WorldMapFrame.Panel:ClearAllPoints() - WorldMapFrame.Panel:WrapOuter(WorldMapFrame, 4, 4) - WorldMapFrame.Panel.Panel:WrapOuter(WorldMapFrame.Panel) + WorldMapFrame.Panel:SetAllPointsOut(WorldMapFrame, 4, 4) + WorldMapFrame.Panel.Panel:SetAllPointsOut(WorldMapFrame.Panel) if(SVUI_WorldMapCoords) then SVUI_WorldMapCoords.playerCoords:SetPoint("BOTTOMLEFT", WorldMapFrame, "BOTTOMLEFT", 5, 5) end @@ -53,9 +53,9 @@ local function WorldMap_FullView() local WorldMapFrame = _G.WorldMapFrame; WorldMapFrame.Panel:ClearAllPoints() local w, h = WorldMapDetailFrame:GetSize() - WorldMapFrame.Panel:Size(w + 24, h + 98) - WorldMapFrame.Panel:Point("TOP", WorldMapFrame, "TOP", 0, 0) - WorldMapFrame.Panel.Panel:WrapOuter(WorldMapFrame.Panel) + WorldMapFrame.Panel:SetSizeToScale(w + 24, h + 98) + WorldMapFrame.Panel:SetPointToScale("TOP", WorldMapFrame, "TOP", 0, 0) + WorldMapFrame.Panel.Panel:SetAllPointsOut(WorldMapFrame.Panel) if(SVUI_WorldMapCoords) then SVUI_WorldMapCoords.playerCoords:SetPoint("BOTTOMLEFT", WorldMapFrame.Panel, "BOTTOMLEFT", 5, 5) end @@ -84,19 +84,19 @@ local function StripQuestMapFrame() QuestMapFrame.DetailsFrame.TrackButton:RemoveTextures(true) QuestMapFrame.DetailsFrame.RewardsFrame:RemoveTextures(true) - QuestMapFrame.DetailsFrame:SetPanelTemplate("Paper") - QuestMapFrame.DetailsFrame.CompleteQuestFrame.CompleteButton:SetButtonTemplate() - QuestMapFrame.DetailsFrame.BackButton:SetButtonTemplate() - QuestMapFrame.DetailsFrame.AbandonButton:SetButtonTemplate() - QuestMapFrame.DetailsFrame.ShareButton:SetButtonTemplate() - QuestMapFrame.DetailsFrame.TrackButton:SetButtonTemplate() - QuestMapFrame.DetailsFrame.RewardsFrame:SetPanelTemplate("Paper") + QuestMapFrame.DetailsFrame:SetStylePanel("Default", "Paper") + QuestMapFrame.DetailsFrame.CompleteQuestFrame.CompleteButton:SetStylePanel("Button") + QuestMapFrame.DetailsFrame.BackButton:SetStylePanel("Button") + QuestMapFrame.DetailsFrame.AbandonButton:SetStylePanel("Button") + QuestMapFrame.DetailsFrame.ShareButton:SetStylePanel("Button") + QuestMapFrame.DetailsFrame.TrackButton:SetStylePanel("Button") + QuestMapFrame.DetailsFrame.RewardsFrame:SetStylePanel("Default", "Paper") QuestMapFrame.DetailsFrame.RewardsFrame:SetPanelColor("dark") - QuestScrollFrame:SetFixedPanelTemplate("Paper") + QuestScrollFrame:SetStylePanel("Fixed", "Paper") QuestScrollFrame:SetPanelColor("special") - QuestScrollFrame.ViewAll:SetButtonTemplate() + QuestScrollFrame.ViewAll:SetStylePanel("Button") local detailWidth = QuestMapFrame.DetailsFrame.RewardsFrame:GetWidth() QuestMapFrame.DetailsFrame:ClearAllPoints() @@ -104,9 +104,9 @@ local function StripQuestMapFrame() QuestMapFrame.DetailsFrame:SetWidth(detailWidth) WorldMapFrameNavBar:ClearAllPoints() - WorldMapFrameNavBar:Point("TOPLEFT", WorldMapFrame.Panel, "TOPLEFT", 12, -26) + WorldMapFrameNavBar:SetPointToScale("TOPLEFT", WorldMapFrame.Panel, "TOPLEFT", 12, -26) WorldMapFrameTutorialButton:ClearAllPoints() - WorldMapFrameTutorialButton:Point("LEFT", WorldMapFrameNavBar.Panel, "RIGHT", -50, 0) + WorldMapFrameTutorialButton:SetPointToScale("LEFT", WorldMapFrameNavBar.Panel, "RIGHT", -50, 0) end local function WorldMap_OnShow() @@ -124,13 +124,9 @@ local function WorldMap_OnShow() BlackoutWorld:SetTexture(0,0,0,0) end - WorldMapFrameAreaLabel:FontManager(nil, 50, "OUTLINE") WorldMapFrameAreaLabel:SetShadowOffset(2, -2) WorldMapFrameAreaLabel:SetTextColor(0.90, 0.8294, 0.6407) - WorldMapFrameAreaDescription:FontManager(nil, 40, "OUTLINE") WorldMapFrameAreaDescription:SetShadowOffset(2, -2) - WorldMapFrameAreaPetLevels:FontManager(nil, 25, 'OUTLINE') - WorldMapZoneInfo:FontManager(nil, 27, "OUTLINE") WorldMapZoneInfo:SetShadowOffset(2, -2) if InCombatLockdown() then return end @@ -145,13 +141,13 @@ local function WorldMapStyle() if PLUGIN.db.blizzard.enable ~= true or PLUGIN.db.blizzard.worldmap ~= true then return end PLUGIN:ApplyWindowStyle(WorldMapFrame, true, true) - WorldMapFrame.Panel:SetPanelTemplate("Blackout") + WorldMapFrame.Panel:SetStylePanel("Default", "Blackout") PLUGIN:ApplyScrollFrameStyle(WorldMapQuestScrollFrameScrollBar) PLUGIN:ApplyScrollFrameStyle(WorldMapQuestDetailScrollFrameScrollBar, 4) PLUGIN:ApplyScrollFrameStyle(WorldMapQuestRewardScrollFrameScrollBar, 4) - WorldMapDetailFrame:SetPanelTemplate("Blackout") + WorldMapDetailFrame:SetStylePanel("Default", "Blackout") WorldMapFrameSizeDownButton:SetFrameLevel(999) WorldMapFrameSizeUpButton:SetFrameLevel(999) @@ -169,17 +165,17 @@ local function WorldMapStyle() StripQuestMapFrame() - --WorldMapFrame.UIElementsFrame:SetPanelTemplate("Blackout") + --WorldMapFrame.UIElementsFrame:SetStylePanel("Default", "Blackout") WorldMapFrame:HookScript("OnShow", WorldMap_OnShow) hooksecurefunc("WorldMap_ToggleSizeUp", WorldMap_OnShow) BlackoutWorld:SetParent(WorldMapFrame.Panel.Panel) WorldMapFrameNavBar:ClearAllPoints() - WorldMapFrameNavBar:Point("TOPLEFT", WorldMapFrame.Panel, "TOPLEFT", 12, -26) - WorldMapFrameNavBar:SetPanelTemplate("Blackout") + WorldMapFrameNavBar:SetPointToScale("TOPLEFT", WorldMapFrame.Panel, "TOPLEFT", 12, -26) + WorldMapFrameNavBar:SetStylePanel("Default", "Blackout") WorldMapFrameTutorialButton:ClearAllPoints() - WorldMapFrameTutorialButton:Point("LEFT", WorldMapFrameNavBar.Panel, "RIGHT", -50, 0) + WorldMapFrameTutorialButton:SetPointToScale("LEFT", WorldMapFrameNavBar.Panel, "RIGHT", -50, 0) WorldMap_OnShow() end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldstate.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldstate.lua index 03a72c5..1f0a05b 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldstate.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldstate.lua @@ -31,11 +31,11 @@ local function WorldStateStyle() if PLUGIN.db.blizzard.enable ~= true or PLUGIN.db.blizzard.bgscore ~= true then return end WorldStateScoreScrollFrame:RemoveTextures() WorldStateScoreFrame:RemoveTextures() - WorldStateScoreFrame:SetPanelTemplate("Halftone") + WorldStateScoreFrame:SetStylePanel("Default", "Halftone") PLUGIN:ApplyCloseButtonStyle(WorldStateScoreFrameCloseButton) PLUGIN:ApplyScrollFrameStyle(WorldStateScoreScrollFrameScrollBar) WorldStateScoreFrameInset:SetAlpha(0) - WorldStateScoreFrameLeaveButton:SetButtonTemplate() + WorldStateScoreFrameLeaveButton:SetStylePanel("Button") for b = 1, 3 do PLUGIN:ApplyTabStyle(_G["WorldStateScoreFrameTab"..b]) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/style_methods.lua b/Interface/AddOns/SVUI_StyleOMatic/components/style_methods.lua index f7143ed..602e21b 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/style_methods.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/style_methods.lua @@ -65,13 +65,13 @@ function PLUGIN:ApplyFrameStyle(this, template, noStripping, fullStripping) if(not this or (this and this.Panel)) then return end if not noStripping then this:RemoveTextures(fullStripping) end template = template or "Transparent" - this:SetPanelTemplate(template) + this:SetStylePanel("Default", template) end function PLUGIN:ApplyAdjustedFrameStyle(this, template, xTopleft, yTopleft, xBottomright, yBottomright) if(not this or (this and this.Panel)) then return end template = template or "Transparent" - this:SetPanelTemplate(template) + this:SetStylePanel("Default", template) this.Panel:SetPoint("TOPLEFT", this, "TOPLEFT", xTopleft, yTopleft) this.Panel:SetPoint("BOTTOMRIGHT", this, "BOTTOMRIGHT", xBottomright, yBottomright) end @@ -80,7 +80,7 @@ function PLUGIN:ApplyFixedFrameStyle(this, template, noStripping, fullStripping) if(not this or (this and this.Panel)) then return end if not noStripping then this:RemoveTextures(fullStripping) end template = template or "Transparent" - this:SetFixedPanelTemplate(template) + this:SetStylePanel("Fixed", template) end function PLUGIN:ApplyWindowStyle(this, action, fullStrip) @@ -92,7 +92,7 @@ function PLUGIN:ApplyWindowStyle(this, action, fullStrip) end this:RemoveTextures(fullStrip) - this:SetPanelTemplate(template) + this:SetStylePanel("Default", template) end function PLUGIN:ApplyAdjustedWindowStyle(this, action, fullStrip, padding, xOffset, yOffset) @@ -104,7 +104,7 @@ function PLUGIN:ApplyAdjustedWindowStyle(this, action, fullStrip, padding, xOffs end this:RemoveTextures(fullStrip) - this:SetPanelTemplate(template, false, padding, xOffset, yOffset) + this:SetStylePanel("Default", template, false, padding, xOffset, yOffset) end function PLUGIN:ApplyWindowHolder(this, fullStrip) @@ -115,7 +115,7 @@ function PLUGIN:ApplyWindowHolder(this, fullStrip) end this:RemoveTextures(fullStrip) - this:SetPanelTemplate("Blackout") + this:SetStylePanel("Default", "Blackout") end --[[ ########################################################## @@ -139,7 +139,7 @@ end function PLUGIN:ApplyButtonStyle(this) if not this then return end - this:SetButtonTemplate() + this:SetStylePanel("Button") end local ArrowButton_OnEnter = function(self) @@ -153,7 +153,7 @@ end function PLUGIN:ApplyArrowButtonStyle(this, direction, anchor) if not this then return end this:RemoveTextures() - this:SetButtonTemplate(nil, 1, -7, -7, nil, "green") + this:SetStylePanel("Button", nil, 1, -7, -7, nil, "green") this:SetFrameLevel(this:GetFrameLevel() + 4) this:SetNormalTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\MOVE-]] .. direction:upper()) if not this.hookedColors then @@ -178,7 +178,7 @@ end function PLUGIN:ApplyCloseButtonStyle(this, anchor) if not this then return end this:RemoveTextures() - this:SetButtonTemplate(nil, 1, -7, -7, nil, "red") + this:SetStylePanel("Button", nil, 1, -7, -7, nil, "red") this:SetFrameLevel(this:GetFrameLevel() + 4) this:SetNormalTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\CLOSE-BUTTON]]) if not this.hookedColors then @@ -202,9 +202,9 @@ function PLUGIN:ApplyItemButtonStyle(frame, adjust, shrink, noScript) if(not frame.Panel) then if shrink then - frame:SetPanelTemplate("Button", true, 1, -1, -1) + frame:SetStylePanel("Default", "Button", true, 1, -1, -1) else - frame:SetFixedPanelTemplate("Button") + frame:SetStylePanel("Fixed", "Button") end end @@ -220,12 +220,12 @@ function PLUGIN:ApplyItemButtonStyle(frame, adjust, shrink, noScript) iconObject:SetTexCoord(0.1, 0.9, 0.1, 0.9) if adjust then - iconObject:FillInner(frame, 2, 2) + iconObject:SetAllPointsIn(frame, 2, 2) end frame.IconShadow = CreateFrame("Frame", nil, frame) - frame.IconShadow:WrapOuter(iconObject) - frame.IconShadow:SetBasicPanel(0,0,0,0,true) + frame.IconShadow:SetAllPointsOut(iconObject) + frame.IconShadow:SetStylePanel("Icon", true, 2, 0, 0) --iconObject:SetParent(frame.IconShadow) end @@ -241,7 +241,7 @@ function PLUGIN:ApplyItemButtonStyle(frame, adjust, shrink, noScript) if(countObject) then countObject:SetParent(frame.Riser) countObject:SetAllPoints(frame.Riser) - countObject:SetFont(LSM:Fetch("font", SV.db.media.fonts.number), SV.db.media.fonts.size, "OUTLINE") + countObject:FontManager("number") countObject:SetDrawLayer("ARTWORK", 7) end @@ -251,7 +251,7 @@ function PLUGIN:ApplyItemButtonStyle(frame, adjust, shrink, noScript) if(levelObject) then levelObject:SetParent(frame.Riser) - levelObject:SetFont(LSM:Fetch("font", SV.db.media.fonts.number), SV.db.media.fonts.size, "OUTLINE") + levelObject:FontManager("number") levelObject:SetDrawLayer("ARTWORK", 7) end @@ -307,7 +307,7 @@ function PLUGIN:ApplyScrollFrameStyle(this, scale, yOffset) local upW, upH = upButton:GetSize() PLUGIN:ApplyPaginationStyle(upButton) SquareButton_SetIcon(upButton, "UP") - upButton:Size(upW + scale, upH + scale) + upButton:SetSizeToScale(upW + scale, upH + scale) if(yOffset) then local anchor, parent, relative, xBase, yBase = upButton:GetPoint() local yAdjust = (yOffset or 0) + yBase @@ -321,7 +321,7 @@ function PLUGIN:ApplyScrollFrameStyle(this, scale, yOffset) local dnW, dnH = downButton:GetSize() PLUGIN:ApplyPaginationStyle(downButton) SquareButton_SetIcon(downButton, "DOWN") - downButton:Size(dnW + scale, dnH + scale) + downButton:SetSizeToScale(dnW + scale, dnH + scale) if(yOffset) then local anchor, parent, relative, xBase, yBase = downButton:GetPoint() local yAdjust = ((yOffset or 0) * -1) + yBase @@ -334,7 +334,7 @@ function PLUGIN:ApplyScrollFrameStyle(this, scale, yOffset) this.ScrollBG = CreateFrame("Frame", nil, this) this.ScrollBG:SetPoint("TOPLEFT", upButton, "BOTTOMLEFT", 0, -1) this.ScrollBG:SetPoint("BOTTOMRIGHT", downButton, "TOPRIGHT", 0, 1) - this.ScrollBG:SetFixedPanelTemplate("Transparent") + this.ScrollBG:SetStylePanel("Fixed", "Transparent") end if(this:GetThumbTexture()) then @@ -365,7 +365,7 @@ function PLUGIN:ApplyScrollBarStyle(this) this:RemoveTextures() this:SetBackdrop(nil) - this:SetFixedPanelTemplate("Component") + this:SetStylePanel("Fixed", "Component") this:SetBackdropBorderColor(0.2,0.2,0.2) this:SetThumbTexture("Interface\\Buttons\\UI-ScrollBar-Knob") @@ -416,7 +416,7 @@ function PLUGIN:ApplyTabStyle(this, addBackground, xOffset, yOffset) if(nTex) then nTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) - nTex:FillInner() + nTex:SetAllPointsIn() end xOffset = xOffset or 1 @@ -424,7 +424,7 @@ function PLUGIN:ApplyTabStyle(this, addBackground, xOffset, yOffset) this.pushed = true; this.backdrop = CreateFrame("Frame", nil, this) - this.backdrop:WrapOuter(this, xOffset, yOffset) + this.backdrop:SetAllPointsOut(this, xOffset, yOffset) this.backdrop:SetFrameLevel(0) this.backdrop:SetBackdrop({ bgFile = [[Interface\BUTTONS\WHITE8X8]], @@ -443,13 +443,13 @@ function PLUGIN:ApplyTabStyle(this, addBackground, xOffset, yOffset) this.backdrop:SetBackdropBorderColor(0,0,0,1) local initialAnchor, anchorParent, relativeAnchor, xPosition, yPosition = this:GetPoint() - this:Point(initialAnchor, anchorParent, relativeAnchor, 1, yPosition) + this:SetPointToScale(initialAnchor, anchorParent, relativeAnchor, 1, yPosition) else xOffset = xOffset or 10 yOffset = yOffset or 3 this.backdrop = CreateFrame("Frame", nil, this) - this.backdrop:FillInner(this, xOffset, yOffset) - this.backdrop:SetFixedPanelTemplate("Component", true) + this.backdrop:SetAllPointsIn(this, xOffset, yOffset) + this.backdrop:SetStylePanel("Fixed", "Component", true) this.backdrop:SetPanelColor("dark") if(this:GetFrameLevel() > 0) then @@ -487,12 +487,12 @@ function PLUGIN:ApplyPaginationStyle(button, isVertical) button:SetHighlightTexture(0,0,0,0) button:SetDisabledTexture("") - button:SetButtonTemplate() - button:Size((button:GetWidth() - 7), (button:GetHeight() - 7)) + button:SetStylePanel("Button") + button:SetSizeToScale((button:GetWidth() - 7), (button:GetHeight() - 7)) if not button.icon then button.icon = button:CreateTexture(nil,'ARTWORK') - button.icon:Size(13) + button.icon:SetSizeToScale(13) button.icon:SetPoint('CENTER') button.icon:SetTexture([[Interface\Buttons\SquareButtonTextures]]) button.icon:SetTexCoord(0.02, 0.2, 0.02, 0.2) @@ -552,7 +552,7 @@ end --]] local _hook_DropDownButton_SetPoint = function(self, _, _, _, _, _, breaker) if not breaker then - self:Point("RIGHT", self.AnchorParent, "RIGHT", -10, 3, true) + self:SetPointToScale("RIGHT", self.AnchorParent, "RIGHT", -10, 3, true) end end @@ -566,7 +566,7 @@ function PLUGIN:ApplyDropdownStyle(this, width) if not width then width = 155 end this:RemoveTextures() - this:Width(width) + this:SetWidthToScale(width) if(ddButton) then if(ddText) then @@ -574,7 +574,7 @@ function PLUGIN:ApplyDropdownStyle(this, width) end ddButton:ClearAllPoints() - ddButton:Point("RIGHT", this, "RIGHT", -10, 3) + ddButton:SetPointToScale("RIGHT", this, "RIGHT", -10, 3) ddButton.AnchorParent = this NewHook(ddButton, "SetPoint", _hook_DropDownButton_SetPoint) @@ -587,9 +587,9 @@ function PLUGIN:ApplyDropdownStyle(this, width) end local bg = CreateFrame("Frame", nil, this) - bg:Point("TOPLEFT", this, "TOPLEFT", 18, -2) - bg:Point("BOTTOMRIGHT", ddButton, "BOTTOMRIGHT", 2, -2) - bg:SetPanelTemplate("Blackout") + bg:SetPointToScale("TOPLEFT", this, "TOPLEFT", 18, -2) + bg:SetPointToScale("BOTTOMRIGHT", ddButton, "BOTTOMRIGHT", 2, -2) + bg:SetStylePanel("Default", "Blackout") bg:SetBackdropBorderColor(0,0,0) this.Panel = bg end @@ -772,9 +772,9 @@ end function PLUGIN:ApplyEditBoxStyle(this, width, height, x, y) if not this then return end this:RemoveTextures(true) - this:SetEditboxTemplate(x, y) - if width then this:Width(width) end - if height then this:Height(height) end + this:SetStylePanel("Editbox", x, y) + if width then this:SetWidthToScale(width) end + if height then this:SetHeightToScale(height) end end function PLUGIN:ApplyTextureStyle(this) @@ -782,7 +782,7 @@ function PLUGIN:ApplyTextureStyle(this) this:SetTexCoord(0.1, 0.9, 0.1, 0.9) local parent = this:GetParent() if(parent) then - this:FillInner(parent, 1, 1) + this:SetAllPointsIn(parent, 1, 1) end end diff --git a/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.lua b/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.lua index 9290e8a..5c2a6cb 100644 --- a/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.lua +++ b/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.lua @@ -72,15 +72,15 @@ BUILD ########################################################## ]]-- function SVUIToggleTrackingDoodad() - if(not SVUI_TrackingDoodad.Trackable) then - SVUI_TrackingDoodad.Trackable = true + if(not SVUI_UnitTrackingCompass.Trackable) then + SVUI_UnitTrackingCompass.Trackable = true if((UnitInParty("target") or UnitInRaid("target")) and not UnitIsUnit("target", "player")) then - SVUI_TrackingDoodad:Show() + SVUI_UnitTrackingCompass:Show() end SV:AddonMessage("Tracking Device |cff00FF00Enabled|r") else - SVUI_TrackingDoodad.Trackable = false - SVUI_TrackingDoodad:Hide() + SVUI_UnitTrackingCompass.Trackable = false + SVUI_UnitTrackingCompass:Hide() SV:AddonMessage("Tracking Device |cffFF0000Disabled|r") end end @@ -90,13 +90,13 @@ MAIN MOVABLE TRACKER ########################################################## ]]-- function PLUGIN:PLAYER_TARGET_CHANGED() - if not SVUI_TrackingDoodad then return end + if not SVUI_UnitTrackingCompass then return end if((UnitInParty("target") or UnitInRaid("target")) and not UnitIsUnit("target", "player")) then - SVUI_TrackingDoodad.Trackable = true - SVUI_TrackingDoodad:Show() + SVUI_UnitTrackingCompass.Trackable = true + SVUI_UnitTrackingCompass:Show() else - SVUI_TrackingDoodad.Trackable = false - SVUI_TrackingDoodad:Hide() + SVUI_UnitTrackingCompass.Trackable = false + SVUI_UnitTrackingCompass:Hide() end end @@ -123,10 +123,10 @@ local Rotate_Arrow = function(self, angle) self.Arrow:SetTexCoord(ULx, ULy, LLx, LLy, URx, URy, LRx, LRy); end -local Tracker_OnUpdate = function(self, elapsed) +local UnitTracker_OnUpdate = function(self, elapsed) if self.elapsed and self.elapsed > (self.throttle or 0.02) then if(self.Trackable) then - local distance, angle = Triangulate("target", true) + local distance, angle = TriangulateUnit("target", true) if not angle then self.throttle = 4 self.Arrow:SetAlpha(0) @@ -179,6 +179,86 @@ local Tracker_OnUpdate = function(self, elapsed) self.elapsed = (self.elapsed or 0) + elapsed end end + +local QuestTracker_OnUpdate = function(self, elapsed) + if self.elapsed and self.elapsed > (self.throttle or 0.02) then + if(self.questID) then + local distance, angle = TriangulateQuest(self.questID) + if not angle then + self.questID = nil + self.throttle = 4 + self.Arrow:SetAlpha(0) + self.BG:SetVertexColor(0.1,0.1,0.1) + else + self.throttle = 0.02 + local range = floor(distance) + self:Spin(angle) + if(range > 25) then + self.Arrow:SetAlpha(1) + self.BG:SetAlpha(1) + if(range > 100) then + self.BG:SetVertexColor(0.8,0.1,0.1) + elseif(range > 40) then + self.BG:SetVertexColor(0.8,0.8,0.1) + else + self.BG:SetVertexColor(0.1,0.8,0.1) + end + self.Range:SetText(range) + else + self.BG:SetVertexColor(0.1,0.1,0.1) + self.Arrow:SetAlpha(0) + self.BG:SetAlpha(0) + self.Range:SetText("") + end + end + else + self:Hide() + end + self.elapsed = 0 + else + self.elapsed = (self.elapsed or 0) + elapsed + end +end + +local StartTrackingQuest = function(self, questID) + if(questID) then + if(not WorldMapFrame:IsShown()) then + SetMapToCurrentZone() + end + self.Compass.questID = questID + self.Compass:Show() + + else + self.Compass.questID = nil + self.Compass:Hide() + end +end + +function SV:AddQuestCompass(parent, anchor, size) + if anchor.Compass then return end + local compass = CreateFrame("Frame", nil, parent) + compass:SetPoint("CENTER", anchor, "CENTER", 0, 0) + compass:SetSize(size, size) + compass:SetFrameLevel(anchor:GetFrameLevel() + 99) + compass.BG = compass:CreateTexture(nil, 'BACKGROUND') + compass.BG:SetAllPointsIn(compass) + compass.BG:SetTexture([[Interface\AddOns\SVUI_TrackOMatic\artwork\QUEST-COMPASS-BG]]) + compass.BG:SetVertexColor(0.1, 0.3, 0.4) + compass.Arrow = compass:CreateTexture(nil, 'BORDER') + compass.Arrow:SetAllPoints(compass) + compass.Arrow:SetTexture([[Interface\AddOns\SVUI_TrackOMatic\artwork\QUEST-COMPASS-ARROW]]) + compass.Range = compass:CreateFontString(nil, 'ARTWORK') + compass.Range:SetPoint("CENTER", compass, "CENTER", 0, 0) + compass.Range:SetFont(SV.Media.font.default, 10, "OUTLINE") + compass.Range:SetTextColor(1, 1, 1, 0.75) + compass.Spin = Rotate_Arrow + + compass:SetScript("OnUpdate", QuestTracker_OnUpdate) + compass:Hide() + + anchor.Compass = compass + anchor.PostUpdate = StartTrackingQuest +end --[[ ########################################################## CORE @@ -188,36 +268,38 @@ function PLUGIN:ReLoad() local frameSize = self.db.size or 70 local arrowSize = frameSize * 0.5 local fontSize = self.db.fontSize or 14 - local frame = _G["SVUI_TrackingDoodad"] + local frame = _G["SVUI_UnitTrackingCompass"] frame:SetSize(frameSize, frameSize) frame.Arrow:SetSize(arrowSize, arrowSize) - frame.Range:SetFont(SV.Media.font.roboto, fontSize, "OUTLINE") + frame.Range:SetFont(SV.Media.font.default, fontSize, "OUTLINE") end function PLUGIN:Load() - local _TRACKER = SVUI_TrackingDoodad - local _TARGET = SVUI_Target + local UNIT_TRACKER = SVUI_UnitTrackingCompass + local TRACKER_TARGET = SVUI_Target - if(_TRACKER) then - _TRACKER.Border:SetGradient(unpack(SV.Media.gradient.special)) - _TRACKER.Arrow:SetVertexColor(0.1, 0.8, 0.8) - _TRACKER.Range:SetFont(SV.Media.font.roboto, 14, "OUTLINE") - _TRACKER.Range:SetTextColor(1, 1, 1, 0.75) - _TRACKER.Spin = Rotate_Arrow + if(UNIT_TRACKER) then + UNIT_TRACKER.Border:SetGradient(unpack(SV.Media.gradient.special)) + UNIT_TRACKER.Arrow:SetVertexColor(0.1, 0.8, 0.8) + UNIT_TRACKER.Range:SetFont(SV.Media.font.default, 14, "OUTLINE") + UNIT_TRACKER.Range:SetTextColor(1, 1, 1, 0.75) + UNIT_TRACKER.Spin = Rotate_Arrow - _TRACKER:RegisterForDrag("LeftButton"); - _TRACKER:SetScript("OnUpdate", Tracker_OnUpdate) + UNIT_TRACKER:RegisterForDrag("LeftButton"); + UNIT_TRACKER:SetScript("OnUpdate", UnitTracker_OnUpdate) - SV.Animate:Orbit(_TRACKER.Radar, 8, true) + SV.Animate:Orbit(UNIT_TRACKER.Radar, 8, true) - _TRACKER:Hide() + UNIT_TRACKER:Hide() - if(_TARGET) then - _TRACKER:SetParent(_TARGET) - _TRACKER:SetPoint("LEFT", _TARGET, "RIGHT", 2, 0) + if(TRACKER_TARGET) then + UNIT_TRACKER:SetParent(TRACKER_TARGET) + UNIT_TRACKER:SetPoint("LEFT", TRACKER_TARGET, "RIGHT", 2, 0) end self:RegisterEvent("PLAYER_TARGET_CHANGED") end + + self:EnableGPS() end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.toc b/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.toc index 9fa33d9..991b46e 100644 --- a/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.toc +++ b/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.toc @@ -1,6 +1,6 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 5.3.9 +## Version: 5.4.08 ## Title: |cffFF9900SVUI |r|cffFFEF00Track-O-Matic|r ## Notes: Supervillain UI [|cff9911FFRaid & Party Member Tracking|r]. ## SavedVariables: TrackOMatic_Global diff --git a/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.xml b/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.xml index 51b099b..b43b70f 100644 --- a/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.xml +++ b/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.xml @@ -1,5 +1,5 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Frame name="SVUI_TrackingDoodad" movable="true" frameStrata="DIALOG"> + <Frame name="SVUI_UnitTrackingCompass" movable="true" frameStrata="DIALOG"> <Size x="70" y="70"/> <Anchors> <Anchor point="CENTER" relativeTo="UIParent" relativePoint="CENTER"/> @@ -30,16 +30,41 @@ </Layers> <Scripts> <OnDragStart> - _G["SVUI_TrackingDoodad"].moving = true; - _G["SVUI_TrackingDoodad"]:StartMoving(); + _G["SVUI_UnitTrackingCompass"].moving = true; + _G["SVUI_UnitTrackingCompass"]:StartMoving(); </OnDragStart> <OnDragStop> - _G["SVUI_TrackingDoodad"].moving = nil; - _G["SVUI_TrackingDoodad"]:StopMovingOrSizing(); + _G["SVUI_UnitTrackingCompass"].moving = nil; + _G["SVUI_UnitTrackingCompass"]:StopMovingOrSizing(); </OnDragStop> </Scripts> </Frame> + <Frame name="SVUI_TrackingCompassTemplate" frameStrata="DIALOG" virtual="true" > + <Layers> + <Layer level="BACKGROUND"> + <Texture parentKey="BG" setAllPoints="true" file="Interface\AddOns\SVUI_TrackOMatic\artwork\QUEST-COMPASS-BG"/> + </Layer> + <Layer level="BORDER"> + <Texture parentKey="Arrow" file="Interface\AddOns\SVUI_TrackOMatic\artwork\QUEST-COMPASS-ARROW"> + <Anchors> + <Anchor point="CENTER" relativeTo="$parent" relativePoint="CENTER"/> + </Anchors> + </Texture> + </Layer> + <Layer level="OVERLAY"> + <Texture parentKey="Radar" setAllPoints="true" file="Interface\AddOns\SVUI_TrackOMatic\artwork\DOODAD-RADAR"/> + </Layer> + <Layer level="ARTWORK"> + <FontString parentKey="Range" inherits="GameFontNormal"> + <Anchors> + <Anchor point="CENTER" relativeTo="$parent" relativePoint="CENTER"/> + </Anchors> + </FontString> + </Layer> + </Layers> + </Frame> + <Script file='Loader.lua'/> <Include file='components\_load.xml'/> <Script file='SVUI_TrackOMatic.lua'/> diff --git a/Interface/AddOns/SVUI_TrackOMatic/artwork/QUEST-COMPASS-ARROW.blp b/Interface/AddOns/SVUI_TrackOMatic/artwork/QUEST-COMPASS-ARROW.blp new file mode 100644 index 0000000..9ebcfd2 Binary files /dev/null and b/Interface/AddOns/SVUI_TrackOMatic/artwork/QUEST-COMPASS-ARROW.blp differ diff --git a/Interface/AddOns/SVUI_TrackOMatic/artwork/QUEST-COMPASS-BG.blp b/Interface/AddOns/SVUI_TrackOMatic/artwork/QUEST-COMPASS-BG.blp new file mode 100644 index 0000000..da92dab Binary files /dev/null and b/Interface/AddOns/SVUI_TrackOMatic/artwork/QUEST-COMPASS-BG.blp differ diff --git a/Interface/AddOns/SVUI_TrackOMatic/components/triangulate.lua b/Interface/AddOns/SVUI_TrackOMatic/components/triangulate.lua index 576b5f7..3f36c6a 100644 --- a/Interface/AddOns/SVUI_TrackOMatic/components/triangulate.lua +++ b/Interface/AddOns/SVUI_TrackOMatic/components/triangulate.lua @@ -313,10 +313,11 @@ do end local function GetCoordinates(map, mapFloor, x, y) - if not map then return end + if not map then return 0,0 end if (mapFloor ~= 0) then map = rawget(map, mapFloor) or DUNGEON_DATA[map.origin][mapFloor]; end + if not map then return 0,0 end x = x * map.width + map.xOffset; y = y * map.height + map.yOffset; return x, y; @@ -388,8 +389,8 @@ local function GetDistance(map1, floor1, x1, y1, map2, floor2, x2, y2) return dist, angle; end -function Triangulate(unit, noMapLocation) - if(WorldMap and WorldMap:IsShown()) then return end +function TriangulateUnit(unit, noMapLocation) + if(WorldMapFrame and WorldMapFrame:IsShown()) then return end local plot1, plot2, plot3, plot4, plot5, plot6, plot7, plot8; @@ -445,4 +446,37 @@ function Triangulate(unit, noMapLocation) end return GetDistance(plot1, plot2, plot3, plot4, plot1, plot2, plot7, plot8) +end + +--QuestPOIGetIconInfo(questID) + +function TriangulateQuest(questID) + if(WorldMapFrame and WorldMapFrame:IsShown()) then return end + + local _, plot1, plot2, plot3, plot4, plot5, plot6, plot7, plot8; + + plot3, plot4 = GetPlayerMapPosition("player"); + + if(plot3 <= 0 and plot4 <= 0) then + SetMapToCurrentZone(); + plot3, plot4 = GetPlayerMapPosition("player"); + if(plot3 <= 0 and plot4 <= 0) then + if(ZoomOut()) then + elseif(GetCurrentMapZone() ~= WORLDMAP_WORLD_ID) then + SetMapZoom(GetCurrentMapContinent()); + else + SetMapZoom(WORLDMAP_WORLD_ID); + end + plot3, plot4 = GetPlayerMapPosition("player"); + if(plot3 <= 0 and plot4 <= 0) then + return; + end + end + end + + plot1 = GetCurrentMapAreaID() + plot2 = GetCurrentMapDungeonLevel() + _, plot7, plot8, _ = QuestPOIGetIconInfo(questID); + if((not plot7) or (not plot8)) then return 0,0 end + return GetDistance(plot1, plot2, plot3, plot4, plot1, plot2, plot7, plot8) end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_TrackOMatic/components/unitframe_gps.lua b/Interface/AddOns/SVUI_TrackOMatic/components/unitframe_gps.lua index 87bc9bb..04bcad1 100644 --- a/Interface/AddOns/SVUI_TrackOMatic/components/unitframe_gps.lua +++ b/Interface/AddOns/SVUI_TrackOMatic/components/unitframe_gps.lua @@ -62,7 +62,7 @@ local playerGUID = UnitGUID("player") local _FRAMES, _PROXIMITY = {}, {} local minThrottle = 0.02 local numArrows, inRange, GPS -local Triangulate = Triangulate +local TriangulateUnit = TriangulateUnit local NewHook = hooksecurefunc; --[[ ########################################################## @@ -100,7 +100,7 @@ oUF.Tags.Methods["nearbyplayers:8"] = function(unit) if UnitIsConnected(unit)then for taggedUnit, _ in pairs(taggedUnits)do if not UnitIsUnit(unit, taggedUnit) and UnitIsConnected(taggedUnit)then - distance = Triangulate(unit, taggedUnit, true) + distance = TriangulateUnit(unit, taggedUnit, true) if distance and distance <= 8 then unitsInRange = unitsInRange + 1 end @@ -116,7 +116,7 @@ oUF.Tags.Methods["nearbyplayers:10"] = function(unit) if UnitIsConnected(unit)then for taggedUnit, _ in pairs(taggedUnits)do if not UnitIsUnit(unit, taggedUnit) and UnitIsConnected(taggedUnit)then - distance = Triangulate(unit, taggedUnit, true) + distance = TriangulateUnit(unit, taggedUnit, true) if distance and distance <= 10 then unitsInRange = unitsInRange + 1 end @@ -132,7 +132,7 @@ oUF.Tags.Methods["nearbyplayers:30"] = function(unit) if UnitIsConnected(unit)then for taggedUnit, _ in pairs(taggedUnits)do if not UnitIsUnit(unit, taggedUnit) and UnitIsConnected(taggedUnit)then - distance = Triangulate(unit, taggedUnit, true) + distance = TriangulateUnit(unit, taggedUnit, true) if distance and distance <= 30 then unitsInRange = unitsInRange + 1 end @@ -145,7 +145,7 @@ end oUF.Tags.OnUpdateThrottle['distance'] = 0.25 oUF.Tags.Methods["distance"] = function(unit) if not UnitIsConnected(unit) or UnitIsUnit(unit, "player")then return "" end - local dst = Triangulate("player", unit, true) + local dst = TriangulateUnit("player", unit, true) if dst and dst > 0 then return format("%d", dst) end @@ -200,15 +200,15 @@ local function CreateGPS(frame) if not frame then return end local size = 32 - local gps = CreateFrame("Frame", nil, frame.InfoPanel) + local gps = CreateFrame("Frame", nil, frame.TextGrip) gps:SetFrameLevel(99) - gps:Size(size, size) + gps:SetSizeToScale(size, size) gps.DefaultSize = size - gps:Point("RIGHT", frame, "RIGHT", 0, 0) + gps:SetPointToScale("RIGHT", frame, "RIGHT", 0, 0) gps.Arrow = gps:CreateTexture(nil, "OVERLAY", nil, 7) gps.Arrow:SetTexture([[Interface\AddOns\SVUI_TrackOMatic\artwork\GPS-ARROW]]) - gps.Arrow:Size(size, size) + gps.Arrow:SetSizeToScale(size, size) gps.Arrow:SetPoint("CENTER", gps, "CENTER", 0, 0) gps.Arrow:SetVertexColor(0.1, 0.8, 0.8) gps.Arrow:SetBlendMode("ADD") @@ -327,7 +327,7 @@ local Disable = function(self) end function PLUGIN:EnableGPS() - GPS_UpdateHandler.Track = Triangulate + GPS_UpdateHandler.Track = TriangulateUnit GPS_UpdateHandler:SetScript("OnUpdate", Update) oUF:AddElement('GPS', nil, Enable, Disable) NewHook(SV.SVUnit, "RefreshUnitLayout", RefreshGPS) diff --git a/Interface/EncounterJournal/UI-ENCOUNTERJOURNALTEXTURES.blp b/Interface/EncounterJournal/UI-ENCOUNTERJOURNALTEXTURES.blp index aa4d4c3..5d5f0d0 100644 Binary files a/Interface/EncounterJournal/UI-ENCOUNTERJOURNALTEXTURES.blp and b/Interface/EncounterJournal/UI-ENCOUNTERJOURNALTEXTURES.blp differ diff --git a/Interface/Reforging/Valor-Flare.blp b/Interface/Reforging/Valor-Flare.blp deleted file mode 100644 index 1d97bb8..0000000 Binary files a/Interface/Reforging/Valor-Flare.blp and /dev/null differ diff --git a/Interface/Store/Store-Main.blp b/Interface/Store/Store-Main.blp deleted file mode 100644 index 3a8d35f..0000000 Binary files a/Interface/Store/Store-Main.blp and /dev/null differ diff --git a/Interface/Store/category-icon-armor.blp b/Interface/Store/category-icon-armor.blp deleted file mode 100644 index 35e7361..0000000 Binary files a/Interface/Store/category-icon-armor.blp and /dev/null differ diff --git a/Interface/Store/category-icon-bag.blp b/Interface/Store/category-icon-bag.blp deleted file mode 100644 index ea3f982..0000000 Binary files a/Interface/Store/category-icon-bag.blp and /dev/null differ diff --git a/Interface/Store/category-icon-book.blp b/Interface/Store/category-icon-book.blp deleted file mode 100644 index 5e16afd..0000000 Binary files a/Interface/Store/category-icon-book.blp and /dev/null differ diff --git a/Interface/Store/category-icon-clothes.blp b/Interface/Store/category-icon-clothes.blp deleted file mode 100644 index 561e061..0000000 Binary files a/Interface/Store/category-icon-clothes.blp and /dev/null differ diff --git a/Interface/Store/category-icon-enchantscroll.blp b/Interface/Store/category-icon-enchantscroll.blp deleted file mode 100644 index 2c7467e..0000000 Binary files a/Interface/Store/category-icon-enchantscroll.blp and /dev/null differ diff --git a/Interface/Store/category-icon-featured.blp b/Interface/Store/category-icon-featured.blp deleted file mode 100644 index 96575b3..0000000 Binary files a/Interface/Store/category-icon-featured.blp and /dev/null differ diff --git a/Interface/Store/category-icon-food.blp b/Interface/Store/category-icon-food.blp deleted file mode 100644 index 4326d78..0000000 Binary files a/Interface/Store/category-icon-food.blp and /dev/null differ diff --git a/Interface/Store/category-icon-free.blp b/Interface/Store/category-icon-free.blp deleted file mode 100644 index d80034c..0000000 Binary files a/Interface/Store/category-icon-free.blp and /dev/null differ diff --git a/Interface/Store/category-icon-hot.blp b/Interface/Store/category-icon-hot.blp deleted file mode 100644 index 93a4999..0000000 Binary files a/Interface/Store/category-icon-hot.blp and /dev/null differ diff --git a/Interface/Store/category-icon-key.blp b/Interface/Store/category-icon-key.blp deleted file mode 100644 index 9de62d8..0000000 Binary files a/Interface/Store/category-icon-key.blp and /dev/null differ diff --git a/Interface/Store/category-icon-misc.blp b/Interface/Store/category-icon-misc.blp deleted file mode 100644 index 0e30040..0000000 Binary files a/Interface/Store/category-icon-misc.blp and /dev/null differ diff --git a/Interface/Store/category-icon-mounts.blp b/Interface/Store/category-icon-mounts.blp deleted file mode 100644 index 551d670..0000000 Binary files a/Interface/Store/category-icon-mounts.blp and /dev/null differ diff --git a/Interface/Store/category-icon-pets.blp b/Interface/Store/category-icon-pets.blp deleted file mode 100644 index 4609ad2..0000000 Binary files a/Interface/Store/category-icon-pets.blp and /dev/null differ diff --git a/Interface/Store/category-icon-placeholder.blp b/Interface/Store/category-icon-placeholder.blp deleted file mode 100644 index 2e5ab6d..0000000 Binary files a/Interface/Store/category-icon-placeholder.blp and /dev/null differ diff --git a/Interface/Store/category-icon-sale.blp b/Interface/Store/category-icon-sale.blp deleted file mode 100644 index 0578834..0000000 Binary files a/Interface/Store/category-icon-sale.blp and /dev/null differ diff --git a/Interface/Store/category-icon-scroll.blp b/Interface/Store/category-icon-scroll.blp deleted file mode 100644 index a7326e0..0000000 Binary files a/Interface/Store/category-icon-scroll.blp and /dev/null differ diff --git a/Interface/Store/category-icon-services.blp b/Interface/Store/category-icon-services.blp deleted file mode 100644 index 8744321..0000000 Binary files a/Interface/Store/category-icon-services.blp and /dev/null differ diff --git a/Interface/Store/category-icon-ticket.blp b/Interface/Store/category-icon-ticket.blp deleted file mode 100644 index 8d908b4..0000000 Binary files a/Interface/Store/category-icon-ticket.blp and /dev/null differ diff --git a/Interface/Store/category-icon-toys.blp b/Interface/Store/category-icon-toys.blp deleted file mode 100644 index 33de74a..0000000 Binary files a/Interface/Store/category-icon-toys.blp and /dev/null differ diff --git a/Interface/Store/category-icon-weapons.blp b/Interface/Store/category-icon-weapons.blp deleted file mode 100644 index 7c18d54..0000000 Binary files a/Interface/Store/category-icon-weapons.blp and /dev/null differ diff --git a/Interface/Store/category-icon-wow.blp b/Interface/Store/category-icon-wow.blp deleted file mode 100644 index 27c1a72..0000000 Binary files a/Interface/Store/category-icon-wow.blp and /dev/null differ diff --git a/Interface/Store/store-item-highlight.blp b/Interface/Store/store-item-highlight.blp deleted file mode 100644 index 4750856..0000000 Binary files a/Interface/Store/store-item-highlight.blp and /dev/null differ