From a49806d227174e5e4a82a2a89fa49a0d1793462b Mon Sep 17 00:00:00 2001 From: urnati Date: Wed, 12 Nov 2025 14:33:02 -0500 Subject: [PATCH] - Upgraded Ace libs - Midnight ready! --- Titan/Titan.code-workspace | 762 ++--- Titan/Titan.toc | 3 +- Titan/Titan.xml | 40 +- Titan/TitanConfig.lua | 2 +- Titan/TitanPanelChangeLog.txt | 4 +- Titan/TitanPanelSetup-READ_ME_FIRST.txt | 398 +-- Titan/TitanTemplate.xml | 316 +- Titan/_ATitanDoc.lua | 696 ++--- Titan/_Titan_Lib_Notes.txt | 12 +- .../!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 | 266 -- .../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 | 2398 --------------- .../LibUIDropDownMenu/LibUIDropDownMenu.xml | 24 - Titan/libs/Ace/Ace3.toc | 4 +- .../AceConfigDialog-3.0/AceConfigDialog-3.0.lua | 17 +- .../widgets/AceGUIContainer-TreeGroup.lua | 10 +- .../AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua | 6 +- .../widgets/AceGUIWidget-MultiLineEditBox.lua | 6 +- Titan/libs/Ace/CHANGES.txt | 170 +- Titan/libs/Ace/LibQTip-1.0/CHANGELOG.md | 20 +- Titan/libs/Ace/LibQTip-1.0/LICENSE.txt | 58 +- Titan/libs/Ace/LibQTip-1.0/LibQTip-1.0.lua | 3130 ++++++++++---------- Titan/libs/Ace/LibQTip-1.0/LibQTip-1.0.toc | 30 +- Titan/libs/Ace/LibQTip-1.0/LibStub/LibStub.lua | 102 +- Titan/libs/Ace/LibQTip-1.0/README.md | 60 +- Titan/libs/Ace/LibQTip-1.0/lib.xml | 6 +- Titan/libs/Ace/LibSharedMedia-3.0/CHANGES.txt | 8 - .../CallbackHandler-1.0/CallbackHandler-1.0.lua | 202 -- .../Ace/LibSharedMedia-3.0/LibSharedMedia-3.0.toc | 18 - .../LibSharedMedia-3.0/LibSharedMedia-3.0.lua | 299 -- .../LibSharedMedia-3.0/LibSharedMedia-3.0/lib.xml | 4 - .../Ace/LibSharedMedia-3.0/LibStub/LibStub.lua | 51 - Titan/libs/Ace/LibSharedMedia-3.0/lib.xml | 5 - Titan/libs/Ace/changelog.txt | 9 + Titan/libs/LibDataBroker-1.1.lua | 180 +- Titan/libs/LibSharedMedia-3.0/CHANGES.txt | 8 + .../CallbackHandler-1.0/CallbackHandler-1.0.lua | 202 ++ .../libs/LibSharedMedia-3.0/LibSharedMedia-3.0.toc | 18 + .../LibSharedMedia-3.0/LibSharedMedia-3.0.lua | 299 ++ .../LibSharedMedia-3.0/LibSharedMedia-3.0/lib.xml | 4 + Titan/libs/LibSharedMedia-3.0/LibStub/LibStub.lua | 51 + Titan/libs/LibSharedMedia-3.0/lib.xml | 5 + .../Changelog-libserialize-0.9.1.beta.txt | 59 - Titan/libs/libserialize/LibSerialize.toc | 16 - Titan/libs/libserialize/embeds.xml | 3 - .../libs/LibStub/Changelog-LibStub-1.0.2-40200.txt | 13 - Titan/libs/libserialize/libs/LibStub/LibStub.lua | 51 - Titan/libs/libserialize/libs/LibStub/LibStub.toc | 17 - .../libs/libserialize/libs/LibStub/tests/test.lua | 41 - .../libs/libserialize/libs/LibStub/tests/test2.lua | 27 - .../libs/libserialize/libs/LibStub/tests/test3.lua | 14 - .../libs/libserialize/libs/LibStub/tests/test4.lua | 41 - Titan/libs/libserialize/serializer.lua | 412 --- Titan/locale/Localization.BR.lua | 19 +- Titan/locale/Localization.CN.lua | 19 +- Titan/locale/Localization.DE.lua | 19 +- Titan/locale/Localization.ES.lua | 19 +- Titan/locale/Localization.FR.lua | 19 +- Titan/locale/Localization.IT.lua | 19 +- Titan/locale/Localization.KR.lua | 19 +- Titan/locale/Localization.MX.lua | 19 +- Titan/locale/Localization.RU.lua | 19 +- Titan/locale/Localization.TW.lua | 19 +- 74 files changed, 3709 insertions(+), 7531 deletions(-) delete mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-BCC.toc delete mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-Classic.toc delete mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-WOTLKC.toc delete mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu.toc delete mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/Docs/Readme.txt delete mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/Docs/Revision.txt delete mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/LibStub/LibStub.lua delete mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/LibStub/LibStub.toc delete mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test.lua delete mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test2.lua delete mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test3.lua delete mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test4.lua delete mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibEasyMenu.lua delete mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibUIDropDownMenu.lua delete mode 100644 Titan/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibUIDropDownMenu.xml delete mode 100644 Titan/libs/Ace/LibSharedMedia-3.0/CHANGES.txt delete mode 100644 Titan/libs/Ace/LibSharedMedia-3.0/CallbackHandler-1.0/CallbackHandler-1.0.lua delete mode 100644 Titan/libs/Ace/LibSharedMedia-3.0/LibSharedMedia-3.0.toc delete mode 100644 Titan/libs/Ace/LibSharedMedia-3.0/LibSharedMedia-3.0/LibSharedMedia-3.0.lua delete mode 100644 Titan/libs/Ace/LibSharedMedia-3.0/LibSharedMedia-3.0/lib.xml delete mode 100644 Titan/libs/Ace/LibSharedMedia-3.0/LibStub/LibStub.lua delete mode 100644 Titan/libs/Ace/LibSharedMedia-3.0/lib.xml create mode 100644 Titan/libs/LibSharedMedia-3.0/CHANGES.txt create mode 100644 Titan/libs/LibSharedMedia-3.0/CallbackHandler-1.0/CallbackHandler-1.0.lua create mode 100644 Titan/libs/LibSharedMedia-3.0/LibSharedMedia-3.0.toc create mode 100644 Titan/libs/LibSharedMedia-3.0/LibSharedMedia-3.0/LibSharedMedia-3.0.lua create mode 100644 Titan/libs/LibSharedMedia-3.0/LibSharedMedia-3.0/lib.xml create mode 100644 Titan/libs/LibSharedMedia-3.0/LibStub/LibStub.lua create mode 100644 Titan/libs/LibSharedMedia-3.0/lib.xml delete mode 100644 Titan/libs/libserialize/Changelog-libserialize-0.9.1.beta.txt delete mode 100644 Titan/libs/libserialize/LibSerialize.toc delete mode 100644 Titan/libs/libserialize/embeds.xml delete mode 100644 Titan/libs/libserialize/libs/LibStub/Changelog-LibStub-1.0.2-40200.txt delete mode 100644 Titan/libs/libserialize/libs/LibStub/LibStub.lua delete mode 100644 Titan/libs/libserialize/libs/LibStub/LibStub.toc delete mode 100644 Titan/libs/libserialize/libs/LibStub/tests/test.lua delete mode 100644 Titan/libs/libserialize/libs/LibStub/tests/test2.lua delete mode 100644 Titan/libs/libserialize/libs/LibStub/tests/test3.lua delete mode 100644 Titan/libs/libserialize/libs/LibStub/tests/test4.lua delete mode 100644 Titan/libs/libserialize/serializer.lua diff --git a/Titan/Titan.code-workspace b/Titan/Titan.code-workspace index e9213b3..b51d770 100644 --- a/Titan/Titan.code-workspace +++ b/Titan/Titan.code-workspace @@ -1,382 +1,382 @@ -{ - "folders": [ - { - "path": "." - }, - { - "path": "../TitanAmmo" - }, - { - "path": "../TitanBag" - }, - { - "path": "../TitanClassic" - }, - { - "path": "../TitanClock" - }, - { - "path": "../TitanGold" - }, - { - "path": "../TitanLDB" - }, - { - "path": "../TitanLocation" - }, - { - "path": "../TitanLootType" - }, - { - "path": "../TitanPerformance" - }, - { - "path": "../TitanPlugin" - }, - { - "path": "../TitanRegen" - }, - { - "path": "../TitanRepair" - }, - { - "path": "../TitanVolume" - }, - { - "path": "../TitanXP" - } - ], - "settings": { - "Lua.diagnostics.globals": [ - "HIGHLIGHT_FONT_COLOR_CODE", - "GREEN_FONT_COLOR_CODE", - "DEFAULT_CHAT_FRAME", - "FONT_COLOR_CODE_CLOSE", - "ToggleAllBags", - "HIGHLIGHT_FONT_COLOR", - "NORMAL_FONT_COLOR", - "ORANGE_FONT_COLOR", - "RED_FONT_COLOR", - "UNKNOWN", - "NONE", - "GameTimeFrame", - "TimeManagerClockButton", - "ToggleCalendar", - "TIME_TWENTYFOURHOURS", - "TIME_TWELVEHOURAM", - "TIME_TWELVEHOURPM", - "WorldMapFrameCloseButton", - "WorldMapFrame", - "ToggleFrame", - "SANCTUARY_TERRITORY", - "CONTESTED_TERRITORY", - "ChatEdit_GetActiveWindow", - "FACTION_CONTROLLED_TERRITORY", - "VOLUME", - "OPTION_TOOLTIP_MASTER_VOLUME", - "OPTION_TOOLTIP_MUSIC_VOLUME", - "OPTION_TOOLTIP_FX_VOLUME", - "OPTION_TOOLTIP_ENABLE_AMBIENCE", - "OPTION_TOOLTIP_DIALOG_VOLUME", - "GREEN_FONT_COLOR", - "MouseIsOver", - "LIGHTYELLOW_FONT_COLOR_CODE", - "ReloadUI", - "NORMAL_FONT_COLOR_CODE", - "RED_FONT_COLOR_CODE", - "StaticPopupDialogs", - "StaticPopup_Show", - "ALL", - "ACCEPT", - "CANCEL", - "FACTION_ALLIANCE", - "FACTION_HORDE", - "FACTION_OTHER", - "CLASS_ICON_TCOORDS", - "ICON_TAG_LIST", - "MAX_RAID_MEMBERS", - "MAX_PARTY_MEMBERS", - "RANDOM_ROLL_RESULT", - "WHISPER", - "StaticPopup_Hide", - "YES", - "NO", - "ITEM_QUALITY0_DESC", - "FACTION_STANDING_LABEL5", - "FACTION_STANDING_LABEL6", - "FACTION_STANDING_LABEL7", - "FACTION_STANDING_LABEL8", - "MoneyFrame_Update", - "TooltipUtil", - "MerchantRepairAllButton", - "MerchantGuildBankRepairButton", - "GUILD", - "REPAIR_COST", - "WITHDRAW", - "UNLIMITED", - "AVAILABLE", - "GUILDBANK_REPAIR_INSUFFICIENT_FUNDS", - "FROM", - "YOU", - "SHOW", - "LOOT", - "SPECIALIZATION", - "LOOT_METHOD", - "SELECT_LOOT_SPECIALIZATION", - "SlashCmdList", - "Settings", - "TOOLTIP_DEFAULT_COLOR", - "HIDE", - "COLOR", - "USE", - "BACKGROUND", - "BATTLEGROUND", - "ARENA", - "LOW", - "HIGH", - "SecureUnitButton_OnClick", - "FCF_DockUpdate", - "UpdateContainerFrameAnchors", - "MainMenuBar", - "TicketStatusFrame", - "ContainerFrame1", - "MainMenuBarVehicleLeaveButton", - "MultiBarBottomLeft", - "ExtraActionBarFrame", - "MultiCastActionBarFrame", - "MultiBarBottomRight", - "DropDownList1", - "UIDropDownMenu_AddButton", - "UIDROPDOWNMENU_MENU_LEVEL", - "UIDropDownMenu_AddSeparator", - "UIDropDownMenu_AddSpace", - "TOOLTIP_DEFAULT_BACKGROUND_COLOR", - "ToggleDropDownMenu", - "UIDropDownMenu_Initialize", - "UKNOWNBEING", - "SHORT", - "UIDROPDOWNMENU_MAXLEVELS", - "ColorPickerFrame", - "ExecuteFrameScript", - "GameFontDisableSmallLeft", - "GameFontHighlightSmallLeft", - "DropDownMenuButtonMixin", - "GameFontNormalSmallLeft", - "VIDEO_QUALITY_LABEL6", - "TooltipBackdropTemplateMixin", - "SharedTooltip_SetBackdropStyle", - "GRAY_FONT_COLOR", - "GameTooltip_Hide", - "GameTooltip_AddErrorLine", - "SELECTED_CHAT_FRAME", - "GameFontNormal", - "GameFontHighlight", - "InterfaceOptions_AddCategory", - "GameFontHighlightLarge", - "GameFontHighlightSmall", - "CLOSE", - "PanelTemplates_TabResize", - "PanelTemplates_SetDisabledTabState", - "PanelTemplates_SelectTab", - "PanelTemplates_DeselectTab", - "SetDesaturation", - "OpacitySliderFrame", - "ChatFontNormal", - "OKAY", - "NOT_BOUND", - "GameFontDisableSmall", - "GameFontNormalSmall", - "BACKDROP_SLIDER_8_8", - "IGNORE", - "FACTION", - "CUSTOM", - "COMMAND", - "RESET_POSITION", - "HELP_LABEL", - "HISTORY", - "TitanUtils_*", - "NAME", - "_G", - "getfenv", - "CreateFrame", - "error", - "ipairs", - "pcall", - "string", - "tostring", - "type", - "UIParent", - "GameTooltip", - "IsShiftKeyDown", - "IsAltKeyDown", - "IsControlKeyDown", - "table", - "pairs", - "print", - "math", - "tonumber", - "C_PvP", - "C_AddOns", - "GetCursorPosition", - "UnitName", - "GetCVar", - "GetScreenWidth", - "GetPhysicalScreenSize", - "Constants", - "C_Container", - "GetInventoryItemLink", - "GetItemInfoInstant", - "format", - "GetRealmName", - "floor", - "mod", - "date", - "C_PetBattles", - "ID", - "UIParent_ManageFramePositions", - "MUTE", - "OFF", - "MUTED", - "show", - "Add", - "NOTE", - "setmetatable", - "assert", - "select", - "getmetatable", - "PlaySound", - "newproxy", - "unpack", - "rawequal", - "securecallfunction", - "WOW_PROJECT_ID", - "loadstring", - "GetCursorInfo", - "next", - "wipe", - "rawset", - "rawget", - "GetLocale", - "geterrorhandler", - "BackdropTemplateMixin", - "xpcall", - "GetSpellInfo", - "CreateFont", - "max", - "min", - "ceil", - "GetTime", - "C_Timer", - "issecurevariable", - "hooksecurefunc", - "ClearCursor", - "GetMacroInfo", - "WOW_PROJECT_MAINLINE", - "PlaySoundFile", - "IsLoggedIn", - "PetHasActionBar", - "HasPetUI", - "GetNumShapeshiftForms", - "SetCVar", - "InCombatLockdown", - "GetScreenHeight", - "CreateFromMixins", - "GetMouseFocus", - "EventRegistry", - "Clamp", - "SOUNDKIT", - "C_Texture", - "Mixin", - "UnitPowerType", - "UnitHealth", - "UnitHealthMax", - "UnitPower", - "UnitPowerMax", - "GetItemInfo", - "GetInventorySlotInfo", - "C_Item", - "GetBuildInfo", - "GetInventoryItemID", - "UnitClass", - "GetInventoryItemCount", - "GetGameTime", - "RequestTimePlayed", - "UnitFactionGroup", - "time", - "UnitXPMax", - "UnitXP", - "GetXPExhaustion", - "GetZonePVPInfo", - "GetZoneText", - "GetSubZoneText", - "C_Map", - "GetBindLocation", - "C_CVar", - "UpdateAddOnCPUUsage", - "UpdateAddOnMemoryUsage", - "collectgarbage", - "GetAddOnMemoryUsage", - "GetFramerate", - "GetNetStats", - "gcinfo", - "GetAddOnCPUUsage", - "IsModifierKeyDown", - "GetAutoCompleteRealms", - "getn", - "GetMoney", - "CLASS_SORT_ORDER", - "LOCALIZED_CLASS_NAMES_MALE", - "RandomRoll", - "UnitIsGroupLeader", - "GetLootMethod", - "sort", - "IsInRaid", - "IsInGroup", - "IsInGuild", - "UnitIsInMyGuild", - "tContains", - "GetGuildInfo", - "SendChatMessage", - "GetLootThreshold", - "GuildControlGetRankName", - "UnitInParty", - "random", - "tinsert", - "UnitInRaid", - "C_GuildInfo", - "UnitGUID", - "GetItemQualityColor", - "C_TooltipInfo", - "GetRepairAllCost", - "GetGuildBankWithdrawMoney", - "GetGuildBankMoney", - "RepairAllItems", - "CanMerchantRepair", - "CanGuildBankRepair", - "IsGuildLeader", - "GetInventoryItemDurability", - "GetSpecialization", - "GetLootSpecialization", - "GetRaidDifficultyID", - "GetDifficultyInfo", - "GetDungeonDifficultyID", - "GetSpecializationInfo", - "GetSpecializationInfoByID", - "SetDungeonDifficultyID", - "IsInInstance", - "UnitLevel", - "SetRaidDifficultyID", - "GetNumSubgroupMembers", - "GetNumGroupMembers", - "UnitExists" - ], - "Lua.misc.parameters": [ - "--develop=true", - "--dbgport=11428" - ], - }, - "launch": { - "version": "0.2.0", - "configurations": [] - }, +{ + "folders": [ + { + "path": "." + }, + { + "path": "../TitanAmmo" + }, + { + "path": "../TitanBag" + }, + { + "path": "../TitanClassic" + }, + { + "path": "../TitanClock" + }, + { + "path": "../TitanGold" + }, + { + "path": "../TitanLDB" + }, + { + "path": "../TitanLocation" + }, + { + "path": "../TitanLootType" + }, + { + "path": "../TitanPerformance" + }, + { + "path": "../TitanPlugin" + }, + { + "path": "../TitanRegen" + }, + { + "path": "../TitanRepair" + }, + { + "path": "../TitanVolume" + }, + { + "path": "../TitanXP" + } + ], + "settings": { + "Lua.diagnostics.globals": [ + "HIGHLIGHT_FONT_COLOR_CODE", + "GREEN_FONT_COLOR_CODE", + "DEFAULT_CHAT_FRAME", + "FONT_COLOR_CODE_CLOSE", + "ToggleAllBags", + "HIGHLIGHT_FONT_COLOR", + "NORMAL_FONT_COLOR", + "ORANGE_FONT_COLOR", + "RED_FONT_COLOR", + "UNKNOWN", + "NONE", + "GameTimeFrame", + "TimeManagerClockButton", + "ToggleCalendar", + "TIME_TWENTYFOURHOURS", + "TIME_TWELVEHOURAM", + "TIME_TWELVEHOURPM", + "WorldMapFrameCloseButton", + "WorldMapFrame", + "ToggleFrame", + "SANCTUARY_TERRITORY", + "CONTESTED_TERRITORY", + "ChatEdit_GetActiveWindow", + "FACTION_CONTROLLED_TERRITORY", + "VOLUME", + "OPTION_TOOLTIP_MASTER_VOLUME", + "OPTION_TOOLTIP_MUSIC_VOLUME", + "OPTION_TOOLTIP_FX_VOLUME", + "OPTION_TOOLTIP_ENABLE_AMBIENCE", + "OPTION_TOOLTIP_DIALOG_VOLUME", + "GREEN_FONT_COLOR", + "MouseIsOver", + "LIGHTYELLOW_FONT_COLOR_CODE", + "ReloadUI", + "NORMAL_FONT_COLOR_CODE", + "RED_FONT_COLOR_CODE", + "StaticPopupDialogs", + "StaticPopup_Show", + "ALL", + "ACCEPT", + "CANCEL", + "FACTION_ALLIANCE", + "FACTION_HORDE", + "FACTION_OTHER", + "CLASS_ICON_TCOORDS", + "ICON_TAG_LIST", + "MAX_RAID_MEMBERS", + "MAX_PARTY_MEMBERS", + "RANDOM_ROLL_RESULT", + "WHISPER", + "StaticPopup_Hide", + "YES", + "NO", + "ITEM_QUALITY0_DESC", + "FACTION_STANDING_LABEL5", + "FACTION_STANDING_LABEL6", + "FACTION_STANDING_LABEL7", + "FACTION_STANDING_LABEL8", + "MoneyFrame_Update", + "TooltipUtil", + "MerchantRepairAllButton", + "MerchantGuildBankRepairButton", + "GUILD", + "REPAIR_COST", + "WITHDRAW", + "UNLIMITED", + "AVAILABLE", + "GUILDBANK_REPAIR_INSUFFICIENT_FUNDS", + "FROM", + "YOU", + "SHOW", + "LOOT", + "SPECIALIZATION", + "LOOT_METHOD", + "SELECT_LOOT_SPECIALIZATION", + "SlashCmdList", + "Settings", + "TOOLTIP_DEFAULT_COLOR", + "HIDE", + "COLOR", + "USE", + "BACKGROUND", + "BATTLEGROUND", + "ARENA", + "LOW", + "HIGH", + "SecureUnitButton_OnClick", + "FCF_DockUpdate", + "UpdateContainerFrameAnchors", + "MainMenuBar", + "TicketStatusFrame", + "ContainerFrame1", + "MainMenuBarVehicleLeaveButton", + "MultiBarBottomLeft", + "ExtraActionBarFrame", + "MultiCastActionBarFrame", + "MultiBarBottomRight", + "DropDownList1", + "UIDropDownMenu_AddButton", + "UIDROPDOWNMENU_MENU_LEVEL", + "UIDropDownMenu_AddSeparator", + "UIDropDownMenu_AddSpace", + "TOOLTIP_DEFAULT_BACKGROUND_COLOR", + "ToggleDropDownMenu", + "UIDropDownMenu_Initialize", + "UKNOWNBEING", + "SHORT", + "UIDROPDOWNMENU_MAXLEVELS", + "ColorPickerFrame", + "ExecuteFrameScript", + "GameFontDisableSmallLeft", + "GameFontHighlightSmallLeft", + "DropDownMenuButtonMixin", + "GameFontNormalSmallLeft", + "VIDEO_QUALITY_LABEL6", + "TooltipBackdropTemplateMixin", + "SharedTooltip_SetBackdropStyle", + "GRAY_FONT_COLOR", + "GameTooltip_Hide", + "GameTooltip_AddErrorLine", + "SELECTED_CHAT_FRAME", + "GameFontNormal", + "GameFontHighlight", + "InterfaceOptions_AddCategory", + "GameFontHighlightLarge", + "GameFontHighlightSmall", + "CLOSE", + "PanelTemplates_TabResize", + "PanelTemplates_SetDisabledTabState", + "PanelTemplates_SelectTab", + "PanelTemplates_DeselectTab", + "SetDesaturation", + "OpacitySliderFrame", + "ChatFontNormal", + "OKAY", + "NOT_BOUND", + "GameFontDisableSmall", + "GameFontNormalSmall", + "BACKDROP_SLIDER_8_8", + "IGNORE", + "FACTION", + "CUSTOM", + "COMMAND", + "RESET_POSITION", + "HELP_LABEL", + "HISTORY", + "TitanUtils_*", + "NAME", + "_G", + "getfenv", + "CreateFrame", + "error", + "ipairs", + "pcall", + "string", + "tostring", + "type", + "UIParent", + "GameTooltip", + "IsShiftKeyDown", + "IsAltKeyDown", + "IsControlKeyDown", + "table", + "pairs", + "print", + "math", + "tonumber", + "C_PvP", + "C_AddOns", + "GetCursorPosition", + "UnitName", + "GetCVar", + "GetScreenWidth", + "GetPhysicalScreenSize", + "Constants", + "C_Container", + "GetInventoryItemLink", + "GetItemInfoInstant", + "format", + "GetRealmName", + "floor", + "mod", + "date", + "C_PetBattles", + "ID", + "UIParent_ManageFramePositions", + "MUTE", + "OFF", + "MUTED", + "show", + "Add", + "NOTE", + "setmetatable", + "assert", + "select", + "getmetatable", + "PlaySound", + "newproxy", + "unpack", + "rawequal", + "securecallfunction", + "WOW_PROJECT_ID", + "loadstring", + "GetCursorInfo", + "next", + "wipe", + "rawset", + "rawget", + "GetLocale", + "geterrorhandler", + "BackdropTemplateMixin", + "xpcall", + "GetSpellInfo", + "CreateFont", + "max", + "min", + "ceil", + "GetTime", + "C_Timer", + "issecurevariable", + "hooksecurefunc", + "ClearCursor", + "GetMacroInfo", + "WOW_PROJECT_MAINLINE", + "PlaySoundFile", + "IsLoggedIn", + "PetHasActionBar", + "HasPetUI", + "GetNumShapeshiftForms", + "SetCVar", + "InCombatLockdown", + "GetScreenHeight", + "CreateFromMixins", + "GetMouseFocus", + "EventRegistry", + "Clamp", + "SOUNDKIT", + "C_Texture", + "Mixin", + "UnitPowerType", + "UnitHealth", + "UnitHealthMax", + "UnitPower", + "UnitPowerMax", + "GetItemInfo", + "GetInventorySlotInfo", + "C_Item", + "GetBuildInfo", + "GetInventoryItemID", + "UnitClass", + "GetInventoryItemCount", + "GetGameTime", + "RequestTimePlayed", + "UnitFactionGroup", + "time", + "UnitXPMax", + "UnitXP", + "GetXPExhaustion", + "GetZonePVPInfo", + "GetZoneText", + "GetSubZoneText", + "C_Map", + "GetBindLocation", + "C_CVar", + "UpdateAddOnCPUUsage", + "UpdateAddOnMemoryUsage", + "collectgarbage", + "GetAddOnMemoryUsage", + "GetFramerate", + "GetNetStats", + "gcinfo", + "GetAddOnCPUUsage", + "IsModifierKeyDown", + "GetAutoCompleteRealms", + "getn", + "GetMoney", + "CLASS_SORT_ORDER", + "LOCALIZED_CLASS_NAMES_MALE", + "RandomRoll", + "UnitIsGroupLeader", + "GetLootMethod", + "sort", + "IsInRaid", + "IsInGroup", + "IsInGuild", + "UnitIsInMyGuild", + "tContains", + "GetGuildInfo", + "SendChatMessage", + "GetLootThreshold", + "GuildControlGetRankName", + "UnitInParty", + "random", + "tinsert", + "UnitInRaid", + "C_GuildInfo", + "UnitGUID", + "GetItemQualityColor", + "C_TooltipInfo", + "GetRepairAllCost", + "GetGuildBankWithdrawMoney", + "GetGuildBankMoney", + "RepairAllItems", + "CanMerchantRepair", + "CanGuildBankRepair", + "IsGuildLeader", + "GetInventoryItemDurability", + "GetSpecialization", + "GetLootSpecialization", + "GetRaidDifficultyID", + "GetDifficultyInfo", + "GetDungeonDifficultyID", + "GetSpecializationInfo", + "GetSpecializationInfoByID", + "SetDungeonDifficultyID", + "IsInInstance", + "UnitLevel", + "SetRaidDifficultyID", + "GetNumSubgroupMembers", + "GetNumGroupMembers", + "UnitExists" + ], + "Lua.misc.parameters": [ + "--develop=true", + "--dbgport=11428" + ], + }, + "launch": { + "version": "0.2.0", + "configurations": [] + }, } \ No newline at end of file diff --git a/Titan/Titan.toc b/Titan/Titan.toc index 8ab4099..0011be9 100644 --- a/Titan/Titan.toc +++ b/Titan/Titan.toc @@ -36,9 +36,10 @@ 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\LibSharedMedia-3.0\lib.xml libs\Ace\LibQTip-1.0\lib.xml +libs\LibDeflate\LibDeflate.lua libs\LibDataBroker-1.1.lua locale\Localization.lua diff --git a/Titan/Titan.xml b/Titan/Titan.xml index a761d2a..eb6f9e6 100644 --- a/Titan/Titan.xml +++ b/Titan/Titan.xml @@ -1,20 +1,20 @@ - - - - - - + + + + + + diff --git a/Titan/TitanConfig.lua b/Titan/TitanConfig.lua index 28ced5d..e9237d9 100644 --- a/Titan/TitanConfig.lua +++ b/Titan/TitanConfig.lua @@ -1774,7 +1774,7 @@ local function TitanToonList() order = position, type = "execute", func = function(info, v) - TitanDumpTable(export) +-- TitanDumpTable(export) export_str = TitanVariables_CreateExport(export, false) end, } diff --git a/Titan/TitanPanelChangeLog.txt b/Titan/TitanPanelChangeLog.txt index 348ed4a..430b003 100644 --- a/Titan/TitanPanelChangeLog.txt +++ b/Titan/TitanPanelChangeLog.txt @@ -1,3 +1,3 @@ -A complete change history for Titan Panel since version 3.0.0.20000 is available at http://www.titanpanel.org/changes.html. - +A complete change history for Titan Panel since version 3.0.0.20000 is available at http://www.titanpanel.org/changes.html. + You may also find the most recent release notes, on our SourceForge page, here : https://sourceforge.net/p/titanpanel/wiki/Titan_Panel_Version_History/ \ No newline at end of file diff --git a/Titan/TitanPanelSetup-READ_ME_FIRST.txt b/Titan/TitanPanelSetup-READ_ME_FIRST.txt index 1f38f45..7818ef9 100644 --- a/Titan/TitanPanelSetup-READ_ME_FIRST.txt +++ b/Titan/TitanPanelSetup-READ_ME_FIRST.txt @@ -1,200 +1,200 @@ -TitanPanelSetup-READ_ME_FIRST File -================================== - -**************************************************************************************************** -**************************************************************************************************** - -1. Description - - Titan Panel adds a configurable interface bar/control panel to your WoW UI. - - -2. Installation - - Unzip the contents of the zip file into your ..\Interface\AddOns directory. - - Important Note for Mac Users: When a zip file contains folders, the auto-unzip function built - into Mac OSX will create a new folder to place them in. If you unzip directly to the AddOns - folder, this newly-created folder will prevent Titan from loading. We recommend Mac users unzip - to the desktop, open the Titan folder on the desktop, then select and drag the contents of it to - your ../Interface/AddOns folder. Verify WoW recognizes the addon. After signing on to WoW, - click the AddOns button on the Realm/Character Selection screen. Titan Panel should be checked - by default; if not, check it. While there, check any unchecked addons, including Titan plugins, - you want to display and uncheck any addons you don't want to display. Now enter the game. - - -3. Setup - - Basic setup includes displaying the desired bars and configuring the plugins. - - - Bars: - - By default, Titan Panel displays the Main Bar (a single bar at the top of the screen). - You can, however, display up to 4 independent bars, 1 or 2 at the top of the screen and/or 1 - or 2 at the bottom. To change the number and/or location of the bars, right-click a blank - area of the Titan Panel and click the Configuration option. Alternatively, you can click the - Game Menu icon on the bottom action bar, select Interface, click the + next to Titan Panel in - the Addons tab, and then click Bars. Use the Bars option to configure the top bars and the - Aux Bars option to configure the bottom bars. - - * Show Bar. Displays the specified bar: Main Bar is the top bar, Main Bar 2 is the 2nd - top bar, Auxiliary Bar is the bottom bar, Auxiliary Bar 2 is the 2nd bottom bar. - * Auto-hide. Causes the bar to appear only when you move the cursor atop the bar; - otherwise, the bar is hidden. - * Center text. Changes the location of display (left-side) plugins from left-justified to - centered. - * Disable screen adjust. Titan Panel adjusts the Blizzard UI automatically so Titan Panel - fits without overlapping frames, such as the minimap. This allows you to disable this - automatic adjustment. Select this option if you previously selected Auto-hide. - * Disable minimap adjust. Disables the adjustment of the minimap. This is useful in cases - you want to enable another addon to specifically handle that frame. - * Automatic ticket frame adjust. Moves the Blizzard Ticket Frame so it's not under the top - bar(s). - * Automatic log adjust. Pins the chat log above your highest horizontal action bar, so the - chat log doesn't overlap it. This only works on Blizzard default bars (not custom - bars). Because this option has created a lot of confusion, we recommend that you keep - this off, manually move the chat log, and lock it. - * Automatic bag adjust. Automatically adjusts your bag containers, so they don't overlap - the horizontal action bar when you are using bottom bar(s). Unchecking this option is - useful in cases you use another addon which specifically handles your container frames. - - - Configuring Plugins using the Interface menu: - - Select the Plugins option and then click the Plugin you want to move or configure. Not all of - the options listed below apply to every plugin. - - * Show plugin. Check to display the plugin, uncheck to hide. - * Show icon. Check to display the icon, uncheck to hide. - * Show label text. Check to display the name of the plugin, uncheck to hide. - * Show colored text. Check to show the information of display (left-side) plugins in - color, uncheck to display the information in white. - * Right-side plugin. Check to move the plugin to the right side. Applies to Clock and to - LDB launchers that aren't coded as launchers. - * < Shift Left. Swaps the plugin with the one to it's immediate left. - * > Shift Right. Swaps the plugin with the one to it's immediate right. - * Bar drop-down. Specifies the bar on which you want the plugin to appear. Only those - bars you have enabled appear in the dropdown. - - - Configuring Plugins using the Titan Panel right-click menu: - - * Right-click a blank area of the Titan Panel bar on which you want to show, hide, or - configure plugins. - * Hover the cursor over a category of plugins. Plugins that are displayed on the bar are - selected. - * Select additional plugins to display or deselect to hide by clicking the plugin's name on - the secondary menu. - * Select configuration options for individual plugins by clicking the option on the - tertiary menu. - - - Configuring Plugins using individual plugin's right-click menu: Most plugins have a - right-click menu for configuring them. - - - Moving plugins using drag-and-drop: - - * To swap plugins, click-and-drag a plugin onto another one. You can swap between - different bars. - * To move a plugin to another bar, click-and-drag it to an empty space on the desired bar. - - -4. Customization - - You have numerous ways to customize Titan Panel. One way is through core functions. The - following core functions appear on the right side of the main bar: - - - AutoHide (Push Pin icon): Left-clicking this icon causes the bar to only appear when you move - the cursor atop the bar. Otherwise, the bar is hidden. There is a separate push pin for each - bar. - - - Volume Control (speaker icon): This allows you to override Blizzard's default sound settings. - - * Right-click this icon to display the following Volume Control options: - + Show Sound/Voice options. Displays the Sound & Voice window. Here you can control - volume using Blizzard's interface. - + Override Blizzard Volume Settings. Select this to control volume using Titan Panel's - interface. - + Hide. Removes the plugin from the bar. - * Left-click this icon to display 6 slider bars with which you can control specific volume - levels. You MUST select Override Blizzard Volume Settings from the right-click options - menu if you want to control the volume with these sliders. - - - Clock: - - * In addition to the options in the Interface menu, right-clicking the Clock gives access to - the following options: Show Local Time, Show Server Time, Show Server Adjusted Time, Hide - Time button, and Hide Calendar Button. - * Left-clicking allows you to adjust the server time and change the time to 24-hour format. - - The following core functions appear in Blizzard's Interface Addons frame: - - - Tooltips and Frames: - - * Hide tooltips in combat. Turns off tooltips in combat so you're not distracted while - fighting. - * Show tooltips. Displays a tooltip when you hover the cursor over a button/icon. - * Lock buttons. Locks the buttons in place, keeping you from inadvertently moving them. - * Show plugin versions. Displays the version number when a plugin is selected from the - Interface menu. - * Force LDB launchers to right-side. Use when LDB launchers are not coded as such. - * Refresh plugins. Use when a plugin does not update. If you need to use this, and it fixes - the display, contact the developer. - * Reset Titan Panel to Default. For emergency use only. - - - Scale and Font: - - * UI Scale. Controls the scale of the User Interface from 64% to 100%. - * Titan Panel Scale. Controls the size of Titan Panel from 75% to 125%. - * Button Spacing. Controls the separation between left-side plugins from 5 pixels to 80 - pixels. - * Tooltip Font Scale. Controls the size of the plugins' Tooltip Fonts from 50% to 130%. - * Disable Tooltip Font Scale. Overrides the setting on the Tooltip Font Scale slider. - * Panel Font drop-down. Changes the font type used. - * Font Size. Changes the size of the specified font. - * Titan Panel Frame Strata drop-down. Changes the depth you want the bars to be relative to - other frames. - - - Transparency: Controls the transparency of each of the bars and the tooltips. - - - All the built-ins, and many third-party plugins, give you the option to disable them individually - by right-clicking the icon and selecting Hide. Another way to customize Titan Panel is by - changing skins. Titan comes with a large selection of skins. You control skins from the - Interface Addon menu. - - - Skins: Here you can select a skin from the Skin List drop-down or Reset to Defaults. - - - Skins-Custom: Use this screen to add a custom skin to the Skin List or remove one. - - -5. Profiles - - Profiles allow you to have different configurations for individual characters. The - first time you configure Titan Panel, it automatically saves the settings in a profile, using the - character's name. It will continue to use that profile for other characters until you change - your configuration and save it. There are two ways to manage profiles: - - - Titan Panel Right-Click Menu: - - * Profiles Manage. Allows you to replace the current character's profile with another another - character's profile. Also allows you to delete a profile. - * Profiles Save. Allows you to save the current character's settings under a user-specified - name. - - - Interface Addons Menu: Gives you the same options to manage and save profiles as the - right-click menu does. - - -6. Bug Reporting - - If you encounter a bug, open an Issue at our SourceForge site: - - https://sourceforge.net/p/titanpanel/tickets/?source=navbar - - Please include as many details as possible, including a complete list of addons. It is helpful - to use a bug capturing addon, such as !Swatter (part of Gatherer addon); copy and paste the - entire text into the Issue screen. We will post our troubleshooting results and recommendations - there, so check back often. Before opening the Issue, please Search All Issues to see if the bug - has already been reported and fixed. Also, check the download sites for information on the - download page, such as: - - http://www.wowinterface.com/downloads/fileinfo.php?id=8092 +TitanPanelSetup-READ_ME_FIRST File +================================== + +**************************************************************************************************** +**************************************************************************************************** + +1. Description + + Titan Panel adds a configurable interface bar/control panel to your WoW UI. + + +2. Installation + + Unzip the contents of the zip file into your ..\Interface\AddOns directory. + + Important Note for Mac Users: When a zip file contains folders, the auto-unzip function built + into Mac OSX will create a new folder to place them in. If you unzip directly to the AddOns + folder, this newly-created folder will prevent Titan from loading. We recommend Mac users unzip + to the desktop, open the Titan folder on the desktop, then select and drag the contents of it to + your ../Interface/AddOns folder. Verify WoW recognizes the addon. After signing on to WoW, + click the AddOns button on the Realm/Character Selection screen. Titan Panel should be checked + by default; if not, check it. While there, check any unchecked addons, including Titan plugins, + you want to display and uncheck any addons you don't want to display. Now enter the game. + + +3. Setup + + Basic setup includes displaying the desired bars and configuring the plugins. + + - Bars: + + By default, Titan Panel displays the Main Bar (a single bar at the top of the screen). + You can, however, display up to 4 independent bars, 1 or 2 at the top of the screen and/or 1 + or 2 at the bottom. To change the number and/or location of the bars, right-click a blank + area of the Titan Panel and click the Configuration option. Alternatively, you can click the + Game Menu icon on the bottom action bar, select Interface, click the + next to Titan Panel in + the Addons tab, and then click Bars. Use the Bars option to configure the top bars and the + Aux Bars option to configure the bottom bars. + + * Show Bar. Displays the specified bar: Main Bar is the top bar, Main Bar 2 is the 2nd + top bar, Auxiliary Bar is the bottom bar, Auxiliary Bar 2 is the 2nd bottom bar. + * Auto-hide. Causes the bar to appear only when you move the cursor atop the bar; + otherwise, the bar is hidden. + * Center text. Changes the location of display (left-side) plugins from left-justified to + centered. + * Disable screen adjust. Titan Panel adjusts the Blizzard UI automatically so Titan Panel + fits without overlapping frames, such as the minimap. This allows you to disable this + automatic adjustment. Select this option if you previously selected Auto-hide. + * Disable minimap adjust. Disables the adjustment of the minimap. This is useful in cases + you want to enable another addon to specifically handle that frame. + * Automatic ticket frame adjust. Moves the Blizzard Ticket Frame so it's not under the top + bar(s). + * Automatic log adjust. Pins the chat log above your highest horizontal action bar, so the + chat log doesn't overlap it. This only works on Blizzard default bars (not custom + bars). Because this option has created a lot of confusion, we recommend that you keep + this off, manually move the chat log, and lock it. + * Automatic bag adjust. Automatically adjusts your bag containers, so they don't overlap + the horizontal action bar when you are using bottom bar(s). Unchecking this option is + useful in cases you use another addon which specifically handles your container frames. + + - Configuring Plugins using the Interface menu: + + Select the Plugins option and then click the Plugin you want to move or configure. Not all of + the options listed below apply to every plugin. + + * Show plugin. Check to display the plugin, uncheck to hide. + * Show icon. Check to display the icon, uncheck to hide. + * Show label text. Check to display the name of the plugin, uncheck to hide. + * Show colored text. Check to show the information of display (left-side) plugins in + color, uncheck to display the information in white. + * Right-side plugin. Check to move the plugin to the right side. Applies to Clock and to + LDB launchers that aren't coded as launchers. + * < Shift Left. Swaps the plugin with the one to it's immediate left. + * > Shift Right. Swaps the plugin with the one to it's immediate right. + * Bar drop-down. Specifies the bar on which you want the plugin to appear. Only those + bars you have enabled appear in the dropdown. + + - Configuring Plugins using the Titan Panel right-click menu: + + * Right-click a blank area of the Titan Panel bar on which you want to show, hide, or + configure plugins. + * Hover the cursor over a category of plugins. Plugins that are displayed on the bar are + selected. + * Select additional plugins to display or deselect to hide by clicking the plugin's name on + the secondary menu. + * Select configuration options for individual plugins by clicking the option on the + tertiary menu. + + - Configuring Plugins using individual plugin's right-click menu: Most plugins have a + right-click menu for configuring them. + + - Moving plugins using drag-and-drop: + + * To swap plugins, click-and-drag a plugin onto another one. You can swap between + different bars. + * To move a plugin to another bar, click-and-drag it to an empty space on the desired bar. + + +4. Customization + + You have numerous ways to customize Titan Panel. One way is through core functions. The + following core functions appear on the right side of the main bar: + + - AutoHide (Push Pin icon): Left-clicking this icon causes the bar to only appear when you move + the cursor atop the bar. Otherwise, the bar is hidden. There is a separate push pin for each + bar. + + - Volume Control (speaker icon): This allows you to override Blizzard's default sound settings. + + * Right-click this icon to display the following Volume Control options: + + Show Sound/Voice options. Displays the Sound & Voice window. Here you can control + volume using Blizzard's interface. + + Override Blizzard Volume Settings. Select this to control volume using Titan Panel's + interface. + + Hide. Removes the plugin from the bar. + * Left-click this icon to display 6 slider bars with which you can control specific volume + levels. You MUST select Override Blizzard Volume Settings from the right-click options + menu if you want to control the volume with these sliders. + + - Clock: + + * In addition to the options in the Interface menu, right-clicking the Clock gives access to + the following options: Show Local Time, Show Server Time, Show Server Adjusted Time, Hide + Time button, and Hide Calendar Button. + * Left-clicking allows you to adjust the server time and change the time to 24-hour format. + + The following core functions appear in Blizzard's Interface Addons frame: + + - Tooltips and Frames: + + * Hide tooltips in combat. Turns off tooltips in combat so you're not distracted while + fighting. + * Show tooltips. Displays a tooltip when you hover the cursor over a button/icon. + * Lock buttons. Locks the buttons in place, keeping you from inadvertently moving them. + * Show plugin versions. Displays the version number when a plugin is selected from the + Interface menu. + * Force LDB launchers to right-side. Use when LDB launchers are not coded as such. + * Refresh plugins. Use when a plugin does not update. If you need to use this, and it fixes + the display, contact the developer. + * Reset Titan Panel to Default. For emergency use only. + + - Scale and Font: + + * UI Scale. Controls the scale of the User Interface from 64% to 100%. + * Titan Panel Scale. Controls the size of Titan Panel from 75% to 125%. + * Button Spacing. Controls the separation between left-side plugins from 5 pixels to 80 + pixels. + * Tooltip Font Scale. Controls the size of the plugins' Tooltip Fonts from 50% to 130%. + * Disable Tooltip Font Scale. Overrides the setting on the Tooltip Font Scale slider. + * Panel Font drop-down. Changes the font type used. + * Font Size. Changes the size of the specified font. + * Titan Panel Frame Strata drop-down. Changes the depth you want the bars to be relative to + other frames. + + - Transparency: Controls the transparency of each of the bars and the tooltips. + + + All the built-ins, and many third-party plugins, give you the option to disable them individually + by right-clicking the icon and selecting Hide. Another way to customize Titan Panel is by + changing skins. Titan comes with a large selection of skins. You control skins from the + Interface Addon menu. + + - Skins: Here you can select a skin from the Skin List drop-down or Reset to Defaults. + + - Skins-Custom: Use this screen to add a custom skin to the Skin List or remove one. + + +5. Profiles + + Profiles allow you to have different configurations for individual characters. The + first time you configure Titan Panel, it automatically saves the settings in a profile, using the + character's name. It will continue to use that profile for other characters until you change + your configuration and save it. There are two ways to manage profiles: + + - Titan Panel Right-Click Menu: + + * Profiles Manage. Allows you to replace the current character's profile with another another + character's profile. Also allows you to delete a profile. + * Profiles Save. Allows you to save the current character's settings under a user-specified + name. + + - Interface Addons Menu: Gives you the same options to manage and save profiles as the + right-click menu does. + + +6. Bug Reporting + + If you encounter a bug, open an Issue at our SourceForge site: + + https://sourceforge.net/p/titanpanel/tickets/?source=navbar + + Please include as many details as possible, including a complete list of addons. It is helpful + to use a bug capturing addon, such as !Swatter (part of Gatherer addon); copy and paste the + entire text into the Issue screen. We will post our troubleshooting results and recommendations + there, so check back often. Before opening the Issue, please Search All Issues to see if the bug + has already been reported and fixed. Also, check the download sites for information on the + download page, such as: + + http://www.wowinterface.com/downloads/fileinfo.php?id=8092 http://www.curse.com/addons/wow/titan-panel \ No newline at end of file diff --git a/Titan/TitanTemplate.xml b/Titan/TitanTemplate.xml index 72133b9..ef030d6 100644 --- a/Titan/TitanTemplate.xml +++ b/Titan/TitanTemplate.xml @@ -1,158 +1,158 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TitanOptionsSliderTemplate_OnLoad(self); - - self:EnableMouseWheel(true); - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TitanOptionsSliderTemplate_OnLoad(self); + + self:EnableMouseWheel(true); + + + + + diff --git a/Titan/_ATitanDoc.lua b/Titan/_ATitanDoc.lua index 68d4c7f..ebaf604 100644 --- a/Titan/_ATitanDoc.lua +++ b/Titan/_ATitanDoc.lua @@ -1,348 +1,348 @@ ---[===[ File -Starts the Titan developer documention. ---]===] - ---[===[ Titan Documentation Beginning - -This document will introduce Titan essentials for a Titan developer. -The intent is simplify what may appear to be a daunting experience. - -We suggest you grab your favorite beverage, read this doc, and relax! -Many of Titan mysteries will be explained. 🙂 - -The Titan team and its users are available to answer questions. -The two most used ways are : -The Titan Discord community - https://discord.gg/e93sxuSPwC -Curse comments under Titan Panel addon - -=== IDE Tools used: -Visual Studio Code - https://code.visualstudio.com/ -Other IDEs accept Lua Language Server, see if your prefered IDE will accept LLS - -Lua Language Server (LLS) - https://marketplace.visualstudio.com/items?itemName=sumneko.lua - https://github.com/LuaLS/lua-language-server -WoW API - LLS extension - https://marketplace.visualstudio.com/items?itemName=ketho.wow-api - https://github.com/Ketho/vscode-wow-api - -And a tiny Python parser to pull these comments. - -Note: The WoW API is geared to Retail. -There was no option to automatically include 'Classic' deprecated routines. -There are diagnostic annotations used to ignore some warnings. -Ignore warning annotations were limited as much as practical to 'this line' to point out usage of Classic routines. - -=== Documentation blocks -These are created from annotations in the Lua files. -API : -These are routines Titan will keep stable. -Changes to these varaibles and routines will be broadcast to developers via Discord at a minimum. - -Dev : -These are global routines Titan uses. These may change at any time per Titan needs and design. - -File : -Each file has a terse description of its contents. ---]===] - ---[===[ Titan Start editing - -Before you start changing this example, it is HIGHLY recommended to install the following WoW addons: -- BugGrabber : Grabs errors and stores them -- BugSack : The visual part of BugGrabber -- WowLua : This allows you to try Lua code directly in WoW. - -Small changes are recommended; then test your coding. -When testing, just start or reload WoW. All versions now check and load new files on reload. - -Reload is /reload in game chat. -Using a text editor with code folding features will make this file easier to read and find information. - -For simple changes, install a code / text editor. NotepadPlusPlus is a very popular editor. - -For more in delpth changes consider using an IDE (Integrated Development Environment). -The file TitanIDE contains details on tools and annotation. - -Regardless of tools used, please update any annotations and comments as changes are made!!! - -=== Additional Help For You -A good Lua resource is https://www.lua.org/docs.html -NOTE: WoW uses Lua version 5.1 as its base. -NOTE: WoW does restrict, add, or even remove some Lua features. For example the file routines and many OS routines are not available to an addon. - -There are sites that have deeper explanations about addon development, such as -- Wowhead.com -- Wiki wow wiki (Warcraft.Wiki.gg). -Please use these or other sites for more detailed addon and API information. -The API information changes as Blizzard adds features, changes API methods, or any other reason. - -=== Folder Structure -Inside the Titan folder you will notice : -- Artwork folder : Contains skins used by Titan -- libs : Library routines Titan uses -- A .toc file -- Many .lua files including this file -- An XML file : Containing Titan templates mainly for plugins -- This file - - -=== .toc -NOTE: Summer 2025 Titan dropped TitanClassic as a method to make CE and other WoW versions distinct. - -The folder and the .toc files MUST have the same name! -Sort of... the name prior to the underscore(_) must be the same as the folder name. -The part after (postfix) has meaning to the WoW addon loader. -This list changes : https://warcraft.wiki.gg/wiki/TOC_format - -Titan uses at least two postfix values. -_Mainline : current retail version -_Vanilla : Classic Era version - -Titan uses this TOC method. Notice a couple built-ins use _Vanilla.toc. -This allows Titan to load plugins (built-in or 3rd party) intended for Classic only without change. - -=== .toc internals -NOTE: The ## Interface value should match the current interface value of the corresponding WoW version. -In BattleNet this is typically shown below the 'Play' button. -DragonFlight 10.02.05 is represented without dots - 100207 - in the .toc. - -If the interface value is higher or lower, WoW will complain that you are running 'out of date' addons. - -See one of the referrenced sites for more detail. -- https://warcraft.wiki.gg/wiki/TOC_format contains more info than you will ever need on TOC format. - -After the TOC directives, Titan lists the files in the order they are to be parsed. -This is important for Titan (or any addon) to load properly. - -TitanGame.Lua specifies TITAN_ID which is the addon ID and is determines whether to use Retail or Classic versions of some routines. - -Then the Ace libraries. Note Titan does not use all the Ace libraries. -_Titan_Lib_Notes shows a running change history of the libraries. - -Then all the localization files. - -Then the Titan code files. - -=== Artwork - -WoW tends to use .tga image files. -Lookup TextureBase:SetTexture for current accepted image types. -NOTE: All versions of WoW may not accept all image types. - -Most graphic art software can save to these formats. We don’t recommend using an online source to convert options. -They have a tendency to add additional code or info to the artwork. ---]===] - ---[===[ Titan Addon code flow - -First step: ==== Starting WoW -Wow will load load Titan along with other addons installed. There is no guarantee of order the addons are installed! - -The files will be loaded / run per the order in the TOC. -TitanTemplate.xml : Creates the Titan frame - TitanPanelBarButton - along with Titan Templates. This is used to receive events. - -Any code outside the Lua functions will be run per the order in the TOC. -Examples: -- TitanGlobal.lua sets up constants and variables used by Titan -- Titan.lua local variables and registering for some events such as ADDON_LOADED -- Creation of functions -- TitanLDB.lua creates LDBToTitan frome to handle LDB objects - -When ADDON_LOADED event is received, -- Titan registers for event PLAYER_ENTERING_WORLD -- Titan ensures its saved variables are whole and known player profiles are read. - -NOTE: On ADDON_LOADED is the first time addon saved variables should be considered loaded and safe!! -Using addon saved variables before ADDON_LOADED is likely to result in nil(s). Such as when WoW parses the addon code as it is loading. -NOTE: The addon saved vars are NOT the Titan plugin saved vars via the registry (.savedVariables)! The registry is processed later! - -Next: ==== Waiting for WoW -WoW fires a bunch of events as this and other addons are loaded. -Eventually the game and all addons are loaded and PLAYER_ENTERING_WORLD event is sent - -Next: ==== Entering world - PLAYER_ENTERING_WORLD (PEW) event -When PLAYER_ENTERING_WORLD event is received via OnEvent, the real work begins. -The PEW events do NOT guarantee order! Titan plugins (addons) could receive a PEW before Titan - See NOTE below. - -The local routine - TitanPanel_PlayerEnteringWorld - is called using pcall. -This ensures Titan reacts to errors rather than forcing an error to the user. -TitanPanel_PlayerEnteringWorld does all the variable and profile setup for the character entering the world. - -On login PLAYER_ENTERING_WORLD - not reload - Titan -- Sets character profiles - TitanVariables_InitTitanSettings -- Sets TitanPanel*Anchor for other addons to adjust for Titan -- Creates all Titan bars including right click menu and auto hide frames. See Frames below. -- Registers for events Titan uses - RegisterForEvents - -On login and reload Titan -- Set THIS character profile () - TitanVariables_UseSettings - - See TitanVariables (File) for more details on saved variables; this is a simple concept but touchy to implement. - The user chosen profile sets the user chosen plugin saved vars for both Titan and any plugins - see NOTE below. - TitanVariables_UseSettings uses - - TitanPanel_InitPanelBarButton to set the bars the user wants. - - TitanPanel_InitPanelButtons to set the plugins the user wants on the user selected bars via OnShow. -- Update the Titan config tables - TitanUpdateConfig -- Set Titan font and strata -- Sync any LDB plugins with the cooresponding Titan plugin- TitanLDBRefreshButton -If the above was successful then all is good -If the above failed with an error then -- tell user some bad happened with error they can pass to dev team -- attempt to hide all bars as cleanup -- nuke the Titan config tables as cleanup - -NOTE: The PEW event is an important but subtle distinction for Titan plugins! -Titan plugins should be very careful if they use the PEW event to run code. The PEW events do NOT guarantee order! -Meaning the plugin PEW could be processed BEFORE Titan has set saved vars for itself or plugins. -Titan plugins should not assume ANY saved vars are available until their OnShow. -Only at the OnShow are the 'right' plugin saved vars guaranteed to be set. -We have seen bugs occur on some user systems due to the order addons get and process the PEW event. ---]===] - ---[[ Frames and Frame Scripts -Here we detour into XML. TitanTemplate.xml contains the frames used by Titan. -- TitanPanelBarButton : This "is" Titan in the sense that it has all events attached to it and all the code. -- Titan_Bar__Display_Template : The template (Button) for a Titan bar. -- TitanPanelBarButtonHiderTemplate : The template (Button) paired a full width Titan bar to allow hiding and unhiding the paired Titan Bar. -- TitanPanelTooltip : This or GameTooltip is used for tool tips. - -TitanPanelButton_CreateBar in Titan.lua creates the full width bars and short bars by looping through TitanBarData. -TitanBarData in TitanVariables.lua holds creation data for each bar. -TitanBarDataVars holds the Titan and user settings for each bar. An initial setup (fresh / another install) uses TitanBarVarsDefaults. - -The frame scripts are how WoW and Titan interact with this addon. - -==== OnEnter and OnLeave -Titan sets these scripts on a Bar for future use . Currently Titan does no work. - -For Titan Hider Bars these are used to show / hide the Titan Bar. -Note: Hider Bars are only for the full width bars - NOT Short Bars. - -==== OnClick script : -Right click is to open the Titan menu. -Left click closes any tooltip and any menu. - -On Short Bars Titan registers for -- OnDragStart and OnDragStop (left mouse button) for moving Short Bars -- OnMouseWheel to size a Short Bar - -==== OnShow script : -Not used by Titan bars. - -==== OnHide script : -Not used by Titan bars. - -==== OnEvent script : -Titan.lua sets the OnEvent stript for TitanPanelBarButton to redirect events to TitanPanelBarButton: -See local function RegisterForEvents for the list of eventsand their usage. ---]] - ---[[ Plugin .registry - -=== Titan plugins -The routine - TitanUtils_RegisterPluginList - starts the plugin registry process. - -=== LDB objects : See LDBTitan.lua for many more details. - -The OnEvent script of LDBToTitan frame processes the PLAYER_LOGIN event. -This starts the process to convert all known LDB objects into Titan plugins. -Note: PLAYER_LOGIN occurs same time or very close to PLAYER_ENTERING_WORLD. -This event was chosen by the orignal developer. - -Each object found calls TitanLDBCreateObject using pcall to protect Titan. - -Before Titan is initialized (first PLAYER_ENTERING_WORLD) the LDB object will be added to the plugin list. -After, TitanUtils_RegisterPluginList will be used iteratively to register each found LDB object. -Most LDB objects are created on loading by addons. There should only an issue for addons that create -many LDB objects on demand. - -The Titan plugin example has a lot more detail from the plugin view that would be helpful to a Titan dev. ---]] - ---[[ Saved Variables - -See TitanVariables.lua (File) for additional detail. - -Much of the info below is included in the Titan plugin example. - -NOTE: Titan routines have used 1 as true since inception so be careful on 'true checks'. -As an example -if ShowUsedSlots then -*should* work fine if ShowUsedSlots is true or 1 - -=== Where are these saved variables????? -The saved variables are specified in the Titan toc : -## SavedVariables: TitanAll, TitanSettings, TitanSkins, ServerTimeOffsets, ServerHourFormat - -TitanSettings contains all the plugin saved variables. -Titan uses the single table structure to store the saved variables across a user account. -This makes the setup code rather cumbersome and not straight forward - just warning... - -The saved variables can be found here: .../World of Warcraft/_retail_/WTF/Account/(account name>/SavedVariables/Titan.lua -There is a Titan.lua.bak which is the prior save (logout / exit / reload). - -It is HIGHLY recommended opening the saved variables file in an editor with code folding features! -This file could be quite large with many lines. -I have 20+ characters on one server. Even though I do not use many addons, I do test with addons on some characters. -A plugin such as Titan Panel [Reputation] can create 100+ plugins. My file is nearly 90,000 lines long! - -Say we want to find a character named Embic on Staghelm which you are using for testing. -This would under -TitanSettings = { - ["Players"] = { - ["Embic@Staghelm"] = { - ["Panel"] = { - -- Holds all the Titan settings for this character - } - ["BarVars"] = { - -- Holds all the Titan bar settings for this character - } - ["Plugins"] = { - -- Each registered plugin will be here - ["Starter"] = { - ["notes"] = "Adds bag and free slot information to Titan Panel.\n", - ["menuTextFunction"] = nil, - ["id"] = "Starter", - ["menuText"] = "Bag", - ["iconWidth"] = 16, - ["savedVariables"] = { - ["ShowColoredText"] = 1, - ["CustomLabel3Text"] = "", - ["ShowIcon"] = 1, - ["OpenBags"] = false, - ["CustomLabel3TextShow"] = false, - ["CustomLabelTextShow"] = false, - ["CustomLabel4Text"] = "", - ["CustomLabel2Text"] = "", - ["OpenBagsClassic"] = "new_install", - ["ShowLabelText"] = 1, - ["CustomLabel4TextShow"] = false, - ["CountProfBagSlots"] = false, - ["ShowUsedSlots"] = 1, - ["DisplayOnRightSide"] = false, - ["ShowDetailedInfo"] = false, - ["CustomLabel2TextShow"] = false, - ["CustomLabelText"] = "", - }, - ["controlVariables"] = { - ["DisplayOnRightSide"] = true, - ["ShowColoredText"] = true, - ["ShowIcon"] = true, - ["ShowLabelText"] = true, - }, - ["version"] = "1.0.0", - ["category"] = "Information", - ["buttonTextFunction"] = nil , - ["tooltipTextFunction"] = nil , - ["icon"] = "Interface\\AddOns\\TitanPlugin\\Artwork\\TitanStarter", - ["tooltipTitle"] = "Bags Info", - }, - } - ["Adjust"] = { - -- Holds offsets for frames the user may adjust - Retail and Classic have different list of frames - } - ["Register"] = { - -- Holds data as each plugin and LDB is attempted to be registered. - -- There may be helpful debug data here under your plugin name if the plugin is not shown as expected. - -- Titan > Configuration > Attempts shows some of this data, including errors. - } - ---]] +--[===[ File +Starts the Titan developer documention. +--]===] + +--[===[ Titan Documentation Beginning + +This document will introduce Titan essentials for a Titan developer. +The intent is simplify what may appear to be a daunting experience. + +We suggest you grab your favorite beverage, read this doc, and relax! +Many of Titan mysteries will be explained. 🙂 + +The Titan team and its users are available to answer questions. +The two most used ways are : +The Titan Discord community - https://discord.gg/e93sxuSPwC +Curse comments under Titan Panel addon + +=== IDE Tools used: +Visual Studio Code - https://code.visualstudio.com/ +Other IDEs accept Lua Language Server, see if your prefered IDE will accept LLS + +Lua Language Server (LLS) - https://marketplace.visualstudio.com/items?itemName=sumneko.lua + https://github.com/LuaLS/lua-language-server +WoW API - LLS extension - https://marketplace.visualstudio.com/items?itemName=ketho.wow-api + https://github.com/Ketho/vscode-wow-api + +And a tiny Python parser to pull these comments. + +Note: The WoW API is geared to Retail. +There was no option to automatically include 'Classic' deprecated routines. +There are diagnostic annotations used to ignore some warnings. +Ignore warning annotations were limited as much as practical to 'this line' to point out usage of Classic routines. + +=== Documentation blocks +These are created from annotations in the Lua files. +API : +These are routines Titan will keep stable. +Changes to these varaibles and routines will be broadcast to developers via Discord at a minimum. + +Dev : +These are global routines Titan uses. These may change at any time per Titan needs and design. + +File : +Each file has a terse description of its contents. +--]===] + +--[===[ Titan Start editing + +Before you start changing this example, it is HIGHLY recommended to install the following WoW addons: +- BugGrabber : Grabs errors and stores them +- BugSack : The visual part of BugGrabber +- WowLua : This allows you to try Lua code directly in WoW. + +Small changes are recommended; then test your coding. +When testing, just start or reload WoW. All versions now check and load new files on reload. + +Reload is /reload in game chat. +Using a text editor with code folding features will make this file easier to read and find information. + +For simple changes, install a code / text editor. NotepadPlusPlus is a very popular editor. + +For more in delpth changes consider using an IDE (Integrated Development Environment). +The file TitanIDE contains details on tools and annotation. + +Regardless of tools used, please update any annotations and comments as changes are made!!! + +=== Additional Help For You +A good Lua resource is https://www.lua.org/docs.html +NOTE: WoW uses Lua version 5.1 as its base. +NOTE: WoW does restrict, add, or even remove some Lua features. For example the file routines and many OS routines are not available to an addon. + +There are sites that have deeper explanations about addon development, such as +- Wowhead.com +- Wiki wow wiki (Warcraft.Wiki.gg). +Please use these or other sites for more detailed addon and API information. +The API information changes as Blizzard adds features, changes API methods, or any other reason. + +=== Folder Structure +Inside the Titan folder you will notice : +- Artwork folder : Contains skins used by Titan +- libs : Library routines Titan uses +- A .toc file +- Many .lua files including this file +- An XML file : Containing Titan templates mainly for plugins +- This file + + +=== .toc +NOTE: Summer 2025 Titan dropped TitanClassic as a method to make CE and other WoW versions distinct. + +The folder and the .toc files MUST have the same name! +Sort of... the name prior to the underscore(_) must be the same as the folder name. +The part after (postfix) has meaning to the WoW addon loader. +This list changes : https://warcraft.wiki.gg/wiki/TOC_format + +Titan uses at least two postfix values. +_Mainline : current retail version +_Vanilla : Classic Era version + +Titan uses this TOC method. Notice a couple built-ins use _Vanilla.toc. +This allows Titan to load plugins (built-in or 3rd party) intended for Classic only without change. + +=== .toc internals +NOTE: The ## Interface value should match the current interface value of the corresponding WoW version. +In BattleNet this is typically shown below the 'Play' button. +DragonFlight 10.02.05 is represented without dots - 100207 - in the .toc. + +If the interface value is higher or lower, WoW will complain that you are running 'out of date' addons. + +See one of the referrenced sites for more detail. +- https://warcraft.wiki.gg/wiki/TOC_format contains more info than you will ever need on TOC format. + +After the TOC directives, Titan lists the files in the order they are to be parsed. +This is important for Titan (or any addon) to load properly. + +TitanGame.Lua specifies TITAN_ID which is the addon ID and is determines whether to use Retail or Classic versions of some routines. + +Then the Ace libraries. Note Titan does not use all the Ace libraries. +_Titan_Lib_Notes shows a running change history of the libraries. + +Then all the localization files. + +Then the Titan code files. + +=== Artwork + +WoW tends to use .tga image files. +Lookup TextureBase:SetTexture for current accepted image types. +NOTE: All versions of WoW may not accept all image types. + +Most graphic art software can save to these formats. We don’t recommend using an online source to convert options. +They have a tendency to add additional code or info to the artwork. +--]===] + +--[===[ Titan Addon code flow + +First step: ==== Starting WoW +Wow will load load Titan along with other addons installed. There is no guarantee of order the addons are installed! + +The files will be loaded / run per the order in the TOC. +TitanTemplate.xml : Creates the Titan frame - TitanPanelBarButton - along with Titan Templates. This is used to receive events. + +Any code outside the Lua functions will be run per the order in the TOC. +Examples: +- TitanGlobal.lua sets up constants and variables used by Titan +- Titan.lua local variables and registering for some events such as ADDON_LOADED +- Creation of functions +- TitanLDB.lua creates LDBToTitan frome to handle LDB objects + +When ADDON_LOADED event is received, +- Titan registers for event PLAYER_ENTERING_WORLD +- Titan ensures its saved variables are whole and known player profiles are read. + +NOTE: On ADDON_LOADED is the first time addon saved variables should be considered loaded and safe!! +Using addon saved variables before ADDON_LOADED is likely to result in nil(s). Such as when WoW parses the addon code as it is loading. +NOTE: The addon saved vars are NOT the Titan plugin saved vars via the registry (.savedVariables)! The registry is processed later! + +Next: ==== Waiting for WoW +WoW fires a bunch of events as this and other addons are loaded. +Eventually the game and all addons are loaded and PLAYER_ENTERING_WORLD event is sent + +Next: ==== Entering world - PLAYER_ENTERING_WORLD (PEW) event +When PLAYER_ENTERING_WORLD event is received via OnEvent, the real work begins. +The PEW events do NOT guarantee order! Titan plugins (addons) could receive a PEW before Titan - See NOTE below. + +The local routine - TitanPanel_PlayerEnteringWorld - is called using pcall. +This ensures Titan reacts to errors rather than forcing an error to the user. +TitanPanel_PlayerEnteringWorld does all the variable and profile setup for the character entering the world. + +On login PLAYER_ENTERING_WORLD - not reload - Titan +- Sets character profiles - TitanVariables_InitTitanSettings +- Sets TitanPanel*Anchor for other addons to adjust for Titan +- Creates all Titan bars including right click menu and auto hide frames. See Frames below. +- Registers for events Titan uses - RegisterForEvents + +On login and reload Titan +- Set THIS character profile () - TitanVariables_UseSettings - + See TitanVariables (File) for more details on saved variables; this is a simple concept but touchy to implement. + The user chosen profile sets the user chosen plugin saved vars for both Titan and any plugins - see NOTE below. + TitanVariables_UseSettings uses + - TitanPanel_InitPanelBarButton to set the bars the user wants. + - TitanPanel_InitPanelButtons to set the plugins the user wants on the user selected bars via OnShow. +- Update the Titan config tables - TitanUpdateConfig +- Set Titan font and strata +- Sync any LDB plugins with the cooresponding Titan plugin- TitanLDBRefreshButton +If the above was successful then all is good +If the above failed with an error then +- tell user some bad happened with error they can pass to dev team +- attempt to hide all bars as cleanup +- nuke the Titan config tables as cleanup + +NOTE: The PEW event is an important but subtle distinction for Titan plugins! +Titan plugins should be very careful if they use the PEW event to run code. The PEW events do NOT guarantee order! +Meaning the plugin PEW could be processed BEFORE Titan has set saved vars for itself or plugins. +Titan plugins should not assume ANY saved vars are available until their OnShow. +Only at the OnShow are the 'right' plugin saved vars guaranteed to be set. +We have seen bugs occur on some user systems due to the order addons get and process the PEW event. +--]===] + +--[[ Frames and Frame Scripts +Here we detour into XML. TitanTemplate.xml contains the frames used by Titan. +- TitanPanelBarButton : This "is" Titan in the sense that it has all events attached to it and all the code. +- Titan_Bar__Display_Template : The template (Button) for a Titan bar. +- TitanPanelBarButtonHiderTemplate : The template (Button) paired a full width Titan bar to allow hiding and unhiding the paired Titan Bar. +- TitanPanelTooltip : This or GameTooltip is used for tool tips. + +TitanPanelButton_CreateBar in Titan.lua creates the full width bars and short bars by looping through TitanBarData. +TitanBarData in TitanVariables.lua holds creation data for each bar. +TitanBarDataVars holds the Titan and user settings for each bar. An initial setup (fresh / another install) uses TitanBarVarsDefaults. + +The frame scripts are how WoW and Titan interact with this addon. + +==== OnEnter and OnLeave +Titan sets these scripts on a Bar for future use . Currently Titan does no work. + +For Titan Hider Bars these are used to show / hide the Titan Bar. +Note: Hider Bars are only for the full width bars - NOT Short Bars. + +==== OnClick script : +Right click is to open the Titan menu. +Left click closes any tooltip and any menu. + +On Short Bars Titan registers for +- OnDragStart and OnDragStop (left mouse button) for moving Short Bars +- OnMouseWheel to size a Short Bar + +==== OnShow script : +Not used by Titan bars. + +==== OnHide script : +Not used by Titan bars. + +==== OnEvent script : +Titan.lua sets the OnEvent stript for TitanPanelBarButton to redirect events to TitanPanelBarButton: +See local function RegisterForEvents for the list of eventsand their usage. +--]] + +--[[ Plugin .registry + +=== Titan plugins +The routine - TitanUtils_RegisterPluginList - starts the plugin registry process. + +=== LDB objects : See LDBTitan.lua for many more details. + +The OnEvent script of LDBToTitan frame processes the PLAYER_LOGIN event. +This starts the process to convert all known LDB objects into Titan plugins. +Note: PLAYER_LOGIN occurs same time or very close to PLAYER_ENTERING_WORLD. +This event was chosen by the orignal developer. + +Each object found calls TitanLDBCreateObject using pcall to protect Titan. + +Before Titan is initialized (first PLAYER_ENTERING_WORLD) the LDB object will be added to the plugin list. +After, TitanUtils_RegisterPluginList will be used iteratively to register each found LDB object. +Most LDB objects are created on loading by addons. There should only an issue for addons that create +many LDB objects on demand. + +The Titan plugin example has a lot more detail from the plugin view that would be helpful to a Titan dev. +--]] + +--[[ Saved Variables + +See TitanVariables.lua (File) for additional detail. + +Much of the info below is included in the Titan plugin example. + +NOTE: Titan routines have used 1 as true since inception so be careful on 'true checks'. +As an example +if ShowUsedSlots then +*should* work fine if ShowUsedSlots is true or 1 + +=== Where are these saved variables????? +The saved variables are specified in the Titan toc : +## SavedVariables: TitanAll, TitanSettings, TitanSkins, ServerTimeOffsets, ServerHourFormat + +TitanSettings contains all the plugin saved variables. +Titan uses the single table structure to store the saved variables across a user account. +This makes the setup code rather cumbersome and not straight forward - just warning... + +The saved variables can be found here: .../World of Warcraft/_retail_/WTF/Account/(account name>/SavedVariables/Titan.lua +There is a Titan.lua.bak which is the prior save (logout / exit / reload). + +It is HIGHLY recommended opening the saved variables file in an editor with code folding features! +This file could be quite large with many lines. +I have 20+ characters on one server. Even though I do not use many addons, I do test with addons on some characters. +A plugin such as Titan Panel [Reputation] can create 100+ plugins. My file is nearly 90,000 lines long! + +Say we want to find a character named Embic on Staghelm which you are using for testing. +This would under +TitanSettings = { + ["Players"] = { + ["Embic@Staghelm"] = { + ["Panel"] = { + -- Holds all the Titan settings for this character + } + ["BarVars"] = { + -- Holds all the Titan bar settings for this character + } + ["Plugins"] = { + -- Each registered plugin will be here + ["Starter"] = { + ["notes"] = "Adds bag and free slot information to Titan Panel.\n", + ["menuTextFunction"] = nil, + ["id"] = "Starter", + ["menuText"] = "Bag", + ["iconWidth"] = 16, + ["savedVariables"] = { + ["ShowColoredText"] = 1, + ["CustomLabel3Text"] = "", + ["ShowIcon"] = 1, + ["OpenBags"] = false, + ["CustomLabel3TextShow"] = false, + ["CustomLabelTextShow"] = false, + ["CustomLabel4Text"] = "", + ["CustomLabel2Text"] = "", + ["OpenBagsClassic"] = "new_install", + ["ShowLabelText"] = 1, + ["CustomLabel4TextShow"] = false, + ["CountProfBagSlots"] = false, + ["ShowUsedSlots"] = 1, + ["DisplayOnRightSide"] = false, + ["ShowDetailedInfo"] = false, + ["CustomLabel2TextShow"] = false, + ["CustomLabelText"] = "", + }, + ["controlVariables"] = { + ["DisplayOnRightSide"] = true, + ["ShowColoredText"] = true, + ["ShowIcon"] = true, + ["ShowLabelText"] = true, + }, + ["version"] = "1.0.0", + ["category"] = "Information", + ["buttonTextFunction"] = nil , + ["tooltipTextFunction"] = nil , + ["icon"] = "Interface\\AddOns\\TitanPlugin\\Artwork\\TitanStarter", + ["tooltipTitle"] = "Bags Info", + }, + } + ["Adjust"] = { + -- Holds offsets for frames the user may adjust - Retail and Classic have different list of frames + } + ["Register"] = { + -- Holds data as each plugin and LDB is attempted to be registered. + -- There may be helpful debug data here under your plugin name if the plugin is not shown as expected. + -- Titan > Configuration > Attempts shows some of this data, including errors. + } + +--]] diff --git a/Titan/_Titan_Lib_Notes.txt b/Titan/_Titan_Lib_Notes.txt index 8bc9a4b..0dd0bb4 100644 --- a/Titan/_Titan_Lib_Notes.txt +++ b/Titan/_Titan_Lib_Notes.txt @@ -5,14 +5,20 @@ LibQTip-1.0 - https://www.curseforge.com/wow/addons/libqtip-1-0 LibSharedMedia-3.0 - https://www.wowace.com/projects/libsharedmedia-3-0 : https://www.curseforge.com/wow/addons/libsharedmedia-3-0 -*** 2025-May *** -- AceSerializer-3.0 taken from Release-r1349 2024-07-24 -- Dropped AceGUI-3.0-SharedMediaWidgets, not used +*** 2025-Nov **** +- Ace update from Release-r1377 2024-10-28 + *** 2025-Sep* - Dropped !LibUIDropDownMenu, again; updated wrappers to Blizz version LibUIDropDownMenu - https://www.curseforge.com/wow/addons/libuidropdownmenu +*** 2025-May *** +- AceSerializer-3.0 taken from Release-r1349 2024-07-24 +- Added LibDeflate (8.3.0 2020-06-26) from Curse +- Updated LibSharedMedia-3.0 (11.2.5 2025-09-23) from Curse +- Dropped AceGUI-3.0-SharedMediaWidgets, not used + *** 2023-Dec *** - Updated libs to latest - Added back !LibUIDropDownMenu per combined Titan versions diff --git a/Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-BCC.toc b/Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-BCC.toc deleted file mode 100644 index 50233de..0000000 --- a/Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-BCC.toc +++ /dev/null @@ -1,12 +0,0 @@ -## Interface: 20504 -## Title: Lib: UIDropDownMenu -## Notes: A Replacement for standard UIDropDownMenu -## Version: v4.26.10020553040 -## 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 deleted file mode 100644 index 3f6fb3f..0000000 --- a/Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-Classic.toc +++ /dev/null @@ -1,12 +0,0 @@ -## Interface: 11500 -## Title: Lib: UIDropDownMenu -## Notes: A Replacement for standard UIDropDownMenu -## Version: v4.26.10020553040 -## 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 deleted file mode 100644 index 6743d1d..0000000 --- a/Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu-WOTLKC.toc +++ /dev/null @@ -1,12 +0,0 @@ -## Interface: 30403 -## Title: Lib: UIDropDownMenu -## Notes: A Replacement for standard UIDropDownMenu -## Version: v4.26.10020553040 -## 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 deleted file mode 100644 index 4211700..0000000 --- a/Titan/libs/Ace/!LibUIDropDownMenu/!LibUIDropDownMenu.toc +++ /dev/null @@ -1,12 +0,0 @@ -## Interface: 100205 -## Title: Lib: UIDropDownMenu -## Notes: A Replacement for standard UIDropDownMenu -## Version: v4.26.10020553040 -## 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 deleted file mode 100644 index d2ceaa1..0000000 --- a/Titan/libs/Ace/!LibUIDropDownMenu/Docs/Readme.txt +++ /dev/null @@ -1,178 +0,0 @@ -$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 deleted file mode 100644 index 50f9f30..0000000 --- a/Titan/libs/Ace/!LibUIDropDownMenu/Docs/Revision.txt +++ /dev/null @@ -1,266 +0,0 @@ -$Id: Revision.txt 135 2024-02-05 16:50:14Z arithmandar $ - -Revision History: -================= - -v4.26.10020553040 (2024/02/06) ------------------------------- -- OpenColorPicker related feature's compatibility enhancement - -v4.25.10020553040 (2024/01/30) ------------------------------- -- Enhanced frame or texture's creation to set the name as nil when parent frame name is also nil -- Further error handling for NewFeature - -v4.24.10020553007 (2024/01/23) ------------------------------- -- Fixed issue of version confliction when older version was loaded first and then newer version was to replace the library. - What has been created won't have the "NewFeature" frame there. - -v4.23.10020553007 (2024/01/22) ------------------------------- -- Fixed issue with the compatibility with WoW 3.4.3 / 1.15.0 - -v4.22.10020553007 (2024/01/21) ------------------------------- -- Toc update to support WoW 10.2.5 / 3.4.3 / 1.15.0 -- function sync with build 53007 - -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 deleted file mode 100644 index 7e9b5cd..0000000 --- a/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/LibStub.lua +++ /dev/null @@ -1,51 +0,0 @@ --- $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 deleted file mode 100644 index 6e4cca9..0000000 --- a/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/LibStub.toc +++ /dev/null @@ -1,9 +0,0 @@ -## 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 deleted file mode 100644 index 276ddab..0000000 --- a/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test.lua +++ /dev/null @@ -1,41 +0,0 @@ -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 deleted file mode 100644 index eae7172..0000000 --- a/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test2.lua +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index 30f7b94..0000000 --- a/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test3.lua +++ /dev/null @@ -1,14 +0,0 @@ -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 deleted file mode 100644 index 43eb338..0000000 --- a/Titan/libs/Ace/!LibUIDropDownMenu/LibStub/tests/test4.lua +++ /dev/null @@ -1,41 +0,0 @@ -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 deleted file mode 100644 index 2954463..0000000 --- a/Titan/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibEasyMenu.lua +++ /dev/null @@ -1,44 +0,0 @@ ---$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 deleted file mode 100644 index 908eba4..0000000 --- a/Titan/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibUIDropDownMenu.lua +++ /dev/null @@ -1,2398 +0,0 @@ --- $Id: LibUIDropDownMenu.lua 135 2024-02-05 16:50:14Z 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: 135 $"):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); - if self.NewFeature then - self.NewFeature:Hide(); - end - 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 buttonParent = self:GetParent() - if not buttonParent then - return - end - button_OnClick(buttonParent, 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 - - -- Button Frame - 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 and (name.."Highlight") or nil, "BACKGROUND") - f.Highlight:SetTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight") - f.Highlight:SetBlendMode("ADD") - f.Highlight:SetAllPoints() - f.Highlight:Hide() - - f.Check = f:CreateTexture( name and (name.."Check") or nil, "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 and (name.."UnCheck") or nil, "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) - - -- Icon Texture - local fIcon - fIcon = f:CreateTexture( name and (name.."Icon") or nil, "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 and (name.."ColorSwatch") or nil, 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 and (name.."ColorSwatchSwatchBg") or nil, "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 and (name.."ColorSwatchNormalTexture") or nil) - 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 and (name.."ExpandArrow") or nil, f) - fea:SetSize(16, 16) - fea:SetPoint("RIGHT", f, 0, 0) - fea:Hide() - local button2NormalTexture = fea:CreateTexture( name and (name.."ExpandArrowNormalTexture") or nil) - 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 and (name.."InvisibleButton") or nil, 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 - - -- NewFeature - if (WoWRetail) then - local fnf = CreateFrame("Frame", name and (name.."NewFeature") or nil, f, "NewFeatureLabelTemplate"); - fnf:SetFrameStrata("HIGH"); - fnf:SetScale(0.8); - fnf:SetFrameLevel(100); - fnf:SetSize(1, 1); - fnf:Hide(); - - f.NewFeature = fnf; - end - - -- MenuButton scripts - 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 and (name.."NormalText") or nil) - 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 = name and _G[name] or CreateFrame("Button", name) - f:SetParent(parent or nil) - f:Hide() - f:SetFrameStrata("DIALOG") - f:EnableMouse(true) - - local fbd = name and _G[name.."Backdrop"] or CreateFrame("Frame", name and (name.."Backdrop") or nil, f, BackdropTemplateMixin and "DialogBorderDarkTemplate" or nil) - fbd:SetAllPoints() - fbd.backdropInfo = BACKDROP_DIALOG_DARK - f.Backdrop = fbd - - local fmb = name and _G[name.."MenuBackdrop"] or CreateFrame("Frame", name and (name.."MenuBackdrop") or nil, 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 = name and _G[name.."Button1"] or create_MenuButton(name and (name.."Button1") or nil, f) -- to replace the inherits of "UIDropDownMenuButtonTemplate" - f.Button1:SetID(1) - - -- Checking if NewFeature exists or not - if (WoWRetail) then - if not f.Button1.NewFeature then - local fnf = CreateFrame("Frame", name and (name.."NewFeature") or nil, f, "NewFeatureLabelTemplate"); - fnf:SetFrameStrata("HIGH"); - fnf:SetScale(0.8); - fnf:SetFrameLevel(100); - fnf:SetSize(1, 1); - fnf:Hide(); - - f.Button1.NewFeature = fnf; - end - end - - - 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 and (name.."Left") or nil, "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 and (name.."Middle") or nil, "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 and (name.."Right") or nil, "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 and (name.."Text") or nil, "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 and (name.."Icon") or nil, "OVERLAY") - f.Icon:Hide() - f.Icon:SetSize(16, 16) - f.Icon:SetPoint("LEFT", 30, 2) - - -- // UIDropDownMenuButtonScriptTemplate - f.Button = CreateFrame("Button", name and (name.."Button") or nil, 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 and (name.."NormalTexture") or nil) - 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 and (name.."PushedTexture") or nil) - 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 and (name.."DisabledTexture") or nil) - 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 and (name.."HighlightTexture") or nil) - 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; - if (WoWRetail) then - dropDownList:SetWindow(frame:GetWindow()); - end - - 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 -info.showNewLabel -]] - --- 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; - button.showNewLabel = info.showNewLabel; - 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 (WoWRetail and button.NewFeature) then - button.NewFeature:SetShown(button.showNewLabel); - end - - -- 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 (WoWRetail and button.showNewLabel and button.NewFeature) then - width = width + button.NewFeature.Label:GetUnboundedStringWidth(); - 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 (WoWRetail and button.NewFeature) then - local normalText = _G[button:GetName().."NormalText"]; - button.NewFeature:SetShown(button.showNewLabel); - button.NewFeature:SetPoint("LEFT", normalText, "RIGHT", 20, 0); - 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; - if (WoWRetail) then - ColorPickerFrame:SetupColorPickerAndShow(button); - else - lib:OpenColorPicker(button); - end -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) - if (WoWRetail) then - ColorPickerFrame:SetupColorPickerAndShow(info); - else - 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 -end - -function lib:ColorPicker_GetPreviousValues() - if (WoWRetail) then - local r, g, b = ColorPickerFrame:GetPreviousValues(); - return r, g, b; - else - return ColorPickerFrame.previousValues.r, ColorPickerFrame.previousValues.g, ColorPickerFrame.previousValues.b; - end -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 - - -lib.ColorSwatchMixin = {} - -function lib.ColorSwatchMixin:SetColor(color) - self.Color:SetVertexColor(color:GetRGB()); -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 deleted file mode 100644 index 2047913..0000000 --- a/Titan/libs/Ace/!LibUIDropDownMenu/LibUIDropDownMenu/LibUIDropDownMenu.xml +++ /dev/null @@ -1,24 +0,0 @@ - - -