setPoints
Definition
-- @/lua/ge/extensions/ui/apps/pointsBar.lua:26
-- Function to update points
local function setPoints(points, pointsLabel)
pointsData.currentPoints = points
pointsData.pointsLabel = pointsLabel
local maxValue = pointsData.thresholds[#pointsData.thresholds] * 1.1 -- Add 10% buffer
guiData.fillPercent = points / maxValue
guiData.pointsLabel = pointsLabel or tostring(points)
guiData.thresholdsReached = {}
for i, threshold in ipairs(pointsData.thresholds) do
guiData.thresholdsReached[i] = points >= threshold
end
guiData.thresholdCount = #pointsData.thresholds
guihooks.queueStream('pointsBar', guiData)
end
Callers
@/lua/ge/extensions/ui/apps/pointsBar.lua
M.setThresholds({100, 200, 300})
M.setPoints(0)
end
M.setThresholds(pointsData.thresholds)
M.setPoints(pointsData.currentPoints, pointsData.pointsLabel)
end
@/lua/ge/extensions/gameplay/crashTest/scenarioManager.lua
ui_apps_pointsBar.setPoints(gameplay_crashTest_crashTestScoring.getTotalScoreData().totalScore)
local function startScenario()
ui_apps_pointsBar.setPoints(0)
@/lua/ge/extensions/flowgraph/nodes/gameplay/pointsBarSetPoints.lua
function C:work()
ui_apps_pointsBar.setPoints(self.pinIn.points.value, self.pinIn.pointsLabel.value)
self.mgr.modules.ui.pointsBarChanged = true