Skip to content

Commit 6c7eee8

Browse files
committed
1 parent 1c107fe commit 6c7eee8

18 files changed

Lines changed: 7002 additions & 114 deletions

src/Classes/CalcSectionControl.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ function CalcSectionClass:Draw(viewPort, noTooltip)
246246
DrawString(x + 3, lineY + 3, "LEFT", 16, "VAR BOLD", textColor..subSec.label..":")
247247
if subSec.data.extra then
248248
local x = x + 3 + DrawStringWidth(16, "VAR BOLD", subSec.label) + 10
249-
DrawString(x, lineY + 3, "LEFT", 16, "VAR", "^7"..self:FormatStr(subSec.data.extra, actor))
249+
DrawString(x, lineY + 3, "LEFT", 16, "VAR", "^7"..formatCalcStr(subSec.data.extra, actor))
250250
end
251251
end
252252
-- Draw line below label
@@ -301,7 +301,7 @@ function CalcSectionClass:Draw(viewPort, noTooltip)
301301
end
302302
local textSize = rowData.textSize or 14
303303
SetViewport(colData.x + 3, colData.y, colData.width - 4, colData.height)
304-
DrawString(1, 9 - textSize/2, "LEFT", textSize, "VAR", "^7"..self:FormatStr(colData.format, actor, colData))
304+
DrawString(1, 9 - textSize/2, "LEFT", textSize, "VAR", "^7"..formatCalcStr(colData.format, actor, colData))
305305
SetViewport()
306306
end
307307
end
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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()

src/Classes/CalcsTab.lua.rej

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff a/src/Classes/CalcsTab.lua b/src/Classes/CalcsTab.lua (rejected hunks)
2+
@@ -372,8 +372,8 @@ function CalcsTabClass:SetDisplayStat(displayData, pin)
3+
self.controls.breakdown:SetBreakdownData(displayData, pin)
4+
end
5+
6+
-function CalcsTabClass:CheckFlag(obj)
7+
- local actor = self.input.showMinion and self.calcsEnv.minion or self.calcsEnv.player
8+
+function CalcsTabClass:CheckFlag(obj, actor)
9+
+ actor = actor or (self.input.showMinion and self.calcsEnv.minion or self.calcsEnv.player)
10+
local skillFlags = actor.mainSkill.skillFlags
11+
if obj.flag and not skillFlags[obj.flag] then
12+
return

0 commit comments

Comments
 (0)