From a7214e07237d576033ca324a89570d51a84cc636 Mon Sep 17 00:00:00 2001 From: urnati Date: Sun, 26 Nov 2023 12:36:29 -0500 Subject: [PATCH] - TOC update tp 8.00.00 - COMBINED release of retail, Classic WOTLK, and Classic Era --- Titan/Titan.lua | 146 +- Titan/Titan.toc | 51 - Titan/TitanAutoHide.lua | 2 +- Titan/TitanConfig.lua | 193 +- Titan/TitanGame.lua | 8 + Titan/TitanGlobal.lua | 5 +- Titan/TitanMovable.lua | 694 +++++- Titan/TitanUtils.lua | 414 +++- Titan/TitanVariables.lua | 115 +- Titan/Titan_Mainline.toc | 53 + .../!LibUIDropDownMenu/!LibUIDropDownMenu-BCC.toc | 12 + .../!LibUIDropDownMenu-Classic.toc | 12 + .../!LibUIDropDownMenu-WOTLKC.toc | 12 + .../Ace/!LibUIDropDownMenu/!LibUIDropDownMenu.toc | 12 + Titan/libs/Ace/!LibUIDropDownMenu/Docs/Readme.txt | 178 ++ .../libs/Ace/!LibUIDropDownMenu/Docs/Revision.txt | 243 ++ .../Ace/!LibUIDropDownMenu/LibStub/LibStub.lua | 51 + .../Ace/!LibUIDropDownMenu/LibStub/LibStub.toc | 9 + .../Ace/!LibUIDropDownMenu/LibStub/tests/test.lua | 41 + .../Ace/!LibUIDropDownMenu/LibStub/tests/test2.lua | 27 + .../Ace/!LibUIDropDownMenu/LibStub/tests/test3.lua | 14 + .../Ace/!LibUIDropDownMenu/LibStub/tests/test4.lua | 41 + .../LibUIDropDownMenu/LibEasyMenu.lua | 44 + .../LibUIDropDownMenu/LibUIDropDownMenu.lua | 2328 ++++++++++++++++++++ .../LibUIDropDownMenu/LibUIDropDownMenu.xml | 24 + Titan/license.txt | 2 +- Titan/locale/Localization.BR.lua | 4 +- Titan/locale/Localization.CN.lua | 12 +- Titan/locale/Localization.DE.lua | 20 +- Titan/locale/Localization.ES.lua | 10 +- Titan/locale/Localization.FR.lua | 10 +- Titan/locale/Localization.IT.lua | 4 +- Titan/locale/Localization.KR.lua | 4 +- Titan/locale/Localization.MX.lua | 10 +- Titan/locale/Localization.RU.lua | 13 +- Titan/locale/Localization.TW.lua | 10 +- Titan/locale/Localization.lua | 78 +- TitanAmmo/TitanAmmo_Vanilla.toc | 10 + TitanAmmo/TitanAmmo_Wrath.toc | 10 + TitanAmmo/TitanClassicAmmo.lua | 357 +++ TitanAmmo/TitanClassicAmmo.xml | 16 + TitanAmmo/TitanClassicAmmo_CE.lua | 339 +++ TitanAmmo/TitanClassicAmmo_CE.xml | 16 + TitanAmmo/TitanClassicThrown.tga | Bin 0 -> 16428 bytes TitanBag/TitanBag.lua | 2 +- TitanBag/TitanBag.toc | 8 +- TitanBag/TitanBag_Mainline.toc | 10 + TitanBag/TitanBag_Vanilla.toc | 10 + TitanBag/TitanBag_Wrath.toc | 10 + TitanClassic/TitanClassic_Vanilla.toc | 57 + TitanClassic/TitanClassic_Wrath.toc | 57 + TitanClassic/TitanGame.lua | 8 + .../AllBlack Skin/TitanPanelBackgroundBottom0.tga | Bin 0 -> 338 bytes .../AllBlack Skin/TitanPanelBackgroundTop0.tga | Bin 0 -> 338 bytes .../TitanPanelBackgroundBottom0.pdf | Bin 0 -> 1970 bytes .../TitanPanelBackgroundBottom0.tga | Bin 0 -> 338 bytes .../BlackPlusOne Skin/TitanPanelBackgroundTop0.tga | Bin 0 -> 338 bytes .../Charcoal Metal/TitanPanelBackgroundBottom0.blp | Bin 0 -> 12196 bytes .../Charcoal Metal/TitanPanelBackgroundTop0.blp | Bin 0 -> 12196 bytes .../Christmas Skin/TitanPanelBackgroundBottom0.blp | Bin 0 -> 12196 bytes .../Christmas Skin/TitanPanelBackgroundTop0.blp | Bin 0 -> 12196 bytes .../Crusader Skin/TitanPanelBackgroundBottom0.blp | Bin 0 -> 12196 bytes .../Crusader Skin/TitanPanelBackgroundTop0.blp | Bin 0 -> 12196 bytes .../TitanPanelBackgroundBottom0.blp | Bin 0 -> 12196 bytes .../TitanPanelBackgroundTop0.blp | Bin 0 -> 12196 bytes .../Dark Wood Skin/TitanPanelBackgroundBottom0.blp | Bin 0 -> 6684 bytes .../Dark Wood Skin/TitanPanelBackgroundTop0.blp | Bin 0 -> 6684 bytes .../Deep Cave Skin/TitanPanelBackgroundBottom0.blp | Bin 0 -> 6684 bytes .../Deep Cave Skin/TitanPanelBackgroundTop0.blp | Bin 0 -> 6684 bytes .../Elfwood Skin/TitanPanelBackgroundBottom0.blp | Bin 0 -> 12196 bytes .../Elfwood Skin/TitanPanelBackgroundTop0.blp | Bin 0 -> 12196 bytes .../Engineer Skin/TitanPanelBackgroundBottom0.blp | Bin 0 -> 12196 bytes .../Engineer Skin/TitanPanelBackgroundTop0.blp | Bin 0 -> 12196 bytes .../TitanPanelBackgroundBottom0.blp | Bin 0 -> 12196 bytes .../Frozen Metal Skin/TitanPanelBackgroundTop0.blp | Bin 0 -> 12196 bytes .../Graphic Skin/TitanPanelBackgroundBottom0.blp | Bin 0 -> 12196 bytes .../Graphic Skin/TitanPanelBackgroundTop0.blp | Bin 0 -> 12196 bytes .../Graveyard Skin/TitanPanelBackgroundBottom0.blp | Bin 0 -> 12196 bytes .../Graveyard Skin/TitanPanelBackgroundTop0.blp | Bin 0 -> 12196 bytes .../TitanPanelBackgroundBottom0.blp | Bin 0 -> 12196 bytes .../Hidden Leaf Skin/TitanPanelBackgroundTop0.blp | Bin 0 -> 12196 bytes .../TitanPanelBackgroundBottom0.blp | Bin 0 -> 12196 bytes .../Holy Warrior Skin/TitanPanelBackgroundTop0.blp | Bin 0 -> 12196 bytes .../Nightlife Skin/TitanPanelBackgroundBottom0.blp | Bin 0 -> 12196 bytes .../Nightlife Skin/TitanPanelBackgroundTop0.blp | Bin 0 -> 12196 bytes .../Orgrimmar Skin/TitanPanelBackgroundBottom0.blp | Bin 0 -> 12196 bytes .../Orgrimmar Skin/TitanPanelBackgroundTop0.blp | Bin 0 -> 12196 bytes .../Plate Skin/TitanPanelBackgroundBottom0.blp | Bin 0 -> 12196 bytes .../Custom/Plate Skin/TitanPanelBackgroundTop0.blp | Bin 0 -> 12196 bytes .../Tribal Skin/TitanPanelBackgroundBottom0.blp | Bin 0 -> 12196 bytes .../Tribal Skin/TitanPanelBackgroundTop0.blp | Bin 0 -> 12196 bytes .../Custom/X-Perl/TitanPanelBackgroundBottom0.tga | Bin 0 -> 2623 bytes .../Custom/X-Perl/TitanPanelBackgroundTop0.tga | Bin 0 -> 2623 bytes .../save/Artwork/TitanPanelBackgroundBottom0.tga | Bin 0 -> 32812 bytes .../save/Artwork/TitanPanelBackgroundTop0.tga | Bin 0 -> 32812 bytes TitanClassic/save/Artwork/TitanPanelPushpinIn.tga | Bin 0 -> 1068 bytes TitanClassic/save/Artwork/TitanPanelPushpinOut.tga | Bin 0 -> 1068 bytes TitanClassic/save/LibDataBroker-1.1.lua | 90 + .../!LibUIDropDownMenu/!LibUIDropDownMenu-BCC.toc | 12 + .../!LibUIDropDownMenu-Classic.toc | 12 + .../!LibUIDropDownMenu-WOTLKC.toc | 12 + .../!LibUIDropDownMenu/!LibUIDropDownMenu.toc | 12 + .../libs-old/!LibUIDropDownMenu/Docs/Readme.txt | 178 ++ .../libs-old/!LibUIDropDownMenu/Docs/Revision.txt | 243 ++ .../!LibUIDropDownMenu/LibStub/LibStub.lua | 51 + .../!LibUIDropDownMenu/LibStub/LibStub.toc | 9 + .../!LibUIDropDownMenu/LibStub/tests/test.lua | 41 + .../!LibUIDropDownMenu/LibStub/tests/test2.lua | 27 + .../!LibUIDropDownMenu/LibStub/tests/test3.lua | 14 + .../!LibUIDropDownMenu/LibStub/tests/test4.lua | 41 + .../LibUIDropDownMenu/LibEasyMenu.lua | 44 + .../LibUIDropDownMenu/LibUIDropDownMenu.lua | 2328 ++++++++++++++++++++ .../LibUIDropDownMenu/LibUIDropDownMenu.xml | 24 + TitanClassic/save/libs-old/Ace3.lua | 110 + TitanClassic/save/libs-old/Ace3.toc | 28 + TitanClassic/save/libs-old/Ace3_TBC.toc | 28 + TitanClassic/save/libs-old/Ace3_Vanilla.toc | 28 + TitanClassic/save/libs-old/Ace3_Wrath.toc | 28 + .../save/libs-old/AceAddon-3.0/AceAddon-3.0.lua | 649 ++++++ .../save/libs-old/AceAddon-3.0/AceAddon-3.0.xml | 4 + .../save/libs-old/AceConfig-3.0/AceConfig-3.0.lua | 58 + .../save/libs-old/AceConfig-3.0/AceConfig-3.0.xml | 8 + .../AceConfigCmd-3.0/AceConfigCmd-3.0.lua | 787 +++++++ .../AceConfigCmd-3.0/AceConfigCmd-3.0.xml | 4 + .../AceConfigDialog-3.0/AceConfigDialog-3.0.lua | 2028 +++++++++++++++++ .../AceConfigDialog-3.0/AceConfigDialog-3.0.xml | 4 + .../AceConfigRegistry-3.0.lua | 372 ++++ .../AceConfigRegistry-3.0.xml | 4 + .../libs-old/AceGUI-3.0-SharedMediaWidgets.toc | 20 + .../BackgroundWidget.lua | 235 ++ .../AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua | 230 ++ .../AceGUI-3.0-SharedMediaWidgets/FontWidget.lua | 216 ++ .../AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua | 264 +++ .../StatusbarWidget.lua | 233 ++ .../AceGUI-3.0-SharedMediaWidgets/prototypes.lua | 273 +++ .../AceGUI-3.0-SharedMediaWidgets/widget.xml | 9 + .../save/libs-old/AceGUI-3.0/AceGUI-3.0.lua | 1020 +++++++++ .../save/libs-old/AceGUI-3.0/AceGUI-3.0.xml | 28 + .../widgets/AceGUIContainer-BlizOptionsGroup.lua | 143 ++ .../widgets/AceGUIContainer-DropDownGroup.lua | 157 ++ .../AceGUI-3.0/widgets/AceGUIContainer-Frame.lua | 318 +++ .../widgets/AceGUIContainer-InlineGroup.lua | 103 + .../widgets/AceGUIContainer-ScrollFrame.lua | 215 ++ .../widgets/AceGUIContainer-SimpleGroup.lua | 69 + .../widgets/AceGUIContainer-TabGroup.lua | 535 +++++ .../widgets/AceGUIContainer-TreeGroup.lua | 719 ++++++ .../AceGUI-3.0/widgets/AceGUIContainer-Window.lua | 336 +++ .../AceGUI-3.0/widgets/AceGUIWidget-Button.lua | 103 + .../AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua | 292 +++ .../widgets/AceGUIWidget-ColorPicker.lua | 186 ++ .../widgets/AceGUIWidget-DropDown-Items.lua | 471 ++++ .../AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua | 732 ++++++ .../AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua | 259 +++ .../AceGUI-3.0/widgets/AceGUIWidget-Heading.lua | 78 + .../AceGUI-3.0/widgets/AceGUIWidget-Icon.lua | 140 ++ .../widgets/AceGUIWidget-InteractiveLabel.lua | 94 + .../AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua | 245 ++ .../AceGUI-3.0/widgets/AceGUIWidget-Label.lua | 179 ++ .../widgets/AceGUIWidget-MultiLineEditBox.lua | 369 ++++ .../AceGUI-3.0/widgets/AceGUIWidget-Slider.lua | 280 +++ .../save/libs-old/AceHook-3.0/AceHook-3.0.lua | 510 +++++ .../save/libs-old/AceHook-3.0/AceHook-3.0.xml | 4 + .../save/libs-old/AceLocale-3.0/AceLocale-3.0.lua | 133 ++ .../save/libs-old/AceLocale-3.0/AceLocale-3.0.xml | 4 + .../save/libs-old/AceTimer-3.0/AceTimer-3.0.lua | 278 +++ .../save/libs-old/AceTimer-3.0/AceTimer-3.0.xml | 4 + TitanClassic/save/libs-old/Bindings.xml | 5 + TitanClassic/save/libs-old/CHANGES.txt | 109 + .../CallbackHandler-1.0/CallbackHandler-1.0.lua | 202 ++ .../CallbackHandler-1.0/CallbackHandler-1.0.xml | 4 + .../save/libs-old/Changelog-Ace3-Release-r1151.txt | 92 + ...g-AceGUI-3.0-SharedMediaWidgets-r57-release.txt | 27 + TitanClassic/save/libs-old/LICENSE.txt | 29 + TitanClassic/save/libs-old/LibQTip-1.0/CHANGES.txt | 21 + TitanClassic/save/libs-old/LibQTip-1.0/LICENSE.txt | 29 + .../save/libs-old/LibQTip-1.0/LibQTip-1.0.lua | 1529 +++++++++++++ .../save/libs-old/LibQTip-1.0/LibQTip-1.0.toc | 14 + .../save/libs-old/LibQTip-1.0/LibStub/LibStub.lua | 51 + TitanClassic/save/libs-old/LibQTip-1.0/lib.xml | 4 + .../save/libs-old/LibSharedMedia-3.0/CHANGES.txt | 8 + .../Changelog-LibSharedMedia-3.0-7.0.3.txt | 13 + .../LibSharedMedia-3.0/LibSharedMedia-3.0.lua | 292 +++ .../LibSharedMedia-3.0/LibSharedMedia-3.0.toc | 18 + .../save/libs-old/LibSharedMedia-3.0/lib.xml | 4 + TitanClassic/save/libs-old/LibStub/LibStub.lua | 30 + .../save/libs-old/Libs/AceGUI-3.0/AceGUI-3.0.lua | 1020 +++++++++ .../save/libs-old/Libs/AceGUI-3.0/AceGUI-3.0.xml | 28 + .../widgets/AceGUIContainer-BlizOptionsGroup.lua | 143 ++ .../widgets/AceGUIContainer-DropDownGroup.lua | 157 ++ .../AceGUI-3.0/widgets/AceGUIContainer-Frame.lua | 318 +++ .../widgets/AceGUIContainer-InlineGroup.lua | 103 + .../widgets/AceGUIContainer-ScrollFrame.lua | 215 ++ .../widgets/AceGUIContainer-SimpleGroup.lua | 69 + .../widgets/AceGUIContainer-TabGroup.lua | 535 +++++ .../widgets/AceGUIContainer-TreeGroup.lua | 719 ++++++ .../AceGUI-3.0/widgets/AceGUIContainer-Window.lua | 336 +++ .../AceGUI-3.0/widgets/AceGUIWidget-Button.lua | 103 + .../AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua | 292 +++ .../widgets/AceGUIWidget-ColorPicker.lua | 186 ++ .../widgets/AceGUIWidget-DropDown-Items.lua | 471 ++++ .../AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua | 732 ++++++ .../AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua | 259 +++ .../AceGUI-3.0/widgets/AceGUIWidget-Heading.lua | 78 + .../Libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua | 140 ++ .../widgets/AceGUIWidget-InteractiveLabel.lua | 94 + .../AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua | 245 ++ .../Libs/AceGUI-3.0/widgets/AceGUIWidget-Label.lua | 179 ++ .../widgets/AceGUIWidget-MultiLineEditBox.lua | 369 ++++ .../AceGUI-3.0/widgets/AceGUIWidget-Slider.lua | 280 +++ .../CallbackHandler-1.0/CallbackHandler-1.0.lua | 202 ++ .../CallbackHandler-1.0/CallbackHandler-1.0.xml | 4 + .../Libs/LibSharedMedia-3.0/LibSharedMedia-3.0.lua | 292 +++ .../save/libs-old/Libs/LibSharedMedia-3.0/lib.xml | 4 + .../save/libs-old/Libs/LibStub/LibStub.lua | 30 + TitanClassic/save/libs-old/README.md | 26 + TitanClassic/save/libs-old/changelog.txt | 463 ++++ TitanClassic/save/libs-old/lib.xml | 5 + TitanClassic/save/libs-old/widget.xml | 4 + .../!LibUIDropDownMenu/!LibUIDropDownMenu-BCC.toc | 12 + .../!LibUIDropDownMenu-Classic.toc | 12 + .../!LibUIDropDownMenu-WOTLKC.toc | 12 + .../Ace/!LibUIDropDownMenu/!LibUIDropDownMenu.toc | 12 + .../libs/Ace/!LibUIDropDownMenu/Docs/Readme.txt | 178 ++ .../libs/Ace/!LibUIDropDownMenu/Docs/Revision.txt | 243 ++ .../Ace/!LibUIDropDownMenu/LibStub/LibStub.lua | 51 + .../Ace/!LibUIDropDownMenu/LibStub/LibStub.toc | 9 + .../Ace/!LibUIDropDownMenu/LibStub/tests/test.lua | 41 + .../Ace/!LibUIDropDownMenu/LibStub/tests/test2.lua | 27 + .../Ace/!LibUIDropDownMenu/LibStub/tests/test3.lua | 14 + .../Ace/!LibUIDropDownMenu/LibStub/tests/test4.lua | 41 + .../LibUIDropDownMenu/LibEasyMenu.lua | 44 + .../LibUIDropDownMenu/LibUIDropDownMenu.lua | 2328 ++++++++++++++++++++ .../LibUIDropDownMenu/LibUIDropDownMenu.xml | 24 + TitanClassic/save/libs/Ace/Ace3.lua | 110 + TitanClassic/save/libs/Ace/Ace3.toc | 28 + .../save/libs/Ace/AceAddon-3.0/AceAddon-3.0.lua | 649 ++++++ .../save/libs/Ace/AceAddon-3.0/AceAddon-3.0.xml | 4 + .../save/libs/Ace/AceConfig-3.0/AceConfig-3.0.lua | 58 + .../save/libs/Ace/AceConfig-3.0/AceConfig-3.0.xml | 8 + .../AceConfigCmd-3.0/AceConfigCmd-3.0.lua | 787 +++++++ .../AceConfigCmd-3.0/AceConfigCmd-3.0.xml | 4 + .../AceConfigDialog-3.0/AceConfigDialog-3.0.lua | 2028 +++++++++++++++++ .../AceConfigDialog-3.0/AceConfigDialog-3.0.xml | 4 + .../AceConfigRegistry-3.0.lua | 372 ++++ .../AceConfigRegistry-3.0.xml | 4 + .../AceGUI-3.0-SharedMediaWidgets.toc | 16 + .../BackgroundWidget.lua | 235 ++ .../AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua | 230 ++ .../AceGUI-3.0-SharedMediaWidgets/FontWidget.lua | 216 ++ .../AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua | 264 +++ .../StatusbarWidget.lua | 233 ++ .../AceGUI-3.0-SharedMediaWidgets/prototypes.lua | 266 +++ .../AceGUI-3.0-SharedMediaWidgets/widget.xml | 9 + .../Ace/AceGUI-3.0-SharedMediaWidgets/CHANGES.txt | 12 + .../Libs/AceGUI-3.0/AceGUI-3.0.lua | 1026 +++++++++ .../Libs/AceGUI-3.0/AceGUI-3.0.xml | 28 + .../widgets/AceGUIContainer-BlizOptionsGroup.lua | 138 ++ .../widgets/AceGUIContainer-DropDownGroup.lua | 157 ++ .../AceGUI-3.0/widgets/AceGUIContainer-Frame.lua | 316 +++ .../widgets/AceGUIContainer-InlineGroup.lua | 103 + .../widgets/AceGUIContainer-ScrollFrame.lua | 215 ++ .../widgets/AceGUIContainer-SimpleGroup.lua | 69 + .../widgets/AceGUIContainer-TabGroup.lua | 349 +++ .../widgets/AceGUIContainer-TreeGroup.lua | 715 ++++++ .../AceGUI-3.0/widgets/AceGUIContainer-Window.lua | 336 +++ .../AceGUI-3.0/widgets/AceGUIWidget-Button.lua | 103 + .../AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua | 296 +++ .../widgets/AceGUIWidget-ColorPicker.lua | 190 ++ .../widgets/AceGUIWidget-DropDown-Items.lua | 471 ++++ .../AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua | 737 +++++++ .../AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua | 263 +++ .../AceGUI-3.0/widgets/AceGUIWidget-Heading.lua | 78 + .../Libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua | 140 ++ .../widgets/AceGUIWidget-InteractiveLabel.lua | 94 + .../AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua | 249 +++ .../Libs/AceGUI-3.0/widgets/AceGUIWidget-Label.lua | 179 ++ .../widgets/AceGUIWidget-MultiLineEditBox.lua | 366 +++ .../AceGUI-3.0/widgets/AceGUIWidget-Slider.lua | 284 +++ .../CallbackHandler-1.0/CallbackHandler-1.0.lua | 239 ++ .../CallbackHandler-1.0/CallbackHandler-1.0.xml | 4 + .../Libs/LibSharedMedia-3.0/LibSharedMedia-3.0.lua | 300 +++ .../Libs/LibSharedMedia-3.0/lib.xml | 4 + .../Libs/LibStub/LibStub.lua | 30 + .../Libs/LibStub/LibStub.toc | 9 + .../Ace/AceGUI-3.0-SharedMediaWidgets/widget.xml | 4 + .../save/libs/Ace/AceGUI-3.0/AceGUI-3.0.lua | 1020 +++++++++ .../save/libs/Ace/AceGUI-3.0/AceGUI-3.0.xml | 28 + .../widgets/AceGUIContainer-BlizOptionsGroup.lua | 143 ++ .../widgets/AceGUIContainer-DropDownGroup.lua | 157 ++ .../AceGUI-3.0/widgets/AceGUIContainer-Frame.lua | 318 +++ .../widgets/AceGUIContainer-InlineGroup.lua | 103 + .../widgets/AceGUIContainer-ScrollFrame.lua | 215 ++ .../widgets/AceGUIContainer-SimpleGroup.lua | 69 + .../widgets/AceGUIContainer-TabGroup.lua | 535 +++++ .../widgets/AceGUIContainer-TreeGroup.lua | 719 ++++++ .../AceGUI-3.0/widgets/AceGUIContainer-Window.lua | 336 +++ .../Ace/AceGUI-3.0/widgets/AceGUIWidget-Button.lua | 103 + .../AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua | 292 +++ .../widgets/AceGUIWidget-ColorPicker.lua | 186 ++ .../widgets/AceGUIWidget-DropDown-Items.lua | 471 ++++ .../AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua | 732 ++++++ .../AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua | 259 +++ .../AceGUI-3.0/widgets/AceGUIWidget-Heading.lua | 78 + .../Ace/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua | 140 ++ .../widgets/AceGUIWidget-InteractiveLabel.lua | 94 + .../AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua | 245 ++ .../Ace/AceGUI-3.0/widgets/AceGUIWidget-Label.lua | 179 ++ .../widgets/AceGUIWidget-MultiLineEditBox.lua | 369 ++++ .../Ace/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua | 280 +++ .../save/libs/Ace/AceHook-3.0/AceHook-3.0.lua | 510 +++++ .../save/libs/Ace/AceHook-3.0/AceHook-3.0.xml | 4 + .../save/libs/Ace/AceLocale-3.0/AceLocale-3.0.lua | 133 ++ .../save/libs/Ace/AceLocale-3.0/AceLocale-3.0.xml | 4 + .../save/libs/Ace/AceTimer-3.0/AceTimer-3.0.lua | 278 +++ .../save/libs/Ace/AceTimer-3.0/AceTimer-3.0.xml | 4 + TitanClassic/save/libs/Ace/Bindings.xml | 5 + TitanClassic/save/libs/Ace/CHANGES.txt | 109 + .../CallbackHandler-1.0/CallbackHandler-1.0.lua | 202 ++ .../CallbackHandler-1.0/CallbackHandler-1.0.xml | 4 + TitanClassic/save/libs/Ace/LICENSE.txt | 29 + TitanClassic/save/libs/Ace/LibQTip-1.0/CHANGES.txt | 10 + TitanClassic/save/libs/Ace/LibQTip-1.0/LICENSE.txt | 29 + .../save/libs/Ace/LibQTip-1.0/LibQTip-1.0.lua | 1551 +++++++++++++ .../save/libs/Ace/LibQTip-1.0/LibQTip-1.0.toc | 14 + .../save/libs/Ace/LibQTip-1.0/LibStub/LibStub.lua | 51 + TitanClassic/save/libs/Ace/LibQTip-1.0/lib.xml | 4 + .../save/libs/Ace/LibSharedMedia-3.0/CHANGES.txt | 29 + .../CallbackHandler-1.0/CallbackHandler-1.0.lua | 212 ++ .../Ace/LibSharedMedia-3.0/LibSharedMedia-3.0.toc | 18 + .../LibSharedMedia-3.0/LibSharedMedia-3.0.lua | 300 +++ .../LibSharedMedia-3.0/LibSharedMedia-3.0/lib.xml | 4 + .../Ace/LibSharedMedia-3.0/LibStub/LibStub.lua | 51 + .../save/libs/Ace/LibSharedMedia-3.0/lib.xml | 5 + TitanClassic/save/libs/Ace/LibStub/LibStub.lua | 30 + TitanClassic/save/libs/Ace/README.md | 26 + TitanClassic/save/libs/Ace/changelog.txt | 463 ++++ TitanClassic/save/libs/LibDataBroker-1.1.lua | 90 + TitanClassic/save/locale-old/Localization.BR.lua | 607 +++++ TitanClassic/save/locale-old/Localization.CN.lua | 607 +++++ TitanClassic/save/locale-old/Localization.DE.lua | 604 +++++ TitanClassic/save/locale-old/Localization.ES.lua | 621 ++++++ TitanClassic/save/locale-old/Localization.FR.lua | 604 +++++ TitanClassic/save/locale-old/Localization.IT.lua | 605 +++++ TitanClassic/save/locale-old/Localization.KR.lua | 606 +++++ TitanClassic/save/locale-old/Localization.MX.lua | 621 ++++++ TitanClassic/save/locale-old/Localization.RU.lua | 605 +++++ TitanClassic/save/locale-old/Localization.TW.lua | 604 +++++ TitanClassic/save/locale-old/Localization.lua | 614 ++++++ TitanClassic/save/locale/Localization.BR.lua | 560 +++++ TitanClassic/save/locale/Localization.CN.lua | 568 +++++ TitanClassic/save/locale/Localization.DE.lua | 572 +++++ TitanClassic/save/locale/Localization.ES.lua | 580 +++++ TitanClassic/save/locale/Localization.FR.lua | 563 +++++ TitanClassic/save/locale/Localization.IT.lua | 558 +++++ TitanClassic/save/locale/Localization.KR.lua | 559 +++++ TitanClassic/save/locale/Localization.MX.lua | 580 +++++ TitanClassic/save/locale/Localization.RU.lua | 567 +++++ TitanClassic/save/locale/Localization.TW.lua | 563 +++++ TitanClassic/save/locale/Localization.lua | 667 ++++++ TitanClock/TitanClock.lua | 12 +- TitanClock/TitanClock.toc | 8 +- TitanClock/TitanClock_Mainline.toc | 10 + TitanClock/TitanClock_Vanilla.toc | 10 + TitanClock/TitanClock_Wrath.toc | 10 + TitanGold/TitanGold.lua | 2 +- TitanGold/TitanGold.toc | 8 +- TitanGold/TitanGold_Mainline.toc | 10 + TitanGold/TitanGold_Vanilla.toc | 10 + TitanGold/TitanGold_Wrath.toc | 10 + TitanLocation/TitanLocation.lua | 129 +- TitanLocation/TitanLocation.toc | 8 +- TitanLocation/TitanLocation_Mainline.toc | 10 + TitanLocation/TitanLocation_Vanilla.toc | 10 + TitanLocation/TitanLocation_Wrath.toc | 10 + TitanLootType/TitanClassicLootType.lua | 1569 +++++++++++++ TitanLootType/TitanClassicLootType.xml | 264 +++ TitanLootType/TitanLootType.lua | 2 +- TitanLootType/TitanLootType_Mainline.toc | 10 + TitanLootType/TitanLootType_Vanilla.toc | 10 + TitanLootType/TitanLootType_Wrath.toc | 10 + TitanPerformance/TitanPerformance.lua | 68 +- TitanPerformance/TitanPerformance.toc | 8 +- TitanPerformance/TitanPerformance_Mainlnine.toc | 10 + TitanPerformance/TitanPerformance_Vanilla.toc | 10 + TitanPerformance/TitanPerformance_Wrath.toc | 10 + TitanRegen/TitanClassicRegen.lua | 316 +++ TitanRegen/TitanClassicRegen.xml | 19 + TitanRegen/TitanRegen_Vanilla.toc | 10 + TitanRegen/TitanRegen_Wrath.toc | 10 + TitanRepair/TitanRepair.lua | 178 +- TitanRepair/TitanRepair.toc | 8 +- TitanRepair/TitanRepair_Mainline.toc | 10 + TitanRepair/TitanRepair_Vanilla.toc | 10 + TitanRepair/TitanRepair_Wrath.toc | 10 + TitanVolume/TitanVolume.lua | 2 +- TitanVolume/TitanVolume.toc | 7 +- TitanVolume/TitanVolume_Mainline.toc | 11 + TitanVolume/TitanVolume_Vanilla.toc | 11 + TitanVolume/TitanVolume_Wrath.toc | 11 + TitanXP/TitanXP.lua | 2 +- TitanXP/TitanXP.toc | 8 +- TitanXP/TitanXP_Mainline.toc | 10 + TitanXP/TitanXP_Vanilla.toc | 10 + TitanXP/TitanXP_Wrath.toc | 10 + 404 files changed, 76146 insertions(+), 247 deletions(-) delete mode 100644 Titan/Titan.toc create mode 100644 Titan/TitanGame.lua create mode 100644 Titan/Titan_Mainline.toc create mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-BCC.toc create mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-Classic.toc create mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-WOTLKC.toc create mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu.toc create mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/Docs/Readme.txt create mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/Docs/Revision.txt create mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/LibStub/LibStub.lua create mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/LibStub/LibStub.toc create mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test.lua create mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test2.lua create mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test3.lua create mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test4.lua create mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibEasyMenu.lua create mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibUIDropDownMenu.lua create mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibUIDropDownMenu.xml create mode 100644 TitanAmmo/TitanAmmo_Vanilla.toc create mode 100644 TitanAmmo/TitanAmmo_Wrath.toc create mode 100644 TitanAmmo/TitanClassicAmmo.lua create mode 100644 TitanAmmo/TitanClassicAmmo.xml create mode 100644 TitanAmmo/TitanClassicAmmo_CE.lua create mode 100644 TitanAmmo/TitanClassicAmmo_CE.xml create mode 100644 TitanAmmo/TitanClassicThrown.tga create mode 100644 TitanBag/TitanBag_Mainline.toc create mode 100644 TitanBag/TitanBag_Vanilla.toc create mode 100644 TitanBag/TitanBag_Wrath.toc create mode 100644 TitanClassic/TitanClassic_Vanilla.toc create mode 100644 TitanClassic/TitanClassic_Wrath.toc create mode 100644 TitanClassic/TitanGame.lua create mode 100644 TitanClassic/save/Artwork/Custom/AllBlack Skin/TitanPanelBackgroundBottom0.tga create mode 100644 TitanClassic/save/Artwork/Custom/AllBlack Skin/TitanPanelBackgroundTop0.tga create mode 100644 TitanClassic/save/Artwork/Custom/BlackPlusOne Skin/TitanPanelBackgroundBottom0.pdf create mode 100644 TitanClassic/save/Artwork/Custom/BlackPlusOne Skin/TitanPanelBackgroundBottom0.tga create mode 100644 TitanClassic/save/Artwork/Custom/BlackPlusOne Skin/TitanPanelBackgroundTop0.tga create mode 100644 TitanClassic/save/Artwork/Custom/Charcoal Metal/TitanPanelBackgroundBottom0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Charcoal Metal/TitanPanelBackgroundTop0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Christmas Skin/TitanPanelBackgroundBottom0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Christmas Skin/TitanPanelBackgroundTop0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Crusader Skin/TitanPanelBackgroundBottom0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Crusader Skin/TitanPanelBackgroundTop0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Cursed Orange Skin/TitanPanelBackgroundBottom0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Cursed Orange Skin/TitanPanelBackgroundTop0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Dark Wood Skin/TitanPanelBackgroundBottom0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Dark Wood Skin/TitanPanelBackgroundTop0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Deep Cave Skin/TitanPanelBackgroundBottom0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Deep Cave Skin/TitanPanelBackgroundTop0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Elfwood Skin/TitanPanelBackgroundBottom0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Elfwood Skin/TitanPanelBackgroundTop0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Engineer Skin/TitanPanelBackgroundBottom0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Engineer Skin/TitanPanelBackgroundTop0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Frozen Metal Skin/TitanPanelBackgroundBottom0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Frozen Metal Skin/TitanPanelBackgroundTop0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Graphic Skin/TitanPanelBackgroundBottom0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Graphic Skin/TitanPanelBackgroundTop0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Graveyard Skin/TitanPanelBackgroundBottom0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Graveyard Skin/TitanPanelBackgroundTop0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Hidden Leaf Skin/TitanPanelBackgroundBottom0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Hidden Leaf Skin/TitanPanelBackgroundTop0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Holy Warrior Skin/TitanPanelBackgroundBottom0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Holy Warrior Skin/TitanPanelBackgroundTop0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Nightlife Skin/TitanPanelBackgroundBottom0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Nightlife Skin/TitanPanelBackgroundTop0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Orgrimmar Skin/TitanPanelBackgroundBottom0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Orgrimmar Skin/TitanPanelBackgroundTop0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Plate Skin/TitanPanelBackgroundBottom0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Plate Skin/TitanPanelBackgroundTop0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Tribal Skin/TitanPanelBackgroundBottom0.blp create mode 100644 TitanClassic/save/Artwork/Custom/Tribal Skin/TitanPanelBackgroundTop0.blp create mode 100644 TitanClassic/save/Artwork/Custom/X-Perl/TitanPanelBackgroundBottom0.tga create mode 100644 TitanClassic/save/Artwork/Custom/X-Perl/TitanPanelBackgroundTop0.tga create mode 100644 TitanClassic/save/Artwork/TitanPanelBackgroundBottom0.tga create mode 100644 TitanClassic/save/Artwork/TitanPanelBackgroundTop0.tga create mode 100644 TitanClassic/save/Artwork/TitanPanelPushpinIn.tga create mode 100644 TitanClassic/save/Artwork/TitanPanelPushpinOut.tga create mode 100644 TitanClassic/save/LibDataBroker-1.1.lua create mode 100644 TitanClassic/save/libs-old/!LibUIDropDownMenu/!LibUIDropDownMenu-BCC.toc create mode 100644 TitanClassic/save/libs-old/!LibUIDropDownMenu/!LibUIDropDownMenu-Classic.toc create mode 100644 TitanClassic/save/libs-old/!LibUIDropDownMenu/!LibUIDropDownMenu-WOTLKC.toc create mode 100644 TitanClassic/save/libs-old/!LibUIDropDownMenu/!LibUIDropDownMenu.toc create mode 100644 TitanClassic/save/libs-old/!LibUIDropDownMenu/Docs/Readme.txt create mode 100644 TitanClassic/save/libs-old/!LibUIDropDownMenu/Docs/Revision.txt create mode 100644 TitanClassic/save/libs-old/!LibUIDropDownMenu/LibStub/LibStub.lua create mode 100644 TitanClassic/save/libs-old/!LibUIDropDownMenu/LibStub/LibStub.toc create mode 100644 TitanClassic/save/libs-old/!LibUIDropDownMenu/LibStub/tests/test.lua create mode 100644 TitanClassic/save/libs-old/!LibUIDropDownMenu/LibStub/tests/test2.lua create mode 100644 TitanClassic/save/libs-old/!LibUIDropDownMenu/LibStub/tests/test3.lua create mode 100644 TitanClassic/save/libs-old/!LibUIDropDownMenu/LibStub/tests/test4.lua create mode 100644 TitanClassic/save/libs-old/!LibUIDropDownMenu/LibUIDropDownMenu/LibEasyMenu.lua create mode 100644 TitanClassic/save/libs-old/!LibUIDropDownMenu/LibUIDropDownMenu/LibUIDropDownMenu.lua create mode 100644 TitanClassic/save/libs-old/!LibUIDropDownMenu/LibUIDropDownMenu/LibUIDropDownMenu.xml create mode 100644 TitanClassic/save/libs-old/Ace3.lua create mode 100644 TitanClassic/save/libs-old/Ace3.toc create mode 100644 TitanClassic/save/libs-old/Ace3_TBC.toc create mode 100644 TitanClassic/save/libs-old/Ace3_Vanilla.toc create mode 100644 TitanClassic/save/libs-old/Ace3_Wrath.toc create mode 100644 TitanClassic/save/libs-old/AceAddon-3.0/AceAddon-3.0.lua create mode 100644 TitanClassic/save/libs-old/AceAddon-3.0/AceAddon-3.0.xml create mode 100644 TitanClassic/save/libs-old/AceConfig-3.0/AceConfig-3.0.lua create mode 100644 TitanClassic/save/libs-old/AceConfig-3.0/AceConfig-3.0.xml create mode 100644 TitanClassic/save/libs-old/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua create mode 100644 TitanClassic/save/libs-old/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.xml create mode 100644 TitanClassic/save/libs-old/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua create mode 100644 TitanClassic/save/libs-old/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.xml create mode 100644 TitanClassic/save/libs-old/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua create mode 100644 TitanClassic/save/libs-old/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.xml create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0-SharedMediaWidgets.toc create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0-SharedMediaWidgets/prototypes.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0-SharedMediaWidgets/widget.xml create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/AceGUI-3.0.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/AceGUI-3.0.xml create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIContainer-InlineGroup.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIContainer-SimpleGroup.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIContainer-Window.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIWidget-Button.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIWidget-Label.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua create mode 100644 TitanClassic/save/libs-old/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua create mode 100644 TitanClassic/save/libs-old/AceHook-3.0/AceHook-3.0.lua create mode 100644 TitanClassic/save/libs-old/AceHook-3.0/AceHook-3.0.xml create mode 100644 TitanClassic/save/libs-old/AceLocale-3.0/AceLocale-3.0.lua create mode 100644 TitanClassic/save/libs-old/AceLocale-3.0/AceLocale-3.0.xml create mode 100644 TitanClassic/save/libs-old/AceTimer-3.0/AceTimer-3.0.lua create mode 100644 TitanClassic/save/libs-old/AceTimer-3.0/AceTimer-3.0.xml create mode 100644 TitanClassic/save/libs-old/Bindings.xml create mode 100644 TitanClassic/save/libs-old/CHANGES.txt create mode 100644 TitanClassic/save/libs-old/CallbackHandler-1.0/CallbackHandler-1.0.lua create mode 100644 TitanClassic/save/libs-old/CallbackHandler-1.0/CallbackHandler-1.0.xml create mode 100644 TitanClassic/save/libs-old/Changelog-Ace3-Release-r1151.txt create mode 100644 TitanClassic/save/libs-old/Changelog-AceGUI-3.0-SharedMediaWidgets-r57-release.txt create mode 100644 TitanClassic/save/libs-old/LICENSE.txt create mode 100644 TitanClassic/save/libs-old/LibQTip-1.0/CHANGES.txt create mode 100644 TitanClassic/save/libs-old/LibQTip-1.0/LICENSE.txt create mode 100644 TitanClassic/save/libs-old/LibQTip-1.0/LibQTip-1.0.lua create mode 100644 TitanClassic/save/libs-old/LibQTip-1.0/LibQTip-1.0.toc create mode 100644 TitanClassic/save/libs-old/LibQTip-1.0/LibStub/LibStub.lua create mode 100644 TitanClassic/save/libs-old/LibQTip-1.0/lib.xml create mode 100644 TitanClassic/save/libs-old/LibSharedMedia-3.0/CHANGES.txt create mode 100644 TitanClassic/save/libs-old/LibSharedMedia-3.0/Changelog-LibSharedMedia-3.0-7.0.3.txt create mode 100644 TitanClassic/save/libs-old/LibSharedMedia-3.0/LibSharedMedia-3.0.lua create mode 100644 TitanClassic/save/libs-old/LibSharedMedia-3.0/LibSharedMedia-3.0.toc create mode 100644 TitanClassic/save/libs-old/LibSharedMedia-3.0/lib.xml create mode 100644 TitanClassic/save/libs-old/LibStub/LibStub.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/AceGUI-3.0.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/AceGUI-3.0.xml create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIContainer-InlineGroup.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIContainer-SimpleGroup.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIContainer-Window.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIWidget-Label.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua create mode 100644 TitanClassic/save/libs-old/Libs/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua create mode 100644 TitanClassic/save/libs-old/Libs/CallbackHandler-1.0/CallbackHandler-1.0.lua create mode 100644 TitanClassic/save/libs-old/Libs/CallbackHandler-1.0/CallbackHandler-1.0.xml create mode 100644 TitanClassic/save/libs-old/Libs/LibSharedMedia-3.0/LibSharedMedia-3.0.lua create mode 100644 TitanClassic/save/libs-old/Libs/LibSharedMedia-3.0/lib.xml create mode 100644 TitanClassic/save/libs-old/Libs/LibStub/LibStub.lua create mode 100644 TitanClassic/save/libs-old/README.md create mode 100644 TitanClassic/save/libs-old/changelog.txt create mode 100644 TitanClassic/save/libs-old/lib.xml create mode 100644 TitanClassic/save/libs-old/widget.xml create mode 100644 TitanClassic/save/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-BCC.toc create mode 100644 TitanClassic/save/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-Classic.toc create mode 100644 TitanClassic/save/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-WOTLKC.toc create mode 100644 TitanClassic/save/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu.toc create mode 100644 TitanClassic/save/libs/Ace/!LibUIDropDownMenu/Docs/Readme.txt create mode 100644 TitanClassic/save/libs/Ace/!LibUIDropDownMenu/Docs/Revision.txt create mode 100644 TitanClassic/save/libs/Ace/!LibUIDropDownMenu/LibStub/LibStub.lua create mode 100644 TitanClassic/save/libs/Ace/!LibUIDropDownMenu/LibStub/LibStub.toc create mode 100644 TitanClassic/save/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test.lua create mode 100644 TitanClassic/save/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test2.lua create mode 100644 TitanClassic/save/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test3.lua create mode 100644 TitanClassic/save/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test4.lua create mode 100644 TitanClassic/save/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibEasyMenu.lua create mode 100644 TitanClassic/save/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibUIDropDownMenu.lua create mode 100644 TitanClassic/save/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibUIDropDownMenu.xml create mode 100644 TitanClassic/save/libs/Ace/Ace3.lua create mode 100644 TitanClassic/save/libs/Ace/Ace3.toc create mode 100644 TitanClassic/save/libs/Ace/AceAddon-3.0/AceAddon-3.0.lua create mode 100644 TitanClassic/save/libs/Ace/AceAddon-3.0/AceAddon-3.0.xml create mode 100644 TitanClassic/save/libs/Ace/AceConfig-3.0/AceConfig-3.0.lua create mode 100644 TitanClassic/save/libs/Ace/AceConfig-3.0/AceConfig-3.0.xml create mode 100644 TitanClassic/save/libs/Ace/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua create mode 100644 TitanClassic/save/libs/Ace/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.xml create mode 100644 TitanClassic/save/libs/Ace/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua create mode 100644 TitanClassic/save/libs/Ace/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.xml create mode 100644 TitanClassic/save/libs/Ace/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua create mode 100644 TitanClassic/save/libs/Ace/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.xml create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets.toc create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/prototypes.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/widget.xml create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/CHANGES.txt create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/AceGUI-3.0.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/AceGUI-3.0.xml create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-InlineGroup.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-SimpleGroup.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-Window.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-Label.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/CallbackHandler-1.0/CallbackHandler-1.0.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/CallbackHandler-1.0/CallbackHandler-1.0.xml create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/LibSharedMedia-3.0/LibSharedMedia-3.0.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/LibSharedMedia-3.0/lib.xml create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/LibStub/LibStub.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/Libs/LibStub/LibStub.toc create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0-SharedMediaWidgets/widget.xml create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/AceGUI-3.0.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/AceGUI-3.0.xml create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIContainer-InlineGroup.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIContainer-SimpleGroup.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIContainer-Window.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-Button.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-Label.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua create mode 100644 TitanClassic/save/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua create mode 100644 TitanClassic/save/libs/Ace/AceHook-3.0/AceHook-3.0.lua create mode 100644 TitanClassic/save/libs/Ace/AceHook-3.0/AceHook-3.0.xml create mode 100644 TitanClassic/save/libs/Ace/AceLocale-3.0/AceLocale-3.0.lua create mode 100644 TitanClassic/save/libs/Ace/AceLocale-3.0/AceLocale-3.0.xml create mode 100644 TitanClassic/save/libs/Ace/AceTimer-3.0/AceTimer-3.0.lua create mode 100644 TitanClassic/save/libs/Ace/AceTimer-3.0/AceTimer-3.0.xml create mode 100644 TitanClassic/save/libs/Ace/Bindings.xml create mode 100644 TitanClassic/save/libs/Ace/CHANGES.txt create mode 100644 TitanClassic/save/libs/Ace/CallbackHandler-1.0/CallbackHandler-1.0.lua create mode 100644 TitanClassic/save/libs/Ace/CallbackHandler-1.0/CallbackHandler-1.0.xml create mode 100644 TitanClassic/save/libs/Ace/LICENSE.txt create mode 100644 TitanClassic/save/libs/Ace/LibQTip-1.0/CHANGES.txt create mode 100644 TitanClassic/save/libs/Ace/LibQTip-1.0/LICENSE.txt create mode 100644 TitanClassic/save/libs/Ace/LibQTip-1.0/LibQTip-1.0.lua create mode 100644 TitanClassic/save/libs/Ace/LibQTip-1.0/LibQTip-1.0.toc create mode 100644 TitanClassic/save/libs/Ace/LibQTip-1.0/LibStub/LibStub.lua create mode 100644 TitanClassic/save/libs/Ace/LibQTip-1.0/lib.xml create mode 100644 TitanClassic/save/libs/Ace/LibSharedMedia-3.0/CHANGES.txt create mode 100644 TitanClassic/save/libs/Ace/LibSharedMedia-3.0/CallbackHandler-1.0/CallbackHandler-1.0.lua create mode 100644 TitanClassic/save/libs/Ace/LibSharedMedia-3.0/LibSharedMedia-3.0.toc create mode 100644 TitanClassic/save/libs/Ace/LibSharedMedia-3.0/LibSharedMedia-3.0/LibSharedMedia-3.0.lua create mode 100644 TitanClassic/save/libs/Ace/LibSharedMedia-3.0/LibSharedMedia-3.0/lib.xml create mode 100644 TitanClassic/save/libs/Ace/LibSharedMedia-3.0/LibStub/LibStub.lua create mode 100644 TitanClassic/save/libs/Ace/LibSharedMedia-3.0/lib.xml create mode 100644 TitanClassic/save/libs/Ace/LibStub/LibStub.lua create mode 100644 TitanClassic/save/libs/Ace/README.md create mode 100644 TitanClassic/save/libs/Ace/changelog.txt create mode 100644 TitanClassic/save/libs/LibDataBroker-1.1.lua create mode 100644 TitanClassic/save/locale-old/Localization.BR.lua create mode 100644 TitanClassic/save/locale-old/Localization.CN.lua create mode 100644 TitanClassic/save/locale-old/Localization.DE.lua create mode 100644 TitanClassic/save/locale-old/Localization.ES.lua create mode 100644 TitanClassic/save/locale-old/Localization.FR.lua create mode 100644 TitanClassic/save/locale-old/Localization.IT.lua create mode 100644 TitanClassic/save/locale-old/Localization.KR.lua create mode 100644 TitanClassic/save/locale-old/Localization.MX.lua create mode 100644 TitanClassic/save/locale-old/Localization.RU.lua create mode 100644 TitanClassic/save/locale-old/Localization.TW.lua create mode 100644 TitanClassic/save/locale-old/Localization.lua create mode 100644 TitanClassic/save/locale/Localization.BR.lua create mode 100644 TitanClassic/save/locale/Localization.CN.lua create mode 100644 TitanClassic/save/locale/Localization.DE.lua create mode 100644 TitanClassic/save/locale/Localization.ES.lua create mode 100644 TitanClassic/save/locale/Localization.FR.lua create mode 100644 TitanClassic/save/locale/Localization.IT.lua create mode 100644 TitanClassic/save/locale/Localization.KR.lua create mode 100644 TitanClassic/save/locale/Localization.MX.lua create mode 100644 TitanClassic/save/locale/Localization.RU.lua create mode 100644 TitanClassic/save/locale/Localization.TW.lua create mode 100644 TitanClassic/save/locale/Localization.lua create mode 100644 TitanClock/TitanClock_Mainline.toc create mode 100644 TitanClock/TitanClock_Vanilla.toc create mode 100644 TitanClock/TitanClock_Wrath.toc create mode 100644 TitanGold/TitanGold_Mainline.toc create mode 100644 TitanGold/TitanGold_Vanilla.toc create mode 100644 TitanGold/TitanGold_Wrath.toc create mode 100644 TitanLocation/TitanLocation_Mainline.toc create mode 100644 TitanLocation/TitanLocation_Vanilla.toc create mode 100644 TitanLocation/TitanLocation_Wrath.toc create mode 100644 TitanLootType/TitanClassicLootType.lua create mode 100644 TitanLootType/TitanClassicLootType.xml create mode 100644 TitanLootType/TitanLootType_Mainline.toc create mode 100644 TitanLootType/TitanLootType_Vanilla.toc create mode 100644 TitanLootType/TitanLootType_Wrath.toc create mode 100644 TitanPerformance/TitanPerformance_Mainlnine.toc create mode 100644 TitanPerformance/TitanPerformance_Vanilla.toc create mode 100644 TitanPerformance/TitanPerformance_Wrath.toc create mode 100644 TitanRegen/TitanClassicRegen.lua create mode 100644 TitanRegen/TitanClassicRegen.xml create mode 100644 TitanRegen/TitanRegen_Vanilla.toc create mode 100644 TitanRegen/TitanRegen_Wrath.toc create mode 100644 TitanRepair/TitanRepair_Mainline.toc create mode 100644 TitanRepair/TitanRepair_Vanilla.toc create mode 100644 TitanRepair/TitanRepair_Wrath.toc create mode 100644 TitanVolume/TitanVolume_Mainline.toc create mode 100644 TitanVolume/TitanVolume_Vanilla.toc create mode 100644 TitanVolume/TitanVolume_Wrath.toc create mode 100644 TitanXP/TitanXP_Mainline.toc create mode 100644 TitanXP/TitanXP_Vanilla.toc create mode 100644 TitanXP/TitanXP_Wrath.toc diff --git a/Titan/Titan.lua b/Titan/Titan.lua index 699c137..3b9bbfb 100644 --- a/Titan/Titan.lua +++ b/Titan/Titan.lua @@ -425,7 +425,12 @@ print("PEW" Titan__InitializedPEW = true -- Move frames --- TitanMovable_SecureFrames() + if TITAN_ID == "TitanClassic" then + TitanMovable_SecureFrames() + TitanPanel_AdjustFrames() + else + -- No need + end -- Also sync LDB object text with their created Titan plugin TitanLDBRefreshButton() @@ -451,6 +456,14 @@ end --]===] function TitanPanelBarButton:ADDON_LOADED(addon) if addon == TITAN_ID then +--[[ +print("ADDON_LOADED" +.." "..tostring(addon).."" +) +--]] + _G[TITAN_PANEL_CONTROL]:RegisterEvent("PLAYER_ENTERING_WORLD") + TitanVariables_InitTitanSettings() -- Min table setup to start. +--[===[ -- Determine WoW TOC Version local wowversion = select(4, GetBuildInfo()) if wowversion >= 100000 then -- Initialize Titan @@ -467,6 +480,7 @@ function TitanPanelBarButton:ADDON_LOADED(addon) .." (10.00.xx)" , "error") end +--]===] -- Unregister event - saves a few event calls. self:UnregisterEvent("ADDON_LOADED"); self.ADDON_LOADED = nil @@ -489,6 +503,11 @@ print("PLAYER_ENTERING_WORLD" -- pcall does not allow errors to propagate out. Any error -- is returned as text with the success / fail. -- Think of it as a try - catch block +--[[ +print("_PlayerEnteringWorld" +.." "..tostring(call_success).."" +) +--]] if call_success then -- Titan initialized properly else @@ -519,6 +538,12 @@ function TitanPanelBarButton:CVAR_UPDATE(cvarname, cvarvalue) or cvarname == "uiScale" then if TitanPlayerSettings and TitanPanelGetVar("Scale") then TitanPanel_InitPanelBarButton("CVAR_ "..tostring(cvarname)) + if TITAN_ID == "TitanClassic" then + -- Adjust frame positions + TitanPanel_AdjustFrames("PLAYER_REGEN_ENABLED") + else + -- No need + end end end end @@ -548,12 +573,10 @@ function TitanPanelBarButton:ZONE_CHANGED_NEW_AREA() end function TitanPanelBarButton:PET_BATTLE_OPENING_START() ---print("PET_BATTLE_OPENING_START") TitanPanelBarButton_DisplayBarsWanted("PET_BATTLE_OPENING_START") end function TitanPanelBarButton:PET_BATTLE_CLOSE() ---print("PET_BATTLE_CLOSE") TitanPanelBarButton_DisplayBarsWanted("PET_BATTLE_CLOSE") end @@ -561,6 +584,13 @@ local in_combat = false -- seems InCombatLockdown may not be set fast enough to function TitanPanelBarButton:PLAYER_REGEN_ENABLED() in_combat = false TitanPanelBarButton_DisplayBarsWanted("PLAYER_REGEN_ENABLED") + + if TITAN_ID == "TitanClassic" then + -- Adjust frame positions + TitanPanel_AdjustFrames() + else + -- No need + end end function TitanPanelBarButton:PLAYER_REGEN_DISABLED() @@ -569,6 +599,28 @@ function TitanPanelBarButton:PLAYER_REGEN_DISABLED() end -- +if TITAN_ID == "TitanClassic" then +function TitanPanelBarButton:ACTIVE_TALENT_GROUP_CHANGED() + TitanMovable_AdjustTimer("DualSpec") +end + +function TitanPanelBarButton:UNIT_ENTERED_VEHICLE(self, ...) + TitanUtils_CloseAllControlFrames(); + TitanUtils_CloseRightClickMenu(); + + -- Needed because 8.0 made changes to the menu bar processing (see TitanMovable) + TitanMovable_MenuBar_Disable() +end +function TitanPanelBarButton:UNIT_EXITED_VEHICLE(self, ...) + -- A combat check will be done inside the adjust + TitanPanel_AdjustFrames(true) +end +--]] +-- +else + -- No need +end + --[[ Titan NAME: TitanPanelBarButton_OnClick DESC: Handle the button clicks on any Titan bar. @@ -711,6 +763,12 @@ local function handle_reset_cmds(cmd_list) if not InCombatLockdown() then TitanPanelSetVar("Scale", 1); TitanPanel_InitPanelBarButton("/panelscale reset ") + if TITAN_ID == "TitanClassic" then + -- Adjust frame positions + TitanPanel_AdjustFrames() + else + -- No need + end TitanPrint(L["TITAN_PANEL_SLASH_RESP3"], "info") else TitanPrint(L["TITAN_PANEL_MENU_IN_COMBAT_LOCKDOWN"], "warning") @@ -1114,6 +1172,77 @@ end -------------------------------------------------------------- -- +-- Titan Frames for CLASSIC versions + +-- +--========================== +-- Routines to handle adjusting some UI frames +-- +--[[ Titan +NAME: TitanPanelBarButton_ToggleAlign +DESC: Align the buttons per the user's new choice. +VAR: align - left or center +OUT: None +--]] +function TitanPanelBarButton_ToggleAlign(align) + -- toggle between left or center + if ( TitanPanelGetVar(align) == TITAN_PANEL_BUTTONS_ALIGN_CENTER ) then + TitanPanelSetVar(align, TITAN_PANEL_BUTTONS_ALIGN_LEFT); + else + TitanPanelSetVar(align, TITAN_PANEL_BUTTONS_ALIGN_CENTER); + end + + -- Justify button position + TitanPanelButton_Justify(); +end + +--[[ Titan +NAME: TitanPanelBarButton_ToggleAutoHide +DESC: Toggle the auto hide of the given Titan bar per the user's new choice. +VAR: frame - expected to be a Titan bar +OUT: None +--]] +function TitanPanelBarButton_ToggleAutoHide(frame) + local frName = _G[frame] + local plugin = (TitanBarData[frame] and TitanBarData[frame].auto_hide_plugin or nil) + + if frName then + Titan_AutoHide_ToggleAutoHide(_G[plugin]) + end +end + +--[[ Titan +NAME: TitanPanelBarButton_ToggleScreenAdjust +DESC: Toggle whether Titan adjusts 'top' frames around Titan bars per the user's new choice. +VAR: None +NOTE: +- Another addon can tell Titan to NOT adjust some or all frames. +:NOTE +--]] +function TitanPanelBarButton_ToggleScreenAdjust() + -- Turn on / off adjusting of other frames around Titan + TitanPanelToggleVar("ScreenAdjust"); + TitanPanel_AdjustFrames(true) +end + +--[[ Titan +NAME: TitanPanelBarButton_ToggleAuxScreenAdjust +DESC: Toggle whether Titan adjusts 'bottom' frames around Titan bars per the user's new choice. +VAR: None +OUT: None +NOTE: +- Another addon can tell Titan to NOT adjust some or all frames. +:NOTE +--]] +function TitanPanelBarButton_ToggleAuxScreenAdjust() + -- turn on / off adjusting of frames at the bottom of the screen + TitanPanelToggleVar("AuxScreenAdjust"); + TitanPanel_AdjustFrames(true) +end + + +-------------------------------------------------------------- +-- -- Titan Bar -- @@ -1452,6 +1581,13 @@ function TitanPanelBarButton_DisplayBarsWanted(reason) -- Set anchors for other addons to use. TitanAnchors() + + if TITAN_ID == "TitanClassic" then + -- Adjust other frames because the bars shown / hidden may have changed + TitanPanel_AdjustFrames(true) + else + -- Not needed with UI movable widgets + end end --[[ Titan @@ -1496,6 +1632,9 @@ local function showBar(frame_str) end end + if TITAN_ID == "TitanClassic" then + -- skip, no pet battles yet + else -- ===== In Pet Battle if C_PetBattles.IsInBattle() then if TitanBarData[frame_str].user_move then @@ -1504,6 +1643,7 @@ local function showBar(frame_str) flag = false end end + end --[[ print("showBar" --.." "..tostring(C_PetBattles.IsInBattle()).."" diff --git a/Titan/Titan.toc b/Titan/Titan.toc deleted file mode 100644 index bbd49a1..0000000 --- a/Titan/Titan.toc +++ /dev/null @@ -1,51 +0,0 @@ -## Interface: 100200 -## Title: Titan Panel [|cffeda55f_Core_|r] |cff00aa007.01.04.100200|r -## Author: Titan Panel Development Team -## Version: 7.01.04.100200 -## SavedVariables: TitanAll, TitanSettings, TitanSkins, ServerTimeOffsets, ServerHourFormat -## Notes: Adds display bars on the top and/or bottom of the screen; also adds user placeable Short bars. Allows users to show and control information/launcher plugins. -## X-Credits: TitanMod, Dark Imakuni, Adsertor, Titan Dev Team -## X-Category: Interface Enhancements -## X-Website: http://www.titanpanel.org -## X-Email: honorgog@gmail.com -## X-Localizations: enUS, ptBR, zhCN, deDE, esES, frFR, itIT, koKR, ruRU, zhTW -## X-License: All rights reserved (See license.txt) -## X-WoWI-ID: 8092 - -libs\Ace\LibStub\LibStub.lua -libs\Ace\CallbackHandler-1.0\CallbackHandler-1.0.xml -libs\Ace\AceAddon-3.0\AceAddon-3.0.xml -libs\Ace\AceHook-3.0\AceHook-3.0.xml -libs\Ace\AceTimer-3.0\AceTimer-3.0.xml -libs\Ace\AceGUI-3.0\AceGUI-3.0.xml -libs\Ace\AceConfig-3.0\AceConfig-3.0.xml -libs\Ace\AceLocale-3.0\AceLocale-3.0.xml -libs\Ace\LibSharedMedia-3.0\lib.xml -libs\Ace\AceGUI-3.0-SharedMediaWidgets\widget.xml -libs\Ace\LibQTip-1.0\lib.xml - -libs\LibDataBroker-1.1.lua - -locale\Localization.lua -locale\Localization.BR.lua -locale\Localization.CN.lua -locale\Localization.DE.lua -locale\Localization.ES.lua -locale\Localization.FR.lua -locale\Localization.IT.lua -locale\Localization.KR.lua -locale\Localization.MX.lua -locale\Localization.RU.lua -locale\Localization.TW.lua - -TitanGlobal.lua -TitanUtils.lua -TitanVariables.lua -TitanTemplate.xml -TitanTemplate.lua -TitanMovable.lua -TitanConfig.lua -TitanAutoHide.lua -Titan.xml -Titan.lua -TitanLDB.lua diff --git a/Titan/TitanAutoHide.lua b/Titan/TitanAutoHide.lua index 9956714..3d64047 100644 --- a/Titan/TitanAutoHide.lua +++ b/Titan/TitanAutoHide.lua @@ -12,7 +12,7 @@ The hider bar is a 1/2 height bar used to catch the mouse over to show the bar a :DESC --]] local AceTimer = LibStub("AceTimer-3.0") -local L = LibStub("AceLocale-3.0"):GetLocale("Titan", true) +local L = LibStub("AceLocale-3.0"):GetLocale(TITAN_ID, true) local Dewdrop = nil if AceLibrary and AceLibrary:HasInstance("Dewdrop-2.0") then Dewdrop = AceLibrary("Dewdrop-2.0") end diff --git a/Titan/TitanConfig.lua b/Titan/TitanConfig.lua index c5c1e87..c4bdf47 100644 --- a/Titan/TitanConfig.lua +++ b/Titan/TitanConfig.lua @@ -29,18 +29,9 @@ Highlight - notes. tips. and details local notes = "" do notes = notes - ..TitanUtils_GetGoldText("Major update :\n") - ..TitanUtils_GetHighlightText("" - .."- This is a major update which includes Short Bars; revamped Config screens; and other new features.\n" - .."\n") - ..TitanUtils_GetGoldText("DOWNGRADING From Titan 7.xx to 6.xx :\n") - ..TitanUtils_GetHighlightText("" - .."- Prior to downgrading, move *any* plugins on a Short bar to one of the original full width Titan Bars or Hide the plugin. Titan 6.xx will throw an error if ANY plugin is assigned to ANY Short Bar. If Titan throws an error after a downgrade, wipe the Titan saved variables.\n" - ) - .."\n\n" ..TitanUtils_GetGoldText("Notes:\n") ..TitanUtils_GetHighlightText("" - .."- Changing Titan Scaling : Short bars will move on screen. They should not go off screen. Move Short bars to desired location. You may have to Reset the SHort bar or temporarily disalbe top ot bottom bars to drag the Short bar.\n" + .."- Changing Titan Scaling : Short bars will move on screen. They should not go off screen. If Short bars move then drag to desired location. You may have to Reset the Short bar or temporarily disable top or bottom bars to drag the Short bar.\n" ) ..TitanUtils_GetGoldText("Known Issues:\n") ..TitanUtils_GetHighlightText("" @@ -51,6 +42,13 @@ end local changes = "" do -- recent change history changes = changes + ..TitanUtils_GetGoldText("8.00.00.100200 : 2023/12/xx\n") + ..TitanUtils_GetGreenText("Titan single release version : \n") + ..TitanUtils_GetHighlightText("" + .."- Titan : Combined with Classic versions for maintainability. This makes most retail / DF features available in Classic versions\n" + .."- Titan built-in plugins : Merged retail and Classic versions.\n" + ) + .."\n\n" ..TitanUtils_GetGoldText("7.01.04.100200 : 2023/11/11\n") ..TitanUtils_GetGreenText("Titan : \n") ..TitanUtils_GetHighlightText("" @@ -69,13 +67,6 @@ changes = changes .."- TitanRepair : Fix (hopefully last) for 'Desaturation' error on Repair when auto repair is set.\n" ) .."\n\n" - ..TitanUtils_GetGoldText("7.01.01.100100 : 2023/07/26\n") - ..TitanUtils_GetGreenText("Titan : \n") - ..TitanUtils_GetHighlightText("" - .."- TitanPerformance : WoW threshhold values were deleted by Blizz, used numerical values.\n" - .."- TitanRepair : In 10.01.05 Blizz changed names of Merchant repair buttuns, using new names.\n" - ) - .."\n\n" end TITAN_PANEL_CONFIG = { @@ -97,7 +88,8 @@ TITAN_PANEL_CONFIG = { changes = L["TITAN_PANEL_MENU_CHANGE_HISTORY"], slash = L["TITAN_PANEL_MENU_SLASH_COMMAND"], help = L["TITAN_PANEL_MENU_HELP"], - adjust = "Frame Adjustment", --L["TITAN_PANEL_MENU_HELP"], + adjust = "Frame Adjustment", + adjust_classic = "Frame Adjustment - Classic", } } @@ -132,6 +124,95 @@ end -- helper functions +if TITAN_ID == "TitanClassic" then + +--[[ local +NAME: TitanAdjustPanelScale +DESC: Set the Tian bars and plugins to the selected scale then adjust other frames as needed. +VAR: scale - the scale the user has selected for Titan +OUT: None +--]] +local function TitanAdjustPanelScale(scale) + Titan_AdjustScale() + + -- Adjust frame positions + TitanPanel_AdjustFrames(TITAN_PANEL_PLACE_BOTH, true) +end + +-- helper functions +--[[ local +NAME: TitanPanel_TicketReload +DESC: When the user changes the option to adjust for the Blizz ticket frame the UI must be reloaded. Ask the user if they want to do it now. +VAR: None +OUT: None +--]] +local function TitanPanel_TicketReload() + StaticPopupDialogs["TITAN_RELOAD"] = { + text = TitanUtils_GetNormalText(L["TITAN_PANEL_MENU_TITLE"]).."\n\n" + ..L["TITAN_PANEL_RELOAD"], + button1 = ACCEPT, + button2 = CANCEL, + OnAccept = function(self) + TitanPanelBarButton_ToggleScreenAdjust() + ReloadUI(); + end, + showAlert = 1, + timeout = 0, + whileDead = 1, + hideOnEscape = 1 + }; + StaticPopup_Show("TITAN_RELOAD"); +end + +local function TitanPanel_ScreenAdjustReload() + if TitanPanelGetVar("ScreenAdjust") then + -- if set then clear it - the screen will adjust + TitanPanelBarButton_ToggleScreenAdjust() + else + -- if NOT set then need a reload - the screen will NOT adjust + StaticPopupDialogs["TITAN_RELOAD"] = { + text = TitanUtils_GetNormalText(L["TITAN_PANEL_MENU_TITLE"]).."\n\n" + ..L["TITAN_PANEL_RELOAD"], + button1 = ACCEPT, + button2 = CANCEL, + OnAccept = function(self) + TitanPanelToggleVar("ScreenAdjust"); + ReloadUI(); + end, + showAlert = 1, + timeout = 0, + whileDead = 1, + hideOnEscape = 1 + }; + StaticPopup_Show("TITAN_RELOAD"); + end +end +local function TitanPanel_AuxScreenAdjustReload() + if TitanPanelGetVar("AuxScreenAdjust") then + -- if set then clear it - the screen will adjust + TitanPanelBarButton_ToggleAuxScreenAdjust() + else + -- if NOT set then need a reload - the screen will NOT adjust + StaticPopupDialogs["TITAN_RELOAD"] = { + text = TitanUtils_GetNormalText(L["TITAN_PANEL_MENU_TITLE"]).."\n\n" + ..L["TITAN_PANEL_RELOAD"], + button1 = ACCEPT, + button2 = CANCEL, + OnAccept = function(self) + TitanPanelToggleVar("AuxScreenAdjust"); + ReloadUI(); +-- TitanPanelBarButton_ToggleAuxScreenAdjust(); + end, + showAlert = 1, + timeout = 0, + whileDead = 1, + hideOnEscape = 1 + }; + StaticPopup_Show("TITAN_RELOAD"); + end +end + +end --============= Titan Panel entry -- --[[ local @@ -152,7 +233,7 @@ local titan_entry = { order = 1, type = "description", name = "" - .."Titan Panel is an Interface Enhancement addon which allows you to add short display bars to the UI as well as the top and bottom of your game screen." + .."Titan Panel is an Interface Enhancement addon which allows you to add short display bars to the UI as well as bars to the top and bottom of your game screen." .."\n\n" .."This addon does not interfere with, enhance, or replace any of your actual gameplay within the game. Titan Panel is meant to give you a quick visual point or click-on access to see the data related to your character without having to open other dialog boxes in the game or, in some cases, other addons." .."\n\n" @@ -2327,6 +2408,67 @@ end --============= Advanced +local conftimerdesc = { + name = "Timers", + type = "group", inline = true, + order = 1, + args = { + confdesc = { + order = 10, + type = "description", + name = L["TITAN_PANEL_MENU_ADV_DESC"], + cmdHidden = true + }, + advtimerpew = { + name = L["TITAN_PANEL_MENU_ADV_PEW"], + desc = L["TITAN_PANEL_MENU_ADV_PEW_DESC"], + order = 20, type = "range", width = "full", + min = 1, max = 10, step = 0.5, + get = function() return TitanAllGetVar("TimerPEW") end, + set = function(_, a) + TitanAllSetVar("TimerPEW", a); + TitanTimers["EnterWorld"].delay = a + end, + }, + advtimervehicle = { + name = L["TITAN_PANEL_MENU_ADV_VEHICLE"], + desc = L["TITAN_PANEL_MENU_ADV_VEHICLE_DESC"], + order = 50, type = "range", width = "full", + min = 1, max = 10, step = 0.5, + get = function() return TitanAllGetVar("TimerVehicle") end, + set = function(_, a) + TitanAllSetVar("TimerVehicle", a); + TitanTimers["Vehicle"].delay = a + end, + }, + }, + } +local confbuffdesc = { + name = "Buff Icon Vertical Adjustment", + type = "group", inline = true, + order = 2, + args = { + confbuffdesc = { + order = 110, + type = "description", + name = "Adjust Buff icons only as needed. This will override the Titan default adjustment.", --L["TITAN_PANEL_MENU_ADV_DESC"], + cmdHidden = true + }, + advbuffadj = { + name = "Buff", --L["TITAN_PANEL_MENU_ADV_PEW"], + desc = "", -- L["TITAN_PANEL_MENU_ADV_PEW_DESC"], + order = 120, type = "range", width = "full", + min = -100, max = 100, step = 1, + get = function() return TitanPanelGetVar("BuffIconVerticalAdj") end, + set = function(_, a) + TitanPanelSetVar("BuffIconVerticalAdj", a); + -- Adjust frame positions + TitanPanel_AdjustFrames(true, "BuffIconVerticalAdj") + end, + }, + }, + } + --[[ local NAME: optionsAdvanced DESC: Set the table to allow the user to control advanced features. @@ -2372,6 +2514,18 @@ local optionsAdvanced = { }, }, } + +local function BuildAdv() + if TITAN_ID == "TitanClassic" then + optionsAdvanced.args.conftimerdesc = conftimerdesc + optionsAdvanced.args.confbuffdesc = confbuffdesc + else + -- Do not need + end + + AceConfigRegistry:NotifyChange("Titan Panel Advanced") +end + ------------- @@ -2599,6 +2753,7 @@ function TitanUpdateConfig(action) BuildSkins() BuildBars() BuildAdj() + BuildAdv() end if action == "nuke" then local nuked = { diff --git a/Titan/TitanGame.lua b/Titan/TitanGame.lua new file mode 100644 index 0000000..37ba840 --- /dev/null +++ b/Titan/TitanGame.lua @@ -0,0 +1,8 @@ +--[[ File +NAME: TitanGame.lua +DESC: This file contains the 'game version' Titan or TitanClassic. Used to set up libs, locale, ... +:DESC +--]] + +TITAN_ID = "Titan" + diff --git a/Titan/TitanGlobal.lua b/Titan/TitanGlobal.lua index f60b47b..12a0c20 100644 --- a/Titan/TitanGlobal.lua +++ b/Titan/TitanGlobal.lua @@ -5,7 +5,6 @@ DESC: This file contains the global variables and constants used throughout Tita --]] -- Global variables -TITAN_ID = "Titan" Titan_Panel = {} -- begin the slow journey to a smaller _G footprint @@ -36,8 +35,8 @@ TITAN_PANEL_UPDATE_ALL = 3; TitanTooltipOrigScale = 1; TitanTooltipScaleSet = 0; --- Set Titan Version var for backwards compatibility -TITAN_VERSION = GetAddOnMetadata(TITAN_ID, "Version") or L["TITAN_NA"] +-- Set Titan Version var for backwards compatibility, set later +TITAN_VERSION = "" -- Various constants TITAN_PANEL_PLACE_TOP = 1; diff --git a/Titan/TitanMovable.lua b/Titan/TitanMovable.lua index 52c821f..76bf0bd 100755 --- a/Titan/TitanMovable.lua +++ b/Titan/TitanMovable.lua @@ -219,4 +219,696 @@ end .." f:"..tostring(force) ) end ---]] \ No newline at end of file +--]] + +--[[ ================================================== +Messy but declare the lib routines used in the Classic versions + +Share the calc Y routine +--]] +if TITAN_ID == "TitanClassic" then + + +local hooks_done = false; + +local move_count = 0 +--[[ Titan +Declare the Ace routines + local AceTimer = LibStub("AceTimer-3.0") + i.e. TitanPanelAce.ScheduleTimer("LDBToTitanSetText", TitanLDBRefreshButton, 2); + or + i.e. TitanPanelAce:ScheduleTimer(TitanLDBRefreshButton, 2); + + Be careful that the 'self' is proper to cancel timers!!! +--]] +local TitanPanelAce = LibStub("AceAddon-3.0"):NewAddon("TitanPanel", "AceHook-3.0", "AceTimer-3.0") + +--Determines the optimal magic number based on resolution +--local menuBarTop = 55; +--local width, height = string.match((({GetScreenResolutions()})[GetCurrentResolution()] or ""), "(%d+).-(%d+)"); +--if ( tonumber(width) / tonumber(height ) > 4/3 ) then + --Widescreen resolution +-- menuBarTop = 75; +--end + +--[[From Resike to prevent tainting stuff to override the SetPoint calls securely. +hooksecurefunc(FrameRef, "SetPoint", function(self) + if self.moving then + return + end + self.moving = true + self:SetMovable(true) + self:SetUserPlaced(true) + self:ClearAllPoints() + self:SetPoint("CENTER", UIParent, "CENTER", 0, 0) + self:SetMovable(false) + self.moving = nil +end) +--]] + +--[[ local +NAME: DoAdjust +DESC: See if Titan should adjust based only on its own flags. +VAR: place - top or bottom +OUT: boolean - true to adjust, false if not +--]] +local function DoAdjust(place, force) + local res = false -- assume we will not adjust + -- force is passed to cover cases where the user has just deselected both top or bottom bars + -- When that happens we need to adjust + + -- We did it to ourselves - if (Aux)ScreenAdjust is true it means the user wants Titan to NOT adjust... + if place == TITAN_PANEL_PLACE_TOP then + if TitanPanelGetVar("ScreenAdjust") == 1 then + -- do not adjust + else + if force then + res = true + elseif TitanPanelGetVar("Bar_Show") or TitanPanelGetVar("Bar2_Show") then + res = true + end + end + elseif place == TITAN_PANEL_PLACE_BOTTOM then + if TitanPanelGetVar("AuxScreenAdjust") == 1 then + -- do not adjust + else + if force then + res = true + elseif TitanPanelGetVar("AuxBar_Show") or TitanPanelGetVar("AuxBar2_Show") then + res = true + end + end + end + return res +end + +--[[ Titan +NAME: TitanMovable_MenuBar_Disable +DESC: Handle the main menu bar so Blizzard does not get upset. +VAR: None +OUT: None +NOTE: +- Reverted from 8.0 changes +:NOTE +--]] +function TitanMovable_MenuBar_Disable() + if DoAdjust(TITAN_PANEL_PLACE_BOTTOM, false) then +--TitanPrint("TitanMovable_MenuBar_Disable - DoAdjust", "warning") + MainMenuBar:SetMovable(true); +-- MainMenuBar:SetUserPlaced(false); + end +end + +--[[ Titan +NAME: TitanMovable_MenuBar_Enable +DESC: Handle the main menu bar so Blizzard does not get upset. +VAR: None +OUT: None +NOTE: +- Reverted from 8.0 changes +- This is called for the various events Titan handles that do / may hide the main menu bar +- IF TitanMovable_MenuBar_Disable was called, this must be called before having Titan adjust frames. The 'is user placed' is required to work around a Blizzard 'feature' that adjusts the main menu bar while in combat. +:NOTE +--]] +function TitanMovable_MenuBar_Enable() + if InCombatLockdown() then + -- wait until out of combat... + -- if player is in vehicle ... + else + if DoAdjust(TITAN_PANEL_PLACE_BOTTOM, false) then + MainMenuBar:SetMovable(true); + MainMenuBar:SetUserPlaced(true); + MainMenuBar:SetMovable(false); + end + end +end + +--[[ local +NAME: TitanMovableFrame_GetXOffset +DESC: Get the x axis offset Titan needs to adjust the given frame. +VAR: frame - frame object +VAR: point - "LEFT" / "RIGHT" / "TOP" / "BOTTOM" / "CENTER" +OUT: int - X axis offset, in pixels +--]] +local function TitanMovableFrame_GetXOffset(frame, point) + -- A valid frame and point is required + -- Determine a proper X offset using the given point (position) + local ret = 0 -- In case the inputs were invalid or the point was not relevant to the frame then return 0 + if frame and point then + if point == "LEFT" and frame:GetLeft() and UIParent:GetLeft() then + ret = frame:GetLeft() - UIParent:GetLeft(); + elseif point == "RIGHT" and frame:GetRight() and UIParent:GetRight() then + ret = frame:GetRight() - UIParent:GetRight(); + elseif point == "TOP" and frame:GetTop() and UIParent:GetTop() then + ret = frame:GetTop() - UIParent:GetTop(); + elseif point == "BOTTOM" and frame:GetBottom() and UIParent:GetBottom() then + ret = frame:GetBottom() - UIParent:GetBottom(); + elseif point == "CENTER" and frame:GetLeft() and frame:GetRight() + and UIParent:GetLeft() and UIParent:GetRight() then + local framescale = frame.GetScale and frame:GetScale() or 1; + ret = (frame:GetLeft()* framescale + frame:GetRight() + * framescale - UIParent:GetLeft() - UIParent:GetRight()) / 2; + end + end + + return ret +end + +--[[ local +NAME: SetPosition +DESC: Adjust a given frame with the passed in values. +VAR: frame - Text string of the frame name +VAR: ... - list of frame position info +NOTE: +- Swiped from Vrul on wowinterface forum + +- The table UIPARENT_MANAGED_FRAME_POSITIONS does not hold all Blizzard frames. +It is cleared for each frame in case the frame is in or might be in the table in the future. + +- Titan does not control the frames as other addons so we honor a user placed frame +:NOTE +--]] +local function SetPosition(frame, ...) + if type(frame) == 'string' then + UIPARENT_MANAGED_FRAME_POSITIONS[frame] = nil + frame = _G[frame] + end + if type(frame) == 'table' and type(frame.IsObjectType) == 'function' and frame:IsObjectType('Frame') then + local name = frame:GetName() + if name then + UIPARENT_MANAGED_FRAME_POSITIONS[name] = nil + end + -- Titan honors a user placed frame + frame:SetDontSavePosition(true) + frame:SetAttribute('ignoreFramePositionManager', true) + frame.ignoreFramePositionManager = true + if ... then + frame:ClearAllPoints() + frame:SetPoint(...) + end + end +end + +--[[ local +NAME: CheckConflicts +DESC: Check for other addons that control UI elements. Tell Titan to back off the frames the addon controls or can control. +VAR: +NOTE: +- This is messy routine because the internals of each addon must be known to check for the frames that are controlled. +- Some addons use different names where Titan uses the Blizzard frame names +:NOTE +--]] +local function CheckConflicts() + local addon = "Bartender4" +--[[ +-- Below is sample code. The ideal would be tell the user to disable the +-- Titan bottom bar adjust... + if (IsAddOnLoaded(addon)) then -- user has enabled + -- Check would be : BT4Bar.config.enabled to check if the frame exists and if it is enabled in BT4 + TitanMovable_AddonAdjust("MainMenuBar", true) + TitanMovable_AddonAdjust("MicroButtonAndBagsBar", true) + TitanMovable_AddonAdjust("MultiBarRight", true) + TitanMovable_AddonAdjust("ExtraActionBarFrame", true) + TitanMovable_AddonAdjust("OverrideActionBar", true) -- not sure about this one... + end +--]] +end + +--[[ local +NAME: MoveFrame +DESC: Adjust the given frame. Expected are frames where :GetPoint works +VAR: frame_ptr - Text string of the frame name +VAR: start_y - Any offset due to the specific frame +OUT: top_bottom - Frame is at top or bottom, expecting Titan constant for top or bottom +--]] +local function MoveFrame(frame_ptr, start_y, top_bottom, force) + local frame = _G[frame_ptr] + + if frame then -- ensure a valid frame + if frame:IsUserPlaced() then -- user (or another addon) may have placed this frame + else + if DoAdjust(top_bottom, force) and frame:IsShown() then + local y = TitanMovable_GetPanelYOffset(top_bottom) + (start_y or 0) -- includes scale adjustment + local point, relativeTo, relativePoint, xOfs, yOfs = frame:GetPoint() + -- check for nil which will cause an error + if point and relativeTo and relativePoint and xOfs then -- do not care about yOfs + SetPosition(frame, point, relativeTo:GetName(), relativePoint, xOfs, y) + else + -- do not proceed + end + else + --[[ + Some frames such as the ticket frame may not be visible or even created + --]] + end + end + else + -- Should note get here... +--[[ + TitanDebug ("MoveFrame nil found :" + .." "..tostring(frame_ptr) + ) +--]] + end +end + +--[[ local +NAME: MoveMenuFrame +DESC: Adjust the MainMenuBar frame. Needed because :GetPoint does NOT always work for MainMenuBar. +This is modeled after MoveFrame to keep it similar. +Titan sets the IsUserPlaced for the MainMenuBar frame so Titan needs to adjust. +VAR: frame_ptr - Text string of the frame name +VAR: start_y - Any offset due to the specific frame +OUT: top_bottom - Frame is at top or bottom, expecting Titan constant for top or bottom +--]] +local function MoveMenuFrame(frame_ptr, start_y, top_bottom, force) + local frame = _G[frame_ptr] + local adj = false + if frame and DoAdjust(top_bottom, force) + then + local yOffset = TitanMovable_GetPanelYOffset(top_bottom) -- includes scale adjustment + xOfs = TitanPanelGetVar("MainMenuBarXAdj") + + SetPosition(frame, "BOTTOM", "UIParent", "BOTTOM", xOfs, yOffset) + adj = true + else + -- Unknown frame... + end +end + +--[[ Titan +NAME: Titan_FCF_UpdateDockPosition +DESC: Secure post hook to help adjust the chat / log frame. +VAR: None +OUT: None +NOTE: +- This is required because Blizz adjusts the chat frame relative to other frames so some of the Blizz code is copied. +- If in combat or if the user has moved the chat frame then no action is taken. +- The frame is adjusted in the Y axis only. +:NOTE +--]] +local function Titan_FCF_UpdateDockPosition() + if not Titan__InitializedPEW + or not TitanPanelGetVar("LogAdjust") + or TitanPanelGetVar("AuxScreenAdjust") then + return + end + + if not InCombatLockdown() or (InCombatLockdown() + and not _G["DEFAULT_CHAT_FRAME"]:IsProtected()) then + local panelYOffset = TitanMovable_GetPanelYOffset(TITAN_PANEL_PLACE_BOTTOM); + local scale = TitanPanelGetVar("Scale"); + if scale then + panelYOffset = panelYOffset + (24 * scale) -- after 3.3.5 an additional adjust was needed. why? idk + end + +--[[ Blizz code + if _G["DEFAULT_CHAT_FRAME"]:IsUserPlaced() then + if _G["SIMPLE_CHAT"] ~= "1" then return end + end + + local chatOffset = 85 + panelYOffset; + if GetNumShapeshiftForms() > 0 or HasPetUI() or PetHasActionBar() then + if MultiBarBottomLeft:IsVisible() then + chatOffset = chatOffset + 55; + else + chatOffset = chatOffset + 15; + end + elseif MultiBarBottomLeft:IsVisible() then + chatOffset = chatOffset + 15; + end + _G["DEFAULT_CHAT_FRAME"]:SetPoint("BOTTOMLEFT", "UIParent", "BOTTOMLEFT", 32, chatOffset); + FCF_DockUpdate(); +--]] + if ( DEFAULT_CHAT_FRAME:IsUserPlaced() ) then + return; + end + + local chatOffset = 85 + panelYOffset; -- Titan change to adjust Y offset + if ( GetNumShapeshiftForms() > 0 or HasPetUI() or PetHasActionBar() ) then + if ( MultiBarBottomLeft:IsShown() ) then + chatOffset = chatOffset + 55; + else + chatOffset = chatOffset + 15; + end + elseif ( MultiBarBottomLeft:IsShown() ) then + chatOffset = chatOffset + 15; + end + DEFAULT_CHAT_FRAME:SetPoint("BOTTOMLEFT", "UIParent", "BOTTOMLEFT", + 32, chatOffset); + FCF_DockUpdate(); + end +end + +--[[ Titan +NAME: Titan_ContainerFrames_Relocate +DESC: Secure post hook to help adjust the bag frames. +VAR: None +OUT: None +NOTE: +- The frame is adjusted in the Y axis only. +- The Blizz routine "ContainerFrames_Relocate" should be examined for any conditions it checks and any changes to the SetPoint. +If Blizz changes the anchor points the SetPoint here must change as well!! +The Blizz routine calculates X & Y offsets to UIParent (screen) so there is not need to store the prior offsets. +Like the Blizz routine we search through the visible bags. Unlike the Blizz routine we only care about the first of each column to adjust for Titan. +This way the Blizz code does not need to be copied here. +:NOTE +--]] +local function Titan_ContainerFrames_Relocate() + if not TitanPanelGetVar("BagAdjust") then + return + end + + local panelYOffset = TitanMovable_GetPanelYOffset(TITAN_PANEL_PLACE_BOTTOM) + local off_y = 10000 -- something ridiculously high + local bottom_y = 0 + local right_x = 0 + + for index, frameName in ipairs(ContainerFrame1.bags) do + frame = _G[frameName]; + if frame:GetBottom() then bottom_y = frame:GetBottom() end + if ( bottom_y < off_y ) then + -- Start a new column + right_x = frame:GetRight() + frame:ClearAllPoints(); + frame:SetPoint("BOTTOMRIGHT", frame:GetParent(), + "BOTTOMLEFT", -- changed because we are taking the current x value + right_x, -- x is not adjusted + bottom_y + panelYOffset -- y + ) + end + off_y = bottom_y + end +end + +local function has_pet_bar() + local hasPetBar = false + if ( ( PetActionBarFrame and PetActionBarFrame:IsShown() ) or ( StanceBarFrame and StanceBarFrame:IsShown() ) or + ( MultiCastActionBarFrame and MultiCastActionBarFrame:IsShown() ) or ( PossessBarFrame and PossessBarFrame:IsShown() ) or + ( MainMenuBarVehicleLeaveButton and MainMenuBarVehicleLeaveButton:IsShown() ) ) then + hasPetBar = true; + end + return hasPetBar +end + +--[[ local +NAME: MData table +DESC: MData is a local table that holds each frame Titan may need to adjust. It controls the offsets needed to make room for the Titan bar(s). +Each frame can be adjusted by modifying its 'move' function. +The index is the frame name. Each record contains: +frameName - frame name (string) to adjust +addonAdj - true if another addon is taking responsibility of adjusting this frame, if false Titan will use the user settings to adjust or not +:DESC +NOTE: +- Of course Blizzard had to make the MainMenuBar act differently . :GetPoint() does not work on it so a special helper routine was needed. +:NOTE +--]] +local MData = { + [1] = {frameName = "PlayerFrame", + move = function (force) MoveFrame("PlayerFrame", 0, TITAN_PANEL_PLACE_TOP, force) end, + addonAdj = false, }, + [2] = {frameName = "TargetFrame", + move = function (force) MoveFrame("TargetFrame", 0, TITAN_PANEL_PLACE_TOP, force) end, + addonAdj = false, }, + [3] = {frameName = "PartyMemberFrame1", + move = function (force) MoveFrame("PartyMemberFrame1", 0, TITAN_PANEL_PLACE_TOP, force) end, + addonAdj = false, }, + [4] = {frameName = "TicketStatusFrame", + move = function (force) MoveFrame("TicketStatusFrame", 0, TITAN_PANEL_PLACE_TOP, force) end, + addonAdj = false, }, + [5] = {frameName = "BuffFrame", + move = function (force) + -- properly adjust buff frame(s) if GM Ticket is visible + + -- Use IsShown rather than IsVisible. In some cases (after closing + -- full screen map) the ticket may not yet be visible. + local yOffset = 0 + if TicketStatusFrame:IsShown() + and TitanPanelGetVar("TicketAdjust") + then + yOffset = (-TicketStatusFrame:GetHeight()) + else + yOffset = TitanPanelGetVar("BuffIconVerticalAdj") -- -13 + end + MoveFrame("BuffFrame", yOffset, TITAN_PANEL_PLACE_TOP, force) end, + addonAdj = false, }, + [6] = {frameName = "MinimapCluster", + move = function (force) + local yOffset = 0 + if MinimapBorderTop + and not MinimapBorderTop:IsShown() then + yOffset = yOffset + (MinimapBorderTop:GetHeight() * 3/5) - 5 + end + MoveFrame("MinimapCluster", yOffset, TITAN_PANEL_PLACE_TOP, force) end, + addonAdj = false, }, + [7] = {frameName = "MultiBarRight", + move = function (force) + MoveFrame("MultiBarRight", 0, TITAN_PANEL_PLACE_BOTTOM, force) end, + addonAdj = false, }, + [8] = {frameName = "OverrideActionBar", + move = function (force) MoveFrame("OverrideActionBar", 0, TITAN_PANEL_PLACE_BOTTOM, force) end, + addonAdj = false, }, + [9] = {frameName = "MicroButtonAndBagsBar", + move = function (force) MoveFrame("MicroButtonAndBagsBar", 0, TITAN_PANEL_PLACE_BOTTOM, force) end, + addonAdj = false, }, + [10] = {frameName = "MainMenuBar", -- MainMenuBar + move = function (force) + MoveMenuFrame("MainMenuBar", 0, TITAN_PANEL_PLACE_BOTTOM, force) end, + addonAdj = false, }, + [11] = {frameName = "ExtraActionBarFrame", + move = function (force) + -- Only spend cycles if the frame is shown. + if ExtraActionBarFrame + and ExtraActionBarFrame:IsShown() then + -- Need to calc Y because Y depends on what else is shown + --[=[ UIParent + Look at UIParent.lua for logic (UIParent_ManageFramePosition) + --]=] + local actionBarOffset = 45; + local menuBarTop = 55; + local overrideActionBarTop = 40; + local petBattleTop = 60; + + local yOfs = 18 -- FramePositionDelegate:UIParentManageFramePositions + if MainMenuBar and MainMenuBar:IsShown() then + yOfs = yOfs + menuBarTop + end + if (MultiBarBottomLeft and MultiBarBottomLeft:IsShown()) + or (MultiBarBottomRight and MultiBarBottomRight:IsShown()) + then + yOfs = yOfs + actionBarOffset + end + if (has_pet_bar()) + and (MultiBarBottomRight and MultiBarBottomRight:IsShown()) + then + yOfs = yOfs + petBattleTop + end + MoveFrame("ExtraActionBarFrame", yOfs, TITAN_PANEL_PLACE_BOTTOM, force) + end + end, + addonAdj = false, }, + [12] = {frameName = "UIWidgetTopCenterContainerFrame", + move = function (force) MoveFrame("UIWidgetTopCenterContainerFrame", 0, TITAN_PANEL_PLACE_TOP, force) end, + addonAdj = false, }, +} + +--[[ Titan +NAME: TitanMovable_AdjustTimer +DESC: Cancel then add the given timer. The timer must be in TitanTimers. +VAR: ttype - The timer type (string) as defined in TitanTimers +OUT: None +--]] +function TitanMovable_AdjustTimer(ttype) + local timer = TitanTimers[ttype] + if timer then + TitanPanelAce.CancelAllTimers(timer.obj) + TitanPanelAce.ScheduleTimer(timer.obj, timer.callback, timer.delay) + end +end + +--[[ Titan +NAME: TitanMovable_AddonAdjust +DESC: Set the given frame to be adjusted or not by another addon. This is called from TitanUtils for a developer API. +VAR: frame - frame name (string) +VAR: bool - true (addon will adjust) or false (Titan will use its settings) +OUT: None +--]] +function TitanMovable_AddonAdjust(frame, bool) + for i = 1,#MData,1 do + local fData = MData[i] + local fName = nil + if fData then + fName = fData.frameName; + end + + if (frame == fName) then + fData.addonAdj = bool + end + end +end + +--[[ local +NAME: TitanMovableFrame_MoveFrames +DESC: Loop through MData calling each frame's 'move' function for each Titan controlled frame. +Then update the chat and open bag frames. +OUT: None +--]] +local function TitanMovableFrame_MoveFrames(force) + local move_count = 0 -- debug + local str = "" -- debug + --[[ + Setting the MainMenuBar as user placed is needed because in 8.0.0 Blizzard changed something in the + way they controlled the frame. With Titan panel and bottom bars enabled the MainMenuBar + would 'bounce'. Figuring out the true root cause was a bust. + This idea of user placed came from a Titan user who is an addon developer. + However setting user placed causes the main menu bar to not act as we desire due to the way Blizzard coded the bar. + For now we will try to minimize the side effects... + + Later Titan checks rely on the user placed flag so it needs to be set early. + --]] + if DoAdjust(TITAN_PANEL_PLACE_BOTTOM, force) then + TitanMovable_MenuBar_Enable() + end + + if not InCombatLockdown() then + for i = 1,#MData,1 do + if MData[i] then + if MData[i].addonAdj then + -- An addon has taken control of the frame so skip + else + -- Adjust the frame per MData + MData[i].move(force) +--[[ + local ok, msg = pcall(function () MData[i].move() end) + if ok then + -- all is well + else + TitanPrint("Cannot Move" + .." '"..(MData[i].frameName or "?").."." + .." "..msg, "error") + end +--]] + end + end + end + Titan_FCF_UpdateDockPosition(); -- chat + UpdateContainerFrameAnchors(); -- Move bags as needed + else + -- nothing to do + end +end + +--[[ local +NAME: Titan_AdjustUIScale +DESC: Adjust the scale of Titan bars and plugins to the user selected scaling. This is called by the secure post hooks to the 'Video Options Frame'. +VAR: None +OUT: None +--]] +local function Titan_AdjustUIScale() + Titan_AdjustScale() +end + +--[[ Titan +NAME: TitanPanel_AdjustFrames +DESC: Adjust the frames for the Titan visible bars. +This is a shell for the actual Movable routine used by other Titan routines and secure hooks +OUT: None +NOTE: +:NOTE +--]] +function TitanPanel_AdjustFrames(force) + -- force is passed to cover cases where Titan should always adjust + -- such as when the user has just de/selected top or bottom bars + local f = force or false -- do not require the parameter + + -- Adjust frame positions top and bottom based on user choices + if hooks_done then + TitanMovableFrame_MoveFrames(f) + end +end + +--[[ Titan +NAME: Titan_AdjustScale +DESC: Update the bars and plugins to the user selected scale. +VAR: None +OUT: None +NOTE: +- Ensure Titan has done its initialization before this is run. +:NOTE +--]] +function Titan_AdjustScale() + -- Only adjust if Titan is fully initialized + if Titan__InitializedPEW then + TitanPanel_SetScale(); + + TitanPanel_ClearAllBarTextures() + TitanPanel_CreateBarTextures() + + for idx,v in pairs (TitanBarData) do + TitanPanel_SetTexture(TITAN_PANEL_DISPLAY_PREFIX..TitanBarData[idx].name + , TITAN_PANEL_PLACE_TOP); + end + + TitanMovableFrame_MoveFrames() +-- TitanPanelBarButton_DisplayBarsWanted() + TitanPanel_RefreshPanelButtons(); + end +end + +--[[ Titan +NAME: TitanMovable_SecureFrames +DESC: Once Titan is initialized create the post hooks we need to help adjust frames properly. +VAR: None +OUT: None +NOTE: +- The secure post hooks are required because Blizz adjusts frames Titan is interested in at times other than the events Titan registers for. +- This used to be inline code but was moved to a routine to avoid errors as Titan loaded. +:NOTE +--]] +function TitanMovable_SecureFrames() + if not TitanPanelAce:IsHooked("FCF_UpdateDockPosition", Titan_FCF_UpdateDockPosition) then + TitanPanelAce:SecureHook("FCF_UpdateDockPosition", Titan_FCF_UpdateDockPosition) -- FloatingChatFrame + end + if not TitanPanelAce:IsHooked("UIParent_ManageFramePositions", TitanPanel_AdjustFrames) then + TitanPanelAce:SecureHook("UIParent_ManageFramePositions", TitanPanel_AdjustFrames) -- UIParent.lua + TitanPanel_AdjustFrames() + end + + if not TitanPanelAce:IsHooked(TicketStatusFrame, "Show", TitanPanel_AdjustFrames) then + TitanPanelAce:SecureHook(TicketStatusFrame, "Show", TitanPanel_AdjustFrames) -- HelpFrame.xml + TitanPanelAce:SecureHook(TicketStatusFrame, "Hide", TitanPanel_AdjustFrames) -- HelpFrame.xml + TitanPanelAce:SecureHook("TargetFrame_Update", TitanPanel_AdjustFrames) -- TargetFrame.lua +-- TitanPanelAce:SecureHook(MainMenuBar, "Show", TitanPanel_AdjustFrames) -- HelpFrame.xml +-- TitanPanelAce:SecureHook(MainMenuBar, "Hide", TitanPanel_AdjustFrames) -- HelpFrame.xml +-- TitanPanelAce:SecureHook(OverrideActionBar, "Show", TitanPanel_AdjustFrames) -- HelpFrame.xml +-- TitanPanelAce:SecureHook(OverrideActionBar, "Hide", TitanPanel_AdjustFrames) -- HelpFrame.xml + TitanPanelAce:SecureHook("UpdateContainerFrameAnchors", Titan_ContainerFrames_Relocate) -- ContainerFrame.lua +-- TitanPanelAce:SecureHook(WorldMapFrame.BorderFrame.MaximizeMinimizeFrame.MinimizeButton, "Show", TitanPanel_AdjustFrames) -- WorldMapFrame.lua +-- TitanPanelAce:SecureHook("OrderHall_CheckCommandBar", TitanPanel_AdjustFrames) + end + + if not TitanPanelAce:IsHooked("VideoOptionsFrameOkay_OnClick", Titan_AdjustUIScale) then + -- Properly Adjust UI Scale if set + -- Note: These are the least intrusive hooks we could think of, to properly adjust the Titan Bar(s) + -- without having to resort to a SetCvar secure hook. Any addon using SetCvar should make sure to use the 3rd + -- argument in the API call and trigger the CVAR_UPDATE event with an appropriate argument so that other addons + -- can detect this behavior and fire their own functions (where applicable). + TitanPanelAce:SecureHook("VideoOptionsFrameOkay_OnClick", Titan_AdjustUIScale) -- VideoOptionsFrame.lua + TitanPanelAce:SecureHook(VideoOptionsFrame, "Hide", Titan_AdjustUIScale) -- VideoOptionsFrame.xml + end + + -- Check for other addons that control UI frames. + -- Tell Titan to back off of the frames these addons could control + -- Look in this routine for any special code or directions + CheckConflicts() + + hooks_done = true +end +function TitanMovable_Unhook_SecureFrames() +--[[ +This is a debug attempt to fix an issue when a player is dumped from a vehicle while still in combat. +--]] + TitanPanelAce:UnhookAll() +end + +end diff --git a/Titan/TitanUtils.lua b/Titan/TitanUtils.lua index ab5b3ce..aec47b9 100644 --- a/Titan/TitanUtils.lua +++ b/Titan/TitanUtils.lua @@ -1,14 +1,248 @@ --[[ File NAME: TitanUtils.lua DESC: This file contains various utility routines used by Titan and routines available to plugin developers. +Nov 2023 : merge Retail and Classic to min versions and maintainence and, hopefully, allow a consistent feature set. --]] local _G = getfenv(0); local L = LibStub("AceLocale-3.0"):GetLocale(TITAN_ID, true) local media = LibStub("LibSharedMedia-3.0") --- The LibUIDropDownMenu lib is used over the Blizzard frame -local drop_down_1 = "DropDownList1" -- Boo!! Per hard-coded Blizz UIDropDownMenu.lua +local drop_down_1 = "" -- + +if TITAN_ID == "TitanClassic" then + drop_down_1 = "L_DropDownList1" -- The LibUIDropDownMenu lib is used over the Blizzard frame +else + -- The LibUIDropDownMenu lib is used over the Blizzard frame + drop_down_1 = "DropDownList1" -- Boo!! Per hard-coded Blizz UIDropDownMenu.lua +end + +--[[ ================================================== +Messy but declare the lib routines used in the Classic versions +--]] +if TITAN_ID == "TitanClassic" then + +local DDM = LibStub:GetLibrary("LibUIDropDownMenu-4.0") + +-- +-- Wrap the drop down lib 4.0 to look like 2.0 to keep current plugins the same +-- These need to be global to act like the older version +-- +-- L_UIDropDownMenuDelegate_OnAttributeChanged -- Different in 4.0 +function L_UIDropDownMenu_InitializeHelper (frame) + DDM:UIDropDownMenu_InitializeHelper (frame) +end +function L_Create_UIDropDownMenu(name, parent) + local str = "" + if type(name) == "table" then + str = name:GetName() + else + str = name + end + return DDM:Create_UIDropDownMenu(name, parent) +end +function L_UIDropDownMenu_Initialize(frame, initFunction, displayMode, level, menuList) + DDM:UIDropDownMenu_Initialize(frame, initFunction, displayMode, level, menuList) +end +function L_UIDropDownMenu_SetInitializeFunction(frame, initFunction) + DDM:UIDropDownMenu_SetInitializeFunction(frame, initFunction) +end +function L_UIDropDownMenu_SetDisplayMode(frame, displayMode) + DDM:UIDropDownMenu_SetDisplayMode(frame, displayMode) +end +function L_UIDropDownMenu_RefreshDropDownSize(self) + DDM:UIDropDownMenu_RefreshDropDownSize(self) +end +--function L_UIDropDownMenu_OnUpdate(self, elapsed) -- Different in 4.0 +function L_UIDropDownMenu_StartCounting(frame) + DDM:UIDropDownMenu_StartCounting(frame) +end +function L_UIDropDownMenu_StopCounting(frame) + DDM:UIDropDownMenu_StopCounting(frame) +end +--function L_UIDropDownMenuButtonInvisibleButton_OnEnter(self)) -- Different in 4.0 +--function L_UIDropDownMenuButtonInvisibleButton_OnLeave(self)) -- Different in 4.0 +--function L_UIDropDownMenuButton_OnEnter(self) -- Different in 4.0 +--function L_UIDropDownMenuButton_OnLeave(self) -- Different in 4.0 +function L_UIDropDownMenu_CreateInfo() + return DDM:UIDropDownMenu_CreateInfo() +end +function L_UIDropDownMenu_CreateFrames(level, index) + DDM:UIDropDownMenu_CreateFrames(level, index) +end +function L_UIDropDownMenu_AddSeparator(level) + DDM:UIDropDownMenu_AddSeparator(level) +end +function L_UIDropDownMenu_AddSpace(level) -- new in 4.0 + DDM:UIDropDownMenu_AddSpace(level) +end +function L_UIDropDownMenu_AddButton(info, level) + DDM:UIDropDownMenu_AddButton(info, level) +end +function L_UIDropDownMenu_CheckAddCustomFrame(self, button, info) + DDM:UIDropDownMenu_CheckAddCustomFrame(self, button, info) +end +function L_UIDropDownMenu_RegisterCustomFrame(self, customFrame) + DDM:UIDropDownMenu_RegisterCustomFrame(self, customFrame) +end +function L_UIDropDownMenu_GetMaxButtonWidth(self) + return DDM:UIDropDownMenu_GetMaxButtonWidth(self) +end +function L_UIDropDownMenu_GetButtonWidth(button) + return DDM:UIDropDownMenu_GetButtonWidth(button) +end +function L_UIDropDownMenu_Refresh(frame, useValue, dropdownLevel) + DDM:UIDropDownMenu_Refresh(frame, useValue, dropdownLevel) +end +function L_UIDropDownMenu_RefreshAll(frame, useValue) + DDM:UIDropDownMenu_RefreshAll(frame, useValue) +end +function L_UIDropDownMenu_SetIconImage(icon, texture, info) + DDM:UIDropDownMenu_SetIconImage(icon, texture, info) +end +function L_UIDropDownMenu_SetSelectedName(frame, name, useValue) + DDM:UIDropDownMenu_SetSelectedName(frame, name, useValue) +end +function L_UIDropDownMenu_SetSelectedValue(frame, value, useValue) + DDM:UIDropDownMenu_SetSelectedValue(frame, value, useValue) +end +function L_UIDropDownMenu_SetSelectedID(frame, id, useValue) + DDM:UIDropDownMenu_SetSelectedID(frame, id, useValue) +end +function L_UIDropDownMenu_GetSelectedName(frame) + return DDM:UIDropDownMenu_GetSelectedName(frame) +end +function L_UIDropDownMenu_GetSelectedID(frame) + return DDM:UIDropDownMenu_GetSelectedID(frame) +end +function L_UIDropDownMenu_GetSelectedValue(frame) + return DDM:UIDropDownMenu_GetSelectedValue(frame) +end +--function L_UIDropDownMenuButton_OnClick(self) -- Different in 4.0 +function L_HideDropDownMenu(level) + DDM:HideDropDownMenu(level) +end +function L_ToggleDropDownMenu(level, value, dropDownFrame, anchorName, xOffset, yOffset, menuList, button, autoHideDelay) + DDM:ToggleDropDownMenu(level, value, dropDownFrame, anchorName, xOffset, yOffset, menuList, button, autoHideDelay) +end +function L_CloseDropDownMenus(level) + DDM:CloseDropDownMenus(level) +end +--function L_UIDropDownMenu_OnHide(self) -- Different in 4.0 +-- 4.0 has 'contains mouse' routines for retail only +function L_UIDropDownMenu_SetWidth(frame, width, padding) + DDM:UIDropDownMenu_SetWidth(frame, width, padding) +end +function L_UIDropDownMenu_SetButtonWidth(frame, width) + DDMUIDropDownMenu_SetButtonWidth(frame, width) +end +function L_UIDropDownMenu_SetText(frame, text) + DDM:UIDropDownMenu_SetText(frame, text) +end +function L_UIDropDownMenu_GetText(frame) + return DDM:UIDropDownMenu_GetText(frame) +end +function L_UIDropDownMenu_ClearAll(frame) + DDM:UIDropDownMenu_ClearAll(frame) +end +function L_UIDropDownMenu_JustifyText(frame, justification) + DDM:UIDropDownMenu_JustifyText(frame, justification) +end +function L_UIDropDownMenu_SetAnchor(dropdown, xOffset, yOffset, point, relativeTo, relativePoint) + DDM:UIDropDownMenu_SetAnchor(dropdown, xOffset, yOffset, point, relativeTo, relativePoint) +end +function L_UIDropDownMenu_GetCurrentDropDown() + return DDM:UIDropDownMenu_GetCurrentDropDown() +end +function L_UIDropDownMenuButton_GetChecked(self) + return DDM:UIDropDownMenuButton_GetChecked(self) +end +function L_UIDropDownMenuButton_GetName(self) + return DDM:UIDropDownMenuButton_GetName(self) +end +function L_UIDropDownMenuButton_OpenColorPicker(self, button) + DDM:UIDropDownMenuButton_OpenColorPicker(self, button) +end +function L_UIDropDownMenu_DisableButton(level, id) + DDM:UIDropDownMenu_DisableButton(level, id) +end +function L_UIDropDownMenu_EnableButton(level, id) + DDM:UIDropDownMenu_EnableButton(level, id) +end +function L_UIDropDownMenu_SetButtonText(level, id, text, colorCode) + DDM:UIDropDownMenu_SetButtonText(level, id, text, colorCode) +end +function L_UIDropDownMenu_SetButtonNotClickable(level, id) + DDM:UIDropDownMenu_SetButtonNotClickable(level, id) +end +function L_UIDropDownMenu_SetButtonClickable(level, id) + DDM:UIDropDownMenu_SetButtonClickable(level, id) +end +function L_UIDropDownMenu_DisableDropDown(dropDown) + DDM:UIDropDownMenu_DisableDropDown(dropDown) +end +function L_UIDropDownMenu_EnableDropDown(dropDown) + DDM:UIDropDownMenu_EnableDropDown(dropDown) +end +function L_UIDropDownMenu_IsEnabled(dropDown) + return DDM:UIDropDownMenu_IsEnabled(dropDown) +end +function L_UIDropDownMenu_GetValue(id) + return DDM:UIDropDownMenu_GetValue(id) +end +function L_OpenColorPicker(info) + DDM:OpenColorPicker(info) +end +function L_ColorPicker_GetPreviousValues() + return DDM:ColorPicker_GetPreviousValues() +end +else + +--[[ API +NAME: TitanUtils_GetMinimapAdjust +DESC: Return the current setting of the Titan MinimapAdjust option. +VAR: None +OUT: The value of the MinimapAdjust option +--]] +function TitanUtils_GetMinimapAdjust() -- Used by addons + return not TitanPanelGetVar("MinimapAdjust") +end + +--[[ API +NAME: TitanUtils_SetMinimapAdjust +DESC: Set the current setting of the Titan MinimapAdjust option. +VAR: bool - true (off) or false (on) +OUT: None +--]] +function TitanUtils_SetMinimapAdjust(bool) -- Used by addons + -- This routine allows an addon to turn on or off + -- the Titan minimap adjust. + TitanPanelSetVar("MinimapAdjust", not bool) +end + +--[[ API +NAME: TitanUtils_AddonAdjust +DESC: Tell Titan to adjust (or not) a frame. +VAR: frame - is the name (string) of the frame +VAR: bool - true if the addon will adjust the frame or false if Titan will adjust +OUT: None +Note: +- Titan will NOT store the adjust value across a log out / exit. +- This is a generic way for an addon to tell Titan to not adjust a frame. The addon will take responsibility for adjusting that frame. This is useful for UI style addons so the user can run Titan and a modifed UI. +- The list of frames Titan adjusts is specified in TitanMovableData within TitanMovable.lua. +- If the frame name is not in TitanMovableData then Titan does not adjust that frame. +:NOTE +--]] +function TitanUtils_AddonAdjust(frame, bool) -- Used by addons + TitanMovable_AddonAdjust(frame, bool) +end + +end +--[[ ================================================== +End Classic versions +--]] + + -- -- The routines labeled API are useable by addon developers -- @@ -677,9 +911,17 @@ function TitanUtils_ToString(text) return TitanUtils_Ternary(text, text, ""); end +local function Add_button(info, level) + if TITAN_ID == "TitanClassic" then + L_UIDropDownMenu_AddButton(info, level); + else + UIDropDownMenu_AddButton(info, level) + end +end + -------------------------------------------------------------- -- --- Right click menu routines +-- Right click menu routines - Retail dropdown menu -- --[[ Right click menu routines for plugins @@ -692,13 +934,59 @@ Whenever there is a change to the menu routines, the abstractions allows us to u --]] --[[ API -NAME: TitanPanelRightClickMenu_GetDropdownLevel +NAME: TitanPanelRightClickMenu_GetDropdownFrameBase +DESC: Menu - Get the current dropdown w/o a level +OUT: str - dropdown w/o a level +--]] +function TitanPanelRightClickMenu_GetDropdownFrameBase() + local res = "" + + if TITAN_ID == "TitanClassic" then + res = "L_DropDownList" -- The LibUIDropDownMenu lib is used over the Blizzard frame + else + -- The LibUIDropDownMenu lib is used over the Blizzard frame + res = "DropDownList" -- Boo!! Per hard-coded Blizz UIDropDownMenu.lua + end + + return res +end + +--[[ API +NAME: TitanPanelRightClickMenu_GetDropdownMenu +DESC: Menu - Get the current level in the menus. +VAR: None +OUT: int - dropdown menu level +--]] +function TitanPanelRightClickMenu_GetDropdownFrame() + local res = "" + + if TITAN_ID == "TitanClassic" then + res = "L_DropDownList1" -- The LibUIDropDownMenu lib is used over the Blizzard frame + else + -- The LibUIDropDownMenu lib is used over the Blizzard frame + res = "DropDownList1" -- Boo!! Per hard-coded Blizz UIDropDownMenu.lua + end + + return res +end + +--[[ API +NAME: TitanPanelRightClickMenu_GetDropdownMenu DESC: Menu - Get the current level in the menus. VAR: None OUT: int - dropdown menu level --]] function TitanPanelRightClickMenu_GetDropdownLevel() - return UIDROPDOWNMENU_MENU_LEVEL + local res = _G[drop_down_1] + + if TITAN_ID == "TitanClassic" then + res = L_UIDROPDOWNMENU_MENU_LEVEL + else + -- The LibUIDropDownMenu lib is used over the Blizzard frame + res = UIDROPDOWNMENU_MENU_LEVEL + end + + return res end --[[ API @@ -708,7 +996,13 @@ VAR: None OUT: int - dropdown menu value --]] function TitanPanelRightClickMenu_GetDropdMenuValue() - return UIDROPDOWNMENU_MENU_VALUE + local res = nil + if TITAN_ID == "TitanClassic" then + res = L_UIDROPDOWNMENU_MENU_VALUE + else + res = UIDROPDOWNMENU_MENU_VALUE + end + return res end --[[ API @@ -720,7 +1014,7 @@ OUT: None --]] function TitanPanelRightClickMenu_AddButton(info, level) if (info) then - UIDropDownMenu_AddButton(info, level); + Add_button(info, level) end end @@ -746,7 +1040,7 @@ function TitanPanelRightClickMenu_AddToggleRightSide(id, level) end info.checked = TitanGetVar(id, "DisplayOnRightSide"); info.keepShownOnClick = 1; - UIDropDownMenu_AddButton(info, level); + Add_button(info, level); end end @@ -764,7 +1058,7 @@ function TitanPanelRightClickMenu_AddTitle(title, level) info.notCheckable = true; info.notClickable = true; info.isTitle = 1; - UIDropDownMenu_AddButton(info, level); + Add_button(info, level); end end @@ -789,7 +1083,7 @@ function TitanPanelRightClickMenu_AddCommand(text, value, functionName, level) callback(value) end end - UIDropDownMenu_AddButton(info, level); + Add_button(info, level); end --[[ API @@ -799,7 +1093,11 @@ VAR: level - level to put the line OUT: None --]] function TitanPanelRightClickMenu_AddSeparator(level) - UIDropDownMenu_AddSeparator(level) + if TITAN_ID == "TitanClassic" then + L_UIDropDownMenu_AddSeparator(level) + else + UIDropDownMenu_AddSeparator(level) + end end --[[ API @@ -809,7 +1107,11 @@ VAR: level - level to put the line OUT: None --]] function TitanPanelRightClickMenu_AddSpacer(level) - UIDropDownMenu_AddSpace(level) + if TITAN_ID == "TitanClassic" then + L_UIDropDownMenu_AddSpace(level) + else + UIDropDownMenu_AddSpace(level) + end end --[[ API @@ -841,7 +1143,7 @@ function TitanPanelRightClickMenu_AddToggleVar(text, id, var, toggleTable, level end info.checked = TitanGetVar(id, var); info.keepShownOnClick = 1; - UIDropDownMenu_AddButton(info, level); + Add_button(info, level); end --[[ API @@ -901,7 +1203,7 @@ function TitanPanelRightClickMenu_AddHide(id, level) info.func = function() TitanPanelRightClickMenu_Hide(id) end - UIDropDownMenu_AddButton(info, level); + Add_button(info, level); end --[[ API @@ -997,7 +1299,7 @@ VAR: id - id of the plugin OUT: None NOTE: Assume top level only --]] -function TitanPanelRightClickMenu_AddControlVars(id, hide_text) +function TitanPanelRightClickMenu_AddControlVars(id, level) local level = 1 -- assume top menu TitanPanelRightClickMenu_AddSeparator(level) @@ -1265,6 +1567,16 @@ function TitanUtils_CloseAllControlFrames() end end +function TitanUtils_IsAnyControlFrameVisible() -- need? + for index, value in TitanPlugins do + local frame = _G["TitanPanel"..index.."ControlFrame"]; + if (frame:IsVisible()) then + return true; + end + end + return false; +end + --[[ Titan Plugins AND Titan NAME: TitanUtils_GetOffscreen DESC: Check where the control frame should be on screen; return x and y @@ -1318,12 +1630,14 @@ NOTE: - As of May 2023 (10.1) the routine moved and no longer dies silently so it is wrapped here... --]] function TitanUtils_GetAddOnMetadata(name, field) + local GetMeta = C_AddOns and C_AddOns.GetAddOnMetadata or GetAddOnMetadata + local call_success, ret_val -- Just in case, catch any errors call_success, -- needed for pcall ret_val = -- actual return values - pcall (C_AddOns.GetAddOnMetadata, name, field) + pcall (GetMeta, name, field) if call_success then -- all is good return ret_val @@ -1744,6 +2058,43 @@ function TitanUtils_CloseRightClickMenu() end end +--[[ local Classic +NAME: TitanRightClick_UIScale +DESC: Scale the right click menu to the user requested value. +VAR: None +OUT: +- float - x scaled +- float - y scaled +- float - scale used + +--]] +local function TitanRightClick_UIScale() + -- take UI Scale into consideration + local listFrame = _G[drop_down_1]; + local listframeScale = listFrame:GetScale(); + + local uiScale; + local uiParentScale = UIParent:GetScale(); + + local x, y = GetCursorPosition(UIParent) + + if ( GetCVar("useUIScale") == "1" ) then + uiScale = tonumber(GetCVar("uiscale")); + if ( uiParentScale < uiScale ) then + uiScale = uiParentScale; + end + else + uiScale = uiParentScale; + end + + x = x/uiScale; + y = y/uiScale; + + listFrame:SetScale(uiScale); + + return x, y, uiScale +end + --[[ local NAME: TitanRightClickMenu_OnLoad DESC: Prepare the plugin right click menu using the function given by the plugin =or Titan bar. @@ -1776,6 +2127,31 @@ local function TitanRightClickMenu_OnLoad(self) return DropDownList1, DropDownList1:GetHeight(), DropDownList1:GetWidth() end +--[[ local Classic +NAME: TitanDisplayRightClickMenu_OnLoad +DESC: Prepare the Titan bar right click menu using the given function. +VAR: +- self - frame of the Titan bar +- func - function to create the menu +OUT: None +NOTE: +- This routine is for Titan bar. There is a similar routine for the Titan plugins. +--]] +local function TitanDisplayRightClickMenu_OnLoad(self, func) + local prepareFunction = _G[func]; + if prepareFunction and type(prepareFunction) == "function" then + -- Nasty "hack", load Blizzard_Calendar if not loaded, + -- for it to secure init 24 dropdown menu buttons, + -- to avoid action blocked by tainting +-- if not IsAddOnLoaded("Blizzard_Calendar") then +-- LoadAddOn("Blizzard_Calendar") +-- end + -- not good practice but there seems to be no other way to get + -- the actual bar (frame parent) to the dropdown implementation + TitanPanel_DropMenu = self + L_UIDropDownMenu_Initialize(self, prepareFunction, "MENU"); + end +end --[[ Titan NAME: TitanPanelRightClickMenu_Toggle DESC: Call the routine to build the plugin menu then place it properly. @@ -1862,7 +2238,11 @@ print("RCM" .." "..tostring(format("%0.1f", left)).."" ) --]] - ToggleDropDownMenu(1, nil, menu, frame, x_offset, 0, nil, self); + if TITAN_ID == "TitanClassic" then + L_ToggleDropDownMenu(1, nil, menu, frame, TitanUtils_Max(x_offset - 40, 0), 0, nil, self) + else + ToggleDropDownMenu(1, nil, menu, frame, x_offset, 0, nil, self); + end end --[[ Titan diff --git a/Titan/TitanVariables.lua b/Titan/TitanVariables.lua index 6760ae0..7bc4fcd 100644 --- a/Titan/TitanVariables.lua +++ b/Titan/TitanVariables.lua @@ -271,16 +271,21 @@ The original Titan (full width) bars values are used for default X and Y :DESC -]] TitanBarDataVars = {} + +TitanSkinsDefaultPath = "Interface\\AddOns\\Titan\\Artwork\\" +TitanSkinsCustomPath = TitanSkinsDefaultPath.."Custom\\" +TitanSkinsPathEnd = "\\" + TitanBarVarsDefaults = { ["Global"] = -- holds 'global' user settings; NOT for use in the frame loop! { - skin = {path = "Interface\\AddOns\\Titan\\Artwork\\", alpha = 0.7}, + skin = {path = TitanSkinsDefaultPath, alpha = 0.7}, color = {r = 1.0, g = .5, b = 1.0, alpha = 1.0}, texure = Titan_Panel.NONE, -- Titan_Panel.NONE or Titan_Panel.SKIN or Titan_Panel.COLOR hide_in_combat = false, }, [TITAN_PANEL_DISPLAY_PREFIX.."Bar"] = {off_x=0, off_y=0, off_w = x_max, - skin = {path = "Interface\\AddOns\\Titan\\Artwork\\", alpha = 0.7}, + skin = {path = TitanSkinsDefaultPath, alpha = 0.7}, color = {r = 1.0, g = .5, b = 1.0, alpha = 1.0}, texure = Titan_Panel.SKIN, -- or Titan_Panel.COLOR show = true, @@ -289,7 +294,7 @@ TitanBarVarsDefaults = { hide_in_combat = false, }, [TITAN_PANEL_DISPLAY_PREFIX.."Bar2"] = {off_x=0, off_y=-(TITAN_PANEL_BAR_HEIGHT), off_w = x_max, - skin = {path = "Interface\\AddOns\\Titan\\Artwork\\", alpha = 0.7}, + skin = {path = TitanSkinsDefaultPath, alpha = 0.7}, color = {r = 1.0, g = .5, b = 1.0, alpha = 1.0}, texure = Titan_Panel.SKIN, show = false, @@ -298,7 +303,7 @@ TitanBarVarsDefaults = { hide_in_combat = false, }, [TITAN_PANEL_DISPLAY_PREFIX.."AuxBar2"] = {off_x=0, off_y=(TITAN_PANEL_BAR_HEIGHT * 2), off_w = x_max, - skin = {path = "Interface\\AddOns\\Titan\\Artwork\\", alpha = 0.7}, + skin = {path = TitanSkinsDefaultPath, alpha = 0.7}, color = {r = 1.0, g = .5, b = 1.0, alpha = 1.0}, texure = Titan_Panel.SKIN, show = false, @@ -307,7 +312,7 @@ TitanBarVarsDefaults = { hide_in_combat = false, }, [TITAN_PANEL_DISPLAY_PREFIX.."AuxBar"] = {off_x=0, off_y=(TITAN_PANEL_BAR_HEIGHT), off_w = x_max, - skin = {path = "Interface\\AddOns\\Titan\\Artwork\\", alpha = 0.7}, + skin = {path = TitanSkinsDefaultPath, alpha = 0.7}, color = {r = 1.0, g = .5, b = 1.0, alpha = 1.0}, texure = Titan_Panel.SKIN, show = false, @@ -316,7 +321,7 @@ TitanBarVarsDefaults = { hide_in_combat = false, }, [TITAN_PANEL_DISPLAY_PREFIX.."Short01"] = {off_x=x_mid, off_y=Calc_Y(3), off_w = SHORT_WIDTH, - skin = {path = "Interface\\AddOns\\Titan\\Artwork\\", alpha = 0.7}, + skin = {path = TitanSkinsDefaultPath, alpha = 0.7}, color = {r = 1.0, g = .5, b = 1.0, alpha = 1.0}, texure = Titan_Panel.SKIN, show = false, @@ -325,7 +330,7 @@ TitanBarVarsDefaults = { hide_in_combat = false, }, [TITAN_PANEL_DISPLAY_PREFIX.."Short02"] = {off_x=x_mid, off_y=Calc_Y(4), off_w = SHORT_WIDTH, - skin = {path = "Interface\\AddOns\\Titan\\Artwork\\", alpha = 0.7}, + skin = {path = TitanSkinsDefaultPath, alpha = 0.7}, color = {r = 1.0, g = .5, b = 1.0, alpha = 1.0}, texure = Titan_Panel.SKIN, show = false, @@ -334,7 +339,7 @@ TitanBarVarsDefaults = { hide_in_combat = false, }, [TITAN_PANEL_DISPLAY_PREFIX.."Short03"] = {off_x=x_mid, off_y=Calc_Y(5), off_w = SHORT_WIDTH, - skin = {path = "Interface\\AddOns\\Titan\\Artwork\\", alpha = 0.7}, + skin = {path = TitanSkinsDefaultPath, alpha = 0.7}, color = {r = 1.0, g = .5, b = 1.0, alpha = 1.0}, texure = Titan_Panel.SKIN, show = false, @@ -343,7 +348,7 @@ TitanBarVarsDefaults = { hide_in_combat = false, }, [TITAN_PANEL_DISPLAY_PREFIX.."Short04"] = {off_x=x_mid, off_y=Calc_Y(6), off_w = SHORT_WIDTH, - skin = {path = "Interface\\AddOns\\Titan\\Artwork\\", alpha = 0.7}, + skin = {path = TitanSkinsDefaultPath, alpha = 0.7}, color = {r = 1.0, g = .5, b = 1.0, alpha = 1.0}, texure = Titan_Panel.SKIN, show = false, @@ -352,7 +357,7 @@ TitanBarVarsDefaults = { hide_in_combat = false, }, [TITAN_PANEL_DISPLAY_PREFIX.."Short05"] = {off_x=x_mid, off_y=Calc_Y(7), off_w = SHORT_WIDTH, - skin = {path = "Interface\\AddOns\\Titan\\Artwork\\", alpha = 0.7}, + skin = {path = TitanSkinsDefaultPath, alpha = 0.7}, color = {r = 1.0, g = .5, b = 1.0, alpha = 1.0}, texure = Titan_Panel.SKIN, show = false, @@ -361,7 +366,7 @@ TitanBarVarsDefaults = { hide_in_combat = false, }, [TITAN_PANEL_DISPLAY_PREFIX.."Short06"] = {off_x=x_mid, off_y=Calc_Y(8), off_w = SHORT_WIDTH, - skin = {path = "Interface\\AddOns\\Titan\\Artwork\\", alpha = 0.7}, + skin = {path = TitanSkinsDefaultPath, alpha = 0.7}, color = {r = 1.0, g = .5, b = 1.0, alpha = 1.0}, texure = Titan_Panel.SKIN, show = false, @@ -370,7 +375,7 @@ TitanBarVarsDefaults = { hide_in_combat = false, }, [TITAN_PANEL_DISPLAY_PREFIX.."Short07"] = {off_x=x_mid, off_y=Calc_Y(9), off_w = SHORT_WIDTH, - skin = {path = "Interface\\AddOns\\Titan\\Artwork\\", alpha = 0.7}, + skin = {path = TitanSkinsDefaultPath, alpha = 0.7}, color = {r = 1.0, g = .5, b = 1.0, alpha = 1.0}, texure = Titan_Panel.SKIN, show = false, @@ -379,7 +384,7 @@ TitanBarVarsDefaults = { hide_in_combat = false, }, [TITAN_PANEL_DISPLAY_PREFIX.."Short08"] = {off_x=x_mid, off_y=Calc_Y(10), off_w = SHORT_WIDTH, - skin = {path = "Interface\\AddOns\\Titan\\Artwork\\", alpha = 0.7}, + skin = {path = TitanSkinsDefaultPath, alpha = 0.7}, color = {r = 1.0, g = .5, b = 1.0, alpha = 1.0}, texure = Titan_Panel.SKIN, show = false, @@ -388,7 +393,7 @@ TitanBarVarsDefaults = { hide_in_combat = false, }, [TITAN_PANEL_DISPLAY_PREFIX.."Short09"] = {off_x=x_mid, off_y=Calc_Y(11), off_w = SHORT_WIDTH, - skin = {path = "Interface\\AddOns\\Titan\\Artwork\\", alpha = 0.7}, + skin = {path = TitanSkinsDefaultPath, alpha = 0.7}, color = {r = 1.0, g = .5, b = 1.0, alpha = 1.0}, texure = Titan_Panel.SKIN, show = false, @@ -397,7 +402,7 @@ TitanBarVarsDefaults = { hide_in_combat = false, }, [TITAN_PANEL_DISPLAY_PREFIX.."Short10"] = {off_x=x_mid, off_y=Calc_Y(12), off_w = SHORT_WIDTH, - skin = {path = "Interface\\AddOns\\Titan\\Artwork\\", alpha = 0.7}, + skin = {path = TitanSkinsDefaultPath, alpha = 0.7}, color = {r = 1.0, g = .5, b = 1.0, alpha = 1.0}, texure = Titan_Panel.SKIN, show = false, @@ -484,6 +489,12 @@ TITAN_PANEL_SAVED_VARIABLES = { HideTipsInCombat = false, HideBarsInCombat = false, HideBarsInPVP = false, + -- Classic + ScreenAdjust = false, + AuxScreenAdjust = false, + MainMenuBarXAdj = 0, + BuffIconVerticalAdj = -13, + -- End -- for the independent bars Bar_Show = true, Bar_Hide = false, @@ -520,12 +531,15 @@ TITAN_ALL_SAVED_VARIABLES = { TooltipModiferAlt = false, TooltipModiferCtrl = false, TooltipModiferShift = false, + -- Classic + TimerPEW = 4, + TimerDualSpec = 2, + TimerAdjust = 1, + TimerVehicle = 1, + -- End }; -- The skins released with Titan -TitanSkinsDefaultPath = "Interface\\AddOns\\Titan\\Artwork\\" -TitanSkinsCustomPath = TitanSkinsDefaultPath.."Custom\\" -TitanSkinsPathEnd = "\\" TitanSkinsDefault = { { name = "Titan Default", titan=true, path = TitanSkinsDefaultPath}, { name = "AllBlack", titan=true, path = TitanSkinsCustomPath.."AllBlack Skin"..TitanSkinsPathEnd}, @@ -552,7 +566,7 @@ TitanSkinsDefault = { TitanSkins = {} -- trim version if it exists -local fullversion = GetAddOnMetadata(TITAN_ID, "Version") +local fullversion = TitanUtils_GetAddOnMetadata(TITAN_ID, "Version") if fullversion then local pos = string.find(fullversion, " -", 1, true); if pos then @@ -560,6 +574,20 @@ if fullversion then end end +--[[ local Classic +NAME: TitanRegisterExtra +DESC: Add the saved variable data of an unloaded plugin to the 'extra' list in case the user wants to delete the data via Tian Extras option. +VAR: id - the name of the plugin (string) +OUT: None +--]] +local function TitanRegisterExtra(id) + TitanPluginExtrasNum = TitanPluginExtrasNum + 1 + TitanPluginExtras[TitanPluginExtrasNum] = + {num=TitanPluginExtrasNum, + id = (id or "?"), + } +end + -- routines to sync toon data local function CleanupProfile () if TitanPanelSettings and TitanPanelSettings["Buttons"] then @@ -741,12 +769,27 @@ local function Set_Timers(reset) -- Titan is loaded so set the timers we want to use TitanTimers = { ["LDBRefresh"] = {obj = "LDB", callback = TitanLDBRefreshButton, delay = 2,}, + -- Classic + ["EnterWorld"] = {obj = "PEW", callback = TitanPanel_AdjustFrames, delay = 4,}, + ["DualSpec"] = {obj = "SpecSwitch", callback = TitanPanel_AdjustFrames, delay = 2,}, + ["Adjust"] = {obj = "MoveAdj", callback = TitanPanel_AdjustFrames, delay = 1,}, + ["Vehicle"] = {obj = "Vehicle", callback = TitanPanel_AdjustFrames, delay = 1,}, } if reset then TitanAllSetVar("TimerLDB", TitanTimers["LDBRefresh"].delay) + -- Classic + TitanAllSetVar("TimerPEW", TitanTimers["EnterWorld"].delay) + TitanAllSetVar("TimerDualSpec", TitanTimers["DualSpec"].delay) + TitanAllSetVar("TimerAdjust", TitanTimers["Adjust"].delay) + TitanAllSetVar("TimerVehicle", TitanTimers["Vehicle"].delay) else TitanTimers["LDBRefresh"].delay = TitanAllGetVar("TimerLDB") + -- Classic + TitanTimers["EnterWorld"].delay = TitanAllGetVar("TimerPEW") + TitanTimers["DualSpec"].delay = TitanAllGetVar("TimerDualSpec") + TitanTimers["Adjust"].delay = TitanAllGetVar("TimerAdjust") + TitanTimers["Vehicle"].delay = TitanAllGetVar("TimerVehicle") end end @@ -833,6 +876,10 @@ function TitanVariables_InitTitanSettings() local trace = false local new_toon = false local player = TitanUtils_GetPlayer() + if trace then + TitanDebug("_Init begin "..tostring(player)) + end + if (TitanSettings) then -- all is good else @@ -859,6 +906,10 @@ function TitanVariables_InitTitanSettings() end TitanVariables_SyncRegisterSavedVariables(TITAN_ALL_SAVED_VARIABLES, TitanAll) + if trace then + TitanDebug("_Init end "..tostring(player)) + end + -- Current Titan list known - all toons player has profiles for -- Sort in alphabetical order. -- Used for menus. @@ -928,8 +979,12 @@ OUT: X, Y, Width function TitanVariables_GetBarPos(frame_str) local tscale = TitanPanelGetVar("Scale") --[[ +print("_GetBarPos f" +.." '"..tostring(frame_str).."'" +.." '"..tostring(TitanBarData[frame_str].name).."'" +) print("_GetBarPos" -.." '"..tostring(format("%0.1f", TitanBarData[frame_str].name).."'" +.." '"..tostring(TitanBarData[frame_str].name).."'" .." '"..tostring(format("%0.1f", TitanBarDataVars[frame_str].off_x)).."'" .." '"..tostring(format("%0.1f", TitanBarDataVars[frame_str].off_y)).."'" .." '"..tostring(format("%0.1f", TitanBarDataVars[frame_str].off_w)).."'" @@ -967,10 +1022,19 @@ local function deepcopy(orig) return copy end -local function Set_bar_vars(to_profile) +local function Set_bar_vars(to_profile, trace) + local tracer = (trace or false) if TitanSettings.Players[to_profile].BarVars then -- All good + if tracer then + print("Set_bar_vars found" + ) + end else + if tracer then + print("Set_bar_vars init" + ) + end -- Set to defaults TitanSettings.Players[to_profile].BarVars = TitanBarVarsDefaults local BV = TitanSettings.Players[to_profile].BarVars @@ -978,6 +1042,11 @@ local function Set_bar_vars(to_profile) -- Cannot assume profile is current / cannot use Get Var routines. local panel = TitanSettings.Players[to_profile].Panel + local tex = panel["TexturePath"]:gsub("TitanClassic", "Titan") + if tracer then + print("tex path '"..tex.."'") + end + -- Bring original Titan bar optionss to the current user settings. -- If this is a new toon or new saved vars then it will just get defaults. for idx, v in pairs (TitanBarData) do @@ -989,7 +1058,7 @@ local function Set_bar_vars(to_profile) -- only skins before 7.x BV[idx].texure = Titan_Panel.SKIN BV[idx].skin.alpha = panel[v.name.."_Transparency"] - BV[idx].skin.path = panel["TexturePath"] + BV[idx].skin.path = tex end end end @@ -1076,7 +1145,7 @@ local function Init_player_settings(from_profile, to_profile, action) -- ====== -- ====== New Mar 2023 : TitanSettings.Players[player].BarData to hold Short bar data - Set_bar_vars(to_profile) + Set_bar_vars(to_profile, trace) -- ====== if action == TITAN_PROFILE_RESET then -- default is global profile OFF diff --git a/Titan/Titan_Mainline.toc b/Titan/Titan_Mainline.toc new file mode 100644 index 0000000..03a3d27 --- /dev/null +++ b/Titan/Titan_Mainline.toc @@ -0,0 +1,53 @@ +## Interface: 100200 +## Title: Titan Panel [|cffeda55f_Core_|r] |cff00aa008.00.00.Retail|r +## Author: Titan Panel Dev Team +## Version: 8.00.00.Retail +## SavedVariables: TitanAll, TitanSettings, TitanSkins, ServerTimeOffsets, ServerHourFormat +## Notes: Adds display bars to show and control information/launcher plugins. +## X-Credits: TitanMod, Dark Imakuni, Adsertor, Titan Dev Team +## X-Category: Interface Enhancements +## X-Website: http://www.titanpanel.org +## X-Email: honorgog@gmail.com +## X-Localizations: enUS, ptBR, zhCN, deDE, esES, frFR, itIT, koKR, ruRU, zhTW +## X-License: All rights reserved (See license.txt) +## X-WoWI-ID: 8092 + +TitanGame.lua + +libs\Ace\LibStub\LibStub.lua +libs\Ace\CallbackHandler-1.0\CallbackHandler-1.0.xml +libs\Ace\AceAddon-3.0\AceAddon-3.0.xml +libs\Ace\AceHook-3.0\AceHook-3.0.xml +libs\Ace\AceTimer-3.0\AceTimer-3.0.xml +libs\Ace\AceGUI-3.0\AceGUI-3.0.xml +libs\Ace\AceConfig-3.0\AceConfig-3.0.xml +libs\Ace\AceLocale-3.0\AceLocale-3.0.xml +libs\Ace\LibSharedMedia-3.0\lib.xml +libs\Ace\AceGUI-3.0-SharedMediaWidgets\widget.xml +libs\Ace\LibQTip-1.0\lib.xml + +libs\LibDataBroker-1.1.lua + +locale\Localization.lua +locale\Localization.BR.lua +locale\Localization.CN.lua +locale\Localization.DE.lua +locale\Localization.ES.lua +locale\Localization.FR.lua +locale\Localization.IT.lua +locale\Localization.KR.lua +locale\Localization.MX.lua +locale\Localization.RU.lua +locale\Localization.TW.lua + +TitanGlobal.lua +TitanUtils.lua +TitanVariables.lua +TitanTemplate.xml +TitanTemplate.lua +TitanMovable.lua +TitanConfig.lua +TitanAutoHide.lua +Titan.xml +Titan.lua +TitanLDB.lua diff --git a/Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-BCC.toc b/Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-BCC.toc new file mode 100644 index 0000000..d8d57f2 --- /dev/null +++ b/Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-BCC.toc @@ -0,0 +1,12 @@ +## Interface: 20504 +## Title: Lib: UIDropDownMenu +## Notes: A Replacement for standard UIDropDownMenu +## Version: v4.21.10010550587 +## X-Category: Libraries +## X-Website: https://www.wowace.com/projects/libuidropdownmenu +## OptionalDeps: LibStub + +#@no-lib-strip@ +LibStub\LibStub.lua +#@end-no-lib-strip@ +LibUIDropDownMenu\LibUIDropDownMenu.lua diff --git a/Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-Classic.toc b/Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-Classic.toc new file mode 100644 index 0000000..14e2066 --- /dev/null +++ b/Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-Classic.toc @@ -0,0 +1,12 @@ +## Interface: 11403 +## Title: Lib: UIDropDownMenu +## Notes: A Replacement for standard UIDropDownMenu +## Version: v4.21.10010550587 +## X-Category: Libraries +## X-Website: https://www.wowace.com/projects/libuidropdownmenu +## OptionalDeps: LibStub + +#@no-lib-strip@ +LibStub\LibStub.lua +#@end-no-lib-strip@ +LibUIDropDownMenu\LibUIDropDownMenu.lua diff --git a/Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-WOTLKC.toc b/Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-WOTLKC.toc new file mode 100644 index 0000000..0094b37 --- /dev/null +++ b/Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-WOTLKC.toc @@ -0,0 +1,12 @@ +## Interface: 30402 +## Title: Lib: UIDropDownMenu +## Notes: A Replacement for standard UIDropDownMenu +## Version: v4.21.10010550587 +## X-Category: Libraries +## X-Website: https://www.wowace.com/projects/libuidropdownmenu +## OptionalDeps: LibStub + +#@no-lib-strip@ +LibStub\LibStub.lua +#@end-no-lib-strip@ +LibUIDropDownMenu\LibUIDropDownMenu.lua diff --git a/Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu.toc b/Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu.toc new file mode 100644 index 0000000..46d19f3 --- /dev/null +++ b/Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu.toc @@ -0,0 +1,12 @@ +## Interface: 100105 +## Title: Lib: UIDropDownMenu +## Notes: A Replacement for standard UIDropDownMenu +## Version: v4.21.10010550587 +## X-Category: Libraries +## X-Website: https://www.wowace.com/projects/libuidropdownmenu +## OptionalDeps: LibStub + +#@no-lib-strip@ +LibStub\LibStub.lua +#@end-no-lib-strip@ +LibUIDropDownMenu\LibUIDropDownMenu.lua diff --git a/Titan/libs/Ace/!LibUIDropDownMenu/Docs/Readme.txt b/Titan/libs/Ace/!LibUIDropDownMenu/Docs/Readme.txt new file mode 100644 index 0000000..d2ceaa1 --- /dev/null +++ b/Titan/libs/Ace/!LibUIDropDownMenu/Docs/Readme.txt @@ -0,0 +1,178 @@ +$Id: Readme.txt 64 2020-11-18 13:13:15Z arithmandar $ + +== About == +Standard UIDropDownMenu global functions using protected frames and causing taints +when used by third-party addons. But it is possible to avoid taints by using same +functionality with that library. + +== What is it == +Library is standard code from Blizzard's files EasyMenu.lua, UIDropDownMenu.lua, +UIDropDownMenu.xml and UIDropDownMenuTemplates.xml with frames, tables, variables +and functions renamed to: +* constants : "L_" added at the start +* functions: "L_" added at the start + +== How to use it (for addon developer) == +=== Initial Preparation === +Assuming your addon is using all the UIDropDownMenu functions from the WoW's +built in function calls, then it is suggested that you have below preparation +in your lua codes: + local LibDD = LibStub:GetLibrary("LibUIDropDownMenu-4.0") + +=== Function Call Replacement === +Depends on which UIDropDownMenu's function calls you have used in your addon, +you will need below similar replacement: + + UIDropDownMenu_Initialize => LibDD:UIDropDownMenu_Initialize + UIDropDownMenu_CreateInfo => LibDD:UIDropDownMenu_CreateInfo + UIDropDownMenu_AddButton => LibDD:UIDropDownMenu_AddButton + + UIDropDownMenu_AddSeparator => LibDD:UIDropDownMenu_AddSeparator + UIDropDownMenu_AddSpace=> LibDD:UIDropDownMenu_AddSpace + + UIDropDownMenu_SetSelectedValue => LibDD:UIDropDownMenu_SetSelectedValue + UIDropDownMenu_SetSelectedName=> LibDD:UIDropDownMenu_SetSelectedName + + UIDropDownMenu_SetSelectedID => LibDD:UIDropDownMenu_SetSelectedID + UIDropDownMenu_SetWidth => LibDD:UIDropDownMenu_SetWidth + + CloseDropDownMenus => LibDD:CloseDropDownMenus + +=== Creating new UIDropDownMenu === +Traditionally you will either create a new frame in your lua codes or with +XML by setting the frame to inherit from "UIDropDownMenuTemplate". + +By using this library, you will need to create your menu from like below: + local frame = LibDD:Create_UIDropDownMenu("MyDropDownMenu", parent_frame) + +== Button Name == +As you (the developers) might be aware that at some point you might need to +manipulate the dropdowns by accessing the button names. For example, you have +multiple levels of menus and you would like to hide or show some level's menu +button. In that case, you need to make sure you also revise the button name +used in your original codes when you are migrating to use LibUIDropDownMenu. + + "L_DropDownList"..i + +Example: + + for i = 1, L_UIDROPDOWNMENU_MAXLEVELS, 1 do + dropDownList = _G["L_DropDownList"..i]; + if ( i >= L_UIDROPDOWNMENU_MENU_LEVEL or frame ~= L_UIDROPDOWNMENU_OPEN_MENU ) then + dropDownList.numButtons = 0; + dropDownList.maxWidth = 0; + for j=1, L_UIDROPDOWNMENU_MAXBUTTONS, 1 do + button = _G["L_DropDownList"..i.."Button"..j]; + button:Hide(); + end + dropDownList:Hide(); + end + end + +== Constants == +* L_UIDROPDOWNMENU_MINBUTTONS +* L_UIDROPDOWNMENU_MAXBUTTONS +* L_UIDROPDOWNMENU_MAXLEVELS +* L_UIDROPDOWNMENU_BUTTON_HEIGHT +* L_UIDROPDOWNMENU_BORDER_HEIGHT +* L_UIDROPDOWNMENU_OPEN_MENU +* L_UIDROPDOWNMENU_INIT_MENU +* L_UIDROPDOWNMENU_MENU_LEVEL +* L_UIDROPDOWNMENU_MENU_VALUE +* L_UIDROPDOWNMENU_SHOW_TIME +* L_UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT +* L_OPEN_DROPDOWNMENUS + +== Functions == +* lib:EasyMenu +* lib:EasyMenu_Initialize + +* lib:UIDropDownMenuDelegate_OnAttributeChanged +* lib:UIDropDownMenu_InitializeHelper +* lib:UIDropDownMenu_Initialize +* lib:UIDropDownMenu_SetInitializeFunction +* lib:UIDropDownMenu_RefreshDropDownSize +* lib:UIDropDownMenu_OnUpdate +* lib:UIDropDownMenu_StartCounting +* lib:UIDropDownMenu_StopCounting +* lib:UIDropDownMenu_CheckAddCustomFrame +* lib:UIDropDownMenu_CreateInfo +* lib:UIDropDownMenu_CreateFrames +* lib:UIDropDownMenu_AddSeparator +* lib:UIDropDownMenu_AddButton +* lib:UIDropDownMenu_AddSeparator +* lib:UIDropDownMenu_GetMaxButtonWidth +* lib:UIDropDownMenu_GetButtonWidth +* lib:UIDropDownMenu_Refresh +* lib:UIDropDownMenu_RefreshAll +* lib:UIDropDownMenu_RegisterCustomFrame +* lib:UIDropDownMenu_SetIconImage +* lib:UIDropDownMenu_SetSelectedName +* lib:UIDropDownMenu_SetSelectedValue +* lib:UIDropDownMenu_SetSelectedID +* lib:UIDropDownMenu_GetSelectedName +* lib:UIDropDownMenu_GetSelectedID +* lib:UIDropDownMenu_GetSelectedValue +* lib:UIDropDownMenuButton_OnClick +* lib:HideDropDownMenu +* lib:ToggleDropDownMenu +* lib:CloseDropDownMenus +* lib:UIDropDownMenu_OnHide +* lib:UIDropDownMenu_SetWidth +* lib:UIDropDownMenu_SetButtonWidth +* lib:UIDropDownMenu_SetText +* lib:UIDropDownMenu_GetText +* lib:UIDropDownMenu_ClearAll +* lib:UIDropDownMenu_JustifyText +* lib:UIDropDownMenu_SetAnchor +* lib:UIDropDownMenu_GetCurrentDropDown +* lib:UIDropDownMenuButton_GetChecked +* lib:UIDropDownMenuButton_GetName +* lib:UIDropDownMenuButton_OpenColorPicker +* lib:UIDropDownMenu_DisableButton +* lib:UIDropDownMenu_EnableButton +* lib:UIDropDownMenu_SetButtonText +* lib:UIDropDownMenu_SetButtonNotClickable +* lib:UIDropDownMenu_SetButtonClickable +* lib:UIDropDownMenu_DisableDropDown +* lib:UIDropDownMenu_EnableDropDown +* lib:UIDropDownMenu_IsEnabled +* lib:UIDropDownMenu_GetValue + +== List of button attributes == +* info.text = [STRING] -- The text of the button +* info.value = [ANYTHING] -- The value that L_UIDROPDOWNMENU_MENU_VALUE is set to when the button is clicked +* info.func = [function()] -- The function that is called when you click the button +* info.checked = [nil, true, function] -- Check the button if true or function returns true +* info.isNotRadio = [nil, true] -- Check the button uses radial image if false check box image if true +* info.isTitle = [nil, true] -- If it's a title the button is disabled and the font color is set to yellow +* info.disabled = [nil, true] -- Disable the button and show an invisible button that still traps the mouseover event so menu doesn't time out +* info.tooltipWhileDisabled = [nil, 1] -- Show the tooltip, even when the button is disabled. +* info.hasArrow = [nil, true] -- Show the expand arrow for multilevel menus +* info.hasColorSwatch = [nil, true] -- Show color swatch or not, for color selection +* info.r = [1 - 255] -- Red color value of the color swatch +* info.g = [1 - 255] -- Green color value of the color swatch +* info.b = [1 - 255] -- Blue color value of the color swatch +* info.colorCode = [STRING] -- "|cAARRGGBB" embedded hex value of the button text color. Only used when button is enabled +* info.swatchFunc = [function()] -- Function called by the color picker on color change +* info.hasOpacity = [nil, 1] -- Show the opacity slider on the colorpicker frame +* info.opacity = [0.0 - 1.0] -- Percentatge of the opacity, 1.0 is fully shown, 0 is transparent +* info.opacityFunc = [function()] -- Function called by the opacity slider when you change its value +* info.cancelFunc = [function(previousValues)] -- Function called by the colorpicker when you click the cancel button (it takes the previous values as its argument) +* info.notClickable = [nil, 1] -- Disable the button and color the font white +* info.notCheckable = [nil, 1] -- Shrink the size of the buttons and don't display a check box +* info.owner = [Frame] -- Dropdown frame that "owns" the current dropdownlist +* info.keepShownOnClick = [nil, 1] -- Don't hide the dropdownlist after a button is clicked +* info.tooltipTitle = [nil, STRING] -- Title of the tooltip shown on mouseover +* info.tooltipText = [nil, STRING] -- Text of the tooltip shown on mouseover +* info.tooltipOnButton = [nil, 1] -- Show the tooltip attached to the button instead of as a Newbie tooltip. +* info.justifyH = [nil, "CENTER"] -- Justify button text +* info.arg1 = [ANYTHING] -- This is the first argument used by info.func +* info.arg2 = [ANYTHING] -- This is the second argument used by info.func +* info.fontObject = [FONT] -- font object replacement for Normal and Highlight +* info.menuTable = [TABLE] -- This contains an array of info tables to be displayed as a child menu +* info.noClickSound = [nil, 1] -- Set to 1 to suppress the sound when clicking the button. The sound only plays if .func is set. +* info.padding = [nil, NUMBER] -- Number of pixels to pad the text on the right side +* info.leftPadding = [nil, NUMBER] -- Number of pixels to pad the button on the left side +* info.minWidth = [nil, NUMBER] -- Minimum width for this line +* info.customFrame = frame -- Allows this button to be a completely custom frame, should inherit from L_UIDropDownCustomMenuEntryTemplate and override appropriate methods. \ No newline at end of file diff --git a/Titan/libs/Ace/!LibUIDropDownMenu/Docs/Revision.txt b/Titan/libs/Ace/!LibUIDropDownMenu/Docs/Revision.txt new file mode 100644 index 0000000..33114f8 --- /dev/null +++ b/Titan/libs/Ace/!LibUIDropDownMenu/Docs/Revision.txt @@ -0,0 +1,243 @@ +$Id: Revision.txt 123 2023-07-29 01:42:12Z arithmandar $ + +Revision History: +================= + +v4.21.10010550587 (2023/07/29) +------------------------------ +- Toc update to support WoW 10.1.5 / 3.4.2 +- function sync with build 50587 + +v4.20.10000748520 (2023/03/20) +------------------------------ +- Toc update to support WoW 10.0.7 + +v4.19.10000047936 (2023/02/05) +------------------------------ +- Toc update to support WoW 10.0.5 / 3.4.1 + +v4.18.10000046801 (2022/11/29) +------------------------------ +- Replace SetBackdrop with backdropInfo + +v4.17.10000046801 (2022/11/29) +------------------------------ +- update backdrop template to DialogBorderDarkTemplate + - update BACKDROP_DIALOG_DARK.insets.bottom to 11 +- update menubackdrop template to TooltipBackdropTemplate + +v4.16.10000046689 (2022/11/18) +------------------------------ +- Fixing tagging error + +v4.15.10000046689 (2022/11/18) +------------------------------ +- Toc update to support WoW 10.0.2 +- Updated lib:UIDropDownMenu_JustifyText() + +v4.14.10000046455 (2022/11/04) +------------------------------ +- minor bug fix for menu icon onclick + +v4.13.10000046366 (2022/11/03) +----------------------------- +- Toc update to support WoW 10.0.0 +- function sync with build 46366 + +v4.12.9020745161 (2022/08/23) +----------------------------- +- Classic ToC update to support WoW 1.14.3 +- Release for WOLTKC + +v4.11.9020745114 (2022/08/17) +----------------------------- +- Toc update to support WoW 9.2.7 +- Added support for Wrath of the Lich King Classic (WoW 3.4.0) + +v4.10.9020542423 (2022/07/17) +----------------------------- +- Toc update to support WoW 9.2.5 +- function sync with build 44232 +- Fixed: Global Mouse Down making menu not toggle properly from the button (TeeloJubeithos) + +v4.09.9020042698 (2022/03/23) +----------------------------- +- BCC ToC update to support WoW 2.5.4 + +v4.09.9020042488 (2022/02/28) +----------------------------- +- Fixed issue while in Classic or BCC in counting maximum buttons + +v4.08.9020042423 (2022/02/23) +----------------------------- +- Toc update to support WoW 9.2.0 +- function sync with build 42423 + +v4.07.9020042277 (2022/02/13) +----------------------------- +- function sync with build 42277 +- enhanced the auto hide feature in ClassicEra and Classic TBC + +v4.07.9020042257 (2022/02/10) +----------------------------- +- function sync with build 42257 +- BCC ToC update to support WoW 2.5.3 +- Classic ToC update to support WoW 1.14.2 + +v4.07.9020042174 (2022/02/09) +----------------------------- +- Support multiple ToC +- BCC ToC update to support WoW 2.5.3 +- Classic ToC update to support WoW 1.14.1 + +v4.07.9020042069 (2022/01/26) +----------------------------- +- Toc update to support WoW 9.1.5 +- function sync with build 42069 +- fixed the issue that backdrop was not properly set + +v4.06.9010039185 (2021/06/30) +----------------------------- +- Toc update to support WoW 9.1.0 +- function sync with build 39185 + +v4.05.9000538556 (2021/06/14) +----------------------------- +- Rework on dropdown menu's audo-hide + +v4.04.9000538556 (2021/06/14) +----------------------------- +- Allowing dropdown frame to be wihout a name (nil) given (for an anonymous frame) +- Added timeout for classic (both classic era and TBC) so that dropdown menu will auto-hide when mouse is away (thanks to DahkCeles) + +v4.03.9000538556 (2021/05/19) +----------------------------- +- Added codes for fixing Tainting UIMenus and CloseMenus() (thanks to DahkCeles) + +v4.02.9000538556 (2021/05/19) +----------------------------- +- Supported WoW Classic 2.5.1 (38707) + +v4.01.9000236639 (2020/12/14) +----------------------------- +- Fixed issues that classic server doesn't have UIDropDownMenu_HandleGlobalMouseEvent() + +v4.00.9000236639 (2020/11/22) +----------------------------- +- Toc update to support WoW 9.0.2 +- LibUIDropDownMenu + - Set major version to 4.0 + - Migrate all global functions to be under library tables + - Insert "L_DropDownList1" and "L_DropDownList2" to global UIMenus + - UIDropDownMenu_HandleGlobalMouseEvent (thanks to SLOKnightFall) +- LibEasyMenu + - Move function calls to under LibUIDropDownMenu and under library tables +- LibUIDropDownMenuTemplates + - Move codes to under LibUIDropDownMenu so that thet can de under one single library + +v3.02.9000136272.01 (2020/10/20) +----------------------------- +- Fixed version detection while setting ColorSwatch's backdrop template. It should now be correctly detecting the retail (as well as ShadowLands) version + +v3.02.9000136272 (2020/10/18) +----------------------------- +- Update to sync with 9.0.1 build 36272 +- ToC update to support WoW 9.0.1 + +v3.01.9000135522 (2020/09/07) +----------------------------- +- Updated Backdrop's handling + +v3.00.9000135522 (2020/08/19) +----------------------------- +- Shadowlands support and backward compatibility for both WoW classic and BFA + +v2.01.8020031429 (2019/08/12) +----------------------------- +- Update to sync with 8.2.0 build 31429 +- ToC update + +v2.00.8010028833 (2018/12/27) +----------------------------- +- Migrate template to Lua function call + (Refer to below page for more details: + https://www.wowace.com/projects/libuidropdownmenu/pages/faq/changes-regarding-to-dropdown-templates-usage ) +- Update major version to "LibUIDropDownMenu-2.0" + +v1.08.8010028768 (2018/12/17) +----------------------------- +- Update to sync with 8.0.1 build 28768 +- ToC update + +v1.08.8000127326 (2018/08/11) +----------------------------- +- Workaround to get rid of addons which are still using old version of this library + (thanks to ddcorkum) + +v1.08.8000127165 (2018/07/25) +----------------------------- +- Sync with WoW 8.0.1.27165 + - Added L_UIDropDownMenu_SetDisplayMode() + - Added L_UIDropDownMenuButtonInvisibleButton_OnEnter() + - Added L_UIDropDownMenuButtonInvisibleButton_OnLeave() + - Added L_UIDropDownMenuButton_OnEnter() + - Added L_UIDropDownMenuButton_OnLeave() + +v1.08.8000126433 (2018/04/24) +----------------------------- +- Sync with WoW 8.0.1.26433 + - Added LibUIDropDownMenuTemplates.lua + - Added frame template: L_UIDropDownCustomMenuEntryTemplate + - Added local function GetChild() + - New custom frame functions: + - L_UIDropDownMenu_CheckAddCustomFrame() + - L_UIDropDownMenu_RegisterCustomFrame() + - New button attribute: info.customFrame + - Changes of L_UIDropDownMenu_AddSeparator() is to be reflected only on WoW 8.x.x + - L_UIDropDownMenu_AddSeparator(info, level) == > L_UIDropDownMenu_AddSeparator(level) + No need to specify info there to prevent from messing up other menu items if info is to be re-used. +- Fixed the lib's major version. + Previously with the wrong major version which also has the release version, it makes all the different versions of lib to be presented + as different entities, which means newer version won't replace the older version. The latest loaded one will replace all the constants + and functions. + This change will take effect until all the addons which embed this lib to replace with latest version. + +v1.07.7030525961 (2018/04/23) +----------------------------- +- Remove external +- Refine upvalue and local function pre-definition +- Rename local parameters to make them consistent with others + +v1.07.7030024931 (2017/08/31) +----------------------------- +- Remove PlaySound compact code. + +v1.06.7030024931 (2017/08/31) +----------------------------- +- Remove PlaySound compact code. + +v1.05.7030024920 (2017/08/29) +----------------------------- +- ToC update to support WoW 7.3.0 + +v1.04.7030024484 (2017/07/02) +----------------------------- +- Changed soundkit's ID to key indicator likes SOUNDKIT.U_CHAT_SCROLL_BUTTON + +v1.03.7030024484 (2017/06/30) +----------------------------- +- Update version number + +v1.02.7030024484 (2017/06/30) +----------------------------- +- Updated PlaySound API's usage method to support both 7.2.5 and 7.3.0 of WoW clients + +v1.01.7020024015 (2017/05/25) +---------------------------- +- Fixed the wrong name of LibEasyMenu.lua specified in LibUIDropDownMenu.xml + +v1.00.7020024015 (2017/05/24) +---------------------------- +- Clone from NoTaint_UIDropDownMenu v7.2.0.24015-r2 +- Changed LIB_ and Lib_ to L_ to prevent from conflict with outdated + NoTaint_UIDropDownMenu being loaded from other addons diff --git a/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/LibStub.lua b/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/LibStub.lua new file mode 100644 index 0000000..7e9b5cd --- /dev/null +++ b/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/LibStub.lua @@ -0,0 +1,51 @@ +-- $Id: LibStub.lua 103 2014-10-16 03:02:50Z mikk $ +-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/addons/libstub/ for more info +-- LibStub is hereby placed in the Public Domain +-- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke +local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS! +local LibStub = _G[LIBSTUB_MAJOR] + +-- Check to see is this version of the stub is obsolete +if not LibStub or LibStub.minor < LIBSTUB_MINOR then + LibStub = LibStub or {libs = {}, minors = {} } + _G[LIBSTUB_MAJOR] = LibStub + LibStub.minor = LIBSTUB_MINOR + + -- LibStub:NewLibrary(major, minor) + -- major (string) - the major version of the library + -- minor (string or number ) - the minor version of the library + -- + -- returns nil if a newer or same version of the lib is already present + -- returns empty library object or old library object if upgrade is needed + function LibStub:NewLibrary(major, minor) + assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)") + minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.") + + local oldminor = self.minors[major] + if oldminor and oldminor >= minor then return nil end + self.minors[major], self.libs[major] = minor, self.libs[major] or {} + return self.libs[major], oldminor + end + + -- LibStub:GetLibrary(major, [silent]) + -- major (string) - the major version of the library + -- silent (boolean) - if true, library is optional, silently return nil if its not found + -- + -- throws an error if the library can not be found (except silent is set) + -- returns the library object if found + function LibStub:GetLibrary(major, silent) + if not self.libs[major] and not silent then + error(("Cannot find a library instance of %q."):format(tostring(major)), 2) + end + return self.libs[major], self.minors[major] + end + + -- LibStub:IterateLibraries() + -- + -- Returns an iterator for the currently registered libraries + function LibStub:IterateLibraries() + return pairs(self.libs) + end + + setmetatable(LibStub, { __call = LibStub.GetLibrary }) +end diff --git a/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/LibStub.toc b/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/LibStub.toc new file mode 100644 index 0000000..6e4cca9 --- /dev/null +++ b/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/LibStub.toc @@ -0,0 +1,9 @@ +## Interface: 90005 +## Title: Lib: LibStub +## Notes: Universal Library Stub +## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel +## X-Website: http://www.wowace.com/addons/libstub/ +## X-Category: Library +## X-License: Public Domain + +LibStub.lua diff --git a/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test.lua b/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test.lua new file mode 100644 index 0000000..276ddab --- /dev/null +++ b/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test.lua @@ -0,0 +1,41 @@ +debugstack = debug.traceback +strmatch = string.match + +loadfile("../LibStub.lua")() + +local lib, oldMinor = LibStub:NewLibrary("Pants", 1) -- make a new thingy +assert(lib) -- should return the library table +assert(not oldMinor) -- should not return the old minor, since it didn't exist + +-- the following is to create data and then be able to check if the same data exists after the fact +function lib:MyMethod() +end +local MyMethod = lib.MyMethod +lib.MyTable = {} +local MyTable = lib.MyTable + +local newLib, newOldMinor = LibStub:NewLibrary("Pants", 1) -- try to register a library with the same version, should silently fail +assert(not newLib) -- should not return since out of date + +local newLib, newOldMinor = LibStub:NewLibrary("Pants", 0) -- try to register a library with a previous, should silently fail +assert(not newLib) -- should not return since out of date + +local newLib, newOldMinor = LibStub:NewLibrary("Pants", 2) -- register a new version +assert(newLib) -- library table +assert(rawequal(newLib, lib)) -- should be the same reference as the previous +assert(newOldMinor == 1) -- should return the minor version of the previous version + +assert(rawequal(lib.MyMethod, MyMethod)) -- verify that values were saved +assert(rawequal(lib.MyTable, MyTable)) -- verify that values were saved + +local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 3 Blah") -- register a new version with a string minor version (instead of a number) +assert(newLib) -- library table +assert(newOldMinor == 2) -- previous version was 2 + +local newLib, newOldMinor = LibStub:NewLibrary("Pants", "Blah 4 and please ignore 15 Blah") -- register a new version with a string minor version (instead of a number) +assert(newLib) +assert(newOldMinor == 3) -- previous version was 3 (even though it gave a string) + +local newLib, newOldMinor = LibStub:NewLibrary("Pants", 5) -- register a new library, using a normal number instead of a string +assert(newLib) +assert(newOldMinor == 4) -- previous version was 4 (even though it gave a string) \ No newline at end of file diff --git a/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test2.lua b/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test2.lua new file mode 100644 index 0000000..eae7172 --- /dev/null +++ b/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test2.lua @@ -0,0 +1,27 @@ +debugstack = debug.traceback +strmatch = string.match + +loadfile("../LibStub.lua")() + +for major, library in LibStub:IterateLibraries() do + -- check that MyLib doesn't exist yet, by iterating through all the libraries + assert(major ~= "MyLib") +end + +assert(not LibStub:GetLibrary("MyLib", true)) -- check that MyLib doesn't exist yet by direct checking +assert(not pcall(LibStub.GetLibrary, LibStub, "MyLib")) -- don't silently fail, thus it should raise an error. +local lib = LibStub:NewLibrary("MyLib", 1) -- create the lib +assert(lib) -- check it exists +assert(rawequal(LibStub:GetLibrary("MyLib"), lib)) -- verify that :GetLibrary("MyLib") properly equals the lib reference + +assert(LibStub:NewLibrary("MyLib", 2)) -- create a new version + +local count=0 +for major, library in LibStub:IterateLibraries() do + -- check that MyLib exists somewhere in the libraries, by iterating through all the libraries + if major == "MyLib" then -- we found it! + count = count +1 + assert(rawequal(library, lib)) -- verify that the references are equal + end +end +assert(count == 1) -- verify that we actually found it, and only once diff --git a/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test3.lua b/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test3.lua new file mode 100644 index 0000000..30f7b94 --- /dev/null +++ b/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test3.lua @@ -0,0 +1,14 @@ +debugstack = debug.traceback +strmatch = string.match + +loadfile("../LibStub.lua")() + +local proxy = newproxy() -- non-string + +assert(not pcall(LibStub.NewLibrary, LibStub, proxy, 1)) -- should error, proxy is not a string, it's userdata +local success, ret = pcall(LibStub.GetLibrary, proxy, true) +assert(not success or not ret) -- either error because proxy is not a string or because it's not actually registered. + +assert(not pcall(LibStub.NewLibrary, LibStub, "Something", "No number in here")) -- should error, minor has no string in it. + +assert(not LibStub:GetLibrary("Something", true)) -- shouldn't've created it from the above statement \ No newline at end of file diff --git a/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test4.lua b/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test4.lua new file mode 100644 index 0000000..43eb338 --- /dev/null +++ b/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test4.lua @@ -0,0 +1,41 @@ +debugstack = debug.traceback +strmatch = string.match + +loadfile("../LibStub.lua")() + + +-- Pretend like loaded libstub is old and doesn't have :IterateLibraries +assert(LibStub.minor) +LibStub.minor = LibStub.minor - 0.0001 +LibStub.IterateLibraries = nil + +loadfile("../LibStub.lua")() + +assert(type(LibStub.IterateLibraries)=="function") + + +-- Now pretend that we're the same version -- :IterateLibraries should NOT be re-created +LibStub.IterateLibraries = 123 + +loadfile("../LibStub.lua")() + +assert(LibStub.IterateLibraries == 123) + + +-- Now pretend that a newer version is loaded -- :IterateLibraries should NOT be re-created +LibStub.minor = LibStub.minor + 0.0001 + +loadfile("../LibStub.lua")() + +assert(LibStub.IterateLibraries == 123) + + +-- Again with a huge number +LibStub.minor = LibStub.minor + 1234567890 + +loadfile("../LibStub.lua")() + +assert(LibStub.IterateLibraries == 123) + + +print("OK") \ No newline at end of file diff --git a/Titan/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibEasyMenu.lua b/Titan/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibEasyMenu.lua new file mode 100644 index 0000000..2954463 --- /dev/null +++ b/Titan/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibEasyMenu.lua @@ -0,0 +1,44 @@ +--$Id: LibEasyMenu.lua 64 2020-11-18 13:13:15Z arithmandar $ +-- ////////////////////////////////////////////////////////////// +-- Notes: +-- Functions have been moved to under LibUIDropDownMenu.lua +-- New function calls are as below: +-- +-- - lib:EasyMenu(menuList, menuFrame, anchor, x, y, displayMode, autoHideDelay ) +-- - lib:EasyMenu_Initialize( frame, level, menuList ) +-- +-- ////////////////////////////////////////////////////////////// +-- Simplified Menu Display System +-- This is a basic system for displaying a menu from a structure table. +-- +-- See UIDropDownMenu.lua for the menuList details. +-- +-- Args: +-- menuList - menu table +-- menuFrame - the UI frame to populate +-- anchor - where to anchor the frame (e.g. CURSOR) +-- x - x offset +-- y - y offset +-- displayMode - border type +-- autoHideDelay - how long until the menu disappears +-- +-- +--[[ +function EasyMenu(menuList, menuFrame, anchor, x, y, displayMode, autoHideDelay ) + if ( displayMode == "MENU" ) then + menuFrame.displayMode = displayMode; + end + UIDropDownMenu_Initialize(menuFrame, EasyMenu_Initialize, displayMode, nil, menuList); + ToggleDropDownMenu(1, nil, menuFrame, anchor, x, y, menuList, nil, autoHideDelay); +end + +function EasyMenu_Initialize( frame, level, menuList ) + for index = 1, #menuList do + local value = menuList[index] + if (value.text) then + value.index = index; + UIDropDownMenu_AddButton( value, level ); + end + end +end +]] diff --git a/Titan/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibUIDropDownMenu.lua b/Titan/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibUIDropDownMenu.lua new file mode 100644 index 0000000..8898ed0 --- /dev/null +++ b/Titan/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibUIDropDownMenu.lua @@ -0,0 +1,2328 @@ +-- $Id: LibUIDropDownMenu.lua 123 2023-07-29 01:42:12Z arithmandar $ +-- ---------------------------------------------------------------------------- +-- Localized Lua globals. +-- ---------------------------------------------------------------------------- +local _G = getfenv(0) +local tonumber, type, string, table = _G.tonumber, _G.type, _G.string, _G.table +local tinsert = table.insert +local strsub, strlen, strmatch, gsub = _G.strsub, _G.strlen, _G.strmatch, _G.gsub +local max, match = _G.max, _G.match +local securecall, issecure = _G.securecall, _G.issecure +local wipe = table.wipe +-- WoW +local CreateFrame, GetCursorPosition, GetCVar, GetScreenHeight, GetScreenWidth, PlaySound = _G.CreateFrame, _G.GetCursorPosition, _G.GetCVar, _G.GetScreenHeight, _G.GetScreenWidth, _G.PlaySound +local GetBuildInfo = _G.GetBuildInfo +local GameTooltip, GetAppropriateTooltip, tooltip, GetValueOrCallFunction +local CloseMenus, ShowUIPanel = _G.CloseMenus, _G.ShowUIPanel +local GameTooltip_SetTitle, GameTooltip_AddInstructionLine, GameTooltip_AddNormalLine, GameTooltip_AddColoredLine = _G.GameTooltip_SetTitle, _G.GameTooltip_AddInstructionLine, _G.GameTooltip_AddNormalLine, _G.GameTooltip_AddColoredLine + +-- ---------------------------------------------------------------------------- +local MAJOR_VERSION = "LibUIDropDownMenu-4.0" +local MINOR_VERSION = 90000 + tonumber(("$Rev: 123 $"):match("%d+")) + + +local LibStub = _G.LibStub +if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end +local lib = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION) +if not lib then return end + +-- Determine WoW TOC Version +local WoWClassicEra, WoWClassicTBC, WoWWOTLKC, WoWRetail +local wowversion = select(4, GetBuildInfo()) +if wowversion < 20000 then + WoWClassicEra = true +elseif wowversion < 30000 then + WoWClassicTBC = true +elseif wowversion < 40000 then + WoWWOTLKC = true +elseif wowversion > 90000 then + WoWRetail = true + +else + -- n/a +end + +if WoWClassicEra or WoWClassicTBC or WoWWOTLKC then + GameTooltip = _G.GameTooltip + tooltip = GameTooltip +else -- Retail + GetAppropriateTooltip = _G.GetAppropriateTooltip + tooltip = GetAppropriateTooltip() + GetValueOrCallFunction = _G.GetValueOrCallFunction +end + +-- ////////////////////////////////////////////////////////////// +L_UIDROPDOWNMENU_MINBUTTONS = 8; -- classic only +L_UIDROPDOWNMENU_MAXBUTTONS = 1; +L_UIDROPDOWNMENU_MAXLEVELS = 3; +L_UIDROPDOWNMENU_BUTTON_HEIGHT = 16; +L_UIDROPDOWNMENU_BORDER_HEIGHT = 15; +-- The current open menu +L_UIDROPDOWNMENU_OPEN_MENU = nil; +-- The current menu being initialized +L_UIDROPDOWNMENU_INIT_MENU = nil; +-- Current level shown of the open menu +L_UIDROPDOWNMENU_MENU_LEVEL = 1; +-- Current value of the open menu +L_UIDROPDOWNMENU_MENU_VALUE = nil; +-- Time to wait to hide the menu +L_UIDROPDOWNMENU_SHOW_TIME = 2; +-- Default dropdown text height +L_UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT = nil; +-- For Classic checkmarks, this is the additional padding that we give to the button text. +L_UIDROPDOWNMENU_CLASSIC_CHECK_PADDING = 4; +-- Default dropdown width padding +L_UIDROPDOWNMENU_DEFAULT_WIDTH_PADDING = 25; +-- List of open menus +L_OPEN_DROPDOWNMENUS = {}; + +local L_DropDownList1, L_DropDownList2, L_DropDownList3 + +local delegateFrame = CreateFrame("FRAME"); +delegateFrame:SetScript("OnAttributeChanged", function(self, attribute, value) + if ( attribute == "createframes" and value == true ) then + lib:UIDropDownMenu_CreateFrames(self:GetAttribute("createframes-level"), self:GetAttribute("createframes-index")); + elseif ( attribute == "initmenu" ) then + L_UIDROPDOWNMENU_INIT_MENU = value; + elseif ( attribute == "openmenu" ) then + L_UIDROPDOWNMENU_OPEN_MENU = value; + end +end); + +function lib:UIDropDownMenu_InitializeHelper(frame) + -- This deals with the potentially tainted stuff! + if ( frame ~= L_UIDROPDOWNMENU_OPEN_MENU ) then + L_UIDROPDOWNMENU_MENU_LEVEL = 1; + end + + -- Set the frame that's being intialized + delegateFrame:SetAttribute("initmenu", frame); + + -- Hide all the buttons + local button, dropDownList; + for i = 1, L_UIDROPDOWNMENU_MAXLEVELS, 1 do + dropDownList = _G["L_DropDownList"..i]; + if ( i >= L_UIDROPDOWNMENU_MENU_LEVEL or frame ~= L_UIDROPDOWNMENU_OPEN_MENU ) then + dropDownList.numButtons = 0; + dropDownList.maxWidth = 0; + for j=1, L_UIDROPDOWNMENU_MAXBUTTONS, 1 do + button = _G["L_DropDownList"..i.."Button"..j]; + button:Hide(); + end + dropDownList:Hide(); + end + end + frame:SetHeight(L_UIDROPDOWNMENU_BUTTON_HEIGHT * 2); +end + +function lib:UIDropDownMenuButton_ShouldShowIconTooltip(self) + if self.Icon and (self.iconTooltipTitle or self.iconTooltipText) and (self.icon or self.mouseOverIcon) then + return GetMouseFocus() == self.Icon; + end + return false; +end + + +-- ////////////////////////////////////////////////////////////// +-- L_UIDropDownMenuButtonTemplate +local function create_MenuButton(name, parent) + -- UIDropDownMenuButton Scripts BEGIN + local function button_OnEnter(self) + if ( self.hasArrow ) then + local level = self:GetParent():GetID() + 1; + local listFrame = _G["L_DropDownList"..level]; + if ( not listFrame or not listFrame:IsShown() or select(2, listFrame:GetPoint(1)) ~= self ) then + lib:ToggleDropDownMenu(self:GetParent():GetID() + 1, self.value, nil, nil, nil, nil, self.menuList, self, nil, self.menuListDisplayMode); + end + else + lib:CloseDropDownMenus(self:GetParent():GetID() + 1); + end + self.Highlight:Show(); + if (WoWClassicEra or WoWClassicTBC or WoWWOTLKC) then + lib:UIDropDownMenu_StopCounting(self:GetParent()); + end + -- To check: do we need special handle for classic since there is no UIDropDownMenuButton_ShouldShowIconTooltip()? + -- if ( self.tooltipTitle and not self.noTooltipWhileEnabled ) then + if ( self.tooltipTitle and not self.noTooltipWhileEnabled and not lib:UIDropDownMenuButton_ShouldShowIconTooltip(self)) then + if ( self.tooltipOnButton ) then + tooltip:SetOwner(self, "ANCHOR_RIGHT"); + GameTooltip_SetTitle(tooltip, self.tooltipTitle); + if self.tooltipInstruction then + GameTooltip_AddInstructionLine(tooltip, self.tooltipInstruction); + end + if self.tooltipText then + GameTooltip_AddNormalLine(tooltip, self.tooltipText, true); + end + if self.tooltipWarning then + GameTooltip_AddColoredLine(tooltip, self.tooltipWarning, RED_FONT_COLOR, true); + end + if self.tooltipBackdropStyle then + SharedTooltip_SetBackdropStyle(tooltip, self.tooltipBackdropStyle); + end + tooltip:Show(); + end + end + + if ( self.mouseOverIcon ~= nil ) then + self.Icon:SetTexture(self.mouseOverIcon); + self.Icon:Show(); + end + if (WoWRetail) then + GetValueOrCallFunction(self, "funcOnEnter", self); + end + end + + local function button_OnLeave(self) + self.Highlight:Hide(); + if (WoWClassicEra or WoWClassicTBC or WoWWOTLKC) then + lib:UIDropDownMenu_StartCounting(self:GetParent()); + end + + tooltip:Hide(); + + if ( self.mouseOverIcon ~= nil ) then + if ( self.icon ~= nil ) then + self.Icon:SetTexture(self.icon); + else + self.Icon:Hide(); + end + end + + if (WoWRetail) then + GetValueOrCallFunction(self, "funcOnLeave", self); + end + end + + local function button_OnClick(self, button) + local checked = self.checked; + if ( type (checked) == "function" ) then + checked = checked(self); + end + + if ( self.keepShownOnClick ) then + if not self.notCheckable then + if ( checked ) then + _G[self:GetName().."Check"]:Hide(); + _G[self:GetName().."UnCheck"]:Show(); + checked = false; + else + _G[self:GetName().."Check"]:Show(); + _G[self:GetName().."UnCheck"]:Hide(); + checked = true; + end + end + else + self:GetParent():Hide(); + end + + if ( type (self.checked) ~= "function" ) then + self.checked = checked; + end + + -- saving this here because func might use a dropdown, changing this self's attributes + local playSound = true; + if ( self.noClickSound ) then + playSound = false; + end + + local func = self.func; + if ( func ) then + func(self, self.arg1, self.arg2, checked, button); + else + return; + end + + if ( playSound ) then + PlaySound(SOUNDKIT.U_CHAT_SCROLL_BUTTON); + end + end + -- UIDropDownMenuButton Scripts END + + -- UIDropDownMenuButtonIcon Script BEGIN + local function icon_OnClick(self, button) + local button = self:GetParent() + if not button then + return + end + button_OnClick(self, button) + end + + local function icon_OnEnter(self) + local button = self:GetParent(); + if not button then + return; + end + + local shouldShowIconTooltip = lib:UIDropDownMenuButton_ShouldShowIconTooltip(button); + + if shouldShowIconTooltip then + tooltip:SetOwner(button, "ANCHOR_RIGHT"); + if button.iconTooltipTitle then + GameTooltip_SetTitle(tooltip, button.iconTooltipTitle); + end + if button.iconTooltipText then + GameTooltip_AddNormalLine(tooltip, button.iconTooltipText, true); + end + if button.iconTooltipBackdropStyle then + SharedTooltip_SetBackdropStyle(tooltip, button.iconTooltipBackdropStyle); + end + tooltip:Show(); + end + button_OnEnter(button); + end + + local function icon_OnLeave(self) + local button = self:GetParent(); + if not button then + return; + end + + button_OnLeave(button); + end + local function icon_OnMouseUp(self, button) + if ( button == "LeftButton" ) then + icon_OnClick(self, button) + end + end + -- UIDropDownMenuButtonIcon Script END + + local f = CreateFrame("Button", name, parent or nil) + f:SetWidth(100) + f:SetHeight(16) + f:SetFrameLevel(f:GetParent():GetFrameLevel()+2) + + f.Highlight = f:CreateTexture(name.."Highlight", "BACKGROUND") + f.Highlight:SetTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight") + f.Highlight:SetBlendMode("ADD") + f.Highlight:SetAllPoints() + f.Highlight:Hide() + + f.Check = f:CreateTexture(name.."Check", "ARTWORK") + f.Check:SetTexture("Interface\\Common\\UI-DropDownRadioChecks") + f.Check:SetSize(16, 16) + f.Check:SetPoint("LEFT", f, 0, 0) + f.Check:SetTexCoord(0, 0.5, 0.5, 1) + + f.UnCheck = f:CreateTexture(name.."UnCheck", "ARTWORK") + f.UnCheck:SetTexture("Interface\\Common\\UI-DropDownRadioChecks") + f.UnCheck:SetSize(16, 16) + f.UnCheck:SetPoint("LEFT", f, 0, 0) + f.UnCheck:SetTexCoord(0.5, 1, 0.5, 1) + + local fIcon + fIcon = f:CreateTexture(name.."Icon", "ARTWORK") + fIcon:SetSize(16, 16) + fIcon:SetPoint("RIGHT", f, 0, 0) + fIcon:Hide() + if (WoWRetail) then + fIcon:SetScript("OnEnter", function(self) + icon_OnEnter(self) + end) + fIcon:SetScript("OnLeave", function(self) + icon_OnLeave(self) + end) + fIcon:SetScript("OnMouseUp", function(self, button) + icon_OnMouseUp(self, button) + end) + end + f.Icon = fIcon + + -- ColorSwatch + local fcw + fcw = CreateFrame("Button", name.."ColorSwatch", f, BackdropTemplateMixin and DropDownMenuButtonMixin and "BackdropTemplate,ColorSwatchTemplate" or BackdropTemplateMixin and "BackdropTemplate" or nil) + fcw:SetPoint("RIGHT", f, -6, 0) + fcw:Hide() + if not DropDownMenuButtonMixin then + fcw:SetSize(16, 16) + fcw.SwatchBg = fcw:CreateTexture(name.."ColorSwatchSwatchBg", "BACKGROUND") + fcw.SwatchBg:SetVertexColor(1, 1, 1) + fcw.SwatchBg:SetWidth(14) + fcw.SwatchBg:SetHeight(14) + fcw.SwatchBg:SetPoint("CENTER", fcw, 0, 0) + local button1NormalTexture = fcw:CreateTexture(name.."ColorSwatchNormalTexture") + button1NormalTexture:SetTexture("Interface\\ChatFrame\\ChatFrameColorSwatch") + button1NormalTexture:SetAllPoints() + fcw:SetNormalTexture(button1NormalTexture) + end + fcw:SetScript("OnClick", function(self, button, down) + CloseMenus() + lib:UIDropDownMenuButton_OpenColorPicker(self:GetParent()) + end) + fcw:SetScript("OnEnter", function(self, motion) + lib:CloseDropDownMenus(self:GetParent():GetParent():GetID() + 1) + _G[self:GetName().."SwatchBg"]:SetVertexColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b) + lib:UIDropDownMenu_StopCounting(self:GetParent():GetParent()) + end) + fcw:SetScript("OnLeave", function(self, motion) + _G[self:GetName().."SwatchBg"]:SetVertexColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b); + lib:UIDropDownMenu_StartCounting(self:GetParent():GetParent()) + end) + f.ColorSwatch = fcw + + -- ExpandArrow + local fea = CreateFrame("Button", name.."ExpandArrow", f) + + fea:SetSize(16, 16) + fea:SetPoint("RIGHT", f, 0, 0) + fea:Hide() + local button2NormalTexture = fea:CreateTexture(name.."ExpandArrowNormalTexture") + button2NormalTexture:SetTexture("Interface\\ChatFrame\\ChatFrameExpandArrow") + button2NormalTexture:SetAllPoints() + fea:SetNormalTexture(button2NormalTexture) + fea:SetScript("OnMouseDown", function(self, button) + if self:IsEnabled() then + lib:ToggleDropDownMenu(self:GetParent():GetParent():GetID() + 1, self:GetParent().value, nil, nil, nil, nil, self:GetParent().menuList, self); + PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON); + end + end) + fea:SetScript("OnEnter", function(self, motion) + local level = self:GetParent():GetParent():GetID() + 1 + lib:CloseDropDownMenus(level) + if self:IsEnabled() then + local listFrame = _G["L_DropDownList"..level]; + if ( not listFrame or not listFrame:IsShown() or select(2, listFrame:GetPoint()) ~= self ) then + lib:ToggleDropDownMenu(level, self:GetParent().value, nil, nil, nil, nil, self:GetParent().menuList, self) + end + end + lib:UIDropDownMenu_StopCounting(self:GetParent():GetParent()) + end) + fea:SetScript("OnLeave", function(self, motion) + lib:UIDropDownMenu_StartCounting(self:GetParent():GetParent()) + end) + f.ExpandArrow = fea + + -- InvisibleButton + local fib = CreateFrame("Button", name.."InvisibleButton", f) + fib:Hide() + fib:SetPoint("TOPLEFT", f, 0, 0) + fib:SetPoint("BOTTOMLEFT", f, 0, 0) + fib:SetPoint("RIGHT", fcw, "LEFT", 0, 0) + fib:SetScript("OnEnter", function(self, motion) + if (WoWClassicEra or WoWClassicTBC or WoWWOTLKC) then + lib:UIDropDownMenu_StopCounting(self:GetParent():GetParent()); + end + lib:CloseDropDownMenus(self:GetParent():GetParent():GetID() + 1); + local parent = self:GetParent(); + if ( parent.tooltipTitle and parent.tooltipWhileDisabled) then + if ( parent.tooltipOnButton ) then + tooltip:SetOwner(parent, "ANCHOR_RIGHT"); + GameTooltip_SetTitle(tooltip, parent.tooltipTitle); + if parent.tooltipInstruction then + GameTooltip_AddInstructionLine(tooltip, parent.tooltipInstruction); + end + if parent.tooltipText then + GameTooltip_AddNormalLine(tooltip, parent.tooltipText, true); + end + if parent.tooltipWarning then + GameTooltip_AddColoredLine(tooltip, parent.tooltipWarning, RED_FONT_COLOR, true); + end + if parent.tooltipBackdropStyle then + SharedTooltip_SetBackdropStyle(tooltip, parent.tooltipBackdropStyle); + end + tooltip:Show(); + end + end + end) + fib:SetScript("OnLeave", function(self, motion) + if (WoWClassicEra or WoWClassicTBC or WoWWOTLKC) then + lib:UIDropDownMenu_StartCounting(self:GetParent():GetParent()); + end + tooltip:Hide(); + end) + f.invisibleButton = fib + + f:SetScript("OnClick", function(self, button) + button_OnClick(self, button) + end) + f:SetScript("OnEnter", function(self, motion) + button_OnEnter(self) + end) + f:SetScript("OnLeave", function(self, motion) + button_OnLeave(self) + end) + f:SetScript("OnEnable", function(self) + self.invisibleButton:Hide() + end) + f:SetScript("OnDisable", function(self) + self.invisibleButton:Show() + end) + + local text1 = f:CreateFontString(name.."NormalText") + f:SetFontString(text1) + text1:SetPoint("LEFT", f, -5, 0) + f:SetNormalFontObject("GameFontHighlightSmallLeft") + f:SetHighlightFontObject("GameFontHighlightSmallLeft") + f:SetDisabledFontObject("GameFontDisableSmallLeft") + + return f +end + +-- ////////////////////////////////////////////////////////////// +-- L_UIDropDownListTemplate +local function creatre_DropDownList(name, parent) + -- This has been removed from Backdrop.lua, so we added the definition here. + local BACKDROP_DIALOG_DARK = { + bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background-Dark", + edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", + tile = true, + tileEdge = true, + tileSize = 32, + edgeSize = 32, + insets = { left = 11, right = 12, top = 12, bottom = 11, }, + } + local BACKDROP_TOOLTIP_16_16_5555 = { + bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", + edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", + tile = true, + tileEdge = true, + tileSize = 16, + edgeSize = 16, + insets = { left = 5, right = 5, top = 5, bottom = 5 }, + } + + local f = _G[name] or CreateFrame("Button", name) + f:SetParent(parent or nil) + f:Hide() + f:SetFrameStrata("DIALOG") + f:EnableMouse(true) + + local fbd = _G[name.."Backdrop"] or CreateFrame("Frame", name.."Backdrop", f, BackdropTemplateMixin and "DialogBorderDarkTemplate" or nil) + fbd:SetAllPoints() + fbd.backdropInfo = BACKDROP_DIALOG_DARK + f.Backdrop = fbd + + local fmb = _G[name.."MenuBackdrop"] or CreateFrame("Frame", name.."MenuBackdrop", f, TooltipBackdropTemplateMixin and "TooltipBackdropTemplate" or nil) + fmb:SetAllPoints() + fmb.backdropInfo = BACKDROP_TOOLTIP_16_16_5555 + fmb:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b) + fmb:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b) + f.MenuBackdrop = fmb + + f.Button1 = _G[name.."Button1"] or create_MenuButton(name.."Button1", f) -- to replace the inherits of "UIDropDownMenuButtonTemplate" + f.Button1:SetID(1) + + f:SetScript("OnClick", function(self) + self:Hide() + end) + f:SetScript("OnEnter", function(self, motion) + if (WoWClassicEra or WoWClassicTBC or WoWWOTLKC) then + lib:UIDropDownMenu_StopCounting(self, motion) + end + end) + f:SetScript("OnLeave", function(self, motion) + if (WoWClassicEra or WoWClassicTBC or WoWWOTLKC) then + lib:UIDropDownMenu_StartCounting(self, motion) + end + end) + -- If dropdown is visible then see if its timer has expired, if so hide the frame + f:SetScript("OnUpdate", function(self, elapsed) + if ( self.shouldRefresh ) then + lib:UIDropDownMenu_RefreshDropDownSize(self); + self.shouldRefresh = false; + end + if (WoWClassicEra or WoWClassicTBC or WoWWOTLKC) then + if ( not self.showTimer or not self.isCounting ) then + return; + elseif ( self.showTimer < 0 ) then + self:Hide(); + self.showTimer = nil; + self.isCounting = nil; + else + self.showTimer = self.showTimer - elapsed; + end + end + end) + f:SetScript("OnShow", function(self) + if ( self.onShow ) then + self.onShow(); + self.onShow = nil; + end + + for i=1, L_UIDROPDOWNMENU_MAXBUTTONS do + if (not self.noResize) then + _G[self:GetName().."Button"..i]:SetWidth(self.maxWidth); + end + end + + if (not self.noResize) then + self:SetWidth(self.maxWidth+25); + end + if (WoWClassicEra or WoWClassicTBC or WoWWOTLKC) then + self.showTimer = nil; + end + if ( self:GetID() > 1 ) then + self.parent = _G["L_DropDownList"..(self:GetID() - 1)]; + end + EventRegistry:TriggerEvent("UIDropDownMenu.Show", self); + end) + f:SetScript("OnHide", function(self) + local id = self:GetID() + if ( self.onHide ) then + self.onHide(id+1); + self.onHide = nil; + end + if ( self.baseFrameStrata ) then + self:SetFrameStrata(self.baseFrameStrata); + self.baseFrameStrata = nil; + end + lib:CloseDropDownMenus(id+1); + L_OPEN_DROPDOWNMENUS[id] = nil; + if (id == 1) then + L_UIDROPDOWNMENU_OPEN_MENU = nil; + end + + lib:UIDropDownMenu_ClearCustomFrames(self); + EventRegistry:TriggerEvent("UIDropDownMenu.Hide"); + end) + + return f +end + +-- ////////////////////////////////////////////////////////////// +-- L_UIDropDownMenuTemplate +local function create_DropDownMenu(name, parent) + local f + if type(name) == "table" then + f = name + name = f:GetName() + else + f = CreateFrame("Frame", name, parent or nil) + end + + if not name then name = "" end + + f:SetSize(40, 32) + + f.Left = f:CreateTexture(name.."Left", "ARTWORK") + f.Left:SetTexture("Interface\\Glues\\CharacterCreate\\CharacterCreate-LabelFrame") + f.Left:SetSize(25, 64) + f.Left:SetPoint("TOPLEFT", f, 0, 17) + f.Left:SetTexCoord(0, 0.1953125, 0, 1) + + f.Middle = f:CreateTexture(name.."Middle", "ARTWORK") + f.Middle:SetTexture("Interface\\Glues\\CharacterCreate\\CharacterCreate-LabelFrame") + f.Middle:SetSize(115, 64) + f.Middle:SetPoint("LEFT", f.Left, "RIGHT") + f.Middle:SetTexCoord(0.1953125, 0.8046875, 0, 1) + + f.Right = f:CreateTexture(name.."Right", "ARTWORK") + f.Right:SetTexture("Interface\\Glues\\CharacterCreate\\CharacterCreate-LabelFrame") + f.Right:SetSize(25, 64) + f.Right:SetPoint("LEFT", f.Middle, "RIGHT") + f.Right:SetTexCoord(0.8046875, 1, 0, 1) + + f.Text = f:CreateFontString(name.."Text", "ARTWORK", "GameFontHighlightSmall") + f.Text:SetWordWrap(false) + f.Text:SetJustifyH("RIGHT") + f.Text:SetSize(0, 10) + f.Text:SetPoint("RIGHT", f.Right, -43, 2) + + f.Icon = f:CreateTexture(name.."Icon", "OVERLAY") + f.Icon:Hide() + f.Icon:SetSize(16, 16) + f.Icon:SetPoint("LEFT", 30, 2) + + -- // UIDropDownMenuButtonScriptTemplate + f.Button = CreateFrame("Button", name.."Button", f) + f.Button:SetMotionScriptsWhileDisabled(true) + f.Button:SetSize(24, 24) + f.Button:SetPoint("TOPRIGHT", f.Right, -16, -18) + + f.Button.NormalTexture = f.Button:CreateTexture(name.."NormalTexture") + f.Button.NormalTexture:SetTexture("Interface\\ChatFrame\\UI-ChatIcon-ScrollDown-Up") + f.Button.NormalTexture:SetSize(24, 24) + f.Button.NormalTexture:SetPoint("RIGHT", f.Button, 0, 0) + f.Button:SetNormalTexture(f.Button.NormalTexture) + + f.Button.PushedTexture = f.Button:CreateTexture(name.."PushedTexture") + f.Button.PushedTexture:SetTexture("Interface\\ChatFrame\\UI-ChatIcon-ScrollDown-Down") + f.Button.PushedTexture:SetSize(24, 24) + f.Button.PushedTexture:SetPoint("RIGHT", f.Button, 0, 0) + f.Button:SetPushedTexture(f.Button.PushedTexture) + + f.Button.DisabledTexture = f.Button:CreateTexture(name.."DisabledTexture") + f.Button.DisabledTexture:SetTexture("Interface\\ChatFrame\\UI-ChatIcon-ScrollDown-Disabled") + f.Button.DisabledTexture:SetSize(24, 24) + f.Button.DisabledTexture:SetPoint("RIGHT", f.Button, 0, 0) + f.Button:SetDisabledTexture(f.Button.DisabledTexture) + + f.Button.HighlightTexture = f.Button:CreateTexture(name.."HighlightTexture") + f.Button.HighlightTexture:SetTexture("Interface\\Buttons\\UI-Common-MouseHilight") + f.Button.HighlightTexture:SetSize(24, 24) + f.Button.HighlightTexture:SetPoint("RIGHT", f.Button, 0, 0) + f.Button.HighlightTexture:SetBlendMode("ADD") + f.Button:SetHighlightTexture(f.Button.HighlightTexture) + + -- Button Script + f.Button:SetScript("OnEnter", function(self, motion) + local parent = self:GetParent() + local myscript = parent:GetScript("OnEnter") + if(myscript ~= nil) then + myscript(parent) + end + end) + f.Button:SetScript("OnLeave", function(self, motion) + local parent = self:GetParent() + local myscript = parent:GetScript("OnLeave") + if(myscript ~= nil) then + myscript(parent) + end + end) + f.Button:SetScript("OnMouseDown", function(self, button) + if self:IsEnabled() then + local parent = self:GetParent() + lib:ToggleDropDownMenu(nil, nil, parent) + PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON) + end + end) + + -- UIDropDownMenu Script + f:SetScript("OnHide", function(self) + lib:CloseDropDownMenus() + end) + + return f +end +-- End of frame templates +-- ////////////////////////////////////////////////////////////// + +-- ////////////////////////////////////////////////////////////// +-- Handling two frames from LibUIDropDownMenu.xml +local function create_DropDownButtons() + L_DropDownList1 = creatre_DropDownList("L_DropDownList1") + L_DropDownList1:SetToplevel(true) + L_DropDownList1:SetFrameStrata("FULLSCREEN_DIALOG") + L_DropDownList1:Hide() + L_DropDownList1:SetID(1) + L_DropDownList1:SetSize(180, 10) + local _, fontHeight, _ = _G["L_DropDownList1Button1NormalText"]:GetFont() + L_UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT = fontHeight + + L_DropDownList2 = creatre_DropDownList("L_DropDownList2") + L_DropDownList2:SetToplevel(true) + L_DropDownList2:SetFrameStrata("FULLSCREEN_DIALOG") + L_DropDownList2:Hide() + L_DropDownList2:SetID(2) + L_DropDownList2:SetSize(180, 10) + + L_DropDownList3 = creatre_DropDownList("L_DropDownList3") + L_DropDownList3:SetToplevel(true) + L_DropDownList3:SetFrameStrata("FULLSCREEN_DIALOG") + L_DropDownList3:Hide() + L_DropDownList3:SetID(3) + L_DropDownList3:SetSize(180, 10) + + -- UIParent integration; since we customize the name of DropDownList, we need to add it to golbal UIMenus table. + --tinsert(UIMenus, "L_DropDownList1"); + --tinsert(UIMenus, "L_DropDownList2"); + --tinsert(UIMenus, "L_DropDownList3"); + + -- Alternative by Dahk Celes (DDC) that avoids tainting UIMenus and CloseMenus() + hooksecurefunc("CloseMenus", function() + L_DropDownList1:Hide() + L_DropDownList2:Hide() + L_DropDownList3:Hide() + end) +end + +do + if lib then + create_DropDownButtons() + end +end + +-- ////////////////////////////////////////////////////////////// +-- Global function to replace L_UIDropDownMenuTemplate +function lib:Create_UIDropDownMenu(name, parent) + return create_DropDownMenu(name, parent) +end + +local function GetChild(frame, name, key) + if (frame[key]) then + return frame[key]; + elseif name then + return _G[name..key]; + end + + return nil; +end + +function lib:UIDropDownMenu_Initialize(frame, initFunction, displayMode, level, menuList) + frame.menuList = menuList; + + --securecall("initializeHelper", frame); + lib:UIDropDownMenu_InitializeHelper(frame) + + -- Set the initialize function and call it. The initFunction populates the dropdown list. + if ( initFunction ) then + lib:UIDropDownMenu_SetInitializeFunction(frame, initFunction); + initFunction(frame, level, frame.menuList); + end + + --master frame + if(level == nil) then + level = 1; + end + + local dropDownList = _G["L_DropDownList"..level]; + dropDownList.dropdown = frame; + dropDownList.shouldRefresh = true; + + lib:UIDropDownMenu_SetDisplayMode(frame, displayMode); +end + +function lib:UIDropDownMenu_SetInitializeFunction(frame, initFunction) + frame.initialize = initFunction; +end + +function lib:UIDropDownMenu_SetDisplayMode(frame, displayMode) + -- Change appearance based on the displayMode + -- Note: this is a one time change based on previous behavior. + if ( displayMode == "MENU" ) then + local name = frame:GetName(); + GetChild(frame, name, "Left"):Hide(); + GetChild(frame, name, "Middle"):Hide(); + GetChild(frame, name, "Right"):Hide(); + local button = GetChild(frame, name, "Button"); + local buttonName = button:GetName(); + GetChild(button, buttonName, "NormalTexture"):SetTexture(nil); + GetChild(button, buttonName, "DisabledTexture"):SetTexture(nil); + GetChild(button, buttonName, "PushedTexture"):SetTexture(nil); + GetChild(button, buttonName, "HighlightTexture"):SetTexture(nil); + local text = GetChild(frame, name, "Text"); + + button:ClearAllPoints(); + button:SetPoint("LEFT", text, "LEFT", -9, 0); + button:SetPoint("RIGHT", text, "RIGHT", 6, 0); + frame.displayMode = "MENU"; + end +end + +function lib:UIDropDownMenu_SetFrameStrata(frame, frameStrata) + frame.listFrameStrata = frameStrata; +end + +function lib:UIDropDownMenu_RefreshDropDownSize(self) + self.maxWidth = lib:UIDropDownMenu_GetMaxButtonWidth(self); + self:SetWidth(self.maxWidth + 25); + + for i=1, L_UIDROPDOWNMENU_MAXBUTTONS, 1 do + local icon = _G[self:GetName().."Button"..i.."Icon"]; + + if ( icon.tFitDropDownSizeX ) then + icon:SetWidth(self.maxWidth - 5); + end + end +end + +-- Start the countdown on a frame +function lib:UIDropDownMenu_StartCounting(frame) + if ( frame.parent ) then + lib:UIDropDownMenu_StartCounting(frame.parent); + else + frame.showTimer = L_UIDROPDOWNMENU_SHOW_TIME; + frame.isCounting = 1; + end +end + +-- Stop the countdown on a frame +function lib:UIDropDownMenu_StopCounting(frame) + if ( frame.parent ) then + lib:UIDropDownMenu_StopCounting(frame.parent); + else + frame.isCounting = nil; + end +end + + +--[[ +List of button attributes +====================================================== +info.text = [STRING] -- The text of the button +info.value = [ANYTHING] -- The value that L_UIDROPDOWNMENU_MENU_VALUE is set to when the button is clicked +info.func = [function()] -- The function that is called when you click the button +info.checked = [nil, true, function] -- Check the button if true or function returns true +info.isNotRadio = [nil, true] -- Check the button uses radial image if false check box image if true +info.isTitle = [nil, true] -- If it's a title the button is disabled and the font color is set to yellow +info.disabled = [nil, true] -- Disable the button and show an invisible button that still traps the mouseover event so menu doesn't time out +info.tooltipWhileDisabled = [nil, 1] -- Show the tooltip, even when the button is disabled. +info.hasArrow = [nil, true] -- Show the expand arrow for multilevel menus +info.arrowXOffset = [nil, NUMBER] -- Number of pixels to shift the button's icon to the left or right (positive numbers shift right, negative numbers shift left). +info.hasColorSwatch = [nil, true] -- Show color swatch or not, for color selection +info.r = [1 - 255] -- Red color value of the color swatch +info.g = [1 - 255] -- Green color value of the color swatch +info.b = [1 - 255] -- Blue color value of the color swatch +info.colorCode = [STRING] -- "|cAARRGGBB" embedded hex value of the button text color. Only used when button is enabled +info.swatchFunc = [function()] -- Function called by the color picker on color change +info.hasOpacity = [nil, 1] -- Show the opacity slider on the colorpicker frame +info.opacity = [0.0 - 1.0] -- Percentatge of the opacity, 1.0 is fully shown, 0 is transparent +info.opacityFunc = [function()] -- Function called by the opacity slider when you change its value +info.cancelFunc = [function(previousValues)] -- Function called by the colorpicker when you click the cancel button (it takes the previous values as its argument) +info.notClickable = [nil, 1] -- Disable the button and color the font white +info.notCheckable = [nil, 1] -- Shrink the size of the buttons and don't display a check box +info.owner = [Frame] -- Dropdown frame that "owns" the current dropdownlist +info.keepShownOnClick = [nil, 1] -- Don't hide the dropdownlist after a button is clicked +info.tooltipTitle = [nil, STRING] -- Title of the tooltip shown on mouseover +info.tooltipText = [nil, STRING] -- Text of the tooltip shown on mouseover +info.tooltipWarning = [nil, STRING] -- Warning-style text of the tooltip shown on mouseover +info.tooltipInstruction = [nil, STRING] -- Instruction-style text of the tooltip shown on mouseover +info.tooltipOnButton = [nil, 1] -- Show the tooltip attached to the button instead of as a Newbie tooltip. +info.tooltipBackdropStyle = [nil, TABLE] -- Optional Backdrop style of the tooltip shown on mouseover +info.justifyH = [nil, "CENTER"] -- Justify button text +info.arg1 = [ANYTHING] -- This is the first argument used by info.func +info.arg2 = [ANYTHING] -- This is the second argument used by info.func +info.fontObject = [FONT] -- font object replacement for Normal and Highlight +info.menuList = [TABLE] -- This contains an array of info tables to be displayed as a child menu +info.menuListDisplayMode = [nil, "MENU"] -- If menuList is set, show the sub drop down with an override display mode. +info.noClickSound = [nil, 1] -- Set to 1 to suppress the sound when clicking the button. The sound only plays if .func is set. +info.padding = [nil, NUMBER] -- Number of pixels to pad the text on the right side +info.topPadding = [nil, NUMBER] -- Extra spacing between buttons. +info.leftPadding = [nil, NUMBER] -- Number of pixels to pad the button on the left side +info.minWidth = [nil, NUMBER] -- Minimum width for this line +info.customFrame = frame -- Allows this button to be a completely custom frame, should inherit from UIDropDownCustomMenuEntryTemplate and override appropriate methods. +info.icon = [TEXTURE] -- An icon for the button. +info.iconXOffset = [nil, NUMBER] -- Number of pixels to shift the button's icon to the left or right (positive numbers shift right, negative numbers shift left). +info.iconTooltipTitle = [nil, STRING] -- Title of the tooltip shown on icon mouseover +info.iconTooltipText = [nil, STRING] -- Text of the tooltip shown on icon mouseover +info.iconTooltipBackdropStyle = [nil, TABLE] -- Optional Backdrop style of the tooltip shown on icon mouseover +info.mouseOverIcon = [TEXTURE] -- An override icon when a button is moused over. +info.ignoreAsMenuSelection [nil, true] -- Never set the menu text/icon to this, even when this button is checked +info.registerForRightClick [nil, true] -- Register dropdown buttons for right clicks +info.registerForAnyClick [nil, true] -- Register dropdown buttons for any clicks +]] + +-- Create (return) empty table +function lib:UIDropDownMenu_CreateInfo() + return {}; +end + +function lib:UIDropDownMenu_CreateFrames(level, index) + while ( level > L_UIDROPDOWNMENU_MAXLEVELS ) do + L_UIDROPDOWNMENU_MAXLEVELS = L_UIDROPDOWNMENU_MAXLEVELS + 1; + --local newList = CreateFrame("Button", "L_DropDownList"..L_UIDROPDOWNMENU_MAXLEVELS, nil, "L_UIDropDownListTemplate"); + local newList = creatre_DropDownList("L_DropDownList"..L_UIDROPDOWNMENU_MAXLEVELS) + newList:SetFrameStrata("FULLSCREEN_DIALOG"); + newList:SetToplevel(true); + newList:Hide(); + newList:SetID(L_UIDROPDOWNMENU_MAXLEVELS); + newList:SetWidth(180) + newList:SetHeight(10) +-- for i = WoWRetail and 1 or (L_UIDROPDOWNMENU_MINBUTTONS+1), L_UIDROPDOWNMENU_MAXBUTTONS do + for i=1, L_UIDROPDOWNMENU_MAXBUTTONS do + --local newButton = CreateFrame("Button", "L_DropDownList"..L_UIDROPDOWNMENU_MAXLEVELS.."Button"..i, newList, "L_UIDropDownMenuButtonTemplate"); + local newButton = create_MenuButton("L_DropDownList"..L_UIDROPDOWNMENU_MAXLEVELS.."Button"..i, newList) + newButton:SetID(i); + end + end + + while ( index > L_UIDROPDOWNMENU_MAXBUTTONS ) do + L_UIDROPDOWNMENU_MAXBUTTONS = L_UIDROPDOWNMENU_MAXBUTTONS + 1; + for i=1, L_UIDROPDOWNMENU_MAXLEVELS do + --local newButton = CreateFrame("Button", "L_DropDownList"..i.."Button"..L_UIDROPDOWNMENU_MAXBUTTONS, _G["L_DropDownList"..i], "L_UIDropDownMenuButtonTemplate"); + local newButton = create_MenuButton("L_DropDownList"..i.."Button"..L_UIDROPDOWNMENU_MAXBUTTONS, _G["L_DropDownList"..i]) + newButton:SetID(L_UIDROPDOWNMENU_MAXBUTTONS); + end + end +end + +function lib:UIDropDownMenu_AddSeparator(level) + local separatorInfo = { + hasArrow = false; + dist = 0; + isTitle = true; + isUninteractable = true; + notCheckable = true; + iconOnly = true; + icon = "Interface\\Common\\UI-TooltipDivider-Transparent"; + tCoordLeft = 0; + tCoordRight = 1; + tCoordTop = 0; + tCoordBottom = 1; + tSizeX = 0; + tSizeY = 8; + tFitDropDownSizeX = true; + iconInfo = { + tCoordLeft = 0, + tCoordRight = 1, + tCoordTop = 0, + tCoordBottom = 1, + tSizeX = 0, + tSizeY = 8, + tFitDropDownSizeX = true + }, + }; + + lib:UIDropDownMenu_AddButton(separatorInfo, level); +end + +function lib:UIDropDownMenu_AddSpace(level) + local spaceInfo = { + hasArrow = false, + dist = 0, + isTitle = true, + isUninteractable = true, + notCheckable = true, + }; + + lib:UIDropDownMenu_AddButton(spaceInfo, level); +end + +function lib:UIDropDownMenu_AddButton(info, level) + --[[ + Might to uncomment this if there are performance issues + if ( not L_UIDROPDOWNMENU_OPEN_MENU ) then + return; + end + ]] + if ( not level ) then + level = 1; + end + + local listFrame = _G["L_DropDownList"..level]; + local index; + if (listFrame) then + index = listFrame.numButtons and (listFrame.numButtons + 1) or 1 + else + index = 0 + end + --local index = listFrame and (listFrame.numButtons + 1) or 1; + local width; + + delegateFrame:SetAttribute("createframes-level", level); + delegateFrame:SetAttribute("createframes-index", index); + delegateFrame:SetAttribute("createframes", true); + + listFrame = listFrame or _G["L_DropDownList"..level]; + local listFrameName = listFrame:GetName(); + + -- Set the number of buttons in the listframe + listFrame.numButtons = index; + + local button = _G[listFrameName.."Button"..index]; + local normalText = _G[button:GetName().."NormalText"]; + local icon = _G[button:GetName().."Icon"]; + -- This button is used to capture the mouse OnEnter/OnLeave events if the dropdown button is disabled, since a disabled button doesn't receive any events + -- This is used specifically for drop down menu time outs + local invisibleButton = _G[button:GetName().."InvisibleButton"]; + + -- Default settings + button:SetDisabledFontObject(GameFontDisableSmallLeft); + invisibleButton:Hide(); + button:Enable(); + + if ( info.registerForAnyClick ) then + button:RegisterForClicks("AnyUp"); + elseif ( info.registerForRightClick ) then + button:RegisterForClicks("LeftButtonUp", "RightButtonUp"); + else + button:RegisterForClicks("LeftButtonUp"); + end + + -- If not clickable then disable the button and set it white + if ( info.notClickable ) then + info.disabled = true; + button:SetDisabledFontObject(GameFontHighlightSmallLeft); + end + + -- Set the text color and disable it if its a title + if ( info.isTitle ) then + info.disabled = true; + button:SetDisabledFontObject(GameFontNormalSmallLeft); + end + + -- Disable the button if disabled and turn off the color code + if ( info.disabled ) then + button:Disable(); + invisibleButton:Show(); + info.colorCode = nil; + end + + -- If there is a color for a disabled line, set it + if( info.disablecolor ) then + info.colorCode = info.disablecolor; + end + + -- Configure button + if ( info.text ) then + -- look for inline color code this is only if the button is enabled + if ( info.colorCode ) then + button:SetText(info.colorCode..info.text.."|r"); + else + button:SetText(info.text); + end + + -- Set icon + if ( info.icon or info.mouseOverIcon ) then + icon:SetSize(16,16); + if (WoWRetail) then + if(info.icon and C_Texture.GetAtlasInfo(info.icon)) then + icon:SetAtlas(info.icon); + else + icon:SetTexture(info.icon); + end + icon:ClearAllPoints(); + icon:SetPoint("RIGHT", info.iconXOffset or 0, 0); + else + icon:SetTexture(info.icon); + icon:ClearAllPoints(); + icon:SetPoint("RIGHT"); + end + + if ( info.tCoordLeft ) then + icon:SetTexCoord(info.tCoordLeft, info.tCoordRight, info.tCoordTop, info.tCoordBottom); + else + icon:SetTexCoord(0, 1, 0, 1); + end + icon:Show(); + else + icon:Hide(); + end + + -- Check to see if there is a replacement font + if ( info.fontObject ) then + button:SetNormalFontObject(info.fontObject); + button:SetHighlightFontObject(info.fontObject); + else + button:SetNormalFontObject(GameFontHighlightSmallLeft); + button:SetHighlightFontObject(GameFontHighlightSmallLeft); + end + else + button:SetText(""); + icon:Hide(); + end + + button.iconOnly = nil; + button.icon = nil; + button.iconInfo = nil; + + if (info.iconInfo) then + icon.tFitDropDownSizeX = info.iconInfo.tFitDropDownSizeX; + else + icon.tFitDropDownSizeX = nil; + end + if (info.iconOnly and info.icon) then + button.iconOnly = true; + button.icon = info.icon; + button.iconInfo = info.iconInfo; + + lib:UIDropDownMenu_SetIconImage(icon, info.icon, info.iconInfo); + icon:ClearAllPoints(); + icon:SetPoint("LEFT"); + end + + -- Pass through attributes + button.func = info.func; + button.funcOnEnter = info.funcOnEnter; + button.funcOnLeave = info.funcOnLeave; + if (WoWRetail) then + button.iconXOffset = info.iconXOffset; + button.ignoreAsMenuSelection = info.ignoreAsMenuSelection; + else + button.classicChecks = info.classicChecks; + end + button.owner = info.owner; + button.hasOpacity = info.hasOpacity; + button.opacity = info.opacity; + button.opacityFunc = info.opacityFunc; + button.cancelFunc = info.cancelFunc; + button.swatchFunc = info.swatchFunc; + button.keepShownOnClick = info.keepShownOnClick; + button.tooltipTitle = info.tooltipTitle; + button.tooltipText = info.tooltipText; + button.tooltipInstruction = info.tooltipInstruction; + button.tooltipWarning = info.tooltipWarning; + button.arg1 = info.arg1; + button.arg2 = info.arg2; + button.hasArrow = info.hasArrow; + button.arrowXOffset = info.arrowXOffset; + button.hasColorSwatch = info.hasColorSwatch; + button.notCheckable = info.notCheckable; + button.menuList = info.menuList; + button.menuListDisplayMode = info.menuListDisplayMode; + button.tooltipWhileDisabled = info.tooltipWhileDisabled; + button.noTooltipWhileEnabled = info.noTooltipWhileEnabled; + button.tooltipOnButton = info.tooltipOnButton; + button.noClickSound = info.noClickSound; + button.padding = info.padding; + button.icon = info.icon; + button.mouseOverIcon = info.mouseOverIcon; + if (WoWRetail) then + button.tooltipBackdropStyle = info.tooltipBackdropStyle; + button.iconTooltipTitle = info.iconTooltipTitle; + button.iconTooltipText = info.iconTooltipText; + button.iconTooltipBackdropStyle = info.iconTooltipBackdropStyle; + button.iconXOffset = info.iconXOffset; + button.ignoreAsMenuSelection = info.ignoreAsMenuSelection; + else + button.classicChecks = info.classicChecks; + end + + if ( info.value ~= nil ) then + button.value = info.value; + elseif ( info.text ) then + button.value = info.text; + else + button.value = nil; + end + + local expandArrow = _G[listFrameName.."Button"..index.."ExpandArrow"]; + expandArrow:SetPoint("RIGHT", info.arrowXOffset or 0, 0); + expandArrow:SetShown(info.hasArrow); + expandArrow:SetEnabled(not info.disabled); + + -- If not checkable move everything over to the left to fill in the gap where the check would be + local xPos = 5; + local buttonHeight = (info.topPadding or 0) + L_UIDROPDOWNMENU_BUTTON_HEIGHT; + local yPos = -((button:GetID() - 1) * buttonHeight) - L_UIDROPDOWNMENU_BORDER_HEIGHT; + local displayInfo = normalText; + if (info.iconOnly) then + displayInfo = icon; + end + + displayInfo:ClearAllPoints(); + if ( info.notCheckable ) then + if ( info.justifyH and info.justifyH == "CENTER" ) then + displayInfo:SetPoint("CENTER", button, "CENTER", -7, 0); + else + displayInfo:SetPoint("LEFT", button, "LEFT", 0, 0); + end + xPos = xPos + 10; + + else + xPos = xPos + 12; + displayInfo:SetPoint("LEFT", button, "LEFT", 20, 0); + end + + -- Adjust offset if displayMode is menu + local frame = L_UIDROPDOWNMENU_OPEN_MENU; + if ( frame and frame.displayMode == "MENU" ) then + if ( not info.notCheckable ) then + xPos = xPos - 6; + end + end + + -- If no open frame then set the frame to the currently initialized frame + frame = frame or L_UIDROPDOWNMENU_INIT_MENU; + + if ( info.leftPadding ) then + xPos = xPos + info.leftPadding; + end + button:SetPoint("TOPLEFT", button:GetParent(), "TOPLEFT", xPos, yPos); + + -- See if button is selected by id or name + if ( frame ) then + if ( lib:UIDropDownMenu_GetSelectedName(frame) ) then + if ( button:GetText() == lib:UIDropDownMenu_GetSelectedName(frame) ) then + info.checked = 1; + end + elseif ( lib:UIDropDownMenu_GetSelectedID(frame) ) then + if ( button:GetID() == lib:UIDropDownMenu_GetSelectedID(frame) ) then + info.checked = 1; + end + elseif ( lib:UIDropDownMenu_GetSelectedValue(frame) ~= nil ) then + if ( button.value == lib:UIDropDownMenu_GetSelectedValue(frame) ) then + info.checked = 1; + end + end + end + + if not info.notCheckable then + local check = _G[listFrameName.."Button"..index.."Check"]; + local uncheck = _G[listFrameName.."Button"..index.."UnCheck"]; + if ( info.disabled ) then + check:SetDesaturated(true); + check:SetAlpha(0.5); + uncheck:SetDesaturated(true); + uncheck:SetAlpha(0.5); + else + check:SetDesaturated(false); + check:SetAlpha(1); + uncheck:SetDesaturated(false); + uncheck:SetAlpha(1); + end + if (WoWClassicEra or WoWClassicTBC or WoWWOTLKC) then + check:SetSize(16,16); + uncheck:SetSize(16,16); + normalText:SetPoint("LEFT", check, "RIGHT", 0, 0); + end + + if info.customCheckIconAtlas or info.customCheckIconTexture then + check:SetTexCoord(0, 1, 0, 1); + uncheck:SetTexCoord(0, 1, 0, 1); + + if info.customCheckIconAtlas then + check:SetAtlas(info.customCheckIconAtlas); + uncheck:SetAtlas(info.customUncheckIconAtlas or info.customCheckIconAtlas); + else + check:SetTexture(info.customCheckIconTexture); + uncheck:SetTexture(info.customUncheckIconTexture or info.customCheckIconTexture); + end + elseif info.classicChecks then + check:SetTexCoord(0, 1, 0, 1); + uncheck:SetTexCoord(0, 1, 0, 1); + + check:SetSize(24,24); + uncheck:SetSize(24,24); + + check:SetTexture("Interface\\Buttons\\UI-CheckBox-Check"); + uncheck:SetTexture(""); + + normalText:SetPoint("LEFT", check, "RIGHT", L_UIDROPDOWNMENU_CLASSIC_CHECK_PADDING, 0); + elseif info.isNotRadio then + check:SetTexCoord(0.0, 0.5, 0.0, 0.5); + check:SetTexture("Interface\\Common\\UI-DropDownRadioChecks"); + uncheck:SetTexCoord(0.5, 1.0, 0.0, 0.5); + uncheck:SetTexture("Interface\\Common\\UI-DropDownRadioChecks"); + else + check:SetTexCoord(0.0, 0.5, 0.5, 1.0); + check:SetTexture("Interface\\Common\\UI-DropDownRadioChecks"); + uncheck:SetTexCoord(0.5, 1.0, 0.5, 1.0); + uncheck:SetTexture("Interface\\Common\\UI-DropDownRadioChecks"); + end + + -- Checked can be a function now + local checked = info.checked; + if ( type(checked) == "function" ) then + checked = checked(button); + end + + -- Show the check if checked + if ( checked ) then + button:LockHighlight(); + check:Show(); + uncheck:Hide(); + else + button:UnlockHighlight(); + check:Hide(); + uncheck:Show(); + end + else + _G[listFrameName.."Button"..index.."Check"]:Hide(); + _G[listFrameName.."Button"..index.."UnCheck"]:Hide(); + end + button.checked = info.checked; + + -- If has a colorswatch, show it and vertex color it + local colorSwatch = _G[listFrameName.."Button"..index.."ColorSwatch"]; + if ( info.hasColorSwatch ) then + if (WoWClassicEra or WoWClassicTBC or WoWWOTLKC) then + _G["L_DropDownList"..level.."Button"..index.."ColorSwatch".."NormalTexture"]:SetVertexColor(info.r, info.g, info.b); + else + _G["L_DropDownList"..level.."Button"..index.."ColorSwatch"].Color:SetVertexColor(info.r, info.g, info.b); + end + button.r = info.r; + button.g = info.g; + button.b = info.b; + colorSwatch:Show(); + else + colorSwatch:Hide(); + end + + lib:UIDropDownMenu_CheckAddCustomFrame(listFrame, button, info); + + button:SetShown(button.customFrame == nil); + + button.minWidth = info.minWidth; + + width = max(lib:UIDropDownMenu_GetButtonWidth(button), info.minWidth or 0); + --Set maximum button width + if ( width > (listFrame and listFrame.maxWidth or 0) ) then + listFrame.maxWidth = width; + end + + if (WoWRetail) then + local customFrameCount = listFrame.customFrames and #listFrame.customFrames or 0; + local height = ((index - customFrameCount) * buttonHeight) + (L_UIDROPDOWNMENU_BORDER_HEIGHT * 2); + for frameIndex = 1, customFrameCount do + local frame = listFrame.customFrames[frameIndex]; + height = height + frame:GetPreferredEntryHeight(); + end + + -- Set the height of the listframe + listFrame:SetHeight(height); + else + -- Set the height of the listframe + listFrame:SetHeight((index * L_UIDROPDOWNMENU_BUTTON_HEIGHT) + (L_UIDROPDOWNMENU_BORDER_HEIGHT * 2)); + end + + return button; +end + +function lib:UIDropDownMenu_CheckAddCustomFrame(self, button, info) + local customFrame = info.customFrame; + button.customFrame = customFrame; + if customFrame then + customFrame:SetOwningButton(button); + customFrame:ClearAllPoints(); + customFrame:SetPoint("TOPLEFT", button, "TOPLEFT", 0, 0); + customFrame:Show(); + + lib:UIDropDownMenu_RegisterCustomFrame(self, customFrame); + end +end + +function lib:UIDropDownMenu_RegisterCustomFrame(self, customFrame) + self.customFrames = self.customFrames or {} + table.insert(self.customFrames, customFrame); +end + +function lib:UIDropDownMenu_GetMaxButtonWidth(self) + local maxWidth = 0; + for i=1, self.numButtons do + local button = _G[self:GetName().."Button"..i]; + local width = lib:UIDropDownMenu_GetButtonWidth(button); + if ( width > maxWidth ) then + maxWidth = width; + end + end + return maxWidth; +end + +function lib:UIDropDownMenu_GetButtonWidth(button) + local minWidth = button.minWidth or 0; + if button.customFrame and button.customFrame:IsShown() then + return math.max(minWidth, button.customFrame:GetPreferredEntryWidth()); + end + + if not button:IsShown() then + return 0; + end + + local width; + local buttonName = button:GetName(); + local icon = _G[buttonName.."Icon"]; + local normalText = _G[buttonName.."NormalText"]; + + if ( button.iconOnly and icon ) then + width = icon:GetWidth(); + elseif ( normalText and normalText:GetText() ) then + width = normalText:GetWidth() + 40; + + if ( button.icon ) then + -- Add padding for the icon + width = width + 10; + end + if ( button.classicChecks ) then + width = width + L_UIDROPDOWNMENU_CLASSIC_CHECK_PADDING; + end + else + return minWidth; + end + + -- Add padding if has and expand arrow or color swatch + if ( button.hasArrow or button.hasColorSwatch ) then + width = width + 10; + end + if ( button.notCheckable ) then + width = width - 30; + end + if ( button.padding ) then + width = width + button.padding; + end + + return math.max(minWidth, width); +end + +function lib:UIDropDownMenu_Refresh(frame, useValue, dropdownLevel) + local maxWidth = 0; + local somethingChecked = nil; + if ( not dropdownLevel ) then + dropdownLevel = L_UIDROPDOWNMENU_MENU_LEVEL; + end + + local listFrame = _G["L_DropDownList"..dropdownLevel]; + listFrame.numButtons = listFrame.numButtons or 0; + -- Just redraws the existing menu + for i=1, L_UIDROPDOWNMENU_MAXBUTTONS do + local button = _G["L_DropDownList"..dropdownLevel.."Button"..i]; + local checked = nil; + + if(i <= listFrame.numButtons) then + -- See if checked or not + if ( lib:UIDropDownMenu_GetSelectedName(frame) ) then + if ( button:GetText() == lib:UIDropDownMenu_GetSelectedName(frame) ) then + checked = 1; + end + elseif ( lib:UIDropDownMenu_GetSelectedID(frame) ) then + if ( button:GetID() == lib:UIDropDownMenu_GetSelectedID(frame) ) then + checked = 1; + end + elseif ( lib:UIDropDownMenu_GetSelectedValue(frame) ) then + if ( button.value == lib:UIDropDownMenu_GetSelectedValue(frame) ) then + checked = 1; + end + end + end + if (button.checked and type(button.checked) == "function") then + checked = button.checked(button); + end + + if not button.notCheckable and button:IsShown() then + -- If checked show check image + local checkImage = _G["L_DropDownList"..dropdownLevel.."Button"..i.."Check"]; + local uncheckImage = _G["L_DropDownList"..dropdownLevel.."Button"..i.."UnCheck"]; + if ( checked ) then + if not button.ignoreAsMenuSelection then + somethingChecked = true; + local icon = GetChild(frame, frame:GetName(), "Icon"); + if (button.iconOnly and icon and button.icon) then + lib:UIDropDownMenu_SetIconImage(icon, button.icon, button.iconInfo); + elseif ( useValue ) then + lib:UIDropDownMenu_SetText(frame, button.value); + icon:Hide(); + else + lib:UIDropDownMenu_SetText(frame, button:GetText()); + icon:Hide(); + end + end + button:LockHighlight(); + checkImage:Show(); + uncheckImage:Hide(); + else + button:UnlockHighlight(); + checkImage:Hide(); + uncheckImage:Show(); + end + end + + if ( button:IsShown() ) then + local width = lib:UIDropDownMenu_GetButtonWidth(button); + if ( width > maxWidth ) then + maxWidth = width; + end + end + end + if(somethingChecked == nil) then + lib:UIDropDownMenu_SetText(frame, VIDEO_QUALITY_LABEL6); + local icon = GetChild(frame, frame:GetName(), "Icon"); + icon:Hide(); + end + if (not frame.noResize) then + for i=1, L_UIDROPDOWNMENU_MAXBUTTONS do + local button = _G["L_DropDownList"..dropdownLevel.."Button"..i]; + button:SetWidth(maxWidth); + end + lib:UIDropDownMenu_RefreshDropDownSize(_G["L_DropDownList"..dropdownLevel]); + end +end + +function lib:UIDropDownMenu_RefreshAll(frame, useValue) + for dropdownLevel = L_UIDROPDOWNMENU_MENU_LEVEL, 2, -1 do + local listFrame = _G["L_DropDownList"..dropdownLevel]; + if ( listFrame:IsShown() ) then + lib:UIDropDownMenu_Refresh(frame, nil, dropdownLevel); + end + end + -- useValue is the text on the dropdown, only needs to be set once + lib:UIDropDownMenu_Refresh(frame, useValue, 1); +end + +function lib:UIDropDownMenu_SetIconImage(icon, texture, info) + icon:SetTexture(texture); + if ( info.tCoordLeft ) then + icon:SetTexCoord(info.tCoordLeft, info.tCoordRight, info.tCoordTop, info.tCoordBottom); + else + icon:SetTexCoord(0, 1, 0, 1); + end + if ( info.tSizeX ) then + icon:SetWidth(info.tSizeX); + else + icon:SetWidth(16); + end + if ( info.tSizeY ) then + icon:SetHeight(info.tSizeY); + else + icon:SetHeight(16); + end + icon:Show(); +end + +function lib:UIDropDownMenu_SetSelectedName(frame, name, useValue) + frame.selectedName = name; + frame.selectedID = nil; + frame.selectedValue = nil; + lib:UIDropDownMenu_Refresh(frame, useValue); +end + +function lib:UIDropDownMenu_SetSelectedValue(frame, value, useValue) + -- useValue will set the value as the text, not the name + frame.selectedName = nil; + frame.selectedID = nil; + frame.selectedValue = value; + lib:UIDropDownMenu_Refresh(frame, useValue); +end + +function lib:UIDropDownMenu_SetSelectedID(frame, id, useValue) + frame.selectedID = id; + frame.selectedName = nil; + frame.selectedValue = nil; + lib:UIDropDownMenu_Refresh(frame, useValue); +end + +function lib:UIDropDownMenu_GetSelectedName(frame) + return frame.selectedName; +end + +function lib:UIDropDownMenu_GetSelectedID(frame) + if ( frame.selectedID ) then + return frame.selectedID; + else + -- If no explicit selectedID then try to send the id of a selected value or name +--[[ local maxNum; + if (WoWClassicEra or WoWClassicTBC or WoWWOTLKC) then + maxNum = L_UIDROPDOWNMENU_MAXBUTTONS + else + local listFrame = _G["L_DropDownList"..L_UIDROPDOWNMENU_MENU_LEVEL]; + maxNum = listFrame.numButtons + end + for i=1, maxNum do]] + local listFrame = _G["L_DropDownList"..L_UIDROPDOWNMENU_MENU_LEVEL]; + for i=1, listFrame.numButtons do + local button = _G["L_DropDownList"..L_UIDROPDOWNMENU_MENU_LEVEL.."Button"..i]; + -- See if checked or not + if ( lib:UIDropDownMenu_GetSelectedName(frame) ) then + if ( button:GetText() == lib:UIDropDownMenu_GetSelectedName(frame) ) then + return i; + end + elseif ( lib:UIDropDownMenu_GetSelectedValue(frame) ) then + if ( button.value == lib:UIDropDownMenu_GetSelectedValue(frame) ) then + return i; + end + end + end + end +end + +function lib:UIDropDownMenu_GetSelectedValue(frame) + return frame.selectedValue; +end + +function lib:HideDropDownMenu(level) + local listFrame = _G["L_DropDownList"..level]; + listFrame:Hide(); +end + +function lib:ToggleDropDownMenu(level, value, dropDownFrame, anchorName, xOffset, yOffset, menuList, button, autoHideDelay, overrideDisplayMode) + if ( not level ) then + level = 1; + end + delegateFrame:SetAttribute("createframes-level", level); + delegateFrame:SetAttribute("createframes-index", 0); + delegateFrame:SetAttribute("createframes", true); + L_UIDROPDOWNMENU_MENU_LEVEL = level; + L_UIDROPDOWNMENU_MENU_VALUE = value; + local listFrameName = "L_DropDownList"..level; + local listFrame = _G[listFrameName]; + if (WoWRetail) then + lib:UIDropDownMenu_ClearCustomFrames(listFrame); + end + + local tempFrame; + local point, relativePoint, relativeTo; + if ( not dropDownFrame ) then + tempFrame = button:GetParent(); + else + tempFrame = dropDownFrame; + end + if ( listFrame:IsShown() and (L_UIDROPDOWNMENU_OPEN_MENU == tempFrame) ) then + listFrame:Hide(); + else + -- Set the dropdownframe scale + local uiScale; + local uiParentScale = UIParent:GetScale(); + if ( GetCVar("useUIScale") == "1" ) then + uiScale = tonumber(GetCVar("uiscale")); + if ( uiParentScale < uiScale ) then + uiScale = uiParentScale; + end + else + uiScale = uiParentScale; + end + listFrame:SetScale(uiScale); + + -- Hide the listframe anyways since it is redrawn OnShow() + listFrame:Hide(); + + -- Frame to anchor the dropdown menu to + local anchorFrame; + + -- Display stuff + -- Level specific stuff + if ( level == 1 ) then + delegateFrame:SetAttribute("openmenu", dropDownFrame); + listFrame:ClearAllPoints(); + -- If there's no specified anchorName then use left side of the dropdown menu + if ( not anchorName ) then + -- See if the anchor was set manually using setanchor + if ( dropDownFrame.xOffset ) then + xOffset = dropDownFrame.xOffset; + end + if ( dropDownFrame.yOffset ) then + yOffset = dropDownFrame.yOffset; + end + if ( dropDownFrame.point ) then + point = dropDownFrame.point; + end + if ( dropDownFrame.relativeTo ) then + relativeTo = dropDownFrame.relativeTo; + else + relativeTo = GetChild(L_UIDROPDOWNMENU_OPEN_MENU, L_UIDROPDOWNMENU_OPEN_MENU:GetName(), "Left"); + end + if ( dropDownFrame.relativePoint ) then + relativePoint = dropDownFrame.relativePoint; + end + elseif ( anchorName == "cursor" ) then + relativeTo = nil; + local cursorX, cursorY = GetCursorPosition(); + cursorX = cursorX/uiScale; + cursorY = cursorY/uiScale; + + if ( not xOffset ) then + xOffset = 0; + end + if ( not yOffset ) then + yOffset = 0; + end + xOffset = cursorX + xOffset; + yOffset = cursorY + yOffset; + else + -- See if the anchor was set manually using setanchor + if ( dropDownFrame.xOffset ) then + xOffset = dropDownFrame.xOffset; + end + if ( dropDownFrame.yOffset ) then + yOffset = dropDownFrame.yOffset; + end + if ( dropDownFrame.point ) then + point = dropDownFrame.point; + end + if ( dropDownFrame.relativeTo ) then + relativeTo = dropDownFrame.relativeTo; + else + relativeTo = anchorName; + end + if ( dropDownFrame.relativePoint ) then + relativePoint = dropDownFrame.relativePoint; + end + end + if ( not xOffset or not yOffset ) then + xOffset = 8; + yOffset = 22; + end + if ( not point ) then + point = "TOPLEFT"; + end + if ( not relativePoint ) then + relativePoint = "BOTTOMLEFT"; + end + listFrame:SetPoint(point, relativeTo, relativePoint, xOffset, yOffset); + else + if ( not dropDownFrame ) then + dropDownFrame = L_UIDROPDOWNMENU_OPEN_MENU; + end + listFrame:ClearAllPoints(); + -- If this is a dropdown button, not the arrow anchor it to itself + if ( strsub(button:GetParent():GetName(), 0,14) == "L_DropDownList" and strlen(button:GetParent():GetName()) == 15 ) then + anchorFrame = button; + else + anchorFrame = button:GetParent(); + end + point = "TOPLEFT"; + relativePoint = "TOPRIGHT"; + listFrame:SetPoint(point, anchorFrame, relativePoint, 0, 0); + end + + if dropDownFrame.hideBackdrops then + _G[listFrameName.."Backdrop"]:Hide(); + _G[listFrameName.."MenuBackdrop"]:Hide(); + else + -- Change list box appearance depending on display mode + local displayMode = overrideDisplayMode or (dropDownFrame and dropDownFrame.displayMode) or nil; + if ( displayMode == "MENU" ) then + _G[listFrameName.."Backdrop"]:Hide(); + _G[listFrameName.."MenuBackdrop"]:Show(); + else + _G[listFrameName.."Backdrop"]:Show(); + _G[listFrameName.."MenuBackdrop"]:Hide(); + end + end + if (WoWClassicEra or WoWClassicTBC or WoWWOTLKC) then + dropDownFrame.menuList = menuList; + end + + lib:UIDropDownMenu_Initialize(dropDownFrame, dropDownFrame.initialize, nil, level, menuList); + -- If no items in the drop down don't show it + if ( listFrame.numButtons == 0 ) then + return; + end + + if (WoWRetail) then + listFrame.onShow = dropDownFrame.listFrameOnShow; + end + + -- Check to see if the dropdownlist is off the screen, if it is anchor it to the top of the dropdown button + listFrame:Show(); + -- Hack since GetCenter() is returning coords relative to 1024x768 + local x, y = listFrame:GetCenter(); + -- Hack will fix this in next revision of dropdowns + if ( not x or not y ) then + listFrame:Hide(); + return; + end + + listFrame.onHide = dropDownFrame.onHide; + + -- Set the listframe frameStrata + if dropDownFrame.listFrameStrata then + listFrame.baseFrameStrata = listFrame:GetFrameStrata(); + listFrame:SetFrameStrata(dropDownFrame.listFrameStrata); + end + + -- We just move level 1 enough to keep it on the screen. We don't necessarily change the anchors. + if ( level == 1 ) then + local offLeft = listFrame:GetLeft()/uiScale; + local offRight = (GetScreenWidth() - listFrame:GetRight())/uiScale; + local offTop = (GetScreenHeight() - listFrame:GetTop())/uiScale; + local offBottom = listFrame:GetBottom()/uiScale; + + local xAddOffset, yAddOffset = 0, 0; + if ( offLeft < 0 ) then + xAddOffset = -offLeft; + elseif ( offRight < 0 ) then + xAddOffset = offRight; + end + + if ( offTop < 0 ) then + yAddOffset = offTop; + elseif ( offBottom < 0 ) then + yAddOffset = -offBottom; + end + + listFrame:ClearAllPoints(); + if ( anchorName == "cursor" ) then + listFrame:SetPoint(point, relativeTo, relativePoint, xOffset + xAddOffset, yOffset + yAddOffset); + else + listFrame:SetPoint(point, relativeTo, relativePoint, xOffset + xAddOffset, yOffset + yAddOffset); + end + else + -- Determine whether the menu is off the screen or not + local offscreenY, offscreenX; + if ( (y - listFrame:GetHeight()/2) < 0 ) then + offscreenY = 1; + end + if ( listFrame:GetRight() > GetScreenWidth() ) then + offscreenX = 1; + end + if ( offscreenY and offscreenX ) then + point = gsub(point, "TOP(.*)", "BOTTOM%1"); + point = gsub(point, "(.*)LEFT", "%1RIGHT"); + relativePoint = gsub(relativePoint, "TOP(.*)", "BOTTOM%1"); + relativePoint = gsub(relativePoint, "(.*)RIGHT", "%1LEFT"); + xOffset = -11; + yOffset = -14; + elseif ( offscreenY ) then + point = gsub(point, "TOP(.*)", "BOTTOM%1"); + relativePoint = gsub(relativePoint, "TOP(.*)", "BOTTOM%1"); + xOffset = 0; + yOffset = -14; + elseif ( offscreenX ) then + point = gsub(point, "(.*)LEFT", "%1RIGHT"); + relativePoint = gsub(relativePoint, "(.*)RIGHT", "%1LEFT"); + xOffset = -11; + yOffset = 14; + else + xOffset = 0; + yOffset = 14; + end + + listFrame:ClearAllPoints(); + listFrame.parentLevel = tonumber(strmatch(anchorFrame:GetName(), "L_DropDownList(%d+)")); + listFrame.parentID = anchorFrame:GetID(); + listFrame:SetPoint(point, anchorFrame, relativePoint, xOffset, yOffset); + end + + if (WoWClassicEra or WoWClassicTBC or WoWWOTLKC) then + if ( autoHideDelay and tonumber(autoHideDelay)) then + listFrame.showTimer = autoHideDelay; + listFrame.isCounting = 1; + end + end + end +end + +function lib:CloseDropDownMenus(level) + if ( not level ) then + level = 1; + end + for i=level, L_UIDROPDOWNMENU_MAXLEVELS do + _G["L_DropDownList"..i]:Hide(); + end + -- yes, we also want to close the menus which created by built-in UIDropDownMenus + for i=level, UIDROPDOWNMENU_MAXLEVELS do + _G["DropDownList"..i]:Hide(); + end +end + +local function containsMouse() + local result = false + + for i = 1, L_UIDROPDOWNMENU_MAXLEVELS do + local dropdown = _G["L_DropDownList"..i]; + if dropdown:IsShown() and dropdown:IsMouseOver() then + result = true; + end + end + for i = 1, UIDROPDOWNMENU_MAXLEVELS do + local dropdown = _G["DropDownList"..i]; + if dropdown:IsShown() and dropdown:IsMouseOver() then + result = true; + end + end + -- TeeloJubeithos: + -- If the menu is open, and you click the button to close it, + -- the Global Mouse Down triggers to close it, but then the MouseDown for the button triggers to open it back up again. + -- I fixed this by adding a filter to the global mouse down check, don't count it if the mouse is still over the DropDownMenu's Button + if L_UIDROPDOWNMENU_OPEN_MENU and L_UIDROPDOWNMENU_OPEN_MENU.Button:IsMouseOver() then + result = true; + end + + return result; +end + +function lib:containsMouse() + containsMouse() +end + +-- GLOBAL_MOUSE_DOWN event is only available in retail, not classic +function lib:UIDropDownMenu_HandleGlobalMouseEvent(button, event) + if event == "GLOBAL_MOUSE_DOWN" and (button == "LeftButton" or button == "RightButton") then + if not containsMouse() then + lib:CloseDropDownMenus(); + end + end +end + +-- hooking UIDropDownMenu_HandleGlobalMouseEvent +do + if lib and WoWRetail then + hooksecurefunc("UIDropDownMenu_HandleGlobalMouseEvent", function(button, event) + lib:UIDropDownMenu_HandleGlobalMouseEvent(button, event) + end) + + end +end + +function lib:UIDropDownMenu_ClearCustomFrames(self) + if self.customFrames then + for index, frame in ipairs(self.customFrames) do + frame:Hide(); + end + + self.customFrames = nil; + end +end + +function lib:UIDropDownMenu_MatchTextWidth(frame, minWidth, maxWidth) + local frameName = frame:GetName(); + local newWidth = GetChild(frame, frameName, "Text"):GetUnboundedStringWidth() + L_UIDROPDOWNMENU_DEFAULT_WIDTH_PADDING; + + if minWidth or maxWidth then + newWidth = Clamp(newWidth, minWidth or newWidth, maxWidth or newWidth); + end + + lib:UIDropDownMenu_SetWidth(frame, newWidth); +end + +function lib:UIDropDownMenu_SetWidth(frame, width, padding) + local frameName = frame:GetName(); + GetChild(frame, frameName, "Middle"):SetWidth(width); + if ( padding ) then + frame:SetWidth(width + padding); + else + frame:SetWidth(width + L_UIDROPDOWNMENU_DEFAULT_WIDTH_PADDING + L_UIDROPDOWNMENU_DEFAULT_WIDTH_PADDING); + end + if ( padding ) then + GetChild(frame, frameName, "Text"):SetWidth(width); + else + GetChild(frame, frameName, "Text"):SetWidth(width - L_UIDROPDOWNMENU_DEFAULT_WIDTH_PADDING); + end + frame.noResize = 1; +end + +function lib:UIDropDownMenu_SetButtonWidth(frame, width) + local frameName = frame:GetName(); + if ( width == "TEXT" ) then + width = GetChild(frame, frameName, "Text"):GetWidth(); + end + + GetChild(frame, frameName, "Button"):SetWidth(width); + frame.noResize = 1; +end + +function lib:UIDropDownMenu_SetText(frame, text) + local frameName = frame:GetName(); + GetChild(frame, frameName, "Text"):SetText(text); +end + +function lib:UIDropDownMenu_GetText(frame) + local frameName = frame:GetName(); + return GetChild(frame, frameName, "Text"):GetText(); +end + +function lib:UIDropDownMenu_ClearAll(frame) + -- Previous code refreshed the menu quite often and was a performance bottleneck + frame.selectedID = nil; + frame.selectedName = nil; + frame.selectedValue = nil; + lib:UIDropDownMenu_SetText(frame, ""); + + local button, checkImage, uncheckImage; + for i=1, L_UIDROPDOWNMENU_MAXBUTTONS do + button = _G["L_DropDownList"..L_UIDROPDOWNMENU_MENU_LEVEL.."Button"..i]; + button:UnlockHighlight(); + + checkImage = _G["L_DropDownList"..L_UIDROPDOWNMENU_MENU_LEVEL.."Button"..i.."Check"]; + checkImage:Hide(); + uncheckImage = _G["L_DropDownList"..L_UIDROPDOWNMENU_MENU_LEVEL.."Button"..i.."UnCheck"]; + uncheckImage:Hide(); + end +end + +function lib:UIDropDownMenu_JustifyText(frame, justification, customXOffset, customYOffset) + local frameName = frame:GetName(); + local text = GetChild(frame, frameName, "Text"); + text:ClearAllPoints(); + if ( justification == "LEFT" ) then + text:SetPoint("LEFT", GetChild(frame, frameName, "Left"), "LEFT", customXOffset or 27, customYOffset or 2); + text:SetJustifyH("LEFT"); + elseif ( justification == "RIGHT" ) then + text:SetPoint("RIGHT", GetChild(frame, frameName, "Right"), "RIGHT", customXOffset or -43, customYOffset or 2); + text:SetJustifyH("RIGHT"); + elseif ( justification == "CENTER" ) then + text:SetPoint("CENTER", GetChild(frame, frameName, "Middle"), "CENTER", customXOffset or -5, customYOffset or 2); + text:SetJustifyH("CENTER"); + end +end + +function lib:UIDropDownMenu_SetAnchor(dropdown, xOffset, yOffset, point, relativeTo, relativePoint) + dropdown.xOffset = xOffset; + dropdown.yOffset = yOffset; + dropdown.point = point; + dropdown.relativeTo = relativeTo; + dropdown.relativePoint = relativePoint; +end + +function lib:UIDropDownMenu_GetCurrentDropDown() + if ( L_UIDROPDOWNMENU_OPEN_MENU ) then + return L_UIDROPDOWNMENU_OPEN_MENU; + elseif ( L_UIDROPDOWNMENU_INIT_MENU ) then + return L_UIDROPDOWNMENU_INIT_MENU; + end +end + +function lib:UIDropDownMenuButton_GetChecked(self) + return _G[self:GetName().."Check"]:IsShown(); +end + +function lib:UIDropDownMenuButton_GetName(self) + return _G[self:GetName().."NormalText"]:GetText(); +end + +function lib:UIDropDownMenuButton_OpenColorPicker(self, button) + securecall("CloseMenus"); + if ( not button ) then + button = self; + end + L_UIDROPDOWNMENU_MENU_VALUE = button.value; + lib:OpenColorPicker(button); +end + +function lib:UIDropDownMenu_DisableButton(level, id) + lib:UIDropDownMenu_SetDropdownButtonEnabled(_G["DropDownList"..level.."Button"..id], false); +end + +function lib:UIDropDownMenu_EnableButton(level, id) + lib:UIDropDownMenu_SetDropdownButtonEnabled(_G["DropDownList"..level.."Button"..id], true); +end + +function lib:UIDropDownMenu_SetDropdownButtonEnabled(button, enabled) + if enabled then + button:Enable(); + else + button:Disable(); + end +end + +function lib:UIDropDownMenu_SetButtonText(level, id, text, colorCode) + local button = _G["L_DropDownList"..level.."Button"..id]; + if ( colorCode) then + button:SetText(colorCode..text.."|r"); + else + button:SetText(text); + end +end + +function lib:UIDropDownMenu_SetButtonNotClickable(level, id) + _G["L_DropDownList"..level.."Button"..id]:SetDisabledFontObject(GameFontHighlightSmallLeft); +end + +function lib:UIDropDownMenu_SetButtonClickable(level, id) + _G["L_DropDownList"..level.."Button"..id]:SetDisabledFontObject(GameFontDisableSmallLeft); +end + + +function lib:UIDropDownMenu_DisableDropDown(dropDown) + lib:UIDropDownMenu_SetDropDownEnabled(dropDown, false, disabledtooltip); +end + +function lib:UIDropDownMenu_EnableDropDown(dropDown) + lib:UIDropDownMenu_SetDropDownEnabled(dropDown, true); +end + +function lib:UIDropDownMenu_SetDropDownEnabled(dropDown, enabled, disabledtooltip) + local dropDownName = dropDown:GetName(); + local label = GetChild(dropDown, dropDownName, "Label"); + if label then + label:SetVertexColor((enabled and NORMAL_FONT_COLOR or GRAY_FONT_COLOR):GetRGB()); + end + + local icon = GetChild(dropDown, dropDownName, "Icon"); + if icon then + icon:SetVertexColor((enabled and HIGHLIGHT_FONT_COLOR or GRAY_FONT_COLOR):GetRGB()); + end + + local text = GetChild(dropDown, dropDownName, "Text"); + if text then + text:SetVertexColor((enabled and HIGHLIGHT_FONT_COLOR or GRAY_FONT_COLOR):GetRGB()); + end + + local button = GetChild(dropDown, dropDownName, "Button"); + if button then + button:SetEnabled(enabled); + + -- Clear any previously set disabledTooltip (it will be reset below if needed). + if button:GetMotionScriptsWhileDisabled() then + button:SetMotionScriptsWhileDisabled(false); + button:SetScript("OnEnter", nil); + button:SetScript("OnLeave", nil); + end + end + + if enabled then + dropDown.isDisabled = nil; + else + dropDown.isDisabled = 1; + + if button then + if disabledTooltip then + button:SetMotionScriptsWhileDisabled(true); + button:SetScript("OnEnter", function() + GameTooltip:SetOwner(button, "ANCHOR_RIGHT"); + GameTooltip_AddErrorLine(GameTooltip, disabledTooltip); + GameTooltip:Show(); + end); + + button:SetScript("OnLeave", GameTooltip_Hide); + end + end + end +end + +function lib:UIDropDownMenu_IsEnabled(dropDown) + return not dropDown.isDisabled; +end + +function lib:UIDropDownMenu_GetValue(id) + --Only works if the dropdown has just been initialized, lame, I know =( + local button = _G["L_DropDownList1Button"..id]; + if ( button ) then + return _G["L_DropDownList1Button"..id].value; + else + return nil; + end +end + +function lib:OpenColorPicker(info) + ColorPickerFrame.func = info.swatchFunc; + ColorPickerFrame.hasOpacity = info.hasOpacity; + ColorPickerFrame.opacityFunc = info.opacityFunc; + ColorPickerFrame.opacity = info.opacity; + ColorPickerFrame.previousValues = {r = info.r, g = info.g, b = info.b, opacity = info.opacity}; + ColorPickerFrame.cancelFunc = info.cancelFunc; + ColorPickerFrame.extraInfo = info.extraInfo; + -- This must come last, since it triggers a call to ColorPickerFrame.func() + ColorPickerFrame:SetColorRGB(info.r, info.g, info.b); + ShowUIPanel(ColorPickerFrame); +end + +function lib:ColorPicker_GetPreviousValues() + return ColorPickerFrame.previousValues.r, ColorPickerFrame.previousValues.g, ColorPickerFrame.previousValues.b; +end + +-- ////////////////////////////////////////////////////////////// +-- LibUIDropDownMenuTemplates +-- ////////////////////////////////////////////////////////////// + +-- Custom dropdown buttons are instantiated by some external system. +-- When calling L_UIDropDownMenu_AddButton that system sets info.customFrame to the instance of the frame it wants to place on the menu. +-- The dropdown menu creates its button for the entry as it normally would, but hides all elements. The custom frame is then anchored +-- to that button and assumes responsibility for all relevant dropdown menu operations. +-- The hidden button will request a size that it should become from the custom frame. + +lib.DropDownMenuButtonMixin = {} + +function lib.DropDownMenuButtonMixin:OnEnter(...) + ExecuteFrameScript(self:GetParent(), "OnEnter", ...); +end + +function lib.DropDownMenuButtonMixin:OnLeave(...) + ExecuteFrameScript(self:GetParent(), "OnLeave", ...); +end + +function lib.DropDownMenuButtonMixin:OnMouseDown(button) + if self:IsEnabled() then + lib:ToggleDropDownMenu(nil, nil, self:GetParent()); + PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON); + end +end + +lib.LargeDropDownMenuButtonMixin = CreateFromMixins(lib.DropDownMenuButtonMixin); + +function lib.LargeDropDownMenuButtonMixin:OnMouseDown(button) + if self:IsEnabled() then + local parent = self:GetParent(); + lib:ToggleDropDownMenu(nil, nil, parent, parent, -8, 8); + PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON); + end +end + +lib.DropDownExpandArrowMixin = {}; + +function lib.DropDownExpandArrowMixin:OnEnter() + local level = self:GetParent():GetParent():GetID() + 1; + + lib:CloseDropDownMenus(level); + + if self:IsEnabled() then + local listFrame = _G["L_DropDownList"..level]; + if ( not listFrame or not listFrame:IsShown() or select(2, listFrame:GetPoint()) ~= self ) then + lib:ToggleDropDownMenu(level, self:GetParent().value, nil, nil, nil, nil, self:GetParent().menuList, self, nil, self:GetParent().menuListDisplayMode); + end + end +end + +function lib.DropDownExpandArrowMixin:OnMouseDown(button) + if self:IsEnabled() then + lib:ToggleDropDownMenu(self:GetParent():GetParent():GetID() + 1, self:GetParent().value, nil, nil, nil, nil, self:GetParent().menuList, self, nil, self:GetParent().menuListDisplayMode); + PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON); + end +end + +lib.UIDropDownCustomMenuEntryMixin = {}; + +function lib.UIDropDownCustomMenuEntryMixin:GetPreferredEntryWidth() + return self:GetWidth(); +end + +function lib.UIDropDownCustomMenuEntryMixin:GetPreferredEntryHeight() + return self:GetHeight(); +end + +function lib.UIDropDownCustomMenuEntryMixin:OnSetOwningButton() + -- for derived objects to implement +end + +function lib.UIDropDownCustomMenuEntryMixin:SetOwningButton(button) + self:SetParent(button:GetParent()); + self.owningButton = button; + self:OnSetOwningButton(); +end + +function lib.UIDropDownCustomMenuEntryMixin:GetOwningDropdown() + return self.owningButton:GetParent(); +end + +function lib.UIDropDownCustomMenuEntryMixin:SetContextData(contextData) + self.contextData = contextData; +end + +function lib.UIDropDownCustomMenuEntryMixin:GetContextData() + return self.contextData; +end + +-- ////////////////////////////////////////////////////////////// +-- L_UIDropDownCustomMenuEntryTemplate +function lib:Create_UIDropDownCustomMenuEntry(name, parent) + local f = _G[name] or CreateFrame("Frame", name, parent or nil) + f:EnableMouse(true) + f:Hide() + + -- I am not 100% sure if below works for replacing the mixins + f:SetScript("GetPreferredEntryWidth", function(self) + return self:GetWidth() + end) + f:SetScript("SetOwningButton", function(self, button) + self:SetParent(button:GetParent()) + self.owningButton = button + self:OnSetOwningButton() + end) + f:SetScript("GetOwningDropdown", function(self) + return self.owningButton:GetParent() + end) + f:SetScript("SetContextData", function(self, contextData) + self.contextData = contextData + end) + f:SetScript("GetContextData", function(self) + return self.contextData + end) + + return f +end + +-- ////////////////////////////////////////////////////////////// +-- UIDropDownMenuButtonScriptTemplate +-- +-- TBD +-- + +-- ////////////////////////////////////////////////////////////// +-- LargeUIDropDownMenuTemplate +-- +-- TBD +-- + +-- ////////////////////////////////////////////////////////////// +-- EasyMenu +-- Simplified Menu Display System +-- This is a basic system for displaying a menu from a structure table. +-- +-- Args: +-- menuList - menu table +-- menuFrame - the UI frame to populate +-- anchor - where to anchor the frame (e.g. CURSOR) +-- x - x offset +-- y - y offset +-- displayMode - border type +-- autoHideDelay - how long until the menu disappears +local function easyMenu_Initialize( frame, level, menuList ) + for index = 1, #menuList do + local value = menuList[index] + if (value.text) then + value.index = index; + lib:UIDropDownMenu_AddButton( value, level ); + end + end +end + +function lib:EasyMenu(menuList, menuFrame, anchor, x, y, displayMode, autoHideDelay ) + if ( displayMode == "MENU" ) then + menuFrame.displayMode = displayMode; + end + lib:UIDropDownMenu_Initialize(menuFrame, easyMenu_Initialize, displayMode, nil, menuList); + lib:ToggleDropDownMenu(1, nil, menuFrame, anchor, x, y, menuList, nil, autoHideDelay); +end + +function lib:EasyMenu_Initialize( frame, level, menuList ) + easyMenu_Initialize( frame, level, menuList ) +end + diff --git a/Titan/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibUIDropDownMenu.xml b/Titan/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibUIDropDownMenu.xml new file mode 100644 index 0000000..2047913 --- /dev/null +++ b/Titan/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibUIDropDownMenu.xml @@ -0,0 +1,24 @@ + + +