Quantcast

created split frame config window

Kevin Lyles [10-23-09 - 22:21]
created split frame config window
Filename
WeightsWatcher.lua
WeightsWatcher.xml
config.lua
diff --git a/WeightsWatcher.lua b/WeightsWatcher.lua
index 4ed94a5..b8e7ac4 100644
--- a/WeightsWatcher.lua
+++ b/WeightsWatcher.lua
@@ -27,14 +27,6 @@ function WeightsWatcher:OnInitialize()
 	end
 end

-function commandHandler(msg)
-	open_config()
-end
-
-function open_config()
-	WeightsWatcherConfig:Show()
-end
-
 currentHooks = {}

 function WeightsWatcher:HookTooltip(objectName, funcName)
diff --git a/WeightsWatcher.xml b/WeightsWatcher.xml
index 4054ff0..d703309 100644
--- a/WeightsWatcher.xml
+++ b/WeightsWatcher.xml
@@ -1,27 +1,327 @@
 <Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 		xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
-	<Script file="WeightsWatcher.lua"/>
-	<Frame name="WeightsWatcherConfig" hidden="true" parent="UIParent">
-		<Size x="400" y="400"/>
+	<Script file="config.lua"/>
+	<!--The Parent Frame Containing all configuration content-->
+	<Frame name="wwConfig" parent="UIParent" hidden="true">
+		<Size>
+			<AbsDimension x="400" y="400"/>
+		</Size>
 		<Anchors>
 			<Anchor point="CENTER"/>
 		</Anchors>
 		<Layers>
 			<Layer level="BACKGROUND">
 				<Texture setAllPoints="true">
-					<!-- Texture has blue color wit 50% alpha -->
-				<Color r="0" g="0" b="0" a="0.8" />
+					<!--Plain black background with 50% alpha-->
+					<Color r="0" g="0" b="0" a="0.5"/>
 				</Texture>
 			</Layer>
 		</Layers>
+		<!--list of objects within the configuartion window-->
 		<Frames>
-			<Button name="$parentCloseButton" inherits="UIPanelCloseButton">
+			<!--The Class Selection Frame-->
+			<Frame name="$parentLeftPanel" parentKey="leftPanel">
+				<Size>
+					<AbsDimension x="100" y="210"/>
+				</Size>
 				<Anchors>
-					<Anchor point="TOPRIGHT">
-						<Offset x="-4" y="-4"/>
-					</Anchor>
+					<Anchor point="LEFT"/>
 				</Anchors>
