Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions LoadHUD.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
-- Small HUD which shows current engine load in percent. The shown value is the average of the last 60 frames.
--
-- Author: StingerTopGun
--
-- Changelog:
-- Clamp the output value to prevent negative load numbers
--
--

LoadHUD = {}
LoadHUD.eventName = {}
LoadHUD.ModName = g_currentModName
LoadHUD.ModDirectory = g_currentModDirectory
LoadHUD.Version = "1.0.0.0"
LoadHUD.Version = "1.0.0.1"

LoadHUD.loopcnt = 0
LoadHUD.average_cnt = 60
Expand Down Expand Up @@ -61,7 +66,8 @@ function LoadHUD.mean( t )
end
end

return (sum / count)
-- Edit by Gate
return MathUtil.clamp((sum / count), 0, 100)
end

addModEventListener(LoadHUD)