Quantcast

Made /ag options and /ag open the UI

jinivus [07-01-16 - 00:36]
Made /ag options and /ag open the UI
Filename
Autogratzer.lua
diff --git a/Autogratzer.lua b/Autogratzer.lua
index 30c68fd..24bae8f 100644
--- a/Autogratzer.lua
+++ b/Autogratzer.lua
@@ -193,6 +193,7 @@ end

 function AG_ShowHelp()
 	print("AutoGratzer usage:");
+	print("'/ag' or '/ag options' to show options ui");
 	print("'/ag {msg}' or '/autogratzer {msg}'");
 	print("'/ag delay {delay}' or '/autogratzer {delay}', with delay in milliseconds to set delay");
 	print("'/ag guild' or '/autogratzer guild' to enable/disable guild gratzing");
@@ -256,11 +257,15 @@ end
 function AG_Command(msg)
     local Cmd, SubCmd = AG_GetCmd(msg);
     if (Cmd == "")then
-        AG_ShowHelp();
+        --If the interface options aren't already loaded this doesn't work fully(just opens to non addons tab)
+		--but apparently if you call it twice it works fine!
+		InterfaceOptionsFrame_OpenToCategory(AutoGratzer.ui.panel);
+		InterfaceOptionsFrame_OpenToCategory(AutoGratzer.ui.panel);
     elseif (Cmd == "help")then
         AG_ShowHelp();
     elseif (Cmd == "options")then
-        AG_ShowHelp();
+        InterfaceOptionsFrame_OpenToCategory(AutoGratzer.ui.panel);
+		InterfaceOptionsFrame_OpenToCategory(AutoGratzer.ui.panel);
     elseif (Cmd == "guild")then
         AG_ToggleGuild();
     elseif (Cmd == "say")then