Skip to content

Commit

Permalink
fix FormatMoney - TomDotBat/pixel-ui PR TomDotBat#50
Browse files Browse the repository at this point in the history
  • Loading branch information
Lythium4848 authored Aug 4, 2024
1 parent e420d85 commit 2583f18
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lua/pulsarui/core/sh_formatting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ do
local currencySymbol = "$"
local currencyLeft = true

hook.Add("PostGamemodeLoaded", "PulsarUI.GetMoneyFormatSettings", function()
---@diagnostic disable-next-line: undefined-field
local config = (GM or GAMEMODE).Config
local function load()
local config = (GM or GAMEMODE or {}).Config
if not config then return end

if config.currency then currencySymbol = config.currency end
if config.currencyLeft then currencyLeft = config.currencyLeft end
if config.currency ~= nil then currencySymbol = config.currency end
if config.currencyLeft ~= nil then currencyLeft = config.currencyLeft end
end)

Check failure on line 13 in lua/pulsarui/core/sh_formatting.lua

View workflow job for this annotation

GitHub Actions / lint / lint

"Parse error"

unexpected ")", expecting 'label', if statement, function definition, numeric for loop, generic for loop, variable definition, function call or return statement
load()
hook.Add("PostGamemodeLoaded", "PIXEL.UI.GetMoneyFormatSettings", load)

local function addCurrency(str)
return currencyLeft and (currencySymbol .. str) or (str .. currencySymbol)
Expand Down Expand Up @@ -74,4 +75,4 @@ function PulsarUI.FormatTime(time)
end

return format("%im %is", m, s)
end
end

0 comments on commit 2583f18

Please sign in to comment.