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 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ -..\FrameXML\UI.xsd"> - - <!-- - These two frames are placed at the bottom of the top bar(s) - and top of the bottom bar(s) to give addons a notion of what - space Titan is using. - A non zero size is needed for the anchors to respond properly. - --> - <Button name="TitanPanelTopAnchor" frameStrata="DIALOG" parent="UIParent" > - <Size> - <AbsDimension x="1" y="1" /> - </Size> - </Button> - <Button name="TitanPanelBottomAnchor" frameStrata="DIALOG" parent="UIParent" > - <Size> - <AbsDimension x="1" y="1" /> - </Size> - </Button> -</Ui> +<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ +..\FrameXML\UI.xsd"> + + <!-- + These two frames are placed at the bottom of the top bar(s) + and top of the bottom bar(s) to give addons a notion of what + space Titan is using. + A non zero size is needed for the anchors to respond properly. + --> + <Button name="TitanPanelTopAnchor" frameStrata="DIALOG" parent="UIParent" > + <Size> + <AbsDimension x="1" y="1" /> + </Size> + </Button> + <Button name="TitanPanelBottomAnchor" frameStrata="DIALOG" parent="UIParent" > + <Size> + <AbsDimension x="1" y="1" /> + </Size> + </Button> +</Ui> 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 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ -..\FrameXML\UI.xsd"> - <Button name="TitanPanelButtonTemplate" hidden="true" movable="true" virtual="true"> - <Scripts> - <OnLoad> - TitanPanelButton_OnLoad(self); - </OnLoad> - <OnShow> - TitanPanelButton_OnShow(self); - </OnShow> - <OnClick> - TitanPanelButton_OnClick(self, button); - </OnClick> - <OnEnter> - TitanPanelButton_OnEnter(self); - </OnEnter> - <OnLeave> - TitanPanelButton_OnLeave(self); - </OnLeave> - </Scripts> - </Button> - <Button name="TitanPanelTextTemplate" inherits="TitanPanelButtonTemplate" virtual="true"> - <Size> - <AbsDimension x="0" y="16" /> - </Size> - <ButtonText name="$parentText" inherits="GameFontNormalSmall" justifyH="LEFT"> - <Anchors> - <Anchor point="LEFT"> - <Offset> - <AbsDimension x="0" y="1" /> - </Offset> - </Anchor> - </Anchors> - </ButtonText> - <PushedTextOffset> - <AbsDimension x="0" y="0"/> - </PushedTextOffset> - </Button> - <Button name="TitanPanelIconTemplate" inherits="TitanPanelButtonTemplate" virtual="true"> - <Size> - <AbsDimension x="16" y="16" /> - </Size> - <Layers> - <Layer level="ARTWORK"> - <Texture name="$parentIcon"> - <Size> - <AbsDimension x="16" y="16"/> - </Size> - <Anchors> - <Anchor point="LEFT" /> - </Anchors> - </Texture> - </Layer> - </Layers> - </Button> - <Button name="TitanPanelComboTemplate" inherits="TitanPanelButtonTemplate" virtual="true"> - <Size> - <AbsDimension x="0" y="16" /> - </Size> - <Layers> - <Layer level="ARTWORK"> - <Texture name="$parentIcon"> - <Size> - <AbsDimension x="0" y="16"/> - </Size> - <Anchors> - <Anchor point="LEFT" /> - </Anchors> - </Texture> - </Layer> - </Layers> - <ButtonText name="$parentText" inherits="GameFontNormalSmall" justifyH="LEFT" /> - <PushedTextOffset> - <AbsDimension x="0" y="0"/> - </PushedTextOffset> - </Button> - - <Slider name="TitanOptionsSliderTemplate" orientation="VERTICAL" inherits="BackdropTemplate" virtual="true" enableMouse="true" > - <Size> - <AbsDimension x="10" y="100"/> - </Size> - <HitRectInsets> - <AbsInset left="-10" right="-10" top="0" bottom="0"/> - </HitRectInsets> - <Layers> - <Layer level="ARTWORK"> - <FontString name="$parentText" inherits="GameFontGreenSmall"> - <Anchors> - <Anchor point="LEFT" relativePoint="RIGHT"> - <Offset> - <AbsDimension x="2" y="0" /> - </Offset> - </Anchor> - </Anchors> - </FontString> - <FontString name="$parentLow" inherits="GameFontHighlightSmall" text="LOW"> - <Anchors> - <Anchor point="BOTTOM" relativePoint="TOP"> - <Offset> - <AbsDimension x="0" y="3"/> - </Offset> - </Anchor> - </Anchors> - </FontString> - <FontString name="$parentHigh" inherits="GameFontHighlightSmall" text="HIGH"> - <Anchors> - <Anchor point="TOP" relativePoint="BOTTOM"> - <Offset> - <AbsDimension x="0" y="0"/> - </Offset> - </Anchor> - </Anchors> - </FontString> - </Layer> - </Layers> - <ThumbTexture name="$parentThumb" file="Interface\Buttons\UI-SliderBar-Button-Vertical"> - <Size> - <AbsDimension x="32" y="32"/> - </Size> - </ThumbTexture> - <Scripts> - <!-- Draagonflight (DF) Appears Blizz moved EnableMouseWheel from declaration to code --> - <OnLoad> - TitanOptionsSliderTemplate_OnLoad(self); - - self:EnableMouseWheel(true); - </OnLoad> - </Scripts> - </Slider> - - <GameTooltip name="TitanPanelTooltip" inherits="GameTooltipTemplate" parent="UIParent" hidden="true"/> - - <Button name="TitanPanelBarButtonHiderTemplate" frameStrata="BACKGROUND" toplevel="true" movable="true" parent="UIParent" virtual="true"> - <Scripts> - <OnLoad> - self:RegisterForClicks("LeftButtonUp", "RightButtonDown") - </OnLoad> - </Scripts> - <Size> - <AbsDimension x="2560" y="24"/> - </Size> - </Button> - - <!-- - This is a control frame used to capture events Titan is interested in. - Other buttons will be used for display. - --> - <Button name="TitanPanelBarButton" frameStrata="BACKGROUND" parent="UIParent"> - <Size> - <AbsDimension x="0" y="0"/> - </Size> - </Button> - - <Button name="Titan_Bar__Display_Template" frameStrata="DIALOG" inherits="BackdropTemplate" - toplevel="true" movable="true" parent="UIParent" virtual="true"> - </Button> - -</Ui> +<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ +..\FrameXML\UI.xsd"> + <Button name="TitanPanelButtonTemplate" hidden="true" movable="true" virtual="true"> + <Scripts> + <OnLoad> + TitanPanelButton_OnLoad(self); + </OnLoad> + <OnShow> + TitanPanelButton_OnShow(self); + </OnShow> + <OnClick> + TitanPanelButton_OnClick(self, button); + </OnClick> + <OnEnter> + TitanPanelButton_OnEnter(self); + </OnEnter> + <OnLeave> + TitanPanelButton_OnLeave(self); + </OnLeave> + </Scripts> + </Button> + <Button name="TitanPanelTextTemplate" inherits="TitanPanelButtonTemplate" virtual="true"> + <Size> + <AbsDimension x="0" y="16" /> + </Size> + <ButtonText name="$parentText" inherits="GameFontNormalSmall" justifyH="LEFT"> + <Anchors> + <Anchor point="LEFT"> + <Offset> + <AbsDimension x="0" y="1" /> + </Offset> + </Anchor> + </Anchors> + </ButtonText> + <PushedTextOffset> + <AbsDimension x="0" y="0"/> + </PushedTextOffset> + </Button> + <Button name="TitanPanelIconTemplate" inherits="TitanPanelButtonTemplate" virtual="true"> + <Size> + <AbsDimension x="16" y="16" /> + </Size> + <Layers> + <Layer level="ARTWORK"> + <Texture name="$parentIcon"> + <Size> + <AbsDimension x="16" y="16"/> + </Size> + <Anchors> + <Anchor point="LEFT" /> + </Anchors> + </Texture> + </Layer> + </Layers> + </Button> + <Button name="TitanPanelComboTemplate" inherits="TitanPanelButtonTemplate" virtual="true"> + <Size> + <AbsDimension x="0" y="16" /> + </Size> + <Layers> + <Layer level="ARTWORK"> + <Texture name="$parentIcon"> + <Size> + <AbsDimension x="0" y="16"/> + </Size> + <Anchors> + <Anchor point="LEFT" /> + </Anchors> + </Texture> + </Layer> + </Layers> + <ButtonText name="$parentText" inherits="GameFontNormalSmall" justifyH="LEFT" /> + <PushedTextOffset> + <AbsDimension x="0" y="0"/> + </PushedTextOffset> + </Button> + + <Slider name="TitanOptionsSliderTemplate" orientation="VERTICAL" inherits="BackdropTemplate" virtual="true" enableMouse="true" > + <Size> + <AbsDimension x="10" y="100"/> + </Size> + <HitRectInsets> + <AbsInset left="-10" right="-10" top="0" bottom="0"/> + </HitRectInsets> + <Layers> + <Layer level="ARTWORK"> + <FontString name="$parentText" inherits="GameFontGreenSmall"> + <Anchors> + <Anchor point="LEFT" relativePoint="RIGHT"> + <Offset> + <AbsDimension x="2" y="0" /> + </Offset> + </Anchor> + </Anchors> + </FontString> + <FontString name="$parentLow" inherits="GameFontHighlightSmall" text="LOW"> + <Anchors> + <Anchor point="BOTTOM" relativePoint="TOP"> + <Offset> + <AbsDimension x="0" y="3"/> + </Offset> + </Anchor> + </Anchors> + </FontString> + <FontString name="$parentHigh" inherits="GameFontHighlightSmall" text="HIGH"> + <Anchors> + <Anchor point="TOP" relativePoint="BOTTOM"> + <Offset> + <AbsDimension x="0" y="0"/> + </Offset> + </Anchor> + </Anchors> + </FontString> + </Layer> + </Layers> + <ThumbTexture name="$parentThumb" file="Interface\Buttons\UI-SliderBar-Button-Vertical"> + <Size> + <AbsDimension x="32" y="32"/> + </Size> + </ThumbTexture> + <Scripts> + <!-- Draagonflight (DF) Appears Blizz moved EnableMouseWheel from declaration to code --> + <OnLoad> + TitanOptionsSliderTemplate_OnLoad(self); + + self:EnableMouseWheel(true); + </OnLoad> + </Scripts> + </Slider> + + <GameTooltip name="TitanPanelTooltip" inherits="GameTooltipTemplate" parent="UIParent" hidden="true"/> + + <Button name="TitanPanelBarButtonHiderTemplate" frameStrata="BACKGROUND" toplevel="true" movable="true" parent="UIParent" virtual="true"> + <Scripts> + <OnLoad> + self:RegisterForClicks("LeftButtonUp", "RightButtonDown") + </OnLoad> + </Scripts> + <Size> + <AbsDimension x="2560" y="24"/> + </Size> + </Button> + + <!-- + This is a control frame used to capture events Titan is interested in. + Other buttons will be used for display. + --> + <Button name="TitanPanelBarButton" frameStrata="BACKGROUND" parent="UIParent"> + <Size> + <AbsDimension x="0" y="0"/> + </Size> + </Button> + + <Button name="Titan_Bar__Display_Template" frameStrata="DIALOG" inherits="BackdropTemplate" + toplevel="true" movable="true" parent="UIParent" virtual="true"> + </Button> + +</Ui> 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:<registered event> -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:<registered event> +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 @@ -<!-- $Id: LibUIDropDownMenu.xml 64 2020-11-18 13:13:15Z arithmandar $ --> -<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ -..\FrameXML\UI.xsd"> - <Script file="LibUIDropDownMenu.lua"/> -<!-- <Include file="LibUIDropDownMenuTemplates.xml"/> - - <Button name="L_DropDownList1" toplevel="true" frameStrata="FULLSCREEN_DIALOG" inherits="L_UIDropDownListTemplate" hidden="true" id="1"> - <Size> - <AbsDimension x="180" y="10"/> - </Size> - <Scripts> - <OnLoad> - local fontName, fontHeight, fontFlags = _G["L_DropDownList1Button1NormalText"]:GetFont(); - L_UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT = fontHeight; - </OnLoad> - </Scripts> - </Button> - <Button name="L_DropDownList2" toplevel="true" frameStrata="FULLSCREEN_DIALOG" inherits="L_UIDropDownListTemplate" hidden="true" id="2"> - <Size> - <AbsDimension x="180" y="10"/> - </Size> - </Button> ---> -</Ui> diff --git a/Titan/libs/Ace/Ace3.toc b/Titan/libs/Ace/Ace3.toc index 6cfd277..b0d60df 100644 --- a/Titan/libs/Ace/Ace3.toc +++ b/Titan/libs/Ace/Ace3.toc @@ -1,4 +1,4 @@ -## Interface: 11503, 40400, 100207, 110000, 110002 +## Interface: 11508, 11507, 20504, 30405, 40402, 50501, 50502, 110205, 110207, 120000 ## Title: Lib: Ace3 ## Notes: AddOn development framework @@ -6,7 +6,7 @@ ## X-Website: http://www.wowace.com ## X-Category: Library ## X-License: Limited BSD -## Version: Release-r1349 +## Version: Release-r1377 LibStub\LibStub.lua CallbackHandler-1.0\CallbackHandler-1.0.xml diff --git a/Titan/libs/Ace/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua b/Titan/libs/Ace/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua index 11254eb..904458a 100644 --- a/Titan/libs/Ace/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua +++ b/Titan/libs/Ace/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua @@ -1,13 +1,13 @@ --- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables. -- @class file -- @name AceConfigDialog-3.0 --- @release $Id: AceConfigDialog-3.0.lua 1296 2022-11-04 18:50:10Z nevcairiel $ +-- @release $Id: AceConfigDialog-3.0.lua 1372 2025-10-05 05:38:34Z nevcairiel $ local LibStub = LibStub local gui = LibStub("AceGUI-3.0") local reg = LibStub("AceConfigRegistry-3.0") -local MAJOR, MINOR = "AceConfigDialog-3.0", 86 +local MAJOR, MINOR = "AceConfigDialog-3.0", 89 local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR) if not AceConfigDialog then return end @@ -517,7 +517,7 @@ local function OptionOnMouseOver(widget, event) if descStyle and descStyle ~= "tooltip" then return end - tooltip:SetText(name, 1, .82, 0, true) + tooltip:SetText(name, 1, .82, 0, 1, true) if opt.type == "multiselect" then tooltip:AddLine(user.text, 0.5, 0.5, 0.8, true) @@ -526,7 +526,7 @@ local function OptionOnMouseOver(widget, event) tooltip:AddLine(desc, 1, 1, 1, true) end if type(usage) == "string" then - tooltip:AddLine("Usage: "..usage, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, true) + tooltip:AddLine(usage, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, true) end tooltip:Show() @@ -544,6 +544,7 @@ local function GetFuncName(option) end end do + local InCombatLockdown = InCombatLockdown local frame = AceConfigDialog.popup if not frame or oldminor < 81 then frame = CreateFrame("Frame", nil, UIParent) @@ -556,13 +557,15 @@ do frame:SetFrameLevel(100) -- Lots of room to draw under it frame:SetScript("OnKeyDown", function(self, key) if key == "ESCAPE" then - self:SetPropagateKeyboardInput(false) + if not InCombatLockdown() then + self:SetPropagateKeyboardInput(false) + end if self.cancel:IsShown() then self.cancel:Click() else -- Showing a validation error self:Hide() end - else + elseif not InCombatLockdown() then self:SetPropagateKeyboardInput(true) end end) @@ -1503,7 +1506,7 @@ local function TreeOnButtonEnter(widget, event, uniquevalue, button) tooltip:SetPoint("LEFT",button,"RIGHT") end - tooltip:SetText(name, 1, .82, 0, true) + tooltip:SetText(name, 1, .82, 0, 1, true) if type(desc) == "string" then tooltip:AddLine(desc, 1, 1, 1, true) diff --git a/Titan/libs/Ace/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua b/Titan/libs/Ace/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua index 89f387a..7900937 100644 --- a/Titan/libs/Ace/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua +++ b/Titan/libs/Ace/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua @@ -2,7 +2,7 @@ TreeGroup Container Container that uses a tree control to switch between groups. -------------------------------------------------------------------------------]] -local Type, Version = "TreeGroup", 47 +local Type, Version = "TreeGroup", 48 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end @@ -387,10 +387,6 @@ local methods = { ["RefreshTree"] = function(self,scrollToSelection,fromOnUpdate) local buttons = self.buttons local lines = self.lines - - for i, v in ipairs(buttons) do - v:Hide() - end while lines[1] do local t = tremove(lines) for k in pairs(t) do @@ -499,6 +495,10 @@ local methods = { buttonnum = buttonnum + 1 end + -- We hide the remaining buttons after updating others to avoid a blizzard bug that keeps them interactable even if hidden when hidden before updating the buttons. + for i = buttonnum, #buttons do + buttons[i]:Hide() + end end, ["SetSelected"] = function(self, value) diff --git a/Titan/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua b/Titan/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua index f2a238b..ae1e969 100644 --- a/Titan/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua +++ b/Titan/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua @@ -19,7 +19,11 @@ Support functions -------------------------------------------------------------------------------]] if not AceGUIEditBoxInsertLink then -- upgradeable hook - hooksecurefunc("ChatEdit_InsertLink", function(...) return _G.AceGUIEditBoxInsertLink(...) end) + if ChatFrameUtil and ChatFrameUtil.InsertLink then + hooksecurefunc(ChatFrameUtil, "InsertLink", function(...) return _G.AceGUIEditBoxInsertLink(...) end) + elseif ChatEdit_InsertLink then + hooksecurefunc("ChatEdit_InsertLink", function(...) return _G.AceGUIEditBoxInsertLink(...) end) + end end function _G.AceGUIEditBoxInsertLink(text) diff --git a/Titan/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua b/Titan/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua index f0095b5..3dcbaca 100644 --- a/Titan/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua +++ b/Titan/libs/Ace/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua @@ -16,7 +16,11 @@ Support functions if not AceGUIMultiLineEditBoxInsertLink then -- upgradeable hook - hooksecurefunc("ChatEdit_InsertLink", function(...) return _G.AceGUIMultiLineEditBoxInsertLink(...) end) + if ChatFrameUtil and ChatFrameUtil.InsertLink then + hooksecurefunc(ChatFrameUtil, "InsertLink", function(...) return _G.AceGUIMultiLineEditBoxInsertLink(...) end) + elseif ChatEdit_InsertLink then + hooksecurefunc("ChatEdit_InsertLink", function(...) return _G.AceGUIMultiLineEditBoxInsertLink(...) end) + end end function _G.AceGUIMultiLineEditBoxInsertLink(text) diff --git a/Titan/libs/Ace/CHANGES.txt b/Titan/libs/Ace/CHANGES.txt index e9aeca1..14b4f42 100644 --- a/Titan/libs/Ace/CHANGES.txt +++ b/Titan/libs/Ace/CHANGES.txt @@ -1,53 +1,189 @@ ------------------------------------------------------------------------ -r1348 | nevcairiel | 2024-07-23 11:23:40 +0000 (Tue, 23 Jul 2024) | 1 line +r1376 | nevcairiel | 2025-10-28 22:06:01 +0000 (Tue, 28 Oct 2025) | 1 line Changed paths: M /trunk/changelog.txt Update changelog ------------------------------------------------------------------------ -r1347 | nevcairiel | 2024-07-23 11:23:22 +0000 (Tue, 23 Jul 2024) | 1 line +r1375 | funkehdude | 2025-10-24 04:07:54 +0000 (Fri, 24 Oct 2025) | 1 line Changed paths: M /trunk/Ace3.toc -Remove outdated TOC versions that are no longer maintained/tested +Bump toc ------------------------------------------------------------------------ -r1346 | nevcairiel | 2024-07-20 07:10:33 +0000 (Sat, 20 Jul 2024) | 1 line +r1374 | funkehdude | 2025-10-15 17:12:41 +0000 (Wed, 15 Oct 2025) | 1 line +Changed paths: + M /trunk/Ace3.toc + +Bump toc +------------------------------------------------------------------------ +r1373 | funkehdude | 2025-10-13 14:09:48 +0000 (Mon, 13 Oct 2025) | 1 line +Changed paths: + M /trunk/Ace3.toc + +Bump toc +------------------------------------------------------------------------ +r1372 | nevcairiel | 2025-10-05 05:38:34 +0000 (Sun, 05 Oct 2025) | 1 line +Changed paths: + M /trunk + M /trunk/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua + +AceConfigDialog-3.0: Consistently provide an alpha value for GameTooltip:SetText +------------------------------------------------------------------------ +r1371 | nevcairiel | 2025-10-03 10:25:33 +0000 (Fri, 03 Oct 2025) | 1 line +Changed paths: + M /trunk + M /trunk/AceComm-3.0/ChatThrottleLib.lua + +ChatThrottleLib: Use C_BattleNet namespace, if available +------------------------------------------------------------------------ +r1370 | nevcairiel | 2025-10-03 00:16:25 +0000 (Fri, 03 Oct 2025) | 1 line Changed paths: M /trunk M /trunk/.luacheckrc + +Update luacheck for chat changes +------------------------------------------------------------------------ +r1369 | nevcairiel | 2025-10-02 23:56:28 +0000 (Thu, 02 Oct 2025) | 1 line +Changed paths: + M /trunk M /trunk/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua M /trunk/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua -AceGUI-3.0: Editboxes: Update spell drag-and-drop for WoW 11.0 +AceGUI-3.0: EditBox: Fix InsertLink hook for 12.0 ------------------------------------------------------------------------ -r1345 | funkehdude | 2024-07-09 19:31:35 +0000 (Tue, 09 Jul 2024) | 1 line +r1368 | nevcairiel | 2025-10-02 23:52:43 +0000 (Thu, 02 Oct 2025) | 1 line +Changed paths: + M /trunk + M /trunk/AceComm-3.0/ChatThrottleLib.lua + +ChatThrottleLib: Properly use the right namespace for SendChatMessage +------------------------------------------------------------------------ +r1367 | funkehdude | 2025-09-08 17:06:01 +0000 (Mon, 08 Sep 2025) | 1 line +Changed paths: + M /trunk/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua + +AceConfigDialog-3.0: Remove untranslated text "Usage:" from input boxes that define a usage field +------------------------------------------------------------------------ +r1366 | funkehdude | 2025-09-03 15:34:16 +0000 (Wed, 03 Sep 2025) | 1 line +Changed paths: + M /trunk/Ace3.toc + +Bump toc +------------------------------------------------------------------------ +r1365 | funkehdude | 2025-07-11 17:08:49 +0000 (Fri, 11 Jul 2025) | 1 line +Changed paths: + M /trunk/Ace3.toc + +Bump toc +------------------------------------------------------------------------ +r1364 | nevcairiel | 2025-07-05 16:01:08 +0000 (Sat, 05 Jul 2025) | 1 line +Changed paths: + M /trunk + M /trunk/AceDB-3.0/AceDB-3.0.lua + +AceDB-3.0: Avoid hitting the metatable when looking up the keys +------------------------------------------------------------------------ +r1363 | nevcairiel | 2025-07-05 15:42:11 +0000 (Sat, 05 Jul 2025) | 3 lines +Changed paths: + M /trunk + M /trunk/AceDB-3.0/AceDB-3.0.lua + +AceDB-3.0: Aggressively cleanout empty profiles tables inside namespace on logout + +This should help cleanup unloaded empty namespaces +------------------------------------------------------------------------ +r1362 | funkehdude | 2025-06-19 17:08:39 +0000 (Thu, 19 Jun 2025) | 1 line +Changed paths: + M /trunk/Ace3.toc + +Bump toc +------------------------------------------------------------------------ +r1361 | nevcairiel | 2025-05-17 12:20:39 +0000 (Sat, 17 May 2025) | 6 lines +Changed paths: + M /trunk + M /trunk/AceDB-3.0/AceDB-3.0.lua + +AceDB-3.0: Cleanup empty namespace tables + +Some addons use a large amount of namespaces which rarely get used, and +empty tables can clutter the SV. Cleaning up empty tables is consistent +with the other cleanup tasks done at logout, as they'll be re-created if +needed. +------------------------------------------------------------------------ +r1360 | funkehdude | 2025-05-01 22:54:00 +0000 (Thu, 01 May 2025) | 1 line +Changed paths: + M /trunk/Ace3.toc + +Bump toc +------------------------------------------------------------------------ +r1359 | funkehdude | 2025-03-21 19:41:37 +0000 (Fri, 21 Mar 2025) | 1 line +Changed paths: + M /trunk/Ace3.toc + +bump toc +------------------------------------------------------------------------ +r1358 | funkehdude | 2025-03-21 19:37:45 +0000 (Fri, 21 Mar 2025) | 1 line +Changed paths: + M /trunk/Ace3.toc + +bump toc +------------------------------------------------------------------------ +r1357 | funkehdude | 2025-01-23 06:13:10 +0000 (Thu, 23 Jan 2025) | 1 line Changed paths: M /trunk/Ace3.toc bump toc ------------------------------------------------------------------------ -r1344 | nevcairiel | 2024-07-03 10:50:13 +0000 (Wed, 03 Jul 2024) | 1 line +r1356 | nevcairiel | 2024-12-05 06:15:30 +0000 (Thu, 05 Dec 2024) | 1 line Changed paths: M /trunk + M /trunk/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua + +AceGUI-3.0: TreeGroup: Re-factor button hiding to help avoid bizarre button breakage +------------------------------------------------------------------------ +r1355 | funkehdude | 2024-11-20 01:54:56 +0000 (Wed, 20 Nov 2024) | 1 line +Changed paths: M /trunk/Ace3.toc -Add 11.0.2 TOC +bump toc ------------------------------------------------------------------------ -r1343 | funkehdude | 2024-06-06 06:04:02 +0000 (Thu, 06 Jun 2024) | 1 line +r1354 | funkehdude | 2024-09-10 14:01:06 +0000 (Tue, 10 Sep 2024) | 1 line Changed paths: M /trunk/Ace3.toc - D /trunk/Ace3_Cata.toc - D /trunk/Ace3_TBC.toc - D /trunk/Ace3_Vanilla.toc - D /trunk/Ace3_Wrath.toc -Update toc structure +bump toc ------------------------------------------------------------------------ -r1342 | nevcairiel | 2024-05-26 11:49:35 +0000 (Sun, 26 May 2024) | 1 line +r1353 | nevcairiel | 2024-08-27 13:37:35 +0000 (Tue, 27 Aug 2024) | 8 lines Changed paths: M /trunk - M /trunk/AceTimer-3.0/AceTimer-3.0.lua + M /trunk/AceDB-3.0/AceDB-3.0.lua + +AceDB-3.0: Handle unloaded namespaces in Reset/Copy/Delete functions + +When applying profile changes to namespaces, we should also handle +namespaces that are not currently loaded. + +These may be from optional Load-on-Demand parts that are not currently +loaded, but the expectation is that the database behaves consistent +no matter what is currently active. +------------------------------------------------------------------------ +r1352 | funkehdude | 2024-07-24 18:29:31 +0000 (Wed, 24 Jul 2024) | 1 line +Changed paths: + M /trunk/.luacheckrc + +Update luacheck +------------------------------------------------------------------------ +r1351 | funkehdude | 2024-07-24 18:23:24 +0000 (Wed, 24 Jul 2024) | 1 line +Changed paths: + M /trunk/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua + +AceConfigDialog-3.0: Don't change keyboard input propagation in combat when showing the popup +------------------------------------------------------------------------ +r1350 | funkehdude | 2024-07-24 17:55:50 +0000 (Wed, 24 Jul 2024) | 1 line +Changed paths: + M /trunk/Ace3.toc -AceTimer-3.0: fix callback parameter name in docs +Restore old toc versions, these are here purely to compensate for bad addon updaters, we don't actually care if we fully support these versions of wow ------------------------------------------------------------------------ diff --git a/Titan/libs/Ace/LibQTip-1.0/CHANGELOG.md b/Titan/libs/Ace/LibQTip-1.0/CHANGELOG.md index a4fdb13..442bb65 100644 --- a/Titan/libs/Ace/LibQTip-1.0/CHANGELOG.md +++ b/Titan/libs/Ace/LibQTip-1.0/CHANGELOG.md @@ -1,10 +1,10 @@ -# Lib: QTip-1.0 - -## [10.0.7.1](https://github.com/Torhal/LibQTip-1.0/tree/10.0.7.1) (2023-03-29) -[Full Changelog](https://github.com/Torhal/LibQTip-1.0/compare/9.0.1.2...10.0.7.1) [Previous Releases](https://github.com/Torhal/LibQTip-1.0/releases) - -- Create release.yml - Add release configuration for the BigWigs Packager. -- Update ToC Interface and add X-Curse-Project-ID to support the BigWigs Packager. -- Create README.md -- update for WoW 9.1.5's new TooltipBackdropTemplate +# Lib: QTip-1.0 + +## [10.0.7.1](https://github.com/Torhal/LibQTip-1.0/tree/10.0.7.1) (2023-03-29) +[Full Changelog](https://github.com/Torhal/LibQTip-1.0/compare/9.0.1.2...10.0.7.1) [Previous Releases](https://github.com/Torhal/LibQTip-1.0/releases) + +- Create release.yml + Add release configuration for the BigWigs Packager. +- Update ToC Interface and add X-Curse-Project-ID to support the BigWigs Packager. +- Create README.md +- update for WoW 9.1.5's new TooltipBackdropTemplate diff --git a/Titan/libs/Ace/LibQTip-1.0/LICENSE.txt b/Titan/libs/Ace/LibQTip-1.0/LICENSE.txt index 54cdb47..9bc7b5c 100644 --- a/Titan/libs/Ace/LibQTip-1.0/LICENSE.txt +++ b/Titan/libs/Ace/LibQTip-1.0/LICENSE.txt @@ -1,29 +1,29 @@ -Copyright (c) 2008, LibQTip Development Team - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Redistribution of a stand alone version is strictly prohibited without - prior written authorization from the Lead of the LibQTip Development Team. - * Neither the name of the LibQTip Development Team nor the names of its contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright (c) 2008, LibQTip Development Team + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Redistribution of a stand alone version is strictly prohibited without + prior written authorization from the Lead of the LibQTip Development Team. + * Neither the name of the LibQTip Development Team nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Titan/libs/Ace/LibQTip-1.0/LibQTip-1.0.lua b/Titan/libs/Ace/LibQTip-1.0/LibQTip-1.0.lua index 586bcca..bb38c75 100644 --- a/Titan/libs/Ace/LibQTip-1.0/LibQTip-1.0.lua +++ b/Titan/libs/Ace/LibQTip-1.0/LibQTip-1.0.lua @@ -1,1565 +1,1565 @@ -local MAJOR = "LibQTip-1.0" -local MINOR = 49 -- Should be manually increased -local LibStub = _G.LibStub - -assert(LibStub, MAJOR .. " requires LibStub") - -local lib, oldMinor = LibStub:NewLibrary(MAJOR, MINOR) - -if not lib then - return -end -- No upgrade needed - ------------------------------------------------------------------------------- --- Upvalued globals ------------------------------------------------------------------------------- -local table = _G.table -local tinsert = table.insert -local tremove = table.remove -local wipe = table.wipe - -local error = error -local math = math -local min, max = math.min, math.max -local next = next -local pairs, ipairs = pairs, ipairs -local select = select -local setmetatable = setmetatable -local tonumber, tostring = tonumber, tostring -local type = type - -local CreateFrame = _G.CreateFrame -local GameTooltip = _G.GameTooltip -local UIParent = _G.UIParent - -local geterrorhandler = _G.geterrorhandler - ------------------------------------------------------------------------------- --- Tables and locals ------------------------------------------------------------------------------- -lib.frameMetatable = lib.frameMetatable or {__index = CreateFrame("Frame")} - -lib.tipPrototype = lib.tipPrototype or setmetatable({}, lib.frameMetatable) -lib.tipMetatable = lib.tipMetatable or {__index = lib.tipPrototype} - -lib.providerPrototype = lib.providerPrototype or {} -lib.providerMetatable = lib.providerMetatable or {__index = lib.providerPrototype} - -lib.cellPrototype = lib.cellPrototype or setmetatable({}, lib.frameMetatable) -lib.cellMetatable = lib.cellMetatable or {__index = lib.cellPrototype} - -lib.activeTooltips = lib.activeTooltips or {} - -lib.tooltipHeap = lib.tooltipHeap or {} -lib.frameHeap = lib.frameHeap or {} -lib.timerHeap = lib.timerHeap or {} -lib.tableHeap = lib.tableHeap or {} - -lib.onReleaseHandlers = lib.onReleaseHandlers or {} - -local tipPrototype = lib.tipPrototype -local tipMetatable = lib.tipMetatable - -local providerPrototype = lib.providerPrototype -local providerMetatable = lib.providerMetatable - -local cellPrototype = lib.cellPrototype -local cellMetatable = lib.cellMetatable - -local activeTooltips = lib.activeTooltips - -local highlightFrame = CreateFrame("Frame", nil, UIParent) -highlightFrame:SetFrameStrata("TOOLTIP") -highlightFrame:Hide() - -local DEFAULT_HIGHLIGHT_TEXTURE_PATH = [[Interface\QuestFrame\UI-QuestTitleHighlight]] - -local highlightTexture = highlightFrame:CreateTexture(nil, "OVERLAY") -highlightTexture:SetTexture(DEFAULT_HIGHLIGHT_TEXTURE_PATH) -highlightTexture:SetBlendMode("ADD") -highlightTexture:SetAllPoints(highlightFrame) - ------------------------------------------------------------------------------- --- Private methods for Caches and Tooltip ------------------------------------------------------------------------------- -local AcquireTooltip, ReleaseTooltip -local AcquireCell, ReleaseCell -local AcquireTable, ReleaseTable - -local InitializeTooltip, SetTooltipSize, ResetTooltipSize, FixCellSizes -local ClearTooltipScripts -local SetFrameScript, ClearFrameScripts - ------------------------------------------------------------------------------- --- Cache debugging. ------------------------------------------------------------------------------- --- @debug @ -local usedTables, usedFrames, usedTooltips = 0, 0, 0 ---@end-debug@]==] - ------------------------------------------------------------------------------- --- Internal constants to tweak the layout ------------------------------------------------------------------------------- -local TOOLTIP_PADDING = 10 -local CELL_MARGIN_H = 6 -local CELL_MARGIN_V = 3 - ------------------------------------------------------------------------------- --- Public library API ------------------------------------------------------------------------------- ---- Create or retrieve the tooltip with the given key. --- If additional arguments are passed, they are passed to :SetColumnLayout for the acquired tooltip. --- @name LibQTip:Acquire(key[, numColumns, column1Justification, column2justification, ...]) --- @param key string or table - the tooltip key. Any value that can be used as a table key is accepted though you should try to provide unique keys to avoid conflicts. --- Numbers and booleans should be avoided and strings should be carefully chosen to avoid namespace clashes - no "MyTooltip" - you have been warned! --- @return tooltip Frame object - the acquired tooltip. --- @usage Acquire a tooltip with at least 5 columns, justification : left, center, left, left, left --- <pre>local tip = LibStub('LibQTip-1.0'):Acquire('MyFooBarTooltip', 5, "LEFT", "CENTER")</pre> -function lib:Acquire(key, ...) - if key == nil then - error("attempt to use a nil key", 2) - end - - local tooltip = activeTooltips[key] - - if not tooltip then - tooltip = AcquireTooltip() - InitializeTooltip(tooltip, key) - activeTooltips[key] = tooltip - end - - if select("#", ...) > 0 then - -- Here we catch any error to properly report it for the calling code - local ok, msg = pcall(tooltip.SetColumnLayout, tooltip, ...) - - if not ok then - error(msg, 2) - end - end - - return tooltip -end - -function lib:Release(tooltip) - local key = tooltip and tooltip.key - - if not key or activeTooltips[key] ~= tooltip then - return - end - - ReleaseTooltip(tooltip) - activeTooltips[key] = nil -end - -function lib:IsAcquired(key) - if key == nil then - error("attempt to use a nil key", 2) - end - - return not (not activeTooltips[key]) -end - -function lib:IterateTooltips() - return pairs(activeTooltips) -end - ------------------------------------------------------------------------------- --- Frame cache (for lines and columns) ------------------------------------------------------------------------------- -local frameHeap = lib.frameHeap - -local function AcquireFrame(parent) - local frame = tremove(frameHeap) or CreateFrame("Frame", nil, nil, BackdropTemplateMixin and "BackdropTemplate") - frame:SetParent(parent) - --[==[@debug@ - usedFrames = usedFrames + 1 - --@end-debug@]==] - return frame -end - -local function ReleaseFrame(frame) - frame:Hide() - frame:SetParent(nil) - frame:ClearAllPoints() - frame:SetBackdrop(nil) - - ClearFrameScripts(frame) - - tinsert(frameHeap, frame) - --[==[@debug@ - usedFrames = usedFrames - 1 - --@end-debug@]==] -end - ------------------------------------------------------------------------------- --- Timer cache ------------------------------------------------------------------------------- -local timerHeap = lib.timerHeap - -local function AcquireTimer(parent) - local frame = tremove(timerHeap) or CreateFrame("Frame") - frame:SetParent(parent) - return frame -end - -local function ReleaseTimer(frame) - frame:Hide() - frame:SetParent(nil) - - ClearFrameScripts(frame) - - tinsert(timerHeap, frame) -end - ------------------------------------------------------------------------------- --- Dirty layout handler ------------------------------------------------------------------------------- -lib.layoutCleaner = lib.layoutCleaner or CreateFrame("Frame") - -local layoutCleaner = lib.layoutCleaner -layoutCleaner.registry = layoutCleaner.registry or {} - -function layoutCleaner:RegisterForCleanup(tooltip) - self.registry[tooltip] = true - self:Show() -end - -function layoutCleaner:CleanupLayouts() - self:Hide() - - for tooltip in pairs(self.registry) do - FixCellSizes(tooltip) - end - - wipe(self.registry) -end - -layoutCleaner:SetScript("OnUpdate", layoutCleaner.CleanupLayouts) - ------------------------------------------------------------------------------- --- CellProvider and Cell ------------------------------------------------------------------------------- -function providerPrototype:AcquireCell() - local cell = tremove(self.heap) - - if not cell then - cell = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate") - setmetatable(cell, self.cellMetatable) - - if type(cell.InitializeCell) == "function" then - cell:InitializeCell() - end - end - - self.cells[cell] = true - - return cell -end - -function providerPrototype:ReleaseCell(cell) - if not self.cells[cell] then - return - end - - if type(cell.ReleaseCell) == "function" then - cell:ReleaseCell() - end - - self.cells[cell] = nil - tinsert(self.heap, cell) -end - -function providerPrototype:GetCellPrototype() - return self.cellPrototype, self.cellMetatable -end - -function providerPrototype:IterateCells() - return pairs(self.cells) -end - -function lib:CreateCellProvider(baseProvider) - local cellBaseMetatable, cellBasePrototype - - if baseProvider and baseProvider.GetCellPrototype then - cellBasePrototype, cellBaseMetatable = baseProvider:GetCellPrototype() - else - cellBaseMetatable = cellMetatable - end - - local newCellPrototype = setmetatable({}, cellBaseMetatable) - local newCellProvider = setmetatable({}, providerMetatable) - - newCellProvider.heap = {} - newCellProvider.cells = {} - newCellProvider.cellPrototype = newCellPrototype - newCellProvider.cellMetatable = {__index = newCellPrototype} - - return newCellProvider, newCellPrototype, cellBasePrototype -end - ------------------------------------------------------------------------------- --- Basic label provider ------------------------------------------------------------------------------- -if not lib.LabelProvider then - lib.LabelProvider, lib.LabelPrototype = lib:CreateCellProvider() -end - -local labelProvider = lib.LabelProvider -local labelPrototype = lib.LabelPrototype - -function labelPrototype:InitializeCell() - self.fontString = self:CreateFontString() - self.fontString:SetFontObject(_G.GameTooltipText) -end - -function labelPrototype:SetupCell(tooltip, value, justification, font, leftPadding, rightPadding, maxWidth, minWidth, ...) - local fontString = self.fontString - local line = tooltip.lines[self._line] - - -- detatch fs from cell for size calculations - fontString:ClearAllPoints() - fontString:SetFontObject(font or (line.is_header and tooltip:GetHeaderFont() or tooltip:GetFont())) - fontString:SetJustifyH(justification) - fontString:SetText(tostring(value)) - - leftPadding = leftPadding or 0 - rightPadding = rightPadding or 0 - - local width = fontString:GetStringWidth() + leftPadding + rightPadding - - if maxWidth and minWidth and (maxWidth < minWidth) then - error("maximum width cannot be lower than minimum width: " .. tostring(maxWidth) .. " < " .. tostring(minWidth), 2) - end - - if maxWidth and (maxWidth < (leftPadding + rightPadding)) then - error("maximum width cannot be lower than the sum of paddings: " .. tostring(maxWidth) .. " < " .. tostring(leftPadding) .. " + " .. tostring(rightPadding), 2) - end - - if minWidth and width < minWidth then - width = minWidth - end - - if maxWidth and maxWidth < width then - width = maxWidth - end - - fontString:SetWidth(width - (leftPadding + rightPadding)) - -- Use GetHeight() instead of GetStringHeight() so lines which are longer than width will wrap. - local height = fontString:GetHeight() - - -- reanchor fs to cell - fontString:SetWidth(0) - fontString:SetPoint("TOPLEFT", self, "TOPLEFT", leftPadding, 0) - fontString:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -rightPadding, 0) - --~ fs:SetPoint("TOPRIGHT", self, "TOPRIGHT", -r_pad, 0) - - self._paddingL = leftPadding - self._paddingR = rightPadding - - return width, height -end - -function labelPrototype:getContentHeight() - local fontString = self.fontString - fontString:SetWidth(self:GetWidth() - (self._paddingL + self._paddingR)) - - local height = self.fontString:GetHeight() - fontString:SetWidth(0) - - return height -end - -function labelPrototype:GetPosition() - return self._line, self._column -end - ------------------------------------------------------------------------------- --- Tooltip cache ------------------------------------------------------------------------------- -local tooltipHeap = lib.tooltipHeap - --- Returns a tooltip -function AcquireTooltip() - local tooltip = tremove(tooltipHeap) - - if not tooltip then - local template = (TooltipBackdropTemplateMixin and "TooltipBackdropTemplate") or (BackdropTemplateMixin and "BackdropTemplate") - tooltip = CreateFrame("Frame", nil, UIParent, template) - - local scrollFrame = CreateFrame("ScrollFrame", nil, tooltip) - scrollFrame:SetPoint("TOP", tooltip, "TOP", 0, -TOOLTIP_PADDING) - scrollFrame:SetPoint("BOTTOM", tooltip, "BOTTOM", 0, TOOLTIP_PADDING) - scrollFrame:SetPoint("LEFT", tooltip, "LEFT", TOOLTIP_PADDING, 0) - scrollFrame:SetPoint("RIGHT", tooltip, "RIGHT", -TOOLTIP_PADDING, 0) - tooltip.scrollFrame = scrollFrame - - local scrollChild = CreateFrame("Frame", nil, tooltip.scrollFrame) - scrollFrame:SetScrollChild(scrollChild) - tooltip.scrollChild = scrollChild - - setmetatable(tooltip, tipMetatable) - end - - --[==[@debug@ - usedTooltips = usedTooltips + 1 - --@end-debug@]==] - return tooltip -end - --- Cleans the tooltip and stores it in the cache -function ReleaseTooltip(tooltip) - if tooltip.releasing then - return - end - - tooltip.releasing = true - tooltip:Hide() - - local releaseHandler = lib.onReleaseHandlers[tooltip] - - if releaseHandler then - lib.onReleaseHandlers[tooltip] = nil - - local success, errorMessage = pcall(releaseHandler, tooltip) - - if not success then - geterrorhandler()(errorMessage) - end - elseif tooltip.OnRelease then - local success, errorMessage = pcall(tooltip.OnRelease, tooltip) - if not success then - geterrorhandler()(errorMessage) - end - - tooltip.OnRelease = nil - end - - tooltip.releasing = nil - tooltip.key = nil - tooltip.step = nil - - ClearTooltipScripts(tooltip) - - tooltip:SetAutoHideDelay(nil) - tooltip:ClearAllPoints() - tooltip:Clear() - - if tooltip.slider then - tooltip.slider:SetValue(0) - tooltip.slider:Hide() - tooltip.scrollFrame:SetPoint("RIGHT", tooltip, "RIGHT", -TOOLTIP_PADDING, 0) - tooltip:EnableMouseWheel(false) - end - - for i, column in ipairs(tooltip.columns) do - tooltip.columns[i] = ReleaseFrame(column) - end - - tooltip.columns = ReleaseTable(tooltip.columns) - tooltip.lines = ReleaseTable(tooltip.lines) - tooltip.colspans = ReleaseTable(tooltip.colspans) - - layoutCleaner.registry[tooltip] = nil - - if TooltipBackdropTemplateMixin and not tooltip.NineSlice then - -- don't recycle outdated tooltips into heap - tooltip = nil - end - - if tooltip then - tinsert(tooltipHeap, tooltip) - end - - highlightTexture:SetTexture(DEFAULT_HIGHLIGHT_TEXTURE_PATH) - highlightTexture:SetTexCoord(0, 1, 0, 1) - - --[==[@debug@ - usedTooltips = usedTooltips - 1 - --@end-debug@]==] -end - ------------------------------------------------------------------------------- --- Cell 'cache' (just a wrapper to the provider's cache) ------------------------------------------------------------------------------- --- Returns a cell for the given tooltip from the given provider -function AcquireCell(tooltip, provider) - local cell = provider:AcquireCell(tooltip) - - cell:SetParent(tooltip.scrollChild) - cell:SetFrameLevel(tooltip.scrollChild:GetFrameLevel() + 3) - cell._provider = provider - - return cell -end - --- Cleans the cell hands it to its provider for storing -function ReleaseCell(cell) - if cell.fontString and cell.r then - cell.fontString:SetTextColor(cell.r, cell.g, cell.b, cell.a) - end - - cell._font = nil - cell._justification = nil - cell._colSpan = nil - cell._line = nil - cell._column = nil - - cell:Hide() - cell:ClearAllPoints() - cell:SetParent(nil) - cell:SetBackdrop(nil) - - ClearFrameScripts(cell) - - cell._provider:ReleaseCell(cell) - cell._provider = nil -end - ------------------------------------------------------------------------------- --- Table cache ------------------------------------------------------------------------------- -local tableHeap = lib.tableHeap - --- Returns a table -function AcquireTable() - local tbl = tremove(tableHeap) or {} - --[==[@debug@ - usedTables = usedTables + 1 - --@end-debug@]==] - return tbl -end - --- Cleans the table and stores it in the cache -function ReleaseTable(tableInstance) - wipe(tableInstance) - tinsert(tableHeap, tableInstance) - --[==[@debug@ - usedTables = usedTables - 1 - --@end-debug@]==] -end - ------------------------------------------------------------------------------- --- Tooltip prototype ------------------------------------------------------------------------------- -function InitializeTooltip(tooltip, key) - ---------------------------------------------------------------------- - -- (Re)set frame settings - ---------------------------------------------------------------------- - if TooltipBackdropTemplateMixin then - tooltip.layoutType = GameTooltip.layoutType - NineSlicePanelMixin.OnLoad(tooltip.NineSlice) - if GameTooltip.layoutType then - tooltip.NineSlice:SetCenterColor(GameTooltip.NineSlice:GetCenterColor()) - tooltip.NineSlice:SetBorderColor(GameTooltip.NineSlice:GetBorderColor()) - end - else - local backdrop = GameTooltip:GetBackdrop() - - tooltip:SetBackdrop(backdrop) - - if backdrop then - tooltip:SetBackdropColor(GameTooltip:GetBackdropColor()) - tooltip:SetBackdropBorderColor(GameTooltip:GetBackdropBorderColor()) - end - end - - tooltip:SetScale(GameTooltip:GetScale()) - tooltip:SetAlpha(1) - tooltip:SetFrameStrata("TOOLTIP") - tooltip:SetClampedToScreen(false) - - ---------------------------------------------------------------------- - -- Internal data. Since it's possible to Acquire twice without calling - -- release, check for pre-existence. - ---------------------------------------------------------------------- - tooltip.key = key - tooltip.columns = tooltip.columns or AcquireTable() - tooltip.lines = tooltip.lines or AcquireTable() - tooltip.colspans = tooltip.colspans or AcquireTable() - tooltip.regularFont = _G.GameTooltipText - tooltip.headerFont = _G.GameTooltipHeaderText - tooltip.labelProvider = labelProvider - tooltip.cell_margin_h = tooltip.cell_margin_h or CELL_MARGIN_H - tooltip.cell_margin_v = tooltip.cell_margin_v or CELL_MARGIN_V - - ---------------------------------------------------------------------- - -- Finishing procedures - ---------------------------------------------------------------------- - tooltip:SetAutoHideDelay(nil) - tooltip:Hide() - ResetTooltipSize(tooltip) -end - -function tipPrototype:SetDefaultProvider(myProvider) - if not myProvider then - return - end - - self.labelProvider = myProvider -end - -function tipPrototype:GetDefaultProvider() - return self.labelProvider -end - -local function checkJustification(justification, level, silent) - if justification ~= "LEFT" and justification ~= "CENTER" and justification ~= "RIGHT" then - if silent then - return false - end - error("invalid justification, must one of LEFT, CENTER or RIGHT, not: " .. tostring(justification), level + 1) - end - - return true -end - -function tipPrototype:SetColumnLayout(numColumns, ...) - if type(numColumns) ~= "number" or numColumns < 1 then - error("number of columns must be a positive number, not: " .. tostring(numColumns), 2) - end - - for i = 1, numColumns do - local justification = select(i, ...) or "LEFT" - - checkJustification(justification, 2) - - if self.columns[i] then - self.columns[i].justification = justification - else - self:AddColumn(justification) - end - end -end - -function tipPrototype:AddColumn(justification) - justification = justification or "LEFT" - checkJustification(justification, 2) - - local colNum = #self.columns + 1 - local column = self.columns[colNum] or AcquireFrame(self.scrollChild) - - column:SetFrameLevel(self.scrollChild:GetFrameLevel() + 1) - column.justification = justification - column.width = 0 - column:SetWidth(1) - column:SetPoint("TOP", self.scrollChild) - column:SetPoint("BOTTOM", self.scrollChild) - - if colNum > 1 then - local h_margin = self.cell_margin_h or CELL_MARGIN_H - - column:SetPoint("LEFT", self.columns[colNum - 1], "RIGHT", h_margin, 0) - SetTooltipSize(self, self.width + h_margin, self.height) - else - column:SetPoint("LEFT", self.scrollChild) - end - - column:Show() - self.columns[colNum] = column - - return colNum -end - ------------------------------------------------------------------------------- --- Convenient methods ------------------------------------------------------------------------------- -function tipPrototype:Release() - lib:Release(self) -end - -function tipPrototype:IsAcquiredBy(key) - return key ~= nil and self.key == key -end - ------------------------------------------------------------------------------- --- Script hooks ------------------------------------------------------------------------------- -local RawSetScript = lib.frameMetatable.__index.SetScript - -function ClearTooltipScripts(tooltip) - if tooltip.scripts then - for scriptType in pairs(tooltip.scripts) do - RawSetScript(tooltip, scriptType, nil) - end - - tooltip.scripts = ReleaseTable(tooltip.scripts) - end -end - -function tipPrototype:SetScript(scriptType, handler) - RawSetScript(self, scriptType, handler) - - if handler then - if not self.scripts then - self.scripts = AcquireTable() - end - - self.scripts[scriptType] = true - elseif self.scripts then - self.scripts[scriptType] = nil - end -end - --- That might break some addons ; those addons were breaking other --- addons' tooltip though. -function tipPrototype:HookScript() - geterrorhandler()(":HookScript is not allowed on LibQTip tooltips") -end - ------------------------------------------------------------------------------- --- Scrollbar data and functions ------------------------------------------------------------------------------- -local BACKDROP_SLIDER_8_8 = BACKDROP_SLIDER_8_8 or { - bgFile = "Interface\\Buttons\\UI-SliderBar-Background", - edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", - tile = true, - tileEdge = true, - tileSize = 8, - edgeSize = 8, - insets = { left = 3, right = 3, top = 6, bottom = 6 }, -}; - -local function slider_OnValueChanged(self) - self.scrollFrame:SetVerticalScroll(self:GetValue()) -end - -local function tooltip_OnMouseWheel(self, delta) - local slider = self.slider - local currentValue = slider:GetValue() - local minValue, maxValue = slider:GetMinMaxValues() - local stepValue = self.step or 10 - - if delta < 0 and currentValue < maxValue then - slider:SetValue(min(maxValue, currentValue + stepValue)) - elseif delta > 0 and currentValue > minValue then - slider:SetValue(max(minValue, currentValue - stepValue)) - end -end - --- Set the step size for the scroll bar -function tipPrototype:SetScrollStep(step) - self.step = step -end - --- will resize the tooltip to fit the screen and show a scrollbar if needed -function tipPrototype:UpdateScrolling(maxheight) - self:SetClampedToScreen(false) - - -- all data is in the tooltip; fix colspan width and prevent the layout cleaner from messing up the tooltip later - FixCellSizes(self) - layoutCleaner.registry[self] = nil - - local scale = self:GetScale() - local topside = self:GetTop() - local bottomside = self:GetBottom() - local screensize = UIParent:GetHeight() / scale - local tipsize = (topside - bottomside) - - -- if the tooltip would be too high, limit its height and show the slider - if bottomside < 0 or topside > screensize or (maxheight and tipsize > maxheight) then - local shrink = (bottomside < 0 and (5 - bottomside) or 0) + (topside > screensize and (topside - screensize + 5) or 0) - - if maxheight and tipsize - shrink > maxheight then - shrink = tipsize - maxheight - end - - self:SetHeight(2 * TOOLTIP_PADDING + self.height - shrink) - self:SetWidth(2 * TOOLTIP_PADDING + self.width + 20) - self.scrollFrame:SetPoint("RIGHT", self, "RIGHT", -(TOOLTIP_PADDING + 20), 0) - - if not self.slider then - local slider = CreateFrame("Slider", nil, self, BackdropTemplateMixin and "BackdropTemplate") - slider.scrollFrame = self.scrollFrame - - slider:SetOrientation("VERTICAL") - slider:SetPoint("TOPRIGHT", self, "TOPRIGHT", -TOOLTIP_PADDING, -TOOLTIP_PADDING) - slider:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -TOOLTIP_PADDING, TOOLTIP_PADDING) - slider:SetBackdrop(BACKDROP_SLIDER_8_8) - slider:SetThumbTexture([[Interface\Buttons\UI-SliderBar-Button-Vertical]]) - slider:SetMinMaxValues(0, 1) - slider:SetValueStep(1) - slider:SetWidth(12) - slider:SetScript("OnValueChanged", slider_OnValueChanged) - slider:SetValue(0) - - self.slider = slider - end - - self.slider:SetMinMaxValues(0, shrink) - self.slider:Show() - - self:EnableMouseWheel(true) - self:SetScript("OnMouseWheel", tooltip_OnMouseWheel) - else - self:SetHeight(2 * TOOLTIP_PADDING + self.height) - self:SetWidth(2 * TOOLTIP_PADDING + self.width) - - self.scrollFrame:SetPoint("RIGHT", self, "RIGHT", -TOOLTIP_PADDING, 0) - - if self.slider then - self.slider:SetValue(0) - self.slider:Hide() - - self:EnableMouseWheel(false) - self:SetScript("OnMouseWheel", nil) - end - end -end - ------------------------------------------------------------------------------- --- Tooltip methods for changing its contents. ------------------------------------------------------------------------------- -function tipPrototype:Clear() - for i, line in ipairs(self.lines) do - for _, cell in pairs(line.cells) do - if cell then - ReleaseCell(cell) - end - end - - ReleaseTable(line.cells) - - line.cells = nil - line.is_header = nil - - ReleaseFrame(line) - - self.lines[i] = nil - end - - for _, column in ipairs(self.columns) do - column.width = 0 - column:SetWidth(1) - end - - wipe(self.colspans) - - self.cell_margin_h = nil - self.cell_margin_v = nil - - ResetTooltipSize(self) -end - -function tipPrototype:SetCellMarginH(size) - if #self.lines > 0 then - error("Unable to set horizontal margin while the tooltip has lines.", 2) - end - - if not size or type(size) ~= "number" or size < 0 then - error("Margin size must be a positive number or zero.", 2) - end - - self.cell_margin_h = size -end - -function tipPrototype:SetCellMarginV(size) - if #self.lines > 0 then - error("Unable to set vertical margin while the tooltip has lines.", 2) - end - - if not size or type(size) ~= "number" or size < 0 then - error("Margin size must be a positive number or zero.", 2) - end - - self.cell_margin_v = size -end - -function SetTooltipSize(tooltip, width, height) - tooltip.height = height - tooltip.width = width - - tooltip:SetHeight(2 * TOOLTIP_PADDING + height) - tooltip:SetWidth(2 * TOOLTIP_PADDING + width) - - tooltip.scrollChild:SetHeight(height) - tooltip.scrollChild:SetWidth(width) -end - --- Add 2 pixels to height so dangling letters (g, y, p, j, etc) are not clipped. -function ResetTooltipSize(tooltip) - local h_margin = tooltip.cell_margin_h or CELL_MARGIN_H - - SetTooltipSize(tooltip, max(0, (h_margin * (#tooltip.columns - 1)) + (h_margin / 2)), 2) -end - -local function EnlargeColumn(tooltip, column, width) - if width > column.width then - SetTooltipSize(tooltip, tooltip.width + width - column.width, tooltip.height) - - column.width = width - column:SetWidth(width) - end -end - -local function ResizeLine(tooltip, line, height) - SetTooltipSize(tooltip, tooltip.width, tooltip.height + height - line.height) - - line.height = height - line:SetHeight(height) -end - -function FixCellSizes(tooltip) - local columns = tooltip.columns - local colspans = tooltip.colspans - local lines = tooltip.lines - local h_margin = tooltip.cell_margin_h or CELL_MARGIN_H - - -- resize columns to make room for the colspans - while next(colspans) do - local maxNeedCols - local maxNeedWidthPerCol = 0 - - -- calculate the colspan with the highest additional width need per column - for colRange, width in pairs(colspans) do - local left, right = colRange:match("^(%d+)%-(%d+)$") - - left, right = tonumber(left), tonumber(right) - - for col = left, right - 1 do - width = width - columns[col].width - h_margin - end - - width = width - columns[right].width - - if width <= 0 then - colspans[colRange] = nil - else - width = width / (right - left + 1) - - if width > maxNeedWidthPerCol then - maxNeedCols = colRange - maxNeedWidthPerCol = width - end - end - end - - -- resize all columns for that colspan - if maxNeedCols then - local left, right = maxNeedCols:match("^(%d+)%-(%d+)$") - - for col = left, right do - EnlargeColumn(tooltip, columns[col], columns[col].width + maxNeedWidthPerCol) - end - - colspans[maxNeedCols] = nil - end - end - - --now that the cell width is set, recalculate the rows' height - for _, line in ipairs(lines) do - if #(line.cells) > 0 then - local lineheight = 0 - - for _, cell in pairs(line.cells) do - if cell then - lineheight = max(lineheight, cell:getContentHeight()) - end - end - - if lineheight > 0 then - ResizeLine(tooltip, line, lineheight) - end - end - end -end - -local function _SetCell(tooltip, lineNum, colNum, value, font, justification, colSpan, provider, ...) - local line = tooltip.lines[lineNum] - local cells = line.cells - - -- Unset: be quick - if value == nil then - local cell = cells[colNum] - - if cell then - for i = colNum, colNum + cell._colSpan - 1 do - cells[i] = nil - end - - ReleaseCell(cell) - end - - return lineNum, colNum - end - - font = font or (line.is_header and tooltip.headerFont or tooltip.regularFont) - - -- Check previous cell - local cell - local prevCell = cells[colNum] - - if prevCell then - -- There is a cell here - justification = justification or prevCell._justification - colSpan = colSpan or prevCell._colSpan - - -- Clear the currently marked colspan - for i = colNum + 1, colNum + prevCell._colSpan - 1 do - cells[i] = nil - end - - if provider == nil or prevCell._provider == provider then - -- Reuse existing cell - cell = prevCell - provider = cell._provider - else - -- A new cell is required - cells[colNum] = ReleaseCell(prevCell) - end - elseif prevCell == nil then - -- Creating a new cell, using meaningful defaults. - provider = provider or tooltip.labelProvider - justification = justification or tooltip.columns[colNum].justification or "LEFT" - colSpan = colSpan or 1 - else - error("overlapping cells at column " .. colNum, 3) - end - - local tooltipWidth = #tooltip.columns - local rightColNum - - if colSpan > 0 then - rightColNum = colNum + colSpan - 1 - - if rightColNum > tooltipWidth then - error("ColSpan too big, cell extends beyond right-most column", 3) - end - else - -- Zero or negative: count back from right-most columns - rightColNum = max(colNum, tooltipWidth + colSpan) - -- Update colspan to its effective value - colSpan = 1 + rightColNum - colNum - end - - -- Cleanup colspans - for i = colNum + 1, rightColNum do - local columnCell = cells[i] - - if columnCell then - ReleaseCell(columnCell) - elseif columnCell == false then - error("overlapping cells at column " .. i, 3) - end - - cells[i] = false - end - - -- Create the cell - if not cell then - cell = AcquireCell(tooltip, provider) - cells[colNum] = cell - end - - -- Anchor the cell - cell:SetPoint("LEFT", tooltip.columns[colNum]) - cell:SetPoint("RIGHT", tooltip.columns[rightColNum]) - cell:SetPoint("TOP", line) - cell:SetPoint("BOTTOM", line) - - -- Store the cell settings directly into the cell - -- That's a bit risky but is really cheap compared to other ways to do it - cell._font, cell._justification, cell._colSpan, cell._line, cell._column = font, justification, colSpan, lineNum, colNum - - -- Setup the cell content - local width, height = cell:SetupCell(tooltip, value, justification, font, ...) - cell:Show() - - if colSpan > 1 then - -- Postpone width changes until the tooltip is shown - local colRange = colNum .. "-" .. rightColNum - - tooltip.colspans[colRange] = max(tooltip.colspans[colRange] or 0, width) - layoutCleaner:RegisterForCleanup(tooltip) - else - -- Enlarge the column and tooltip if need be - EnlargeColumn(tooltip, tooltip.columns[colNum], width) - end - - -- Enlarge the line and tooltip if need be - if height > line.height then - SetTooltipSize(tooltip, tooltip.width, tooltip.height + height - line.height) - - line.height = height - line:SetHeight(height) - end - - if rightColNum < tooltipWidth then - return lineNum, rightColNum + 1 - else - return lineNum, nil - end -end - -do - local function CreateLine(tooltip, font, ...) - if #tooltip.columns == 0 then - error("column layout should be defined before adding line", 3) - end - - local lineNum = #tooltip.lines + 1 - local line = tooltip.lines[lineNum] or AcquireFrame(tooltip.scrollChild) - - line:SetFrameLevel(tooltip.scrollChild:GetFrameLevel() + 2) - line:SetPoint("LEFT", tooltip.scrollChild) - line:SetPoint("RIGHT", tooltip.scrollChild) - - if lineNum > 1 then - local v_margin = tooltip.cell_margin_v or CELL_MARGIN_V - - line:SetPoint("TOP", tooltip.lines[lineNum - 1], "BOTTOM", 0, -v_margin) - SetTooltipSize(tooltip, tooltip.width, tooltip.height + v_margin) - else - line:SetPoint("TOP", tooltip.scrollChild) - end - - tooltip.lines[lineNum] = line - - line.cells = line.cells or AcquireTable() - line.height = 0 - line:SetHeight(1) - line:Show() - - local colNum = 1 - - for i = 1, #tooltip.columns do - local value = select(i, ...) - - if value ~= nil then - lineNum, colNum = _SetCell(tooltip, lineNum, i, value, font, nil, 1, tooltip.labelProvider) - end - end - - return lineNum, colNum - end - - function tipPrototype:AddLine(...) - return CreateLine(self, self.regularFont, ...) - end - - function tipPrototype:AddHeader(...) - local line, col = CreateLine(self, self.headerFont, ...) - - self.lines[line].is_header = true - - return line, col - end -end -- do-block - -local GenericBackdrop = { - bgFile = "Interface\\Tooltips\\UI-Tooltip-Background" -} - -function tipPrototype:AddSeparator(height, r, g, b, a) - local lineNum, colNum = self:AddLine() - local line = self.lines[lineNum] - local color = _G.NORMAL_FONT_COLOR - - height = height or 1 - - SetTooltipSize(self, self.width, self.height + height) - - line.height = height - line:SetHeight(height) - line:SetBackdrop(GenericBackdrop) - line:SetBackdropColor(r or color.r, g or color.g, b or color.b, a or 1) - - return lineNum, colNum -end - -function tipPrototype:SetCellColor(lineNum, colNum, r, g, b, a) - local cell = self.lines[lineNum].cells[colNum] - - if cell then - local sr, sg, sb, sa = self:GetBackdropColor() - - cell:SetBackdrop(GenericBackdrop) - cell:SetBackdropColor(r or sr, g or sg, b or sb, a or sa) - end -end - -function tipPrototype:SetColumnColor(colNum, r, g, b, a) - local column = self.columns[colNum] - - if column then - local sr, sg, sb, sa = self:GetBackdropColor() - column:SetBackdrop(GenericBackdrop) - column:SetBackdropColor(r or sr, g or sg, b or sb, a or sa) - end -end - -function tipPrototype:SetLineColor(lineNum, r, g, b, a) - local line = self.lines[lineNum] - - if line then - local sr, sg, sb, sa = self:GetBackdropColor() - - line:SetBackdrop(GenericBackdrop) - line:SetBackdropColor(r or sr, g or sg, b or sb, a or sa) - end -end - -function tipPrototype:SetCellTextColor(lineNum, colNum, r, g, b, a) - local line = self.lines[lineNum] - local column = self.columns[colNum] - - if not line or not column then - return - end - - local cell = self.lines[lineNum].cells[colNum] - - if cell then - if not cell.fontString then - error("cell's label provider did not assign a fontString field", 2) - end - - if not cell.r then - cell.r, cell.g, cell.b, cell.a = cell.fontString:GetTextColor() - end - - cell.fontString:SetTextColor(r or cell.r, g or cell.g, b or cell.b, a or cell.a) - end -end - -function tipPrototype:SetColumnTextColor(colNum, r, g, b, a) - if not self.columns[colNum] then - return - end - - for lineIndex = 1, #self.lines do - self:SetCellTextColor(lineIndex, colNum, r, g, b, a) - end -end - -function tipPrototype:SetLineTextColor(lineNum, r, g, b, a) - local line = self.lines[lineNum] - - if not line then - return - end - - for cellIndex = 1, #line.cells do - self:SetCellTextColor(lineNum, line.cells[cellIndex]._column, r, g, b, a) - end -end - -function tipPrototype:SetHighlightTexture(...) - return highlightTexture:SetTexture(...) -end - -function tipPrototype:SetHighlightTexCoord(...) - highlightTexture:SetTexCoord(...) -end - -do - local function checkFont(font, level, silent) - local bad = false - - if not font then - bad = true - elseif type(font) == "string" then - local ref = _G[font] - - if not ref or type(ref) ~= "table" or type(ref.IsObjectType) ~= "function" or not ref:IsObjectType("Font") then - bad = true - end - elseif type(font) ~= "table" or type(font.IsObjectType) ~= "function" or not font:IsObjectType("Font") then - bad = true - end - - if bad then - if silent then - return false - end - - error("font must be a Font instance or a string matching the name of a global Font instance, not: " .. tostring(font), level + 1) - end - return true - end - - function tipPrototype:SetFont(font) - local is_string = type(font) == "string" - - checkFont(font, 2) - self.regularFont = is_string and _G[font] or font - end - - function tipPrototype:SetHeaderFont(font) - local is_string = type(font) == "string" - - checkFont(font, 2) - self.headerFont = is_string and _G[font] or font - end - - -- TODO: fixed argument positions / remove checks for performance? - function tipPrototype:SetCell(lineNum, colNum, value, ...) - -- Mandatory argument checking - if type(lineNum) ~= "number" then - error("line number must be a number, not: " .. tostring(lineNum), 2) - elseif lineNum < 1 or lineNum > #self.lines then - error("line number out of range: " .. tostring(lineNum), 2) - elseif type(colNum) ~= "number" then - error("column number must be a number, not: " .. tostring(colNum), 2) - elseif colNum < 1 or colNum > #self.columns then - error("column number out of range: " .. tostring(colNum), 2) - end - - -- Variable argument checking - local font, justification, colSpan, provider - local i, arg = 1, ... - - if arg == nil or checkFont(arg, 2, true) then - i, font, arg = 2, ... - end - - if arg == nil or checkJustification(arg, 2, true) then - i, justification, arg = i + 1, select(i, ...) - end - - if arg == nil or type(arg) == "number" then - i, colSpan, arg = i + 1, select(i, ...) - end - - if arg == nil or type(arg) == "table" and type(arg.AcquireCell) == "function" then - i, provider = i + 1, arg - end - - return _SetCell(self, lineNum, colNum, value, font, justification, colSpan, provider, select(i, ...)) - end -end -- do-block - -function tipPrototype:GetFont() - return self.regularFont -end - -function tipPrototype:GetHeaderFont() - return self.headerFont -end - -function tipPrototype:GetLineCount() - return #self.lines -end - -function tipPrototype:GetColumnCount() - return #self.columns -end - ------------------------------------------------------------------------------- --- Frame Scripts ------------------------------------------------------------------------------- -local scripts = { - OnEnter = function(frame, ...) - highlightFrame:SetParent(frame) - highlightFrame:SetAllPoints(frame) - highlightFrame:Show() - - if frame._OnEnter_func then - frame:_OnEnter_func(frame._OnEnter_arg, ...) - end - end, - OnLeave = function(frame, ...) - highlightFrame:Hide() - highlightFrame:ClearAllPoints() - highlightFrame:SetParent(nil) - - if frame._OnLeave_func then - frame:_OnLeave_func(frame._OnLeave_arg, ...) - end - end, - OnMouseDown = function(frame, ...) - frame:_OnMouseDown_func(frame._OnMouseDown_arg, ...) - end, - OnMouseUp = function(frame, ...) - frame:_OnMouseUp_func(frame._OnMouseUp_arg, ...) - end, - OnReceiveDrag = function(frame, ...) - frame:_OnReceiveDrag_func(frame._OnReceiveDrag_arg, ...) - end -} - -function SetFrameScript(frame, script, func, arg) - if not scripts[script] then - return - end - - frame["_" .. script .. "_func"] = func - frame["_" .. script .. "_arg"] = arg - - if script == "OnMouseDown" or script == "OnMouseUp" or script == "OnReceiveDrag" then - if func then - frame:SetScript(script, scripts[script]) - else - frame:SetScript(script, nil) - end - end - - -- if at least one script is set, set the OnEnter/OnLeave scripts for the highlight - if frame._OnEnter_func or frame._OnLeave_func or frame._OnMouseDown_func or frame._OnMouseUp_func or frame._OnReceiveDrag_func then - frame:EnableMouse(true) - frame:SetScript("OnEnter", scripts.OnEnter) - frame:SetScript("OnLeave", scripts.OnLeave) - else - frame:EnableMouse(false) - frame:SetScript("OnEnter", nil) - frame:SetScript("OnLeave", nil) - end -end - -function ClearFrameScripts(frame) - if frame._OnEnter_func or frame._OnLeave_func or frame._OnMouseDown_func or frame._OnMouseUp_func or frame._OnReceiveDrag_func then - frame:EnableMouse(false) - - frame:SetScript("OnEnter", nil) - frame._OnEnter_func = nil - frame._OnEnter_arg = nil - - frame:SetScript("OnLeave", nil) - frame._OnLeave_func = nil - frame._OnLeave_arg = nil - - frame:SetScript("OnReceiveDrag", nil) - frame._OnReceiveDrag_func = nil - frame._OnReceiveDrag_arg = nil - - frame:SetScript("OnMouseDown", nil) - frame._OnMouseDown_func = nil - frame._OnMouseDown_arg = nil - - frame:SetScript("OnMouseUp", nil) - frame._OnMouseUp_func = nil - frame._OnMouseUp_arg = nil - end -end - -function tipPrototype:SetLineScript(lineNum, script, func, arg) - SetFrameScript(self.lines[lineNum], script, func, arg) -end - -function tipPrototype:SetColumnScript(colNum, script, func, arg) - SetFrameScript(self.columns[colNum], script, func, arg) -end - -function tipPrototype:SetCellScript(lineNum, colNum, script, func, arg) - local cell = self.lines[lineNum].cells[colNum] - - if cell then - SetFrameScript(cell, script, func, arg) - end -end - ------------------------------------------------------------------------------- --- Auto-hiding feature ------------------------------------------------------------------------------- - --- Script of the auto-hiding child frame -local function AutoHideTimerFrame_OnUpdate(self, elapsed) - self.checkElapsed = self.checkElapsed + elapsed - - if self.checkElapsed > 0.1 then - if self.parent:IsMouseOver() or (self.alternateFrame and self.alternateFrame:IsMouseOver()) then - self.elapsed = 0 - else - self.elapsed = self.elapsed + self.checkElapsed - - if self.elapsed >= self.delay then - lib:Release(self.parent) - end - end - - self.checkElapsed = 0 - end -end - --- Usage: --- :SetAutoHideDelay(0.25) => hides after 0.25sec outside of the tooltip --- :SetAutoHideDelay(0.25, someFrame) => hides after 0.25sec outside of both the tooltip and someFrame --- :SetAutoHideDelay() => disable auto-hiding (default) -function tipPrototype:SetAutoHideDelay(delay, alternateFrame, releaseHandler) - local timerFrame = self.autoHideTimerFrame - delay = tonumber(delay) or 0 - - if releaseHandler then - if type(releaseHandler) ~= "function" then - error("releaseHandler must be a function", 2) - end - - lib.onReleaseHandlers[self] = releaseHandler - end - - if delay > 0 then - if not timerFrame then - timerFrame = AcquireTimer(self) - timerFrame:SetScript("OnUpdate", AutoHideTimerFrame_OnUpdate) - - self.autoHideTimerFrame = timerFrame - end - - timerFrame.parent = self - timerFrame.checkElapsed = 0 - timerFrame.elapsed = 0 - timerFrame.delay = delay - timerFrame.alternateFrame = alternateFrame - timerFrame:Show() - elseif timerFrame then - self.autoHideTimerFrame = nil - - timerFrame.alternateFrame = nil - timerFrame:SetScript("OnUpdate", nil) - - ReleaseTimer(timerFrame) - end -end - ------------------------------------------------------------------------------- --- "Smart" Anchoring ------------------------------------------------------------------------------- -local function GetTipAnchor(frame) - local x, y = frame:GetCenter() - - if not x or not y then - return "TOPLEFT", "BOTTOMLEFT" - end - - local hhalf = (x > UIParent:GetWidth() * 2 / 3) and "RIGHT" or (x < UIParent:GetWidth() / 3) and "LEFT" or "" - local vhalf = (y > UIParent:GetHeight() / 2) and "TOP" or "BOTTOM" - - return vhalf .. hhalf, frame, (vhalf == "TOP" and "BOTTOM" or "TOP") .. hhalf -end - -function tipPrototype:SmartAnchorTo(frame) - if not frame then - error("Invalid frame provided.", 2) - end - - self:ClearAllPoints() - self:SetClampedToScreen(true) - self:SetPoint(GetTipAnchor(frame)) -end - ------------------------------------------------------------------------------- --- Debug slashcmds ------------------------------------------------------------------------------- --- @debug @ -local print = print -local function PrintStats() - local tipCache = tostring(#tooltipHeap) - local frameCache = tostring(#frameHeap) - local tableCache = tostring(#tableHeap) - local header = false - - print("Tooltips used: " .. usedTooltips .. ", Cached: " .. tipCache .. ", Total: " .. tipCache + usedTooltips) - print("Frames used: " .. usedFrames .. ", Cached: " .. frameCache .. ", Total: " .. frameCache + usedFrames) - print("Tables used: " .. usedTables .. ", Cached: " .. tableCache .. ", Total: " .. tableCache + usedTables) - - for k in pairs(activeTooltips) do - if not header then - print("Active tooltips:") - header = true - end - print("- " .. k) - end -end - -SLASH_LibQTip1 = "/qtip" -_G.SlashCmdList["LibQTip"] = PrintStats ---@end-debug@]==] +local MAJOR = "LibQTip-1.0" +local MINOR = 49 -- Should be manually increased +local LibStub = _G.LibStub + +assert(LibStub, MAJOR .. " requires LibStub") + +local lib, oldMinor = LibStub:NewLibrary(MAJOR, MINOR) + +if not lib then + return +end -- No upgrade needed + +------------------------------------------------------------------------------ +-- Upvalued globals +------------------------------------------------------------------------------ +local table = _G.table +local tinsert = table.insert +local tremove = table.remove +local wipe = table.wipe + +local error = error +local math = math +local min, max = math.min, math.max +local next = next +local pairs, ipairs = pairs, ipairs +local select = select +local setmetatable = setmetatable +local tonumber, tostring = tonumber, tostring +local type = type + +local CreateFrame = _G.CreateFrame +local GameTooltip = _G.GameTooltip +local UIParent = _G.UIParent + +local geterrorhandler = _G.geterrorhandler + +------------------------------------------------------------------------------ +-- Tables and locals +------------------------------------------------------------------------------ +lib.frameMetatable = lib.frameMetatable or {__index = CreateFrame("Frame")} + +lib.tipPrototype = lib.tipPrototype or setmetatable({}, lib.frameMetatable) +lib.tipMetatable = lib.tipMetatable or {__index = lib.tipPrototype} + +lib.providerPrototype = lib.providerPrototype or {} +lib.providerMetatable = lib.providerMetatable or {__index = lib.providerPrototype} + +lib.cellPrototype = lib.cellPrototype or setmetatable({}, lib.frameMetatable) +lib.cellMetatable = lib.cellMetatable or {__index = lib.cellPrototype} + +lib.activeTooltips = lib.activeTooltips or {} + +lib.tooltipHeap = lib.tooltipHeap or {} +lib.frameHeap = lib.frameHeap or {} +lib.timerHeap = lib.timerHeap or {} +lib.tableHeap = lib.tableHeap or {} + +lib.onReleaseHandlers = lib.onReleaseHandlers or {} + +local tipPrototype = lib.tipPrototype +local tipMetatable = lib.tipMetatable + +local providerPrototype = lib.providerPrototype +local providerMetatable = lib.providerMetatable + +local cellPrototype = lib.cellPrototype +local cellMetatable = lib.cellMetatable + +local activeTooltips = lib.activeTooltips + +local highlightFrame = CreateFrame("Frame", nil, UIParent) +highlightFrame:SetFrameStrata("TOOLTIP") +highlightFrame:Hide() + +local DEFAULT_HIGHLIGHT_TEXTURE_PATH = [[Interface\QuestFrame\UI-QuestTitleHighlight]] + +local highlightTexture = highlightFrame:CreateTexture(nil, "OVERLAY") +highlightTexture:SetTexture(DEFAULT_HIGHLIGHT_TEXTURE_PATH) +highlightTexture:SetBlendMode("ADD") +highlightTexture:SetAllPoints(highlightFrame) + +------------------------------------------------------------------------------ +-- Private methods for Caches and Tooltip +------------------------------------------------------------------------------ +local AcquireTooltip, ReleaseTooltip +local AcquireCell, ReleaseCell +local AcquireTable, ReleaseTable + +local InitializeTooltip, SetTooltipSize, ResetTooltipSize, FixCellSizes +local ClearTooltipScripts +local SetFrameScript, ClearFrameScripts + +------------------------------------------------------------------------------ +-- Cache debugging. +------------------------------------------------------------------------------ +-- @debug @ +local usedTables, usedFrames, usedTooltips = 0, 0, 0 +--@end-debug@]==] + +------------------------------------------------------------------------------ +-- Internal constants to tweak the layout +------------------------------------------------------------------------------ +local TOOLTIP_PADDING = 10 +local CELL_MARGIN_H = 6 +local CELL_MARGIN_V = 3 + +------------------------------------------------------------------------------ +-- Public library API +------------------------------------------------------------------------------ +--- Create or retrieve the tooltip with the given key. +-- If additional arguments are passed, they are passed to :SetColumnLayout for the acquired tooltip. +-- @name LibQTip:Acquire(key[, numColumns, column1Justification, column2justification, ...]) +-- @param key string or table - the tooltip key. Any value that can be used as a table key is accepted though you should try to provide unique keys to avoid conflicts. +-- Numbers and booleans should be avoided and strings should be carefully chosen to avoid namespace clashes - no "MyTooltip" - you have been warned! +-- @return tooltip Frame object - the acquired tooltip. +-- @usage Acquire a tooltip with at least 5 columns, justification : left, center, left, left, left +-- <pre>local tip = LibStub('LibQTip-1.0'):Acquire('MyFooBarTooltip', 5, "LEFT", "CENTER")</pre> +function lib:Acquire(key, ...) + if key == nil then + error("attempt to use a nil key", 2) + end + + local tooltip = activeTooltips[key] + + if not tooltip then + tooltip = AcquireTooltip() + InitializeTooltip(tooltip, key) + activeTooltips[key] = tooltip + end + + if select("#", ...) > 0 then + -- Here we catch any error to properly report it for the calling code + local ok, msg = pcall(tooltip.SetColumnLayout, tooltip, ...) + + if not ok then + error(msg, 2) + end + end + + return tooltip +end + +function lib:Release(tooltip) + local key = tooltip and tooltip.key + + if not key or activeTooltips[key] ~= tooltip then + return + end + + ReleaseTooltip(tooltip) + activeTooltips[key] = nil +end + +function lib:IsAcquired(key) + if key == nil then + error("attempt to use a nil key", 2) + end + + return not (not activeTooltips[key]) +end + +function lib:IterateTooltips() + return pairs(activeTooltips) +end + +------------------------------------------------------------------------------ +-- Frame cache (for lines and columns) +------------------------------------------------------------------------------ +local frameHeap = lib.frameHeap + +local function AcquireFrame(parent) + local frame = tremove(frameHeap) or CreateFrame("Frame", nil, nil, BackdropTemplateMixin and "BackdropTemplate") + frame:SetParent(parent) + --[==[@debug@ + usedFrames = usedFrames + 1 + --@end-debug@]==] + return frame +end + +local function ReleaseFrame(frame) + frame:Hide() + frame:SetParent(nil) + frame:ClearAllPoints() + frame:SetBackdrop(nil) + + ClearFrameScripts(frame) + + tinsert(frameHeap, frame) + --[==[@debug@ + usedFrames = usedFrames - 1 + --@end-debug@]==] +end + +------------------------------------------------------------------------------ +-- Timer cache +------------------------------------------------------------------------------ +local timerHeap = lib.timerHeap + +local function AcquireTimer(parent) + local frame = tremove(timerHeap) or CreateFrame("Frame") + frame:SetParent(parent) + return frame +end + +local function ReleaseTimer(frame) + frame:Hide() + frame:SetParent(nil) + + ClearFrameScripts(frame) + + tinsert(timerHeap, frame) +end + +------------------------------------------------------------------------------ +-- Dirty layout handler +------------------------------------------------------------------------------ +lib.layoutCleaner = lib.layoutCleaner or CreateFrame("Frame") + +local layoutCleaner = lib.layoutCleaner +layoutCleaner.registry = layoutCleaner.registry or {} + +function layoutCleaner:RegisterForCleanup(tooltip) + self.registry[tooltip] = true + self:Show() +end + +function layoutCleaner:CleanupLayouts() + self:Hide() + + for tooltip in pairs(self.registry) do + FixCellSizes(tooltip) + end + + wipe(self.registry) +end + +layoutCleaner:SetScript("OnUpdate", layoutCleaner.CleanupLayouts) + +------------------------------------------------------------------------------ +-- CellProvider and Cell +------------------------------------------------------------------------------ +function providerPrototype:AcquireCell() + local cell = tremove(self.heap) + + if not cell then + cell = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate") + setmetatable(cell, self.cellMetatable) + + if type(cell.InitializeCell) == "function" then + cell:InitializeCell() + end + end + + self.cells[cell] = true + + return cell +end + +function providerPrototype:ReleaseCell(cell) + if not self.cells[cell] then + return + end + + if type(cell.ReleaseCell) == "function" then + cell:ReleaseCell() + end + + self.cells[cell] = nil + tinsert(self.heap, cell) +end + +function providerPrototype:GetCellPrototype() + return self.cellPrototype, self.cellMetatable +end + +function providerPrototype:IterateCells() + return pairs(self.cells) +end + +function lib:CreateCellProvider(baseProvider) + local cellBaseMetatable, cellBasePrototype + + if baseProvider and baseProvider.GetCellPrototype then + cellBasePrototype, cellBaseMetatable = baseProvider:GetCellPrototype() + else + cellBaseMetatable = cellMetatable + end + + local newCellPrototype = setmetatable({}, cellBaseMetatable) + local newCellProvider = setmetatable({}, providerMetatable) + + newCellProvider.heap = {} + newCellProvider.cells = {} + newCellProvider.cellPrototype = newCellPrototype + newCellProvider.cellMetatable = {__index = newCellPrototype} + + return newCellProvider, newCellPrototype, cellBasePrototype +end + +------------------------------------------------------------------------------ +-- Basic label provider +------------------------------------------------------------------------------ +if not lib.LabelProvider then + lib.LabelProvider, lib.LabelPrototype = lib:CreateCellProvider() +end + +local labelProvider = lib.LabelProvider +local labelPrototype = lib.LabelPrototype + +function labelPrototype:InitializeCell() + self.fontString = self:CreateFontString() + self.fontString:SetFontObject(_G.GameTooltipText) +end + +function labelPrototype:SetupCell(tooltip, value, justification, font, leftPadding, rightPadding, maxWidth, minWidth, ...) + local fontString = self.fontString + local line = tooltip.lines[self._line] + + -- detatch fs from cell for size calculations + fontString:ClearAllPoints() + fontString:SetFontObject(font or (line.is_header and tooltip:GetHeaderFont() or tooltip:GetFont())) + fontString:SetJustifyH(justification) + fontString:SetText(tostring(value)) + + leftPadding = leftPadding or 0 + rightPadding = rightPadding or 0 + + local width = fontString:GetStringWidth() + leftPadding + rightPadding + + if maxWidth and minWidth and (maxWidth < minWidth) then + error("maximum width cannot be lower than minimum width: " .. tostring(maxWidth) .. " < " .. tostring(minWidth), 2) + end + + if maxWidth and (maxWidth < (leftPadding + rightPadding)) then + error("maximum width cannot be lower than the sum of paddings: " .. tostring(maxWidth) .. " < " .. tostring(leftPadding) .. " + " .. tostring(rightPadding), 2) + end + + if minWidth and width < minWidth then + width = minWidth + end + + if maxWidth and maxWidth < width then + width = maxWidth + end + + fontString:SetWidth(width - (leftPadding + rightPadding)) + -- Use GetHeight() instead of GetStringHeight() so lines which are longer than width will wrap. + local height = fontString:GetHeight() + + -- reanchor fs to cell + fontString:SetWidth(0) + fontString:SetPoint("TOPLEFT", self, "TOPLEFT", leftPadding, 0) + fontString:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -rightPadding, 0) + --~ fs:SetPoint("TOPRIGHT", self, "TOPRIGHT", -r_pad, 0) + + self._paddingL = leftPadding + self._paddingR = rightPadding + + return width, height +end + +function labelPrototype:getContentHeight() + local fontString = self.fontString + fontString:SetWidth(self:GetWidth() - (self._paddingL + self._paddingR)) + + local height = self.fontString:GetHeight() + fontString:SetWidth(0) + + return height +end + +function labelPrototype:GetPosition() + return self._line, self._column +end + +------------------------------------------------------------------------------ +-- Tooltip cache +------------------------------------------------------------------------------ +local tooltipHeap = lib.tooltipHeap + +-- Returns a tooltip +function AcquireTooltip() + local tooltip = tremove(tooltipHeap) + + if not tooltip then + local template = (TooltipBackdropTemplateMixin and "TooltipBackdropTemplate") or (BackdropTemplateMixin and "BackdropTemplate") + tooltip = CreateFrame("Frame", nil, UIParent, template) + + local scrollFrame = CreateFrame("ScrollFrame", nil, tooltip) + scrollFrame:SetPoint("TOP", tooltip, "TOP", 0, -TOOLTIP_PADDING) + scrollFrame:SetPoint("BOTTOM", tooltip, "BOTTOM", 0, TOOLTIP_PADDING) + scrollFrame:SetPoint("LEFT", tooltip, "LEFT", TOOLTIP_PADDING, 0) + scrollFrame:SetPoint("RIGHT", tooltip, "RIGHT", -TOOLTIP_PADDING, 0) + tooltip.scrollFrame = scrollFrame + + local scrollChild = CreateFrame("Frame", nil, tooltip.scrollFrame) + scrollFrame:SetScrollChild(scrollChild) + tooltip.scrollChild = scrollChild + + setmetatable(tooltip, tipMetatable) + end + + --[==[@debug@ + usedTooltips = usedTooltips + 1 + --@end-debug@]==] + return tooltip +end + +-- Cleans the tooltip and stores it in the cache +function ReleaseTooltip(tooltip) + if tooltip.releasing then + return + end + + tooltip.releasing = true + tooltip:Hide() + + local releaseHandler = lib.onReleaseHandlers[tooltip] + + if releaseHandler then + lib.onReleaseHandlers[tooltip] = nil + + local success, errorMessage = pcall(releaseHandler, tooltip) + + if not success then + geterrorhandler()(errorMessage) + end + elseif tooltip.OnRelease then + local success, errorMessage = pcall(tooltip.OnRelease, tooltip) + if not success then + geterrorhandler()(errorMessage) + end + + tooltip.OnRelease = nil + end + + tooltip.releasing = nil + tooltip.key = nil + tooltip.step = nil + + ClearTooltipScripts(tooltip) + + tooltip:SetAutoHideDelay(nil) + tooltip:ClearAllPoints() + tooltip:Clear() + + if tooltip.slider then + tooltip.slider:SetValue(0) + tooltip.slider:Hide() + tooltip.scrollFrame:SetPoint("RIGHT", tooltip, "RIGHT", -TOOLTIP_PADDING, 0) + tooltip:EnableMouseWheel(false) + end + + for i, column in ipairs(tooltip.columns) do + tooltip.columns[i] = ReleaseFrame(column) + end + + tooltip.columns = ReleaseTable(tooltip.columns) + tooltip.lines = ReleaseTable(tooltip.lines) + tooltip.colspans = ReleaseTable(tooltip.colspans) + + layoutCleaner.registry[tooltip] = nil + + if TooltipBackdropTemplateMixin and not tooltip.NineSlice then + -- don't recycle outdated tooltips into heap + tooltip = nil + end + + if tooltip then + tinsert(tooltipHeap, tooltip) + end + + highlightTexture:SetTexture(DEFAULT_HIGHLIGHT_TEXTURE_PATH) + highlightTexture:SetTexCoord(0, 1, 0, 1) + + --[==[@debug@ + usedTooltips = usedTooltips - 1 + --@end-debug@]==] +end + +------------------------------------------------------------------------------ +-- Cell 'cache' (just a wrapper to the provider's cache) +------------------------------------------------------------------------------ +-- Returns a cell for the given tooltip from the given provider +function AcquireCell(tooltip, provider) + local cell = provider:AcquireCell(tooltip) + + cell:SetParent(tooltip.scrollChild) + cell:SetFrameLevel(tooltip.scrollChild:GetFrameLevel() + 3) + cell._provider = provider + + return cell +end + +-- Cleans the cell hands it to its provider for storing +function ReleaseCell(cell) + if cell.fontString and cell.r then + cell.fontString:SetTextColor(cell.r, cell.g, cell.b, cell.a) + end + + cell._font = nil + cell._justification = nil + cell._colSpan = nil + cell._line = nil + cell._column = nil + + cell:Hide() + cell:ClearAllPoints() + cell:SetParent(nil) + cell:SetBackdrop(nil) + + ClearFrameScripts(cell) + + cell._provider:ReleaseCell(cell) + cell._provider = nil +end + +------------------------------------------------------------------------------ +-- Table cache +------------------------------------------------------------------------------ +local tableHeap = lib.tableHeap + +-- Returns a table +function AcquireTable() + local tbl = tremove(tableHeap) or {} + --[==[@debug@ + usedTables = usedTables + 1 + --@end-debug@]==] + return tbl +end + +-- Cleans the table and stores it in the cache +function ReleaseTable(tableInstance) + wipe(tableInstance) + tinsert(tableHeap, tableInstance) + --[==[@debug@ + usedTables = usedTables - 1 + --@end-debug@]==] +end + +------------------------------------------------------------------------------ +-- Tooltip prototype +------------------------------------------------------------------------------ +function InitializeTooltip(tooltip, key) + ---------------------------------------------------------------------- + -- (Re)set frame settings + ---------------------------------------------------------------------- + if TooltipBackdropTemplateMixin then + tooltip.layoutType = GameTooltip.layoutType + NineSlicePanelMixin.OnLoad(tooltip.NineSlice) + if GameTooltip.layoutType then + tooltip.NineSlice:SetCenterColor(GameTooltip.NineSlice:GetCenterColor()) + tooltip.NineSlice:SetBorderColor(GameTooltip.NineSlice:GetBorderColor()) + end + else + local backdrop = GameTooltip:GetBackdrop() + + tooltip:SetBackdrop(backdrop) + + if backdrop then + tooltip:SetBackdropColor(GameTooltip:GetBackdropColor()) + tooltip:SetBackdropBorderColor(GameTooltip:GetBackdropBorderColor()) + end + end + + tooltip:SetScale(GameTooltip:GetScale()) + tooltip:SetAlpha(1) + tooltip:SetFrameStrata("TOOLTIP") + tooltip:SetClampedToScreen(false) + + ---------------------------------------------------------------------- + -- Internal data. Since it's possible to Acquire twice without calling + -- release, check for pre-existence. + ---------------------------------------------------------------------- + tooltip.key = key + tooltip.columns = tooltip.columns or AcquireTable() + tooltip.lines = tooltip.lines or AcquireTable() + tooltip.colspans = tooltip.colspans or AcquireTable() + tooltip.regularFont = _G.GameTooltipText + tooltip.headerFont = _G.GameTooltipHeaderText + tooltip.labelProvider = labelProvider + tooltip.cell_margin_h = tooltip.cell_margin_h or CELL_MARGIN_H + tooltip.cell_margin_v = tooltip.cell_margin_v or CELL_MARGIN_V + + ---------------------------------------------------------------------- + -- Finishing procedures + ---------------------------------------------------------------------- + tooltip:SetAutoHideDelay(nil) + tooltip:Hide() + ResetTooltipSize(tooltip) +end + +function tipPrototype:SetDefaultProvider(myProvider) + if not myProvider then + return + end + + self.labelProvider = myProvider +end + +function tipPrototype:GetDefaultProvider() + return self.labelProvider +end + +local function checkJustification(justification, level, silent) + if justification ~= "LEFT" and justification ~= "CENTER" and justification ~= "RIGHT" then + if silent then + return false + end + error("invalid justification, must one of LEFT, CENTER or RIGHT, not: " .. tostring(justification), level + 1) + end + + return true +end + +function tipPrototype:SetColumnLayout(numColumns, ...) + if type(numColumns) ~= "number" or numColumns < 1 then + error("number of columns must be a positive number, not: " .. tostring(numColumns), 2) + end + + for i = 1, numColumns do + local justification = select(i, ...) or "LEFT" + + checkJustification(justification, 2) + + if self.columns[i] then + self.columns[i].justification = justification + else + self:AddColumn(justification) + end + end +end + +function tipPrototype:AddColumn(justification) + justification = justification or "LEFT" + checkJustification(justification, 2) + + local colNum = #self.columns + 1 + local column = self.columns[colNum] or AcquireFrame(self.scrollChild) + + column:SetFrameLevel(self.scrollChild:GetFrameLevel() + 1) + column.justification = justification + column.width = 0 + column:SetWidth(1) + column:SetPoint("TOP", self.scrollChild) + column:SetPoint("BOTTOM", self.scrollChild) + + if colNum > 1 then + local h_margin = self.cell_margin_h or CELL_MARGIN_H + + column:SetPoint("LEFT", self.columns[colNum - 1], "RIGHT", h_margin, 0) + SetTooltipSize(self, self.width + h_margin, self.height) + else + column:SetPoint("LEFT", self.scrollChild) + end + + column:Show() + self.columns[colNum] = column + + return colNum +end + +------------------------------------------------------------------------------ +-- Convenient methods +------------------------------------------------------------------------------ +function tipPrototype:Release() + lib:Release(self) +end + +function tipPrototype:IsAcquiredBy(key) + return key ~= nil and self.key == key +end + +------------------------------------------------------------------------------ +-- Script hooks +------------------------------------------------------------------------------ +local RawSetScript = lib.frameMetatable.__index.SetScript + +function ClearTooltipScripts(tooltip) + if tooltip.scripts then + for scriptType in pairs(tooltip.scripts) do + RawSetScript(tooltip, scriptType, nil) + end + + tooltip.scripts = ReleaseTable(tooltip.scripts) + end +end + +function tipPrototype:SetScript(scriptType, handler) + RawSetScript(self, scriptType, handler) + + if handler then + if not self.scripts then + self.scripts = AcquireTable() + end + + self.scripts[scriptType] = true + elseif self.scripts then + self.scripts[scriptType] = nil + end +end + +-- That might break some addons ; those addons were breaking other +-- addons' tooltip though. +function tipPrototype:HookScript() + geterrorhandler()(":HookScript is not allowed on LibQTip tooltips") +end + +------------------------------------------------------------------------------ +-- Scrollbar data and functions +------------------------------------------------------------------------------ +local BACKDROP_SLIDER_8_8 = BACKDROP_SLIDER_8_8 or { + bgFile = "Interface\\Buttons\\UI-SliderBar-Background", + edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", + tile = true, + tileEdge = true, + tileSize = 8, + edgeSize = 8, + insets = { left = 3, right = 3, top = 6, bottom = 6 }, +}; + +local function slider_OnValueChanged(self) + self.scrollFrame:SetVerticalScroll(self:GetValue()) +end + +local function tooltip_OnMouseWheel(self, delta) + local slider = self.slider + local currentValue = slider:GetValue() + local minValue, maxValue = slider:GetMinMaxValues() + local stepValue = self.step or 10 + + if delta < 0 and currentValue < maxValue then + slider:SetValue(min(maxValue, currentValue + stepValue)) + elseif delta > 0 and currentValue > minValue then + slider:SetValue(max(minValue, currentValue - stepValue)) + end +end + +-- Set the step size for the scroll bar +function tipPrototype:SetScrollStep(step) + self.step = step +end + +-- will resize the tooltip to fit the screen and show a scrollbar if needed +function tipPrototype:UpdateScrolling(maxheight) + self:SetClampedToScreen(false) + + -- all data is in the tooltip; fix colspan width and prevent the layout cleaner from messing up the tooltip later + FixCellSizes(self) + layoutCleaner.registry[self] = nil + + local scale = self:GetScale() + local topside = self:GetTop() + local bottomside = self:GetBottom() + local screensize = UIParent:GetHeight() / scale + local tipsize = (topside - bottomside) + + -- if the tooltip would be too high, limit its height and show the slider + if bottomside < 0 or topside > screensize or (maxheight and tipsize > maxheight) then + local shrink = (bottomside < 0 and (5 - bottomside) or 0) + (topside > screensize and (topside - screensize + 5) or 0) + + if maxheight and tipsize - shrink > maxheight then + shrink = tipsize - maxheight + end + + self:SetHeight(2 * TOOLTIP_PADDING + self.height - shrink) + self:SetWidth(2 * TOOLTIP_PADDING + self.width + 20) + self.scrollFrame:SetPoint("RIGHT", self, "RIGHT", -(TOOLTIP_PADDING + 20), 0) + + if not self.slider then + local slider = CreateFrame("Slider", nil, self, BackdropTemplateMixin and "BackdropTemplate") + slider.scrollFrame = self.scrollFrame + + slider:SetOrientation("VERTICAL") + slider:SetPoint("TOPRIGHT", self, "TOPRIGHT", -TOOLTIP_PADDING, -TOOLTIP_PADDING) + slider:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -TOOLTIP_PADDING, TOOLTIP_PADDING) + slider:SetBackdrop(BACKDROP_SLIDER_8_8) + slider:SetThumbTexture([[Interface\Buttons\UI-SliderBar-Button-Vertical]]) + slider:SetMinMaxValues(0, 1) + slider:SetValueStep(1) + slider:SetWidth(12) + slider:SetScript("OnValueChanged", slider_OnValueChanged) + slider:SetValue(0) + + self.slider = slider + end + + self.slider:SetMinMaxValues(0, shrink) + self.slider:Show() + + self:EnableMouseWheel(true) + self:SetScript("OnMouseWheel", tooltip_OnMouseWheel) + else + self:SetHeight(2 * TOOLTIP_PADDING + self.height) + self:SetWidth(2 * TOOLTIP_PADDING + self.width) + + self.scrollFrame:SetPoint("RIGHT", self, "RIGHT", -TOOLTIP_PADDING, 0) + + if self.slider then + self.slider:SetValue(0) + self.slider:Hide() + + self:EnableMouseWheel(false) + self:SetScript("OnMouseWheel", nil) + end + end +end + +------------------------------------------------------------------------------ +-- Tooltip methods for changing its contents. +------------------------------------------------------------------------------ +function tipPrototype:Clear() + for i, line in ipairs(self.lines) do + for _, cell in pairs(line.cells) do + if cell then + ReleaseCell(cell) + end + end + + ReleaseTable(line.cells) + + line.cells = nil + line.is_header = nil + + ReleaseFrame(line) + + self.lines[i] = nil + end + + for _, column in ipairs(self.columns) do + column.width = 0 + column:SetWidth(1) + end + + wipe(self.colspans) + + self.cell_margin_h = nil + self.cell_margin_v = nil + + ResetTooltipSize(self) +end + +function tipPrototype:SetCellMarginH(size) + if #self.lines > 0 then + error("Unable to set horizontal margin while the tooltip has lines.", 2) + end + + if not size or type(size) ~= "number" or size < 0 then + error("Margin size must be a positive number or zero.", 2) + end + + self.cell_margin_h = size +end + +function tipPrototype:SetCellMarginV(size) + if #self.lines > 0 then + error("Unable to set vertical margin while the tooltip has lines.", 2) + end + + if not size or type(size) ~= "number" or size < 0 then + error("Margin size must be a positive number or zero.", 2) + end + + self.cell_margin_v = size +end + +function SetTooltipSize(tooltip, width, height) + tooltip.height = height + tooltip.width = width + + tooltip:SetHeight(2 * TOOLTIP_PADDING + height) + tooltip:SetWidth(2 * TOOLTIP_PADDING + width) + + tooltip.scrollChild:SetHeight(height) + tooltip.scrollChild:SetWidth(width) +end + +-- Add 2 pixels to height so dangling letters (g, y, p, j, etc) are not clipped. +function ResetTooltipSize(tooltip) + local h_margin = tooltip.cell_margin_h or CELL_MARGIN_H + + SetTooltipSize(tooltip, max(0, (h_margin * (#tooltip.columns - 1)) + (h_margin / 2)), 2) +end + +local function EnlargeColumn(tooltip, column, width) + if width > column.width then + SetTooltipSize(tooltip, tooltip.width + width - column.width, tooltip.height) + + column.width = width + column:SetWidth(width) + end +end + +local function ResizeLine(tooltip, line, height) + SetTooltipSize(tooltip, tooltip.width, tooltip.height + height - line.height) + + line.height = height + line:SetHeight(height) +end + +function FixCellSizes(tooltip) + local columns = tooltip.columns + local colspans = tooltip.colspans + local lines = tooltip.lines + local h_margin = tooltip.cell_margin_h or CELL_MARGIN_H + + -- resize columns to make room for the colspans + while next(colspans) do + local maxNeedCols + local maxNeedWidthPerCol = 0 + + -- calculate the colspan with the highest additional width need per column + for colRange, width in pairs(colspans) do + local left, right = colRange:match("^(%d+)%-(%d+)$") + + left, right = tonumber(left), tonumber(right) + + for col = left, right - 1 do + width = width - columns[col].width - h_margin + end + + width = width - columns[right].width + + if width <= 0 then + colspans[colRange] = nil + else + width = width / (right - left + 1) + + if width > maxNeedWidthPerCol then + maxNeedCols = colRange + maxNeedWidthPerCol = width + end + end + end + + -- resize all columns for that colspan + if maxNeedCols then + local left, right = maxNeedCols:match("^(%d+)%-(%d+)$") + + for col = left, right do + EnlargeColumn(tooltip, columns[col], columns[col].width + maxNeedWidthPerCol) + end + + colspans[maxNeedCols] = nil + end + end + + --now that the cell width is set, recalculate the rows' height + for _, line in ipairs(lines) do + if #(line.cells) > 0 then + local lineheight = 0 + + for _, cell in pairs(line.cells) do + if cell then + lineheight = max(lineheight, cell:getContentHeight()) + end + end + + if lineheight > 0 then + ResizeLine(tooltip, line, lineheight) + end + end + end +end + +local function _SetCell(tooltip, lineNum, colNum, value, font, justification, colSpan, provider, ...) + local line = tooltip.lines[lineNum] + local cells = line.cells + + -- Unset: be quick + if value == nil then + local cell = cells[colNum] + + if cell then + for i = colNum, colNum + cell._colSpan - 1 do + cells[i] = nil + end + + ReleaseCell(cell) + end + + return lineNum, colNum + end + + font = font or (line.is_header and tooltip.headerFont or tooltip.regularFont) + + -- Check previous cell + local cell + local prevCell = cells[colNum] + + if prevCell then + -- There is a cell here + justification = justification or prevCell._justification + colSpan = colSpan or prevCell._colSpan + + -- Clear the currently marked colspan + for i = colNum + 1, colNum + prevCell._colSpan - 1 do + cells[i] = nil + end + + if provider == nil or prevCell._provider == provider then + -- Reuse existing cell + cell = prevCell + provider = cell._provider + else + -- A new cell is required + cells[colNum] = ReleaseCell(prevCell) + end + elseif prevCell == nil then + -- Creating a new cell, using meaningful defaults. + provider = provider or tooltip.labelProvider + justification = justification or tooltip.columns[colNum].justification or "LEFT" + colSpan = colSpan or 1 + else + error("overlapping cells at column " .. colNum, 3) + end + + local tooltipWidth = #tooltip.columns + local rightColNum + + if colSpan > 0 then + rightColNum = colNum + colSpan - 1 + + if rightColNum > tooltipWidth then + error("ColSpan too big, cell extends beyond right-most column", 3) + end + else + -- Zero or negative: count back from right-most columns + rightColNum = max(colNum, tooltipWidth + colSpan) + -- Update colspan to its effective value + colSpan = 1 + rightColNum - colNum + end + + -- Cleanup colspans + for i = colNum + 1, rightColNum do + local columnCell = cells[i] + + if columnCell then + ReleaseCell(columnCell) + elseif columnCell == false then + error("overlapping cells at column " .. i, 3) + end + + cells[i] = false + end + + -- Create the cell + if not cell then + cell = AcquireCell(tooltip, provider) + cells[colNum] = cell + end + + -- Anchor the cell + cell:SetPoint("LEFT", tooltip.columns[colNum]) + cell:SetPoint("RIGHT", tooltip.columns[rightColNum]) + cell:SetPoint("TOP", line) + cell:SetPoint("BOTTOM", line) + + -- Store the cell settings directly into the cell + -- That's a bit risky but is really cheap compared to other ways to do it + cell._font, cell._justification, cell._colSpan, cell._line, cell._column = font, justification, colSpan, lineNum, colNum + + -- Setup the cell content + local width, height = cell:SetupCell(tooltip, value, justification, font, ...) + cell:Show() + + if colSpan > 1 then + -- Postpone width changes until the tooltip is shown + local colRange = colNum .. "-" .. rightColNum + + tooltip.colspans[colRange] = max(tooltip.colspans[colRange] or 0, width) + layoutCleaner:RegisterForCleanup(tooltip) + else + -- Enlarge the column and tooltip if need be + EnlargeColumn(tooltip, tooltip.columns[colNum], width) + end + + -- Enlarge the line and tooltip if need be + if height > line.height then + SetTooltipSize(tooltip, tooltip.width, tooltip.height + height - line.height) + + line.height = height + line:SetHeight(height) + end + + if rightColNum < tooltipWidth then + return lineNum, rightColNum + 1 + else + return lineNum, nil + end +end + +do + local function CreateLine(tooltip, font, ...) + if #tooltip.columns == 0 then + error("column layout should be defined before adding line", 3) + end + + local lineNum = #tooltip.lines + 1 + local line = tooltip.lines[lineNum] or AcquireFrame(tooltip.scrollChild) + + line:SetFrameLevel(tooltip.scrollChild:GetFrameLevel() + 2) + line:SetPoint("LEFT", tooltip.scrollChild) + line:SetPoint("RIGHT", tooltip.scrollChild) + + if lineNum > 1 then + local v_margin = tooltip.cell_margin_v or CELL_MARGIN_V + + line:SetPoint("TOP", tooltip.lines[lineNum - 1], "BOTTOM", 0, -v_margin) + SetTooltipSize(tooltip, tooltip.width, tooltip.height + v_margin) + else + line:SetPoint("TOP", tooltip.scrollChild) + end + + tooltip.lines[lineNum] = line + + line.cells = line.cells or AcquireTable() + line.height = 0 + line:SetHeight(1) + line:Show() + + local colNum = 1 + + for i = 1, #tooltip.columns do + local value = select(i, ...) + + if value ~= nil then + lineNum, colNum = _SetCell(tooltip, lineNum, i, value, font, nil, 1, tooltip.labelProvider) + end + end + + return lineNum, colNum + end + + function tipPrototype:AddLine(...) + return CreateLine(self, self.regularFont, ...) + end + + function tipPrototype:AddHeader(...) + local line, col = CreateLine(self, self.headerFont, ...) + + self.lines[line].is_header = true + + return line, col + end +end -- do-block + +local GenericBackdrop = { + bgFile = "Interface\\Tooltips\\UI-Tooltip-Background" +} + +function tipPrototype:AddSeparator(height, r, g, b, a) + local lineNum, colNum = self:AddLine() + local line = self.lines[lineNum] + local color = _G.NORMAL_FONT_COLOR + + height = height or 1 + + SetTooltipSize(self, self.width, self.height + height) + + line.height = height + line:SetHeight(height) + line:SetBackdrop(GenericBackdrop) + line:SetBackdropColor(r or color.r, g or color.g, b or color.b, a or 1) + + return lineNum, colNum +end + +function tipPrototype:SetCellColor(lineNum, colNum, r, g, b, a) + local cell = self.lines[lineNum].cells[colNum] + + if cell then + local sr, sg, sb, sa = self:GetBackdropColor() + + cell:SetBackdrop(GenericBackdrop) + cell:SetBackdropColor(r or sr, g or sg, b or sb, a or sa) + end +end + +function tipPrototype:SetColumnColor(colNum, r, g, b, a) + local column = self.columns[colNum] + + if column then + local sr, sg, sb, sa = self:GetBackdropColor() + column:SetBackdrop(GenericBackdrop) + column:SetBackdropColor(r or sr, g or sg, b or sb, a or sa) + end +end + +function tipPrototype:SetLineColor(lineNum, r, g, b, a) + local line = self.lines[lineNum] + + if line then + local sr, sg, sb, sa = self:GetBackdropColor() + + line:SetBackdrop(GenericBackdrop) + line:SetBackdropColor(r or sr, g or sg, b or sb, a or sa) + end +end + +function tipPrototype:SetCellTextColor(lineNum, colNum, r, g, b, a) + local line = self.lines[lineNum] + local column = self.columns[colNum] + + if not line or not column then + return + end + + local cell = self.lines[lineNum].cells[colNum] + + if cell then + if not cell.fontString then + error("cell's label provider did not assign a fontString field", 2) + end + + if not cell.r then + cell.r, cell.g, cell.b, cell.a = cell.fontString:GetTextColor() + end + + cell.fontString:SetTextColor(r or cell.r, g or cell.g, b or cell.b, a or cell.a) + end +end + +function tipPrototype:SetColumnTextColor(colNum, r, g, b, a) + if not self.columns[colNum] then + return + end + + for lineIndex = 1, #self.lines do + self:SetCellTextColor(lineIndex, colNum, r, g, b, a) + end +end + +function tipPrototype:SetLineTextColor(lineNum, r, g, b, a) + local line = self.lines[lineNum] + + if not line then + return + end + + for cellIndex = 1, #line.cells do + self:SetCellTextColor(lineNum, line.cells[cellIndex]._column, r, g, b, a) + end +end + +function tipPrototype:SetHighlightTexture(...) + return highlightTexture:SetTexture(...) +end + +function tipPrototype:SetHighlightTexCoord(...) + highlightTexture:SetTexCoord(...) +end + +do + local function checkFont(font, level, silent) + local bad = false + + if not font then + bad = true + elseif type(font) == "string" then + local ref = _G[font] + + if not ref or type(ref) ~= "table" or type(ref.IsObjectType) ~= "function" or not ref:IsObjectType("Font") then + bad = true + end + elseif type(font) ~= "table" or type(font.IsObjectType) ~= "function" or not font:IsObjectType("Font") then + bad = true + end + + if bad then + if silent then + return false + end + + error("font must be a Font instance or a string matching the name of a global Font instance, not: " .. tostring(font), level + 1) + end + return true + end + + function tipPrototype:SetFont(font) + local is_string = type(font) == "string" + + checkFont(font, 2) + self.regularFont = is_string and _G[font] or font + end + + function tipPrototype:SetHeaderFont(font) + local is_string = type(font) == "string" + + checkFont(font, 2) + self.headerFont = is_string and _G[font] or font + end + + -- TODO: fixed argument positions / remove checks for performance? + function tipPrototype:SetCell(lineNum, colNum, value, ...) + -- Mandatory argument checking + if type(lineNum) ~= "number" then + error("line number must be a number, not: " .. tostring(lineNum), 2) + elseif lineNum < 1 or lineNum > #self.lines then + error("line number out of range: " .. tostring(lineNum), 2) + elseif type(colNum) ~= "number" then + error("column number must be a number, not: " .. tostring(colNum), 2) + elseif colNum < 1 or colNum > #self.columns then + error("column number out of range: " .. tostring(colNum), 2) + end + + -- Variable argument checking + local font, justification, colSpan, provider + local i, arg = 1, ... + + if arg == nil or checkFont(arg, 2, true) then + i, font, arg = 2, ... + end + + if arg == nil or checkJustification(arg, 2, true) then + i, justification, arg = i + 1, select(i, ...) + end + + if arg == nil or type(arg) == "number" then + i, colSpan, arg = i + 1, select(i, ...) + end + + if arg == nil or type(arg) == "table" and type(arg.AcquireCell) == "function" then + i, provider = i + 1, arg + end + + return _SetCell(self, lineNum, colNum, value, font, justification, colSpan, provider, select(i, ...)) + end +end -- do-block + +function tipPrototype:GetFont() + return self.regularFont +end + +function tipPrototype:GetHeaderFont() + return self.headerFont +end + +function tipPrototype:GetLineCount() + return #self.lines +end + +function tipPrototype:GetColumnCount() + return #self.columns +end + +------------------------------------------------------------------------------ +-- Frame Scripts +------------------------------------------------------------------------------ +local scripts = { + OnEnter = function(frame, ...) + highlightFrame:SetParent(frame) + highlightFrame:SetAllPoints(frame) + highlightFrame:Show() + + if frame._OnEnter_func then + frame:_OnEnter_func(frame._OnEnter_arg, ...) + end + end, + OnLeave = function(frame, ...) + highlightFrame:Hide() + highlightFrame:ClearAllPoints() + highlightFrame:SetParent(nil) + + if frame._OnLeave_func then + frame:_OnLeave_func(frame._OnLeave_arg, ...) + end + end, + OnMouseDown = function(frame, ...) + frame:_OnMouseDown_func(frame._OnMouseDown_arg, ...) + end, + OnMouseUp = function(frame, ...) + frame:_OnMouseUp_func(frame._OnMouseUp_arg, ...) + end, + OnReceiveDrag = function(frame, ...) + frame:_OnReceiveDrag_func(frame._OnReceiveDrag_arg, ...) + end +} + +function SetFrameScript(frame, script, func, arg) + if not scripts[script] then + return + end + + frame["_" .. script .. "_func"] = func + frame["_" .. script .. "_arg"] = arg + + if script == "OnMouseDown" or script == "OnMouseUp" or script == "OnReceiveDrag" then + if func then + frame:SetScript(script, scripts[script]) + else + frame:SetScript(script, nil) + end + end + + -- if at least one script is set, set the OnEnter/OnLeave scripts for the highlight + if frame._OnEnter_func or frame._OnLeave_func or frame._OnMouseDown_func or frame._OnMouseUp_func or frame._OnReceiveDrag_func then + frame:EnableMouse(true) + frame:SetScript("OnEnter", scripts.OnEnter) + frame:SetScript("OnLeave", scripts.OnLeave) + else + frame:EnableMouse(false) + frame:SetScript("OnEnter", nil) + frame:SetScript("OnLeave", nil) + end +end + +function ClearFrameScripts(frame) + if frame._OnEnter_func or frame._OnLeave_func or frame._OnMouseDown_func or frame._OnMouseUp_func or frame._OnReceiveDrag_func then + frame:EnableMouse(false) + + frame:SetScript("OnEnter", nil) + frame._OnEnter_func = nil + frame._OnEnter_arg = nil + + frame:SetScript("OnLeave", nil) + frame._OnLeave_func = nil + frame._OnLeave_arg = nil + + frame:SetScript("OnReceiveDrag", nil) + frame._OnReceiveDrag_func = nil + frame._OnReceiveDrag_arg = nil + + frame:SetScript("OnMouseDown", nil) + frame._OnMouseDown_func = nil + frame._OnMouseDown_arg = nil + + frame:SetScript("OnMouseUp", nil) + frame._OnMouseUp_func = nil + frame._OnMouseUp_arg = nil + end +end + +function tipPrototype:SetLineScript(lineNum, script, func, arg) + SetFrameScript(self.lines[lineNum], script, func, arg) +end + +function tipPrototype:SetColumnScript(colNum, script, func, arg) + SetFrameScript(self.columns[colNum], script, func, arg) +end + +function tipPrototype:SetCellScript(lineNum, colNum, script, func, arg) + local cell = self.lines[lineNum].cells[colNum] + + if cell then + SetFrameScript(cell, script, func, arg) + end +end + +------------------------------------------------------------------------------ +-- Auto-hiding feature +------------------------------------------------------------------------------ + +-- Script of the auto-hiding child frame +local function AutoHideTimerFrame_OnUpdate(self, elapsed) + self.checkElapsed = self.checkElapsed + elapsed + + if self.checkElapsed > 0.1 then + if self.parent:IsMouseOver() or (self.alternateFrame and self.alternateFrame:IsMouseOver()) then + self.elapsed = 0 + else + self.elapsed = self.elapsed + self.checkElapsed + + if self.elapsed >= self.delay then + lib:Release(self.parent) + end + end + + self.checkElapsed = 0 + end +end + +-- Usage: +-- :SetAutoHideDelay(0.25) => hides after 0.25sec outside of the tooltip +-- :SetAutoHideDelay(0.25, someFrame) => hides after 0.25sec outside of both the tooltip and someFrame +-- :SetAutoHideDelay() => disable auto-hiding (default) +function tipPrototype:SetAutoHideDelay(delay, alternateFrame, releaseHandler) + local timerFrame = self.autoHideTimerFrame + delay = tonumber(delay) or 0 + + if releaseHandler then + if type(releaseHandler) ~= "function" then + error("releaseHandler must be a function", 2) + end + + lib.onReleaseHandlers[self] = releaseHandler + end + + if delay > 0 then + if not timerFrame then + timerFrame = AcquireTimer(self) + timerFrame:SetScript("OnUpdate", AutoHideTimerFrame_OnUpdate) + + self.autoHideTimerFrame = timerFrame + end + + timerFrame.parent = self + timerFrame.checkElapsed = 0 + timerFrame.elapsed = 0 + timerFrame.delay = delay + timerFrame.alternateFrame = alternateFrame + timerFrame:Show() + elseif timerFrame then + self.autoHideTimerFrame = nil + + timerFrame.alternateFrame = nil + timerFrame:SetScript("OnUpdate", nil) + + ReleaseTimer(timerFrame) + end +end + +------------------------------------------------------------------------------ +-- "Smart" Anchoring +------------------------------------------------------------------------------ +local function GetTipAnchor(frame) + local x, y = frame:GetCenter() + + if not x or not y then + return "TOPLEFT", "BOTTOMLEFT" + end + + local hhalf = (x > UIParent:GetWidth() * 2 / 3) and "RIGHT" or (x < UIParent:GetWidth() / 3) and "LEFT" or "" + local vhalf = (y > UIParent:GetHeight() / 2) and "TOP" or "BOTTOM" + + return vhalf .. hhalf, frame, (vhalf == "TOP" and "BOTTOM" or "TOP") .. hhalf +end + +function tipPrototype:SmartAnchorTo(frame) + if not frame then + error("Invalid frame provided.", 2) + end + + self:ClearAllPoints() + self:SetClampedToScreen(true) + self:SetPoint(GetTipAnchor(frame)) +end + +------------------------------------------------------------------------------ +-- Debug slashcmds +------------------------------------------------------------------------------ +-- @debug @ +local print = print +local function PrintStats() + local tipCache = tostring(#tooltipHeap) + local frameCache = tostring(#frameHeap) + local tableCache = tostring(#tableHeap) + local header = false + + print("Tooltips used: " .. usedTooltips .. ", Cached: " .. tipCache .. ", Total: " .. tipCache + usedTooltips) + print("Frames used: " .. usedFrames .. ", Cached: " .. frameCache .. ", Total: " .. frameCache + usedFrames) + print("Tables used: " .. usedTables .. ", Cached: " .. tableCache .. ", Total: " .. tableCache + usedTables) + + for k in pairs(activeTooltips) do + if not header then + print("Active tooltips:") + header = true + end + print("- " .. k) + end +end + +SLASH_LibQTip1 = "/qtip" +_G.SlashCmdList["LibQTip"] = PrintStats +--@end-debug@]==] diff --git a/Titan/libs/Ace/LibQTip-1.0/LibQTip-1.0.toc b/Titan/libs/Ace/LibQTip-1.0/LibQTip-1.0.toc index 42fd94e..d7d75e8 100644 --- a/Titan/libs/Ace/LibQTip-1.0/LibQTip-1.0.toc +++ b/Titan/libs/Ace/LibQTip-1.0/LibQTip-1.0.toc @@ -1,15 +1,15 @@ -## Interface: 100007 -## Title: Lib: QTip-1.0 -## Notes: Library providing multi-column tooltips. -## Author: Torhal, Adirelle, Elkano, Tristanian -## Version: 10.0.7.1 -## LoadOnDemand: 1 -## X-Credits: Kaelten (input on initial design) -## X-Category: Library, Tooltip -## X-Curse-Project-ID: 15487 -## X-Date: 2023-03-29T21:01:29Z -## X-License: Ace3 BSD-like license -## X-Website: http://www.wowace.com/addons/libqtip-1-0/ - -LibStub\LibStub.lua -lib.xml +## Interface: 100007 +## Title: Lib: QTip-1.0 +## Notes: Library providing multi-column tooltips. +## Author: Torhal, Adirelle, Elkano, Tristanian +## Version: 10.0.7.1 +## LoadOnDemand: 1 +## X-Credits: Kaelten (input on initial design) +## X-Category: Library, Tooltip +## X-Curse-Project-ID: 15487 +## X-Date: 2023-03-29T21:01:29Z +## X-License: Ace3 BSD-like license +## X-Website: http://www.wowace.com/addons/libqtip-1-0/ + +LibStub\LibStub.lua +lib.xml diff --git a/Titan/libs/Ace/LibQTip-1.0/LibStub/LibStub.lua b/Titan/libs/Ace/LibQTip-1.0/LibStub/LibStub.lua index 7e9b5cd..7e7b76d 100644 --- a/Titan/libs/Ace/LibQTip-1.0/LibStub/LibStub.lua +++ b/Titan/libs/Ace/LibQTip-1.0/LibStub/LibStub.lua @@ -1,51 +1,51 @@ --- $Id: LibStub.lua 103 2014-10-16 03:02:50Z mikk $ --- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/addons/libstub/ for more info --- LibStub is hereby placed in the Public Domain --- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke -local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS! -local LibStub = _G[LIBSTUB_MAJOR] - --- Check to see is this version of the stub is obsolete -if not LibStub or LibStub.minor < LIBSTUB_MINOR then - LibStub = LibStub or {libs = {}, minors = {} } - _G[LIBSTUB_MAJOR] = LibStub - LibStub.minor = LIBSTUB_MINOR - - -- LibStub:NewLibrary(major, minor) - -- major (string) - the major version of the library - -- minor (string or number ) - the minor version of the library - -- - -- returns nil if a newer or same version of the lib is already present - -- returns empty library object or old library object if upgrade is needed - function LibStub:NewLibrary(major, minor) - assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)") - minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.") - - local oldminor = self.minors[major] - if oldminor and oldminor >= minor then return nil end - self.minors[major], self.libs[major] = minor, self.libs[major] or {} - return self.libs[major], oldminor - end - - -- LibStub:GetLibrary(major, [silent]) - -- major (string) - the major version of the library - -- silent (boolean) - if true, library is optional, silently return nil if its not found - -- - -- throws an error if the library can not be found (except silent is set) - -- returns the library object if found - function LibStub:GetLibrary(major, silent) - if not self.libs[major] and not silent then - error(("Cannot find a library instance of %q."):format(tostring(major)), 2) - end - return self.libs[major], self.minors[major] - end - - -- LibStub:IterateLibraries() - -- - -- Returns an iterator for the currently registered libraries - function LibStub:IterateLibraries() - return pairs(self.libs) - end - - setmetatable(LibStub, { __call = LibStub.GetLibrary }) -end +-- $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/LibQTip-1.0/README.md b/Titan/libs/Ace/LibQTip-1.0/README.md index 61f5162..b61c509 100644 --- a/Titan/libs/Ace/LibQTip-1.0/README.md +++ b/Titan/libs/Ace/LibQTip-1.0/README.md @@ -1,30 +1,30 @@ -# LibQTip-1.0 -LibQTip is designed replace GameTooltip - but with added functionality, such as multiple columns - from a minimalist design perspective. - -## Features -- Ability to display and handle multiple tooltips at the same time, -- Unlimited number of columns and lines, -- Column default and per cell justification, -- Tooltip default and per cell font setting, -- Colspans, -- Possibility to add custom cells, -- Optional scrollbar, -- Optional scripts for lines, columns, or cells, -- Optional automatic hiding, -- Frames and tables recycling to reduce resource footprint. - -## Caveats -Look [here](https://www.wowace.com/projects/libqtip-1-0/pages/getting-started) for information on embedding the latest beta/release. - -**In order to achieve effective frame recycling, tooltips must be released.** - -Holding a tooltip leads to the creation of a full set of frames for every AddOn which does not follow this practice. Moreover, releasing a tooltip has a very little overhead compared to its benefits. - -## Known issues -Alignment may be altered when using :SetScale after filling the tooltip. - -## Documentation -- [Getting Started Guide](https://www.wowace.com/projects/libqtip-1-0/pages/getting-started) -- [How to Add Custom Cells](https://www.wowace.com/projects/libqtip-1-0/pages/how-to-add-custom-cells) -- [API Reference](https://www.wowace.com/projects/libqtip-1-0/pages/api-reference) -- [Standard CellProvider API](https://www.wowace.com/projects/libqtip-1-0/pages/standard-cell-provider-api) +# LibQTip-1.0 +LibQTip is designed replace GameTooltip - but with added functionality, such as multiple columns - from a minimalist design perspective. + +## Features +- Ability to display and handle multiple tooltips at the same time, +- Unlimited number of columns and lines, +- Column default and per cell justification, +- Tooltip default and per cell font setting, +- Colspans, +- Possibility to add custom cells, +- Optional scrollbar, +- Optional scripts for lines, columns, or cells, +- Optional automatic hiding, +- Frames and tables recycling to reduce resource footprint. + +## Caveats +Look [here](https://www.wowace.com/projects/libqtip-1-0/pages/getting-started) for information on embedding the latest beta/release. + +**In order to achieve effective frame recycling, tooltips must be released.** + +Holding a tooltip leads to the creation of a full set of frames for every AddOn which does not follow this practice. Moreover, releasing a tooltip has a very little overhead compared to its benefits. + +## Known issues +Alignment may be altered when using :SetScale after filling the tooltip. + +## Documentation +- [Getting Started Guide](https://www.wowace.com/projects/libqtip-1-0/pages/getting-started) +- [How to Add Custom Cells](https://www.wowace.com/projects/libqtip-1-0/pages/how-to-add-custom-cells) +- [API Reference](https://www.wowace.com/projects/libqtip-1-0/pages/api-reference) +- [Standard CellProvider API](https://www.wowace.com/projects/libqtip-1-0/pages/standard-cell-provider-api) diff --git a/Titan/libs/Ace/LibQTip-1.0/lib.xml b/Titan/libs/Ace/LibQTip-1.0/lib.xml index 5531be0..f212246 100644 --- a/Titan/libs/Ace/LibQTip-1.0/lib.xml +++ b/Titan/libs/Ace/LibQTip-1.0/lib.xml @@ -1,4 +1,4 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ -..\FrameXML\UI.xsd"> - <Script file="LibQTip-1.0.lua"/> +<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ +..\FrameXML\UI.xsd"> + <Script file="LibQTip-1.0.lua"/> </Ui> \ No newline at end of file diff --git a/Titan/libs/Ace/LibSharedMedia-3.0/CHANGES.txt b/Titan/libs/Ace/LibSharedMedia-3.0/CHANGES.txt deleted file mode 100644 index 98dd1b2..0000000 --- a/Titan/libs/Ace/LibSharedMedia-3.0/CHANGES.txt +++ /dev/null @@ -1,8 +0,0 @@ ------------------------------------------------------------------------- -r154 | funkehdude | 2024-11-20 16:58:47 +0000 (Wed, 20 Nov 2024) | 1 line -Changed paths: - M /trunk/LibSharedMedia-3.0.toc - -bump toc ------------------------------------------------------------------------- - diff --git a/Titan/libs/Ace/LibSharedMedia-3.0/CallbackHandler-1.0/CallbackHandler-1.0.lua b/Titan/libs/Ace/LibSharedMedia-3.0/CallbackHandler-1.0/CallbackHandler-1.0.lua deleted file mode 100644 index 21569f4..0000000 --- a/Titan/libs/Ace/LibSharedMedia-3.0/CallbackHandler-1.0/CallbackHandler-1.0.lua +++ /dev/null @@ -1,202 +0,0 @@ ---[[ $Id: CallbackHandler-1.0.lua 26 2022-12-12 15:09:39Z nevcairiel $ ]] -local MAJOR, MINOR = "CallbackHandler-1.0", 8 -local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR) - -if not CallbackHandler then return end -- No upgrade needed - -local meta = {__index = function(tbl, key) tbl[key] = {} return tbl[key] end} - --- Lua APIs -local securecallfunction, error = securecallfunction, error -local setmetatable, rawget = setmetatable, rawget -local next, select, pairs, type, tostring = next, select, pairs, type, tostring - - -local function Dispatch(handlers, ...) - local index, method = next(handlers) - if not method then return end - repeat - securecallfunction(method, ...) - index, method = next(handlers, index) - until not method -end - --------------------------------------------------------------------------- --- CallbackHandler:New --- --- target - target object to embed public APIs in --- RegisterName - name of the callback registration API, default "RegisterCallback" --- UnregisterName - name of the callback unregistration API, default "UnregisterCallback" --- UnregisterAllName - name of the API to unregister all callbacks, default "UnregisterAllCallbacks". false == don't publish this API. - -function CallbackHandler.New(_self, target, RegisterName, UnregisterName, UnregisterAllName) - - RegisterName = RegisterName or "RegisterCallback" - UnregisterName = UnregisterName or "UnregisterCallback" - if UnregisterAllName==nil then -- false is used to indicate "don't want this method" - UnregisterAllName = "UnregisterAllCallbacks" - end - - -- we declare all objects and exported APIs inside this closure to quickly gain access - -- to e.g. function names, the "target" parameter, etc - - - -- Create the registry object - local events = setmetatable({}, meta) - local registry = { recurse=0, events=events } - - -- registry:Fire() - fires the given event/message into the registry - function registry:Fire(eventname, ...) - if not rawget(events, eventname) or not next(events[eventname]) then return end - local oldrecurse = registry.recurse - registry.recurse = oldrecurse + 1 - - Dispatch(events[eventname], eventname, ...) - - registry.recurse = oldrecurse - - if registry.insertQueue and oldrecurse==0 then - -- Something in one of our callbacks wanted to register more callbacks; they got queued - for event,callbacks in pairs(registry.insertQueue) do - local first = not rawget(events, event) or not next(events[event]) -- test for empty before. not test for one member after. that one member may have been overwritten. - for object,func in pairs(callbacks) do - events[event][object] = func - -- fire OnUsed callback? - if first and registry.OnUsed then - registry.OnUsed(registry, target, event) - first = nil - end - end - end - registry.insertQueue = nil - end - end - - -- Registration of a callback, handles: - -- self["method"], leads to self["method"](self, ...) - -- self with function ref, leads to functionref(...) - -- "addonId" (instead of self) with function ref, leads to functionref(...) - -- all with an optional arg, which, if present, gets passed as first argument (after self if present) - target[RegisterName] = function(self, eventname, method, ... --[[actually just a single arg]]) - if type(eventname) ~= "string" then - error("Usage: "..RegisterName.."(eventname, method[, arg]): 'eventname' - string expected.", 2) - end - - method = method or eventname - - local first = not rawget(events, eventname) or not next(events[eventname]) -- test for empty before. not test for one member after. that one member may have been overwritten. - - if type(method) ~= "string" and type(method) ~= "function" then - error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): 'methodname' - string or function expected.", 2) - end - - local regfunc - - if type(method) == "string" then - -- self["method"] calling style - if type(self) ~= "table" then - error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): self was not a table?", 2) - elseif self==target then - error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): do not use Library:"..RegisterName.."(), use your own 'self'", 2) - elseif type(self[method]) ~= "function" then - error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): 'methodname' - method '"..tostring(method).."' not found on self.", 2) - end - - if select("#",...)>=1 then -- this is not the same as testing for arg==nil! - local arg=select(1,...) - regfunc = function(...) self[method](self,arg,...) end - else - regfunc = function(...) self[method](self,...) end - end - else - -- function ref with self=object or self="addonId" or self=thread - if type(self)~="table" and type(self)~="string" and type(self)~="thread" then - error("Usage: "..RegisterName.."(self or \"addonId\", eventname, method): 'self or addonId': table or string or thread expected.", 2) - end - - if select("#",...)>=1 then -- this is not the same as testing for arg==nil! - local arg=select(1,...) - regfunc = function(...) method(arg,...) end - else - regfunc = method - end - end - - - if events[eventname][self] or registry.recurse<1 then - -- if registry.recurse<1 then - -- we're overwriting an existing entry, or not currently recursing. just set it. - events[eventname][self] = regfunc - -- fire OnUsed callback? - if registry.OnUsed and first then - registry.OnUsed(registry, target, eventname) - end - else - -- we're currently processing a callback in this registry, so delay the registration of this new entry! - -- yes, we're a bit wasteful on garbage, but this is a fringe case, so we're picking low implementation overhead over garbage efficiency - registry.insertQueue = registry.insertQueue or setmetatable({},meta) - registry.insertQueue[eventname][self] = regfunc - end - end - - -- Unregister a callback - target[UnregisterName] = function(self, eventname) - if not self or self==target then - error("Usage: "..UnregisterName.."(eventname): bad 'self'", 2) - end - if type(eventname) ~= "string" then - error("Usage: "..UnregisterName.."(eventname): 'eventname' - string expected.", 2) - end - if rawget(events, eventname) and events[eventname][self] then - events[eventname][self] = nil - -- Fire OnUnused callback? - if registry.OnUnused and not next(events[eventname]) then - registry.OnUnused(registry, target, eventname) - end - end - if registry.insertQueue and rawget(registry.insertQueue, eventname) and registry.insertQueue[eventname][self] then - registry.insertQueue[eventname][self] = nil - end - end - - -- OPTIONAL: Unregister all callbacks for given selfs/addonIds - if UnregisterAllName then - target[UnregisterAllName] = function(...) - if select("#",...)<1 then - error("Usage: "..UnregisterAllName.."([whatFor]): missing 'self' or \"addonId\" to unregister events for.", 2) - end - if select("#",...)==1 and ...==target then - error("Usage: "..UnregisterAllName.."([whatFor]): supply a meaningful 'self' or \"addonId\"", 2) - end - - - for i=1,select("#",...) do - local self = select(i,...) - if registry.insertQueue then - for eventname, callbacks in pairs(registry.insertQueue) do - if callbacks[self] then - callbacks[self] = nil - end - end - end - for eventname, callbacks in pairs(events) do - if callbacks[self] then - callbacks[self] = nil - -- Fire OnUnused callback? - if registry.OnUnused and not next(callbacks) then - registry.OnUnused(registry, target, eventname) - end - end - end - end - end - end - - return registry -end - - --- CallbackHandler purposefully does NOT do explicit embedding. Nor does it --- try to upgrade old implicit embeds since the system is selfcontained and --- relies on closures to work. - diff --git a/Titan/libs/Ace/LibSharedMedia-3.0/LibSharedMedia-3.0.toc b/Titan/libs/Ace/LibSharedMedia-3.0/LibSharedMedia-3.0.toc deleted file mode 100644 index 61ff4fb..0000000 --- a/Titan/libs/Ace/LibSharedMedia-3.0/LibSharedMedia-3.0.toc +++ /dev/null @@ -1,18 +0,0 @@ -## Interface: 11504, 11505, 20504, 30403, 40400, 40401, 110005, 110007, 110002 -## LoadOnDemand: 1 - -## Title: Lib: SharedMedia-3.0 -## Notes: Shared handling of media data (fonts, sounds, textures, ...) between addons. -## Author: Elkano -## Version: 3.0-154 -## X-Website: https://www.curseforge.com/wow/addons/libsharedmedia-3-0 -## X-Category: Library - -## X-Revision: 154 -## X-Date: 2024-11-20T16:58:47Z - -LibStub\LibStub.lua -CallbackHandler-1.0\CallbackHandler-1.0.lua - -LibSharedMedia-3.0\lib.xml - diff --git a/Titan/libs/Ace/LibSharedMedia-3.0/LibSharedMedia-3.0/LibSharedMedia-3.0.lua b/Titan/libs/Ace/LibSharedMedia-3.0/LibSharedMedia-3.0/LibSharedMedia-3.0.lua deleted file mode 100644 index 94ee292..0000000 --- a/Titan/libs/Ace/LibSharedMedia-3.0/LibSharedMedia-3.0/LibSharedMedia-3.0.lua +++ /dev/null @@ -1,299 +0,0 @@ ---@curseforge-project-slug: libsharedmedia-3-0@ ---[[ -Name: LibSharedMedia-3.0 -Revision: $Revision: 151 $ -Author: Elkano (elkano@gmx.de) -Inspired By: SurfaceLib by Haste/Otravi (troeks@gmail.com) -Website: http://www.wowace.com/projects/libsharedmedia-3-0/ -Description: Shared handling of media data (fonts, sounds, textures, ...) between addons. -Dependencies: LibStub, CallbackHandler-1.0 -License: LGPL v2.1 -]] - -local MAJOR, MINOR = "LibSharedMedia-3.0", 8020003 -- 8.2.0 v3 / increase manually on changes -local lib = LibStub:NewLibrary(MAJOR, MINOR) - -if not lib then return end - -local _G = getfenv(0) - -local pairs = _G.pairs -local type = _G.type - -local band = _G.bit.band -local table_sort = _G.table.sort - -local locale = GetLocale() -local locale_is_western -local LOCALE_MASK -lib.LOCALE_BIT_koKR = 1 -lib.LOCALE_BIT_ruRU = 2 -lib.LOCALE_BIT_zhCN = 4 -lib.LOCALE_BIT_zhTW = 8 -lib.LOCALE_BIT_western = 128 - -local CallbackHandler = LibStub:GetLibrary("CallbackHandler-1.0") - -lib.callbacks = lib.callbacks or CallbackHandler:New(lib) - -lib.DefaultMedia = lib.DefaultMedia or {} -lib.MediaList = lib.MediaList or {} -lib.MediaTable = lib.MediaTable or {} -lib.MediaType = lib.MediaType or {} -lib.OverrideMedia = lib.OverrideMedia or {} - -local defaultMedia = lib.DefaultMedia -local mediaList = lib.MediaList -local mediaTable = lib.MediaTable -local overrideMedia = lib.OverrideMedia - - --- create mediatype constants -lib.MediaType.BACKGROUND = "background" -- background textures -lib.MediaType.BORDER = "border" -- border textures -lib.MediaType.FONT = "font" -- fonts -lib.MediaType.STATUSBAR = "statusbar" -- statusbar textures -lib.MediaType.SOUND = "sound" -- sound files - --- populate lib with default Blizzard data --- BACKGROUND -if not lib.MediaTable.background then lib.MediaTable.background = {} end -lib.MediaTable.background["None"] = [[]] -lib.MediaTable.background["Blizzard Collections Background"] = [[Interface\Collections\CollectionsBackgroundTile]] -lib.MediaTable.background["Blizzard Dialog Background"] = [[Interface\DialogFrame\UI-DialogBox-Background]] -lib.MediaTable.background["Blizzard Dialog Background Dark"] = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]] -lib.MediaTable.background["Blizzard Dialog Background Gold"] = [[Interface\DialogFrame\UI-DialogBox-Gold-Background]] -lib.MediaTable.background["Blizzard Garrison Background"] = [[Interface\Garrison\GarrisonUIBackground]] -lib.MediaTable.background["Blizzard Garrison Background 2"] = [[Interface\Garrison\GarrisonUIBackground2]] -lib.MediaTable.background["Blizzard Garrison Background 3"] = [[Interface\Garrison\GarrisonMissionUIInfoBoxBackgroundTile]] -lib.MediaTable.background["Blizzard Low Health"] = [[Interface\FullScreenTextures\LowHealth]] -lib.MediaTable.background["Blizzard Marble"] = [[Interface\FrameGeneral\UI-Background-Marble]] -lib.MediaTable.background["Blizzard Out of Control"] = [[Interface\FullScreenTextures\OutOfControl]] -lib.MediaTable.background["Blizzard Parchment"] = [[Interface\AchievementFrame\UI-Achievement-Parchment-Horizontal]] -lib.MediaTable.background["Blizzard Parchment 2"] = [[Interface\AchievementFrame\UI-GuildAchievement-Parchment-Horizontal]] -lib.MediaTable.background["Blizzard Rock"] = [[Interface\FrameGeneral\UI-Background-Rock]] -lib.MediaTable.background["Blizzard Tabard Background"] = [[Interface\TabardFrame\TabardFrameBackground]] -lib.MediaTable.background["Blizzard Tooltip"] = [[Interface\Tooltips\UI-Tooltip-Background]] -lib.MediaTable.background["Solid"] = [[Interface\Buttons\WHITE8X8]] -lib.DefaultMedia.background = "None" - --- BORDER -if not lib.MediaTable.border then lib.MediaTable.border = {} end -lib.MediaTable.border["None"] = [[]] -lib.MediaTable.border["Blizzard Achievement Wood"] = [[Interface\AchievementFrame\UI-Achievement-WoodBorder]] -lib.MediaTable.border["Blizzard Chat Bubble"] = [[Interface\Tooltips\ChatBubble-Backdrop]] -lib.MediaTable.border["Blizzard Dialog"] = [[Interface\DialogFrame\UI-DialogBox-Border]] -lib.MediaTable.border["Blizzard Dialog Gold"] = [[Interface\DialogFrame\UI-DialogBox-Gold-Border]] -lib.MediaTable.border["Blizzard Party"] = [[Interface\CHARACTERFRAME\UI-Party-Border]] -lib.MediaTable.border["Blizzard Tooltip"] = [[Interface\Tooltips\UI-Tooltip-Border]] -lib.DefaultMedia.border = "None" - --- FONT -if not lib.MediaTable.font then lib.MediaTable.font = {} end -local SML_MT_font = lib.MediaTable.font ---[[ -All font files are currently in all clients, the following table depicts which font supports which charset as of 5.0.4 -Fonts were checked using langcover.pl from DejaVu fonts (http://sourceforge.net/projects/dejavu/) and FontForge (http://fontforge.org/) -latin means check for: de, en, es, fr, it, pt - -file name latin koKR ruRU zhCN zhTW -2002.ttf 2002 X X X - - -2002B.ttf 2002 Bold X X X - - -ARHei.ttf AR CrystalzcuheiGBK Demibold X - X X X -ARIALN.TTF Arial Narrow X - X - - -ARKai_C.ttf AR ZhongkaiGBK Medium (Combat) X - X X X -ARKai_T.ttf AR ZhongkaiGBK Medium X - X X X -bHEI00M.ttf AR Heiti2 Medium B5 - - - - X -bHEI01B.ttf AR Heiti2 Bold B5 - - - - X -bKAI00M.ttf AR Kaiti Medium B5 - - - - X -bLEI00D.ttf AR Leisu Demi B5 - - - - X -FRIZQT__.TTF Friz Quadrata TT X - - - - -FRIZQT___CYR.TTF FrizQuadrataCTT x - X - - -K_Damage.TTF YDIWingsM - X X - - -K_Pagetext.TTF MoK X X X - - -MORPHEUS.TTF Morpheus X - - - - -MORPHEUS_CYR.TTF Morpheus X - X - - -NIM_____.ttf Nimrod MT X - X - - -SKURRI.TTF Skurri X - - - - -SKURRI_CYR.TTF Skurri X - X - - - -WARNING: Although FRIZQT___CYR is available on western clients, it doesn't support special European characters e.g. é, ï, ö -Due to this, we cannot use it as a replacement for FRIZQT__.TTF -]] - -if locale == "koKR" then - LOCALE_MASK = lib.LOCALE_BIT_koKR --- - SML_MT_font["굵은 글꼴"] = [[Fonts\2002B.TTF]] - SML_MT_font["기본 글꼴"] = [[Fonts\2002.TTF]] - SML_MT_font["데미지 글꼴"] = [[Fonts\K_Damage.TTF]] - SML_MT_font["퀘스트 글꼴"] = [[Fonts\K_Pagetext.TTF]] --- - lib.DefaultMedia["font"] = "기본 글꼴" -- someone from koKR please adjust if needed --- -elseif locale == "zhCN" then - LOCALE_MASK = lib.LOCALE_BIT_zhCN --- - SML_MT_font["伤害数字"] = [[Fonts\ARKai_C.ttf]] - SML_MT_font["默认"] = [[Fonts\ARKai_T.ttf]] - SML_MT_font["聊天"] = [[Fonts\ARHei.ttf]] --- - lib.DefaultMedia["font"] = "默认" -- someone from zhCN please adjust if needed --- -elseif locale == "zhTW" then - LOCALE_MASK = lib.LOCALE_BIT_zhTW --- - SML_MT_font["提示訊息"] = [[Fonts\bHEI00M.ttf]] - SML_MT_font["聊天"] = [[Fonts\bHEI01B.ttf]] - SML_MT_font["傷害數字"] = [[Fonts\bKAI00M.ttf]] - SML_MT_font["預設"] = [[Fonts\bLEI00D.ttf]] --- - lib.DefaultMedia["font"] = "預設" -- someone from zhTW please adjust if needed - -elseif locale == "ruRU" then - LOCALE_MASK = lib.LOCALE_BIT_ruRU --- - SML_MT_font["2002"] = [[Fonts\2002.TTF]] - SML_MT_font["2002 Bold"] = [[Fonts\2002B.TTF]] - SML_MT_font["AR CrystalzcuheiGBK Demibold"] = [[Fonts\ARHei.TTF]] - SML_MT_font["AR ZhongkaiGBK Medium (Combat)"] = [[Fonts\ARKai_C.TTF]] - SML_MT_font["AR ZhongkaiGBK Medium"] = [[Fonts\ARKai_T.TTF]] - SML_MT_font["Arial Narrow"] = [[Fonts\ARIALN.TTF]] - SML_MT_font["Friz Quadrata TT"] = [[Fonts\FRIZQT___CYR.TTF]] - SML_MT_font["MoK"] = [[Fonts\K_Pagetext.TTF]] - SML_MT_font["Morpheus"] = [[Fonts\MORPHEUS_CYR.TTF]] - SML_MT_font["Nimrod MT"] = [[Fonts\NIM_____.ttf]] - SML_MT_font["Skurri"] = [[Fonts\SKURRI_CYR.TTF]] --- - lib.DefaultMedia.font = "Friz Quadrata TT" --- -else - LOCALE_MASK = lib.LOCALE_BIT_western - locale_is_western = true --- - SML_MT_font["2002"] = [[Fonts\2002.TTF]] - SML_MT_font["2002 Bold"] = [[Fonts\2002B.TTF]] - SML_MT_font["AR CrystalzcuheiGBK Demibold"] = [[Fonts\ARHei.TTF]] - SML_MT_font["AR ZhongkaiGBK Medium (Combat)"] = [[Fonts\ARKai_C.TTF]] - SML_MT_font["AR ZhongkaiGBK Medium"] = [[Fonts\ARKai_T.TTF]] - SML_MT_font["Arial Narrow"] = [[Fonts\ARIALN.TTF]] - SML_MT_font["Friz Quadrata TT"] = [[Fonts\FRIZQT__.TTF]] - SML_MT_font["MoK"] = [[Fonts\K_Pagetext.TTF]] - SML_MT_font["Morpheus"] = [[Fonts\MORPHEUS_CYR.TTF]] - SML_MT_font["Nimrod MT"] = [[Fonts\NIM_____.ttf]] - SML_MT_font["Skurri"] = [[Fonts\SKURRI_CYR.TTF]] --- - lib.DefaultMedia.font = "Friz Quadrata TT" --- -end - --- STATUSBAR -if not lib.MediaTable.statusbar then lib.MediaTable.statusbar = {} end -lib.MediaTable.statusbar["Blizzard"] = [[Interface\TargetingFrame\UI-StatusBar]] -lib.MediaTable.statusbar["Blizzard Character Skills Bar"] = [[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]] -lib.MediaTable.statusbar["Blizzard Raid Bar"] = [[Interface\RaidFrame\Raid-Bar-Hp-Fill]] -lib.MediaTable.statusbar["Solid"] = [[Interface\Buttons\WHITE8X8]] -lib.DefaultMedia.statusbar = "Blizzard" - --- SOUND -if not lib.MediaTable.sound then lib.MediaTable.sound = {} end -lib.MediaTable.sound["None"] = 1 -- Relies on the fact that PlaySoundFile doesn't error on this value -lib.DefaultMedia.sound = "None" - -local function rebuildMediaList(mediatype) - local mtable = mediaTable[mediatype] - if not mtable then return end - if not mediaList[mediatype] then mediaList[mediatype] = {} end - local mlist = mediaList[mediatype] - -- list can only get larger, so simply overwrite it - local i = 0 - for k in pairs(mtable) do - i = i + 1 - mlist[i] = k - end - table_sort(mlist) -end - -function lib:Register(mediatype, key, data, langmask) - if type(mediatype) ~= "string" then - error(MAJOR..":Register(mediatype, key, data, langmask) - mediatype must be string, got "..type(mediatype)) - end - if type(key) ~= "string" then - error(MAJOR..":Register(mediatype, key, data, langmask) - key must be string, got "..type(key)) - end - mediatype = mediatype:lower() - if mediatype == lib.MediaType.FONT and ((langmask and band(langmask, LOCALE_MASK) == 0) or not (langmask or locale_is_western)) then - -- ignore fonts that aren't flagged as supporting local glyphs on non-western clients - return false - end - if type(data) == "string" and (mediatype == lib.MediaType.BACKGROUND or mediatype == lib.MediaType.BORDER or mediatype == lib.MediaType.STATUSBAR or mediatype == lib.MediaType.SOUND) then - local path = data:lower() - if not path:find("^interface") then - -- files accessed via path only allowed from interface folder - return false - end - if mediatype == lib.MediaType.SOUND and not (path:find(".ogg", nil, true) or path:find(".mp3", nil, true)) then - -- Only ogg and mp3 are valid sounds. - return false - end - end - if not mediaTable[mediatype] then mediaTable[mediatype] = {} end - local mtable = mediaTable[mediatype] - if mtable[key] then return false end - - mtable[key] = data - rebuildMediaList(mediatype) - self.callbacks:Fire("LibSharedMedia_Registered", mediatype, key) - return true -end - -function lib:Fetch(mediatype, key, noDefault) - local mtt = mediaTable[mediatype] - local overridekey = overrideMedia[mediatype] - local result = mtt and ((overridekey and mtt[overridekey] or mtt[key]) or (not noDefault and defaultMedia[mediatype] and mtt[defaultMedia[mediatype]])) or nil - return result ~= "" and result or nil -end - -function lib:IsValid(mediatype, key) - return mediaTable[mediatype] and (not key or mediaTable[mediatype][key]) and true or false -end - -function lib:HashTable(mediatype) - return mediaTable[mediatype] -end - -function lib:List(mediatype) - if not mediaTable[mediatype] then - return nil - end - if not mediaList[mediatype] then - rebuildMediaList(mediatype) - end - return mediaList[mediatype] -end - -function lib:GetGlobal(mediatype) - return overrideMedia[mediatype] -end - -function lib:SetGlobal(mediatype, key) - if not mediaTable[mediatype] then - return false - end - overrideMedia[mediatype] = (key and mediaTable[mediatype][key]) and key or nil - self.callbacks:Fire("LibSharedMedia_SetGlobal", mediatype, overrideMedia[mediatype]) - return true -end - -function lib:GetDefault(mediatype) - return defaultMedia[mediatype] -end - -function lib:SetDefault(mediatype, key) - if mediaTable[mediatype] and mediaTable[mediatype][key] and not defaultMedia[mediatype] then - defaultMedia[mediatype] = key - return true - else - return false - end -end diff --git a/Titan/libs/Ace/LibSharedMedia-3.0/LibSharedMedia-3.0/lib.xml b/Titan/libs/Ace/LibSharedMedia-3.0/LibSharedMedia-3.0/lib.xml deleted file mode 100644 index 7f2fd53..0000000 --- a/Titan/libs/Ace/LibSharedMedia-3.0/LibSharedMedia-3.0/lib.xml +++ /dev/null @@ -1,4 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ -..\FrameXML\UI.xsd"> - <Script file="LibSharedMedia-3.0.lua" /> -</Ui> diff --git a/Titan/libs/Ace/LibSharedMedia-3.0/LibStub/LibStub.lua b/Titan/libs/Ace/LibSharedMedia-3.0/LibStub/LibStub.lua deleted file mode 100644 index ae1900e..0000000 --- a/Titan/libs/Ace/LibSharedMedia-3.0/LibStub/LibStub.lua +++ /dev/null @@ -1,51 +0,0 @@ --- $Id: LibStub.lua 76 2007-09-03 01:50:17Z mikk $ --- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/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/LibSharedMedia-3.0/lib.xml b/Titan/libs/Ace/LibSharedMedia-3.0/lib.xml deleted file mode 100644 index c81f35f..0000000 --- a/Titan/libs/Ace/LibSharedMedia-3.0/lib.xml +++ /dev/null @@ -1,5 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ -..\FrameXML\UI.xsd"> - <Include file="LibSharedMedia-3.0\lib.xml"/> -</Ui> - diff --git a/Titan/libs/Ace/changelog.txt b/Titan/libs/Ace/changelog.txt index 20e64ca..db97361 100644 --- a/Titan/libs/Ace/changelog.txt +++ b/Titan/libs/Ace/changelog.txt @@ -1,3 +1,12 @@ +Ace3 Release - Revision r1377 (October 28th, 2025) +-------------------------------------------------- +- AceComm-3.0: Updated ChatThrottleLib for WoW 12.0 +- AceConfigDialog-3.0: Consistently provide an alpha value for GameTooltip:SetText +- AceDB-3.0: Unloaded namespaces are handled when profiles are Reset, Copied, Deleted +- AceDB-3.0: Empty namespaces are cleaned up on database shutdown +- AceGUI-3.0: TreeGroup: Re-factor button hiding to help avoid bizarre button breakage +- AceGUI-3.0: EditBox: Fix InsertLink hook for WoW 12.0 + Ace3 Release - Revision r1349 (July 23th, 2024) ----------------------------------------------- - AceGUI-3.0: EditBoxes: Updated for WoW 11.0 API changes diff --git a/Titan/libs/LibDataBroker-1.1.lua b/Titan/libs/LibDataBroker-1.1.lua index f47c0cd..4182f2e 100644 --- a/Titan/libs/LibDataBroker-1.1.lua +++ b/Titan/libs/LibDataBroker-1.1.lua @@ -1,90 +1,90 @@ - -assert(LibStub, "LibDataBroker-1.1 requires LibStub") -assert(LibStub:GetLibrary("CallbackHandler-1.0", true), "LibDataBroker-1.1 requires CallbackHandler-1.0") - -local lib, oldminor = LibStub:NewLibrary("LibDataBroker-1.1", 4) -if not lib then return end -oldminor = oldminor or 0 - - -lib.callbacks = lib.callbacks or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib) -lib.attributestorage, lib.namestorage, lib.proxystorage = lib.attributestorage or {}, lib.namestorage or {}, lib.proxystorage or {} -local attributestorage, namestorage, callbacks = lib.attributestorage, lib.namestorage, lib.callbacks - -if oldminor < 2 then - lib.domt = { - __metatable = "access denied", - __index = function(self, key) return attributestorage[self] and attributestorage[self][key] end, - } -end - -if oldminor < 3 then - lib.domt.__newindex = function(self, key, value) - if not attributestorage[self] then attributestorage[self] = {} end - if attributestorage[self][key] == value then return end - attributestorage[self][key] = value - local name = namestorage[self] - if not name then return end - callbacks:Fire("LibDataBroker_AttributeChanged", name, key, value, self) - callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value, self) - callbacks:Fire("LibDataBroker_AttributeChanged_"..name.."_"..key, name, key, value, self) - callbacks:Fire("LibDataBroker_AttributeChanged__"..key, name, key, value, self) - end -end - -if oldminor < 2 then - function lib:NewDataObject(name, dataobj) - if self.proxystorage[name] then return end - - if dataobj then - assert(type(dataobj) == "table", "Invalid dataobj, must be nil or a table") - self.attributestorage[dataobj] = {} - for i,v in pairs(dataobj) do - self.attributestorage[dataobj][i] = v - dataobj[i] = nil - end - end - dataobj = setmetatable(dataobj or {}, self.domt) - self.proxystorage[name], self.namestorage[dataobj] = dataobj, name - self.callbacks:Fire("LibDataBroker_DataObjectCreated", name, dataobj) - return dataobj - end -end - -if oldminor < 1 then - function lib:DataObjectIterator() - return pairs(self.proxystorage) - end - - function lib:GetDataObjectByName(dataobjectname) - return self.proxystorage[dataobjectname] - end - - function lib:GetNameByDataObject(dataobject) - return self.namestorage[dataobject] - end -end - -if oldminor < 4 then - local next = pairs(attributestorage) - function lib:pairs(dataobject_or_name) - local t = type(dataobject_or_name) - assert(t == "string" or t == "table", "Usage: ldb:pairs('dataobjectname') or ldb:pairs(dataobject)") - - local dataobj = self.proxystorage[dataobject_or_name] or dataobject_or_name - assert(attributestorage[dataobj], "Data object not found") - - return next, attributestorage[dataobj], nil - end - - local ipairs_iter = ipairs(attributestorage) - function lib:ipairs(dataobject_or_name) - local t = type(dataobject_or_name) - assert(t == "string" or t == "table", "Usage: ldb:ipairs('dataobjectname') or ldb:ipairs(dataobject)") - - local dataobj = self.proxystorage[dataobject_or_name] or dataobject_or_name - assert(attributestorage[dataobj], "Data object not found") - - return ipairs_iter, attributestorage[dataobj], 0 - end -end + +assert(LibStub, "LibDataBroker-1.1 requires LibStub") +assert(LibStub:GetLibrary("CallbackHandler-1.0", true), "LibDataBroker-1.1 requires CallbackHandler-1.0") + +local lib, oldminor = LibStub:NewLibrary("LibDataBroker-1.1", 4) +if not lib then return end +oldminor = oldminor or 0 + + +lib.callbacks = lib.callbacks or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib) +lib.attributestorage, lib.namestorage, lib.proxystorage = lib.attributestorage or {}, lib.namestorage or {}, lib.proxystorage or {} +local attributestorage, namestorage, callbacks = lib.attributestorage, lib.namestorage, lib.callbacks + +if oldminor < 2 then + lib.domt = { + __metatable = "access denied", + __index = function(self, key) return attributestorage[self] and attributestorage[self][key] end, + } +end + +if oldminor < 3 then + lib.domt.__newindex = function(self, key, value) + if not attributestorage[self] then attributestorage[self] = {} end + if attributestorage[self][key] == value then return end + attributestorage[self][key] = value + local name = namestorage[self] + if not name then return end + callbacks:Fire("LibDataBroker_AttributeChanged", name, key, value, self) + callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value, self) + callbacks:Fire("LibDataBroker_AttributeChanged_"..name.."_"..key, name, key, value, self) + callbacks:Fire("LibDataBroker_AttributeChanged__"..key, name, key, value, self) + end +end + +if oldminor < 2 then + function lib:NewDataObject(name, dataobj) + if self.proxystorage[name] then return end + + if dataobj then + assert(type(dataobj) == "table", "Invalid dataobj, must be nil or a table") + self.attributestorage[dataobj] = {} + for i,v in pairs(dataobj) do + self.attributestorage[dataobj][i] = v + dataobj[i] = nil + end + end + dataobj = setmetatable(dataobj or {}, self.domt) + self.proxystorage[name], self.namestorage[dataobj] = dataobj, name + self.callbacks:Fire("LibDataBroker_DataObjectCreated", name, dataobj) + return dataobj + end +end + +if oldminor < 1 then + function lib:DataObjectIterator() + return pairs(self.proxystorage) + end + + function lib:GetDataObjectByName(dataobjectname) + return self.proxystorage[dataobjectname] + end + + function lib:GetNameByDataObject(dataobject) + return self.namestorage[dataobject] + end +end + +if oldminor < 4 then + local next = pairs(attributestorage) + function lib:pairs(dataobject_or_name) + local t = type(dataobject_or_name) + assert(t == "string" or t == "table", "Usage: ldb:pairs('dataobjectname') or ldb:pairs(dataobject)") + + local dataobj = self.proxystorage[dataobject_or_name] or dataobject_or_name + assert(attributestorage[dataobj], "Data object not found") + + return next, attributestorage[dataobj], nil + end + + local ipairs_iter = ipairs(attributestorage) + function lib:ipairs(dataobject_or_name) + local t = type(dataobject_or_name) + assert(t == "string" or t == "table", "Usage: ldb:ipairs('dataobjectname') or ldb:ipairs(dataobject)") + + local dataobj = self.proxystorage[dataobject_or_name] or dataobject_or_name + assert(attributestorage[dataobj], "Data object not found") + + return ipairs_iter, attributestorage[dataobj], 0 + end +end diff --git a/Titan/libs/LibSharedMedia-3.0/CHANGES.txt b/Titan/libs/LibSharedMedia-3.0/CHANGES.txt new file mode 100644 index 0000000..132b974 --- /dev/null +++ b/Titan/libs/LibSharedMedia-3.0/CHANGES.txt @@ -0,0 +1,8 @@ +------------------------------------------------------------------------ +r162 | funkehdude | 2025-09-23 21:46:08 +0000 (Tue, 23 Sep 2025) | 1 line +Changed paths: + M /trunk/LibSharedMedia-3.0.toc + +Bump toc +------------------------------------------------------------------------ + diff --git a/Titan/libs/LibSharedMedia-3.0/CallbackHandler-1.0/CallbackHandler-1.0.lua b/Titan/libs/LibSharedMedia-3.0/CallbackHandler-1.0/CallbackHandler-1.0.lua new file mode 100644 index 0000000..21569f4 --- /dev/null +++ b/Titan/libs/LibSharedMedia-3.0/CallbackHandler-1.0/CallbackHandler-1.0.lua @@ -0,0 +1,202 @@ +--[[ $Id: CallbackHandler-1.0.lua 26 2022-12-12 15:09:39Z nevcairiel $ ]] +local MAJOR, MINOR = "CallbackHandler-1.0", 8 +local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR) + +if not CallbackHandler then return end -- No upgrade needed + +local meta = {__index = function(tbl, key) tbl[key] = {} return tbl[key] end} + +-- Lua APIs +local securecallfunction, error = securecallfunction, error +local setmetatable, rawget = setmetatable, rawget +local next, select, pairs, type, tostring = next, select, pairs, type, tostring + + +local function Dispatch(handlers, ...) + local index, method = next(handlers) + if not method then return end + repeat + securecallfunction(method, ...) + index, method = next(handlers, index) + until not method +end + +-------------------------------------------------------------------------- +-- CallbackHandler:New +-- +-- target - target object to embed public APIs in +-- RegisterName - name of the callback registration API, default "RegisterCallback" +-- UnregisterName - name of the callback unregistration API, default "UnregisterCallback" +-- UnregisterAllName - name of the API to unregister all callbacks, default "UnregisterAllCallbacks". false == don't publish this API. + +function CallbackHandler.New(_self, target, RegisterName, UnregisterName, UnregisterAllName) + + RegisterName = RegisterName or "RegisterCallback" + UnregisterName = UnregisterName or "UnregisterCallback" + if UnregisterAllName==nil then -- false is used to indicate "don't want this method" + UnregisterAllName = "UnregisterAllCallbacks" + end + + -- we declare all objects and exported APIs inside this closure to quickly gain access + -- to e.g. function names, the "target" parameter, etc + + + -- Create the registry object + local events = setmetatable({}, meta) + local registry = { recurse=0, events=events } + + -- registry:Fire() - fires the given event/message into the registry + function registry:Fire(eventname, ...) + if not rawget(events, eventname) or not next(events[eventname]) then return end + local oldrecurse = registry.recurse + registry.recurse = oldrecurse + 1 + + Dispatch(events[eventname], eventname, ...) + + registry.recurse = oldrecurse + + if registry.insertQueue and oldrecurse==0 then + -- Something in one of our callbacks wanted to register more callbacks; they got queued + for event,callbacks in pairs(registry.insertQueue) do + local first = not rawget(events, event) or not next(events[event]) -- test for empty before. not test for one member after. that one member may have been overwritten. + for object,func in pairs(callbacks) do + events[event][object] = func + -- fire OnUsed callback? + if first and registry.OnUsed then + registry.OnUsed(registry, target, event) + first = nil + end + end + end + registry.insertQueue = nil + end + end + + -- Registration of a callback, handles: + -- self["method"], leads to self["method"](self, ...) + -- self with function ref, leads to functionref(...) + -- "addonId" (instead of self) with function ref, leads to functionref(...) + -- all with an optional arg, which, if present, gets passed as first argument (after self if present) + target[RegisterName] = function(self, eventname, method, ... --[[actually just a single arg]]) + if type(eventname) ~= "string" then + error("Usage: "..RegisterName.."(eventname, method[, arg]): 'eventname' - string expected.", 2) + end + + method = method or eventname + + local first = not rawget(events, eventname) or not next(events[eventname]) -- test for empty before. not test for one member after. that one member may have been overwritten. + + if type(method) ~= "string" and type(method) ~= "function" then + error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): 'methodname' - string or function expected.", 2) + end + + local regfunc + + if type(method) == "string" then + -- self["method"] calling style + if type(self) ~= "table" then + error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): self was not a table?", 2) + elseif self==target then + error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): do not use Library:"..RegisterName.."(), use your own 'self'", 2) + elseif type(self[method]) ~= "function" then + error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): 'methodname' - method '"..tostring(method).."' not found on self.", 2) + end + + if select("#",...)>=1 then -- this is not the same as testing for arg==nil! + local arg=select(1,...) + regfunc = function(...) self[method](self,arg,...) end + else + regfunc = function(...) self[method](self,...) end + end + else + -- function ref with self=object or self="addonId" or self=thread + if type(self)~="table" and type(self)~="string" and type(self)~="thread" then + error("Usage: "..RegisterName.."(self or \"addonId\", eventname, method): 'self or addonId': table or string or thread expected.", 2) + end + + if select("#",...)>=1 then -- this is not the same as testing for arg==nil! + local arg=select(1,...) + regfunc = function(...) method(arg,...) end + else + regfunc = method + end + end + + + if events[eventname][self] or registry.recurse<1 then + -- if registry.recurse<1 then + -- we're overwriting an existing entry, or not currently recursing. just set it. + events[eventname][self] = regfunc + -- fire OnUsed callback? + if registry.OnUsed and first then + registry.OnUsed(registry, target, eventname) + end + else + -- we're currently processing a callback in this registry, so delay the registration of this new entry! + -- yes, we're a bit wasteful on garbage, but this is a fringe case, so we're picking low implementation overhead over garbage efficiency + registry.insertQueue = registry.insertQueue or setmetatable({},meta) + registry.insertQueue[eventname][self] = regfunc + end + end + + -- Unregister a callback + target[UnregisterName] = function(self, eventname) + if not self or self==target then + error("Usage: "..UnregisterName.."(eventname): bad 'self'", 2) + end + if type(eventname) ~= "string" then + error("Usage: "..UnregisterName.."(eventname): 'eventname' - string expected.", 2) + end + if rawget(events, eventname) and events[eventname][self] then + events[eventname][self] = nil + -- Fire OnUnused callback? + if registry.OnUnused and not next(events[eventname]) then + registry.OnUnused(registry, target, eventname) + end + end + if registry.insertQueue and rawget(registry.insertQueue, eventname) and registry.insertQueue[eventname][self] then + registry.insertQueue[eventname][self] = nil + end + end + + -- OPTIONAL: Unregister all callbacks for given selfs/addonIds + if UnregisterAllName then + target[UnregisterAllName] = function(...) + if select("#",...)<1 then + error("Usage: "..UnregisterAllName.."([whatFor]): missing 'self' or \"addonId\" to unregister events for.", 2) + end + if select("#",...)==1 and ...==target then + error("Usage: "..UnregisterAllName.."([whatFor]): supply a meaningful 'self' or \"addonId\"", 2) + end + + + for i=1,select("#",...) do + local self = select(i,...) + if registry.insertQueue then + for eventname, callbacks in pairs(registry.insertQueue) do + if callbacks[self] then + callbacks[self] = nil + end + end + end + for eventname, callbacks in pairs(events) do + if callbacks[self] then + callbacks[self] = nil + -- Fire OnUnused callback? + if registry.OnUnused and not next(callbacks) then + registry.OnUnused(registry, target, eventname) + end + end + end + end + end + end + + return registry +end + + +-- CallbackHandler purposefully does NOT do explicit embedding. Nor does it +-- try to upgrade old implicit embeds since the system is selfcontained and +-- relies on closures to work. + diff --git a/Titan/libs/LibSharedMedia-3.0/LibSharedMedia-3.0.toc b/Titan/libs/LibSharedMedia-3.0/LibSharedMedia-3.0.toc new file mode 100644 index 0000000..5c95b53 --- /dev/null +++ b/Titan/libs/LibSharedMedia-3.0/LibSharedMedia-3.0.toc @@ -0,0 +1,18 @@ +## Interface: 11506, 11507, 20504, 30405, 40402, 50501, 50500, 110205, 110107, 110200 +## LoadOnDemand: 1 + +## Title: Lib: SharedMedia-3.0 +## Notes: Shared handling of media data (fonts, sounds, textures, ...) between addons. +## Author: Elkano +## Version: 3.0-162 +## X-Website: https://www.curseforge.com/wow/addons/libsharedmedia-3-0 +## X-Category: Library + +## X-Revision: 162 +## X-Date: 2025-09-23T21:46:08Z + +LibStub\LibStub.lua +CallbackHandler-1.0\CallbackHandler-1.0.lua + +LibSharedMedia-3.0\lib.xml + diff --git a/Titan/libs/LibSharedMedia-3.0/LibSharedMedia-3.0/LibSharedMedia-3.0.lua b/Titan/libs/LibSharedMedia-3.0/LibSharedMedia-3.0/LibSharedMedia-3.0.lua new file mode 100644 index 0000000..94ee292 --- /dev/null +++ b/Titan/libs/LibSharedMedia-3.0/LibSharedMedia-3.0/LibSharedMedia-3.0.lua @@ -0,0 +1,299 @@ +--@curseforge-project-slug: libsharedmedia-3-0@ +--[[ +Name: LibSharedMedia-3.0 +Revision: $Revision: 151 $ +Author: Elkano (elkano@gmx.de) +Inspired By: SurfaceLib by Haste/Otravi (troeks@gmail.com) +Website: http://www.wowace.com/projects/libsharedmedia-3-0/ +Description: Shared handling of media data (fonts, sounds, textures, ...) between addons. +Dependencies: LibStub, CallbackHandler-1.0 +License: LGPL v2.1 +]] + +local MAJOR, MINOR = "LibSharedMedia-3.0", 8020003 -- 8.2.0 v3 / increase manually on changes +local lib = LibStub:NewLibrary(MAJOR, MINOR) + +if not lib then return end + +local _G = getfenv(0) + +local pairs = _G.pairs +local type = _G.type + +local band = _G.bit.band +local table_sort = _G.table.sort + +local locale = GetLocale() +local locale_is_western +local LOCALE_MASK +lib.LOCALE_BIT_koKR = 1 +lib.LOCALE_BIT_ruRU = 2 +lib.LOCALE_BIT_zhCN = 4 +lib.LOCALE_BIT_zhTW = 8 +lib.LOCALE_BIT_western = 128 + +local CallbackHandler = LibStub:GetLibrary("CallbackHandler-1.0") + +lib.callbacks = lib.callbacks or CallbackHandler:New(lib) + +lib.DefaultMedia = lib.DefaultMedia or {} +lib.MediaList = lib.MediaList or {} +lib.MediaTable = lib.MediaTable or {} +lib.MediaType = lib.MediaType or {} +lib.OverrideMedia = lib.OverrideMedia or {} + +local defaultMedia = lib.DefaultMedia +local mediaList = lib.MediaList +local mediaTable = lib.MediaTable +local overrideMedia = lib.OverrideMedia + + +-- create mediatype constants +lib.MediaType.BACKGROUND = "background" -- background textures +lib.MediaType.BORDER = "border" -- border textures +lib.MediaType.FONT = "font" -- fonts +lib.MediaType.STATUSBAR = "statusbar" -- statusbar textures +lib.MediaType.SOUND = "sound" -- sound files + +-- populate lib with default Blizzard data +-- BACKGROUND +if not lib.MediaTable.background then lib.MediaTable.background = {} end +lib.MediaTable.background["None"] = [[]] +lib.MediaTable.background["Blizzard Collections Background"] = [[Interface\Collections\CollectionsBackgroundTile]] +lib.MediaTable.background["Blizzard Dialog Background"] = [[Interface\DialogFrame\UI-DialogBox-Background]] +lib.MediaTable.background["Blizzard Dialog Background Dark"] = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]] +lib.MediaTable.background["Blizzard Dialog Background Gold"] = [[Interface\DialogFrame\UI-DialogBox-Gold-Background]] +lib.MediaTable.background["Blizzard Garrison Background"] = [[Interface\Garrison\GarrisonUIBackground]] +lib.MediaTable.background["Blizzard Garrison Background 2"] = [[Interface\Garrison\GarrisonUIBackground2]] +lib.MediaTable.background["Blizzard Garrison Background 3"] = [[Interface\Garrison\GarrisonMissionUIInfoBoxBackgroundTile]] +lib.MediaTable.background["Blizzard Low Health"] = [[Interface\FullScreenTextures\LowHealth]] +lib.MediaTable.background["Blizzard Marble"] = [[Interface\FrameGeneral\UI-Background-Marble]] +lib.MediaTable.background["Blizzard Out of Control"] = [[Interface\FullScreenTextures\OutOfControl]] +lib.MediaTable.background["Blizzard Parchment"] = [[Interface\AchievementFrame\UI-Achievement-Parchment-Horizontal]] +lib.MediaTable.background["Blizzard Parchment 2"] = [[Interface\AchievementFrame\UI-GuildAchievement-Parchment-Horizontal]] +lib.MediaTable.background["Blizzard Rock"] = [[Interface\FrameGeneral\UI-Background-Rock]] +lib.MediaTable.background["Blizzard Tabard Background"] = [[Interface\TabardFrame\TabardFrameBackground]] +lib.MediaTable.background["Blizzard Tooltip"] = [[Interface\Tooltips\UI-Tooltip-Background]] +lib.MediaTable.background["Solid"] = [[Interface\Buttons\WHITE8X8]] +lib.DefaultMedia.background = "None" + +-- BORDER +if not lib.MediaTable.border then lib.MediaTable.border = {} end +lib.MediaTable.border["None"] = [[]] +lib.MediaTable.border["Blizzard Achievement Wood"] = [[Interface\AchievementFrame\UI-Achievement-WoodBorder]] +lib.MediaTable.border["Blizzard Chat Bubble"] = [[Interface\Tooltips\ChatBubble-Backdrop]] +lib.MediaTable.border["Blizzard Dialog"] = [[Interface\DialogFrame\UI-DialogBox-Border]] +lib.MediaTable.border["Blizzard Dialog Gold"] = [[Interface\DialogFrame\UI-DialogBox-Gold-Border]] +lib.MediaTable.border["Blizzard Party"] = [[Interface\CHARACTERFRAME\UI-Party-Border]] +lib.MediaTable.border["Blizzard Tooltip"] = [[Interface\Tooltips\UI-Tooltip-Border]] +lib.DefaultMedia.border = "None" + +-- FONT +if not lib.MediaTable.font then lib.MediaTable.font = {} end +local SML_MT_font = lib.MediaTable.font +--[[ +All font files are currently in all clients, the following table depicts which font supports which charset as of 5.0.4 +Fonts were checked using langcover.pl from DejaVu fonts (http://sourceforge.net/projects/dejavu/) and FontForge (http://fontforge.org/) +latin means check for: de, en, es, fr, it, pt + +file name latin koKR ruRU zhCN zhTW +2002.ttf 2002 X X X - - +2002B.ttf 2002 Bold X X X - - +ARHei.ttf AR CrystalzcuheiGBK Demibold X - X X X +ARIALN.TTF Arial Narrow X - X - - +ARKai_C.ttf AR ZhongkaiGBK Medium (Combat) X - X X X +ARKai_T.ttf AR ZhongkaiGBK Medium X - X X X +bHEI00M.ttf AR Heiti2 Medium B5 - - - - X +bHEI01B.ttf AR Heiti2 Bold B5 - - - - X +bKAI00M.ttf AR Kaiti Medium B5 - - - - X +bLEI00D.ttf AR Leisu Demi B5 - - - - X +FRIZQT__.TTF Friz Quadrata TT X - - - - +FRIZQT___CYR.TTF FrizQuadrataCTT x - X - - +K_Damage.TTF YDIWingsM - X X - - +K_Pagetext.TTF MoK X X X - - +MORPHEUS.TTF Morpheus X - - - - +MORPHEUS_CYR.TTF Morpheus X - X - - +NIM_____.ttf Nimrod MT X - X - - +SKURRI.TTF Skurri X - - - - +SKURRI_CYR.TTF Skurri X - X - - + +WARNING: Although FRIZQT___CYR is available on western clients, it doesn't support special European characters e.g. é, ï, ö +Due to this, we cannot use it as a replacement for FRIZQT__.TTF +]] + +if locale == "koKR" then + LOCALE_MASK = lib.LOCALE_BIT_koKR +-- + SML_MT_font["굵은 글꼴"] = [[Fonts\2002B.TTF]] + SML_MT_font["기본 글꼴"] = [[Fonts\2002.TTF]] + SML_MT_font["데미지 글꼴"] = [[Fonts\K_Damage.TTF]] + SML_MT_font["퀘스트 글꼴"] = [[Fonts\K_Pagetext.TTF]] +-- + lib.DefaultMedia["font"] = "기본 글꼴" -- someone from koKR please adjust if needed +-- +elseif locale == "zhCN" then + LOCALE_MASK = lib.LOCALE_BIT_zhCN +-- + SML_MT_font["伤害数字"] = [[Fonts\ARKai_C.ttf]] + SML_MT_font["默认"] = [[Fonts\ARKai_T.ttf]] + SML_MT_font["聊天"] = [[Fonts\ARHei.ttf]] +-- + lib.DefaultMedia["font"] = "默认" -- someone from zhCN please adjust if needed +-- +elseif locale == "zhTW" then + LOCALE_MASK = lib.LOCALE_BIT_zhTW +-- + SML_MT_font["提示訊息"] = [[Fonts\bHEI00M.ttf]] + SML_MT_font["聊天"] = [[Fonts\bHEI01B.ttf]] + SML_MT_font["傷害數字"] = [[Fonts\bKAI00M.ttf]] + SML_MT_font["預設"] = [[Fonts\bLEI00D.ttf]] +-- + lib.DefaultMedia["font"] = "預設" -- someone from zhTW please adjust if needed + +elseif locale == "ruRU" then + LOCALE_MASK = lib.LOCALE_BIT_ruRU +-- + SML_MT_font["2002"] = [[Fonts\2002.TTF]] + SML_MT_font["2002 Bold"] = [[Fonts\2002B.TTF]] + SML_MT_font["AR CrystalzcuheiGBK Demibold"] = [[Fonts\ARHei.TTF]] + SML_MT_font["AR ZhongkaiGBK Medium (Combat)"] = [[Fonts\ARKai_C.TTF]] + SML_MT_font["AR ZhongkaiGBK Medium"] = [[Fonts\ARKai_T.TTF]] + SML_MT_font["Arial Narrow"] = [[Fonts\ARIALN.TTF]] + SML_MT_font["Friz Quadrata TT"] = [[Fonts\FRIZQT___CYR.TTF]] + SML_MT_font["MoK"] = [[Fonts\K_Pagetext.TTF]] + SML_MT_font["Morpheus"] = [[Fonts\MORPHEUS_CYR.TTF]] + SML_MT_font["Nimrod MT"] = [[Fonts\NIM_____.ttf]] + SML_MT_font["Skurri"] = [[Fonts\SKURRI_CYR.TTF]] +-- + lib.DefaultMedia.font = "Friz Quadrata TT" +-- +else + LOCALE_MASK = lib.LOCALE_BIT_western + locale_is_western = true +-- + SML_MT_font["2002"] = [[Fonts\2002.TTF]] + SML_MT_font["2002 Bold"] = [[Fonts\2002B.TTF]] + SML_MT_font["AR CrystalzcuheiGBK Demibold"] = [[Fonts\ARHei.TTF]] + SML_MT_font["AR ZhongkaiGBK Medium (Combat)"] = [[Fonts\ARKai_C.TTF]] + SML_MT_font["AR ZhongkaiGBK Medium"] = [[Fonts\ARKai_T.TTF]] + SML_MT_font["Arial Narrow"] = [[Fonts\ARIALN.TTF]] + SML_MT_font["Friz Quadrata TT"] = [[Fonts\FRIZQT__.TTF]] + SML_MT_font["MoK"] = [[Fonts\K_Pagetext.TTF]] + SML_MT_font["Morpheus"] = [[Fonts\MORPHEUS_CYR.TTF]] + SML_MT_font["Nimrod MT"] = [[Fonts\NIM_____.ttf]] + SML_MT_font["Skurri"] = [[Fonts\SKURRI_CYR.TTF]] +-- + lib.DefaultMedia.font = "Friz Quadrata TT" +-- +end + +-- STATUSBAR +if not lib.MediaTable.statusbar then lib.MediaTable.statusbar = {} end +lib.MediaTable.statusbar["Blizzard"] = [[Interface\TargetingFrame\UI-StatusBar]] +lib.MediaTable.statusbar["Blizzard Character Skills Bar"] = [[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]] +lib.MediaTable.statusbar["Blizzard Raid Bar"] = [[Interface\RaidFrame\Raid-Bar-Hp-Fill]] +lib.MediaTable.statusbar["Solid"] = [[Interface\Buttons\WHITE8X8]] +lib.DefaultMedia.statusbar = "Blizzard" + +-- SOUND +if not lib.MediaTable.sound then lib.MediaTable.sound = {} end +lib.MediaTable.sound["None"] = 1 -- Relies on the fact that PlaySoundFile doesn't error on this value +lib.DefaultMedia.sound = "None" + +local function rebuildMediaList(mediatype) + local mtable = mediaTable[mediatype] + if not mtable then return end + if not mediaList[mediatype] then mediaList[mediatype] = {} end + local mlist = mediaList[mediatype] + -- list can only get larger, so simply overwrite it + local i = 0 + for k in pairs(mtable) do + i = i + 1 + mlist[i] = k + end + table_sort(mlist) +end + +function lib:Register(mediatype, key, data, langmask) + if type(mediatype) ~= "string" then + error(MAJOR..":Register(mediatype, key, data, langmask) - mediatype must be string, got "..type(mediatype)) + end + if type(key) ~= "string" then + error(MAJOR..":Register(mediatype, key, data, langmask) - key must be string, got "..type(key)) + end + mediatype = mediatype:lower() + if mediatype == lib.MediaType.FONT and ((langmask and band(langmask, LOCALE_MASK) == 0) or not (langmask or locale_is_western)) then + -- ignore fonts that aren't flagged as supporting local glyphs on non-western clients + return false + end + if type(data) == "string" and (mediatype == lib.MediaType.BACKGROUND or mediatype == lib.MediaType.BORDER or mediatype == lib.MediaType.STATUSBAR or mediatype == lib.MediaType.SOUND) then + local path = data:lower() + if not path:find("^interface") then + -- files accessed via path only allowed from interface folder + return false + end + if mediatype == lib.MediaType.SOUND and not (path:find(".ogg", nil, true) or path:find(".mp3", nil, true)) then + -- Only ogg and mp3 are valid sounds. + return false + end + end + if not mediaTable[mediatype] then mediaTable[mediatype] = {} end + local mtable = mediaTable[mediatype] + if mtable[key] then return false end + + mtable[key] = data + rebuildMediaList(mediatype) + self.callbacks:Fire("LibSharedMedia_Registered", mediatype, key) + return true +end + +function lib:Fetch(mediatype, key, noDefault) + local mtt = mediaTable[mediatype] + local overridekey = overrideMedia[mediatype] + local result = mtt and ((overridekey and mtt[overridekey] or mtt[key]) or (not noDefault and defaultMedia[mediatype] and mtt[defaultMedia[mediatype]])) or nil + return result ~= "" and result or nil +end + +function lib:IsValid(mediatype, key) + return mediaTable[mediatype] and (not key or mediaTable[mediatype][key]) and true or false +end + +function lib:HashTable(mediatype) + return mediaTable[mediatype] +end + +function lib:List(mediatype) + if not mediaTable[mediatype] then + return nil + end + if not mediaList[mediatype] then + rebuildMediaList(mediatype) + end + return mediaList[mediatype] +end + +function lib:GetGlobal(mediatype) + return overrideMedia[mediatype] +end + +function lib:SetGlobal(mediatype, key) + if not mediaTable[mediatype] then + return false + end + overrideMedia[mediatype] = (key and mediaTable[mediatype][key]) and key or nil + self.callbacks:Fire("LibSharedMedia_SetGlobal", mediatype, overrideMedia[mediatype]) + return true +end + +function lib:GetDefault(mediatype) + return defaultMedia[mediatype] +end + +function lib:SetDefault(mediatype, key) + if mediaTable[mediatype] and mediaTable[mediatype][key] and not defaultMedia[mediatype] then + defaultMedia[mediatype] = key + return true + else + return false + end +end diff --git a/Titan/libs/LibSharedMedia-3.0/LibSharedMedia-3.0/lib.xml b/Titan/libs/LibSharedMedia-3.0/LibSharedMedia-3.0/lib.xml new file mode 100644 index 0000000..7f2fd53 --- /dev/null +++ b/Titan/libs/LibSharedMedia-3.0/LibSharedMedia-3.0/lib.xml @@ -0,0 +1,4 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ +..\FrameXML\UI.xsd"> + <Script file="LibSharedMedia-3.0.lua" /> +</Ui> diff --git a/Titan/libs/LibSharedMedia-3.0/LibStub/LibStub.lua b/Titan/libs/LibSharedMedia-3.0/LibStub/LibStub.lua new file mode 100644 index 0000000..ae1900e --- /dev/null +++ b/Titan/libs/LibSharedMedia-3.0/LibStub/LibStub.lua @@ -0,0 +1,51 @@ +-- $Id: LibStub.lua 76 2007-09-03 01:50:17Z mikk $ +-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/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/LibSharedMedia-3.0/lib.xml b/Titan/libs/LibSharedMedia-3.0/lib.xml new file mode 100644 index 0000000..c81f35f --- /dev/null +++ b/Titan/libs/LibSharedMedia-3.0/lib.xml @@ -0,0 +1,5 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ +..\FrameXML\UI.xsd"> + <Include file="LibSharedMedia-3.0\lib.xml"/> +</Ui> + diff --git a/Titan/libs/libserialize/Changelog-libserialize-0.9.1.beta.txt b/Titan/libs/libserialize/Changelog-libserialize-0.9.1.beta.txt deleted file mode 100644 index 71e0476..0000000 --- a/Titan/libs/libserialize/Changelog-libserialize-0.9.1.beta.txt +++ /dev/null @@ -1,59 +0,0 @@ ------------------------------------------------------------------------- -r10 | dieendieen | 2012-01-29 12:39:07 +0000 (Sun, 29 Jan 2012) | 1 line -Changed paths: - A /tags/0.9.1.beta (from /trunk:9) - -Tagging as 0.9.1.beta ------------------------------------------------------------------------- -r9 | dieendieen | 2012-01-29 12:23:51 +0000 (Sun, 29 Jan 2012) | 1 line -Changed paths: - M /trunk/LibSerialize.toc - M /trunk/serializer.lua - -bit of code cleaning ------------------------------------------------------------------------- -r7 | dieendieen | 2012-01-14 19:47:54 +0000 (Sat, 14 Jan 2012) | 1 line -Changed paths: - M /trunk/LibSerialize.toc - M /trunk/serializer.lua - -first release candidate version ------------------------------------------------------------------------- -r5 | dieendieen | 2012-01-13 14:42:20 +0000 (Fri, 13 Jan 2012) | 1 line -Changed paths: - M /trunk/LibSerialize.toc - M /trunk/serializer.lua - -updates ------------------------------------------------------------------------- -r3 | dieendieen | 2012-01-12 10:07:30 +0000 (Thu, 12 Jan 2012) | 1 line -Changed paths: - A /trunk/libs - A /trunk/libs/LibStub - A /trunk/libs/LibStub/Changelog-LibStub-1.0.2-40200.txt - A /trunk/libs/LibStub/LibStub.lua - A /trunk/libs/LibStub/LibStub.toc - A /trunk/libs/LibStub/tests - A /trunk/libs/LibStub/tests/test.lua - A /trunk/libs/LibStub/tests/test2.lua - A /trunk/libs/LibStub/tests/test3.lua - A /trunk/libs/LibStub/tests/test4.lua - -added embedded LibStub ------------------------------------------------------------------------- -r2 | dieendieen | 2012-01-12 10:03:32 +0000 (Thu, 12 Jan 2012) | 1 line -Changed paths: - A /trunk/LibSerialize.toc - A /trunk/embeds.xml - A /trunk/serializer.lua - -initial version, mostly functional, but lot of things needs lot of polishing ------------------------------------------------------------------------- -r1 | svn | 2012-01-10 15:29:05 +0000 (Tue, 10 Jan 2012) | 1 line -Changed paths: - A /branches - A /tags - A /trunk - -libserialize/mainline: Initial Import ------------------------------------------------------------------------- diff --git a/Titan/libs/libserialize/LibSerialize.toc b/Titan/libs/libserialize/LibSerialize.toc deleted file mode 100644 index d44ea8c..0000000 --- a/Titan/libs/libserialize/LibSerialize.toc +++ /dev/null @@ -1,16 +0,0 @@ -## Interface: 40300 -## X-Compatible-With: 40300 -## Title: Lib: Serialize -## Version: 0.9.1.beta -## Notes: Serialized -## Author: Dieen@twobears.cz -## SavedVariables: -## OptionalDeps: LibStub -## X-Curse-Packaged-Version: 0.9.1.beta -## X-Curse-Project-Name: Lib: Serialize -## X-Curse-Project-ID: libserialize -## X-Curse-Repository-ID: wow/libserialize/mainline - -embeds.xml -serializer.lua - diff --git a/Titan/libs/libserialize/embeds.xml b/Titan/libs/libserialize/embeds.xml deleted file mode 100644 index f07507c..0000000 --- a/Titan/libs/libserialize/embeds.xml +++ /dev/null @@ -1,3 +0,0 @@ -<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd"> - <Script file="Libs\LibStub\LibStub.lua"/> -</Ui> diff --git a/Titan/libs/libserialize/libs/LibStub/Changelog-LibStub-1.0.2-40200.txt b/Titan/libs/libserialize/libs/LibStub/Changelog-LibStub-1.0.2-40200.txt deleted file mode 100644 index c8d9669..0000000 --- a/Titan/libs/libserialize/libs/LibStub/Changelog-LibStub-1.0.2-40200.txt +++ /dev/null @@ -1,13 +0,0 @@ ------------------------------------------------------------------------- -r96 | mikk | 2011-07-24 00:25:09 +0000 (Sun, 24 Jul 2011) | 1 line -Changed paths: - A /tags/1.0.2-40200 (from /trunk:95) - -Tagging as 1.0.2-40200 ------------------------------------------------------------------------- -r95 | mikk | 2011-07-24 00:18:56 +0000 (Sun, 24 Jul 2011) | 1 line -Changed paths: - M /trunk/LibStub.toc - -TOC 40200 ------------------------------------------------------------------------- diff --git a/Titan/libs/libserialize/libs/LibStub/LibStub.lua b/Titan/libs/libserialize/libs/LibStub/LibStub.lua deleted file mode 100644 index f5fc919..0000000 --- a/Titan/libs/libserialize/libs/LibStub/LibStub.lua +++ /dev/null @@ -1,51 +0,0 @@ --- $Id: LibStub.lua 76 2007-09-03 01:50:17Z mikk $ --- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/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/libserialize/libs/LibStub/LibStub.toc b/Titan/libs/libserialize/libs/LibStub/LibStub.toc deleted file mode 100644 index e73a415..0000000 --- a/Titan/libs/libserialize/libs/LibStub/LibStub.toc +++ /dev/null @@ -1,17 +0,0 @@ -## Interface: 40200 -## 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 -## X-Curse-Packaged-Version: 1.0.2-40200 -## X-Curse-Project-Name: LibStub -## X-Curse-Project-ID: libstub -## X-Curse-Repository-ID: wow/libstub/mainline -## X-Curse-Packaged-Version: 0.9.1.beta -## X-Curse-Project-Name: Lib: Serialize -## X-Curse-Project-ID: libserialize -## X-Curse-Repository-ID: wow/libserialize/mainline - -LibStub.lua diff --git a/Titan/libs/libserialize/libs/LibStub/tests/test.lua b/Titan/libs/libserialize/libs/LibStub/tests/test.lua deleted file mode 100644 index 645a08b..0000000 --- a/Titan/libs/libserialize/libs/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/libserialize/libs/LibStub/tests/test2.lua b/Titan/libs/libserialize/libs/LibStub/tests/test2.lua deleted file mode 100644 index af431dd..0000000 --- a/Titan/libs/libserialize/libs/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/libserialize/libs/LibStub/tests/test3.lua b/Titan/libs/libserialize/libs/LibStub/tests/test3.lua deleted file mode 100644 index 01aabb8..0000000 --- a/Titan/libs/libserialize/libs/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/libserialize/libs/LibStub/tests/test4.lua b/Titan/libs/libserialize/libs/LibStub/tests/test4.lua deleted file mode 100644 index 15a9c9c..0000000 --- a/Titan/libs/libserialize/libs/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/libserialize/serializer.lua b/Titan/libs/libserialize/serializer.lua deleted file mode 100644 index e57b494..0000000 --- a/Titan/libs/libserialize/serializer.lua +++ /dev/null @@ -1,412 +0,0 @@ -local MAJOR,MINOR = "LibSerialize", 1; -local LibSerialize, oldminor = LibStub:NewLibrary(MAJOR, MINOR); - ---[[ -E empty string -S new plain string (no need for escaping) -W new escaped string - -* nil value -! NaN -0 0 (exact zero) -1 1 (exact one) -. . -. . -9 9 (exact nine) -I inf -i -inf -N number from tostring function -B positive number in big base -b negative number in big base - -F positive double precison float -f negative double precison float - -D function declaration - -T new table -Q empty table - -+ boolean true -- boolean false - -R reference - -Vv protocol version -]]-- - -local tinsert,type,format,find,gsub,concat,char,byte,modf,frexp,floor=tinsert,type,string.format,string.find,string.gsub,table.concat,string.char,string.byte,math.modf,math.frexp,math.floor; - - - -function LibSerialize:InitSera() -local sera={refs={[1]={};arrcnt=0;refcnt=0;curarr=1};serialized={""};row=1;rowcount=0}; - return sera; -end; - -function LibSerialize:AppendSera(sera,datatype,data) - - if sera.row > 5000 then - sera.serialized ={concat(sera.serialized)}; - sera.row=1; - end; - sera.row=sera.row+1; - sera.serialized [sera.row] = "~"..datatype..(data or ""); -end; - -function LibSerialize:FinishSera(sera) - sera.serialized =concat(sera.serialized); -end; - -local num2char={}; -for i=0,99 do num2char[i]=char(i+26);end; - - -local function num2big (number) - local res=""; - local sign=1; - if number<0 then sign=-1; number=abs(number); end; - while number>99 do - res=num2char[number % 100]..res; - number=floor(number/100); - end; - res=num2char[number]..res; - return res,sign; -end; - -local function big2num (big,sign) - sign=sign or 1; - local res=0; - for i=1,#big do - res=res*100+byte(big,i)-26; - end; - return sign*res; -end; - -local function format_index(number) - return num2big (number); -end; - -local function checkref (sera,anIt) - local refs=sera.refs; - local ref; - for i=1,refs.curarr do - ref=refs[i][anIt]; - if ref~=nil then return ref,true;end; - end; - return nil,false; -end; - -local function getref (sera,anIt) - local refs=sera.refs; - local ref; - for i=1,refs.curarr do - ref=refs[i][anIt]; - if ref~=nil then return ref,true;end; - end; - if refs.arrcnt<65535 then - refs.arrcnt=refs.arrcnt+1; - else - refs.arrcnt=0; - refs.curarr=refs.curarr+1; - sera.refs[refs.curarr]={}; - end; - refs.refcnt=refs.refcnt+1; - ref=format_index(refs.refcnt); - sera.refs[refs.curarr][anIt]=ref; - return ref,false; -end; - -local function getdesref (sera,anIt) - local refs=sera.refs; - local ref; - for i=1,refs.curarr do - ref=refs[i][anIt]; - if ref~=nil then return ref,true;end; - end; - if refs.arrcnt<65535 then - refs.arrcnt=refs.arrcnt+1; - else - refs.arrcnt=0; - refs.curarr=refs.curarr+1; - sera.refs[refs.curarr]={}; - end; - refs.refcnt=refs.refcnt+1; - ref=format_index(refs.refcnt); - sera.refs[refs.curarr][anIt]=ref; - return ref,false; -end; - - -local function numtostring(aNumber) - if (modf(aNumber))==aNumber then -- integer? - local big,sign=num2big(aNumber); - return big,((sign<0) and "b" or "B"); - else - local numstr=tostring(aNumber); - if tonumber(numstr)==aNumber then - return numstr,"N"; - else - local m,e=frexp(aNumber); - return format("%s\025%d",(num2big (abs(m)*2^53)),e-53),(m<0) and "f" or "F"; - end; - end; -end; - - -function LibSerialize:Serialize_string (sera,aString) - local ref,refok= getref (sera,aString); - if refok then - self:AppendSera (sera,"R",ref); - else - if find(aString, "%~")==nil then - self:AppendSera (sera,"S",aString); - else - local replaces; - aString,replaces=gsub(aString, "\\", "\\e"); --\\ make the escape char free :) - aString,replaces=gsub(aString, "%~", "\\!"); - self:AppendSera (sera,"W",aString); - end; - end; -end; - -function LibSerialize:DeSerialize_escapedstring(sera,stype,sdata) - sera.refcnt=sera.refcnt+1; - local refindex=format_index(sera.refcnt); - sera.refs[refindex]=""; - local newstring=sdata; - newstring=gsub(newstring, "\\!", "~"); - newstring=gsub(newstring, "\\e", "\\"); --undo the escape char escapping - sera.refs[refindex]=newstring; - return newstring; -end; - -function LibSerialize:DeSerialize_simplestring(sera,stype,sdata) - sera.refcnt=sera.refcnt+1; - sera.refs[format_index(sera.refcnt)]=sdata; - return sdata; -end; - - -function LibSerialize:DeSerialize_ref(sera,stype,sdata) - return sera.refs[sdata]; -end; - - -local serdirectarr={ --switch array - [0]="0"; - [1]="1"; - [2]="2"; - [3]="3"; - [4]="4"; - [5]="5"; - [6]="6"; - [7]="7"; - [8]="8"; - [9]="9"; - [10]="A"; - [(1/0)]="I"; - [(-1/0)]="i"; - [""]="E"; - [true]="+"; - [false]="-"; -}; - -function LibSerialize:Serialize_number (sera,aNumber) - local sNumber,stype=numtostring(aNumber); - self:AppendSera (sera,stype,sNumber); -end; - -local function numberfromfloat(sdata) - local m,e=string.match(sdata, "([^\025]+)\025([+-]*%d*)"); - return ldexp(big2num(m),e or 0); -end; - - -function LibSerialize:DeSerialize_number(sera,stype,sdata) - return (stype=="F" and numberfromfloat(sdata))or (stype=="f" and -numberfromfloat(sdata)) or tonumber(sdata); -end; - -function LibSerialize:DeSerialize_numberbig(sera,stype,sdata) - return (stype=="B" and big2num(sdata)) or (stype=="b" and -big2num(sdata)); -end; - - -function LibSerialize:Serialize_function (sera,aFunction) - local ref,refok= getref (sera,aFunction); - if refok then - self:AppendSera (sera,"R",ref); - else - self:AppendSera (sera,"D"); - self:Serialize_any(sera,string.dump(aFunction));--well..that got to do for a moment - end; -end; - -function LibSerialize:Serialize_table (sera,aTable) - local ref,refok= getref (sera,aTable); - if refok then - self:AppendSera (sera,"R",ref); - elseif next(aTable) == nil then - self:AppendSera (sera,"Q"); - else - self:AppendSera (sera,"T"); - for key, value in pairs (aTable) do - self:Serialize_any (sera,key); - self:Serialize_any (sera,value); - end; - self:AppendSera (sera,"t"); - end; -end; - -function LibSerialize:DeSerialize_table(sera,stype,sdata,tokenizer) - local newtable={}; - sera.refcnt=sera.refcnt+1; - sera.refs[format_index(sera.refcnt)]=newtable; - if stype=="T" then - stype,sdata=tokenizer(); - while stype~="t" do - local key=self:DeSerialize_any(sera,stype,sdata,tokenizer); - stype,sdata=tokenizer(); - newtable [key] = self:DeSerialize_any(sera,stype,sdata,tokenizer); - stype,sdata=tokenizer(); - end; - end; - return newtable; -end; - -function LibSerialize:DeSerialize_function (sera,stype,sdata,tokenizer) - local fdef=self:DeSerialize_any(sera,stype,sdata,tokenizer); - local newfunction = loadstring (fdef); - sera.refcnt=sera.refcnt+1; - sera.refs[format_index(sera.refcnt)]=newfunction; - return newfunction; -end; - - -local serarr={ --switch array - ["string"]=LibSerialize.Serialize_string; - ["number"]=LibSerialize.Serialize_number; - ["table"]=LibSerialize.Serialize_table; - ["function"]=LibSerialize.Serialize_function; -}; -function LibSerialize:Serialize_any (sera,anItem) - local direct=((anItem==nil) and "*") or ((anItem~=anItem) and "!") or serdirectarr[anItem]; - - if type(direct)=="string" then self:AppendSera (sera,direct); - else - local ref,refok= checkref (sera,anItem); - if refok then self:AppendSera (sera,"R",ref); - else - local anItemType=type(anItem); - local handler=serarr[type(anItem)]; - if type(handler)=="function" then handler (self,sera,anItem);end; - end; - end; -end; - - - -function LibSerialize:Serialize (anItem) - local sera; - sera=self:InitSera(); - self:AppendSera (sera,"V","5"); - self:Serialize_any(sera,anItem); - self:AppendSera (sera,"v"); - self:FinishSera(sera); - return sera.serialized; -end; - ---and deserialization -local deserarr={ --switch array - ["+"]=true; - ["-"]=false; - ["0"]=0; - ["1"]=1; - ["2"]=2; - ["3"]=3; - ["4"]=4; - ["5"]=5; - ["6"]=6; - ["7"]=7; - ["8"]=8; - ["9"]=9; - ["A"]=10; - ["I"]=(1/0); - ["i"]=(-1/0); - ["!"]=(0/0); - ["*"]=nil; - ["N"]=LibSerialize.DeSerialize_number; - ["F"]=LibSerialize.DeSerialize_number; - ["f"]=LibSerialize.DeSerialize_number; - ["B"]=LibSerialize.DeSerialize_numberbig; - ["b"]=LibSerialize.DeSerialize_numberbig; - ["E"]=""; - ["W"]=LibSerialize.DeSerialize_escapedstring; - ["S"]=LibSerialize.DeSerialize_simplestring; - ["Q"]=LibSerialize.DeSerialize_table; - ["T"]=LibSerialize.DeSerialize_table; - ["D"]=LibSerialize.DeSerialize_function; - ["R"]=LibSerialize.DeSerialize_ref; -}; - -function LibSerialize:DeSerialize_any(sera,stype,sdata,tokenizer) - local handler=sera.handlers[stype]; - if type(handler)=="function" then return handler (self,sera,stype,sdata,tokenizer); else return handler; end; -end; - - - -function LibSerialize:DeSerialize (anSerializedItem) - local sera={handlers=deserarr;refs={};refcnt=0}; - local result=anSerializedItem; - local tokenizer=string.gmatch(anSerializedItem, "[^~]-[~](.)([^~]*)"); - local stype,sdata=tokenizer(); - if stype=="V" and sdata=="5" then - stype,sdata=tokenizer(); - result = self:DeSerialize_any(sera,stype,sdata,tokenizer); - stype,sdata=tokenizer(); - end; - return result; -end; - -local function CompareByValue (t1,t2) - local ty = type(t1); - if ty ~= type(t2) then return false end; - if t1==t2 then return true;end; - if ty ~= 'table' then return t1 == t2 end; - - local cnt=0; - local tablecnt=0; - for k1,v1 in pairs(t1) do - local v2 = t2[k1]; - if v2 == nil then return false end; - cnt=cnt+1; - if type(v1)~= 'table' then - if not CompareByValue(v1,v2) then return false end - else - tablecnt=tablecnt+1; - end; - end - - if tablecnt>0 then - for k1,v1 in pairs(t1) do - if type(v1)== 'table' then - local v2 = t2[k1]; - if not CompareByValue(v1,v2) then return false end - end - end; - end; - - if #t1 ~= #t2 then return false end; - - for k2,v2 in pairs(t2) do cnt=cnt-1; end; - return cnt==0; -end; - - -function LibSerialize:DoCheck (testdata) - local test=self:Serialize(testdata); - return CompareByValue (testdata,self:DeSerialize(test)); -end; - - diff --git a/Titan/locale/Localization.BR.lua b/Titan/locale/Localization.BR.lua index e558f37..9bc6a9d 100644 --- a/Titan/locale/Localization.BR.lua +++ b/Titan/locale/Localization.BR.lua @@ -250,6 +250,7 @@ L["TITAN_PANEL_MENU_CENTER_TEXT"] = "Centralizar Texto"; L["TITAN_PANEL_MENU_CHANGE_HISTORY"] = "Recent Change History" L["TITAN_PANEL_MENU_COMMAND"] = (COMMAND or "Command") L["TITAN_PANEL_MENU_CONFIGURATION"] = "Configuração"; +L["TITAN_PANEL_MENU_DELETE_SETTINGS"] = "Apagar"; L["TITAN_PANEL_MENU_DISABLE_PUSH"] = "Desativar Ajuste de Tela"; L["TITAN_PANEL_MENU_DISABLED"] = "Desativado"; L["TITAN_PANEL_MENU_DISPLAY_BAR"] = "Exibir Barra"; @@ -271,8 +272,6 @@ L["TITAN_PANEL_MENU_IN_COMBAT_LOCKDOWN"] = "(Em Combate)"; L["TITAN_PANEL_MENU_LDB_FORCE_LAUNCHER"] = "Força os LDB Launchers para o Lado Direito"; L["TITAN_PANEL_MENU_LDB_SIDE"] = "Plugin no Lado Direito"; L["TITAN_PANEL_MENU_LOAD_SETTINGS"] = "Carregar"; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_DESC"] = "Copy this profile into the current character."; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_ERR1"] = "Load not allowed, same toon."; L["TITAN_PANEL_MENU_LOCK_BUTTONS"] = "Trancar Botões"; L["TITAN_PANEL_MENU_LSM_FONTS_DESC"] = "Select the font type for the various plugins on the "..TITAN_PANEL.." Bars."; L["TITAN_PANEL_MENU_LSM_FONTS"] = "Painel de Fontes"; @@ -289,31 +288,18 @@ L["TITAN_PANEL_MENU_PLUGINS"] = "Plugins"; L["TITAN_PANEL_MENU_POSITION"] = "Posição"; L["TITAN_PANEL_MENU_PROFILE_ALREADY_EXISTS"] = "O nome de perfil digitado já existe. Você tem certeza que quer sobrescrevê-lo? Aperte 'Aceitar' se sim, de outra maneira aperte 'Cancelar' ou a tecla 'Esc'."; L["TITAN_PANEL_MENU_PROFILE_CHARS"] = "Personagem"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC"] = "Clear Sync"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC_DESC"] = "Clear Sync to use profile of this toon."; L["TITAN_PANEL_MENU_PROFILE_CUSTOM"] = "Personalizado"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS"] = "Delete"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_DESC"] = "Delete this profile from the list."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR1"] = "Delete not allowed, used as Sync by another profile."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR2"] = "Delete not allowed, cannot delete yourself."; L["TITAN_PANEL_MENU_PROFILE_DELETED"] = " foi apagado."; L["TITAN_PANEL_MENU_PROFILE_RELOADUI"] = "Sua UI será recarregada quando o botão 'Ok' for apertado, permitindo que seu perfil personalizado seja salvo."; -L["TITAN_PANEL_MENU_PROFILE_RESET"] = "Reset Profile"; -L["TITAN_PANEL_MENU_PROFILE_RESET_DESC"] = "Reset just this profile to defaults."; -L["TITAN_PANEL_MENU_PROFILE_SAVE"] = "Save"; -L["TITAN_PANEL_MENU_PROFILE_SAVE_DESC"] = "Save this profile as a custom profile."; L["TITAN_PANEL_MENU_PROFILE_SAVE_CUSTOM_TITLE"] = "Digite um nome para seu perfil personalizado:\n(máximo 20 caracteres, espaços não são permitidos, maíusculas e minúsculas)"; L["TITAN_PANEL_MENU_PROFILE_SAVE_PENDING"] = "Configurações atuais serão salvas no perfil de nome: "; L["TITAN_PANEL_MENU_PROFILE_SERVERS"] = "Reino"; -L["TITAN_PANEL_MENU_PROFILE_SYNC"] = "Sync"; -L["TITAN_PANEL_MENU_PROFILE_SYNC_DESC"] = "Sync this profile with current character. Changes on current character will be made to this profile."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR1"] = "Sync not allowed, cannot Sync to a toon that has a Sync."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR2"] = "Sync not allowed, cannot Sync to yourself."; L["TITAN_PANEL_MENU_PROFILE"] = "Perfil "; L["TITAN_PANEL_MENU_PROFILES"] = "Perfis"; L["TITAN_PANEL_MENU_RELOADUI"] = "(Recarregar IU)"; L["TITAN_PANEL_MENU_RESET_POSITION"] = (RESET_POSITION or "Reset Position Only") L["TITAN_PANEL_MENU_RESET"] = "Resetar o " .. TITAN_PANEL .. " para os Padrões"; +L["TITAN_PANEL_MENU_SAVE_SETTINGS"] = "Salvar"; L["TITAN_PANEL_MENU_SHOW_COLORED_TEXT"] = "Exibir Texto Colorido"; L["TITAN_PANEL_MENU_SHOW_ICON"] = "Exibir Ícone"; L["TITAN_PANEL_MENU_SHOW_LABEL_TEXT"] = "Exibir Texto de Rótulo"; @@ -391,7 +377,6 @@ L["TITAN_PANEL_SLASH_RESET_2"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipf L["TITAN_PANEL_SLASH_RESET_3"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipalpha: |cffffffffReseta a transparência de dica do "..TITAN_PANEL.." para o padrão."; L["TITAN_PANEL_SLASH_RESET_4"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset panelscale: |cffffffffReseta a escala do "..TITAN_PANEL.." para o padrão."; L["TITAN_PANEL_SLASH_RESET_5"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset spacing: |cffffffffReseta o espaçamento do botão do "..TITAN_PANEL.." para o padrão."; -L["TITAN_PANEL_SLASH_RESET_6"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset all: |r|cffffffffResets "..TITAN_PANEL.." to default. Acts as a delete of Titan saved vars.|r"; L["TITAN_PANEL_SLASH_RESP1"] = LIGHTYELLOW_FONT_COLOR_CODE..TITAN_PANEL.." escala de fonte de dica resetada."; L["TITAN_PANEL_SLASH_RESP2"] = LIGHTYELLOW_FONT_COLOR_CODE..TITAN_PANEL.." transparência de dica resetada."; L["TITAN_PANEL_SLASH_RESP3"] = LIGHTYELLOW_FONT_COLOR_CODE..TITAN_PANEL.." escala resetada."; diff --git a/Titan/locale/Localization.CN.lua b/Titan/locale/Localization.CN.lua index bb1d9a2..a8312c4 100644 --- a/Titan/locale/Localization.CN.lua +++ b/Titan/locale/Localization.CN.lua @@ -250,6 +250,7 @@ L["TITAN_PANEL_MENU_CENTER_TEXT"] = "文字居中"; L["TITAN_PANEL_MENU_CHANGE_HISTORY"] = "Recent Change History" L["TITAN_PANEL_MENU_COMMAND"] = (COMMAND or "Command") L["TITAN_PANEL_MENU_CONFIGURATION"] = "配置设置"; +L["TITAN_PANEL_MENU_DELETE_SETTINGS"] = "删除"; L["TITAN_PANEL_MENU_DISABLE_PUSH"] = "禁用自动适应屏幕"; L["TITAN_PANEL_MENU_DISABLED"] = "禁用"; L["TITAN_PANEL_MENU_DISPLAY_BAR"] = "显示Titan条"; @@ -271,8 +272,6 @@ L["TITAN_PANEL_MENU_IN_COMBAT_LOCKDOWN"] = "(战斗中)"; L["TITAN_PANEL_MENU_LDB_FORCE_LAUNCHER"] = "强制LDB启动器到右侧"; L["TITAN_PANEL_MENU_LDB_SIDE"] = "右侧插件"; --?? L["TITAN_PANEL_MENU_LOAD_SETTINGS"] = "载入"; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_DESC"] = "Copy this profile into the current character."; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_ERR1"] = "Load not allowed, same toon."; L["TITAN_PANEL_MENU_LOCK_BUTTONS"] = "锁定按钮"; L["TITAN_PANEL_MENU_LSM_FONTS_DESC"] = "选择Titan条上各个模块的字体样式."; L["TITAN_PANEL_MENU_LSM_FONTS"] = "面板字体"; @@ -289,31 +288,18 @@ L["TITAN_PANEL_MENU_PLUGINS"] = "扩展组件"; L["TITAN_PANEL_MENU_POSITION"] = "位置"; L["TITAN_PANEL_MENU_PROFILE_ALREADY_EXISTS"] = "配置文件名称已存在. 你确定要覆盖它? 按 '接受' 确定, 按 '取消' 取消."; L["TITAN_PANEL_MENU_PROFILE_CHARS"] = "角色"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC"] = "Clear Sync"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC_DESC"] = "Clear Sync to use profile of this toon."; L["TITAN_PANEL_MENU_PROFILE_CUSTOM"] = "个人"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS"] = "Delete"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_DESC"] = "Delete this profile from the list."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR1"] = "Delete not allowed, used as Sync by another profile."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR2"] = "Delete not allowed, cannot delete yourself."; L["TITAN_PANEL_MENU_PROFILE_DELETED"] = " 已删除."; L["TITAN_PANEL_MENU_PROFILE_RELOADUI"] = "按下 '确定' 界面将重载来保存你的个人配置."; -L["TITAN_PANEL_MENU_PROFILE_RESET"] = "Reset Profile"; -L["TITAN_PANEL_MENU_PROFILE_RESET_DESC"] = "Reset just this profile to defaults."; -L["TITAN_PANEL_MENU_PROFILE_SAVE"] = "Save"; -L["TITAN_PANEL_MENU_PROFILE_SAVE_DESC"] = "Save this profile as a custom profile."; L["TITAN_PANEL_MENU_PROFILE_SAVE_CUSTOM_TITLE"] = "为你的配置文件输入一个名称:\n(20字符限制,不能有空格)"; L["TITAN_PANEL_MENU_PROFILE_SAVE_PENDING"] = "现有设置已经被保存为配置文件: "; L["TITAN_PANEL_MENU_PROFILE_SERVERS"] = "服务器"; -L["TITAN_PANEL_MENU_PROFILE_SYNC"] = "Sync"; -L["TITAN_PANEL_MENU_PROFILE_SYNC_DESC"] = "Sync this profile with current character. Changes on current character will be made to this profile."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR1"] = "Sync not allowed, cannot Sync to a toon that has a Sync."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR2"] = "Sync not allowed, cannot Sync to yourself."; L["TITAN_PANEL_MENU_PROFILE"] = "配置"; L["TITAN_PANEL_MENU_PROFILES"] = "配置"; L["TITAN_PANEL_MENU_RELOADUI"] = "(将重载界面)"; L["TITAN_PANEL_MENU_RESET_POSITION"] = (RESET_POSITION or "Reset Position Only") L["TITAN_PANEL_MENU_RESET"] = "重置 "..TITAN_PANEL.." 为默认"; +L["TITAN_PANEL_MENU_SAVE_SETTINGS"] = "保存"; L["TITAN_PANEL_MENU_SHOW_COLORED_TEXT"] = "显示彩色文本"; L["TITAN_PANEL_MENU_SHOW_ICON"] = "显示图标"; L["TITAN_PANEL_MENU_SHOW_LABEL_TEXT"] = "显示名称"; @@ -391,7 +377,6 @@ L["TITAN_PANEL_SLASH_RESET_2"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipf L["TITAN_PANEL_SLASH_RESET_3"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipalpha: |cffffffffResets "..TITAN_PANEL.." 重置提示文字透明度为默认值."; L["TITAN_PANEL_SLASH_RESET_4"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset panelscale: |cffffffffResets "..TITAN_PANEL.." 重置面板缩放为默认值."; L["TITAN_PANEL_SLASH_RESET_5"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset spacing: |cffffffffResets "..TITAN_PANEL.." 重置按钮间距为默认值."; -L["TITAN_PANEL_SLASH_RESET_6"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset all: |r|cffffffffResets "..TITAN_PANEL.." to default. Acts as a delete of Titan saved vars.|r"; L["TITAN_PANEL_SLASH_RESP1"] = LIGHTYELLOW_FONT_COLOR_CODE..TITAN_PANEL.."Titan Panel 提示文字缩放已重置."; L["TITAN_PANEL_SLASH_RESP2"] = LIGHTYELLOW_FONT_COLOR_CODE..TITAN_PANEL.."Titan Panel 提示窗口的透明度已重置."; L["TITAN_PANEL_SLASH_RESP3"] = LIGHTYELLOW_FONT_COLOR_CODE..TITAN_PANEL.."Titan Panel 缩放已重置."; diff --git a/Titan/locale/Localization.DE.lua b/Titan/locale/Localization.DE.lua index 58a5c6f..0bcc143 100644 --- a/Titan/locale/Localization.DE.lua +++ b/Titan/locale/Localization.DE.lua @@ -250,6 +250,7 @@ L["TITAN_PANEL_MENU_CENTER_TEXT"] = "Text zentrieren"; L["TITAN_PANEL_MENU_CHANGE_HISTORY"] = "Recent Change History" L["TITAN_PANEL_MENU_COMMAND"] = (COMMAND or "Command") L["TITAN_PANEL_MENU_CONFIGURATION"] = "Konfiguration"; +L["TITAN_PANEL_MENU_DELETE_SETTINGS"] = "L\195\182schen"; L["TITAN_PANEL_MENU_DISABLE_PUSH"] = "Bildschirmjustierung deaktivieren (Gr\195\182\195\159en\195\164nderung)"; L["TITAN_PANEL_MENU_DISABLED"] = "Aus"; L["TITAN_PANEL_MENU_DISPLAY_BAR"] = "Zeige Leiste"; @@ -271,8 +272,6 @@ L["TITAN_PANEL_MENU_IN_COMBAT_LOCKDOWN"] = "(Im Kampf)"; L["TITAN_PANEL_MENU_LDB_FORCE_LAUNCHER"] = "Schiebe Starter nach rechts"; L["TITAN_PANEL_MENU_LDB_SIDE"] = "Plugin rechts"; L["TITAN_PANEL_MENU_LOAD_SETTINGS"] = "Einstellungen laden"; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_DESC"] = "Copy this profile into the current character."; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_ERR1"] = "Load not allowed, same toon."; L["TITAN_PANEL_MENU_LOCK_BUTTONS"] = "Schaltfl\195\164chen fixieren"; L["TITAN_PANEL_MENU_LSM_FONTS_DESC"] = "Wähle die Schriftart f\195\188r die verschiedenen Plugins in den "..TITAN_PANEL.."-Leisten."; L["TITAN_PANEL_MENU_LSM_FONTS"] = "Panel-Schriftart"; @@ -289,31 +288,18 @@ L["TITAN_PANEL_MENU_PLUGINS"] = "Plugins"; L["TITAN_PANEL_MENU_POSITION"] = "Position"; L["TITAN_PANEL_MENU_PROFILE_ALREADY_EXISTS"] = "Dieser Profilname existiert bereits. Soll wirklich \195\188berschrieben werden? Dr\195\188cke 'Accept' f\195\188r JA, wenn NEIN dr\195\188cke 'Cancel' oder 'Escape'."; L["TITAN_PANEL_MENU_PROFILE_CHARS"] = "Charakter"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC"] = "Clear Sync"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC_DESC"] = "Clear Sync to use profile of this toon."; L["TITAN_PANEL_MENU_PROFILE_CUSTOM"] = "Benutzerdefiniert"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS"] = "Delete"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_DESC"] = "Delete this profile from the list."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR1"] = "Delete not allowed, used as Sync by another profile."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR2"] = "Delete not allowed, cannot delete yourself."; L["TITAN_PANEL_MENU_PROFILE_DELETED"] = " wurde gel\195\182scht."; L["TITAN_PANEL_MENU_PROFILE_RELOADUI"] = "UI wird jetzt neu geladen nach dr\195\188cken von 'Okay' und das benutzerdefinierte Profil sichern."; -L["TITAN_PANEL_MENU_PROFILE_RESET"] = "Reset Profile"; -L["TITAN_PANEL_MENU_PROFILE_RESET_DESC"] = "Reset just this profile to defaults."; -L["TITAN_PANEL_MENU_PROFILE_SAVE"] = "Save"; -L["TITAN_PANEL_MENU_PROFILE_SAVE_DESC"] = "Save this profile as a custom profile."; L["TITAN_PANEL_MENU_PROFILE_SAVE_CUSTOM_TITLE"] = "Name f\195\188r benutzerdefiniertes Profil:\n(20 Zeichen max, keine Leerzeichen erlaubt, Gross-/Kleinschreibung beachten) "; L["TITAN_PANEL_MENU_PROFILE_SAVE_PENDING"] = "Aktuelle Leisteneinstellung werden gesichtert unter Profilname: "; L["TITAN_PANEL_MENU_PROFILE_SERVERS"] = "Server"; -L["TITAN_PANEL_MENU_PROFILE_SYNC"] = "Sync"; -L["TITAN_PANEL_MENU_PROFILE_SYNC_DESC"] = "Sync this profile with current character. Changes on current character will be made to this profile."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR1"] = "Sync not allowed, cannot Sync to a toon that has a Sync."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR2"] = "Sync not allowed, cannot Sync to yourself."; L["TITAN_PANEL_MENU_PROFILE"] = "Profil "; L["TITAN_PANEL_MENU_PROFILES"] = "Profile"; L["TITAN_PANEL_MENU_RELOADUI"] = "(UI neuladen)"; L["TITAN_PANEL_MENU_RESET_POSITION"] = (RESET_POSITION or "Reset Position Only") L["TITAN_PANEL_MENU_RESET"] = "Einstellungen zur\195\188cksetzen"; +L["TITAN_PANEL_MENU_SAVE_SETTINGS"] = "Sichern"; L["TITAN_PANEL_MENU_SHOW_COLORED_TEXT"] = "Farbigen Text anzeigen"; L["TITAN_PANEL_MENU_SHOW_ICON"] = "Icon anzeigen"; L["TITAN_PANEL_MENU_SHOW_LABEL_TEXT"] = "Beschriftungstext anzeigen"; @@ -391,7 +377,6 @@ L["TITAN_PANEL_SLASH_RESET_2"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipf L["TITAN_PANEL_SLASH_RESET_3"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipalpha: |cffffffffSetzt Paneltooltip-Transparenz auf Voreinstellung zur\195\188ck."; L["TITAN_PANEL_SLASH_RESET_4"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset panelscale: |cffffffffSetzt Panelgr\195\182\195\159e auf Voreinstellung zur\195\188ck."; L["TITAN_PANEL_SLASH_RESET_5"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset spacing: |cffffffffSetzt Panel-Buttonabstand auf Voreinstellung zur\195\188ck."; -L["TITAN_PANEL_SLASH_RESET_6"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset all: |r|cffffffffResets "..TITAN_PANEL.." to default. Acts as a delete of Titan saved vars.|r"; L["TITAN_PANEL_SLASH_RESP1"] = LIGHTYELLOW_FONT_COLOR_CODE.."Titan Panel Tooltip-Schriftgr\195\182sse wurde zur\195\188ckgesetzt."; L["TITAN_PANEL_SLASH_RESP2"] = LIGHTYELLOW_FONT_COLOR_CODE.."Titan Panel Tooltip-Transparenz wurde zur\195\188ckgesetzt."; L["TITAN_PANEL_SLASH_RESP3"] = LIGHTYELLOW_FONT_COLOR_CODE.."Titan Panel Gr\195\182sse wurde zur\195\188ckgesetzt."; diff --git a/Titan/locale/Localization.ES.lua b/Titan/locale/Localization.ES.lua index eae81d3..927241d 100644 --- a/Titan/locale/Localization.ES.lua +++ b/Titan/locale/Localization.ES.lua @@ -251,6 +251,7 @@ L["TITAN_PANEL_MENU_CENTER_TEXT"] = "Centrar texto"; L["TITAN_PANEL_MENU_CHANGE_HISTORY"] = "Recent Change History" L["TITAN_PANEL_MENU_COMMAND"] = (COMMAND or "Command") L["TITAN_PANEL_MENU_CONFIGURATION"] = "Configuración"; +L["TITAN_PANEL_MENU_DELETE_SETTINGS"] = "Borrar"; L["TITAN_PANEL_MENU_DISABLE_PUSH"] = "Desactivar ajuste de pantalla"; L["TITAN_PANEL_MENU_DISABLED"] = "Desactivado"; L["TITAN_PANEL_MENU_DISPLAY_BAR"] = "Mostrar barra superior"; @@ -272,8 +273,6 @@ L["TITAN_PANEL_MENU_IN_COMBAT_LOCKDOWN"] = "(En combate)"; L["TITAN_PANEL_MENU_LDB_FORCE_LAUNCHER"] = "Forzar lanzadores LDB en el lado derecho"; L["TITAN_PANEL_MENU_LDB_SIDE"] = "Plugin del lado derecho"; L["TITAN_PANEL_MENU_LOAD_SETTINGS"] = "Cargar ajustes"; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_DESC"] = "Copy this profile into the current character."; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_ERR1"] = "Load not allowed, same toon."; L["TITAN_PANEL_MENU_LOCK_BUTTONS"] = "Bloquear botones"; L["TITAN_PANEL_MENU_LSM_FONTS_DESC"] = "Elige el tipo de letra utilizado por los diferentes plugins en las barras "..TITAN_PANEL.."."; L["TITAN_PANEL_MENU_LSM_FONTS"] = "Fuente del Panel"; @@ -290,31 +289,18 @@ L["TITAN_PANEL_MENU_PLUGINS"] = "Plugins"; L["TITAN_PANEL_MENU_POSITION"] = "Posición"; L["TITAN_PANEL_MENU_PROFILE_ALREADY_EXISTS"] = "El nombre de perfil introducido ya existe. ¿Estás seguro de que quieres sobreescribirlo? Pulsa 'Aceptar' si lo deseas, de lo contrario pulsa 'Cancelar' o la tecla 'Escape'."; L["TITAN_PANEL_MENU_PROFILE_CHARS"] = "Personaje"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC"] = "Clear Sync"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC_DESC"] = "Clear Sync to use profile of this toon."; L["TITAN_PANEL_MENU_PROFILE_CUSTOM"] = "Personalizado"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS"] = "Delete"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_DESC"] = "Delete this profile from the list."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR1"] = "Delete not allowed, used as Sync by another profile."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR2"] = "Delete not allowed, cannot delete yourself."; L["TITAN_PANEL_MENU_PROFILE_DELETED"] = " ha sido borrado."; L["TITAN_PANEL_MENU_PROFILE_RELOADUI"] = "Se recargará tu interfaz en cuanto pulses 'Ok' para poder grabar tu perfil personalizado."; -L["TITAN_PANEL_MENU_PROFILE_RESET"] = "Reset Profile"; -L["TITAN_PANEL_MENU_PROFILE_RESET_DESC"] = "Reset just this profile to defaults."; -L["TITAN_PANEL_MENU_PROFILE_SAVE"] = "Save"; -L["TITAN_PANEL_MENU_PROFILE_SAVE_DESC"] = "Save this profile as a custom profile."; L["TITAN_PANEL_MENU_PROFILE_SAVE_CUSTOM_TITLE"] = "Introduce un nombre para tu perfil personalizado::\n(20 carácteres máximo, sin espacios, diferencia entre mayúsculas y minúsculas)"; L["TITAN_PANEL_MENU_PROFILE_SAVE_PENDING"] = "La configuración actual del panel se va a grabar en el perfil llamado: "; L["TITAN_PANEL_MENU_PROFILE_SERVERS"] = "Servidor"; -L["TITAN_PANEL_MENU_PROFILE_SYNC"] = "Sync"; -L["TITAN_PANEL_MENU_PROFILE_SYNC_DESC"] = "Sync this profile with current character. Changes on current character will be made to this profile."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR1"] = "Sync not allowed, cannot Sync to a toon that has a Sync."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR2"] = "Sync not allowed, cannot Sync to yourself."; L["TITAN_PANEL_MENU_PROFILE"] = "Perfil "; L["TITAN_PANEL_MENU_PROFILES"] = "Perfiles"; L["TITAN_PANEL_MENU_RELOADUI"] = "(Recargar IU)"; L["TITAN_PANEL_MENU_RESET_POSITION"] = (RESET_POSITION or "Reset Position Only") L["TITAN_PANEL_MENU_RESET"] = "Volver a los ajustes por defecto de "..TITAN_PANEL; +L["TITAN_PANEL_MENU_SAVE_SETTINGS"] = "Grabar"; L["TITAN_PANEL_MENU_SHOW_COLORED_TEXT"] = "Mostrar texto en color"; L["TITAN_PANEL_MENU_SHOW_ICON"] = "Mostrar icono"; L["TITAN_PANEL_MENU_SHOW_LABEL_TEXT"] = "Mostrar etiqueta de texto"; @@ -392,7 +378,6 @@ L["TITAN_PANEL_SLASH_RESET_2"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipf L["TITAN_PANEL_SLASH_RESET_3"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipalpha: |cffffffffRestablece la transparencia de los tooltips a su valor por defecto."; L["TITAN_PANEL_SLASH_RESET_4"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset panelscale: |cffffffffRestablece la escala de "..TITAN_PANEL.." a su valor por defecto."; L["TITAN_PANEL_SLASH_RESET_5"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset spacing: |cffffffffRestablece el espaciado de los botones de "..TITAN_PANEL.." a su valor por defecto."; -L["TITAN_PANEL_SLASH_RESET_6"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset all: |r|cffffffffResets "..TITAN_PANEL.." to default. Acts as a delete of Titan saved vars.|r"; L["TITAN_PANEL_SLASH_RESP1"] = LIGHTYELLOW_FONT_COLOR_CODE.."La escala de la fuente en los tooltips de Titan Panel ha sido restableceda."; L["TITAN_PANEL_SLASH_RESP2"] = LIGHTYELLOW_FONT_COLOR_CODE.."La transparencia de los tooltips de Titan Panel ha sido restableceda."; L["TITAN_PANEL_SLASH_RESP3"] = LIGHTYELLOW_FONT_COLOR_CODE.."La escala de Titan Panel ha sido restableceda."; diff --git a/Titan/locale/Localization.FR.lua b/Titan/locale/Localization.FR.lua index 184c522..663a29c 100644 --- a/Titan/locale/Localization.FR.lua +++ b/Titan/locale/Localization.FR.lua @@ -250,6 +250,7 @@ L["TITAN_PANEL_MENU_CENTER_TEXT"] = "Centrer le texte"; L["TITAN_PANEL_MENU_CHANGE_HISTORY"] = "Recent Change History" L["TITAN_PANEL_MENU_COMMAND"] = (COMMAND or "Command") L["TITAN_PANEL_MENU_CONFIGURATION"] = "Configuration"; +L["TITAN_PANEL_MENU_DELETE_SETTINGS"] = "Suppression"; L["TITAN_PANEL_MENU_DISABLE_PUSH"] = "Ne pas ajuster l'écran"; L["TITAN_PANEL_MENU_DISABLED"] = "Désactivé"; L["TITAN_PANEL_MENU_DISPLAY_BAR"] = "Afficher la barre"; @@ -271,8 +272,6 @@ L["TITAN_PANEL_MENU_IN_COMBAT_LOCKDOWN"] = "(En Combat)"; L["TITAN_PANEL_MENU_LDB_FORCE_LAUNCHER"] = "Forcer les launchers du côté droit"; L["TITAN_PANEL_MENU_LDB_SIDE"] = "Plugin du côté droit"; L["TITAN_PANEL_MENU_LOAD_SETTINGS"] = "Chargement"; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_DESC"] = "Copy this profile into the current character."; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_ERR1"] = "Load not allowed, same toon."; L["TITAN_PANEL_MENU_LOCK_BUTTONS"] = "Verrouiller les boutons"; L["TITAN_PANEL_MENU_LSM_FONTS_DESC"] = "Sélectionne la police pour les divers plugins sur les barres de "..TITAN_PANEL.."."; L["TITAN_PANEL_MENU_LSM_FONTS"] = "Police des panneaux"; @@ -289,31 +288,18 @@ L["TITAN_PANEL_MENU_PLUGINS"] = "Plug-ins"; L["TITAN_PANEL_MENU_POSITION"] = "Position"; L["TITAN_PANEL_MENU_PROFILE_ALREADY_EXISTS"] = "Le nom du profil existe déjà. Veuillez saisir un autre nom."; L["TITAN_PANEL_MENU_PROFILE_CHARS"] = "Personnage"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC"] = "Clear Sync"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC_DESC"] = "Clear Sync to use profile of this toon."; L["TITAN_PANEL_MENU_PROFILE_CUSTOM"] = "Personnalisation"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS"] = "Delete"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_DESC"] = "Delete this profile from the list."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR1"] = "Delete not allowed, used as Sync by another profile."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR2"] = "Delete not allowed, cannot delete yourself."; L["TITAN_PANEL_MENU_PROFILE_DELETED"] = " a été supprimé."; L["TITAN_PANEL_MENU_PROFILE_RELOADUI"] = "L'interface va maintenant être recharcée lorsque vous appuierez sur 'OK' pour permettre d'enregistrer votre profil perso."; -L["TITAN_PANEL_MENU_PROFILE_RESET"] = "Reset Profile"; -L["TITAN_PANEL_MENU_PROFILE_RESET_DESC"] = "Reset just this profile to defaults."; -L["TITAN_PANEL_MENU_PROFILE_SAVE"] = "Save"; -L["TITAN_PANEL_MENU_PROFILE_SAVE_DESC"] = "Save this profile as a custom profile."; L["TITAN_PANEL_MENU_PROFILE_SAVE_CUSTOM_TITLE"] = "Entrez un nom pour votre profil perso :\n(20 lettres max, pas d'espaces)"; L["TITAN_PANEL_MENU_PROFILE_SAVE_PENDING"] = "Les paramètres actuels vont être enregistrés sous le profil : "; L["TITAN_PANEL_MENU_PROFILE_SERVERS"] = "Serveur"; -L["TITAN_PANEL_MENU_PROFILE_SYNC"] = "Sync"; -L["TITAN_PANEL_MENU_PROFILE_SYNC_DESC"] = "Sync this profile with current character. Changes on current character will be made to this profile."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR1"] = "Sync not allowed, cannot Sync to a toon that has a Sync."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR2"] = "Sync not allowed, cannot Sync to yourself."; L["TITAN_PANEL_MENU_PROFILE"] = "Profil "; L["TITAN_PANEL_MENU_PROFILES"] = "Profils"; L["TITAN_PANEL_MENU_RELOADUI"] = "(Recharge l'interface)"; L["TITAN_PANEL_MENU_RESET_POSITION"] = (RESET_POSITION or "Reset Position Only") L["TITAN_PANEL_MENU_RESET"] = "Réinitialiser "..TITAN_PANEL; +L["TITAN_PANEL_MENU_SAVE_SETTINGS"] = "Sauvegarde"; L["TITAN_PANEL_MENU_SHOW_COLORED_TEXT"] = "Colorer le texte"; L["TITAN_PANEL_MENU_SHOW_ICON"] = "Montrer l'icône"; L["TITAN_PANEL_MENU_SHOW_LABEL_TEXT"] = "Montrer le titre"; @@ -391,7 +377,6 @@ L["TITAN_PANEL_SLASH_RESET_2"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipf L["TITAN_PANEL_SLASH_RESET_3"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipalpha: |cffffffffRéinitialise la transparence des tooltips de "..TITAN_PANEL.."."; L["TITAN_PANEL_SLASH_RESET_4"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset panelscale: |cffffffffRéinitialise l'échelle de "..TITAN_PANEL.."."; L["TITAN_PANEL_SLASH_RESET_5"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset spacing: |cffffffffRéinitialise l'espacement des boutons de "..TITAN_PANEL.."."; -L["TITAN_PANEL_SLASH_RESET_6"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset all: |r|cffffffffResets "..TITAN_PANEL.." to default. Acts as a delete of Titan saved vars.|r"; L["TITAN_PANEL_SLASH_RESP1"] = LIGHTYELLOW_FONT_COLOR_CODE.."L'échelle des polices des tooltips de "..TITAN_PANEL.." a été réinitialisée."; L["TITAN_PANEL_SLASH_RESP2"] = LIGHTYELLOW_FONT_COLOR_CODE.."La transparence des tooltips de "..TITAN_PANEL.." a été réinitialisée."; L["TITAN_PANEL_SLASH_RESP3"] = LIGHTYELLOW_FONT_COLOR_CODE.."L'échelle de "..TITAN_PANEL.." a été réinitialisée."; diff --git a/Titan/locale/Localization.IT.lua b/Titan/locale/Localization.IT.lua index b7237f5..7468c5d 100644 --- a/Titan/locale/Localization.IT.lua +++ b/Titan/locale/Localization.IT.lua @@ -250,6 +250,7 @@ L["TITAN_PANEL_MENU_CENTER_TEXT"] = "Testo Centrale"; L["TITAN_PANEL_MENU_CHANGE_HISTORY"] = "Recent Change History" L["TITAN_PANEL_MENU_COMMAND"] = (COMMAND or "Command") L["TITAN_PANEL_MENU_CONFIGURATION"] = "Configurazione"; +L["TITAN_PANEL_MENU_DELETE_SETTINGS"] = "Elimina"; L["TITAN_PANEL_MENU_DISABLE_PUSH"] = "Disabilita adattamento allo schermo"; L["TITAN_PANEL_MENU_DISABLED"] = "Disabilita"; L["TITAN_PANEL_MENU_DISPLAY_BAR"] = "Mostra barra"; @@ -271,8 +272,6 @@ L["TITAN_PANEL_MENU_IN_COMBAT_LOCKDOWN"] = "(In combattimento)"; L["TITAN_PANEL_MENU_LDB_FORCE_LAUNCHER"] = "Forza il posizionamento dei lanciatori LDB a destra"; L["TITAN_PANEL_MENU_LDB_SIDE"] = "Plugin di destra"; L["TITAN_PANEL_MENU_LOAD_SETTINGS"] = "Carica"; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_DESC"] = "Copy this profile into the current character."; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_ERR1"] = "Load not allowed, same toon."; L["TITAN_PANEL_MENU_LOCK_BUTTONS"] = "Blocca Bottoni"; L["TITAN_PANEL_MENU_LSM_FONTS_DESC"] = "Scegli il tipo di font per i plugin delle barre di "..TITAN_PANEL.."."; L["TITAN_PANEL_MENU_LSM_FONTS"] = "Font Finestre"; @@ -289,31 +288,18 @@ L["TITAN_PANEL_MENU_PLUGINS"] = "Plugins"; L["TITAN_PANEL_MENU_POSITION"] = "Posizione"; L["TITAN_PANEL_MENU_PROFILE_ALREADY_EXISTS"] = "Il nome profilo inserito esiste già. Sei sicuro di volerlo sovrascrivere? Premi 'Accetta' se si, altrimenti premi 'Annulla' o il tasto 'Cancella."; L["TITAN_PANEL_MENU_PROFILE_CHARS"] = "Personaggio"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC"] = "Clear Sync"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC_DESC"] = "Clear Sync to use profile of this toon."; L["TITAN_PANEL_MENU_PROFILE_CUSTOM"] = "Personalizzato"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS"] = "Delete"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_DESC"] = "Delete this profile from the list."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR1"] = "Delete not allowed, used as Sync by another profile."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR2"] = "Delete not allowed, cannot delete yourself."; L["TITAN_PANEL_MENU_PROFILE_DELETED"] = " è stato eliminato."; L["TITAN_PANEL_MENU_PROFILE_RELOADUI"] = "L'IU verrà ricaricata premento 'OK' per permettere il salvataggio del tuo profilo personalizzato."; -L["TITAN_PANEL_MENU_PROFILE_RESET"] = "Reset Profile"; -L["TITAN_PANEL_MENU_PROFILE_RESET_DESC"] = "Reset just this profile to defaults."; -L["TITAN_PANEL_MENU_PROFILE_SAVE"] = "Save"; -L["TITAN_PANEL_MENU_PROFILE_SAVE_DESC"] = "Save this profile as a custom profile."; L["TITAN_PANEL_MENU_PROFILE_SAVE_CUSTOM_TITLE"] = "Inserisci un nome per il tuo profilo personalizzato:\n(20 caratteri massimo, spazi non permessii, case sensitive)"; L["TITAN_PANEL_MENU_PROFILE_SAVE_PENDING"] = "Le impostazioni in uso verranno salvate con il nome profilo: "; L["TITAN_PANEL_MENU_PROFILE_SERVERS"] = "Server"; -L["TITAN_PANEL_MENU_PROFILE_SYNC"] = "Sync"; -L["TITAN_PANEL_MENU_PROFILE_SYNC_DESC"] = "Sync this profile with current character. Changes on current character will be made to this profile."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR1"] = "Sync not allowed, cannot Sync to a toon that has a Sync."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR2"] = "Sync not allowed, cannot Sync to yourself."; L["TITAN_PANEL_MENU_PROFILE"] = "Profilo "; L["TITAN_PANEL_MENU_PROFILES"] = "Profili"; L["TITAN_PANEL_MENU_RELOADUI"] = "(Ricarica l'IU)"; L["TITAN_PANEL_MENU_RESET_POSITION"] = (RESET_POSITION or "Reset Position Only") L["TITAN_PANEL_MENU_RESET"] = "Reimposta "..TITAN_PANEL; +L["TITAN_PANEL_MENU_SAVE_SETTINGS"] = "Salva"; L["TITAN_PANEL_MENU_SHOW_COLORED_TEXT"] = "Mostra testo colorato"; L["TITAN_PANEL_MENU_SHOW_ICON"] = "Mostra icona"; L["TITAN_PANEL_MENU_SHOW_LABEL_TEXT"] = "Mostra testo"; @@ -391,7 +377,6 @@ L["TITAN_PANEL_SLASH_RESET_2"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipf L["TITAN_PANEL_SLASH_RESET_3"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipalpha: |cffffffffReimposta "..TITAN_PANEL.." la trasparenza dei font dei tooltip."; L["TITAN_PANEL_SLASH_RESET_4"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset panelscale: |cffffffffReimposta "..TITAN_PANEL.." la scala."; L["TITAN_PANEL_SLASH_RESET_5"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset spacing: |cffffffffReimposta "..TITAN_PANEL.." la spaziatura tra i pulsanti."; -L["TITAN_PANEL_SLASH_RESET_6"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset all: |r|cffffffffResets "..TITAN_PANEL.." to default. Acts as a delete of Titan saved vars.|r"; L["TITAN_PANEL_SLASH_RESP1"] = LIGHTYELLOW_FONT_COLOR_CODE..TITAN_PANEL.." la scala del font dei tooltip è stata reimpostata."; L["TITAN_PANEL_SLASH_RESP2"] = LIGHTYELLOW_FONT_COLOR_CODE..TITAN_PANEL.." la trasparenza dei tooltip è stata reimpostata."; L["TITAN_PANEL_SLASH_RESP3"] = LIGHTYELLOW_FONT_COLOR_CODE..TITAN_PANEL.." la scala è stata reimpostata."; diff --git a/Titan/locale/Localization.KR.lua b/Titan/locale/Localization.KR.lua index 7c70f23..6da8834 100644 --- a/Titan/locale/Localization.KR.lua +++ b/Titan/locale/Localization.KR.lua @@ -251,6 +251,7 @@ L["TITAN_PANEL_MENU_CENTER_TEXT"] = "중앙 글자"; L["TITAN_PANEL_MENU_CHANGE_HISTORY"] = "Recent Change History" L["TITAN_PANEL_MENU_COMMAND"] = (COMMAND or "Command") L["TITAN_PANEL_MENU_CONFIGURATION"] = "설정"; +L["TITAN_PANEL_MENU_DELETE_SETTINGS"] = "삭제"; L["TITAN_PANEL_MENU_DISABLE_PUSH"] = "화면 보정 불가"; L["TITAN_PANEL_MENU_DISABLED"] = "중지"; L["TITAN_PANEL_MENU_DISPLAY_BAR"] = "바 표시"; @@ -272,8 +273,6 @@ L["TITAN_PANEL_MENU_IN_COMBAT_LOCKDOWN"] = "(전투중)"; L["TITAN_PANEL_MENU_LDB_FORCE_LAUNCHER"] = "LDB 실행을 오른쪽으로 배치 합니다."; L["TITAN_PANEL_MENU_LDB_SIDE"] = "오른쪽 플러그인"; L["TITAN_PANEL_MENU_LOAD_SETTINGS"] = "불러옴"; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_DESC"] = "Copy this profile into the current character."; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_ERR1"] = "Load not allowed, same toon."; L["TITAN_PANEL_MENU_LOCK_BUTTONS"] = "버튼 고정"; L["TITAN_PANEL_MENU_LSM_FONTS_DESC"] = "타이탄 플러그인의 글꼴을 변경합니다."; L["TITAN_PANEL_MENU_LSM_FONTS"] = "패널 글꼴"; @@ -290,31 +289,18 @@ L["TITAN_PANEL_MENU_PLUGINS"] = "플러그인"; L["TITAN_PANEL_MENU_POSITION"] = "위치"; L["TITAN_PANEL_MENU_PROFILE_ALREADY_EXISTS"] = "입력한 프로필 이름이 있습니다. 덮어씌우시겠습니까? 덮어씌우려면 확인 버튼을 누루시고, 취소하려면 취소 버튼이나 ESC키를 눌러주세요."; L["TITAN_PANEL_MENU_PROFILE_CHARS"] = "캐릭터"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC"] = "Clear Sync"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC_DESC"] = "Clear Sync to use profile of this toon."; L["TITAN_PANEL_MENU_PROFILE_CUSTOM"] = "사용자"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS"] = "Delete"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_DESC"] = "Delete this profile from the list."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR1"] = "Delete not allowed, used as Sync by another profile."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR2"] = "Delete not allowed, cannot delete yourself."; L["TITAN_PANEL_MENU_PROFILE_DELETED"] = " 삭제되었습니다."; L["TITAN_PANEL_MENU_PROFILE_RELOADUI"] = "사용자 프로필을 저장하려면 UI를 재시작해야 합니다. 확인 버튼을 누르세요."; -L["TITAN_PANEL_MENU_PROFILE_RESET"] = "Reset Profile"; -L["TITAN_PANEL_MENU_PROFILE_RESET_DESC"] = "Reset just this profile to defaults."; -L["TITAN_PANEL_MENU_PROFILE_SAVE"] = "Save"; -L["TITAN_PANEL_MENU_PROFILE_SAVE_DESC"] = "Save this profile as a custom profile."; L["TITAN_PANEL_MENU_PROFILE_SAVE_CUSTOM_TITLE"] = "사용자 프로필의 이름을 입력하세요.:\n(한글 10글자, 영문 20글자, 띄어쓰기 없음, 대소문자 구별)"; L["TITAN_PANEL_MENU_PROFILE_SAVE_PENDING"] = "현재 설정이 저장될 프로필 이름: "; L["TITAN_PANEL_MENU_PROFILE_SERVERS"] = "서버"; -L["TITAN_PANEL_MENU_PROFILE_SYNC"] = "Sync"; -L["TITAN_PANEL_MENU_PROFILE_SYNC_DESC"] = "Sync this profile with current character. Changes on current character will be made to this profile."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR1"] = "Sync not allowed, cannot Sync to a toon that has a Sync."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR2"] = "Sync not allowed, cannot Sync to yourself."; L["TITAN_PANEL_MENU_PROFILE"] = "프로필 "; L["TITAN_PANEL_MENU_PROFILES"] = "프로필"; L["TITAN_PANEL_MENU_RELOADUI"] = "(UI 재시작)"; L["TITAN_PANEL_MENU_RESET_POSITION"] = (RESET_POSITION or "Reset Position Only") L["TITAN_PANEL_MENU_RESET"] = "패널을 초기값으로 되돌립니다."; +L["TITAN_PANEL_MENU_SAVE_SETTINGS"] = "저장"; L["TITAN_PANEL_MENU_SHOW_COLORED_TEXT"] = "색상화 글자 표시"; L["TITAN_PANEL_MENU_SHOW_ICON"] = "아이콘 표시"; L["TITAN_PANEL_MENU_SHOW_LABEL_TEXT"] = "라벨 글자 표시"; @@ -392,7 +378,6 @@ L["TITAN_PANEL_SLASH_RESET_2"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipf L["TITAN_PANEL_SLASH_RESET_3"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipalpha: |cffffffff초기화 - "..TITAN_PANEL.."툴팁 투명도"; L["TITAN_PANEL_SLASH_RESET_4"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset panelscale: |cffffffff초기화 - "..TITAN_PANEL.."크기"; L["TITAN_PANEL_SLASH_RESET_5"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset spacing: |cffffffff초기화 - "..TITAN_PANEL.."버튼 간격"; -L["TITAN_PANEL_SLASH_RESET_6"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset all: |r|cffffffffResets "..TITAN_PANEL.." to default. Acts as a delete of Titan saved vars.|r"; L["TITAN_PANEL_SLASH_RESP1"] = LIGHTYELLOW_FONT_COLOR_CODE..TITAN_PANEL.." 툴팁 글꼴 크기가 초기화 되었습니다."; L["TITAN_PANEL_SLASH_RESP2"] = LIGHTYELLOW_FONT_COLOR_CODE..TITAN_PANEL.." 툴팁 투명도가 초기화 되었습니다."; L["TITAN_PANEL_SLASH_RESP3"] = LIGHTYELLOW_FONT_COLOR_CODE..TITAN_PANEL.." 크기가 초기화 되었습니다."; diff --git a/Titan/locale/Localization.MX.lua b/Titan/locale/Localization.MX.lua index a269249..25628ce 100644 --- a/Titan/locale/Localization.MX.lua +++ b/Titan/locale/Localization.MX.lua @@ -251,6 +251,7 @@ L["TITAN_PANEL_MENU_CENTER_TEXT"] = "Centrar texto"; L["TITAN_PANEL_MENU_CHANGE_HISTORY"] = "Recent Change History" L["TITAN_PANEL_MENU_COMMAND"] = (COMMAND or "Command") L["TITAN_PANEL_MENU_CONFIGURATION"] = "Configuración"; +L["TITAN_PANEL_MENU_DELETE_SETTINGS"] = "Borrar"; L["TITAN_PANEL_MENU_DISABLE_PUSH"] = "Desactivar ajuste de pantalla"; L["TITAN_PANEL_MENU_DISABLED"] = "Desactivado"; L["TITAN_PANEL_MENU_DISPLAY_BAR"] = "Mostrar barra superior"; @@ -272,8 +273,6 @@ L["TITAN_PANEL_MENU_IN_COMBAT_LOCKDOWN"] = "(En combate)"; L["TITAN_PANEL_MENU_LDB_FORCE_LAUNCHER"] = "Forzar lanzadores LDB en el lado derecho"; L["TITAN_PANEL_MENU_LDB_SIDE"] = "Plugin del lado derecho"; L["TITAN_PANEL_MENU_LOAD_SETTINGS"] = "Cargar ajustes"; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_DESC"] = "Copy this profile into the current character."; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_ERR1"] = "Load not allowed, same toon."; L["TITAN_PANEL_MENU_LOCK_BUTTONS"] = "Bloquear botones"; L["TITAN_PANEL_MENU_LSM_FONTS_DESC"] = "Elige el tipo de letra utilizado por los diferentes plugins en las barras "..TITAN_PANEL.."."; L["TITAN_PANEL_MENU_LSM_FONTS"] = "Fuente del Panel"; @@ -290,31 +289,18 @@ L["TITAN_PANEL_MENU_PLUGINS"] = "Plugins"; L["TITAN_PANEL_MENU_POSITION"] = "Posición"; L["TITAN_PANEL_MENU_PROFILE_ALREADY_EXISTS"] = "El nombre de perfil introducido ya existe. ¿Estás seguro de que quieres sobreescribirlo? Pulsa 'Aceptar' si lo deseas, de lo contrario pulsa 'Cancelar' o la tecla 'Escape'."; L["TITAN_PANEL_MENU_PROFILE_CHARS"] = "Personaje"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC"] = "Clear Sync"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC_DESC"] = "Clear Sync to use profile of this toon."; L["TITAN_PANEL_MENU_PROFILE_CUSTOM"] = "Personalizado"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS"] = "Delete"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_DESC"] = "Delete this profile from the list."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR1"] = "Delete not allowed, used as Sync by another profile."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR2"] = "Delete not allowed, cannot delete yourself."; L["TITAN_PANEL_MENU_PROFILE_DELETED"] = " ha sido borrado."; L["TITAN_PANEL_MENU_PROFILE_RELOADUI"] = "Se recargará tu interfaz en cuanto pulses 'Ok' para poder grabar tu perfil personalizado."; -L["TITAN_PANEL_MENU_PROFILE_RESET"] = "Reset Profile"; -L["TITAN_PANEL_MENU_PROFILE_RESET_DESC"] = "Reset just this profile to defaults."; -L["TITAN_PANEL_MENU_PROFILE_SAVE"] = "Save"; -L["TITAN_PANEL_MENU_PROFILE_SAVE_DESC"] = "Save this profile as a custom profile."; L["TITAN_PANEL_MENU_PROFILE_SAVE_CUSTOM_TITLE"] = "Introduce un nombre para tu perfil personalizado::\n(20 carácteres máximo, sin espacios, diferencia entre mayúsculas y minúsculas)"; L["TITAN_PANEL_MENU_PROFILE_SAVE_PENDING"] = "La configuración actual del panel se va a grabar en el perfil llamado: "; L["TITAN_PANEL_MENU_PROFILE_SERVERS"] = "Servidor"; -L["TITAN_PANEL_MENU_PROFILE_SYNC"] = "Sync"; -L["TITAN_PANEL_MENU_PROFILE_SYNC_DESC"] = "Sync this profile with current character. Changes on current character will be made to this profile."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR1"] = "Sync not allowed, cannot Sync to a toon that has a Sync."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR2"] = "Sync not allowed, cannot Sync to yourself."; L["TITAN_PANEL_MENU_PROFILE"] = "Perfil "; L["TITAN_PANEL_MENU_PROFILES"] = "Perfiles"; L["TITAN_PANEL_MENU_RELOADUI"] = "(Recargar IU)"; L["TITAN_PANEL_MENU_RESET_POSITION"] = (RESET_POSITION or "Reset Position Only") L["TITAN_PANEL_MENU_RESET"] = "Volver a los ajustes por defecto de "..TITAN_PANEL; +L["TITAN_PANEL_MENU_SAVE_SETTINGS"] = "Grabar"; L["TITAN_PANEL_MENU_SHOW_COLORED_TEXT"] = "Mostrar texto en color"; L["TITAN_PANEL_MENU_SHOW_ICON"] = "Mostrar icono"; L["TITAN_PANEL_MENU_SHOW_LABEL_TEXT"] = "Mostrar etiqueta de texto"; @@ -392,7 +378,6 @@ L["TITAN_PANEL_SLASH_RESET_2"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipf L["TITAN_PANEL_SLASH_RESET_3"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipalpha: |cffffffffRestablece la transparencia de los tooltips a su valor por defecto."; L["TITAN_PANEL_SLASH_RESET_4"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset panelscale: |cffffffffRestablece la escala de "..TITAN_PANEL.." a su valor por defecto."; L["TITAN_PANEL_SLASH_RESET_5"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset spacing: |cffffffffRestablece el espaciado de los botones de "..TITAN_PANEL.." a su valor por defecto."; -L["TITAN_PANEL_SLASH_RESET_6"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset all: |r|cffffffffResets "..TITAN_PANEL.." to default. Acts as a delete of Titan saved vars.|r"; L["TITAN_PANEL_SLASH_RESP1"] = LIGHTYELLOW_FONT_COLOR_CODE.."La escala de la fuente en los tooltips de Titan Panel ha sido restableceda."; L["TITAN_PANEL_SLASH_RESP2"] = LIGHTYELLOW_FONT_COLOR_CODE.."La transparencia de los tooltips de Titan Panel ha sido restableceda."; L["TITAN_PANEL_SLASH_RESP3"] = LIGHTYELLOW_FONT_COLOR_CODE.."La escala de Titan Panel ha sido restableceda."; diff --git a/Titan/locale/Localization.RU.lua b/Titan/locale/Localization.RU.lua index 5ddaf07..27c8c21 100644 --- a/Titan/locale/Localization.RU.lua +++ b/Titan/locale/Localization.RU.lua @@ -250,6 +250,7 @@ L["TITAN_PANEL_MENU_CENTER_TEXT"] = "Текст в центре"; L["TITAN_PANEL_MENU_CHANGE_HISTORY"] = "Recent Change History" L["TITAN_PANEL_MENU_COMMAND"] = (COMMAND or "Command") L["TITAN_PANEL_MENU_CONFIGURATION"] = "Конфигурация"; +L["TITAN_PANEL_MENU_DELETE_SETTINGS"] = "Удалить"; L["TITAN_PANEL_MENU_DISABLE_PUSH"] = "Выключить подстройку экрана"; L["TITAN_PANEL_MENU_DISABLED"] = "Отключен"; L["TITAN_PANEL_MENU_DISPLAY_BAR"] = "Показать панель"; @@ -271,8 +272,6 @@ L["TITAN_PANEL_MENU_IN_COMBAT_LOCKDOWN"] = "(В Бою)"; L["TITAN_PANEL_MENU_LDB_FORCE_LAUNCHER"] = "Направить модули запусков в правую сторону"; L["TITAN_PANEL_MENU_LDB_SIDE"] = "Плагин справа"; L["TITAN_PANEL_MENU_LOAD_SETTINGS"] = "Загрузить настройки"; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_DESC"] = "Copy this profile into the current character."; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_ERR1"] = "Load not allowed, same toon."; L["TITAN_PANEL_MENU_LOCK_BUTTONS"] = "Блокировать кнопки"; L["TITAN_PANEL_MENU_LSM_FONTS_DESC"] = "Выберите тип шрифтов для различных плагинов на Титан панеле."; L["TITAN_PANEL_MENU_LSM_FONTS"] = "Шрифт панели"; @@ -289,31 +288,18 @@ L["TITAN_PANEL_MENU_PLUGINS"] = "Плагины"; L["TITAN_PANEL_MENU_POSITION"] = "Позиция"; L["TITAN_PANEL_MENU_PROFILE_ALREADY_EXISTS"] = "Введенное имя профиля уже существует. Пожалуйста введите уникальное имя."; L["TITAN_PANEL_MENU_PROFILE_CHARS"] = "Персонаж"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC"] = "Clear Sync"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC_DESC"] = "Clear Sync to use profile of this toon."; L["TITAN_PANEL_MENU_PROFILE_CUSTOM"] = "Выборочный"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS"] = "Delete"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_DESC"] = "Delete this profile from the list."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR1"] = "Delete not allowed, used as Sync by another profile."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR2"] = "Delete not allowed, cannot delete yourself."; L["TITAN_PANEL_MENU_PROFILE_DELETED"] = " удален."; L["TITAN_PANEL_MENU_PROFILE_RELOADUI"] = "Ваш UI будет перезагружен после нажатия 'Okay' для сохранения вашего профиля."; -L["TITAN_PANEL_MENU_PROFILE_RESET"] = "Reset Profile"; -L["TITAN_PANEL_MENU_PROFILE_RESET_DESC"] = "Reset just this profile to defaults."; -L["TITAN_PANEL_MENU_PROFILE_SAVE"] = "Save"; -L["TITAN_PANEL_MENU_PROFILE_SAVE_DESC"] = "Save this profile as a custom profile."; L["TITAN_PANEL_MENU_PROFILE_SAVE_CUSTOM_TITLE"] = "Введите имя вашего профиля:\n(Макс 20 букв, пропуск недопустим)"; L["TITAN_PANEL_MENU_PROFILE_SAVE_PENDING"] = "Настройки текущей панели будут сохранены под названием профиля: "; L["TITAN_PANEL_MENU_PROFILE_SERVERS"] = "Сервер"; -L["TITAN_PANEL_MENU_PROFILE_SYNC"] = "Sync"; -L["TITAN_PANEL_MENU_PROFILE_SYNC_DESC"] = "Sync this profile with current character. Changes on current character will be made to this profile."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR1"] = "Sync not allowed, cannot Sync to a toon that has a Sync."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR2"] = "Sync not allowed, cannot Sync to yourself."; L["TITAN_PANEL_MENU_PROFILE"] = "Профиль "; L["TITAN_PANEL_MENU_PROFILES"] = "Профиля"; L["TITAN_PANEL_MENU_RELOADUI"] = "(Перезагрузить ПИ)"; L["TITAN_PANEL_MENU_RESET_POSITION"] = (RESET_POSITION or "Reset Position Only") L["TITAN_PANEL_MENU_RESET"] = "Сброс панели на стандарт"; +L["TITAN_PANEL_MENU_SAVE_SETTINGS"] = "Сохранить"; L["TITAN_PANEL_MENU_SHOW_COLORED_TEXT"] = "Показывать цветной текст"; L["TITAN_PANEL_MENU_SHOW_ICON"] = "Показывать иконку"; L["TITAN_PANEL_MENU_SHOW_LABEL_TEXT"] = "Текст ярлыка"; @@ -391,7 +377,6 @@ L["TITAN_PANEL_SLASH_RESET_2"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipf L["TITAN_PANEL_SLASH_RESET_3"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipalpha: |cffffffffСбрасывает прозрачность подсказки панели на стандартное значение."; L["TITAN_PANEL_SLASH_RESET_4"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset panelscale: |cffffffffСбрасывает масштаб на стандартное значение."; L["TITAN_PANEL_SLASH_RESET_5"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset spacing: |cffffffffСбрасывает расстояние кнопок на стандартное значение."; -L["TITAN_PANEL_SLASH_RESET_6"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset all: |r|cffffffffResets "..TITAN_PANEL.." to default. Acts as a delete of Titan saved vars.|r"; L["TITAN_PANEL_SLASH_RESP1"] = LIGHTYELLOW_FONT_COLOR_CODE.."Масштаб шрифта подсказки Titan Panel сброшен."; L["TITAN_PANEL_SLASH_RESP2"] = LIGHTYELLOW_FONT_COLOR_CODE.."Прозрачность шрифта подсказки Titan Panel сброшена."; L["TITAN_PANEL_SLASH_RESP3"] = LIGHTYELLOW_FONT_COLOR_CODE.."Масштаб Titan Panel сброшен."; diff --git a/Titan/locale/Localization.TW.lua b/Titan/locale/Localization.TW.lua index 900e396..7701401 100644 --- a/Titan/locale/Localization.TW.lua +++ b/Titan/locale/Localization.TW.lua @@ -250,6 +250,7 @@ L["TITAN_PANEL_MENU_CENTER_TEXT"] = "文字置中"; L["TITAN_PANEL_MENU_CHANGE_HISTORY"] = "Recent Change History" L["TITAN_PANEL_MENU_COMMAND"] = (COMMAND or "Command") L["TITAN_PANEL_MENU_CONFIGURATION"] = "配置設定"; +L["TITAN_PANEL_MENU_DELETE_SETTINGS"] = "刪除"; L["TITAN_PANEL_MENU_DISABLE_PUSH"] = "關閉螢幕調整"; L["TITAN_PANEL_MENU_DISABLED"] = "停用"; L["TITAN_PANEL_MENU_DISPLAY_BAR"] = "Show Bar"; @@ -271,8 +272,6 @@ L["TITAN_PANEL_MENU_IN_COMBAT_LOCKDOWN"] = "(戰鬥中)"; L["TITAN_PANEL_MENU_LDB_FORCE_LAUNCHER"] = "強制快捷列於右側"; L["TITAN_PANEL_MENU_LDB_SIDE"] = "右側插件"; L["TITAN_PANEL_MENU_LOAD_SETTINGS"] = "載入設定"; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_DESC"] = "Copy this profile into the current character."; -L["TITAN_PANEL_MENU_LOAD_SETTINGS_ERR1"] = "Load not allowed, same toon."; L["TITAN_PANEL_MENU_LOCK_BUTTONS"] = "鎖定面板"; L["TITAN_PANEL_MENU_LSM_FONTS_DESC"] = "選擇泰坦條上各個模組的字體樣式."; L["TITAN_PANEL_MENU_LSM_FONTS"] = "面版字體"; @@ -289,31 +288,18 @@ L["TITAN_PANEL_MENU_PLUGINS"] = "插件"; L["TITAN_PANEL_MENU_POSITION"] = "Position"; L["TITAN_PANEL_MENU_PROFILE_ALREADY_EXISTS"] = "此配置檔名稱已存在,你確定你要覆蓋嗎?如果確定請按「套用」,否則請按「取消」或 ESC 鍵。"; L["TITAN_PANEL_MENU_PROFILE_CHARS"] = "角色"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC"] = "Clear Sync"; -L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC_DESC"] = "Clear Sync to use profile of this toon."; L["TITAN_PANEL_MENU_PROFILE_CUSTOM"] = "自訂"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS"] = "Delete"; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_DESC"] = "Delete this profile from the list."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR1"] = "Delete not allowed, used as Sync by another profile."; -L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR2"] = "Delete not allowed, cannot delete yourself."; L["TITAN_PANEL_MENU_PROFILE_DELETED"] = "」已刪除。"; L["TITAN_PANEL_MENU_PROFILE_RELOADUI"] = "當按下「確定」按鈕時,你的插件將立即新載入並儲存你的自訂配置檔。"; -L["TITAN_PANEL_MENU_PROFILE_RESET"] = "Reset Profile"; -L["TITAN_PANEL_MENU_PROFILE_RESET_DESC"] = "Reset just this profile to defaults."; -L["TITAN_PANEL_MENU_PROFILE_SAVE"] = "Save"; -L["TITAN_PANEL_MENU_PROFILE_SAVE_DESC"] = "Save this profile as a custom profile."; L["TITAN_PANEL_MENU_PROFILE_SAVE_CUSTOM_TITLE"] = "請輸入你的自訂配置檔名稱:\n(最大 20 個字元,不可有空格且區分大小寫。)"; L["TITAN_PANEL_MENU_PROFILE_SAVE_PENDING"] = "目前的面板設定將會儲存到配置檔: "; L["TITAN_PANEL_MENU_PROFILE_SERVERS"] = "伺服器"; -L["TITAN_PANEL_MENU_PROFILE_SYNC"] = "Sync"; -L["TITAN_PANEL_MENU_PROFILE_SYNC_DESC"] = "Sync this profile with current character. Changes on current character will be made to this profile."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR1"] = "Sync not allowed, cannot Sync to a toon that has a Sync."; -L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR2"] = "Sync not allowed, cannot Sync to yourself."; L["TITAN_PANEL_MENU_PROFILE"] = "配置檔「"; L["TITAN_PANEL_MENU_PROFILES"] = "配置檔"; L["TITAN_PANEL_MENU_RELOADUI"] = "(重載介面)"; L["TITAN_PANEL_MENU_RESET_POSITION"] = (RESET_POSITION or "Reset Position Only") L["TITAN_PANEL_MENU_RESET"] = "重置面板為預設值"; +L["TITAN_PANEL_MENU_SAVE_SETTINGS"] = "儲存"; L["TITAN_PANEL_MENU_SHOW_COLORED_TEXT"] = "顯示彩色文字"; L["TITAN_PANEL_MENU_SHOW_ICON"] = "顯示圖示"; L["TITAN_PANEL_MENU_SHOW_LABEL_TEXT"] = "顯示標籤文字"; @@ -391,7 +377,6 @@ L["TITAN_PANEL_SLASH_RESET_2"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipf L["TITAN_PANEL_SLASH_RESET_3"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset tipalpha: |cffffffff重製面板提示視窗透明度為預設值。"; L["TITAN_PANEL_SLASH_RESET_4"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset panelscale: |cffffffff重置面板大小為預設值。"; L["TITAN_PANEL_SLASH_RESET_5"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset spacing: |cffffffff重置面板按鈕間距為預設值。"; -L["TITAN_PANEL_SLASH_RESET_6"] = " - "..LIGHTYELLOW_FONT_COLOR_CODE.."reset all: |r|cffffffffResets "..TITAN_PANEL.." to default. Acts as a delete of Titan saved vars.|r"; L["TITAN_PANEL_SLASH_RESP1"] = LIGHTYELLOW_FONT_COLOR_CODE.."Titan Panel 提示文字大小已重置。"; L["TITAN_PANEL_SLASH_RESP2"] = LIGHTYELLOW_FONT_COLOR_CODE.."Titan Panel 提示視窗透明度已重置。"; L["TITAN_PANEL_SLASH_RESP3"] = LIGHTYELLOW_FONT_COLOR_CODE.."Titan Panel 大小已重置。";