GE Lua Documentation

Press F to search!

setThresholds

Definition


-- @/lua/ge/extensions/ui/apps/pointsBar.lua:41

-- Function to update points bar configuration
local function setThresholds(thresholds)
  if thresholds then
    pointsData.thresholds = thresholds
  end
  local maxValue = pointsData.thresholds[#pointsData.thresholds] * 1.1  -- Add 10% buffer
  guiData.thresholdCount = #pointsData.thresholds
  guiData.thresholdPercentages = {}
  for i, threshold in ipairs(pointsData.thresholds) do
    guiData.thresholdPercentages[i] = threshold / maxValue * 100
  end
  guihooks.queueStream('pointsBar', guiData)
end

Callers

@/lua/ge/extensions/ui/apps/pointsBar.lua
local function clearData()
  M.setThresholds({100, 200, 300})
  M.setPoints(0)
local function requestAllData()
  M.setThresholds(pointsData.thresholds)
  M.setPoints(pointsData.currentPoints, pointsData.pointsLabel)
@/lua/ge/extensions/flowgraph/nodes/gameplay/pointsBarSetThresholds.lua
function C:work()
  ui_apps_pointsBar.setThresholds({self.pinIn.bronze.value, self.pinIn.silver.value, self.pinIn.gold.value})
  self.mgr.modules.ui.pointsBarChanged = true