From 16ab8876456b12c4795c260356fd0ed4a4815e56 Mon Sep 17 00:00:00 2001 From: Slivo Date: Sun, 20 Jun 2021 14:19:09 +0200 Subject: [PATCH 01/17] comms printed messages translations --- locales/enUS.lua | 6 ++++++ locales/frFR.lua | 6 ++++++ locales/ruRU.lua | 6 ++++++ locales/zhCN.lua | 6 ++++++ locales/zhTW.lua | 6 ++++++ src/comms.lua | 15 +++++++-------- 6 files changed, 37 insertions(+), 8 deletions(-) diff --git a/locales/enUS.lua b/locales/enUS.lua index 742ba39..3641012 100644 --- a/locales/enUS.lua +++ b/locales/enUS.lua @@ -119,6 +119,12 @@ local L = { -- Rotation reset ["RESET_UNAUTHORIZED"] = "You must be raid assist to reset the rotation", + + -- Comms chat messages + ["COMMS_SENT_BACKUP_REQUEST"] = "Sending backup request to %s", + ["COMMS_RECEIVED_NEW_ROTATION"] = "Received new rotation configuration from %s", + ["COMMS_RECEIVED_BACKUP_REQUEST"] = "%s asked for backup !", + ["COMMS_RECEIVED_RESET_BROADCAST"] = "%s has reset the rotation.", } TranqRotate.L = L diff --git a/locales/frFR.lua b/locales/frFR.lua index fa15c7a..4c72515 100644 --- a/locales/frFR.lua +++ b/locales/frFR.lua @@ -121,6 +121,12 @@ local L = { -- Rotation reset ["RESET_UNAUTHORIZED"] = "Vous devez être assistant raid pour réinitialiser la rotation", + + -- Comms chat messages + ["COMMS_SENT_BACKUP_REQUEST"] = "Envoi d'une demande de backup à %s", + ["COMMS_RECEIVED_NEW_ROTATION"] = "Nouvelle rotation reçue de %s", + ["COMMS_RECEIVED_BACKUP_REQUEST"] = "%s demande un backup !", + ["COMMS_RECEIVED_RESET_BROADCAST"] = "%s à réinitialisé la rotation", } TranqRotate.L = L diff --git a/locales/ruRU.lua b/locales/ruRU.lua index 6fb6ac5..47c6d59 100644 --- a/locales/ruRU.lua +++ b/locales/ruRU.lua @@ -121,6 +121,12 @@ local L = { -- Rotation reset ["RESET_UNAUTHORIZED"] = "You must be raid assist to reset the rotation", + + -- Comms chat messages + ["COMMS_SENT_BACKUP_REQUEST"] = "Sending backup request to %s", + ["COMMS_RECEIVED_NEW_ROTATION"] = "Received new rotation configuration from %s", + ["COMMS_RECEIVED_BACKUP_REQUEST"] = "%s asked for backup !", + ["COMMS_RECEIVED_RESET_BROADCAST"] = "%s has reset the rotation.", } TranqRotate.L = L diff --git a/locales/zhCN.lua b/locales/zhCN.lua index 80bf595..e1bf3d0 100644 --- a/locales/zhCN.lua +++ b/locales/zhCN.lua @@ -121,6 +121,12 @@ local L = { -- Rotation reset ["RESET_UNAUTHORIZED"] = "You must be raid assist to reset the rotation", + + -- Comms chat messages + ["COMMS_SENT_BACKUP_REQUEST"] = "Sending backup request to %s", + ["COMMS_RECEIVED_NEW_ROTATION"] = "Received new rotation configuration from %s", + ["COMMS_RECEIVED_BACKUP_REQUEST"] = "%s asked for backup !", + ["COMMS_RECEIVED_RESET_BROADCAST"] = "%s has reset the rotation.", } TranqRotate.L = L diff --git a/locales/zhTW.lua b/locales/zhTW.lua index 2814ab5..e2e77b7 100644 --- a/locales/zhTW.lua +++ b/locales/zhTW.lua @@ -121,6 +121,12 @@ local L = { -- Rotation reset ["RESET_UNAUTHORIZED"] = "You must be raid assist to reset the rotation", + + -- Comms chat messages + ["COMMS_SENT_BACKUP_REQUEST"] = "Sending backup request to %s", + ["COMMS_RECEIVED_NEW_ROTATION"] = "Received new rotation configuration from %s", + ["COMMS_RECEIVED_BACKUP_REQUEST"] = "%s asked for backup !", + ["COMMS_RECEIVED_RESET_BROADCAST"] = "%s has reset the rotation.", } TranqRotate.L = L diff --git a/src/comms.lua b/src/comms.lua index 32741c3..08b5942 100644 --- a/src/comms.lua +++ b/src/comms.lua @@ -118,8 +118,7 @@ end -- Broadcast a request for the current rotation configuration function TranqRotate:sendBackupRequest(name) - -- todo: translation - TranqRotate:printPrefixedMessage('Sending backup request to ' .. TranqRotate:formatPlayerName(name)) + TranqRotate:printPrefixedMessage(string.format(L['COMMS_SENT_BACKUP_REQUEST'], TranqRotate:formatPlayerName(name))) local message = { ['type'] = TranqRotate.constants.commsTypes.backupRequest, @@ -170,8 +169,8 @@ function TranqRotate:receiveSyncOrder(prefix, message, channel, sender) TranqRotate.syncVersion = (message.version) TranqRotate.syncLastSender = sender - -- todo : translation - TranqRotate:printPrefixedMessage('Received new rotation configuration from ' .. TranqRotate:formatPlayerName(sender)) + TranqRotate:printPrefixedMessage(string.format(L['COMMS_RECEIVED_NEW_ROTATION'], TranqRotate:formatPlayerName(sender))) + TranqRotate:applyRotationConfiguration(message.rotation) local nextHunter = TranqRotate:getHunter(message.nextHunter) @@ -191,8 +190,8 @@ end -- Received a backup request function TranqRotate:receiveBackupRequest(prefix, message, channel, sender) - -- todo: translations - TranqRotate:printPrefixedMessage(TranqRotate:formatPlayerName(sender) .. ' asked for backup !') + TranqRotate:printPrefixedMessage(string.format(L['COMMS_RECEIVED_BACKUP_REQUEST'], TranqRotate:formatPlayerName(sender))) + TranqRotate:throwTranqAlert() end @@ -204,8 +203,8 @@ function TranqRotate:receiveResetRequest(prefix, message, channel, sender) end if (TranqRotate.lastRotationReset < GetTime() - 2) then - -- todo: translations - TranqRotate:printPrefixedMessage(TranqRotate:formatPlayerName(sender) .. ' has reset the rotation.') + TranqRotate:printPrefixedMessage(string.format(L['COMMS_RECEIVED_RESET_BROADCAST'], TranqRotate:formatPlayerName(sender))) + TranqRotate:resetRotation() end end From a108672642eb9e6ace1084909cc4342ed3565481 Mon Sep 17 00:00:00 2001 From: Slivo Date: Sun, 20 Jun 2021 14:19:24 +0200 Subject: [PATCH 02/17] readme wording --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 456516c..b959df5 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This addon will work even if you are the only one using it in your raid. (With s I'm looking for feedback ! I've set up a small discord server to get in touch : https://discord.gg/bPFyvDe -Please report any issue on github : https://github.com/Slivo-fr/TranqRotate/issues +Please report any issue at https://github.com/Slivo-fr/TranqRotate/issues ## Features From 9022c72cd11b73f41fd1c35f5cc25be423c66b3b Mon Sep 17 00:00:00 2001 From: Slivo Date: Sun, 20 Jun 2021 14:25:58 +0200 Subject: [PATCH 03/17] Fail tranq printed messages translations --- locales/enUS.lua | 5 +++++ locales/frFR.lua | 5 +++++ locales/ruRU.lua | 5 +++++ locales/zhCN.lua | 5 +++++ locales/zhTW.lua | 5 +++++ src/tranqRotate.lua | 7 +++---- 6 files changed, 28 insertions(+), 4 deletions(-) diff --git a/locales/enUS.lua b/locales/enUS.lua index 3641012..284153b 100644 --- a/locales/enUS.lua +++ b/locales/enUS.lua @@ -125,6 +125,11 @@ local L = { ["COMMS_RECEIVED_NEW_ROTATION"] = "Received new rotation configuration from %s", ["COMMS_RECEIVED_BACKUP_REQUEST"] = "%s asked for backup !", ["COMMS_RECEIVED_RESET_BROADCAST"] = "%s has reset the rotation.", + + -- Failed tranq printed messages + ["PRINT_FAILED_TRANQ_MISS"] = "%s missed his tranqshot!", + ["PRINT_FAILED_TRANQ_RESIST"] = "%s's tranqshot was resisted!", + ["PRINT_FAILED_TRANQ_MISS_OR_RESIST"] = "%s's tranqshot was missed or resisted!", } TranqRotate.L = L diff --git a/locales/frFR.lua b/locales/frFR.lua index 4c72515..e5e47fc 100644 --- a/locales/frFR.lua +++ b/locales/frFR.lua @@ -127,6 +127,11 @@ local L = { ["COMMS_RECEIVED_NEW_ROTATION"] = "Nouvelle rotation reçue de %s", ["COMMS_RECEIVED_BACKUP_REQUEST"] = "%s demande un backup !", ["COMMS_RECEIVED_RESET_BROADCAST"] = "%s à réinitialisé la rotation", + + -- Failed tranq printed messages + ["PRINT_FAILED_TRANQ_MISS"] = "%s a raté son tranqshot!", + ["PRINT_FAILED_TRANQ_RESIST"] = "Le tranqshot de %s a été résisté!", + ["PRINT_FAILED_TRANQ_MISS_OR_RESIST"] = "Le tranqshot de %s a raté ou a été résisté!", } TranqRotate.L = L diff --git a/locales/ruRU.lua b/locales/ruRU.lua index 47c6d59..548ef8f 100644 --- a/locales/ruRU.lua +++ b/locales/ruRU.lua @@ -127,6 +127,11 @@ local L = { ["COMMS_RECEIVED_NEW_ROTATION"] = "Received new rotation configuration from %s", ["COMMS_RECEIVED_BACKUP_REQUEST"] = "%s asked for backup !", ["COMMS_RECEIVED_RESET_BROADCAST"] = "%s has reset the rotation.", + + -- Failed tranq printed messages + ["PRINT_FAILED_TRANQ_MISS"] = "%s missed his tranqshot!", + ["PRINT_FAILED_TRANQ_RESIST"] = "%s's tranqshot was resisted!", + ["PRINT_FAILED_TRANQ_MISS_OR_RESIST"] = "%s's tranqshot was missed or resisted!", } TranqRotate.L = L diff --git a/locales/zhCN.lua b/locales/zhCN.lua index e1bf3d0..b172cf7 100644 --- a/locales/zhCN.lua +++ b/locales/zhCN.lua @@ -127,6 +127,11 @@ local L = { ["COMMS_RECEIVED_NEW_ROTATION"] = "Received new rotation configuration from %s", ["COMMS_RECEIVED_BACKUP_REQUEST"] = "%s asked for backup !", ["COMMS_RECEIVED_RESET_BROADCAST"] = "%s has reset the rotation.", + + -- Failed tranq printed messages + ["PRINT_FAILED_TRANQ_MISS"] = "%s missed his tranqshot!", + ["PRINT_FAILED_TRANQ_RESIST"] = "%s's tranqshot was resisted!", + ["PRINT_FAILED_TRANQ_MISS_OR_RESIST"] = "%s's tranqshot was missed or resisted!", } TranqRotate.L = L diff --git a/locales/zhTW.lua b/locales/zhTW.lua index e2e77b7..7f7c5c8 100644 --- a/locales/zhTW.lua +++ b/locales/zhTW.lua @@ -127,6 +127,11 @@ local L = { ["COMMS_RECEIVED_NEW_ROTATION"] = "Received new rotation configuration from %s", ["COMMS_RECEIVED_BACKUP_REQUEST"] = "%s asked for backup !", ["COMMS_RECEIVED_RESET_BROADCAST"] = "%s has reset the rotation.", + + -- Failed tranq printed messages + ["PRINT_FAILED_TRANQ_MISS"] = "%s missed his tranqshot!", + ["PRINT_FAILED_TRANQ_RESIST"] = "%s's tranqshot was resisted!", + ["PRINT_FAILED_TRANQ_MISS_OR_RESIST"] = "%s's tranqshot was missed or resisted!", } TranqRotate.L = L diff --git a/src/tranqRotate.lua b/src/tranqRotate.lua index d375b8a..71bf981 100644 --- a/src/tranqRotate.lua +++ b/src/tranqRotate.lua @@ -281,18 +281,17 @@ function TranqRotate:formatAddonVersion(version) end end --- @todo translations -- Prints in the chat the reason a tranqshot has failed function TranqRotate:printFail(hunter, event) local name = TranqRotate:formatPlayerName(hunter.name) if (event == "SPELL_MISSED") then - TranqRotate:printPrefixedMessage(name .. " missed his tranqshot!") + TranqRotate:printPrefixedMessage(string.format(L['PRINT_FAILED_TRANQ_MISS'], name))-- .. " missed his tranqshot!") elseif(event == "SPELL_DISPEL_FAILED") then - TranqRotate:printPrefixedMessage(name .. "'s tranqshot was resisted!") + TranqRotate:printPrefixedMessage(string.format(L['PRINT_FAILED_TRANQ_RESIST'], name))-- .. " missed his tranqshot!") else -- v1.5.1 and older do not send the event type - TranqRotate:printPrefixedMessage(name .. "'s tranqshot was missed or resisted!") + TranqRotate:printPrefixedMessage(string.format(L['PRINT_FAILED_TRANQ_MISS_OR_RESIST'], name))-- .. " missed his tranqshot!") end end From 09b0c1de0001de5170132625977075f9cf6e5a95 Mon Sep 17 00:00:00 2001 From: Slivo Date: Sun, 20 Jun 2021 14:26:29 +0200 Subject: [PATCH 04/17] Removes test function --- src/tranqRotate.lua | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/tranqRotate.lua b/src/tranqRotate.lua index 71bf981..907f3eb 100644 --- a/src/tranqRotate.lua +++ b/src/tranqRotate.lua @@ -144,13 +144,6 @@ function TranqRotate:toggleDisplay() end end --- @todo: remove this -function TranqRotate:test() - TranqRotate:printMessage('test') - - print(TranqRotate:isPlayedIncapacitatedByDebuff()) -end - -- Open ace settings function TranqRotate:openSettings() local AceConfigDialog = LibStub("AceConfigDialog-3.0") From 12331c0dd3c5c1743d13af49bf5cc856dc24572e Mon Sep 17 00:00:00 2001 From: Slivo Date: Sun, 20 Jun 2021 14:31:58 +0200 Subject: [PATCH 05/17] Version check translations --- locales/enUS.lua | 5 +++++ locales/frFR.lua | 5 +++++ locales/ruRU.lua | 5 +++++ locales/zhCN.lua | 5 +++++ locales/zhTW.lua | 5 +++++ src/tranqRotate.lua | 6 +++--- 6 files changed, 28 insertions(+), 3 deletions(-) diff --git a/locales/enUS.lua b/locales/enUS.lua index 284153b..2b20b0d 100644 --- a/locales/enUS.lua +++ b/locales/enUS.lua @@ -130,6 +130,11 @@ local L = { ["PRINT_FAILED_TRANQ_MISS"] = "%s missed his tranqshot!", ["PRINT_FAILED_TRANQ_RESIST"] = "%s's tranqshot was resisted!", ["PRINT_FAILED_TRANQ_MISS_OR_RESIST"] = "%s's tranqshot was missed or resisted!", + + -- Version check printed messages + ["VERSION_CHECK_HEADER"] = "Version check", + ["VERSION_CHECK_YOU"] = "You", + ["VERSION_CHECK_NONE_OR_BELOW_1.6.0"] = "None or below 1.6.0", } TranqRotate.L = L diff --git a/locales/frFR.lua b/locales/frFR.lua index e5e47fc..e8dcf91 100644 --- a/locales/frFR.lua +++ b/locales/frFR.lua @@ -132,6 +132,11 @@ local L = { ["PRINT_FAILED_TRANQ_MISS"] = "%s a raté son tranqshot!", ["PRINT_FAILED_TRANQ_RESIST"] = "Le tranqshot de %s a été résisté!", ["PRINT_FAILED_TRANQ_MISS_OR_RESIST"] = "Le tranqshot de %s a raté ou a été résisté!", + + -- Version check printed messages + ["VERSION_CHECK_HEADER"] = "Controle des versions", + ["VERSION_CHECK_YOU"] = "Vous", + ["VERSION_CHECK_NONE_OR_BELOW_1.6.0"] = "Aucune ou inférieure à 1.6.0", } TranqRotate.L = L diff --git a/locales/ruRU.lua b/locales/ruRU.lua index 548ef8f..c0d9b87 100644 --- a/locales/ruRU.lua +++ b/locales/ruRU.lua @@ -132,6 +132,11 @@ local L = { ["PRINT_FAILED_TRANQ_MISS"] = "%s missed his tranqshot!", ["PRINT_FAILED_TRANQ_RESIST"] = "%s's tranqshot was resisted!", ["PRINT_FAILED_TRANQ_MISS_OR_RESIST"] = "%s's tranqshot was missed or resisted!", + + -- Version check printed messages + ["VERSION_CHECK_HEADER"] = "Version check", + ["VERSION_CHECK_YOU"] = "You", + ["VERSION_CHECK_NONE_OR_BELOW_1.6.0"] = "None or below 1.6.0", } TranqRotate.L = L diff --git a/locales/zhCN.lua b/locales/zhCN.lua index b172cf7..1920098 100644 --- a/locales/zhCN.lua +++ b/locales/zhCN.lua @@ -132,6 +132,11 @@ local L = { ["PRINT_FAILED_TRANQ_MISS"] = "%s missed his tranqshot!", ["PRINT_FAILED_TRANQ_RESIST"] = "%s's tranqshot was resisted!", ["PRINT_FAILED_TRANQ_MISS_OR_RESIST"] = "%s's tranqshot was missed or resisted!", + + -- Version check printed messages + ["VERSION_CHECK_HEADER"] = "Version check", + ["VERSION_CHECK_YOU"] = "You", + ["VERSION_CHECK_NONE_OR_BELOW_1.6.0"] = "None or below 1.6.0", } TranqRotate.L = L diff --git a/locales/zhTW.lua b/locales/zhTW.lua index 7f7c5c8..2129a3c 100644 --- a/locales/zhTW.lua +++ b/locales/zhTW.lua @@ -132,6 +132,11 @@ local L = { ["PRINT_FAILED_TRANQ_MISS"] = "%s missed his tranqshot!", ["PRINT_FAILED_TRANQ_RESIST"] = "%s's tranqshot was resisted!", ["PRINT_FAILED_TRANQ_MISS_OR_RESIST"] = "%s's tranqshot was missed or resisted!", + + -- Version check printed messages + ["VERSION_CHECK_HEADER"] = "Version check", + ["VERSION_CHECK_YOU"] = "You", + ["VERSION_CHECK_NONE_OR_BELOW_1.6.0"] = "None or below 1.6.0", } TranqRotate.L = L diff --git a/src/tranqRotate.lua b/src/tranqRotate.lua index 907f3eb..56d0b92 100644 --- a/src/tranqRotate.lua +++ b/src/tranqRotate.lua @@ -245,8 +245,8 @@ end -- Prints to the chat the addon version of every hunter and addon users function TranqRotate:checkVersions() - TranqRotate:printPrefixedMessage("## Version check ##") - TranqRotate:printPrefixedMessage("You - " .. TranqRotate.version) + TranqRotate:printPrefixedMessage("## " .. L["VERSION_CHECK_HEADER"] .. " ##") + TranqRotate:printPrefixedMessage(L["VERSION_CHECK_YOU"] .. " - " .. TranqRotate.version) for player, version in pairs(TranqRotate.addonVersions) do if (player ~= UnitName("player")) then @@ -268,7 +268,7 @@ end -- Returns a string based on the hunter addon version function TranqRotate:formatAddonVersion(version) if (version == nil) then - return "None or below 1.6.0" + return L["VERSION_CHECK_NONE_OR_BELOW_1.6.0"] else return version end From eb022f5dadbe64699eeceee62b7ec4e0d68f5da9 Mon Sep 17 00:00:00 2001 From: Slivo Date: Sun, 20 Jun 2021 14:33:16 +0200 Subject: [PATCH 06/17] update todos --- src/tranqRotate.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tranqRotate.lua b/src/tranqRotate.lua index 56d0b92..b4d3e60 100644 --- a/src/tranqRotate.lua +++ b/src/tranqRotate.lua @@ -120,7 +120,7 @@ SlashCmdList["TRANQROTATE"] = function(msg) TranqRotate:lock(false) elseif (cmd == 'backup') then TranqRotate:alertBackup(TranqRotate.db.profile.unableToTranqMessage) - elseif (cmd == 'rotate') then -- @todo decide if this should be removed or not + elseif (cmd == 'rotate') then -- @todo decide if this should be removed or not (Used in runDemo) TranqRotate:testRotation() elseif (cmd == 'test') then TranqRotate:toggleArcaneShotTesting() @@ -264,7 +264,6 @@ function TranqRotate:purgeAddonVersions() end end --- @todo translations -- Returns a string based on the hunter addon version function TranqRotate:formatAddonVersion(version) if (version == nil) then From 1c1123c46906561bd1cba9296b8494b9e283b915 Mon Sep 17 00:00:00 2001 From: Slivo Date: Tue, 22 Jun 2021 15:52:22 +0200 Subject: [PATCH 07/17] delayed update logic fix --- src/rotation.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rotation.lua b/src/rotation.lua index 9cb73bc..493b4c4 100644 --- a/src/rotation.lua +++ b/src/rotation.lua @@ -330,8 +330,8 @@ function TranqRotate:updateRaidStatus() if (not complete and not TranqRotate.delayedUpdate) then TranqRotate.delayedUpdate = true C_Timer.After(1, function() - TranqRotate:updateRaidStatus() TranqRotate.delayedUpdate = false + TranqRotate:updateRaidStatus() end) end else From f9cd3a30e6911aa13f0ba0b7778b077f1bd7851b Mon Sep 17 00:00:00 2001 From: Slivo Date: Tue, 22 Jun 2021 16:12:52 +0200 Subject: [PATCH 08/17] Adds reset position button --- locales/enUS.lua | 2 ++ locales/frFR.lua | 2 ++ locales/ruRU.lua | 2 ++ locales/zhCN.lua | 2 ++ locales/zhTW.lua | 2 ++ src/frames.lua | 16 ++++++++++++---- src/settings.lua | 12 +++++++++--- src/tranqRotate.lua | 2 +- 8 files changed, 32 insertions(+), 8 deletions(-) diff --git a/locales/enUS.lua b/locales/enUS.lua index 2b20b0d..d54ee61 100644 --- a/locales/enUS.lua +++ b/locales/enUS.lua @@ -12,6 +12,8 @@ local L = { ["LOCK_WINDOW"] = "Lock window", ["LOCK_WINDOW_DESC"] = "Lock window", + ["RESET_WINDOW_POSITION"] = "Reset position", + ["RESET_WINDOW_POSITION_DESC"] = "Reset the main window position", ["HIDE_WINDOW_NOT_IN_RAID"] = "Hide the window when not in a raid", ["HIDE_WINDOW_NOT_IN_RAID_DESC"] = "Hide the window when not in a raid", ["DO_NOT_SHOW_WHEN_JOINING_RAID"] = "Do not show window when joining a raid", diff --git a/locales/frFR.lua b/locales/frFR.lua index e8dcf91..c6d0634 100644 --- a/locales/frFR.lua +++ b/locales/frFR.lua @@ -14,6 +14,8 @@ local L = { ["LOCK_WINDOW"] = "Verrouiller la position de la fênetre", ["LOCK_WINDOW_DESC"] = "Verrouiller la position de la fênetre", + ["RESET_WINDOW_POSITION"] = "Reset position", + ["RESET_WINDOW_POSITION_DESC"] = "Reinitialise la position de la fenêtre principale", ["HIDE_WINDOW_NOT_IN_RAID"] = "Masquer la fenêtre principale hors raid", ["HIDE_WINDOW_NOT_IN_RAID_DESC"] = "Masquer la fenêtre principale hors raid", ["DO_NOT_SHOW_WHEN_JOINING_RAID"] = "Ne pas afficher la fenêtre principale lorsque vous rejoignez un raid", diff --git a/locales/ruRU.lua b/locales/ruRU.lua index c0d9b87..f0321fd 100644 --- a/locales/ruRU.lua +++ b/locales/ruRU.lua @@ -14,6 +14,8 @@ local L = { ["LOCK_WINDOW"] = "Закрепить окно", ["LOCK_WINDOW_DESC"] = "Препятствует перемещению окна с помощью мыши", + ["RESET_WINDOW_POSITION"] = "Reset position", + ["RESET_WINDOW_POSITION_DESC"] = "Reset the main window position", ["HIDE_WINDOW_NOT_IN_RAID"] = "Показывать окно только в рейде", ["HIDE_WINDOW_NOT_IN_RAID_DESC"] = "Окно будет отображаться только в рейдовой группе", ["DO_NOT_SHOW_WHEN_JOINING_RAID"] = "Не показывать окно во время присоединения к рейду", diff --git a/locales/zhCN.lua b/locales/zhCN.lua index 1920098..7233c89 100644 --- a/locales/zhCN.lua +++ b/locales/zhCN.lua @@ -14,6 +14,8 @@ local L = { ["LOCK_WINDOW"] = "锁定窗口", ["LOCK_WINDOW_DESC"] = "锁定窗口", + ["RESET_WINDOW_POSITION"] = "Reset position", + ["RESET_WINDOW_POSITION_DESC"] = "Reset the main window position", ["HIDE_WINDOW_NOT_IN_RAID"] = "不在团队时隐藏窗口", ["HIDE_WINDOW_NOT_IN_RAID_DESC"] = "不在团队时隐藏窗口", ["DO_NOT_SHOW_WHEN_JOINING_RAID"] = "加入团队时隐藏窗口", diff --git a/locales/zhTW.lua b/locales/zhTW.lua index 2129a3c..db30aaf 100644 --- a/locales/zhTW.lua +++ b/locales/zhTW.lua @@ -14,6 +14,8 @@ local L = { ["LOCK_WINDOW"] = "鎖定窗口", ["LOCK_WINDOW_DESC"] = "鎖定窗口", + ["RESET_WINDOW_POSITION"] = "Reset position", + ["RESET_WINDOW_POSITION_DESC"] = "Reset the main window position", ["HIDE_WINDOW_NOT_IN_RAID"] = "不在團隊時隱藏窗口", ["HIDE_WINDOW_NOT_IN_RAID_DESC"] = "不在團隊時隱藏窗口", ["DO_NOT_SHOW_WHEN_JOINING_RAID"] = "加入團隊時隱藏窗口", diff --git a/src/frames.lua b/src/frames.lua index 138a652..a615374 100644 --- a/src/frames.lua +++ b/src/frames.lua @@ -14,16 +14,24 @@ function TranqRotate:createMainFrame() TranqRotate.mainFrame:SetScript( "OnDragStop", function() - local config = TranqRotate.db.profile TranqRotate.mainFrame:StopMovingOrSizing() - config.point = 'TOPLEFT' - config.y = TranqRotate.mainFrame:GetTop() - config.x = TranqRotate.mainFrame:GetLeft() + TranqRotate.db.profile.point = 'TOPLEFT' + TranqRotate.db.profile.y = TranqRotate.mainFrame:GetTop() + TranqRotate.db.profile.x = TranqRotate.mainFrame:GetLeft() end ) end +function TranqRotate:resetMainWindowPosition() + TranqRotate.db.profile.point = nil + TranqRotate.db.profile.y = nil + TranqRotate.db.profile.x = nil + + TranqRotate.mainFrame:ClearAllPoints() + TranqRotate.mainFrame:SetPoint('CENTER') +end + -- Create Title frame function TranqRotate:createTitleFrame() TranqRotate.mainFrame.titleFrame = CreateFrame("Frame", 'rotationFrame', TranqRotate.mainFrame) diff --git a/src/settings.lua b/src/settings.lua index cba232e..162e2d7 100644 --- a/src/settings.lua +++ b/src/settings.lua @@ -67,25 +67,31 @@ function TranqRotate:CreateConfig() order = 6, width = "double", }, + test = { + name = L["RESET_WINDOW_POSITION"], + type = "execute", + order = 7, + func = function() TranqRotate:resetMainWindowPosition() end + }, hideNotInRaid = { name = L["HIDE_WINDOW_NOT_IN_RAID"], desc = L["HIDE_WINDOW_NOT_IN_RAID_DESC"], type = "toggle", - order = 7, + order = 8, width = "double", }, doNotShowWindowOnRaidJoin = { name = L["DO_NOT_SHOW_WHEN_JOINING_RAID"], desc = L["DO_NOT_SHOW_WHEN_JOINING_RAID_DESC"], type = "toggle", - order = 8, + order = 9, width = "full", }, showWindowWhenTargetingBoss = { name = L["SHOW_WHEN_TARGETING_BOSS"], desc = L["SHOW_WHEN_TARGETING_BOSS_DESC"], type = "toggle", - order = 9, + order = 10, width = "full", }, playerNameFormatting = { diff --git a/src/tranqRotate.lua b/src/tranqRotate.lua index b4d3e60..99db6bd 100644 --- a/src/tranqRotate.lua +++ b/src/tranqRotate.lua @@ -39,7 +39,7 @@ end -- Apply setting on profile change function TranqRotate:ProfilesChanged() - self.db:RegisterDefaults(self.defaults) + self.db:RegisterDefaults(self.defaults) self:applySettings() end From 3c7537128ff180e555d7fa4b95e16701b51c4bf4 Mon Sep 17 00:00:00 2001 From: Slivo Date: Tue, 22 Jun 2021 17:47:43 +0200 Subject: [PATCH 09/17] few minor settings improvements --- src/settings.lua | 41 ++++++++++++++--------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/src/settings.lua b/src/settings.lua index 162e2d7..a6fcf70 100644 --- a/src/settings.lua +++ b/src/settings.lua @@ -28,32 +28,18 @@ function TranqRotate:CreateConfig() type = "group", order = 1, args = { - descriptionText = { - name = "TranqRotate v" .. TranqRotate.version .. " by Slivo-Sulfuron\n", - type = "description", - width = "full", - order = 1, - }, - repoLink = { - name = L['SETTING_GENERAL_REPORT'] .. " https://github.com/Slivo-fr/TranqRotate\n", - type = "description", - width = "full", - order = 2, - }, - -- @todo : find a way to space widget properly - --spacer3 = { - -- name = ' ', - -- type = "description", - -- width = "full", - -- order = 3, - --}, - --baseVersion = { - -- name = L['SETTING_GENERAL_DESC'], - -- type = "description", - -- width = "full", - -- order = 4, - --}, - -- @todo : find a way to space widget properly + descriptionText = { + name = "TranqRotate v" .. TranqRotate.version .. " by Slivo-Sulfuron", + type = "description", + width = "full", + order = 1, + }, + repoLink = { + name = L['SETTING_GENERAL_REPORT'] .. " https://github.com/Slivo-fr/TranqRotate", + type = "description", + width = "full", + order = 2, + }, spacer4 = { name = ' ', type = "description", @@ -328,7 +314,7 @@ function TranqRotate:CreateConfig() PlaySoundFile(TranqRotate.constants.sounds.alarms[value]) end }, - baseVersion = { + dbmSoundWarning = { name = L['DBM_SOUND_WARNING'], type = "description", width = "full", @@ -344,6 +330,7 @@ function TranqRotate:CreateConfig() AceConfigDialog:AddToBlizOptions(Addon, nil, nil, "general") AceConfigDialog:AddToBlizOptions(Addon, L['SETTING_ANNOUNCES'], Addon, "announces") + AceConfigDialog:AddToBlizOptions(Addon, L['SETTING_SOUNDS'], Addon, "sounds") AceConfigDialog:AddToBlizOptions(Addon, L["SETTING_PROFILES"], Addon, "profile") AceConfigDialog:SetDefaultSize(Addon, 895, 570) From 943cf294c9273a02716a4ba9df94e49073899c90 Mon Sep 17 00:00:00 2001 From: Slivo Date: Tue, 22 Jun 2021 17:49:46 +0200 Subject: [PATCH 10/17] few more settings tweaks --- src/settings.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/settings.lua b/src/settings.lua index a6fcf70..9555a35 100644 --- a/src/settings.lua +++ b/src/settings.lua @@ -40,12 +40,12 @@ function TranqRotate:CreateConfig() width = "full", order = 2, }, - spacer4 = { - name = ' ', - type = "description", - width = "full", - order = 5, - }, + spacer4 = { + name = ' ', + type = "description", + width = "full", + order = 5, + }, lock = { name = L["LOCK_WINDOW"], desc = L["LOCK_WINDOW_DESC"], From a6b6ab6dff140465f1d7301ae3b05389e6b28daf Mon Sep 17 00:00:00 2001 From: Slivo Date: Tue, 22 Jun 2021 17:54:36 +0200 Subject: [PATCH 11/17] Fix reset position option name --- src/settings.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/settings.lua b/src/settings.lua index 9555a35..ed9b416 100644 --- a/src/settings.lua +++ b/src/settings.lua @@ -53,7 +53,7 @@ function TranqRotate:CreateConfig() order = 6, width = "double", }, - test = { + resetWindowPosition = { name = L["RESET_WINDOW_POSITION"], type = "execute", order = 7, From 56a60e7f5b93d2ccfb5996eb7664b6c48a0be398 Mon Sep 17 00:00:00 2001 From: Slivo Date: Tue, 22 Jun 2021 19:05:54 +0200 Subject: [PATCH 12/17] sort locale keys --- locales/enUS.lua | 10 +++++----- locales/frFR.lua | 10 +++++----- locales/ruRU.lua | 10 +++++----- locales/zhCN.lua | 10 +++++----- locales/zhTW.lua | 10 +++++----- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/locales/enUS.lua b/locales/enUS.lua index d54ee61..62f6269 100644 --- a/locales/enUS.lua +++ b/locales/enUS.lua @@ -95,6 +95,11 @@ local L = { ["USE_MULTILINE_ROTATION_REPORT"] = "Use multiline for main rotation when reporting", ["USE_MULTILINE_ROTATION_REPORT_DESC"] = "Check this option if you want more comprehensible order display", + --- Raid broadcast messages + ["BROADCAST_HEADER_TEXT"] = "Hunter tranqshot setup", + ["BROADCAST_ROTATION_PREFIX"] = "Rotation", + ["BROADCAST_BACKUP_PREFIX"] = "Backup", + --- Sounds ["SETTING_SOUNDS"] = "Sounds", ["ENABLE_NEXT_TO_TRANQ_SOUND"] = "Play a sound when you are the next to shoot", @@ -105,11 +110,6 @@ local L = { --- Profiles ["SETTING_PROFILES"] = "Profiles", - --- Raid broadcast messages - ["BROADCAST_HEADER_TEXT"] = "Hunter tranqshot setup", - ["BROADCAST_ROTATION_PREFIX"] = "Rotation", - ["BROADCAST_BACKUP_PREFIX"] = "Backup", - -- Blind icon tooltip ["TOOLTIP_PLAYER_WITHOUT_ADDON"] = "This player does not use TranqRotate", ["TOOLTIP_MAY_RUN_OUDATED_VERSION"] = "Or runs an outdated version below 1.6.0", diff --git a/locales/frFR.lua b/locales/frFR.lua index c6d0634..7d2ddee 100644 --- a/locales/frFR.lua +++ b/locales/frFR.lua @@ -97,6 +97,11 @@ local L = { ["USE_MULTILINE_ROTATION_REPORT"] = "Utiliser plusieurs lignes pour la rotation principale", ["USE_MULTILINE_ROTATION_REPORT_DESC"] = "Chaque chasseur de la rotation apparaitra sur une ligne numérotée", + --- Raid broadcast messages + ["BROADCAST_HEADER_TEXT"] = "Hunter tranqshot setup", + ["BROADCAST_ROTATION_PREFIX"] = "Rotation", + ["BROADCAST_BACKUP_PREFIX"] = "Backup", + --- Sounds ["SETTING_SOUNDS"] = "Sons", ["ENABLE_NEXT_TO_TRANQ_SOUND"] = "Jouer un son lorsque vous êtes le prochain à devoir tranq", @@ -107,11 +112,6 @@ local L = { --- Profiles ["SETTING_PROFILES"] = "Profils", - --- Raid broadcast messages - ["BROADCAST_HEADER_TEXT"] = "Hunter tranqshot setup", - ["BROADCAST_ROTATION_PREFIX"] = "Rotation", - ["BROADCAST_BACKUP_PREFIX"] = "Backup", - -- Blind icon tooltip ["TOOLTIP_PLAYER_WITHOUT_ADDON"] = "Ce joueur n'utilise pas TranqRotate", ["TOOLTIP_MAY_RUN_OUDATED_VERSION"] = "Ou possède une version obsolète inférieure à 1.6.0", diff --git a/locales/ruRU.lua b/locales/ruRU.lua index f0321fd..c111dfa 100644 --- a/locales/ruRU.lua +++ b/locales/ruRU.lua @@ -97,6 +97,11 @@ local L = { ["USE_MULTILINE_ROTATION_REPORT"] = "Использовать многострочный вывод при объявлении очередности", ["USE_MULTILINE_ROTATION_REPORT_DESC"] = "Выберите для более понятного порядка отображения очередности", + --- Raid broadcast messages + ["BROADCAST_HEADER_TEXT"] = "Очередность Усмиряющего выстрела", + ["BROADCAST_ROTATION_PREFIX"] = "Очередность", + ["BROADCAST_BACKUP_PREFIX"] = "Запасные", + --- Sounds ["SETTING_SOUNDS"] = "Звуки", ["ENABLE_NEXT_TO_TRANQ_SOUND"] = "Проигрывать звук когда подходит ваша очередь", @@ -107,11 +112,6 @@ local L = { --- Profiles ["SETTING_PROFILES"] = "Профили", - --- Raid broadcast messages - ["BROADCAST_HEADER_TEXT"] = "Очередность Усмиряющего выстрела", - ["BROADCAST_ROTATION_PREFIX"] = "Очередность", - ["BROADCAST_BACKUP_PREFIX"] = "Запасные", - -- Blind icon tooltip ["TOOLTIP_PLAYER_WITHOUT_ADDON"] = "Этот игрок не использует TranqRotate", ["TOOLTIP_MAY_RUN_OUDATED_VERSION"] = "Или используется версия ниже 1.6.0", diff --git a/locales/zhCN.lua b/locales/zhCN.lua index 7233c89..e0d56b5 100644 --- a/locales/zhCN.lua +++ b/locales/zhCN.lua @@ -97,6 +97,11 @@ local L = { ["USE_MULTILINE_ROTATION_REPORT"] = "连续多行发送宁神通告", ["USE_MULTILINE_ROTATION_REPORT_DESC"] = "如果您想要更易于理解的顺序显示,请选中此选项", + --- Raid broadcast messages + ["BROADCAST_HEADER_TEXT"] = "猎人宁神顺序", + ["BROADCAST_ROTATION_PREFIX"] = "循环", + ["BROADCAST_BACKUP_PREFIX"] = "替补", + --- Sounds ["SETTING_SOUNDS"] = "音效", ["ENABLE_NEXT_TO_TRANQ_SOUND"] = "当下一个宁神射击是您时,播放提示音", @@ -107,11 +112,6 @@ local L = { --- Profiles ["SETTING_PROFILES"] = "配置文件", - --- Raid broadcast messages - ["BROADCAST_HEADER_TEXT"] = "猎人宁神顺序", - ["BROADCAST_ROTATION_PREFIX"] = "循环", - ["BROADCAST_BACKUP_PREFIX"] = "替补", - -- Blind icon tooltip ["TOOLTIP_PLAYER_WITHOUT_ADDON"] = "此玩家没有使用TranqRotate插件", ["TOOLTIP_MAY_RUN_OUDATED_VERSION"] = "或者运行低于1.6.0的过时版本", diff --git a/locales/zhTW.lua b/locales/zhTW.lua index db30aaf..c4b902a 100644 --- a/locales/zhTW.lua +++ b/locales/zhTW.lua @@ -97,6 +97,11 @@ local L = { ["USE_MULTILINE_ROTATION_REPORT"] = "連續多行發送寧神通告", ["USE_MULTILINE_ROTATION_REPORT_DESC"] = "如果您想要更易於理解的順序顯示,請選中此選項", + --- Raid broadcast messages + ["BROADCAST_HEADER_TEXT"] = "獵人寧神順序", + ["BROADCAST_ROTATION_PREFIX"] = "循環", + ["BROADCAST_BACKUP_PREFIX"] = "替補", + --- Sounds ["SETTING_SOUNDS"] = "音效", ["ENABLE_NEXT_TO_TRANQ_SOUND"] = "當下壹個寧神射擊是您時,播放提示音", @@ -107,11 +112,6 @@ local L = { --- Profiles ["SETTING_PROFILES"] = "設定檔", - --- Raid broadcast messages - ["BROADCAST_HEADER_TEXT"] = "獵人寧神順序", - ["BROADCAST_ROTATION_PREFIX"] = "循環", - ["BROADCAST_BACKUP_PREFIX"] = "替補", - -- Blind icon tooltip ["TOOLTIP_PLAYER_WITHOUT_ADDON"] = "This player does not use TranqRotate", ["TOOLTIP_MAY_RUN_OUDATED_VERSION"] = "Or runs an outdated version below 1.6.0", From 3fffdaab60b2684122208f635423632835499930 Mon Sep 17 00:00:00 2001 From: Slivo Date: Mon, 5 Jul 2021 10:59:57 +0200 Subject: [PATCH 13/17] Import translations in comms.lua --- src/comms.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/comms.lua b/src/comms.lua index 08b5942..01aded8 100644 --- a/src/comms.lua +++ b/src/comms.lua @@ -1,6 +1,8 @@ local AceComm = LibStub("AceComm-3.0") local AceSerializer = LibStub("AceSerializer-3.0") +local L = TranqRotate.L + -- Register comm prefix at initialization steps function TranqRotate:initComms() From 0f534a546e45822d56f659bac4240c5de7c30a97 Mon Sep 17 00:00:00 2001 From: Slivo Date: Sat, 18 Sep 2021 11:28:09 +0200 Subject: [PATCH 14/17] Improve rotation automatic reset --- TranqRotate.toc | 1 + changelog.md | 8 ++++++++ src/encounter.lua | 4 ++++ src/events.lua | 9 +++++++-- src/tranqRotate.lua | 5 +++++ 5 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 src/encounter.lua diff --git a/TranqRotate.toc b/TranqRotate.toc index 0e263bc..24c3ed8 100644 --- a/TranqRotate.toc +++ b/TranqRotate.toc @@ -37,3 +37,4 @@ src\utils.lua src\debuff.lua src\migration.lua src\raidIcons.lua +src\encounter.lua diff --git a/changelog.md b/changelog.md index 40ab276..065ff14 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,13 @@ ## TranqRotate Changelog +#### v2.2.0 + +- Adds several translations +- Adds a button to reset window position in general settings +- Update Ace3 libs +- Improves rotation automatic reset after boss fight +- Drag and drop backend changes + #### v2.1.0 - Removes server suffixes from player names everywhere (connected realms) diff --git a/src/encounter.lua b/src/encounter.lua new file mode 100644 index 0000000..868c280 --- /dev/null +++ b/src/encounter.lua @@ -0,0 +1,4 @@ +function TranqRotate:endEncounter() + TranqRotate:resetRotation() + TranqRotate:sendResetBroadcast() +end diff --git a/src/events.lua b/src/events.lua index 21bb0da..9c2ffa0 100644 --- a/src/events.lua +++ b/src/events.lua @@ -7,6 +7,7 @@ eventFrame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") eventFrame:RegisterEvent("GROUP_ROSTER_UPDATE") eventFrame:RegisterEvent("PLAYER_REGEN_ENABLED") eventFrame:RegisterEvent("PLAYER_TARGET_CHANGED") +eventFrame:RegisterEvent("ENCOUNTER_END") eventFrame:SetScript( "OnEvent", @@ -77,8 +78,7 @@ function TranqRotate:COMBAT_LOG_EVENT_UNFILTERED() TranqRotate.frenzy = false elseif (event == "UNIT_DIED" and TranqRotate:isTranqableBoss(destGUID)) then if (TranqRotate:isPlayerAllowedToManageRotation()) then - TranqRotate:resetRotation() - TranqRotate:sendResetBroadcast() + TranqRotate:endEncounter() end TranqRotate.mainFrame.frenzyFrame:Hide() end @@ -94,6 +94,11 @@ function TranqRotate:PLAYER_REGEN_ENABLED() TranqRotate:updateRaidStatus() end +-- Player left combat +function TranqRotate:ENCOUNTER_END() + TranqRotate.endEncounter() +end + function TranqRotate:PLAYER_TARGET_CHANGED() if (TranqRotate.db.profile.showWindowWhenTargetingBoss) then if (TranqRotate:isTranqableBoss(UnitGUID("target")) and not UnitIsDead("target")) then diff --git a/src/tranqRotate.lua b/src/tranqRotate.lua index 99db6bd..2bd956f 100644 --- a/src/tranqRotate.lua +++ b/src/tranqRotate.lua @@ -69,6 +69,11 @@ function TranqRotate:printPrefixedMessage(msg) TranqRotate:printMessage(TranqRotate:colorText(TranqRotate.constants.printPrefix) .. msg) end +-- Print message with colored prefix +function TranqRotate:debug(...) + print("TranqRotate", "DEBUG", ...) +end + -- Send a tranq announce message to a given channel function TranqRotate:sendAnnounceMessage(chatMessage) if TranqRotate.db.profile.enableAnnounces then From 26c3e27c505cc4c2065524439419aa0eb9db166d Mon Sep 17 00:00:00 2001 From: Slivo Date: Sat, 18 Sep 2021 11:38:51 +0200 Subject: [PATCH 15/17] Update drag and drop logic --- src/dragdrop.lua | 58 +++++++++++++++++++++++------------------------- src/gui.lua | 1 - 2 files changed, 28 insertions(+), 31 deletions(-) diff --git a/src/dragdrop.lua b/src/dragdrop.lua index 128ff52..9dcee80 100644 --- a/src/dragdrop.lua +++ b/src/dragdrop.lua @@ -25,7 +25,14 @@ function TranqRotate:configureHunterFrameDrag(hunter) function() hunter.frame:StartMoving() hunter.frame:SetFrameStrata("HIGH") - TranqRotate.mainFrame.rulerFrame:SetPoint('BOTTOMRIGHT', hunter.frame, 'TOPLEFT', 0, 0) + + hunter.frame:SetScript( + "OnUpdate", + function () + TranqRotate:setDropHintPosition(hunter.frame) + end + ) + TranqRotate.mainFrame.dropHintFrame:Show() TranqRotate.mainFrame.backupFrame:Show() end @@ -38,17 +45,25 @@ function TranqRotate:configureHunterFrameDrag(hunter) hunter.frame:SetFrameStrata(TranqRotate.mainFrame:GetFrameStrata()) TranqRotate.mainFrame.dropHintFrame:Hide() + -- Removes the OnUpdate event used for drag & drop + hunter.frame:SetScript("OnUpdate", nil) + if (#TranqRotate.rotationTables.backup < 1) then TranqRotate.mainFrame.backupFrame:Hide() end - local group, position = TranqRotate:getDropPosition(TranqRotate.mainFrame.rulerFrame:GetHeight()) + local group, position = TranqRotate:getDropPosition(hunter.frame) TranqRotate:handleDrop(hunter, group, position) TranqRotate:sendSyncOrder(false) end ) end +-- returns the difference between the top of the rotation frame and the dragged hunter frame +function TranqRotate:getDragFrameHeight(hunterFrame) + return math.abs(hunterFrame:GetTop() - TranqRotate.mainFrame.rotationFrame:GetTop()) +end + -- create and initialize the drop hint frame function TranqRotate:createDropHintFrame() @@ -70,32 +85,14 @@ function TranqRotate:createDropHintFrame() TranqRotate.mainFrame.dropHintFrame = hintFrame end --- Create and initialize the 'ruler' frame. --- It's height will be used as a ruler for position calculation -function TranqRotate:createRulerFrame() - - local rulerFrame = CreateFrame("Frame", nil, TranqRotate.mainFrame.rotationFrame) - TranqRotate.mainFrame.rulerFrame = rulerFrame - - rulerFrame:SetPoint('TOPLEFT', TranqRotate.mainFrame.rotationFrame, 'TOPLEFT', 0, 0) - - rulerFrame:SetScript( - "OnSizeChanged", - function (self, width, height) - TranqRotate:setDropHintPosition(self, width, height) - end - ) - -end - -- Set the drop hint frame position to match dragged frame position -function TranqRotate:setDropHintPosition(self, width, height) +function TranqRotate:setDropHintPosition(hunterFrame) local hunterFrameHeight = TranqRotate.constants.hunterFrameHeight local hunterFrameSpacing = TranqRotate.constants.hunterFrameSpacing local hintPosition = 0 - local group, position = TranqRotate:getDropPosition(height) + local group, position = TranqRotate:getDropPosition(hunterFrame) if (group == 'ROTATION') then if (position == 0) then @@ -117,8 +114,9 @@ function TranqRotate:setDropHintPosition(self, width, height) end -- Compute drop group and position from ruler height -function TranqRotate:getDropPosition(rulerHeight) +function TranqRotate:getDropPosition(hunterFrame) + local height = TranqRotate:getDragFrameHeight(hunterFrame) local group = 'ROTATION' local position = 0 @@ -126,25 +124,25 @@ function TranqRotate:getDropPosition(rulerHeight) local hunterFrameSpacing = TranqRotate.constants.hunterFrameSpacing -- Dragged frame is above rotation frames - if (TranqRotate.mainFrame.rulerFrame:GetTop() > TranqRotate.mainFrame.rotationFrame:GetTop()) then - rulerHeight = 0 + if (hunterFrame:GetTop() > TranqRotate.mainFrame.rotationFrame:GetTop()) then + height = 0 end - position = floor(rulerHeight / (hunterFrameHeight + hunterFrameSpacing)) + position = floor(height / (hunterFrameHeight + hunterFrameSpacing)) -- Dragged frame is bellow rotation frame - if (rulerHeight > TranqRotate.mainFrame.rotationFrame:GetHeight()) then + if (height > TranqRotate.mainFrame.rotationFrame:GetHeight()) then group = 'BACKUP' -- Removing rotation frame size from calculation, using it's height as base hintPosition offset - rulerHeight = rulerHeight - TranqRotate.mainFrame.rotationFrame:GetHeight() + height = height - TranqRotate.mainFrame.rotationFrame:GetHeight() - if (rulerHeight > TranqRotate.mainFrame.backupFrame:GetHeight()) then + if (height > TranqRotate.mainFrame.backupFrame:GetHeight()) then -- Dragged frame is bellow backup frame position = #TranqRotate.rotationTables.backup else - position = floor(rulerHeight / (hunterFrameHeight + hunterFrameSpacing)) + position = floor(height / (hunterFrameHeight + hunterFrameSpacing)) end end diff --git a/src/gui.lua b/src/gui.lua index 87a987b..b06fa04 100644 --- a/src/gui.lua +++ b/src/gui.lua @@ -12,7 +12,6 @@ function TranqRotate:initGui() TranqRotate:drawHunterFrames() TranqRotate:createDropHintFrame() - TranqRotate:createRulerFrame() TranqRotate:updateDisplay() end From 3677e2eddf9a7ab0ecfb78adf1de299de64ca43f Mon Sep 17 00:00:00 2001 From: Slivo Date: Sun, 19 Sep 2021 16:44:39 +0200 Subject: [PATCH 16/17] Update readme --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b959df5..71b8778 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # TranqRotate -This addon is meant to help hunters to setup tranqshot rotation and give them real time visual feedback about it. +This addon is meant to help hunters to setup tranqshot rotation and give them real time feedback about it. It also allow non-hunter raid leaders to easily manage, report and watch the tranq rotation live. @@ -10,7 +10,7 @@ This addon will work even if you are the only one using it in your raid. (With s ## Feedback -I'm looking for feedback ! I've set up a small discord server to get in touch : https://discord.gg/bPFyvDe +I've set up a small discord server to talk about the project, get feedback and troubleshoot problems : https://discord.gg/bPFyvDe Please report any issue at https://github.com/Slivo-fr/TranqRotate/issues @@ -60,7 +60,6 @@ The `/tranq check` command allows you to list TranqRotate versions used by other Here is a list of feature I want to implement at some point, no specific order is decided yet. -- Automatic reset of rotation when raid wipe - Customization of the tranq window, size, textures, colors, fonts... ## Download From 5046ba4923fde963939289226ae3bac3a904b2c6 Mon Sep 17 00:00:00 2001 From: Slivo Date: Mon, 27 Sep 2021 15:26:45 +0200 Subject: [PATCH 17/17] increase toc version 2.2.0 --- TranqRotate.toc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TranqRotate.toc b/TranqRotate.toc index 24c3ed8..f0ad2c1 100644 --- a/TranqRotate.toc +++ b/TranqRotate.toc @@ -1,8 +1,8 @@ ## Interface: 11307 -## Title: TranqRotate |cff00aa002.1.0|r +## Title: TranqRotate |cff00aa002.2.0|r ## Notes: A tranqshot rotation assistant ## Author: Slivo -## Version: 2.1.0 +## Version: 2.2.0 ## SavedVariables: TranqRotateDb ## OptionalDeps: Ace3