forked from Quantx/CC2-UI-Enhancer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscreen_self_destruct.lua
More file actions
executable file
·49 lines (36 loc) · 1.78 KB
/
Copy pathscreen_self_destruct.lua
File metadata and controls
executable file
·49 lines (36 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
g_blink_timer = 0
function parse()
end
function begin()
begin_load()
end
function update(screen_w, screen_h, ticks)
if update_screen_overrides(screen_w, screen_h, ticks) then return end
local this_vehicle = update_get_screen_vehicle()
if this_vehicle:get() == false then return end
local this_vehicle_object = update_get_vehicle_by_id(this_vehicle:get_id())
if this_vehicle_object:get() == false then return end
g_blink_timer = g_blink_timer + 1
if(g_blink_timer > 30)
then
g_blink_timer = 0
end
active_mode = this_vehicle_object:get_self_destruct_mode()
countdown = this_vehicle_object:get_self_destruct_countdown()
if active_mode == g_self_destruct_modes.locked then
update_ui_rectangle((screen_w/2)-17, (screen_h/2)-2, 34, 12, color_white)
update_ui_rectangle((screen_w/2)-17+1, (screen_h/2)-2+1, 32, 10, color_black)
update_ui_text(0, screen_h/2, update_get_loc(e_loc.upp_lck), 128, 1, color_white, 0)
elseif active_mode == g_self_destruct_modes.input then
update_ui_rectangle((screen_w/2)-17, (screen_h/2)-2, 34, 12, color_white)
update_ui_rectangle((screen_w/2)-17+1, (screen_h/2)-2+1, 32, 10, color_black)
if g_blink_timer > 5 then
update_ui_text(0, screen_h/2, string.format("%.2f", countdown / 30), 128, 1, color_white, 0)
end
elseif active_mode == g_self_destruct_modes.ready then
update_ui_rectangle((screen_w/2)-17, (screen_h/2)-2, 34, 12, color_white)
update_ui_rectangle((screen_w/2)-17+1, (screen_h/2)-2+1, 32, 10, color_black)
update_ui_text(0, screen_h/2-12, update_get_loc(e_loc.upp_armed), 128, 1, color_white, 0)
update_ui_text(0, screen_h/2, string.format("%.2f", countdown / 30), 128, 1, color_white, 0)
end
end