Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v1.8.0 #53

Merged
merged 13 commits into from
May 27, 2021
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,8 @@ The `/tranq check` command allows you to list version or TranqRotate used by oth

Here is a list of feature I want to implement at some point, no specific order is decided yet.

- Automatic handling of death and disconnection of hunters on the rotation group (swap with a backup, send an alert about it)
- 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
- Customization of the tranq window, size, textures, colors, fonts...

## Download

Expand Down
5 changes: 3 additions & 2 deletions TranqRotate.toc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Interface: 11307
## Title: TranqRotate |cff00aa001.7.0|r
## Title: TranqRotate |cff00aa001.8.0|r
## Notes: A tranqshot rotation assistant
## Author: Slivo
## Version: 1.7.0
## Version: 1.8.0
## SavedVariables: TranqRotateDb
## OptionalDeps: Ace3

Expand Down Expand Up @@ -36,3 +36,4 @@ src\settings.lua
src\utils.lua
src\debuff.lua
src\migration.lua
src\raidIcons.lua
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## TranqRotate Changelog

#### v1.8.0

- Adds different announces messages for boss and trash (Boss announces can call next player, trash announces can call target)
- Adds raid marker symbol to chat tranq announces
- Adds "available update" chat notifications
- Removes server suffix from hunter names on era connected realms

#### v1.7.0

