summaryrefslogtreecommitdiff
path: root/gamemode/cl_hud/draw_battery.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/cl_hud/draw_battery.lua')
-rw-r--r--gamemode/cl_hud/draw_battery.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/gamemode/cl_hud/draw_battery.lua b/gamemode/cl_hud/draw_battery.lua
new file mode 100644
index 0000000..b2ba854
--- /dev/null
+++ b/gamemode/cl_hud/draw_battery.lua
@@ -0,0 +1,10 @@
+local X = ScrW()-104
+
+function DrawBatteryLife()
+ local W = system.BatteryPower()
+ if (W > 100) then return end
+
+ DrawRect(X,4,100,12,MAIN_BLACKCOLOR)
+ DrawRect(X,4,math.Clamp(W,0,100),12,MAIN_GREENCOLOR)
+ DrawText("Battery: "..W.."%","Trebuchet18",X-5,2,MAIN_TEXTCOLOR,2)
+end \ No newline at end of file