- billion damage format.

- some debug added to find a nil sourcename from the CLEU.
- some table recycle suggested by @Farmbuyer on curseforge.
- framework update to version 50.
This commit is contained in:
Tercio
2017-05-24 11:58:47 -03:00
parent f88c0f7acc
commit 447eb08401
5 changed files with 39 additions and 19 deletions
+4 -2
View File
@@ -1,5 +1,5 @@
local dversion = 49
local dversion = 50
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
@@ -244,7 +244,9 @@ if (symbol_1K) then
end
else
function DF.FormatNumber (numero)
if (numero > 999999) then
if (numero > 999999999) then
return format ("%.2f", numero/1000000000) .. "B"
elseif (numero > 999999) then
return format ("%.2f", numero/1000000) .. "M"
elseif (numero > 99999) then
return floor (numero/1000) .. "K"
+6 -9
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -250,7 +250,7 @@
return parser:SLT_damage (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand)
--> Light of the Martyr - paladin spell which causes damage to the caster it self
elseif (spellid == 196917) then
elseif (spellid == 196917) then -- or spellid == 183998 < healing part
local healingActor = healing_cache [who_name]
if (healingActor and healingActor.spells) then
local spell = healingActor.spells._ActorTable [spellid]
+9 -3
View File
@@ -275,7 +275,9 @@
function _detalhes:UseWestNumericalSystem()
--> short numbers
function _detalhes:ToK (numero)
if (numero > 1000000) then
if (numero > 999999999) then
return format ("%.2f", numero/1000000000) .. "B"
elseif (numero > 1000000) then
return _string_format ("%.2f", numero/1000000) .. "M"
elseif (numero > 1000) then
return _string_format ("%.1f", numero/1000) .. "K"
@@ -284,7 +286,9 @@
end
function _detalhes:ToK2 (numero)
if (numero > 999999) then
if (numero > 999999999) then
return format ("%.2f", numero/1000000000) .. "B"
elseif (numero > 999999) then
return _string_format ("%.2f", numero/1000000) .. "M"
elseif (numero > 99999) then
return _math_floor (numero/1000) .. "K"
@@ -296,7 +300,9 @@
--> short numbers no numbers after comma
function _detalhes:ToK0 (numero)
if (numero > 1000000) then
if (numero > 999999999) then
return format ("%.2f", numero/1000000000) .. "B"
elseif (numero > 1000000) then
return _string_format ("%.0f", numero/1000000) .. "M"
elseif (numero > 1000) then
return _string_format ("%.0f", numero/1000) .. "K"
+19 -4
View File
@@ -136,6 +136,18 @@ do
end
end
if (not Actor.nome) then
if (not _detalhes.NoActorNameWarning) then
print ("==============")
_detalhes:Msg ("Unhandled Exception: Actor has no name, ContainerID: ", container.tipo)
_detalhes:Msg ("After the current combat, reset data and use /reload.")
_detalhes:Msg ("Report this issue to the Author: Actor with no name, container: ", container.tipo)
print ("==============")
_detalhes.NoActorNameWarning = true
end
return
end
local class = _detalhes:GetClass (Actor.nome)
if (class) then
Actor.classe = class
@@ -155,7 +167,9 @@ do
end
if (tries and tries < 10) then
_detalhes:ScheduleTimer ("GuessClass", 2, {Actor, container, tries+1})
t[3] = tries + 1 --thanks @Farmbuyer on curseforge
--_detalhes:ScheduleTimer ("GuessClass", 2, {Actor, container, tries+1})
_detalhes:ScheduleTimer ("GuessClass", 2, t) --passing the same table instead of creating a new one
end
return false
@@ -276,7 +290,7 @@ do
end
end
end
function _detalhes:GuessSpec (t)
local Actor, container, tries = t[1], t[2], t[3]
@@ -434,9 +448,10 @@ do
return spec
end
if (tries and tries < 10) then
_detalhes:ScheduleTimer ("GuessSpec", 3, {Actor, container, tries+1})
t[3] = tries + 1
_detalhes:ScheduleTimer ("GuessSpec", 3, t)
end
return false