Skip to content

Commit 93a7a8c

Browse files
committed
Added the baseline for the Coach Mode feature
- Added the command '/details coach' to enabled coach mode, need to be raid leader and all members must have details up to date. - Fixed Tiny Threat not showing threat. - Fixed annoucement interrupt toggle enable was reseting on logon. - Added container_spells:GetOrCreateSpell(id, shouldCreate, token) - Added Details:GetRaidLeader(), return the RL name. - Framework update.
1 parent 262f115 commit 93a7a8c

File tree

15 files changed

+1587
-35
lines changed

15 files changed

+1587
-35
lines changed

Details.toc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ API.lua
2828
functions\profiles.lua
2929
functions\hooks.lua
3030
functions\bossmods.lua
31+
functions\coach.lua
3132
functions\skins.lua
3233
functions\boss.lua
3334
functions\spells.lua

Libs/DF/fw.lua

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
local dversion = 214
3+
local dversion = 215
44

55
local major, minor = "DetailsFramework-1.0", dversion
66
local DF, oldminor = LibStub:NewLibrary (major, minor)
@@ -609,7 +609,26 @@ function DF:TruncateText (fontString, maxWidth)
609609
if (string.len (text) <= 1) then
610610
break
611611
end
612-
end
612+
end
613+
614+
DF:CleanTruncateUTF8String(text)
615+
fontString:SetText (text)
616+
end
617+
618+
function DF:CleanTruncateUTF8String(text)
619+
if type(text) == "string" and text ~= "" then
620+
local b1 = (#text > 0) and strbyte(strsub(text, #text, #text)) or nil
621+
local b2 = (#text > 1) and strbyte(strsub(text, #text-1, #text)) or nil
622+
local b3 = (#text > 2) and strbyte(strsub(text, #text-2, #text)) or nil
623+
if b1 and b1 >= 194 and b1 <= 244 then
624+
text = strsub (text, 1, #text - 1)
625+
elseif b2 and b2 >= 224 and b2 <= 244 then
626+
text = strsub (text, 1, #text - 2)
627+
elseif b3 and b3 >= 240 and b3 <= 244 then
628+
text = strsub (text, 1, #text - 3)
629+
end
630+
end
631+
return text
613632
end
614633

615634
function DF:Msg (msg, ...)

boot.lua

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
_ = nil
55
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0")
66

7-
_detalhes.build_counter = 7938
8-
_detalhes.alpha_build_counter = 7938 --if this is higher than the regular counter, use it instead
7+
_detalhes.build_counter = 7950
8+
_detalhes.alpha_build_counter = 7950 --if this is higher than the regular counter, use it instead
99
_detalhes.game_version = "v9.0.1"
1010
_detalhes.userversion = "v9.0.1." .. _detalhes.build_counter
11-
_detalhes.realversion = 143 --core version, this is used to check API version for scripts and plugins (see alias below)
11+
_detalhes.realversion = 144 --core version, this is used to check API version for scripts and plugins (see alias below)
1212
_detalhes.APIVersion = _detalhes.realversion --core version
1313
_detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" --simple stirng to show to players
1414

@@ -28,8 +28,16 @@ do
2828
local Loc = _G.LibStub("AceLocale-3.0"):GetLocale( "Details" )
2929

3030
local news = {
31+
{"v9.0.1.7950.144", "November 3rd, 2020"},
32+
"Added the baseline for the Coach feature, for testing use '/details coach', all users in the raid must have details! up to date.",
33+
"Added container_spells:GetOrCreateSpell(id, shouldCreate, token).",
34+
"Added Details:GetRaidLeader(), return the RL name.",
35+
"Fixed Tiny Threat not showing threat.",
36+
"Fixed annoucement interrupt enable toggle checkbox was reseting on logon.",
37+
3138
{"v9.0.1.7938.142", "October 29th, 2020"},
3239
"Added option to select the icon buttons in the title bar.",
40+
3341
{"v9.0.1.7739.142", "August 18th, 2020"},
3442
"More development on the new plugin Cast Timeline.",
3543
"More development on Details! Scroll Damage.",
@@ -333,7 +341,7 @@ do
333341
--> player detail skin
334342
_detalhes.playerdetailwindow_skins = {}
335343

336-
_detalhes.BitfieldSwapDebuffsIDs = {265646, 272407, 269691, 273401, 269131, 260900, 260926, 284995, 292826, 311367, 310567, 308996, 307832, 327414}
344+
_detalhes.BitfieldSwapDebuffsIDs = {265646, 272407, 269691, 273401, 269131, 260900, 260926, 284995, 292826, 311367, 310567, 308996, 307832, 327414, 337253}
337345

338346
--> auto run code
339347
_detalhes.RunCodeTypes = {

classes/class_instance.lua

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,13 +608,13 @@ end
608608

609609
if (not self.iniciada) then
610610
self:RestauraJanela (self.meu_id, nil, true) --parece que esta chamando o ativar instance denovo... passei true no load_only vamos ver o resultado
611+
--tiny threat parou de funcionar depois de /reload depois dessa mudança, talvez tenha algo para carregar ainda
611612
self.iniciada = true
612613
else
613614
_detalhes.opened_windows = _detalhes.opened_windows+1
614615
end
615616

616617
self:ChangeSkin() --carrega a skin aqui que era antes feito dentro do restaura janela
617-
618618
_detalhes:TrocaTabela (self, nil, nil, nil, true)
619619

620620
if (self.hide_icon) then
@@ -634,7 +634,7 @@ end
634634

635635
if (not temp) then
636636
if (self.modo == modo_raid) then
637-
_detalhes.RaidTables:EnableRaidMode (self)
637+
_detalhes.RaidTables:EnableRaidMode(self)
638638

639639
elseif (self.modo == modo_alone) then
640640
self:SoloMode (true)
@@ -656,6 +656,14 @@ end
656656
if (not temp and not _detalhes.initializing) then
657657
_detalhes:SendEvent ("DETAILS_INSTANCE_OPEN", nil, self)
658658
end
659+
660+
if (self.modo == modo_raid) then
661+
_detalhes.RaidTables:EnableRaidMode(self)
662+
663+
elseif (self.modo == modo_alone) then
664+
self:SoloMode (true)
665+
end
666+
659667
end
660668
------------------------------------------------------------------------------------------------------------------------
661669

classes/container_actors.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727

2828
local GetNumDeclensionSets = _G.GetNumDeclensionSets
2929
local DeclineName = _G.DeclineName
30-
31-
local GetLocale = _G.GetLocale
30+
3231
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3332
--> constants
3433

@@ -438,7 +437,7 @@
438437
--if the user client is in russian language
439438
--make an attempt to remove declensions from the character's name
440439
--this is equivalent to remove 's from the owner on enUS
441-
if (GetLocale() == "ruRU") then
440+
if (CONST_CLIENT_LANGUAGE == "ruRU") then
442441
if (find_name_declension (text1, playerName)) then
443442
return find_pet_found_owner (pName, serial, nome, flag, self)
444443
else
@@ -462,7 +461,7 @@
462461
local pName = playerName
463462
playerName = playerName:gsub ("%-.*", "") --remove realm name
464463

465-
if (GetLocale() == "ruRU") then
464+
if (CONST_CLIENT_LANGUAGE == "ruRU") then
466465
if (find_name_declension (text2, playerName)) then
467466
return find_pet_found_owner (pName, serial, nome, flag, self)
468467
else

classes/container_spells.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ local _
5959
return pairs (self._ActorTable)
6060
end
6161

62-
function container_habilidades:PegaHabilidade (id, criar, token, cria_shadow)
62+
function container_habilidades:GetOrCreateSpell(id, shouldCreate, token)
63+
return self:PegaHabilidade (id, shouldCreate, token)
64+
end
65+
66+
function container_habilidades:PegaHabilidade (id, criar, token)
6367

6468
local esta_habilidade = self._ActorTable [id]
6569

@@ -68,7 +72,7 @@ local _
6872
else
6973
if (criar) then
7074

71-
local novo_objeto = self.funcao_de_criacao (nil, id, shadow_objeto, token)
75+
local novo_objeto = self.funcao_de_criacao (nil, id, nil, token)
7276

7377
self._ActorTable [id] = novo_objeto
7478

core/gears.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,6 +1758,8 @@ function Details.Database.StoreEncounter(combat)
17581758
local mybest2 = mybest[1] or 0
17591759
local myBestDps = mybest2 / onencounter.elapsed
17601760

1761+
--[12:18:37] Details!: error occurred on Details.Database.StoreEncounter(): Interface\AddOns\Details\core\gears.lua:1758: attempt to index local 'mybest' (a nil value)
1762+
17611763
if (mybest) then
17621764
local d_one = 0
17631765
if (myrole == "DAMAGER" or myrole == "TANK") then

0 commit comments

Comments
 (0)