changeset 3:be6f5d3e0a95

- Added Summary Panel.
author tercio
date Sun, 31 Aug 2014 21:23:10 -0300
parents a6fb0ff113b1
children 453c68ff5d72
files HotCorners.lua HotCorners.xml
diffstat 2 files changed, 182 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/HotCorners.lua	Sat Aug 23 18:56:28 2014 -0300
+++ b/HotCorners.lua	Sun Aug 31 21:23:10 2014 -0300
@@ -1,7 +1,3 @@
-
--- fazer ele fechar apenas com o HotCornersBackgroundFrame.
--- assim vai dar + estabilidade sabendo exatamente quando ele esta aberto ou fechado.
-
 LibHotCorners = LibStub ("AceAddon-3.0"):NewAddon ("HotCorners", "AceConsole-3.0", "AceEvent-3.0", "AceTimer-3.0")
 _G.HotCorners = LibHotCorners
 local LibHotCorners = LibHotCorners
@@ -501,6 +497,41 @@
 			--item frame
 			LibHotCorners:RefereshItems (self)
 			
+			self.AnimOnShow:Play()
+			HotCornersInfosFrame:Show()
+			HotCornersInfosFrame:SetAlpha (0)
+			HotCornersInfosFrame.AnimOnShow:Play()
+			
+			--update repair
+			local percent, items = 0, 0
+			for i = INVSLOT_FIRST_EQUIPPED, INVSLOT_LAST_EQUIPPED do
+				local durability, maxdurability = GetInventoryItemDurability (i)
+				if (durability and maxdurability) then
+					local p = durability / maxdurability * 100
+					percent = percent + p
+					items = items + 1
+				end
+			end
+			
+			if (items == 0) then
+				HotCornersInfosFrame.repairText:SetText ("-- %")
+			end
+			
+			percent = percent / items
+			HotCornersInfosFrame.repairText:SetText (math.floor (percent) .. "%")
+			
+			--update date
+			HotCornersInfosFrame.clockText:SetText (date ("%H:%M"))
+			HotCornersInfosFrame.dayText:SetText (date ("%A\n%B %d"))
+			
+			--update money
+			local money = GetMoney()
+			HotCornersInfosFrame.goldText:SetText (math.floor (money / 100 / 100))
+			HotCornersInfosFrame.silverText:SetText (math.floor ((money / 100) % 100))
+			HotCornersInfosFrame.bronzeText:SetText (math.floor (money % 100))
+			
+			--HotCornersInfosFrame.clockText:SetText (date ("%A %B %d %H:%M:%S %Y"))
+			
 		end
 
 	function LibHotCorners:RefereshItems (self)
@@ -597,6 +628,7 @@
 			OptionsButton:Hide()
 			
 			self.item_frame:Hide()
+			HotCornersInfosFrame:Hide()
 		end
 		
 	--> quick corner on click
--- a/HotCorners.xml	Sat Aug 23 18:56:28 2014 -0300
+++ b/HotCorners.xml	Sun Aug 31 21:23:10 2014 -0300
@@ -17,6 +17,130 @@
 		
 	</Frame>
 
