- Added buttons to edit the total and percentage code for custom displays.

- Fixed a problem while report custom displays.
This commit is contained in:
tercio
2014-09-09 12:50:40 -03:00
parent 20a9773a58
commit 556d5549dc
5 changed files with 164 additions and 47 deletions
+36
View File
@@ -172,6 +172,36 @@
instance_container:Remap()
if (export) then
-- key name value need to be formated
if (custom_object) then
local percent_script = _detalhes.custom_function_cache [instance.customName .. "Percent"]
local total_script = _detalhes.custom_function_cache [instance.customName .. "Total"]
for index, actor in _ipairs (instance_container._ActorTable) do
local percent, total
if (percent_script) then
percent = percent_script (actor.value, top, total, combat, instance)
else
percent = _cstr ("%.1f", self.value / total * 100)
end
if (total_script) then
local value = total_script (actor.value, top, total, combat, instance)
if (type (value) == "number") then
total = SelectedToKFunction (_, value)
else
total = value
end
else
total = SelectedToKFunction (_, self.value)
end
actor.report_value = total .. " (" .. percent .. "%)"
end
end
return total, instance_container._ActorTable, top, amount
end
@@ -801,6 +831,12 @@
function atributo_custom:GetScriptToolip()
return self.tooltip
end
function atributo_custom:GetScriptTotal()
return self.total_script
end
function atributo_custom:GetScriptPercent()
return self.percent_script
end
function atributo_custom:SetName (name)
self.name = name