mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-07 21:59:49 -05:00
HUD: convert timer to LUI
This commit is contained in:
parent
29b59cf044
commit
6e560792c7
@ -191,11 +191,16 @@ precache_strings()
|
|||||||
precacheString(&"r_fog_settings");
|
precacheString(&"r_fog_settings");
|
||||||
|
|
||||||
precacheString(&"hud_update_enemy_counter");
|
precacheString(&"hud_update_enemy_counter");
|
||||||
|
precacheString(&"hud_update_total_timer");
|
||||||
|
precacheString(&"hud_update_round_timer");
|
||||||
|
precacheString(&"hud_update_round_total_timer");
|
||||||
precacheString(&"hud_update_health_bar");
|
precacheString(&"hud_update_health_bar");
|
||||||
precacheString(&"hud_update_zone_name");
|
precacheString(&"hud_update_zone_name");
|
||||||
|
|
||||||
precacheString(&"hud_fade_out_zone_name");
|
precacheString(&"hud_fade_out_zone_name");
|
||||||
precacheString(&"hud_fade_in_zone_name");
|
precacheString(&"hud_fade_in_zone_name");
|
||||||
|
precacheString(&"hud_fade_out_round_total_timer");
|
||||||
|
precacheString(&"hud_fade_in_round_total_timer");
|
||||||
|
|
||||||
foreach (zone_name in level.zone_keys)
|
foreach (zone_name in level.zone_keys)
|
||||||
{
|
{
|
||||||
@ -738,18 +743,36 @@ lui_notify_events()
|
|||||||
|
|
||||||
wait 0.05;
|
wait 0.05;
|
||||||
|
|
||||||
self luinotifyevent(&"hud_update_enemy_counter", 1, level.enemy_counter_hud_value);
|
if (isdefined(level.enemy_counter_hud_value))
|
||||||
|
{
|
||||||
|
self luinotifyevent(&"hud_update_enemy_counter", 1, level.enemy_counter_hud_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isdefined(level.total_timer_hud_value))
|
||||||
|
{
|
||||||
|
self luinotifyevent(&"hud_update_total_timer", 1, level.total_timer_hud_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isdefined(level.round_timer_hud_value))
|
||||||
|
{
|
||||||
|
self luinotifyevent(&"hud_update_round_timer", 1, level.round_timer_hud_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isdefined(level.round_total_timer_hud_value))
|
||||||
|
{
|
||||||
|
self luinotifyevent(&"hud_update_round_total_timer", 1, level.round_total_timer_hud_value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enemy_counter_hud()
|
enemy_counter_hud()
|
||||||
{
|
{
|
||||||
|
flag_wait("hud_visible");
|
||||||
|
|
||||||
if (getDvar("g_gametype") == "zgrief")
|
if (getDvar("g_gametype") == "zgrief")
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
flag_wait("hud_visible");
|
|
||||||
|
|
||||||
level.enemy_counter_hud_value = 0;
|
level.enemy_counter_hud_value = 0;
|
||||||
|
|
||||||
players = get_players();
|
players = get_players();
|
||||||
@ -793,150 +816,159 @@ enemy_counter_hud()
|
|||||||
|
|
||||||
timer_hud()
|
timer_hud()
|
||||||
{
|
{
|
||||||
level thread round_timer_hud();
|
level endon("end_game");
|
||||||
|
level endon("stop_timers");
|
||||||
hud = newHudElem();
|
|
||||||
hud.alignx = "right";
|
|
||||||
hud.aligny = "top";
|
|
||||||
hud.horzalign = "user_right";
|
|
||||||
hud.vertalign = "user_top";
|
|
||||||
hud.x -= 5;
|
|
||||||
hud.y += 12;
|
|
||||||
hud.fontscale = 1.4;
|
|
||||||
hud.alpha = 0;
|
|
||||||
hud.color = (1, 1, 1);
|
|
||||||
hud.hidewheninmenu = 1;
|
|
||||||
hud.foreground = 1;
|
|
||||||
hud.label = &"ZOMBIE_HUD_TOTAL_TIME";
|
|
||||||
|
|
||||||
hud endon("death");
|
|
||||||
|
|
||||||
hud thread destroy_on_intermission();
|
|
||||||
|
|
||||||
hud thread set_time_frozen_on_end_game();
|
|
||||||
|
|
||||||
flag_wait("hud_visible");
|
flag_wait("hud_visible");
|
||||||
|
|
||||||
hud.alpha = 1;
|
level thread round_timer_hud_loop();
|
||||||
|
|
||||||
|
level.total_timer_hud_value = 0;
|
||||||
|
|
||||||
|
players = get_players();
|
||||||
|
|
||||||
|
foreach (player in players)
|
||||||
|
{
|
||||||
|
player luinotifyevent(&"hud_update_total_timer", 1, level.total_timer_hud_value);
|
||||||
|
}
|
||||||
|
|
||||||
if (!flag("initial_blackscreen_passed"))
|
if (!flag("initial_blackscreen_passed"))
|
||||||
{
|
{
|
||||||
hud set_time_frozen(0, "initial_blackscreen_passed");
|
level waittill("initial_blackscreen_passed");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getDvar("g_gametype") == "zgrief")
|
if (getDvar("g_gametype") == "zgrief")
|
||||||
{
|
{
|
||||||
hud set_time_frozen(0);
|
level waittill("restart_round_start");
|
||||||
}
|
}
|
||||||
|
|
||||||
hud setTimerUp(0);
|
while (1)
|
||||||
hud.start_time = getTime();
|
{
|
||||||
level.timer_hud_start_time = hud.start_time;
|
wait 1;
|
||||||
|
|
||||||
|
level.total_timer_hud_value++;
|
||||||
|
|
||||||
|
players = get_players();
|
||||||
|
|
||||||
|
foreach (player in players)
|
||||||
|
{
|
||||||
|
player luinotifyevent(&"hud_update_total_timer", 1, level.total_timer_hud_value);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
round_timer_hud()
|
round_timer_hud_loop()
|
||||||
{
|
{
|
||||||
flag_wait("hud_visible");
|
level endon("end_game");
|
||||||
|
level endon("stop_timers");
|
||||||
|
|
||||||
if (isDefined(level.scr_zm_ui_gametype_obj) && level.scr_zm_ui_gametype_obj != "zsnr")
|
if (isDefined(level.scr_zm_ui_gametype_obj) && level.scr_zm_ui_gametype_obj != "zsnr")
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
hud = newHudElem();
|
level.round_timer_hud_value = 0;
|
||||||
hud.alignx = "right";
|
|
||||||
hud.aligny = "top";
|
|
||||||
hud.horzalign = "user_right";
|
|
||||||
hud.vertalign = "user_top";
|
|
||||||
hud.x -= 5;
|
|
||||||
hud.y += 27;
|
|
||||||
hud.fontscale = 1.4;
|
|
||||||
hud.alpha = 0;
|
|
||||||
hud.color = (1, 1, 1);
|
|
||||||
hud.hidewheninmenu = 1;
|
|
||||||
hud.foreground = 1;
|
|
||||||
hud.label = &"ZOMBIE_HUD_ROUND_TIME";
|
|
||||||
|
|
||||||
hud endon("death");
|
players = get_players();
|
||||||
|
|
||||||
hud thread destroy_on_intermission();
|
foreach (player in players)
|
||||||
|
{
|
||||||
hud thread set_time_frozen_on_end_game();
|
player luinotifyevent(&"hud_update_round_timer", 1, level.round_timer_hud_value);
|
||||||
|
}
|
||||||
hud.alpha = 1;
|
|
||||||
|
|
||||||
if (!flag("initial_blackscreen_passed"))
|
if (!flag("initial_blackscreen_passed"))
|
||||||
{
|
{
|
||||||
hud set_time_frozen(0, "initial_blackscreen_passed");
|
level waittill("initial_blackscreen_passed");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getDvar("g_gametype") == "zgrief")
|
if (getDvar("g_gametype") == "zgrief")
|
||||||
{
|
{
|
||||||
hud set_time_frozen(0);
|
level waittill("restart_round_start");
|
||||||
}
|
}
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
hud setTimerUp(0);
|
level thread round_timer_hud();
|
||||||
hud.start_time = getTime();
|
|
||||||
|
|
||||||
if (getDvar("g_gametype") == "zgrief")
|
if (getDvar("g_gametype") == "zgrief")
|
||||||
{
|
{
|
||||||
level waittill("restart_round");
|
level waittill("restart_round_start");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
level waittill("end_of_round");
|
level waittill("end_of_round");
|
||||||
|
level waittill("start_of_round");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
level thread round_total_timer_hud();
|
round_timer_hud()
|
||||||
|
{
|
||||||
|
level endon("end_game");
|
||||||
|
level endon("stop_timers");
|
||||||
|
level notify("round_timer_hud");
|
||||||
|
level endon("round_timer_hud");
|
||||||
|
|
||||||
time = int((getTime() - hud.start_time) / 1000);
|
if (getDvar("g_gametype") == "zgrief")
|
||||||
|
{
|
||||||
|
level endon("restart_round");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
level endon("end_of_round");
|
||||||
|
}
|
||||||
|
|
||||||
hud set_time_frozen(time);
|
level thread round_total_timer_hud();
|
||||||
|
|
||||||
|
level.round_timer_hud_value = 0;
|
||||||
|
level.round_total_timer_hud_value = undefined;
|
||||||
|
|
||||||
|
players = get_players();
|
||||||
|
|
||||||
|
foreach (player in players)
|
||||||
|
{
|
||||||
|
player luinotifyevent(&"hud_update_round_timer", 1, level.round_timer_hud_value);
|
||||||
|
player luinotifyevent(&"hud_fade_out_round_total_timer", 1, 500);
|
||||||
|
}
|
||||||
|
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
wait 1;
|
||||||
|
|
||||||
|
level.round_timer_hud_value++;
|
||||||
|
|
||||||
|
players = get_players();
|
||||||
|
|
||||||
|
foreach (player in players)
|
||||||
|
{
|
||||||
|
player luinotifyevent(&"hud_update_round_timer", 1, level.round_timer_hud_value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
round_total_timer_hud()
|
round_total_timer_hud()
|
||||||
{
|
{
|
||||||
|
level endon("end_game");
|
||||||
|
level endon("stop_timers");
|
||||||
|
level notify("round_total_timer_hud");
|
||||||
|
level endon("round_total_timer_hud");
|
||||||
|
|
||||||
if (getDvar("g_gametype") == "zgrief")
|
if (getDvar("g_gametype") == "zgrief")
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
hud = newHudElem();
|
level waittill("end_of_round");
|
||||||
hud.alignx = "right";
|
|
||||||
hud.aligny = "top";
|
|
||||||
hud.horzalign = "user_right";
|
|
||||||
hud.vertalign = "user_top";
|
|
||||||
hud.x -= 5;
|
|
||||||
hud.y += 42;
|
|
||||||
hud.fontscale = 1.4;
|
|
||||||
hud.alpha = 0;
|
|
||||||
hud.color = (1, 1, 1);
|
|
||||||
hud.hidewheninmenu = 1;
|
|
||||||
hud.foreground = 1;
|
|
||||||
hud.label = &"ZOMBIE_HUD_ROUND_TOTAL_TIME";
|
|
||||||
|
|
||||||
hud endon("death");
|
level.round_total_timer_hud_value = level.total_timer_hud_value;
|
||||||
|
|
||||||
hud thread destroy_on_intermission();
|
players = get_players();
|
||||||
|
|
||||||
fade_time = 0.5;
|
foreach (player in players)
|
||||||
|
{
|
||||||
hud fadeOverTime(fade_time);
|
player luinotifyevent(&"hud_update_round_total_timer", 1, level.round_total_timer_hud_value);
|
||||||
hud.alpha = 1;
|
player luinotifyevent(&"hud_fade_in_round_total_timer", 1, 500);
|
||||||
|
}
|
||||||
time = int((getTime() - level.timer_hud_start_time) / 1000);
|
|
||||||
|
|
||||||
hud set_time_frozen(time);
|
|
||||||
|
|
||||||
hud fadeOverTime(fade_time);
|
|
||||||
hud.alpha = 0;
|
|
||||||
|
|
||||||
wait fade_time;
|
|
||||||
|
|
||||||
hud destroy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set_time_frozen(time, endon_notify)
|
set_time_frozen(time, endon_notify)
|
||||||
@ -976,17 +1008,6 @@ set_time_frozen(time, endon_notify)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
set_time_frozen_on_end_game()
|
|
||||||
{
|
|
||||||
level endon("intermission");
|
|
||||||
|
|
||||||
level waittill_any("end_game", "freeze_timers");
|
|
||||||
|
|
||||||
time = int((getTime() - self.start_time) / 1000);
|
|
||||||
|
|
||||||
self set_time_frozen(time, "forever");
|
|
||||||
}
|
|
||||||
|
|
||||||
health_bar_hud()
|
health_bar_hud()
|
||||||
{
|
{
|
||||||
level endon("intermission");
|
level endon("intermission");
|
||||||
|
@ -306,7 +306,7 @@ stage_final()
|
|||||||
level thread clean_up_final_brutuses();
|
level thread clean_up_final_brutuses();
|
||||||
wait 2;
|
wait 2;
|
||||||
|
|
||||||
level notify("freeze_timers");
|
level notify("stop_timers");
|
||||||
|
|
||||||
if (level.winner == "weasel")
|
if (level.winner == "weasel")
|
||||||
{
|
{
|
||||||
|
@ -11,8 +11,6 @@ LUI.createMenu.ReimaginedArea = function(LocalClientIndex)
|
|||||||
enemyCounterWidget:setLeftRight(true, false, x, x)
|
enemyCounterWidget:setLeftRight(true, false, x, x)
|
||||||
enemyCounterWidget:setTopBottom(true, false, y, y)
|
enemyCounterWidget:setTopBottom(true, false, y, y)
|
||||||
enemyCounterWidget:setAlpha(0)
|
enemyCounterWidget:setAlpha(0)
|
||||||
enemyCounterWidget.width = width
|
|
||||||
enemyCounterWidget.height = height
|
|
||||||
safeArea:addElement(enemyCounterWidget)
|
safeArea:addElement(enemyCounterWidget)
|
||||||
|
|
||||||
local enemyCounterText = LUI.UIText.new()
|
local enemyCounterText = LUI.UIText.new()
|
||||||
@ -41,6 +39,67 @@ LUI.createMenu.ReimaginedArea = function(LocalClientIndex)
|
|||||||
enemyCounterWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_IS_PLAYER_ZOMBIE, CoD.Reimagined.EnemyCounterArea.UpdateVisibility)
|
enemyCounterWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_IS_PLAYER_ZOMBIE, CoD.Reimagined.EnemyCounterArea.UpdateVisibility)
|
||||||
enemyCounterWidget:registerEventHandler("hud_update_enemy_counter", CoD.Reimagined.EnemyCounterArea.UpdateEnemyCounter)
|
enemyCounterWidget:registerEventHandler("hud_update_enemy_counter", CoD.Reimagined.EnemyCounterArea.UpdateEnemyCounter)
|
||||||
|
|
||||||
|
local x = -7
|
||||||
|
local y = 18
|
||||||
|
|
||||||
|
local timerWidget = LUI.UIElement.new()
|
||||||
|
timerWidget:setLeftRight(false, true, x, x)
|
||||||
|
timerWidget:setTopBottom(true, false, y, y)
|
||||||
|
timerWidget:setAlpha(0)
|
||||||
|
safeArea:addElement(timerWidget)
|
||||||
|
|
||||||
|
local totalTimerText = LUI.UIText.new()
|
||||||
|
totalTimerText:setLeftRight(true, false, -1000, 0)
|
||||||
|
totalTimerText:setTopBottom(true, false, 0, CoD.textSize.Default)
|
||||||
|
totalTimerText:setFont(CoD.fonts.Big)
|
||||||
|
totalTimerText:setAlignment(LUI.Alignment.Right)
|
||||||
|
timerWidget:addElement(totalTimerText)
|
||||||
|
timerWidget.totalTimerText = totalTimerText
|
||||||
|
|
||||||
|
local roundTimerText = LUI.UIText.new()
|
||||||
|
roundTimerText:setLeftRight(true, false, -1000, 0)
|
||||||
|
roundTimerText:setTopBottom(true, false, 0 + 23, CoD.textSize.Default + 23)
|
||||||
|
roundTimerText:setFont(CoD.fonts.Big)
|
||||||
|
roundTimerText:setAlignment(LUI.Alignment.Right)
|
||||||
|
timerWidget:addElement(roundTimerText)
|
||||||
|
timerWidget.roundTimerText = roundTimerText
|
||||||
|
|
||||||
|
local roundTotalTimerText = LUI.UIText.new()
|
||||||
|
roundTotalTimerText:setLeftRight(true, false, -1000, 0)
|
||||||
|
roundTotalTimerText:setTopBottom(true, false, 0 + 46, CoD.textSize.Default + 46)
|
||||||
|
roundTotalTimerText:setFont(CoD.fonts.Big)
|
||||||
|
roundTotalTimerText:setAlignment(LUI.Alignment.Right)
|
||||||
|
roundTotalTimerText:registerAnimationState("fade_out", {
|
||||||
|
alpha = 0,
|
||||||
|
})
|
||||||
|
roundTotalTimerText:registerAnimationState("fade_in", {
|
||||||
|
alpha = 1,
|
||||||
|
})
|
||||||
|
timerWidget:addElement(roundTotalTimerText)
|
||||||
|
timerWidget.roundTotalTimerText = roundTotalTimerText
|
||||||
|
|
||||||
|
timerWidget:registerEventHandler("hud_update_refresh", CoD.Reimagined.TimerArea.UpdateVisibility)
|
||||||
|
timerWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_HUD_VISIBLE, CoD.Reimagined.TimerArea.UpdateVisibility)
|
||||||
|
timerWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_EMP_ACTIVE, CoD.Reimagined.TimerArea.UpdateVisibility)
|
||||||
|
timerWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_DEMO_CAMERA_MODE_MOVIECAM, CoD.Reimagined.TimerArea.UpdateVisibility)
|
||||||
|
timerWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_DEMO_ALL_GAME_HUD_HIDDEN, CoD.Reimagined.TimerArea.UpdateVisibility)
|
||||||
|
timerWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_IN_VEHICLE, CoD.Reimagined.TimerArea.UpdateVisibility)
|
||||||
|
timerWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_IN_GUIDED_MISSILE, CoD.Reimagined.TimerArea.UpdateVisibility)
|
||||||
|
timerWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_IN_REMOTE_KILLSTREAK_STATIC, CoD.Reimagined.TimerArea.UpdateVisibility)
|
||||||
|
timerWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_AMMO_COUNTER_HIDE, CoD.Reimagined.TimerArea.UpdateVisibility)
|
||||||
|
timerWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_IS_FLASH_BANGED, CoD.Reimagined.TimerArea.UpdateVisibility)
|
||||||
|
timerWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_UI_ACTIVE, CoD.Reimagined.TimerArea.UpdateVisibility)
|
||||||
|
timerWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_SPECTATING_CLIENT, CoD.Reimagined.TimerArea.UpdateVisibility)
|
||||||
|
timerWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_SCOREBOARD_OPEN, CoD.Reimagined.TimerArea.UpdateVisibility)
|
||||||
|
timerWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_PLAYER_DEAD, CoD.Reimagined.TimerArea.UpdateVisibility)
|
||||||
|
timerWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_IS_SCOPED, CoD.Reimagined.TimerArea.UpdateVisibility)
|
||||||
|
timerWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_IS_PLAYER_ZOMBIE, CoD.Reimagined.TimerArea.UpdateVisibility)
|
||||||
|
timerWidget:registerEventHandler("hud_update_total_timer", CoD.Reimagined.TimerArea.UpdateTotalTimer)
|
||||||
|
timerWidget:registerEventHandler("hud_update_round_timer", CoD.Reimagined.TimerArea.UpdateRoundTimer)
|
||||||
|
timerWidget:registerEventHandler("hud_update_round_total_timer", CoD.Reimagined.TimerArea.UpdateRoundTotalTimer)
|
||||||
|
timerWidget:registerEventHandler("hud_fade_out_round_total_timer", CoD.Reimagined.TimerArea.FadeOutRoundTotalTimer)
|
||||||
|
timerWidget:registerEventHandler("hud_fade_in_round_total_timer", CoD.Reimagined.TimerArea.FadeInRoundTotalTimer)
|
||||||
|
|
||||||
local x = 7
|
local x = 7
|
||||||
local y = -163
|
local y = -163
|
||||||
local width = 169
|
local width = 169
|
||||||
@ -116,8 +175,6 @@ LUI.createMenu.ReimaginedArea = function(LocalClientIndex)
|
|||||||
zoneNameWidget:setLeftRight(true, false, x, x)
|
zoneNameWidget:setLeftRight(true, false, x, x)
|
||||||
zoneNameWidget:setTopBottom(false, true, y, y)
|
zoneNameWidget:setTopBottom(false, true, y, y)
|
||||||
zoneNameWidget:setAlpha(0)
|
zoneNameWidget:setAlpha(0)
|
||||||
zoneNameWidget.width = width
|
|
||||||
zoneNameWidget.height = height
|
|
||||||
safeArea:addElement(zoneNameWidget)
|
safeArea:addElement(zoneNameWidget)
|
||||||
|
|
||||||
local zoneNameText = LUI.UIText.new()
|
local zoneNameText = LUI.UIText.new()
|
||||||
@ -181,6 +238,57 @@ CoD.Reimagined.EnemyCounterArea.UpdateEnemyCounter = function(Menu, ClientInstan
|
|||||||
Menu.enemyCounterText:setText(Engine.Localize("ZOMBIE_HUD_ENEMIES_REMAINING") .. enemyCount)
|
Menu.enemyCounterText:setText(Engine.Localize("ZOMBIE_HUD_ENEMIES_REMAINING") .. enemyCount)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
CoD.Reimagined.TimerArea = {}
|
||||||
|
CoD.Reimagined.TimerArea.UpdateVisibility = function(Menu, ClientInstance)
|
||||||
|
local controller = ClientInstance.controller
|
||||||
|
if UIExpression.IsVisibilityBitSet(controller, CoD.BIT_HUD_VISIBLE) == 1 and UIExpression.IsVisibilityBitSet(controller, CoD.BIT_EMP_ACTIVE) == 0 and UIExpression.IsVisibilityBitSet(controller, CoD.BIT_DEMO_CAMERA_MODE_MOVIECAM) == 0 and UIExpression.IsVisibilityBitSet(controller, CoD.BIT_DEMO_ALL_GAME_HUD_HIDDEN) == 0 and UIExpression.IsVisibilityBitSet(controller, CoD.BIT_IN_VEHICLE) == 0 and UIExpression.IsVisibilityBitSet(controller, CoD.BIT_IN_GUIDED_MISSILE) == 0 and UIExpression.IsVisibilityBitSet(controller, CoD.BIT_IN_REMOTE_KILLSTREAK_STATIC) == 0 and UIExpression.IsVisibilityBitSet(controller, CoD.BIT_AMMO_COUNTER_HIDE) == 0 and UIExpression.IsVisibilityBitSet(controller, CoD.BIT_IS_FLASH_BANGED) == 0 and (UIExpression.IsVisibilityBitSet(controller, CoD.BIT_UI_ACTIVE) == 0 or UIExpression.IsVisibilityBitSet(controller, CoD.BIT_SCOREBOARD_OPEN) == 1) and UIExpression.IsVisibilityBitSet(controller, CoD.BIT_IN_KILLCAM) == 0 and UIExpression.IsVisibilityBitSet(controller, CoD.BIT_IS_SCOPED) == 0 and UIExpression.IsVisibilityBitSet(controller, CoD.BIT_IS_PLAYER_ZOMBIE) == 0 and (not CoD.IsShoutcaster(controller) or CoD.ExeProfileVarBool(controller, "shoutcaster_scorestreaks") and Engine.IsSpectatingActiveClient(controller)) and CoD.FSM_VISIBILITY(controller) == 0 then
|
||||||
|
if Menu.visible ~= true then
|
||||||
|
Menu:setAlpha(1)
|
||||||
|
Menu.visible = true
|
||||||
|
end
|
||||||
|
elseif Menu.visible == true then
|
||||||
|
Menu:setAlpha(0)
|
||||||
|
Menu.visible = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
CoD.Reimagined.TimerArea.UpdateTotalTimer = function(Menu, ClientInstance)
|
||||||
|
local timeNum = ClientInstance.data[1]
|
||||||
|
local time = CoD.Reimagined.ConvertNumToTime(timeNum)
|
||||||
|
|
||||||
|
Menu.totalTimerText:setText(Engine.Localize("ZOMBIE_HUD_TOTAL_TIME") .. time)
|
||||||
|
end
|
||||||
|
|
||||||
|
CoD.Reimagined.TimerArea.UpdateRoundTimer = function(Menu, ClientInstance)
|
||||||
|
local timeNum = ClientInstance.data[1]
|
||||||
|
local time = CoD.Reimagined.ConvertNumToTime(timeNum)
|
||||||
|
|
||||||
|
Menu.roundTimerText:setText(Engine.Localize("ZOMBIE_HUD_ROUND_TIME") .. time)
|
||||||
|
end
|
||||||
|
|
||||||
|
CoD.Reimagined.TimerArea.UpdateRoundTotalTimer = function(Menu, ClientInstance)
|
||||||
|
local timeNum = ClientInstance.data[1]
|
||||||
|
local time = CoD.Reimagined.ConvertNumToTime(timeNum)
|
||||||
|
|
||||||
|
Menu.roundTotalTimerText:setText(Engine.Localize("ZOMBIE_HUD_ROUND_TOTAL_TIME") .. time)
|
||||||
|
end
|
||||||
|
|
||||||
|
CoD.Reimagined.TimerArea.FadeOutRoundTotalTimer = function(Menu, ClientInstance)
|
||||||
|
if ClientInstance.data ~= nil then
|
||||||
|
Menu.roundTotalTimerText:animateToState("fade_out", ClientInstance.data[1])
|
||||||
|
else
|
||||||
|
Menu.roundTotalTimerText:animateToState("fade_out")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
CoD.Reimagined.TimerArea.FadeInRoundTotalTimer = function(Menu, ClientInstance)
|
||||||
|
if ClientInstance.data ~= nil then
|
||||||
|
Menu.roundTotalTimerText:animateToState("fade_in", ClientInstance.data[1])
|
||||||
|
else
|
||||||
|
Menu.roundTotalTimerText:animateToState("fade_in")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
CoD.Reimagined.HealthBarArea = {}
|
CoD.Reimagined.HealthBarArea = {}
|
||||||
CoD.Reimagined.HealthBarArea.UpdateVisibility = function(Menu, ClientInstance)
|
CoD.Reimagined.HealthBarArea.UpdateVisibility = function(Menu, ClientInstance)
|
||||||
local controller = ClientInstance.controller
|
local controller = ClientInstance.controller
|
||||||
@ -254,3 +362,32 @@ CoD.Reimagined.ZoneNameArea.FadeInZoneName = function(Menu, ClientInstance)
|
|||||||
Menu.zoneNameText:animateToState("fade_in")
|
Menu.zoneNameText:animateToState("fade_in")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
CoD.Reimagined.ConvertNumToTime = function(num)
|
||||||
|
local time = ""
|
||||||
|
local hrs = 0
|
||||||
|
local mins = 0
|
||||||
|
local secs = 0
|
||||||
|
|
||||||
|
if num >= 3600 then
|
||||||
|
hrs = math.floor(num / 3600)
|
||||||
|
num = num - (hrs * 3600)
|
||||||
|
end
|
||||||
|
|
||||||
|
if num >= 60 then
|
||||||
|
mins = math.floor(num / 60)
|
||||||
|
num = num - (mins * 60)
|
||||||
|
end
|
||||||
|
|
||||||
|
if num > 0 then
|
||||||
|
secs = num
|
||||||
|
end
|
||||||
|
|
||||||
|
if hrs > 0 then
|
||||||
|
time = tostring(hrs) .. ":" .. string.format("%02d", mins) .. ":" .. string.format("%02d", secs)
|
||||||
|
else
|
||||||
|
time = tostring(mins) .. ":" .. string.format("%02d", secs)
|
||||||
|
end
|
||||||
|
|
||||||
|
return time
|
||||||
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user