From 747a6864da8a573ae6cdf09b5d38fdafa56f7dfe Mon Sep 17 00:00:00 2001 From: Slivo Date: Sun, 24 Oct 2021 17:54:35 +0200 Subject: [PATCH 1/5] Adds button tooltips (Thx Vinny) --- locales/enUS.lua | 6 ++++++ locales/frFR.lua | 6 ++++++ locales/ruRU.lua | 6 ++++++ locales/zhCN.lua | 6 ++++++ locales/zhTW.lua | 6 ++++++ src/frames.lua | 37 ++++++++++++++++++++++++++----------- 6 files changed, 56 insertions(+), 11 deletions(-) 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 From 14ac7e924f7b67f0547447c8a33d8a2a82d3fb16 Mon Sep 17 00:00:00 2001 From: Slivo Date: Thu, 4 Nov 2021 09:05:25 +0100 Subject: [PATCH 2/5] 1.14.1 toc --- TranqRotate.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TranqRotate.toc b/TranqRotate.toc index d3c8af8..5174e8c 100644 --- a/TranqRotate.toc +++ b/TranqRotate.toc @@ -1,4 +1,4 @@ -## Interface: 11400 +## Interface: 11401 ## Title: TranqRotate |cff00aa002.2.1|r ## Notes: A tranqshot rotation assistant ## Author: Slivo From 7b4994572570a6cd51f2e70fb6df22cf74fd7943 Mon Sep 17 00:00:00 2001 From: Slivo Date: Thu, 4 Nov 2021 09:05:40 +0100 Subject: [PATCH 3/5] 2.2.1 changelog --- changelog.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/changelog.md b/changelog.md index 065ff14..403b740 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ ## TranqRotate Changelog +#### v2.2.1 + +- Bump toc for 1.14.1 +- Add tooltip to title bar buttons (Thanks Vinny) + #### v2.2.0 - Adds several translations From 15b5a2a1d6d23d3465512438af721e1c9d3e1029 Mon Sep 17 00:00:00 2001 From: Slivo Date: Thu, 4 Nov 2021 09:09:12 +0100 Subject: [PATCH 4/5] Fix changelog for 2.2.1 and 2.2.2 --- changelog.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 403b740..b5f9557 100644 --- a/changelog.md +++ b/changelog.md @@ -1,10 +1,14 @@ ## TranqRotate Changelog -#### v2.2.1 +#### 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 From 05e235685477d2f7b33f4593bc72aaea370c939b Mon Sep 17 00:00:00 2001 From: Slivo Date: Thu, 4 Nov 2021 09:09:53 +0100 Subject: [PATCH 5/5] Toc version 2.2.2 --- TranqRotate.toc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TranqRotate.toc b/TranqRotate.toc index 5174e8c..58bd944 100644 --- a/TranqRotate.toc +++ b/TranqRotate.toc @@ -1,8 +1,8 @@ ## Interface: 11401 -## Title: TranqRotate |cff00aa002.2.1|r +## 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