- Adds an icon on hunter not using the addon (You can disable it in the settings)
Expand Down
10 changes: 8 additions & 2 deletions locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ local L = {

---- Messages
["ANNOUNCES_MESSAGE_HEADER"] = "Announce messages",
["SUCCESS_MESSAGE_LABEL"] = "Successful announce message",
["BOSS_SUCCESS_MESSAGE_LABEL"] = "Successful announce message on boss (%s will be replaced by next hunter name)",
["TRASH_SUCCESS_MESSAGE_LABEL"] = "Successful announce message on trash (%s will be replaced by target name)",
["FAIL_MESSAGE_LABEL"] = "Fail announce message",
["FAIL_WHISPER_LABEL"] = "Fail whisper message",
["UNABLE_TO_TRANQ_MESSAGE_LABEL"] = "Message whispered when you cannot tranq or call for backup",

['DEFAULT_SUCCESS_ANNOUNCE_MESSAGE'] = "Tranqshot done on %s",
['DEFAULT_BOSS_SUCCESS_ANNOUNCE_MESSAGE'] = "Tranqshot done, %s is next!",
['DEFAULT_TRASH_SUCCESS_ANNOUNCE_MESSAGE'] = "Tranqshot done on %s",
['DEFAULT_FAIL_ANNOUNCE_MESSAGE'] = "!!! TRANQSHOT FAILED ON %s !!!",
['DEFAULT_FAIL_WHISPER_MESSAGE'] = "TRANQSHOT MISSED ! TRANQ NOW !",
['DEFAULT_UNABLE_TO_TRANQ_MESSAGE'] = "I'M UNABLE TO TRANQ ! TRANQ NOW !",
Expand Down Expand Up @@ -103,6 +105,10 @@ local L = {
["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)",

--- Available update
["UPDATE_AVAILABLE"] = "A new TranqRotate version is available, update to get latest features",
["BREAKING_UPDATE_AVAILABLE"] = "A new BREAKING TranqRotate update is available, you MUST update AS SOON AS possible! TranqRotate may not work properly with up-to-date version users.",
}

TranqRotate.L = L
10 changes: 8 additions & 2 deletions locales/frFR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ local L = {

---- Messages
["ANNOUNCES_MESSAGE_HEADER"] = "Annonces de tir tranquilisant",
["SUCCESS_MESSAGE_LABEL"] = "Message de réussite",
["BOSS_SUCCESS_MESSAGE_LABEL"] = "Message de réussite sur boss (%s est le nom du prochain chasseur)",
["TRASH_SUCCESS_MESSAGE_LABEL"] = "Message de réussite sur trash (%s est le nom de la cible)",
["FAIL_MESSAGE_LABEL"] = "Message d'échec",
["FAIL_WHISPER_LABEL"] = "Message d'échec chuchoté",
["UNABLE_TO_TRANQ_MESSAGE_LABEL"] = "Message chuchoté quand vous ne pouvez pas tranq ou que vous demandez un backup",

['DEFAULT_SUCCESS_ANNOUNCE_MESSAGE'] = "Tir tranquillisant fait sur %s",
['DEFAULT_BOSS_SUCCESS_ANNOUNCE_MESSAGE'] = "Tir tranquillisant fait, %s est le suivant!",
['DEFAULT_TRASH_SUCCESS_ANNOUNCE_MESSAGE'] = "Tir tranquillisant fait sur %s",
['DEFAULT_FAIL_ANNOUNCE_MESSAGE'] = "!!! TIR TRANQUILLISANT RATE SUR %s !!!",
['DEFAULT_FAIL_WHISPER_MESSAGE'] = "TIR TRANQUILISANT RATE ! TRANQ MAINTENANT !",
['DEFAULT_UNABLE_TO_TRANQ_MESSAGE'] = "JE NE PEUX PAS TRANQ ! TRANQ MAINTENANT !",
Expand Down Expand Up @@ -105,6 +107,10 @@ local L = {
["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)",

--- Available update
["UPDATE_AVAILABLE"] = "Une nouvelle version est disponible, faites la mise à jour pour profiter des derniers ajouts",
["BREAKING_UPDATE_AVAILABLE"] = "Une nouvelle version MAJEURE est disponible, vous DEVEZ faire la mise à jour le plus rapidement possible! Votre version pourrait ne pas fonctionner correctement avec celle des utilisateurs disposant de la mise à jour.",
}

TranqRotate.L = L
10 changes: 8 additions & 2 deletions locales/ruRU.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ local L = {

---- Messages
["ANNOUNCES_MESSAGE_HEADER"] = "Сообщения оповещений",
["SUCCESS_MESSAGE_LABEL"] = "При успехе сообщить",
["BOSS_SUCCESS_MESSAGE_LABEL"] = "Successful announce message on boss (%s will be replaced by next hunter name)",
["TRASH_SUCCESS_MESSAGE_LABEL"] = "Successful announce message on trash (%s will be replaced by target name)",
["FAIL_MESSAGE_LABEL"] = "При промахе сообщить",
["FAIL_WHISPER_LABEL"] = "При промахе шепнуть запасным",
["UNABLE_TO_TRANQ_MESSAGE_LABEL"] = "Сообщение шепота, когда вы не можете произвести усирение или оповестить запасных",

['DEFAULT_SUCCESS_ANNOUNCE_MESSAGE'] = "Усмиряющий выстрел в %s",
['DEFAULT_BOSS_SUCCESS_ANNOUNCE_MESSAGE'] = "Tranqshot done, %s is next!",
['DEFAULT_TRASH_SUCCESS_ANNOUNCE_MESSAGE'] = "Tranqshot done on %s",
['DEFAULT_FAIL_ANNOUNCE_MESSAGE'] = "!!! Усмиряющий выстрел промахнулся в %s !!!",
['DEFAULT_FAIL_WHISPER_MESSAGE'] = "!!! Усмиряющий выстрел промахнулся !!! ! УСМИРЯЙ СЕЙЧАС !",
['DEFAULT_UNABLE_TO_TRANQ_MESSAGE'] = "Я НЕ МОГУ УСМИРИТЬ ! УСМИРЯЙ СЕЙЧАС !",
Expand Down Expand Up @@ -105,6 +107,10 @@ local L = {
["TOOLTIP_PLAYER_WITHOUT_ADDON"] = "Этот игрок не использует TranqRotate",
["TOOLTIP_MAY_RUN_OUDATED_VERSION"] = "Или используется версия ниже 1.6.0",
["TOOLTIP_DISABLE_SETTINGS"] = "(Вы можете отключить этот значок и/или эту подсказку в настройках)",

--- Available update
["UPDATE_AVAILABLE"] = "A new TranqRotate version is available, update to get latest features",
["BREAKING_UPDATE_AVAILABLE"] = "A new BREAKING TranqRotate update is available, you MUST update AS SOON AS possible! TranqRotate may not work properly with up-to-date version users.",
}

TranqRotate.L = L
10 changes: 8 additions & 2 deletions locales/zhCN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ local L = {

---- Messages
["ANNOUNCES_MESSAGE_HEADER"] = "通告信息",
["SUCCESS_MESSAGE_LABEL"] = "施放成功通告信息",
["BOSS_SUCCESS_MESSAGE_LABEL"] = "Successful announce message on boss (%s will be replaced by next hunter name)",
["TRASH_SUCCESS_MESSAGE_LABEL"] = "Successful announce message on trash (%s will be replaced by target name)",
["FAIL_MESSAGE_LABEL"] = "施放失败通告信息",
["FAIL_WHISPER_LABEL"] = "施放失败私聊信息",
["UNABLE_TO_TRANQ_MESSAGE_LABEL"] = "当你无法宁神或呼叫替补时,这条信息就会低声传来",

['DEFAULT_SUCCESS_ANNOUNCE_MESSAGE'] = "已对 %s 施放了宁神射击!",
['DEFAULT_BOSS_SUCCESS_ANNOUNCE_MESSAGE'] = "Tranqshot done, %s is next!",
['DEFAULT_TRASH_SUCCESS_ANNOUNCE_MESSAGE'] = "Tranqshot done on %s",
['DEFAULT_FAIL_ANNOUNCE_MESSAGE'] = "!!! 对 %s 宁神失败!!!",
['DEFAULT_FAIL_WHISPER_MESSAGE'] = "宁神失败 !! 赶紧补宁神!!",
['DEFAULT_UNABLE_TO_TRANQ_MESSAGE'] = "我无法宁神射击 ! 请现在宁神 !",
Expand Down Expand Up @@ -105,6 +107,10 @@ local L = {
["TOOLTIP_PLAYER_WITHOUT_ADDON"] = "此玩家没有使用TranqRotate插件",
["TOOLTIP_MAY_RUN_OUDATED_VERSION"] = "或者运行低于1.6.0的过时版本",
["TOOLTIP_DISABLE_SETTINGS"] = "(您可以在设置中禁用此图标或此工具提示)",

--- Available update
["UPDATE_AVAILABLE"] = "A new TranqRotate version is available, update to get latest features",
["BREAKING_UPDATE_AVAILABLE"] = "A new BREAKING TranqRotate update is available, you MUST update AS SOON AS possible! TranqRotate may not work properly with up-to-date version users.",
}

TranqRotate.L = L
10 changes: 8 additions & 2 deletions locales/zhTW.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ local L = {

---- Messages
["ANNOUNCES_MESSAGE_HEADER"] = "通告資訊",
["SUCCESS_MESSAGE_LABEL"] = "施放成功通告資訊",
["BOSS_SUCCESS_MESSAGE_LABEL"] = "Successful announce message on boss (%s will be replaced by next hunter name)",
["TRASH_SUCCESS_MESSAGE_LABEL"] = "Successful announce message on trash (%s will be replaced by target name)",
["FAIL_MESSAGE_LABEL"] = "施放失敗通告資訊",
["FAIL_WHISPER_LABEL"] = "施放失敗私聊資訊",
["UNABLE_TO_TRANQ_MESSAGE_LABEL"] = "Message whispered when you cannot tranq or call for backup",

['DEFAULT_SUCCESS_ANNOUNCE_MESSAGE'] = "已對 %s 施放了寧神射擊!",
['DEFAULT_BOSS_SUCCESS_ANNOUNCE_MESSAGE'] = "Tranqshot done, %s is next!",
['DEFAULT_TRASH_SUCCESS_ANNOUNCE_MESSAGE'] = "Tranqshot done on %s",
['DEFAULT_FAIL_ANNOUNCE_MESSAGE'] = "!!! 對 %s 寧神失敗!!!",
['DEFAULT_FAIL_WHISPER_MESSAGE'] = "寧神失敗 !! 趕緊補寧神!!",
['DEFAULT_UNABLE_TO_TRANQ_MESSAGE'] = "I'M UNABLE TO TRANQ ! TRANQ NOW !",
Expand Down Expand Up @@ -105,6 +107,10 @@ local L = {
["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)",

--- Available update
["UPDATE_AVAILABLE"] = "A new TranqRotate version is available, update to get latest features",
["BREAKING_UPDATE_AVAILABLE"] = "A new BREAKING TranqRotate update is available, you MUST update AS SOON AS possible! TranqRotate may not work properly with up-to-date version users.",
}

TranqRotate.L = L
3 changes: 2 additions & 1 deletion src/comms.lua
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ end
function TranqRotate:receiveSyncOrder(prefix, message, channel, sender)

TranqRotate:updateRaidStatus()
TranqRotate:updatePlayerAddonVersion(sender, message.addonVersion)

if (TranqRotate:isVersionEligible(message.version, sender)) then
TranqRotate.syncVersion = (message.version)
Expand All @@ -158,6 +157,8 @@ function TranqRotate:receiveSyncOrder(prefix, message, channel, sender)
TranqRotate:printPrefixedMessage('Received new rotation configuration from ' .. sender)
TranqRotate:applyRotationConfiguration(message.rotation)
end

TranqRotate:updatePlayerAddonVersion(sender, message.addonVersion)
end

-- Request to send current roration configuration received
Expand Down
3 changes: 2 additions & 1 deletion src/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ function TranqRotate:LoadDefaults()
channelType = "YELL",
rotationReportChannelType = "RAID",
useMultilineRotationReport = false,
announceSuccessMessage = L["DEFAULT_SUCCESS_ANNOUNCE_MESSAGE"],
announceBossSuccessMessage = L["DEFAULT_BOSS_SUCCESS_ANNOUNCE_MESSAGE"],
announceTrashSuccessMessage = L["DEFAULT_TRASH_SUCCESS_ANNOUNCE_MESSAGE"],
announceFailMessage = L["DEFAULT_FAIL_ANNOUNCE_MESSAGE"],
whisperFailMessage = L["DEFAULT_FAIL_WHISPER_MESSAGE"],
unableToTranqMessage = L["DEFAULT_UNABLE_TO_TRANQ_MESSAGE"],
Expand Down
12 changes: 9 additions & 3 deletions src/events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,25 @@ function TranqRotate:COMBAT_LOG_EVENT_UNFILTERED()
local spellId, spellName, spellSchool, amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing, isOffHand = select(12, CombatLogGetCurrentEventInfo())

if (spellName == tranqShot or (TranqRotate.testMode and spellName == arcaneShot)) then
local hunter = TranqRotate:getHunter(nil, sourceGUID)
local hunter = TranqRotate:getHunter(sourceGUID)
if (hunter) then
if (event == "SPELL_CAST_SUCCESS") then
TranqRotate:sendSyncTranq(hunter, false, timestamp)
TranqRotate:rotate(hunter)
if (sourceGUID == UnitGUID("player")) then
TranqRotate:sendAnnounceMessage(TranqRotate.db.profile.announceSuccessMessage, destName)
TranqRotate:sendAnnounceMessage(
TranqRotate:getTranqSuccessMessage(
TranqRotate:isTranqableBoss(destGUID),
destName,
destRaidFlags
)
)
end
elseif (event == "SPELL_MISSED" or event == "SPELL_DISPEL_FAILED") then
TranqRotate:sendSyncTranq(hunter, true, timestamp, event)
TranqRotate:handleFailTranq(hunter, event)
if (sourceGUID == UnitGUID("player")) then
TranqRotate:sendAnnounceMessage(TranqRotate.db.profile.announceFailMessage, destName)
TranqRotate:sendAnnounceMessage(TranqRotate:getTranqFailMessage(destName, destRaidFlags))
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/frames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function TranqRotate:createHunterFrame(hunter, parentFrame)
hunter.frame.text = hunter.frame:CreateFontString(nil, "ARTWORK")
hunter.frame.text:SetFont(TranqRotate:getPlayerNameFont(), 12)
hunter.frame.text:SetPoint("LEFT",5,0)
hunter.frame.text:SetText(hunter.name)
hunter.frame.text:SetText(strsplit("-", hunter.name))

TranqRotate:createCooldownFrame(hunter)
TranqRotate:createBlindIconFrame(hunter)
Expand Down
5 changes: 5 additions & 0 deletions src/migration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ TranqRotate.migrations = {
TranqRotate.db.profile.enableTimedBackupAlertValue = nil
TranqRotate.db.profile.timedBackupAlertValueDelay = nil
end,
-- 1.8.0
function()
-- This is an old key
TranqRotate.db.profile.announceSuccessMessage = nil
end,
}
21 changes: 21 additions & 0 deletions src/raidIcons.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
TranqRotate.chatIconString = "{rt%d}"

TranqRotate.raidIconMaskToIndex = {
[COMBATLOG_OBJECT_RAIDTARGET1] = 1,
[COMBATLOG_OBJECT_RAIDTARGET2] = 2,
[COMBATLOG_OBJECT_RAIDTARGET3] = 3,
[COMBATLOG_OBJECT_RAIDTARGET4] = 4,
[COMBATLOG_OBJECT_RAIDTARGET5] = 5,
[COMBATLOG_OBJECT_RAIDTARGET6] = 6,
[COMBATLOG_OBJECT_RAIDTARGET7] = 7,
[COMBATLOG_OBJECT_RAIDTARGET8] = 8,
}

function TranqRotate:getRaidTargetIcon(flags)
local raidIconMask = bit.band(flags, COMBATLOG_OBJECT_RAIDTARGET_MASK)
if (TranqRotate.raidIconMaskToIndex[raidIconMask]) then
return string.format(TranqRotate.chatIconString, TranqRotate.raidIconMaskToIndex[raidIconMask])
end

return ""
end
43 changes: 36 additions & 7 deletions src/rotation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function TranqRotate:isPlayerNextTranq()
return false
end

local player = TranqRotate:getHunter(nil, UnitGUID("player"))
local player = TranqRotate:getHunter(UnitGUID("player"))

if (not player.nextTranq) then

Expand Down Expand Up @@ -250,10 +250,10 @@ function TranqRotate:testRotation()
end

-- Return our hunter object from name or GUID
function TranqRotate:getHunter(name, GUID)
function TranqRotate:getHunter(searchTerm)

for key,hunter in pairs(TranqRotate.hunterTable) do
if ((GUID ~= nil and hunter.GUID == GUID) or (name ~= nil and hunter.name == name)) then
for _, hunter in pairs(TranqRotate.hunterTable) do
if (searchTerm ~= nil and (hunter.GUID == searchTerm or hunter.name == searchTerm)) then
return hunter
end
end
Expand Down Expand Up @@ -293,7 +293,7 @@ function TranqRotate:updateRaidStatus()
-- Players name might be nil at loading
if (name ~= nil) then
if(TranqRotate:isHunter(name)) then
local hunter = TranqRotate:getHunter(nil, UnitGUID(name))
local hunter = TranqRotate:getHunter(UnitGUID(name))

if (hunter == nil and not InCombatLockdown()) then
hunter = TranqRotate:registerHunter(name)
Expand Down Expand Up @@ -447,8 +447,8 @@ function TranqRotate:applyRotationConfiguration(rotationsTables)
group = 'BACKUP'
end

for index, hunterName in pairs(rotationTable) do
local hunter = TranqRotate:getHunter(hunterName)
for index, GUID in pairs(rotationTable) do
local hunter = TranqRotate:getHunter(GUID)
if (hunter) then
TranqRotate:moveHunter(hunter, group, index)
end
Expand Down Expand Up @@ -523,3 +523,32 @@ function TranqRotate:getHighlightedHunter()

return nil
end

function TranqRotate:getTranqSuccessMessage(isBossTranq, targetName, raidIconFlags)

local message = ""
if (isBossTranq) then
message = TranqRotate.db.profile.announceBossSuccessMessage
local hunter = TranqRotate:getHighlightedHunter()
message = string.format(message, hunter.name)
else
message = TranqRotate.db.profile.announceTrashSuccessMessage
message = string.format(
message,
TranqRotate:getRaidTargetIcon(raidIconFlags) .. targetName
)
end

return message
end

function TranqRotate:getTranqFailMessage(targetName, raidIconFlags)

local message = TranqRotate.db.profile.announceFailMessage
message = string.format(
message,
TranqRotate:getRaidTargetIcon(raidIconFlags) .. targetName
)

return message
end
16 changes: 11 additions & 5 deletions src/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -214,28 +214,34 @@ function TranqRotate:CreateConfig()
width = "normal",
order = 22,
},
announceSuccessMessage = {
name = L["SUCCESS_MESSAGE_LABEL"],
announceBossSuccessMessage = {
name = L["BOSS_SUCCESS_MESSAGE_LABEL"],
type = "input",
order = 23,
width = "double",
},
announceTrashSuccessMessage = {
name = L["TRASH_SUCCESS_MESSAGE_LABEL"],
type = "input",
order = 24,
width = "double",
},
announceFailMessage = {
name = L["FAIL_MESSAGE_LABEL"],
type = "input",
order = 24,
order = 25,
width = "double",
},
whisperFailMessage = {
name = L["FAIL_WHISPER_LABEL"],
type = "input",
order = 25,
order = 26,
width = "double",
},
unableToTranqMessage = {
name = L["UNABLE_TO_TRANQ_MESSAGE_LABEL"],
type = "input",
order = 26,
order = 27,
width = "double",
},
setupBroadcastHeader = {
Expand Down
Loading