|
| 1 | +diff a/src/Classes/CalcSectionControl.lua b/src/Classes/CalcSectionControl.lua (rejected hunks) |
| 2 | +@@ -157,64 +157,6 @@ function CalcSectionClass:UpdatePos() |
| 3 | + end |
| 4 | + end |
| 5 | + |
| 6 | +-function CalcSectionClass:FormatVal(val, p) |
| 7 | +- return formatNumSep(tostring(round(val, p))) |
| 8 | +-end |
| 9 | +- |
| 10 | +-function CalcSectionClass:FormatStr(str, actor, colData) |
| 11 | +- str = str:gsub("{output:([%a%.:]+)}", function(c) |
| 12 | +- local ns, var = c:match("^(%a+)%.(%a+)$") |
| 13 | +- if ns then |
| 14 | +- return actor.output[ns] and actor.output[ns][var] or "" |
| 15 | +- else |
| 16 | +- return actor.output[c] or "" |
| 17 | +- end |
| 18 | +- end) |
| 19 | +- str = str:gsub("{(%d+):output:([%a%.:]+)}", function(p, c) |
| 20 | +- local ns, var = c:match("^(%a+)%.(%a+)$") |
| 21 | +- if ns then |
| 22 | +- return self:FormatVal(actor.output[ns] and actor.output[ns][var] or 0, tonumber(p)) |
| 23 | +- else |
| 24 | +- return self:FormatVal(actor.output[c] or 0, tonumber(p)) |
| 25 | +- end |
| 26 | +- end) |
| 27 | +- str = str:gsub("{(%d+):mod:([%d,]+)}", function(p, n) |
| 28 | +- local numList = { } |
| 29 | +- for num in n:gmatch("%d+") do |
| 30 | +- t_insert(numList, tonumber(num)) |
| 31 | +- end |
| 32 | +- local modType = colData[numList[1]].modType |
| 33 | +- local modTotal = modType == "MORE" and 1 or 0 |
| 34 | +- for _, num in ipairs(numList) do |
| 35 | +- local sectionData = colData[num] |
| 36 | +- local modCfg = (sectionData.cfg and actor.mainSkill[sectionData.cfg.."Cfg"]) or { } |
| 37 | +- if sectionData.modSource then |
| 38 | +- modCfg.source = sectionData.modSource |
| 39 | +- end |
| 40 | +- if sectionData.actor then |
| 41 | +- modCfg.actor = sectionData.actor |
| 42 | +- end |
| 43 | +- local modVal |
| 44 | +- local modStore = (sectionData.enemy and actor.enemy.modDB) or (sectionData.cfg and actor.mainSkill.skillModList) or actor.modDB |
| 45 | +- if type(sectionData.modName) == "table" then |
| 46 | +- modVal = modStore:Combine(sectionData.modType, modCfg, unpack(sectionData.modName)) |
| 47 | +- else |
| 48 | +- modVal = modStore:Combine(sectionData.modType, modCfg, sectionData.modName) |
| 49 | +- end |
| 50 | +- if modType == "MORE" then |
| 51 | +- modTotal = modTotal * modVal |
| 52 | +- else |
| 53 | +- modTotal = modTotal + modVal |
| 54 | +- end |
| 55 | +- end |
| 56 | +- if modType == "MORE" then |
| 57 | +- modTotal = (modTotal - 1) * 100 |
| 58 | +- end |
| 59 | +- return self:FormatVal(modTotal, tonumber(p)) |
| 60 | +- end) |
| 61 | +- return str |
| 62 | +-end |
| 63 | +- |
| 64 | + function CalcSectionClass:Draw(viewPort, noTooltip) |
| 65 | + local x, y = self:GetPos() |
| 66 | + local width, height = self:GetSize() |
0 commit comments