diff --git a/TranqRotate.toc b/TranqRotate.toc index d3c8af8..58bd944 100644 --- a/TranqRotate.toc +++ b/TranqRotate.toc @@ -1,8 +1,8 @@ -## Interface: 11400 -## Title: TranqRotate |cff00aa002.2.1|r +## Interface: 11401 +## Title: TranqRotate |cff00aa002.2.2|r ## Notes: A tranqshot rotation assistant ## Author: Slivo -## Version: 2.2.1 +## Version: 2.2.2 ## SavedVariables: TranqRotateDb ## OptionalDeps: Ace3 diff --git a/changelog.md b/changelog.md index 065ff14..b5f9557 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,14 @@ ## TranqRotate Changelog +#### v2.2.2 + +- Bump toc for 1.14.1 +- Add tooltip to title bar buttons (Thanks Vinny) + +#### v2.2.1 + +- Bump toc for 1.14.0 + #### v2.2.0 - Adds several translations diff --git a/locales/enUS.lua b/locales/enUS.lua index 62f6269..91f0f0a 100644 --- a/locales/enUS.lua +++ b/locales/enUS.lua @@ -5,6 +5,12 @@ local L = { ["LOADED_MESSAGE"] = "TranqRotate loaded, type /tranq for options", ["TRANQ_WINDOW_HIDDEN"] = "Tranqrotate window hidden. Use /tranq toggle to get it back", + -- Buttons tooltips + ["BUTTON_CLOSE"] = "Hide window", + ["BUTTON_SETTINGS"] = "Settings", + ["BUTTON_RESET_ROTATION"] = "Reset Rotation", + ["BUTTON_PRINT_ROTATION"] = "Print Rotation", + -- Settings ["SETTING_GENERAL"] = "General", ["SETTING_GENERAL_REPORT"] = "Please report any issue at", diff --git a/locales/frFR.lua b/locales/frFR.lua index 7d2ddee..a6725b5 100644 --- a/locales/frFR.lua +++ b/locales/frFR.lua @@ -7,6 +7,12 @@ local L = { ["LOADED_MESSAGE"] = "TranqRotate chargé, utilisez /tranq pour les options", ["TRANQ_WINDOW_HIDDEN"] = "Tranqrotate window hidden. Use /tranq toggle to get it back", + -- Buttons tooltips + ["BUTTON_CLOSE"] = "Hide window", + ["BUTTON_SETTINGS"] = "Settings", + ["BUTTON_RESET_ROTATION"] = "Reset Rotation", + ["BUTTON_PRINT_ROTATION"] = "Print Rotation", + -- Settings ["SETTING_GENERAL"] = "Général", ["SETTING_GENERAL_REPORT"] = "Merci de signaler tout bug rencontré sur", diff --git a/locales/ruRU.lua b/locales/ruRU.lua index c111dfa..d9604dc 100644 --- a/locales/ruRU.lua +++ b/locales/ruRU.lua @@ -7,6 +7,12 @@ local L = { ["LOADED_MESSAGE"] = "TranqRotate загружен, введите /tranq для настройки", ["TRANQ_WINDOW_HIDDEN"] = "Окно TranqRotate скрыто. Введите /tranq toggle для отображения", + -- Buttons tooltips + ["BUTTON_CLOSE"] = "Hide window", + ["BUTTON_SETTINGS"] = "Settings", + ["BUTTON_RESET_ROTATION"] = "Reset Rotation", + ["BUTTON_PRINT_ROTATION"] = "Print Rotation", + -- Settings ["SETTING_GENERAL"] = "Общие", ["SETTING_GENERAL_REPORT"] = "Пожалуйста о всех ошибках сообщайте на", diff --git a/locales/zhCN.lua b/locales/zhCN.lua index e0d56b5..c78ad41 100644 --- a/locales/zhCN.lua +++ b/locales/zhCN.lua @@ -7,6 +7,12 @@ local L = { ["LOADED_MESSAGE"] = "TranqRotate 已加载, 输入 /tranq 进入设置", ["TRANQ_WINDOW_HIDDEN"] = "Tranqrotate 窗口隐藏. 输入 /tranq toggle 显示窗口", + -- Buttons tooltips + ["BUTTON_CLOSE"] = "Hide window", + ["BUTTON_SETTINGS"] = "Settings", + ["BUTTON_RESET_ROTATION"] = "Reset Rotation", + ["BUTTON_PRINT_ROTATION"] = "Print Rotation", + -- Settings ["SETTING_GENERAL"] = "一般", ["SETTING_GENERAL_REPORT"] = "请报告问题: ", diff --git a/locales/zhTW.lua b/locales/zhTW.lua index c4b902a..92ac0b1 100644 --- a/locales/zhTW.lua +++ b/locales/zhTW.lua @@ -7,6 +7,12 @@ local L = { ["LOADED_MESSAGE"] = "TranqRotate 已加載, 輸入 /tranq 進入設定", ["TRANQ_WINDOW_HIDDEN"] = "Tranqrotate 窗口隱藏. 輸入 /tranq toggle 顯示窗口", + -- Buttons tooltips + ["BUTTON_CLOSE"] = "Hide window", + ["BUTTON_SETTINGS"] = "Settings", + ["BUTTON_RESET_ROTATION"] = "Reset Rotation", + ["BUTTON_PRINT_ROTATION"] = "Print Rotation", + -- Settings ["SETTING_GENERAL"] = "General", ["SETTING_GENERAL_REPORT"] = "請報告問題: ", diff --git a/src/frames.lua b/src/frames.lua index a615374..96cbe18 100644 --- a/src/frames.lua +++ b/src/frames.lua @@ -57,34 +57,38 @@ function TranqRotate:createButtons() local buttons = { { - ['texture'] = 'Interface/Buttons/UI-Panel-MinimizeButton-Up', - ['callback'] = TranqRotate.toggleDisplay, - ['textCoord'] = {0.18, 0.8, 0.2, 0.8} + texture = 'Interface/Buttons/UI-Panel-MinimizeButton-Up', + callback = TranqRotate.toggleDisplay, + textCoord = {0.18, 0.8, 0.2, 0.8}, + tooltip = L['BUTTON_CLOSE'], }, { - ['texture'] = 'Interface/GossipFrame/BinderGossipIcon', - ['callback'] = TranqRotate.openSettings + texture = 'Interface/GossipFrame/BinderGossipIcon', + callback = TranqRotate.openSettings, + tooltip = L['BUTTON_SETTINGS'], }, { - ['texture'] = 'Interface/Buttons/UI-RefreshButton', - ['callback'] = TranqRotate.handleResetButton + texture = 'Interface/Buttons/UI-RefreshButton', + callback = TranqRotate.handleResetButton, + tooltip = L['BUTTON_RESET_ROTATION'], }, { - ['texture'] = 'Interface/Buttons/UI-GuildButton-MOTD-Up', - ['callback'] = TranqRotate.printRotationSetup + texture = 'Interface/Buttons/UI-GuildButton-MOTD-Up', + callback = TranqRotate.printRotationSetup, + tooltip = L['BUTTON_PRINT_ROTATION'], }, } local position = 5 for key, button in pairs(buttons) do - TranqRotate:createButton(position, button.texture, button.callback, button.textCoord) + TranqRotate:createButton(position, button.texture, button.callback, button.textCoord, button.tooltip) position = position + 13 end end -- Create a single button in the title bar -function TranqRotate:createButton(position, texture, callback, textCoord) +function TranqRotate:createButton(position, texture, callback, textCoord, tooltip) local button = CreateFrame("Button", nil, TranqRotate.mainFrame.titleFrame) button:SetPoint('RIGHT', -position, 0) @@ -107,6 +111,17 @@ function TranqRotate:createButton(position, texture, callback, textCoord) end button:SetScript("OnClick", callback) + + if tooltip then + button:SetScript("OnEnter", function() + GameTooltip:SetOwner(button, "ANCHOR_RIGHT") + GameTooltip_SetTitle(GameTooltip, tooltip) + GameTooltip:Show() + end) + button:SetScript("OnLeave", function() + GameTooltip:Hide() + end) + end end -- Create rotation frame