Quantcast

added a close button, class header, and non-functional new weight and reset defaults buttons

U-punta-PC\punta [09-26-09 - 06:36]
added a close button, class header, and non-functional new weight and reset defaults buttons

for some reason, frame anchors must use the global names and not the parentKeys
Filename
WeightsWatcher.xml
config.lua
diff --git a/WeightsWatcher.xml b/WeightsWatcher.xml
index c443f72..0a7fd8b 100644
--- a/WeightsWatcher.xml
+++ b/WeightsWatcher.xml
@@ -64,6 +64,19 @@
 				<Anchors>
 					<Anchor point="RIGHT"/>
 				</Anchors>
+				<Layers>
+					<Layer level="OVERLAY">
+						<FontString name="$parentHeader" parentKey="header" inherits="GameFontNormal">
+							<Anchors>
+								<Anchor point="TOP">
+									<Offset>
+										<AbsDimension y="-5"/>
+									</Offset>
+								</Anchor>
+							</Anchors>
+						</FontString>
+					</Layer>
+				</Layers>
 				<Backdrop edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
 					<EdgeSize>
 						<AbsValue val="10"/>
@@ -76,6 +89,40 @@
 					</BackgroundInsets>
 				</Backdrop>
 			</Frame>
+			<!--Close Button for the configuration window-->
+			<Button name="$parentCloseButton" parentKey="closeButton" inherits="UIPanelCloseButton">
+				<Anchors>
+					<Anchor point="TOPRIGHT"/>
+				</Anchors>
+			</Button>
+			<!--restore default button-->
+			<Button name="$parentDefaultsButton" parentKey="defaultsButton" inherits="UIPanelButtonTemplate" text="Restore Defaults">
+				<Size>
+					<AbsDimension x="150" y="22"/>
+				</Size>
+				<Anchors>
+					<Anchor point="BOTTOMLEFT"/>
+				</Anchors>
+				<Scripts>
+					<OnClick>
+						print("Restore defaults not yet implemented")
+					</OnClick>
+				</Scripts>
+			</Button>
+			<!--Create new weight button-->
+			<Button name="$parentNewWeightButton" parentKey="newWeightButton" inherits="UIPanelButtonTemplate" text="New Weight">
+				<Size>
+					<AbsDimension x="100" y="22"/>
+				</Size>
+				<Anchors>
+					<Anchor point="BOTTOMRIGHT"/>
+				</Anchors>
+				<Scripts>
+					<OnClick>
+						print("New weight not yet implemented")
+					</OnClick>
+				</Scripts>
+			</Button>
 		</Frames>
 	</Frame>
 </Ui>
diff --git a/config.lua b/config.lua
index 338a775..d420d44 100644
--- a/config.lua
+++ b/config.lua
@@ -31,7 +31,7 @@ function configClassSelect(classType)
 		--if our previously created button table isn't big enough, add new buttons
 		if #(weightButtonTable) < counter then
 			table.insert(weightButtonTable, CreateFrame("Button", nil, wwConfig.rightPanel, "genericButton"))
-			weightButtonTable[counter]:SetPoint("TOPLEFT", 5, 15 - 20 * counter)
+			weightButtonTable[counter]:SetPoint("TOPLEFT", 5, -5 - 20 * counter)
 		end
 		weightButtonTable[counter]:SetText(weightName)
 		weightButtonTable[counter]:SetScript("OnClick",
@@ -46,6 +46,7 @@ function configClassSelect(classType)
 		weightButtonTable[counter]:Hide()
 		counter = counter + 1
 	end
+	wwConfig.rightPanel.header:SetText(classNames[classType] .. " weights")
 	wwConfig.rightPanel:Show()
 end