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