changeset 46:3a3dc5e4405a

Removed a level of frames for the minimap button, and improved some widgets naming a bit.
author madcatzinc@35b17cf1-18cd-47ff-9ca3-31d6b526ef09
date Mon, 29 Apr 2013 17:44:58 +0000
parents 57d46de51ba7
children 1a29be548897
files CyborgMMO7.lua OpenButtonPage.xml
diffstat 2 files changed, 66 insertions(+), 76 deletions(-) [+]
line wrap: on
line diff
--- a/CyborgMMO7.lua	Mon Apr 29 17:44:53 2013 +0000
+++ b/CyborgMMO7.lua	Mon Apr 29 17:44:58 2013 +0000
@@ -42,8 +42,8 @@
 	local r = 80
 	local dx = r * math.cos(angle)
 	local dy = r * math.sin(angle)
-	CyborgMMO_MiniMapFrame:ClearAllPoints()
-	CyborgMMO_MiniMapFrame:SetPoint("CENTER", "Minimap", "CENTER", dx, dy)
+	CyborgMMO_MiniMapButton:ClearAllPoints()
+	CyborgMMO_MiniMapButton:SetPoint("CENTER", "Minimap", "CENTER", dx, dy)
 end
 
 
@@ -59,8 +59,8 @@
 end
 
 function CyborgMMO_MouseModeChange(mode)
-	local MiniMapTexture = getglobal("CyborgMMO_MiniMapFrameButton_Icon")
-	local MiniMapGlowTexture = getglobal("CyborgMMO_MiniMapFrameButton_IconGlow")
+	local MiniMapTexture = CyborgMMO_MiniMapButtonIcon
+	local MiniMapGlowTexture = CyborgMMO_MiniMapButtonIconGlow
 	local OpenButtonTexture = getglobal("CyborgMMO_OpenButtonPage".."OpenMainForm"):GetNormalTexture()
 	local OpenButtonGlowTexture = getglobal("CyborgMMO_OpenButtonPage".."OpenMainForm"):GetHighlightTexture()
 	if mode == 1 then
@@ -456,9 +456,9 @@
 
 function CyborgMMO_SetMiniMapButton(visible)
 	if visible then
-		CyborgMMO_MiniMapFrameButton:Show()
+		CyborgMMO_MiniMapButton:Show()
 	else
-		CyborgMMO_MiniMapFrameButton:Hide()
+		CyborgMMO_MiniMapButton:Hide()
 	end
 	CyborgMMO_OptionPageMiniMapButton:SetChecked(visible)
 	if SettingsLoaded then
--- a/OpenButtonPage.xml	Mon Apr 29 17:44:53 2013 +0000
+++ b/OpenButtonPage.xml	Mon Apr 29 17:44:58 2013 +0000
@@ -80,77 +80,67 @@
 		</Frames>
 	</Frame>
 
-	<Frame name="CyborgMMO_MiniMapFrame" parent="Minimap" enableMouse="true" hidden="false" frameStrata="LOW">
+	<Button name="CyborgMMO_MiniMapButton" parent="Minimap">
 		<Size><AbsDimension x="33" y="33"/></Size>
 		<Anchors>
-			<Anchor point="TOPLEFT" relativeTo="Minimap" relativePoint="RIGHT">
-				<Offset><AbsDimension x="2" y="0"/></Offset>
-			</Anchor>
+			<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
 		</Anchors>