+	<Frame name="HotCornersInfosFrame" frameStrata="TOOLTIP" parent="UIParent" hidden="true">
+		<Size x="500" y="150"/>
+		<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" tile="true">
+			<TileSize>
+				<AbsValue val="40"/>
+			</TileSize>
+			<BackgroundInsets>
+				<AbsInset left="0" right="0" top="0" bottom="0"/>
+			</BackgroundInsets>
+		</Backdrop>
+		
+		<Anchors>
+			<Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="BOTTOMLEFT" x="150" y="200"/>
+		</Anchors>
+		
+		<Layers>
+
+			<Layer level="OVERLAY" textureSubLevel="1">
+				<!-- repair -->
+
+				<FontString text="100%" name="$parentRepairText" inherits="FriendsFont_Large" parentKey="repairText">
+					<Anchors>
+						<Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="BOTTOMLEFT" x="20" y="10"/>
+
+					</Anchors>
+					<Color r="1" g="1" b="1" a="1"/>
+				</FontString>
+				<Texture name="$parentRepairIcon" parentKey="repairIcon" file="Interface\ICONS\Trade_BlackSmithing">
+					<Size>
+						<AbsDimension x="20" y="20"/>
+					</Size>
+					<Anchors>
+						<Anchor point="LEFT" relativeTo="$parentRepairText" relativePoint="RIGHT" x="4" y="0"/>
+					</Anchors>
+					<TexCoords left="0.0625" right="0.9375" top="0.0625" bottom="0.9375"/>
+				</Texture>
+
+				<!-- date "SystemFont_OutlineThick_WTF" "GameFont_Gigantic"  -->
+				
+				<FontString text="22:10" name="$parentClockText" inherits="GameFont_Gigantic" parentKey="clockText">
+					<Anchors>
+						<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT" x="20" y="-10"/>
+					</Anchors>
+					<Color r="1" g="1" b="1" a="1"/>
+				</FontString>
+				
+				<FontString text="Domingo" name="$parentDayText" inherits="FriendsFont_Large" parentKey="dayText" justifyH="LEFT">
+					<Anchors>
+						<Anchor point="LEFT" relativeTo="$parentClockText" relativePoint="RIGHT" x="10" y="0"/>
+					</Anchors>
+					<Color r="1" g="1" b="1" a="1"/>
+				</FontString>
+				
+				<!-- gold -->
+				
+				<FontString text="10000" name="$parentGoldText" inherits="FriendsFont_Large" parentKey="goldText">
+					<Anchors>
+						<Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="BOTTOMLEFT" x="90" y="10"/>
+					</Anchors>
+					<Color r="1" g="1" b="1" a="1"/>
+				</FontString>
+				<Texture name="$parentGoldIcon" parentKey="goldIcon" file="Interface\MONEYFRAME\UI-GoldIcon">
+					<Size>
+						<AbsDimension x="20" y="20"/>
+					</Size>
+					<Anchors>
+						<Anchor point="LEFT" relativeTo="$parentGoldText" relativePoint="RIGHT" x="4" y="0"/>
+					</Anchors>
+				</Texture>
+
+				<FontString text="10000" name="$parentSilverText" inherits="FriendsFont_Large" parentKey="silverText">
+					<Anchors>
+						<Anchor point="LEFT" relativeTo="$parentGoldIcon" relativePoint="RIGHT" x="5" y="0"/>
+					</Anchors>
+					<Color r="1" g="1" b="1" a="1"/>
+				</FontString>
+				<Texture name="$parentSilverIcon" parentKey="silverIcon" file="Interface\MONEYFRAME\UI-SilverIcon">
+					<Size>
+						<AbsDimension x="20" y="20"/>
+					</Size>
+					<Anchors>
+						<Anchor point="LEFT" relativeTo="$parentSilverText" relativePoint="RIGHT" x="4" y="0"/>
+					</Anchors>
+				</Texture>
+
+				<FontString text="10000" name="$parentBronzeText" inherits="FriendsFont_Large" parentKey="bronzeText">
+					<Anchors>
+						<Anchor point="LEFT" relativeTo="$parentSilverIcon" relativePoint="RIGHT" x="5" y="0"/>
+					</Anchors>
+					<Color r="1" g="1" b="1" a="1"/>
+				</FontString>				
+				<Texture name="$parentBronzeIcon" parentKey="bronzeIcon" file="Interface\MONEYFRAME\UI-CopperIcon">
+					<Size>
+						<AbsDimension x="20" y="20"/>
+					</Size>
+					<Anchors>
+						<Anchor point="LEFT" relativeTo="$parentBronzeText" relativePoint="RIGHT" x="4" y="0"/>
+					</Anchors>
+				</Texture>
+			</Layer>
+		</Layers>
+		
+		<Animations>
+			<AnimationGroup name="$parentOnShow" parentKey="AnimOnShow" looping="NONE">
+				<!-- hide -->
+				<Alpha change="-1" duration="0" order="1"/>
+				<!-- show with alpha 
+				<Translation offsetX="32" offsetY="0" duration="0.3" order="2"/>
+				-->
+				<Alpha change="1" duration="0.2" order="2"/>
+				<Scripts>
+					<OnPlay>
+						HotCornersAnimOnShowStarted (self:GetParent())
+					</OnPlay>
+					<OnFinished>
+						self:GetParent():Show()
+						self:GetParent():SetAlpha(1)
+					</OnFinished>
+				</Scripts>
+			</AnimationGroup>
+		</Animations>
+		
+	</Frame>
+
 	<Frame name="HotCornersFrameCornerTemplate" frameStrata="FULLSCREEN" virtual="true" parent="UIParent">
 		<Size x="1" y="1"/>
 		<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" tile="true">
