mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-07 21:59:49 -05:00
HUD: convert game mode name to LUI
This commit is contained in:
parent
eb6fb4f409
commit
c75e0051bf
@ -91,6 +91,9 @@ LANG_ENGLISH "HEALTH BAR"
|
|||||||
REFERENCE MENU_ZONE_NAME_CAPS
|
REFERENCE MENU_ZONE_NAME_CAPS
|
||||||
LANG_ENGLISH "ZONE NAME"
|
LANG_ENGLISH "ZONE NAME"
|
||||||
|
|
||||||
|
REFERENCE MENU_GAME_MODE_NAME_CAPS
|
||||||
|
LANG_ENGLISH "GAME MODE NAME"
|
||||||
|
|
||||||
REFERENCE MENU_CONTAINMENT_ZONE_TIME_CAPS
|
REFERENCE MENU_CONTAINMENT_ZONE_TIME_CAPS
|
||||||
LANG_ENGLISH "CONTAINMENT ZONE/TIME"
|
LANG_ENGLISH "CONTAINMENT ZONE/TIME"
|
||||||
|
|
||||||
|
@ -197,8 +197,6 @@ precache_strings()
|
|||||||
precacheString(&"hud_update_health_bar");
|
precacheString(&"hud_update_health_bar");
|
||||||
precacheString(&"hud_update_zone_name");
|
precacheString(&"hud_update_zone_name");
|
||||||
precacheString(&"hud_update_quest_timer");
|
precacheString(&"hud_update_quest_timer");
|
||||||
precacheString(&"hud_update_containment_zone");
|
|
||||||
precacheString(&"hud_update_containment_time");
|
|
||||||
|
|
||||||
precacheString(&"hud_fade_out_zone_name");
|
precacheString(&"hud_fade_out_zone_name");
|
||||||
precacheString(&"hud_fade_in_zone_name");
|
precacheString(&"hud_fade_in_zone_name");
|
||||||
@ -784,6 +782,11 @@ lui_notify_events()
|
|||||||
{
|
{
|
||||||
self luinotifyevent(&"hud_update_containment_time", 1, level.containment_time_hud_value);
|
self luinotifyevent(&"hud_update_containment_time", 1, level.containment_time_hud_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isdefined(level.game_mode_name_hud_value))
|
||||||
|
{
|
||||||
|
self luinotifyevent(&"hud_update_game_mode_name", 1, level.game_mode_name_hud_value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enemy_counter_hud()
|
enemy_counter_hud()
|
||||||
|
@ -32,19 +32,7 @@ init()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
precacheshader("waypoint_target");
|
set_grief_vars();
|
||||||
precacheshader("white_waypoint_target");
|
|
||||||
precacheshader("white_waypoint_capture");
|
|
||||||
precacheshader("white_waypoint_defend");
|
|
||||||
precacheshader("white_waypoint_contested");
|
|
||||||
precacheshader("white_waypoint_grab");
|
|
||||||
precacheshader("white_waypoint_kill");
|
|
||||||
precacheshader("white_waypoint_escort");
|
|
||||||
precacheshader("chalkmarks_hellcatraz_1");
|
|
||||||
precacheshader("chalkmarks_hellcatraz_2");
|
|
||||||
precacheshader("chalkmarks_hellcatraz_3");
|
|
||||||
precacheshader("chalkmarks_hellcatraz_4");
|
|
||||||
precacheshader("chalkmarks_hellcatraz_5");
|
|
||||||
|
|
||||||
level._effect["human_disappears"] = loadfx("maps/zombie/fx_zmb_returned_spawn_puff");
|
level._effect["human_disappears"] = loadfx("maps/zombie/fx_zmb_returned_spawn_puff");
|
||||||
|
|
||||||
@ -59,15 +47,32 @@ init()
|
|||||||
|
|
||||||
precacheStatusIcon(level.item_meat_status_icon_name);
|
precacheStatusIcon(level.item_meat_status_icon_name);
|
||||||
|
|
||||||
|
precacheshader("waypoint_target");
|
||||||
|
precacheshader("white_waypoint_target");
|
||||||
|
precacheshader("white_waypoint_capture");
|
||||||
|
precacheshader("white_waypoint_defend");
|
||||||
|
precacheshader("white_waypoint_contested");
|
||||||
|
precacheshader("white_waypoint_grab");
|
||||||
|
precacheshader("white_waypoint_kill");
|
||||||
|
precacheshader("white_waypoint_escort");
|
||||||
|
precacheshader("chalkmarks_hellcatraz_1");
|
||||||
|
precacheshader("chalkmarks_hellcatraz_2");
|
||||||
|
precacheshader("chalkmarks_hellcatraz_3");
|
||||||
|
precacheshader("chalkmarks_hellcatraz_4");
|
||||||
|
precacheshader("chalkmarks_hellcatraz_5");
|
||||||
|
|
||||||
|
precacheString(&"hud_update_game_mode_name");
|
||||||
|
precacheString(&"hud_update_containment_zone");
|
||||||
|
precacheString(&"hud_update_containment_time");
|
||||||
|
precacheString(istring(toupper("ZMUI_" + level.scr_zm_ui_gametype_obj)));
|
||||||
|
precacheString(istring(toupper("ZMUI_" + level.scr_zm_ui_gametype_obj + "_PRO")));
|
||||||
|
|
||||||
setDvar("ui_scorelimit", 1);
|
setDvar("ui_scorelimit", 1);
|
||||||
|
|
||||||
setteamscore("axis", 0);
|
setteamscore("axis", 0);
|
||||||
setteamscore("allies", 0);
|
setteamscore("allies", 0);
|
||||||
|
|
||||||
set_grief_vars();
|
|
||||||
grief_setscoreboardcolumns_gametype();
|
grief_setscoreboardcolumns_gametype();
|
||||||
grief_gamemode_hud();
|
|
||||||
grief_score_hud();
|
|
||||||
enemy_powerup_hud();
|
enemy_powerup_hud();
|
||||||
|
|
||||||
if (level.scr_zm_ui_gametype_obj == "zcontainment")
|
if (level.scr_zm_ui_gametype_obj == "zcontainment")
|
||||||
@ -96,6 +101,8 @@ init()
|
|||||||
level.store_player_damage_info_func = ::store_player_damage_info;
|
level.store_player_damage_info_func = ::store_player_damage_info;
|
||||||
level.player_suicide_func = ::player_suicide;
|
level.player_suicide_func = ::player_suicide;
|
||||||
|
|
||||||
|
level thread grief_gamemode_name_hud();
|
||||||
|
level thread grief_gamemode_score_hud();
|
||||||
level thread grief_intro_msg();
|
level thread grief_intro_msg();
|
||||||
level thread round_start_wait(5, true);
|
level thread round_start_wait(5, true);
|
||||||
level thread remove_round_number();
|
level thread remove_round_number();
|
||||||
@ -121,39 +128,21 @@ grief_setscoreboardcolumns_gametype()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
grief_gamemode_hud()
|
grief_gamemode_name_hud()
|
||||||
{
|
|
||||||
level.grief_gamemode_hud = newHudElem();
|
|
||||||
level.grief_gamemode_hud.alignx = "center";
|
|
||||||
level.grief_gamemode_hud.aligny = "top";
|
|
||||||
level.grief_gamemode_hud.horzalign = "user_center";
|
|
||||||
level.grief_gamemode_hud.vertalign = "user_top";
|
|
||||||
level.grief_gamemode_hud.y += 2;
|
|
||||||
level.grief_gamemode_hud.fontscale = 1.2;
|
|
||||||
level.grief_gamemode_hud.hidewheninmenu = 1;
|
|
||||||
level.grief_gamemode_hud.foreground = 1;
|
|
||||||
level.grief_gamemode_hud.alpha = 0;
|
|
||||||
level.grief_gamemode_hud setText(get_gamemode_display_name());
|
|
||||||
|
|
||||||
level thread grief_gamemode_hud_wait_and_show();
|
|
||||||
level thread grief_gamemode_hud_destroy_on_intermission();
|
|
||||||
}
|
|
||||||
|
|
||||||
grief_gamemode_hud_wait_and_show()
|
|
||||||
{
|
{
|
||||||
flag_wait("hud_visible");
|
flag_wait("hud_visible");
|
||||||
|
|
||||||
level.grief_gamemode_hud.alpha = 1;
|
level.game_mode_name_hud_value = get_gamemode_display_name();
|
||||||
|
|
||||||
|
players = get_players();
|
||||||
|
|
||||||
|
foreach (player in players)
|
||||||
|
{
|
||||||
|
player luinotifyevent(&"hud_update_game_mode_name", 1, level.game_mode_name_hud_value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
grief_gamemode_hud_destroy_on_intermission()
|
grief_gamemode_score_hud()
|
||||||
{
|
|
||||||
level waittill("intermission");
|
|
||||||
|
|
||||||
level.grief_gamemode_hud destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
grief_score_hud()
|
|
||||||
{
|
{
|
||||||
if (level.script == "zm_prison")
|
if (level.script == "zm_prison")
|
||||||
{
|
{
|
||||||
|
@ -657,6 +657,10 @@ CoD.OptionsSettings.CreateModTab = function(ModTab, LocalClientIndex)
|
|||||||
|
|
||||||
ModTabButtonList:addSpacer(CoD.CoD9Button.Height / 2)
|
ModTabButtonList:addSpacer(CoD.CoD9Button.Height / 2)
|
||||||
|
|
||||||
|
local GameModeNameSelector = ModTabButtonList:addDvarLeftRightSelector(LocalClientIndex, Engine.Localize("MENU_GAME_MODE_NAME_CAPS"), "ui_hud_game_mode_name")
|
||||||
|
GameModeNameSelector:addChoice(LocalClientIndex, Engine.Localize("MENU_DISABLED_CAPS"), 0, nil, CoD.OptionsSettings.Button_ApplyDvarChanged)
|
||||||
|
GameModeNameSelector:addChoice(LocalClientIndex, Engine.Localize("MENU_ENABLED_CAPS"), 1, nil, CoD.OptionsSettings.Button_ApplyDvarChanged)
|
||||||
|
|
||||||
local ContainmentSelector = ModTabButtonList:addDvarLeftRightSelector(LocalClientIndex, Engine.Localize("MENU_CONTAINMENT_ZONE_TIME_CAPS"), "ui_hud_containment")
|
local ContainmentSelector = ModTabButtonList:addDvarLeftRightSelector(LocalClientIndex, Engine.Localize("MENU_CONTAINMENT_ZONE_TIME_CAPS"), "ui_hud_containment")
|
||||||
ContainmentSelector:addChoice(LocalClientIndex, Engine.Localize("MENU_DISABLED_CAPS"), 0, nil, CoD.OptionsSettings.Button_ApplyDvarChanged)
|
ContainmentSelector:addChoice(LocalClientIndex, Engine.Localize("MENU_DISABLED_CAPS"), 0, nil, CoD.OptionsSettings.Button_ApplyDvarChanged)
|
||||||
ContainmentSelector:addChoice(LocalClientIndex, Engine.Localize("MENU_ENABLED_CAPS"), 1, nil, CoD.OptionsSettings.Button_ApplyDvarChanged)
|
ContainmentSelector:addChoice(LocalClientIndex, Engine.Localize("MENU_ENABLED_CAPS"), 1, nil, CoD.OptionsSettings.Button_ApplyDvarChanged)
|
||||||
|
@ -199,6 +199,10 @@ CoD.InitCustomDvars = function()
|
|||||||
Engine.Exec(nil, "seta ui_hud_zone_name 1")
|
Engine.Exec(nil, "seta ui_hud_zone_name 1")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if UIExpression.DvarString(nil, "ui_hud_game_mode_name") == "" then
|
||||||
|
Engine.Exec(nil, "seta ui_hud_game_mode_name 1")
|
||||||
|
end
|
||||||
|
|
||||||
if UIExpression.DvarString(nil, "ui_hud_containment") == "" then
|
if UIExpression.DvarString(nil, "ui_hud_containment") == "" then
|
||||||
Engine.Exec(nil, "seta ui_hud_containment 1")
|
Engine.Exec(nil, "seta ui_hud_containment 1")
|
||||||
end
|
end
|
||||||
|
@ -238,6 +238,44 @@ LUI.createMenu.ReimaginedArea = function(LocalClientIndex)
|
|||||||
questTimerWidget:registerEventHandler("hud_fade_out_quest_timer", CoD.Reimagined.QuestTimerArea.FadeOutQuestTimer)
|
questTimerWidget:registerEventHandler("hud_fade_out_quest_timer", CoD.Reimagined.QuestTimerArea.FadeOutQuestTimer)
|
||||||
questTimerWidget:registerEventHandler("hud_fade_in_quest_timer", CoD.Reimagined.QuestTimerArea.FadeInQuestTimer)
|
questTimerWidget:registerEventHandler("hud_fade_in_quest_timer", CoD.Reimagined.QuestTimerArea.FadeInQuestTimer)
|
||||||
|
|
||||||
|
local gameModeNameWidget = LUI.UIElement.new()
|
||||||
|
gameModeNameWidget:setLeftRight(true, true, 0, 0)
|
||||||
|
gameModeNameWidget:setTopBottom(true, false, 3, 3)
|
||||||
|
gameModeNameWidget:setAlpha(0)
|
||||||
|
safeArea:addElement(gameModeNameWidget)
|
||||||
|
|
||||||
|
local gameModeNameText = LUI.UIText.new()
|
||||||
|
gameModeNameText:setLeftRight(true, true, 0, 0)
|
||||||
|
gameModeNameText:setTopBottom(true, false, 0, CoD.textSize.ExtraSmall)
|
||||||
|
gameModeNameText:setFont(CoD.fonts.Big)
|
||||||
|
gameModeNameText:setAlignment(LUI.Alignment.Center)
|
||||||
|
gameModeNameText:registerAnimationState("fade_out", {
|
||||||
|
alpha = 0,
|
||||||
|
})
|
||||||
|
gameModeNameText:registerAnimationState("fade_in", {
|
||||||
|
alpha = 1,
|
||||||
|
})
|
||||||
|
gameModeNameWidget:addElement(gameModeNameText)
|
||||||
|
gameModeNameWidget.gameModeNameText = gameModeNameText
|
||||||
|
|
||||||
|
gameModeNameWidget:registerEventHandler("hud_update_refresh", CoD.Reimagined.GameModeNameArea.UpdateVisibility)
|
||||||
|
gameModeNameWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_HUD_VISIBLE, CoD.Reimagined.GameModeNameArea.UpdateVisibility)
|
||||||
|
gameModeNameWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_EMP_ACTIVE, CoD.Reimagined.GameModeNameArea.UpdateVisibility)
|
||||||
|
gameModeNameWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_DEMO_CAMERA_MODE_MOVIECAM, CoD.Reimagined.GameModeNameArea.UpdateVisibility)
|
||||||
|
gameModeNameWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_DEMO_ALL_GAME_HUD_HIDDEN, CoD.Reimagined.GameModeNameArea.UpdateVisibility)
|
||||||
|
gameModeNameWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_IN_VEHICLE, CoD.Reimagined.GameModeNameArea.UpdateVisibility)
|
||||||
|
gameModeNameWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_IN_GUIDED_MISSILE, CoD.Reimagined.GameModeNameArea.UpdateVisibility)
|
||||||
|
gameModeNameWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_IN_REMOTE_KILLSTREAK_STATIC, CoD.Reimagined.GameModeNameArea.UpdateVisibility)
|
||||||
|
gameModeNameWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_AMMO_COUNTER_HIDE, CoD.Reimagined.GameModeNameArea.UpdateVisibility)
|
||||||
|
gameModeNameWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_IS_FLASH_BANGED, CoD.Reimagined.GameModeNameArea.UpdateVisibility)
|
||||||
|
gameModeNameWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_UI_ACTIVE, CoD.Reimagined.GameModeNameArea.UpdateVisibility)
|
||||||
|
gameModeNameWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_SPECTATING_CLIENT, CoD.Reimagined.GameModeNameArea.UpdateVisibility)
|
||||||
|
gameModeNameWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_SCOREBOARD_OPEN, CoD.Reimagined.GameModeNameArea.UpdateVisibility)
|
||||||
|
gameModeNameWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_PLAYER_DEAD, CoD.Reimagined.GameModeNameArea.UpdateVisibility)
|
||||||
|
gameModeNameWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_IS_SCOPED, CoD.Reimagined.GameModeNameArea.UpdateVisibility)
|
||||||
|
gameModeNameWidget:registerEventHandler("hud_update_bit_" .. CoD.BIT_IS_PLAYER_ZOMBIE, CoD.Reimagined.GameModeNameArea.UpdateVisibility)
|
||||||
|
gameModeNameWidget:registerEventHandler("hud_update_game_mode_name", CoD.Reimagined.GameModeNameArea.UpdateGameModeName)
|
||||||
|
|
||||||
local containmentWidget = LUI.UIElement.new()
|
local containmentWidget = LUI.UIElement.new()
|
||||||
containmentWidget:setLeftRight(true, true, 7, 7)
|
containmentWidget:setLeftRight(true, true, 7, 7)
|
||||||
containmentWidget:setTopBottom(true, false, 3, 3)
|
containmentWidget:setTopBottom(true, false, 3, 3)
|
||||||
@ -469,6 +507,26 @@ CoD.Reimagined.QuestTimerArea.FadeInQuestTimer = function(Menu, ClientInstance)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
CoD.Reimagined.GameModeNameArea = {}
|
||||||
|
CoD.Reimagined.GameModeNameArea.UpdateVisibility = function(Menu, ClientInstance)
|
||||||
|
local controller = ClientInstance.controller
|
||||||
|
if UIExpression.DvarBool(nil, "ui_hud_game_mode_name") == 1 and 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 and UIExpression.IsVisibilityBitSet(controller, CoD.BIT_SCOREBOARD_OPEN) == 0 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.GameModeNameArea.UpdateGameModeName = function(Menu, ClientInstance)
|
||||||
|
local gameModeNameName = Engine.Localize(Engine.GetIString(ClientInstance.data[1], "CS_LOCALIZED_STRINGS"))
|
||||||
|
|
||||||
|
Menu.gameModeNameText:setText(gameModeNameName)
|
||||||
|
end
|
||||||
|
|
||||||
CoD.Reimagined.ContainmentArea = {}
|
CoD.Reimagined.ContainmentArea = {}
|
||||||
CoD.Reimagined.ContainmentArea.UpdateVisibility = function(Menu, ClientInstance)
|
CoD.Reimagined.ContainmentArea.UpdateVisibility = function(Menu, ClientInstance)
|
||||||
local controller = ClientInstance.controller
|
local controller = ClientInstance.controller
|
||||||
|
Loading…
x
Reference in New Issue
Block a user