diff --git a/README.md b/README.md index e6db739..eb3f392 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@ It also allow non-hunter raid leaders to easily manage, report and watch the tra This addon will work even if you are the only one using it in your raid. (With some combat log range limitation, see bellow) -![Screenshot](docs/screenshots/screenshot.png "ui") ![Screenshot](docs/screenshots/drag.gif "ui") ![Screenshot](docs/screenshots/rotation.gif "ui") +![Screenshot](docs/screenshots/screenshot.png "screenshot") ![Screenshot](docs/screenshots/drag.gif "drag and drop gif") ![Screenshot](docs/screenshots/rotation.gif "rotation gif") ## Feedback 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 using github issues : https://github.com/Slivo-fr/TranqRotate/issues +Please report any issue on github : https://github.com/Slivo-fr/TranqRotate/issues ## Features @@ -33,6 +33,7 @@ Please report any issue using github issues : https://github.com/Slivo-fr/TranqR - Optional automatic backup call when incapacitated - Optional automatic timed backup call - Prints to chat name and reason of a tranq fail (miss or resist) +- Show an indicator on hunters that does not use the addon ## Usage @@ -64,7 +65,6 @@ Here is a list of feature I want to implement at some point, no specific order i - Use raid symbols to mark hunters that need to tranq, or that need to backup a failed tranqshot - Automatic reset of rotation when raid wipe - Adds raid markers to tranq announces if target has one -- Show an indicator on hunters that does not use TranqRotate (So you know you have to inform them about the rotation) ## Download diff --git a/TranqRotate.toc b/TranqRotate.toc index d7bc874..4fb4613 100644 --- a/TranqRotate.toc +++ b/TranqRotate.toc @@ -1,8 +1,8 @@ ## Interface: 11307 -## Title: TranqRotate |cff00aa001.6.1|r +## Title: TranqRotate |cff00aa001.7.0|r ## Notes: A tranqshot rotation assistant ## Author: Slivo -## Version: 1.6.1 +## Version: 1.7.0 ## SavedVariables: TranqRotateDb ## OptionalDeps: Ace3 diff --git a/changelog.md b/changelog.md index 66f3dcc..14bb4de 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ ## TranqRotate Changelog +#### v1.7.0 + +- Adds an icon on hunter not using the addon (You can disable it in the settings) +- Adds `/tranq test` command to toggle the test mode +- Improves and fix player addon version checks + #### v1.6.1 - Update ace3 libs for TBC prepatch @@ -33,7 +39,7 @@ #### v1.4.0 -- TranqRotate now play a sound when you need to tranq (You can disable it in the options) +- TranqRotate now play a sound when you need to tranq (You can disable it in the settings) - Added an option to not show up the window each time you join a raid - Added an option to have the window show up when you target a tranq-able boss - Rotation will now reset when you kill the boss diff --git a/docs/screenshots/drag.gif b/docs/screenshots/drag.gif index 46d7b18..7da0744 100644 Binary files a/docs/screenshots/drag.gif and b/docs/screenshots/drag.gif differ diff --git a/docs/screenshots/rotation.gif b/docs/screenshots/rotation.gif index c37fc95..1ce98be 100644 Binary files a/docs/screenshots/rotation.gif and b/docs/screenshots/rotation.gif differ diff --git a/docs/screenshots/rotation.png b/docs/screenshots/rotation.png new file mode 100644 index 0000000..c73ec8f Binary files /dev/null and b/docs/screenshots/rotation.png differ diff --git a/docs/screenshots/screenshot.png b/docs/screenshots/screenshot.png index a58b272..c77579b 100644 Binary files a/docs/screenshots/screenshot.png and b/docs/screenshots/screenshot.png differ diff --git a/docs/screenshots/settings-announces.png b/docs/screenshots/settings-announces.png index 1e16f91..74e6b0b 100644 Binary files a/docs/screenshots/settings-announces.png and b/docs/screenshots/settings-announces.png differ diff --git a/docs/screenshots/settings-general.png b/docs/screenshots/settings-general.png index 1091150..fc6a91a 100644 Binary files a/docs/screenshots/settings-general.png and b/docs/screenshots/settings-general.png differ diff --git a/docs/screenshots/settings-sounds.png b/docs/screenshots/settings-sounds.png index 7b331b8..4abe915 100644 Binary files a/docs/screenshots/settings-sounds.png and b/docs/screenshots/settings-sounds.png differ diff --git a/docs/screenshots/status.png b/docs/screenshots/status.png new file mode 100644 index 0000000..dd6deca Binary files /dev/null and b/docs/screenshots/status.png differ diff --git a/locales/enUS.lua b/locales/enUS.lua index 6295560..0e93418 100644 --- a/locales/enUS.lua +++ b/locales/enUS.lua @@ -32,6 +32,10 @@ local L = { ["FEATURES_HEADER"] = "Optionals features", ["DISPLAY_BOSS_FRENZY_COOLDOWN"] = "Display frenzy cooldown progress bar", ["DISPLAY_BOSS_FRENZY_COOLDOWN_DESC"] = "A thin progress bar just under the title bar will show the progress", + ["DISPLAY_BLIND_ICON"] = "Show an icon for hunter without TranqRotate", + ["DISPLAY_BLIND_ICON_DESC"] = "Adds a blind icon on the hunter frame to indicate he's not using the addon. This means he will not be aware of the rotate unless you communicate with him and his tranqshot won't be synced if he's far from every other TranqRotate user.", + ["DISPLAY_BLIND_ICON_TOOLTIP"] = "Show the blind icon tooltip", + ["DISPLAY_BLIND_ICON_TOOLTIP_DESC"] = "You can disable this options to disable the tooltip while still having the icon", ["ENABLE_AUTOMATIC_BACKUP_ALERT_WHEN_INCAPACITATED"] = "Enable automatic backup alert when incapacitated", ["ENABLE_AUTOMATIC_BACKUP_ALERT_WHEN_INCAPACITATED_DESC"] = "TranqRotate will check for your debuffs when you should actually tranq and will call for backup if you are incapacitated for longer than the defined delay", ["INCAPACITATED_DELAY_THRESHOLD"] = "Incapacitated alert threshold", @@ -94,6 +98,11 @@ local L = { ["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", + ["TOOLTIP_DISABLE_SETTINGS"] = "(You can disable this icon and/or this tooltip in the settings)", } TranqRotate.L = L diff --git a/locales/frFR.lua b/locales/frFR.lua index 202fd85..14290c2 100644 --- a/locales/frFR.lua +++ b/locales/frFR.lua @@ -34,6 +34,10 @@ local L = { ["FEATURES_HEADER"] = "Fonctionnalités optionnelles", ["DISPLAY_BOSS_FRENZY_COOLDOWN"] = "Afficher le cooldown de frénésie des boss", ["DISPLAY_BOSS_FRENZY_COOLDOWN_DESC"] = "Une fine barre de progression, juste sous la barre de titre, indiquera le cooldown de la frénésie", + ["DISPLAY_BLIND_ICON"] = "Afficher une icone pour les chasseurs qui n'utilisent pas TranqRotate", + ["DISPLAY_BLIND_ICON_DESC"] = "Ajoute une icone \"aveugle\" sur le chasseur pour indiquer qu'il n'utilise pas l'addon. Cela signifie qu'il ne connaitra pas la rotation affichée à moins de lui communiquer, ses tir tranquilisants ne seront également pas synchronisés si le joueur se retrouve loin des utilisateurs de l'addons", + ["DISPLAY_BLIND_ICON_TOOLTIP"] = "Afficher l'infobulle pour l'icone \"aveugle\"", + ["DISPLAY_BLIND_ICON_TOOLTIP_DESC"] = "En désactivant cette option vous désactivez l'infobulle tout en conservant l'icone", ["ENABLE_AUTOMATIC_BACKUP_ALERT_WHEN_INCAPACITATED"] = "Activer l'alerte automatique en cas d'incapacité", ["ENABLE_AUTOMATIC_BACKUP_ALERT_WHEN_INCAPACITATED_DESC"] = "TranqRotate alertera automatiquement le backup si un debuff vous empeche de tranq pendant un temps supérieur au délai configuré", ["INCAPACITATED_DELAY_THRESHOLD"] = "Délai pour l'alerte d'incapacité", @@ -96,6 +100,11 @@ local L = { ["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", + ["TOOLTIP_DISABLE_SETTINGS"] = "(Il est possible de désactiver l'icone et/ou l'infobulle dans les options)", } TranqRotate.L = L diff --git a/locales/ruRU.lua b/locales/ruRU.lua index a5022ee..e838c48 100644 --- a/locales/ruRU.lua +++ b/locales/ruRU.lua @@ -31,23 +31,27 @@ local L = { ["ARCANE_SHOT_TESTING_ENABLED"] = "Тестовый режим включен на 10 минут", ["ARCANE_SHOT_TESTING_DISABLED"] = "Тестовый режим выключен", - ["FEATURES_HEADER"] = "Optionals features", - ["DISPLAY_BOSS_FRENZY_COOLDOWN"] = "Display frenzy cooldown progress bar", - ["DISPLAY_BOSS_FRENZY_COOLDOWN_DESC"] = "A thin progress bar just under the title bar will show the progress", - ["ENABLE_AUTOMATIC_BACKUP_ALERT_WHEN_INCAPACITATED"] = "Enable automatic backup alert when incapacitated", - ["ENABLE_AUTOMATIC_BACKUP_ALERT_WHEN_INCAPACITATED_DESC"] = "TranqRotate will check for your debuffs when you should actually tranq and will call for backup if you are incapacitated for longer than the defined delay", - ["INCAPACITATED_DELAY_THRESHOLD"] = "Incapacitated alert threshold", - ["INCAPACITATED_DELAY_THRESHOLD_DESC"] = "If you are incapacitated for longer than the configured delay, TranqRotate will automatically call for backup", - ["ENABLE_AUTOMATIC_TIMED_BACKUP_ALERT"] = "Enable timed automatic backup alert", - ["ENABLE_AUTOMATIC_TIMED_BACKUP_ALERT_DESC"] = "TranqRotate will call for backup if the boss is on frenzy for a defined delay and you should have been tranqing it", - ["TIMED_DELAY_THRESHOLD"] = "Timed alert threshold", - ["TIMED_DELAY_THRESHOLD_DESC"] = "TranqRotate will automatically call for backup if you do not tranq within the configured threshold", + ["FEATURES_HEADER"] = "Дополнительные возможности", + ["DISPLAY_BOSS_FRENZY_COOLDOWN"] = "Показывть полоску перезарядки бешенства", + ["DISPLAY_BOSS_FRENZY_COOLDOWN_DESC"] = "Тонкая полоса прямо под строкой заголовка будет показывать прогресс перезарядки", + ["DISPLAY_BLIND_ICON"] = "Показывать иконку для охотника без TranqRotate", + ["DISPLAY_BLIND_ICON_DESC"] = "Добавляет значок в рамку охотника, показывабщий, что он не использует аддон. Это означает, что он не будет знать о ротации, если вы не сообщите ему, и его Усмеряющий выстрел не будет синхронизирован, если он находится далеко от всех остальных пользователей TranqRotate.", + ["DISPLAY_BLIND_ICON_TOOLTIP"] = "Показать всплывающую подсказку для значка", + ["DISPLAY_BLIND_ICON_TOOLTIP_DESC"] = "При отключить этого параметра, отключается всплывающая потказка для значка, при этом зам значок все еще отображается", + ["ENABLE_AUTOMATIC_BACKUP_ALERT_WHEN_INCAPACITATED"] = "Включить автоматическое оповещение запасным при неспособности", + ["ENABLE_AUTOMATIC_BACKUP_ALERT_WHEN_INCAPACITATED_DESC"] = "TranqRotate проверит ваши дебаффы, и когда вы должны будите использовать Усмиряющий выстрел, а вы не сможете его применить в отведенную очередность, он оповестит запасных", + ["INCAPACITATED_DELAY_THRESHOLD"] = "Порог оповещения о неспособности", + ["INCAPACITATED_DELAY_THRESHOLD_DESC"] = "Если вы потеряете способность выполнить действие дольше установленной задержки, TranqRotate автоматически оповестит запасных", + ["ENABLE_AUTOMATIC_TIMED_BACKUP_ALERT"] = "Включить время автоматического оповещения запасных", + ["ENABLE_AUTOMATIC_TIMED_BACKUP_ALERT_DESC"] = "TranqRotate оповестит запасных, если босс находится в бешенсте в течение оппределенного времени, а вы должны были усмирять его", + ["TIMED_DELAY_THRESHOLD"] = "Время порого для оповещения", + ["TIMED_DELAY_THRESHOLD_DESC"] = "TranqRotate автоматически оповестит запасных, если вы не произвели успирение в установленный порог", --- Announces ["SETTING_ANNOUNCES"] = "Оповещения", ["ENABLE_ANNOUNCES"] = "Включить оповещения", ["ENABLE_ANNOUNCES_DESC"] = "Включить / отключить оповещения", - ["YELL_SAY_DISABLED_OPEN_WORLD"] = "(Yell and say channels does not work in open world, but will inside your raids)", + ["YELL_SAY_DISABLED_OPEN_WORLD"] = "(Каналы Крикнуть и Сказать работают внутри ваших рейдов, но не в открытом мире)", ---- Channels ["ANNOUNCES_CHANNEL_HEADER"] = "Канал оповещений", @@ -69,14 +73,14 @@ local L = { ["SUCCESS_MESSAGE_LABEL"] = "При успехе сообщить", ["FAIL_MESSAGE_LABEL"] = "При промахе сообщить", ["FAIL_WHISPER_LABEL"] = "При промахе шепнуть запасным", - ["UNABLE_TO_TRANQ_MESSAGE_LABEL"] = "Message whispered when you cannot tranq or call for backup", + ["UNABLE_TO_TRANQ_MESSAGE_LABEL"] = "Сообщение шепота, когда вы не можете произвести усирение или оповестить запасных", ['DEFAULT_SUCCESS_ANNOUNCE_MESSAGE'] = "Усмиряющий выстрел в %s", - ['DEFAULT_FAIL_ANNOUNCE_MESSAGE'] = "!!! Усмиряющий выстрел промах в %s !!!", - ['DEFAULT_FAIL_WHISPER_MESSAGE'] = "!!! Усмиряющий выстрел промах !!! ! СТРЕЛЯЙ СЕЙЧАС !", - ['DEFAULT_UNABLE_TO_TRANQ_MESSAGE'] = "I'M UNABLE TO TRANQ ! TRANQ NOW !", + ['DEFAULT_FAIL_ANNOUNCE_MESSAGE'] = "!!! Усмиряющий выстрел промахнулся в %s !!!", + ['DEFAULT_FAIL_WHISPER_MESSAGE'] = "!!! Усмиряющий выстрел промахнулся !!! ! УСМИРЯЙ СЕЙЧАС !", + ['DEFAULT_UNABLE_TO_TRANQ_MESSAGE'] = "Я НЕ МОГУ УСМИРИТЬ ! УСМИРЯЙ СЕЙЧАС !", - ['TRANQ_NOW_LOCAL_ALERT_MESSAGE'] = "СТРЕЛЯЙ СЕЙЧАС !", + ['TRANQ_NOW_LOCAL_ALERT_MESSAGE'] = "УСМИРЯЙ СЕЙЧАС !", ["BROADCAST_MESSAGE_HEADER"] = "Объявление очередности", ["USE_MULTILINE_ROTATION_REPORT"] = "Использовать многострочный вывод при объявлении очередности", @@ -96,6 +100,11 @@ local L = { ["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", + ["TOOLTIP_DISABLE_SETTINGS"] = "(Вы можете отключить этот значок и/или эту подсказку в настройках)", } TranqRotate.L = L diff --git a/locales/zhCN.lua b/locales/zhCN.lua index 1b7e174..bcf5361 100644 --- a/locales/zhCN.lua +++ b/locales/zhCN.lua @@ -34,6 +34,10 @@ local L = { ["FEATURES_HEADER"] = "可选功能", ["DISPLAY_BOSS_FRENZY_COOLDOWN"] = "显示激怒冷却进度条", ["DISPLAY_BOSS_FRENZY_COOLDOWN_DESC"] = "标题栏下方显示一个细进度条", + ["DISPLAY_BLIND_ICON"] = "显示一个没有TranqRotate插件的失明图标", + ["DISPLAY_BLIND_ICON_DESC"] = "在猎人框架上添加一个失明图标,表明他没有使用此插件。这意味着他将不会意识到轮换,除非你与他交流,如果他远离其他TranqRotate用户,他的宁神射击将不会同步。", + ["DISPLAY_BLIND_ICON_TOOLTIP"] = "显示失明图标的工具提示", + ["DISPLAY_BLIND_ICON_TOOLTIP_DESC"] = "您可以禁用此选项来禁用工具提示,同时仍然拥有图标", ["ENABLE_AUTOMATIC_BACKUP_ALERT_WHEN_INCAPACITATED"] = "当无法工作时,启用自动替补通告", ["ENABLE_AUTOMATIC_BACKUP_ALERT_WHEN_INCAPACITATED_DESC"] = "TranqRotate会检查你的Debuff,如果轮到你宁神时,你瘫痪时间超过定义的延迟时间,则会要求替补", ["INCAPACITATED_DELAY_THRESHOLD"] = "瘫痪通告阀值", @@ -41,13 +45,13 @@ local L = { ["ENABLE_AUTOMATIC_TIMED_BACKUP_ALERT"] = "启用定时自动替补通告", ["ENABLE_AUTOMATIC_TIMED_BACKUP_ALERT_DESC"] = "如果BOSS在规定的延迟时间内激怒,而你已经宁神了,那么TranqRotate会要求替补", ["TIMED_DELAY_THRESHOLD"] = "定时通告阈值", - ["TIMED_DELAY_THRESHOLD_DESC"] = "如果你没有在配置的阈值内进行宁神, TranqRotate将自动调用替补", + ["TIMED_DELAY_THRESHOLD_DESC"] = "如果你没有在配置的阈值内进行宁神,TranqRotate将自动调用替补", --- Announces ["SETTING_ANNOUNCES"] = "通告", ["ENABLE_ANNOUNCES"] = "启用通告", ["ENABLE_ANNOUNCES_DESC"] = "启用 / 禁用通告", - ["YELL_SAY_DISABLED_OPEN_WORLD"] = "(Yell and say channels does not work in open world, but will inside your raids)", + ["YELL_SAY_DISABLED_OPEN_WORLD"] = "(大喊并说 频道在开放世界中不工作,但会在你的团本中工作)", ---- Channels ["ANNOUNCES_CHANNEL_HEADER"] = "通告频道", @@ -69,12 +73,12 @@ local L = { ["SUCCESS_MESSAGE_LABEL"] = "施放成功通告信息", ["FAIL_MESSAGE_LABEL"] = "施放失败通告信息", ["FAIL_WHISPER_LABEL"] = "施放失败私聊信息", - ["UNABLE_TO_TRANQ_MESSAGE_LABEL"] = "Message whispered when you cannot tranq or call for backup", + ["UNABLE_TO_TRANQ_MESSAGE_LABEL"] = "当你无法宁神或呼叫替补时,这条信息就会低声传来", ['DEFAULT_SUCCESS_ANNOUNCE_MESSAGE'] = "已对 %s 施放了宁神射击!", ['DEFAULT_FAIL_ANNOUNCE_MESSAGE'] = "!!! 对 %s 宁神失败!!!", ['DEFAULT_FAIL_WHISPER_MESSAGE'] = "宁神失败 !! 赶紧补宁神!!", - ['DEFAULT_UNABLE_TO_TRANQ_MESSAGE'] = "I'M UNABLE TO TRANQ ! TRANQ NOW !", + ['DEFAULT_UNABLE_TO_TRANQ_MESSAGE'] = "我无法宁神射击 ! 请现在宁神 !", ['TRANQ_NOW_LOCAL_ALERT_MESSAGE'] = "立即使用宁神 !!", @@ -96,6 +100,11 @@ local L = { ["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的过时版本", + ["TOOLTIP_DISABLE_SETTINGS"] = "(您可以在设置中禁用此图标或此工具提示)", } TranqRotate.L = L diff --git a/locales/zhTW.lua b/locales/zhTW.lua index e81e3cf..c37b83e 100644 --- a/locales/zhTW.lua +++ b/locales/zhTW.lua @@ -34,6 +34,10 @@ local L = { ["FEATURES_HEADER"] = "Optionals features", ["DISPLAY_BOSS_FRENZY_COOLDOWN"] = "Display frenzy cooldown progress bar", ["DISPLAY_BOSS_FRENZY_COOLDOWN_DESC"] = "A thin progress bar just under the title bar will show the progress", + ["DISPLAY_BLIND_ICON"] = "Show an icon for hunter without TranqRotate", + ["DISPLAY_BLIND_ICON_DESC"] = "Adds a blind icon on the hunter frame to indicate he's not using the addon. This means he will not be aware of the rotate unless you communicate with him and his tranqshot won't be synced if he's far from every other TranqRotate user.", + ["DISPLAY_BLIND_ICON_TOOLTIP"] = "Show the blind icon tooltip", + ["DISPLAY_BLIND_ICON_TOOLTIP_DESC"] = "You can disable this options to disable the tooltip while still having the icon", ["ENABLE_AUTOMATIC_BACKUP_ALERT_WHEN_INCAPACITATED"] = "Enable automatic backup alert when incapacitated", ["ENABLE_AUTOMATIC_BACKUP_ALERT_WHEN_INCAPACITATED_DESC"] = "TranqRotate will check for your debuffs when you should actually tranq and will call for backup if you are incapacitated for longer than the defined delay", ["INCAPACITATED_DELAY_THRESHOLD"] = "Incapacitated alert threshold", @@ -96,6 +100,11 @@ local L = { ["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", + ["TOOLTIP_DISABLE_SETTINGS"] = "(You can disable this icon and/or this tooltip in the settings)", } TranqRotate.L = L diff --git a/src/comms.lua b/src/comms.lua index 492fc33..562f55c 100644 --- a/src/comms.lua +++ b/src/comms.lua @@ -111,6 +111,7 @@ end -- Broadcast a request for the current rotation configuration function TranqRotate:sendBackupRequest(name) + -- todo: translation TranqRotate:printPrefixedMessage('Sending backup request to ' .. name) local message = { @@ -153,6 +154,7 @@ function TranqRotate:receiveSyncOrder(prefix, message, channel, sender) TranqRotate.syncVersion = (message.version) TranqRotate.syncLastSender = sender + -- todo : translation TranqRotate:printPrefixedMessage('Received new rotation configuration from ' .. sender) TranqRotate:applyRotationConfiguration(message.rotation) end @@ -166,6 +168,7 @@ end -- Received a backup request function TranqRotate:receiveBackupRequest(prefix, message, channel, sender) + -- todo: translations TranqRotate:printPrefixedMessage(sender .. ' asked for backup !') TranqRotate:throwTranqAlert() end diff --git a/src/defaults.lua b/src/defaults.lua index e7b2b20..559ce6c 100644 --- a/src/defaults.lua +++ b/src/defaults.lua @@ -23,6 +23,8 @@ function TranqRotate:LoadDefaults() incapacitatedDelay = 2, enableTimedBackupAlert = false, timedBackupAlertDelay = 3, + showIconOnHunterWithoutTranqRotate = true, + showBlindIconTooltip = true, }, } end diff --git a/src/dragdrop.lua b/src/dragdrop.lua index aec7267..4f9a19e 100644 --- a/src/dragdrop.lua +++ b/src/dragdrop.lua @@ -17,6 +17,9 @@ function TranqRotate:configureHunterFrameDrag(hunter) hunter.frame:RegisterForDrag("LeftButton") hunter.frame:SetClampedToScreen(true) + hunter.frame.blindIconFrame:RegisterForDrag("LeftButton") + hunter.frame.blindIconFrame:SetClampedToScreen(true) + hunter.frame:SetScript( "OnDragStart", function() diff --git a/src/events.lua b/src/events.lua index dd1f390..91495ca 100644 --- a/src/events.lua +++ b/src/events.lua @@ -87,7 +87,7 @@ end function TranqRotate:PLAYER_TARGET_CHANGED() if (TranqRotate.db.profile.showWindowWhenTargetingBoss) then - if (TranqRotate:isTranqableBoss(UnitGUID("target")) and not UnitIsDead('target')) then + if (TranqRotate:isTranqableBoss(UnitGUID("target")) and not UnitIsDead("target")) then TranqRotate.mainFrame:Show() end end diff --git a/src/frames.lua b/src/frames.lua index 045828f..d6e2ee3 100644 --- a/src/frames.lua +++ b/src/frames.lua @@ -1,3 +1,5 @@ +local L = TranqRotate.L + -- Create main window function TranqRotate:createMainFrame() TranqRotate.mainFrame = CreateFrame("Frame", 'mainFrame', UIParent) @@ -154,6 +156,7 @@ function TranqRotate:createHunterFrame(hunter, parentFrame) hunter.frame.text:SetText(hunter.name) TranqRotate:createCooldownFrame(hunter) + TranqRotate:createBlindIconFrame(hunter) TranqRotate:configureHunterFrameDrag(hunter) TranqRotate:toggleHunterFrameDragging(hunter, TranqRotate:isPlayerAllowedToSortHunterList()) @@ -198,6 +201,53 @@ function TranqRotate:createCooldownFrame(hunter) hunter.frame.cooldownFrame:Hide() end +-- Create the blind icon frame +function TranqRotate:createBlindIconFrame(hunter) + + -- Frame + hunter.frame.blindIconFrame = CreateFrame("Frame", nil, hunter.frame) + hunter.frame.blindIconFrame:SetPoint('RIGHT', -5, 0) + hunter.frame.blindIconFrame:SetPoint('CENTER', 0, 0) + hunter.frame.blindIconFrame:SetWidth(16) + hunter.frame.blindIconFrame:SetHeight(16) + + -- Set Texture + hunter.frame.blindIconFrame.texture = hunter.frame.blindIconFrame:CreateTexture(nil, "ARTWORK") + hunter.frame.blindIconFrame.texture:SetTexture("Interface\\AddOns\\TranqRotate\\textures\\blind.tga") + hunter.frame.blindIconFrame.texture:SetAllPoints() + hunter.frame.blindIconFrame.texture:SetTexCoord(0.15, 0.85, 0.15, 0.85); + + -- Tooltip + hunter.frame.blindIconFrame:SetScript("OnEnter", TranqRotate.onBlindIconEnter) + hunter.frame.blindIconFrame:SetScript("OnLeave", TranqRotate.onBlindIconLeave) + + -- Drag & drop handlers + hunter.frame.blindIconFrame:SetScript("OnDragStart", function(self, ...) + ExecuteFrameScript(self:GetParent(), "OnDragStart", ...); + end) + hunter.frame.blindIconFrame:SetScript("OnDragStop", function(self, ...) + ExecuteFrameScript(self:GetParent(), "OnDragStop", ...); + end) + + hunter.frame.blindIconFrame:Hide() +end + +-- Blind icon tooltip show +function TranqRotate:onBlindIconEnter() + if (TranqRotate.db.profile.showBlindIconTooltip) then + GameTooltip:SetOwner(self, "ANCHOR_BOTTOMRIGHT") + GameTooltip:SetText(L["TOOLTIP_PLAYER_WITHOUT_ADDON"]) + GameTooltip:AddLine(L["TOOLTIP_MAY_RUN_OUDATED_VERSION"]) + GameTooltip:AddLine(L["TOOLTIP_DISABLE_SETTINGS"]) + GameTooltip:Show() + end +end + +-- Blind icon tooltip hide +function TranqRotate:onBlindIconLeave(self, motion) + GameTooltip:Hide() +end + -- Create the boss frenzy CD frame function TranqRotate:createFrenzyFrame() diff --git a/src/gui.lua b/src/gui.lua index 08e77e0..622eba5 100644 --- a/src/gui.lua +++ b/src/gui.lua @@ -87,7 +87,9 @@ function TranqRotate:drawList(hunterList, parentFrame) end -- SetColor - setHunterFrameColor(hunter) + TranqRotate:setHunterFrameColor(hunter) + -- Update blind version icon + TranqRotate:updateBlindIcon(hunter) hunter.frame:Show() hunter.frame.hunter = hunter @@ -105,11 +107,12 @@ end -- Refresh a single hunter frame function TranqRotate:refreshHunterFrame(hunter) - setHunterFrameColor(hunter) + TranqRotate:setHunterFrameColor(hunter) + TranqRotate:updateBlindIcon(hunter) end -- Set the hunter frame color regarding it's status -function setHunterFrameColor(hunter) +function TranqRotate:setHunterFrameColor(hunter) local color = TranqRotate.colors.green @@ -124,6 +127,28 @@ function setHunterFrameColor(hunter) hunter.frame.texture:SetVertexColor(color:GetRGB()) end +-- Toggle blind icon display based on addonVersion +function TranqRotate:updateBlindIcon(hunter) + if ( + not TranqRotate.db.profile.showIconOnHunterWithoutTranqRotate or + TranqRotate.addonVersions[hunter.name] ~= nil or + hunter.name == UnitName('player') or + not TranqRotate:isHunterOnline(hunter) + ) then + hunter.frame.blindIconFrame:Hide() + else + hunter.frame.blindIconFrame:Show() + end +end + +-- Refresh all blind icons +function TranqRotate:refreshBlindIcons() + for _, hunter in pairs(TranqRotate.hunterTable) do + TranqRotate:updateBlindIcon(hunter) + end +end + +-- Starts the tranq cooldown progress function TranqRotate:startHunterCooldown(hunter) hunter.frame.cooldownFrame.statusBar:SetMinMaxValues(GetTime(), GetTime() + 20) hunter.frame.cooldownFrame.statusBar.expirationTime = GetTime() + 20 diff --git a/src/migration.lua b/src/migration.lua index 0e595b3..e78114c 100644 --- a/src/migration.lua +++ b/src/migration.lua @@ -1,3 +1,4 @@ +-- Runs migrations on the current profile based on the currentMigration value function TranqRotate:migrateProfile() if (TranqRotate.db.profile.currentMigration == nil) then diff --git a/src/rotation.lua b/src/rotation.lua index df99207..88ef101 100644 --- a/src/rotation.lua +++ b/src/rotation.lua @@ -11,7 +11,6 @@ function TranqRotate:registerHunter(hunterName) hunter.nextTranq = false hunter.lastTranqTime = 0 hunter.lastFailTime = 0 - hunter.addonVersion = nil -- Add to global list table.insert(TranqRotate.hunterTable, hunter) @@ -231,7 +230,7 @@ function TranqRotate:resetRotation() end end --- @todo: remove this | TEST FUNCTION - Manually rotate hunters for test purpose +-- TEST FUNCTION - Manually rotate hunters for test purpose function TranqRotate:testRotation() local hunterToRotate = nil @@ -250,19 +249,6 @@ function TranqRotate:testRotation() TranqRotate:rotate(hunterToRotate) end --- Check if a hunter is already registered -function TranqRotate:isHunterRegistered(GUID) - - -- @todo refactor this using TranqRotate:getHunter(name, GUID) - for key,hunter in pairs(TranqRotate.hunterTable) do - if (hunter.GUID == GUID) then - return true - end - end - - return false -end - -- Return our hunter object from name or GUID function TranqRotate:getHunter(name, GUID) @@ -298,6 +284,7 @@ function TranqRotate:updateRaidStatus() if (TranqRotate:isInPveRaid()) then local playerCount = GetNumGroupMembers() + local complete = true for index = 1, playerCount, 1 do @@ -305,28 +292,20 @@ function TranqRotate:updateRaidStatus() -- Players name might be nil at loading if (name ~= nil) then - local GUID = UnitGUID(name) - local hunter - if(TranqRotate:isHunter(name)) then + local hunter = TranqRotate:getHunter(nil, UnitGUID(name)) - local registered = TranqRotate:isHunterRegistered(GUID) - - if (not registered) then - if (not InCombatLockdown()) then - hunter = TranqRotate:registerHunter(name) - TranqRotate:registerUnitEvents(hunter) - registered = true - end - else - hunter = TranqRotate:getHunter(nil, GUID) + if (hunter == nil and not InCombatLockdown()) then + hunter = TranqRotate:registerHunter(name) + TranqRotate:registerUnitEvents(hunter) end - if (registered) then + if (hunter ~= nil) then TranqRotate:updateHunterStatus(hunter) end end - + else + complete = false end end @@ -339,6 +318,15 @@ function TranqRotate:updateRaidStatus() TranqRotate:sendSyncOrderRequest() TranqRotate.raidInitialized = true end + + -- If some player names are nil, retry + if (not complete and not TranqRotate.delayedUpdate) then + TranqRotate.delayedUpdate = true + C_Timer.After(1, function() + TranqRotate:updateRaidStatus() + TranqRotate.delayedUpdate = false + end) + end else if(TranqRotate.raidInitialized == true) then TranqRotate:updateDisplay() @@ -347,6 +335,7 @@ function TranqRotate:updateRaidStatus() end TranqRotate:purgeHunterList() + TranqRotate:purgeAddonVersions() end -- Update hunter status diff --git a/src/settings.lua b/src/settings.lua index bd818fe..814ba1b 100644 --- a/src/settings.lua +++ b/src/settings.lua @@ -91,54 +91,69 @@ function TranqRotate:CreateConfig() testHeader = { name = L["TEST_MODE_HEADER"], type = "header", - order = 10, + order = 30, }, ToggleArcaneShotTestingDesc = { name = L['ENABLE_ARCANE_SHOT_TESTING_DESC'], type = "description", width = "full", - order = 11, + order = 31, }, spacer12 = { name = ' ', type = "description", width = "full", - order = 12, + order = 32, }, ToggleArcaneShotTesting = { name = L["ENABLE_ARCANE_SHOT_TESTING"], type = "execute", - order = 13, + order = 33, func = function() TranqRotate.toggleArcaneShotTesting() end }, featuresHeader = { name = L["FEATURES_HEADER"], type = "header", - order = 20, + order = 50, }, showFrenzyCooldownProgress = { name = L["DISPLAY_BOSS_FRENZY_COOLDOWN"], desc = L["DISPLAY_BOSS_FRENZY_COOLDOWN_DESC"], type = "toggle", - order = 21, + order = 51, width = "full", set = function(info, value) set(info, value) if (not value) then TranqRotate:resetFrenzyFrame() end end }, + showIconOnHunterWithoutTranqRotate = { + name = L["DISPLAY_BLIND_ICON"], + desc = L["DISPLAY_BLIND_ICON_DESC"], + type = "toggle", + order = 52, + width = "full", + set = function(info, value) set(info,value) TranqRotate:refreshBlindIcons() end + }, + showBlindIconTooltip = { + name = L["DISPLAY_BLIND_ICON_TOOLTIP"], + desc = L["DISPLAY_BLIND_ICON_TOOLTIP_DESC"], + type = "toggle", + order = 53, + width = "full", + }, enableIncapacitatedBackupAlert = { name = L["ENABLE_AUTOMATIC_BACKUP_ALERT_WHEN_INCAPACITATED"], desc = L["ENABLE_AUTOMATIC_BACKUP_ALERT_WHEN_INCAPACITATED_DESC"], type = "toggle", - order = 25, + order = 54, width = "double", }, incapacitatedDelay = { name = L["INCAPACITATED_DELAY_THRESHOLD"], desc = L["INCAPACITATED_DELAY_THRESHOLD_DESC"], type = "range", - order = 26, + order = 55, width = "normal", min = 1, max = 6, @@ -148,14 +163,14 @@ function TranqRotate:CreateConfig() name = L["ENABLE_AUTOMATIC_TIMED_BACKUP_ALERT"], desc = L["ENABLE_AUTOMATIC_TIMED_BACKUP_ALERT_DESC"], type = "toggle", - order = 30, + order = 56, width = "double", }, timedBackupAlertDelay = { name = L["TIMED_DELAY_THRESHOLD"], desc = L["TIMED_DELAY_THRESHOLD_DESC"], type = "range", - order = 31, + order = 57, width = "normal", min = 1, max = 6, diff --git a/src/tranqRotate.lua b/src/tranqRotate.lua index 34d457e..8ba40d7 100644 --- a/src/tranqRotate.lua +++ b/src/tranqRotate.lua @@ -7,15 +7,15 @@ TranqRotate.version = GetAddOnMetadata(..., "Version") -- Initialize addon - Shouldn't be call more than once function TranqRotate:init() - self:LoadDefaults() + TranqRotate:LoadDefaults() - self.db = LibStub:GetLibrary("AceDB-3.0"):New("TranqRotateDb", self.defaults, true) - self.db.RegisterCallback(self, "OnProfileChanged", "ProfilesChanged") - self.db.RegisterCallback(self, "OnProfileCopied", "ProfilesChanged") - self.db.RegisterCallback(self, "OnProfileReset", "ProfilesChanged") + TranqRotate.db = LibStub:GetLibrary("AceDB-3.0"):New("TranqRotateDb", self.defaults, true) + TranqRotate.db.RegisterCallback(self, "OnProfileChanged", "ProfilesChanged") + TranqRotate.db.RegisterCallback(self, "OnProfileCopied", "ProfilesChanged") + TranqRotate.db.RegisterCallback(self, "OnProfileReset", "ProfilesChanged") - self:CreateConfig() - TranqRotate.migrateProfile() + TranqRotate:CreateConfig() + TranqRotate:migrateProfile() TranqRotate.hunterTable = {} TranqRotate.addonVersions = {} @@ -127,7 +127,7 @@ SlashCmdList["TRANQROTATE"] = function(msg) TranqRotate:alertBackup(TranqRotate.db.profile.unableToTranqMessage) elseif (cmd == 'rotate') then -- @todo decide if this should be removed or not TranqRotate:testRotation() - elseif (cmd == 'test') then -- @todo: remove this + elseif (cmd == 'test') then TranqRotate:toggleArcaneShotTesting() elseif (cmd == 'report') then TranqRotate:printRotationSetup() @@ -215,6 +215,7 @@ function TranqRotate:printHelp() TranqRotate:printMessage(spacing .. TranqRotate:colorText('report') .. ' : Prints the rotation setup to the configured channel') TranqRotate:printMessage(spacing .. TranqRotate:colorText('backup') .. ' : Whispers backup hunters to immediately tranq') TranqRotate:printMessage(spacing .. TranqRotate:colorText('check') .. ' : Prints users version of TranqRotate') + TranqRotate:printMessage(spacing .. TranqRotate:colorText('test') .. ' : Toggle test mode') end -- Adds color to given text @@ -239,32 +240,39 @@ function TranqRotate:toggleArcaneShotTesting(disable) end end +-- Update the addon version of a given player function TranqRotate:updatePlayerAddonVersion(player, version) + TranqRotate.addonVersions[player] = version local hunter = TranqRotate:getHunter(player) if (hunter) then - hunter.addonVersion = version - else - TranqRotate.addonVersions[player] = version + TranqRotate:updateBlindIcon(hunter) end 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) - for key, hunter in pairs(TranqRotate.hunterTable) do - if (hunter.name ~= UnitName("player")) then - TranqRotate:printPrefixedMessage(hunter.name .. " - " .. TranqRotate:formatAddonVersion(hunter.addonVersion)) + for player, version in pairs(TranqRotate.addonVersions) do + if (player ~= UnitName("player")) then + TranqRotate:printPrefixedMessage(player .. " - " .. TranqRotate:formatAddonVersion(version)) end end - for key, player in pairs(TranqRotate.addonVersions) do - if (player ~= UnitName("player")) then - TranqRotate:printPrefixedMessage(player .. " - " .. TranqRotate:formatAddonVersion(hunter.addonVersion)) +end + +-- Removes players that left the raid from version table +function TranqRotate:purgeAddonVersions() + for player, version in pairs(TranqRotate.addonVersions) do + if (not UnitInParty(player)) then + TranqRotate.addonVersions[player] = nil end end end +-- @todo translations +-- Returns a string based on the hunter addon version function TranqRotate:formatAddonVersion(version) if (version == nil) then return "None or below 1.6.0" @@ -273,6 +281,8 @@ function TranqRotate:formatAddonVersion(version) end end +-- @todo translations +-- Prints in the chat the reason a tranqshot has failed function TranqRotate:printFail(hunter, event) if (event == "SPELL_MISSED") then TranqRotate:printPrefixedMessage(hunter.name .. " missed his tranqshot!") @@ -283,3 +293,20 @@ function TranqRotate:printFail(hunter, event) TranqRotate:printPrefixedMessage(hunter.name .. "'s tranqshot was missed or resisted!") end end + +-- Demo rotation to record documentation gifs / screens +function TranqRotate:runDemo() + C_Timer.NewTicker( + 10.5, + function() + TranqRotate:startBossFrenzyCooldown(10) + C_Timer.After( + 1, + function() + TranqRotate:testRotation() + end + ) + end, + 5 + ) +end diff --git a/textures/blind.tga b/textures/blind.tga new file mode 100644 index 0000000..1ca8ab6 Binary files /dev/null and b/textures/blind.tga differ