diff --git a/Interface/AddOns/SVUI/SVUI.toc b/Interface/AddOns/SVUI/SVUI.toc index 1b03ec0..a2909da 100644 --- a/Interface/AddOns/SVUI/SVUI.toc +++ b/Interface/AddOns/SVUI/SVUI.toc @@ -1,13 +1,13 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 5.1 +## Version: 5.2 ## Title: |cffFF9900SVUI|r ## Notes: Supervillain UI [|cff9911FFCore Framework|r]. ## SavedVariables: SVUI_Global, SVUI_Errors ## SavedVariablesPerCharacter: SVUI_Profile, SVUI_Cache ## OptionalDeps: Blizzard_DebugTools, Blizzard_PetJournal, SharedMedia -## X-SVUI-Header: SuperVillain UI -## X-SVUI-Schema: Core +## X-SVUIName: SuperVillain UI +## X-SVUISchema: Core ## X-oUF: oUF_Villain ## X-Email: munglunch@gmail.com diff --git a/Interface/AddOns/SVUI/SVUI.xml b/Interface/AddOns/SVUI/SVUI.xml index 539bb14..3fda7c5 100644 --- a/Interface/AddOns/SVUI/SVUI.xml +++ b/Interface/AddOns/SVUI/SVUI.xml @@ -1,8 +1,8 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> <Include file="libs\_load.xml"/> <Include file="language\_load.xml"/> - <Include file="xml\_load.xml"/> <Include file="system\_load.xml"/> + <Include file="framework\_load.xml"/> <Include file="setup\_load.xml"/> <Include file="packages\_load.xml"/> <Include file="scripts\_load.xml"/> diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/SVUI-ICON.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/SVUI-ICON.blp new file mode 100644 index 0000000..733c459 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Icons/SVUI-ICON.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Minimap/MINIMAP-ROUND.blp b/Interface/AddOns/SVUI/assets/artwork/Minimap/MINIMAP-ROUND.blp new file mode 100644 index 0000000..1389179 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Minimap/MINIMAP-ROUND.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/SPLASH-BLACK.blp b/Interface/AddOns/SVUI/assets/artwork/SPLASH-BLACK.blp new file mode 100644 index 0000000..3845d77 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/SPLASH-BLACK.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Template/DROPDOWN-DIVIDER.blp b/Interface/AddOns/SVUI/assets/artwork/Template/DROPDOWN-DIVIDER.blp new file mode 100644 index 0000000..4776934 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Template/DROPDOWN-DIVIDER.blp differ diff --git a/Interface/AddOns/SVUI/docs/schema.lua b/Interface/AddOns/SVUI/docs/schema.lua index b676b51..71c4207 100644 --- a/Interface/AddOns/SVUI/docs/schema.lua +++ b/Interface/AddOns/SVUI/docs/schema.lua @@ -64,10 +64,10 @@ local Schema = PKG.Schema (there are two possibilities at the time of this writing. "Header" and "Schema") so it will end up looking like this: - X-SVUI-Header + X-SVUIName or this: - X-SVUI-Schema + X-SVUISchema Your toc should end up looking something like this: @@ -76,8 +76,8 @@ local Schema = PKG.Schema ## Interface: 60000 ## Author: SumFukinDude ## Version: 1.0 - ## X-SVUI-Header: Some Fukin Addon - ## X-SVUI-Schema: SumFukinSchema + ## X-SVUIName: Some Fukin Addon + ## X-SVUISchema: SumFukinSchema Having defined and initialized all requirements at this point, your database will now @@ -89,7 +89,7 @@ local Schema = PKG.Schema LoadOnDemand: When schema is defined for plugins that are NOT loaded by default, the library will - be able to parse all toc files that contain an "X-SVUI-Schema" property and generate + be able to parse all toc files that contain an "X-SVUISchema" property and generate a database entry as well as a config option so that we can manipulate that plugin and save our changes. diff --git a/Interface/AddOns/SVUI/framework/_load.xml b/Interface/AddOns/SVUI/framework/_load.xml new file mode 100644 index 0000000..f6f5384 --- /dev/null +++ b/Interface/AddOns/SVUI/framework/_load.xml @@ -0,0 +1,8 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Include file="screen\screen.xml"/> + <Include file="api\api.xml"/> + <Include file="widgets\widgets.xml"/> + <Include file="movers\movers.xml"/> + <Include file="docks\docks.xml"/> + <Script file="framework.lua"/> +</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/api/api.xml b/Interface/AddOns/SVUI/framework/api/api.xml new file mode 100644 index 0000000..d1f4658 --- /dev/null +++ b/Interface/AddOns/SVUI/framework/api/api.xml @@ -0,0 +1,1174 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + + <Frame name="SVUI_ShadowTemplate" virtual="true"> + <Attributes> + <Attribute name="shadowAlpha" type="number" value="0.5" /> + </Attributes> + <Backdrop edgeFile="Interface\AddOns\SVUI\assets\artwork\Template\GLOW"> + <EdgeSize val="3" /> + <BackgroundInsets left="0" right="0" top="0" bottom="0" /> + <Color r="0" g="0" b="0" a="0" /> + <BorderColor r="0" g="0" b="0" a="0.5" /> + </Backdrop> + </Frame> + + <Frame name="SVUI_PanelTemplate_Default" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="default" /> + <Attribute name="panelPadding" type="number" value="1" /> + <Attribute name="panelColor" type="string" value="default" /> + <Attribute name="panelGradient" type="string" value="default" /> + <Attribute name="panelTexUpdate" type="boolean" value="false" /> + <Attribute name="panelSkipUpdate" type="boolean" value="false" /> + </Attributes> + <Backdrop bgFile="Interface\BUTTONS\WHITE8X8" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> + <EdgeSize val="1" /> + <TileSize val="0" /> + <BackgroundInsets left="0" right="0" top="0" bottom="0" /> + <Color r="0.2" g="0.2" b="0.2" a="1" /> + <BorderColor r="0" g="0" b="0" a="1" /> + </Backdrop> + <Layers> + <Layer level="BACKGROUND" textureSubLevel="1"> + <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT" setAllPoints="true" /> + <Color r="0.2" g="0.2" b="0.2" a="1" /> + </Layer> + <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="1" /> + </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="1" /> + </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="1" /> + </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="1" /> + </Size> + <Color r="0" g="0" b="0" a="1" /> + </Texture> + </Layer> + </Layers> + </Frame> + + <Frame name="SVUI_PanelTemplate_Transparent" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="transparent" /> + <Attribute name="panelPadding" type="number" value="2" /> + <Attribute name="panelColor" type="string" value="transparent" /> + <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\BUTTONS\WHITE8X8" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> + <EdgeSize val="2" /> + <TileSize val="0" /> + <BackgroundInsets left="0" right="0" top="0" bottom="0" /> + <Color r="0" g="0" b="0" a="0.5" /> + <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="1" /> + </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="1" /> + </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="1" /> + </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="1" /> + </Size> + <Color r="0" g="0" b="0" a="1" /> + </Texture> + </Layer> + </Layers> + </Frame> + + <Frame name="SVUI_PanelTemplate_Component" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="component" /> + <Attribute name="panelPadding" type="number" value="1" /> + <Attribute name="panelColor" type="string" value="default" /> + <Attribute name="panelGradient" type="string" value="default" /> + <Attribute name="panelTexUpdate" type="boolean" value="false" /> + <Attribute name="panelSkipUpdate" type="boolean" value="false" /> + </Attributes> + <Backdrop bgFile="Interface\BUTTONS\WHITE8X8" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> + <EdgeSize val="2" /> + <TileSize val="0" /> + <BackgroundInsets left="0" right="0" top="0" bottom="0" /> + <Color r="0.2" g="0.2" b="0.2" a="1" /> + <BorderColor r="0" g="0" b="0" a="1" /> + </Backdrop> + <Layers> + <Layer level="BACKGROUND" textureSubLevel="1"> + <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT" setAllPoints="true" /> + <Color r="0.2" g="0.2" b="0.2" a="1" /> + </Layer> + <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="1" /> + </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="1" /> + </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="1" /> + </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="1" /> + </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_Headline" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="headline" /> + <Attribute name="panelPadding" type="number" value="1" /> + <Attribute name="panelColor" type="string" value="darkest" /> + <Attribute name="panelGradient" type="boolean" value="false" /> + <Attribute name="panelTexUpdate" type="boolean" value="false" /> + <Attribute name="panelSkipUpdate" type="boolean" value="false" /> + </Attributes> + <Backdrop bgFile="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT" tile="true"> + <TileSize val="20" /> + <Color r="0" g="0" b="0" a="0.5" /> + </Backdrop> + </Frame> + + <Frame name="SVUI_PanelTemplate_Button" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="button" /> + <Attribute name="panelPadding" type="number" value="1" /> + <Attribute name="panelColor" type="string" value="default" /> + <Attribute name="panelGradient" type="boolean" value="false" /> + <Attribute name="panelTexUpdate" type="boolean" value="false" /> + <Attribute name="panelSkipUpdate" type="boolean" value="false" /> + </Attributes> + <Backdrop bgFile="Interface\AddOns\SVUI\assets\artwork\Template\BUTTON" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> + <EdgeSize val="2" /> + <TileSize val="0" /> + <BackgroundInsets left="0" right="0" top="0" bottom="0" /> + <Color r="0.2" g="0.2" b="0.2" a="1" /> + <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="1" /> + </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="1" /> + </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="1" /> + </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="1" /> + </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_FramedTop" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="framedtop" /> + <Attribute name="panelPadding" type="number" value="1" /> + <Attribute name="panelColor" type="string" value="default" /> + <Attribute name="panelGradient" type="string" value="darkest2" /> + <Attribute name="panelTexUpdate" type="boolean" value="true" /> + <Attribute name="panelSkipUpdate" type="boolean" value="false" /> + </Attributes> + <Backdrop bgFile="Interface\BUTTONS\WHITE8X8" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> + <EdgeSize val="1" /> + <TileSize val="0" /> + <BackgroundInsets left="0" right="0" top="0" bottom="0" /> + <Color r="0.2" g="0.2" b="0.2" a="1" /> + <BorderColor r="0" g="0" b="0" a="1" /> + </Backdrop> + <Layers> + <Layer level="BACKGROUND" textureSubLevel="1"> + <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT2" setAllPoints="true" /> + <Color r="0.2" g="0.2" b="0.2" a="1" /> + </Layer> + <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="1" /> + </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="1" /> + </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="1" /> + </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="1" /> + </Size> + <Color r="0" g="0" b="0" a="1" /> + </Texture> + </Layer> + </Layers> + </Frame> + + <Frame name="SVUI_PanelTemplate_FramedBottom" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="framedbottom" /> + <Attribute name="panelPadding" type="number" value="1" /> + <Attribute name="panelColor" type="string" value="default" /> + <Attribute name="panelGradient" type="string" value="darkest" /> + <Attribute name="panelTexUpdate" type="boolean" value="true" /> + <Attribute name="panelSkipUpdate" type="boolean" value="false" /> + </Attributes> + <Backdrop bgFile="Interface\BUTTONS\WHITE8X8" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> + <EdgeSize val="1" /> + <TileSize val="0" /> + <BackgroundInsets left="0" right="0" top="0" bottom="0" /> + <Color r="0.2" g="0.2" b="0.2" a="1" /> + <BorderColor r="0" g="0" b="0" a="1" /> + </Backdrop> + <Layers> + <Layer level="BACKGROUND" textureSubLevel="1"> + <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT" setAllPoints="true" /> + <Color r="0.2" g="0.2" b="0.2" a="1" /> + </Layer> + <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="1" /> + </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="1" /> + </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="1" /> + </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="1" /> + </Size> + <Color r="0" g="0" b="0" a="1" /> + </Texture> + </Layer> + </Layers> + </Frame> + + <Frame name="SVUI_PanelTemplate_Bar" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="bar" /> + <Attribute name="panelPadding" type="number" value="1" /> + <Attribute name="panelColor" type="string" value="transparent" /> + <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="0" right="0" top="0" bottom="0" /> + <Color r="0" g="0" b="0" a="0.5" /> + <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="1" /> + </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="1" /> + </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="1" /> + </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="1" /> + </Size> + <Color r="0" g="0" b="0" a="1" /> + </Texture> + </Layer> + </Layers> + </Frame> + + <Frame name="SVUI_PanelTemplate_Slot" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="slot" /> + <Attribute name="panelPadding" type="number" value="2" /> + <Attribute name="panelColor" type="string" value="transparent" /> + <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.5" /> + <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" /> + <Attribute name="panelPadding" type="number" value="2" /> + <Attribute name="panelColor" type="string" value="transparent" /> + <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="2" /> + <TileSize val="0" /> + <BackgroundInsets left="0" right="0" top="0" bottom="0" /> + <Color r="0" g="0" b="0" a="0.5" /> + <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> + </Frame> + + <Frame name="SVUI_PanelTemplate_Comic" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="comic" /> + <Attribute name="panelPadding" type="number" value="1" /> + <Attribute name="panelColor" type="string" value="class" /> + <Attribute name="panelGradient" type="string" value="class" /> + <Attribute name="panelTexUpdate" type="boolean" value="true" /> + <Attribute name="panelSkipUpdate" type="boolean" value="false" /> + </Attributes> + <Backdrop bgFile="Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC1" tile="false"> + <TileSize val="0" /> + <BackgroundInsets left="0" right="0" top="0" bottom="0" /> + <Color r="0.2" g="0.2" b="0.2" a="1" /> + </Backdrop> + <Layers> + <Layer level="BACKGROUND" textureSubLevel="1"> + <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC1" setAllPoints="true" /> + <Color r="0.2" g="0.2" b="0.2" a="1" /> + </Layer> + </Layers> + </Frame> + + <Frame name="SVUI_PanelTemplate_Model" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="model" /> + <Attribute name="panelPadding" type="number" value="1" /> + <Attribute name="panelColor" type="string" value="special" /> + <Attribute name="panelGradient" type="string" value="class" /> + <Attribute name="panelTexUpdate" type="boolean" value="true" /> + <Attribute name="panelSkipUpdate" type="boolean" value="false" /> + </Attributes> + <Backdrop bgFile="Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC-MODEL" tile="false"> + <TileSize val="0" /> + <BackgroundInsets left="0" right="0" top="0" bottom="0" /> + <Color r="0.37" g="0.32" b="0.29" a="1" /> + </Backdrop> + <Layers> + <Layer level="BACKGROUND" textureSubLevel="1"> + <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC-MODEL" setAllPoints="true" /> + <Color r="0.37" g="0.32" b="0.29" a="1" /> + </Layer> + </Layers> + </Frame> + + <Frame name="SVUI_PanelTemplate_Paper" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="paper" /> + <Attribute name="panelPadding" type="number" value="3" /> + <Attribute name="panelColor" type="string" value="white" /> + <Attribute name="panelGradient" type="string" value="white" /> + <Attribute name="panelTexUpdate" type="boolean" value="true" /> + <Attribute name="panelSkipUpdate" type="boolean" value="true" /> + </Attributes> + <Backdrop bgFile="Interface\AddOns\SVUI\assets\artwork\Template\Background\PAPER" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> + <EdgeSize val="1" /> + <TileSize val="0" /> + <BackgroundInsets left="0" right="0" top="0" bottom="0" /> + <Color r="1" g="1" b="1" a="1" /> + <BorderColor r="0" g="0" b="0" a="1" /> + </Backdrop> + <Layers> + <Layer level="BACKGROUND" textureSubLevel="1"> + <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Background\PAPER" setAllPoints="true" /> + <Color r="1" g="1" b="1" a="1" /> + </Layer> + <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="3" /> + </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="3" /> + </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="3" /> + </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="3" /> + </Size> + <Color r="0" g="0" b="0" a="1" /> + </Texture> + </Layer> + </Layers> + </Frame> + + <Frame name="SVUI_PanelTemplate_Container" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="container" /> + <Attribute name="panelPadding" type="number" value="2" /> + <Attribute name="panelColor" type="string" value="special" /> + <Attribute name="panelGradient" type="string" value="special" /> + <Attribute name="panelTexUpdate" type="boolean" value="true" /> + <Attribute name="panelSkipUpdate" type="boolean" value="false" /> + </Attributes> + <Backdrop bgFile="Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN3" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> + <EdgeSize val="1" /> + <TileSize val="0" /> + <BackgroundInsets left="0" right="0" top="0" bottom="0" /> + <Color r="0.37" g="0.32" b="0.29" a="1" /> + <BorderColor r="0" g="0" b="0" a="1" /> + </Backdrop> + <Layers> + <Layer level="BACKGROUND" textureSubLevel="1"> + <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN3" setAllPoints="true" /> + <Color r="0.37" g="0.32" b="0.29" a="1" /> + </Layer> + <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> + </Frame> + + <Frame name="SVUI_PanelTemplate_Pattern" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="pattern" /> + <Attribute name="panelPadding" type="number" value="3" /> + <Attribute name="panelColor" type="string" value="special" /> + <Attribute name="panelGradient" type="string" value="special" /> + <Attribute name="panelTexUpdate" type="boolean" value="true" /> + <Attribute name="panelSkipUpdate" type="boolean" value="false" /> + </Attributes> + <Backdrop bgFile="Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN1" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> + <EdgeSize val="1" /> + <TileSize val="0" /> + <BackgroundInsets left="0" right="0" top="0" bottom="0" /> + <Color r="0.37" g="0.32" b="0.29" a="1" /> + <BorderColor r="0" g="0" b="0" a="1" /> + </Backdrop> + <Layers> + <Layer level="BACKGROUND" textureSubLevel="1"> + <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN1" setAllPoints="true" /> + <Color r="0.37" g="0.32" b="0.29" a="1" /> + </Layer> + <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="3" /> + </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="3" /> + </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="3" /> + </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="3" /> + </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_Action" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="action" /> + <Attribute name="panelPadding" type="number" value="2" /> + <Attribute name="panelColor" type="string" value="default" /> + <Attribute name="panelGradient" type="string" value="special" /> + <Attribute name="panelTexUpdate" type="boolean" value="true" /> + <Attribute name="panelSkipUpdate" type="boolean" value="false" /> + </Attributes> + <Backdrop bgFile="Interface\BUTTONS\WHITE8X8" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> + <EdgeSize val="2" /> + <TileSize val="0" /> + <BackgroundInsets left="1" right="1" top="1" bottom="1" /> + <Color r="0.2" g="0.2" b="0.2" a="1" /> + <BorderColor r="0" g="0" b="0" a="1" /> + </Backdrop> + <Layers> + <Layer level="BACKGROUND" textureSubLevel="1"> + <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT" setAllPoints="true" /> + <Color r="0.2" g="0.2" b="0.2" a="1" /> + </Layer> + <Layer level="BACKGROUND" textureSubLevel="2"> + <Texture parentKey="ExtendedTopLeft" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Extended\ACTION_TOPLEFT"> + <Anchors> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" /> + <Anchor point="TOPRIGHT" relativePoint="TOP" /> + <Anchor point="BOTTOMLEFT" relativePoint="LEFT" /> + </Anchors> + <Color r="0.05" g="0.05" b="0.05" a="0.5" /> + </Texture> + <Texture parentKey="ExtendedTopRight" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Extended\ACTION_TOPRIGHT"> + <Anchors> + <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" /> + <Anchor point="TOPLEFT" relativePoint="TOP" /> + <Anchor point="BOTTOMRIGHT" relativePoint="RIGHT" /> + </Anchors> + <Color r="0.05" g="0.05" b="0.05" a="0.5" /> + </Texture> + <Texture parentKey="ExtendedBottomLeft" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Extended\ACTION_BOTTOMLEFT"> + <Anchors> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" /> + <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOM" /> + <Anchor point="TOPLEFT" relativePoint="LEFT" /> + </Anchors> + <Color r="0.1" g="0.1" b="0.1" a="0.5" /> + </Texture> + <Texture parentKey="ExtendedBottomRight" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Extended\ACTION_BOTTOMRIGHT"> + <Anchors> + <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" /> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOM" /> + <Anchor point="TOPRIGHT" relativePoint="RIGHT" /> + </Anchors> + <Color r="0.1" g="0.1" b="0.1" a="0.5" /> + </Texture> + </Layer> + <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_Halftone" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="halftone" /> + <Attribute name="panelPadding" type="number" value="2" /> + <Attribute name="panelColor" type="string" value="default" /> + <Attribute name="panelGradient" type="string" value="special" /> + <Attribute name="panelTexUpdate" type="boolean" value="true" /> + <Attribute name="panelSkipUpdate" type="boolean" value="false" /> + </Attributes> + <Backdrop bgFile="Interface\BUTTONS\WHITE8X8" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> + <EdgeSize val="2" /> + <TileSize val="0" /> + <BackgroundInsets left="1" right="1" top="1" bottom="1" /> + <Color r="0.2" g="0.2" b="0.2" a="1" /> + <BorderColor r="0" g="0" b="0" a="1" /> + </Backdrop> + <Layers> + <Layer level="BACKGROUND" textureSubLevel="1"> + <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT" setAllPoints="true" /> + <Color r="0.2" g="0.2" b="0.2" a="1" /> + </Layer> + <Layer level="BACKGROUND" textureSubLevel="2"> + <Texture parentKey="ExtendedTopLeft" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Extended\HALFTONE_TOPLEFT"> + <Anchors> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" /> + <Anchor point="TOPRIGHT" relativePoint="TOP" /> + <Anchor point="BOTTOMLEFT" relativePoint="LEFT" /> + </Anchors> + <Color r="0.05" g="0.05" b="0.05" a="0.5" /> + </Texture> + <Texture parentKey="ExtendedTopRight" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Extended\HALFTONE_TOPRIGHT"> + <Anchors> + <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" /> + <Anchor point="TOPLEFT" relativePoint="TOP" /> + <Anchor point="BOTTOMRIGHT" relativePoint="RIGHT" /> + </Anchors> + <Color r="0.05" g="0.05" b="0.05" a="0.5" /> + </Texture> + <Texture parentKey="ExtendedBottomLeft" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Extended\HALFTONE_BOTTOMLEFT"> + <Anchors> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" /> + <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOM" /> + <Anchor point="TOPLEFT" relativePoint="LEFT" /> + </Anchors> + <Color r="0.1" g="0.1" b="0.1" a="0.5" /> + </Texture> + <Texture parentKey="ExtendedBottomRight" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Extended\HALFTONE_BOTTOMRIGHT"> + <Anchors> + <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" /> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOM" /> + <Anchor point="TOPRIGHT" relativePoint="RIGHT" /> + </Anchors> + <Color r="0.1" g="0.1" b="0.1" a="0.5" /> + </Texture> + </Layer> + <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_Blackout" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="blackout" /> + <Attribute name="panelPadding" type="number" value="2" /> + <Attribute name="panelColor" type="string" value="transparent" /> + <Attribute name="panelGradient" type="boolean" value="false" /> + <Attribute name="panelTexUpdate" type="boolean" value="false" /> + <Attribute name="panelOffset" type="number" value="2" /> + <Attribute name="panelSkipUpdate" type="boolean" value="false" /> + </Attributes> + <Backdrop bgFile="Interface\BUTTONS\WHITE8X8" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> + <EdgeSize val="2" /> + <TileSize val="0" /> + <BackgroundInsets left="1" right="1" top="1" bottom="1" /> + <Color r="0" g="0" b="0" a="0.5" /> + <BorderColor r="0" g="0" b="0" a="1" /> + </Backdrop> + <Layers> + <Layer level="BACKGROUND" textureSubLevel="1"> + <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT" setAllPoints="true" /> + <Color r="0" g="0" b="0" a="0.5" /> + </Layer> + <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_UnitLarge" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="unitlarge" /> + <Attribute name="panelPadding" type="number" value="0" /> + <Attribute name="panelColor" type="string" value="special" /> + <Attribute name="panelGradient" type="boolean" value="false" /> + <Attribute name="panelTexUpdate" type="boolean" value="true" /> + <Attribute name="panelOffset" type="number" value="3" /> + <Attribute name="panelSkipUpdate" type="boolean" value="false" /> + <Attribute name="panelNoBackdrop" type="boolean" value="true" /> + </Attributes> + <Layers> + <Layer level="BACKGROUND" textureSubLevel="1"> + <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG1" setAllPoints="true" /> + <Color r="0.37" g="0.32" b="0.29" a="1" /> + </Layer> + </Layers> + </Frame> + + <Frame name="SVUI_PanelTemplate_UnitSmall" virtual="true"> + <Attributes> + <Attribute name="panelID" type="string" value="unitlarge" /> + <Attribute name="panelPadding" type="number" value="0" /> + <Attribute name="panelColor" type="string" value="special" /> + <Attribute name="panelGradient" type="boolean" value="false" /> + <Attribute name="panelTexUpdate" type="boolean" value="true" /> + <Attribute name="panelOffset" type="number" value="3" /> + <Attribute name="panelSkipUpdate" type="boolean" value="false" /> + <Attribute name="panelNoBackdrop" type="boolean" value="true" /> + </Attributes> + <Layers> + <Layer level="BACKGROUND" textureSubLevel="1"> + <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG1" setAllPoints="true" /> + <Color r="0.37" g="0.32" b="0.29" a="1" /> + </Layer> + </Layers> + </Frame> + + <Script file="api_layout.lua"/> + <Script file="api_templates.lua"/> +</Ui> \ 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 new file mode 100644 index 0000000..267f281 --- /dev/null +++ b/Interface/AddOns/SVUI/framework/api/api_layout.lua @@ -0,0 +1,250 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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_templates.lua b/Interface/AddOns/SVUI/framework/api/api_templates.lua new file mode 100644 index 0000000..fd5319e --- /dev/null +++ b/Interface/AddOns/SVUI/framework/api/api_templates.lua @@ -0,0 +1,955 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 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", + ["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) + 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:SetSwipeColor(0, 0, 0, 1) + cooldown:SetHideCountdownNumbers(true) + + 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 + 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) + + 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) +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.65) + 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) + hooksecurefunc(self, "SetBackdrop", HookBackdrop) + 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.__border 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.__border[1]:SetTexture(r2,g2,b2) + self.__border[2]:SetTexture(r2,g2,b2) + self.__border[3]:SetTexture(r2,g2,b2) + self.__border[4]:SetTexture(r2,g2,b2) + 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.__border then + 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) + 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) + 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) + if(shadowAlpha) then + self.Panel.Shadow:SetAttribute("shadowAlpha", shadowAlpha) + end +end + +local function SetCheckboxTemplate(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 == 1 or checked == true) 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 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 = {} + + border[1] = self: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 = self:CreateTexture(nil,"BORDER") + leftoutline:SetTexture(0,0,0) + leftoutline:SetPoint("TOPLEFT", -2, 2) + leftoutline:SetPoint("BOTTOMLEFT", -2, -2) + leftoutline:SetWidth(1) + + border[2] = self: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 = self:CreateTexture(nil,"BORDER") + rightoutline:SetTexture(0,0,0) + rightoutline:SetPoint("TOPRIGHT", 2, 2) + rightoutline:SetPoint("BOTTOMRIGHT", 2, -2) + rightoutline:SetWidth(1) + + border[3] = self: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 = self:CreateTexture(nil,"BORDER") + topoutline:SetTexture(0,0,0) + topoutline:SetPoint("TOPLEFT", -2, 2) + topoutline:SetPoint("TOPRIGHT", 2, 2) + topoutline:SetHeight(1) + + border[4] = self: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 = self:CreateTexture(nil,"BORDER") + bottomoutline:SetTexture(0,0,0) + bottomoutline:SetPoint("BOTTOMLEFT", -2, -2) + bottomoutline:SetPoint("BOTTOMRIGHT", 2, -2) + bottomoutline:SetHeight(1) + + self.__border = border + 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 + +LibSuperVillain("Registry"):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.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/docks.lua b/Interface/AddOns/SVUI/framework/docks/docks.lua new file mode 100644 index 0000000..e638d77 --- /dev/null +++ b/Interface/AddOns/SVUI/framework/docks/docks.lua @@ -0,0 +1,1106 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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}, + ["BottomRight"] = {-1, "RIGHT", true}, + ["TopLeft"] = {1, "LEFT", false}, + ["TopRight"] = {-1, "RIGHT", false}, +}; + +local STAT_LOCATIONS = { + ["BottomCenter"] = {1, "LEFT", true}, + ["TopCenter"] = {1, "LEFT", false}, +}; + +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.BottomRight, 0.2, Dock.BottomRight: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.BottomRight, 0.2, Dock.BottomRight: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) + self.BottomRight:Show() + SV:SecureFadeIn(self.BottomRight, 0.2, self.BottomRight:GetAlpha(), 1) + SVLib:Trigger("DOCKS_FADE_IN"); + end +end + +function Dock:ExitFade() + if SV.cache.Docks.IsFaded then + SV:SecureFadeOut(self.BottomLeft, 0.2, self.BottomLeft:GetAlpha(), 0, true) + SV:SecureFadeOut(self.BottomRight, 0.2, self.BottomRight:GetAlpha(), 0, true) + SVLib:Trigger("DOCKS_FADE_OUT"); + end +end +--[[ +########################################################## +SET DOCKBAR FUNCTIONS +########################################################## +]]-- +local RefreshDockButtons = function(self) + for name,docklet in pairs(Dock.Registration) do + if(docklet) then + if(not InCombatLockdown() or (InCombatLockdown() and (docklet.IsProtected and not docklet:IsProtected()))) 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] + self.Parent.Window:Show() + _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] + self.Parent.Window:Show() + _G[window]:Show() + button:Activate() + end + end +end + +local ToggleDockletWindow = function(self, button) + local frame = button.FrameLink + if(frame and frame.Show) then + self.Parent.Window.FrameLink = frame + + if(not self.Parent.Window:IsShown()) then + self.Parent.Window:Show() + end + + if(not frame:IsShown()) then + self:Refresh() + 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)) + + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 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 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 = {{ title = "Move This", divider = true }}; + + 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 width = count * (size + 6) + 6; + local offset = 1; + + self.ToolBar:SetWidth(width); + 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:Size(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 + + 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 frameName = button.FrameLink:GetName() + Dock.Locations[frameName] = currentLocation; + button.FrameLink:ClearAllPoints() + button.FrameLink:SetParent(self.Parent.Window) + button.FrameLink:FillInner(self.Parent.Window) + end + + 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() + 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:Size(size, size) + button:SetFramedButtonTemplate() + button.Icon:SetTexture(dockIcon) + button:SetAttribute("tipText", displayName) + 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.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], + Default = "", + Buttons = {}, + 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 = 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; + + 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; + + 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:Size(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:Size(width, buttonsize) + dock.Bar.ToolBar:SetHeight(buttonsize) + dock:Size(width, height) + dock.Alert:Size(width, 1) + dock.Window:Size(width, height) + + if(dock.Bar.Button) then + dock.Bar.Button:Size(buttonsize, buttonsize) + end + + dock.Bar:Update() + end + end + + self.BottomCenter:Size(centerWidth, centerHeight) + self.BottomCenter.Left:Size((centerWidth * 0.5), centerHeight) + self.BottomCenter.Right:Size((centerWidth * 0.5), centerHeight) + + self.TopCenter:Size(centerWidth, centerHeight) + self.TopCenter.Left:Size((centerWidth * 0.5), centerHeight) + self.TopCenter.Right:Size((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", SV.Screen) + 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", SV.Screen) + 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:Size(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:Size(buttonsize, buttonsize) + dock.Bar.Button:SetFramedButtonTemplate() + dock.Bar.ToolBar:Size(1, buttonsize) + dock.Bar.ToolBar:Point(barAnchor, dock.Bar.Button, barReverse, (spacing * mod), 0) + InitDockButton(dock.Bar.Button) + else + dock.Bar.ToolBar:Size(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:Size(width, height) + dock:SetAttribute("buttonSize", buttonsize) + dock:SetAttribute("spacingSize", spacing) + + dock.Alert:ClearAllPoints() + dock.Alert:Size(width, 1) + dock.Alert:SetPoint(anchor, dock, anchor, 0, 0) + + dock.Window:ClearAllPoints() + dock.Window:Size(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 new file mode 100644 index 0000000..a4f4495 --- /dev/null +++ b/Interface/AddOns/SVUI/framework/docks/docks.xml @@ -0,0 +1,325 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Button name="SVUI_DockletButtonTemplate" virtual="true" hidden="true"> + <Size x="22" y="22"/> + <Attributes> + <Attribute name="tipText" type="string" value="" /> + <Attribute name="ownerFrame" type="string" value="None" /> + <Attribute name="hasDropDown" type="boolean" value="true" /> + <Attribute name="isActive" type="boolean" value="false" /> + </Attributes> + <Layers> + <Layer level="OVERLAY"> + <Texture parentKey="Icon" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT"> + <Anchors> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="2" y="-2" /> + <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-2" y="2" /> + </Anchors> + </Texture> + </Layer> + </Layers> + <Scripts> + <OnLoad> + self:RegisterForClicks("LeftButtonUp", "RightButtonUp"); + </OnLoad> + </Scripts> + </Button> + + <Frame name="SVUI_DockletWindowTemplate" virtual="true"> + <Attributes> + <Attribute name="ownerFrame" type="string" value="None" /> + <Attribute name="isLoaded" type="boolean" value="false" /> + </Attributes> + </Frame> + + <Frame name="SVUI_DockBarBottomLeft" frameStrata="BACKGROUND"> + <Size y="22"/> + <Attributes> + <Attribute name="spacingSize" type="number" value="4" /> + <Attribute name="buttonSize" type="number" value="22" /> + </Attributes> + <Anchors> + <Anchor point="BOTTOMLEFT" x="1" y="1" /> + </Anchors> + <Frames> + <Button name="$parentButton" parentKey="Button"> + <Size x="22" y="22"/> + <Anchors> + <Anchor point="BOTTOMLEFT" relativeTo="$parent" /> + </Anchors> + <Attributes> + <Attribute name="tipText" type="string" value="Toggle Docks" /> + <Attribute name="tipExtraText" type="string" value="Left Dock Options" /> + <Attribute name="hasDropDown" type="boolean" value="true" /> + </Attributes> + <Layers> + <Layer level="OVERLAY"> + <Texture parentKey="Icon" file="Interface\AddOns\SVUI\assets\artwork\Icons\SVUI-ICON"> + <Anchors> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="2" y="-2" /> + <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-2" y="2" /> + </Anchors> + </Texture> + </Layer> + </Layers> + <Scripts> + <OnLoad> + self:RegisterForClicks("LeftButtonUp", "RightButtonUp"); + </OnLoad> + </Scripts> + </Button> + <Frame name="$parentToolBar" parentKey="ToolBar"> + <Size x="1" y="22"/> + <Anchors> + <Anchor point="BOTTOMLEFT" relativeTo="$parentButton" relativePoint="BOTTOMRIGHT" x="4" y="0" /> + </Anchors> + </Frame> + </Frames> + </Frame> + + <Frame name="SVUI_DockBottomLeft" frameStrata="BACKGROUND"> + <Attributes> + <Attribute name="spacingSize" type="number" value="4" /> + <Attribute name="buttonSize" type="number" value="22" /> + </Attributes> + <Anchors> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" x="1" y="32" /> + </Anchors> + <Frames> + <Frame name="$parentAlert" parentKey="Alert" frameStrata="BACKGROUND"> + <Size y="1"/> + <Anchors> + <Anchor point="BOTTOMLEFT" x="0" y="4" /> + <Anchor point="BOTTOMRIGHT" x="0" y="4" /> + </Anchors> + </Frame> + <Frame name="$parentWindow" parentKey="Window" frameStrata="BACKGROUND"> + <Anchors> + <Anchor point="BOTTOMRIGHT" relativeTo="$parentAlert" relativePoint="TOPRIGHT" x="-4" y="4" /> + <Anchor point="BOTTOMLEFT" relativeTo="$parentAlert" relativePoint="TOPLEFT" x="4" y="4" /> + <Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT" x="4" y="0" /> + <Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT" x="-4" y="0" /> + </Anchors> + </Frame> + </Frames> + </Frame> + + <Frame name="SVUI_DockBarBottomRight" frameStrata="BACKGROUND"> + <Size y="22"/> + <Attributes> + <Attribute name="spacingSize" type="number" value="4" /> + <Attribute name="buttonSize" type="number" value="22" /> + </Attributes> + <Anchors> + <Anchor point="BOTTOMRIGHT" x="-1" y="1" /> + </Anchors> + <Frames> + <Button name="$parentButton" parentKey="Button"> + <Size x="22" y="22"/> + <Anchors> + <Anchor point="BOTTOMRIGHT" relativeTo="$parent" /> + </Anchors> + <Attributes> + <Attribute name="tipText" type="string" value="Toggle Docks" /> + <Attribute name="tipExtraText" type="string" value="Right Dock Options" /> + <Attribute name="hasDropDown" type="boolean" value="true" /> + </Attributes> + <Layers> + <Layer level="OVERLAY"> + <Texture parentKey="Icon" file="Interface\AddOns\SVUI\assets\artwork\Icons\SVUI-ICON"> + <Anchors> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="2" y="-2" /> + <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-2" y="2" /> + </Anchors> + </Texture> + </Layer> + </Layers> + <Scripts> + <OnLoad> + self:RegisterForClicks("LeftButtonUp", "RightButtonUp"); + </OnLoad> + </Scripts> + </Button> + <Frame name="$parentToolBar" parentKey="ToolBar"> + <Size x="1" y="22"/> + <Anchors> + <Anchor point="BOTTOMRIGHT" relativeTo="$parentButton" relativePoint="BOTTOMLEFT" x="-4" y="0" /> + </Anchors> + </Frame> + </Frames> + </Frame> + + <Frame name="SVUI_DockBottomRight" frameStrata="BACKGROUND"> + <Attributes> + <Attribute name="spacingSize" type="number" value="4" /> + <Attribute name="buttonSize" type="number" value="22" /> + </Attributes> + <Anchors> + <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-1" y="32" /> + </Anchors> + <Frames> + <Frame name="$parentAlert" parentKey="Alert" frameStrata="BACKGROUND"> + <Size y="1"/> + <Anchors> + <Anchor point="BOTTOMRIGHT" x="0" y="4" /> + <Anchor point="BOTTOMLEFT" x="0" y="4" /> + </Anchors> + </Frame> + <Frame name="$parentWindow" parentKey="Window" frameStrata="BACKGROUND"> + <Anchors> + <Anchor point="BOTTOMRIGHT" relativeTo="$parentAlert" relativePoint="TOPRIGHT" x="-4" y="4" /> + <Anchor point="BOTTOMLEFT" relativeTo="$parentAlert" relativePoint="TOPLEFT" x="4" y="4" /> + <Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT" x="4" y="0" /> + <Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT" x="-4" y="0" /> + </Anchors> + </Frame> + </Frames> + </Frame> + + <Frame name="SVUI_DockBarTopLeft" frameStrata="BACKGROUND"> + <Size y="22"/> + <Attributes> + <Attribute name="spacingSize" type="number" value="4" /> + <Attribute name="buttonSize" type="number" value="22" /> + </Attributes> + <Anchors> + <Anchor point="TOPLEFT" /> + </Anchors> + <Frames> + <Frame name="$parentToolBar" parentKey="ToolBar"> + <Size x="1" y="22"/> + <Anchors> + <Anchor point="TOPLEFT" relativeTo="$parent" /> + </Anchors> + </Frame> + </Frames> + </Frame> + + <Frame name="SVUI_DockTopLeft" frameStrata="BACKGROUND"> + <Attributes> + <Attribute name="spacingSize" type="number" value="4" /> + <Attribute name="buttonSize" type="number" value="22" /> + </Attributes> + <Anchors> + <Anchor point="TOPLEFT" /> + </Anchors> + <Frames> + <Frame name="$parentAlert" parentKey="Alert" frameStrata="BACKGROUND"> + <Size y="1"/> + <Anchors> + <Anchor point="TOPRIGHT" x="0" y="4" /> + <Anchor point="TOPLEFT" x="0" y="4" /> + </Anchors> + </Frame> + <Frame name="$parentWindow" parentKey="Window" frameStrata="BACKGROUND"> + <Anchors> + <Anchor point="TOPRIGHT" relativeTo="$parentAlert" relativePoint="BOTTOMRIGHT" x="0" y="4" /> + <Anchor point="TOPLEFT" relativeTo="$parentAlert" relativePoint="BOTTOMLEFT" x="0" y="4" /> + <Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="BOTTOMLEFT" x="0" y="0" /> + <Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT" x="0" y="0" /> + </Anchors> + </Frame> + </Frames> + </Frame> + + <Frame name="SVUI_DockBarTopRight" frameStrata="BACKGROUND"> + <Size y="22"/> + <Attributes> + <Attribute name="spacingSize" type="number" value="4" /> + <Attribute name="buttonSize" type="number" value="22" /> + </Attributes> + <Anchors> + <Anchor point="TOPRIGHT" /> + </Anchors> + <Frames> + <Frame name="$parentToolBar" parentKey="ToolBar"> + <Size x="1" y="22"/> + <Anchors> + <Anchor point="TOPRIGHT" relativeTo="$parent" /> + </Anchors> + </Frame> + </Frames> + </Frame> + + <Frame name="SVUI_DockTopRight" frameStrata="BACKGROUND"> + <Attributes> + <Attribute name="spacingSize" type="number" value="4" /> + <Attribute name="buttonSize" type="number" value="22" /> + </Attributes> + <Anchors> + <Anchor point="TOPRIGHT" /> + </Anchors> + <Frames> + <Frame name="$parentAlert" parentKey="Alert" frameStrata="BACKGROUND"> + <Size y="1"/> + <Anchors> + <Anchor point="TOPRIGHT" x="0" y="4" /> + <Anchor point="TOPLEFT" x="0" y="4" /> + </Anchors> + </Frame> + <Frame name="$parentWindow" parentKey="Window" frameStrata="BACKGROUND"> + <Anchors> + <Anchor point="TOPRIGHT" relativeTo="$parentAlert" relativePoint="BOTTOMRIGHT" x="0" y="4" /> + <Anchor point="TOPLEFT" relativeTo="$parentAlert" relativePoint="BOTTOMLEFT" x="0" y="4" /> + <Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="BOTTOMLEFT" x="0" y="0" /> + <Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT" x="0" y="0" /> + </Anchors> + </Frame> + </Frames> + </Frame> + + <Frame name="SVUI_DockBottomCenter" frameStrata="BACKGROUND"> + <Size x="500" y="22"/> + <Attributes> + <Attribute name="spacingSize" type="number" value="4" /> + <Attribute name="buttonSize" type="number" value="22" /> + </Attributes> + <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"> + <Size x="500" y="22"/> + <Attributes> + <Attribute name="spacingSize" type="number" value="4" /> + <Attribute name="buttonSize" type="number" value="22" /> + </Attributes> + <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"/> +</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/framework.lua b/Interface/AddOns/SVUI/framework/framework.lua new file mode 100644 index 0000000..9238308 --- /dev/null +++ b/Interface/AddOns/SVUI/framework/framework.lua @@ -0,0 +1,36 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...); + +function SV:LoadFramework() + self.Dropdown:Initialize() + self.Dock:Initialize(); + self.Mentalo:Initialize(); + self.Comix:Initialize() + self.Ego:Initialize() +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/movers/mover_blizzard.lua b/Interface/AddOns/SVUI/framework/movers/mover_blizzard.lua new file mode 100644 index 0000000..7426602 --- /dev/null +++ b/Interface/AddOns/SVUI/framework/movers/mover_blizzard.lua @@ -0,0 +1,173 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 type = _G.type; +local pairs = _G.pairs; +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 Movable = CreateFrame("Frame", nil) +local MovableFrames = {} +MovableFrames["GameMenuFrame"] = {} +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local DraggableFrames = { + "AchievementFrame", + "AuctionFrame", + "ArchaeologyFrame", + "BattlefieldMinimap", + "BarberShopFrame", + "BlackMarketFrame", + "CalendarFrame", + "CharacterFrame", + "ClassTrainerFrame", + "DressUpFrame", + "EncounterJournal", + "FriendsFrame", + "GameMenuFrame", + "GMSurveyFrame", + "GossipFrame", + "GuildFrame", + "GuildBankFrame", + "GuildRegistrarFrame", + "HelpFrame", + "InterfaceOptionsFrame", + "ItemUpgradeFrame", + "KeyBindingFrame", + "LFGDungeonReadyPopup", + "MacOptionsFrame", + "MacroFrame", + "MailFrame", + "MerchantFrame", + "PlayerTalentFrame", + "PetJournalParent", + "PVEFrame", + "PVPFrame", + "QuestFrame", + "QuestLogFrame", + "RaidBrowserFrame", + "ReadyCheckFrame", + "ReforgingFrame", + "ReportCheatingDialog", + "ReportPlayerNameDialog", + "RolePollPopup", + "ScrollOfResurrectionSelectionFrame", + "SpellBookFrame", + "TabardFrame", + "TaxiFrame", + "TimeManagerFrame", + "TradeSkillFrame", + "TradeFrame", + "TransmorgifyFrame", + "TutorialFrame", + "VideoOptionsFrame", + "VoidStorageFrame", + --"WorldStateAlwaysUpFrame" +}; +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- +local BlizzardFrame_OnUpdate = function(self) + if InCombatLockdown() or self:GetName() == "GameMenuFrame" then return end + if self.IsMoving then return end + self:ClearAllPoints() + if self:GetName() == "QuestFrame" then + if MovableFrames["GossipFrame"].Points ~= nil then + self:SetPoint(unpack(MovableFrames["GossipFrame"].Points)) + end + elseif MovableFrames[self:GetName()].Points ~= nil then + self:SetPoint(unpack(MovableFrames[self:GetName()].Points)) + end +end + +local BlizzardFrame_OnDragStart = function(self) + if not self:IsMovable() then return end + self:StartMoving() + self.IsMoving = true +end + +local BlizzardFrame_OnDragStop = function(self) + if not self:IsMovable() then return end + self.IsMoving = false; + self:StopMovingOrSizing() + if self:GetName() == "GameMenuFrame" then return end + local anchor1, parent, anchor2, x, y = self:GetPoint() + parent = self:GetParent():GetName() + self:ClearAllPoints() + self:SetPoint(anchor1, parent, anchor2, x, y) + if self:GetName() == "QuestFrame" then + MovableFrames["GossipFrame"].Points = {anchor1, parent, anchor2, x, y} + else + MovableFrames[self:GetName()].Points = {anchor1, parent, anchor2, x, y} + end +end + +local Movable_OnEvent = function(self) + for _, frameName in pairs(DraggableFrames) do + local frame = _G[frameName] + if(frame) then + if(frameName ~= "LossOfControlFrame" and (not MovableFrames[frameName])) then + frame:EnableMouse(true) + + if(frameName == "LFGDungeonReadyPopup") then + LFGDungeonReadyDialog:EnableMouse(false) + end + + frame:SetMovable(true) + frame:RegisterForDrag("LeftButton") + frame:SetClampedToScreen(true) + frame:HookScript("OnUpdate", BlizzardFrame_OnUpdate) + frame:SetScript("OnDragStart", BlizzardFrame_OnDragStart) + frame:SetScript("OnDragStop", BlizzardFrame_OnDragStop) + MovableFrames[frameName] = {} + end + end + end +end + +Movable:RegisterEvent("PLAYER_LOGIN") +Movable:RegisterEvent("ADDON_LOADED") +Movable:RegisterEvent("LFG_UPDATE") +Movable:RegisterEvent("ROLE_POLL_BEGIN") +Movable:RegisterEvent("READY_CHECK") +Movable:RegisterEvent("UPDATE_WORLD_STATES") +Movable:RegisterEvent("WORLD_STATE_TIMER_START") +Movable:RegisterEvent("WORLD_STATE_UI_TIMER_UPDATE") + +Movable:SetScript("OnEvent", Movable_OnEvent) \ 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 new file mode 100644 index 0000000..6712bee --- /dev/null +++ b/Interface/AddOns/SVUI/framework/movers/mover_mentalo.lua @@ -0,0 +1,869 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 Mentalo = {} + +Mentalo.Frames = {} + +local MentaloUpdateHandler = CreateFrame("Frame", nil) + +local Sticky = {}; +Sticky.Frames = {}; +Sticky.Frames[1] = SV.Screen; +Sticky.scripts = Sticky.scripts or {} +Sticky.rangeX = 15 +Sticky.rangeY = 15 +Sticky.sticky = Sticky.sticky or {} + +local function SnapStickyFrame(frameA, frameB, left, top, right, bottom) + local sA, sB = frameA:GetEffectiveScale(), frameB:GetEffectiveScale() + local xA, yA = frameA:GetCenter() + local xB, yB = frameB:GetCenter() + local hA, hB = frameA:GetHeight() / 2, ((frameB:GetHeight() * sB) / sA) / 2 + local wA, wB = frameA:GetWidth() / 2, ((frameB:GetWidth() * sB) / sA) / 2 + local newX, newY = xA, yA + if not left then left = 0 end + if not top then top = 0 end + if not right then right = 0 end + if not bottom then bottom = 0 end + if not xB or not yB or not sB or not sA or not sB then return end + xB, yB = (xB * sB) / sA, (yB * sB) / sA + local stickyAx, stickyAy = wA * 0.75, hA * 0.75 + local stickyBx, stickyBy = wB * 0.75, hB * 0.75 + local lA, tA, rA, bA = frameA:GetLeft(), frameA:GetTop(), frameA:GetRight(), frameA:GetBottom() + local lB, tB, rB, bB = frameB:GetLeft(), frameB:GetTop(), frameB:GetRight(), frameB:GetBottom() + local snap = nil + lB, tB, rB, bB = (lB * sB) / sA, (tB * sB) / sA, (rB * sB) / sA, (bB * sB) / sA + if (bA <= tB and bB <= tA) then + if xA <= (xB + Sticky.rangeX) and xA >= (xB - Sticky.rangeX) then + newX = xB + snap = true + end + if lA <= (lB + Sticky.rangeX) and lA >= (lB - Sticky.rangeX) then + newX = lB + wA + if frameB == UIParent or frameB == WorldFrame or frameB == SVUIParent then + newX = newX + 4 + end + snap = true + end + if rA <= (rB + Sticky.rangeX) and rA >= (rB - Sticky.rangeX) then + newX = rB - wA + if frameB == UIParent or frameB == WorldFrame or frameB == SVUIParent then + newX = newX - 4 + end + snap = true + end + if lA <= (rB + Sticky.rangeX) and lA >= (rB - Sticky.rangeX) then + newX = rB + (wA - left) + snap = true + end + if rA <= (lB + Sticky.rangeX) and rA >= (lB - Sticky.rangeX) then + newX = lB - (wA - right) + snap = true + end + end + if (lA <= rB and lB <= rA) then + if yA <= (yB + Sticky.rangeY) and yA >= (yB - Sticky.rangeY) then + newY = yB + snap = true + end + if tA <= (tB + Sticky.rangeY) and tA >= (tB - Sticky.rangeY) then + newY = tB - hA + if frameB == UIParent or frameB == WorldFrame or frameB == SVUIParent then + newY = newY - 4 + end + snap = true + end + if bA <= (bB + Sticky.rangeY) and bA >= (bB - Sticky.rangeY) then + newY = bB + hA + if frameB == UIParent or frameB == WorldFrame or frameB == SVUIParent then + newY = newY + 4 + end + snap = true + end + if tA <= (bB + Sticky.rangeY + bottom) and tA >= (bB - Sticky.rangeY + bottom) then + newY = bB - (hA - top) + snap = true + end + if bA <= (tB + Sticky.rangeY - top) and bA >= (tB - Sticky.rangeY - top) then + newY = tB + (hA - bottom) + snap = true + end + end + if snap then + frameA:ClearAllPoints() + frameA:SetPoint("CENTER", UIParent, "BOTTOMLEFT", newX, newY) + return true + end +end + +function Sticky:GetStickyUpdate(frame, xoffset, yoffset, left, top, right, bottom) + return function() + local x, y = GetCursorPosition() + local s = frame:GetEffectiveScale() + local sticky = nil + x, y = x / s, y / s + frame:ClearAllPoints() + frame:SetPoint("CENTER", UIParent, "BOTTOMLEFT", x + xoffset, y + yoffset) + self.sticky[frame] = nil + for i = 1, #Sticky.Frames do + local v = Sticky.Frames[i] + if(frame ~= v and frame ~= v:GetParent() and not IsShiftKeyDown() and v:IsVisible()) then + if SnapStickyFrame(frame, v, left, top, right, bottom) then + self.sticky[frame] = v + break + end + end + end + end +end + +function Sticky:StartMoving(frame, left, top, right, bottom) + local x, y = GetCursorPosition() + local aX, aY = frame:GetCenter() + local aS = frame:GetEffectiveScale() + aX, aY = aX * aS, aY * aS + local xoffset, yoffset = (aX - x), (aY - y) + self.scripts[frame] = frame:GetScript("OnUpdate") + frame:SetScript("OnUpdate", Sticky.GetStickyUpdate(Sticky, frame, xoffset, yoffset, left, top, right, bottom)) +end + +function Sticky:StopMoving(frame) + frame:SetScript("OnUpdate", self.scripts[frame]) + self.scripts[frame] = nil + if self.sticky[frame] then + local sticky = self.sticky[frame] + self.sticky[frame] = nil + return true, sticky + else + return false, nil + end +end +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local CurrentFrameTarget, UpdateFrameTarget; +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- +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 CurrentPosition(frame) + if not frame then return end + local anchor1, parent, anchor2, x, y = frame:GetPoint() + local parentName + if not parent then + parentName = "SVUIParent" + elseif not parent:GetName() then + parentName = "SVUI_Player" + else + parentName = parent:GetName() + end + return ("%s\031%s\031%s\031%d\031%d"):format(anchor1, parentName, anchor2, parsefloat(x), parsefloat(y)) +end + +local function GrabUsableRegions(frame) + local parent = frame or SV.Screen + local right = parent:GetRight() + local top = parent:GetTop() + local center = parent:GetCenter() + return right, top, center +end + +local function CalculateOffsets(frame) + if(not CurrentFrameTarget) then return end + local right, top, center = GrabUsableRegions() + local xOffset, yOffset = CurrentFrameTarget:GetCenter() + local screenLeft = (right * 0.33); + local screenRight = (right * 0.66); + local topMedian = (top * 0.5); + local anchor, a1, a2; + + if(yOffset >= (top * 0.5)) then + a1 = "TOP" + yOffset = -(top - CurrentFrameTarget:GetTop()) + else + a1 = "BOTTOM" + yOffset = CurrentFrameTarget:GetBottom() + end + + if xOffset >= screenRight then + a2 = "RIGHT" + xOffset = (CurrentFrameTarget:GetRight() - right) + elseif xOffset <= screenLeft then + a2 = "LEFT" + xOffset = CurrentFrameTarget:GetLeft() + else + a2 = "" + xOffset = (xOffset - center) + end + + xOffset = parsefloat(xOffset, 0) + yOffset = parsefloat(yOffset, 0) + anchor = ("%s%s"):format(a1,a2) + + return xOffset, yOffset, anchor +end + +local function ResetAllAlphas() + for entry,_ in pairs(Mentalo.Frames) do + local frame = _G[entry] + if(frame) then + frame:SetAlpha(0.4) + end + end +end + +--[[ + /$$$$$$$$/$$ /$$ /$$$$$$$$ /$$ /$$ /$$$$$$ /$$ /$$ /$$$$$$$ +|__ $$__/ $$ | $$| $$_____/ | $$ | $$ /$$__ $$| $$$ | $$| $$__ $$ + | $$ | $$ | $$| $$ | $$ | $$| $$ \ $$| $$$$| $$| $$ \ $$ + | $$ | $$$$$$$$| $$$$$ | $$$$$$$$| $$$$$$$$| $$ $$ $$| $$ | $$ + | $$ | $$__ $$| $$__/ | $$__ $$| $$__ $$| $$ $$$$| $$ | $$ + | $$ | $$ | $$| $$ | $$ | $$| $$ | $$| $$\ $$$| $$ | $$ + | $$ | $$ | $$| $$$$$$$$ | $$ | $$| $$ | $$| $$ \ $$| $$$$$$$/ + |__/ |__/ |__/|________/ |__/ |__/|__/ |__/|__/ \__/|_______/ +--]] + +local TheHand = CreateFrame("Frame", "SVUI_HandOfMentalo", SV.Screen) +TheHand:SetFrameStrata("DIALOG") +TheHand:SetFrameLevel(99) +TheHand:SetClampedToScreen(true) +TheHand:SetSize(128,128) +TheHand:SetPoint("CENTER") +TheHand.bg = TheHand:CreateTexture(nil, "OVERLAY") +TheHand.bg:SetAllPoints(TheHand) +TheHand.bg:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-HAND-OFF]]) +TheHand.energy = TheHand:CreateTexture(nil, "OVERLAY") +TheHand.energy:SetAllPoints(TheHand) +TheHand.energy:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-ENERGY]]) +SV.Animate:Orbit(TheHand.energy, 10) +TheHand.flash = TheHand.energy.anim; +TheHand.energy:Hide() +TheHand.elapsedTime = 0; +TheHand.flash:Stop() +TheHand:Hide() +TheHand.UserHeld = false; + +local TheHand_OnUpdate = function(self, elapsed) + self.elapsedTime = self.elapsedTime + elapsed + if self.elapsedTime > 0.1 then + self.elapsedTime = 0 + local x, y = GetCursorPosition() + local scale = SV.Screen:GetEffectiveScale() + self:SetPoint("CENTER", SV.Screen, "BOTTOMLEFT", (x / scale) + 50, (y / scale) + 50) + end +end + +function TheHand:Enable() + self:Show() + self.bg:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-HAND-ON]]) + self.energy:Show() + self.flash:Play() + self:SetScript("OnUpdate", TheHand_OnUpdate) +end + +function TheHand:Disable() + self.flash:Stop() + self.energy:Hide() + self.bg:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-HAND-OFF]]) + self:SetScript("OnUpdate", nil) + self.elapsedTime = 0 + self:Hide() +end +--[[ +########################################################## +HANDLERS +########################################################## +]]-- +local Movable_OnMouseUp = function(self) + CurrentFrameTarget = self; + local xOffset, yOffset, anchor = CalculateOffsets() + + SVUI_MentaloPrecisionSetX.CurrentValue = xOffset; + SVUI_MentaloPrecisionSetX:SetText(xOffset) + + SVUI_MentaloPrecisionSetY.CurrentValue = yOffset; + SVUI_MentaloPrecisionSetY:SetText(yOffset) + + SVUI_MentaloPrecision.Title:SetText(self.textString) +end + +local Movable_OnUpdate = function(self) + local frame = UpdateFrameTarget; + if not frame then return end + local rightPos, topPos, centerPos = GrabUsableRegions() + local centerX, centerY = frame:GetCenter() + local calc1 = rightPos * 0.33; + local calc2 = rightPos * 0.66; + local calc3 = topPos * 0.5; + local anchor1, anchor2; + 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) + Movable_OnMouseUp(frame) +end + +local Movable_OnSizeChanged = function(self) + if InCombatLockdown()then return end + if self.dirtyWidth and self.dirtyHeight then + self.Avatar:Size(self.dirtyWidth, self.dirtyHeight) + else + self.Avatar:Size(self:GetSize()) + end +end + +local Movable_OnDragStart = function(self) + if InCombatLockdown() then SV:AddonMessage(ERR_NOT_IN_COMBAT)return end + if SV.db.general.stickyFrames then + Sticky:StartMoving(self, self.snapOffset, self.snapOffset, self.snapOffset, self.snapOffset) + else + self:StartMoving() + end + UpdateFrameTarget = self; + MentaloUpdateHandler:Show() + MentaloUpdateHandler:SetScript("OnUpdate", Movable_OnUpdate) + TheHand:Enable() + TheHand.UserHeld = true +end + +local Movable_OnDragStop = function(self) + if InCombatLockdown()then SV:AddonMessage(ERR_NOT_IN_COMBAT)return end + TheHand.UserHeld = false; + if SV.db.general.stickyFrames then + Sticky:StopMoving(self) + else + self:StopMovingOrSizing() + end + local pR, pT, pC = GrabUsableRegions() + local cX, cY = self:GetCenter() + local newAnchor; + if cY >= (pT * 0.5) then + newAnchor = "TOP"; + cY = (-(pT - self:GetTop())) + else + newAnchor = "BOTTOM" + cY = self:GetBottom() + end + if cX >= (pR * 0.66) then + newAnchor = newAnchor.."RIGHT" + cX = self:GetRight() - pR + elseif cX <= (pR * 0.33) then + newAnchor = newAnchor.."LEFT" + cX = self:GetLeft() + else + cX = cX - pC + end + if self.positionOverride then + self.parent:ClearAllPoints() + self.parent:Point(self.positionOverride, self, self.positionOverride) + end + + self:ClearAllPoints() + self:Point(newAnchor, SV.Screen, newAnchor, cX, cY) + + Mentalo:SaveMovable(self.name) + + if SVUI_MentaloPrecision then + Movable_OnMouseUp(self) + end + + UpdateFrameTarget = nil; + + MentaloUpdateHandler:SetScript("OnUpdate", nil) + MentaloUpdateHandler:Hide() + + if(self.postdrag ~= nil and type(self.postdrag) == "function") then + self:postdrag(Pinpoint(self)) + end + self:SetUserPlaced(false) + TheHand:Disable() +end + +local Movable_OnEnter = function(self) + if TheHand.UserHeld then return end + ResetAllAlphas() + self:SetAlpha(1) + self.text:SetTextColor(1, 1, 1) + UpdateFrameTarget = self; + SVUI_Mentalo.Avatar:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-ON]]) + TheHand:SetPoint("CENTER", self, "TOP", 0, 0) + TheHand:Show() + if CurrentFrameTarget ~= self then + SVUI_MentaloPrecision:Hide() + Movable_OnMouseUp(self) + end +end + +local Movable_OnLeave = function(self) + if TheHand.UserHeld then return end + self.text:SetTextColor(0.1, 0.8, 0.8) + SVUI_Mentalo.Avatar:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-OFF]]) + TheHand:Hide() + if(CurrentFrameTarget ~= self and not SVUI_MentaloPrecision:IsShown()) then + self:SetAlpha(0.4) + end +end + +local Movable_OnMouseDown = function(self, arg) + if arg == "RightButton"then + TheHand.UserHeld = false; + if(CurrentFrameTarget == self and not SVUI_MentaloPrecision:IsShown()) then + Movable_OnUpdate() + SVUI_MentaloPrecision:Show() + else + SVUI_MentaloPrecision:Hide() + end + if SV.db.general.stickyFrames then + Sticky:StopMoving(self) + else + self:StopMovingOrSizing() + end + end +end + +local Movable_OnShow = function(self) + self:SetBackdropBorderColor(0.1, 0.8, 0.8) +end +--[[ +########################################################## +CONSTRUCTS +########################################################## +]]-- +function Mentalo:New(frame, moveName, title, raised, snap, dragStopFunc) + if(not frame) then return end + if self.Frames[moveName].Created then return end + if raised == nil then raised = true end + + local movable = CreateFrame("Button", moveName, SV.Screen) + movable:SetFrameLevel(frame:GetFrameLevel() + 1) + movable:SetClampedToScreen(true) + movable:SetWidth(frame:GetWidth()) + movable:SetHeight(frame:GetHeight()) + + movable.parent = frame; + movable.name = moveName; + movable.textString = title; + movable.postdrag = dragStopFunc; + movable.overlay = raised; + movable.snapOffset = snap or -2; + + if raised == true then + movable:SetFrameStrata("DIALOG") + else + movable:SetFrameStrata("BACKGROUND") + end + + local anchor1, anchorParent, anchor2, xPos, yPos = split("\031", CurrentPosition(frame)) + if(SV.cache.Anchors and SV.cache.Anchors[moveName]) then + if(type(SV.cache.Anchors[moveName]) == "table") then + movable:SetPoint(SV.cache.Anchors[moveName]["p"], SV.Screen, SV.cache.Anchors[moveName]["p2"], SV.cache.Anchors[moveName]["p3"], SV.cache.Anchors[moveName]["p4"]) + SV.cache.Anchors[moveName] = CurrentPosition(movable) + movable:ClearAllPoints() + end + anchor1, anchorParent, anchor2, xPos, yPos = split("\031", SV.cache.Anchors[moveName]) + movable:SetPoint(anchor1, anchorParent, anchor2, xPos, yPos) + else + movable:SetPoint(anchor1, anchorParent, anchor2, xPos, yPos) + end + + movable:SetFixedPanelTemplate("Transparent") + movable:SetAlpha(0.4) + + self.Frames[moveName].Avatar = movable; + Sticky.Frames[#Sticky.Frames + 1] = movable; + + frame:SetScript("OnSizeChanged", Movable_OnSizeChanged) + frame.Avatar = movable; + frame:ClearAllPoints() + frame:SetPoint(anchor1, movable, 0, 0) + + local mtext = movable:CreateFontString(nil, "OVERLAY") + mtext:FontManager() + mtext:SetJustifyH("CENTER") + mtext:SetPoint("CENTER") + mtext:SetText(title or moveName) + mtext:SetTextColor(0.1, 0.8, 0.8) + + movable:SetFontString(mtext) + movable.text = mtext; + + movable:RegisterForDrag("LeftButton", "RightButton") + movable:SetScript("OnMouseUp", Movable_OnMouseUp) + movable:SetScript("OnDragStart", Movable_OnDragStart) + movable:SetScript("OnDragStop", Movable_OnDragStop) + movable:SetScript("OnEnter", Movable_OnEnter) + movable:SetScript("OnMouseDown", Movable_OnMouseDown) + movable:SetScript("OnLeave", Movable_OnLeave) + movable:SetScript("OnShow", Movable_OnShow) + + movable:SetMovable(true) + movable:Hide() + + if dragStopFunc ~= nil and type(dragStopFunc) == "function" then + movable:RegisterEvent("PLAYER_ENTERING_WORLD") + movable:SetScript("OnEvent", function(this, event) + local point = Pinpoint(this) + dragStopFunc(this, point) + this:UnregisterAllEvents() + end) + end + + self.Frames[moveName].Created = true +end + +function Mentalo:HasMoved(frame) + if SV.cache.Anchors and SV.cache.Anchors[frame] then + return true + else + return false + end +end + +function Mentalo:SaveMovable(frame) + if(not _G[frame] or not SV.cache.Anchors) then return end + SV.cache.Anchors[frame] = CurrentPosition(_G[frame]) +end + +function Mentalo:ChangeSnapOffset(frame, snapOffset) + if not _G[frame] or not self.Frames[frame] then return end + self.Frames[frame].Avatar.snapOffset = snapOffset or -2; + self.Frames[frame]["snapoffset"] = snapOffset or -2 +end + +function Mentalo:Add(frame, title, raised, snapOffset, dragStopFunc, movableGroup, overrideName) + if(not frame or (not overrideName and not frame:GetName())) then return end + local frameName = overrideName or frame:GetName() + local moveName = ("%s_MOVE"):format(frameName) + if not movableGroup then movableGroup = "ALL, GENERAL" end + if self.Frames[moveName] == nil then + self.Frames[moveName] = {} + self.Frames[moveName]["parent"] = frame; + self.Frames[moveName]["text"] = title; + self.Frames[moveName]["overlay"] = raised; + self.Frames[moveName]["postdrag"] = dragStopFunc; + self.Frames[moveName]["snapoffset"] = snapOffset; + self.Frames[moveName]["point"] = CurrentPosition(frame) + self.Frames[moveName]["type"] = {} + local group = {split(", ", movableGroup)} + for i = 1, #group do + local this = group[i] + self.Frames[moveName]["type"][this] = true + end + end + + self:New(frame, moveName, title, raised, snapOffset, dragStopFunc) +end + +function Mentalo:Reset(request) + if request == "" or request == nil then + for name, _ in pairs(self.Frames)do + local frame = _G[name]; + if self.Frames[name]["point"] then + local u, v, w, x, y = split("\031", self.Frames[name]["point"]) + frame:ClearAllPoints() + frame:SetPoint(u, v, w, x, y) + for arg, func in pairs(self.Frames[name])do + if arg == "postdrag" and type(func) == "function" then + func(frame, Pinpoint(frame)) + end + end + end + end + if(SV.cache.Anchors) then + wipe(SV.cache.Anchors) + end + else + for name, _ in pairs(self.Frames)do + if self.Frames[name]["point"] then + for arg1, arg2 in pairs(self.Frames[name])do + local mover; + if arg1 == "text" then + if request == arg2 then + local frame = _G[name] + local u, v, w, x, y = split("\031", self.Frames[name]["point"]) + frame:ClearAllPoints() + frame:SetPoint(u, v, w, x, y) + if(SV.cache.Anchors and SV.cache.Anchors[name]) then + SV.cache.Anchors[name] = nil + end + if (self.Frames[name]["postdrag"] ~= nil and type(self.Frames[name]["postdrag"]) == "function")then + self.Frames[name]["postdrag"](frame, Pinpoint(frame)) + end + end + end + end + end + end + end +end + +function Mentalo:SetPositions() + for name, _ in pairs(self.Frames)do + local frame = _G[name]; + local anchor1, parent, anchor2, x, y; + if frame then + if (SV.cache.Anchors and SV.cache.Anchors[name] and type(SV.cache.Anchors[name]) == "string") then + anchor1, parent, anchor2, x, y = split("\031", SV.cache.Anchors[name]) + frame:ClearAllPoints() + frame:SetPoint(anchor1, parent, anchor2, x, y) + elseif self.Frames[name]["point"] then + anchor1, parent, anchor2, x, y = split("\031", self.Frames[name]["point"]) + frame:ClearAllPoints() + frame:SetPoint(anchor1, parent, anchor2, x, y) + end + end + end +end + +function Mentalo:Toggle(isConfigMode, configType) + if(InCombatLockdown()) then return end + local enabled = false; + if(isConfigMode ~= nil and isConfigMode ~= "") then + self.ConfigurationMode = isConfigMode + end + + if(not self.ConfigurationMode) then + if IsAddOnLoaded(SV.ConfigID)then + LibStub("AceConfigDialog-3.0"):Close(SV.NameID) + GameTooltip:Hide() + self.ConfigurationMode = true + else + self.ConfigurationMode = false + end + else + self.ConfigurationMode = false + end + + if(SVUI_Mentalo:IsShown()) then + SVUI_Mentalo:Hide() + else + SVUI_Mentalo:Show() + enabled = true + end + + if(not configType or (configType and type(configType) ~= "string")) then + configType = "ALL" + end + + for frameName, _ in pairs(self.Frames)do + if(_G[frameName]) then + local movable = _G[frameName] + if(not enabled) then + movable:Hide() + else + if self.Frames[frameName]["type"][configType]then + movable:Show() + else + movable:Hide() + end + end + end + end +end +--[[ +########################################################## +SCRIPT AND EVENT HANDLERS +########################################################## +]]-- +local XML_Mentalo_OnEvent = function(self) + if self:IsShown() then + self:Hide() + Mentalo:Toggle(true) + end +end + +local XML_MentaloLockButton_OnClick = function(self) + Mentalo:Toggle(true) + if IsAddOnLoaded(SV.ConfigID)then + LibStub("AceConfigDialog-3.0"):Open(SV.NameID) + end +end + +local SVUI_MentaloPrecisionResetButton_OnClick = function(self) + if(not CurrentFrameTarget) then return end + local name = CurrentFrameTarget.name + Mentalo:Reset(name) +end + +local XML_MentaloPrecisionInputX_EnterPressed = function(self) + local current = tonumber(self:GetText()) + if(current) then + if(CurrentFrameTarget) then + local xOffset, yOffset, anchor = CalculateOffsets() + yOffset = tonumber(SVUI_MentaloPrecisionSetY.CurrentValue) + CurrentFrameTarget:ClearAllPoints() + CurrentFrameTarget:Point(anchor, SVUIParent, anchor, current, yOffset) + Mentalo:SaveMovable(CurrentFrameTarget.name) + end + self.CurrentValue = current + end + self:SetText(floor((self.CurrentValue or 0) + 0.5)) + EditBox_ClearFocus(self) +end + +local XML_MentaloPrecisionInputY_EnterPressed = function(self) + local current = tonumber(self:GetText()) + if(current) then + if(CurrentFrameTarget) then + local xOffset, yOffset, anchor = CalculateOffsets() + xOffset = tonumber(SVUI_MentaloPrecisionSetX.CurrentValue) + CurrentFrameTarget:ClearAllPoints() + CurrentFrameTarget:Point(anchor, SVUIParent, anchor, xOffset, current) + Mentalo:SaveMovable(CurrentFrameTarget.name) + end + self.CurrentValue = current + end + self:SetText(floor((self.CurrentValue or 0) + 0.5)) + EditBox_ClearFocus(self) +end +--[[ +########################################################## +Initialize +########################################################## +]]-- +function Mentalo:Initialize() + SVUI_Mentalo:SetFixedPanelTemplate("Component") + SVUI_Mentalo:SetPanelColor("yellow") + SVUI_Mentalo:RegisterForDrag("LeftButton") + SVUI_Mentalo:RegisterEvent("PLAYER_REGEN_DISABLED") + SVUI_Mentalo:SetScript("OnEvent", XML_Mentalo_OnEvent) + + SVUI_MentaloLockButton:SetScript("OnClick", XML_MentaloLockButton_OnClick) + + SVUI_MentaloPrecision:SetPanelTemplate("Transparent") + SVUI_MentaloPrecision:EnableMouse(true) + + SVUI_MentaloPrecisionSetX:SetEditboxTemplate() + SVUI_MentaloPrecisionSetX.CurrentValue = 0; + SVUI_MentaloPrecisionSetX:SetScript("OnEnterPressed", XML_MentaloPrecisionInputX_EnterPressed) + + SVUI_MentaloPrecisionSetY:SetEditboxTemplate() + SVUI_MentaloPrecisionSetY.CurrentValue = 0; + SVUI_MentaloPrecisionSetY:SetScript("OnEnterPressed", XML_MentaloPrecisionInputY_EnterPressed) + + SVUI_MentaloPrecisionUpButton:SetButtonTemplate() + SVUI_MentaloPrecisionDownButton:SetButtonTemplate() + SVUI_MentaloPrecisionLeftButton:SetButtonTemplate() + SVUI_MentaloPrecisionRightButton:SetButtonTemplate() + + SV.cache.Anchors = SV.cache.Anchors or {} + + for name, _ in pairs(self.Frames)do + local parent, text, overlay, snapoffset, postdrag; + for key, value in pairs(self.Frames[name])do + if(key == "parent") then + parent = value + elseif(key == "text") then + text = value + elseif(key == "overlay") then + overlay = value + elseif(key == "snapoffset") then + snapoffset = value + elseif(key == "postdrag") then + postdrag = value + end + end + self:New(parent, name, text, overlay, snapoffset, postdrag) + end + + self:SetPositions() +end + +SV.Mentalo = Mentalo \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/movers/movers.xml b/Interface/AddOns/SVUI/framework/movers/movers.xml new file mode 100644 index 0000000..e5f19c4 --- /dev/null +++ b/Interface/AddOns/SVUI/framework/movers/movers.xml @@ -0,0 +1,253 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Frame name="SVUI_MentaloPrecision" hidden="true" frameStrata="DIALOG"> + <Size x="130" y="60"/> + <Anchors> + <Anchor point="CENTER"/> + </Anchors> + <Layers> + <Layer level="BACKGROUND"> + <Texture name="$parentBG" setAllPoints="true"/> + </Layer> + <Layer level="OVERLAY"> + <Texture name="$parentTitleBG"> + <Anchors> + <Anchor point="BOTTOMLEFT" relativeTo="$parentBG" relativePoint="TOPLEFT"/> + <Anchor point="TOPRIGHT" relativeTo="$parentBG" relativePoint="TOPRIGHT"> + <Offset x="0" y="30"/> + </Anchor> + </Anchors> + </Texture> + </Layer> + <Layer level="ARTWORK"> + <FontString parentKey="Title" inherits="GameFontNormal" text="Focused Position"> + <Anchors> + <Anchor point="TOPLEFT" relativeTo="$parentTitleBG" relativePoint="TOPLEFT"/> + <Anchor point="BOTTOMRIGHT" relativeTo="$parentTitleBG" relativePoint="BOTTOMRIGHT"/> + </Anchors> + </FontString> + <FontString inherits="NumberFont_Outline_Huge" text="X"> + <Anchors> + <Anchor point="RIGHT" relativeTo="$parent" relativePoint="LEFT"> + <Offset x="-3" y="0"/> + </Anchor> + </Anchors> + <Color r="1" g="0.5" b="0" a="1"/> + </FontString> + <FontString inherits="NumberFont_Outline_Huge" text="Y"> + <Anchors> + <Anchor point="LEFT" relativeTo="$parent" relativePoint="RIGHT"> + <Offset x="3" y="0"/> + </Anchor> + </Anchors> + <Color r="1" g="0.5" b="0" a="1"/> + </FontString> + </Layer> + </Layers> + <Frames> + <EditBox name="$parentSetX" inherits="InputBoxTemplate" autoFocus="false"> + <Size x="50" y="17"/> + <Anchors> + <Anchor point="BOTTOMRIGHT" relativeTo="$parentBG" relativePoint="CENTER"> + <Offset x="-12" y="3"/> + </Anchor> + </Anchors> + + <Scripts> + <OnEscapePressed> + self:SetText(math.floor((self.CurrentValue or 0) + 0.5)) + EditBox_ClearFocus(self) + </OnEscapePressed> + <OnEditFocusLost> + self:SetText(math.floor((self.CurrentValue or 0) + 0.5)) + </OnEditFocusLost> + <OnShow> + EditBox_ClearFocus(self) + self:SetText(math.floor((self.CurrentValue or 0) + 0.5)) + </OnShow> + </Scripts> + </EditBox> + + <EditBox name="$parentSetY" inherits="InputBoxTemplate" autoFocus="false"> + <Size x="50" y="17"/> + <Anchors> + <Anchor point="BOTTOMLEFT" relativeTo="$parentBG" relativePoint="CENTER"> + <Offset x="12" y="3"/> + </Anchor> + </Anchors> + <Scripts> + <OnEscapePressed> + self:SetText(math.floor((self.CurrentValue or 0) + 0.5)) + EditBox_ClearFocus(self) + </OnEscapePressed> + <OnEditFocusLost> + self:SetText(math.floor((self.CurrentValue or 0) + 0.5)) + </OnEditFocusLost> + <OnShow> + EditBox_ClearFocus(self) + self:SetText(math.floor((self.CurrentValue or 0) + 0.5)) + </OnShow> + </Scripts> + </EditBox> + + <Button name="$parentUpButton" inherits="UIPanelSquareButton"> + <Size x="25" y="20"/> + <Anchors> + <Anchor point="TOPLEFT" relativeTo="$parentBG" relativePoint="CENTER"> + <Offset x="10" y="-3"/> + </Anchor> + </Anchors> + <Scripts> + <OnLoad> + SquareButton_SetIcon(self, "UP"); + self:RegisterForClicks("AnyUp"); + </OnLoad> + <OnClick> + local frame = _G["SVUI_MentaloPrecisionSetY"]; + frame.CurrentValue = frame.CurrentValue + 1 + frame:SetText(frame.CurrentValue) + frame:GetScript('OnEnterPressed')(frame) + </OnClick> + </Scripts> + </Button> + + <Button name="$parentDownButton" inherits="UIPanelSquareButton"> + <Size x="25" y="20"/> + <Anchors> + <Anchor point="LEFT" relativeTo="$parentUpButton" relativePoint="RIGHT"> + <Offset x="2" y="0"/> + </Anchor> + </Anchors> + <Scripts> + <OnLoad> + SquareButton_SetIcon(self, "DOWN"); + self:RegisterForClicks("AnyUp"); + </OnLoad> + <OnClick> + local frame = _G["SVUI_MentaloPrecisionSetY"]; + frame.CurrentValue = frame.CurrentValue - 1 + frame:SetText(frame.CurrentValue) + frame:GetScript('OnEnterPressed')(frame) + </OnClick> + </Scripts> + </Button> + + <Button name="$parentRightButton" inherits="UIPanelSquareButton"> + <Size x="25" y="20"/> + <Anchors> + <Anchor point="RIGHT" relativeTo="$parentUpButton" relativePoint="LEFT"> + <Offset x="-20" y="0"/> + </Anchor> + </Anchors> + <Scripts> + <OnLoad> + SquareButton_SetIcon(self, "RIGHT"); + self:RegisterForClicks("AnyUp"); + </OnLoad> + <OnClick> + local frame = _G["SVUI_MentaloPrecisionSetX"]; + frame.CurrentValue = frame.CurrentValue + 1 + frame:SetText(frame.CurrentValue) + frame:GetScript('OnEnterPressed')(frame) + </OnClick> + </Scripts> + </Button> + + <Button name="$parentLeftButton" inherits="UIPanelSquareButton"> + <Size x="25" y="20"/> + <Anchors> + <Anchor point="RIGHT" relativeTo="$parentRightButton" relativePoint="LEFT"> + <Offset x="-2" y="0"/> + </Anchor> + </Anchors> + <Scripts> + <OnLoad> + SquareButton_SetIcon(self, "LEFT"); + self:RegisterForClicks("AnyUp"); + </OnLoad> + <OnClick> + local frame = _G["SVUI_MentaloPrecisionSetX"]; + frame.CurrentValue = frame.CurrentValue - 1 + frame:SetText(frame.CurrentValue) + frame:GetScript('OnEnterPressed')(frame) + </OnClick> + </Scripts> + </Button> + </Frames> + </Frame> + + <Frame name="SVUI_Mentalo" movable="true" hidden="true" frameStrata="DIALOG"> + <Size x="300" y="30"/> + <Anchors> + <Anchor point="CENTER"/> + </Anchors> + <Layers> + <Layer level="BACKGROUND"> + <Texture name="$parentBG" setAllPoints="true"/> + </Layer> + <Layer level="OVERLAY"> + <Texture name="$parentTitleBG"> + <Anchors> + <Anchor point="TOPLEFT"/> + <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT"> + <Offset x="0" y="-30"/> + </Anchor> + </Anchors> + </Texture> + </Layer> + <Layer level="ARTWORK"> + <FontString parentKey="Title" inherits="SystemFont_Small" justifyH="LEFT" text="Mentalo The Frame Mover!"> + <Anchors> + <Anchor point="TOPLEFT" relativeTo="$parentTitleBG"> + <Offset x="4" y="0"/> + </Anchor> + <Anchor point="BOTTOMRIGHT" relativeTo="$parentTitleBG"/> + </Anchors> + <Color r="1" g="1" b="1" a="1"/> + </FontString> + <FontString parentKey="SubTitle" inherits="FriendsFont_Small" justifyH="CENTER" text="Right-click frames to move with precision."> + <Anchors> + <Anchor point="TOPLEFT" relativeTo="$parentTitleBG" relativePoint="BOTTOMLEFT"> + <Offset x="4" y="-4"/> + </Anchor> + <Anchor point="TOPRIGHT" relativeTo="$parentTitleBG" relativePoint="BOTTOMRIGHT"> + <Offset x="-4" y="-4"/> + </Anchor> + </Anchors> + <Color r="1" g="1" b="0" a="0.8"/> + </FontString> + <Texture parentKey="Avatar" file="Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-OFF"> + <Size x="132" y="132"/> + <Anchors> + <Anchor point="BOTTOM" relativeTo="$parentBG" relativePoint="TOP"/> + </Anchors> + </Texture> + </Layer> + </Layers> + <Frames> + <Button name="$parentLockButton" inherits="OptionsButtonTemplate" text="Lock"> + <Size x="96" y="24"/> + <Anchors> + <Anchor point="RIGHT" relativeTo="$parentBG"> + <Offset x="-4" y="0"/> + </Anchor> + </Anchors> + </Button> + </Frames> + <Scripts> + <OnHide> + _G["SVUI_MentaloPrecision"]:Hide(); + </OnHide> + <OnDragStart> + self.moving = true; + self:StartMoving(); + </OnDragStart> + <OnDragStop> + self.moving = nil; + self:StopMovingOrSizing(); + </OnDragStop> + </Scripts> + </Frame> + + <Script file="mover_mentalo.lua"/> + <Script file="mover_blizzard.lua"/> +</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/widgets/widget_comix.lua b/Interface/AddOns/SVUI/framework/widgets/widget_comix.lua new file mode 100644 index 0000000..f7ea3c6 --- /dev/null +++ b/Interface/AddOns/SVUI/framework/widgets/widget_comix.lua @@ -0,0 +1,214 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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.Comix = CreateFrame("Frame"); +SV.Comix.Basic = _G["SVUI_ComixFrame1"] +SV.Comix.Deluxe = _G["SVUI_ComixFrame2"] +SV.Comix.Premium = _G["SVUI_ComixFrame3"] +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local animReady = true; +local playerGUID; +local COMIX_DATA = { + { + {0,0.25,0,0.25}, + {0.25,0.5,0,0.25}, + {0.5,0.75,0,0.25}, + {0.75,1,0,0.25}, + {0,0.25,0.25,0.5}, + {0.25,0.5,0.25,0.5}, + {0.5,0.75,0.25,0.5}, + {0.75,1,0.25,0.5}, + {0,0.25,0.5,0.75}, + {0.25,0.5,0.5,0.75}, + {0.5,0.75,0.5,0.75}, + {0.75,1,0.5,0.75}, + {0,0.25,0.75,1}, + {0.25,0.5,0.75,1}, + {0.5,0.75,0.75,1}, + {0.75,1,0.75,1} + }, + { + {220, 210, 50, -50, 220, 210, -1, 5}, + {230, 210, 50, 5, 280, 210, -5, 1}, + {280, 160, 1, 50, 280, 210, -1, 5}, + {220, 210, 50, -50, 220, 210, -1, 5}, + {210, 190, 50, 50, 220, 210, -1, 5}, + {220, 210, 50, -50, 220, 210, -1, 5}, + {230, 210, 50, 5, 280, 210, -5, 1}, + {280, 160, 1, 50, 280, 210, -1, 5}, + {220, 210, 50, -50, 220, 210, -1, 5}, + {210, 190, 50, 50, 220, 210, -1, 5}, + {220, 210, 50, -50, 220, 210, -1, 5}, + {230, 210, 50, 5, 280, 210, -5, 1}, + {280, 160, 1, 50, 280, 210, -1, 5}, + {220, 210, 50, -50, 220, 210, -1, 5}, + {210, 190, 50, 50, 220, 210, -1, 5}, + {210, 190, 50, 50, 220, 210, -1, 5} + } +}; +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +function SV.Comix:ReadyState(state) + if(state == nil) then return animReady end + animReady = state +end + +function SV.Comix:LaunchPremiumPopup() + local rng = random(1, 16); + local coords = COMIX_DATA[1][rng]; + local offsets = COMIX_DATA[2][rng] + + self.Premium.tex:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) + self.Premium.bg.tex:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) + self.Premium.anim[1]:SetOffset(offsets[1],offsets[2]) + self.Premium.anim[2]:SetOffset(offsets[3],offsets[4]) + self.Premium.anim[3]:SetOffset(0,0) + self.Premium.bg.anim[1]:SetOffset(offsets[5],offsets[6]) + self.Premium.bg.anim[2]:SetOffset(offsets[7],offsets[8]) + self.Premium.bg.anim[3]:SetOffset(0,0) + self.Premium.anim:Play() + 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(-100, 100); + 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(-100, 100); + if(step1_y > -30 and step1_y < 30) then step1_y = step1_y * 3 end + self.Basic.tex:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) + self.Basic:Point("CENTER", SV.Screen, "CENTER", step1_x, step1_y) + self.Basic.anim:Play() +end + +local Comix_OnEvent = function(self, event, ...) + local subEvent = select(2,...) + local guid = select(4,...) + local ready = self:ReadyState() + playerGUID = UnitGUID('player') + if subEvent == "PARTY_KILL" and guid == playerGUID and ready then + self:ReadyState(false) + local rng = random(1,15) + if rng < 8 then + self:LaunchDeluxePopup() + else + self:LaunchPopup() + end + end +end + +function SV:ToggleComix() + if not self.db.general.comix then + self.Comix:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED") + self.Comix:SetScript("OnEvent", nil) + else + self.Comix:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") + self.Comix:SetScript("OnEvent", Comix_OnEvent) + end +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.tex:SetTexCoord(0,0.25,0,0.25) + SV.Animate:Kapow(self.Basic, true) + self.Basic:SetAlpha(0) + self.Basic.anim[2]:SetScript("OnFinished", Comix_OnUpdate) + + 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.tex:SetTexCoord(0,0.25,0,0.25) + SV.Animate:RandomSlide(self.Premium, true) + self.Premium:SetAlpha(0) + self.Premium.anim[3]:SetScript("OnFinished", Comix_OnUpdate) + + self.Premium.bg.tex:SetTexCoord(0,0.25,0,0.25) + SV.Animate:RandomSlide(self.Premium.bg, false) + self.Premium.bg:SetAlpha(0) + self.Premium.bg.anim[3]:SetScript("OnFinished", Comix_OnUpdate) + + --MOD + local toasty = CreateFrame("Frame", "ComixToastyPanelBG", UIParent) + toasty:SetSize(256, 256) + toasty:SetFrameStrata("DIALOG") + toasty:Point("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", 0, 0) + toasty.tex = toasty:CreateTexture(nil, "ARTWORK") + toasty.tex:FillInner(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) + + if SV.db.general.comix then + self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") + self:SetScript("OnEvent", Comix_OnEvent) + end +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 new file mode 100644 index 0000000..c416f5e --- /dev/null +++ b/Interface/AddOns/SVUI/framework/widgets/widget_dropdown.lua @@ -0,0 +1,234 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 InCombatLockdown = _G.InCombatLockdown; +local CreateFrame = _G.CreateFrame; +--[[ +########################################################## +ADDON +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L + +SV.Dropdown = _G["SVUI_DropdownFrame"]; + +local DropdownButton_OnClick = function(self) + self.func(self.target) + self:GetParent():Hide() +end + +local DropdownButton_OnEnter = function(self) + self.hoverTex:Show() +end + +local DropdownButton_OnLeave = function(self) + self.hoverTex:Hide() +end + +local function GetScreenPosition(frame) + local parent = frame:GetParent() + 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 + +function SV.Dropdown:Open(target, list) + if(InCombatLockdown() or (not list)) then return end + + if(not self.option) then + self.option = {}; + self:SetFrameStrata("DIALOG"); + self:SetClampedToScreen(true); + tinsert(UISpecialFrames, self:GetName()); + self:Hide(); + end + + local maxPerColumn = 25; + local cols = 1; + + for i=1, #self.option do + self.option[i].button:Hide(); + self.option[i].divider:Hide(); + self.option[i].header:Hide(); + self.option[i]:Hide(); + end + + for i=1, #list do + if(not self.option[i]) then + -- HOLDER + self.option[i] = CreateFrame("Frame", nil, self); + self.option[i]:SetHeight(16); + self.option[i]:SetWidth(135); + + -- DIVIDER + self.option[i].divider = self.option[i]:CreateTexture(nil, 'BORDER'); + self.option[i].divider:SetAllPoints(); + self.option[i].divider:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DROPDOWN-DIVIDER]]); + self.option[i].divider:Hide(); + + 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:SetTextColor(1, 0.8, 0) + self.option[i].header:SetJustifyH("CENTER"); + self.option[i].header:SetJustifyV("MIDDLE"); + + -- BUTTON + self.option[i].button = CreateFrame("Button", nil, self.option[i]); + self.option[i].button:SetAllPoints(); + + self.option[i].button.hoverTex = self.option[i].button:CreateTexture(nil, 'OVERLAY'); + self.option[i].button.hoverTex:SetAllPoints(); + self.option[i].button.hoverTex:SetTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]]); + self.option[i].button.hoverTex:SetBlendMode("ADD"); + self.option[i].button.hoverTex:Hide(); + + 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:SetJustifyH("LEFT"); + + self.option[i].button:SetScript("OnEnter", DropdownButton_OnEnter); + self.option[i].button:SetScript("OnLeave", DropdownButton_OnLeave); + end + + self.option[i]:Show(); + + if(list[i].text) then + self.option[i].button:Show(); + self.option[i].button.target = target; + self.option[i].button.text:SetText(list[i].text); + self.option[i].button.func = list[i].func; + self.option[i].button:SetScript("OnClick", DropdownButton_OnClick); + elseif(list[i].title) then + self.option[i].header:Show(); + self.option[i].header:SetText(list[i].title); + if(list[i].divider) then + self.option[i].divider:Show(); + end + self.option[i].button:SetScript("OnClick", nil); + end + + if(i == 1) then + self.option[i]:SetPoint("TOPLEFT", self, "TOPLEFT", 10, -10) + elseif((i - 1) % maxPerColumn == 0) then + self.option[i]:SetPoint("TOPLEFT", self.option[i - maxPerColumn], "TOPRIGHT", 10, 0) + cols = cols + 1 + else + self.option[i]:SetPoint("TOPLEFT", self.option[i - 1], "BOTTOMLEFT") + end + end + + local maxHeight = (min(maxPerColumn, #list) * 16) + 20; + local maxWidth = (135 * cols) + (10 * cols) + 10; + local point = GetScreenPosition(target); + + self:ClearAllPoints(); + self:SetSize(maxWidth, maxHeight); + + if(point:find("BOTTOM")) then + self:SetPoint("BOTTOMLEFT", target, "TOPLEFT", 10, 10); + else + self:SetPoint("TOPLEFT", target, "BOTTOMLEFT", 10, -10); + end + + if(GameTooltip:IsShown()) then + GameTooltip:Hide(); + end + + ToggleFrame(self); +end + +function SV.Dropdown:Initialize() + self:SetParent(SV.Screen) + self:SetFrameStrata("DIALOG") + self:SetFrameLevel(99) + self:SetPanelTemplate("Default") + self.option = {} + self:SetClampedToScreen(true) + self:SetSize(155, 94) + + WorldFrame:HookScript("OnMouseUp", function() + if(SV.Dropdown:IsShown()) then + ToggleFrame(SV.Dropdown) + end + end) + + SV:AddToDisplayAudit(self) +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/widgets/widget_ego.lua b/Interface/AddOns/SVUI/framework/widgets/widget_ego.lua new file mode 100644 index 0000000..6a2eeb3 --- /dev/null +++ b/Interface/AddOns/SVUI/framework/widgets/widget_ego.lua @@ -0,0 +1,100 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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; +local GameMenuFrame = _G.GameMenuFrame +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...); + +SV.Ego = _G["SVUI_EgoFrame"]; + +local Sequences = { + --{65, 1000}, --shrug + {70, 1000}, --laugh + --{74, 1000}, --roar + --{82, 1000}, --flex + {5, 1000}, --run + {125, 1000}, --spell2 + {125, 1000}, --spell2 + {26, 1000}, --attack + {26, 1000}, --attack + {26, 1000}, --attack + {26, 1000}, --attack + {5, 1000}, --run + {69, 1000}, --dance +}; + +local function rng() + return random(1, #Sequences) +end + +local Activate = function(self) + if(not SV.db.general.ego) then + self:Toggle() + return + end + + local key = rng() + local emote = Sequences[key][1] + self:SetAlpha(1) + self.ModelLeft:SetAnimation(emote) + self.ModelRight:SetAnimation(emote) +end + +function SV.Ego:Initialize() + self:SetFrameLevel(0) + self:SetAllPoints(SV.Screen) + + self.ModelLeft:SetUnit("player") + self.ModelLeft:SetRotation(1) + self.ModelLeft:SetPortraitZoom(0.05) + self.ModelLeft:SetPosition(0,0,-0.25) + + self.ModelRight:SetUnit("player") + self.ModelRight:SetRotation(-1) + self.ModelRight:SetPortraitZoom(0.05) + self.ModelRight:SetPosition(0,0,-0.25) + + -- local splash = self:CreateTexture(nil, "OVERLAY") + -- splash:SetSize(600, 300) + -- splash:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\SPLASH-BLACK") + -- splash:SetBlendMode("ADD") + -- splash:SetPoint("TOP", 0, 0) + + self:SetScript("OnShow", Activate) +end + +function SV.Ego:Toggle() + if(SV.db.general.ego) then + self:Show() + self:SetScript("OnShow", Activate) + else + self:Hide() + self:SetScript("OnShow", nil) + end +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/framework/widgets/widgets.xml b/Interface/AddOns/SVUI/framework/widgets/widgets.xml new file mode 100644 index 0000000..b8cbf51 --- /dev/null +++ b/Interface/AddOns/SVUI/framework/widgets/widgets.xml @@ -0,0 +1,187 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Frame name="SVUI_PanelTemplate" virtual="true" toplevel="true"> + <Layers> + <Layer level="BACKGROUND"> + <Texture name="$parentBG" setAllPoints="true"/> + </Layer> + <Layer level="OVERLAY"> + <Texture name="$parentTitleBG"> + <Anchors> + <Anchor point="BOTTOMLEFT" relativeTo="$parentBG" relativePoint="TOPLEFT"/> + <Anchor point="TOPRIGHT" relativeTo="$parentBG" relativePoint="TOPRIGHT"> + <Offset x="0" y="30"/> + </Anchor> + </Anchors> + </Texture> + </Layer> + </Layers> + </Frame> + + <Frame name="SVUI_MovingPanelTemplate" virtual="true" movable="true" clampedToScreen="true" toplevel="true"> + <Layers> + <Layer level="BACKGROUND"> + <Texture name="$parentBG" setAllPoints="true"/> + </Layer> + <Layer level="OVERLAY"> + <Texture name="$parentTitleBG"> + <Anchors> + <Anchor point="TOPLEFT"/> + <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT"> + <Offset x="0" y="-30"/> + </Anchor> + </Anchors> + </Texture> + </Layer> + </Layers> + <Frames> + <Frame name="$parentTitleButton"> + <Anchors> + <Anchor point="TOPLEFT" relativeTo="$parentTitleBG"/> + <Anchor point="BOTTOMRIGHT" relativeTo="$parentTitleBG"/> + </Anchors> + </Frame> + </Frames> + </Frame> + + <Frame name="SVUI_MessagePanelTemplate" virtual="true" toplevel="true"> + <Layers> + <Layer level="BACKGROUND"> + <Texture name="$parentBG" setAllPoints="true"/> + </Layer> + <Layer level="OVERLAY"> + <Texture name="$parentTitleBG"> + <Anchors> + <Anchor point="TOPLEFT"> + <Offset x="8" y="-8"/> + </Anchor> + <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT"> + <Offset x="-32" y="-24"/> + </Anchor> + </Anchors> + </Texture> + <Texture name="$parentDialogBG"> + <Anchors> + <Anchor point="TOPLEFT"> + <Offset x="8" y="-32"/> + </Anchor> + <Anchor point="BOTTOMRIGHT"> + <Offset x="-32" y="32"/> + </Anchor> + </Anchors> + </Texture> + </Layer> + <Layer level="ARTWORK"> + <FontString parentKey="Title" inherits="GameFontNormal"> + <Anchors> + <Anchor point="TOPLEFT"> + <Offset x="8" y="-8"/> + </Anchor> + <Anchor point="TOPRIGHT"> + <Offset x="-32" y="-24"/> + </Anchor> + </Anchors> + </FontString> + </Layer> + </Layers> + <Frames> + <Button parentKey="Close" inherits="UIPanelCloseButton"> + <Anchors> + <Anchor point="TOPRIGHT"> + <Offset x="-2" y="-2"/> + </Anchor> + </Anchors> + </Button> + </Frames> + </Frame> + + <Frame name="SVUI_DropdownFrame" frameStrata="DIALOG" hidden="true" /> + <Frame name="SVUI_EgoFrame" parent="GameMenuFrame"> + <Layers> + <Layer level="BACKGROUND" textureSubLevel="-7"> + <Texture file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT"> + <Anchors> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0" /> + <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" x="0" y="-300" /> + </Anchors> + <Color r="0" g="0" b="0" a="0.8" /> + </Texture> + <Texture file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT"> + <Anchors> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" x="0" y="0" /> + <Anchor point="TOPRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="300" /> + </Anchors> + <Color r="0" g="0" b="0" a="0.8" /> + </Texture> + </Layer> + </Layers> + <Frames> + <PlayerModel name="$parentModelLeft" parentKey="ModelLeft" frameStrata="BACKGROUND"> + <Size y="1"/> + <Anchors> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="-250" y="-300" /> + <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOM" x="0" y="300" /> + </Anchors> + </PlayerModel> + <PlayerModel name="$parentModelRight" parentKey="ModelRight" frameStrata="BACKGROUND"> + <Size y="1"/> + <Anchors> + <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="250" y="-300" /> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOM" x="0" y="300" /> + </Anchors> + </PlayerModel> + </Frames> + </Frame> + + <Frame name="SVUI_ComixFrame1" frameStrata="DIALOG" hidden="true"> + <Size x="100" y="100"/> + <Anchors> + <Anchor point="CENTER" relativePoint="CENTER" x="0" y="-50" /> + </Anchors> + <Layers> + <Layer level="ARTWORK"> + <Texture parentKey="tex" file="Interface\AddOns\SVUI\assets\artwork\Doodads\COMICS-TYPE1" setAllPoints="true" /> + </Layer> + </Layers> + </Frame> + + <Frame name="SVUI_ComixFrame2" frameStrata="DIALOG" hidden="true"> + <Size x="100" y="100"/> + <Anchors> + <Anchor point="CENTER" relativePoint="CENTER" x="0" y="-50" /> + </Anchors> + <Layers> + <Layer level="ARTWORK"> + <Texture parentKey="tex" file="Interface\AddOns\SVUI\assets\artwork\Doodads\COMICS-TYPE2" setAllPoints="true" /> + </Layer> + </Layers> + </Frame> + + <Frame name="SVUI_ComixFrame3" frameStrata="DIALOG" hidden="true"> + <Size x="100" y="100"/> + <Anchors> + <Anchor point="CENTER" relativePoint="CENTER" x="0" y="-50" /> + </Anchors> + <Layers> + <Layer level="ARTWORK"> + <Texture parentKey="tex" file="Interface\AddOns\SVUI\assets\artwork\Doodads\COMICS-TYPE3" setAllPoints="true" /> + </Layer> + </Layers> + <Frames> + <Frame name="$parentBG" parentKey="bg" frameStrata="BACKGROUND"> + <Size x="128" y="128"/> + <Anchors> + <Anchor point="CENTER" relativePoint="CENTER" x="0" y="-50" /> + </Anchors> + <Layers> + <Layer level="ARTWORK"> + <Texture parentKey="tex" file="Interface\AddOns\SVUI\assets\artwork\Doodads\COMICS-TYPE3-BG" setAllPoints="true" /> + </Layer> + </Layers> + </Frame> + </Frames> + </Frame> + + <Script file="widget_dropdown.lua"/> + <Script file="widget_ego.lua"/> + <Script file="widget_comix.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 6293d3a..5458b00 100644 --- a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Animate.lua +++ b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Animate.lua @@ -28,6 +28,21 @@ local lib = LibSuperVillain:NewLibrary("Animate") if not lib then return end -- No upgrade needed +local MANAGED_ANIMATIONS = { + ["Orbit"] = true, + ["Sprite"] = true, + ["SmallSprite"] = true, + ["StopSprite"] = false, + ["Pulse"] = false, + ["Kapow"] = false, + ["Flash"] = false, + ["StopFlash"] = false, + ["Slide"] = false, + ["SlideIn"] = false, + ["SlideOut"] = false, + ["RandomSlide"] = false, +}; + --[[ LOCAL FUNCTIONS ]]-- local Anim_OnShow = function(self) @@ -56,14 +71,9 @@ local Anim_OnStop = function(self) if self.hideOnFinished and parent:IsShown() then parent:Hide() end - if self.savedFrameLevel or self.startscale then + if self.startscale then parent:SetScale(1) - if self.startscale then - self.startscale = 1 - end - if self.savedFrameLevel then - parent:SetFrameLevel(self.savedFrameLevel) - end + self.startscale = 1 end end @@ -108,23 +118,23 @@ local SmallSprite_OnUpdate = function(self) parent.overlay:SetTexCoord(left,right,0,1) parent.overlay:SetVertexColor(1,1,1,FlickerAlpha[order]) end -end +end + +local Pulse_OnPlay = function(self) + local parent = self.parent + parent:SetAlpha(1) + parent:SetScale(1) +end -local PulseIn_OnUpdate = function(self) +local Pulse_OnUpdate1 = function(self) local parent = self.parent local step = self:GetProgress() - if(parent.savedFrameLevel) then - parent:SetFrameLevel(128) - end parent:SetScale(1 + (1.05 * step)) end -local PulseOut_OnUpdate = function(self) +local Pulse_OnUpdate2 = function(self) local parent = self.parent local step = self:GetProgress() - if(parent.savedFrameLevel) then - parent:SetFrameLevel(128) - end parent:SetScale(1 + (1.05 * (1 - step))) end @@ -137,15 +147,7 @@ local Kapow_OnPlay = function(self) parent:SetScale(parent.startscale or 1) end -local Kapow_OnStop = function(self) - self.parent:SetAlpha(0) -end - -local Kapow_OnFinished = function(self) - self:Stop() -end - -local Kapow_OnUpdate = function(self) +local Kapow_OnUpdate1 = function(self) local parent = self.parent local step = self:GetProgress() local scale = 1 @@ -193,19 +195,19 @@ end --[[ LIB METHODS ]]-- local function AnimationTemplate(frame, animType, hideOnFinished, speed, special, scriptToParent) - if not animType then return end + if(not frame or not animType) then return end frame.anim = frame:CreateAnimationGroup(animType) frame.anim.parent = frame; frame.anim.hideOnFinished = hideOnFinished - if animType ~= 'Flash' and animType ~= 'Kapow' then + if(MANAGED_ANIMATIONS[animType]) then frame.anim:SetScript("OnPlay", Anim_OnPlay) frame.anim:SetScript("OnFinished", Anim_OnFinished) frame.anim:SetScript("OnStop", Anim_OnStop) end - if scriptToParent then + if(scriptToParent) then local frameParent = frame:GetParent(); if(frameParent.SetScript) then frameParent.anim = frame.anim; @@ -217,7 +219,7 @@ local function AnimationTemplate(frame, animType, hideOnFinished, speed, special frame:SetScript("OnHide", Anim_OnHide) end - if animType == 'Flash'then + if(animType == 'Flash') then frame.anim.fadeOnFinished = true if not speed then speed = 0.33 end @@ -234,7 +236,7 @@ local function AnimationTemplate(frame, animType, hideOnFinished, speed, special if special then frame.anim:SetLooping("REPEAT") end - elseif animType == 'Orbit' then + elseif(animType == 'Orbit') then frame.anim[1] = SetNewAnimation(frame.anim, "Rotation") if special then frame.anim[1]:SetDegrees(-360) @@ -244,7 +246,7 @@ 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 == 'Sprite') then frame.anim[1] = SetNewAnimation(frame.anim, "Translation") frame.anim[1]:SetOrder(1) frame.anim[1]:SetDuration(speed) @@ -274,7 +276,7 @@ local function AnimationTemplate(frame, animType, hideOnFinished, speed, special end frame.anim:SetLooping("REPEAT") - elseif animType == 'SmallSprite' then + elseif(animType == 'SmallSprite') then frame.anim[1] = SetNewAnimation(frame.anim, "Translation") frame.anim[1]:SetOrder(1) frame.anim[1]:SetDuration(speed) @@ -315,7 +317,7 @@ local function AnimationTemplate(frame, animType, hideOnFinished, speed, special frame.anim[8]:SetDuration(speed) frame.anim[8]:SetScript("OnUpdate", SmallSprite_OnUpdate) - if special then + if(special) then frame.anim[9] = SetNewAnimation(frame.anim, "Translation") frame.anim[9]:SetOrder(9) frame.anim[9]:SetDuration(special) @@ -324,20 +326,19 @@ local function AnimationTemplate(frame, animType, hideOnFinished, speed, special end frame.anim:SetLooping("REPEAT") - elseif animType == 'Pulse' then - frame.anim.savedFrameLevel = frame:GetFrameLevel() + elseif(animType == 'Pulse') then + frame.anim:SetScript("OnPlay", Pulse_OnPlay) frame.anim[1] = SetNewAnimation(frame.anim) frame.anim[1]:SetDuration(0.2) - frame.anim[1]:SetEndDelay(0.1) frame.anim[1]:SetOrder(1) - frame.anim[1]:SetScript("OnUpdate", PulseIn_OnUpdate) + frame.anim[1]:SetScript("OnUpdate", Pulse_OnUpdate1) frame.anim[2] = SetNewAnimation(frame.anim) frame.anim[2]:SetDuration(0.6) frame.anim[2]:SetOrder(2) - frame.anim[2]:SetScript("OnUpdate", PulseOut_OnUpdate) - elseif animType == 'Kapow' then + frame.anim[2]:SetScript("OnUpdate", Pulse_OnUpdate2) + elseif(animType == 'Kapow') then frame.anim:SetScript("OnPlay", Kapow_OnPlay) frame.anim.startscale = frame:GetScale() @@ -346,7 +347,7 @@ local function AnimationTemplate(frame, animType, hideOnFinished, speed, special frame.anim[1]:SetDuration(0.2) frame.anim[1]:SetOrder(1) frame.anim[1]:SetDegrees(360) - frame.anim[1]:SetScript("OnUpdate", Kapow_OnUpdate) + frame.anim[1]:SetScript("OnUpdate", Kapow_OnUpdate1) frame.anim[2] = SetNewAnimation(frame.anim) frame.anim[2]:SetDuration(0.3) 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 271b215..f51d68d 100644 --- a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Registry.lua +++ b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Registry.lua @@ -79,8 +79,8 @@ if not lib then return end -- No upgrade needed local CoreName, CoreObject = ... local AddonVersion = GetAddOnMetadata(..., "Version"); -local SchemaFromMeta = "X-" .. CoreName .. "-Schema"; -local HeaderFromMeta = "X-" .. CoreName .. "-Header"; +local SchemaFromMeta = "X-SVUISchema"; +local HeaderFromMeta = "X-SVUIName"; local InterfaceVersion = select(4, GetBuildInfo()); --[[ COMMON LOCAL VARS ]]-- @@ -92,8 +92,7 @@ local CACHE_FILENAME = CoreName.."_Cache"; local SOURCE_KEY = 1; local GLOBAL_SV, PROFILE_SV, CACHE_SV, ERROR_CACHE, PLUGINS, MODULES; local PluginString = "" -local AllowedIndexes, LoadOnDemand = {},{}; -local Callbacks, ScriptQueue = {},{}; +local AllowedIndexes, LoadOnDemand, ScriptQueue = {},{},{}; local playerClass = select(2,UnitClass("player")); @@ -103,6 +102,10 @@ 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) @@ -636,13 +639,15 @@ end --REGISTRY PUBLIC METHODS -function lib:RunCallbacks() - for i=1, #Callbacks do - local fn = Callbacks[i] +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", "Callback", catch) + HandleErrors("LibSuperVillain:Registry:Trigger(" .. eventName .. "):", id, catch) end end end @@ -739,13 +744,15 @@ function lib:LoadQueuedPlugins() obj.db = db end - if(files.CACHE and _G[files.CACHE]) then + if(files.CACHE) then + if not _G[files.CACHE] then _G[files.CACHE] = {} end local cache = setmetatable({}, meta_database) cache.data = _G[files.CACHE] obj.cache = cache end - if(files.GLOBAL and _G[files.GLOBAL]) then + if(files.GLOBAL) then + if not _G[files.GLOBAL] then _G[files.GLOBAL] = {} end local public = setmetatable({}, meta_database) public.data = _G[files.GLOBAL] obj.public = public @@ -767,6 +774,16 @@ 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) @@ -797,6 +814,7 @@ function lib:NewPlugin(addonName, addonObject, pfile, gfile, cfile) addonObject.public = addonObject.public or {} addonObject.configs = addonObject.configs or {} + addonObject.cache = addonObject.cache or {} addonObject.db = tablesplice(addonObject.configs, {}) if(IsAddOnLoaded(addonName) and not lod) then @@ -860,7 +878,7 @@ local function NewLoadOnDemand(addonName, schema, header) if(not IsAddOnLoaded(addonName)) then local loaded, reason = LoadAddOn(addonName) PROFILE_SV.SAFEDATA[schema].enable = true - lib:LoadQueuedPlugins() + CoreObject:StaticPopup_Show("RL_CLIENT") else PROFILE_SV.SAFEDATA[schema].enable = false CoreObject:StaticPopup_Show("RL_CLIENT") @@ -905,12 +923,6 @@ end -- CORE OBJECT CONSTRUCT -local Core_NewCallback = function(self, fn) - if(fn and type(fn) == "function") then - Callbacks[#Callbacks+1] = fn - end -end - local Core_NewScript = function(self, fn) if(fn and type(fn) == "function") then ScriptQueue[#ScriptQueue+1] = fn @@ -1041,7 +1053,7 @@ function lib:NewCore(gfile, efile, pfile, cfile) CoreObject.NameID = CoreName; CoreObject.Version = AddonVersion; CoreObject.GameVersion = tonumber(InterfaceVersion); - CoreObject.DebugMode = false; + CoreObject.DebugMode = true; CoreObject.Schema = GetAddOnMetadata(CoreName, SchemaFromMeta); CoreObject.TitleID = GetAddOnMetadata(CoreName, HeaderFromMeta); @@ -1050,7 +1062,6 @@ function lib:NewCore(gfile, efile, pfile, cfile) CoreObject.RegisterUpdate = registerUpdate CoreObject.UnregisterUpdate = unregisterUpdate - CoreObject.NewCallback = Core_NewCallback CoreObject.NewScript = Core_NewScript CoreObject.NewPackage = Core_NewPackage CoreObject.NewSubClass = Core_NewSubClass @@ -1206,12 +1217,14 @@ function lib:Initialize() for i = 1, addonCount do local addonName, _, _, _, _, reason = GetAddOnInfo(i) - local lod = IsAddOnLoadOnDemand(i) - local header = GetAddOnMetadata(i, HeaderFromMeta) - local schema = GetAddOnMetadata(i, SchemaFromMeta) - if(lod and schema) then - NewLoadOnDemand(addonName, schema, header) + if(IsAddOnLoadOnDemand(i)) then + local header = GetAddOnMetadata(i, HeaderFromMeta) + local schema = GetAddOnMetadata(i, SchemaFromMeta) + + if(header and schema) then + NewLoadOnDemand(addonName, schema, header) + end end end 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 75755a0..45043ce 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.1 +## Version: 5.2 ## 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 5b400be..d1beb3b 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.1 +## Version: 5.2 ## X-Category: oUF ## Dependencies: oUF 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 6d123ed..cc45b1b 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.1 +## Version: 5.2 ## 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 eeaa1ef..be938a1 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 @@ -266,10 +266,24 @@ local function Update(self, event, unit) local auras = {} local lastAuraIndex = 0 for index = 1, 40 do - local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellID = UnitAura(unit, index, helpOrHarm) + local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff = UnitAura(unit, index, helpOrHarm); + + if auraBars.forceShow then + spellID = 47540 + name, rank, icon = GetSpellInfo(spellID) + count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, canApplyAura, isBossDebuff = 5, 'Magic', 0, 60, 'player', nil, nil, nil, nil + end + if not name then break end + + local show = true + if not auraBars.forceShow then + show = (auraBars.filter or DefaultFilter)(self, unit, name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellID) + else + show = lastAuraIndex < 5; + end - if (auraBars.filter or DefaultFilter)(self, unit, name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellID) then + if (show) then lastAuraIndex = lastAuraIndex + 1 auras[lastAuraIndex] = {} auras[lastAuraIndex].spellID = spellID 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 4f7ce07..8a725cd 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.1 +## Version: 5.2 ## X-Category: oUF ## Dependencies: oUF diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/range.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/range.lua index a8ce0b6..3c07571 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/range.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/oUF/elements/range.lua @@ -26,7 +26,7 @@ local function UpdateSpellList() twipe(longEnemySpells) twipe(enemySpells) twipe(petSpells) - + if class == "PRIEST" then AddSpell(enemySpells, 585) -- Smite AddSpell(longEnemySpells, 589) -- Shadow Word: Pain @@ -36,8 +36,8 @@ local function UpdateSpellList() AddSpell(enemySpells, 33786) -- Cyclone AddSpell(longEnemySpells, 5176) -- Wrath AddSpell(friendlySpells, 774) -- Rejuvenation - AddSpell(resSpells, 50769) -- Revive - AddSpell(resSpells, 20484) -- Rebirth + AddSpell(resSpells, 50769) -- Revive + AddSpell(resSpells, 20484) -- Rebirth elseif class == "PALADIN" then AddSpell(enemySpells, 20271) -- Judgement AddSpell(friendlySpells, 85673) -- Word of Glory @@ -45,10 +45,10 @@ local function UpdateSpellList() AddSpell(longEnemySpells, 114165) -- Holy Prism AddSpell(longEnemySpells, 114157) -- Execution Sentence elseif class == "SHAMAN" then - AddSpell(enemySpells, 8042) -- Earth Shock + AddSpell(enemySpells, 8042) -- Earth Shock AddSpell(longEnemySpells, 403) -- Lightning Bolt AddSpell(friendlySpells, 8004) -- Healing Surge - AddSpell(resSpells, 2008) -- Ancestral Spirit + AddSpell(resSpells, 2008) -- Ancestral Spirit elseif class == "WARLOCK" then AddSpell(enemySpells, 5782) -- Fear AddSpell(longEnemySpells, 172) -- Corruption @@ -66,21 +66,20 @@ local function UpdateSpellList() elseif class == "DEATHKNIGHT" then AddSpell(enemySpells, 49576) -- Death Grip AddSpell(friendlySpells, 47541) -- Death Coil - AddSpell(resSpells, 61999) -- Raise Ally + AddSpell(resSpells, 61999) -- Raise Ally elseif class == "ROGUE" then - AddSpell(enemySpells, 2094) -- Blind + AddSpell(enemySpells, 2094) -- Blind AddSpell(longEnemySpells, 1725) -- Distract AddSpell(friendlySpells, 57934) -- Tricks of the Trade elseif class == "WARRIOR" then AddSpell(enemySpells, 5246) -- Intimidating Shout AddSpell(enemySpells, 100) -- Charge AddSpell(longEnemySpells, 355) -- Taunt - AddSpell(friendlySpells, 3411) -- Intervene elseif class == "MONK" then AddSpell(enemySpells, 115546) -- Provoke AddSpell(friendlySpells, 115450) -- Detox AddSpell(resSpells, 115178) -- Resuscitate - end + end end local function getUnit(unit) @@ -206,7 +205,7 @@ local OnRangeUpdate = function(self, elapsed) end end else - object:SetAlpha(range.insideAlpha) + object:SetAlpha(range.insideAlpha) end end end diff --git a/Interface/AddOns/SVUI/packages/_load.xml b/Interface/AddOns/SVUI/packages/_load.xml index a340cac..380b83b 100644 --- a/Interface/AddOns/SVUI/packages/_load.xml +++ b/Interface/AddOns/SVUI/packages/_load.xml @@ -12,4 +12,5 @@ <Script file="override\SVOverride.lua"/> <Script file="gear\SVGear.lua"/> <Script file="henchmen\SVHenchmen.lua"/> + <Include file="tools\SVTools.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 index e2399de..360b190 100644 --- a/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua +++ b/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua @@ -487,7 +487,7 @@ function MOD:LoadKeyBinder() moveHandle:SetScript("OnMouseUp", onMouseUp) local moveText = moveHandle:CreateFontString("OVERLAY") - moveText:SetFontTemplate() + moveText:FontManager() moveText:SetPoint("CENTER", moveHandle, "CENTER") moveText:SetText("Key Binds") diff --git a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua index 6fccb10..262c694 100644 --- a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua +++ b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua @@ -106,7 +106,7 @@ local function RefreshMicrobar() 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 + 6) + SVUI_MicroBar_MOVE:Size(barWidth, buttonSize) SVUI_MicroBar:SetAllPoints(SVUI_MicroBar_MOVE) for i=1,13 do local data = ICON_DATA[i] @@ -116,9 +116,9 @@ local function RefreshMicrobar() button:Size(buttonSize, buttonSize + 28) button._fade = SV.db.SVBar.Micro.mouseover if lastParent == SVUI_MicroBar then - button:SetPoint("BOTTOMLEFT",lastParent,"BOTTOMLEFT",1,1) + button:SetPoint("BOTTOMLEFT", lastParent, "BOTTOMLEFT", 0, 0) else - button:SetPoint('LEFT',lastParent,'RIGHT',spacing,0) + button:SetPoint("BOTTOMLEFT", lastParent, "BOTTOMRIGHT", spacing, 0) end lastParent = button; button:Show() @@ -168,7 +168,6 @@ end local MicroButton_OnEnter = function(self) if(self._fade) then SV:SecureFadeIn(SVUI_MicroBar,0.2,SVUI_MicroBar:GetAlpha(),1) - SV:SecureFadeOut(SVUI_MicroBar.screenMarker,0.1,SVUI_MicroBar:GetAlpha(),0) end if InCombatLockdown()then return end self.overlay:SetPanelColor("highlight") @@ -178,7 +177,6 @@ end local MicroButton_OnLeave = function(self) if(self._fade) then SV:SecureFadeOut(SVUI_MicroBar,1,SVUI_MicroBar:GetAlpha(),0) - SV:SecureFadeIn(SVUI_MicroBar.screenMarker,5,SVUI_MicroBar:GetAlpha(),1) end if InCombatLockdown()then return end self.overlay:SetPanelColor("special") @@ -188,15 +186,13 @@ end local MicroButton_OnUpdate = function() if(not SV.db.SVBar.Micro.mouseover) then SVUI_MicroBar:SetAlpha(1) - SVUI_MicroBar.screenMarker:SetAlpha(0) else SVUI_MicroBar:SetAlpha(0) - SVUI_MicroBar.screenMarker:SetAlpha(1) end GuildMicroButtonTabard:ClearAllPoints(); GuildMicroButtonTabard:Hide(); RefreshMicrobar() -end +end function MOD:FixKeybindText(button) local hotkey = _G[button:GetName()..'HotKey'] @@ -262,6 +258,9 @@ 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) @@ -366,7 +365,7 @@ local function ModifyActionButton(parent) count:ClearAllPoints() count:SetPoint("BOTTOMRIGHT",1,1) count:SetShadowOffset(1,-1) - count:SetFontTemplate(LSM:Fetch("font",SV.db.SVBar.countFont),SV.db.SVBar.countFontSize,SV.db.SVBar.countFontOutline) + 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) @@ -377,7 +376,7 @@ local function ModifyActionButton(parent) if SV.db.SVBar.hotkeytext then hotkey:ClearAllPoints() hotkey:SetAllPoints() - hotkey:SetFontTemplate(LSM:Fetch("font",SV.db.SVBar.font),SV.db.SVBar.fontSize,SV.db.SVBar.fontOutline) + 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) @@ -633,7 +632,11 @@ CORE FUNCTIONS do local Button_OnEnter = function(self) local parent = self:GetParent() - if parent and parent._fade then + 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 @@ -641,7 +644,11 @@ do local Button_OnLeave = function(self) local parent = self:GetParent() GameTooltip:Hide() - if parent and parent._fade then + 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 @@ -716,6 +723,10 @@ do 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) @@ -723,6 +734,10 @@ do 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 @@ -1051,7 +1066,6 @@ do for i = 1, maxButtons do local button = _G["SVUI_StanceBarButton"..i] local icon = _G["SVUI_StanceBarButton"..i.."Icon"] - local cd = _G["SVUI_StanceBarButton"..i.."Cooldown"] 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 @@ -1060,10 +1074,16 @@ do icon:SetTexture(texture) - if texture then - cd:SetAlpha(1) - else - cd:SetAlpha(0) + 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 @@ -1220,7 +1240,7 @@ do end button.isToken = isToken; button.tooltipSubtext = subtext; - if arg and actionName ~= "PET_ACTION_FOLLOW" then + 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 @@ -1251,10 +1271,21 @@ do SetDesaturation(icon, nil) else SetDesaturation(icon, 1) - end + end + if(button.cd) then + button.cd:SetAlpha(1) + button.cd:SetSwipeColor(0, 0, 0, 1) + button.cd:SetDrawBling(true) + end else - icon:Hide() - end + 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) @@ -1316,11 +1347,12 @@ 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',SV.Screen) - microBar:Size(barWidth,buttonSize + 6) + microBar:Size(barWidth, barHeight) microBar:SetFrameStrata("HIGH") microBar:SetFrameLevel(0) - microBar:Point('TOP',SV.Screen,'TOP',0,4) + microBar:Point('BOTTOMLEFT', SV.Dock.TopLeft.Bar.ToolBar, 'BOTTOMRIGHT', 4, 0) SV:AddToDisplayAudit(microBar) for i=1,13 do @@ -1380,24 +1412,14 @@ CreateMicroBar = function(self) SV.Mentalo:Add(microBar, L["Micro Bar"]) RefreshMicrobar() - - microBar.screenMarker = NewFrame('Frame',nil,SV.Screen) - microBar.screenMarker:Point('TOP',SV.Screen,'TOP',0,2) - microBar.screenMarker:Size(20,20) - microBar.screenMarker:SetFrameStrata("BACKGROUND") - microBar.screenMarker:SetFrameLevel(4) - microBar.screenMarker.icon = microBar.screenMarker:CreateTexture(nil,'OVERLAY') - microBar.screenMarker.icon:SetAllPoints(microBar.screenMarker) - microBar.screenMarker.icon:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\ARROW-DOWN") - microBar.screenMarker.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - SVUI_MicroBar:SetAlpha(0) end local CreateExtraBar = function(self) + local specialBarSize = ExtraActionBarFrame:GetSize() local specialBar = CreateFrame("Frame", "SVUI_SpecialAbility", SV.Screen) - specialBar:Point("TOP", SV.Screen, "CENTER", 0, -50) - specialBar:Size(ExtraActionBarFrame:GetSize()) + specialBar:Point("BOTTOM", SV.Screen, "BOTTOM", 0, (275 + specialBarSize)) + specialBar:Size(specialBarSize) ExtraActionBarFrame:SetParent(specialBar) ExtraActionBarFrame:ClearAllPoints() ExtraActionBarFrame:SetPoint("CENTER", specialBar, "CENTER") diff --git a/Interface/AddOns/SVUI/packages/aura/SVAura.lua b/Interface/AddOns/SVUI/packages/aura/SVAura.lua index d1d70c1..92fa897 100644 --- a/Interface/AddOns/SVUI/packages/aura/SVAura.lua +++ b/Interface/AddOns/SVUI/packages/aura/SVAura.lua @@ -296,10 +296,10 @@ do 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:SetFontTemplate(font, SV.db.SVAura.fontSize, SV.db.SVAura.fontOutline) + aura.count:FontManager(font, SV.db.SVAura.fontSize, SV.db.SVAura.fontOutline) aura.time = aura:CreateFontString(nil, "ARTWORK") aura.time:SetPoint("TOP", aura, "BOTTOM", 1 + SV.db.SVAura.timeOffsetH, 0 + SV.db.SVAura.timeOffsetV) - aura.time:SetFontTemplate(font, SV.db.SVAura.fontSize, SV.db.SVAura.fontOutline) + aura.time:FontManager(font, SV.db.SVAura.fontSize, SV.db.SVAura.fontOutline) aura.highlight = aura:CreateTexture(nil, "HIGHLIGHT") aura.highlight:SetTexture(0, 0, 0, 0.45) aura.highlight:FillInner() diff --git a/Interface/AddOns/SVUI/packages/bag/SVBag.lua b/Interface/AddOns/SVUI/packages/bag/SVBag.lua index 6679454..719144f 100644 --- a/Interface/AddOns/SVUI/packages/bag/SVBag.lua +++ b/Interface/AddOns/SVUI/packages/bag/SVBag.lua @@ -267,8 +267,8 @@ function MOD:INVENTORY_SEARCH_UPDATE() end if(self.ReagentFrame) then for i = 1, self.ReagentFrame.numSlots do - local _, _, _, _, _, _, _, isFiltered = GetContainerItemInfo(id, i) - local item = bag[i] + local _, _, _, _, _, _, _, isFiltered = GetContainerItemInfo(REAGENTBANK_CONTAINER, i) + local item = frame.Bags[REAGENTBANK_CONTAINER][i] if(item and item:IsShown()) then if isFiltered then SetItemButtonDesaturated(item, 1) @@ -291,6 +291,13 @@ local SlotUpdate = function(self, slotID) slot:Show() + if(slot.JunkIcon) then + slot.JunkIcon:Hide() + end + if(slot.questIcon) then + slot.questIcon:Hide(); + end + local texture, count, locked, rarity = GetContainerItemInfo(bag, slotID); local start, duration, enable = GetContainerItemCooldown(bag, slotID); local itemLink = GetContainerItemLink(bag, slotID); @@ -302,31 +309,50 @@ local SlotUpdate = function(self, slotID) else SetItemButtonTextureVertexColor(slot, 1, 1, 1) end + + slot:SetBackdropColor(0, 0, 0, 0.6) + slot:SetBackdropBorderColor(0, 0, 0, 1) if(itemLink) then local rarity = select(3, GetItemInfo(itemLink)) - if(rarity and rarity > 1) then - local r, g, b = GetItemQualityColor(rarity) - slot:SetBackdropColor(r, g, b, 0.6) - slot:SetBackdropBorderColor(r, g, b, 1) + local isQuestItem, questId, isActiveQuest = GetContainerItemQuestInfo(bag, slotID); + + if(questId and not isActive) then + slot:SetBackdropBorderColor(1.0, 0.3, 0.3); + if(slot.questIcon) then + slot.questIcon:Show(); + end + elseif(questId or isQuestItem) then + slot:SetBackdropBorderColor(1.0, 0.3, 0.3); + elseif(rarity) then + if(rarity > 1) then + local r, g, b = GetItemQualityColor(rarity) + slot:SetBackdropColor(r, g, b, 0.6) + slot:SetBackdropBorderColor(r, g, b, 1) + elseif(rarity == 0) then + if(slot.JunkIcon) then + slot.JunkIcon:Show() + end + slot:SetBackdropColor(0, 0, 0, 0.6) + slot:SetBackdropBorderColor(0, 0, 0, 1) + end else slot:SetBackdropColor(0, 0, 0, 0.6) slot:SetBackdropBorderColor(0, 0, 0, 1) end - elseif(bagType) then + end + + if(bagType) then local r, g, b = bagType[1], bagType[2], bagType[3]; slot:SetBackdropColor(r, g, b, 0.6) slot:SetBackdropBorderColor(r, g, b, 1) - else - slot:SetBackdropColor(0, 0, 0, 0.6) - slot:SetBackdropBorderColor(0, 0, 0, 1) end - if(C_NewItems.IsNewItem(bag, slotID)) then - ActionButton_ShowOverlayGlow(slot) - else - ActionButton_HideOverlayGlow(slot) - end + -- if(C_NewItems.IsNewItem(bag, slotID)) then + -- ActionButton_ShowOverlayGlow(slot) + -- else + -- ActionButton_HideOverlayGlow(slot) + -- end SetItemButtonTexture(slot, texture) SetItemButtonCount(slot, count) @@ -580,9 +606,9 @@ local ContainerFrame_UpdateLayout = function(self) if not bag[slotID] then local slotName = ("%sSlot%d"):format(bagName, slotID) - local newTexName = ("%sNewItemTexture"):format(slotName) local iconName = ("%sIconTexture"):format(slotName) local cdName = ("%sCooldown"):format(slotName) + local questIcon = ("%sIconQuestTexture"):format(slotName) slot = CreateFrame("CheckButton", slotName, bag, template); slot:SetNormalTexture(""); @@ -591,13 +617,29 @@ local ContainerFrame_UpdateLayout = function(self) slot:SetSlotTemplate(true, 2, 0, 0, 0.45); slot.Panel.Shadow:SetAttribute("shadowAlpha", 0.9) - if(_G[newTexName]) then - _G[newTexName]:Hide() - end + if(slot.NewItemTexture) then + slot.NewItemTexture:SetTexture(nil); + slot.NewItemTexture:Hide() + end + + if(slot.JunkIcon) then + slot.JunkIcon:SetTexture([[Interface\BUTTONS\UI-GroupLoot-Coin-Up]]); + slot.JunkIcon:Point("TOPLEFT", slot, "TOPLEFT", -4, 4); + end slot.iconTexture = _G[iconName]; slot.iconTexture:FillInner(slot); slot.iconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9); + + if(_G[questIcon]) then + slot.questIcon = _G[questIcon] + else + slot.questIcon = slot:CreateTexture(nil, "OVERLAY") + end + slot.questIcon:SetTexture(TEXTURE_ITEM_QUEST_BANG); + slot.questIcon:FillInner(slot); + slot.questIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9); + slot.cooldown = _G[cdName]; bag[slotID] = slot @@ -697,7 +739,6 @@ local ReagentFrame_UpdateLayout = function(self) if not bag[slotID] then local slotName = ("%sSlot%d"):format(bagName, slotID) - local newTexName = ("%sNewItemTexture"):format(slotName) local iconName = ("%sIconTexture"):format(slotName) local cdName = ("%sCooldown"):format(slotName) @@ -707,8 +748,13 @@ local ReagentFrame_UpdateLayout = function(self) slot:RemoveTextures() slot:SetSlotTemplate(true, 2, 0, 0, true); - if(_G[newTexName]) then - _G[newTexName]:Hide() + if(slot.NewItemTexture) then + slot.NewItemTexture:Hide() + end + + if(slot.JunkIcon) then + slot.JunkIcon:SetTexture([[Interface\BUTTONS\UI-GroupLoot-Coin-Up]]); + slot.JunkIcon:Point("TOPLEFT", slot, "TOPLEFT", -4, 4); end slot.iconTexture = _G[iconName]; @@ -827,11 +873,11 @@ function MOD:ModifyBags() if(docked) then if self.BagFrame then self.BagFrame:ClearAllPoints() - self.BagFrame:Point("BOTTOMRIGHT", SV.Dock.Right, "BOTTOMRIGHT", 0, 0) + self.BagFrame:Point("BOTTOMRIGHT", SV.Dock.BottomRight, "BOTTOMRIGHT", 0, 0) end if self.BankFrame then self.BankFrame:ClearAllPoints() - self.BankFrame:Point("BOTTOMLEFT", SV.Dock.Left, "BOTTOMLEFT", 0, 0) + self.BankFrame:Point("BOTTOMLEFT", SV.Dock.BottomLeft, "BOTTOMLEFT", 0, 0) end else if self.BagFrame then @@ -873,16 +919,16 @@ do if MOD.BagBarLoaded then return end local bar = CreateFrame("Frame", "SVUI_BagBar", SV.Screen) - bar:SetPoint("TOPRIGHT", SV.Dock.Right, "TOPLEFT", -4, 0) + bar:SetPoint("TOPRIGHT", SV.Dock.BottomRight, "TOPLEFT", -4, 0) bar.buttons = {} bar:EnableMouse(true) bar:SetScript("OnEnter", Bags_OnEnter) bar:SetScript("OnLeave", Bags_OnLeave) MainMenuBarBackpackButton:SetParent(bar) - MainMenuBarBackpackButton.SetParent = SV.Cloaked; + MainMenuBarBackpackButton.SetParent = SV.Hidden; MainMenuBarBackpackButton:ClearAllPoints() - MainMenuBarBackpackButtonCount:SetFontTemplate(nil, 10) + MainMenuBarBackpackButtonCount:FontManager(nil, 10) MainMenuBarBackpackButtonCount:ClearAllPoints() MainMenuBarBackpackButtonCount:Point("BOTTOMRIGHT", MainMenuBarBackpackButton, "BOTTOMRIGHT", -1, 4) MainMenuBarBackpackButton:HookScript("OnEnter", Bags_OnEnter) @@ -897,7 +943,7 @@ do for i = 0, frameCount do local bagSlot = _G["CharacterBag"..i.."Slot"] bagSlot:SetParent(bar) - bagSlot.SetParent = SV.Cloaked; + bagSlot.SetParent = SV.Hidden; bagSlot:HookScript("OnEnter", Bags_OnEnter) bagSlot:HookScript("OnLeave", Bags_OnLeave) AlterBagBar(bagSlot) @@ -987,7 +1033,7 @@ do local function UpdateEquipmentInfo(slot, bag, index) if not slot.equipmentinfo then slot.equipmentinfo = slot:CreateFontString(nil,"OVERLAY") - slot.equipmentinfo:SetFontTemplate(SV.Media.font.roboto, 10, "OUTLINE") + slot.equipmentinfo:FontManager(SV.Media.font.roboto, 10, "OUTLINE") slot.equipmentinfo:SetAllPoints(slot) slot.equipmentinfo:SetWordWrap(true) slot.equipmentinfo:SetJustifyH('LEFT') @@ -1275,7 +1321,7 @@ do frame.BagMenu:Hide() frame.goldText = frame:CreateFontString(nil, "OVERLAY") - frame.goldText:SetFontTemplate(SV.Media.font.numbers) + frame.goldText:FontManager(SV.Media.font.numbers) frame.goldText:Point("BOTTOMRIGHT", frame.holderFrame, "TOPRIGHT", -2, 4) frame.goldText:SetJustifyH("RIGHT") @@ -1295,7 +1341,7 @@ do frame.editBox:SetScript("OnChar", Search_OnInput) frame.editBox.SearchReset = Search_OnKeyPressed frame.editBox:SetText(SEARCH) - frame.editBox:SetFontTemplate(SV.Media.font.roboto) + frame.editBox:FontManager(SV.Media.font.roboto) local searchButton = CreateFrame("Button", nil, frame) searchButton:RegisterForClicks("LeftButtonUp", "RightButtonUp") @@ -1388,7 +1434,7 @@ do 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:SetFontTemplate(SV.Media.font.numbers, 18, "NONE") + frame.currencyButton[h].text:FontManager(SV.Media.font.numbers, 18, "NONE") frame.currencyButton[h]:SetScript("OnEnter", Token_OnEnter) frame.currencyButton[h]:SetScript("OnLeave", Token_OnLeave) frame.currencyButton[h]:SetScript("OnClick", Token_OnClick) diff --git a/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua b/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua index ab80479..f14b9da 100644 --- a/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua +++ b/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua @@ -290,10 +290,10 @@ function MOD:BreakStuffLoader() if not allowed then return end - BreakStuffButton:SetParent(SV.Dock.BarRight.ToolBar) - local size = SV.Dock.BarRight.ToolBar:GetHeight() + BreakStuffButton:SetParent(SV.Dock.BottomRight.Bar.ToolBar) + local size = SV.Dock.BottomRight.Bar.ToolBar:GetHeight() BreakStuffButton:Size(size, size) - BreakStuffButton:Point("RIGHT", SV.Dock.BarRight.ToolBar, "LEFT", -6, 0) + BreakStuffButton:Point("RIGHT", SV.Dock.BottomRight.Bar.ToolBar, "LEFT", -6, 0) BreakStuffButton:Show(); BreakStuffButton:SetFramedButtonTemplate() BreakStuffButton.icon=BreakStuffButton:CreateTexture(nil,"OVERLAY") diff --git a/Interface/AddOns/SVUI/packages/chat/SVChat.lua b/Interface/AddOns/SVUI/packages/chat/SVChat.lua index 34e4812..143b547 100644 --- a/Interface/AddOns/SVUI/packages/chat/SVChat.lua +++ b/Interface/AddOns/SVUI/packages/chat/SVChat.lua @@ -71,6 +71,7 @@ local SV = select(2, ...) local L = SV.L local LSM = LibStub("LibSharedMedia-3.0") local MOD = SV:NewPackage("SVChat", L["Chat"]); + --[[ ########################################################## LOCAL VARS @@ -436,23 +437,22 @@ do local EditBox_OnEditFocusGained = function(self) self:Show() - if not SV.Dock.Left:IsShown()then - SV.Dock.Left.editboxforced = true; - SV.Dock.BarLeft.Button:GetScript("OnEnter")(SV.Dock.BarLeft.Button) + if not MOD.Dock.Parent:IsShown()then + MOD.Dock.editboxforced = true; + MOD.Dock.Parent.Bar.Button:GetScript("OnEnter")(MOD.Dock.Parent.Bar.Button) end - - SV.Dock.Left.Alert:Activate(self) + MOD.Dock.Parent.Alert:Activate(self) end local EditBox_OnEditFocusLost = function(self) - if SV.Dock.Left.editboxforced then - SV.Dock.Left.editboxforced = nil; - if SV.Dock.Left:IsShown()then - SV.Dock.BarLeft.Button:GetScript("OnLeave")(SV.Dock.BarLeft.Button) + if MOD.Dock.editboxforced then + MOD.Dock.editboxforced = nil; + if MOD.Dock.Parent:IsShown()then + MOD.Dock.Parent.Bar.Button:GetScript("OnLeave")(MOD.Dock.Parent.Bar.Button) end end self:Hide() - SV.Dock.Left.Alert:Deactivate() + MOD.Dock.Parent.Alert:Deactivate() end local EditBox_OnTextChanged = function(self) @@ -500,19 +500,22 @@ do local lastTab = TabsList[1]; if(lastTab) then lastTab:ClearAllPoints() - lastTab:Point("LEFT", SV.Dock.BarLeft.ExtraBar, "LEFT", 3, 0); + lastTab:Point("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", SV.Dock.BarLeft.ExtraBar, "LEFT", 3, 0); + frame:Point("LEFT", MOD.Dock.Bar, "LEFT", 2, 0); else frame:Point("LEFT", lastTab, "RIGHT", 6, 0); end lastTab = frame end end + local newWidth = ((MOD.Dock.Bar:GetHeight() * 1.75) + 6) * offset; + MOD.Dock.Bar:SetWidth(newWidth); end local function _removeTab(frame,chat) @@ -525,10 +528,8 @@ do TabsList[chatID] = nil; end frame:SetParent(chat) - if(chatID ~= 1) then - frame:ClearAllPoints() - frame:Point("TOPLEFT", chat, "BOTTOMLEFT", 0, 0) - end + frame:ClearAllPoints() + frame:Point("TOPLEFT", chat, "BOTTOMLEFT", 0, 0) _repositionDockedTabs() end @@ -538,17 +539,17 @@ do TabSafety[name] = true; TabsList[chatID] = frame frame.chatID = chatID; - frame:SetParent(SV.Dock.BarLeft.ExtraBar) + frame:SetParent(MOD.Dock.Bar) _repositionDockedTabs() end local function _customTab(tab, chatID, enabled) if(tab.IsStyled) then return end local tabName = tab:GetName(); - local tabSize = SV.Dock.BarLeft.ExtraBar:GetHeight(); + local tabSize = MOD.Dock.Bar:GetHeight(); local tabText = tab.text:GetText() or "Chat "..chatID; - local holder = CreateFrame("Frame", ("SVUI_ChatTab%s"):format(chatID), SV.Dock.BarLeft.ExtraBar) + local holder = CreateFrame("Frame", ("SVUI_ChatTab%s"):format(chatID), MOD.Dock.Bar) holder:SetWidth(tabSize * 1.75) holder:SetHeight(tabSize) tab.chatID = chatID; @@ -557,7 +558,7 @@ do tab:SetAllPoints(holder) tab:SetFramedButtonTemplate() tab.icon = tab:CreateTexture(nil,"BACKGROUND",nil,3) - tab.icon:Size(tabSize * 1.25,tabSize) + tab.icon:Size(tabSize * 1.25, tabSize) tab.icon:Point("CENTER",tab,"CENTER",0,0) tab.icon:SetTexture(ICONARTFILE) if(tab.conversationIcon) then @@ -615,7 +616,6 @@ do chat:SetClampedToScreen(false) chat:RemoveTextures(true) chat:SetBackdropColor(0,0,0,0) - chat.SetBackdropColor = SV.fubar _G[chatName.."ButtonFrame"]:Die() ------------------------------------------- _G[tabName .."Left"]:SetTexture(0,0,0,0) @@ -656,9 +656,9 @@ do _G[editBoxName.."FocusLeft"]:Die() _G[editBoxName.."FocusMid"]:Die() _G[editBoxName.."FocusRight"]:Die() - editBox:SetFixedPanelTemplate("Button", true) + editBox:SetPanelTemplate("Inset", true, 2, -2, -3) editBox:SetAltArrowKeyMode(false) - editBox:SetAllPoints(SV.Dock.Left.Alert) + editBox:SetAllPoints(MOD.Dock.Parent.Alert) editBox:HookScript("OnEditFocusGained", EditBox_OnEditFocusGained) editBox:HookScript("OnEditFocusLost", EditBox_OnEditFocusLost) editBox:HookScript("OnTextChanged", EditBox_OnTextChanged) @@ -667,7 +667,7 @@ do chat:SetFading(CHAT_FADING) chat:SetScript("OnHyperlinkClick", SVUI_OnHyperlinkShow) - local alertSize = (SV.Dock.BarLeft.ExtraBar:GetHeight()) * 2; + local alertSize = (MOD.Dock.Bar:GetHeight()) * 2; local alert = CreateFrame("Frame", nil, tab) alert:SetSize(alertSize, alertSize) alert:SetFrameStrata("DIALOG") @@ -706,15 +706,17 @@ do if (not SV.db.SVChat.enable) then return; end if ((not forced) and (refreshLocked and (IsMouseButtonDown("LeftButton") or InCombatLockdown()))) then return; end - for i,name in pairs(CHAT_FRAMES)do + CHAT_WIDTH, CHAT_HEIGHT = MOD.Dock:GetSize(); + + for i,name in pairs(CHAT_FRAMES) do local chat = _G[name] local id = chat:GetID() local tab = _G[name.."Tab"] local tabText = _G[name.."TabText"] _modifyChat(chat, tabText) tab.owner = chat; - chat:SetParent(SV.Dock.Left.Window) - if not chat.isDocked and chat:IsShown() then + if not chat.isDocked and chat:IsShown() then + chat:SetSize(CHAT_WIDTH, CHAT_HEIGHT) chat.Panel:Show() if(not TAB_SKINS) then tab.isDocked = chat.isDocked; @@ -729,16 +731,19 @@ do end end else - chat.Panel:Hide() if id == 1 then FCF_SavePositionAndDimensions(chat) - end - chat:ClearAllPoints() - chat:SetAllPoints(SV.Dock.Left.Window) + end + + chat:ClearAllPoints(); + chat:SetAllPoints(MOD.Dock); + chat:SetBackdropColor(0,0,0,0); + chat.Panel:Hide(); + if(not TAB_SKINS) then tab.owner = chat; tab.isDocked = chat.isDocked; - tab:SetParent(SV.Dock.BarLeft.ExtraBar) + tab:SetParent(MOD.Dock.Bar) _modifyTab(tab, false) else tab.owner = chat; @@ -824,7 +829,7 @@ do end local _hook_GDMFrameSetPoint = function(self) - self:SetAllPoints(SV.Dock.BarLeft.ExtraBar) + self:SetAllPoints(MOD.Dock.Bar) end local _hook_GDMScrollSetPoint = function(self, point, anchor, attachTo, x, y) @@ -937,6 +942,18 @@ do end end +local function DockFadeInChat() + local activeChatFrame = FCFDock_GetSelectedWindow(GENERAL_CHAT_DOCK) + SV:SecureFadeIn(activeChatFrame, 0.2, activeChatFrame:GetAlpha(), 1) +end +LibSuperVillain("Registry"):NewCallback("DOCKS_FADE_IN", "DockFadeInChat", DockFadeInChat); + +local function DockFadeOutChat() + local activeChatFrame = FCFDock_GetSelectedWindow(GENERAL_CHAT_DOCK) + SV:SecureFadeOut(activeChatFrame, 0.2, activeChatFrame:GetAlpha(), 0, true) +end +LibSuperVillain("Registry"):NewCallback("DOCKS_FADE_OUT", "DockFadeOutChat", DockFadeOutChat); + function MOD:UpdateLocals() CHAT_WIDTH = (SV.db.Dock.dockLeftWidth or 350) - 10; CHAT_HEIGHT = (SV.db.Dock.dockLeftHeight or 180) - 15; @@ -967,9 +984,11 @@ function MOD:ReLoad() end function MOD:Load() - ScrollIndicator:SetParent(SV.Dock.Left.Window) + self.Dock = SV.Dock:NewAdvancedDocklet("BottomLeft", "SVUI_ChatFrameDock") + + ScrollIndicator:SetParent(self.Dock) ScrollIndicator:SetSize(20,20) - ScrollIndicator:SetPoint("BOTTOMRIGHT", SV.Dock.Left.Window, "BOTTOMRIGHT", 6, 0) + ScrollIndicator:SetPoint("BOTTOMRIGHT", self.Dock, "BOTTOMRIGHT", 6, 0) ScrollIndicator:SetFrameStrata("HIGH") ScrollIndicator.icon = ScrollIndicator:CreateTexture(nil, "OVERLAY") ScrollIndicator.icon:SetAllPoints() @@ -987,9 +1006,9 @@ function MOD:Load() self:RefreshChatFrames(true) _G.GeneralDockManagerOverflowButton:ClearAllPoints() - _G.GeneralDockManagerOverflowButton:SetPoint('BOTTOMRIGHT', SV.Dock.BarLeft.ExtraBar, 'BOTTOMRIGHT', -2, 2) + _G.GeneralDockManagerOverflowButton:SetPoint('BOTTOMRIGHT', self.Dock.Bar, 'BOTTOMRIGHT', -2, 2) _G.GeneralDockManagerOverflowButtonList:SetFixedPanelTemplate('Transparent') - _G.GeneralDockManager:SetAllPoints(SV.Dock.BarLeft.ExtraBar) + _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 e1c3edc..a12f77c 100644 --- a/Interface/AddOns/SVUI/packages/gear/SVGear.lua +++ b/Interface/AddOns/SVUI/packages/gear/SVGear.lua @@ -148,7 +148,7 @@ local function SetDisplayStats(arg) if(flags[1]) then frame.ItemLevel = frame:CreateFontString(nil, "OVERLAY") frame.ItemLevel:Point("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 2, 1) - frame.ItemLevel:SetFontTemplate(SV.Media.font.roboto, 10, "OUTLINE", "RIGHT") + frame.ItemLevel:FontManager(SV.Media.font.roboto, 10, "OUTLINE", "RIGHT") end if(arg == "Character" and flags[2]) then diff --git a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua index 2f17e84..3f39e63 100644 --- a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua +++ b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua @@ -184,31 +184,7 @@ local SubOption_OnMouseUp = function(self) self.isopen=false end end -end - -local Speech_OnTimeout = function() - HenchmenSpeechBubble:Hide() - speechTimer = nil -end - -local Speech_OnEnter = function(self) - SV:SecureFadeOut(self, 0.5, 1, 0) - local newTimer = SV.Timers:ExecuteTimer(Speech_OnTimeout, 0.5, speechTimer) - speechTimer = newTimer - self:SetScript("OnEnter", nil) -end - -local Speech_OnShow = function(self) - if self.message then - self.txt:SetText(self.message) - local newTimer = SV.Timers:ExecuteTimer(Speech_OnTimeout, 5, speechTimer) - speechTimer = newTimer - self.message = nil - self:SetScript("OnEnter", Speech_OnEnter) - else - self:Hide() - end -end +end --[[ ########################################################## LOCAL FUNCTIONS @@ -300,7 +276,7 @@ function StopOpeningMail(msg, ...) total_cash = nil; needsToWait = false; if msg then - SV:HenchmanSays(msg) + SV:AddonMessage(msg) end end @@ -442,7 +418,7 @@ local function CreateHenchmenSubOptions(buttonIndex,optionIndex) frame.txt:SetTextColor(1,1,1) frame.txthigh = frame:CreateFontString(nil,"HIGHLIGHT") frame.txthigh:FillInner(frame) - frame.txthigh:SetFontTemplate(false,12,"OUTLINE","CENTER","MIDDLE") + frame.txthigh:FontManager(false,12,"OUTLINE","CENTER","MIDDLE") frame.txthigh:SetTextColor(1,1,0) SV.Animate:Slide(frame,500,0) @@ -646,7 +622,7 @@ function SV:ToggleHenchman() minion:Show() minion.anim:Play() end - SV.Dock.BarRight.Button.Icon:SetGradient(unpack(SV.Media.gradient.green)) + MOD.DockButton.Icon:SetGradient(unpack(SV.Media.gradient.green)) else UpdateHenchmanModel(true) for _,frame in pairs(SUBOPTIONS)do @@ -670,13 +646,8 @@ function SV:ToggleHenchman() minion.anim:Finish() minion:Hide() end - SV.Dock.BarRight.Button.Icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + MOD.DockButton.Icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) end -end - -function SV:HenchmanSays(msg) - HenchmenSpeechBubble.message = msg; - HenchmenSpeechBubble:Show(); end --[[ ########################################################## @@ -816,12 +787,12 @@ function MOD:MERCHANT_SHOW() RepairAllItems(autoRepair=='GUILD') local x,y,z= repairCost % 100,floor((repairCost % 10000)/100), floor(repairCost / 10000) if autoRepair=='GUILD' then - SV:HenchmanSays("Repairs Complete! ...Using Guild Money!\n"..GetCoinTextureString(repairCost,12)) + SV:AddonMessage("Repairs Complete! ...Using Guild Money!\n"..GetCoinTextureString(repairCost,12)) else - SV:HenchmanSays("Repairs Complete!\n"..GetCoinTextureString(repairCost,12)) + SV:AddonMessage("Repairs Complete!\n"..GetCoinTextureString(repairCost,12)) end else - SV:HenchmanSays("The Minions Say You Are Too Broke To Repair! They Are Laughing..") + SV:AddonMessage("The Minions Say You Are Too Broke To Repair! They Are Laughing..") end end end @@ -912,36 +883,40 @@ function MOD:QUEST_COMPLETE() if(not SV.db.SVHenchmen.autoquestcomplete and (not SV.db.SVHenchmen.autoquestreward)) then return end if(IsShiftKeyDown()) then return false; end local rewards = GetNumQuestChoices() - if rewards > 1 then + local rewardsFrame = QuestInfoFrame.rewardsFrame; + if(rewards > 1) then local auto_select = QuestFrameRewardPanel.itemChoice or QuestInfoFrame.itemChoice; local selection, value = 1, 0; - if SV.db.SVHenchmen.autoquestreward == true then - for i = 1, rewards do - local iLink = GetQuestItemLink("choice", i) - if iLink then - local iValue = select(11,GetItemInfo(iLink)) - if iValue and iValue > value then - value = iValue; - selection = i - end + + for i = 1, rewards do + local iLink = GetQuestItemLink("choice", i) + if iLink then + local iValue = select(11,GetItemInfo(iLink)) + if iValue and iValue > value then + value = iValue; + selection = i end end - local chosenItem = _G[("QuestInfoItem%d"):format(selection)] - if chosenItem.type == "choice" then - QuestInfoItemHighlight:ClearAllPoints() - QuestInfoItemHighlight:SetAllPoints(chosenItem) - QuestInfoItemHighlight:Show() - QuestInfoFrame.itemChoice = chosenItem:GetID() - SV:HenchmanSays("A Minion Has Chosen Your Reward!") - end end + + local chosenItem = QuestInfo_GetRewardButton(rewardsFrame, selection) + + if chosenItem.type == "choice" then + QuestInfoItemHighlight:ClearAllPoints() + QuestInfoItemHighlight:SetAllPoints(chosenItem) + QuestInfoItemHighlight:Show() + QuestInfoFrame.itemChoice = chosenItem:GetID() + SV:AddonMessage("A Minion Has Chosen Your Reward!") + end + auto_select = selection - if SV.db.SVHenchmen.autoquestcomplete == true then + + if SV.db.SVHenchmen.autoquestreward == true then GetQuestReward(auto_select) end else if(SV.db.SVHenchmen.autoquestcomplete == true) then - GetQuestReward(GetNumQuestChoices()) + GetQuestReward(rewards) end end end @@ -951,24 +926,7 @@ BUILD FUNCTION / UPDATE ########################################################## ]]-- function MOD:Load() - local bubble = CreateFrame("Frame", "HenchmenSpeechBubble", SV.Screen) - bubble:SetSize(256,128) - bubble:Point("BOTTOMRIGHT", SV.Dock.BarRight.Button, "TOPLEFT", 0, 0) - bubble:SetFrameStrata("DIALOG") - bubble:SetFrameLevel(24) - bubble.bg = bubble:CreateTexture(nil,"BORDER") - bubble.bg:SetAllPoints(bubble) - bubble.bg:SetTexture(BUBBLE) - bubble.bg:SetVertexColor(1,1,1) - bubble.txt = bubble:CreateFontString(nil,"DIALOG") - bubble.txt:Point("TOPLEFT", bubble, "TOPLEFT", 5, -5) - bubble.txt:Point("BOTTOMRIGHT", bubble, "BOTTOMRIGHT", -5, 20) - bubble.txt:SetFont(SV.Media.font.dialog,12,"NONE") - bubble.txt:SetText("") - bubble.txt:SetTextColor(0,0,0) - bubble.txt:SetWordWrap(true) - bubble:Hide() - bubble:SetScript('OnShow', Speech_OnShow) + self.DockButton = SV.Dock:SetDockButton("BottomRight", "Call Henchman!", [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-HENCHMAN]], SV.ToggleHenchman, "SVUI_Henchmen") if IsAddOnLoaded("Postal") then SV.db.SVHenchmen.mailOpener = false @@ -1001,21 +959,13 @@ function MOD:Load() end) end - local skippy = CreateFrame("Frame") - skippy:RegisterEvent("CINEMATIC_START") - skippy:SetScript("OnEvent", function(_, event) - if event == "CINEMATIC_START" then - if(SV.db.SVHenchmen.skipcinematics) then - CinematicFrame_CancelCinematic() - end - end - end) - local PlayMovie_hook = MovieFrame_PlayMovie - MovieFrame_PlayMovie = function(...) - if(SV.db.SVHenchmen.skipcinematics) then - GameMovieFinished() - else - PlayMovie_hook(...) - end + if(SV.db.SVHenchmen.skipcinematics) then + local skippy = CreateFrame("Frame") + skippy:RegisterEvent("CINEMATIC_START") + skippy:SetScript("OnEvent", function(self, event) + CinematicFrame_CancelCinematic() + end) + + MovieFrame:SetScript("OnEvent", function() GameMovieFinished() end) end end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/map/SVMap.lua b/Interface/AddOns/SVUI/packages/map/SVMap.lua index dd00e58..ad048e7 100644 --- a/Interface/AddOns/SVUI/packages/map/SVMap.lua +++ b/Interface/AddOns/SVUI/packages/map/SVMap.lua @@ -76,8 +76,9 @@ local MM_OFFSET_TOP = (MM_SIZE * 0.07) local MM_OFFSET_BOTTOM = (MM_SIZE * 0.11) 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) -SVUI_MinimapFrame:Size(MM_WIDTH, MM_HEIGHT) +SVUI_MinimapFrame:SetSize(MM_WIDTH, MM_HEIGHT) --[[ /$$$$$$$ /$$ /$$ /$$$$$$$$/$$$$$$$$/$$$$$$ /$$ /$$ /$$$$$$ | $$__ $$| $$ | $$|__ $$__/__ $$__/$$__ $$| $$$ | $$ /$$__ $$ @@ -275,15 +276,6 @@ do end end -local function CheckMovement() - if(not WorldMapFrame:IsShown()) then return end - if GetUnitSpeed("player") ~= 0 then - WorldMapFrame:SetAlpha(SV.db.SVMap.mapAlpha) - else - WorldMapFrame:SetAlpha(1) - end -end - local function UpdateMapCoords() local xF, yF = "|cffffffffx: |r%.1f", "|cffffffffy: |r%.1f" local skip = IsInInstance() @@ -329,8 +321,13 @@ local function UpdateMapCoords() SVUI_WorldMapCoords.playerCoords:SetText("") end end - if(SV.db.SVMap.mapAlpha < 100) then - CheckMovement() + if(WM_ALPHA and WorldMapFrame:IsShown() and (not WorldMapFrame_InWindowedMode())) then + local speed = GetUnitSpeed("player") + if(speed ~= 0) then + WorldMapFrame:SetAlpha(0.2) + else + WorldMapFrame:SetAlpha(1) + end end end @@ -384,13 +381,7 @@ local function AdjustMapSize() BlackoutWorld:SetTexture(0,0,0,0) else BlackoutWorld:SetTexture(0, 0, 0, 1) - end - - WorldMapFrame:SetFrameLevel(1) - WorldMapDetailFrame:SetFrameLevel(2) - WorldMapFrame:SetFrameStrata('HIGH') - WorldMapArchaeologyDigSites:SetFrameLevel(3) - WorldMapArchaeologyDigSites:SetFrameStrata('DIALOG') + end end local function UpdateWorldMapConfig() @@ -524,12 +515,6 @@ local _hook_WorldMapFrame_OnShow = function() WorldMap_ToggleSizeUp() Initialized = true end - - WorldMapFrame:SetFrameLevel(1) - WorldMapDetailFrame:SetFrameLevel(2) - WorldMapFrame:SetFrameStrata('HIGH') - WorldMapArchaeologyDigSites:SetFrameLevel(3) - WorldMapArchaeologyDigSites:SetFrameStrata('DIALOG') end local _hook_WorldMapFrame_OnHide = function() @@ -560,22 +545,41 @@ function MOD:RefreshMiniMap() NARR_PREFIX = ""; if(self.Holder and self.Holder:IsShown()) then - --local minimapRotationEnabled = GetCVar("rotateMinimap") ~= "0" - self.Holder:Size(MM_WIDTH, MM_HEIGHT) - self.Holder.backdrop:SetGradient(unpack(MM_COLOR)) - Minimap:Size(MM_SIZE,MM_SIZE) - if SV.db.SVMap.customshape then - Minimap:SetPoint("BOTTOMLEFT", self.Holder, "BOTTOMLEFT", MM_BRDR, -(MM_OFFSET_BOTTOM - MM_BRDR)) - Minimap:SetPoint("TOPRIGHT", self.Holder, "TOPRIGHT", -MM_BRDR, (MM_OFFSET_TOP - MM_BRDR)) - Minimap:SetMaskTexture('Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP_MASK_RECTANGLE') - else + 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) + 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:SetMaskTexture('Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP_MASK_SQUARE') + 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) + self.Holder.Circle:Hide() + self.Holder.Square:Show() + self.Holder.Square.Panel.Skin:SetGradient(unpack(MM_COLOR)) + + if SV.db.SVMap.customshape then + Minimap:SetPoint("BOTTOMLEFT", self.Holder, "BOTTOMLEFT", MM_BRDR, -(MM_OFFSET_BOTTOM - MM_BRDR)) + Minimap:SetPoint("TOPRIGHT", self.Holder, "TOPRIGHT", -MM_BRDR, (MM_OFFSET_TOP - MM_BRDR)) + 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:SetMaskTexture('Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP_MASK_SQUARE') + end end Minimap:SetParent(self.Holder) Minimap:SetZoom(1) Minimap:SetZoom(0) + else + SV.Dock.TopRight:Size(MM_WIDTH, (MM_HEIGHT + 4)) end self.Zone:SetSize(MM_WIDTH,28) @@ -621,6 +625,10 @@ function MOD:RefreshMiniMap() UpdateWorldMapConfig() end + +local function RotationHook() + MOD:RefreshMiniMap() +end --[[ ########################################################## EVENTS @@ -683,6 +691,7 @@ function MOD:UpdateLocals() MM_OFFSET_BOTTOM = (MM_SIZE * 0.11) MM_WIDTH = MM_SIZE + (MM_BRDR * 2) MM_HEIGHT = db.customshape and (MM_SIZE - (MM_OFFSET_TOP + MM_OFFSET_BOTTOM) + (MM_BRDR * 2)) or MM_WIDTH + WM_ALPHA = GetCVarBool("mapFade") end function MOD:ReLoad() @@ -706,40 +715,21 @@ function MOD:Load() Minimap:SetClampedToScreen(false) local mapHolder = SVUI_MinimapFrame + mapHolder:SetParent(SV.Screen); mapHolder:SetFrameStrata("BACKGROUND") - mapHolder.backdrop = mapHolder:CreateTexture(nil, "BACKGROUND", nil, -2) mapHolder:Point("TOPRIGHT", SV.Screen, "TOPRIGHT", -10, -10) mapHolder:Size(MM_WIDTH, MM_HEIGHT) - mapHolder.backdrop:ClearAllPoints() - mapHolder.backdrop:WrapOuter(mapHolder, 2) - mapHolder.backdrop:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - mapHolder.backdrop:SetGradient(unpack(MM_COLOR)) - mapHolder:SetPanelTemplate("Blackout") - - local border = CreateFrame("Frame", nil, mapHolder) - border:WrapOuter(mapHolder.backdrop) - border.left = border:CreateTexture(nil, "BACKGROUND", nil, -1) - border.left:SetTexture(0, 0, 0) - border.left:SetPoint("TOPLEFT") - border.left:SetPoint("BOTTOMLEFT") - border.left:SetWidth(1) - border.right = border:CreateTexture(nil, "BACKGROUND", nil, -1) - border.right:SetTexture(0, 0, 0) - border.right:SetPoint("TOPRIGHT") - border.right:SetPoint("BOTTOMRIGHT") - border.right:SetWidth(1) - border.top = border:CreateTexture(nil, "BACKGROUND", nil, -1) - border.top:SetTexture(0, 0, 0) - border.top:SetPoint("TOPLEFT") - border.top:SetPoint("TOPRIGHT") - border.top:SetHeight(1) - border.bottom = border:CreateTexture(nil, "BACKGROUND", nil, -1) - border.bottom:SetTexture(0, 0, 0) - border.bottom:SetPoint("BOTTOMLEFT") - border.bottom:SetPoint("BOTTOMRIGHT") - border.bottom:SetHeight(1) - - mapHolder.border = border + + mapHolder.Square = CreateFrame("Frame", nil, mapHolder) + mapHolder.Square:WrapOuter(mapHolder, 2) + mapHolder.Square:SetPanelTemplate("Blackout") + mapHolder.Square.Panel.Skin:SetGradient(unpack(MM_COLOR)) + + mapHolder.Circle = mapHolder:CreateTexture(nil, "BACKGROUND", nil, -2) + mapHolder.Circle:WrapOuter(mapHolder, 2) + mapHolder.Circle:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP-ROUND") + mapHolder.Circle:SetGradient(unpack(MM_COLOR)) + mapHolder.Circle:Hide() if TimeManagerClockButton then TimeManagerClockButton:Die() @@ -766,29 +756,40 @@ function MOD:Load() MiniMapMailBorder:Hide() MiniMapMailIcon:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP-MAIL") MiniMapWorldMapButton:Hide() + MiniMapInstanceDifficulty:ClearAllPoints() MiniMapInstanceDifficulty:SetParent(Minimap) - MiniMapInstanceDifficulty:Point("BOTTOMLEFT", mapHolder, "BOTTOMLEFT", 0, 0) + MiniMapInstanceDifficulty:Point("LEFT", mapHolder, "LEFT", 0, 0) + GuildInstanceDifficulty:ClearAllPoints() GuildInstanceDifficulty:SetParent(Minimap) - GuildInstanceDifficulty:Point("BOTTOMLEFT", mapHolder, "BOTTOMLEFT", 0, 0) + GuildInstanceDifficulty:Point("LEFT", mapHolder, "LEFT", 0, 0) + MiniMapChallengeMode:ClearAllPoints() MiniMapChallengeMode:SetParent(Minimap) - MiniMapChallengeMode:Point("BOTTOMLEFT", mapHolder, "BOTTOMLEFT", 8, -8) + MiniMapChallengeMode:Point("LEFT", mapHolder, "LEFT", 12, 0) + QueueStatusMinimapButton:ClearAllPoints() QueueStatusMinimapButton:Point("BOTTOMLEFT", mapHolder, "BOTTOMLEFT", 6, 5) QueueStatusMinimapButton:SetPanelTemplate("Button", false, 1, -2, -2) + + GarrisonLandingPageMinimapButton:ClearAllPoints() + GarrisonLandingPageMinimapButton:Point("BOTTOMLEFT", mapHolder, "BOTTOMLEFT", 6, 5) + GarrisonLandingPageMinimapButton:SetPanelTemplate("Button", false, 1, -2, -2) + QueueStatusFrame:SetClampedToScreen(true) QueueStatusMinimapButtonBorder:Hide() QueueStatusMinimapButton:SetScript("OnShow", function() MiniMapInstanceDifficulty:Point("BOTTOMLEFT", QueueStatusMinimapButton, "TOPLEFT", 0, 0) - GuildInstanceDifficulty:Point("BOTTOMLEFT", QueueStatusMinimapButton, "BOTTOMLEFT", 0, 0) - MiniMapChallengeMode:Point("BOTTOMLEFT", QueueStatusMinimapButton, "BOTTOMLEFT", 0, 0) + GuildInstanceDifficulty:Point("BOTTOMLEFT", QueueStatusMinimapButton, "TOPLEFT", 0, 0) + MiniMapChallengeMode:Point("BOTTOMLEFT", QueueStatusMinimapButton, "TOPRIGHT", 0, 0) + GarrisonLandingPageMinimapButton:Point("BOTTOMLEFT", QueueStatusMinimapButton, "BOTTOMRIGHT", 0, 0) end) QueueStatusMinimapButton:SetScript("OnHide", function() - MiniMapInstanceDifficulty:Point("BOTTOMLEFT", mapHolder, "BOTTOMLEFT", 0, 0) - GuildInstanceDifficulty:Point("BOTTOMLEFT", mapHolder, "BOTTOMLEFT", 0, 0) - MiniMapChallengeMode:Point("BOTTOMLEFT", mapHolder, "BOTTOMLEFT", 8, -8) + GarrisonLandingPageMinimapButton:Point("BOTTOMLEFT", mapHolder, "BOTTOMLEFT", 0, 0) + MiniMapInstanceDifficulty:Point("LEFT", mapHolder, "LEFT", 0, 0) + GuildInstanceDifficulty:Point("LEFT", mapHolder, "LEFT", 0, 0) + MiniMapChallengeMode:Point("LEFT", mapHolder, "LEFT", 12, 0) end) if FeedbackUIButton then FeedbackUIButton:Die() @@ -806,7 +807,7 @@ function MOD:Load() narr:SetParent(Minimap) narr.Text = narr:CreateFontString(nil, "ARTWORK", nil, 7) - narr.Text:SetFontTemplate(mwfont, 12, "OUTLINE", "CENTER", "MIDDLE") + narr.Text:FontManager(mwfont, 12, "OUTLINE", "CENTER", "MIDDLE") narr.Text:SetAllPoints(narr) narr.Text:SetTextColor(1, 1, 1) narr.Text:SetShadowColor(0, 0, 0, 0.3) @@ -821,7 +822,7 @@ function MOD:Load() zt:SetParent(Minimap) zt.Text = zt:CreateFontString(nil, "ARTWORK", nil, 7) - zt.Text:SetFontTemplate(mwfont, 12, "OUTLINE", "RIGHT", "MIDDLE") + zt.Text:FontManager(mwfont, 12, "OUTLINE", "RIGHT", "MIDDLE") zt.Text:Point("RIGHT", zt) zt.Text:SetSize(MM_WIDTH, 32) zt.Text:SetTextColor(1, 1, 0) @@ -844,26 +845,23 @@ function MOD:Load() if(SV.db.SVMap.tinyWorldMap) then setfenv(WorldMapFrame_OnShow, setmetatable({ UpdateMicroButtons = SV.fubar }, { __index = _G })) WorldMapFrame:SetParent(SV.Screen) - WorldMapFrame:SetFrameLevel(1) - WorldMapFrame:SetFrameStrata('HIGH') - WorldMapDetailFrame:SetFrameLevel(2) WorldMapFrame:HookScript('OnShow', _hook_WorldMapFrame_OnShow) WorldMapFrame:HookScript('OnHide', _hook_WorldMapFrame_OnHide) end - local CoordsHolder = CreateFrame('Frame', 'SVUI_WorldMapCoords', WorldMapFrame) - CoordsHolder:SetFrameLevel(WorldMapDetailFrame:GetFrameLevel() + 1) - CoordsHolder:SetFrameStrata(WorldMapDetailFrame:GetFrameStrata()) - CoordsHolder.playerCoords=CoordsHolder:CreateFontString(nil,'OVERLAY') - CoordsHolder.mouseCoords=CoordsHolder:CreateFontString(nil,'OVERLAY') - CoordsHolder.playerCoords:SetTextColor(1,1,0) - CoordsHolder.mouseCoords:SetTextColor(1,1,0) - CoordsHolder.playerCoords:SetFontObject(NumberFontNormal) - CoordsHolder.mouseCoords:SetFontObject(NumberFontNormal) - CoordsHolder.playerCoords:SetPoint("BOTTOMLEFT",WorldMapFrame,"BOTTOMLEFT",5,5) - CoordsHolder.playerCoords:SetText(PLAYER..": 0, 0") - CoordsHolder.mouseCoords:SetPoint("BOTTOMLEFT",CoordsHolder.playerCoords,"TOPLEFT",0,5) - CoordsHolder.mouseCoords:SetText(MOUSE_LABEL..": 0, 0") + local WMCoords = CreateFrame('Frame', 'SVUI_WorldMapCoords', WorldMapFrame) + WMCoords:SetFrameLevel(WorldMapDetailFrame:GetFrameLevel() + 1) + WMCoords:SetFrameStrata(WorldMapDetailFrame:GetFrameStrata()) + WMCoords.playerCoords = WMCoords:CreateFontString(nil,'OVERLAY') + WMCoords.mouseCoords = WMCoords:CreateFontString(nil,'OVERLAY') + WMCoords.playerCoords:SetTextColor(1,1,0) + WMCoords.mouseCoords:SetTextColor(1,1,0) + WMCoords.playerCoords:SetFontObject(NumberFontNormal) + WMCoords.mouseCoords:SetFontObject(NumberFontNormal) + WMCoords.playerCoords:SetPoint("BOTTOMLEFT", WorldMapFrame, "BOTTOMLEFT", 5, 5) + WMCoords.playerCoords:SetText(PLAYER..": 0, 0") + WMCoords.mouseCoords:SetPoint("BOTTOMLEFT", WMCoords.playerCoords, "TOPLEFT", 0, 5) + WMCoords.mouseCoords:SetText(MOUSE_LABEL..": 0, 0") DropDownList1:HookScript('OnShow', _hook_DropDownList1) WorldFrame:SetAllPoints() @@ -885,14 +883,14 @@ function MOD:Load() CoordsHolder.playerXCoords:SetPoint("BOTTOMLEFT", CoordsHolder, "BOTTOMLEFT", 0, 0) CoordsHolder.playerXCoords:SetWidth(70) CoordsHolder.playerXCoords:SetHeight(22) - CoordsHolder.playerXCoords:SetFontTemplate(SV.Media.font.numbers, 12, "OUTLINE") + CoordsHolder.playerXCoords:FontManager(SV.Media.font.numbers, 12, "OUTLINE") 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:SetFontTemplate(SV.Media.font.numbers, 12, "OUTLINE") + CoordsHolder.playerYCoords:FontManager(SV.Media.font.numbers, 12, "OUTLINE") CoordsHolder.playerYCoords:SetTextColor(cColor.r, cColor.g, cColor.b) local calendarButton = CreateFrame("Button", "SVUI_CalendarButton", CoordsHolder) @@ -923,7 +921,7 @@ function MOD:Load() if(SV.db.SVMap.minimapbar.enable == true) then MMBHolder = CreateFrame("Frame", "SVUI_MiniMapButtonHolder", mapHolder) - MMBHolder:Point("TOPRIGHT", SVUI_MiniMapCoords, "BOTTOMRIGHT", 0, -4) + MMBHolder:Point("TOPRIGHT", SV.Dock.TopRight, "BOTTOMRIGHT", 0, -4) MMBHolder:Size(mapHolder:GetWidth(), 32) MMBHolder:SetFrameStrata("BACKGROUND") MMBBar = CreateFrame("Frame", "SVUI_MiniMapButtonBar", MMBHolder) @@ -945,4 +943,6 @@ function MOD:Load() self:RegisterEvent('PLAYER_REGEN_DISABLED') self:RegisterEvent("ZONE_CHANGED") self:RegisterEvent("ZONE_CHANGED_NEW_AREA") + + NewHook("Minimap_UpdateRotationSetting", RotationHook) end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/override/SVOverride.lua b/Interface/AddOns/SVUI/packages/override/SVOverride.lua index ad51d7a..07194c9 100644 --- a/Interface/AddOns/SVUI/packages/override/SVOverride.lua +++ b/Interface/AddOns/SVUI/packages/override/SVOverride.lua @@ -153,7 +153,7 @@ local Vehicle_OnSetPoint = function(self,_,parent) if _G.VehicleSeatIndicator_MOVE then VehicleSeatIndicator:Point("BOTTOM", VehicleSeatIndicator_MOVE, "BOTTOM", 0, 0) else - VehicleSeatIndicator:Point("TOPLEFT", SV.Screen, "TOPLEFT", 22, -45) + VehicleSeatIndicator:Point("TOPLEFT", SV.Dock.TopLeft, "TOPLEFT", 0, 0) SV.Mentalo:Add(VehicleSeatIndicator, L["Vehicle Seat Frame"]) end VehicleSeatIndicator:SetScale(0.8) @@ -396,7 +396,7 @@ local function MirrorBarRegistry(barType) bar:SetScript("OnUpdate", MirrorBar_OnUpdate) local r, g, b = unpack(mirrorTypeColor[barType]) bar.text = bar:CreateFontString(nil, 'OVERLAY') - bar.text:SetFontTemplate(SV.Media.font.roboto, 12, 'OUTLINE') + bar.text:FontManager(SV.Media.font.roboto, 12, 'OUTLINE') bar.text:SetJustifyH('CENTER') bar.text:SetTextColor(1, 1, 1) bar.text:SetPoint('LEFT', bar) @@ -420,7 +420,7 @@ local function SetTimerStyle(bar) if child:GetObjectType() == "Texture"then child:SetTexture(0,0,0,0) elseif child:GetObjectType() == "FontString" then - child:SetFontTemplate(SV.Media.font.roboto, 12, 'OUTLINE') + child:FontManager(SV.Media.font.roboto, 12, 'OUTLINE') end end bar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) @@ -478,17 +478,17 @@ end local SVUI_LootFrameHolder = CreateFrame("Frame","SVUI_LootFrameHolder",SV.Screen); local SVUI_LootFrame = CreateFrame('Button', 'SVUI_LootFrame', SVUI_LootFrameHolder); -SVUI_LootFrameHolder:Point("TOPLEFT",36,-195); -SVUI_LootFrameHolder:Width(150); -SVUI_LootFrameHolder:Height(22); +SVUI_LootFrameHolder:SetPoint("BOTTOMRIGHT", SVUI_DockTopLeft, "BOTTOMRIGHT", 0, 0); +SVUI_LootFrameHolder:SetWidth(150); +SVUI_LootFrameHolder:SetHeight(22); SVUI_LootFrame:SetClampedToScreen(true); SVUI_LootFrame:SetPoint('TOPLEFT'); -SVUI_LootFrame:Size(256,64); -SVUI_LootFrame:SetFrameStrata("FULLSCREEN"); +SVUI_LootFrame:SetSize(256,64); +SVUI_LootFrame:SetFrameStrata("FULLSCREEN_DIALOG"); SVUI_LootFrame:SetToplevel(true); SVUI_LootFrame.title = SVUI_LootFrame:CreateFontString(nil,'OVERLAY'); -SVUI_LootFrame.title:Point('BOTTOMLEFT',SVUI_LootFrame,'TOPLEFT',0,1); +SVUI_LootFrame.title:SetPoint('BOTTOMLEFT',SVUI_LootFrame,'TOPLEFT',0,1); SVUI_LootFrame.slots = {}; SVUI_LootFrame:SetScript("OnHide", Loot_OnHide); @@ -828,13 +828,14 @@ local OpenedLootHandler = function(_, event, autoLoot) cursorX = cursorX / SVUI_LootFrame:GetEffectiveScale() cursorY = (cursorY / (SVUI_LootFrame:GetEffectiveScale())); SVUI_LootFrame:ClearAllPoints() - SVUI_LootFrame:Point("TOPLEFT", nil, "BOTTOMLEFT", cursorX - 40, cursorY + 20) + SVUI_LootFrame:SetPoint("TOPLEFT", nil, "BOTTOMLEFT", cursorX - 40, cursorY + 20) SVUI_LootFrame:GetCenter() - SVUI_LootFrame:Raise() else SVUI_LootFrame:ClearAllPoints() SVUI_LootFrame:SetPoint("TOPLEFT", SVUI_LootFrameHolder, "TOPLEFT") - end + end + + SVUI_LootFrame:Raise() local iQuality, nameWidth, titleWidth = 0, 0, SVUI_LootFrame.title:GetStringWidth() UpdateLootUpvalues() @@ -1031,7 +1032,7 @@ function MOD:Load() NewHook(DurabilityFrame, "SetPoint", Dura_OnSetPoint) TicketStatusFrame:ClearAllPoints() - TicketStatusFrame:SetPoint("TOPLEFT", SV.Screen, "TOPLEFT", 250, -5) + TicketStatusFrame:SetPoint("TOPRIGHT", SV.Dock.TopLeft, "TOPRIGHT", 0, 0) SV.Mentalo:Add(TicketStatusFrame, L["GM Ticket Frame"], nil, nil, nil, nil, "GM") HelpOpenTicketButton:SetParent(Minimap) HelpOpenTicketButton:ClearAllPoints() @@ -1046,9 +1047,24 @@ function MOD:Load() self:RegisterEvent('PLAYER_REGEN_DISABLED', ErrorFrameHandler) self:RegisterEvent('PLAYER_REGEN_ENABLED', ErrorFrameHandler) + local wsc = CreateFrame("Frame", "SVUI_WorldStateHolder", SV.Screen) + wsc:SetSize(200, 45) + wsc:SetPoint("TOP", SV.Dock.TopCenter, "BOTTOM", 0, -10) + SV.Mentalo:Add(wsc, L["Capture Bars"]) + NewHook("UIParent_ManageFramePositions", CaptureBarHandler) + + local altPower = CreateFrame("Frame", "SVUI_AltPowerBar", UIParent) + altPower:SetPoint("TOP", SV.Dock.TopCenter, "BOTTOM", 0, -60) + altPower:Size(128, 50) + PlayerPowerBarAlt:ClearAllPoints() + PlayerPowerBarAlt:SetPoint("CENTER", altPower, "CENTER") + PlayerPowerBarAlt:SetParent(altPower) + PlayerPowerBarAlt.ignoreFramePositionManager = true; + SV.Mentalo:Add(altPower, L["Alternative Power"]) + SVUI_AlertFrame:SetParent(SV.Screen) - SVUI_AlertFrame:SetPoint("TOP", SV.Screen, "TOP", 0, -18); - SV.Mentalo:Add(SVUI_AlertFrame, L["Loot / Alert Frames"], nil, nil, AlertFramePostMove_Hook) + SVUI_AlertFrame:SetPoint("TOP", SV.Dock.TopCenter, "BOTTOM", 0, -115); + SV.Mentalo:Add(SVUI_AlertFrame, L["Loot / Alert Frames"], nil, nil, AlertFramePostMove_Hook) NewHook('AlertFrame_FixAnchors', AlertFramePostMove_Hook) NewHook('AlertFrame_SetLootAnchors', _hook_AlertFrame_SetLootAnchors) NewHook('AlertFrame_SetLootWonAnchors', _hook_AlertFrame_SetLootWonAnchors) @@ -1096,9 +1112,11 @@ function MOD:Load() self:RegisterEvent("MIRROR_TIMER_PAUSE", MirrorBarToggleHandler) self:RegisterEvent("START_TIMER", MirrorBarToggleHandler) + local exitSize = ExtraActionBarFrame:GetSize() + local exit = CreateFrame("Button", "SVUI_BailOut", SV.Screen) - exit:Size(40, 40) - exit:Point("TOPLEFT", SVUI_MinimapFrame, "BOTTOMLEFT", 0, -30) + exit:Size(exitSize) + exit:Point("BOTTOM", SV.Screen, "BOTTOM", 0, 275) exit:SetNormalTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Icons\\EXIT") exit:SetPushedTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Icons\\EXIT") exit:SetHighlightTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Icons\\EXIT") @@ -1115,20 +1133,7 @@ function MOD:Load() SV.Mentalo:Add(exit, L["Bail Out"]) - local altPower = CreateFrame("Frame", "SVUI_AltPowerBar", UIParent) - altPower:SetPoint("TOP", SV.Screen, "TOP", 0, -18) - altPower:Size(128, 50) - PlayerPowerBarAlt:ClearAllPoints() - PlayerPowerBarAlt:SetPoint("CENTER", altPower, "CENTER") - PlayerPowerBarAlt:SetParent(altPower) - PlayerPowerBarAlt.ignoreFramePositionManager = true; - SV.Mentalo:Add(altPower, L["Alternative Power"]) - - local wsc = CreateFrame("Frame", "SVUI_WorldStateHolder", SV.Screen) - wsc:SetSize(200, 45) - wsc:SetPoint("TOP", SV.Screen, "TOP", 0, -100) - SV.Mentalo:Add(wsc, L["Capture Bars"]) - NewHook("UIParent_ManageFramePositions", CaptureBarHandler) - + LossOfControlFrame:ClearAllPoints() + LossOfControlFrame:SetPoint("TOP", SV.Screen, "TOP", 0, -225) SV.Mentalo:Add(LossOfControlFrame, L["Loss Control Icon"], nil, nil, nil, nil, "LoC") end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/plates/SVPlate.lua b/Interface/AddOns/SVUI/packages/plates/SVPlate.lua index 483ed41..a518601 100644 --- a/Interface/AddOns/SVUI/packages/plates/SVPlate.lua +++ b/Interface/AddOns/SVUI/packages/plates/SVPlate.lua @@ -66,7 +66,6 @@ LOCAL VARS ########################################################## ]]-- local numChildren = -1; -local latestColor = {1,0.5,0.5}; local PlateRegistry, VisiblePlates = {}, {}; local WorldFrameUpdateHook, UpdatePlateElements, PlateForge; local BLIZZ_PLATE, SVUI_PLATE, PLATE_REF, PLATE_ARGS, PLATE_AURAS, PLATE_AURAICONS, PLATE_GRIP, PLATE_REALNAME; @@ -809,72 +808,72 @@ do local unitType = GetPlateReaction(plate) local scale = 1 - if(plate.setting.unitcategory ~= unitType) then - plate.setting.unitcategory = unitType + plate.setting.unitcategory = unitType - 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 + 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 - 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 - else - latestColor = NPReactEnemy end - - frame.health:SetStatusBarColor(unpack(latestColor)) - --frame.health.eliteborder.bottom:SetVertexColor(unpack(latestColor)) - --frame.health.eliteborder.right:SetVertexColor(unpack(latestColor)) - --frame.health.eliteborder.left:SetVertexColor(unpack(latestColor)) + plate.ref.reaction = threatReaction + elseif unitType == "FRIENDLY_NPC" then + latestColor = NPReactNPCGood + elseif unitType == "FRIENDLY_PLAYER" then + latestColor = NPReactPlayerGood + else + latestColor = NPReactEnemy end + + frame.health:SetStatusBarColor(unpack(latestColor)) + --frame.health.eliteborder.bottom:SetVertexColor(unpack(latestColor)) + --frame.health.eliteborder.right:SetVertexColor(unpack(latestColor)) + --frame.health.eliteborder.left:SetVertexColor(unpack(latestColor)) if(NPUsePointer and NPPointerMatch and plate.setting.unit == "target") then NPGlow:SetBackdropBorderColor(unpack(latestColor)) @@ -1110,29 +1109,29 @@ do local function UpdateThisPlate(plate) if(not ProxyThisPlate(plate, true)) then return; end - SVUI_PLATE.name:SetFontTemplate(NPFont, NPFSize, NPFOutline) + SVUI_PLATE.name:FontManager(NPFont, NPFSize, NPFOutline) SVUI_PLATE.name:SetTextColor(1, 1, 1) - SVUI_PLATE.level:SetFontTemplate(NPFont, NPFSize, NPFOutline) + 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.textured) - SVUI_PLATE.health.text:SetFontTemplate(SV.Media.font.roboto, 8, "OUTLINE") + SVUI_PLATE.health.text:FontManager(SV.Media.font.roboto, 8, "OUTLINE") SVUI_PLATE.cast:SetSize(HBWidth, (CBHeight + 20)) SVUI_PLATE.cast:SetStatusBarTexture(SV.Media.bar.lazer) 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:ReversePoint(PLATE_REF.raidicon, RIAnchor, SVUI_PLATE.health, RIXoffset, RIYoffset) + SV:SetReversePoint(PLATE_REF.raidicon, RIAnchor, SVUI_PLATE.health, RIXoffset, RIYoffset) PLATE_REF.raidicon:SetSize(RISize, RISize) SVUI_PLATE.health.icon:ClearAllPoints() - SV:ReversePoint(SVUI_PLATE.health.icon, RIAnchor, SVUI_PLATE.health, RIXoffset, RIYoffset) + 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:SetFontTemplate(AuraFont, AuraFSize, AuraFOutline) - PLATE_AURAICONS[index].Stacks:SetFontTemplate(AuraFont, AuraFSize, AuraFOutline) + 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 diff --git a/Interface/AddOns/SVUI/packages/stats/SVStats.lua b/Interface/AddOns/SVUI/packages/stats/SVStats.lua index c96ad22..2339abb 100644 --- a/Interface/AddOns/SVUI/packages/stats/SVStats.lua +++ b/Interface/AddOns/SVUI/packages/stats/SVStats.lua @@ -63,8 +63,8 @@ MOD.DisabledList = {}; MOD.StatListing = {[""] = "None"}; MOD.tooltip = CreateFrame("GameTooltip", "StatisticTooltip", UIParent, "GameTooltipTemplate") MOD.BGPanels = { - ["SVUI_StatsBar1"] = {left = "Honor", middle = "Kills", right = "Assists"}, - ["SVUI_StatsBar2"] = {left = "Damage", middle = "Healing", right = "Deaths"} + ["SVUI_DockTopCenterLeft"] = {left = "Honor", middle = "Kills", right = "Assists"}, + ["SVUI_DockTopCenterRight"] = {left = "Damage", middle = "Healing", right = "Deaths"} }; MOD.BGStats = { ["Name"] = {1, NAME}, @@ -100,7 +100,6 @@ local BGStatString = "%s: %s" local myName = UnitName("player"); local myClass = select(2,UnitClass("player")); local classColor = RAID_CLASS_COLORS[myClass]; -local StatMenuFrame = CreateFrame("Frame", "SVUI_StatMenu", UIParent); local SCORE_CACHE = {}; local hexHighlight = "FFFFFF"; local StatMenuListing = {} @@ -146,7 +145,7 @@ local UpdateAnchor = function() width = anchor:GetWidth() / numPoints - 4; height = anchor:GetHeight() - 4; if(backdrops) then - height = SV.Dock.BarRight.Button:GetHeight() - 6 + height = height + 6 end end @@ -277,11 +276,11 @@ function MOD:NewAnchor(parent, maxCount, tipAnchor, isTop, customTemplate, isVer 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:SetFontTemplate(LSM:Fetch("font", SV.db.SVStats.font), SV.db.SVStats.fontSize, "NONE", "CENTER", "MIDDLE") + 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:SetFontTemplate(LSM:Fetch("font", SV.db.SVStats.font), SV.db.SVStats.fontSize, SV.db.SVStats.fontOutline) + 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 @@ -343,119 +342,11 @@ do MOD.tooltip:Hide() end - local DD_OnClick = function(self) - self.func() - self:GetParent():Hide() - end - - local DD_OnEnter = function(self) - self.hoverTex:Show() - end - - local DD_OnLeave = function(self) - self.hoverTex:Hide() - end - - local function _locate(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 - - function MOD:SetStatMenu(self, list) - if not StatMenuFrame.buttons then - StatMenuFrame.buttons = {} - StatMenuFrame:SetFrameStrata("DIALOG") - StatMenuFrame:SetClampedToScreen(true) - tinsert(UISpecialFrames, StatMenuFrame:GetName()) - StatMenuFrame:Hide() - end - local maxPerColumn = 25 - local cols = 1 - for i=1, #StatMenuFrame.buttons do - StatMenuFrame.buttons[i]:Hide() - end - - for i=1, #list do - if not StatMenuFrame.buttons[i] then - StatMenuFrame.buttons[i] = CreateFrame("Button", nil, StatMenuFrame) - StatMenuFrame.buttons[i].hoverTex = StatMenuFrame.buttons[i]:CreateTexture(nil, 'OVERLAY') - StatMenuFrame.buttons[i].hoverTex:SetAllPoints() - StatMenuFrame.buttons[i].hoverTex:SetTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]]) - StatMenuFrame.buttons[i].hoverTex:SetBlendMode("ADD") - StatMenuFrame.buttons[i].hoverTex:Hide() - StatMenuFrame.buttons[i].text = StatMenuFrame.buttons[i]:CreateFontString(nil, 'BORDER') - StatMenuFrame.buttons[i].text:SetAllPoints() - StatMenuFrame.buttons[i].text:SetFont(SV.Media.font.roboto,12,"OUTLINE") - StatMenuFrame.buttons[i].text:SetJustifyH("LEFT") - StatMenuFrame.buttons[i]:SetScript("OnEnter", DD_OnEnter) - StatMenuFrame.buttons[i]:SetScript("OnLeave", DD_OnLeave) - end - StatMenuFrame.buttons[i]:Show() - StatMenuFrame.buttons[i]:SetHeight(16) - StatMenuFrame.buttons[i]:SetWidth(135) - StatMenuFrame.buttons[i].text:SetText(list[i].text) - StatMenuFrame.buttons[i].func = list[i].func - StatMenuFrame.buttons[i]:SetScript("OnClick", DD_OnClick) - if i == 1 then - StatMenuFrame.buttons[i]:SetPoint("TOPLEFT", StatMenuFrame, "TOPLEFT", 10, -10) - elseif((i -1) % maxPerColumn == 0) then - StatMenuFrame.buttons[i]:SetPoint("TOPLEFT", StatMenuFrame.buttons[i - maxPerColumn], "TOPRIGHT", 10, 0) - cols = cols + 1 - else - StatMenuFrame.buttons[i]:SetPoint("TOPLEFT", StatMenuFrame.buttons[i - 1], "BOTTOMLEFT") - end - end - local maxHeight = (min(maxPerColumn, #list) * 16) + 20 - local maxWidth = (135 * cols) + (10 * cols) - StatMenuFrame:SetSize(maxWidth, maxHeight) - StatMenuFrame:ClearAllPoints() - local point = _locate(self:GetParent()) - if point:find("BOTTOM") then - StatMenuFrame:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 10, 10) - else - StatMenuFrame:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 10, -10) - end - ToggleFrame(StatMenuFrame) - end - local Parent_OnClick = function(self, button) if IsAltKeyDown() then - MOD:SetStatMenu(self, self.MenuList); + SV.Dropdown:Open(self, self.MenuList); elseif(self.onClick) then - if(StatMenuFrame:IsShown()) then - ToggleFrame(StatMenuFrame) - else - self.onClick(self, button); - end + self.onClick(self, button); end end @@ -577,10 +468,10 @@ do local this = positionIndex[parent.useIndex][i] local subList = twipe(parent.holders[this].MenuList) - tinsert(subList,{text = NONE, func = function() MOD:ChangeDBVar(NONE, this, "panels", place); MOD:Generate() end}); + 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, "panels", place); MOD:Generate() end}); + tinsert(subList,{text = name, func = function() MOD:ChangeDBVar(name, this, "docks", place); MOD:Generate() end}); end end end @@ -592,6 +483,7 @@ do if(self.ListNeedsUpdate) then self:SetMenuLists() end + local instance, groupType = IsInInstance() local anchorTable = self.Anchors local statTable = self.Statistics @@ -635,7 +527,7 @@ do parent.holders[position]:Show() else for name, config in pairs(statTable)do - for panelName, panelData in pairs(db.panels) 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) @@ -663,40 +555,16 @@ function MOD:UnSet(parent) self.DisabledList[parent.StatParent] = true self:SetMenuLists() end - -function MOD:UpdateStatSize() - local rez = GetCVar("gxResolution"); - local gxWidth = tonumber(rez:match("(%d+)x%d+")); - local bw = gxWidth * 0.5 - local defaultStatBarWidth = min(bw, 800) - local buttonsize = SV.Dock.BarLeft.ToolBar:GetHeight() - local statBarWidth = SV.db.SVStats.dockStatWidth or defaultStatBarWidth - _G["SVUI_TopStatsDock"]:Size(statBarWidth - 2, buttonsize - 8) - _G["SVUI_StatsBar1"]:Size((statBarWidth * 0.5) - 1, buttonsize - 8) - _G["SVUI_StatsBar2"]:Size((statBarWidth * 0.5) - 1, buttonsize - 8) - _G["SVUI_BottomStatsDock"]:Size(statBarWidth - 2, buttonsize - 8) - _G["SVUI_StatsBar3"]:Size((statBarWidth * 0.5) - 1, buttonsize - 8) - _G["SVUI_StatsBar4"]:Size((statBarWidth * 0.5) - 1, buttonsize - 8) - self:Generate() -end --[[ ########################################################## BUILD FUNCTION / UPDATE ########################################################## ]]-- function MOD:ReLoad() - self:UpdateStatSize() + self:Generate() end function MOD:Load() - local rez = GetCVar("gxResolution"); - local gxWidth = tonumber(rez:match("(%d+)x%d+")); - local bw = gxWidth * 0.5 - local defaultStatBarWidth = min(bw, 800) - local buttonsize = SV.Dock.BarLeft.ToolBar:GetHeight() - local spacing = SV.Dock.Left:GetAttribute("spacingSize") - local statBarWidth = SV.db.SVStats.dockStatWidth or defaultStatBarWidth - hexHighlight = SV:HexColor("highlight") or "FFFFFF" local hexClass = classColor.colorStr BGStatString = "|cff" .. hexHighlight .. "%s: |c" .. hexClass .. "%s|r"; @@ -710,50 +578,14 @@ function MOD:Load() self.Accountant[playerRealm]["tokens"] = self.Accountant[playerRealm]["tokens"] or {}; self.Accountant[playerRealm]["tokens"][playerName] = self.Accountant[playerRealm]["tokens"][playerName] or 738; - --TOP STAT HOLDERS - - local topanchor = CreateFrame("Frame", "SVUI_TopStatsDock", SV.Screen) - topanchor:Size(statBarWidth - 2, buttonsize - 8) - topanchor:Point("LEFT", SV.Dock.Top.ToolBar, "RIGHT", spacing, 0) - SV:AddToDisplayAudit(topanchor) - - local topleftdata = CreateFrame("Frame", "SVUI_StatsBar1", topanchor) - topleftdata:Size((statBarWidth * 0.5) - 1, buttonsize - 8) - topleftdata:Point("LEFT", topanchor, "LEFT", 0, 0) - self:NewAnchor(topleftdata, 3, "ANCHOR_CURSOR", true) - SV.Mentalo:Add(topleftdata, L["Stats Dock 1"]) - - local toprightdata = CreateFrame("Frame", "SVUI_StatsBar2", topanchor) - toprightdata:Size((statBarWidth * 0.5) - 1, buttonsize - 8) - toprightdata:Point("RIGHT", topanchor, "RIGHT", 0, 0) - self:NewAnchor(toprightdata, 3, "ANCHOR_CURSOR", true) - SV.Mentalo:Add(toprightdata, L["Stats Dock 2"]) - - --BOTTOM STAT HOLDERS - - local bottomanchor = CreateFrame("Frame", "SVUI_BottomStatsDock", SV.Screen) - bottomanchor:Size(statBarWidth - 2, buttonsize - 8) - bottomanchor:Point("BOTTOM", SV.Screen, "BOTTOM", 0, 2) - - local bottomleftdata = CreateFrame("Frame", "SVUI_StatsBar3", bottomanchor) - bottomleftdata:Size((statBarWidth * 0.5) - 1, buttonsize - 8) - bottomleftdata:Point("LEFT", bottomanchor, "LEFT", 0, 0) - self:NewAnchor(bottomleftdata, 3, "ANCHOR_CURSOR") - SV.Mentalo:Add(bottomleftdata, L["Stats Dock 3"]) - - local bottomrightdata = CreateFrame("Frame", "SVUI_StatsBar4", bottomanchor) - bottomrightdata:Size((statBarWidth * 0.5) - 1, buttonsize - 8) - bottomrightdata:Point("RIGHT", bottomanchor, "RIGHT", 0, 0) - self:NewAnchor(bottomrightdata, 3, "ANCHOR_CURSOR") - SV.Mentalo:Add(bottomrightdata, L["Stats Dock 4"]) + 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:CacheTokenData() - - StatMenuFrame:SetParent(SV.Screen); - StatMenuFrame:SetPanelTemplate("Transparent"); - StatMenuFrame:Hide() self.tooltip:SetParent(SV.Screen) self.tooltip:SetFrameStrata("DIALOG") diff --git a/Interface/AddOns/SVUI/packages/stats/stats/bags.lua b/Interface/AddOns/SVUI/packages/stats/stats/bags.lua index 0d79b1f..c59d3a3 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/bags.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/bags.lua @@ -99,5 +99,5 @@ local BagsColorUpdate = function() end end -SV:NewCallback(BagsColorUpdate) +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 index 3a195b1..1a0e54a 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/cta.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/cta.lua @@ -155,6 +155,6 @@ local CTAColorUpdate = function() CTA_OnEvent(currentObject) end end -SV:NewCallback(CTAColorUpdate) +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 index bee4c11..a1f3c03 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/dps.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/dps.lua @@ -124,5 +124,5 @@ local DPSColorUpdate = function() end end -SV:NewCallback(DPSColorUpdate) +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 index d2c817f..af16df2 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/durability.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/durability.lua @@ -85,7 +85,7 @@ local function Durability_OnEvent(self, ...) self.text:SetAllPoints(self) self.text:SetJustifyH("CENTER") self.barframe:Hide() - self.text:SetFontTemplate(LSM:Fetch("font",SV.db.SVStats.font),SV.db.SVStats.fontSize,SV.db.SVStats.fontOutline) + 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) @@ -106,7 +106,7 @@ local function DurabilityBar_OnEvent(self, ...) if not self.barframe:IsShown() then self.barframe:Show() self.barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\STAT-DUR") - self.text:SetFontTemplate(LSM:Fetch("font",SV.db.SVStats.font),SV.db.SVStats.fontSize,"NONE") + 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) @@ -144,7 +144,7 @@ local DurColorUpdate = function() Durability_OnEvent(currentObject) end end -SV:NewCallback(DurColorUpdate) +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 index 3497e58..e184524 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/experience.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/experience.lua @@ -72,7 +72,7 @@ local function Experience_OnEvent(self, ...) self.text:SetAllPoints(self) self.text:SetJustifyH("CENTER") self.barframe:Hide() - self.text:SetFontTemplate(LSM:Fetch("font",SV.db.SVStats.font),SV.db.SVStats.fontSize,SV.db.SVStats.fontOutline) + 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() @@ -94,7 +94,7 @@ 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:SetFontTemplate(LSM:Fetch("font",SV.db.SVStats.font),SV.db.SVStats.fontSize,"NONE") + 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() diff --git a/Interface/AddOns/SVUI/packages/stats/stats/friends.lua b/Interface/AddOns/SVUI/packages/stats/stats/friends.lua index e937009..96e8a47 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/friends.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/friends.lua @@ -380,6 +380,6 @@ local FriendsColorUpdate = function() end end -SV:NewCallback(FriendsColorUpdate) +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/guild.lua b/Interface/AddOns/SVUI/packages/stats/stats/guild.lua index df4fc8e..2b75226 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/guild.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/guild.lua @@ -305,6 +305,6 @@ local GuildColorUpdate = function() Guild_OnEvent(currentObject, 'SVUI_COLOR_UPDATE') end end -SV:NewCallback(GuildColorUpdate) +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 index 1375031..e5ecbff 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/hps.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/hps.lua @@ -131,5 +131,5 @@ local HPSColorUpdate = function() end end -SV:NewCallback(HPSColorUpdate) +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 index 229b452..942c035 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua @@ -91,7 +91,7 @@ local function Reputation_OnEvent(self, ...) self.text:SetShadowOffset(2, -4) end local ID = 100 - local isFriend, friendText + local friendText local name, reaction, min, max, value = GetWatchedFactionInfo() local numFactions = GetNumFactions(); if not name then @@ -102,14 +102,14 @@ local function Reputation_OnEvent(self, ...) local friendID, friendRep, friendMaxRep, _, _, _, friendTextLevel = GetFriendshipReputation(isChild); if(not factionName or (name == "No watched factions") or (name == factionName)) then if friendID ~= nil then - isFriend = true friendText = friendTextLevel else ID = standingID end end end - self.text:SetFormattedText("|cff22EF5F%s|r|cff888888 - [|r%d%%|cff888888]|r", isFriend and friendText or _G["FACTION_STANDING_LABEL"..ID], ((value - min) / (max - min) * 100)) + 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 @@ -168,7 +168,7 @@ end local function Reputation_OnClick(self, button) MOD:CacheRepData() - MOD:SetStatMenu(self, RepMenuList) + SV.Dropdown:Open(self, RepMenuList) end MOD:Extend("Reputation", StatEvents, Reputation_OnEvent, nil, Reputation_OnClick, Reputation_OnEnter) diff --git a/Interface/AddOns/SVUI/packages/stats/stats/time.lua b/Interface/AddOns/SVUI/packages/stats/stats/time.lua index e753a8d..1a1dbae 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/time.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/time.lua @@ -224,7 +224,7 @@ function Update(self, t) int = 5 end -local ColorUpdate = function() +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") @@ -233,6 +233,6 @@ local ColorUpdate = function() end end -SV:NewCallback(ColorUpdate) +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 index 17ded7f..05beef0 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/tokens.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/tokens.lua @@ -201,7 +201,7 @@ end local function Tokens_OnClick(self, button) TokenParent = self; MOD:CacheTokenData() - MOD:SetStatMenu(self, TokenMenuList) + SV.Dropdown:Open(self, TokenMenuList) end MOD:Extend('Tokens', TokenEvents, TokensEventHandler, nil, Tokens_OnClick, Tokens_OnEnter) \ 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 ed2326c..3190b81 100644 --- a/Interface/AddOns/SVUI/packages/tip/SVTip.lua +++ b/Interface/AddOns/SVUI/packages/tip/SVTip.lua @@ -181,7 +181,7 @@ end local SetBurstColor = function(self, r, g, b) local a = self.ToggleAlpha self[1]:SetVertexColor(r, g, b, a) - self[2]:SetVertexColor(r, g, b, a) + --self[2]:SetVertexColor(r, g, b, a) self[3]:SetVertexColor(0, 0, 0, 0) self[4]:SetVertexColor(0, 0, 0, 0) self:SetMaskBorder(r, g, b) @@ -190,7 +190,7 @@ end local SetToneColor = function(self, r, g, b) local a = self.ToggleAlpha self[1]:SetVertexColor(0, 0, 0, 0) - self[2]:SetVertexColor(0, 0, 0, 0) + --self[2]:SetVertexColor(0, 0, 0, 0) self[3]:SetVertexColor(r, g, b, a) self[4]:SetVertexColor(r, g, b, a) self:SetMaskBorder(r, g, b) @@ -198,7 +198,7 @@ end local ClearMaskColors = function(self) self[1]:SetVertexColor(0, 0, 0, 0) - self[2]: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) @@ -583,11 +583,11 @@ local _hook_GameTooltip_SetDefaultAnchor = function(self, parent) if not SV.Mentalo:HasMoved("SVUI_ToolTip_MOVE")then self:ClearAllPoints() if(SV.SVBag.BagFrame and SV.SVBag.BagFrame:IsShown()) then - self:SetPoint("BOTTOMRIGHT", SV.SVBag.BagFrame, "TOPRIGHT", -44, 18) - elseif(SV.Dock.Right:GetAlpha() == 1 and SV.Dock.Right:IsShown()) then - self:SetPoint("BOTTOMRIGHT", SV.Dock.Right, "TOPRIGHT", -44, 18) + self:SetPoint("BOTTOMLEFT", SV.SVBag.BagFrame, "TOPLEFT", 0, 24) + elseif(SV.Dock.BottomRight:GetAlpha() == 1 and SV.Dock.BottomRight:IsShown()) then + self:SetPoint("BOTTOMLEFT", SV.Dock.BottomRight, "TOPLEFT", 0, 24) else - self:SetPoint("BOTTOMRIGHT", SV.Screen, "BOTTOMRIGHT", -44, 78) + self:SetPoint("BOTTOMLEFT", SV.Dock.BottomRight.Bar, "TOPLEFT", 0, 24) end else local point = Pinpoint(SVUI_ToolTip_MOVE) @@ -724,10 +724,10 @@ local function ApplyTooltipSkins() mask[2]:SetPoint("TOPRIGHT", mask, "BOTTOMRIGHT", 0, 0) mask[2]:SetHeight(mask:GetWidth() * 0.25) mask[2]:SetWidth(mask:GetWidth() * 0.25) - mask[2]:SetTexture(TT_BOTTOM) - mask[2]:SetVertexColor(0,0,0) - mask[2]:SetBlendMode("BLEND") - mask[2]:SetAlpha(alpha) + --mask[2]:SetTexture(TT_BOTTOM) + --mask[2]:SetVertexColor(0,0,0) + --mask[2]:SetBlendMode("BLEND") + --mask[2]:SetAlpha(alpha) --[[ HALFTONE RIGHT ]] mask[3] = mask:CreateTexture(nil, "BACKGROUND") mask[3]:SetPoint("LEFT", mask, "RIGHT", 0, 0) @@ -860,13 +860,14 @@ function MOD:ReLoad() end function MOD:Load() - BNToastFrame:Point("TOPRIGHT", SVUI_MinimapFrame, "BOTTOMLEFT", 0, -10) + BNToastFrame:ClearAllPoints() + BNToastFrame:Point("BOTTOMRIGHT", SV.Dock.BottomLeft, "TOPRIGHT", 0, 20) SV.Mentalo:Add(BNToastFrame, L["BattleNet Frame"], nil, nil, nil, nil, "BattleNetToasts") NewHook(BNToastFrame, "SetPoint", _hook_BNToastOnShow) if not SV.db.SVTip.enable then return end local anchor = CreateFrame("Frame", "SVUI_ToolTip", SV.Screen) - anchor:Point("BOTTOMRIGHT", SV.Dock.Right, "TOPRIGHT", 0, 60) + anchor:Point("BOTTOMLEFT", SV.Dock.BottomRight, "TOPLEFT", 0, 24) anchor:Size(130, 20) anchor:SetFrameLevel(anchor:GetFrameLevel() + 50) SV.Mentalo:Add(anchor, L["Tooltip"]) @@ -882,7 +883,7 @@ function MOD:Load() GameTooltipStatusBar:SetPoint("BOTTOMRIGHT", GameTooltip.SuperBorder, "BOTTOMRIGHT", -3, 3) GameTooltipStatusBar.text = GameTooltipStatusBar:CreateFontString(nil, "OVERLAY") GameTooltipStatusBar.text:Point("CENTER", GameTooltipStatusBar, "CENTER", 0, 0) - GameTooltipStatusBar.text:SetFontTemplate(LSM:Fetch("font", SV.db.SVTip.healthBar.font), SV.db.SVTip.healthBar.fontSize, "OUTLINE") + GameTooltipStatusBar.text:FontManager(LSM:Fetch("font", SV.db.SVTip.healthBar.font), SV.db.SVTip.healthBar.fontSize, "OUTLINE") if not GameTooltipStatusBar.border then diff --git a/Interface/AddOns/SVUI/packages/tools/SVTools.lua b/Interface/AddOns/SVUI/packages/tools/SVTools.lua new file mode 100644 index 0000000..f079fd3 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tools/SVTools.lua @@ -0,0 +1,96 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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.RaidLeaderNeedsUpdate) then + self.RaidLeaderNeedsUpdate = nil; + self:UpdateRaidLeader() + end +end + +function MOD:ReLoad() + self:UpdateProfessionTools() + self:UpdateRaidLeader() +end + +function MOD:Load() + self:LoadQuestWatch() + self:LoadProfessionTools() + 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 new file mode 100644 index 0000000..74c4b63 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tools/SVTools.xml @@ -0,0 +1,6 @@ +<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\raidleader.lua"/> +</Ui> \ 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 new file mode 100644 index 0000000..862c612 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tools/components/profession.lua @@ -0,0 +1,255 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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) + GameTooltip:AddDoubleLine("[Left-Click]", L["Hearthstone"], 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) + local extraText = self:GetAttribute("tipExtraText") + if(extraText) then + GameTooltip:AddLine(" ", 1, 1, 1) + GameTooltip:AddDoubleLine(extraText, "[Right Click]", 1, 1, 1, 0, 1, 0) + 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); + 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 + + -- 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 new file mode 100644 index 0000000..879d79f --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tools/components/questwatch.lua @@ -0,0 +1,216 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 VARS +########################################################## +]]-- +local ICON_FILE = [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-QUESTS]]; +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +function MOD:QUEST_AUTOCOMPLETE(event) + if(SV.Dock.BottomRight.Window and self.QuestWatch) then + if(not self.QuestWatch:IsShown()) then + SV.Dock.BottomRight.Window.FrameLink = self.QuestWatch + + if not SV.Dock.BottomRight.Window:IsShown() then + SV.Dock.BottomRight.Window:Show() + end + + SV.Dock.BottomRight.Bar:Refresh() + self.QuestWatch:Show() + + if(self.QuestWatch.DockButton) then + self.QuestWatch.DockButton:Activate() + end + end + end +end + +function MOD:LoadQuestWatch() + local ObjectiveTrackerFrame = _G.ObjectiveTrackerFrame + + if(not ObjectiveTrackerFrame) then return end + + if(not SV.db.general.questWatch) then + ObjectiveTrackerFrame:RemoveTextures(true) + + self.QuestWatch = CreateFrame("Frame", "SVUI_QuestWatchFrame", UIParent); + self.QuestWatch:SetSize(200, ObjectiveTrackerFrame:GetHeight()); + self.QuestWatch:SetPoint("TOPRIGHT", UIParent, "RIGHT", -200, 100); + + ObjectiveTrackerFrame:ClearAllPoints() + ObjectiveTrackerFrame:SetClampedToScreen(false) + ObjectiveTrackerFrame:SetParent(self.QuestWatch) + ObjectiveTrackerFrame:SetAllPoints(self.QuestWatch) + ObjectiveTrackerFrame:SetFrameLevel(self.QuestWatch:GetFrameLevel() + 1) + ObjectiveTrackerFrame.ClearAllPoints = SV.fubar; + ObjectiveTrackerFrame.SetPoint = SV.fubar; + ObjectiveTrackerFrame.SetAllPoints = SV.fubar; + + 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: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 + + SV.Mentalo:Add(self.QuestWatch, "Quest Watch"); + 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", nil, self.QuestWatch); + listFrame:SetPoint("TOPLEFT", self.QuestWatch, -62, 0); + listFrame:SetPoint("BOTTOMRIGHT", self.QuestWatch, -31, 21); + listFrame:EnableMouseWheel(true); + + local scrollFrame = CreateFrame("Slider", nil, 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, 420); + 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:SetParent(listFrame) + ObjectiveTrackerFrame:SetHeight(500) + ObjectiveTrackerFrame:SetWidth(WIDTH) + ObjectiveTrackerFrame:SetPoint("TOPRIGHT", listFrame, "TOPRIGHT", -31, 0) + ObjectiveTrackerFrame:SetFrameLevel(listFrame:GetFrameLevel() + 1) + + listFrame:SetScrollChild(ObjectiveTrackerFrame) + + ObjectiveTrackerFrame.ClearAllPoints = SV.fubar; + ObjectiveTrackerFrame.SetAllPoints = SV.fubar; + ObjectiveTrackerFrame.SetPoint = SV.fubar; + ObjectiveTrackerFrame.SetWidth = SV.fubar; + + 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.SetWidth = SV.fubar; + + 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:RegisterEvent("QUEST_AUTOCOMPLETE"); + 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 new file mode 100644 index 0000000..83b019f --- /dev/null +++ b/Interface/AddOns/SVUI/packages/tools/components/raidleader.lua @@ -0,0 +1,214 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 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, "UIMenuButtonStretchTemplate, SecureHandlerClickTemplate") + SVUI_RaidToolToggle:SetAllPoints(self.RaidTool) + SVUI_RaidToolToggle:RemoveTextures() + 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); + + 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 2e4a39f..91ab75b 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua @@ -517,7 +517,7 @@ function MOD:RefreshUnitLayout(frame, template) cX = db.name.xOffset cY = db.name.yOffset nametext:ClearAllPoints() - SV:ReversePoint(nametext, point, infoPanel, cX, cY) + SV:SetReversePoint(nametext, point, infoPanel, cX, cY) if(nametext.initialAnchor:find("RIGHT")) then nametext:SetJustifyH("RIGHT") @@ -549,7 +549,7 @@ function MOD:RefreshUnitLayout(frame, template) cX = db.health.xOffset cY = db.health.yOffset healthtext:ClearAllPoints() - SV:ReversePoint(healthtext, point, infoPanel, cX, cY) + SV:SetReversePoint(healthtext, point, infoPanel, cX, cY) frame:Tag(healthtext, db.health.tags) end end @@ -565,7 +565,7 @@ function MOD:RefreshUnitLayout(frame, template) cX = db.power.xOffset cY = db.power.yOffset powertext:ClearAllPoints() - SV:ReversePoint(powertext, point, infoPanel, cX, cY) + SV:SetReversePoint(powertext, point, infoPanel, cX, cY) if db.power.attachTextToPower then powertext:SetParent(frame.Power) else @@ -882,7 +882,7 @@ function MOD:RefreshUnitLayout(frame, template) local attachTo = FindAnchorFrame(frame, db.buffs.attachTo, db.debuffs.attachTo == 'BUFFS' and db.buffs.attachTo == 'DEBUFFS') - SV:ReversePoint(buffs, db.buffs.anchorPoint, attachTo, db.buffs.xOffset + BOTTOM_MODIFIER, db.buffs.yOffset) + 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; @@ -914,7 +914,7 @@ function MOD:RefreshUnitLayout(frame, template) local attachTo = FindAnchorFrame(frame, db.debuffs.attachTo, db.debuffs.attachTo == 'BUFFS' and db.buffs.attachTo == 'DEBUFFS') - SV:ReversePoint(debuffs, db.debuffs.anchorPoint, attachTo, db.debuffs.xOffset + BOTTOM_MODIFIER, db.debuffs.yOffset) + 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; @@ -935,6 +935,8 @@ function MOD:RefreshUnitLayout(frame, template) if db.aurabar.enable then if not frame:IsElementEnabled("AuraBars") then frame:EnableElement("AuraBars") end auraBar:Show() + + auraBar.forceShow = frame.forceShowAuras; auraBar.friendlyAuraType = db.aurabar.friendlyAuraType auraBar.enemyAuraType = db.aurabar.enemyAuraType @@ -996,7 +998,7 @@ function MOD:RefreshUnitLayout(frame, template) classIcon:SetAlpha(1) classIcon:Size(size) - SV:ReversePoint(classIcon, ico.classIcon.attachTo, healthPanel, ico.classIcon.xOffset, ico.classIcon.yOffset) + SV:SetReversePoint(classIcon, ico.classIcon.attachTo, healthPanel, ico.classIcon.xOffset, ico.classIcon.yOffset) else classIcon:Hide() end @@ -1019,7 +1021,7 @@ function MOD:RefreshUnitLayout(frame, template) else raidIcon:SetAlpha(1) raidIcon:Size(size) - SV:ReversePoint(raidIcon, ico.raidicon.attachTo, healthPanel, ico.raidicon.xOffset, ico.raidicon.yOffset) + SV:SetReversePoint(raidIcon, ico.raidicon.attachTo, healthPanel, ico.raidicon.xOffset, ico.raidicon.yOffset) end else frame:DisableElement('RaidIcon') @@ -1044,7 +1046,7 @@ function MOD:RefreshUnitLayout(frame, template) else lfd:SetAlpha(1) lfd:Size(size) - SV:ReversePoint(lfd, ico.roleIcon.attachTo, healthPanel, ico.roleIcon.xOffset, ico.roleIcon.yOffset) + SV:SetReversePoint(lfd, ico.roleIcon.attachTo, healthPanel, ico.roleIcon.xOffset, ico.roleIcon.yOffset) end else frame:DisableElement('LFDRole') @@ -1070,7 +1072,7 @@ function MOD:RefreshUnitLayout(frame, template) else roles:SetAlpha(1) roles:Size(size) - SV:ReversePoint(roles, ico.raidRoleIcons.attachTo, healthPanel, ico.raidRoleIcons.xOffset, ico.raidRoleIcons.yOffset) + SV:SetReversePoint(roles, ico.raidRoleIcons.attachTo, healthPanel, ico.raidRoleIcons.xOffset, ico.raidRoleIcons.yOffset) end else roles:Hide() @@ -1148,13 +1150,11 @@ function MOD:FrameForge() LoadedUnitFrames = true; end if not LoadedGroupHeaders then - self:SetGroupFrame("raid10") - self:SetGroupFrame("raid25") - self:SetGroupFrame("raid40") - self:SetGroupFrame("raidpet") - self:SetGroupFrame("party") self:SetGroupFrame("tank") self:SetGroupFrame("assist") + self:SetGroupFrame("raid") + self:SetGroupFrame("raidpet") + self:SetGroupFrame("party") LoadedGroupHeaders = true end end diff --git a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua index e2c8e01..91b9715 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua @@ -546,7 +546,7 @@ function MOD:SmartAuraDisplay() if buffs:IsShown() then buffs:ClearAllPoints() - SV:ReversePoint(buffs, db.buffs.anchorPoint, self, db.buffs.xOffset, db.buffs.yOffset) + SV:SetReversePoint(buffs, db.buffs.anchorPoint, self, db.buffs.xOffset, db.buffs.yOffset) if db.aurabar.attachTo ~= 'FRAME' then bars:ClearAllPoints() bars:SetPoint('BOTTOMLEFT', buffs, 'TOPLEFT', 0, 1) @@ -556,7 +556,7 @@ function MOD:SmartAuraDisplay() if debuffs:IsShown() then debuffs:ClearAllPoints() - SV:ReversePoint(debuffs, db.debuffs.anchorPoint, self, db.debuffs.xOffset, db.debuffs.yOffset) + SV:SetReversePoint(debuffs, db.debuffs.anchorPoint, self, db.debuffs.xOffset, db.debuffs.yOffset) if db.aurabar.attachTo ~= 'FRAME' then bars:ClearAllPoints() bars:SetPoint('BOTTOMLEFT', debuffs, 'TOPLEFT', 0, 1) diff --git a/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua b/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua index c454359..4c3d1ba 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua @@ -74,10 +74,11 @@ LOCALS -- local MISSING_MODEL_FILE = [[creature\ghost\ghost.m2]]; -- local MISSING_MODEL_FILE = [[Spells\Monk_travelingmist_missile.m2]]; local HEALTH_ANIM_FILE = [[Interface\Addons\SVUI\assets\artwork\Unitframe\UNIT-HEALTH-ANIMATION]]; -local ELITE_TOP = [[Interface\Addons\SVUI\assets\artwork\Unitframe\Border\ELITE-TOP]] -local ELITE_BOTTOM = [[Interface\Addons\SVUI\assets\artwork\Unitframe\Border\ELITE-BOTTOM]] -local ELITE_RIGHT = [[Interface\Addons\SVUI\assets\artwork\Unitframe\Border\ELITE-RIGHT]] -local STUNNED_ANIM = [[Interface\Addons\SVUI\assets\artwork\Unitframe\UNIT-STUNNED]] +local ELITE_TOP = [[Interface\Addons\SVUI\assets\artwork\Unitframe\Border\ELITE-TOP]]; +local ELITE_BOTTOM = [[Interface\Addons\SVUI\assets\artwork\Unitframe\Border\ELITE-BOTTOM]]; +local ELITE_RIGHT = [[Interface\Addons\SVUI\assets\artwork\Unitframe\Border\ELITE-RIGHT]]; +local STUNNED_ANIM = [[Interface\Addons\SVUI\assets\artwork\Unitframe\UNIT-STUNNED]]; +local AGGRO_TEXTURE = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\UNIT-AGGRO]]; local borderTex = [[Interface\Addons\SVUI\assets\artwork\Template\ROUND]] local token = {[0] = "MANA", [1] = "RAGE", [2] = "FOCUS", [3] = "ENERGY", [6] = "RUNIC_POWER"} @@ -173,13 +174,12 @@ ACTIONPANEL ########################################################## ]]-- local UpdateThreat = function(self, event, unit) - if(unit ~= self.unit) or not unit or not IsLoggedIn() then return end + if(not unit) then return end local threat = self.Threat local status = UnitThreatSituation(unit) local r, g, b if(status and status > 0) then r, g, b = GetThreatStatusColor(status) - threat:SetBackdropBorderColor(r, g, b) else threat:SetBackdropBorderColor(0, 0, 0, 0.5) @@ -187,30 +187,30 @@ local UpdateThreat = function(self, event, unit) end local UpdatePlayerThreat = function(self, event, unit) - if(unit ~= self.unit) or not unit or not IsLoggedIn() then return end + if(unit ~= "player") then return end local threat = self.Threat + local aggro = self.Aggro local status = UnitThreatSituation(unit) local r, g, b if(status and status > 0) then r, g, b = GetThreatStatusColor(status) threat:SetBackdropBorderColor(r, g, b) - if(status > 1) then - threat.OhShit:Show() + if(status > 1 and (not aggro:IsShown())) then + aggro:Show() end else threat:SetBackdropBorderColor(0, 0, 0, 0.5) - threat.OhShit:Hide() + if(aggro:IsShown()) then + aggro:Hide() + end end end -local OhShit_OnShow = function(self) - if not self.anim:IsPlaying() then self.anim:Play() end -end - local function CreateThreat(frame, unit) - local threat = CreateFrame('Frame', nil, frame) - threat:Point('TOPLEFT', frame, 'TOPLEFT', -3, 3) - threat:Point('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', 3, -3) + if(not frame.ActionPanel) then return; end + local threat = CreateFrame("Frame", nil, frame.ActionPanel) + threat:Point("TOPLEFT", frame.ActionPanel, "TOPLEFT", -3, 3) + threat:Point("BOTTOMRIGHT", frame.ActionPanel, "BOTTOMRIGHT", 3, -3) threat:SetBackdrop({ edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], edgeSize = 3, @@ -224,19 +224,20 @@ local function CreateThreat(frame, unit) threat:SetBackdropBorderColor(0,0,0,0.5) if(unit == "player") then - local aggro = CreateFrame("Frame", nil, threat) + local aggro = CreateFrame("Frame", "SVUI_PlayerThreatAlert", frame) aggro:SetFrameStrata("HIGH") aggro:SetFrameLevel(30) - aggro:Size(52,52) - aggro:Point("TOPRIGHT",frame,16,16) - aggro.bg = aggro:CreateTexture(nil, "BORDER") - aggro.bg:FillInner(aggro) - aggro.bg:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\UNIT-AGGRO") + aggro:SetSize(52,52) + aggro:SetPoint("TOPRIGHT", frame, "TOPRIGHT", 16, 16) + aggro.texture = aggro:CreateTexture(nil, "OVERLAY") + aggro.texture:SetAllPoints(aggro) + aggro.texture:SetTexture(AGGRO_TEXTURE) SV.Animate:Pulse(aggro) - aggro:Hide() - aggro:SetScript("OnShow", OhShit_OnShow) - - threat.OhShit = aggro + aggro:SetScript("OnShow", function(this) + this.anim:Play() + end); + frame.Aggro = aggro + threat.Override = UpdatePlayerThreat else threat.Override = UpdateThreat @@ -465,8 +466,6 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) frame.InfoPanel:Point("BOTTOMRIGHT", frame.ActionPanel, "BOTTOMRIGHT", -2, 2) end - frame.Threat = CreateThreat(frame.ActionPanel, unit) - frame.InfoPanel.Name = CreateNameText(frame.InfoPanel, unit) local reverse = unit and (unit == "target" or unit == "focus" or unit == "boss" or unit == "arena") or false; @@ -526,6 +525,8 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) frame.StatusPanel:SetFrameStrata("LOW") frame.StatusPanel:SetFrameLevel(28) + + frame.Threat = CreateThreat(frame, unit) end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/packages/unit/elements/misc.lua b/Interface/AddOns/SVUI/packages/unit/elements/misc.lua index de86873..22d7bca 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/misc.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/misc.lua @@ -101,11 +101,11 @@ function MOD:CreateRaidDebuffs(frame) raidDebuff.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) raidDebuff.icon:FillInner(raidDebuff) raidDebuff.count = raidDebuff:CreateFontString(nil, "OVERLAY") - raidDebuff.count:SetFontTemplate(AURA_FONT, AURA_FONTSIZE, AURA_OUTLINE) + raidDebuff.count:FontManager(AURA_FONT, AURA_FONTSIZE, AURA_OUTLINE) raidDebuff.count:SetPoint("BOTTOMRIGHT", 0, 2) raidDebuff.count:SetTextColor(1, .9, 0) raidDebuff.time = raidDebuff:CreateFontString(nil, "OVERLAY") - raidDebuff.time:SetFontTemplate(AURA_FONT, AURA_FONTSIZE, AURA_OUTLINE) + raidDebuff.time:FontManager(AURA_FONT, AURA_FONTSIZE, AURA_OUTLINE) raidDebuff.time:SetPoint("CENTER") raidDebuff.time:SetTextColor(1, .9, 0) raidDebuff:SetParent(frame.InfoPanel) @@ -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:SetFontTemplate(SV.Media.font.roboto, 10, "NONE") + xp.Value:FontManager(SV.Media.font.roboto, 10, "NONE") xp.Value:SetTextColor(0.2, 0.75, 1) xp.Value:SetShadowColor(0, 0, 0, 0) xp.Value:SetShadowOffset(0, 0) @@ -379,7 +379,7 @@ function MOD:CreateExperienceRepBar(frame) rep.Tooltip = true; rep.Value = rep:CreateFontString(nil, "TOOLTIP") rep.Value:SetAllPoints(rep) - rep.Value:SetFontTemplate(SV.Media.font.roboto, 10, "NONE") + rep.Value:FontManager(SV.Media.font.roboto, 10, "NONE") rep.Value:SetTextColor(0.1, 1, 0.2) rep.Value:SetShadowColor(0, 0, 0, 0) rep.Value:SetShadowOffset(0, 0) diff --git a/Interface/AddOns/SVUI/packages/unit/frames.lua b/Interface/AddOns/SVUI/packages/unit/frames.lua index 707476b..507ea68 100644 --- a/Interface/AddOns/SVUI/packages/unit/frames.lua +++ b/Interface/AddOns/SVUI/packages/unit/frames.lua @@ -169,7 +169,7 @@ local UpdatePlayerFrame = function(self) local size = iconDB.restIcon.size; resting:ClearAllPoints() resting:Size(size) - SV:ReversePoint(resting, iconDB.restIcon.attachTo, healthPanel, iconDB.restIcon.xOffset, iconDB.restIcon.yOffset) + SV:SetReversePoint(resting, iconDB.restIcon.attachTo, healthPanel, iconDB.restIcon.xOffset, iconDB.restIcon.yOffset) if not self:IsElementEnabled("Resting")then self:EnableElement("Resting") end @@ -186,7 +186,7 @@ local UpdatePlayerFrame = function(self) local size = iconDB.combatIcon.size; combat:ClearAllPoints() combat:Size(size) - SV:ReversePoint(combat, iconDB.combatIcon.attachTo, healthPanel, iconDB.combatIcon.xOffset, iconDB.combatIcon.yOffset) + SV:SetReversePoint(combat, iconDB.combatIcon.attachTo, healthPanel, iconDB.combatIcon.xOffset, iconDB.combatIcon.yOffset) if not self:IsElementEnabled("Combat")then self:EnableElement("Combat") end @@ -314,7 +314,7 @@ CONSTRUCTORS["player"] = function(self, unit) self.Resting = MOD:CreateRestingIndicator(self) self.Combat = MOD:CreateCombatIndicator(self) self.PvPText = self.InfoPanel:CreateFontString(nil,'OVERLAY') - self.PvPText:SetFontTemplate(LSM:Fetch("font", SV.db.SVUnit.font), SV.db.SVUnit.fontSize, SV.db.SVUnit.fontOutline) + self.PvPText:FontManager(LSM:Fetch("font", SV.db.SVUnit.font), SV.db.SVUnit.fontSize, SV.db.SVUnit.fontOutline) self.Afflicted = MOD:CreateAfflicted(self) self.HealPrediction = MOD:CreateHealPrediction(self, true) self.AuraBars = MOD:CreateAuraBarHeader(self, key) diff --git a/Interface/AddOns/SVUI/packages/unit/frames/raid.lua b/Interface/AddOns/SVUI/packages/unit/frames/raid.lua deleted file mode 100644 index 80ca094..0000000 --- a/Interface/AddOns/SVUI/packages/unit/frames/raid.lua +++ /dev/null @@ -1,1168 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## ---]] ---LUA -local unpack = unpack; -local select = select; -local pairs = pairs; -local type = type; -local rawset = rawset; -local rawget = rawget; -local tostring = tostring; -local error = error; -local next = next; -local pcall = pcall; -local getmetatable = getmetatable; -local setmetatable = setmetatable; -local assert = assert; ---BLIZZARD -local _G = _G; -local tinsert = _G.tinsert; -local tremove = _G.tremove; -local twipe = _G.wipe; ---STRING -local string = string; -local format = string.format; -local sub = string.sub; -local upper = string.upper; -local match = string.match; -local gsub = string.gsub; ---MATH -local math = math; -local numMin = math.min; ---TABLE -local table = table; -local tsort = table.sort; -local tremove = table.remove; - -local SV = select(2, ...) -local oUF_Villain = SV.oUF - -assert(oUF_Villain, "SVUI was unable to locate oUF.") - -local L = SV.L; -local MOD = SV.SVUnit - -if(not MOD) then return end ---[[ -########################################################## -LOCAL DATA -########################################################## -]]-- -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}, -} -local GroupDistributor = { - ["CLASS"] = function(x) - x:SetAttribute("groupingOrder","DEATHKNIGHT,DRUID,HUNTER,MAGE,PALADIN,PRIEST,SHAMAN,WARLOCK,WARRIOR,MONK") - x:SetAttribute("sortMethod","NAME") - x:SetAttribute("groupBy","CLASS") - end, - ["MTMA"] = function(x) - x:SetAttribute("groupingOrder","MAINTANK,MAINASSIST,NONE") - x:SetAttribute("sortMethod","NAME") - x:SetAttribute("groupBy","ROLE") - end, - ["ROLE_TDH"] = function(x) - x:SetAttribute("groupingOrder","TANK,DAMAGER,HEALER,NONE") - x:SetAttribute("sortMethod","NAME") - x:SetAttribute("groupBy","ASSIGNEDROLE") - end, - ["ROLE_HTD"] = function(x) - x:SetAttribute("groupingOrder","HEALER,TANK,DAMAGER,NONE") - x:SetAttribute("sortMethod","NAME") - x:SetAttribute("groupBy","ASSIGNEDROLE") - end, - ["ROLE_HDT"] = function(x) - x:SetAttribute("groupingOrder","HEALER,DAMAGER,TANK,NONE") - x:SetAttribute("sortMethod","NAME") - x:SetAttribute("groupBy","ASSIGNEDROLE") - end, - ["ROLE"] = function(x) - x:SetAttribute("groupingOrder","TANK,HEALER,DAMAGER,NONE") - x:SetAttribute("sortMethod","NAME") - x:SetAttribute("groupBy","ASSIGNEDROLE") - end, - ["NAME"] = function(x) - x:SetAttribute("groupingOrder","1,2,3,4,5,6,7,8") - x:SetAttribute("sortMethod","NAME") - x:SetAttribute("groupBy",nil) - end, - ["GROUP"] = function(x) - x:SetAttribute("groupingOrder","1,2,3,4,5,6,7,8") - x:SetAttribute("sortMethod","INDEX") - x:SetAttribute("groupBy","GROUP") - end, - ["PETNAME"] = function(x) - x:SetAttribute("groupingOrder","1,2,3,4,5,6,7,8") - x:SetAttribute("sortMethod","NAME") - x:SetAttribute("groupBy", nil) - x:SetAttribute("filterOnPet", true) - end -} ---[[ -########################################################## -FRAME HELPERS -########################################################## -]]-- -local DetachSubFrames = function(...) - for i = 1, select("#", ...) do - local frame = select(i,...) - frame:ClearAllPoints() - end -end - -local UpdateTargetGlow = function(self) - if not self.unit then return end - local unit = self.unit; - if(UnitIsUnit(unit, "target")) then - self.TargetGlow:Show() - local reaction = UnitReaction(unit, "player") - if(UnitIsPlayer(unit)) then - local _, class = UnitClass(unit) - if class then - local colors = RAID_CLASS_COLORS[class] - self.TargetGlow:SetBackdropBorderColor(colors.r, colors.g, colors.b) - else - self.TargetGlow:SetBackdropBorderColor(1, 1, 1) - end - elseif(reaction) then - local colors = FACTION_BAR_COLORS[reaction] - self.TargetGlow:SetBackdropBorderColor(colors.r, colors.g, colors.b) - else - self.TargetGlow:SetBackdropBorderColor(1, 1, 1) - end - else - self.TargetGlow:Hide() - end -end ---[[ -########################################################## -TEMPLATES AND PROTOTYPES -########################################################## -]]-- -local BuildTemplates = {}; -local UpdateTemplates = {}; ---[[ -########################################################## -COMMON -########################################################## -]]-- -local AllowElement = function(self) - if InCombatLockdown() then return; end - - if not self.isForced then - self.sourceElement = self.unit; - self.unit = "player" - self.isForced = true; - self.sourceEvent = self:GetScript("OnUpdate") - end - - self:SetScript("OnUpdate", nil) - self.forceShowAuras = true; - - UnregisterUnitWatch(self) - RegisterUnitWatch(self, true) - - self:Show() - if self:IsVisible() and self.Update then - self:Update() - end -end - -local RestrictElement = function(self) - if(InCombatLockdown() or (not self.isForced)) then return; end - - self.forceShowAuras = nil - self.isForced = nil - - UnregisterUnitWatch(self) - RegisterUnitWatch(self) - - if self.sourceEvent then - self:SetScript("OnUpdate", self.sourceEvent) - self.sourceEvent = nil - end - - self.unit = self.sourceElement or self.unit; - - if self:IsVisible() and self.Update then - self:Update() - end -end ---[[ -########################################################## -PARTY FRAMES -########################################################## -]]-- -local PartyUnitUpdate = function(self) - local db = SV.db.SVUnit.party - self.colors = oUF_Villain.colors; - self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and 'AnyDown' or 'AnyUp') - MOD.RefreshUnitMedia(self, "party") - if self.isChild then - local altDB = db.petsGroup; - if self == _G[self.originalParent:GetName()..'Target'] then - altDB = db.targetsGroup - end - if not self.originalParent.childList then - self.originalParent.childList = {} - end - self.originalParent.childList[self] = true; - if not InCombatLockdown()then - if altDB.enable then - local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(altDB, "partychild") - self:SetParent(self.originalParent) - self:Size(UNIT_WIDTH, UNIT_HEIGHT) - self:ClearAllPoints() - SV:ReversePoint(self, altDB.anchorPoint, self.originalParent, altDB.xOffset, altDB.yOffset) - else - self:SetParent(SV.Cloaked) - end - end - do - local health = self.Health; - health.Smooth = nil; - health.frequentUpdates = nil; - health.colorSmooth = nil; - health.colorHealth = nil; - health.colorClass = true; - health.colorReaction = true; - health:ClearAllPoints() - health:Point("TOPRIGHT", self, "TOPRIGHT", -1, -1) - health:Point("BOTTOMLEFT", self, "BOTTOMLEFT", 1, 1) - end - do - local nametext = self.InfoPanel.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) - end - MOD:RefreshUnitLayout(self, "party") - MOD:UpdateAuraWatch(self, "party") - end - self:EnableElement('ReadyCheck') - self:UpdateAllElements() -end - -UpdateTemplates["party"] = function(self) - if(SV.NeedsFrameAudit) then return end - local db = SV.db.SVUnit.party - local groupFrame = self:GetParent() - - if not groupFrame.positioned then - groupFrame:ClearAllPoints() - groupFrame:Point("LEFT",SV.Screen,"LEFT",40,0) - RegisterStateDriver(groupFrame, "visibility", "[group:raid][nogroup] hide;show") - SV.Mentalo:Add(groupFrame, L['Party Frames'], nil, nil, nil, 'ALL,PARTY,ARENA'); - groupFrame.positioned = true; - end - - local index = 1; - local attIndex = ("child%d"):format(index) - local childFrame = self:GetAttribute(attIndex) - if(not childFrame) then return end - local childName = childFrame:GetName() - local petFrame = _G[("%sPet"):format(childName)] - local targetFrame = _G[("%sTarget"):format(childName)] - - while childFrame do - childFrame:UnitUpdate() - - childName = childFrame:GetName() - petFrame = _G[("%sPet"):format(childName)] - targetFrame = _G[("%sTarget"):format(childName)] - - if(petFrame) then - petFrame:UnitUpdate() - end - - if(targetFrame) then - targetFrame:UnitUpdate() - end - - index = index + 1; - attIndex = ("child%d"):format(index) - childFrame = self:GetAttribute(attIndex) - end -end - -BuildTemplates["party"] = function(self, unit) - self.unit = unit - self.___key = "party" - self:SetScript("OnEnter", UnitFrame_OnEnter) - self:SetScript("OnLeave", UnitFrame_OnLeave) - - MOD:SetActionPanel(self, "party") - self.Health = MOD:CreateHealthBar(self, true) - - if self.isChild then - self.originalParent = self:GetParent() - else - self.Power = MOD:CreatePowerBar(self, true) - self.Power.frequentUpdates = false - MOD:CreatePortrait(self, true) - self.Buffs = MOD:CreateBuffs(self, "party") - self.Debuffs = MOD:CreateDebuffs(self, "party") - self.AuraWatch = MOD:CreateAuraWatch(self, "party") - self.Afflicted = MOD:CreateAfflicted(self) - self.ResurrectIcon = MOD:CreateResurectionIcon(self) - self.LFDRole = MOD:CreateRoleIcon(self) - self.RaidRoleFramesAnchor = MOD:CreateRaidRoleFrames(self) - self.RaidIcon = MOD:CreateRaidIcon(self) - self.ReadyCheck = MOD:CreateReadyCheckIcon(self) - self.HealPrediction = MOD:CreateHealPrediction(self) - --self.GPS = MOD:CreateGPS(self, true) - - local shadow = CreateFrame("Frame", nil, self) - shadow:SetFrameLevel(1) - shadow:SetFrameStrata(self:GetFrameStrata()) - shadow:WrapOuter(self, 3, 3) - shadow:SetBackdrop({ - edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], - edgeSize = 3, - insets = { - left = 5, - right = 5, - top = 5, - bottom = 5 - } - }) - shadow:SetBackdropColor(0, 0, 0, 0) - shadow:SetBackdropBorderColor(0, 0, 0, 0.9) - shadow:Hide() - self.TargetGlow = shadow - tinsert(self.__elements, UpdateTargetGlow) - self:RegisterEvent("PLAYER_TARGET_CHANGED", UpdateTargetGlow) - self:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateTargetGlow) - self:RegisterEvent("GROUP_ROSTER_UPDATE", UpdateTargetGlow) - end - - self.Range = { insideAlpha = 1, outsideAlpha = 1 } - - self.Restrict = RestrictElement - self.Allow = AllowElement - self.UnitUpdate = PartyUnitUpdate - - return self -end ---[[ -########################################################## -RAID FRAMES -########################################################## -]]-- -local RaidUnitUpdate = function(self) - local db = SV.db.SVUnit.raid - self.colors = oUF_Villain.colors; - self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") - - local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db) - if not InCombatLockdown() then - self:Size(UNIT_WIDTH, UNIT_HEIGHT) - end - - do - local rdBuffs = self.RaidDebuffs; - if db.rdebuffs.enable then - if not self:IsElementEnabled('RaidDebuffs') then - 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:Show() - else - self:DisableElement("RaidDebuffs") - rdBuffs:Hide() - end - end - - MOD.RefreshUnitMedia(self, token) - MOD:UpdateAuraWatch(self, token) - MOD:RefreshUnitLayout(self, token) - - if(token ~= "raidpet") then - self:EnableElement("ReadyCheck") - end - self:UpdateAllElements() -end - -UpdateTemplates["raid"] = function(self) - if(SV.NeedsFrameAudit) then return end - local db = SV.db.SVUnit.raid - local groupFrame = self:GetParent() - - if not groupFrame.positioned then - groupFrame:ClearAllPoints() - groupFrame:Point("LEFT", SV.Screen, "LEFT", 4, 0) - RegisterStateDriver(groupFrame, "visibility", "[group:raid] show; hide") - SV.Mentalo:Add(groupFrame, "Raid Frames") - groupFrame.positioned = true - end - - local index = 1; - local attIndex = ("child%d"):format(index) - local childFrame = self:GetAttribute(attIndex) - if(not childFrame) then return end - local childName = childFrame:GetName() - local petFrame = _G[("%sPet"):format(childName)] - local targetFrame = _G[("%sTarget"):format(childName)] - - while childFrame do - childFrame:UnitUpdate() - - childName = childFrame:GetName() - petFrame = _G[("%sPet"):format(childName)] - targetFrame = _G[("%sTarget"):format(childName)] - - if(petFrame) then - petFrame:UnitUpdate() - end - - if(targetFrame) then - targetFrame:UnitUpdate() - end - - index = index + 1; - attIndex = ("child%d"):format(index) - childFrame = self:GetAttribute(attIndex) - end -end - -BuildTemplates["raid"] = function(self, unit) - self.unit = unit - self.___key = "raid" - MOD:SetActionPanel(self, "raid") - self.Health = MOD:CreateHealthBar(self, true) - self.Health.frequentUpdates = false - self.Power = MOD:CreatePowerBar(self, true) - self.Power.frequentUpdates = false - self.Buffs = MOD:CreateBuffs(self, "raid") - self.Debuffs = MOD:CreateDebuffs(self, "raid") - self.AuraWatch = MOD:CreateAuraWatch(self, "raid") - self.RaidDebuffs = MOD:CreateRaidDebuffs(self) - self.Afflicted = MOD:CreateAfflicted(self) - self.ResurrectIcon = MOD:CreateResurectionIcon(self) - self.LFDRole = MOD:CreateRoleIcon(self) - self.RaidRoleFramesAnchor = MOD:CreateRaidRoleFrames(self) - self.RaidIcon = MOD:CreateRaidIcon(self) - self.ReadyCheck = MOD:CreateReadyCheckIcon(self) - self.HealPrediction = MOD:CreateHealPrediction(self) - self.Range = { insideAlpha = 1, outsideAlpha = 1 } - - self.Restrict = RestrictElement - self.Allow = AllowElement - self.UnitUpdate = RaidUnitUpdate - - local shadow = CreateFrame("Frame", nil, self) - shadow:SetFrameLevel(1) - shadow:SetFrameStrata(self:GetFrameStrata()) - shadow:WrapOuter(self, 3, 3) - shadow:SetBackdrop({ - edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], - edgeSize = 3, - insets = { - left = 5, - right = 5, - top = 5, - bottom = 5 - } - }) - shadow:SetBackdropColor(0, 0, 0, 0) - shadow:SetBackdropBorderColor(0, 0, 0, 0.9) - shadow:Hide() - self.TargetGlow = shadow - - tinsert(self.__elements, UpdateTargetGlow) - - self:SetScript("OnEnter", UnitFrame_OnEnter) - self:SetScript("OnLeave", UnitFrame_OnLeave) - self:RegisterEvent("PLAYER_TARGET_CHANGED", UpdateTargetGlow) - self:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateTargetGlow) - - return self -end ---[[ -########################################################## -RAID PETS -########################################################## -]]-- -UpdateTemplates["raidpet"] = function(self) - if(SV.NeedsFrameAudit) then return end - local db = SV.db.SVUnit.raidpet - local groupFrame = self:GetParent() - - if not groupFrame.positioned then - groupFrame:ClearAllPoints() - groupFrame:Point("BOTTOMLEFT", SV.Screen, "BOTTOMLEFT", 4, 433) - RegisterStateDriver(groupFrame, "visibility", "[group:raid] show; hide") - SV.Mentalo:Add(groupFrame, L["Raid Pet Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") - groupFrame.positioned = true; - end - - RaidPetVisibility(groupFrame) - - local index = 1; - local attIndex = ("child%d"):format(index) - local childFrame = self:GetAttribute(attIndex) - if(not childFrame) then return end - local childName = childFrame:GetName() - local petFrame = _G[("%sPet"):format(childName)] - local targetFrame = _G[("%sTarget"):format(childName)] - - while childFrame do - childFrame:UnitUpdate() - - childName = childFrame:GetName() - petFrame = _G[("%sPet"):format(childName)] - targetFrame = _G[("%sTarget"):format(childName)] - - if(petFrame) then - petFrame:UnitUpdate() - end - - if(targetFrame) then - targetFrame:UnitUpdate() - end - - index = index + 1; - attIndex = ("child%d"):format(index) - childFrame = self:GetAttribute(attIndex) - end -end - -BuildTemplates["raidpet"] = function(self, unit) - self.unit = unit - self.___key = "raidpet" - self:SetScript("OnEnter", UnitFrame_OnEnter) - self:SetScript("OnLeave", UnitFrame_OnLeave) - MOD:SetActionPanel(self, "raidpet") - self.Health = MOD:CreateHealthBar(self, true) - self.Debuffs = MOD:CreateDebuffs(self, "raidpet") - self.AuraWatch = MOD:CreateAuraWatch(self, "raidpet") - self.RaidDebuffs = MOD:CreateRaidDebuffs(self) - self.Afflicted = MOD:CreateAfflicted(self) - self.RaidIcon = MOD:CreateRaidIcon(self) - self.Range = { insideAlpha = 1, outsideAlpha = 1 } - - self.Restrict = RestrictElement - self.Allow = AllowElement - self.UnitUpdate = RaidUnitUpdate - - local shadow = CreateFrame("Frame", nil, self) - shadow:SetFrameLevel(1) - shadow:SetFrameStrata(self:GetFrameStrata()) - shadow:WrapOuter(self, 3, 3) - shadow:SetBackdrop({ - edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], - edgeSize = 3, - insets = { - left = 5, - right = 5, - top = 5, - bottom = 5 - } - }) - shadow:SetBackdropColor(0, 0, 0, 0) - shadow:SetBackdropBorderColor(0, 0, 0, 0.9) - shadow:Hide() - self.TargetGlow = shadow - tinsert(self.__elements, UpdateTargetGlow) - - self:RegisterEvent("PLAYER_TARGET_CHANGED", UpdateTargetGlow) - self:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateTargetGlow) - return self -end ---[[ -########################################################## -TANK -########################################################## -]]-- -local TankUnitUpdate = function(self) - local db = SV.db.SVUnit.tank - self.colors = oUF_Villain.colors; - self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") - MOD.RefreshUnitMedia(self, "tank") - if self.isChild and self.originalParent then - local targets = db.targetsGroup; - if not self.originalParent.childList then - self.originalParent.childList = {} - end - self.originalParent.childList[self] = true; - if not InCombatLockdown()then - if targets.enable then - local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(targets) - self:SetParent(self.originalParent) - self:Size(UNIT_WIDTH, UNIT_HEIGHT) - self:ClearAllPoints() - SV:ReversePoint(self, targets.anchorPoint, self.originalParent, targets.xOffset, targets.yOffset) - else - self:SetParent(SV.Cloaked) - end - end - elseif not InCombatLockdown() then - local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db) - self:Size(UNIT_WIDTH, UNIT_HEIGHT) - end - MOD:RefreshUnitLayout(self, "tank") - do - local nametext = self.InfoPanel.Name; - if oUF_Villain.colors.healthclass then - self:Tag(nametext, "[name:10]") - else - self:Tag(nametext, "[name:color][name:10]") - end - end - self:UpdateAllElements() -end - -UpdateTemplates["tank"] = function(self) - if(SV.NeedsFrameAudit) then return end - local db = SV.db.SVUnit.tank - - if db.enable ~= true then - UnregisterAttributeDriver(self, "state-visibility") - self:Hide() - return - end - - self:Hide() - DetachSubFrames(self:GetChildren()) - self:SetAttribute("startingIndex", -1) - RegisterAttributeDriver(self, "state-visibility", "show") - self.dirtyWidth, self.dirtyHeight = self:GetSize() - RegisterAttributeDriver(self, "state-visibility", "[@raid1, exists] show;hide") - self:SetAttribute("startingIndex", 1) - self:SetAttribute("point", "BOTTOM") - self:SetAttribute("columnAnchorPoint", "LEFT") - DetachSubFrames(self:GetChildren()) - self:SetAttribute("yOffset", 7) - - if not self.positioned then - self:ClearAllPoints() - self:Point("TOPLEFT", SV.Screen, "TOPLEFT", 4, -40) - SV.Mentalo:Add(self, L["Tank Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") - self.Avatar.positionOverride = "TOPLEFT" - self:SetAttribute("minHeight", self.dirtyHeight) - self:SetAttribute("minWidth", self.dirtyWidth) - self.positioned = true - end - - local childFrame, childName, petFrame, targetFrame - for i = 1, self:GetNumChildren() do - childFrame = select(i, self:GetChildren()) - childFrame:UnitUpdate() - - childName = childFrame:GetName() - petFrame = _G[("%sPet"):format(childName)] - targetFrame = _G[("%sTarget"):format(childName)] - - if(petFrame) then - petFrame:UnitUpdate() - end - if(targetFrame) then - targetFrame:UnitUpdate() - end - end -end - -BuildTemplates["tank"] = function(self, unit) - local db = SV.db.SVUnit.tank - self.unit = unit - self.___key = "tank" - self:SetScript("OnEnter", UnitFrame_OnEnter) - self:SetScript("OnLeave", UnitFrame_OnLeave) - MOD:SetActionPanel(self, "tank") - self.Health = MOD:CreateHealthBar(self, true) - self.RaidIcon = MOD:CreateRaidIcon(self) - self.RaidIcon:SetPoint("BOTTOMRIGHT") - - self.Restrict = RestrictElement - self.Allow = AllowElement - self.UnitUpdate = TankUnitUpdate - - self.Range = { insideAlpha = 1, outsideAlpha = 1 } - self.originalParent = self:GetParent() - - self:UnitUpdate() - return self -end ---[[ -########################################################## -ASSIST -########################################################## -]]-- -local AssistUnitUpdate = function(self) - local db = SV.db.SVUnit.assist - self.colors = oUF_Villain.colors; - self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") - MOD.RefreshUnitMedia(self, "assist") - if self.isChild and self.originalParent then - local targets = db.targetsGroup; - if not self.originalParent.childList then - self.originalParent.childList = {} - end - self.originalParent.childList[self] = true; - if not InCombatLockdown()then - if targets.enable then - local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(targets) - self:SetParent(self.originalParent) - self:Size(UNIT_WIDTH, UNIT_HEIGHT) - self:ClearAllPoints() - SV:ReversePoint(self, targets.anchorPoint, self.originalParent, targets.xOffset, targets.yOffset) - else - self:SetParent(SV.Cloaked) - end - end - elseif not InCombatLockdown() then - local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db) - self:Size(UNIT_WIDTH, UNIT_HEIGHT) - end - - MOD:RefreshUnitLayout(self, "assist") - - do - local nametext = self.InfoPanel.Name; - if oUF_Villain.colors.healthclass then - self:Tag(nametext, "[name:10]") - else - self:Tag(nametext, "[name:color][name:10]") - end - end - self:UpdateAllElements() -end - -UpdateTemplates["assist"] = function(self) - if(SV.NeedsFrameAudit) then return end - local db = SV.db.SVUnit.assist - - self:Hide() - DetachSubFrames(self:GetChildren()) - self:SetAttribute("startingIndex", -1) - RegisterAttributeDriver(self, "state-visibility", "show") - self.dirtyWidth, self.dirtyHeight = self:GetSize() - RegisterAttributeDriver(self, "state-visibility", "[@raid1, exists] show;hide") - self:SetAttribute("startingIndex", 1) - self:SetAttribute("point", "BOTTOM") - self:SetAttribute("columnAnchorPoint", "LEFT") - DetachSubFrames(self:GetChildren()) - self:SetAttribute("yOffset", 7) - - if not self.positioned then - self:ClearAllPoints() - self:Point("TOPLEFT", SV.Screen, "TOPLEFT", 4, -140) - SV.Mentalo:Add(self, L["Assist Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") - self.Avatar.positionOverride = "TOPLEFT" - self:SetAttribute("minHeight", self.dirtyHeight) - self:SetAttribute("minWidth", self.dirtyWidth) - self.positioned = true - end - - local childFrame, childName, petFrame, targetFrame - for i = 1, self:GetNumChildren() do - childFrame = select(i, self:GetChildren()) - childFrame:UnitUpdate() - - childName = childFrame:GetName() - petFrame = _G[("%sPet"):format(childName)] - targetFrame = _G[("%sTarget"):format(childName)] - - if(petFrame) then - petFrame:UnitUpdate() - end - if(targetFrame) then - targetFrame:UnitUpdate() - end - end -end - -BuildTemplates["assist"] = function(self, unit) - local db = SV.db.SVUnit.assist - self.unit = unit - self.___key = "assist" - self:SetScript("OnEnter", UnitFrame_OnEnter) - self:SetScript("OnLeave", UnitFrame_OnLeave) - MOD:SetActionPanel(self, "assist") - self.Health = MOD:CreateHealthBar(self, true) - self.RaidIcon = MOD:CreateRaidIcon(self) - self.RaidIcon:SetPoint("BOTTOMRIGHT") - self.Range = { insideAlpha = 1, outsideAlpha = 1 } - - self.Restrict = RestrictElement - self.Allow = AllowElement - self.UnitUpdate = AssistUnitUpdate - - self.originalParent = self:GetParent() - - self:UnitUpdate() - return self -end ---[[ -########################################################## -HEADER CONSTRUCTS -########################################################## -]]-- -local HeaderMediaUpdate = function(self) - local token = self.___groupkey - local index = 1; - local attIndex = ("child%d"):format(index) - local childFrame = self:GetAttribute(attIndex) - local childName = childFrame:GetName() - local petFrame = _G[("%sPet"):format(childName)] - local targetFrame = _G[("%sTarget"):format(childName)] - - while childFrame do - MOD.RefreshUnitMedia(childFrame, token) - - if(petFrame) then - MOD.RefreshUnitMedia(petFrame, token) - end - - if(targetFrame) then - MOD.RefreshUnitMedia(targetFrame, token) - end - - index = index + 1; - attIndex = ("child%d"):format(index) - childFrame = self:GetAttribute(attIndex) - childName = childFrame:GetName() - petFrame = _G[("%sPet"):format(childName)] - targetFrame = _G[("%sTarget"):format(childName)] - end -end - -local HeaderUnsetAttributes = function(self) - self:Hide() - self:SetAttribute("showPlayer", true) - self:SetAttribute("showSolo", true) - self:SetAttribute("showParty", true) - self:SetAttribute("showRaid", true) - self:SetAttribute("columnSpacing", nil) - self:SetAttribute("columnAnchorPoint", nil) - self:SetAttribute("sortMethod", nil) - self:SetAttribute("groupFilter", nil) - self:SetAttribute("groupingOrder", nil) - self:SetAttribute("maxColumns", nil) - self:SetAttribute("nameList", nil) - self:SetAttribute("point", nil) - self:SetAttribute("sortDir", nil) - self:SetAttribute("sortMethod", "NAME") - self:SetAttribute("startingIndex", nil) - self:SetAttribute("strictFiltering", nil) - self:SetAttribute("unitsPerColumn", nil) - self:SetAttribute("xOffset", nil) - self:SetAttribute("yOffset", nil) -end - -local HeaderEnableChildren = function(self) - self.isForced = true; - for i=1, select("#", self:GetChildren()) do - local childFrame = select(i, self:GetChildren()) - childFrame:RegisterForClicks(nil) - childFrame:SetID(i) - childFrame.TargetGlow:SetAlpha(0) - childFrame:Allow() - end -end - -local HeaderDisableChildren = function(self) - self.isForced = nil; - for i=1,select("#", self:GetChildren()) do - local childFrame = select(i, self:GetChildren()) - childFrame:RegisterForClicks(SV.db.SVUnit.fastClickTarget and 'AnyDown' or 'AnyUp') - childFrame.TargetGlow:SetAlpha(1) - childFrame:Restrict() - end -end - -function MOD:SetGroupHeader(parentFrame, filter, layout, headerName, token) - local db = SV.db.SVUnit[token] - - local template1, template2 - if(token == "raidpet") then - template1 = "SVUI_UNITPET" - template2 = "SecureGroupPetHeaderTemplate" - elseif(token == "tank") then - filter = "MAINTANK" - template1 = "SVUI_UNITTARGET" - elseif(token == "assist") then - filter = "MAINASSIST" - template1 = "SVUI_UNITTARGET" - end - - local UNIT_WIDTH, UNIT_HEIGHT = self:GetActiveSize(db) - local groupHeader = oUF_Villain:SpawnHeader(headerName, template2, nil, - "oUF-initialConfigFunction", ("self:SetWidth(%d); self:SetHeight(%d); self:SetFrameLevel(5)"):format(UNIT_WIDTH, UNIT_HEIGHT), - "groupFilter", filter, - "showParty", true, - "showRaid", true, - "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 - - return groupHeader -end ---[[ -########################################################## -GROUP CONSTRUCTS -########################################################## -]]-- -local GroupUpdate = function(self) - local token = self.___groupkey - if SV.db.SVUnit[token].enable ~= true then - UnregisterAttributeDriver(self, "state-visibility") - self:Hide() - return - end - for i=1,#self.groups do - self.groups[i]:Update() - end -end - -local GroupMediaUpdate = function(self) - for i=1,#self.groups do - self.groups[i]:MediaUpdate() - end -end - -local GroupSetVisibility = function(self) - if not self.isForced then - local token = self.___groupkey - local db = SV.db.SVUnit[token] - if(db) then - for i=1,#self.groups do - local frame = self.groups[i] - if(i <= db.groupCount) then - frame:Show() - else - if frame.forceShow then - frame:Hide() - frame:DisableChildren() - frame:SetAttribute('startingIndex',1) - else - frame:UnsetAttributes() - end - end - end - end - end -end - -local GroupConfigure = function(self) - local token = self.___groupkey - 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 - - self.groupCount = groupCount - - for i = 1, groupCount do - - local frame = self.groups[i] - - if(frame) then - if(settings.showBy == "UP") then - settings.showBy = "UP_RIGHT" - end - - if(settings.showBy == "DOWN") then - settings.showBy = "DOWN_RIGHT" - end - - if(isHorizontal) then - frame:SetAttribute("xOffset", settings.wrapXOffset * horizontal) - frame:SetAttribute("yOffset", 0) - frame:SetAttribute("columnSpacing", settings.wrapYOffset) - else - frame:SetAttribute("xOffset", 0) - frame:SetAttribute("yOffset", settings.wrapYOffset * vertical) - frame:SetAttribute("columnSpacing", settings.wrapXOffset) - end - - if(not frame.isForced) then - if not frame.initialized then - frame:SetAttribute("startingIndex", -4) - frame:Show() - frame.initialized = true - end - frame:SetAttribute("startingIndex", 1) - end - - frame:ClearAllPoints() - frame:SetAttribute("columnAnchorPoint", columnAnchor) - - DetachSubFrames(frame:GetChildren()) - - frame:SetAttribute("point", point) - - if(not frame.isForced) then - frame:SetAttribute("maxColumns", 1) - frame:SetAttribute("unitsPerColumn", 5) - GroupDistributor[sortMethod](frame) - frame:SetAttribute("sortDir", settings.sortDir) - frame:SetAttribute("showPlayer", settings.showPlayer) - 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) - end - - heightCalc = heightCalc + UNIT_HEIGHT + settings.wrapYOffset; - yCalc = yCalc + 1 - else - if(frame) then frame:SetPoint(anchorPoint, self, anchorPoint, widthCalc * horizontal, 0) 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(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 - end - - self:SetSize(widthCalc - settings.wrapXOffset, heightCalc - settings.wrapYOffset) -end - -function MOD:GetGroupFrame(token, layout) - if(not self.Headers[token]) then - oUF_Villain:RegisterStyle(layout, BuildTemplates[token]) - oUF_Villain:SetActiveStyle(layout) - local groupFrame = CreateFrame("Frame", layout, SVUI_UnitFrameParent, "SecureHandlerStateTemplate") - groupFrame.___groupkey = token; - groupFrame.groups = {} - groupFrame.Update = GroupUpdate - groupFrame.MediaUpdate = GroupMediaUpdate - groupFrame.SetVisibility = GroupSetVisibility - groupFrame.Configure = GroupConfigure - - groupFrame:Show() - self.Headers[token] = groupFrame - end - return self.Headers[token] -end - -function MOD:SetCustomFrame(token, layout) - if(not self.Headers[token]) then - oUF_Villain:RegisterStyle(layout, BuildTemplates[token]) - oUF_Villain:SetActiveStyle(layout) - local groupFrame = self:SetGroupHeader(SVUI_UnitFrameParent, nil, layout, layout, token) - self.Headers[token] = groupFrame - end - self.Headers[token]:Show() - self.Headers[token]:Update() -end - -function MOD:SetGroupFrame(token, forceUpdate) - if(InCombatLockdown()) then self:RegisterEvent("PLAYER_REGEN_ENABLED"); return end - if(not SV.db.SVUnit.enable) then return end - local settings = SV.db.SVUnit[token] - local realName = token:gsub("(.)", upper, 1) - local layout = "SVUI_"..realName - - if(token == "tank" or token == "assist") then - return self:SetCustomFrame(token, layout) - end - - local groupFrame = self:GetGroupFrame(token, layout) - - if(token ~= "raidpet" and settings.enable ~= true) then - UnregisterStateDriver(groupFrame, "visibility") - groupFrame:Hide() - return - end - - local groupName - for i = 1, settings.groupCount do - if(not groupFrame.groups[i]) then - groupName = layout .. "Group" .. i - groupFrame.groups[i] = self:SetGroupHeader(groupFrame, i, layout, groupName, token) - groupFrame.groups[i]:Show() - end - end - - groupFrame:SetVisibility() - - if(forceUpdate or not groupFrame.Avatar) then - groupFrame:Configure() - if(not groupFrame.isForced and settings.visibility) then - RegisterStateDriver(groupFrame, "visibility", settings.visibility) - end - else - groupFrame:Configure() - groupFrame:Update() - end - - if(token == "raidpet" and settings.enable ~= true) then - UnregisterStateDriver(groupFrame, "visibility") - groupFrame:Hide() - return - end -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/groups.lua b/Interface/AddOns/SVUI/packages/unit/groups.lua index ea80e91..b89cf6c 100644 --- a/Interface/AddOns/SVUI/packages/unit/groups.lua +++ b/Interface/AddOns/SVUI/packages/unit/groups.lua @@ -126,18 +126,6 @@ local GroupDistributor = { FRAME HELPERS ########################################################## ]]-- -local function RaidLayoutEnabled(token) - local maxPlayers = select(5, GetInstanceInfo()) - if(token == "raid10" and (maxPlayers == 10)) then - return true; - elseif(token == "raid25" and ((maxPlayers > 10) and (maxPlayers < 40))) then - return true; - elseif(token == "raid40" and (maxPlayers > 25)) then - return true; - end - return false; -end - local DetachSubFrames = function(...) for i = 1, select("#", ...) do local frame = select(i,...) @@ -228,81 +216,11 @@ end PARTY FRAMES ########################################################## ]]-- -local PartyVisibility = function(self, event) - local db = SV.db.SVUnit.party - if(not SV.db.SVUnit or (not SV.db.SVUnit.party)) then return end - if ((not SV.db.SVUnit.party.enable) or self.isForced) then return end - - if(event == "PLAYER_REGEN_ENABLED") then - self:UnregisterEvent("PLAYER_REGEN_ENABLED") - end - - if(not InCombatLockdown()) then - local instance, instanceType = IsInInstance() - if(instance and instanceType == "raid") then - UnregisterStateDriver(self,"visibility") - self:Hide() - else - RegisterStateDriver(self, "visibility", "[group:raid][nogroup] hide;show") - end - else - self:RegisterEvent("PLAYER_REGEN_ENABLED") - end -end - -UpdateTemplates["party"] = function(self) - if(SV.NeedsFrameAudit) then return end - local token = self.___groupkey - local db = SV.db.SVUnit[token] - local groupFrame = self:GetParent() - - if not groupFrame.positioned then - groupFrame:ClearAllPoints() - groupFrame:Point("LEFT",SV.Screen,"LEFT",40,0) - SV.Mentalo:Add(groupFrame, L['Party Frames'], nil, nil, nil, 'ALL,PARTY,ARENA'); - groupFrame:RegisterEvent("PLAYER_ENTERING_WORLD") - groupFrame:RegisterEvent("ZONE_CHANGED_NEW_AREA") - groupFrame:SetScript("OnEvent", PartyVisibility) - groupFrame.positioned = true; - end - - PartyVisibility(groupFrame) - - local index = 1; - local attIndex = ("child%d"):format(index) - local childFrame = self:GetAttribute(attIndex) - if(not childFrame) then return end - local childName = childFrame:GetName() - local petFrame = _G[("%sPet"):format(childName)] - local targetFrame = _G[("%sTarget"):format(childName)] - - while childFrame do - childFrame:UnitUpdate() - - childName = childFrame:GetName() - petFrame = _G[("%sPet"):format(childName)] - targetFrame = _G[("%sTarget"):format(childName)] - - if(petFrame) then - petFrame:UnitUpdate() - end - - if(targetFrame) then - targetFrame:UnitUpdate() - end - - index = index + 1; - attIndex = ("child%d"):format(index) - childFrame = self:GetAttribute(attIndex) - end -end - local PartyUnitUpdate = function(self) - local token = self.___key - local db = SV.db.SVUnit["party"] + local db = SV.db.SVUnit.party self.colors = oUF_Villain.colors; self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and 'AnyDown' or 'AnyUp') - MOD.RefreshUnitMedia(self, token) + MOD.RefreshUnitMedia(self, "party") if self.isChild then local altDB = db.petsGroup; if self == _G[self.originalParent:GetName()..'Target'] then @@ -318,9 +236,9 @@ local PartyUnitUpdate = function(self) self:SetParent(self.originalParent) self:Size(UNIT_WIDTH, UNIT_HEIGHT) self:ClearAllPoints() - SV:ReversePoint(self, altDB.anchorPoint, self.originalParent, altDB.xOffset, altDB.yOffset) + SV:SetReversePoint(self, altDB.anchorPoint, self.originalParent, altDB.xOffset, altDB.yOffset) else - self:SetParent(SV.Cloaked) + self:SetParent(SV.Hidden) end end do @@ -344,21 +262,59 @@ local PartyUnitUpdate = function(self) local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db, "party") self:Size(UNIT_WIDTH, UNIT_HEIGHT) end - MOD:RefreshUnitLayout(self, token) - MOD:UpdateAuraWatch(self, token) + MOD:RefreshUnitLayout(self, "party") + MOD:UpdateAuraWatch(self, "party") end self:EnableElement('ReadyCheck') self:UpdateAllElements() end +UpdateTemplates["party"] = function(self) + if(SV.NeedsFrameAudit) then return end + local db = SV.db.SVUnit.party + 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][nogroup] hide;show") + SV.Mentalo:Add(groupFrame, L['Party Frames'], nil, nil, nil, 'ALL,PARTY,ARENA'); + groupFrame.positioned = true; + end + + local index = 1; + local attIndex = ("child%d"):format(index) + local childFrame = self:GetAttribute(attIndex) + local childName, petFrame, targetFrame; + + while childFrame do + childFrame:UnitUpdate() + + childName = childFrame:GetName() + petFrame = _G[("%sPet"):format(childName)] + targetFrame = _G[("%sTarget"):format(childName)] + + if(petFrame) then + petFrame:UnitUpdate() + end + + if(targetFrame) then + targetFrame:UnitUpdate() + end + + index = index + 1; + attIndex = ("child%d"):format(index) + childFrame = self:GetAttribute(attIndex) + end +end + BuildTemplates["party"] = function(self, unit) - local token = "party" self.unit = unit - self.___key = token + self.___key = "party" self:SetScript("OnEnter", UnitFrame_OnEnter) self:SetScript("OnLeave", UnitFrame_OnLeave) - MOD:SetActionPanel(self, token) + MOD:SetActionPanel(self, "party") self.Health = MOD:CreateHealthBar(self, true) if self.isChild then @@ -367,9 +323,9 @@ BuildTemplates["party"] = function(self, unit) self.Power = MOD:CreatePowerBar(self, true) self.Power.frequentUpdates = false MOD:CreatePortrait(self, true) - self.Buffs = MOD:CreateBuffs(self, token) - self.Debuffs = MOD:CreateDebuffs(self, token) - self.AuraWatch = MOD:CreateAuraWatch(self, token) + self.Buffs = MOD:CreateBuffs(self, "party") + self.Debuffs = MOD:CreateDebuffs(self, "party") + self.AuraWatch = MOD:CreateAuraWatch(self, "party") self.Afflicted = MOD:CreateAfflicted(self) self.ResurrectIcon = MOD:CreateResurectionIcon(self) self.LFDRole = MOD:CreateRoleIcon(self) @@ -377,6 +333,7 @@ BuildTemplates["party"] = function(self, unit) self.RaidIcon = MOD:CreateRaidIcon(self) self.ReadyCheck = MOD:CreateReadyCheckIcon(self) self.HealPrediction = MOD:CreateHealPrediction(self) + --self.GPS = MOD:CreateGPS(self, true) local shadow = CreateFrame("Frame", nil, self) shadow:SetFrameLevel(1) @@ -397,7 +354,6 @@ BuildTemplates["party"] = function(self, unit) shadow:Hide() self.TargetGlow = shadow tinsert(self.__elements, UpdateTargetGlow) - self:RegisterEvent("PLAYER_TARGET_CHANGED", UpdateTargetGlow) self:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateTargetGlow) self:RegisterEvent("GROUP_ROSTER_UPDATE", UpdateTargetGlow) @@ -416,136 +372,6 @@ end RAID FRAMES ########################################################## ]]-- -local RaidVisibility = { - ["raid10"] = function(self, event) - local db = SV.db.SVUnit.raid10 - if(not db or (not db.enable) or self.isForced) then return end - - if(event and event == "PLAYER_REGEN_ENABLED") then - self:UnregisterEvent("PLAYER_REGEN_ENABLED") - end - - if not InCombatLockdown() then - local instance, instanceType = IsInInstance() - if(instance and (instanceType == "raid")) then - UnregisterStateDriver(self, "visibility") - local maxPlayers = select(5, GetInstanceInfo()) - if(maxPlayers == 10) then - self:Show() - else - self:Hide() - end - else - RegisterStateDriver(self, "visibility", "[@raid1, noexists][@raid11, exists][nogroup] hide;show") - end - else - self:RegisterEvent("PLAYER_REGEN_ENABLED") - return - end - end, - ["raid25"] = function(self, event) - local db = SV.db.SVUnit.raid25 - if(not db or (not db.enable) or self.isForced) then return end - - if(event and event == "PLAYER_REGEN_ENABLED") then - self:UnregisterEvent("PLAYER_REGEN_ENABLED") - end - - if not InCombatLockdown() then - local instance, instanceType = IsInInstance() - if(instance and (instanceType == "raid")) then - UnregisterStateDriver(self, "visibility") - local maxPlayers = select(5, GetInstanceInfo()) - if((maxPlayers > 10) and (maxPlayers < 26)) then - self:Show() - else - self:Hide() - end - else - RegisterStateDriver(self, "visibility", "[@raid11, noexists][@raid26, exists][nogroup] hide;show") - end - else - self:RegisterEvent("PLAYER_REGEN_ENABLED") - return - end - end, - ["raid40"] = function(self, event) - local db = SV.db.SVUnit.raid40 - if(not db or (not db.enable) or self.isForced) then return end - - if(event and event == "PLAYER_REGEN_ENABLED") then - self:UnregisterEvent("PLAYER_REGEN_ENABLED") - end - - if not InCombatLockdown() then - local instance, instanceType = IsInInstance() - if(instance and (instanceType == "raid")) then - UnregisterStateDriver(self, "visibility") - local maxPlayers = select(5, GetInstanceInfo()) - if(maxPlayers > 25) then - self:Show() - else - self:Hide() - end - else - RegisterStateDriver(self, "visibility", "[@raid26, noexists][nogroup] hide;show") - end - else - self:RegisterEvent("PLAYER_REGEN_ENABLED") - return - end - end, -} - -local RaidUpdatePrototype = function(token) - return function(self) - if(SV.NeedsFrameAudit) then return end - local db = SV.db.SVUnit[token] - local groupFrame = self:GetParent() - - if not groupFrame.positioned then - local moverName = (token .. " Frames"):gsub("(.)", upper, 1) - groupFrame:ClearAllPoints() - groupFrame:Point("LEFT", SV.Screen, "LEFT", 4, 0) - SV.Mentalo:Add(groupFrame, moverName) - groupFrame:RegisterEvent("PLAYER_ENTERING_WORLD") - groupFrame:RegisterEvent("ZONE_CHANGED_NEW_AREA") - groupFrame:SetScript("OnEvent", RaidVisibility[token]) - groupFrame.positioned = true - end - - RaidVisibility[token](groupFrame) - - local index = 1; - local attIndex = ("child%d"):format(index) - local childFrame = self:GetAttribute(attIndex) - if(not childFrame) then return end - local childName = childFrame:GetName() - local petFrame = _G[("%sPet"):format(childName)] - local targetFrame = _G[("%sTarget"):format(childName)] - - while childFrame do - childFrame:UnitUpdate() - - childName = childFrame:GetName() - petFrame = _G[("%sPet"):format(childName)] - targetFrame = _G[("%sTarget"):format(childName)] - - if(petFrame) then - petFrame:UnitUpdate() - end - - if(targetFrame) then - targetFrame:UnitUpdate() - end - - index = index + 1; - attIndex = ("child%d"):format(index) - childFrame = self:GetAttribute(attIndex) - end - end -end - local RaidUnitUpdate = function(self) local token = self.___key local db = SV.db.SVUnit[token] @@ -583,106 +409,113 @@ local RaidUnitUpdate = function(self) self:UpdateAllElements() end -local RaidBuildPrototype = function(token) - return function(self, unit) - self.unit = unit - self.___key = token - MOD:SetActionPanel(self, token) - self.Health = MOD:CreateHealthBar(self, true) - self.Health.frequentUpdates = false - self.Power = MOD:CreatePowerBar(self, true) - self.Power.frequentUpdates = false - self.Buffs = MOD:CreateBuffs(self, token) - self.Debuffs = MOD:CreateDebuffs(self, token) - self.AuraWatch = MOD:CreateAuraWatch(self, token) - self.RaidDebuffs = MOD:CreateRaidDebuffs(self) - self.Afflicted = MOD:CreateAfflicted(self) - self.ResurrectIcon = MOD:CreateResurectionIcon(self) - self.LFDRole = MOD:CreateRoleIcon(self) - self.RaidRoleFramesAnchor = MOD:CreateRaidRoleFrames(self) - self.RaidIcon = MOD:CreateRaidIcon(self) - self.ReadyCheck = MOD:CreateReadyCheckIcon(self) - self.HealPrediction = MOD:CreateHealPrediction(self) - self.Range = { insideAlpha = 1, outsideAlpha = 1 } +UpdateTemplates["raid"] = function(self) + if(SV.NeedsFrameAudit) then return end + local db = SV.db.SVUnit.raid + local groupFrame = self:GetParent() - self.Restrict = RestrictElement - self.Allow = AllowElement - self.UnitUpdate = RaidUnitUpdate + if not groupFrame.positioned then + groupFrame:ClearAllPoints() + groupFrame:Point("BOTTOMLEFT", SV.Dock.BottomLeft, "TOPLEFT", 0, 80) + RegisterStateDriver(groupFrame, "visibility", "[group:raid] show; hide") + SV.Mentalo:Add(groupFrame, "Raid Frames") + groupFrame.positioned = true + end - local shadow = CreateFrame("Frame", nil, self) - shadow:SetFrameLevel(1) - shadow:SetFrameStrata(self:GetFrameStrata()) - shadow:WrapOuter(self, 3, 3) - shadow:SetBackdrop({ - edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], - edgeSize = 3, - insets = { - left = 5, - right = 5, - top = 5, - bottom = 5 - } - }) - shadow:SetBackdropColor(0, 0, 0, 0) - shadow:SetBackdropBorderColor(0, 0, 0, 0.9) - shadow:Hide() - self.TargetGlow = shadow + local index = 1; + local attIndex = ("child%d"):format(index) + local childFrame = self:GetAttribute(attIndex) + local childName, petFrame, targetFrame; - tinsert(self.__elements, UpdateTargetGlow) + while childFrame do + childFrame:UnitUpdate() - self:SetScript("OnEnter", UnitFrame_OnEnter) - self:SetScript("OnLeave", UnitFrame_OnLeave) - self:RegisterEvent("PLAYER_TARGET_CHANGED", UpdateTargetGlow) - self:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateTargetGlow) + childName = childFrame:GetName() + petFrame = _G[("%sPet"):format(childName)] + targetFrame = _G[("%sTarget"):format(childName)] + + if(petFrame) then + petFrame:UnitUpdate() + end + + if(targetFrame) then + targetFrame:UnitUpdate() + end - return self + index = index + 1; + attIndex = ("child%d"):format(index) + childFrame = self:GetAttribute(attIndex) end end -UpdateTemplates["raid10"] = RaidUpdatePrototype("raid10") -UpdateTemplates["raid25"] = RaidUpdatePrototype("raid25") -UpdateTemplates["raid40"] = RaidUpdatePrototype("raid40") +BuildTemplates["raid"] = function(self, unit) + self.unit = unit + self.___key = "raid" + MOD:SetActionPanel(self, "raid") + self.Health = MOD:CreateHealthBar(self, true) + self.Health.frequentUpdates = false + self.Power = MOD:CreatePowerBar(self, true) + self.Power.frequentUpdates = false + self.Buffs = MOD:CreateBuffs(self, "raid") + self.Debuffs = MOD:CreateDebuffs(self, "raid") + self.AuraWatch = MOD:CreateAuraWatch(self, "raid") + self.RaidDebuffs = MOD:CreateRaidDebuffs(self) + self.Afflicted = MOD:CreateAfflicted(self) + self.ResurrectIcon = MOD:CreateResurectionIcon(self) + self.LFDRole = MOD:CreateRoleIcon(self) + self.RaidRoleFramesAnchor = MOD:CreateRaidRoleFrames(self) + self.RaidIcon = MOD:CreateRaidIcon(self) + self.ReadyCheck = MOD:CreateReadyCheckIcon(self) + self.HealPrediction = MOD:CreateHealPrediction(self) + self.Range = { insideAlpha = 1, outsideAlpha = 1 } + + self.Restrict = RestrictElement + self.Allow = AllowElement + self.UnitUpdate = RaidUnitUpdate + + local shadow = CreateFrame("Frame", nil, self) + shadow:SetFrameLevel(1) + shadow:SetFrameStrata(self:GetFrameStrata()) + shadow:WrapOuter(self, 3, 3) + shadow:SetBackdrop({ + edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], + edgeSize = 3, + insets = { + left = 5, + right = 5, + top = 5, + bottom = 5 + } + }) + shadow:SetBackdropColor(0, 0, 0, 0) + shadow:SetBackdropBorderColor(0, 0, 0, 0.9) + shadow:Hide() + self.TargetGlow = shadow + + tinsert(self.__elements, UpdateTargetGlow) + + self:SetScript("OnEnter", UnitFrame_OnEnter) + self:SetScript("OnLeave", UnitFrame_OnLeave) + self:RegisterEvent("PLAYER_TARGET_CHANGED", UpdateTargetGlow) + self:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateTargetGlow) -BuildTemplates["raid10"] = RaidBuildPrototype("raid10") -BuildTemplates["raid25"] = RaidBuildPrototype("raid25") -BuildTemplates["raid40"] = RaidBuildPrototype("raid40") + return self +end --[[ ########################################################## RAID PETS ########################################################## ]]-- -local RaidPetVisibility = function(self, event) - local db = SV.db.SVUnit["raidpet"] - if (not db or (db and not db.enable) or self.isForced) then return end - local inInstance, instanceType = IsInInstance() - if event == "PLAYER_REGEN_ENABLED" then self:UnregisterEvent("PLAYER_REGEN_ENABLED") end - - if not InCombatLockdown() then - if inInstance and instanceType == "raid" then - UnregisterStateDriver(self, "visibility") - self:Show() - else - RegisterStateDriver(self, "visibility", "[group:raid] show; hide") - end - else - self:RegisterEvent("PLAYER_REGEN_ENABLED") - return - end -end - UpdateTemplates["raidpet"] = function(self) if(SV.NeedsFrameAudit) then return end - local token = self.___key - local db = SV.db.SVUnit[token] + local db = SV.db.SVUnit.raidpet local groupFrame = self:GetParent() if not groupFrame.positioned then groupFrame:ClearAllPoints() groupFrame:Point("BOTTOMLEFT", SV.Screen, "BOTTOMLEFT", 4, 433) + RegisterStateDriver(groupFrame, "visibility", "[group:raid] show; hide") SV.Mentalo:Add(groupFrame, L["Raid Pet Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") - groupFrame:RegisterEvent("PLAYER_ENTERING_WORLD") - groupFrame:RegisterEvent("ZONE_CHANGED_NEW_AREA") - groupFrame:SetScript("OnEvent", RaidPetVisibility) groupFrame.positioned = true; end @@ -691,10 +524,7 @@ UpdateTemplates["raidpet"] = function(self) local index = 1; local attIndex = ("child%d"):format(index) local childFrame = self:GetAttribute(attIndex) - if(not childFrame) then return end - local childName = childFrame:GetName() - local petFrame = _G[("%sPet"):format(childName)] - local targetFrame = _G[("%sTarget"):format(childName)] + local childName, petFrame, targetFrame; while childFrame do childFrame:UnitUpdate() @@ -718,15 +548,14 @@ UpdateTemplates["raidpet"] = function(self) end BuildTemplates["raidpet"] = function(self, unit) - local key = "raidpet" self.unit = unit - self.___key = key + self.___key = "raidpet" self:SetScript("OnEnter", UnitFrame_OnEnter) self:SetScript("OnLeave", UnitFrame_OnLeave) - MOD:SetActionPanel(self, key) + MOD:SetActionPanel(self, "raidpet") self.Health = MOD:CreateHealthBar(self, true) - self.Debuffs = MOD:CreateDebuffs(self, key) - self.AuraWatch = MOD:CreateAuraWatch(self, key) + self.Debuffs = MOD:CreateDebuffs(self, "raidpet") + self.AuraWatch = MOD:CreateAuraWatch(self, "raidpet") self.RaidDebuffs = MOD:CreateRaidDebuffs(self) self.Afflicted = MOD:CreateAfflicted(self) self.RaidIcon = MOD:CreateRaidIcon(self) @@ -766,11 +595,10 @@ TANK ########################################################## ]]-- local TankUnitUpdate = function(self) - local token = "tank" - local db = SV.db.SVUnit[token] + local db = SV.db.SVUnit.tank self.colors = oUF_Villain.colors; self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") - MOD.RefreshUnitMedia(self, token) + MOD.RefreshUnitMedia(self, "tank") if self.isChild and self.originalParent then local targets = db.targetsGroup; if not self.originalParent.childList then @@ -783,16 +611,16 @@ local TankUnitUpdate = function(self) self:SetParent(self.originalParent) self:Size(UNIT_WIDTH, UNIT_HEIGHT) self:ClearAllPoints() - SV:ReversePoint(self, targets.anchorPoint, self.originalParent, targets.xOffset, targets.yOffset) + SV:SetReversePoint(self, targets.anchorPoint, self.originalParent, targets.xOffset, targets.yOffset) else - self:SetParent(SV.Cloaked) + self:SetParent(SV.Hidden) end end elseif not InCombatLockdown() then local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db) self:Size(UNIT_WIDTH, UNIT_HEIGHT) end - MOD:RefreshUnitLayout(self, token) + MOD:RefreshUnitLayout(self, "tank") do local nametext = self.InfoPanel.Name; if oUF_Villain.colors.healthclass then @@ -806,8 +634,7 @@ end UpdateTemplates["tank"] = function(self) if(SV.NeedsFrameAudit) then return end - local token = "tank" - local db = SV.db.SVUnit[token] + local db = SV.db.SVUnit.tank if db.enable ~= true then UnregisterAttributeDriver(self, "state-visibility") @@ -829,7 +656,7 @@ UpdateTemplates["tank"] = function(self) if not self.positioned then self:ClearAllPoints() - self:Point("TOPLEFT", SV.Screen, "TOPLEFT", 4, -40) + self:Point("BOTTOMLEFT", SV.Dock.TopLeft, "BOTTOMLEFT", 0, 0) SV.Mentalo:Add(self, L["Tank Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") self.Avatar.positionOverride = "TOPLEFT" self:SetAttribute("minHeight", self.dirtyHeight) @@ -856,13 +683,12 @@ UpdateTemplates["tank"] = function(self) end BuildTemplates["tank"] = function(self, unit) - local key = "tank" - local db = SV.db.SVUnit[key] + local db = SV.db.SVUnit.tank self.unit = unit - self.___key = key + self.___key = "tank" self:SetScript("OnEnter", UnitFrame_OnEnter) self:SetScript("OnLeave", UnitFrame_OnLeave) - MOD:SetActionPanel(self, key) + MOD:SetActionPanel(self, "tank") self.Health = MOD:CreateHealthBar(self, true) self.RaidIcon = MOD:CreateRaidIcon(self) self.RaidIcon:SetPoint("BOTTOMRIGHT") @@ -883,11 +709,10 @@ ASSIST ########################################################## ]]-- local AssistUnitUpdate = function(self) - local token = "assist" - local db = SV.db.SVUnit[token] + local db = SV.db.SVUnit.assist self.colors = oUF_Villain.colors; self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") - MOD.RefreshUnitMedia(self, token) + MOD.RefreshUnitMedia(self, "assist") if self.isChild and self.originalParent then local targets = db.targetsGroup; if not self.originalParent.childList then @@ -900,9 +725,9 @@ local AssistUnitUpdate = function(self) self:SetParent(self.originalParent) self:Size(UNIT_WIDTH, UNIT_HEIGHT) self:ClearAllPoints() - SV:ReversePoint(self, targets.anchorPoint, self.originalParent, targets.xOffset, targets.yOffset) + SV:SetReversePoint(self, targets.anchorPoint, self.originalParent, targets.xOffset, targets.yOffset) else - self:SetParent(SV.Cloaked) + self:SetParent(SV.Hidden) end end elseif not InCombatLockdown() then @@ -910,7 +735,7 @@ local AssistUnitUpdate = function(self) self:Size(UNIT_WIDTH, UNIT_HEIGHT) end - MOD:RefreshUnitLayout(self, token) + MOD:RefreshUnitLayout(self, "assist") do local nametext = self.InfoPanel.Name; @@ -925,8 +750,7 @@ end UpdateTemplates["assist"] = function(self) if(SV.NeedsFrameAudit) then return end - local token = "assist" - local db = SV.db.SVUnit[token] + local db = SV.db.SVUnit.assist self:Hide() DetachSubFrames(self:GetChildren()) @@ -942,7 +766,7 @@ UpdateTemplates["assist"] = function(self) if not self.positioned then self:ClearAllPoints() - self:Point("TOPLEFT", SV.Screen, "TOPLEFT", 4, -140) + self:Point("TOPLEFT", SV.Dock.TopLeft, "BOTTOMLEFT", 0, -10) SV.Mentalo:Add(self, L["Assist Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") self.Avatar.positionOverride = "TOPLEFT" self:SetAttribute("minHeight", self.dirtyHeight) @@ -969,13 +793,12 @@ UpdateTemplates["assist"] = function(self) end BuildTemplates["assist"] = function(self, unit) - local key = "assist" - local db = SV.db.SVUnit[key] + local db = SV.db.SVUnit.assist self.unit = unit - self.___key = key + self.___key = "assist" self:SetScript("OnEnter", UnitFrame_OnEnter) self:SetScript("OnLeave", UnitFrame_OnLeave) - MOD:SetActionPanel(self, key) + MOD:SetActionPanel(self, "assist") self.Health = MOD:CreateHealthBar(self, true) self.RaidIcon = MOD:CreateRaidIcon(self) self.RaidIcon:SetPoint("BOTTOMRIGHT") @@ -1000,13 +823,15 @@ local HeaderMediaUpdate = function(self) local index = 1; local attIndex = ("child%d"):format(index) local childFrame = self:GetAttribute(attIndex) - local childName = childFrame:GetName() - local petFrame = _G[("%sPet"):format(childName)] - local targetFrame = _G[("%sTarget"):format(childName)] + local childName, petFrame, targetFrame; - while childFrame do + while childFrame do MOD.RefreshUnitMedia(childFrame, token) + childName = childFrame:GetName() + petFrame = _G[("%sPet"):format(childName)] + targetFrame = _G[("%sTarget"):format(childName)] + if(petFrame) then MOD.RefreshUnitMedia(petFrame, token) end @@ -1018,11 +843,9 @@ local HeaderMediaUpdate = function(self) index = index + 1; attIndex = ("child%d"):format(index) childFrame = self:GetAttribute(attIndex) - childName = childFrame:GetName() - petFrame = _G[("%sPet"):format(childName)] - targetFrame = _G[("%sTarget"):format(childName)] end end + local HeaderUnsetAttributes = function(self) self:Hide() self:SetAttribute("showPlayer", true) @@ -1045,25 +868,32 @@ local HeaderUnsetAttributes = function(self) self:SetAttribute("xOffset", nil) self:SetAttribute("yOffset", nil) end + local HeaderEnableChildren = function(self) self.isForced = true; for i=1, select("#", self:GetChildren()) do local childFrame = select(i, self:GetChildren()) - childFrame:RegisterForClicks(nil) - childFrame:SetID(i) - childFrame.TargetGlow:SetAlpha(0) - childFrame:Allow() + if(childFrame and childFrame.RegisterForClicks) then + childFrame:RegisterForClicks(nil) + childFrame:SetID(i) + childFrame.TargetGlow:SetAlpha(0) + childFrame:Allow() + end end end + local HeaderDisableChildren = function(self) self.isForced = nil; - for i=1,select("#", self:GetChildren()) do + for i=1, select("#", self:GetChildren()) do local childFrame = select(i, self:GetChildren()) - childFrame:RegisterForClicks(SV.db.SVUnit.fastClickTarget and 'AnyDown' or 'AnyUp') - childFrame.TargetGlow:SetAlpha(1) - childFrame:Restrict() + if(childFrame and childFrame.RegisterForClicks) then + childFrame:RegisterForClicks(SV.db.SVUnit.fastClickTarget and 'AnyDown' or 'AnyUp') + childFrame.TargetGlow:SetAlpha(1) + childFrame:Restrict() + end end end + function MOD:SetGroupHeader(parentFrame, filter, layout, headerName, token) local db = SV.db.SVUnit[token] diff --git a/Interface/AddOns/SVUI/scripts/_load.xml b/Interface/AddOns/SVUI/scripts/_load.xml index c111e93..4acfca5 100644 --- a/Interface/AddOns/SVUI/scripts/_load.xml +++ b/Interface/AddOns/SVUI/scripts/_load.xml @@ -1,10 +1,6 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> <Script file="misc.lua"/> <Script file="mounts.lua"/> - <Script file="comix.lua"/> - <Script file="questwatch.lua"/> - <Script file="raid.lua"/> <Script file="reactions.lua"/> <Script file="spellbind.lua"/> - <Script file="ego.lua"/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/comix.lua b/Interface/AddOns/SVUI/scripts/comix.lua deleted file mode 100644 index 519cfbf..0000000 --- a/Interface/AddOns/SVUI/scripts/comix.lua +++ /dev/null @@ -1,244 +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 math = _G.math; ---[[ MATH METHODS ]]-- -local random = math.random; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L -local Comix = CreateFrame("Frame"); ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local animReady = true; -local playerGUID; -local COMIX_DATA = { - { - {0,0.25,0,0.25}, - {0.25,0.5,0,0.25}, - {0.5,0.75,0,0.25}, - {0.75,1,0,0.25}, - {0,0.25,0.25,0.5}, - {0.25,0.5,0.25,0.5}, - {0.5,0.75,0.25,0.5}, - {0.75,1,0.25,0.5}, - {0,0.25,0.5,0.75}, - {0.25,0.5,0.5,0.75}, - {0.5,0.75,0.5,0.75}, - {0.75,1,0.5,0.75}, - {0,0.25,0.75,1}, - {0.25,0.5,0.75,1}, - {0.5,0.75,0.75,1}, - {0.75,1,0.75,1} - }, - { - {220, 210, 50, -50, 220, 210, -1, 5}, - {230, 210, 50, 5, 280, 210, -5, 1}, - {280, 160, 1, 50, 280, 210, -1, 5}, - {220, 210, 50, -50, 220, 210, -1, 5}, - {210, 190, 50, 50, 220, 210, -1, 5}, - {220, 210, 50, -50, 220, 210, -1, 5}, - {230, 210, 50, 5, 280, 210, -5, 1}, - {280, 160, 1, 50, 280, 210, -1, 5}, - {220, 210, 50, -50, 220, 210, -1, 5}, - {210, 190, 50, 50, 220, 210, -1, 5}, - {220, 210, 50, -50, 220, 210, -1, 5}, - {230, 210, 50, 5, 280, 210, -5, 1}, - {280, 160, 1, 50, 280, 210, -1, 5}, - {220, 210, 50, -50, 220, 210, -1, 5}, - {210, 190, 50, 50, 220, 210, -1, 5}, - {210, 190, 50, 50, 220, 210, -1, 5} - } -}; ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -function Comix:ReadyState(state) - if(state == nil) then return animReady end - animReady = state -end - -function Comix:LaunchPremiumPopup() - local rng = random(1, 16); - local coords = COMIX_DATA[1][rng]; - local offsets = COMIX_DATA[2][rng] - - self.Premium.tex:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) - self.Premium.bg.tex:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) - self.Premium.anim[1]:SetOffset(offsets[1],offsets[2]) - self.Premium.anim[2]:SetOffset(offsets[3],offsets[4]) - self.Premium.anim[3]:SetOffset(0,0) - self.Premium.bg.anim[1]:SetOffset(offsets[5],offsets[6]) - self.Premium.bg.anim[2]:SetOffset(offsets[7],offsets[8]) - self.Premium.bg.anim[3]:SetOffset(0,0) - self.Premium.anim:Play() - self.Premium.bg.anim:Play() -end - -function 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(-100, 100); - 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 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(-100, 100); - if(step1_y > -30 and step1_y < 30) then step1_y = step1_y * 3 end - self.Basic.tex:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) - self.Basic:Point("CENTER", SV.Screen, "CENTER", step1_x, step1_y) - self.Basic.anim:Play() -end - -local Comix_OnEvent = function(self, event, ...) - local subEvent = select(2,...) - local guid = select(4,...) - local ready = self:ReadyState() - playerGUID = UnitGUID('player') - if subEvent == "PARTY_KILL" and guid == playerGUID and ready then - self:ReadyState(false) - local rng = random(1,15) - if rng < 8 then - self:LaunchDeluxePopup() - else - self:LaunchPopup() - end - end -end - -function SV:ToggleComix() - if not SV.db.general.comix then - Comix:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED") - Comix:SetScript("OnEvent", nil) - else - Comix:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") - Comix:SetScript("OnEvent", Comix_OnEvent) - end -end - -function SV:ToastyKombat() - --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() Comix:ReadyState(true) end -local Toasty_OnUpdate = function(self) Comix:ReadyState(true); self.parent:SetAlpha(0) end - -local function LoadSVComix() - local basic = CreateFrame("Frame", "ComixBasicPanel", SV.Screen) - basic:SetSize(100, 100) - basic:SetFrameStrata("DIALOG") - basic:Point("CENTER", SV.Screen, "CENTER", 0, -50) - basic.tex = basic:CreateTexture(nil, "ARTWORK") - basic.tex:FillInner(basic) - basic.tex:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\COMICS-TYPE1]]) - basic.tex:SetTexCoord(0,0.25,0,0.25) - SV.Animate:Kapow(basic, true) - basic:SetAlpha(0) - basic.anim[2]:SetScript("OnFinished", Comix_OnUpdate) - - Comix.Basic = basic - - local deluxe = CreateFrame("Frame", "ComixDeluxePanel", SV.Screen) - deluxe:SetSize(100, 100) - deluxe:SetFrameStrata("DIALOG") - deluxe:Point("CENTER", SV.Screen, "CENTER", 0, -50) - deluxe.tex = deluxe:CreateTexture(nil, "ARTWORK") - deluxe.tex:FillInner(deluxe) - deluxe.tex:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\COMICS-TYPE2]]) - deluxe.tex:SetTexCoord(0,0.25,0,0.25) - SV.Animate:RandomSlide(deluxe, true) - deluxe:SetAlpha(0) - deluxe.anim[3]:SetScript("OnFinished", Comix_OnUpdate) - - Comix.Deluxe = deluxe - - local premium = CreateFrame("Frame", "ComixPremiumPanel", SV.Screen) - premium:SetSize(100, 100) - premium:SetFrameStrata("DIALOG") - premium:Point("CENTER", SV.Screen, "CENTER", 0, -50) - premium.tex = premium:CreateTexture(nil, "ARTWORK") - premium.tex:FillInner(premium) - premium.tex:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\COMICS-TYPE3]]) - premium.tex:SetTexCoord(0,0.25,0,0.25) - SV.Animate:RandomSlide(premium, true) - premium:SetAlpha(0) - premium.anim[3]:SetScript("OnFinished", Comix_OnUpdate) - - local bg = CreateFrame("Frame", "ComixPremiumPanelBG", SV.Screen) - bg:SetSize(128, 128) - bg:SetFrameStrata("BACKGROUND") - bg:Point("CENTER", SV.Screen, "CENTER", 0, -50) - bg.tex = bg:CreateTexture(nil, "ARTWORK") - bg.tex:FillInner(bg) - bg.tex:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\COMICS-TYPE3-BG]]) - bg.tex:SetTexCoord(0,0.25,0,0.25) - SV.Animate:RandomSlide(bg, false) - bg:SetAlpha(0) - bg.anim[3]:SetScript("OnFinished", Comix_OnUpdate) - - premium.bg = bg - - Comix.Premium = premium - - --MOD - local toasty = CreateFrame("Frame", "ComixToastyPanelBG", UIParent) - toasty:SetSize(256, 256) - toasty:SetFrameStrata("DIALOG") - toasty:Point("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", 0, 0) - toasty.tex = toasty:CreateTexture(nil, "ARTWORK") - toasty.tex:FillInner(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) - - Comix:ReadyState(true) - SV:ToggleComix() -end - -SV:NewScript(LoadSVComix) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/ego.lua b/Interface/AddOns/SVUI/scripts/ego.lua deleted file mode 100644 index 130400b..0000000 --- a/Interface/AddOns/SVUI/scripts/ego.lua +++ /dev/null @@ -1,99 +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 math = _G.math; ---[[ MATH METHODS ]]-- -local random = math.random; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L - -local Sequences = { - {65, 1000}, --shrug - {70, 1000}, --laugh - {74, 1000}, --roar - {82, 1000}, --flex -}; - -local function rng() - return random(1, #Sequences) -end - -local GoGoGadget = function(self, key) - key = key or rng() - local emote = Sequences[key][1] - self:SetAlpha(1) - self.Model1:SetAnimation(emote) - self.Model2:SetAnimation(emote) -end - -local function LoadSVEgo() - if(not SV.db.general.ego) then return end - local GameMenuFrame = _G.GameMenuFrame - - local EgoFrame = CreateFrame("Frame", "SVUI_EgoFrame", UIParent); - EgoFrame:SetParent(GameMenuFrame) - EgoFrame:SetFrameLevel(0) - EgoFrame:SetAllPoints(SV.Screen) - - EgoFrame.BG1 = EgoFrame:CreateTexture(nil, "BACKGROUND", nil, -7) - EgoFrame.BG1:SetPoint("TOPLEFT", EgoFrame, "TOPLEFT", 0, 0) - EgoFrame.BG1:SetPoint("BOTTOMRIGHT", EgoFrame, "TOPRIGHT", 0, -300) - EgoFrame.BG1:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - EgoFrame.BG1:SetVertexColor(0, 0, 0, 0.8) - - EgoFrame.BG2 = EgoFrame:CreateTexture(nil, "BACKGROUND", nil, -7) - EgoFrame.BG2:SetPoint("BOTTOMLEFT", EgoFrame, "BOTTOMLEFT", 0, 0) - EgoFrame.BG2:SetPoint("TOPRIGHT", EgoFrame, "BOTTOMRIGHT", 0, 300) - EgoFrame.BG2:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - EgoFrame.BG2:SetVertexColor(0, 0, 0, 0.8) - - EgoFrame.Model1 = CreateFrame("PlayerModel", "SVUI_EgoModel1", EgoFrame); - EgoFrame.Model1:SetUnit("player") - EgoFrame.Model1:SetRotation(1) - EgoFrame.Model1:SetPortraitZoom(0.3) - EgoFrame.Model1:SetPosition(0,0,-0.25) - EgoFrame.Model1:SetFrameStrata("BACKGROUND") - EgoFrame.Model1:SetPoint("TOPLEFT", EgoFrame, "TOPLEFT", -250, -300) - EgoFrame.Model1:SetPoint("BOTTOMRIGHT", EgoFrame, "BOTTOM", 0, 300) - - EgoFrame.Model2 = CreateFrame("PlayerModel", "SVUI_EgoModel2", EgoFrame); - EgoFrame.Model2:SetUnit("player") - EgoFrame.Model2:SetRotation(-1) - EgoFrame.Model2:SetPortraitZoom(0.3) - EgoFrame.Model2:SetPosition(0,0,-0.25) - EgoFrame.Model2:SetFrameStrata("BACKGROUND") - EgoFrame.Model2:SetPoint("TOPRIGHT", EgoFrame, "TOPRIGHT", 250, -300) - EgoFrame.Model2:SetPoint("BOTTOMLEFT", EgoFrame, "BOTTOM", 250, 300) - - EgoFrame.GoGoGadget = GoGoGadget - - EgoFrame:SetScript("OnShow", function(self) - self:GoGoGadget() - end) -end - -SV:NewScript(LoadSVEgo) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/misc.lua b/Interface/AddOns/SVUI/scripts/misc.lua index 21a9006..6efb957 100644 --- a/Interface/AddOns/SVUI/scripts/misc.lua +++ b/Interface/AddOns/SVUI/scripts/misc.lua @@ -38,6 +38,12 @@ local L = SV.L local toonclass = select(2, UnitClass('player')) --[[ ########################################################## +TAINT FIX HACKS +########################################################## +]]-- +LFRParentFrame:SetScript("OnHide", nil) +--[[ +########################################################## MERCHANT MAX STACK ########################################################## ]]-- @@ -51,81 +57,77 @@ local BuyMaxStack = function(self, ...) end end end + +local MaxStackTooltip = function(self) + GameTooltip:AddDoubleLine("[Alt + Click]", "Buy a full stack.", 0, 0.5, 1, 0.5, 1, 0.5) +end + +hooksecurefunc("MerchantItemButton_OnEnter", MaxStackTooltip); hooksecurefunc("MerchantItemButton_OnModifiedClick", BuyMaxStack); --[[ ########################################################## CHAT BUBBLES ########################################################## ]]-- -local function LoadStyledChatBubbles() - local TaintFix = CreateFrame("Frame") - TaintFix:SetScript("OnUpdate", function(self, elapsed) - if LFRBrowseFrame.timeToClear then - LFRBrowseFrame.timeToClear = nil - end - end) - if(SV.db.general.bubbles == true) then - local ChatBubbleHandler = CreateFrame("Frame", nil, UIParent) - local total = 0 - local numKids = 0 - local function styleBubble(frame) - local needsUpdate = true; - for i = 1, frame:GetNumRegions() do - local region = select(i, frame:GetRegions()) - if region:GetObjectType() == "Texture" then - if(region:GetTexture() == [[Interface\Tooltips\ChatBubble-Background]]) then - region:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Chat\CHATBUBBLE-BG]]) - needsUpdate = false - elseif(region:GetTexture()==[[Interface\Tooltips\ChatBubble-Backdrop]]) then - region:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Chat\CHATBUBBLE-BACKDROP]]) - needsUpdate = false - elseif(region:GetTexture()==[[Interface\Tooltips\ChatBubble-Tail]]) then - region:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Chat\CHATBUBBLE-TAIL]]) - needsUpdate = false - else - region:SetTexture(0,0,0,0) - end - elseif(region:GetObjectType() == "FontString" and not frame.text) then - frame.text = region - end - end - if needsUpdate then - frame:SetBackdrop({ - bgFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - }); - frame:SetClampedToScreen(false) - frame:SetFrameStrata("BACKGROUND") - end - if(frame.text) then - frame.text:SetFont(SV.Media.font.dialog, 10, "NONE") - frame.text:SetShadowColor(0,0,0,1) - frame.text:SetShadowOffset(1,-1) - end - end - - ChatBubbleHandler:SetScript("OnUpdate", function(self, elapsed) - total = total + elapsed - if total > 0.1 then - total = 0 - local newNumKids = WorldFrame:GetNumChildren() - if newNumKids ~= numKids then - for i = numKids + 1, newNumKids do - local frame = select(i, WorldFrame:GetChildren()) - local b = frame:GetBackdrop() - if b and b.bgFile == [[Interface\Tooltips\ChatBubble-Background]] then - styleBubble(frame) - end - end - numKids = newNumKids - end - end - end) - end -end - -SV:NewScript(LoadStyledChatBubbles) +-- local function LoadStyledChatBubbles() +-- if(SV.db.general.bubbles == true) then +-- local ChatBubbleHandler = CreateFrame("Frame", nil, UIParent) +-- local total = 0 +-- local numKids = 0 +-- local function styleBubble(frame) +-- local needsUpdate = true; +-- for i = 1, frame:GetNumRegions() do +-- local region = select(i, frame:GetRegions()) +-- if region:GetObjectType() == "Texture" then +-- if(region:GetTexture() == [[Interface\Tooltips\ChatBubble-Background]]) then +-- region:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Chat\CHATBUBBLE-BG]]) +-- needsUpdate = false +-- elseif(region:GetTexture() == [[Interface\Tooltips\ChatBubble-Backdrop]]) then +-- region:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Chat\CHATBUBBLE-BACKDROP]]) +-- needsUpdate = false +-- elseif(region:GetTexture() == [[Interface\Tooltips\ChatBubble-Tail]]) then +-- region:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Chat\CHATBUBBLE-TAIL]]) +-- needsUpdate = false +-- else +-- region:SetTexture(0,0,0,0) +-- end +-- elseif(region:GetObjectType() == "FontString" and not frame.text) then +-- frame.text = region +-- end +-- end +-- if needsUpdate then +-- frame:SetBackdrop(nil); +-- frame:SetClampedToScreen(false) +-- frame:SetFrameStrata("BACKGROUND") +-- end +-- if(frame.text) then +-- frame.text:SetFont(SV.Media.font.dialog, 10, "NONE") +-- frame.text:SetShadowColor(0,0,0,1) +-- frame.text:SetShadowOffset(1,-1) +-- end +-- end + +-- ChatBubbleHandler:SetScript("OnUpdate", function(self, elapsed) +-- total = total + elapsed +-- if total > 0.1 then +-- total = 0 +-- local newNumKids = WorldFrame:GetNumChildren() +-- if newNumKids ~= numKids then +-- for i = numKids + 1, newNumKids do +-- local frame = select(i, WorldFrame:GetChildren()) +-- local b = frame:GetBackdrop() +-- if(b and b.bgFile == [[Interface\Tooltips\ChatBubble-Background]]) then +-- styleBubble(frame) +-- end +-- end +-- numKids = newNumKids +-- end +-- end +-- end) +-- end +-- end + +-- SV:NewScript(LoadStyledChatBubbles) --[[ ########################################################## DRESSUP HELPERS by: Leatrix @@ -294,7 +296,7 @@ RAIDMARKERS local ButtonIsDown; local RaidMarkFrame=CreateFrame("Frame", "SVUI_RaidMarkFrame", UIParent) RaidMarkFrame:EnableMouse(true) -RaidMarkFrame:SetSize(100,100) +RaidMarkFrame:SetSize(100, 100) RaidMarkFrame:SetPoint("CENTER", UIParent, "CENTER", 0, 0) RaidMarkFrame:SetFrameStrata("DIALOG") @@ -316,7 +318,7 @@ end for i=1,8 do local raidMark = CreateFrame("Button", "RaidMarkIconButton"..i, RaidMarkFrame) - raidMark:Size(40) + raidMark:SetSize(40, 40) raidMark:SetID(i) raidMark.Texture = raidMark:CreateTexture(raidMark:GetName().."NormalTexture","ARTWORK") raidMark.Texture:SetTexture([[Interface\TargetingFrame\UI-RaidTargetingIcons]]) @@ -627,10 +629,10 @@ local function LoadThreatBar() local anchor = _G.SVUI_Target local ThreatBar = CreateFrame('StatusBar', 'SVUI_ThreatBar', SV.Screen); ThreatBar:SetStatusBarTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Doodads\\THREAT-BAR") - ThreatBar:SetSize(50,100) + ThreatBar:SetSize(50, 100) ThreatBar:SetFrameStrata('MEDIUM') ThreatBar:SetOrientation("VERTICAL") - ThreatBar:SetMinMaxValues(0,100) + ThreatBar:SetMinMaxValues(0, 100) if(anchor) then ThreatBar:Point('LEFT', _G.SVUI_Target, 'RIGHT', 0, 10) else diff --git a/Interface/AddOns/SVUI/scripts/questwatch.lua b/Interface/AddOns/SVUI/scripts/questwatch.lua deleted file mode 100644 index 09b75f8..0000000 --- a/Interface/AddOns/SVUI/scripts/questwatch.lua +++ /dev/null @@ -1,217 +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 VARS -########################################################## -]]-- -local QuestFrame, ObjectiveTrackerFrame; -local ICON_FILE = [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-QUESTS]] -local OBJECTIVE_TRACKER_LINE_WIDTH = _G.OBJECTIVE_TRACKER_LINE_WIDTH; ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -local QuestFrame_OnEvent = function(self, event) - if(event == "QUEST_AUTOCOMPLETE" and SV.Dock.Right.Window and QuestFrame) then - if SV.Dock.Right.Window.FrameName and _G[SV.Dock.Right.Window.FrameName] and _G[SV.Dock.Right.Window.FrameName]:IsShown() then return end - if not QuestFrame:IsShown() then - SV.Dock.Right.Window.FrameName = "SVUI_QuestFrame" - if not SV.Dock.Right.Window:IsShown()then - SV.Dock.Right.Window:Show() - end - SV.Dock:CycleDocklets() - QuestFrame:Show() - if(QuestFrame.DockButton) then - QuestFrame.DockButton:Activate() - end - end - end -end - -local function CreateQuestFrame() - ObjectiveTrackerFrame = _G.ObjectiveTrackerFrame - if(not ObjectiveTrackerFrame) then return end - if(not SV.db.general.questWatch) then - ObjectiveTrackerFrame:RemoveTextures(true) - - QuestFrame = CreateFrame("Frame", "SVUI_QuestFrame", UIParent); - QuestFrame:SetSize(200, ObjectiveTrackerFrame:GetHeight()); - QuestFrame:SetPoint("TOPRIGHT", UIParent, "RIGHT", -200, 100); - - ObjectiveTrackerFrame:ClearAllPoints() - ObjectiveTrackerFrame:SetClampedToScreen(false) - ObjectiveTrackerFrame:SetParent(QuestFrame) - ObjectiveTrackerFrame:SetAllPoints(QuestFrame) - ObjectiveTrackerFrame:SetFrameLevel(QuestFrame:GetFrameLevel() + 1) - ObjectiveTrackerFrame.ClearAllPoints = SV.fubar; - ObjectiveTrackerFrame.SetPoint = SV.fubar; - ObjectiveTrackerFrame.SetAllPoints = SV.fubar; - - 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: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 - - SV.Mentalo:Add(QuestFrame, "Quest Watch"); - else - local bgTex = [[Interface\BUTTONS\WHITE8X8]] - local bdTex = SV.Media.bar.glow - local WIDTH, HEIGHT = SV.Dock.Right.Window:GetSize() - - QuestFrame = CreateFrame("Frame", "SVUI_QuestFrame", SV.Dock.Right.Window); - QuestFrame:SetFrameStrata("BACKGROUND"); - SV.Dock:RegisterDocklet("SVUI_QuestFrame", "Quest Watch", ICON_FILE, false, true) - - local listFrame = CreateFrame("ScrollFrame", nil, QuestFrame); - listFrame:SetPoint("TOPLEFT", QuestFrame, -62, 0); - listFrame:SetPoint("BOTTOMRIGHT", QuestFrame, -31, 21); - listFrame:EnableMouseWheel(true); - - local scrollFrame = CreateFrame("Slider", nil, listFrame); - scrollFrame:SetHeight(listFrame:GetHeight()); - scrollFrame:SetWidth(18); - scrollFrame:SetPoint("TOPRIGHT", QuestFrame, "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); - - 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:SetParent(listFrame) - ObjectiveTrackerFrame:SetHeight(500) - ObjectiveTrackerFrame:SetWidth(WIDTH) - ObjectiveTrackerFrame:SetPoint("TOPRIGHT", listFrame, "TOPRIGHT", -31, 0) - ObjectiveTrackerFrame:SetFrameLevel(listFrame:GetFrameLevel() + 1) - - listFrame:SetScrollChild(ObjectiveTrackerFrame) - scrollFrame:SetScript("OnValueChanged", function(self, argValue) - listFrame:SetVerticalScroll(argValue) - end) - scrollFrame:ClearAllPoints() - scrollFrame:SetPoint("TOPRIGHT", QuestFrame, "TOPRIGHT", -3, 0) - - ObjectiveTrackerFrame.ClearAllPoints = SV.fubar; - ObjectiveTrackerFrame.SetAllPoints = SV.fubar; - ObjectiveTrackerFrame.SetPoint = SV.fubar; - ObjectiveTrackerFrame.SetWidth = SV.fubar; - - 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.SetWidth = SV.fubar; - - 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 - - local eventHandler = CreateFrame("Frame") - eventHandler:RegisterEvent("QUEST_AUTOCOMPLETE") - eventHandler:SetScript("OnEvent", QuestFrame_OnEvent) - end -end - -SV:NewScript(CreateQuestFrame) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/raid.lua b/Interface/AddOns/SVUI/scripts/raid.lua deleted file mode 100644 index c49c17e..0000000 --- a/Interface/AddOns/SVUI/scripts/raid.lua +++ /dev/null @@ -1,291 +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 ---[[ -########################################################## -RAID UTILITY By: Elv -########################################################## -]]-- -local PANEL_HEIGHT = 120 -local find = string.find -local RaidUtilFrame = CreateFrame("Frame"); ---Check if We are Raid Leader or Raid Officer -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 function ButtonEnter(self) - self:SetPanelColor("highlight") - - if(self.TText) then - GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) - GameTooltip:ClearLines() - GameTooltip:AddLine(self.TText, 1, 1, 1) - GameTooltip:Show() - end -end - -local function ButtonLeave(self) - self:SetPanelColor("inverse") - - GameTooltip:Hide() -end - -local function CreateUtilButton(name, parent, template, width, height, point, relativeto, point2, xOfs, yOfs, text, texture) - local b = CreateFrame("Button", name, parent, template) - b:Width(width) - b:Height(height) - b:Point(point, relativeto, point2, xOfs, yOfs) - - if text then - local t = b:CreateFontString(nil,"OVERLAY") - t:SetFont(SV.Media.font.roboto, 14, "NONE") - t:SetAllPoints(b) - t:SetJustifyH("CENTER") - t:SetText(text) - b:SetFontString(t) - elseif texture then - local t = b:CreateTexture(nil,"OVERLAY",nil) - t:SetTexture(texture) - t:Point("TOPLEFT", b, "TOPLEFT", 1, -1) - t:Point("BOTTOMRIGHT", b, "BOTTOMRIGHT", -1, 1) - end - b:HookScript("OnEnter", ButtonEnter) - b:HookScript("OnLeave", ButtonLeave) -end - -local function ToggleRaidUtil(event) - if(not SVUI_RaidTools) then return end - if InCombatLockdown() then - RaidUtilFrame:RegisterEvent("PLAYER_REGEN_ENABLED") - return - end - - if CheckRaidStatus() then - local width = SV.Dock.Top:GetAttribute("buttonSize") + 12 - SV.Dock.Top.ToolBar:SetWidth(width) - if RaidUtilityPanel.toggled == true then - SVUI_RaidTools:Hide() - RaidUtilityPanel:Show() - else - SVUI_RaidTools:Show() - RaidUtilityPanel:Hide() - end - else - SV.Dock.Top.ToolBar:SetWidth(1) - SVUI_RaidTools:Hide() - RaidUtilityPanel:Hide() - end - - if event == "PLAYER_REGEN_ENABLED" then - RaidUtilFrame:UnregisterEvent("PLAYER_REGEN_ENABLED") - end -end - -RaidUtilFrame:RegisterEvent("GROUP_ROSTER_UPDATE") -RaidUtilFrame:RegisterEvent("PLAYER_ENTERING_WORLD") -RaidUtilFrame:SetScript("OnEvent", ToggleRaidUtil) - -local function LoadRaidUtility() - local buttonsize = SV.db.Dock.buttonSize or 22; - --Create main frame - local RaidUtilityPanel = CreateFrame("Frame", "RaidUtilityPanel", SV.Screen, "SecureHandlerClickTemplate") - RaidUtilityPanel:SetPanelTemplate('Transparent') - RaidUtilityPanel:Width(120) - RaidUtilityPanel:Height(PANEL_HEIGHT) - RaidUtilityPanel:SetPoint("TOPLEFT", SV.Dock.Top.ToolBar, "BOTTOMLEFT", 0, -2) - RaidUtilityPanel:SetFrameLevel(3) - RaidUtilityPanel.toggled = false - RaidUtilityPanel:SetFrameStrata("HIGH") - SV:AddToDisplayAudit(RaidUtilityPanel) - - --Show Button - local SVUI_RaidTools = CreateFrame("Button", "SVUI_RaidTools", SV.Screen, "UIMenuButtonStretchTemplate, SecureHandlerClickTemplate") - SVUI_RaidTools:Size(buttonsize, buttonsize) - SVUI_RaidTools:Point("CENTER", SV.Dock.Top.ToolBar, "CENTER", 0, 0) - SVUI_RaidTools.icon = SVUI_RaidTools:CreateTexture(nil,"OVERLAY",nil) - SVUI_RaidTools.icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-RAIDTOOL]]) - SVUI_RaidTools.icon:Point("TOPLEFT", SVUI_RaidTools, "TOPLEFT", 1, -1) - SVUI_RaidTools.icon:Point("BOTTOMRIGHT", SVUI_RaidTools, "BOTTOMRIGHT", -1, 1) - - SVUI_RaidTools.TText = RAID_CONTROL .. " [Click to Open]" - - SVUI_RaidTools:HookScript("OnEnter", ButtonEnter) - SVUI_RaidTools:HookScript("OnLeave", ButtonLeave) - - SVUI_RaidTools:SetFrameRef("RaidUtilityPanel", RaidUtilityPanel) - SVUI_RaidTools:SetAttribute("_onclick", [=[ - local raidUtil = self:GetFrameRef("RaidUtilityPanel") - local closeButton = raidUtil:GetFrameRef("RaidUtility_CloseButton") - self:Hide(); - raidUtil:Show(); - - local point = self:GetPoint(); - local raidUtilPoint, raidUtilRelative, closeButtonPoint, closeButtonRelative, yOffset - if string.find(point, "BOTTOM") then - raidUtilPoint = "BOTTOMLEFT" - raidUtilRelative = "TOPLEFT" - closeButtonPoint = "TOP" - closeButtonRelative = "BOTTOM" - yOffset = 1 - else - raidUtilPoint = "TOPLEFT" - raidUtilRelative = "BOTTOMLEFT" - closeButtonPoint = "BOTTOM" - closeButtonRelative = "TOP" - yOffset = -1 - end - - raidUtil:ClearAllPoints() - closeButton:ClearAllPoints() - raidUtil:SetPoint(raidUtilPoint, self, raidUtilRelative, 2, -2) - closeButton:SetPoint(closeButtonRelative, raidUtil, closeButtonPoint, 0, yOffset) - ]=]) - - SVUI_RaidTools:SetScript("OnMouseUp", function(self) RaidUtilityPanel.toggled = true end) - SVUI_RaidTools:SetMovable(true) - SVUI_RaidTools:SetClampedToScreen(true) - SVUI_RaidTools:SetClampRectInsets(0, 0, -1, 1) - SVUI_RaidTools:RegisterForDrag("RightButton") - SVUI_RaidTools:SetFrameStrata("HIGH") - SVUI_RaidTools:SetScript("OnDragStart", function(self) - self:StartMoving() - end) - - SV:AddToDisplayAudit(SVUI_RaidTools) - - SVUI_RaidTools:SetScript("OnDragStop", function(self) - self:StopMovingOrSizing() - local point = self:GetPoint() - local xOffset = self:GetCenter() - local screenWidth = SV.Screen:GetWidth() / 2 - xOffset = xOffset - screenWidth - self:ClearAllPoints() - if find(point, "BOTTOM") then - self:SetPoint('BOTTOM', SV.Screen, 'BOTTOM', xOffset, -1) - else - self:SetPoint('TOP', SV.Screen, 'TOP', xOffset, 1) - end - end) - - --Close Button - CreateUtilButton("RaidUtility_CloseButton", RaidUtilityPanel, "UIMenuButtonStretchTemplate, SecureHandlerClickTemplate", 30, 18, "TOP", RaidUtilityPanel, "BOTTOM", 0, -1, "X", nil) - RaidUtility_CloseButton:SetFrameRef("SVUI_RaidTools", SVUI_RaidTools) - RaidUtility_CloseButton:SetAttribute("_onclick", [=[self:GetParent():Hide(); self:GetFrameRef("SVUI_RaidTools"):Show();]=]) - RaidUtility_CloseButton:SetScript("OnMouseUp", function(self) RaidUtilityPanel.toggled = false end) - RaidUtilityPanel:SetFrameRef("RaidUtility_CloseButton", RaidUtility_CloseButton) - - local buttonWidth = RaidUtilityPanel:GetWidth() * 0.9 - - --Disband Raid button - CreateUtilButton("DisbandRaidButton", RaidUtilityPanel, "UIMenuButtonStretchTemplate", buttonWidth, 18, "TOP", RaidUtilityPanel, "TOP", 0, -5, L['Disband Group'], nil) - DisbandRaidButton:SetScript("OnMouseUp", function(self) - if CheckRaidStatus() then - SV:StaticPopup_Show("DISBAND_RAID") - end - end) - - --Role Check button - CreateUtilButton("RoleCheckButton", RaidUtilityPanel, "UIMenuButtonStretchTemplate", buttonWidth, 18, "TOP", DisbandRaidButton, "BOTTOM", 0, -5, ROLE_POLL, nil) - RoleCheckButton:SetScript("OnMouseUp", function(self) - if CheckRaidStatus() then - InitiateRolePoll() - end - end) - - --Ready Check button - CreateUtilButton("ReadyCheckButton", RaidUtilityPanel, "UIMenuButtonStretchTemplate", buttonWidth, 18, "TOP", RoleCheckButton, "BOTTOM", 0, -5, READY_CHECK, nil) - ReadyCheckButton:SetScript("OnMouseUp", function(self) - if CheckRaidStatus() then - DoReadyCheck() - end - end) - - --Raid Control Panel - CreateUtilButton("RaidControlButton", RaidUtilityPanel, "UIMenuButtonStretchTemplate", buttonWidth, 18, "TOP", ReadyCheckButton, "BOTTOM", 0, -5, L['Raid Menu'], nil) - RaidControlButton:SetScript("OnMouseUp", function(self) - ToggleFriendsFrame(4) - end) - - --Reposition/Resize and Reuse the World Marker Button - if(CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton) then - CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton:ClearAllPoints() - CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton:SetPoint("TOP", RaidControlButton, "BOTTOM", 0, -5) - CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton:SetParent("RaidUtilityPanel") - CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton:Height(18) - CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton:SetWidth(buttonWidth) - local markersText = CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton:CreateFontString(nil,"OVERLAY") - markersText:SetFont(SV.Media.font.roboto, 14, "NONE") - markersText:SetAllPoints(CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton) - markersText:SetJustifyH("CENTER") - markersText:SetText("World Markers") - CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton:SetFontString(markersText) - end - - --Put other stuff back - if(CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateReadyCheck) then - CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateReadyCheck:ClearAllPoints() - CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateReadyCheck:SetPoint("BOTTOMLEFT", CompactRaidFrameManagerDisplayFrameLockedModeToggle, "TOPLEFT", 0, 1) - CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateReadyCheck:SetPoint("BOTTOMRIGHT", CompactRaidFrameManagerDisplayFrameHiddenModeToggle, "TOPRIGHT", 0, 1) - CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateRolePoll:ClearAllPoints() - CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateRolePoll:SetPoint("BOTTOMLEFT", CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateReadyCheck, "TOPLEFT", 0, 1) - CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateRolePoll:SetPoint("BOTTOMRIGHT", CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateReadyCheck, "TOPRIGHT", 0, 1) - end - do - --[[NEEDS TESTING]]-- - local buttons = { - "CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton", - "DisbandRaidButton", - "RoleCheckButton", - "ReadyCheckButton", - "RaidControlButton", - "SVUI_RaidTools", - "RaidUtility_CloseButton" - } - - for i, gName in pairs(buttons) do - local button = _G[gName] - if(button) then - button:RemoveTextures() - button:SetFramedButtonTemplate() - button:HookScript("OnEnter", ButtonEnter) - button:HookScript("OnLeave", ButtonLeave) - end - end - - SVUI_RaidTools.icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-RAIDTOOL]]) - end -end -SV:NewScript(LoadRaidUtility); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/spellbind.lua b/Interface/AddOns/SVUI/scripts/spellbind.lua index 2ae643e..3b14bb2 100644 --- a/Interface/AddOns/SVUI/scripts/spellbind.lua +++ b/Interface/AddOns/SVUI/scripts/spellbind.lua @@ -413,25 +413,7 @@ LOADER ]]-- SVUI_SpellBinderCloseButton:SetScript("OnClick", SpellBindClose_OnClick) -SpellBinder:RemoveTextures() - -SVUI_SpellBinderInset:RemoveTextures() - -SpellBinder:SetPanelTemplate("Action") -SpellBinder.Panel:SetPoint("TOPLEFT", -18, 0) -SpellBinder.Panel:SetPoint("BOTTOMRIGHT", 0, 0) - -SpellBinder.list:RemoveTextures() -SpellBinder.list:SetPanelTemplate("Inset") - SpellBinder.tab = CreateFrame("CheckButton", nil, _G["SpellBookSkillLineTab1"], "SpellBookSkillLineTabTemplate") -SpellBinder.tab:RemoveTextures() -SpellBinder.tab:SetButtonTemplate() -SpellBinder.tab:SetNormalTexture("Interface\\ICONS\\Achievement_Guild_Doctorisin") -SpellBinder.tab:GetNormalTexture():ClearAllPoints() -SpellBinder.tab:GetNormalTexture():SetPoint("TOPLEFT", 2, -2) -SpellBinder.tab:GetNormalTexture():SetPoint("BOTTOMRIGHT", -2, 2) -SpellBinder.tab:GetNormalTexture():SetTexCoord(0.1, 0.9, 0.1, 0.9) SpellBinder.tab:SetScript("OnShow", SpellBindTab_OnShow) SpellBinder.tab:SetScript("OnClick", SpellBindTab_OnClick) SpellBinder.tab:Show() @@ -448,6 +430,25 @@ local function LoadSpellBinder() SV.cache.SpellBinder.frames = SV.cache.SpellBinder.frames or {} SV.cache.SpellBinder.keys = SV.cache.SpellBinder.keys or {} + SpellBinder:RemoveTextures() + + SVUI_SpellBinderInset:RemoveTextures() + + SpellBinder:SetPanelTemplate("Action") + SpellBinder.Panel:SetPoint("TOPLEFT", -18, 0) + SpellBinder.Panel:SetPoint("BOTTOMRIGHT", 0, 0) + + SpellBinder.list:RemoveTextures() + SpellBinder.list:SetPanelTemplate("Inset") + + SpellBinder.tab:RemoveTextures() + SpellBinder.tab:SetButtonTemplate() + SpellBinder.tab:SetNormalTexture("Interface\\ICONS\\Achievement_Guild_Doctorisin") + SpellBinder.tab:GetNormalTexture():ClearAllPoints() + SpellBinder.tab:GetNormalTexture():SetPoint("TOPLEFT", 2, -2) + SpellBinder.tab:GetNormalTexture():SetPoint("BOTTOMRIGHT", -2, 2) + SpellBinder.tab:GetNormalTexture():SetTexCoord(0.1, 0.9, 0.1, 0.9) + SpellBinder:BuildList() SpellBinder:BuildSpells(true) diff --git a/Interface/AddOns/SVUI/setup/installer.lua b/Interface/AddOns/SVUI/setup/installer.lua index 96846fc..6ef89e9 100644 --- a/Interface/AddOns/SVUI/setup/installer.lua +++ b/Interface/AddOns/SVUI/setup/installer.lua @@ -118,10 +118,17 @@ local function forceCVars() InterfaceOptionsActionBarsPanelPickupActionKeyDropDown:RefreshValue() end -local function ShowLayout(show40) - if(not _G["SVUI_Raid40"] or (show40 and _G["SVUI_Raid40"].forceShow == true)) then return end - if(not show40 and _G["SVUI_Raid40"].forceShow ~= true) then return end - SV.SVUnit:ViewGroupFrames(_G["SVUI_Raid40"], show40) +local function ShowLayout(show) + if(not _G["SVUI_Raid"] or (show and _G["SVUI_Raid"].forceShow == true)) then return end + if(not show and _G["SVUI_Raid"].forceShow ~= true) then return end + SV.SVUnit:ViewGroupFrames(_G["SVUI_Raid"], show) +end + +local function ShowAuras(show) + if(not _G["SVUI_Player"] or (show and _G["SVUI_Player"].forceShowAuras)) then return end + if(not show and not _G["SVUI_Player"].forceShowAuras) then return end + _G["SVUI_Player"].forceShowAuras = show + SV.SVUnit:SetUnitFrame("player") end local function BarShuffle() @@ -325,8 +332,7 @@ function SV.Setup:ChatConfigs(mungs) local chatID = chat:GetID() if i == 1 then chat:ClearAllPoints() - chat:Point("BOTTOMLEFT", SVUI_DockLeft, "BOTTOMLEFT", 5, 5) - chat:Point("TOPRIGHT", SVUI_DockLeft, "TOPRIGHT", -5, -10) + chat:SetAllPoints(SV.SVChat.Dock); end FCF_SavePositionAndDimensions(chat) FCF_StopDragging(chat) @@ -427,7 +433,7 @@ function SV.Setup:ChatConfigs(mungs) if not mungs then if SV.Chat then SV.Chat:ReLoad(true) - if SV.Dock.Cache.IsFaded == true then SV.Dock.BarLeft.Button:Click() end + if SV.Dock.Cache.IsFaded == true then HideSuperDocks() end end SV:SavedPopup() end @@ -699,12 +705,14 @@ end local InstallerFrame_SetPage = function(self, newPage) PageData, MAX_PAGE = SV.Setup:CopyPage(newPage) CURRENT_PAGE = newPage; - local willShowLayout = CURRENT_PAGE == 5 or CURRENT_PAGE == 6 + local willShowLayout = CURRENT_PAGE == 5 or CURRENT_PAGE == 6; + local willShowAuras = CURRENT_PAGE == 8; self:PreparePage() self.Status:SetText(CURRENT_PAGE.." / "..MAX_PAGE) ShowLayout(willShowLayout) + ShowAuras(willShowAuras) for option, data in pairs(PageData) do if(type(data) == "table" and data[1] and data[2]) then @@ -803,7 +811,7 @@ function SV.Setup:Install(autoLoaded) local frame = CreateFrame("Button", "SVUI_InstallerFrame", UIParent) frame:Size(550, 400) frame:SetPanelTemplate("Action") - frame:SetPoint("CENTER") + frame:SetPoint("TOP", SV.Screen, "TOP", 0, -150) frame:SetFrameStrata("TOOLTIP") frame.SetPage = InstallerFrame_SetPage; @@ -1144,7 +1152,9 @@ function SV.Setup:Install(autoLoaded) SVUI_InstallerFrame:SetScript("OnHide", function() StopMusic() SetCVar("Sound_MusicVolume", user_music_vol) - musicIsPlaying = nil + musicIsPlaying = nil; + ShowLayout() + ShowAuras() end) SVUI_InstallerFrame:Show() diff --git a/Interface/AddOns/SVUI/setup/presets.lua b/Interface/AddOns/SVUI/setup/presets.lua index 7a7d84b..a7a9999 100644 --- a/Interface/AddOns/SVUI/setup/presets.lua +++ b/Interface/AddOns/SVUI/setup/presets.lua @@ -87,6 +87,7 @@ local function LoadPresetData() ["default"] = { ["colors"] = { ["special"] = {.37, .32, .29, 1}, + ["specialdark"] = {.23, .22, .21, 1}, }, ["textures"] = { ["pattern"] = "SVUI Backdrop 1", @@ -104,6 +105,7 @@ local function LoadPresetData() ["kaboom"] = { ["colors"] = { ["special"] = {.28, .31, .32, 1}, + ["specialdark"] = {.21, .22, .23, 1}, }, ["textures"] = { ["pattern"] = "SVUI Backdrop 2", @@ -121,6 +123,7 @@ local function LoadPresetData() ["classy"] = { ["colors"] = { ["special"] = {r2, g2, b2, 1}, + ["specialdark"] = {(r2 * 0.75), (g2 * 0.75), (b2 * 0.75), 1}, }, ["textures"] = { ["pattern"] = "SVUI Backdrop 3", @@ -138,6 +141,7 @@ local function LoadPresetData() ["dark"] = { ["colors"] = { ["special"] = {.25, .26, .27, 1}, + ["specialdark"] = {.17, .18, .19, 1}, }, ["textures"] = { ["pattern"] = "SVUI Backdrop 4", @@ -541,19 +545,7 @@ local function LoadPresetData() position = "INNERTOPLEFT" }, }, - ["raid10"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid25"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid40"] = { + ["raid"] = { width = 50, height = 30, wrapXOffset = 6, @@ -626,19 +618,7 @@ local function LoadPresetData() position = "INNERTOPLEFT" }, }, - ["raid10"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid25"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid40"] = { + ["raid"] = { width = 50, height = 30, wrapXOffset = 6, @@ -717,19 +697,7 @@ local function LoadPresetData() position = "INNERRIGHT" }, }, - ["raid10"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid25"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid40"] = { + ["raid"] = { width = 50, height = 30, wrapXOffset = 6, @@ -790,19 +758,7 @@ local function LoadPresetData() position = "INNERTOPLEFT" }, }, - ["raid10"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid25"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid40"] = { + ["raid"] = { width = 50, height = 30, wrapXOffset = 6, @@ -841,55 +797,7 @@ local function LoadPresetData() ["yOffset"] = 0, }, }, - ["raid10"] = { - width = 50, - height = 30, - gRowCol = 1, - wrapXOffset = 9, - wrapYOffset = 13, - showBy = "RIGHT_DOWN", - ["power"] = { - ["enable"] = false, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 1, - }, - }, - ["name"] = { - ["font"] = "SVUI Default Font", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["raid25"] = { - width = 50, - height = 30, - gRowCol = 1, - wrapXOffset = 9, - wrapYOffset = 13, - showBy = "RIGHT_DOWN", - ["power"] = { - ["enable"] = false, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 1, - }, - }, - ["name"] = { - ["font"] = "SVUI Default Font", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["raid40"] = { + ["raid"] = { width = 50, height = 30, gRowCol = 1, @@ -943,55 +851,7 @@ local function LoadPresetData() ["yOffset"] = 0, }, }, - ["raid10"] = { - width = 50, - height = 30, - ["showBy"] = "DOWN_RIGHT", - ["gRowCol"] = 1, - ["wrapXOffset"] = 4, - ["wrapYOffset"] = 4, - ["power"] = { - ["enable"] = true, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["name"] = { - ["font"] = "SVUI Default Font", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["raid25"] = { - width = 50, - height = 30, - ["showBy"] = "DOWN_RIGHT", - ["gRowCol"] = 1, - ["wrapXOffset"] = 4, - ["wrapYOffset"] = 4, - ["power"] = { - ["enable"] = true, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["name"] = { - ["font"] = "SVUI Default Font", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["raid40"] = { + ["raid"] = { width = 50, height = 30, ["showBy"] = "DOWN_RIGHT", @@ -1049,55 +909,7 @@ local function LoadPresetData() ["yOffset"] = 1, }, }, - ["raid10"] = { - ["showBy"] = "UP_RIGHT", - ["gRowCol"] = 2, - ["wrapXOffset"] = 4, - ["wrapYOffset"] = 4, - ["power"] = { - ["enable"] = false, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERLEFT", - ["xOffset"] = 10, - ["yOffset"] = 1, - }, - }, - ["name"] = { - ["font"] = "Roboto", - ["position"] = "CENTER", - ["xOffset"] = 0, - ["yOffset"] = 1, - }, - ["width"] = 80, - ["height"] = 20, - }, - ["raid25"] = { - ["showBy"] = "UP_RIGHT", - ["gRowCol"] = 3, - ["wrapXOffset"] = 4, - ["wrapYOffset"] = 4, - ["power"] = { - ["enable"] = false, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERLEFT", - ["xOffset"] = 10, - ["yOffset"] = 1, - }, - }, - ["name"] = { - ["font"] = "Roboto", - ["position"] = "CENTER", - ["xOffset"] = 0, - ["yOffset"] = 1, - }, - ["width"] = 80, - ["height"] = 20, - }, - ["raid40"] = { + ["raid"] = { ["showBy"] = "UP_RIGHT", ["gRowCol"] = 4, ["wrapXOffset"] = 4, @@ -1139,21 +951,7 @@ local function LoadPresetData() enable = false, }, }, - ["raid10"] = { - ["gridAllowed"] = true, - ["wrapXOffset"] = 1, - ["wrapYOffset"] = 1, - ["gRowCol"] = 1, - ["showBy"] = "RIGHT_DOWN", - }, - ["raid25"] = { - ["gridAllowed"] = true, - ["wrapXOffset"] = 1, - ["wrapYOffset"] = 1, - ["gRowCol"] = 1, - ["showBy"] = "RIGHT_DOWN", - }, - ["raid40"] = { + ["raid"] = { ["gridAllowed"] = true, ["wrapXOffset"] = 1, ["wrapYOffset"] = 1, diff --git a/Interface/AddOns/SVUI/system/_load.xml b/Interface/AddOns/SVUI/system/_load.xml index 0b76b94..bd23c8e 100644 --- a/Interface/AddOns/SVUI/system/_load.xml +++ b/Interface/AddOns/SVUI/system/_load.xml @@ -1,15 +1,11 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> <Script file="core.lua"/> + <Script file="screen.lua"/> <Script file="configs.lua"/> <Script file="media.lua"/> <Script file="utilities.lua"/> <Script file="visibility.lua"/> - <Script file="screen.lua"/> - <Script file="templates.lua"/> - <Script file="docks.lua"/> <Script file="slash.lua"/> <Script file="alerts.lua"/> - <Script file="moveable.lua"/> - <Script file="mentalo.lua"/> <Script file="credits.lua"/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/alerts.lua b/Interface/AddOns/SVUI/system/alerts.lua index 7fc39ad..bd87485 100644 --- a/Interface/AddOns/SVUI/system/alerts.lua +++ b/Interface/AddOns/SVUI/system/alerts.lua @@ -197,6 +197,14 @@ SV.SystemAlert["RESET_UI_CHECK"] = { timeout = 0, whileDead = 1 }; +SV.SystemAlert["RESETDOCKS_CHECK"] = { + text = L["Are you sure you want to reset every dock button back to it's default position?"], + button1 = ACCEPT, + button2 = CANCEL, + OnAccept = function(a)SV.Dock:ResetAllButtons()end, + timeout = 0, + whileDead = 1 +}; SV.SystemAlert["CONFIRM_LOOT_DISTRIBUTION"] = { text = CONFIRM_LOOT_DISTRIBUTION, button1 = YES, @@ -913,10 +921,10 @@ function SV:LoadSystemAlerts() fgtex:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\SAVED-FG") SetConfigAlertAnim(configAlert.fg) - SV.Animate:Orbit(configAlert.bg, 10, false, true) + self.Animate:Orbit(configAlert.bg, 10, false, true) end for i = 1, 4 do - local alert = CreateFrame("Frame", "SVUI_SystemAlert"..i, SV.Screen, "StaticPopupTemplate") + local alert = CreateFrame("Frame", "SVUI_SystemAlert"..i, self.Screen, "StaticPopupTemplate") alert:SetID(i) alert:SetScript("OnShow", SysPop_Event_Show) alert:SetScript("OnHide", SysPop_Event_Hide) diff --git a/Interface/AddOns/SVUI/system/configs.lua b/Interface/AddOns/SVUI/system/configs.lua index 9ed41f0..41f5fea 100644 --- a/Interface/AddOns/SVUI/system/configs.lua +++ b/Interface/AddOns/SVUI/system/configs.lua @@ -19,12 +19,10 @@ GET ADDON DATA local SV = select(2, ...) local playerClass = select(2, UnitClass("player")); -local rez = GetCVar("gxResolution"); -local gxWidth = tonumber(rez:match("(%d+)x%d+")); -local bw = gxWidth * 0.5 -local defaultStatBarWidth = min(bw, 800) - local filterClass = playerClass or "NONE" +local rez = GetCVar("gxResolution"); +local defaultDockWidth = tonumber(rez:match("(%d+)x%d+")) * 0.5; +local defaultCenterWidth = min(defaultDockWidth, 800); local function safename(id) local n = GetSpellInfo(id) @@ -107,6 +105,7 @@ SV.configs["media"] = { ["colors"] = { ["default"] = {0.2, 0.2, 0.2, 1}, ["special"] = {0.37, 0.32, 0.29, 1}, + ["specialdark"] = {0.37, 0.32, 0.29, 1}, }, ["unitframes"] = { ["health"] = {0.3, 0.5, 0.3}, @@ -448,6 +447,7 @@ SV.configs["SVBag"] = { SV.configs["SVChat"] = { ["enable"] = true, + ["docked"] = "BottomLeft", ["tabHeight"] = 20, ["tabWidth"] = 75, ["tabStyled"] = true, @@ -476,21 +476,14 @@ SV.configs["Dock"] = { ["dockLeftWidth"] = 412, ["dockLeftHeight"] = 224, ["dockRightWidth"] = 412, - ["dockRightHeight"] = 224, + ["dockRightHeight"] = 224, + ["dockCenterWidth"] = defaultCenterWidth, ["buttonSize"] = 30, ["buttonSpacing"] = 4, ["leftDockBackdrop"] = true, ["rightDockBackdrop"] = true, ["topPanel"] = true, ["bottomPanel"] = true, - ["docklets"] = { - ["DockletMain"] = "None", - ["MainWindow"] = "None", - ["DockletExtra"] = "None", - ["ExtraWindow"] = "None", - ["enableExtra"] = false, - ["DockletCombatFade"] = true - }, }; SV.configs["SVGear"] = { @@ -633,28 +626,27 @@ SV.configs["SVPlate"] = { SV.configs["SVStats"] = { ["enable"] = true, ["font"] = "SVUI Number Font", - ["fontSize"] = 12, + ["fontSize"] = 11, ["fontOutline"] = "OUTLINE", - ["showBackground"] = true, + ["showBackground"] = false, ["shortGold"] = true, - ["dockStatWidth"] = defaultStatBarWidth, - ["panels"] = { - ["SVUI_StatsBar4"] = { - ["right"] = "Bags", - ["left"] = "Friends", - ["middle"] = "Guild", - }, - ["SVUI_StatsBar3"] = { - ["left"] = "Time", - ["middle"] = "System", - ["right"] = "Gold", - }, - ["SVUI_StatsBar1"] = { - ["left"] = "Durability Bar", - ["middle"] = "Reputation Bar", - ["right"] = "Experience Bar", + ["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_StatsBar2"] = { + ["SVUI_DockTopCenterRight"] = { ["left"] = "None", ["middle"] = "None", ["right"] = "None", @@ -663,10 +655,6 @@ SV.configs["SVStats"] = { ["localtime"] = true, ["time24"] = false, ["battleground"] = true, - ["topLeftDockPanel"] = true, - ["bottomLeftDockPanel"] = true, - ["bottomRightDockPanel"] = true, - ["panelTransparency"] = false, }; SV.configs["SVTip"] = { @@ -691,6 +679,12 @@ SV.configs["SVTip"] = { }, }; +SV.configs["SVTools"] = { + ["enable"] = true, + ["professions"] = true, + ["breakStuff"] = true, +}; + SV.configs["SVUnit"] = { ["enable"] = true, ["disableBlizzard"] = true, @@ -2416,305 +2410,8 @@ SV.configs["SVUnit"] = { ["camDistanceScale"] = 1, ["style"] = "3D", }, - }, - ["raid10"] = { - ["enable"] = true, - ["gridAllowed"] = true, - ["rangeCheck"] = true, - ["threatEnabled"] = true, - ["visibility"] = "[@raid6, noexists][@raid11, exists][nogroup] hide;show", - ["showBy"] = "RIGHT_DOWN", - ["wrapXOffset"] = 8, - ["wrapYOffset"] = 8, - ["groupCount"] = 2, - ["gRowCol"] = 1, - ["sortMethod"] = "GROUP", - ["sortDir"] = "ASC", - ["showPlayer"] = true, - ["predict"] = false, - ["colorOverride"] = "USE_DEFAULT", - ["width"] = 75, - ["height"] = 34, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 4, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "BOTTOM", - ["orientation"] = "HORIZONTAL", - ["frequentUpdates"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = true, - ["tags"] = "", - ["frequentUpdates"] = false, - ["height"] = 4, - ["position"] = "BOTTOMRIGHT", - ["hideonnpc"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "INNERTOPLEFT", - ["tags"] = "[name:color][name:4]", - ["yOffset"] = 0, - ["xOffset"] = 8, - ["font"] = "SVUI Default Font", - ["fontSize"] = 10, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = true, - ["filterRaid"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = true, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = false, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["auraWatch"] = - { - ["enable"] = true, - ["size"] = 8, - }, - ["rdebuffs"] = - { - ["enable"] = true, - ["size"] = 26, - ["xOffset"] = 0, - ["yOffset"] = 2, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 15, - ["attachTo"] = "INNERBOTTOMRIGHT", - ["xOffset"] = -8, - ["yOffset"] = 0, - }, - ["roleIcon"] = - { - ["enable"] = true, - ["size"] = 12, - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - ["raidRoleIcons"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "TOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = -4, - }, - }, - }, - ["raid25"] = { - ["enable"] = true, - ["gridAllowed"] = true, - ["rangeCheck"] = true, - ["threatEnabled"] = true, - ["visibility"] = "[@raid11, noexists][@raid26, exists][nogroup] hide;show", - ["showBy"] = "RIGHT_DOWN", - ["wrapXOffset"] = 8, - ["wrapYOffset"] = 8, - ["groupCount"] = 5, - ["gRowCol"] = 1, - ["sortMethod"] = "GROUP", - ["sortDir"] = "ASC", - ["showPlayer"] = true, - ["predict"] = false, - ["colorOverride"] = "USE_DEFAULT", - ["width"] = 50, - ["height"] = 30, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 4, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "BOTTOM", - ["orientation"] = "HORIZONTAL", - ["frequentUpdates"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = true, - ["tags"] = "", - ["height"] = 4, - ["position"] = "BOTTOMRIGHT", - ["hideonnpc"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "INNERTOPLEFT", - ["tags"] = "[name:color][name:4]", - ["yOffset"] = 0, - ["xOffset"] = 8, - ["font"] = "SVUI Default Font", - ["fontSize"] = 10, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = true, - ["filterRaid"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = true, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = false, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["auraWatch"] = - { - ["enable"] = true, - ["size"] = 8, - }, - ["rdebuffs"] = - { - ["enable"] = true, - ["size"] = 26, - ["xOffset"] = 0, - ["yOffset"] = 2, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 15, - ["attachTo"] = "INNERBOTTOMRIGHT", - ["xOffset"] = -8, - ["yOffset"] = 0, - }, - ["roleIcon"] = - { - ["enable"] = true, - ["size"] = 12, - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - ["raidRoleIcons"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "TOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = -4, - }, - }, - }, - ["raid40"] = { + }, + ["raid"] = { ["enable"] = true, ["gridAllowed"] = true, ["rangeCheck"] = true, diff --git a/Interface/AddOns/SVUI/system/core.lua b/Interface/AddOns/SVUI/system/core.lua index d94bcf4..518fb4a 100644 --- a/Interface/AddOns/SVUI/system/core.lua +++ b/Interface/AddOns/SVUI/system/core.lua @@ -59,7 +59,6 @@ local IsAddOnLoaded = _G.IsAddOnLoaded; local InCombatLockdown = _G.InCombatLockdown; local GetAddOnInfo = _G.GetAddOnInfo; local LoadAddOn = _G.LoadAddOn; -local SendAddonMessage = _G.SendAddonMessage; local LibStub = _G.LibStub; local GetAddOnMetadata = _G.GetAddOnMetadata; local GetCVarBool = _G.GetCVarBool; @@ -100,7 +99,6 @@ local SVLib = LibSuperVillain("Registry"); local callbacks = {}; local numCallbacks = 0; local playerClass = select(2, UnitClass("player")); -local actualWidth, actualHeight = UIParent:GetSize() local messagePattern = "|cffFF2F00%s:|r"; local debugPattern = "|cffFF2F00%s|r [|cff992FFF%s|r]|cffFF2F00:|r"; local errorPattern = "|cffff0000Error -- |r|cffff9900Required addon '|r|cffffff00%s|r|cffff9900' is %s.|r" @@ -217,13 +215,10 @@ end local SVUI = SVLib:NewCore("SVUI_Global", "SVUI_Errors", "SVUI_Profile", "SVUI_Cache") SVUI.ConfigID = "SVUI_ConfigOMatic"; -SVUI.class = playerClass -SVUI.ClassRole = "" -SVUI.UnitRole = "NONE" -SVUI.ConfigurationMode = false -SVUI.EffectiveScale = 1 -SVUI.yScreenArea = (actualHeight * 0.33) -SVUI.xScreenArea = (actualWidth * 0.33) +SVUI.class = playerClass; +SVUI.ClassRole = ""; +SVUI.UnitRole = "NONE"; +SVUI.ConfigurationMode = false; --[[ EMBEDDED LIBS ]]-- @@ -231,15 +226,13 @@ SVUI.L = LibSuperVillain("Linguist"):Lang(); SVUI.Animate = LibSuperVillain("Animate"); SVUI.Timers = LibSuperVillain("Timers"); ---[[ UTILITY FRAMES ]]-- - SVUI.Screen = CreateFrame("Frame", "SVUIParent", UIParent); SVUI.Screen:SetFrameLevel(UIParent:GetFrameLevel()); SVUI.Screen:SetPoint("CENTER", UIParent, "CENTER"); SVUI.Screen:SetSize(UIParent:GetSize()); -SVUI.Cloaked = CreateFrame("Frame", nil, UIParent); -SVUI.Cloaked:Hide(); +SVUI.Hidden = CreateFrame("Frame", nil, UIParent); +SVUI.Hidden:Hide(); SVUI.Options = { type = "group", @@ -332,7 +325,7 @@ end function SVUI:ResetAllUI(confirmed) if InCombatLockdown()then - SendAddonMessage(ERR_NOT_IN_COMBAT) + self:AddonMessage(ERR_NOT_IN_COMBAT) return end if(not confirmed) then @@ -344,7 +337,7 @@ end function SVUI:ResetUI(confirmed) if InCombatLockdown()then - SendAddonMessage(ERR_NOT_IN_COMBAT) + self:AddonMessage(ERR_NOT_IN_COMBAT) return end if(not confirmed) then @@ -362,7 +355,7 @@ end function SVUI:ToggleConfig() if InCombatLockdown() then - SendAddonMessage(ERR_NOT_IN_COMBAT) + self:AddonMessage(ERR_NOT_IN_COMBAT) self:RegisterEvent('PLAYER_REGEN_ENABLED') return end @@ -412,10 +405,8 @@ end function SVUI:RefreshEverything(bypass) self:RefreshAllSystemMedia(); - self.Screen:Hide(); self.Mentalo:SetPositions(); SVLib:RefreshAll(); - self.Screen:Show(); if not bypass then self:VersionCheck() end @@ -527,28 +518,16 @@ end function SVUI:Initialize() SVLib:Initialize(); - local rez = GetCVar("gxResolution"); - local gxHeight = tonumber(match(rez,"%d+x(%d+)")); - local gxWidth = tonumber(match(rez,"(%d+)x%d+")); - - self.DisplaySettings = SVLib:NewGlobal("Display") - if(not self.DisplaySettings.screenheight or (self.DisplaySettings.screenheight and type(self.DisplaySettings.screenheight) ~= "number")) then - self.DisplaySettings.screenheight = gxHeight - end - if(not self.DisplaySettings.screenwidth or (self.DisplaySettings.screenwidth and type(self.DisplaySettings.screenwidth) ~= "number")) then - self.DisplaySettings.screenwidth = gxWidth - end - self:UI_SCALE_CHANGED() self:RefreshSystemFonts(); self:LoadSystemAlerts(); + self.Timers:Initialize(); - self.Dock:Initialize(); - self.Mentalo:Initialize(); - self.safedata = SVLib:GetSafeData(); + self:LoadFramework(); + self.safedata = SVLib:GetSafeData(); SVLib:Launch(); diff --git a/Interface/AddOns/SVUI/system/docks.lua b/Interface/AddOns/SVUI/system/docks.lua deleted file mode 100644 index 46d8feb..0000000 --- a/Interface/AddOns/SVUI/system/docks.lua +++ /dev/null @@ -1,1226 +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 ---[[ -########################################################## -LOCALS -########################################################## -]]-- -local ICONFILE = [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-BAG-MICRO]]; -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} ---[[ -########################################################## -DOCKING -########################################################## -]]-- -local Dock = SV:NewSubClass("Dock", L["Docks"]); - -Dock.Docklets = { - Windows = {}, - Buttons = {}, - Registered = {}, - Allowed = { - ["alDamageMeter"] = L["alDamageMeter"], - ["Skada"] = L["Skada"], - ["Recount"] = L["Recount"], - ["TinyDPS"] = L["TinyDPS"], - ["Omen"] = L["Omen"] - } -}; - -Dock.DefaultDocklet = ""; -Dock.DockletWindows = {}; -Dock.DockletButtons = {}; -Dock.HandledDocklets = {}; - -local addonDock1 = CreateFrame("Frame", "SVUI_DockedAddon1", UIParent, "SVUI_DockletWindowTemplate"); -local addonDock2 = CreateFrame("Frame", "SVUI_DockedAddon2", UIParent, "SVUI_DockletWindowTemplate"); - -Dock.Border = {}; -Dock.Addons = {addonDock1, addonDock2}; -Dock.Dropdown = CreateFrame("Frame", "SVUI_DockDropdown", UIParent); - --- MAIN REGIONS -Dock.Left = _G["SVUI_DockLeft"] -Dock.BarLeft = _G["SVUI_DockBarLeft"] -Dock.BarLeft.Docklets = { - Anchor = "LEFT", - Modifier = 1, - Default = "" -}; -Dock.BarLeft.Parent = Dock.Left; - -Dock.Right = _G["SVUI_DockRight"] -Dock.BarRight = _G["SVUI_DockBarRight"] -Dock.BarRight.Docklets = { - Anchor = "RIGHT", - Modifier = -1, - Default = "" -}; -Dock.BarRight.Parent = Dock.Right; - -Dock.Top = _G["SVUI_DockTop"] ---[[ -########################################################## -SET DOCKBAR FUNCTIONS -########################################################## -]]-- -local RefreshDockButtons = function(self) - local list = Dock.Docklets.Windows - for i=1, #list do - local docklet = list[i] - if(not InCombatLockdown() or (InCombatLockdown() and (docklet.IsProtected and not docklet:IsProtected()))) then - local button = _G[docklet.ToggleName] - if(button) then - button:Deactivate() - end - if docklet.Hide then - docklet:Hide() - end - end - end -end - -Dock.BarLeft.Refresh = RefreshDockButtons -Dock.BarRight.Refresh = RefreshDockButtons - -local GetDefault = function(self) - local window = self.Docklets.Default - if window and _G[window] then - self.Parent.Window.FrameName = window - self.Parent.Window:Show() - end -end - -Dock.BarLeft.GetDefault = GetDefault -Dock.BarRight.GetDefault = GetDefault - -local ToggleDockletWindow = function(self, button) - local frameName = button.FrameName - local window = _G[frameName]; - if(window) then - self.Parent.Window.FrameName = frameName - if(not window:IsShown()) then - self:Refresh() - end - - if(not Dock.Right.Window:IsShown()) then - self.Parent.Window:Show() - end - - window:Show() - if(Dock.AddonButton:IsShown()) then - Dock.AddonButton:Deactivate() - end - button:Activate() - else - button:Deactivate() - self:GetDefault() - end -end - -Dock.BarLeft.Toggle = ToggleDockletWindow -Dock.BarRight.Toggle = ToggleDockletWindow ---[[ -########################################################## -SET ALERT FUNCTIONS -########################################################## -]]-- -local AlertActivate = function(self, child) - local size = SV.db.Dock.buttonSize or 22; - self:Height(size) - child:ClearAllPoints() - child:SetAllPoints(self) -end - -Dock.Left.Alert.Activate = AlertActivate -Dock.Right.Alert.Activate = AlertActivate - -local AlertDeactivate = function(self) - self:Height(1) -end - -Dock.Left.Alert.Deactivate = AlertDeactivate -Dock.Right.Alert.Deactivate = AlertDeactivate ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -_G.HideSuperDocks = function() - GameTooltip:Hide() - if SV.cache.Docks.IsFaded then - SV.cache.Docks.IsFaded = nil; - SV:SecureFadeIn(Dock.Left, 0.2, Dock.Left:GetAlpha(), 1) - SV:SecureFadeIn(Dock.Right, 0.2, Dock.Right:GetAlpha(), 1) - else - SV.cache.Docks.IsFaded = true; - SV:SecureFadeOut(Dock.Left, 0.2, Dock.Left:GetAlpha(), 0, true) - SV:SecureFadeOut(Dock.Right, 0.2, Dock.Right:GetAlpha(), 0, true) - end -end ---[[ -########################################################## -PRE VARS/FUNCTIONS -########################################################## -]]-- -local DD_OnClick = function(self) - self.func() - self:GetParent():Hide() -end - -local DD_OnEnter = function(self) - self.hoverTex:Show() -end - -local DD_OnLeave = function(self) - self.hoverTex:Hide() -end - -local function _locate(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 - -function Dock:GetLiveDocklets() - local test = SV.db.Dock.docklets.DockletMain; - local t = {{text = "None", func = function() SV.db.Dock.docklets.DockletMain = "None"; Dock:ReloadAddonDocklets() end}}; - for n,l in pairs(SV.Dock.Docklets.Allowed) do - if IsAddOnLoaded(n) or IsAddOnLoaded(l) then - if (not test:find(n)) then - if n == "Skada" and _G.Skada then - for index,window in pairs(_G.Skada:GetWindows()) do - local keyName = window.db.name - local key = "SkadaBarWindow" .. keyName - local name = (keyName == "Skada") and "Skada - Main" or "Skada - " .. keyName; - tinsert(t,{text = name, func = function() SV.db.Dock.docklets.DockletMain = key; Dock:ReloadAddonDocklets() end}); - end - else - tinsert(t,{text = n, func = function() SV.db.Dock.docklets.DockletMain = l; Dock:ReloadAddonDocklets() end}); - end - end - end - end - return t; -end - -function Dock:SetFilterMenu(parent) - if not self.Dropdown.buttons then - self.Dropdown.buttons = {} - self.Dropdown:SetFrameStrata("DIALOG") - self.Dropdown:SetClampedToScreen(true) - tinsert(UISpecialFrames, self.Dropdown:GetName()) - self.Dropdown:Hide() - end - local maxPerColumn = 25 - local cols = 1 - for i=1, #self.Dropdown.buttons do - self.Dropdown.buttons[i]:Hide() - end - - local list = self:GetLiveDocklets() - - for i=1, #list do - if not self.Dropdown.buttons[i] then - self.Dropdown.buttons[i] = CreateFrame("Button", nil, Dock.Dropdown) - self.Dropdown.buttons[i].hoverTex = self.Dropdown.buttons[i]:CreateTexture(nil, 'OVERLAY') - self.Dropdown.buttons[i].hoverTex:SetAllPoints() - self.Dropdown.buttons[i].hoverTex:SetTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]]) - self.Dropdown.buttons[i].hoverTex:SetBlendMode("ADD") - self.Dropdown.buttons[i].hoverTex:Hide() - self.Dropdown.buttons[i].text = self.Dropdown.buttons[i]:CreateFontString(nil, 'BORDER') - self.Dropdown.buttons[i].text:SetAllPoints() - self.Dropdown.buttons[i].text:SetFont(SV.Media.font.roboto,12,"OUTLINE") - self.Dropdown.buttons[i].text:SetJustifyH("LEFT") - self.Dropdown.buttons[i]:SetScript("OnEnter", DD_OnEnter) - self.Dropdown.buttons[i]:SetScript("OnLeave", DD_OnLeave) - end - self.Dropdown.buttons[i]:Show() - self.Dropdown.buttons[i]:SetHeight(16) - self.Dropdown.buttons[i]:SetWidth(135) - self.Dropdown.buttons[i].text:SetText(list[i].text) - self.Dropdown.buttons[i].func = list[i].func - self.Dropdown.buttons[i]:SetScript("OnClick", DD_OnClick) - if i == 1 then - self.Dropdown.buttons[i]:SetPoint("TOPLEFT", self.Dropdown, "TOPLEFT", 10, -10) - elseif((i -1) % maxPerColumn == 0) then - self.Dropdown.buttons[i]:SetPoint("TOPLEFT", self.Dropdown.buttons[i - maxPerColumn], "TOPRIGHT", 10, 0) - cols = cols + 1 - else - self.Dropdown.buttons[i]:SetPoint("TOPLEFT", self.Dropdown.buttons[i - 1], "BOTTOMLEFT") - end - end - - local maxHeight = (min(maxPerColumn, #list) * 16) + 20 - local maxWidth = (135 * cols) + (10 * cols) - self.Dropdown:SetSize(maxWidth, maxHeight) - self.Dropdown:ClearAllPoints() - local point = _locate(parent:GetParent()) - if point:find("BOTTOM") then - self.Dropdown:SetPoint("BOTTOMLEFT", parent, "TOPLEFT", 10, 10) - else - self.Dropdown:SetPoint("TOPLEFT", parent, "BOTTOMLEFT", 10, -10) - end - ToggleFrame(self.Dropdown) -end - -function Dock:EnterFade() - if SV.cache.Docks.IsFaded then - self.Left:Show() - SV:SecureFadeIn(self.Left, 0.2, self.Left:GetAlpha(), 1) - self.Right:Show() - SV:SecureFadeIn(self.Right, 0.2, self.Right:GetAlpha(), 1) - end -end - -function Dock:ExitFade() - if SV.cache.Docks.IsFaded then - SV:SecureFadeOut(self.Left, 0.2, self.Left:GetAlpha(), 0, true) - SV:SecureFadeOut(self.Right, 0.2, self.Right:GetAlpha(), 0, true) - end -end - -local Docklet_OnShow = function(self) - if(_G[Dock.Right.Window.FrameName]) then - if(InCombatLockdown() and (_G[Dock.Right.Window.FrameName].IsProtected and _G[Dock.Right.Window.FrameName]:IsProtected())) then return end - _G[Dock.Right.Window.FrameName]:Show() - end - if _G[Dock.Right.Window.SecondName] then - if(InCombatLockdown() and (_G[Dock.Right.Window.SecondName].IsProtected and _G[Dock.Right.Window.SecondName]:IsProtected())) then return end - _G[Dock.Right.Window.SecondName]:Show() - end -end - -local DockButtonActivate = function(self) - self:SetAttribute("isActive", true) - self:SetPanelColor("green") - self.Icon:SetGradient(unpack(SV.Media.gradient.green)) -end - -local DockButtonDeactivate = function(self) - self:SetAttribute("isActive", false) - self:SetPanelColor("default") - self.Icon:SetGradient(unpack(SV.Media.gradient.icon)) -end - -local DockletButton_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() - if(self.CustomTooltip) then - self:CustomTooltip() - else - local tipText = self:GetAttribute("tipText") - GameTooltip:AddLine(tipText, 1, 1, 1) - 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(button == "RightButton" and self:GetAttribute("hasDropDown")) then - Dock:SetFilterMenu(self); - else - if self.PostClickFunction then - self:PostClickFunction() - else - self.Parent:Toggle(self) - end - end -end - -local DockletFrame_OnShow = function(self) - local frameName = self.FrameName; - if (frameName and _G[frameName]) then - _G[frameName]:Show() - end -end - -local AddonDockletToggle = function(self) - if addonDock1.FrameName and _G[addonDock1.FrameName] then - if not _G[addonDock1.FrameName]:IsShown() then - self.Parent:Refresh() - if not InCombatLockdown() and not addonDock1:IsShown()then - addonDock1:Show() - end - _G[addonDock1.FrameName]:Show() - self:Activate() - elseif not addonDock1:IsShown()then - if not InCombatLockdown() then addonDock1:Show() end - _G[addonDock1.FrameName]:Show() - self:Activate() - end - else - addonDock1.FrameName = "None" - if InCombatLockdown()then return end - if addonDock1:IsShown()then - addonDock1:Hide() - else - addonDock1:Show() - end - self:Deactivate() - self.Parent:Refresh() - end - if SV.db.Dock.docklets.enableExtra and addonDock2.FrameName and _G[addonDock2.FrameName] then - if not _G[addonDock2.FrameName]:IsShown() then - if not InCombatLockdown() and not addonDock2:IsShown()then - addonDock2:Show() - addonDock1:Show() - end - _G[addonDock2.FrameName]:Show() - self:Activate() - elseif not addonDock2:IsShown() then - if not InCombatLockdown() then - addonDock2:Show() - addonDock1:Show() - end - _G[addonDock2.FrameName]:Show() - self:Activate() - else - if not InCombatLockdown() then - addonDock2:Hide() - addonDock1:Hide() - end - self:Deactivate() - self.Parent:Refresh() - end - else - addonDock2.FrameName = "None" - end -end ---[[ -########################################################## -DOCKLET HELPERS -########################################################## -]]-- -local AddToDock = function(self, button) - local name = button:GetName(); - if Dock.Docklets.Registered[name] then return end - Dock.Docklets.Registered[name] = true; - local anchor = self.Docklets.Anchor - local mod = self.Docklets.Modifier - local height = self.ToolBar:GetHeight(); - local xOffset = #Dock.Docklets.Buttons * (height + 6) + 6 - button:SetPoint(anchor, self.ToolBar, anchor, (xOffset * mod), 0); - tinsert(Dock.Docklets.Buttons, button) - button.listIndex = #Dock.Docklets.Buttons; - button:Show() - local newWidth = xOffset + (height + 12) - self.ToolBar:SetWidth(newWidth) -end - -Dock.BarLeft.Add = AddToDock -Dock.BarRight.Add = AddToDock - -local RemoveFromDock = function(self, button) - if not button or not button.listIndex then return end - local name = button:GetName(); - if not Dock.Docklets.Registered[name] then return end - Dock.Docklets.Registered[name] = nil; - local index = button.listIndex; - tremove(Dock.Docklets.Buttons, index) - button:Hide() - local height = self.ToolBar:GetHeight(); - local anchor = self.Docklets.Anchor - local mod = self.Docklets.Modifier - local xOffset - for i = 1, #Dock.Docklets.Buttons do - local nextButton = Dock.Docklets.Buttons[i] - xOffset = (i - 1) * (height + 6) + 6 - nextButton:ClearAllPoints() - nextButton:SetPoint(anchor, self.ToolBar, anchor, (xOffset * mod), 0); - end - local newWidth = xOffset + (height + 12) - self.ToolBar:SetWidth(newWidth) -end - -Dock.BarLeft.Remove = RemoveFromDock -Dock.BarRight.Remove = RemoveFromDock - -local ActivateDockletButton = function(self, button, clickFunction, tipFunction, isdefault) - button.Activate = DockButtonActivate - button.Deactivate = DockButtonDeactivate - - 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) - button:SetScript("OnClick", DockletButton_OnClick) - - if(clickFunction and type(clickFunction) == "function") then - button.PostClickFunction = clickFunction - end - - if(isdefault) then - self.Docklets.Default = button:GetAttribute("ownerFrame") - button:Activate() - end -end - -Dock.BarLeft.Initialize = ActivateDockletButton -Dock.BarRight.Initialize = ActivateDockletButton - -local CreateBasicToolButton = function(self, name, texture, onclick, frameName, isdefault, doNotAdd) - local fName = frameName or name; - local dockIcon = texture or [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-ADDON]]; - local size = self.ToolBar:GetHeight(); - local button = _G[fName .. "DockletButton"] or CreateFrame("Button", ("%sDockletButton"):format(fName), self.ToolBar, "SVUI_DockletButtonTemplate") - - if(not doNotAdd) then - self:Add(button) - end - - button:RegisterForClicks("AnyUp") - button:Size(size,size) - button:SetFramedButtonTemplate() - button.Icon:SetTexture(dockIcon) - button:SetAttribute("tipText", "Open " .. name) - button:SetAttribute("ownerFrame", fName) - button.IsRegistered = false; - button.FrameName = fName - - self:Initialize(button, onclick, nil, isdefault) - - if(_G[fName]) then - _G[fName].ToggleName = fName.."DockletButton"; - end - - return button -end - -Dock.BarLeft.Create = CreateBasicToolButton -Dock.BarRight.Create = CreateBasicToolButton ---[[ -########################################################## -DOCKS -########################################################## -]]-- -local function SetSuperDockStyle(dock) - if dock.backdrop then return end - 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) - backdrop.left:SetGradientAlpha("VERTICAL", 0, 0, 0, 1, 0, 0, 0, 0) - 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) - backdrop.right:SetGradientAlpha("VERTICAL", 0, 0, 0, 1, 0, 0, 0, 0) - backdrop.bottom = backdrop:CreateTexture(nil, "OVERLAY") - backdrop.bottom:SetTexture(0, 0, 0, 1) - backdrop.bottom:Point("BOTTOMLEFT", 1, -1) - backdrop.bottom:Point("BOTTOMRIGHT", -1, -1) - backdrop.bottom:Height(4) - backdrop.top = backdrop:CreateTexture(nil, "OVERLAY") - backdrop.top:SetTexture(0,0,0,0) - backdrop.top:Point("TOPLEFT", 1, -1) - backdrop.top:Point("TOPRIGHT", -1, 1) - backdrop.top:SetAlpha(0) - backdrop.top:Height(1) - return backdrop -end - -function Dock:CreateDockPanels() - local leftWidth = SV.db.Dock.dockLeftWidth or 350; - local leftHeight = SV.db.Dock.dockLeftHeight or 180; - local rightWidth = SV.db.Dock.dockRightWidth or 350; - local rightHeight = SV.db.Dock.dockRightHeight or 180; - local buttonsize = SV.db.Dock.buttonSize or 22; - local spacing = SV.db.Dock.buttonSpacing or 4; - local texture = [[Interface\AddOns\SVUI\assets\artwork\Template\BUTTON]]; - - -- [[ TOP AND BOTTOM BORDERS ]] -- - - self.Border.Top = CreateFrame("Frame", "SVUITopBorder", SV.Screen) - 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.special)) - 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", SV.Screen) - 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() - - -- [[ BOTTOM LEFT DOCK ]] -- - - self.BarLeft:SetParent(SV.Screen) - self.BarLeft:Size(leftWidth, buttonsize) - self.BarLeft:SetPoint("BOTTOMLEFT", SV.Screen, "BOTTOMLEFT", 2, 2) - self.BarLeft.Button:Size(buttonsize, buttonsize) - self.BarLeft.Button:SetFramedButtonTemplate() - self.BarLeft.Button.Icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\SVUI-EMBLEM]]) - self.BarLeft.Button:SetAttribute("tipText", L["Toggle Docks"]) - self.BarLeft.Button:SetAttribute("hasDropDown", true) - self.BarLeft.Button:RegisterForClicks("AnyUp") - self.BarLeft.ToolBar:Point("LEFT", self.BarLeft.Button, "RIGHT", spacing, 0) - self.BarLeft.ToolBar:Height(buttonsize) - self.BarLeft.ExtraBar:Point("LEFT", self.BarLeft.ToolBar, "RIGHT", spacing, 0) - self.BarLeft.ExtraBar:Size(leftWidth, buttonsize) - - self.Left:SetParent(SV.Screen) - self.Left:SetPoint("BOTTOMLEFT", self.BarLeft, "TOPLEFT", 0, 12) - self.Left:Size(leftWidth, leftHeight) - self.Left:SetAttribute("buttonSize", buttonsize) - self.Left:SetAttribute("spacingSize", spacing) - - self.Left.Alert.Activate = AlertActivate - self.Left.Alert.Deactivate = AlertDeactivate - self.Left.backdrop = SetSuperDockStyle(self.Left.Window) - - self.BarLeft:Initialize(self.BarLeft.Button, HideSuperDocks) - - SV.Mentalo:Add(self.BarLeft, L["Left Dock ToolBar"]) - SV.Mentalo:Add(self.Left, L["Left Dock Window"]) - - -- [[ BOTTOM RIGHT DOCK ]] -- - - self.BarRight:SetParent(SV.Screen) - self.BarRight:Size(rightWidth, buttonsize) - self.BarRight:Point("BOTTOMRIGHT", SV.Screen, "BOTTOMRIGHT", -2, 2) - self.BarRight.Button:Size(buttonsize, buttonsize) - self.BarRight.Button:SetFramedButtonTemplate() - self.BarRight.Button.Icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-HENCHMAN]]) - self.BarRight.Button:SetAttribute("tipText", "Call Henchman!") - self.BarRight.Button:SetAttribute("hasDropDown", true) - self.BarRight.Button:RegisterForClicks("AnyUp") - self.BarRight.ToolBar:Point("RIGHT", self.BarRight.Button, "LEFT", -spacing, 0) - self.BarRight.ToolBar:Height(buttonsize) - self.BarRight.ExtraBar:Point("RIGHT", self.BarRight.ToolBar, "LEFT", -spacing, 0) - self.BarRight.ExtraBar:Size(rightWidth, buttonsize) - - self.Right:SetParent(SV.Screen) - self.Right:Point("BOTTOMRIGHT", self.BarRight, "TOPRIGHT", 0, 12) - self.Right:Size(rightWidth, rightHeight) - self.Right:SetAttribute("buttonSize", buttonsize) - self.Right:SetAttribute("spacingSize", spacing) - self.Right.Window:Size(rightWidth, rightHeight - (buttonsize + 4)) - self.Right.Alert.Activate = AlertActivate - self.Right.Alert.Deactivate = AlertDeactivate - self.Right.backdrop = SetSuperDockStyle(self.Right.Window) - - self.BarRight:Initialize(self.BarRight.Button, SV.ToggleHenchman) - - SV.Mentalo:Add(self.BarRight, L["Right Dock ToolBar"]) - SV.Mentalo:Add(self.Right, L["Right Dock Window"]) - - if SV.cache.Docks.IsFaded then Dock.Left:Hide() Dock.Right:Hide() end - - -- [[ ADDON DOCKLET BUTTON ]] -- - - self.AddonButton = self.BarRight:Create("Addon Dock", nil, AddonDockletToggle, "SVUI_DockRightToolBar", nil, true) - self.AddonButton:SetAttribute("hasDropDown", true) - - -- [[ TOP LEFT DOCK ]] -- - - self.Top:SetParent(SV.Screen) - self.Top:Point("TOPLEFT", SV.Screen, "TOPLEFT", 1, -2) - self.Top:Size(leftWidth, leftHeight) - self.Top:SetAttribute("buttonSize", buttonsize) - self.Top:SetAttribute("spacingSize", spacing) - self.Top.ToolBar:Size(1, buttonsize) - - SV.Mentalo:Add(self.Top, L["Top Dock"]) - - --RIGHT CLICK MENU - - self.Dropdown:SetParent(SV.Screen) - self.Dropdown:SetPanelTemplate("Default") - self.Dropdown.buttons = {} - self.Dropdown:SetFrameStrata("DIALOG") - self.Dropdown:SetClampedToScreen(true) - - for i = 1, 4 do - self.Dropdown.buttons[i] = CreateFrame("Button", nil, self.Dropdown) - - self.Dropdown.buttons[i].hoverTex = self.Dropdown.buttons[i]:CreateTexture(nil, 'OVERLAY') - self.Dropdown.buttons[i].hoverTex:SetAllPoints() - self.Dropdown.buttons[i].hoverTex:SetTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]]) - self.Dropdown.buttons[i].hoverTex:SetBlendMode("ADD") - self.Dropdown.buttons[i].hoverTex:Hide() - - self.Dropdown.buttons[i].activeTex = self.Dropdown.buttons[i]:CreateTexture(nil, 'OVERLAY') - self.Dropdown.buttons[i].activeTex:SetAllPoints() - self.Dropdown.buttons[i].activeTex:SetTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]]) - self.Dropdown.buttons[i].activeTex:SetVertexColor(0,0.7,0) - self.Dropdown.buttons[i].activeTex:SetBlendMode("ADD") - self.Dropdown.buttons[i].activeTex:Hide() - - self.Dropdown.buttons[i].text = self.Dropdown.buttons[i]:CreateFontString(nil, 'BORDER') - self.Dropdown.buttons[i].text:SetAllPoints() - self.Dropdown.buttons[i].text:SetFont(SV.Media.font.roboto,12,"OUTLINE") - self.Dropdown.buttons[i].text:SetJustifyH("LEFT") - self.Dropdown.buttons[i].text:SetText(("Option %d"):format(i)) - - self.Dropdown.buttons[i]:SetHeight(16) - self.Dropdown.buttons[i]:SetWidth(115) - - self.Dropdown.buttons[i]:SetScript("OnEnter", DD_OnEnter) - self.Dropdown.buttons[i]:SetScript("OnLeave", DD_OnLeave) - self.Dropdown.buttons[i]:SetScript("OnClick", DD_OnClick) - - if i == 1 then - self.Dropdown.buttons[i]:SetPoint("TOPLEFT", self.Dropdown, "TOPLEFT", 10, -10) - else - self.Dropdown.buttons[i]:SetPoint("TOPLEFT", self.Dropdown.buttons[i - 1], "BOTTOMLEFT", 0, 0) - end - - self.Dropdown.buttons[i]:Show() - end - - self.Dropdown:SetSize(135, 94) - self.Dropdown:Hide() - - SV:AddToDisplayAudit(self.Right.Window) - SV:AddToDisplayAudit(self.Dropdown) - - self.Right.Window:SetScript("OnShow", Docklet_OnShow) - - if not InCombatLockdown()then - self.BarLeft:Refresh() - self.BarRight:Refresh() - end -end - -local function BorderColorUpdates() - Dock.Border.Top:SetBackdropColor(unpack(SV.Media.color.special)) - 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 - -SV:NewCallback(BorderColorUpdates) - -do - 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") - if(not text2) then - GameTooltip:AddLine(text1, 1, 1, 1) - else - 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) - GameTooltip:AddLine(L["Hearthstone"], 1, 1, 1) - if InCombatLockdown() then return end - local remaining = GetMacroCooldown(6948) - GameTooltip:AddDoubleLine(L["Time Remaining"], remaining, 1, 1, 1, 0, 1, 1) - local extraText = self:GetAttribute("tipExtraText") - if(extraText) then - GameTooltip:AddLine(" ", 1, 1, 1) - GameTooltip:AddDoubleLine(extraText, "[Right Click]", 1, 1, 1, 0, 1, 0) - end - end - - local function CreateMacroToolButton(proName, proID, itemID, size) - local data = TOOL_DATA[proID] - if(not data) then return end - local button = CreateFrame("Button", ("%s_MacroBarButton"):format(itemID), Dock.BarRight.ToolBar, "SecureActionButtonTemplate,SVUI_DockletButtonTemplate") - button:Size(size, size) - Dock.BarRight:Add(button) - button:SetFramedButtonTemplate() - button.Icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\PROFESSIONS]]) - button.Icon:SetTexCoord(data[1], data[2], data[3], data[4]) - button.Icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - button:SetAttribute("tipText", "Open " .. proName) - - if proID == 186 then proName = "Smelting" end - - if(data[5]) then - local rightClick - button:RegisterForClicks("AnyDown") - 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("type", "macro") - button:SetAttribute("macrotext", "/cast [button:2] " .. rightClick .. ";" .. proName) - else - button:SetAttribute("type", "macro") - button:SetAttribute("macrotext", "/cast " .. proName) - end - - button.CustomTooltip = SetMacroTooltip - button:SetPanelColor("default") - button.Icon:SetGradient(unpack(SV.Media.gradient.icon)) - button:SetScript("OnEnter", DockletButton_OnEnter) - button:SetScript("OnLeave", DockletButton_OnLeave) - end - - function Dock:LoadToolBarProfessions() - if(Dock.ToolBarLoaded) then return end - if(InCombatLockdown()) then Dock:RegisterEvent("PLAYER_REGEN_ENABLED"); return end - local size = Dock.BarRight.ToolBar:GetHeight() - local hearth = CreateFrame("Button", "SVUI_HearthButton", Dock.BarRight.ToolBar, "SecureActionButtonTemplate, SVUI_DockletButtonTemplate") - hearth:Size(size, size) - Dock.BarRight:Add(hearth) - hearth:SetFramedButtonTemplate() - hearth.Icon:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Icons\\DOCK-HEARTH") - hearth.Icon:SetTexCoord(0,0.5,0,1) - hearth:RegisterForClicks("AnyUp") - hearth:SetAttribute("type", "item") - hearth:SetAttribute("item", GetItemInfo(6948)) - - hearth.CustomTooltip = SetHearthTooltip - hearth:SetPanelColor("default") - hearth.Icon:SetGradient(unpack(SV.Media.gradient.icon)) - hearth:SetScript("OnEnter", DockletButton_OnEnter) - hearth:SetScript("OnLeave", DockletButton_OnLeave) - - for i = 1, #HEARTH_SPELLS do - if(IsSpellKnown(HEARTH_SPELLS[i])) then - local rightClickSpell = GetSpellInfo(HEARTH_SPELLS[i]) - hearth:SetAttribute("type2", "spell") - hearth:SetAttribute("spell", rightClickSpell) - hearth:SetAttribute("tipExtraText", rightClickSpell) - end - end - - local proName, proID - local prof1, prof2, archaeology, _, cooking, firstAid = GetProfessions() - if(firstAid ~= nil) then - proName, _, _, _, _, _, proID = GetProfessionInfo(firstAid) - CreateMacroToolButton(proName, proID, firstAid, size) - end - if(archaeology ~= nil) then - proName, _, _, _, _, _, proID = GetProfessionInfo(archaeology) - CreateMacroToolButton(proName, proID, archaeology, size) - end - if(cooking ~= nil) then - proName, _, _, _, _, _, proID = GetProfessionInfo(cooking) - CreateMacroToolButton(proName, proID, cooking, size) - end - if(prof2 ~= nil) then - proName, _, _, _, _, _, proID = GetProfessionInfo(prof2) - if(proID ~= 182 and proID ~= 393) then - CreateMacroToolButton(proName, proID, prof2, size) - end - end - if(prof1 ~= nil) then - proName, _, _, _, _, _, proID = GetProfessionInfo(prof1) - if(proID ~= 182 and proID ~= 393) then - CreateMacroToolButton(proName, proID, prof1, size) - end - end - Dock.ToolBarLoaded = true - end -end ---[[ -########################################################## -EXTERNALLY ACCESSIBLE METHODS -########################################################## -]]-- -SV.CurrentlyDocked = {}; - -function Dock:IsDockletReady(arg) - local addon = arg; - if arg == "DockletMain" or arg == "DockletExtra" then - addon = SV.db.Dock.docklets[arg] - end - if addon == nil or addon == "None" then - return false - end - return true -end - -do - local function UnregisterDocklet(name) - local frame = _G[name]; - if not frame or not frame.listIndex then return end - local i = frame.listIndex; - tremove(Dock.DockletWindows, i) - end - - function Dock:ReloadAddonDocklets(alert) - if InCombatLockdown() then return end - - local frame, i; - twipe(SV.CurrentlyDocked); - if self:IsDockletReady("DockletMain") then - frame = SV.db.Dock.docklets.MainWindow - if frame ~= nil and frame ~= "None" and _G[frame] then - UnregisterDocklet(frame) - SV.db.Dock.docklets.MainWindow = "None" - end - elseif self.AddonButton.IsRegistered then - self.BarRight:Remove(self.AddonButton) - self.AddonButton:SetAttribute("tipText", "") - self.AddonButton.IsRegistered = false; - end - if self:IsDockletReady("DockletExtra") then - frame = SV.db.Dock.docklets.ExtraWindow - if frame ~= nil and frame ~= "None" and _G[frame] then - UnregisterDocklet(frame) - SV.db.Dock.docklets.ExtraWindow = "None" - end - end - addonDock1.FrameName = "None" - addonDock2.FrameName = "None" - - local width,height = Dock.Right.Window:GetSize(); - - if self:IsDockletReady('DockletMain') then - if self:IsDockletReady("DockletExtra") and SV.db.Dock.docklets.enableExtra then - width = width * 0.5; - end - addonDock1:ClearAllPoints() - addonDock1:Size(width,height) - addonDock1:Point('BOTTOMLEFT',Dock.Right.Window,'BOTTOMLEFT',1,1) - addonDock2:ClearAllPoints() - addonDock2:Size(width,height) - addonDock2:Point('BOTTOMLEFT',addonDock1,'BOTTOMRIGHT',0,0) - end - end -end - - -function Dock:RegisterDocklet(name, readableName, texture, onclick, isdefault) - local frame = _G[name]; - if frame and (frame.IsObjectType and frame:IsObjectType("Frame")) and (frame.IsProtected and not frame:IsProtected()) then - frame:ClearAllPoints() - frame:SetParent(self.Right.Window) - frame:FillInner(self.Right.Window, 4, 4) - frame.FrameName = name; - tinsert(self.Docklets.Windows, frame); - frame.listIndex = #self.Docklets.Windows; - frame.DockButton = self.BarRight:Create(readableName, texture, onclick, name, isdefault) - end -end - -function Dock:RegisterMainDocklet(name) - local frame = _G[name]; - if (frame and (frame.IsObjectType and frame:IsObjectType("Frame")) and (frame.IsProtected and not frame:IsProtected())) then - addonDock1.FrameName = name; - SV.db.Dock.docklets.MainWindow = name; - frame:ClearAllPoints() - frame:SetParent(addonDock1) - frame:SetAllPoints(addonDock1) - frame.ToggleName = "SVUI_DockRightToolBarAddonButton"; - tinsert(self.Docklets.Windows, frame); - frame.listIndex = #self.Docklets.Windows; - self.BarRight:Add(self.AddonButton) - self.AddonButton:SetAttribute("tipText", "") - self.AddonButton.IsRegistered = true - SV.CurrentlyDocked[name] = true - if not InCombatLockdown() and frame:IsShown() then frame:Hide() end - end -end - -function Dock:RegisterExtraDocklet(name) - local frame = _G[name]; - if (frame and (frame.IsObjectType and frame:IsObjectType("Frame")) and (frame.IsProtected and not frame:IsProtected())) then - addonDock2.FrameName = name; - SV.db.Dock.docklets.ExtraWindow = name; - frame:ClearAllPoints() - frame:SetParent(addonDock2) - frame:SetAllPoints(addonDock2) - frame.ToggleName = "SVUI_DockRightToolBarAddonButton"; - tinsert(self.Docklets.Windows, frame); - frame.listIndex = #self.Docklets.Windows; - self.AddonButton:SetAttribute("tipText", "") - SV.CurrentlyDocked[name] = true; - if not InCombatLockdown() and frame:IsShown() then frame:Hide() end - end -end ---[[ -########################################################## -BUILD/UPDATE -########################################################## -]]-- -function Dock:UpdateDockBackdrops() - if SV.db.Dock.rightDockBackdrop then - Dock.Right.backdrop:Show() - Dock.Right.backdrop:ClearAllPoints() - Dock.Right.backdrop:WrapOuter(Dock.Right.Window, 4, 4) - else - Dock.Right.backdrop:Hide() - end - if SV.db.Dock.leftDockBackdrop then - Dock.Left.backdrop:Show() - Dock.Left.backdrop:ClearAllPoints() - Dock.Left.backdrop:WrapOuter(Dock.Left.Window, 4, 4) - else - Dock.Left.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:PLAYER_REGEN_ENABLED() - self:UnregisterEvent('PLAYER_REGEN_ENABLED') - self:LoadToolBarProfessions() -end - -function Dock:Refresh() - local leftWidth = SV.db.Dock.dockLeftWidth or 350; - local leftHeight = SV.db.Dock.dockLeftHeight or 180; - local rightWidth = SV.db.Dock.dockRightWidth or 350; - local rightHeight = SV.db.Dock.dockRightHeight or 180; - local buttonsize = SV.db.Dock.buttonSize or 22; - local spacing = SV.db.Dock.buttonSpacing or 4; - - self.BarLeft:Size(leftWidth, buttonsize) - self.Left:Size(leftWidth, leftHeight) - self.Left.Window:Size(leftWidth, leftHeight - (buttonsize + 4)) - self.BarRight:Size(rightWidth, buttonsize) - self.Right:Size(rightWidth, rightHeight) - self.Right.Window:Size(rightWidth, rightHeight - (buttonsize + 4)) - - self:BottomBorderVisibility(); - self:TopBorderVisibility(); - self:UpdateDockBackdrops(); - self:ReloadAddonDocklets() -end - -function Dock:Initialize() - SV.cache.Docks = SV.cache.Docks or {} - - if(not SV.cache.Docks.IsFaded) then - SV.cache.Docks.IsFaded = false - end - - self:CreateDockPanels() - - self:UpdateDockBackdrops() - addonDock1:SetFrameLevel(self.Right.Window:GetFrameLevel() + 50) - addonDock2:SetFrameLevel(self.Right.Window:GetFrameLevel() + 50) - - local size = self.BarRight.ToolBar:GetHeight(); - - addonDock1:SetScript("OnShow", DockletFrame_OnShow) - addonDock2:SetScript("OnShow", DockletFrame_OnShow) - self:ReloadAddonDocklets(true) - - SV.Timers:ExecuteTimer(self.LoadToolBarProfessions, 5) -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/media.lua b/Interface/AddOns/SVUI/system/media.lua index 709625c..193771a 100644 --- a/Interface/AddOns/SVUI/system/media.lua +++ b/Interface/AddOns/SVUI/system/media.lua @@ -146,6 +146,7 @@ do SV.Media["color"] = { ["default"] = {0.2, 0.2, 0.2, 1}, ["special"] = {.37, .32, .29, 1}, + ["specialdark"] = {.23, .22, .21, 1}, ["unique"] = {0.32, 0.258, 0.21, 1}, ["class"] = {r1, g1, b1, 1}, ["bizzaro"] = {ir1, ig1, ib1, 1}, @@ -251,12 +252,13 @@ function SV:HexColor(arg1,arg2,arg3) end function SV:MediaUpdate() - self.Media.color.default = self.db.media.colors.default - self.Media.color.special = self.db.media.colors.special - self.Media.bg.pattern = LSM:Fetch("background", self.db.media.textures.pattern) - self.Media.bg.comic = LSM:Fetch("background", self.db.media.textures.comic) - self.Media.bg.unitlarge = LSM:Fetch("background", self.db.media.textures.unitlarge) - self.Media.bg.unitsmall = LSM:Fetch("background", self.db.media.textures.unitsmall) + self.Media.color.default = self.db.media.colors.default + self.Media.color.special = self.db.media.colors.special + self.Media.color.specialdark = self.db.media.colors.specialdark + self.Media.bg.pattern = LSM:Fetch("background", self.db.media.textures.pattern) + self.Media.bg.comic = LSM:Fetch("background", self.db.media.textures.comic) + self.Media.bg.unitlarge = LSM:Fetch("background", self.db.media.textures.unitlarge) + self.Media.bg.unitsmall = LSM:Fetch("background", self.db.media.textures.unitsmall) local cColor1 = self.Media.color.special local cColor2 = self.Media.color.default @@ -265,7 +267,7 @@ function SV:MediaUpdate() self.Media.gradient.special = {"VERTICAL",r1,g1,b1,r2,g2,b2} - SVLib:RunCallbacks() + SVLib:Trigger("CORE_MEDIA_UPDATED"); end function SV:RefreshSystemFonts() @@ -334,7 +336,7 @@ function SV:RefreshSystemFonts() SetFont("NumberFont_Shadow_Small", UNICODE_FONT, unicodesize, "OUTLINE") SetFont("SystemFont_Tiny", UNICODE_FONT, unicodesize) - self:UpdateFontTemplates() + self:UpdateManagedFonts() end function SV:RefreshAllSystemMedia() diff --git a/Interface/AddOns/SVUI/system/mentalo.lua b/Interface/AddOns/SVUI/system/mentalo.lua deleted file mode 100644 index aaa5339..0000000 --- a/Interface/AddOns/SVUI/system/mentalo.lua +++ /dev/null @@ -1,869 +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 Mentalo = {} - -Mentalo.Frames = {} - -local MentaloUpdateHandler = CreateFrame("Frame", nil) - -local Sticky = {}; -Sticky.Frames = {}; -Sticky.Frames[1] = SV.Screen; -Sticky.scripts = Sticky.scripts or {} -Sticky.rangeX = 15 -Sticky.rangeY = 15 -Sticky.sticky = Sticky.sticky or {} - -local function SnapStickyFrame(frameA, frameB, left, top, right, bottom) - local sA, sB = frameA:GetEffectiveScale(), frameB:GetEffectiveScale() - local xA, yA = frameA:GetCenter() - local xB, yB = frameB:GetCenter() - local hA, hB = frameA:GetHeight() / 2, ((frameB:GetHeight() * sB) / sA) / 2 - local wA, wB = frameA:GetWidth() / 2, ((frameB:GetWidth() * sB) / sA) / 2 - local newX, newY = xA, yA - if not left then left = 0 end - if not top then top = 0 end - if not right then right = 0 end - if not bottom then bottom = 0 end - if not xB or not yB or not sB or not sA or not sB then return end - xB, yB = (xB * sB) / sA, (yB * sB) / sA - local stickyAx, stickyAy = wA * 0.75, hA * 0.75 - local stickyBx, stickyBy = wB * 0.75, hB * 0.75 - local lA, tA, rA, bA = frameA:GetLeft(), frameA:GetTop(), frameA:GetRight(), frameA:GetBottom() - local lB, tB, rB, bB = frameB:GetLeft(), frameB:GetTop(), frameB:GetRight(), frameB:GetBottom() - local snap = nil - lB, tB, rB, bB = (lB * sB) / sA, (tB * sB) / sA, (rB * sB) / sA, (bB * sB) / sA - if (bA <= tB and bB <= tA) then - if xA <= (xB + Sticky.rangeX) and xA >= (xB - Sticky.rangeX) then - newX = xB - snap = true - end - if lA <= (lB + Sticky.rangeX) and lA >= (lB - Sticky.rangeX) then - newX = lB + wA - if frameB == UIParent or frameB == WorldFrame or frameB == SVUIParent then - newX = newX + 4 - end - snap = true - end - if rA <= (rB + Sticky.rangeX) and rA >= (rB - Sticky.rangeX) then - newX = rB - wA - if frameB == UIParent or frameB == WorldFrame or frameB == SVUIParent then - newX = newX - 4 - end - snap = true - end - if lA <= (rB + Sticky.rangeX) and lA >= (rB - Sticky.rangeX) then - newX = rB + (wA - left) - snap = true - end - if rA <= (lB + Sticky.rangeX) and rA >= (lB - Sticky.rangeX) then - newX = lB - (wA - right) - snap = true - end - end - if (lA <= rB and lB <= rA) then - if yA <= (yB + Sticky.rangeY) and yA >= (yB - Sticky.rangeY) then - newY = yB - snap = true - end - if tA <= (tB + Sticky.rangeY) and tA >= (tB - Sticky.rangeY) then - newY = tB - hA - if frameB == UIParent or frameB == WorldFrame or frameB == SVUIParent then - newY = newY - 4 - end - snap = true - end - if bA <= (bB + Sticky.rangeY) and bA >= (bB - Sticky.rangeY) then - newY = bB + hA - if frameB == UIParent or frameB == WorldFrame or frameB == SVUIParent then - newY = newY + 4 - end - snap = true - end - if tA <= (bB + Sticky.rangeY + bottom) and tA >= (bB - Sticky.rangeY + bottom) then - newY = bB - (hA - top) - snap = true - end - if bA <= (tB + Sticky.rangeY - top) and bA >= (tB - Sticky.rangeY - top) then - newY = tB + (hA - bottom) - snap = true - end - end - if snap then - frameA:ClearAllPoints() - frameA:SetPoint("CENTER", UIParent, "BOTTOMLEFT", newX, newY) - return true - end -end - -function Sticky:GetStickyUpdate(frame, xoffset, yoffset, left, top, right, bottom) - return function() - local x, y = GetCursorPosition() - local s = frame:GetEffectiveScale() - local sticky = nil - x, y = x / s, y / s - frame:ClearAllPoints() - frame:SetPoint("CENTER", UIParent, "BOTTOMLEFT", x + xoffset, y + yoffset) - self.sticky[frame] = nil - for i = 1, #Sticky.Frames do - local v = Sticky.Frames[i] - if(frame ~= v and frame ~= v:GetParent() and not IsShiftKeyDown() and v:IsVisible()) then - if SnapStickyFrame(frame, v, left, top, right, bottom) then - self.sticky[frame] = v - break - end - end - end - end -end - -function Sticky:StartMoving(frame, left, top, right, bottom) - local x, y = GetCursorPosition() - local aX, aY = frame:GetCenter() - local aS = frame:GetEffectiveScale() - aX, aY = aX * aS, aY * aS - local xoffset, yoffset = (aX - x), (aY - y) - self.scripts[frame] = frame:GetScript("OnUpdate") - frame:SetScript("OnUpdate", Sticky.GetStickyUpdate(Sticky, frame, xoffset, yoffset, left, top, right, bottom)) -end - -function Sticky:StopMoving(frame) - frame:SetScript("OnUpdate", self.scripts[frame]) - self.scripts[frame] = nil - if self.sticky[frame] then - local sticky = self.sticky[frame] - self.sticky[frame] = nil - return true, sticky - else - return false, nil - end -end ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local CurrentFrameTarget, UpdateFrameTarget; ---[[ -########################################################## -LOCAL FUNCTIONS -########################################################## -]]-- -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 CurrentPosition(frame) - if not frame then return end - local anchor1, parent, anchor2, x, y = frame:GetPoint() - local parentName - if not parent then - parentName = "SVUIParent" - elseif not parent:GetName() then - parentName = "SVUI_Player" - else - parentName = parent:GetName() - end - return ("%s\031%s\031%s\031%d\031%d"):format(anchor1, parentName, anchor2, parsefloat(x), parsefloat(y)) -end - -local function GrabUsableRegions(frame) - local parent = frame or SV.Screen - local right = parent:GetRight() - local top = parent:GetTop() - local center = parent:GetCenter() - return right, top, center -end - -local function CalculateOffsets(frame) - if(not CurrentFrameTarget) then return end - local right, top, center = GrabUsableRegions() - local xOffset, yOffset = CurrentFrameTarget:GetCenter() - local screenLeft = (right * 0.33); - local screenRight = (right * 0.66); - local topMedian = (top * 0.5); - local anchor, a1, a2; - - if(yOffset >= (top * 0.5)) then - a1 = "TOP" - yOffset = -(top - CurrentFrameTarget:GetTop()) - else - a1 = "BOTTOM" - yOffset = CurrentFrameTarget:GetBottom() - end - - if xOffset >= screenRight then - a2 = "RIGHT" - xOffset = (CurrentFrameTarget:GetRight() - right) - elseif xOffset <= screenLeft then - a2 = "LEFT" - xOffset = CurrentFrameTarget:GetLeft() - else - a2 = "" - xOffset = (xOffset - center) - end - - xOffset = parsefloat(xOffset, 0) - yOffset = parsefloat(yOffset, 0) - anchor = ("%s%s"):format(a1,a2) - - return xOffset, yOffset, anchor -end - -local function ResetAllAlphas() - for entry,_ in pairs(Mentalo.Frames) do - local frame = _G[entry] - if(frame) then - frame:SetAlpha(0.4) - end - end -end - ---[[ - /$$$$$$$$/$$ /$$ /$$$$$$$$ /$$ /$$ /$$$$$$ /$$ /$$ /$$$$$$$ -|__ $$__/ $$ | $$| $$_____/ | $$ | $$ /$$__ $$| $$$ | $$| $$__ $$ - | $$ | $$ | $$| $$ | $$ | $$| $$ \ $$| $$$$| $$| $$ \ $$ - | $$ | $$$$$$$$| $$$$$ | $$$$$$$$| $$$$$$$$| $$ $$ $$| $$ | $$ - | $$ | $$__ $$| $$__/ | $$__ $$| $$__ $$| $$ $$$$| $$ | $$ - | $$ | $$ | $$| $$ | $$ | $$| $$ | $$| $$\ $$$| $$ | $$ - | $$ | $$ | $$| $$$$$$$$ | $$ | $$| $$ | $$| $$ \ $$| $$$$$$$/ - |__/ |__/ |__/|________/ |__/ |__/|__/ |__/|__/ \__/|_______/ ---]] - -local TheHand = CreateFrame("Frame", "SVUI_HandOfMentalo", SV.Screen) -TheHand:SetFrameStrata("DIALOG") -TheHand:SetFrameLevel(99) -TheHand:SetClampedToScreen(true) -TheHand:SetSize(128,128) -TheHand:SetPoint("CENTER") -TheHand.bg = TheHand:CreateTexture(nil, "OVERLAY") -TheHand.bg:SetAllPoints(TheHand) -TheHand.bg:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-HAND-OFF]]) -TheHand.energy = TheHand:CreateTexture(nil, "OVERLAY") -TheHand.energy:SetAllPoints(TheHand) -TheHand.energy:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-ENERGY]]) -SV.Animate:Orbit(TheHand.energy, 10) -TheHand.flash = TheHand.energy.anim; -TheHand.energy:Hide() -TheHand.elapsedTime = 0; -TheHand.flash:Stop() -TheHand:Hide() -TheHand.UserHeld = false; - -local TheHand_OnUpdate = function(self, elapsed) - self.elapsedTime = self.elapsedTime + elapsed - if self.elapsedTime > 0.1 then - self.elapsedTime = 0 - local x, y = GetCursorPosition() - local scale = SV.Screen:GetEffectiveScale() - self:SetPoint("CENTER", SV.Screen, "BOTTOMLEFT", (x / scale) + 50, (y / scale) + 50) - end -end - -function TheHand:Enable() - self:Show() - self.bg:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-HAND-ON]]) - self.energy:Show() - self.flash:Play() - self:SetScript("OnUpdate", TheHand_OnUpdate) -end - -function TheHand:Disable() - self.flash:Stop() - self.energy:Hide() - self.bg:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-HAND-OFF]]) - self:SetScript("OnUpdate", nil) - self.elapsedTime = 0 - self:Hide() -end ---[[ -########################################################## -HANDLERS -########################################################## -]]-- -local Movable_OnMouseUp = function(self) - CurrentFrameTarget = self; - local xOffset, yOffset, anchor = CalculateOffsets() - - SVUI_MentaloPrecisionSetX.CurrentValue = xOffset; - SVUI_MentaloPrecisionSetX:SetText(xOffset) - - SVUI_MentaloPrecisionSetY.CurrentValue = yOffset; - SVUI_MentaloPrecisionSetY:SetText(yOffset) - - SVUI_MentaloPrecision.Title:SetText(self.textString) -end - -local Movable_OnUpdate = function(self) - local frame = UpdateFrameTarget; - if not frame then return end - local rightPos, topPos, centerPos = GrabUsableRegions() - local centerX, centerY = frame:GetCenter() - local calc1 = rightPos * 0.33; - local calc2 = rightPos * 0.66; - local calc3 = topPos * 0.5; - local anchor1, anchor2; - 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) - Movable_OnMouseUp(frame) -end - -local Movable_OnSizeChanged = function(self) - if InCombatLockdown()then return end - if self.dirtyWidth and self.dirtyHeight then - self.Avatar:Size(self.dirtyWidth, self.dirtyHeight) - else - self.Avatar:Size(self:GetSize()) - end -end - -local Movable_OnDragStart = function(self) - if InCombatLockdown() then SV:AddonMessage(ERR_NOT_IN_COMBAT)return end - if SV.db.general.stickyFrames then - Sticky:StartMoving(self, self.snapOffset, self.snapOffset, self.snapOffset, self.snapOffset) - else - self:StartMoving() - end - UpdateFrameTarget = self; - MentaloUpdateHandler:Show() - MentaloUpdateHandler:SetScript("OnUpdate", Movable_OnUpdate) - TheHand:Enable() - TheHand.UserHeld = true -end - -local Movable_OnDragStop = function(self) - if InCombatLockdown()then SV:AddonMessage(ERR_NOT_IN_COMBAT)return end - TheHand.UserHeld = false; - if SV.db.general.stickyFrames then - Sticky:StopMoving(self) - else - self:StopMovingOrSizing() - end - local pR, pT, pC = GrabUsableRegions() - local cX, cY = self:GetCenter() - local newAnchor; - if cY >= (pT * 0.5) then - newAnchor = "TOP"; - cY = (-(pT - self:GetTop())) - else - newAnchor = "BOTTOM" - cY = self:GetBottom() - end - if cX >= (pR * 0.66) then - newAnchor = newAnchor.."RIGHT" - cX = self:GetRight() - pR - elseif cX <= (pR * 0.33) then - newAnchor = newAnchor.."LEFT" - cX = self:GetLeft() - else - cX = cX - pC - end - if self.positionOverride then - self.parent:ClearAllPoints() - self.parent:Point(self.positionOverride, self, self.positionOverride) - end - - self:ClearAllPoints() - self:Point(newAnchor, SV.Screen, newAnchor, cX, cY) - - Mentalo:SaveMovable(self.name) - - if SVUI_MentaloPrecision then - Movable_OnMouseUp(self) - end - - UpdateFrameTarget = nil; - - MentaloUpdateHandler:SetScript("OnUpdate", nil) - MentaloUpdateHandler:Hide() - - if(self.postdrag ~= nil and type(self.postdrag) == "function") then - self:postdrag(Pinpoint(self)) - end - self:SetUserPlaced(false) - TheHand:Disable() -end - -local Movable_OnEnter = function(self) - if TheHand.UserHeld then return end - ResetAllAlphas() - self:SetAlpha(1) - self.text:SetTextColor(1, 1, 1) - UpdateFrameTarget = self; - SVUI_Mentalo.Avatar:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-ON]]) - TheHand:SetPoint("CENTER", self, "TOP", 0, 0) - TheHand:Show() - if CurrentFrameTarget ~= self then - SVUI_MentaloPrecision:Hide() - Movable_OnMouseUp(self) - end -end - -local Movable_OnLeave = function(self) - if TheHand.UserHeld then return end - self.text:SetTextColor(0.1, 0.8, 0.8) - SVUI_Mentalo.Avatar:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-OFF]]) - TheHand:Hide() - if(CurrentFrameTarget ~= self and not SVUI_MentaloPrecision:IsShown()) then - self:SetAlpha(0.4) - end -end - -local Movable_OnMouseDown = function(self, arg) - if arg == "RightButton"then - TheHand.UserHeld = false; - if(CurrentFrameTarget == self and not SVUI_MentaloPrecision:IsShown()) then - Movable_OnUpdate() - SVUI_MentaloPrecision:Show() - else - SVUI_MentaloPrecision:Hide() - end - if SV.db.general.stickyFrames then - Sticky:StopMoving(self) - else - self:StopMovingOrSizing() - end - end -end - -local Movable_OnShow = function(self) - self:SetBackdropBorderColor(0.1, 0.8, 0.8) -end ---[[ -########################################################## -CONSTRUCTS -########################################################## -]]-- -function Mentalo:New(frame, moveName, title, raised, snap, dragStopFunc) - if(not frame) then return end - if self.Frames[moveName].Created then return end - if raised == nil then raised = true end - - local movable = CreateFrame("Button", moveName, SV.Screen) - movable:SetFrameLevel(frame:GetFrameLevel() + 1) - movable:SetClampedToScreen(true) - movable:SetWidth(frame:GetWidth()) - movable:SetHeight(frame:GetHeight()) - - movable.parent = frame; - movable.name = moveName; - movable.textString = title; - movable.postdrag = dragStopFunc; - movable.overlay = raised; - movable.snapOffset = snap or -2; - - if raised == true then - movable:SetFrameStrata("DIALOG") - else - movable:SetFrameStrata("BACKGROUND") - end - - local anchor1, anchorParent, anchor2, xPos, yPos = split("\031", CurrentPosition(frame)) - if(SV.cache.Anchors and SV.cache.Anchors[moveName]) then - if(type(SV.cache.Anchors[moveName]) == "table") then - movable:SetPoint(SV.cache.Anchors[moveName]["p"], SV.Screen, SV.cache.Anchors[moveName]["p2"], SV.cache.Anchors[moveName]["p3"], SV.cache.Anchors[moveName]["p4"]) - SV.cache.Anchors[moveName] = CurrentPosition(movable) - movable:ClearAllPoints() - end - anchor1, anchorParent, anchor2, xPos, yPos = split("\031", SV.cache.Anchors[moveName]) - movable:SetPoint(anchor1, anchorParent, anchor2, xPos, yPos) - else - movable:SetPoint(anchor1, anchorParent, anchor2, xPos, yPos) - end - - movable:SetFixedPanelTemplate("Transparent") - movable:SetAlpha(0.4) - - self.Frames[moveName].Avatar = movable; - Sticky.Frames[#Sticky.Frames + 1] = movable; - - frame:SetScript("OnSizeChanged", Movable_OnSizeChanged) - frame.Avatar = movable; - frame:ClearAllPoints() - frame:SetPoint(anchor1, movable, 0, 0) - - local mtext = movable:CreateFontString(nil, "OVERLAY") - mtext:SetFontTemplate() - mtext:SetJustifyH("CENTER") - mtext:SetPoint("CENTER") - mtext:SetText(title or moveName) - mtext:SetTextColor(0.1, 0.8, 0.8) - - movable:SetFontString(mtext) - movable.text = mtext; - - movable:RegisterForDrag("LeftButton", "RightButton") - movable:SetScript("OnMouseUp", Movable_OnMouseUp) - movable:SetScript("OnDragStart", Movable_OnDragStart) - movable:SetScript("OnDragStop", Movable_OnDragStop) - movable:SetScript("OnEnter", Movable_OnEnter) - movable:SetScript("OnMouseDown", Movable_OnMouseDown) - movable:SetScript("OnLeave", Movable_OnLeave) - movable:SetScript("OnShow", Movable_OnShow) - - movable:SetMovable(true) - movable:Hide() - - if dragStopFunc ~= nil and type(dragStopFunc) == "function" then - movable:RegisterEvent("PLAYER_ENTERING_WORLD") - movable:SetScript("OnEvent", function(this, event) - local point = Pinpoint(this) - dragStopFunc(this, point) - this:UnregisterAllEvents() - end) - end - - self.Frames[moveName].Created = true -end - -function Mentalo:HasMoved(frame) - if SV.cache.Anchors and SV.cache.Anchors[frame] then - return true - else - return false - end -end - -function Mentalo:SaveMovable(frame) - if(not _G[frame] or not SV.cache.Anchors) then return end - SV.cache.Anchors[frame] = CurrentPosition(_G[frame]) -end - -function Mentalo:ChangeSnapOffset(frame, snapOffset) - if not _G[frame] or not self.Frames[frame] then return end - self.Frames[frame].Avatar.snapOffset = snapOffset or -2; - self.Frames[frame]["snapoffset"] = snapOffset or -2 -end - -function Mentalo:Add(frame, title, raised, snapOffset, dragStopFunc, movableGroup, overrideName) - if(not frame or (not overrideName and not frame:GetName())) then return end - local frameName = overrideName or frame:GetName() - local moveName = ("%s_MOVE"):format(frameName) - if not movableGroup then movableGroup = "ALL, GENERAL" end - if self.Frames[moveName] == nil then - self.Frames[moveName] = {} - self.Frames[moveName]["parent"] = frame; - self.Frames[moveName]["text"] = title; - self.Frames[moveName]["overlay"] = raised; - self.Frames[moveName]["postdrag"] = dragStopFunc; - self.Frames[moveName]["snapoffset"] = snapOffset; - self.Frames[moveName]["point"] = CurrentPosition(frame) - self.Frames[moveName]["type"] = {} - local group = {split(", ", movableGroup)} - for i = 1, #group do - local this = group[i] - self.Frames[moveName]["type"][this] = true - end - end - - self:New(frame, moveName, title, raised, snapOffset, dragStopFunc) -end - -function Mentalo:Reset(request) - if request == "" or request == nil then - for name, _ in pairs(self.Frames)do - local frame = _G[name]; - if self.Frames[name]["point"] then - local u, v, w, x, y = split("\031", self.Frames[name]["point"]) - frame:ClearAllPoints() - frame:SetPoint(u, v, w, x, y) - for arg, func in pairs(self.Frames[name])do - if arg == "postdrag" and type(func) == "function" then - func(frame, Pinpoint(frame)) - end - end - end - end - if(SV.cache.Anchors) then - wipe(SV.cache.Anchors) - end - else - for name, _ in pairs(self.Frames)do - if self.Frames[name]["point"] then - for arg1, arg2 in pairs(self.Frames[name])do - local mover; - if arg1 == "text" then - if request == arg2 then - local frame = _G[name] - local u, v, w, x, y = split("\031", self.Frames[name]["point"]) - frame:ClearAllPoints() - frame:SetPoint(u, v, w, x, y) - if(SV.cache.Anchors and SV.cache.Anchors[name]) then - SV.cache.Anchors[name] = nil - end - if (self.Frames[name]["postdrag"] ~= nil and type(self.Frames[name]["postdrag"]) == "function")then - self.Frames[name]["postdrag"](frame, Pinpoint(frame)) - end - end - end - end - end - end - end -end - -function Mentalo:SetPositions() - for name, _ in pairs(self.Frames)do - local frame = _G[name]; - local anchor1, parent, anchor2, x, y; - if frame then - if (SV.cache.Anchors and SV.cache.Anchors[name] and type(SV.cache.Anchors[name]) == "string") then - anchor1, parent, anchor2, x, y = split("\031", SV.cache.Anchors[name]) - frame:ClearAllPoints() - frame:SetPoint(anchor1, parent, anchor2, x, y) - elseif self.Frames[name]["point"] then - anchor1, parent, anchor2, x, y = split("\031", self.Frames[name]["point"]) - frame:ClearAllPoints() - frame:SetPoint(anchor1, parent, anchor2, x, y) - end - end - end -end - -function Mentalo:Toggle(isConfigMode, configType) - if(InCombatLockdown()) then return end - local enabled = false; - if(isConfigMode ~= nil and isConfigMode ~= "") then - self.ConfigurationMode = isConfigMode - end - - if(not self.ConfigurationMode) then - if IsAddOnLoaded(SV.ConfigID)then - LibStub("AceConfigDialog-3.0"):Close(SV.NameID) - GameTooltip:Hide() - self.ConfigurationMode = true - else - self.ConfigurationMode = false - end - else - self.ConfigurationMode = false - end - - if(SVUI_Mentalo:IsShown()) then - SVUI_Mentalo:Hide() - else - SVUI_Mentalo:Show() - enabled = true - end - - if(not configType or (configType and type(configType) ~= "string")) then - configType = "ALL" - end - - for frameName, _ in pairs(self.Frames)do - if(_G[frameName]) then - local movable = _G[frameName] - if(not enabled) then - movable:Hide() - else - if self.Frames[frameName]["type"][configType]then - movable:Show() - else - movable:Hide() - end - end - end - end -end ---[[ -########################################################## -SCRIPT AND EVENT HANDLERS -########################################################## -]]-- -local XML_Mentalo_OnEvent = function(self) - if self:IsShown() then - self:Hide() - Mentalo:Toggle(true) - end -end - -local XML_MentaloLockButton_OnClick = function(self) - Mentalo:Toggle(true) - if IsAddOnLoaded(SV.ConfigID)then - LibStub("AceConfigDialog-3.0"):Open(SV.NameID) - end -end - -local SVUI_MentaloPrecisionResetButton_OnClick = function(self) - if(not CurrentFrameTarget) then return end - local name = CurrentFrameTarget.name - Mentalo:Reset(name) -end - -local XML_MentaloPrecisionInputX_EnterPressed = function(self) - local current = tonumber(self:GetText()) - if(current) then - if(CurrentFrameTarget) then - local xOffset, yOffset, anchor = CalculateOffsets() - yOffset = tonumber(SVUI_MentaloPrecisionSetY.CurrentValue) - CurrentFrameTarget:ClearAllPoints() - CurrentFrameTarget:Point(anchor, SVUIParent, anchor, current, yOffset) - Mentalo:SaveMovable(CurrentFrameTarget.name) - end - self.CurrentValue = current - end - self:SetText(floor((self.CurrentValue or 0) + 0.5)) - EditBox_ClearFocus(self) -end - -local XML_MentaloPrecisionInputY_EnterPressed = function(self) - local current = tonumber(self:GetText()) - if(current) then - if(CurrentFrameTarget) then - local xOffset, yOffset, anchor = CalculateOffsets() - xOffset = tonumber(SVUI_MentaloPrecisionSetX.CurrentValue) - CurrentFrameTarget:ClearAllPoints() - CurrentFrameTarget:Point(anchor, SVUIParent, anchor, xOffset, current) - Mentalo:SaveMovable(CurrentFrameTarget.name) - end - self.CurrentValue = current - end - self:SetText(floor((self.CurrentValue or 0) + 0.5)) - EditBox_ClearFocus(self) -end ---[[ -########################################################## -Initialize -########################################################## -]]-- -function Mentalo:Initialize() - SVUI_Mentalo:SetFixedPanelTemplate("Component") - SVUI_Mentalo:SetPanelColor("yellow") - SVUI_Mentalo:RegisterForDrag("LeftButton") - SVUI_Mentalo:RegisterEvent("PLAYER_REGEN_DISABLED") - SVUI_Mentalo:SetScript("OnEvent", XML_Mentalo_OnEvent) - - SVUI_MentaloLockButton:SetScript("OnClick", XML_MentaloLockButton_OnClick) - - SVUI_MentaloPrecision:SetPanelTemplate("Transparent") - SVUI_MentaloPrecision:EnableMouse(true) - - SVUI_MentaloPrecisionSetX:SetEditboxTemplate() - SVUI_MentaloPrecisionSetX.CurrentValue = 0; - SVUI_MentaloPrecisionSetX:SetScript("OnEnterPressed", XML_MentaloPrecisionInputX_EnterPressed) - - SVUI_MentaloPrecisionSetY:SetEditboxTemplate() - SVUI_MentaloPrecisionSetY.CurrentValue = 0; - SVUI_MentaloPrecisionSetY:SetScript("OnEnterPressed", XML_MentaloPrecisionInputY_EnterPressed) - - SVUI_MentaloPrecisionUpButton:SetButtonTemplate() - SVUI_MentaloPrecisionDownButton:SetButtonTemplate() - SVUI_MentaloPrecisionLeftButton:SetButtonTemplate() - SVUI_MentaloPrecisionRightButton:SetButtonTemplate() - - SV.cache.Anchors = SV.cache.Anchors or {} - - for name, _ in pairs(self.Frames)do - local parent, text, overlay, snapoffset, postdrag; - for key, value in pairs(self.Frames[name])do - if(key == "parent") then - parent = value - elseif(key == "text") then - text = value - elseif(key == "overlay") then - overlay = value - elseif(key == "snapoffset") then - snapoffset = value - elseif(key == "postdrag") then - postdrag = value - end - end - self:New(parent, name, text, overlay, snapoffset, postdrag) - end - - self:SetPositions() -end - -SV.Mentalo = Mentalo \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/moveable.lua b/Interface/AddOns/SVUI/system/moveable.lua deleted file mode 100644 index 7426602..0000000 --- a/Interface/AddOns/SVUI/system/moveable.lua +++ /dev/null @@ -1,173 +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 type = _G.type; -local pairs = _G.pairs; -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 Movable = CreateFrame("Frame", nil) -local MovableFrames = {} -MovableFrames["GameMenuFrame"] = {} ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local DraggableFrames = { - "AchievementFrame", - "AuctionFrame", - "ArchaeologyFrame", - "BattlefieldMinimap", - "BarberShopFrame", - "BlackMarketFrame", - "CalendarFrame", - "CharacterFrame", - "ClassTrainerFrame", - "DressUpFrame", - "EncounterJournal", - "FriendsFrame", - "GameMenuFrame", - "GMSurveyFrame", - "GossipFrame", - "GuildFrame", - "GuildBankFrame", - "GuildRegistrarFrame", - "HelpFrame", - "InterfaceOptionsFrame", - "ItemUpgradeFrame", - "KeyBindingFrame", - "LFGDungeonReadyPopup", - "MacOptionsFrame", - "MacroFrame", - "MailFrame", - "MerchantFrame", - "PlayerTalentFrame", - "PetJournalParent", - "PVEFrame", - "PVPFrame", - "QuestFrame", - "QuestLogFrame", - "RaidBrowserFrame", - "ReadyCheckFrame", - "ReforgingFrame", - "ReportCheatingDialog", - "ReportPlayerNameDialog", - "RolePollPopup", - "ScrollOfResurrectionSelectionFrame", - "SpellBookFrame", - "TabardFrame", - "TaxiFrame", - "TimeManagerFrame", - "TradeSkillFrame", - "TradeFrame", - "TransmorgifyFrame", - "TutorialFrame", - "VideoOptionsFrame", - "VoidStorageFrame", - --"WorldStateAlwaysUpFrame" -}; ---[[ -########################################################## -LOCAL FUNCTIONS -########################################################## -]]-- -local BlizzardFrame_OnUpdate = function(self) - if InCombatLockdown() or self:GetName() == "GameMenuFrame" then return end - if self.IsMoving then return end - self:ClearAllPoints() - if self:GetName() == "QuestFrame" then - if MovableFrames["GossipFrame"].Points ~= nil then - self:SetPoint(unpack(MovableFrames["GossipFrame"].Points)) - end - elseif MovableFrames[self:GetName()].Points ~= nil then - self:SetPoint(unpack(MovableFrames[self:GetName()].Points)) - end -end - -local BlizzardFrame_OnDragStart = function(self) - if not self:IsMovable() then return end - self:StartMoving() - self.IsMoving = true -end - -local BlizzardFrame_OnDragStop = function(self) - if not self:IsMovable() then return end - self.IsMoving = false; - self:StopMovingOrSizing() - if self:GetName() == "GameMenuFrame" then return end - local anchor1, parent, anchor2, x, y = self:GetPoint() - parent = self:GetParent():GetName() - self:ClearAllPoints() - self:SetPoint(anchor1, parent, anchor2, x, y) - if self:GetName() == "QuestFrame" then - MovableFrames["GossipFrame"].Points = {anchor1, parent, anchor2, x, y} - else - MovableFrames[self:GetName()].Points = {anchor1, parent, anchor2, x, y} - end -end - -local Movable_OnEvent = function(self) - for _, frameName in pairs(DraggableFrames) do - local frame = _G[frameName] - if(frame) then - if(frameName ~= "LossOfControlFrame" and (not MovableFrames[frameName])) then - frame:EnableMouse(true) - - if(frameName == "LFGDungeonReadyPopup") then - LFGDungeonReadyDialog:EnableMouse(false) - end - - frame:SetMovable(true) - frame:RegisterForDrag("LeftButton") - frame:SetClampedToScreen(true) - frame:HookScript("OnUpdate", BlizzardFrame_OnUpdate) - frame:SetScript("OnDragStart", BlizzardFrame_OnDragStart) - frame:SetScript("OnDragStop", BlizzardFrame_OnDragStop) - MovableFrames[frameName] = {} - end - end - end -end - -Movable:RegisterEvent("PLAYER_LOGIN") -Movable:RegisterEvent("ADDON_LOADED") -Movable:RegisterEvent("LFG_UPDATE") -Movable:RegisterEvent("ROLE_POLL_BEGIN") -Movable:RegisterEvent("READY_CHECK") -Movable:RegisterEvent("UPDATE_WORLD_STATES") -Movable:RegisterEvent("WORLD_STATE_TIMER_START") -Movable:RegisterEvent("WORLD_STATE_UI_TIMER_UPDATE") - -Movable:SetScript("OnEvent", Movable_OnEvent) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/screen.lua b/Interface/AddOns/SVUI/system/screen.lua index 4e7eef7..ab8a0fd 100644 --- a/Interface/AddOns/SVUI/system/screen.lua +++ b/Interface/AddOns/SVUI/system/screen.lua @@ -39,42 +39,17 @@ GET ADDON DATA ########################################################## ]]-- local SV = select(2, ...) -local L = SV.L -SV.ScaleModifier = 1; - -local function GetUsableScreen() - local rez = GetCVar("gxResolution") - local height = rez:match("%d+x(%d+)") - local width = rez:match("(%d+)x%d+") - local gxHeight = tonumber(height) - local gxWidth = tonumber(width) - local gxMod = (768 / gxHeight) - return gxWidth, gxHeight, gxMod -end +SV.Screen = _G["SVUIParent"]; +local SCREEN_MOD = 1; --[[ ########################################################## UI SCALING ########################################################## ]]-- function SV:UI_SCALE_CHANGED(event) - local scale, evalwidth - local gxWidth, gxHeight, gxMod = GetUsableScreen() - - if(IsMacClient() and self.DisplaySettings and self.DisplaySettings.screenheight and self.DisplaySettings.screenwidth) then - if(gxHeight ~= self.DisplaySettings.screenheight or gxWidth ~= self.DisplaySettings.screenwidth) then - gxHeight = self.DisplaySettings.screenheight; - gxWidth = self.DisplaySettings.screenwidth - end - end - - if self.db.general.autoScale then - scale = max(0.64, min(1.15, gxMod)) - else - scale = max(0.64, min(1.15, GetCVar("uiScale") or UIParent:GetScale() or gxMod)) - end - - self.ScaleModifier = gxMod / scale; + local evalwidth; + local gxWidth, gxHeight, gxScale = self.Screen:Update(); if(gxWidth < 1600) then self.LowRez = true; @@ -118,19 +93,17 @@ function SV:UI_SCALE_CHANGED(event) end local testScale1 = parsefloat(UIParent:GetScale(), 5) - local testScale2 = parsefloat(scale, 5) + local testScale2 = parsefloat(gxScale, 5) if(event == "PLAYER_LOGIN" and (testScale1 ~= testScale2)) then SetCVar("useUiScale", 1) - SetCVar("uiScale", scale) + SetCVar("uiScale", gxScale) WorldMapFrame.hasTaint = true; end if(event == 'PLAYER_LOGIN' or event == 'UI_SCALE_CHANGED') then - if IsMacClient() then - self.DisplaySettings.screenheight = floor(GetScreenHeight() * 100 + .5) / 100 - self.DisplaySettings.screenwidth = floor(GetScreenWidth() * 100 + .5) / 100 - end + self.Screen:ClearAllPoints() + self.Screen:SetPoint("CENTER") if evalwidth then local width = evalwidth @@ -145,9 +118,6 @@ function SV:UI_SCALE_CHANGED(event) self.Screen:SetSize(UIParent:GetSize()); end - self.Screen:ClearAllPoints() - self.Screen:SetPoint("CENTER") - local change = abs((testScale1 * 100) - (testScale2 * 100)) if(change > 1) then if(self.db.general.autoScale) then @@ -156,13 +126,47 @@ function SV:UI_SCALE_CHANGED(event) self:StaticPopup_Show('RL_CLIENT') end end - - self.EffectiveScale = self.Screen:GetEffectiveScale() - self.ActualHeight = self.Screen:GetHeight() - self.ActualWidth = self.Screen:GetWidth() end end function SV:Scale(value) - return self.ScaleModifier * floor(value / self.ScaleModifier + .5); + return SCREEN_MOD * floor(value / SCREEN_MOD + .5); +end + +function SV.Screen:Update() + local rez = GetCVar("gxResolution") + local height = rez:match("%d+x(%d+)") + local width = rez:match("(%d+)x%d+") + local gxHeight = tonumber(height) + local gxWidth = tonumber(width) + local gxMod = (768 / gxHeight) + + if(IsMacClient()) then + if(not self.MacDisplay) then + self.MacDisplay = SVLib:NewGlobal("Display"); + if(not self.MacDisplay.Y or (self.MacDisplay.Y and type(self.MacDisplay.Y) ~= "number")) then + self.MacDisplay.Y = gxHeight; + end + if(not self.MacDisplay.X or (self.MacDisplay.X and type(self.MacDisplay.X) ~= "number")) then + self.MacDisplay.X = gxWidth; + end + end + if(self.MacDisplay and self.MacDisplay.Y and self.MacDisplay.X) then + if(gxHeight ~= self.MacDisplay.Y or gxWidth ~= self.MacDisplay.X) then + gxHeight = self.MacDisplay.Y; + gxWidth = self.MacDisplay.X; + end + end + end + + local gxScale; + if(SV.db.general.autoScale) then + gxScale = max(0.64, min(1.15, gxMod)); + else + gxScale = max(0.64, min(1.15, GetCVar("uiScale") or UIParent:GetScale() or gxMod)); + end + + SCREEN_MOD = (gxMod / gxScale); + + return gxWidth, gxHeight, gxScale end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/templates.lua b/Interface/AddOns/SVUI/system/templates.lua deleted file mode 100644 index a146d44..0000000 --- a/Interface/AddOns/SVUI/system/templates.lua +++ /dev/null @@ -1,1121 +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 VARS -########################################################## -]]-- -local SizeScaled, HeightScaled, WidthScaled, PointScaled, WrapOuter, FillInner -local TemplateUpdateFrames = {}; -local FontUpdateFrames = {}; -local STANDARD_TEXT_FONT = _G.STANDARD_TEXT_FONT; ---[[ -########################################################## -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 SetFontTemplate(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 - FontUpdateFrames[self] = true - end -end ---[[ -########################################################## -FONT UPDATE CALLBACK -########################################################## -]]-- -local function FontTemplateUpdates() - local STANDARDFONTSIZE = SV.db.media.fonts.size; - for i=1, #FontUpdateFrames do - local frame = FontUpdateFrames[i] - if frame then - local fontSize = frame.useCommon and STANDARDFONTSIZE or frame.fontSize - frame:SetFont(frame.font, fontSize, frame.fontStyle) - else - FontUpdateFrames[i] = nil - end - end -end - -function SV:UpdateFontTemplates() - FontTemplateUpdates() -end - -SV:NewCallback(FontTemplateUpdates) ---[[ -########################################################## -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", - ["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,...) - self.Panel:SetBackdrop(...) -end - -local HookBackdropColor = function(self,...) - self.Panel:SetBackdropColor(...) -end - -local HookBackdropBorderColor = function(self,...) - self.Panel:SetBackdropBorderColor(...) -end - -local HookVertexColor = function(self,...) - self.Panel.Skin:SetVertexColor(...) -end - -local HookCustomBackdrop = function(self) - 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 - -local HookFrameLevel = function(self, level) - local adjustment = level - 1; - if(adjustment < 0) then adjustment = 0 end - self.Panel:SetFrameLevel(adjustment) -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) - local cooldown = button:GetName() and _G[button:GetName().."Cooldown"] - if(cooldown) then - cooldown:ClearAllPoints() - cooldown:FillInner() - cooldown:SetSwipeColor(0, 0, 0, 1) - --cooldown:SetHideCountdownNumbers(true) - - 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 - 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) - - 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) -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.65) - 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) - hooksecurefunc(self, "SetBackdrop", HookBackdrop) - 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.__border 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.__border[1]:SetTexture(r2,g2,b2) - self.__border[2]:SetTexture(r2,g2,b2) - self.__border[3]:SetTexture(r2,g2,b2) - self.__border[4]:SetTexture(r2,g2,b2) - 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.__border then - 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) - 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") - FillInner(hover, self.Panel) - 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") - FillInner(pushed, 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") - FillInner(checked, 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) - 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) - if(shadowAlpha) then - self.Panel.Shadow:SetAttribute("shadowAlpha", shadowAlpha) - end -end - -local function SetCheckboxTemplate(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 == 1 or checked == true) 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 Die(self.TopLeftTex) end - if self.TopRightTex then Die(self.TopRightTex) end - if self.TopTex then Die(self.TopTex) end - if self.BottomLeftTex then Die(self.BottomLeftTex) end - if self.BottomRightTex then Die(self.BottomRightTex) end - if self.BottomTex then Die(self.BottomTex) end - if self.LeftTex then Die(self.LeftTex) end - if self.RightTex then Die(self.RightTex) end - if self.MiddleTex then Die(self.MiddleTex) 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 Die(_G[globalName.."Left"]) end - if _G[globalName.."Middle"] then Die(_G[globalName.."Middle"]) end - if _G[globalName.."Right"] then Die(_G[globalName.."Right"]) end - if _G[globalName.."Mid"] then Die(_G[globalName.."Mid"]) 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 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 = {} - - border[1] = self: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 = self:CreateTexture(nil,"BORDER") - leftoutline:SetTexture(0,0,0) - leftoutline:SetPoint("TOPLEFT", -2, 2) - leftoutline:SetPoint("BOTTOMLEFT", -2, -2) - leftoutline:SetWidth(1) - - border[2] = self: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 = self:CreateTexture(nil,"BORDER") - rightoutline:SetTexture(0,0,0) - rightoutline:SetPoint("TOPRIGHT", 2, 2) - rightoutline:SetPoint("BOTTOMRIGHT", 2, -2) - rightoutline:SetWidth(1) - - border[3] = self: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 = self:CreateTexture(nil,"BORDER") - topoutline:SetTexture(0,0,0) - topoutline:SetPoint("TOPLEFT", -2, 2) - topoutline:SetPoint("TOPRIGHT", 2, 2) - topoutline:SetHeight(1) - - border[4] = self: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 = self:CreateTexture(nil,"BORDER") - bottomoutline:SetTexture(0,0,0) - bottomoutline:SetPoint("BOTTOMLEFT", -2, -2) - bottomoutline:SetPoint("BOTTOMRIGHT", 2, -2) - bottomoutline:SetHeight(1) - - self.__border = border - 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 - -SV:NewCallback(FrameTemplateUpdates) ---[[ -########################################################## -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.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.SetEditboxTemplate then META.SetEditboxTemplate = SetEditboxTemplate end - if not OBJECT.SetFramedButtonTemplate then META.SetFramedButtonTemplate = SetFramedButtonTemplate end - if not OBJECT.SetFontTemplate then META.SetFontTemplate = SetFontTemplate 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/system/utilities.lua b/Interface/AddOns/SVUI/system/utilities.lua index 4ed4592..ad4cd0f 100644 --- a/Interface/AddOns/SVUI/system/utilities.lua +++ b/Interface/AddOns/SVUI/system/utilities.lua @@ -205,7 +205,11 @@ do return "CENTER" end}) - function SV:ReversePoint(frame, point, target, x, y) + function SV:GetReversePoint(point) + return _inverted[point]; + end + + function SV:SetReversePoint(frame, point, target, x, y) if((not frame) or (not point)) then return; end local anchor = _inverted[point]; local relative = _translated[point]; @@ -220,7 +224,7 @@ end function SV:AnchorToCursor(frame) local x, y = GetCursorPosition() - local vHold = self.yScreenArea + local vHold = (UIParent:GetHeight() * 0.33) local scale = self.Screen:GetEffectiveScale() local initialAnchor = "CENTER" local mod = 0 @@ -234,7 +238,7 @@ function SV:AnchorToCursor(frame) end frame:ClearAllPoints() - frame:SetPoint(initialAnchor, SV.Screen, "BOTTOMLEFT", (x / scale), (y / scale) + mod) + frame:SetPoint(initialAnchor, self.Screen, "BOTTOMLEFT", (x / scale), (y / scale) + mod) end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/system/visibility.lua b/Interface/AddOns/SVUI/system/visibility.lua index c5dd4f8..bc6f604 100644 --- a/Interface/AddOns/SVUI/system/visibility.lua +++ b/Interface/AddOns/SVUI/system/visibility.lua @@ -53,7 +53,7 @@ function SV:FlushDisplayAudit() self.NeedsFrameAudit = true if(InCombatLockdown()) then return end for frame, _ in pairs(DisplayFrames)do - frame:SetParent(self.Cloaked) + frame:SetParent(self.Hidden) end end diff --git a/Interface/AddOns/SVUI/xml/_load.xml b/Interface/AddOns/SVUI/xml/_load.xml deleted file mode 100644 index d2cc8c8..0000000 --- a/Interface/AddOns/SVUI/xml/_load.xml +++ /dev/null @@ -1,5 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Include file='system.xml'/> - <Include file='framework.xml'/> - <Include file='mentalo.xml'/> -</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/xml/framework.xml b/Interface/AddOns/SVUI/xml/framework.xml deleted file mode 100644 index 054d63a..0000000 --- a/Interface/AddOns/SVUI/xml/framework.xml +++ /dev/null @@ -1,1366 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Button name="SVUI_DockletButtonTemplate" virtual="true" hidden="true"> - <Size x="22" y="22"/> - <Anchors> - <Anchor point="RIGHT" relativePoint="RIGHT" /> - </Anchors> - <Attributes> - <Attribute name="tipText" type="string" value="" /> - <Attribute name="ownerFrame" type="string" value="None" /> - <Attribute name="hasDropDown" type="boolean" value="false" /> - <Attribute name="isActive" type="boolean" value="false" /> - </Attributes> - <Layers> - <Layer level="OVERLAY"> - <Texture parentKey="Icon" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT"> - <Anchors> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="2" y="-2" /> - <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-2" y="2" /> - </Anchors> - </Texture> - </Layer> - </Layers> - </Button> - - <Frame name="SVUI_DockletWindowTemplate" virtual="true"> - <Attributes> - <Attribute name="ownerFrame" type="string" value="None" /> - <Attribute name="isLoaded" type="boolean" value="false" /> - </Attributes> - </Frame> - - <Frame name="SVUI_DockBarLeft" frameStrata="BACKGROUND"> - <Size y="22"/> - <Attributes> - <Attribute name="spacingSize" type="number" value="4" /> - <Attribute name="buttonSize" type="number" value="22" /> - </Attributes> - <Anchors> - <Anchor point="BOTTOMLEFT" /> - </Anchors> - <Frames> - <Button name="$parentButton" parentKey="Button"> - <Size x="22" y="22"/> - <Anchors> - <Anchor point="BOTTOMLEFT" relativeTo="$parent" /> - </Anchors> - <Attributes> - <Attribute name="tipText" type="string" value="" /> - <Attribute name="tipExtraText" type="string" value="" /> - <Attribute name="ownerFrame" type="string" value="None" /> - <Attribute name="isActive" type="boolean" value="false" /> - </Attributes> - <Layers> - <Layer level="OVERLAY"> - <Texture parentKey="Icon" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT"> - <Anchors> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="2" y="-2" /> - <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-2" y="2" /> - </Anchors> - </Texture> - </Layer> - </Layers> - </Button> - <Frame name="$parentToolBar" parentKey="ToolBar"> - <Size x="1" y="22"/> - <Anchors> - <Anchor point="BOTTOMLEFT" relativeTo="$parentButton" relativePoint="BOTTOMRIGHT" x="4" y="0" /> - </Anchors> - </Frame> - <Frame name="$parentExtraBar" parentKey="ExtraBar"> - <Size x="1" y="22"/> - <Anchors> - <Anchor point="BOTTOMLEFT" relativeTo="$parentToolBar" relativePoint="BOTTOMRIGHT" x="4" y="0" /> - </Anchors> - </Frame> - </Frames> - </Frame> - - <Frame name="SVUI_DockLeft" frameStrata="BACKGROUND"> - <Attributes> - <Attribute name="spacingSize" type="number" value="4" /> - <Attribute name="buttonSize" type="number" value="22" /> - </Attributes> - <Anchors> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" x="1" y="32" /> - </Anchors> - <Frames> - <Frame name="$parentAlert" parentKey="Alert" frameStrata="BACKGROUND"> - <Size y="1"/> - <Anchors> - <Anchor point="BOTTOMLEFT" x="0" y="4" /> - <Anchor point="BOTTOMRIGHT" x="0" y="4" /> - </Anchors> - </Frame> - <Frame name="$parentWindow" parentKey="Window" frameStrata="BACKGROUND"> - <Anchors> - <Anchor point="BOTTOMRIGHT" relativeTo="$parentAlert" relativePoint="TOPRIGHT" x="0" y="4" /> - <Anchor point="BOTTOMLEFT" relativeTo="$parentAlert" relativePoint="TOPLEFT" x="0" y="4" /> - <Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT" x="0" y="0" /> - <Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT" x="0" y="0" /> - </Anchors> - </Frame> - </Frames> - </Frame> - - <Frame name="SVUI_DockBarRight" frameStrata="BACKGROUND"> - <Size y="22"/> - <Attributes> - <Attribute name="spacingSize" type="number" value="4" /> - <Attribute name="buttonSize" type="number" value="22" /> - </Attributes> - <Anchors> - <Anchor point="BOTTOMRIGHT" /> - </Anchors> - <Frames> - <Button name="$parentButton" parentKey="Button"> - <Size x="22" y="22"/> - <Anchors> - <Anchor point="BOTTOMRIGHT" relativeTo="$parent" /> - </Anchors> - <Attributes> - <Attribute name="tipText" type="string" value="" /> - <Attribute name="tipExtraText" type="string" value="" /> - <Attribute name="ownerFrame" type="string" value="None" /> - <Attribute name="isActive" type="boolean" value="false" /> - </Attributes> - <Layers> - <Layer level="OVERLAY"> - <Texture parentKey="Icon" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT"> - <Anchors> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="2" y="-2" /> - <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-2" y="2" /> - </Anchors> - </Texture> - </Layer> - </Layers> - </Button> - <Frame name="$parentToolBar" parentKey="ToolBar"> - <Size x="1" y="22"/> - <Anchors> - <Anchor point="BOTTOMRIGHT" relativeTo="$parentButton" relativePoint="BOTTOMLEFT" x="-4" y="0" /> - </Anchors> - </Frame> - <Frame name="$parentExtraBar" parentKey="ExtraBar"> - <Size x="1" y="22"/> - <Anchors> - <Anchor point="BOTTOMRIGHT" relativeTo="$parentToolBar" relativePoint="BOTTOMLEFT" x="-4" y="0" /> - </Anchors> - </Frame> - </Frames> - </Frame> - - <Frame name="SVUI_DockRight" frameStrata="BACKGROUND"> - <Attributes> - <Attribute name="spacingSize" type="number" value="4" /> - <Attribute name="buttonSize" type="number" value="22" /> - </Attributes> - <Anchors> - <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-1" y="32" /> - </Anchors> - <Frames> - <Frame name="$parentAlert" parentKey="Alert" frameStrata="BACKGROUND"> - <Size y="1"/> - <Anchors> - <Anchor point="BOTTOMRIGHT" x="0" y="4" /> - <Anchor point="BOTTOMLEFT" x="0" y="4" /> - </Anchors> - </Frame> - <Frame name="$parentWindow" parentKey="Window" frameStrata="BACKGROUND"> - <Anchors> - <Anchor point="BOTTOMRIGHT" relativeTo="$parentAlert" relativePoint="TOPRIGHT" x="0" y="4" /> - <Anchor point="BOTTOMLEFT" relativeTo="$parentAlert" relativePoint="TOPLEFT" x="0" y="4" /> - <Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT" x="0" y="0" /> - <Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT" x="0" y="0" /> - </Anchors> - </Frame> - </Frames> - </Frame> - - <Frame name="SVUI_DockTop" frameStrata="BACKGROUND"> - <Attributes> - <Attribute name="spacingSize" type="number" value="4" /> - <Attribute name="buttonSize" type="number" value="22" /> - </Attributes> - <Anchors> - <Anchor point="TOPLEFT" /> - </Anchors> - <Frames> - <Frame name="$parentToolBar" parentKey="ToolBar" frameStrata="BACKGROUND"> - <Size y="1"/> - <Anchors> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" /> - </Anchors> - </Frame> - </Frames> - </Frame> - - <Frame name="SVUI_ShadowTemplate" virtual="true"> - <Attributes> - <Attribute name="shadowAlpha" type="number" value="0.5" /> - </Attributes> - <Backdrop edgeFile="Interface\AddOns\SVUI\assets\artwork\Template\GLOW"> - <EdgeSize val="3" /> - <BackgroundInsets left="0" right="0" top="0" bottom="0" /> - <Color r="0" g="0" b="0" a="0" /> - <BorderColor r="0" g="0" b="0" a="0.5" /> - </Backdrop> - </Frame> - - <Frame name="SVUI_PanelTemplate_Default" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="default" /> - <Attribute name="panelPadding" type="number" value="1" /> - <Attribute name="panelColor" type="string" value="default" /> - <Attribute name="panelGradient" type="string" value="default" /> - <Attribute name="panelTexUpdate" type="boolean" value="false" /> - <Attribute name="panelSkipUpdate" type="boolean" value="false" /> - </Attributes> - <Backdrop bgFile="Interface\BUTTONS\WHITE8X8" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> - <EdgeSize val="1" /> - <TileSize val="0" /> - <BackgroundInsets left="0" right="0" top="0" bottom="0" /> - <Color r="0.2" g="0.2" b="0.2" a="1" /> - <BorderColor r="0" g="0" b="0" a="1" /> - </Backdrop> - <Layers> - <Layer level="BACKGROUND" textureSubLevel="1"> - <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT" setAllPoints="true" /> - <Color r="0.2" g="0.2" b="0.2" a="1" /> - </Layer> - <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="1" /> - </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="1" /> - </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="1" /> - </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="1" /> - </Size> - <Color r="0" g="0" b="0" a="1" /> - </Texture> - </Layer> - </Layers> - </Frame> - - <Frame name="SVUI_PanelTemplate_Transparent" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="transparent" /> - <Attribute name="panelPadding" type="number" value="2" /> - <Attribute name="panelColor" type="string" value="transparent" /> - <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\BUTTONS\WHITE8X8" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> - <EdgeSize val="2" /> - <TileSize val="0" /> - <BackgroundInsets left="0" right="0" top="0" bottom="0" /> - <Color r="0" g="0" b="0" a="0.5" /> - <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="1" /> - </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="1" /> - </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="1" /> - </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="1" /> - </Size> - <Color r="0" g="0" b="0" a="1" /> - </Texture> - </Layer> - </Layers> - </Frame> - - <Frame name="SVUI_PanelTemplate_Component" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="component" /> - <Attribute name="panelPadding" type="number" value="1" /> - <Attribute name="panelColor" type="string" value="default" /> - <Attribute name="panelGradient" type="string" value="default" /> - <Attribute name="panelTexUpdate" type="boolean" value="false" /> - <Attribute name="panelSkipUpdate" type="boolean" value="false" /> - </Attributes> - <Backdrop bgFile="Interface\BUTTONS\WHITE8X8" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> - <EdgeSize val="2" /> - <TileSize val="0" /> - <BackgroundInsets left="0" right="0" top="0" bottom="0" /> - <Color r="0.2" g="0.2" b="0.2" a="1" /> - <BorderColor r="0" g="0" b="0" a="1" /> - </Backdrop> - <Layers> - <Layer level="BACKGROUND" textureSubLevel="1"> - <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT" setAllPoints="true" /> - <Color r="0.2" g="0.2" b="0.2" a="1" /> - </Layer> - <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="1" /> - </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="1" /> - </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="1" /> - </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="1" /> - </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_Headline" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="headline" /> - <Attribute name="panelPadding" type="number" value="1" /> - <Attribute name="panelColor" type="string" value="darkest" /> - <Attribute name="panelGradient" type="boolean" value="false" /> - <Attribute name="panelTexUpdate" type="boolean" value="false" /> - <Attribute name="panelSkipUpdate" type="boolean" value="false" /> - </Attributes> - <Backdrop bgFile="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT" tile="true"> - <TileSize val="20" /> - <Color r="0" g="0" b="0" a="0.5" /> - </Backdrop> - </Frame> - - <Frame name="SVUI_PanelTemplate_Button" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="button" /> - <Attribute name="panelPadding" type="number" value="1" /> - <Attribute name="panelColor" type="string" value="default" /> - <Attribute name="panelGradient" type="boolean" value="false" /> - <Attribute name="panelTexUpdate" type="boolean" value="false" /> - <Attribute name="panelSkipUpdate" type="boolean" value="false" /> - </Attributes> - <Backdrop bgFile="Interface\AddOns\SVUI\assets\artwork\Template\BUTTON" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> - <EdgeSize val="2" /> - <TileSize val="0" /> - <BackgroundInsets left="0" right="0" top="0" bottom="0" /> - <Color r="0.2" g="0.2" b="0.2" a="1" /> - <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="1" /> - </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="1" /> - </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="1" /> - </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="1" /> - </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_FramedTop" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="framedtop" /> - <Attribute name="panelPadding" type="number" value="1" /> - <Attribute name="panelColor" type="string" value="default" /> - <Attribute name="panelGradient" type="string" value="darkest2" /> - <Attribute name="panelTexUpdate" type="boolean" value="true" /> - <Attribute name="panelSkipUpdate" type="boolean" value="false" /> - </Attributes> - <Backdrop bgFile="Interface\BUTTONS\WHITE8X8" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> - <EdgeSize val="1" /> - <TileSize val="0" /> - <BackgroundInsets left="0" right="0" top="0" bottom="0" /> - <Color r="0.2" g="0.2" b="0.2" a="1" /> - <BorderColor r="0" g="0" b="0" a="1" /> - </Backdrop> - <Layers> - <Layer level="BACKGROUND" textureSubLevel="1"> - <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT2" setAllPoints="true" /> - <Color r="0.2" g="0.2" b="0.2" a="1" /> - </Layer> - <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="1" /> - </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="1" /> - </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="1" /> - </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="1" /> - </Size> - <Color r="0" g="0" b="0" a="1" /> - </Texture> - </Layer> - </Layers> - </Frame> - - <Frame name="SVUI_PanelTemplate_FramedBottom" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="framedbottom" /> - <Attribute name="panelPadding" type="number" value="1" /> - <Attribute name="panelColor" type="string" value="default" /> - <Attribute name="panelGradient" type="string" value="darkest" /> - <Attribute name="panelTexUpdate" type="boolean" value="true" /> - <Attribute name="panelSkipUpdate" type="boolean" value="false" /> - </Attributes> - <Backdrop bgFile="Interface\BUTTONS\WHITE8X8" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> - <EdgeSize val="1" /> - <TileSize val="0" /> - <BackgroundInsets left="0" right="0" top="0" bottom="0" /> - <Color r="0.2" g="0.2" b="0.2" a="1" /> - <BorderColor r="0" g="0" b="0" a="1" /> - </Backdrop> - <Layers> - <Layer level="BACKGROUND" textureSubLevel="1"> - <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT" setAllPoints="true" /> - <Color r="0.2" g="0.2" b="0.2" a="1" /> - </Layer> - <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="1" /> - </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="1" /> - </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="1" /> - </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="1" /> - </Size> - <Color r="0" g="0" b="0" a="1" /> - </Texture> - </Layer> - </Layers> - </Frame> - - <Frame name="SVUI_PanelTemplate_Bar" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="bar" /> - <Attribute name="panelPadding" type="number" value="1" /> - <Attribute name="panelColor" type="string" value="transparent" /> - <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="0" right="0" top="0" bottom="0" /> - <Color r="0" g="0" b="0" a="0.5" /> - <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="1" /> - </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="1" /> - </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="1" /> - </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="1" /> - </Size> - <Color r="0" g="0" b="0" a="1" /> - </Texture> - </Layer> - </Layers> - </Frame> - - <Frame name="SVUI_PanelTemplate_Slot" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="slot" /> - <Attribute name="panelPadding" type="number" value="2" /> - <Attribute name="panelColor" type="string" value="transparent" /> - <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.5" /> - <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" /> - <Attribute name="panelPadding" type="number" value="2" /> - <Attribute name="panelColor" type="string" value="transparent" /> - <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="2" /> - <TileSize val="0" /> - <BackgroundInsets left="0" right="0" top="0" bottom="0" /> - <Color r="0" g="0" b="0" a="0.5" /> - <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> - </Frame> - - <Frame name="SVUI_PanelTemplate_Comic" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="comic" /> - <Attribute name="panelPadding" type="number" value="1" /> - <Attribute name="panelColor" type="string" value="class" /> - <Attribute name="panelGradient" type="string" value="class" /> - <Attribute name="panelTexUpdate" type="boolean" value="true" /> - <Attribute name="panelSkipUpdate" type="boolean" value="false" /> - </Attributes> - <Backdrop bgFile="Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC1" tile="false"> - <TileSize val="0" /> - <BackgroundInsets left="0" right="0" top="0" bottom="0" /> - <Color r="0.2" g="0.2" b="0.2" a="1" /> - </Backdrop> - <Layers> - <Layer level="BACKGROUND" textureSubLevel="1"> - <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC1" setAllPoints="true" /> - <Color r="0.2" g="0.2" b="0.2" a="1" /> - </Layer> - </Layers> - </Frame> - - <Frame name="SVUI_PanelTemplate_Model" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="model" /> - <Attribute name="panelPadding" type="number" value="1" /> - <Attribute name="panelColor" type="string" value="special" /> - <Attribute name="panelGradient" type="string" value="class" /> - <Attribute name="panelTexUpdate" type="boolean" value="true" /> - <Attribute name="panelSkipUpdate" type="boolean" value="false" /> - </Attributes> - <Backdrop bgFile="Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC-MODEL" tile="false"> - <TileSize val="0" /> - <BackgroundInsets left="0" right="0" top="0" bottom="0" /> - <Color r="0.37" g="0.32" b="0.29" a="1" /> - </Backdrop> - <Layers> - <Layer level="BACKGROUND" textureSubLevel="1"> - <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC-MODEL" setAllPoints="true" /> - <Color r="0.37" g="0.32" b="0.29" a="1" /> - </Layer> - </Layers> - </Frame> - - <Frame name="SVUI_PanelTemplate_Paper" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="paper" /> - <Attribute name="panelPadding" type="number" value="3" /> - <Attribute name="panelColor" type="string" value="white" /> - <Attribute name="panelGradient" type="string" value="white" /> - <Attribute name="panelTexUpdate" type="boolean" value="true" /> - <Attribute name="panelSkipUpdate" type="boolean" value="true" /> - </Attributes> - <Backdrop bgFile="Interface\AddOns\SVUI\assets\artwork\Template\Background\PAPER" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> - <EdgeSize val="1" /> - <TileSize val="0" /> - <BackgroundInsets left="0" right="0" top="0" bottom="0" /> - <Color r="1" g="1" b="1" a="1" /> - <BorderColor r="0" g="0" b="0" a="1" /> - </Backdrop> - <Layers> - <Layer level="BACKGROUND" textureSubLevel="1"> - <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Background\PAPER" setAllPoints="true" /> - <Color r="1" g="1" b="1" a="1" /> - </Layer> - <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="3" /> - </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="3" /> - </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="3" /> - </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="3" /> - </Size> - <Color r="0" g="0" b="0" a="1" /> - </Texture> - </Layer> - </Layers> - </Frame> - - <Frame name="SVUI_PanelTemplate_Container" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="container" /> - <Attribute name="panelPadding" type="number" value="2" /> - <Attribute name="panelColor" type="string" value="special" /> - <Attribute name="panelGradient" type="string" value="special" /> - <Attribute name="panelTexUpdate" type="boolean" value="true" /> - <Attribute name="panelSkipUpdate" type="boolean" value="false" /> - </Attributes> - <Backdrop bgFile="Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN3" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> - <EdgeSize val="1" /> - <TileSize val="0" /> - <BackgroundInsets left="0" right="0" top="0" bottom="0" /> - <Color r="0.37" g="0.32" b="0.29" a="1" /> - <BorderColor r="0" g="0" b="0" a="1" /> - </Backdrop> - <Layers> - <Layer level="BACKGROUND" textureSubLevel="1"> - <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN3" setAllPoints="true" /> - <Color r="0.37" g="0.32" b="0.29" a="1" /> - </Layer> - <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> - </Frame> - - <Frame name="SVUI_PanelTemplate_Pattern" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="pattern" /> - <Attribute name="panelPadding" type="number" value="3" /> - <Attribute name="panelColor" type="string" value="special" /> - <Attribute name="panelGradient" type="string" value="special" /> - <Attribute name="panelTexUpdate" type="boolean" value="true" /> - <Attribute name="panelSkipUpdate" type="boolean" value="false" /> - </Attributes> - <Backdrop bgFile="Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN1" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> - <EdgeSize val="1" /> - <TileSize val="0" /> - <BackgroundInsets left="0" right="0" top="0" bottom="0" /> - <Color r="0.37" g="0.32" b="0.29" a="1" /> - <BorderColor r="0" g="0" b="0" a="1" /> - </Backdrop> - <Layers> - <Layer level="BACKGROUND" textureSubLevel="1"> - <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN1" setAllPoints="true" /> - <Color r="0.37" g="0.32" b="0.29" a="1" /> - </Layer> - <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="3" /> - </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="3" /> - </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="3" /> - </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="3" /> - </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_Action" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="action" /> - <Attribute name="panelPadding" type="number" value="2" /> - <Attribute name="panelColor" type="string" value="default" /> - <Attribute name="panelGradient" type="string" value="special" /> - <Attribute name="panelTexUpdate" type="boolean" value="true" /> - <Attribute name="panelSkipUpdate" type="boolean" value="false" /> - </Attributes> - <Backdrop bgFile="Interface\BUTTONS\WHITE8X8" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> - <EdgeSize val="2" /> - <TileSize val="0" /> - <BackgroundInsets left="1" right="1" top="1" bottom="1" /> - <Color r="0.2" g="0.2" b="0.2" a="1" /> - <BorderColor r="0" g="0" b="0" a="1" /> - </Backdrop> - <Layers> - <Layer level="BACKGROUND" textureSubLevel="1"> - <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT" setAllPoints="true" /> - <Color r="0.2" g="0.2" b="0.2" a="1" /> - </Layer> - <Layer level="BACKGROUND" textureSubLevel="2"> - <Texture parentKey="ExtendedTopLeft" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Extended\ACTION_TOPLEFT"> - <Anchors> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" /> - <Anchor point="TOPRIGHT" relativePoint="TOP" /> - <Anchor point="BOTTOMLEFT" relativePoint="LEFT" /> - </Anchors> - <Color r="0.05" g="0.05" b="0.05" a="0.5" /> - </Texture> - <Texture parentKey="ExtendedTopRight" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Extended\ACTION_TOPRIGHT"> - <Anchors> - <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" /> - <Anchor point="TOPLEFT" relativePoint="TOP" /> - <Anchor point="BOTTOMRIGHT" relativePoint="RIGHT" /> - </Anchors> - <Color r="0.05" g="0.05" b="0.05" a="0.5" /> - </Texture> - <Texture parentKey="ExtendedBottomLeft" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Extended\ACTION_BOTTOMLEFT"> - <Anchors> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" /> - <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOM" /> - <Anchor point="TOPLEFT" relativePoint="LEFT" /> - </Anchors> - <Color r="0.1" g="0.1" b="0.1" a="0.5" /> - </Texture> - <Texture parentKey="ExtendedBottomRight" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Extended\ACTION_BOTTOMRIGHT"> - <Anchors> - <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" /> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOM" /> - <Anchor point="TOPRIGHT" relativePoint="RIGHT" /> - </Anchors> - <Color r="0.1" g="0.1" b="0.1" a="0.5" /> - </Texture> - </Layer> - <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_Halftone" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="halftone" /> - <Attribute name="panelPadding" type="number" value="2" /> - <Attribute name="panelColor" type="string" value="default" /> - <Attribute name="panelGradient" type="string" value="special" /> - <Attribute name="panelTexUpdate" type="boolean" value="true" /> - <Attribute name="panelSkipUpdate" type="boolean" value="false" /> - </Attributes> - <Backdrop bgFile="Interface\BUTTONS\WHITE8X8" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> - <EdgeSize val="2" /> - <TileSize val="0" /> - <BackgroundInsets left="1" right="1" top="1" bottom="1" /> - <Color r="0.2" g="0.2" b="0.2" a="1" /> - <BorderColor r="0" g="0" b="0" a="1" /> - </Backdrop> - <Layers> - <Layer level="BACKGROUND" textureSubLevel="1"> - <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT" setAllPoints="true" /> - <Color r="0.2" g="0.2" b="0.2" a="1" /> - </Layer> - <Layer level="BACKGROUND" textureSubLevel="2"> - <Texture parentKey="ExtendedTopLeft" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Extended\HALFTONE_TOPLEFT"> - <Anchors> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" /> - <Anchor point="TOPRIGHT" relativePoint="TOP" /> - <Anchor point="BOTTOMLEFT" relativePoint="LEFT" /> - </Anchors> - <Color r="0.05" g="0.05" b="0.05" a="0.5" /> - </Texture> - <Texture parentKey="ExtendedTopRight" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Extended\HALFTONE_TOPRIGHT"> - <Anchors> - <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" /> - <Anchor point="TOPLEFT" relativePoint="TOP" /> - <Anchor point="BOTTOMRIGHT" relativePoint="RIGHT" /> - </Anchors> - <Color r="0.05" g="0.05" b="0.05" a="0.5" /> - </Texture> - <Texture parentKey="ExtendedBottomLeft" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Extended\HALFTONE_BOTTOMLEFT"> - <Anchors> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" /> - <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOM" /> - <Anchor point="TOPLEFT" relativePoint="LEFT" /> - </Anchors> - <Color r="0.1" g="0.1" b="0.1" a="0.5" /> - </Texture> - <Texture parentKey="ExtendedBottomRight" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\Extended\HALFTONE_BOTTOMRIGHT"> - <Anchors> - <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" /> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOM" /> - <Anchor point="TOPRIGHT" relativePoint="RIGHT" /> - </Anchors> - <Color r="0.1" g="0.1" b="0.1" a="0.5" /> - </Texture> - </Layer> - <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_Blackout" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="blackout" /> - <Attribute name="panelPadding" type="number" value="2" /> - <Attribute name="panelColor" type="string" value="transparent" /> - <Attribute name="panelGradient" type="boolean" value="false" /> - <Attribute name="panelTexUpdate" type="boolean" value="false" /> - <Attribute name="panelOffset" type="number" value="2" /> - <Attribute name="panelSkipUpdate" type="boolean" value="false" /> - </Attributes> - <Backdrop bgFile="Interface\BUTTONS\WHITE8X8" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> - <EdgeSize val="2" /> - <TileSize val="0" /> - <BackgroundInsets left="1" right="1" top="1" bottom="1" /> - <Color r="0" g="0" b="0" a="0.5" /> - <BorderColor r="0" g="0" b="0" a="1" /> - </Backdrop> - <Layers> - <Layer level="BACKGROUND" textureSubLevel="1"> - <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT" setAllPoints="true" /> - <Color r="0" g="0" b="0" a="0.5" /> - </Layer> - <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_UnitLarge" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="unitlarge" /> - <Attribute name="panelPadding" type="number" value="0" /> - <Attribute name="panelColor" type="string" value="special" /> - <Attribute name="panelGradient" type="boolean" value="false" /> - <Attribute name="panelTexUpdate" type="boolean" value="true" /> - <Attribute name="panelOffset" type="number" value="3" /> - <Attribute name="panelSkipUpdate" type="boolean" value="false" /> - <Attribute name="panelNoBackdrop" type="boolean" value="true" /> - </Attributes> - <Layers> - <Layer level="BACKGROUND" textureSubLevel="1"> - <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG1" setAllPoints="true" /> - <Color r="0.37" g="0.32" b="0.29" a="1" /> - </Layer> - </Layers> - </Frame> - - <Frame name="SVUI_PanelTemplate_UnitSmall" virtual="true"> - <Attributes> - <Attribute name="panelID" type="string" value="unitlarge" /> - <Attribute name="panelPadding" type="number" value="0" /> - <Attribute name="panelColor" type="string" value="special" /> - <Attribute name="panelGradient" type="boolean" value="false" /> - <Attribute name="panelTexUpdate" type="boolean" value="true" /> - <Attribute name="panelOffset" type="number" value="3" /> - <Attribute name="panelSkipUpdate" type="boolean" value="false" /> - <Attribute name="panelNoBackdrop" type="boolean" value="true" /> - </Attributes> - <Layers> - <Layer level="BACKGROUND" textureSubLevel="1"> - <Texture parentKey="Skin" nonBlocking="true" file="Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG1" setAllPoints="true" /> - <Color r="0.37" g="0.32" b="0.29" a="1" /> - </Layer> - </Layers> - </Frame> -</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/xml/mentalo.xml b/Interface/AddOns/SVUI/xml/mentalo.xml deleted file mode 100644 index f6471e0..0000000 --- a/Interface/AddOns/SVUI/xml/mentalo.xml +++ /dev/null @@ -1,250 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Frame name="SVUI_MentaloPrecision" hidden="true" frameStrata="DIALOG"> - <Size x="130" y="60"/> - <Anchors> - <Anchor point="CENTER"/> - </Anchors> - <Layers> - <Layer level="BACKGROUND"> - <Texture name="$parentBG" setAllPoints="true"/> - </Layer> - <Layer level="OVERLAY"> - <Texture name="$parentTitleBG"> - <Anchors> - <Anchor point="BOTTOMLEFT" relativeTo="$parentBG" relativePoint="TOPLEFT"/> - <Anchor point="TOPRIGHT" relativeTo="$parentBG" relativePoint="TOPRIGHT"> - <Offset x="0" y="30"/> - </Anchor> - </Anchors> - </Texture> - </Layer> - <Layer level="ARTWORK"> - <FontString parentKey="Title" inherits="GameFontNormal" text="Focused Position"> - <Anchors> - <Anchor point="TOPLEFT" relativeTo="$parentTitleBG" relativePoint="TOPLEFT"/> - <Anchor point="BOTTOMRIGHT" relativeTo="$parentTitleBG" relativePoint="BOTTOMRIGHT"/> - </Anchors> - </FontString> - <FontString inherits="NumberFont_Outline_Huge" text="X"> - <Anchors> - <Anchor point="RIGHT" relativeTo="$parent" relativePoint="LEFT"> - <Offset x="-3" y="0"/> - </Anchor> - </Anchors> - <Color r="1" g="0.5" b="0" a="1"/> - </FontString> - <FontString inherits="NumberFont_Outline_Huge" text="Y"> - <Anchors> - <Anchor point="LEFT" relativeTo="$parent" relativePoint="RIGHT"> - <Offset x="3" y="0"/> - </Anchor> - </Anchors> - <Color r="1" g="0.5" b="0" a="1"/> - </FontString> - </Layer> - </Layers> - <Frames> - <EditBox name="$parentSetX" inherits="InputBoxTemplate" autoFocus="false"> - <Size x="50" y="17"/> - <Anchors> - <Anchor point="BOTTOMRIGHT" relativeTo="$parentBG" relativePoint="CENTER"> - <Offset x="-12" y="3"/> - </Anchor> - </Anchors> - - <Scripts> - <OnEscapePressed> - self:SetText(math.floor((self.CurrentValue or 0) + 0.5)) - EditBox_ClearFocus(self) - </OnEscapePressed> - <OnEditFocusLost> - self:SetText(math.floor((self.CurrentValue or 0) + 0.5)) - </OnEditFocusLost> - <OnShow> - EditBox_ClearFocus(self) - self:SetText(math.floor((self.CurrentValue or 0) + 0.5)) - </OnShow> - </Scripts> - </EditBox> - - <EditBox name="$parentSetY" inherits="InputBoxTemplate" autoFocus="false"> - <Size x="50" y="17"/> - <Anchors> - <Anchor point="BOTTOMLEFT" relativeTo="$parentBG" relativePoint="CENTER"> - <Offset x="12" y="3"/> - </Anchor> - </Anchors> - <Scripts> - <OnEscapePressed> - self:SetText(math.floor((self.CurrentValue or 0) + 0.5)) - EditBox_ClearFocus(self) - </OnEscapePressed> - <OnEditFocusLost> - self:SetText(math.floor((self.CurrentValue or 0) + 0.5)) - </OnEditFocusLost> - <OnShow> - EditBox_ClearFocus(self) - self:SetText(math.floor((self.CurrentValue or 0) + 0.5)) - </OnShow> - </Scripts> - </EditBox> - - <Button name="$parentUpButton" inherits="UIPanelSquareButton"> - <Size x="25" y="20"/> - <Anchors> - <Anchor point="TOPLEFT" relativeTo="$parentBG" relativePoint="CENTER"> - <Offset x="10" y="-3"/> - </Anchor> - </Anchors> - <Scripts> - <OnLoad> - SquareButton_SetIcon(self, "UP"); - self:RegisterForClicks("AnyUp"); - </OnLoad> - <OnClick> - local frame = _G["SVUI_MentaloPrecisionSetY"]; - frame.CurrentValue = frame.CurrentValue + 1 - frame:SetText(frame.CurrentValue) - frame:GetScript('OnEnterPressed')(frame) - </OnClick> - </Scripts> - </Button> - - <Button name="$parentDownButton" inherits="UIPanelSquareButton"> - <Size x="25" y="20"/> - <Anchors> - <Anchor point="LEFT" relativeTo="$parentUpButton" relativePoint="RIGHT"> - <Offset x="2" y="0"/> - </Anchor> - </Anchors> - <Scripts> - <OnLoad> - SquareButton_SetIcon(self, "DOWN"); - self:RegisterForClicks("AnyUp"); - </OnLoad> - <OnClick> - local frame = _G["SVUI_MentaloPrecisionSetY"]; - frame.CurrentValue = frame.CurrentValue - 1 - frame:SetText(frame.CurrentValue) - frame:GetScript('OnEnterPressed')(frame) - </OnClick> - </Scripts> - </Button> - - <Button name="$parentRightButton" inherits="UIPanelSquareButton"> - <Size x="25" y="20"/> - <Anchors> - <Anchor point="RIGHT" relativeTo="$parentUpButton" relativePoint="LEFT"> - <Offset x="-20" y="0"/> - </Anchor> - </Anchors> - <Scripts> - <OnLoad> - SquareButton_SetIcon(self, "RIGHT"); - self:RegisterForClicks("AnyUp"); - </OnLoad> - <OnClick> - local frame = _G["SVUI_MentaloPrecisionSetX"]; - frame.CurrentValue = frame.CurrentValue + 1 - frame:SetText(frame.CurrentValue) - frame:GetScript('OnEnterPressed')(frame) - </OnClick> - </Scripts> - </Button> - - <Button name="$parentLeftButton" inherits="UIPanelSquareButton"> - <Size x="25" y="20"/> - <Anchors> - <Anchor point="RIGHT" relativeTo="$parentRightButton" relativePoint="LEFT"> - <Offset x="-2" y="0"/> - </Anchor> - </Anchors> - <Scripts> - <OnLoad> - SquareButton_SetIcon(self, "LEFT"); - self:RegisterForClicks("AnyUp"); - </OnLoad> - <OnClick> - local frame = _G["SVUI_MentaloPrecisionSetX"]; - frame.CurrentValue = frame.CurrentValue - 1 - frame:SetText(frame.CurrentValue) - frame:GetScript('OnEnterPressed')(frame) - </OnClick> - </Scripts> - </Button> - </Frames> - </Frame> - - <Frame name="SVUI_Mentalo" movable="true" hidden="true" frameStrata="DIALOG"> - <Size x="300" y="30"/> - <Anchors> - <Anchor point="CENTER"/> - </Anchors> - <Layers> - <Layer level="BACKGROUND"> - <Texture name="$parentBG" setAllPoints="true"/> - </Layer> - <Layer level="OVERLAY"> - <Texture name="$parentTitleBG"> - <Anchors> - <Anchor point="TOPLEFT"/> - <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT"> - <Offset x="0" y="-30"/> - </Anchor> - </Anchors> - </Texture> - </Layer> - <Layer level="ARTWORK"> - <FontString parentKey="Title" inherits="SystemFont_Small" justifyH="LEFT" text="Mentalo The Frame Mover!"> - <Anchors> - <Anchor point="TOPLEFT" relativeTo="$parentTitleBG"> - <Offset x="4" y="0"/> - </Anchor> - <Anchor point="BOTTOMRIGHT" relativeTo="$parentTitleBG"/> - </Anchors> - <Color r="1" g="1" b="1" a="1"/> - </FontString> - <FontString parentKey="SubTitle" inherits="FriendsFont_Small" justifyH="CENTER" text="Right-click frames to move with precision."> - <Anchors> - <Anchor point="TOPLEFT" relativeTo="$parentTitleBG" relativePoint="BOTTOMLEFT"> - <Offset x="4" y="-4"/> - </Anchor> - <Anchor point="TOPRIGHT" relativeTo="$parentTitleBG" relativePoint="BOTTOMRIGHT"> - <Offset x="-4" y="-4"/> - </Anchor> - </Anchors> - <Color r="1" g="1" b="0" a="0.8"/> - </FontString> - <Texture parentKey="Avatar" file="Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-OFF"> - <Size x="132" y="132"/> - <Anchors> - <Anchor point="BOTTOM" relativeTo="$parentBG" relativePoint="TOP"/> - </Anchors> - </Texture> - </Layer> - </Layers> - <Frames> - <Button name="$parentLockButton" inherits="OptionsButtonTemplate" text="Lock"> - <Size x="96" y="24"/> - <Anchors> - <Anchor point="RIGHT" relativeTo="$parentBG"> - <Offset x="-4" y="0"/> - </Anchor> - </Anchors> - </Button> - </Frames> - <Scripts> - <OnHide> - _G["SVUI_MentaloPrecision"]:Hide(); - </OnHide> - <OnDragStart> - self.moving = true; - self:StartMoving(); - </OnDragStart> - <OnDragStop> - self.moving = nil; - self:StopMovingOrSizing(); - </OnDragStop> - </Scripts> - </Frame> -</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/xml/screen.lua b/Interface/AddOns/SVUI/xml/screen.lua deleted file mode 100644 index bec319f..0000000 --- a/Interface/AddOns/SVUI/xml/screen.lua +++ /dev/null @@ -1,119 +0,0 @@ -function SVUIScreenOnLoad(self) - local macWidth = math.floor(GetScreenWidth() * 100 + .5) / 100; - self:SetAttribute("MAC_DISPLAY_WIDTH", macWidth); - - local macHeight = math.floor(GetScreenHeight() * 100 + .5) / 100; - self:SetAttribute("MAC_DISPLAY_HEIGHT", macHeight); - - local effectiveScale = GetScreenHeightScale() - self:SetAttribute("EFFECTIVE_SCALE", effectiveScale); - - local activeScale - local autoScale = self:GetAttribute("AUTO_SCALE"); - if(autoScale) then - activeScale = math.max(0.64, math.min(1.15, GetScreenHeightScale())); - else - activeScale = math.max(0.64, math.min(1.15, GetCVar("uiScale") or UIParent:GetScale() or GetScreenHeightScale())); - end - self:SetAttribute("ACTIVE_SCALE", activeScale); - - local modScale = effectiveScale / activeScale - self:SetAttribute("MODIFIED_SCALE", modScale); - - self:RegisterEvent("PLAYER_LOGIN"); - self:RegisterEvent("UI_SCALE_CHANGED"); -end - -function SVUIScreenOnEvent(self, event) - local rez = GetCVar("gxResolution") - local height = rez:match("%d+x(%d+)") - local width = rez:match("(%d+)x%d+") - local gxHeight = tonumber(height) - local gxWidth = tonumber(width) - local evalwidth; - - local macWidth = math.floor(GetScreenWidth() * 100 + .5) / 100; - self:SetAttribute("MAC_DISPLAY_WIDTH", macWidth); - local macHeight = math.floor(GetScreenHeight() * 100 + .5) / 100; - self:SetAttribute("MAC_DISPLAY_HEIGHT", macHeight); - local effectiveScale = GetScreenHeightScale() - self:SetAttribute("EFFECTIVE_SCALE", effectiveScale); - - local activeScale - local autoScale = self:GetAttribute("AUTO_SCALE"); - if(autoScale) then - activeScale = math.max(0.64, math.min(1.15, GetScreenHeightScale())); - else - activeScale = math.max(0.64, math.min(1.15, GetCVar("uiScale") or UIParent:GetScale() or GetScreenHeightScale())); - end - self:SetAttribute("ACTIVE_SCALE", activeScale); - - local modScale = effectiveScale / activeScale - self:SetAttribute("MODIFIED_SCALE", modScale); - - if(IsMacClient()) then - macHeight = self:GetAttribute("MAC_DISPLAY_HEIGHT"); - macWidth = self:GetAttribute("MAC_DISPLAY_WIDTH"); - if(gxHeight ~= macHeight or gxWidth ~= macWidth) then - gxHeight = macHeight - gxWidth = macWidth - end - end - - if(gxWidth < 1600) then - self.LowRez = true; - elseif(gxWidth >= 3840) then - self.LowRez = nil - if(self:GetAttribute("MULTI_MONITOR")) then - if(gxWidth < 4080) then - evalwidth = 1224; - elseif(gxWidth < 4320) then - evalwidth = 1360; - elseif(gxWidth < 4800) then - evalwidth = 1440; - elseif(gxWidth < 5760) then - if(gxHeight == 900) then evalwidth = 1600 else evalwidth = 1680 end - elseif(gxWidth < 7680) then - evalwidth = 1920; - elseif(gxWidth < 9840) then - evalwidth = 2560; - elseif(gxWidth > 9839) then - evalwidth = 3280; - end - else - if(gxWidth < 4080) then - evalwidth = 3840; - elseif(gxWidth < 4320) then - evalwidth = 4080; - elseif(gxWidth < 4800) then - evalwidth = 4320; - elseif(gxWidth < 5040) then - evalwidth = 4800; - elseif(gxWidth < 5760) then - evalwidth = 5040; - elseif(gxWidth < 7680) then - evalwidth = 5760; - elseif(gxWidth < 9840) then - evalwidth = 7680; - elseif(gxWidth > 9839) then - evalwidth = 9840; - end - end - end - - self:ClearAllPoints(); - - if evalwidth then - local width = evalwidth - local height = gxHeight; - if(not autoScale or height > 1200) then - height = UIParent:GetHeight(); - local ratio = gxHeight / height; - width = evalwidth / ratio; - end - self:SetSize(width, height); - self:SetPoint("CENTER"); - else - self:SetAllPoints(UIParent); - end -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/xml/screen.xml b/Interface/AddOns/SVUI/xml/screen.xml deleted file mode 100644 index 7e582df..0000000 --- a/Interface/AddOns/SVUI/xml/screen.xml +++ /dev/null @@ -1,18 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Script file="screen.lua"/> - <Frame name="SVUIParent" setAllPoints="true" frameStrata="MEDIUM"> - <Attributes> - <Attribute name="MAC_DISPLAY_HEIGHT" type="number" value="768"/> - <Attribute name="MAC_DISPLAY_WIDTH" type="number" value="1024"/> - <Attribute name="EFFECTIVE_SCALE" type="number" value="1"/> - <Attribute name="ACTIVE_SCALE" type="number" value="1"/> - <Attribute name="MODIFIED_SCALE" type="number" value="1"/> - <Attribute name="AUTO_SCALE" type="boolean" value="true"/> - <Attribute name="MULTI_MONITOR" type="boolean" value="false"/> - </Attributes> - <Scripts> - <OnLoad function="SVUIScreenOnLoad"/> - <OnEvent function="SVUIScreenOnEvent"/> - </Scripts> - </Frame> -</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/xml/system.xml b/Interface/AddOns/SVUI/xml/system.xml deleted file mode 100644 index dc0c93f..0000000 --- a/Interface/AddOns/SVUI/xml/system.xml +++ /dev/null @@ -1,96 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Frame name="SVUI_PanelTemplate" virtual="true" toplevel="true"> - <Layers> - <Layer level="BACKGROUND"> - <Texture name="$parentBG" setAllPoints="true"/> - </Layer> - <Layer level="OVERLAY"> - <Texture name="$parentTitleBG"> - <Anchors> - <Anchor point="BOTTOMLEFT" relativeTo="$parentBG" relativePoint="TOPLEFT"/> - <Anchor point="TOPRIGHT" relativeTo="$parentBG" relativePoint="TOPRIGHT"> - <Offset x="0" y="30"/> - </Anchor> - </Anchors> - </Texture> - </Layer> - </Layers> - </Frame> - - <Frame name="SVUI_MovingPanelTemplate" virtual="true" movable="true" clampedToScreen="true" toplevel="true"> - <Layers> - <Layer level="BACKGROUND"> - <Texture name="$parentBG" setAllPoints="true"/> - </Layer> - <Layer level="OVERLAY"> - <Texture name="$parentTitleBG"> - <Anchors> - <Anchor point="TOPLEFT"/> - <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT"> - <Offset x="0" y="-30"/> - </Anchor> - </Anchors> - </Texture> - </Layer> - </Layers> - <Frames> - <Frame name="$parentTitleButton"> - <Anchors> - <Anchor point="TOPLEFT" relativeTo="$parentTitleBG"/> - <Anchor point="BOTTOMRIGHT" relativeTo="$parentTitleBG"/> - </Anchors> - </Frame> - </Frames> - </Frame> - - <Frame name="SVUI_MessagePanelTemplate" virtual="true" toplevel="true"> - <Layers> - <Layer level="BACKGROUND"> - <Texture name="$parentBG" setAllPoints="true"/> - </Layer> - <Layer level="OVERLAY"> - <Texture name="$parentTitleBG"> - <Anchors> - <Anchor point="TOPLEFT"> - <Offset x="8" y="-8"/> - </Anchor> - <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT"> - <Offset x="-32" y="-24"/> - </Anchor> - </Anchors> - </Texture> - <Texture name="$parentDialogBG"> - <Anchors> - <Anchor point="TOPLEFT"> - <Offset x="8" y="-32"/> - </Anchor> - <Anchor point="BOTTOMRIGHT"> - <Offset x="-32" y="32"/> - </Anchor> - </Anchors> - </Texture> - </Layer> - <Layer level="ARTWORK"> - <FontString parentKey="Title" inherits="GameFontNormal"> - <Anchors> - <Anchor point="TOPLEFT"> - <Offset x="8" y="-8"/> - </Anchor> - <Anchor point="TOPRIGHT"> - <Offset x="-32" y="-24"/> - </Anchor> - </Anchors> - </FontString> - </Layer> - </Layers> - <Frames> - <Button parentKey="Close" inherits="UIPanelCloseButton"> - <Anchors> - <Anchor point="TOPRIGHT"> - <Offset x="-2" y="-2"/> - </Anchor> - </Anchors> - </Button> - </Frames> - </Frame> -</Ui> \ 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 464163a..2d0f165 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.1 +## Version: 5.2 ## Title: |cffFF9900SVUI |r|cffFFEF00Chat-O-Matic|r ## Notes: Supervillain UI [|cff9911FFVarious Chat Gadgets|r] ## SavedVariables: ChatOMatic_Data @@ -8,7 +8,7 @@ ## RequiredDeps: SVUI ## LoadOnDemand: 1 ## X-Email: munglunch@gmail.com -## X-SVUI-Header: Chat-O-Matic -## X-SVUI-Schema: ChatOMatic +## X-SVUIName: Chat-O-Matic +## X-SVUISchema: ChatOMatic SVUI_ChatOMatic.xml diff --git a/Interface/AddOns/SVUI_ChatOMatic/components/answering_service.lua b/Interface/AddOns/SVUI_ChatOMatic/components/answering_service.lua index 9826ea4..ffae20e 100644 --- a/Interface/AddOns/SVUI_ChatOMatic/components/answering_service.lua +++ b/Interface/AddOns/SVUI_ChatOMatic/components/answering_service.lua @@ -791,11 +791,11 @@ function PLUGIN:HangUp(caller,ignored) local inUse,onHold = self:GetServiceState() if inUse == false then - self.Window:Hide() + self.Docklet:Hide() elseif onHold == true then - self.Window:Show() + self.Docklet:Show() else - self.Window:Show() + self.Docklet:Show() end if(ignored) then @@ -867,11 +867,11 @@ OTHER HANDLERS ########################################################## ]]-- local AnsweringOnClick = function() - if(not PLUGIN.Window) then return end - if(PLUGIN.Window:IsShown()) then - PLUGIN.Window:Hide() + if(not PLUGIN.Docklet) then return end + if(PLUGIN.Docklet:IsShown()) then + PLUGIN.Docklet:Hide() else - PLUGIN.Window:Show() + PLUGIN.Docklet:Show() end end @@ -903,69 +903,44 @@ function PLUGIN:EnableAnsweringService() self:RegisterEvent("CHAT_MSG_IGNORED") self:RegisterUpdate("PhoneTimeUpdate", 4) - local buttonsize = SV.Dock.BarLeft.ToolBar:GetHeight() - - local docklet = CreateFrame("Button", nil, UIParent) - docklet:SetParent(SV.Dock.BarLeft.ToolBar) - docklet:Point("LEFT", SV.Dock.BarLeft.ToolBar, "LEFT", 0, 0) - docklet:Size(buttonsize, buttonsize) - docklet:SetFramedButtonTemplate() - docklet.Icon = docklet:CreateTexture(nil, "OVERLAY") - docklet.Icon:FillInner(docklet,2,2) - docklet.Icon:SetTexture(ICON_FILE) - docklet.stateColor = {"VERTICAL", 0.33, 0.25, 0.13, 0.47, 0.39, 0.27} - docklet.TText = L["Show / Hide Phone Lines"] - docklet:RegisterForClicks("AnyUp") - - SV.Dock.BarLeft:Initialize(docklet, AnsweringOnClick) - SV.Dock.BarLeft.ToolBar:SetWidth(buttonsize + 4) - - self.Docklet = docklet - - local window = CreateFrame("Frame", nil, UIParent) - window:SetFrameStrata("MEDIUM") - window:SetWidth(128) - window:SetHeight(145) - window:SetScript("OnDragStart", function(this) this:StartMoving() end) - window:SetScript("OnDragStop", function(this) this:StopMovingOrSizing() end) - window:SetPoint("BOTTOMRIGHT", SV.Dock.Left, "TOPRIGHT", 0, 6) - window:SetFixedPanelTemplate("Transparent") - window:SetMovable(true) - window:EnableMouse(true) - window:SetClampedToScreen(true) - window:RegisterForDrag("LeftButton") + self.Docklet = SV.Dock:NewDocklet("BottomLeft", "SVUI_ChatOMaticDock", "Answering Service", ICON_FILE, AnsweringOnClick) + + 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:SetWidth(128) + title:SetPoint("TOPLEFT", window, "TOPLEFT", 0, -2) + title:SetPoint("TOPRIGHT", window, "TOPRIGHT", 0, -2) title:SetHeight(50) title:SetFontObject(GameFontNormal) title:SetTextColor(0.5, 0.5, 1, 1) title:SetJustifyH("CENTER") title:SetJustifyV("TOP") - title:SetPoint("TOP", window, "TOP", 0, -2) title:SetText("Henchman Answering Service") for x = 1, 5 do local phLn = CreateFrame("Button", "HenchmenPhoneLine"..x, window) - phLn:SetWidth(124) + phLn:SetPoint("TOPLEFT", window, "TOPLEFT", 8, ((-20) - (x * 25))) + phLn:SetPoint("TOPRIGHT", window, "TOPRIGHT", -8, ((-20) - (x * 25))) phLn:SetHeight(20) - phLn:SetPoint("TOPLEFT", window, "TOPLEFT", 2, ((-16) - (x * 21))) phLn:RegisterForClicks("AnyUp") phLn:SetScript("OnClick", PhoneLineClick) phLn:SetFixedPanelTemplate("Button") phLn.Text = phLn:CreateFontString() - phLn.Text:SetWidth(124) + phLn.Text:SetPoint("TOPLEFT", phLn, "TOPLEFT", 0, 0) + phLn.Text:SetPoint("TOPRIGHT", phLn, "TOPRIGHT", 0, 0) phLn.Text:SetHeight(20) phLn.Text:SetFontObject(GameFontNormalSmall) phLn.Text:SetTextColor(1, 1, 1, 1) phLn.Text:SetJustifyH("CENTER") phLn.Text:SetJustifyV("MIDDLE") - phLn.Text:SetPoint("TOP", "HenchmenPhoneLine"..x, "TOP") phLn.Text:SetText("Empty Phone Line") end - self.Window = window - self.Window: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 001c852..da8a8d2 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua @@ -94,17 +94,9 @@ local function CommonFontSizeUpdate() SV.db.SVUnit.arena.power.fontSize = largefont; SV.db.SVUnit.arena.name.fontSize = largefont; - SV.db.SVUnit.raid10.health.fontSize = largefont; - SV.db.SVUnit.raid10.power.fontSize = largefont; - SV.db.SVUnit.raid10.name.fontSize = largefont; - - SV.db.SVUnit.raid25.health.fontSize = largefont; - SV.db.SVUnit.raid25.power.fontSize = largefont; - SV.db.SVUnit.raid25.name.fontSize = largefont; - - SV.db.SVUnit.raid40.health.fontSize = largefont; - SV.db.SVUnit.raid40.power.fontSize = largefont; - SV.db.SVUnit.raid40.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; @@ -386,7 +378,7 @@ SV.Options.args.common = { type = 'toggle', name = L["Awesome Game Menu"], get = function(j)return SV.db.general.ego end, - set = function(j,value) SV.db.general.ego = value; SV:StaticPopup_Show("RL_CLIENT") end + set = function(j,value) SV.db.general.ego = value; SV.Ego:Toggle() end }, } }, @@ -421,7 +413,7 @@ SV.Options.args.common = { name = L['Cooldown Text'], desc = L["Display cooldown text on anything with the cooldown spiral."], get = function(j)return SV.db.general.cooldown end, - set = function(j,value)SV.db.general.cooldown = value;SV:StaticPopup_Show("RL_CLIENT")end + set = function(j,value)SV.db.general.cooldown = value; SV:StaticPopup_Show("RL_CLIENT")end }, size = { order = 4, @@ -644,6 +636,7 @@ SV.Options.args.common = { end, set = function(key, rValue, gValue, bValue, aValue) SV.db.media.colors.special = {rValue, gValue, bValue, aValue} + SV.db.media.colors.specialdark = {(rValue * 0.75), (gValue * 0.75), (bValue * 0.75), aValue} SV:MediaUpdate() end, }, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc index 1970f4f..cc6419b 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc +++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc @@ -1,12 +1,12 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 5.1 +## Version: 5.2 ## Title: |cffFF9900SVUI |r|cffFFEF00Config-O-Matic|r ## Notes: Supervillain UI [|cff9911FFConfig Options|r] ## RequiredDeps: SVUI ## LoadOnDemand: 1 ## X-Notes: Special thanks to Elv and Tukz for their incredible work. ## X-Email: munglunch@gmail.com -## X-SVUI-Header: Config-O-Matic +## X-SVUIName: Config-O-Matic SVUI_ConfigOMatic.xml diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/dock.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/dock.lua index d2e7ddb..8f5df2d 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/dock.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/dock.lua @@ -69,6 +69,36 @@ 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 }, + dockCenterWidth = { + order = 3, + type = 'range', + name = L['Stat Panel Width'], + desc = L["PANEL_DESC"], + min = 400, + max = 1800, + step = 1, + width = "full", + get = function()return SV.db.Dock.dockCenterWidth; end, + set = function(key,value) + MOD:ChangeDBVar(value,key[#key]); + MOD:Refresh() + end, + }, + buttonSize = { + order = 4, + type = "range", + name = L["Dock Button Size"], + desc = L["PANEL_DESC"], + min = 20, + max = 80, + step = 1, + width = "full", + get = function()return SV.db.Dock.buttonSize;end, + set = function(key,value) + MOD:ChangeDBVar(value,key[#key]); + MOD:Refresh() + end, + }, } }; @@ -126,46 +156,6 @@ SV.Options.args.Dock.args["leftDockGroup"] = { } }; -local function GetLiveDockletsA() - local test = SV.db.Dock.docklets.DockletExtra; - local t = {["None"] = L["None"]}; - for n,l in pairs(SV.Dock.Docklets.Allowed) do - if IsAddOnLoaded(n) or IsAddOnLoaded(l) then - if (test ~= n and test ~= l) then - if n == "Skada" and _G.Skada then - for index,window in pairs(_G.Skada:GetWindows()) do - local key = window.db.name - t["SkadaBarWindow"..key] = (key == "Skada") and "Skada - Main" or "Skada - "..key; - end - else - t[n] = l; - end - end - end - end - return t; -end - -local function GetLiveDockletsB() - local test = SV.db.Dock.docklets.DockletMain; - local t = {["None"] = L["None"]}; - for n,l in pairs(SV.Dock.Docklets.Allowed) do - if IsAddOnLoaded(n) or IsAddOnLoaded(l) then - if (test ~= n and test ~= l) then - if n == "Skada" and _G.Skada then - for index,window in pairs(_G.Skada:GetWindows()) do - local key = window.db.name - t["SkadaBarWindow"..key] = (key == "Skada") and "Skada - Main" or "Skada - "..key; - end - else - t[n] = l; - end - end - end - end - return t; -end - SV.Options.args.Dock.args["rightDockGroup"] = { order = 4, type = "group", @@ -234,7 +224,7 @@ SV.Options.args.Dock.args["rightDockGroup"] = { } }, questHeaders = { - order = 4, + order = 5, type = "group", name = L['Quest Header Styled'], args = { @@ -247,56 +237,16 @@ SV.Options.args.Dock.args["rightDockGroup"] = { disabled = function()return (not SV.db.general.questWatch) end, } } - }, - docklets = { - order = 100, - type = 'group', - name = 'Addon Docklets', - guiInline=true, - args = { - docked = { - order=0, - type='group', - name='Docklet Settings', - guiInline=true, - args = { - DockletMain = { - type = "select", - order = 1, - name = "Primary Docklet", - desc = "Select an addon to occupy the primary docklet window", - values = function()return GetLiveDockletsA()end, - get = function()return SV.db.Dock.docklets.DockletMain end, - set = function(a,value)SV.db.Dock.docklets.DockletMain = value;MOD:ReloadAddonDocklets()end, - }, - DockletCombatFade = { - type = "toggle", - order = 2, - name = "Out of Combat (Hide)", - get = function()return SV.db.Dock.docklets.DockletCombatFade end, - set = function(a,value)SV.db.Dock.docklets.DockletCombatFade = value;end - }, - enableExtra = { - type = "toggle", - order = 3, - name = "Split Docklet", - desc = "Split the primary docklet window for 2 addons.", - get = function()return SV.db.Dock.docklets.enableExtra end, - set = function(a,value)SV.db.Dock.docklets.enableExtra = value;MOD:ReloadAddonDocklets()end, - }, - DockletExtra = { - type = "select", - order = 4, - name = "Secondary Docklet", - desc = "Select another addon", - disabled = function()return (not SV.db.Dock.docklets.enableExtra or SV.db.Dock.docklets.DockletMain == "None") end, - values = function()return GetLiveDockletsB()end, - get = function()return SV.db.Dock.docklets.DockletExtra end, - set = function(a,value)SV.db.Dock.docklets.DockletExtra = value;MOD:ReloadAddonDocklets()end, - } - } - } - } } } -}; \ No newline at end of file +}; + +if(MOD.CustomOptions) then + SV.Options.args.Dock.args.custom = { + order = 5, + type = 'group', + name = 'Custom Docks', + guiInline = true, + args = MOD.CustomOptions + } +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/henchmen.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/henchmen.lua index ae30fcd..f628a54 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/henchmen.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/henchmen.lua @@ -115,7 +115,7 @@ SV.Options.args.SVHenchmen={ name = L['Skip Cinematics'], desc = L['Automatically skip any cinematic sequences.'], get = function(j)return SV.db.SVHenchmen.skipcinematics end, - set = function(j,value)SV.db.SVHenchmen.skipcinematics = value;SV:StaticPopup_Show("RL_CLIENT") end + set = function(j,value) SV.db.SVHenchmen.skipcinematics = value; SV:StaticPopup_Show("RL_CLIENT") end }, autoRepair = { order = 8, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/map.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/map.lua index 8a5a340..8287a53 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/map.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/map.lua @@ -222,17 +222,6 @@ SV.Options.args.SVMap = { desc = L["Don't scale the large world map to block out sides of the screen."], set = function(a,b)MOD:ChangeDBVar(b,a[#a])MOD:ReLoad()end }, - mapAlpha = { - order = 2, - name = L['Map Alpha While Moving'], - desc = L['Controls what the transparency of the worldmap will be set to when you are moving.'], - type = 'range', - isPercent = true, - min = 0, - max = 1, - step = 0.01, - set = function(a,b)MOD:ChangeDBVar(b,a[#a])MOD:ReLoad()end - }, } }, } diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/stat.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/stat.lua index 1daec14..b55bcc6 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/stat.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/stat.lua @@ -78,22 +78,8 @@ SV.Options.args.SVStats = { type = "toggle", name = L["Shortened Gold Text"], }, - dockStatWidth = { - order = 7, - type = "range", - name = L["Stats Width"], - desc = L["PANEL_DESC"], - min = 150, - max = 1200, - step = 1, - width = "full", - set = function(key,value) - MOD:ChangeDBVar(value, key[#key]); - MOD:UpdateStatSize(); - end, - }, fontGroup = { - order = 8, + order = 7, type = "group", guiInline = true, name = L["Fonts"], @@ -141,12 +127,13 @@ SV.Options.args.SVStats = { do local orderIncrement = 0; local statValues = MOD.StatListing - local configTable = SV.db.SVStats.panels; + 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 @@ -163,8 +150,8 @@ do type = 'select', name = L[position] or upper(position), values = statValues, - get = function(key) return SV.db.SVStats.panels[panelName][key[#key]] end, - set = function(key, value) MOD:ChangeDBVar(value, key[#key], "panels", panelName); MOD:Generate() end + 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 diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/tip.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/tip.lua index 6fe229a..573edb0 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/tip.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/tip.lua @@ -157,7 +157,7 @@ SV.Options.args.SVTip = { width = "full", name = L["Font"], values = AceGUIWidgetLSMlists.font, - set = function(a,b)SV.db.SVTip.healthBar.font = b;GameTooltipStatusBar.text:SetFontTemplate(LSM:Fetch("font",SV.db.SVTip.healthBar.font), SV.db.SVTip.healthBar.fontSize,"OUTLINE")end + 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, @@ -167,7 +167,7 @@ SV.Options.args.SVTip = { max = 22, step = 1, width = "full", - set = function(a,b)SV.db.SVTip.healthBar.fontSize = b;GameTooltipStatusBar.text:SetFontTemplate(LSM:Fetch("font",SV.db.SVTip.healthBar.font),SV.db.SVTip.healthBar.fontSize,"OUTLINE")end + 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/focus.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/focus.lua index 5399f95..57c8a24 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/focus.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/focus.lua @@ -40,7 +40,7 @@ local _, ns = ... ################################################################################################## ]] SV.Options.args.SVUnit.args.focus = { - name = L["Focus Frame"], + name = L["Focus"], type = "group", order = 9, childGroups = "tab", @@ -153,7 +153,7 @@ SV.Options.args.SVUnit.args.focus = { ################################################################################################## ]] SV.Options.args.SVUnit.args.focustarget = { - name = L["FocusTarget Frame"], + name = L["FocusTarget"], type = "group", order = 10, childGroups = "tab", diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/grid.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/grid.lua index ee85731..67fba04 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/grid.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/grid.lua @@ -40,7 +40,7 @@ local _, ns = ... ################################################################################################## ]] SV.Options.args.SVUnit.args.grid = { - name = L["Grid Frames"], + name = L["Grid"], type = "group", order = 1200, childGroups = "tab", @@ -49,7 +49,7 @@ SV.Options.args.SVUnit.args.grid = { order = 1, type = "execute", name = L["Display Frames"], - func = function()MOD:ViewGroupFrames(_G["SVUI_Raid40"], _G["SVUI_Raid40"].forceShow ~= true or nil, "raid40")end, + func = function()MOD:ViewGroupFrames(_G["SVUI_Raid"], _G["SVUI_Raid"].forceShow ~= true or nil, "raid")end, }, gridCommon = { order = 2, @@ -130,29 +130,13 @@ SV.Options.args.SVUnit.args.grid = { 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, }, - raid10 = { + 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.raid10.gridAllowed end, - set = function(key, value) SV.db.SVUnit.raid10.gridAllowed = value; MOD:SetGroupFrame("raid10"); end, - }, - raid25 = { - type = 'toggle', - order = 5, - name = L['Raid Grid'], - desc = L['If grid-mode is enabled, these units will be changed.'], - get = function(key) return SV.db.SVUnit.raid25.gridAllowed end, - set = function(key, value) SV.db.SVUnit.raid25.gridAllowed = value; MOD:SetGroupFrame("raid25"); end, - }, - raid40 = { - type = 'toggle', - order = 6, - name = L['Raid Grid'], - desc = L['If grid-mode is enabled, these units will be changed.'], - get = function(key) return SV.db.SVUnit.raid40.gridAllowed end, - set = function(key, value) SV.db.SVUnit.raid40.gridAllowed = value; MOD:SetGroupFrame("raid40") end, + 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', diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/other.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/other.lua index 90305ee..543e445 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/other.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/other.lua @@ -40,7 +40,7 @@ local _, ns = ... ################################################################################################## ]] SV.Options.args.SVUnit.args.boss = { - name = L["Boss Frames"], + name = L["Boss"], type = "group", order = 1000, childGroups = "tab", @@ -109,7 +109,7 @@ SV.Options.args.SVUnit.args.boss = { ################################################################################################## ]] SV.Options.args.SVUnit.args.arena = { - name = L["Arena Frames"], + name = L["Arena"], type = "group", order = 1100, childGroups = "tab", @@ -280,7 +280,7 @@ SV.Options.args.SVUnit.args.arena = { ################################################################################################## ]] SV.Options.args.SVUnit.args.tank = { - name = L["Tank Frames"], + name = L["Tank"], type = "group", order = 1200, childGroups = "tab", @@ -330,7 +330,7 @@ SV.Options.args.SVUnit.args.tank = { ################################################################################################## ]] SV.Options.args.SVUnit.args.assist = { - name = L["Assist Frames"], + name = L["Assist"], type = "group", order = 1300, childGroups = "tab", diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/party.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/party.lua index c8108ce..6f795fa 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/party.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/party.lua @@ -36,7 +36,7 @@ if(not MOD) then return end local _, ns = ... SV.Options.args.SVUnit.args.party = { - name = L['Party Frames'], + name = L['Party'], type = 'group', order = 11, childGroups = "tab", diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/pet.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/pet.lua index 68a370f..1a649ab 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/pet.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/pet.lua @@ -40,7 +40,7 @@ local _, ns = ... ################################################################################################## ]] SV.Options.args.SVUnit.args.pet = { - name = L["Pet Frame"], + name = L["Pet"], type = "group", order = 4, childGroups = "tab", @@ -152,7 +152,7 @@ SV.Options.args.SVUnit.args.pet = { ################################################################################################## ]] SV.Options.args.SVUnit.args.pettarget = { - name = L["PetTarget Frame"], + name = L["Pet Target"], type = "group", order = 5, childGroups = "tab", get = function(l)return SV.db.SVUnit["pettarget"][l[#l]]end, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/player.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/player.lua index 5e78f46..ea331a6 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/player.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/player.lua @@ -40,7 +40,7 @@ local _, ns = ... ################################################################################################## ]] SV.Options.args.SVUnit.args.player={ - name = L['Player Frame'], + name = L['Player'], type = 'group', order = 3, childGroups = "tab", diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/raid.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/raid.lua index 5572eac..7c0b888 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/raid.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/raid.lua @@ -35,359 +35,346 @@ local MOD = SV.SVUnit if(not MOD) then return end local _, ns = ... -local RaidCategories = { - [10] = "Raid (10)", - [25] = "Raid (15,20,25)", - [40] = "Raid (40)", -} - -local subOrder = 11; -for w=10,40,15 do - local raidToken = ("raid%d"):format(w) - local raidGlobal = ("SVUI_Raid%d"):format(w) - subOrder = subOrder + 1 - SV.Options.args.SVUnit.args[raidToken] = { - name = RaidCategories[w], - type = "group", - order = subOrder, - childGroups = "tab", - get = function(l) return SV.db.SVUnit[raidToken][l[#l]] end, - set = function(l, m) MOD:ChangeDBVar(m, l[#l], raidToken); MOD:SetGroupFrame(raidToken) end, - args = { - enable = { - type = "toggle", - order = 1, - name = L["Enable"], - }, - configureToggle = { - order = 2, - type = "execute", - name = L["Display Frames"], - func = function() - local setForced = (_G[raidGlobal].forceShow ~= true) or nil; - MOD:ViewGroupFrames(_G[raidGlobal], setForced) - end, - }, - resetSettings = { - type = "execute", - order = 3, - name = L["Restore Defaults"], - func = function(l, m)MOD:ResetUnitOptions(raidToken) SV.Mentalo:Reset("Raid Frames") end, - }, - tabGroups = { - order = 3, - type = "group", - name = L["Unit Options"], - childGroups = "tree", - args = { - commonGroup = { - order = 1, - type = "group", - name = L["General Settings"], - 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[raidToken].showPlayer end, - set = function(l, m) MOD:ChangeDBVar(m, l[#l], raidToken); MOD:SetGroupFrame(raidToken, true) end, - }, - hideonnpc = +SV.Options.args.SVUnit.args["raid"] = { + name = "Raid", + type = "group", + order = 12, + childGroups = "tab", + 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 = { + enable = { + type = "toggle", + order = 1, + name = L["Enable"], + }, + configureToggle = { + order = 2, + type = "execute", + name = L["Display Frames"], + func = function() + local setForced = (_G["SVUI_Raid"].forceShow ~= true) or nil; + MOD:ViewGroupFrames(_G["SVUI_Raid"], setForced) + end, + }, + resetSettings = { + type = "execute", + order = 3, + name = L["Restore Defaults"], + func = function(l, m)MOD:ResetUnitOptions("raid") SV.Mentalo:Reset("Raid Frames") end, + }, + tabGroups = { + order = 3, + type = "group", + name = L["Unit Options"], + childGroups = "tree", + args = { + commonGroup = { + order = 1, + type = "group", + name = L["General Settings"], + 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."], + type = "toggle", + }, + gps = { + order = 4, + name = "GPS Tracking", + desc = "Show an arrow giving the direction and distance to the frames unit.", + type = "toggle", + }, + 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 = { - 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[raidToken]["power"].hideonnpc end, - set = function(l, m) SV.db.SVUnit[raidToken]["power"].hideonnpc = m; MOD:SetGroupFrame(raidToken)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", - }, - 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"], + ["USE_DEFAULT"] = L["Use Default"], + ["FORCE_ON"] = L["Force On"], + ["FORCE_OFF"] = L["Force Off"], }, - colorOverride = { - order = 7, - name = L["Class Color Override"], - desc = L["Override the default class color setting."], - type = "select", - values = + }, + positionsGroup = { + order = 100, + name = L["Size and Positions"], + type = "group", + guiInline = true, + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raid");MOD:SetGroupFrame("raid", true)end, + args = + { + width = { - ["USE_DEFAULT"] = L["Use Default"], - ["FORCE_ON"] = L["Force On"], - ["FORCE_OFF"] = L["Force Off"], + 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, }, - }, - positionsGroup = { - order = 100, - name = L["Size and Positions"], - type = "group", - guiInline = true, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], raidToken);MOD:SetGroupFrame(raidToken, true)end, - args = - { - width = - { - order = 1, - name = L["Width"], - type = "range", - min = 10, - max = 500, - step = 1, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], raidToken);MOD:SetGroupFrame(raidToken)end, - }, - height = - { - order = 2, - name = L["Height"], - type = "range", - min = 10, - max = 500, - step = 1, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], raidToken);MOD:SetGroupFrame(raidToken)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], raidToken); - MOD:SetGroupFrame(raidToken) - if(_G[raidGlobal] and _G[raidGlobal].isForced) then - MOD:ViewGroupFrames(_G[raidGlobal]) - MOD:ViewGroupFrames(_G[raidGlobal], true) - end - end, - }, - wrapXOffset = - { - order = 6, - type = "range", - name = L["Horizontal Spacing"], - min = 0, - max = 50, - step = 1, - }, - wrapYOffset = + height = + { + order = 2, + name = L["Height"], + type = "range", + min = 10, + max = 500, + 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, + name = L["Growth Direction"], + desc = L["Growth direction from the first unitframe."], + type = "select", + values = { - order = 7, - type = "range", - name = L["Vertical Spacing"], - min = 0, - max = 50, - step = 1, + 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], "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, }, - }, - sortingGroup = { - order = 300, - type = "group", - guiInline = true, - name = L["Sorting"], - set = function(l, m)MOD:ChangeDBVar(m, l[#l], raidToken);MOD:SetGroupFrame(raidToken, true)end, - args = + 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 = { - sortMethod = + order = 1, + name = L["Group By"], + desc = L["Set the order that the group will sort."], + type = "select", + values = { - order = 1, - 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, - ["MTMA"] = L["Main Tanks / Main Assist"], - ["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 = + }, + sortDir = + { + order = 2, + name = L["Sort Direction"], + desc = L["Defines the sort order of the selected sort method."], + type = "select", + values = { - order = 2, - 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 grouping order when the raid is not full, this will reverse the direction it starts from."], - disabled = function()return not SV.db.SVUnit[raidToken].customSorting end, - type = "toggle", - }, }, - } - } - }, - misc = ns:SetMiscConfigGroup(true, MOD.SetGroupFrame, raidToken), - health = ns:SetHealthConfigGroup(true, MOD.SetGroupFrame, raidToken), - power = ns:SetPowerConfigGroup(false, MOD.SetGroupFrame, raidToken), - name = ns:SetNameConfigGroup(MOD.SetGroupFrame, raidToken), - buffs = ns:SetAuraConfigGroup(true, "buffs", true, MOD.SetGroupFrame, raidToken), - debuffs = ns:SetAuraConfigGroup(true, "debuffs", true, MOD.SetGroupFrame, raidToken), - 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[raidToken].auraWatch.enable end, - set = function(l, m)MOD:ChangeDBVar(m, "enable", raidToken, "auraWatch");MOD:SetGroupFrame(raidToken)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[raidToken].auraWatch.size end, - set = function(l, m)MOD:ChangeDBVar(m, "size", raidToken, "auraWatch");MOD:SetGroupFrame(raidToken)end, - }, - configureButton = { - type = "execute", - name = L["Configure Auras"], - func = function()ns:SetToFilterConfig("BuffWatch")end, - order = 3, + 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["raid"].customSorting end, + type = "toggle", + }, }, - + } + } + }, + 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[raidToken]["rdebuffs"][l[#l]]end, - set = function(l, m)MOD:ChangeDBVar(m, l[#l], raidToken, "rdebuffs");MOD:SetGroupFrame(raidToken)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, - }, + }, + 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, }, }, - icons = ns:SetIconConfigGroup(MOD.SetGroupFrame, raidToken), }, + icons = ns:SetIconConfigGroup(MOD.SetGroupFrame, "raid"), }, }, - } -end + }, +} -subOrder = subOrder + 1 SV.Options.args.SVUnit.args.raidpet = { - order = subOrder, + order = 13, type = 'group', - name = L['Raid Pet Frames'], + name = L['Raid Pets'], childGroups = "tab", get = function(l)return SV.db.SVUnit['raidpet'][l[#l]]end, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/target.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/target.lua index aeb7efa..0ff343b 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/target.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/target.lua @@ -40,7 +40,7 @@ local _, ns = ... ################################################################################################## ]] SV.Options.args.SVUnit.args.target={ - name = L['Target Frame'], + name = L['Target'], type = 'group', order = 6, childGroups = "tab", @@ -205,7 +205,7 @@ SV.Options.args.SVUnit.args.target={ ################################################################################################## ]] SV.Options.args.SVUnit.args.targettarget={ - name=L['TargetTarget Frame'], + name=L['Target of Target'], type='group', order=7, childGroups="tab", diff --git a/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua b/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua index 12d7d78..ceaf01a 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua @@ -50,10 +50,10 @@ 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_StatsBar4"] = "Bottom Bar Right" - L["SVUI_StatsBar3"] = "Bottom Bar Left" - L["SVUI_StatsBar1"] = "Top Bar Left" - L["SVUI_StatsBar2"] = "Top Bar Right" + L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" + L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" + L["SVUI_DockTopCenterLeft"] = "Top Bar Left" + L["SVUI_DockTopCenterRight"] = "Top Bar Right" end if gameLocale == "frFR" then L["AURAS_DESC"] = "Configure les icônes qui apparaissent près de la Minicarte." @@ -86,10 +86,10 @@ 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_StatsBar4"] = "Bottom Bar Right" - L["SVUI_StatsBar3"] = "Bottom Bar Left" - L["SVUI_StatsBar1"] = "Top Bar Left" - L["SVUI_StatsBar2"] = "Top Bar Right" + L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" + L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" + L["SVUI_DockTopCenterLeft"] = "Top Bar Left" + L["SVUI_DockTopCenterRight"] = "Top Bar Right" end if gameLocale == "deDE" then L["AURAS_DESC"] = "Konfiguriere die Symbole für die Stärkungs- und Schwächungszauber nahe der Minimap." @@ -121,10 +121,10 @@ 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_StatsBar4"] = "Bottom Bar Right" - L["SVUI_StatsBar3"] = "Bottom Bar Left" - L["SVUI_StatsBar1"] = "Top Bar Left" - L["SVUI_StatsBar2"] = "Top Bar Right" + L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" + L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" + L["SVUI_DockTopCenterLeft"] = "Top Bar Left" + L["SVUI_DockTopCenterRight"] = "Top Bar Right" end if gameLocale == "itIT" then L["AURAS_DESC"] = "Configure the aura icons that appear near the minimap." @@ -157,10 +157,10 @@ 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_StatsBar4"] = "Bottom Bar Right" - L["SVUI_StatsBar3"] = "Bottom Bar Left" - L["SVUI_StatsBar1"] = "Top Bar Left" - L["SVUI_StatsBar2"] = "Top Bar Right" + L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" + L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" + L["SVUI_DockTopCenterLeft"] = "Top Bar Left" + L["SVUI_DockTopCenterRight"] = "Top Bar Right" end if gameLocale == "koKR" then L["AURAS_DESC"] = "Configure the aura icons that appear near the minimap." @@ -193,10 +193,10 @@ if gameLocale == "koKR" then L["reset"] = "프로필 초기화" L["reset_desc"] = "단순히 다시 새롭게 구성을 원하는 경우, 현재 프로필을 기본값으로 초기화 합니다." L["reset_sub"] = "현재의 프로필을 기본값으로 초기화 합니다" - L["SVUI_StatsBar4"] = "Bottom Bar Right" - L["SVUI_StatsBar3"] = "Bottom Bar Left" - L["SVUI_StatsBar1"] = "Top Bar Left" - L["SVUI_StatsBar2"] = "Top Bar Right" + L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" + L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" + L["SVUI_DockTopCenterLeft"] = "Top Bar Left" + L["SVUI_DockTopCenterRight"] = "Top Bar Right" end if gameLocale == "ptBR" then L["AURAS_DESC"] = "Configurar os ícones das auras que aparecem perto do minimapa." @@ -210,10 +210,10 @@ 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_StatsBar4"] = "Bottom Bar Right" - L["SVUI_StatsBar3"] = "Bottom Bar Left" - L["SVUI_StatsBar1"] = "Top Bar Left" - L["SVUI_StatsBar2"] = "Top Bar Right" + L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" + L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" + L["SVUI_DockTopCenterLeft"] = "Top Bar Left" + L["SVUI_DockTopCenterRight"] = "Top Bar Right" end if gameLocale == "ruRU" then L["AURAS_DESC"] = "Настройка иконок эффектов, находящихся у миникарты." @@ -246,10 +246,10 @@ if gameLocale == "ruRU" then L["reset"] = "Сброс профиля" L["reset_desc"] = "Если ваша конфигурации испорчена или если вы хотите настроить всё заново - сбросьте текущий профиль на стандартные значения." L["reset_sub"] = "Сброс текущего профиля на стандартный" - L["SVUI_StatsBar4"] = "Bottom Bar Right" - L["SVUI_StatsBar3"] = "Bottom Bar Left" - L["SVUI_StatsBar1"] = "Top Bar Left" - L["SVUI_StatsBar2"] = "Top Bar Right" + L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" + L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" + L["SVUI_DockTopCenterLeft"] = "Top Bar Left" + L["SVUI_DockTopCenterRight"] = "Top Bar Right" end if gameLocale == "esES" or gameLocale == "esMX" then L["AURAS_DESC"] = "Configura los iconos de las auras que aparecen cerca del minimapa." @@ -282,10 +282,10 @@ 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_StatsBar4"] = "Bottom Bar Right" - L["SVUI_StatsBar3"] = "Bottom Bar Left" - L["SVUI_StatsBar1"] = "Top Bar Left" - L["SVUI_StatsBar2"] = "Top Bar Right" + L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" + L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" + L["SVUI_DockTopCenterLeft"] = "Top Bar Left" + L["SVUI_DockTopCenterRight"] = "Top Bar Right" end if gameLocale == "zhTW" then L["AURAS_DESC"] = "小地圖旁的光環圖示設定." @@ -318,10 +318,10 @@ if gameLocale == "zhTW" then L["reset"] = "重置設定檔" L["reset_desc"] = "將當前的設定檔恢復到它的預設值,用於你的設定檔損壞,或者你只是想重來的情況。" L["reset_sub"] = "將當前的設定檔恢復為預設值" - L["SVUI_StatsBar4"] = "Bottom Bar Right" - L["SVUI_StatsBar3"] = "Bottom Bar Left" - L["SVUI_StatsBar1"] = "Top Bar Left" - L["SVUI_StatsBar2"] = "Top Bar Right" + L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" + L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" + L["SVUI_DockTopCenterLeft"] = "Top Bar Left" + L["SVUI_DockTopCenterRight"] = "Top Bar Right" end if gameLocale == "zhCN" then L["AURAS_DESC"] = "小地图旁的光环图标设置." @@ -354,8 +354,8 @@ if gameLocale == "zhCN" then L["reset"] = "重置配置文件" L["reset_desc"] = "将当前的配置文件恢复到它的默认值,用于你的配置文件损坏,或者你只是想重来的情况。" L["reset_sub"] = "将当前的配置文件恢复为默认值" - L["SVUI_StatsBar4"] = "Bottom Bar Right" - L["SVUI_StatsBar3"] = "Bottom Bar Left" - L["SVUI_StatsBar1"] = "Top Bar Left" - L["SVUI_StatsBar2"] = "Top Bar Right" + L["SVUI_DockBottomCenterLeft"] = "Bottom Bar Right" + L["SVUI_DockBottomCenterRight"] = "Bottom Bar Left" + L["SVUI_DockTopCenterLeft"] = "Top Bar Left" + L["SVUI_DockTopCenterRight"] = "Top Bar Right" 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 11ed0f2..0e86238 100644 --- a/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua +++ b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua @@ -343,7 +343,7 @@ local ModeAlert_OnHide = function() SV:AddonMessage(ERR_NOT_IN_COMBAT); return; end - SV.Dock.Right.Alert:Deactivate() + PLUGIN.Docklet.Parent.Alert:Deactivate() end local ModeAlert_OnShow = function(self) @@ -353,7 +353,7 @@ local ModeAlert_OnShow = function(self) return; end SV:SecureFadeIn(self, 0.3, 0, 1) - SV.Dock.Right.Alert:Activate(self) + PLUGIN.Docklet.Parent.Alert:Activate(self) end local ModeAlert_OnMouseDown = function(self) @@ -383,6 +383,23 @@ local ModeButton_OnMouseDown = function(self) end --[[ ########################################################## +SIZING CALLBACK +########################################################## +]]-- +local function ResizeCraftingDock() + local DOCK_HEIGHT = PLUGIN.Docklet.Parent.Window:GetHeight(); + local BUTTON_SIZE = (DOCK_HEIGHT * 0.25) - 4; + SVUI_ModesDockToolBar:SetWidth(BUTTON_SIZE + 4); + SVUI_ModesDockToolBar:SetHeight((BUTTON_SIZE + 4) * 4); + SVUI_ModeButton4:SetSize(BUTTON_SIZE,BUTTON_SIZE); + SVUI_ModeButton3:SetSize(BUTTON_SIZE,BUTTON_SIZE); + SVUI_ModeButton2:SetSize(BUTTON_SIZE,BUTTON_SIZE); + SVUI_ModeButton1:SetSize(BUTTON_SIZE,BUTTON_SIZE); +end + +LibSuperVillain("Registry"):NewCallback("DOCKS_UPDATED", "ResizeCraftingDock", ResizeCraftingDock); +--[[ +########################################################## BUILD FUNCTION ########################################################## ]]-- @@ -391,22 +408,16 @@ function PLUGIN:Load() self.WornItems = {}; self.InModeGear = false; - local ALERT_HEIGHT = 60; - local DOCK_WIDTH = SV.Dock.Right.Window:GetWidth(); - local DOCK_HEIGHT = SV.Dock.Right.Window:GetHeight(); - local DOCKLET_WIDTH = DOCK_WIDTH - 4 - local DOCKLET_HEIGHT = DOCK_HEIGHT - 4 - local BUTTON_SIZE = (DOCK_HEIGHT * 0.25) - 4; + self.Docklet = SV.Dock:NewDocklet("BottomRight", "SVUI_ModesDockFrame", self.TitleID, ICON_FILE); - local modesDocklet = CreateFrame("Frame", "SVUI_ModesDockFrame", SV.Dock.Right.Window) - modesDocklet:SetWidth(DOCKLET_WIDTH); - modesDocklet:SetHeight(DOCKLET_HEIGHT); - modesDocklet:SetPoint("CENTER",SV.Dock.Right.Window,"CENTER",0,0); + local DOCK_HEIGHT = self.Docklet.Parent.Window:GetHeight(); + local DOCKLET_HEIGHT = DOCK_HEIGHT - 4; + local BUTTON_SIZE = (DOCK_HEIGHT * 0.25) - 4; - local modesToolBar = CreateFrame("Frame", "SVUI_ModesDockToolBar", modesDocklet) + local modesToolBar = CreateFrame("Frame", "SVUI_ModesDockToolBar", self.Docklet) modesToolBar:SetWidth(BUTTON_SIZE + 4); modesToolBar:SetHeight((BUTTON_SIZE + 4) * 4); - modesToolBar:SetPoint("BOTTOMLEFT",modesDocklet,"BOTTOMLEFT",0,0); + modesToolBar:SetPoint("BOTTOMLEFT", self.Docklet, "BOTTOMLEFT", 0, 0); local mode4Button = CreateFrame("Frame", "SVUI_ModeButton4", modesToolBar) mode4Button:SetPoint("BOTTOM",modesToolBar,"BOTTOM",0,0) @@ -456,8 +467,8 @@ function PLUGIN:Load() mode1Button:SetScript('OnLeave', ModeButton_OnLeave) mode1Button:SetScript('OnMouseDown', ModeButton_OnMouseDown) - local ModeAlert = CreateFrame("Frame", nil, SV.Dock.Right.Alert) - ModeAlert:SetAllPoints(SV.Dock.Right.Alert) + local ModeAlert = CreateFrame("Frame", nil, self.Docklet) + ModeAlert:SetAllPoints(self.Docklet.Parent.Alert) ModeAlert:SetBackdrop({ bgFile = [[Interface\AddOns\SVUI\assets\artwork\Bars\HALFTONE]], edgeFile = [[Interface\BUTTONS\WHITE8X8]], @@ -491,8 +502,8 @@ function PLUGIN:Load() ModeLogsFrame:SetFrameStrata("MEDIUM") ModeLogsFrame:SetPoint("TOPLEFT", mode1Button, "TOPRIGHT", 5, -5) - ModeLogsFrame:SetPoint("BOTTOMRIGHT", modesDocklet, "BOTTOMRIGHT", -5, 5) - ModeLogsFrame:SetParent(modesDocklet) + ModeLogsFrame:SetPoint("BOTTOMRIGHT", self.Docklet, "BOTTOMRIGHT", -5, 5) + ModeLogsFrame:SetParent(self.Docklet) local title = CreateFrame("ScrollingMessageFrame", nil, ModeLogsFrame) title:SetSpacing(4) @@ -500,7 +511,7 @@ function PLUGIN:Load() title:SetFrameStrata("MEDIUM") title:SetPoint("TOPLEFT",ModeLogsFrame,"TOPLEFT",0,0) title:SetPoint("BOTTOMRIGHT",ModeLogsFrame,"TOPRIGHT",0,-20) - title:SetFontTemplate(UNIT_NAME_FONT, 16, "OUTLINE", "CENTER", "MIDDLE") + title:FontManager(UNIT_NAME_FONT, 16, "OUTLINE", "CENTER", "MIDDLE") title:SetMaxLines(1) title:EnableMouseWheel(false) title:SetFading(false) @@ -524,7 +535,7 @@ function PLUGIN:Load() log:SetFrameStrata("MEDIUM") log:SetPoint("TOPLEFT",title,"BOTTOMLEFT",0,0) log:SetPoint("BOTTOMRIGHT",ModeLogsFrame,"BOTTOMRIGHT",0,0) - log:SetFontTemplate(nil, self.db.fontSize, "OUTLINE") + log:FontManager(nil, self.db.fontSize, "OUTLINE") log:SetJustifyH("CENTER") log:SetJustifyV("MIDDLE") log:SetShadowColor(0, 0, 0, 0) @@ -543,14 +554,8 @@ function PLUGIN:Load() self.ModeAlert = ModeAlert self.TitleWindow = title self.LogWindow = log - self.Docklet = modesDocklet - - SV.Dock:RegisterDocklet("SVUI_ModesDockFrame", self.TitleID, ICON_FILE, false) - self.Docklet:Hide() - self.ListenerEnabled = false; - self:CraftingReset() self:LoadCookingMode() self:LoadFishingMode() diff --git a/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.toc b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.toc index fe02c04..1346fba 100644 --- a/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.toc +++ b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.toc @@ -1,13 +1,13 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 5.1 +## Version: 5.2 ## Title: |cffFF9900SVUI |r|cffFFEF00Craft-O-Matic|r ## Notes: Supervillain UI [|cff9911FFProfession Tools|r]. ## SavedVariablesPerCharacter: CraftOMatic_Profile, CraftOMatic_Cache ## RequiredDeps: SVUI ## LoadOnDemand: 1 ## X-Email: munglunch@gmail.com -## X-SVUI-Header: Craft-O-Matic -## X-SVUI-Schema: CraftOMatic +## X-SVUIName: Craft-O-Matic +## X-SVUISchema: CraftOMatic SVUI_CraftOMatic.xml diff --git a/Interface/AddOns/SVUI_CraftOMatic/components/archaeology.lua b/Interface/AddOns/SVUI_CraftOMatic/components/archaeology.lua index 9a23b35..1de1163 100644 --- a/Interface/AddOns/SVUI_CraftOMatic/components/archaeology.lua +++ b/Interface/AddOns/SVUI_CraftOMatic/components/archaeology.lua @@ -458,19 +458,18 @@ function PLUGIN:LoadArchaeologyMode() end bar:SetStatusBarColor(0.2, 0.2, 0.8, 0.5) - local sOffset = SV:Scale(1) -- Race Text local race = bar:CreateFontString() race:SetFontObject(NumberFont_Outline_Large) race:SetText(RACE) - race:SetPoint("TOPLEFT", bar, "TOPLEFT", sOffset, -sOffset) + race:SetPoint("TOPLEFT", bar, "TOPLEFT", 1, -1) race:SetTextColor(1,0.8,0) -- Progress Text local progress = bar:CreateFontString() progress:SetFont(SV.Media.font.roboto, 11, "OUTLINE") progress:SetText("") - progress:SetPoint("BOTTOMRIGHT", bar, "BOTTOMRIGHT", -sOffset, sOffset) + progress:SetPoint("BOTTOMRIGHT", bar, "BOTTOMRIGHT", -1, 1) -- Solve solve:SetAllPoints(bar) diff --git a/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua index f165c40..0065c36 100644 --- a/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua +++ b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua @@ -701,8 +701,8 @@ local function MakeLogWindow() frame:SetFrameStrata("MEDIUM") frame:SetPoint("TOPLEFT", PLUGIN.Summary, "BOTTOMLEFT",0,0) - frame:SetPoint("BOTTOMRIGHT", SVUI_FightOMaticDock, "BOTTOMRIGHT",0,0) - frame:SetParent(SVUI_FightOMaticDock) + frame:SetPoint("BOTTOMRIGHT", PLUGIN.Docklet, "BOTTOMRIGHT",0,0) + frame:SetParent(PLUGIN.Docklet) local output = CreateFrame("ScrollingMessageFrame", nil, frame) output:SetSpacing(4) @@ -740,8 +740,8 @@ local function MakeCommWindow() frame:SetFrameStrata("MEDIUM") frame:SetPoint("TOPLEFT", PLUGIN.Summary, "BOTTOMLEFT",0,0) - frame:SetPoint("BOTTOMRIGHT", SVUI_FightOMaticDock, "BOTTOMRIGHT",0,0) - frame:SetParent(SVUI_FightOMaticDock) + frame:SetPoint("BOTTOMRIGHT", PLUGIN.Docklet, "BOTTOMRIGHT",0,0) + frame:SetParent(PLUGIN.Docklet) local fallback = CreateFrame("Frame", nil, frame) fallback:SetAllPoints(frame) @@ -822,8 +822,8 @@ local function MakeUtilityWindow() frame:SetFrameStrata("MEDIUM") frame:SetPoint("TOPLEFT", PLUGIN.Summary, "BOTTOMLEFT",0,0) - frame:SetPoint("BOTTOMRIGHT", SVUI_FightOMaticDock, "BOTTOMRIGHT",0,0) - frame:SetParent(SVUI_FightOMaticDock) + frame:SetPoint("BOTTOMRIGHT", PLUGIN.Docklet, "BOTTOMRIGHT",0,0) + frame:SetParent(PLUGIN.Docklet) local fbText = frame:CreateFontString(nil, "OVERLAY") fbText:SetAllPoints(frame) @@ -842,8 +842,8 @@ local function MakeInfoWindow() frame:SetFrameStrata("MEDIUM") frame:SetPoint("TOPLEFT", PLUGIN.Summary, "BOTTOMLEFT",0,0) - frame:SetPoint("BOTTOMRIGHT", SVUI_FightOMaticDock, "BOTTOMRIGHT",0,0) - frame:SetParent(SVUI_FightOMaticDock) + frame:SetPoint("BOTTOMRIGHT", PLUGIN.Docklet, "BOTTOMRIGHT",0,0) + frame:SetParent(PLUGIN.Docklet) local DATA_WIDTH = (frame:GetWidth() * 0.5) - 2; local DATA_HEIGHT = frame:GetHeight() - 2; @@ -900,7 +900,7 @@ local FightOMaticAlert_OnHide = function() SV:AddonMessage(ERR_NOT_IN_COMBAT); return; end - SV.Dock.Right.Alert:Deactivate() + SV.Dock.BottomRight.Alert:Deactivate() end local FightOMaticAlert_OnShow = function(self) @@ -910,7 +910,7 @@ local FightOMaticAlert_OnShow = function(self) return; end SV:SecureFadeIn(self, 0.3, 0, 1) - SV.Dock.Right.Alert:Activate(self) + SV.Dock.BottomRight.Alert:Activate(self) end local FightOMaticAlert_OnMouseDown = function(self) @@ -996,24 +996,20 @@ function PLUGIN:Load() self.cache = self.cache or {} local ALERT_HEIGHT = 60; - local DOCK_WIDTH = SV.Dock.Right.Window:GetWidth(); - local DOCK_HEIGHT = SV.Dock.Right.Window:GetHeight(); + local DOCK_WIDTH = SV.Dock.BottomRight.Window:GetWidth(); + local DOCK_HEIGHT = SV.Dock.BottomRight.Window:GetHeight(); local BUTTON_SIZE = (DOCK_HEIGHT * 0.25) - 4; self.HitBy = false; self.Scanning = false; self.InPVP = false - local holder = CreateFrame("Frame", "SVUI_FightOMaticDock", SV.Dock.Right.Window) - holder:SetFrameStrata("BACKGROUND") - holder:SetWidth(DOCK_WIDTH - 4); - holder:SetHeight(DOCK_HEIGHT - 4); - holder:SetPoint("CENTER",SV.Dock.Right.Window,"CENTER",0,0); + self.Docklet = SV.Dock:NewDocklet("BottomRight", "SVUI_FightOMaticDock", self.TitleID, ICON_FILE) - local toolBar = CreateFrame("Frame", "SVUI_FightOMaticToolBar", holder) + local toolBar = CreateFrame("Frame", "SVUI_FightOMaticToolBar", self.Docklet) toolBar:SetWidth(BUTTON_SIZE + 4); toolBar:SetHeight((BUTTON_SIZE + 4) * 4); - toolBar:SetPoint("BOTTOMLEFT",holder,"BOTTOMLEFT",0,0); + toolBar:SetPoint("BOTTOMLEFT", self.Docklet, "BOTTOMLEFT", 0, 0); local tbDivider = toolBar:CreateTexture(nil,"OVERLAY") tbDivider:SetTexture(0,0,0,0.5) @@ -1073,13 +1069,13 @@ function PLUGIN:Load() tool1:SetScript('OnLeave', FightOMaticTool_OnLeave) tool1:SetScript('OnMouseDown', Scanner_OnMouseDown) - local title = CreateFrame("ScrollingMessageFrame", nil, holder) + local title = CreateFrame("ScrollingMessageFrame", nil, self.Docklet) title:SetSpacing(4) title:SetClampedToScreen(false) title:SetFrameStrata("MEDIUM") title:SetPoint("TOPLEFT", toolBar, "TOPRIGHT",0,0) - title:SetPoint("BOTTOMRIGHT", holder, "TOPRIGHT",0,-16) - title:SetFontTemplate(SV.Media.font.names, 16, "OUTLINE", "CENTER", "MIDDLE") + title:SetPoint("BOTTOMRIGHT", self.Docklet, "TOPRIGHT",0,-16) + title:FontManager(SV.Media.font.names, 16, "OUTLINE", "CENTER", "MIDDLE") title:SetMaxLines(1) title:EnableMouseWheel(false) title:SetFading(false) @@ -1093,7 +1089,7 @@ function PLUGIN:Load() self.Title = title - local listbutton = CreateFrame("Button", nil, holder) + local listbutton = CreateFrame("Button", nil, self.Docklet) listbutton:SetPoint("TOPLEFT", title, "BOTTOMLEFT",0,0) listbutton:SetPoint("BOTTOMRIGHT", title, "BOTTOMRIGHT",0,-14) listbutton:SetButtonTemplate(true) @@ -1104,13 +1100,13 @@ function PLUGIN:Load() self.Switch = listbutton - local summary = CreateFrame("ScrollingMessageFrame", nil, holder) + local summary = CreateFrame("ScrollingMessageFrame", nil, self.Docklet) summary:SetSpacing(4) summary:SetClampedToScreen(false) summary:SetFrameStrata("MEDIUM") summary:SetPoint("TOPLEFT", title, "BOTTOMLEFT",0,0) summary:SetPoint("BOTTOMRIGHT", title, "BOTTOMRIGHT",0,-14) - summary:SetFontTemplate(SV.Media.font.system, 12, "OUTLINE", "CENTER", "MIDDLE") + summary:FontManager(SV.Media.font.system, 12, "OUTLINE", "CENTER", "MIDDLE") summary:SetMaxLines(1) summary:EnableMouse(false) summary:SetFading(false) @@ -1129,9 +1125,7 @@ function PLUGIN:Load() MakeUtilityWindow() MakeInfoWindow() - SV.Dock:RegisterDocklet("SVUI_FightOMaticDock", self.TitleID, ICON_FILE) - - holder: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 c806648..cf4006d 100644 --- a/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.toc +++ b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.toc @@ -1,13 +1,13 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 5.1 +## Version: 5.2 ## Title: |cffFF9900SVUI |r|cffFFEF00Fight-O-Matic|r ## Notes: Supervillain UI [|cff9911FFPvP Tools|r]. ## SavedVariablesPerCharacter: FightOMatic_Profile, FightOMatic_Cache ## RequiredDeps: SVUI ## LoadOnDemand: 1 ## X-Email: munglunch@gmail.com -## X-SVUI-Header: Fight-O-Matic -## X-SVUI-Schema: FightOMatic +## X-SVUIName: Fight-O-Matic +## X-SVUISchema: FightOMatic SVUI_FightOMatic.xml diff --git a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.toc b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.toc index 06bdf22..dadff82 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.1 +## Version: 5.2 ## Title: |cffFF9900SVUI |r|cffFFEF00Log-O-Matic|r ## Notes: Supervillain UI [|cff9911FFData Logging|r]. ## SavedVariables: LogOMatic_Data @@ -8,7 +8,7 @@ ## RequiredDeps: SVUI ## LoadOnDemand: 1 ## X-Email: munglunch@gmail.com -## X-SVUI-Header: Log-O-Matic -## X-SVUI-Schema: LogOMatic +## X-SVUIName: Log-O-Matic +## X-SVUISchema: LogOMatic SVUI_LogOMatic.xml diff --git a/Interface/AddOns/SVUI_StyleOMatic/Loader.lua b/Interface/AddOns/SVUI_StyleOMatic/Loader.lua index 2fa82f1..6d0f710 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/Loader.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/Loader.lua @@ -109,10 +109,10 @@ AddonObject.configs = { ["alDamageMeter"] = true, ["Omen"] = true, ["TradeSkillDW"] = true, - } + }, }; -local PLUGIN = LibSuperVillain("Registry"):NewPlugin(AddonName, AddonObject, "StyleOMatic_Profile", "StyleOMatic_Global") +local PLUGIN = LibSuperVillain("Registry"):NewPlugin(AddonName, AddonObject, "StyleOMatic_Profile", "StyleOMatic_Global", "StyleOMatic_Cache") local Schema = PLUGIN.Schema; local SV = _G["SVUI"]; local L = SV.L diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua index ffd66cd..31ffea8 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua @@ -54,7 +54,6 @@ local NewHook = hooksecurefunc; CORE DATA ########################################################## ]]-- -PLUGIN.DockedParent = {} PLUGIN.AddOnQueue = {}; PLUGIN.AddOnEvents = {}; PLUGIN.CustomQueue = {}; @@ -261,100 +260,245 @@ end OPTIONS CREATION ########################################################## ]]-- -local RegisterAddonDocklets = function() - local MAIN = _G["SVUI_DockedAddon1"]; - local EXTRA = _G["SVUI_DockedAddon2"]; - local main = SV.db.Dock.docklets.DockletMain; - local alternate = SV.db.Dock.docklets.enableExtra and SV.db.Dock.docklets.DockletExtra or ""; +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") + return dock1, dock2, enabled1, enabled2 +end + +function PLUGIN:ValidateDocklet(addon) + local dock1,dock2,enabled1,enabled2 = self:FetchDocklets(); + local valid = false; + + if(dock1:find(addon) or dock2:find(addon)) then + valid = true + end + + return valid,enabled1,enabled2 +end + +function PLUGIN:DockletReady(addon, dock) + if((not addon) or (not dock)) then return false end + if(dock:find(addon)) then + return true + end + return false +end + +function PLUGIN:RegisterAddonDocklets() + local dock1,dock2,enabled1,enabled2 = self:FetchDocklets(); local tipLeft, tipRight = "", ""; - if main == nil or main == "None" then return end - - if find(main, "Skada") or find(alternate, "Skada") then - if SV.Dock:IsDockletReady("Skada") then - PLUGIN:Docklet_Skada() - if find(alternate, "Skada") and EXTRA.FrameName ~= "SkadaHolder2" then - tipRight = "and Skada"; - SV.Dock:RegisterExtraDocklet("SkadaHolder2") - PLUGIN.DockedParent["Skada"] = EXTRA - end - if find(main, "Skada") and MAIN.FrameName ~= "SkadaHolder" then + + self.Docklet.Dock1.FrameLink = nil; + self.Docklet.Dock2.FrameLink = nil; + + if(enabled1) then + local width = self.Docklet:GetWidth(); + self.Docklet:Enable(); + + if(enabled2) then + self.Docklet.Dock1:Show() + self.Docklet.Dock1:SetWidth(width * 0.5) + self.Docklet.Dock2:Show() + self.Docklet.Dock2:SetWidth(width * 0.5) + else + self.Docklet.Dock1:Show() + self.Docklet.Dock2:Hide() + self.Docklet.Dock1:SetWidth(width) + end + + while(not self.Docklet.Dock1.FrameLink) do + if(self:DockletReady("Skada", dock1)) then tipLeft = "Skada"; - SV.Dock:RegisterMainDocklet("SkadaHolder") - PLUGIN.DockedParent["Skada"] = MAIN - end - end - end - if main == "Omen" or alternate == "Omen" then - if SV.Dock:IsDockletReady("Omen") then - if alternate == "Omen" and EXTRA.FrameName ~= "OmenAnchor" then - tipRight = "and Omen"; - SV.Dock:RegisterExtraDocklet("OmenAnchor") - PLUGIN:Docklet_Omen(EXTRA) - PLUGIN.DockedParent["Omen"] = EXTRA - elseif MAIN.FrameName ~= "OmenAnchor" then + self:Docklet_Skada() + elseif(self:DockletReady("Omen", dock1)) then tipLeft = "Omen"; - SV.Dock:RegisterMainDocklet("OmenAnchor") - PLUGIN:Docklet_Omen(MAIN) - PLUGIN.DockedParent["Omen"] = MAIN - end - end - end - if main == "Recount" or alternate == "Recount" then - if SV.Dock:IsDockletReady("Recount") then - if alternate == "Recount" and EXTRA.FrameName ~= "Recount_MainWindow" then - tipRight = "and Recount"; - SV.Dock:RegisterExtraDocklet("Recount_MainWindow") - PLUGIN:Docklet_Recount(EXTRA) - PLUGIN.DockedParent["Recount"] = EXTRA - elseif MAIN.FrameName ~= "Recount_MainWindow" then + self:Docklet_Omen(self.Docklet.Dock1) + elseif(self:DockletReady("Recount", dock1)) then tipLeft = "Recount"; - SV.Dock:RegisterMainDocklet("Recount_MainWindow") - PLUGIN:Docklet_Recount(MAIN) - PLUGIN.DockedParent["Recount"] = MAIN - end - end - end - if main == "TinyDPS" or alternate == "TinyDPS" then - if SV.Dock:IsDockletReady("TinyDPS") then - if alternate == "TinyDPS" and EXTRA.FrameName ~= "tdpsFrame" then - tipRight = "and TinyDPS"; - SV.Dock:RegisterExtraDocklet("tdpsFrame") - PLUGIN:Docklet_TinyDPS(EXTRA) - PLUGIN.DockedParent["TinyDPS"] = EXTRA - elseif MAIN.FrameName ~= "tdpsFrame" then + self:Docklet_Recount(self.Docklet.Dock1) + elseif(self:DockletReady("TinyDPS", dock1)) then tipLeft = "TinyDPS"; - SV.Dock:RegisterMainDocklet("tdpsFrame") - PLUGIN:Docklet_TinyDPS(MAIN) - PLUGIN.DockedParent["TinyDPS"] = MAIN - end - end - end - if main == "alDamageMeter" or alternate == "alDamageMeter" then - if SV.Dock:IsDockletReady("alDamageMeter") then - if alternate == "alDamageMeter" and EXTRA.FrameName ~= "alDamagerMeterFrame" then - tipRight = "and alDamageMeter"; - SV.Dock:RegisterExtraDocklet("alDamagerMeterFrame") - PLUGIN:Docklet_alDamageMeter(EXTRA) - PLUGIN.DockedParent["alDamageMeter"] = EXTRA - elseif MAIN.FrameName ~= "alDamagerMeterFrame" then + self:Docklet_TinyDPS(self.Docklet.Dock1) + elseif(self:DockletReady("alDamageMeter", dock1)) then tipLeft = "alDamageMeter"; - SV.Dock:RegisterMainDocklet("alDamagerMeterFrame") - PLUGIN:Docklet_alDamageMeter(MAIN) - PLUGIN.DockedParent["alDamageMeter"] = MAIN + self:Docklet_alDamageMeter(self.Docklet.Dock1) end - end + end + + if(enabled2) then + while(not self.Docklet.Dock2.FrameLink) do + if(self:DockletReady("Skada", dock2)) then + tipRight = "and Skada"; + self:Docklet_Skada() + elseif(self:DockletReady("Omen", dock2)) then + tipRight = "and Omen"; + self:Docklet_Omen(self.Docklet.Dock2) + elseif(self:DockletReady("Recount", dock2)) then + tipRight = "and Recount"; + self:Docklet_Recount(self.Docklet.Dock2) + elseif(self:DockletReady("TinyDPS", dock2)) then + tipRight = "and TinyDPS"; + self:Docklet_TinyDPS(self.Docklet.Dock2) + elseif(self:DockletReady("alDamageMeter", dock2)) then + tipRight = "and alDamageMeter"; + self:Docklet_alDamageMeter(self.Docklet.Dock2) + end + end + end + + self.Docklet.DockButton:SetAttribute("tipText", ("%s%s"):format(tipLeft, tipRight)); + self.Docklet.DockButton:MakeDefault(); + else + self.Docklet.Dock1:Hide() + self.Docklet.Dock2:Hide() + self.Docklet:Disable() + + self.Docklet.Parent.Bar:UnsetDefault(); end +end + +local DockableAddons = { + ["alDamageMeter"] = L["alDamageMeter"], + ["Skada"] = L["Skada"], + ["Recount"] = L["Recount"], + ["TinyDPS"] = L["TinyDPS"], + ["Omen"] = L["Omen"] +} - if(SV.Dock.AddonButton) then - SV.Dock.AddonButton:SetAttribute("tipText", ("%s%s"):format(tipLeft, tipRight)) +local function GetLiveDockletsA() + local test = PLUGIN.cache.Docks[2]; + local t = {["None"] = L["None"]}; + for n,l in pairs(DockableAddons) do + if (test ~= n) then + if(n:find("Skada") and _G.Skada) then + for index,window in pairs(_G.Skada:GetWindows()) do + local key = window.db.name + t["SkadaBarWindow"..key] = (key == "Skada") and "Skada - Main" or "Skada - "..key; + end + else + if IsAddOnLoaded(n) or IsAddOnLoaded(l) then t[n] = l end + end + end end -end + return t; +end + +local function GetLiveDockletsB() + local test = PLUGIN.cache.Docks[1]; + local t = {["None"] = L["None"]}; + for n,l in pairs(DockableAddons) do + if (test ~= n) then + if(n:find("Skada") and _G.Skada) then + for index,window in pairs(_G.Skada:GetWindows()) do + local key = window.db.name + t["SkadaBarWindow"..key] = (key == "Skada") and "Skada - Main" or "Skada - "..key; + end + else + if IsAddOnLoaded(n) or IsAddOnLoaded(l) then t[n] = l end + end + end + end + return t; +end + +local function GetDockableAddons() + local test = PLUGIN.cache.Docks[1]; + local t = {{text = "None", func = function() PLUGIN.cache.Docks[1] = "None"; PLUGIN:RegisterAddonDocklets() end}}; + for n,l in pairs(DockableAddons) do + if (not test or (test and not test:find(n))) then + if(n:find("Skada") and _G.Skada) then + for index,window in pairs(_G.Skada:GetWindows()) do + local keyName = window.db.name + local key = "SkadaBarWindow" .. keyName + local name = (keyName == "Skada") and "Skada - Main" or "Skada - " .. keyName; + tinsert(t,{text = name, func = function() PLUGIN.cache.Docks[1] = key; PLUGIN:RegisterAddonDocklets() end}); + end + else + if IsAddOnLoaded(n) or IsAddOnLoaded(l) then + tinsert(t,{text = n, func = function() PLUGIN.cache.Docks[1] = l; PLUGIN:RegisterAddonDocklets() end}); + end + end + end + end + return t; +end + +local AddonDockletToggle = function(self) + if(not InCombatLockdown()) then + self.Parent:Refresh() + + if(not self.Parent.Parent.Window:IsShown()) then + self.Parent.Parent.Window:Show() + end + end + + if(not PLUGIN.Docklet:IsShown()) then + PLUGIN.Docklet:Show() + end + + if(not PLUGIN.Docklet.Dock1:IsShown()) then + PLUGIN.Docklet.Dock1:Show() + end + + if(not PLUGIN.Docklet.Dock2:IsShown()) then + PLUGIN.Docklet.Dock2:Show() + end + + self:Activate() +end + +local ShowSubDocklet = function(self) + local frame = self.FrameLink + if(frame and frame.Show) then + if(InCombatLockdown() and (frame.IsProtected and frame:IsProtected())) then return end + if(not frame:IsShown()) then + frame:Show() + end + end +end + +local HideSubDocklet = function(self) + local frame = self.FrameLink + if(frame and frame.Hide) then + if(InCombatLockdown() and (frame.IsProtected and frame:IsProtected())) then return end + if(frame:IsShown()) then + frame:Hide() + end + end +end + +local function DockFadeInDocklet() + local active = PLUGIN.Docklet.DockButton:GetAttribute("isActive") + if(active) then + PLUGIN.Docklet.Dock1:Show() + PLUGIN.Docklet.Dock2:Show() + end +end +LibSuperVillain("Registry"):NewCallback("DOCKS_FADE_IN", "DockFadeInDocklet", DockFadeInDocklet); + +local function DockFadeOutDocklet() + local active = PLUGIN.Docklet.DockButton:GetAttribute("isActive") + if(active) then + PLUGIN.Docklet.Dock1:Hide() + PLUGIN.Docklet.Dock2:Hide() + end +end +LibSuperVillain("Registry"):NewCallback("DOCKS_FADE_OUT", "DockFadeOutDocklet", DockFadeOutDocklet); --[[ ########################################################## BUILD FUNCTION ########################################################## ]]-- +function PLUGIN:ReLoad() + self:RegisterAddonDocklets() +end + function PLUGIN:Load() + self.cache.Docks = self.cache.Docks or {"None", "None"} + local alert = CreateFrame('Frame', nil, UIParent); alert:SetFixedPanelTemplate('Transparent'); alert:SetSize(250, 70); @@ -381,11 +525,56 @@ function PLUGIN:Load() alert.Accept:SetButtonTemplate(); alert.Close:SetButtonTemplate(); alert:Hide(); + self.Alert = alert; - NewHook(SV.Dock, "ReloadAddonDocklets", RegisterAddonDocklets); - SV.Dock:ReloadAddonDocklets(); + self.Docklet = SV.Dock:NewDocklet("BottomRight", "SVUI_StyleOMaticDock", self.TitleID, [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-ADDON]], AddonDockletToggle); + SV.Dock.BottomRight.Bar.Button.GetMenuList = GetDockableAddons; + self.Docklet.DockButton.GetMenuList = GetDockableAddons; + self.Docklet.DockButton:SetAttribute("hasDropDown", true); + + local dockWidth = self.Docklet:GetWidth() + + self.Docklet.Dock1 = CreateFrame("Frame", "SVUI_StyleOMaticDockAddon1", self.Docklet); + self.Docklet.Dock1:SetPoint('TOPLEFT', self.Docklet, 'TOPLEFT', 0, 0); + self.Docklet.Dock1:SetPoint('BOTTOMLEFT', self.Docklet, 'BOTTOMLEFT', 0, 0); + self.Docklet.Dock1:SetWidth(dockWidth); + self.Docklet.Dock1:SetScript('OnShow', ShowSubDocklet); + self.Docklet.Dock1:SetScript('OnHide', HideSubDocklet); + + self.Docklet.Dock2 = CreateFrame("Frame", "SVUI_StyleOMaticDockAddon2", self.Docklet); + self.Docklet.Dock2:SetPoint('TOPLEFT', self.Docklet.Dock1, 'TOPRIGHT', 0, 0); + self.Docklet.Dock2:SetPoint('BOTTOMLEFT', self.Docklet.Dock1, 'BOTTOMRIGHT', 0, 0); + self.Docklet.Dock2:SetWidth(dockWidth * 0.5); + self.Docklet.Dock2:SetScript('OnShow', ShowSubDocklet); + self.Docklet.Dock2:SetScript('OnHide', HideSubDocklet); + + self.Docklet:Hide() + + self:RegisterAddonDocklets() self:RegisterEvent("PLAYER_ENTERING_WORLD"); self:RegisterEvent("ADDON_LOADED"); + + SV.Dock.CustomOptions = { + DockletMain = { + type = "select", + order = 1, + name = "Primary Docklet", + desc = "Select an addon to occupy the primary docklet window", + values = function() return GetLiveDockletsA() end, + get = function() return PLUGIN.cache.Docks[1] end, + set = function(a,value) PLUGIN.cache.Docks[1] = value; PLUGIN:RegisterAddonDocklets() end, + }, + DockletSplit = { + type = "select", + order = 2, + name = "Secondary Docklet", + desc = "Select another addon", + disabled = function() return (PLUGIN.cache.Docks[1] == "None") end, + values = function() return GetLiveDockletsB() end, + get = function() return PLUGIN.cache.Docks[2] end, + set = function(a,value) PLUGIN.cache.Docks[2] = value; PLUGIN:RegisterAddonDocklets() end, + } + } end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc index 698ea94..69bb70d 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc @@ -1,14 +1,14 @@ ## Interface: 60000 ## Author: Munglunch, Azilroka, Sortokk -## Version: 5.1 +## Version: 5.2 ## Title: |cffFF9900SVUI |r|cffFFEF00Style-O-Matic|r ## Notes: Supervillain UI [|cff9911FFAddon Skins|r]. ## SavedVariables: StyleOMatic_Global -## SavedVariablesPerCharacter: StyleOMatic_Profile +## SavedVariablesPerCharacter: StyleOMatic_Profile, StyleOMatic_Cache ## RequiredDeps: SVUI ## OptionalDeps: Blizzard_DebugTools, Blizzard_PetJournal, SharedMedia ## X-Email: munglunch@gmail.com -## X-SVUI-Header: Style-O-Matic -## X-SVUI-Schema: StyleOMatic +## X-SVUIName: Style-O-Matic +## X-SVUISchema: StyleOMatic SVUI_StyleOMatic.xml diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/DBM.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/DBM.lua index 054a27e..9b8420c 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/DBM.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/DBM.lua @@ -100,8 +100,8 @@ local function StyleBars(self) frame:SetHeight(22) name:Point('LEFT', frame, 'LEFT', 4, 0) timer:Point('RIGHT', frame, 'RIGHT', -4, 0) - name:SetFontTemplate(SV.Media.font.default, 12, 'OUTLINE') - timer:SetFontTemplate(SV.Media.font.default, 12, 'OUTLINE') + name:FontManager(SV.Media.font.default, 12, 'OUTLINE') + timer:FontManager(SV.Media.font.default, 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) if bar.owner.options.IconLeft then icon1:Show() icon1.overlay:Show() else icon1:Hide() icon1.overlay:Hide() end @@ -123,7 +123,7 @@ local StyleBossTitle = function() if not anchor.styled then local header = {anchor:GetRegions()} if header[1]:IsObjectType('FontString') then - header[1]:SetFontTemplate(SV.Media.font.default, 12, 'OUTLINE') + header[1]:FontManager(SV.Media.font.default, 12, 'OUTLINE') header[1]:SetTextColor(1, 1, 1) header[1]:SetShadowColor(0, 0, 0, 0) anchor.styled = true @@ -171,8 +171,8 @@ local StyleBoss = function() bar:SetHeight(22) name:Point('LEFT', bar, 'LEFT', 4, 0) timer:Point('RIGHT', bar, 'RIGHT', -4, 0) - name:SetFontTemplate(SV.Media.font.default, 12, 'OUTLINE') - timer:SetFontTemplate(SV.Media.font.default, 12, 'OUTLINE') + name:FontManager(SV.Media.font.default, 12, 'OUTLINE') + timer:FontManager(SV.Media.font.default, 12, 'OUTLINE') count = count + 1 end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Omen.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Omen.lua index a79bd40..d423e18 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Omen.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Omen.lua @@ -48,7 +48,7 @@ local function StyleOmen() Omen.db.profile.TitleBar.UseSameBG = true hooksecurefunc(Omen, 'UpdateBackdrop', function(self) - if not SVUI.CurrentlyDocked["OmenAnchor"] then + if(not PLUGIN:ValidateDocklet("Omen")) then PLUGIN:ApplyFrameStyle(self.BarList, 'Transparent') self.Title:RemoveTextures() self.Title:SetPanelTemplate("Default") @@ -65,7 +65,7 @@ PLUGIN:SaveAddonStyle("Omen", StyleOmen, nil, true) function PLUGIN:Docklet_Omen(parent) if not Omen then return end - local db=Omen.db; + local db = Omen.db; db.profile.Scale=1; db.profile.Bar.Spacing=1; db.profile.Background.EdgeSize=2; @@ -85,4 +85,6 @@ function PLUGIN:Docklet_Omen(parent) OmenBarList:SetFixedPanelTemplate('Transparent') OmenAnchor:ClearAllPoints() OmenAnchor:SetAllPoints(parent) + + parent.Framelink = OmenAnchor end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Recount.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Recount.lua index 45665e5..6d0763f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Recount.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Recount.lua @@ -106,7 +106,7 @@ local function StyleRecount() PLUGIN:ApplyScrollFrameStyle(Recount_MainWindow_ScrollBarScrollBar) - Recount_MainWindow:HookScript('OnShow', function(self) if InCombatLockdown() then return end if SV.CurrentlyDocked["Recount_MainWindow"] then SV.Dock.Right.Window:Show() end end) + Recount_MainWindow:HookScript('OnShow', function(self) if InCombatLockdown() then return end if PLUGIN:ValidateDocklet("Recount") then PLUGIN.Docklet:Show() end end) Recount.MainWindow.FileButton:HookScript('OnClick', function(self) if LibDropdownFrame0 then PLUGIN:ApplyFrameStyle(LibDropdownFrame0) end end) hooksecurefunc(Recount, 'ShowScrollbarElements', function(self, name) Recount_MainWindow_ScrollBarScrollBar:Show() end) @@ -141,4 +141,6 @@ function PLUGIN:Docklet_Recount(parent) Recount:LockWindows(true) Recount:ResizeMainWindow() Recount_MainWindow_ScrollBar:Hide() + + parent.Framelink = Recount.MainWindow end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Skada.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Skada.lua index 4fe1008..9cda01b 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Skada.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Skada.lua @@ -33,32 +33,14 @@ GET ADDON DATA local PLUGIN = select(2, ...); local Schema = PLUGIN.Schema; local activePanels = {}; -local SkadaHolder, SkadaHolder2 local StupidSkada = function() return end --[[ ########################################################## SKADA ########################################################## ]]-- -local function CheckForHolders() - if(not SkadaHolder) then - SkadaHolder = CreateFrame("Frame", "SkadaHolder", SVUI_DockedAddon1) - end - if(not SkadaHolder2) then - SkadaHolder2 = CreateFrame("Frame", "SkadaHolder2", SVUI_DockedAddon2) - end - SkadaHolder:SetSize(SVUI_DockedAddon1:GetSize()) - SkadaHolder2:SetSize(SVUI_DockedAddon2:GetSize()) -end - -local function skada_panel_loader(holder, window) - if(not window) then return end - - local bars = Skada.displays['bar'] - - if(not bars) then return end - bars.ApplySettings = StupidSkada - local width,height = holder:GetSize() +local function skada_panel_loader(dock, window) + local width,height = dock:GetSize() window.db.barspacing = 1; window.db.barwidth = width - 4; @@ -66,30 +48,35 @@ local function skada_panel_loader(holder, window) window.db.spark = false; window.db.barslocked = true; window.bargroup:ClearAllPoints() - window.bargroup:SetParent(holder) - window.bargroup:SetAllPoints(holder) + window.bargroup:SetAllPoints(dock) window.bargroup:SetFrameStrata('LOW') - --bars:ApplySettings(window) local bgroup = window.bargroup.backdrop; if bgroup then bgroup:Show() bgroup:SetFixedPanelTemplate('Transparent', true) - end + end + + dock.FrameLink = window; end function PLUGIN:Docklet_Skada() - if not Skada then return end - CheckForHolders() + if not Skada then return end + + local dock1,dock2,enabled1,enabled2 = PLUGIN:FetchDocklets(); + for index,window in pairs(Skada:GetWindows()) do - local wname = window.db.name or "Skada" - local key = "SkadaBarWindow" .. wname - if(SVUI.db.Dock.docklets.DockletMain == key)then - skada_panel_loader(SkadaHolder, window) - elseif(SVUI.db.Dock.docklets.enableExtra and SVUI.db.Dock.docklets.DockletExtra == key) then - skada_panel_loader(SkadaHolder2, window) - else - window.db.barslocked = false; + if(window) then + local wname = window.db.name or "Skada" + local key = "SkadaBarWindow" .. wname + + if(enabled1 and dock1:find(key)) then + skada_panel_loader(PLUGIN.Docklet.Dock1, window); + elseif(enabled2 and dock2:find(key)) then + skada_panel_loader(PLUGIN.Docklet.Dock2, window); + else + window.db.barslocked = false; + end end end end @@ -100,10 +87,6 @@ end local function StyleSkada() assert(Skada, "AddOn Not Loaded") - - Skada.displays['bar'].ApplySettings = StupidSkada - - CheckForHolders() Skada.ShowPopup = Skada_ShowPopup local SkadaDisplayBar = Skada.displays['bar'] @@ -140,13 +123,13 @@ local function StyleSkada() end) hooksecurefunc(Skada, 'CreateWindow', function() - if SVUI.CurrentlyDocked["SkadaHolder"] or SVUI.CurrentlyDocked["SkadaHolder2"] then + if PLUGIN:ValidateDocklet("Skada") then PLUGIN:Docklet_Skada() end end) hooksecurefunc(Skada, 'DeleteWindow', function() - if SVUI.CurrentlyDocked["SkadaHolder"] or SVUI.CurrentlyDocked["SkadaHolder2"] then + if PLUGIN:ValidateDocklet("Skada") then PLUGIN:Docklet_Skada() end end) diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/TinyDPS.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/TinyDPS.lua index 62c4fc8..cadf0f2 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/TinyDPS.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/TinyDPS.lua @@ -45,8 +45,8 @@ local function StyleTinyDPS() tdpsFrame:HookScript("OnShow", function() if InCombatLockdown() then return end - if SV.CurrentlyDocked["tdpsFrame"] then - SV.Dock.Right.Window:Show() + if PLUGIN:ValidateDocklet("TinyDPS") then + PLUGIN.Docklet:Show() end end) @@ -62,8 +62,6 @@ PLUGIN:SaveAddonStyle("TinyDPS", StyleTinyDPS) function PLUGIN:Docklet_TinyDPS(parent) if not tdpsFrame then return end - tdpsFrame:SetFixedPanelTemplate("Transparent", true) - tdpsFrame:SetFrameStrata("LOW") tdps.hideOOC = false; tdps.hideIC = false; tdps.hideSolo = false; @@ -71,4 +69,6 @@ function PLUGIN:Docklet_TinyDPS(parent) tdpsFrame:ClearAllPoints() tdpsFrame:SetAllPoints(parent) tdpsRefresh() + + parent.Framelink = tdpsFrame end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/alDamageMeter.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/alDamageMeter.lua index dccd32a..0a5fb08 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/alDamageMeter.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/alDamageMeter.lua @@ -45,8 +45,8 @@ local function StyleALDamageMeter() PLUGIN:ApplyFrameStyle(alDamageMeterFrame) alDamageMeterFrame:HookScript('OnShow', function() if InCombatLockdown() then return end - if SV.CurrentlyDocked["alDamagerMeterFrame"] then - SV.Dock.Right.Window:Show() + if PLUGIN:ValidateDocklet("alDamageMeter") then + PLUGIN.Docklet:Show() end end) end @@ -62,4 +62,6 @@ function PLUGIN:Docklet_alDamageMeter(parent) alDamageMeterFrame.backdrop:SetFixedPanelTemplate('Transparent',true) alDamageMeterFrame.bg:Die() alDamageMeterFrame:SetFrameStrata('LOW') + + parent.Framelink = alDamageMeterFrame end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/alert.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/alert.lua index bd8271f..f3a953f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/alert.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/alert.lua @@ -27,11 +27,7 @@ local Schema = PLUGIN.Schema; HELPERS ########################################################## ]]-- -local AlphaHelper = function(self, value, flag) - if(not flag and value ~= 1) then - self:SetAlpha(1, true) - end -end +local AlphaBlock = function() return end --[[ ########################################################## ALERTFRAME PLUGINR @@ -62,7 +58,7 @@ local function AlertStyle() local frame = _G["AchievementAlertFrame"..i] if frame then frame:SetAlpha(1) - hooksecurefunc(frame, "SetAlpha", AlphaHelper) + frame.SetAlpha = AlphaBlock if not frame.Panel then frame:SetBasicPanel() frame.Panel:Point("TOPLEFT", _G[frame:GetName().."Background"], "TOPLEFT", -2, -6) @@ -74,9 +70,9 @@ local function AlertStyle() _G["AchievementAlertFrame"..i.."Shine"]:Die() _G["AchievementAlertFrame"..i.."GuildBanner"]:Die() _G["AchievementAlertFrame"..i.."GuildBorder"]:Die() - _G["AchievementAlertFrame"..i.."Unlocked"]:SetFontTemplate(nil, 12) + _G["AchievementAlertFrame"..i.."Unlocked"]:FontManager(nil, 12) _G["AchievementAlertFrame"..i.."Unlocked"]:SetTextColor(1, 1, 1) - _G["AchievementAlertFrame"..i.."Name"]:SetFontTemplate(nil, 12) + _G["AchievementAlertFrame"..i.."Name"]:FontManager(nil, 12) _G["AchievementAlertFrame"..i.."IconTexture"]:SetTexCoord(0.1, 0.9, 0.1, 0.9) _G["AchievementAlertFrame"..i.."IconOverlay"]:Die() _G["AchievementAlertFrame"..i.."IconTexture"]:ClearAllPoints() @@ -98,7 +94,7 @@ local function AlertStyle() frame:SetAlpha(1) if(not frame.AlphaHooked) then - hooksecurefunc(frame, "SetAlpha", AlphaHelper) + frame.SetAlpha = AlphaBlock frame.AlphaHooked = true end @@ -138,7 +134,7 @@ local function AlertStyle() frame:SetAlpha(1) if(not frame.AlphaHooked) then - hooksecurefunc(frame, "SetAlpha", AlphaHelper) + frame.SetAlpha = AlphaBlock frame.AlphaHooked = true end @@ -171,7 +167,7 @@ local function AlertStyle() local frame = ChallengeModeAlertFrame1; if frame then frame:SetAlpha(1) - hooksecurefunc(frame, "SetAlpha", AlphaHelper) + frame.SetAlpha = AlphaBlock if not frame.Panel then frame:SetBasicPanel() frame.Panel:Point("TOPLEFT", frame, "TOPLEFT", 19, -6) @@ -203,7 +199,7 @@ local function AlertStyle() local frame = ScenarioAlertFrame1; if frame then frame:SetAlpha(1) - hooksecurefunc(frame, "SetAlpha", AlphaHelper) + frame.SetAlpha = AlphaBlock if not frame.Panel then frame:SetBasicPanel() frame.Panel:Point("TOPLEFT", frame, "TOPLEFT", 4, 4) @@ -235,7 +231,7 @@ local function AlertStyle() local frame = _G["CriteriaAlertFrame"..i] if frame then frame:SetAlpha(1) - hooksecurefunc(frame, "SetAlpha", AlphaHelper) + frame.SetAlpha = AlphaBlock if not frame.Panel then frame:SetBasicPanel() frame.Panel:Point("TOPLEFT", frame, "TOPLEFT", -2, -6) @@ -265,7 +261,7 @@ local function AlertStyle() local frame = LOOT_WON_ALERT_FRAMES[i] if frame then frame:SetAlpha(1) - hooksecurefunc(frame, "SetAlpha", AlphaHelper) + frame.SetAlpha = AlphaBlock frame.Background:Die() frame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) frame.IconBorder:Die() @@ -291,7 +287,7 @@ local function AlertStyle() local frame = MONEY_WON_ALERT_FRAMES[i] if frame then frame:SetAlpha(1) - hooksecurefunc(frame, "SetAlpha", AlphaHelper) + frame.SetAlpha = AlphaBlock frame.Background:Die() frame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) frame.IconBorder:Die() @@ -312,7 +308,7 @@ local function AlertStyle() local frame = BonusRollMoneyWonFrame; frame:SetAlpha(1) - hooksecurefunc(frame, "SetAlpha", AlphaHelper) + frame.SetAlpha = AlphaBlock frame.Background:Die() frame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) frame.IconBorder:Die() @@ -326,7 +322,7 @@ local function AlertStyle() local frame = BonusRollLootWonFrame; frame:SetAlpha(1) - hooksecurefunc(frame, "SetAlpha", AlphaHelper) + frame.SetAlpha = AlphaBlock frame.Background:Die() frame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) frame.IconBorder:Die() diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/auctionhouse.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/auctionhouse.lua index 998174e..bd14aae 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/auctionhouse.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/auctionhouse.lua @@ -222,15 +222,14 @@ local function AuctionStyle() local buttonItem = _G["BrowseButton"..h.."Item"]; local buttonTex = _G["BrowseButton"..h.."ItemIconTexture"]; - if(button) then - if(buttonTex) then - buttonTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) - end - + if(button) then button:RemoveTextures() - button:SetButtonTemplate() + button:SetButtonTemplate(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 + if(buttonItem) then buttonItem:RemoveTextures() buttonItem:SetSlotTemplate(true, 2, 0, 0) buttonTex:SetParent(buttonItem.Panel) @@ -239,11 +238,15 @@ local function AuctionStyle() buttonItem:GetNormalTexture():Die() end) + if(buttonTex) then + buttonTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) + end + local highLight = button:GetHighlightTexture() _G["BrowseButton"..h.."Highlight"] = highLight highLight:ClearAllPoints() - highLight:Point("TOPLEFT", buttonItem, "TOPRIGHT", 2, 0) - highLight:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 5) + highLight:Point("TOPLEFT", buttonItem, "TOPRIGHT", 2, -2) + highLight:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 7) button:GetPushedTexture():SetAllPoints(highLight) end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/character.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/character.lua index da1a519..c3f8aa5 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/character.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/character.lua @@ -354,14 +354,6 @@ local function CharacterFrameStyle() hooksecurefunc("PaperDollFrame_UpdateSidebarTabs", PaperDoll_UpdateTabs) - for i = 1, 7 do - local category = _G["CharacterStatsPaneCategory"..i] - if(category) then - category:RemoveTextures() - category:SetButtonTemplate() - end - end - ReputationFrame:RemoveTextures(true) ReputationListScrollFrame:RemoveTextures() ReputationDetailFrame:RemoveTextures() diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/friends.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/friends.lua index fe93f6c..741a0a4 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/friends.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/friends.lua @@ -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"]:SetFontTemplate(nil, 12) + _G["ChannelButton"..i.."Text"]:FontManager(nil, 12) end end end @@ -191,7 +191,7 @@ local function FriendsFrameStyle() FriendsFrameBattlenetFrame.BroadcastButton:SetScript('OnClick', function() SV:StaticPopup_Show("SET_BN_BROADCAST") end) - FriendsFrameBattlenetFrame.Tag:SetFontTemplate(SV.Media.font.narrator,16,"NONE") + FriendsFrameBattlenetFrame.Tag:FontManager(SV.Media.font.narrator,16,"NONE") AddFriendNameEditBox:SetEditboxTemplate() AddFriendFrame:SetFixedPanelTemplate("Transparent", true) ScrollOfResurrectionSelectionFrame:SetFixedPanelTemplate('Transparent') diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lfd.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lfd.lua index ec55578..cdae77a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lfd.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lfd.lua @@ -149,7 +149,7 @@ local function LFDFrameStyle() GroupFinderFrameGroupButton1.icon:SetTexture("Interface\\Icons\\INV_Helmet_08") GroupFinderFrameGroupButton2.icon:SetTexture("Interface\\Icons\\inv_helmet_06") GroupFinderFrameGroupButton3.icon:SetTexture("Interface\\Icons\\Icon_Scenarios") - GroupFinderFrameGroupButton4.icon:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\SVUI-EMBLEM") + GroupFinderFrameGroupButton4.icon:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\SVUI-ICON") LFGDungeonReadyDialogBackground:Die() LFGDungeonReadyDialogEnterDungeonButton:SetButtonTemplate() diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petbattle.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petbattle.lua index 664c988..5c04b38 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petbattle.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petbattle.lua @@ -329,9 +329,9 @@ local function PetBattleStyle() PetBattleActionBar:SetFrameStrata('BACKGROUND') PetBattleActionBar:SetFixedPanelTemplate("Blackout") - local SVUI_BottomStatsDock = _G.SVUI_BottomStatsDock; - if(SVUI_BottomStatsDock) then - PetBattleActionBar:SetPoint("BOTTOM", SVUI_BottomStatsDock, "TOP", 0, 4) + local SVUI_DockBottomCenter = _G.SVUI_DockBottomCenter; + if(SVUI_DockBottomCenter) then + PetBattleActionBar:SetPoint("BOTTOM", SVUI_DockBottomCenter, "TOP", 0, 4) else PetBattleActionBar:SetPoint("BOTTOM", SV.Screen, "BOTTOM", 0, 4) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldmap.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldmap.lua index 4843d45..e33db54 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldmap.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldmap.lua @@ -30,11 +30,13 @@ HELPERS local function AdjustMapLevel() if InCombatLockdown()then return end local WorldMapFrame = _G.WorldMapFrame; - WorldMapFrame:SetFrameLevel(4) - WorldMapDetailFrame:SetFrameLevel(6) - WorldMapFrame:SetFrameStrata('HIGH') - WorldMapArchaeologyDigSites:SetFrameLevel(8) - WorldMapArchaeologyDigSites:SetFrameStrata('DIALOG') + WorldMapFrame:SetFrameStrata("HIGH"); + WorldMapTooltip:SetFrameStrata("TOOLTIP"); + WorldMapPlayerLower:SetFrameStrata("MEDIUM"); + WorldMapPlayerLower:SetFrameStrata("FULLSCREEN"); + WorldMapFrame:SetFrameLevel(1) + WorldMapDetailFrame:SetFrameLevel(2) + WorldMapArchaeologyDigSites:SetFrameLevel(3) end local function WorldMap_SmallView() @@ -42,6 +44,9 @@ local function WorldMap_SmallView() WorldMapFrame.Panel:ClearAllPoints() WorldMapFrame.Panel:WrapOuter(WorldMapFrame, 4, 4) WorldMapFrame.Panel.Panel:WrapOuter(WorldMapFrame.Panel) + if(SVUI_WorldMapCoords) then + SVUI_WorldMapCoords.playerCoords:SetPoint("BOTTOMLEFT", WorldMapFrame, "BOTTOMLEFT", 5, 5) + end end local function WorldMap_FullView() @@ -51,6 +56,9 @@ local function WorldMap_FullView() WorldMapFrame.Panel:Size(w + 24, h + 98) WorldMapFrame.Panel:Point("TOP", WorldMapFrame, "TOP", 0, 0) WorldMapFrame.Panel.Panel:WrapOuter(WorldMapFrame.Panel) + if(SVUI_WorldMapCoords) then + SVUI_WorldMapCoords.playerCoords:SetPoint("BOTTOMLEFT", WorldMapFrame.Panel, "BOTTOMLEFT", 5, 5) + end end local function StripQuestMapFrame() @@ -129,13 +137,13 @@ local function WorldMap_OnShow() BlackoutWorld:SetTexture(0,0,0,0) end - WorldMapFrameAreaLabel:SetFontTemplate(nil, 50, "OUTLINE") + WorldMapFrameAreaLabel:FontManager(nil, 50, "OUTLINE") WorldMapFrameAreaLabel:SetShadowOffset(2, -2) WorldMapFrameAreaLabel:SetTextColor(0.90, 0.8294, 0.6407) - WorldMapFrameAreaDescription:SetFontTemplate(nil, 40, "OUTLINE") + WorldMapFrameAreaDescription:FontManager(nil, 40, "OUTLINE") WorldMapFrameAreaDescription:SetShadowOffset(2, -2) - WorldMapFrameAreaPetLevels:SetFontTemplate(nil, 25, 'OUTLINE') - WorldMapZoneInfo:SetFontTemplate(nil, 27, "OUTLINE") + WorldMapFrameAreaPetLevels:FontManager(nil, 25, 'OUTLINE') + WorldMapZoneInfo:FontManager(nil, 27, "OUTLINE") WorldMapZoneInfo:SetShadowOffset(2, -2) if InCombatLockdown() then return end @@ -149,7 +157,6 @@ WORLDMAP PLUGINR local function WorldMapStyle() if PLUGIN.db.blizzard.enable ~= true or PLUGIN.db.blizzard.worldmap ~= true then return end - WorldMapFrame:SetFrameLevel(4) PLUGIN:ApplyWindowStyle(WorldMapFrame, true, true) WorldMapFrame.Panel:SetPanelTemplate("Blackout") @@ -157,10 +164,7 @@ local function WorldMapStyle() PLUGIN:ApplyScrollFrameStyle(WorldMapQuestDetailScrollFrameScrollBar, 4) PLUGIN:ApplyScrollFrameStyle(WorldMapQuestRewardScrollFrameScrollBar, 4) - WorldMapDetailFrame:SetFrameLevel(6) WorldMapDetailFrame:SetPanelTemplate("Blackout") - - WorldMapArchaeologyDigSites:SetFrameLevel(8) WorldMapFrameSizeDownButton:SetFrameLevel(999) WorldMapFrameSizeUpButton:SetFrameLevel(999) @@ -187,6 +191,8 @@ local function WorldMapStyle() WorldMapFrameNavBar:SetPanelTemplate("Blackout") WorldMapFrameTutorialButton:ClearAllPoints() WorldMapFrameTutorialButton:Point("LEFT", WorldMapFrameNavBar.Panel, "RIGHT", -50, 0) + + WorldMap_OnShow() end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/style_methods.lua b/Interface/AddOns/SVUI_StyleOMatic/components/style_methods.lua index 3793a51..0bcb3f8 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/style_methods.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/style_methods.lua @@ -41,8 +41,6 @@ local PLUGIN = select(2, ...); local Schema = PLUGIN.Schema; local LSM = LibStub("LibSharedMedia-3.0") local NewHook = hooksecurefunc; - -local ScaledOffset = SV:Scale(1) --[[ ########################################################## /$$$$$$$$/$$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$$$ diff --git a/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.lua b/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.lua index b14377c..9290e8a 100644 --- a/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.lua +++ b/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.lua @@ -135,7 +135,7 @@ local Tracker_OnUpdate = function(self, elapsed) self.BG:SetVertexColor(1,0,0,0.15) else self.throttle = 0.02 - local range = floor(distance * 1000) + local range = floor(distance) self:Spin(angle) if(range > 0) then self.Arrow:SetAlpha(1) diff --git a/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.toc b/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.toc index b90a921..1e699e0 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.1 +## Version: 5.2 ## Title: |cffFF9900SVUI |r|cffFFEF00Track-O-Matic|r ## Notes: Supervillain UI [|cff9911FFRaid & Party Member Tracking|r]. ## SavedVariables: TrackOMatic_Global @@ -9,7 +9,7 @@ ## LoadOnDemand: 1 ## X-Email: munglunch@gmail.com ## X-oUF: oUF_Villain -## X-SVUI-Header: Track-O-Matic -## X-SVUI-Schema: TrackOMatic +## X-SVUIName: Track-O-Matic +## X-SVUISchema: TrackOMatic SVUI_TrackOMatic.xml diff --git a/Interface/BUTTONS/UI-MicroButton-Socials-Disabled.blp b/Interface/BUTTONS/UI-MicroButton-Socials-Disabled.blp new file mode 100644 index 0000000..a8d2284 Binary files /dev/null and b/Interface/BUTTONS/UI-MicroButton-Socials-Disabled.blp differ diff --git a/Interface/BUTTONS/UI-MicroButton-Socials-Down.blp b/Interface/BUTTONS/UI-MicroButton-Socials-Down.blp new file mode 100644 index 0000000..e0d7071 Binary files /dev/null and b/Interface/BUTTONS/UI-MicroButton-Socials-Down.blp differ diff --git a/Interface/BUTTONS/UI-MicroButton-Socials-Up.blp b/Interface/BUTTONS/UI-MicroButton-Socials-Up.blp new file mode 100644 index 0000000..e0d7071 Binary files /dev/null and b/Interface/BUTTONS/UI-MicroButton-Socials-Up.blp differ diff --git a/Interface/BUTTONS/UI-MicroButtonCharacter-Down.blp b/Interface/BUTTONS/UI-MicroButtonCharacter-Down.blp new file mode 100644 index 0000000..1745528 Binary files /dev/null and b/Interface/BUTTONS/UI-MicroButtonCharacter-Down.blp differ diff --git a/Interface/BUTTONS/UI-MicroButtonCharacter-Up.blp b/Interface/BUTTONS/UI-MicroButtonCharacter-Up.blp new file mode 100644 index 0000000..1745528 Binary files /dev/null and b/Interface/BUTTONS/UI-MicroButtonCharacter-Up.blp differ diff --git a/Interface/Characterframe/Char-Paperdoll-Horizontal.blp b/Interface/Characterframe/Char-Paperdoll-Horizontal.blp new file mode 100644 index 0000000..5f443b0 Binary files /dev/null and b/Interface/Characterframe/Char-Paperdoll-Horizontal.blp differ diff --git a/Interface/Characterframe/Char-Paperdoll-Parts.blp b/Interface/Characterframe/Char-Paperdoll-Parts.blp new file mode 100644 index 0000000..dbe8280 Binary files /dev/null and b/Interface/Characterframe/Char-Paperdoll-Parts.blp differ diff --git a/Interface/Characterframe/Char-Paperdoll-Vertical.blp b/Interface/Characterframe/Char-Paperdoll-Vertical.blp new file mode 100644 index 0000000..c7673fc Binary files /dev/null and b/Interface/Characterframe/Char-Paperdoll-Vertical.blp differ diff --git a/Interface/Characterframe/Char-Stat-Middle.blp b/Interface/Characterframe/Char-Stat-Middle.blp new file mode 100644 index 0000000..48fdbe6 Binary files /dev/null and b/Interface/Characterframe/Char-Stat-Middle.blp differ diff --git a/Interface/Characterframe/Thumbs.db b/Interface/Characterframe/Thumbs.db new file mode 100644 index 0000000..e66b1c5 Binary files /dev/null and b/Interface/Characterframe/Thumbs.db differ diff --git a/Interface/Characterframe/TotemBorder.blp b/Interface/Characterframe/TotemBorder.blp new file mode 100644 index 0000000..4750856 Binary files /dev/null and b/Interface/Characterframe/TotemBorder.blp differ diff --git a/Interface/Characterframe/UI-CHARACTERFRAME-GROUPINDICATOR.blp b/Interface/Characterframe/UI-CHARACTERFRAME-GROUPINDICATOR.blp new file mode 100644 index 0000000..0968079 Binary files /dev/null and b/Interface/Characterframe/UI-CHARACTERFRAME-GROUPINDICATOR.blp differ diff --git a/Interface/Characterframe/UI-Player-Status.blp b/Interface/Characterframe/UI-Player-Status.blp new file mode 100644 index 0000000..112c580 Binary files /dev/null and b/Interface/Characterframe/UI-Player-Status.blp differ diff --git a/Interface/Characterframe/UI-StateIcon.blp b/Interface/Characterframe/UI-StateIcon.blp new file mode 100644 index 0000000..1d18cc9 Binary files /dev/null and b/Interface/Characterframe/UI-StateIcon.blp differ diff --git a/Interface/Tooltips/ChatBubble-Backdrop.blp b/Interface/Tooltips/ChatBubble-Backdrop.blp new file mode 100644 index 0000000..a000ecc Binary files /dev/null and b/Interface/Tooltips/ChatBubble-Backdrop.blp differ diff --git a/Interface/Tooltips/ChatBubble-Background.blp b/Interface/Tooltips/ChatBubble-Background.blp new file mode 100644 index 0000000..9b7cc4b Binary files /dev/null and b/Interface/Tooltips/ChatBubble-Background.blp differ diff --git a/Interface/Tooltips/ChatBubble-Tail.blp b/Interface/Tooltips/ChatBubble-Tail.blp new file mode 100644 index 0000000..17e10a6 Binary files /dev/null and b/Interface/Tooltips/ChatBubble-Tail.blp differ