diff --git a/DutyManager/Libs/AceAddon-3.0/AceAddon-3.0.lua b/AuraSpy/Libs/AceAddon-3.0/AceAddon-3.0.lua similarity index 100% rename from DutyManager/Libs/AceAddon-3.0/AceAddon-3.0.lua rename to AuraSpy/Libs/AceAddon-3.0/AceAddon-3.0.lua diff --git a/DutyManager/Libs/AceAddon-3.0/AceAddon-3.0.xml b/AuraSpy/Libs/AceAddon-3.0/AceAddon-3.0.xml similarity index 100% rename from DutyManager/Libs/AceAddon-3.0/AceAddon-3.0.xml rename to AuraSpy/Libs/AceAddon-3.0/AceAddon-3.0.xml diff --git a/DutyManager/Libs/AceComm-3.0/AceComm-3.0.lua b/AuraSpy/Libs/AceComm-3.0/AceComm-3.0.lua similarity index 100% rename from DutyManager/Libs/AceComm-3.0/AceComm-3.0.lua rename to AuraSpy/Libs/AceComm-3.0/AceComm-3.0.lua diff --git a/DutyManager/Libs/AceComm-3.0/AceComm-3.0.xml b/AuraSpy/Libs/AceComm-3.0/AceComm-3.0.xml similarity index 100% rename from DutyManager/Libs/AceComm-3.0/AceComm-3.0.xml rename to AuraSpy/Libs/AceComm-3.0/AceComm-3.0.xml diff --git a/DutyManager/Libs/AceComm-3.0/ChatThrottleLib.lua b/AuraSpy/Libs/AceComm-3.0/ChatThrottleLib.lua similarity index 100% rename from DutyManager/Libs/AceComm-3.0/ChatThrottleLib.lua rename to AuraSpy/Libs/AceComm-3.0/ChatThrottleLib.lua diff --git a/DutyManager/Libs/AceConfig-3.0/AceConfig-3.0.lua b/AuraSpy/Libs/AceConfig-3.0/AceConfig-3.0.lua similarity index 100% rename from DutyManager/Libs/AceConfig-3.0/AceConfig-3.0.lua rename to AuraSpy/Libs/AceConfig-3.0/AceConfig-3.0.lua diff --git a/DutyManager/Libs/AceConfig-3.0/AceConfig-3.0.xml b/AuraSpy/Libs/AceConfig-3.0/AceConfig-3.0.xml similarity index 100% rename from DutyManager/Libs/AceConfig-3.0/AceConfig-3.0.xml rename to AuraSpy/Libs/AceConfig-3.0/AceConfig-3.0.xml diff --git a/DutyManager/Libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua b/AuraSpy/Libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua similarity index 100% rename from DutyManager/Libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua rename to AuraSpy/Libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua diff --git a/DutyManager/Libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.xml b/AuraSpy/Libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.xml similarity index 100% rename from DutyManager/Libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.xml rename to AuraSpy/Libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.xml diff --git a/DutyManager/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua b/AuraSpy/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua similarity index 100% rename from DutyManager/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua rename to AuraSpy/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua diff --git a/DutyManager/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.xml b/AuraSpy/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.xml similarity index 100% rename from DutyManager/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.xml rename to AuraSpy/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.xml diff --git a/DutyManager/Libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua b/AuraSpy/Libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua similarity index 100% rename from DutyManager/Libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua rename to AuraSpy/Libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua diff --git a/DutyManager/Libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.xml b/AuraSpy/Libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.xml similarity index 100% rename from DutyManager/Libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.xml rename to AuraSpy/Libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.xml diff --git a/DutyManager/Libs/AceConsole-3.0/AceConsole-3.0.lua b/AuraSpy/Libs/AceConsole-3.0/AceConsole-3.0.lua similarity index 100% rename from DutyManager/Libs/AceConsole-3.0/AceConsole-3.0.lua rename to AuraSpy/Libs/AceConsole-3.0/AceConsole-3.0.lua diff --git a/DutyManager/Libs/AceConsole-3.0/AceConsole-3.0.xml b/AuraSpy/Libs/AceConsole-3.0/AceConsole-3.0.xml similarity index 100% rename from DutyManager/Libs/AceConsole-3.0/AceConsole-3.0.xml rename to AuraSpy/Libs/AceConsole-3.0/AceConsole-3.0.xml diff --git a/DutyManager/Libs/AceEvent-3.0/AceEvent-3.0.lua b/AuraSpy/Libs/AceEvent-3.0/AceEvent-3.0.lua similarity index 100% rename from DutyManager/Libs/AceEvent-3.0/AceEvent-3.0.lua rename to AuraSpy/Libs/AceEvent-3.0/AceEvent-3.0.lua diff --git a/DutyManager/Libs/AceEvent-3.0/AceEvent-3.0.xml b/AuraSpy/Libs/AceEvent-3.0/AceEvent-3.0.xml similarity index 100% rename from DutyManager/Libs/AceEvent-3.0/AceEvent-3.0.xml rename to AuraSpy/Libs/AceEvent-3.0/AceEvent-3.0.xml diff --git a/DutyManager/Libs/AceGUI-3.0/AceGUI-3.0.lua b/AuraSpy/Libs/AceGUI-3.0/AceGUI-3.0.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/AceGUI-3.0.lua rename to AuraSpy/Libs/AceGUI-3.0/AceGUI-3.0.lua diff --git a/DutyManager/Libs/AceGUI-3.0/AceGUI-3.0.xml b/AuraSpy/Libs/AceGUI-3.0/AceGUI-3.0.xml similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/AceGUI-3.0.xml rename to AuraSpy/Libs/AceGUI-3.0/AceGUI-3.0.xml diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIContainer-InlineGroup.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIContainer-InlineGroup.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIContainer-InlineGroup.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIContainer-InlineGroup.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIContainer-SimpleGroup.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIContainer-SimpleGroup.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIContainer-SimpleGroup.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIContainer-SimpleGroup.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIContainer-Window.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIContainer-Window.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIContainer-Window.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIContainer-Window.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-Label.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-Label.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-Label.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-Label.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua diff --git a/DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua b/AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua similarity index 100% rename from DutyManager/Libs/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua rename to AuraSpy/Libs/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua diff --git a/DutyManager/Libs/AceHook-3.0/AceHook-3.0.lua b/AuraSpy/Libs/AceHook-3.0/AceHook-3.0.lua similarity index 100% rename from DutyManager/Libs/AceHook-3.0/AceHook-3.0.lua rename to AuraSpy/Libs/AceHook-3.0/AceHook-3.0.lua diff --git a/DutyManager/Libs/AceHook-3.0/AceHook-3.0.xml b/AuraSpy/Libs/AceHook-3.0/AceHook-3.0.xml similarity index 100% rename from DutyManager/Libs/AceHook-3.0/AceHook-3.0.xml rename to AuraSpy/Libs/AceHook-3.0/AceHook-3.0.xml diff --git a/DutyManager/Libs/AceSerializer-3.0/AceSerializer-3.0.lua b/AuraSpy/Libs/AceSerializer-3.0/AceSerializer-3.0.lua similarity index 100% rename from DutyManager/Libs/AceSerializer-3.0/AceSerializer-3.0.lua rename to AuraSpy/Libs/AceSerializer-3.0/AceSerializer-3.0.lua diff --git a/DutyManager/Libs/AceSerializer-3.0/AceSerializer-3.0.xml b/AuraSpy/Libs/AceSerializer-3.0/AceSerializer-3.0.xml similarity index 100% rename from DutyManager/Libs/AceSerializer-3.0/AceSerializer-3.0.xml rename to AuraSpy/Libs/AceSerializer-3.0/AceSerializer-3.0.xml diff --git a/DutyManager/Libs/LibDeflate/LICENSE.txt b/AuraSpy/Libs/LibDeflate/LICENSE.txt similarity index 100% rename from DutyManager/Libs/LibDeflate/LICENSE.txt rename to AuraSpy/Libs/LibDeflate/LICENSE.txt diff --git a/DutyManager/Libs/LibDeflate/LibDeflate.lua b/AuraSpy/Libs/LibDeflate/LibDeflate.lua similarity index 100% rename from DutyManager/Libs/LibDeflate/LibDeflate.lua rename to AuraSpy/Libs/LibDeflate/LibDeflate.lua diff --git a/DutyManager/Libs/LibDeflate/LibDeflate.toc b/AuraSpy/Libs/LibDeflate/LibDeflate.toc similarity index 100% rename from DutyManager/Libs/LibDeflate/LibDeflate.toc rename to AuraSpy/Libs/LibDeflate/LibDeflate.toc diff --git a/DutyManager/Libs/LibDeflate/LibStub/LibStub.lua b/AuraSpy/Libs/LibDeflate/LibStub/LibStub.lua similarity index 100% rename from DutyManager/Libs/LibDeflate/LibStub/LibStub.lua rename to AuraSpy/Libs/LibDeflate/LibStub/LibStub.lua diff --git a/DutyManager/Libs/LibDeflate/LibStub/LibStub.toc b/AuraSpy/Libs/LibDeflate/LibStub/LibStub.toc similarity index 100% rename from DutyManager/Libs/LibDeflate/LibStub/LibStub.toc rename to AuraSpy/Libs/LibDeflate/LibStub/LibStub.toc diff --git a/DutyManager/Libs/LibDeflate/LibStub/tests/test.lua b/AuraSpy/Libs/LibDeflate/LibStub/tests/test.lua similarity index 100% rename from DutyManager/Libs/LibDeflate/LibStub/tests/test.lua rename to AuraSpy/Libs/LibDeflate/LibStub/tests/test.lua diff --git a/DutyManager/Libs/LibDeflate/LibStub/tests/test2.lua b/AuraSpy/Libs/LibDeflate/LibStub/tests/test2.lua similarity index 100% rename from DutyManager/Libs/LibDeflate/LibStub/tests/test2.lua rename to AuraSpy/Libs/LibDeflate/LibStub/tests/test2.lua diff --git a/DutyManager/Libs/LibDeflate/LibStub/tests/test3.lua b/AuraSpy/Libs/LibDeflate/LibStub/tests/test3.lua similarity index 100% rename from DutyManager/Libs/LibDeflate/LibStub/tests/test3.lua rename to AuraSpy/Libs/LibDeflate/LibStub/tests/test3.lua diff --git a/DutyManager/Libs/LibDeflate/LibStub/tests/test4.lua b/AuraSpy/Libs/LibDeflate/LibStub/tests/test4.lua similarity index 100% rename from DutyManager/Libs/LibDeflate/LibStub/tests/test4.lua rename to AuraSpy/Libs/LibDeflate/LibStub/tests/test4.lua diff --git a/DutyManager/Libs/LibDeflate/README.md b/AuraSpy/Libs/LibDeflate/README.md similarity index 100% rename from DutyManager/Libs/LibDeflate/README.md rename to AuraSpy/Libs/LibDeflate/README.md diff --git a/DutyManager/Libs/LibDeflate/changelog.md b/AuraSpy/Libs/LibDeflate/changelog.md similarity index 100% rename from DutyManager/Libs/LibDeflate/changelog.md rename to AuraSpy/Libs/LibDeflate/changelog.md diff --git a/DutyManager/Libs/LibDeflate/docs/README.md b/AuraSpy/Libs/LibDeflate/docs/README.md similarity index 100% rename from DutyManager/Libs/LibDeflate/docs/README.md rename to AuraSpy/Libs/LibDeflate/docs/README.md diff --git a/DutyManager/Libs/LibDeflate/docs/benchmark.md b/AuraSpy/Libs/LibDeflate/docs/benchmark.md similarity index 100% rename from DutyManager/Libs/LibDeflate/docs/benchmark.md rename to AuraSpy/Libs/LibDeflate/docs/benchmark.md diff --git a/DutyManager/Libs/LibDeflate/docs/config.ld b/AuraSpy/Libs/LibDeflate/docs/config.ld similarity index 100% rename from DutyManager/Libs/LibDeflate/docs/config.ld rename to AuraSpy/Libs/LibDeflate/docs/config.ld diff --git a/DutyManager/Libs/LibDeflate/docs/examples/example.lua.html b/AuraSpy/Libs/LibDeflate/docs/examples/example.lua.html similarity index 100% rename from DutyManager/Libs/LibDeflate/docs/examples/example.lua.html rename to AuraSpy/Libs/LibDeflate/docs/examples/example.lua.html diff --git a/DutyManager/Libs/LibDeflate/docs/index.html b/AuraSpy/Libs/LibDeflate/docs/index.html similarity index 100% rename from DutyManager/Libs/LibDeflate/docs/index.html rename to AuraSpy/Libs/LibDeflate/docs/index.html diff --git a/DutyManager/Libs/LibDeflate/docs/ldoc.css b/AuraSpy/Libs/LibDeflate/docs/ldoc.css similarity index 100% rename from DutyManager/Libs/LibDeflate/docs/ldoc.css rename to AuraSpy/Libs/LibDeflate/docs/ldoc.css diff --git a/DutyManager/Libs/LibDeflate/docs/source/LibDeflate.lua.html b/AuraSpy/Libs/LibDeflate/docs/source/LibDeflate.lua.html similarity index 100% rename from DutyManager/Libs/LibDeflate/docs/source/LibDeflate.lua.html rename to AuraSpy/Libs/LibDeflate/docs/source/LibDeflate.lua.html diff --git a/DutyManager/Libs/LibDeflate/docs/topics/benchmark.md.html b/AuraSpy/Libs/LibDeflate/docs/topics/benchmark.md.html similarity index 100% rename from DutyManager/Libs/LibDeflate/docs/topics/benchmark.md.html rename to AuraSpy/Libs/LibDeflate/docs/topics/benchmark.md.html diff --git a/DutyManager/Libs/LibDeflate/docs/topics/changelog.md.html b/AuraSpy/Libs/LibDeflate/docs/topics/changelog.md.html similarity index 100% rename from DutyManager/Libs/LibDeflate/docs/topics/changelog.md.html rename to AuraSpy/Libs/LibDeflate/docs/topics/changelog.md.html diff --git a/DutyManager/Libs/LibDeflate/docs/topics/readme.md.html b/AuraSpy/Libs/LibDeflate/docs/topics/readme.md.html similarity index 100% rename from DutyManager/Libs/LibDeflate/docs/topics/readme.md.html rename to AuraSpy/Libs/LibDeflate/docs/topics/readme.md.html diff --git a/DutyManager/Libs/LibDeflate/examples/example.lua b/AuraSpy/Libs/LibDeflate/examples/example.lua similarity index 100% rename from DutyManager/Libs/LibDeflate/examples/example.lua rename to AuraSpy/Libs/LibDeflate/examples/example.lua diff --git a/DutyManager/Libs/LibDeflate/lib.xml b/AuraSpy/Libs/LibDeflate/lib.xml similarity index 100% rename from DutyManager/Libs/LibDeflate/lib.xml rename to AuraSpy/Libs/LibDeflate/lib.xml diff --git a/DutyManager/Libs/LibStub/LibStub.lua b/AuraSpy/Libs/LibStub/LibStub.lua similarity index 100% rename from DutyManager/Libs/LibStub/LibStub.lua rename to AuraSpy/Libs/LibStub/LibStub.lua diff --git a/DutyManager/package-lock.json b/AuraSpy/package-lock.json similarity index 98% rename from DutyManager/package-lock.json rename to AuraSpy/package-lock.json index f8c8df4..7f371a6 100644 --- a/DutyManager/package-lock.json +++ b/AuraSpy/package-lock.json @@ -1,6 +1,6 @@ { "name": "DutyManager", - "version": "1.0.0", + "version": "0.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -76,11 +76,13 @@ "dev": true }, "bl": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.1.tgz", - "integrity": "sha512-FL/TdvchukRCuWVxT0YMO/7+L5TNeNrVFvRU2IY63aUyv9mpt8splf2NEr6qXtPo5fya5a66YohQKvGNmLrWNA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.3.tgz", + "integrity": "sha512-fs4G6/Hu4/EE+F75J8DuN/0IpQqNjAdC7aEQv7Qt8MHGUH7Ckv2MwTEEeN9QehD0pfIDkMI1bkHYkKy7xHyKIg==", "dev": true, "requires": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", "readable-stream": "^3.4.0" } }, diff --git a/DutyManager/package.json b/AuraSpy/package.json similarity index 73% rename from DutyManager/package.json rename to AuraSpy/package.json index 26c8f53..6b26287 100644 --- a/DutyManager/package.json +++ b/AuraSpy/package.json @@ -1,6 +1,6 @@ { - "name": "DutyManager", - "version": "1.0.0", + "name": "AuraSpy", + "version": "0.0.1", "dependencies": {}, "devDependencies": { "archiver": "^3.1.1", diff --git a/DutyManager/scripts/build.js b/AuraSpy/scripts/build.js similarity index 87% rename from DutyManager/scripts/build.js rename to AuraSpy/scripts/build.js index f38af8a..ce8e43e 100644 --- a/DutyManager/scripts/build.js +++ b/AuraSpy/scripts/build.js @@ -6,11 +6,13 @@ const archiver = require('archiver'); const versionTag = "## Version:"; +const ADDON_NAME = 'AuraSpy'; + const srcDir = path.join(__dirname, '../src'); const libDir = path.join(__dirname, '../Libs'); const targetDir = path.join(__dirname, '../target'); const WoW_dir = 'D:\\Games\\BattleNet\\World of Warcraft\\_classic_'; -const AddonDir = `${WoW_dir}\\Interface\\Addons\\DutyManager`; +const AddonDir = `${WoW_dir}\\Interface\\Addons\\${ADDON_NAME}`; const copySources = (dest) => { copydir.sync(srcDir, dest); @@ -18,7 +20,7 @@ const copySources = (dest) => { }; const getVersion = () => { - const contents = fs.readFileSync(path.join(srcDir, 'DutyManager.toc'), 'utf8'); + const contents = fs.readFileSync(path.join(srcDir, `${ADDON_NAME}.toc`), 'utf8'); const lines = contents.split(/(?:\r\n|\r|\n)/g); for (let i = 0; i < lines.length; i++) { @@ -56,7 +58,7 @@ const createZip = (dir, target) => { }); archive.pipe(output); - archive.directory(dir, 'DutyManager'); + archive.directory(dir, ADDON_NAME); archive.finalize(); }; @@ -67,7 +69,7 @@ if (!fs.existsSync(targetDir)){ } copySources(path.join(targetDir, 'sources')); -createZip(path.join(targetDir, 'sources'), path.join(targetDir, `DutyManager-v${getVersion()}.zip`)); +createZip(path.join(targetDir, 'sources'), path.join(targetDir, `${ADDON_NAME}-v${getVersion()}.zip`)); rimraf.sync(AddonDir); copySources(AddonDir); diff --git a/AuraSpy/src/AuraSpy.lua b/AuraSpy/src/AuraSpy.lua new file mode 100644 index 0000000..4df5375 --- /dev/null +++ b/AuraSpy/src/AuraSpy.lua @@ -0,0 +1,103 @@ +AuraSpy = LibStub("AceAddon-3.0"):NewAddon("AuraSpy", "AceEvent-3.0", "AceHook-3.0", "AceConsole-3.0") +AceGUI = LibStub("AceGUI-3.0") + +function AuraSpy:OnInitialize() + if not AuraReports then AuraReports = {} end; + if not AuraSpy.var then AuraSpy.var = {} end; + + print("AuraSpy initialized") +end + +function AuraSpy:OnEnable() + AuraSpy:RegisterChatCommand("kgb", "OnCommand") + + AuraSpy:CreateCopyFrame() + --AuraSpy:RegisterEvent("GROUP_ROSTER_UPDATE", "onRosterUpdate") +end + +function AuraSpy:OnDisable() + AuraSpy:UnregisterChatCommand("kgb") + --AuraSpy:UnregisterEvent("GROUP_ROSTER_UPDATE") +end + +function mysplit (inputstr, sep) + if sep == nil then + sep = "%s" + end + local t={} + for str in string.gmatch(inputstr, "([^"..sep.."]+)") do + table.insert(t, str) + end + return t +end + +function AuraSpy:OnCommand(params) + local p = mysplit(params, " ") + + if (p[1] == "spy") then + local players = AuraSpyUtils:spy() + if (players ~= nil) then + players.name = p[2] + AuraReports[#AuraReports + 1] = players + print("Spied " .. #players .. " commrades") + end + elseif (p[1] == "clear") then + AuraReports = {} + print("cleared") + elseif (p[1] == "export") then + local json = AuraSpyJson.stringify(AuraReports[1], false) + AuraSpy:OpenEditor(json) + else + local consumables, enchants = AuraSpyUtils:spyPlayer(p[1], UnitClass(p[1])) + print(AuraSpyUtils:dump(consumables)); + print(AuraSpyUtils:dump(enchants)); + end +end + +function AuraSpy:OpenEditor(text) + print("opening") + if (AuraSpy.var and AuraSpy.var.editBox) then + print("ok") + AuraSpy.var.editBox:Insert(text) + AuraSpy.var.editFrame:Show() + AuraSpy.var.editBox:HighlightText() + AuraSpy.var.editBox:SetFocus() + print("done") + end +end + +function AuraSpy:CloseEditor() + if (AuraSpy.var and AuraSpy.var.editBox) then + AuraSpy.var.editBox:SetText("") + AuraSpy.var.editBox:ClearFocus() + AuraSpy.var.editFrame:Hide() + end +end + +function AuraSpy:CreateCopyFrame() + AuraSpy.var.editFrame = CreateFrame("ScrollFrame", "CopyContent", UIParent, "InputScrollFrameTemplate") + AuraSpy.var.editBox = AuraSpy.var.editFrame.EditBox + AuraSpy.var.btnClose = CreateFrame("Button", "ChatCopy", AuraSpy.var.editFrame, "UIPanelButtonTemplate") + + -- setup edit box + AuraSpy.var.editFrame:SetPoint("CENTER") + AuraSpy.var.editFrame:SetSize(500, 300) + AuraSpy.var.editFrame.CharCount:Hide() + --editBox:SetFontObject("ChatFontNormal") + AuraSpy.var.editBox:SetFont("Fonts\\ARIALN.ttf", 13) + AuraSpy.var.editBox:SetWidth(AuraSpy.var.editFrame:GetWidth()) -- multiline editboxes need a width declared!! + AuraSpy.var.editBox:SetScript("OnEscapePressed", function(self) + AuraSpy:CloseEditor() + end) + AuraSpy.var.editBox:SetAllPoints() + AuraSpy.var.editFrame:Hide() + + -- setup edit box closing button + AuraSpy.var.btnClose:SetPoint("TOPRIGHT") + AuraSpy.var.btnClose:SetSize(15, 15) + AuraSpy.var.btnClose:SetText("x") + AuraSpy.var.btnClose:SetFrameStrata("FULLSCREEN") + AuraSpy.var.btnClose:SetScript("OnClick", function(self) + AuraSpy:CloseEditor() + end) +end \ No newline at end of file diff --git a/AuraSpy/src/AuraSpy.toc b/AuraSpy/src/AuraSpy.toc new file mode 100644 index 0000000..00c7eca --- /dev/null +++ b/AuraSpy/src/AuraSpy.toc @@ -0,0 +1,16 @@ +## Interface: 11304 +## Title: AuraSpy +## Notes: Spy auras +## Version: 0.0.1 + +## SavedVariables: AuraReports +## SavedVariablesPerCharacter: + +## Author: Tomas Chalupnik (tchalupnik.cz) + +embeds.xml + +Json.lua +Config.lua +Utils.lua +AuraSpy.lua diff --git a/AuraSpy/src/Config.lua b/AuraSpy/src/Config.lua new file mode 100644 index 0000000..0134829 --- /dev/null +++ b/AuraSpy/src/Config.lua @@ -0,0 +1,63 @@ +AuraSpyConfig = LibStub("AceAddon-3.0"):NewAddon("AuraSpyConfig") + +AuraSpyConfig = { + watched = { + consumables = { + 17539, -- Greater Arcane Elixir + 11474, -- Elixir of Shadow Power + 22730, -- Runn Tum Tuber Surprise + 21920, -- Elixir of Frost Power + 26276, -- Elixir of Greater Firepower + 18194, -- Nightfin Soup + 16327, -- Juju Guile + 17628, -- Flask of Supreme Power + 11390, -- Arcane Elixir + 10692, -- Cerebral Cortex Compound + 17627, -- Flask of Distilled Wisdom + 25691, -- Sagefish Delight + 17538, -- Elixir of the Mongoose + 17038, -- Winterfall Firewater + 18230, -- Grilled Squid + 16323, -- Juju Power + 10669, -- Ground Scorpok Assay + 16329, -- Juju Might + 22789, -- Gordok Green Grog + 17626, -- Flask of the Titans + 3593, -- Elixir of Fortitude + 11405, -- Elixir of Giants + 11334, -- Elixir of Greater Agility + 7844, -- Elixir of Firepower + 10256, -- Monster Omelet + 18124, -- Blessed Sunfruit + 10667, -- R.O.I.D.S. + 11328, -- Elixir of Agility + 22790, -- Kreeg\'s Stout Beatdown + 10693, -- Gizzard Gum + 18140, -- Blessed Sunfruit Juice + 24382, -- Spirit of Zanza + 24363, -- Mageblood Potion + 24361, -- Major Troll\'s Blood Potion + 11348, -- Elixir of Superior Defense + 17537, -- Elixir of Brute Force + 25804, -- Rumsey Rum Black Label + 10668, -- Lung Juice Cocktail + }, + enchants = { + "Minor Mana Oil", + "Brilliant Mana Oil", + "Brilliant Wizard Oil", + "Lesser Mana Oil", + "Wizard Oil", + "Lesser Wizard Oil", + "Blessed Wizard Oil", + + "Elemental Sharpening Stone", + "Consecrated Sharpening Stone", + "Dense Sharpening Stone", + "Coarse Sharpening Stone", + "Rough Sharpening Stone", + "Heavy Sharpening Stone", + "Solid Sharpening Stone", + }, + } +} \ No newline at end of file diff --git a/AuraSpy/src/Json.lua b/AuraSpy/src/Json.lua new file mode 100644 index 0000000..faa82b8 --- /dev/null +++ b/AuraSpy/src/Json.lua @@ -0,0 +1,179 @@ +AuraSpyJson = LibStub("AceAddon-3.0"):NewAddon("AuraSpyJson") + +--[[ json.lua +A compact pure-Lua JSON library. +The main functions are: json.stringify, json.parse. +## json.stringify: +This expects the following to be true of any tables being encoded: + * They only have string or number keys. Number keys must be represented as + strings in json; this is part of the json spec. + * They are not recursive. Such a structure cannot be specified in json. +A Lua table is considered to be an array if and only if its set of keys is a +consecutive sequence of positive integers starting at 1. Arrays are encoded like +so: `[2, 3, false, "hi"]`. Any other type of Lua table is encoded as a json +object, encoded like so: `{"key1": 2, "key2": false}`. +Because the Lua nil value cannot be a key, and as a table value is considerd +equivalent to a missing key, there is no way to express the json "null" value in +a Lua table. The only way this will output "null" is if your entire input obj is +nil itself. +An empty Lua table, {}, could be considered either a json object or array - +it's an ambiguous edge case. We choose to treat this as an object as it is the +more general type. +To be clear, none of the above considerations is a limitation of this code. +Rather, it is what we get when we completely observe the json specification for +as arbitrary a Lua object as json is capable of expressing. +## json.parse: +This function parses json, with the exception that it does not pay attention to +\u-escaped unicode code points in strings. +It is difficult for Lua to return null as a value. In order to prevent the loss +of keys with a null value in a json string, this function uses the one-off +table value json.null (which is just an empty table) to indicate null values. +This way you can check if a value is null with the conditional +`val == json.null`. +If you have control over the data and are using Lua, I would recommend just +avoiding null values in your data to begin with. +--]] + + +-- Internal functions. + +local function kind_of(obj) + if type(obj) ~= 'table' then return type(obj) end + local i = 1 + for _ in pairs(obj) do + if obj[i] ~= nil then i = i + 1 else return 'table' end + end + if i == 1 then return 'table' else return 'array' end +end + +local function escape_str(s) + local in_char = {'\\', '"', '/', '\b', '\f', '\n', '\r', '\t'} + local out_char = {'\\', '"', '/', 'b', 'f', 'n', 'r', 't'} + for i, c in ipairs(in_char) do + s = s:gsub(c, '\\' .. out_char[i]) + end + return s +end + +-- Returns pos, did_find; there are two cases: +-- 1. Delimiter found: pos = pos after leading space + delim; did_find = true. +-- 2. Delimiter not found: pos = pos after leading space; did_find = false. +-- This throws an error if err_if_missing is true and the delim is not found. +local function skip_delim(str, pos, delim, err_if_missing) + pos = pos + #str:match('^%s*', pos) + if str:sub(pos, pos) ~= delim then + if err_if_missing then + error('Expected ' .. delim .. ' near position ' .. pos) + end + return pos, false + end + return pos + 1, true +end + +-- Expects the given pos to be the first character after the opening quote. +-- Returns val, pos; the returned pos is after the closing quote character. +local function parse_str_val(str, pos, val) + val = val or '' + local early_end_error = 'End of input found while parsing string.' + if pos > #str then error(early_end_error) end + local c = str:sub(pos, pos) + if c == '"' then return val, pos + 1 end + if c ~= '\\' then return parse_str_val(str, pos + 1, val .. c) end + -- We must have a \ character. + local esc_map = {b = '\b', f = '\f', n = '\n', r = '\r', t = '\t'} + local nextc = str:sub(pos + 1, pos + 1) + if not nextc then error(early_end_error) end + return parse_str_val(str, pos + 2, val .. (esc_map[nextc] or nextc)) +end + +-- Returns val, pos; the returned pos is after the number's final character. +local function parse_num_val(str, pos) + local num_str = str:match('^-?%d+%.?%d*[eE]?[+-]?%d*', pos) + local val = tonumber(num_str) + if not val then error('Error parsing number at position ' .. pos .. '.') end + return val, pos + #num_str +end + + +-- Public values and functions. + +function AuraSpyJson.stringify(obj, as_key) + local s = {} -- We'll build the string as an array of strings to be concatenated. + local kind = kind_of(obj) -- This is 'array' if it's an array or type(obj) otherwise. + if kind == 'array' then + if as_key then error('Can\'t encode array as key.') end + s[#s + 1] = '[' + for i, val in ipairs(obj) do + if i > 1 then s[#s + 1] = ', ' end + s[#s + 1] = AuraSpyJson.stringify(val) + end + s[#s + 1] = ']' + elseif kind == 'table' then + if as_key then error('Can\'t encode table as key.') end + s[#s + 1] = '{' + for k, v in pairs(obj) do + if #s > 1 then s[#s + 1] = ', ' end + s[#s + 1] = AuraSpyJson.stringify(k, true) + s[#s + 1] = ':' + s[#s + 1] = AuraSpyJson.stringify(v) + end + s[#s + 1] = '}' + elseif kind == 'string' then + return '"' .. escape_str(obj) .. '"' + elseif kind == 'number' then + if as_key then return '"' .. tostring(obj) .. '"' end + return tostring(obj) + elseif kind == 'boolean' then + return tostring(obj) + elseif kind == 'nil' then + return 'null' + else + error('Unjsonifiable type: ' .. kind .. '.') + end + return table.concat(s) +end + +AuraSpyJson.null = {} -- This is a one-off table to represent the null value. + +function AuraSpyJson.parse(str, pos, end_delim) + pos = pos or 1 + if pos > #str then error('Reached unexpected end of input.') end + local pos = pos + #str:match('^%s*', pos) -- Skip whitespace. + local first = str:sub(pos, pos) + if first == '{' then -- Parse an object. + local obj, key, delim_found = {}, true, true + pos = pos + 1 + while true do + key, pos = AuraSpyJson.parse(str, pos, '}') + if key == nil then return obj, pos end + if not delim_found then error('Comma missing between object items.') end + pos = skip_delim(str, pos, ':', true) -- true -> error if missing. + obj[key], pos = AuraSpyJson.parse(str, pos) + pos, delim_found = skip_delim(str, pos, ',') + end + elseif first == '[' then -- Parse an array. + local arr, val, delim_found = {}, true, true + pos = pos + 1 + while true do + val, pos = AuraSpyJson.parse(str, pos, ']') + if val == nil then return arr, pos end + if not delim_found then error('Comma missing between array items.') end + arr[#arr + 1] = val + pos, delim_found = skip_delim(str, pos, ',') + end + elseif first == '"' then -- Parse a string. + return parse_str_val(str, pos + 1) + elseif first == '-' or first:match('%d') then -- Parse a number. + return parse_num_val(str, pos) + elseif first == end_delim then -- End of an object or array. + return nil, pos + 1 + else -- Parse true, false, or null. + local literals = {['true'] = true, ['false'] = false, ['null'] = AuraSpyJson.null} + for lit_str, lit_val in pairs(literals) do + local lit_end = pos + #lit_str - 1 + if str:sub(pos, lit_end) == lit_str then return lit_val, lit_end + 1 end + end + local pos_info_str = 'position ' .. pos .. ': ' .. str:sub(pos, pos + 10) + error('Invalid json syntax starting at ' .. pos_info_str) + end +end \ No newline at end of file diff --git a/AuraSpy/src/Utils.lua b/AuraSpy/src/Utils.lua new file mode 100644 index 0000000..328b47e --- /dev/null +++ b/AuraSpy/src/Utils.lua @@ -0,0 +1,118 @@ +AuraSpyUtils = LibStub("AceAddon-3.0"):NewAddon("AuraSpyUtils") + +function AuraSpyUtils:isInGroup() + --print("isInGroup: " .. tostring(GetNumGroupMembers() > 0)) + return GetNumGroupMembers() > 0 +end + +function AuraSpyUtils:isOnline(unit) + --print("isOnline ("..unit.."): ".. tostring(UnitIsConnected(unit))) + return UnitIsConnected(unit) +end + +function AuraSpyUtils:spyEnchants(player, slotId) + local tip = CreateFrame("GameTooltip", "scanTip", nil, "GameTooltipTemplate") + tip:SetOwner(WorldFrame,"ANCHOR_NONE") + tip:ClearLines() + + tip:SetInventoryItem(player, slotId) + + local enchants = {}; + + for i = 1, select("#", tip:GetRegions()) do + local region = select(i, tip:GetRegions()) + if region and region:GetObjectType() == "FontString" then + local text = region:GetText() + if (text ~= nil) then + for _, val in ipairs(AuraSpyConfig.watched.enchants) do + if (string.sub(text, 1, string.len(val)) == val) then + enchants[#enchants + 1] = val; + end + end + end + end + end + + return enchants; +end + +function AuraSpyUtils:spyPlayer(player, class) + local consumables = {} + for b=1,40 do + local name, _, _, _, _, _, _, _, _, spellId = UnitBuff(player, b) + + if (name == nil) then + break + end + + if (AuraSpyUtils:tableHasValue(AuraSpyConfig.watched.consumables, spellId)) then + consumables[#consumables + 1] = spellId; + end + end + + local mainId = GetInventorySlotInfo("MAINHANDSLOT"); + local offId = GetInventorySlotInfo("SECONDARYHANDSLOT"); + + local enchants = { + MH = AuraSpyUtils:spyEnchants(player, mainId), + OH = AuraSpyUtils:spyEnchants(player, offId) + } + + return consumables, enchants; +end + +function AuraSpyUtils:spy() + if IsInRaid() then + local raid = {} + for i=1,MAX_RAID_MEMBERS do + local name, _, _, _, _, class, zone, online, isDead, role, isML, combatRole = GetRaidRosterInfo(i); + + if (name ~= nil) then + raid[#raid + 1] = { + name = name, + cl = class, + }; + + if (not online) then + raid[i].status = 'OFFLINE'; + elseif(isDead) then + raid[i].status = 'DEAD'; + else + local consumables, enchants = AuraSpyUtils:spyPlayer(name, class) + raid[i].consumables = consumables; + raid[i].enchants = enchants; + end + end + end + return raid + else + print("You must be in raid to spy commrades") + return nil + end +end + +function AuraSpyUtils:dump(o) + if type(o) == 'table' then + local s = '{ ' + for k,v in pairs(o) do + if type(k) ~= 'number' then k = '"'..k..'"' end + s = s .. '['..k..'] = ' .. AuraSpyUtils:dump(v) .. ',' + end + return s .. '} ' + else + return tostring(o) + end +end + +function AuraSpyUtils:isEmptyString(val) + return val == nil or val == "" +end + +function AuraSpyUtils:tableHasValue(table, value) + for _, val in ipairs(table) do + if val == value then + return true + end + end + return false +end diff --git a/DutyManager/src/embeds.xml b/AuraSpy/src/embeds.xml similarity index 100% rename from DutyManager/src/embeds.xml rename to AuraSpy/src/embeds.xml diff --git a/AuraSpy/target/AuraSpy-v0.0.1.zip b/AuraSpy/target/AuraSpy-v0.0.1.zip new file mode 100644 index 0000000..02e7c92 Binary files /dev/null and b/AuraSpy/target/AuraSpy-v0.0.1.zip differ diff --git a/AuraSpy/target/sources/AuraSpy.lua b/AuraSpy/target/sources/AuraSpy.lua new file mode 100644 index 0000000..4df5375 --- /dev/null +++ b/AuraSpy/target/sources/AuraSpy.lua @@ -0,0 +1,103 @@ +AuraSpy = LibStub("AceAddon-3.0"):NewAddon("AuraSpy", "AceEvent-3.0", "AceHook-3.0", "AceConsole-3.0") +AceGUI = LibStub("AceGUI-3.0") + +function AuraSpy:OnInitialize() + if not AuraReports then AuraReports = {} end; + if not AuraSpy.var then AuraSpy.var = {} end; + + print("AuraSpy initialized") +end + +function AuraSpy:OnEnable() + AuraSpy:RegisterChatCommand("kgb", "OnCommand") + + AuraSpy:CreateCopyFrame() + --AuraSpy:RegisterEvent("GROUP_ROSTER_UPDATE", "onRosterUpdate") +end + +function AuraSpy:OnDisable() + AuraSpy:UnregisterChatCommand("kgb") + --AuraSpy:UnregisterEvent("GROUP_ROSTER_UPDATE") +end + +function mysplit (inputstr, sep) + if sep == nil then + sep = "%s" + end + local t={} + for str in string.gmatch(inputstr, "([^"..sep.."]+)") do + table.insert(t, str) + end + return t +end + +function AuraSpy:OnCommand(params) + local p = mysplit(params, " ") + + if (p[1] == "spy") then + local players = AuraSpyUtils:spy() + if (players ~= nil) then + players.name = p[2] + AuraReports[#AuraReports + 1] = players + print("Spied " .. #players .. " commrades") + end + elseif (p[1] == "clear") then + AuraReports = {} + print("cleared") + elseif (p[1] == "export") then + local json = AuraSpyJson.stringify(AuraReports[1], false) + AuraSpy:OpenEditor(json) + else + local consumables, enchants = AuraSpyUtils:spyPlayer(p[1], UnitClass(p[1])) + print(AuraSpyUtils:dump(consumables)); + print(AuraSpyUtils:dump(enchants)); + end +end + +function AuraSpy:OpenEditor(text) + print("opening") + if (AuraSpy.var and AuraSpy.var.editBox) then + print("ok") + AuraSpy.var.editBox:Insert(text) + AuraSpy.var.editFrame:Show() + AuraSpy.var.editBox:HighlightText() + AuraSpy.var.editBox:SetFocus() + print("done") + end +end + +function AuraSpy:CloseEditor() + if (AuraSpy.var and AuraSpy.var.editBox) then + AuraSpy.var.editBox:SetText("") + AuraSpy.var.editBox:ClearFocus() + AuraSpy.var.editFrame:Hide() + end +end + +function AuraSpy:CreateCopyFrame() + AuraSpy.var.editFrame = CreateFrame("ScrollFrame", "CopyContent", UIParent, "InputScrollFrameTemplate") + AuraSpy.var.editBox = AuraSpy.var.editFrame.EditBox + AuraSpy.var.btnClose = CreateFrame("Button", "ChatCopy", AuraSpy.var.editFrame, "UIPanelButtonTemplate") + + -- setup edit box + AuraSpy.var.editFrame:SetPoint("CENTER") + AuraSpy.var.editFrame:SetSize(500, 300) + AuraSpy.var.editFrame.CharCount:Hide() + --editBox:SetFontObject("ChatFontNormal") + AuraSpy.var.editBox:SetFont("Fonts\\ARIALN.ttf", 13) + AuraSpy.var.editBox:SetWidth(AuraSpy.var.editFrame:GetWidth()) -- multiline editboxes need a width declared!! + AuraSpy.var.editBox:SetScript("OnEscapePressed", function(self) + AuraSpy:CloseEditor() + end) + AuraSpy.var.editBox:SetAllPoints() + AuraSpy.var.editFrame:Hide() + + -- setup edit box closing button + AuraSpy.var.btnClose:SetPoint("TOPRIGHT") + AuraSpy.var.btnClose:SetSize(15, 15) + AuraSpy.var.btnClose:SetText("x") + AuraSpy.var.btnClose:SetFrameStrata("FULLSCREEN") + AuraSpy.var.btnClose:SetScript("OnClick", function(self) + AuraSpy:CloseEditor() + end) +end \ No newline at end of file diff --git a/AuraSpy/target/sources/AuraSpy.toc b/AuraSpy/target/sources/AuraSpy.toc new file mode 100644 index 0000000..00c7eca --- /dev/null +++ b/AuraSpy/target/sources/AuraSpy.toc @@ -0,0 +1,16 @@ +## Interface: 11304 +## Title: AuraSpy +## Notes: Spy auras +## Version: 0.0.1 + +## SavedVariables: AuraReports +## SavedVariablesPerCharacter: + +## Author: Tomas Chalupnik (tchalupnik.cz) + +embeds.xml + +Json.lua +Config.lua +Utils.lua +AuraSpy.lua diff --git a/AuraSpy/target/sources/Config.lua b/AuraSpy/target/sources/Config.lua new file mode 100644 index 0000000..0134829 --- /dev/null +++ b/AuraSpy/target/sources/Config.lua @@ -0,0 +1,63 @@ +AuraSpyConfig = LibStub("AceAddon-3.0"):NewAddon("AuraSpyConfig") + +AuraSpyConfig = { + watched = { + consumables = { + 17539, -- Greater Arcane Elixir + 11474, -- Elixir of Shadow Power + 22730, -- Runn Tum Tuber Surprise + 21920, -- Elixir of Frost Power + 26276, -- Elixir of Greater Firepower + 18194, -- Nightfin Soup + 16327, -- Juju Guile + 17628, -- Flask of Supreme Power + 11390, -- Arcane Elixir + 10692, -- Cerebral Cortex Compound + 17627, -- Flask of Distilled Wisdom + 25691, -- Sagefish Delight + 17538, -- Elixir of the Mongoose + 17038, -- Winterfall Firewater + 18230, -- Grilled Squid + 16323, -- Juju Power + 10669, -- Ground Scorpok Assay + 16329, -- Juju Might + 22789, -- Gordok Green Grog + 17626, -- Flask of the Titans + 3593, -- Elixir of Fortitude + 11405, -- Elixir of Giants + 11334, -- Elixir of Greater Agility + 7844, -- Elixir of Firepower + 10256, -- Monster Omelet + 18124, -- Blessed Sunfruit + 10667, -- R.O.I.D.S. + 11328, -- Elixir of Agility + 22790, -- Kreeg\'s Stout Beatdown + 10693, -- Gizzard Gum + 18140, -- Blessed Sunfruit Juice + 24382, -- Spirit of Zanza + 24363, -- Mageblood Potion + 24361, -- Major Troll\'s Blood Potion + 11348, -- Elixir of Superior Defense + 17537, -- Elixir of Brute Force + 25804, -- Rumsey Rum Black Label + 10668, -- Lung Juice Cocktail + }, + enchants = { + "Minor Mana Oil", + "Brilliant Mana Oil", + "Brilliant Wizard Oil", + "Lesser Mana Oil", + "Wizard Oil", + "Lesser Wizard Oil", + "Blessed Wizard Oil", + + "Elemental Sharpening Stone", + "Consecrated Sharpening Stone", + "Dense Sharpening Stone", + "Coarse Sharpening Stone", + "Rough Sharpening Stone", + "Heavy Sharpening Stone", + "Solid Sharpening Stone", + }, + } +} \ No newline at end of file diff --git a/AuraSpy/target/sources/Libs/AceAddon-3.0/AceAddon-3.0.lua b/AuraSpy/target/sources/Libs/AceAddon-3.0/AceAddon-3.0.lua new file mode 100644 index 0000000..2b2a00e --- /dev/null +++ b/AuraSpy/target/sources/Libs/AceAddon-3.0/AceAddon-3.0.lua @@ -0,0 +1,643 @@ +--- **AceAddon-3.0** provides a template for creating addon objects. +-- It'll provide you with a set of callback functions that allow you to simplify the loading +-- process of your addon.\\ +-- Callbacks provided are:\\ +-- * **OnInitialize**, which is called directly after the addon is fully loaded. +-- * **OnEnable** which gets called during the PLAYER_LOGIN event, when most of the data provided by the game is already present. +-- * **OnDisable**, which is only called when your addon is manually being disabled. +-- @usage +-- -- A small (but complete) addon, that doesn't do anything, +-- -- but shows usage of the callbacks. +-- local MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon") +-- +-- function MyAddon:OnInitialize() +-- -- do init tasks here, like loading the Saved Variables, +-- -- or setting up slash commands. +-- end +-- +-- function MyAddon:OnEnable() +-- -- Do more initialization here, that really enables the use of your addon. +-- -- Register Events, Hook functions, Create Frames, Get information from +-- -- the game that wasn't available in OnInitialize +-- end +-- +-- function MyAddon:OnDisable() +-- -- Unhook, Unregister Events, Hide frames that you created. +-- -- You would probably only use an OnDisable if you want to +-- -- build a "standby" mode, or be able to toggle modules on/off. +-- end +-- @class file +-- @name AceAddon-3.0.lua +-- @release $Id: AceAddon-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $ + +local MAJOR, MINOR = "AceAddon-3.0", 12 +local AceAddon, oldminor = LibStub:NewLibrary(MAJOR, MINOR) + +if not AceAddon then return end -- No Upgrade needed. + +AceAddon.frame = AceAddon.frame or CreateFrame("Frame", "AceAddon30Frame") -- Our very own frame +AceAddon.addons = AceAddon.addons or {} -- addons in general +AceAddon.statuses = AceAddon.statuses or {} -- statuses of addon. +AceAddon.initializequeue = AceAddon.initializequeue or {} -- addons that are new and not initialized +AceAddon.enablequeue = AceAddon.enablequeue or {} -- addons that are initialized and waiting to be enabled +AceAddon.embeds = AceAddon.embeds or setmetatable({}, {__index = function(tbl, key) tbl[key] = {} return tbl[key] end }) -- contains a list of libraries embedded in an addon + +-- Lua APIs +local tinsert, tconcat, tremove = table.insert, table.concat, table.remove +local fmt, tostring = string.format, tostring +local select, pairs, next, type, unpack = select, pairs, next, type, unpack +local loadstring, assert, error = loadstring, assert, error +local setmetatable, getmetatable, rawset, rawget = setmetatable, getmetatable, rawset, rawget + +-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded +-- List them here for Mikk's FindGlobals script +-- GLOBALS: LibStub, IsLoggedIn, geterrorhandler + +--[[ + xpcall safecall implementation +]] +local xpcall = xpcall + +local function errorhandler(err) + return geterrorhandler()(err) +end + +local function safecall(func, ...) + -- we check to see if the func is passed is actually a function here and don't error when it isn't + -- this safecall is used for optional functions like OnInitialize OnEnable etc. When they are not + -- present execution should continue without hinderance + if type(func) == "function" then + return xpcall(func, errorhandler, ...) + end +end + +-- local functions that will be implemented further down +local Enable, Disable, EnableModule, DisableModule, Embed, NewModule, GetModule, GetName, SetDefaultModuleState, SetDefaultModuleLibraries, SetEnabledState, SetDefaultModulePrototype + +-- used in the addon metatable +local function addontostring( self ) return self.name end + +-- Check if the addon is queued for initialization +local function queuedForInitialization(addon) + for i = 1, #AceAddon.initializequeue do + if AceAddon.initializequeue[i] == addon then + return true + end + end + return false +end + +--- Create a new AceAddon-3.0 addon. +-- Any libraries you specified will be embeded, and the addon will be scheduled for +-- its OnInitialize and OnEnable callbacks. +-- The final addon object, with all libraries embeded, will be returned. +-- @paramsig [object ,]name[, lib, ...] +-- @param object Table to use as a base for the addon (optional) +-- @param name Name of the addon object to create +-- @param lib List of libraries to embed into the addon +-- @usage +-- -- Create a simple addon object +-- MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "AceEvent-3.0") +-- +-- -- Create a Addon object based on the table of a frame +-- local MyFrame = CreateFrame("Frame") +-- MyAddon = LibStub("AceAddon-3.0"):NewAddon(MyFrame, "MyAddon", "AceEvent-3.0") +function AceAddon:NewAddon(objectorname, ...) + local object,name + local i=1 + if type(objectorname)=="table" then + object=objectorname + name=... + i=2 + else + name=objectorname + end + if type(name)~="string" then + error(("Usage: NewAddon([object,] name, [lib, lib, lib, ...]): 'name' - string expected got '%s'."):format(type(name)), 2) + end + if self.addons[name] then + error(("Usage: NewAddon([object,] name, [lib, lib, lib, ...]): 'name' - Addon '%s' already exists."):format(name), 2) + end + + object = object or {} + object.name = name + + local addonmeta = {} + local oldmeta = getmetatable(object) + if oldmeta then + for k, v in pairs(oldmeta) do addonmeta[k] = v end + end + addonmeta.__tostring = addontostring + + setmetatable( object, addonmeta ) + self.addons[name] = object + object.modules = {} + object.orderedModules = {} + object.defaultModuleLibraries = {} + Embed( object ) -- embed NewModule, GetModule methods + self:EmbedLibraries(object, select(i,...)) + + -- add to queue of addons to be initialized upon ADDON_LOADED + tinsert(self.initializequeue, object) + return object +end + + +--- Get the addon object by its name from the internal AceAddon registry. +-- Throws an error if the addon object cannot be found (except if silent is set). +-- @param name unique name of the addon object +-- @param silent if true, the addon is optional, silently return nil if its not found +-- @usage +-- -- Get the Addon +-- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") +function AceAddon:GetAddon(name, silent) + if not silent and not self.addons[name] then + error(("Usage: GetAddon(name): 'name' - Cannot find an AceAddon '%s'."):format(tostring(name)), 2) + end + return self.addons[name] +end + +-- - Embed a list of libraries into the specified addon. +-- This function will try to embed all of the listed libraries into the addon +-- and error if a single one fails. +-- +-- **Note:** This function is for internal use by :NewAddon/:NewModule +-- @paramsig addon, [lib, ...] +-- @param addon addon object to embed the libs in +-- @param lib List of libraries to embed into the addon +function AceAddon:EmbedLibraries(addon, ...) + for i=1,select("#", ... ) do + local libname = select(i, ...) + self:EmbedLibrary(addon, libname, false, 4) + end +end + +-- - Embed a library into the addon object. +-- This function will check if the specified library is registered with LibStub +-- and if it has a :Embed function to call. It'll error if any of those conditions +-- fails. +-- +-- **Note:** This function is for internal use by :EmbedLibraries +-- @paramsig addon, libname[, silent[, offset]] +-- @param addon addon object to embed the library in +-- @param libname name of the library to embed +-- @param silent marks an embed to fail silently if the library doesn't exist (optional) +-- @param offset will push the error messages back to said offset, defaults to 2 (optional) +function AceAddon:EmbedLibrary(addon, libname, silent, offset) + local lib = LibStub:GetLibrary(libname, true) + if not lib and not silent then + error(("Usage: EmbedLibrary(addon, libname, silent, offset): 'libname' - Cannot find a library instance of %q."):format(tostring(libname)), offset or 2) + elseif lib and type(lib.Embed) == "function" then + lib:Embed(addon) + tinsert(self.embeds[addon], libname) + return true + elseif lib then + error(("Usage: EmbedLibrary(addon, libname, silent, offset): 'libname' - Library '%s' is not Embed capable"):format(libname), offset or 2) + end +end + +--- Return the specified module from an addon object. +-- Throws an error if the addon object cannot be found (except if silent is set) +-- @name //addon//:GetModule +-- @paramsig name[, silent] +-- @param name unique name of the module +-- @param silent if true, the module is optional, silently return nil if its not found (optional) +-- @usage +-- -- Get the Addon +-- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") +-- -- Get the Module +-- MyModule = MyAddon:GetModule("MyModule") +function GetModule(self, name, silent) + if not self.modules[name] and not silent then + error(("Usage: GetModule(name, silent): 'name' - Cannot find module '%s'."):format(tostring(name)), 2) + end + return self.modules[name] +end + +local function IsModuleTrue(self) return true end + +--- Create a new module for the addon. +-- The new module can have its own embeded libraries and/or use a module prototype to be mixed into the module.\\ +-- A module has the same functionality as a real addon, it can have modules of its own, and has the same API as +-- an addon object. +-- @name //addon//:NewModule +-- @paramsig name[, prototype|lib[, lib, ...]] +-- @param name unique name of the module +-- @param prototype object to derive this module from, methods and values from this table will be mixed into the module (optional) +-- @param lib List of libraries to embed into the addon +-- @usage +-- -- Create a module with some embeded libraries +-- MyModule = MyAddon:NewModule("MyModule", "AceEvent-3.0", "AceHook-3.0") +-- +-- -- Create a module with a prototype +-- local prototype = { OnEnable = function(self) print("OnEnable called!") end } +-- MyModule = MyAddon:NewModule("MyModule", prototype, "AceEvent-3.0", "AceHook-3.0") +function NewModule(self, name, prototype, ...) + if type(name) ~= "string" then error(("Usage: NewModule(name, [prototype, [lib, lib, lib, ...]): 'name' - string expected got '%s'."):format(type(name)), 2) end + if type(prototype) ~= "string" and type(prototype) ~= "table" and type(prototype) ~= "nil" then error(("Usage: NewModule(name, [prototype, [lib, lib, lib, ...]): 'prototype' - table (prototype), string (lib) or nil expected got '%s'."):format(type(prototype)), 2) end + + if self.modules[name] then error(("Usage: NewModule(name, [prototype, [lib, lib, lib, ...]): 'name' - Module '%s' already exists."):format(name), 2) end + + -- modules are basically addons. We treat them as such. They will be added to the initializequeue properly as well. + -- NewModule can only be called after the parent addon is present thus the modules will be initialized after their parent is. + local module = AceAddon:NewAddon(fmt("%s_%s", self.name or tostring(self), name)) + + module.IsModule = IsModuleTrue + module:SetEnabledState(self.defaultModuleState) + module.moduleName = name + + if type(prototype) == "string" then + AceAddon:EmbedLibraries(module, prototype, ...) + else + AceAddon:EmbedLibraries(module, ...) + end + AceAddon:EmbedLibraries(module, unpack(self.defaultModuleLibraries)) + + if not prototype or type(prototype) == "string" then + prototype = self.defaultModulePrototype or nil + end + + if type(prototype) == "table" then + local mt = getmetatable(module) + mt.__index = prototype + setmetatable(module, mt) -- More of a Base class type feel. + end + + safecall(self.OnModuleCreated, self, module) -- Was in Ace2 and I think it could be a cool thing to have handy. + self.modules[name] = module + tinsert(self.orderedModules, module) + + return module +end + +--- Returns the real name of the addon or module, without any prefix. +-- @name //addon//:GetName +-- @paramsig +-- @usage +-- print(MyAddon:GetName()) +-- -- prints "MyAddon" +function GetName(self) + return self.moduleName or self.name +end + +--- Enables the Addon, if possible, return true or false depending on success. +-- This internally calls AceAddon:EnableAddon(), thus dispatching a OnEnable callback +-- and enabling all modules of the addon (unless explicitly disabled).\\ +-- :Enable() also sets the internal `enableState` variable to true +-- @name //addon//:Enable +-- @paramsig +-- @usage +-- -- Enable MyModule +-- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") +-- MyModule = MyAddon:GetModule("MyModule") +-- MyModule:Enable() +function Enable(self) + self:SetEnabledState(true) + + -- nevcairiel 2013-04-27: don't enable an addon/module if its queued for init still + -- it'll be enabled after the init process + if not queuedForInitialization(self) then + return AceAddon:EnableAddon(self) + end +end + +--- Disables the Addon, if possible, return true or false depending on success. +-- This internally calls AceAddon:DisableAddon(), thus dispatching a OnDisable callback +-- and disabling all modules of the addon.\\ +-- :Disable() also sets the internal `enableState` variable to false +-- @name //addon//:Disable +-- @paramsig +-- @usage +-- -- Disable MyAddon +-- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") +-- MyAddon:Disable() +function Disable(self) + self:SetEnabledState(false) + return AceAddon:DisableAddon(self) +end + +--- Enables the Module, if possible, return true or false depending on success. +-- Short-hand function that retrieves the module via `:GetModule` and calls `:Enable` on the module object. +-- @name //addon//:EnableModule +-- @paramsig name +-- @usage +-- -- Enable MyModule using :GetModule +-- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") +-- MyModule = MyAddon:GetModule("MyModule") +-- MyModule:Enable() +-- +-- -- Enable MyModule using the short-hand +-- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") +-- MyAddon:EnableModule("MyModule") +function EnableModule(self, name) + local module = self:GetModule( name ) + return module:Enable() +end + +--- Disables the Module, if possible, return true or false depending on success. +-- Short-hand function that retrieves the module via `:GetModule` and calls `:Disable` on the module object. +-- @name //addon//:DisableModule +-- @paramsig name +-- @usage +-- -- Disable MyModule using :GetModule +-- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") +-- MyModule = MyAddon:GetModule("MyModule") +-- MyModule:Disable() +-- +-- -- Disable MyModule using the short-hand +-- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") +-- MyAddon:DisableModule("MyModule") +function DisableModule(self, name) + local module = self:GetModule( name ) + return module:Disable() +end + +--- Set the default libraries to be mixed into all modules created by this object. +-- Note that you can only change the default module libraries before any module is created. +-- @name //addon//:SetDefaultModuleLibraries +-- @paramsig lib[, lib, ...] +-- @param lib List of libraries to embed into the addon +-- @usage +-- -- Create the addon object +-- MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon") +-- -- Configure default libraries for modules (all modules need AceEvent-3.0) +-- MyAddon:SetDefaultModuleLibraries("AceEvent-3.0") +-- -- Create a module +-- MyModule = MyAddon:NewModule("MyModule") +function SetDefaultModuleLibraries(self, ...) + if next(self.modules) then + error("Usage: SetDefaultModuleLibraries(...): cannot change the module defaults after a module has been registered.", 2) + end + self.defaultModuleLibraries = {...} +end + +--- Set the default state in which new modules are being created. +-- Note that you can only change the default state before any module is created. +-- @name //addon//:SetDefaultModuleState +-- @paramsig state +-- @param state Default state for new modules, true for enabled, false for disabled +-- @usage +-- -- Create the addon object +-- MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon") +-- -- Set the default state to "disabled" +-- MyAddon:SetDefaultModuleState(false) +-- -- Create a module and explicilty enable it +-- MyModule = MyAddon:NewModule("MyModule") +-- MyModule:Enable() +function SetDefaultModuleState(self, state) + if next(self.modules) then + error("Usage: SetDefaultModuleState(state): cannot change the module defaults after a module has been registered.", 2) + end + self.defaultModuleState = state +end + +--- Set the default prototype to use for new modules on creation. +-- Note that you can only change the default prototype before any module is created. +-- @name //addon//:SetDefaultModulePrototype +-- @paramsig prototype +-- @param prototype Default prototype for the new modules (table) +-- @usage +-- -- Define a prototype +-- local prototype = { OnEnable = function(self) print("OnEnable called!") end } +-- -- Set the default prototype +-- MyAddon:SetDefaultModulePrototype(prototype) +-- -- Create a module and explicitly Enable it +-- MyModule = MyAddon:NewModule("MyModule") +-- MyModule:Enable() +-- -- should print "OnEnable called!" now +-- @see NewModule +function SetDefaultModulePrototype(self, prototype) + if next(self.modules) then + error("Usage: SetDefaultModulePrototype(prototype): cannot change the module defaults after a module has been registered.", 2) + end + if type(prototype) ~= "table" then + error(("Usage: SetDefaultModulePrototype(prototype): 'prototype' - table expected got '%s'."):format(type(prototype)), 2) + end + self.defaultModulePrototype = prototype +end + +--- Set the state of an addon or module +-- This should only be called before any enabling actually happend, e.g. in/before OnInitialize. +-- @name //addon//:SetEnabledState +-- @paramsig state +-- @param state the state of an addon or module (enabled=true, disabled=false) +function SetEnabledState(self, state) + self.enabledState = state +end + + +--- Return an iterator of all modules associated to the addon. +-- @name //addon//:IterateModules +-- @paramsig +-- @usage +-- -- Enable all modules +-- for name, module in MyAddon:IterateModules() do +-- module:Enable() +-- end +local function IterateModules(self) return pairs(self.modules) end + +-- Returns an iterator of all embeds in the addon +-- @name //addon//:IterateEmbeds +-- @paramsig +local function IterateEmbeds(self) return pairs(AceAddon.embeds[self]) end + +--- Query the enabledState of an addon. +-- @name //addon//:IsEnabled +-- @paramsig +-- @usage +-- if MyAddon:IsEnabled() then +-- MyAddon:Disable() +-- end +local function IsEnabled(self) return self.enabledState end +local mixins = { + NewModule = NewModule, + GetModule = GetModule, + Enable = Enable, + Disable = Disable, + EnableModule = EnableModule, + DisableModule = DisableModule, + IsEnabled = IsEnabled, + SetDefaultModuleLibraries = SetDefaultModuleLibraries, + SetDefaultModuleState = SetDefaultModuleState, + SetDefaultModulePrototype = SetDefaultModulePrototype, + SetEnabledState = SetEnabledState, + IterateModules = IterateModules, + IterateEmbeds = IterateEmbeds, + GetName = GetName, +} +local function IsModule(self) return false end +local pmixins = { + defaultModuleState = true, + enabledState = true, + IsModule = IsModule, +} +-- Embed( target ) +-- target (object) - target object to embed aceaddon in +-- +-- this is a local function specifically since it's meant to be only called internally +function Embed(target, skipPMixins) + for k, v in pairs(mixins) do + target[k] = v + end + if not skipPMixins then + for k, v in pairs(pmixins) do + target[k] = target[k] or v + end + end +end + + +-- - Initialize the addon after creation. +-- This function is only used internally during the ADDON_LOADED event +-- It will call the **OnInitialize** function on the addon object (if present), +-- and the **OnEmbedInitialize** function on all embeded libraries. +-- +-- **Note:** Do not call this function manually, unless you're absolutely sure that you know what you are doing. +-- @param addon addon object to intialize +function AceAddon:InitializeAddon(addon) + safecall(addon.OnInitialize, addon) + + local embeds = self.embeds[addon] + for i = 1, #embeds do + local lib = LibStub:GetLibrary(embeds[i], true) + if lib then safecall(lib.OnEmbedInitialize, lib, addon) end + end + + -- we don't call InitializeAddon on modules specifically, this is handled + -- from the event handler and only done _once_ +end + +-- - Enable the addon after creation. +-- Note: This function is only used internally during the PLAYER_LOGIN event, or during ADDON_LOADED, +-- if IsLoggedIn() already returns true at that point, e.g. for LoD Addons. +-- It will call the **OnEnable** function on the addon object (if present), +-- and the **OnEmbedEnable** function on all embeded libraries.\\ +-- This function does not toggle the enable state of the addon itself, and will return early if the addon is disabled. +-- +-- **Note:** Do not call this function manually, unless you're absolutely sure that you know what you are doing. +-- Use :Enable on the addon itself instead. +-- @param addon addon object to enable +function AceAddon:EnableAddon(addon) + if type(addon) == "string" then addon = AceAddon:GetAddon(addon) end + if self.statuses[addon.name] or not addon.enabledState then return false end + + -- set the statuses first, before calling the OnEnable. this allows for Disabling of the addon in OnEnable. + self.statuses[addon.name] = true + + safecall(addon.OnEnable, addon) + + -- make sure we're still enabled before continueing + if self.statuses[addon.name] then + local embeds = self.embeds[addon] + for i = 1, #embeds do + local lib = LibStub:GetLibrary(embeds[i], true) + if lib then safecall(lib.OnEmbedEnable, lib, addon) end + end + + -- enable possible modules. + local modules = addon.orderedModules + for i = 1, #modules do + self:EnableAddon(modules[i]) + end + end + return self.statuses[addon.name] -- return true if we're disabled +end + +-- - Disable the addon +-- Note: This function is only used internally. +-- It will call the **OnDisable** function on the addon object (if present), +-- and the **OnEmbedDisable** function on all embeded libraries.\\ +-- This function does not toggle the enable state of the addon itself, and will return early if the addon is still enabled. +-- +-- **Note:** Do not call this function manually, unless you're absolutely sure that you know what you are doing. +-- Use :Disable on the addon itself instead. +-- @param addon addon object to enable +function AceAddon:DisableAddon(addon) + if type(addon) == "string" then addon = AceAddon:GetAddon(addon) end + if not self.statuses[addon.name] then return false end + + -- set statuses first before calling OnDisable, this allows for aborting the disable in OnDisable. + self.statuses[addon.name] = false + + safecall( addon.OnDisable, addon ) + + -- make sure we're still disabling... + if not self.statuses[addon.name] then + local embeds = self.embeds[addon] + for i = 1, #embeds do + local lib = LibStub:GetLibrary(embeds[i], true) + if lib then safecall(lib.OnEmbedDisable, lib, addon) end + end + -- disable possible modules. + local modules = addon.orderedModules + for i = 1, #modules do + self:DisableAddon(modules[i]) + end + end + + return not self.statuses[addon.name] -- return true if we're disabled +end + +--- Get an iterator over all registered addons. +-- @usage +-- -- Print a list of all installed AceAddon's +-- for name, addon in AceAddon:IterateAddons() do +-- print("Addon: " .. name) +-- end +function AceAddon:IterateAddons() return pairs(self.addons) end + +--- Get an iterator over the internal status registry. +-- @usage +-- -- Print a list of all enabled addons +-- for name, status in AceAddon:IterateAddonStatus() do +-- if status then +-- print("EnabledAddon: " .. name) +-- end +-- end +function AceAddon:IterateAddonStatus() return pairs(self.statuses) end + +-- Following Iterators are deprecated, and their addon specific versions should be used +-- e.g. addon:IterateEmbeds() instead of :IterateEmbedsOnAddon(addon) +function AceAddon:IterateEmbedsOnAddon(addon) return pairs(self.embeds[addon]) end +function AceAddon:IterateModulesOfAddon(addon) return pairs(addon.modules) end + +-- Event Handling +local function onEvent(this, event, arg1) + -- 2011-08-17 nevcairiel - ignore the load event of Blizzard_DebugTools, so a potential startup error isn't swallowed up + if (event == "ADDON_LOADED" and arg1 ~= "Blizzard_DebugTools") or event == "PLAYER_LOGIN" then + -- if a addon loads another addon, recursion could happen here, so we need to validate the table on every iteration + while(#AceAddon.initializequeue > 0) do + local addon = tremove(AceAddon.initializequeue, 1) + -- this might be an issue with recursion - TODO: validate + if event == "ADDON_LOADED" then addon.baseName = arg1 end + AceAddon:InitializeAddon(addon) + tinsert(AceAddon.enablequeue, addon) + end + + if IsLoggedIn() then + while(#AceAddon.enablequeue > 0) do + local addon = tremove(AceAddon.enablequeue, 1) + AceAddon:EnableAddon(addon) + end + end + end +end + +AceAddon.frame:RegisterEvent("ADDON_LOADED") +AceAddon.frame:RegisterEvent("PLAYER_LOGIN") +AceAddon.frame:SetScript("OnEvent", onEvent) + +-- upgrade embeded +for name, addon in pairs(AceAddon.addons) do + Embed(addon, true) +end + +-- 2010-10-27 nevcairiel - add new "orderedModules" table +if oldminor and oldminor < 10 then + for name, addon in pairs(AceAddon.addons) do + addon.orderedModules = {} + for module_name, module in pairs(addon.modules) do + tinsert(addon.orderedModules, module) + end + end +end diff --git a/AuraSpy/target/sources/Libs/AceAddon-3.0/AceAddon-3.0.xml b/AuraSpy/target/sources/Libs/AceAddon-3.0/AceAddon-3.0.xml new file mode 100644 index 0000000..dcf24c7 --- /dev/null +++ b/AuraSpy/target/sources/Libs/AceAddon-3.0/AceAddon-3.0.xml @@ -0,0 +1,4 @@ + +