-		<Frames>
-			<Button name="$parentButton">
-				<Size><AbsDimension x="33" y="33"/></Size>
-				<Anchors>
-					<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
-				</Anchors>
-				<HighlightTexture alphaMode="ADD" file="Interface\Minimap\UI-Minimap-ZoomButton-Highlight"/>
-				<Layers>
-					<Layer level="BACKGROUND">
-						<Texture name="$parent_Icon" file="Interface\AddOns\CyborgMMO7\Graphics\Cyborg.tga">
-							<Size><AbsDimension x="20" y="20"/></Size>
-							<Anchors>
-								<Anchor point="TOPLEFT"><AbsDimension x="6" y="-5"/></Anchor>
-							</Anchors>
-							<Color r="0.0" g="0.0" b="0.0" a="1"/>
-						</Texture>
-					</Layer>
-					<Layer level="ARTWORK">
-						<Texture name="$parent_IconGlow" file="Interface\AddOns\CyborgMMO7\Graphics\CyborgGlow.tga">
-							<Size><AbsDimension x="20" y="20"/></Size>
-							<Anchors>
-								<Anchor point="TOPLEFT"><AbsDimension x="6" y="-5"/></Anchor>
-							</Anchors>
-							<Color r=".38" g=".85" b="1.0" a="0.90"/>
-						</Texture>
-					</Layer>
-					<Layer level="OVERLAY">
-						<Texture file="Interface\Minimap\MiniMap-TrackingBorder">
-							<Size><AbsDimension x="52" y="52"/></Size>
-							<Anchors>
-								<Anchor point="TOPLEFT"/>
-							</Anchors>
-						</Texture>
-					</Layer>
-				</Layers>
-				<Scripts>
-					<OnLoad>
-						self:RegisterForDrag("LeftButton", "RightButton")
-					</OnLoad>
-					<OnMouseDown>
-					</OnMouseDown>
-					<OnMouseUp>
-						CyborgMMO_Toggle()
-						if not CyborgMMO_IsOpen() then
-							CyborgMMO_RatQuickPage:Show()
-						end
-					</OnMouseUp>
-					<OnEnter>
-						if not CyborgMMO_IsOpen() then
-							CyborgMMO_RatQuickPage:Show()
-						end
-						CyborgMMO_ShowProfileTooltip(getglobal(self:GetName().."_Icon"))
-					</OnEnter>
-					<OnLeave>
-						CyborgMMO_RatQuickPage:Hide()
-						CyborgMMO_HideProfileTooltip()
-					</OnLeave>
-					<OnUpdate>
-						if self:IsDragging() then
-							CyborgMMO_MiniMapButtonOnUpdate()
-						end
-					</OnUpdate>
-				</Scripts>
-			</Button>
-		</Frames>
-	</Frame>
+		<HighlightTexture alphaMode="ADD" file="Interface\Minimap\UI-Minimap-ZoomButton-Highlight"/>
+		<Layers>
+			<Layer level="BACKGROUND">
+				<Texture name="$parentIcon" file="Interface\AddOns\CyborgMMO7\Graphics\Cyborg.tga">
+					<Size><AbsDimension x="20" y="20"/></Size>
+					<Anchors>
+						<Anchor point="TOPLEFT"><AbsDimension x="6" y="-5"/></Anchor>
+					</Anchors>
+					<Color r="0.0" g="0.0" b="0.0" a="1"/>
+				</Texture>
+			</Layer>
+			<Layer level="ARTWORK">
+				<Texture name="$parentIconGlow" file="Interface\AddOns\CyborgMMO7\Graphics\CyborgGlow.tga">
+					<Size><AbsDimension x="20" y="20"/></Size>
+					<Anchors>
+						<Anchor point="TOPLEFT"><AbsDimension x="6" y="-5"/></Anchor>
+					</Anchors>
+					<Color r=".38" g=".85" b="1.0" a="0.90"/>
+				</Texture>
+			</Layer>
+			<Layer level="OVERLAY">
+				<Texture file="Interface\Minimap\MiniMap-TrackingBorder">
+					<Size><AbsDimension x="52" y="52"/></Size>
+					<Anchors>
+						<Anchor point="TOPLEFT"/>
+					</Anchors>
+				</Texture>
+			</Layer>
+		</Layers>
+		<Scripts>
+			<OnLoad>
+				self:RegisterForDrag("LeftButton", "RightButton")
+			</OnLoad>
+			<OnMouseDown>
+			</OnMouseDown>
+			<OnMouseUp>
+				CyborgMMO_Toggle()
+				if not CyborgMMO_IsOpen() then
+					CyborgMMO_RatQuickPage:Show()
+				end
+			</OnMouseUp>
+			<OnEnter>
+				if not CyborgMMO_IsOpen() then
+					CyborgMMO_RatQuickPage:Show()
+				end
+				CyborgMMO_ShowProfileTooltip(getglobal(self:GetName().."Icon"))
+			</OnEnter>
+			<OnLeave>
+				CyborgMMO_RatQuickPage:Hide()
+				CyborgMMO_HideProfileTooltip()
+			</OnLeave>
+			<OnUpdate>
+				if self:IsDragging() then
+					CyborgMMO_MiniMapButtonOnUpdate()
+				end
+			</OnUpdate>
+		</Scripts>
+	</Button>
 </Ui>