Quantcast

Config panel skeleton

Scott King [07-19-15 - 23:11]
Config panel skeleton
Filename
CHANGELOG.txt
PortraitHealth.lua
PortraitHealth.toc
PortraitHealthConfig.lua
PortraitHealthConfig.xml
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index a3318db..1416489 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,3 +1,6 @@
+v4.0
+	- GUI config
+
 v3.0.2
 	- simplified execute phase code

diff --git a/PortraitHealth.lua b/PortraitHealth.lua
index a5c3340..2df90c3 100755
--- a/PortraitHealth.lua
+++ b/PortraitHealth.lua
@@ -4,7 +4,7 @@ local classDisplayName, class, classID = UnitClass("player");
 local PlayerClass = classID;
 local PlayerClassName = classDisplayName;
 local PlayerClassNameIndex = class;
-local PH_v = '3.0.2'; -- version number
+local PH_v = '4.0'; -- version number
 local limit1 = 0; -- limiter for sounds
 local executeSound = "Sound\\interface\\AuctionWindowClose.ogg";
 local total = 0 -- timer start
diff --git a/PortraitHealth.toc b/PortraitHealth.toc
index c19094d..79ee7ed 100755
--- a/PortraitHealth.toc
+++ b/PortraitHealth.toc
@@ -2,7 +2,7 @@
 ## Title: Portrait Health
 ## Notes: See your target's health percentage in bold text over their portrait.
 ## Author: Cilcraft
-## Version: 3.0.2
+## Version: 4.0
 ##SavedVariablesPerCharacter: PH_sound, PH_on
 PortraitHealth.lua
 PortraitHealth.xml
diff --git a/PortraitHealthConfig.lua b/PortraitHealthConfig.lua
new file mode 100644
index 0000000..f8ea149
--- /dev/null
+++ b/PortraitHealthConfig.lua
@@ -0,0 +1,17 @@
+function PH_ConfigFrame_OnLoad(panel)
+       -- Set the name for the Category for the Panel
+       --
+       panel.name = "PH_ConfigFrame " .. GetAddOnMetadata("Portrait Health", "Version");
+
+       -- When the player clicks okay, run this function.
+       --
+       panel.okay = function (self) PH_ConfigFrame_Close(); end;
+
+       -- When the player clicks cancel, run this function.
+       --
+       panel.cancel = function (self)  PH_ConfigFrame_CancelOrLoad();  end;
+
+       -- Add the panel to the Interface Options
+       --
+       InterfaceOptions_AddCategory(panel);
+end
diff --git a/PortraitHealthConfig.xml b/PortraitHealthConfig.xml
new file mode 100644
index 0000000..db922e1
--- /dev/null
+++ b/PortraitHealthConfig.xml
@@ -0,0 +1,13 @@
+<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="PortraitHealthConfig.lua"/>
+  <Frame name="PH_ConfigFrame">
+    <Scripts>
+      <OnLoad>
+        PH_ConfigFrame_OnLoad(self);
+      </OnLoad>
+    </Scripts>
+  </Frame>
+</Ui>