@@ -55,6 +179,26 @@
 				</Anchors>
 			</Frame>
 		</Frames>
+		
+		<Animations>
+			<AnimationGroup name="$parentOnShow" parentKey="AnimOnShow" looping="NONE">
+				<!-- hide -->
+				<Alpha change="-1" duration="0" order="1"/>
+				<!-- show with alpha 
+				<Translation offsetX="32" offsetY="0" duration="0.3" order="2"/>
+				-->
+				<Alpha change="1" duration="0.2" order="2"/>
+				<Scripts>
+					<OnPlay>
+						HotCornersAnimOnShowStarted (self:GetParent())
+					</OnPlay>
+					<OnFinished>
+						HotCornersAnimOnShowFinished (self:GetParent())
+					</OnFinished>
+				</Scripts>
+			</AnimationGroup>
+		</Animations>
+		
 	</Frame>
 	
 	<Frame name="HotCornersQuickCornerButtonTemplate" frameStrata="FULLSCREEN" virtual="true">
@@ -112,7 +256,7 @@
 				<!-- show with alpha 
 				<Translation offsetX="32" offsetY="0" duration="0.3" order="2"/>
 				-->
-				<Alpha change="1" duration="0.3" order="2"/>
+				<Alpha change="1" duration="0.2" order="2"/>
 				<Scripts>
 					<OnPlay>
 						HotCornersAnimOnShowStarted (self:GetParent())
@@ -154,7 +298,7 @@
 				<!-- show with alpha 
 				<Translation offsetX="32" offsetY="0" duration="0.3" order="2"/>
 				-->
-				<Alpha change="1" duration="0.3" order="2"/>
+				<Alpha change="1" duration="0.2" order="2"/>
 				<Scripts>
 					<OnPlay>
 						HotCornersAnimOnShowStarted (self:GetParent())
@@ -221,48 +365,6 @@
 		</Scripts>
 	</Button>
 
-	<Frame name="ATest" frameStrata="FULLSCREEN" parent="UIParent">
-		
-		<Size x="32" y="32"/>
-		
-		<Anchors>
-			<Anchor point="CENTER" relativeTo="$parent" relativePoint="CENTER" x="0" y="0"/>
-		</Anchors>
-		
-		<Layers>
-			<Layer level="OVERLAY">
-				<Texture name="$parentTexture" parentKey="texture">
-					<Size>
-						<AbsDimension x="32" y="32"/>
-					</Size>
-					<Color r="1" g="1" b="1" a="1"/>
-					<Anchors>
-						<Anchor point="CENTER" relativeTo="$parent" relativePoint="CENTER" x="0" y="0"/>
-					</Anchors>
-				</Texture>
-			</Layer>
-		</Layers>
-		
-		<Animations>
-			<AnimationGroup name="$parentGo" parentKey="go">
-			
-				<Alpha change="-1" duration="0" order="1" startDelay="3"/>
-				
-				<Translation offsetX="32" offsetY="0" duration="5" order="2"/>
-				<Alpha startDelay="0" change="1" duration="5" order="2"/>
-				
-			</AnimationGroup>
-		</Animations>
-		
-		<Scripts>
-			<OnLoad>
-				self.go:Play()
-				self:Hide()
-			</OnLoad>
-		</Scripts>
-		
-	</Frame>
-
 	<Script file="HotCorners.lua"/>
 	
 </Ui>
\ No newline at end of file