-			</Button>
+				<Backdrop edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
+					<EdgeSize>
+						<AbsValue val="10"/>
+					</EdgeSize>
+					<TileSize>
+						<AbsValue val="10"/>
+					</TileSize>
+					<BackgroundInsets>
+						<AbsInset left="0" right="0" top="5" bottom="5"/>
+					</BackgroundInsets>
+				</Backdrop>
+				<!--List of Class Buttons Found in the Left Config Panel-->
+				<Frames>
+					<Button name="rogueButton">
+						<Size>
+							<AbsDimension x="75" y="20"/>
+						</Size>
+						<Anchors>
+							<Anchor point="TOPLEFT">
+								<Offset>
+									<AbsDimension x="5" y="-5"/>
+								</Offset>
+							</Anchor>
+						</Anchors>
+						<Layers>
+							<Layer level="OVERLAY">
+								<FontString name="rogueText" inherits="GameFontNormalSmall" text="Rogue">
+									<Anchors>
+										<Anchor point="LEFT"/>
+									</Anchors>
+								</FontString>
+							</Layer>
+						</Layers>
+						<Scripts>
+							<OnClick>
+								configClassSelect("ROGUE")
+							</OnClick>
+						</Scripts>
+					</Button>
+					<Button name="mageButton">
+						<Size>
+							<AbsDimension x="75" y="20"/>
+						</Size>
+						<Anchors>
+							<Anchor point="TOPLEFT">
+								<Offset>
+									<AbsDimension x="5" y="-25"/>
+								</Offset>
+							</Anchor>
+						</Anchors>
+						<Layers>
+							<Layer level="OVERLAY">
+								<FontString name="mageText" inherits="GameFontNormalSmall" text="Mage">
+									<Anchors>
+										<Anchor point="LEFT"/>
+									</Anchors>
+								</FontString>
+							</Layer>
+						</Layers>
+						<Scripts>
+							<OnClick>
+								configClassSelect("MAGE")
+							</OnClick>
+						</Scripts>
+					</Button>
+					<Button name="priestButton">
+						<Size>
+							<AbsDimension x="75" y="20"/>
+						</Size>
+						<Anchors>
+							<Anchor point="TOPLEFT">
+								<Offset>
+									<AbsDimension x="5" y="-45"/>
+								</Offset>
+							</Anchor>
+						</Anchors>
+						<Layers>
+							<Layer level="OVERLAY">
+								<FontString name="priestText" inherits="GameFontNormalSmall" text="Priest">
+									<Anchors>
+										<Anchor point="LEFT"/>
+									</Anchors>
+								</FontString>
+							</Layer>
+						</Layers>
+						<Scripts>
+							<OnClick>
+								configClassSelect("PRIEST")
+							</OnClick>
+						</Scripts>
+					</Button>
+					<Button name="warlockButton">
+						<Size>
+							<AbsDimension x="75" y="20"/>
+						</Size>
+						<Anchors>
+							<Anchor point="TOPLEFT">
+								<Offset>
+									<AbsDimension x="5" y="-65"/>
+								</Offset>
+							</Anchor>
+						</Anchors>
+						<Layers>
+							<Layer level="OVERLAY">
+								<FontString name="warlockText" inherits="GameFontNormalSmall" text="Warlock">
+									<Anchors>
+										<Anchor point="LEFT"/>
+									</Anchors>
+								</FontString>
+							</Layer>
+						</Layers>
+						<Scripts>
+							<OnClick>
+								configClassSelect("WARLOCK")
+							</OnClick>
+						</Scripts>
+					</Button>
+					<Button name="paladinButton">
+						<Size>
+							<AbsDimension x="75" y="20"/>
+						</Size>
+						<Anchors>
+							<Anchor point="TOPLEFT">
+								<Offset>
+									<AbsDimension x="5" y="-85"/>
+								</Offset>
+							</Anchor>
+						</Anchors>
+						<Layers>
+							<Layer level="OVERLAY">
+								<FontString name="paladinText" inherits="GameFontNormalSmall" text="Paladin">
+									<Anchors>
+										<Anchor point="LEFT"/>
+									</Anchors>
+								</FontString>
+							</Layer>
+						</Layers>
+						<Scripts>
+							<OnClick>
+								configClassSelect("PALADIN")
+							</OnClick>
+						</Scripts>
+					</Button>
+					<Button name="druidButton">
+						<Size>
+							<AbsDimension x="75" y="20"/>
+						</Size>
+						<Anchors>
+							<Anchor point="TOPLEFT">
+								<Offset>
+									<AbsDimension x="5" y="-105"/>
+								</Offset>
+							</Anchor>
+						</Anchors>
+						<Layers>
+							<Layer level="OVERLAY">
+								<FontString name="druidText" inherits="GameFontNormalSmall" text="Druid">
+									<Anchors>
+										<Anchor point="LEFT"/>
+									</Anchors>
+								</FontString>
+							</Layer>
+						</Layers>
+						<Scripts>
+							<OnClick>
+								configClassSelect("DRUID")
+							</OnClick>
+						</Scripts>
+					</Button>
+					<Button name="shamanButton">
+						<Size>
+							<AbsDimension x="75" y="20"/>
+						</Size>
+						<Anchors>
+							<Anchor point="TOPLEFT">
+								<Offset>
+									<AbsDimension x="5" y="-125"/>
+								</Offset>
+							</Anchor>
+						</Anchors>
+						<Layers>
+							<Layer level="OVERLAY">
+								<FontString name="shamanText" inherits="GameFontNormalSmall" text="Shaman">
+									<Anchors>
+										<Anchor point="LEFT"/>
+									</Anchors>
+								</FontString>
+							</Layer>
+						</Layers>
+						<Scripts>
+							<OnClick>
+								configClassSelect("SHAMAN")
+							</OnClick>
+						</Scripts>
+					</Button>
+					<Button name="warriorButton">
+						<Size>
+							<AbsDimension x="75" y="20"/>
+						</Size>
+						<Anchors>
+							<Anchor point="TOPLEFT">
+								<Offset>
+									<AbsDimension x="5" y="-145"/>
+								</Offset>
+							</Anchor>
+						</Anchors>
+						<Layers>
+							<Layer level="OVERLAY">
+								<FontString name="warriorText" inherits="GameFontNormalSmall" text="Warrior">
+									<Anchors>
+										<Anchor point="LEFT"/>
+									</Anchors>
+								</FontString>
+							</Layer>
+						</Layers>
+						<Scripts>
+							<OnClick>
+								configClassSelect("WARRIOR")
+							</OnClick>
+						</Scripts>
+					</Button>
+					<Button name="dkButton">
+						<Size>
+							<AbsDimension x="75" y="20"/>
+						</Size>
+						<Anchors>
+							<Anchor point="TOPLEFT">
+								<Offset>
+									<AbsDimension x="5" y="-165"/>
+								</Offset>
+							</Anchor>
+						</Anchors>
+						<Layers>
+							<Layer level="OVERLAY">
+								<FontString name="dkText" inherits="GameFontNormalSmall" text="Death Knight">
+									<Anchors>
+										<Anchor point="LEFT"/>
+									</Anchors>
+								</FontString>
+							</Layer>
+						</Layers>
+						<Scripts>
+							<OnClick>
+								configClassSelect("DEATHKNIGHT")
+							</OnClick>
+						</Scripts>
+					</Button>
+					<Button name="hunterButton">
+						<Size>
+							<AbsDimension x="75" y="20"/>
+						</Size>
+						<Anchors>
+							<Anchor point="TOPLEFT">
+								<Offset>
+									<AbsDimension x="5" y="-185"/>
+								</Offset>
+							</Anchor>
+						</Anchors>
+						<Layers>
+							<Layer level="OVERLAY">
+								<FontString name="hunterText" inherits="GameFontNormalSmall" text="Hunter">
+									<Anchors>
+										<Anchor point="LEFT"/>
+									</Anchors>
+								</FontString>
+							</Layer>
+						</Layers>
+						<Scripts>
+							<OnClick>
+								configClassSelect("HUNTER")
+							</OnClick>
+						</Scripts>
+					</Button>
+				</Frames>
+			</Frame>
+			<!--Right Frame for viewing the weights for each class-->
+			<Frame>
+				<Size>
+					<AbsDimension x="300" y="400"/>
+				</Size>
+				<Anchors>
+					<Anchor point="RIGHT"/>
+				</Anchors>
+				<Backdrop edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
+					<EdgeSize>
+						<AbsValue val="10"/>
+					</EdgeSize>
+					<TileSize>
+						<AbsValue val="10"/>
+					</TileSize>
+					<BackgroundInsets>
+						<AbsInset left="0" right="0" top="5" bottom="5"/>
+					</BackgroundInsets>
+				</Backdrop>
+			</Frame>
 		</Frames>
 	</Frame>
 </Ui>
diff --git a/config.lua b/config.lua
index 25512e4..717406a 100644
--- a/config.lua
+++ b/config.lua
@@ -1,3 +1,30 @@
+if not WeightsWatcher then
+	WeightsWatcher = AceLibrary("AceAddon-2.0"):new("AceEvent-2.0", "AceHook-2.1")
+end
+
+function commandHandler(msg)
+	open_config()
+end
+
+--display or hide the frame
+function open_config()
+	if wwConfig:IsVisible() then
+		wwConfig:Hide()
+	else
+		wwConfig:Show()
+	end
+end
+
+function configClassSelect(classType)
+	for name, _ in pairs(ww_vars.weightsList[classType]) do
+		addWeightScale(name)
+	end
+end
+
+function addWeightScale(name)
+	print(name)
+end
+
 defaultVars = {
 	dataMajorVersion = 0,
 	dataMinorVersion = 1,