Skip to content

Commit

Permalink
Added the baseline for the Coach Mode feature
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
Tercioo committed Nov 3, 2020
1 parent 262f115 commit 93a7a8c
Show file tree
Hide file tree
Showing 15 changed files with 1,587 additions and 35 deletions.
1 change: 1 addition & 0 deletions Details.toc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ API.lua
functions\profiles.lua
functions\hooks.lua
functions\bossmods.lua
functions\coach.lua
functions\skins.lua
functions\boss.lua
functions\spells.lua
Expand Down
23 changes: 21 additions & 2 deletions Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


local dversion = 214
local dversion = 215

local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
Expand Down Expand Up @@ -609,7 +609,26 @@ function DF:TruncateText (fontString, maxWidth)
if (string.len (text) <= 1) then
break
end
end
end

DF:CleanTruncateUTF8String(text)
fontString:SetText (text)
end

function DF:CleanTruncateUTF8String(text)
if type(text) == "string" and text ~= "" then
local b1 = (#text > 0) and strbyte(strsub(text, #text, #text)) or nil
local b2 = (#text > 1) and strbyte(strsub(text, #text-1, #text)) or nil
local b3 = (#text > 2) and strbyte(strsub(text, #text-2, #text)) or nil
if b1 and b1 >= 194 and b1 <= 244 then
text = strsub (text, 1, #text - 1)
elseif b2 and b2 >= 224 and b2 <= 244 then
text = strsub (text, 1, #text - 2)
elseif b3 and b3 >= 240 and b3 <= 244 then
text = strsub (text, 1, #text - 3)
end
end
return text
end

function DF:Msg (msg, ...)
Expand Down
16 changes: 12 additions & 4 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
_ = nil
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0")

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

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

local news = {
{"v9.0.1.7950.144", "November 3rd, 2020"},
"Added the baseline for the Coach feature, for testing use '/details coach', all users in the raid must have details! up to date.",
"Added container_spells:GetOrCreateSpell(id, shouldCreate, token).",
"Added Details:GetRaidLeader(), return the RL name.",
"Fixed Tiny Threat not showing threat.",
"Fixed annoucement interrupt enable toggle checkbox was reseting on logon.",

{"v9.0.1.7938.142", "October 29th, 2020"},
"Added option to select the icon buttons in the title bar.",

{"v9.0.1.7739.142", "August 18th, 2020"},
"More development on the new plugin Cast Timeline.",
"More development on Details! Scroll Damage.",
Expand Down Expand Up @@ -333,7 +341,7 @@ do
--> player detail skin
_detalhes.playerdetailwindow_skins = {}

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

--> auto run code
_detalhes.RunCodeTypes = {
Expand Down
12 changes: 10 additions & 2 deletions classes/class_instance.lua
Original file line number Diff line number Diff line change
Expand Up @@ -608,13 +608,13 @@ end

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

self:ChangeSkin() --carrega a skin aqui que era antes feito dentro do restaura janela

_detalhes:TrocaTabela (self, nil, nil, nil, true)

if (self.hide_icon) then
Expand All @@ -634,7 +634,7 @@ end

if (not temp) then
if (self.modo == modo_raid) then
_detalhes.RaidTables:EnableRaidMode (self)
_detalhes.RaidTables:EnableRaidMode(self)

elseif (self.modo == modo_alone) then
self:SoloMode (true)
Expand All @@ -656,6 +656,14 @@ end
if (not temp and not _detalhes.initializing) then
_detalhes:SendEvent ("DETAILS_INSTANCE_OPEN", nil, self)
end

if (self.modo == modo_raid) then
_detalhes.RaidTables:EnableRaidMode(self)

elseif (self.modo == modo_alone) then
self:SoloMode (true)
end

end
------------------------------------------------------------------------------------------------------------------------

Expand Down
7 changes: 3 additions & 4 deletions classes/container_actors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@

local GetNumDeclensionSets = _G.GetNumDeclensionSets
local DeclineName = _G.DeclineName

local GetLocale = _G.GetLocale

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> constants

Expand Down Expand Up @@ -438,7 +437,7 @@
--if the user client is in russian language
--make an attempt to remove declensions from the character's name
--this is equivalent to remove 's from the owner on enUS
if (GetLocale() == "ruRU") then
if (CONST_CLIENT_LANGUAGE == "ruRU") then
if (find_name_declension (text1, playerName)) then
return find_pet_found_owner (pName, serial, nome, flag, self)
else
Expand All @@ -462,7 +461,7 @@
local pName = playerName
playerName = playerName:gsub ("%-.*", "") --remove realm name

if (GetLocale() == "ruRU") then
if (CONST_CLIENT_LANGUAGE == "ruRU") then
if (find_name_declension (text2, playerName)) then
return find_pet_found_owner (pName, serial, nome, flag, self)
else
Expand Down
8 changes: 6 additions & 2 deletions classes/container_spells.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ local _
return pairs (self._ActorTable)
end

function container_habilidades:PegaHabilidade (id, criar, token, cria_shadow)
function container_habilidades:GetOrCreateSpell(id, shouldCreate, token)
return self:PegaHabilidade (id, shouldCreate, token)
end

function container_habilidades:PegaHabilidade (id, criar, token)

local esta_habilidade = self._ActorTable [id]

Expand All @@ -68,7 +72,7 @@ local _
else
if (criar) then

local novo_objeto = self.funcao_de_criacao (nil, id, shadow_objeto, token)
local novo_objeto = self.funcao_de_criacao (nil, id, nil, token)

self._ActorTable [id] = novo_objeto

Expand Down
2 changes: 2 additions & 0 deletions core/gears.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1758,6 +1758,8 @@ function Details.Database.StoreEncounter(combat)
local mybest2 = mybest[1] or 0
local myBestDps = mybest2 / onencounter.elapsed

--[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)

if (mybest) then
local d_one = 0
if (myrole == "DAMAGER" or myrole == "TANK") then
Expand Down
Loading

0 comments on commit 93a7a8c

Please sign in to comment.