1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-07 21:59:49 -05:00

MOTD and Origins: show initial parts on HUD at correct time

MOTD and Origins: space out items on HUD evenly
MOTD: add initial key state on HUD
Origins: fix crash from record color change on HUD
This commit is contained in:
Jbleezy 2024-01-30 01:01:47 -08:00
parent f4fe4be182
commit d41fb06418
7 changed files with 67 additions and 15 deletions

View File

@ -1682,8 +1682,7 @@ temp_disable_offhand_weapons()
buildbuildables()
{
// need a wait or else some buildables dont build
wait 1;
wait 1; // need a wait or else some buildables dont build
if (is_classic())
{
@ -1926,8 +1925,12 @@ unregister_tower_unitriggers()
// MOTD\Origins style buildables
buildcraftables()
{
// need a wait or else some buildables dont build
wait 1;
flag_wait("initial_blackscreen_passed");
if (is_true(level.zombiemode_using_afterlife))
{
flag_wait("afterlife_start_over");
}
if (is_classic())
{

View File

@ -117,3 +117,24 @@ include_craftables()
plane.custom_craftablestub_update_prompt = ::prison_plane_update_prompt;
include_craftable(refuelable_plane);
}
planecraftable()
{
level thread alcatraz_craftable_trigger_think("plane_craftable_trigger", "plane", "plane", "", 1, 0);
level setclientfield("quest_plane_craft_complete", 0);
level thread setclientfield_quest_states_init();
}
setclientfield_quest_states_init()
{
flag_wait("initial_blackscreen_passed");
if (is_true(level.zombiemode_using_afterlife))
{
flag_wait("afterlife_start_over");
}
for (i = 1; i <= 5; i++)
level setclientfield("quest_state" + i, 2);
}

View File

@ -604,6 +604,8 @@ run_gramophone_door(str_vinyl_record)
while (!trig_position.has_vinyl)
wait 0.05;
wait 0.05;
t_door.initial_placed = 1;
trig_position.gramophone_model = spawn("script_model", trig_position.origin);
trig_position.gramophone_model.angles = trig_position.angles;

View File

@ -50,7 +50,7 @@ LUI.createMenu.CraftablesTombArea = function(f1_arg0)
f1_local8.shouldFadeOutQuestStatus = true
f1_local8.highlightRecentItem = true
end
local f1_local9 = f1_local6 + 100
local f1_local9 = f1_local6 + 90
local f1_local10 = LUI.UIVerticalList.new()
f1_local10:setLeftRight(true, true, 0, 0)
f1_local10:setTopBottom(true, false, f1_local9, f1_local9 + CoD.CraftablesTomb.ContainerHeight)

View File

@ -16,7 +16,7 @@ LUI.createMenu.CraftablesArea = function(f1_arg0)
local f1_local3 = CoD.QuestItemDisplay.ContainerSize / 4
if CoD.Zombie.SoloQuestMode == false then
CoD.QuestItemDisplay.AddPersistentIcon(f1_local2)
f1_local2:addSpacer(f1_local3 * 2)
f1_local2:addSpacer(90 - CoD.QuestItemDisplay.ContainerSize)
end
local f1_local4 = false
local f1_local5 = true
@ -30,7 +30,7 @@ LUI.createMenu.CraftablesArea = function(f1_arg0)
end
local f1_local6 = LUI.UIVerticalList.new()
f1_local6:setLeftRight(true, true, 0, 0)
f1_local6:setTopBottom(true, true, 200, 0)
f1_local6:setTopBottom(true, true, 180, 0)
local f1_local7 = CoD.CraftableItemDisplay.new(f1_local6)
f1_local0.scaleContainer:addElement(f1_local7)
if not CoD.Zombie.LocalSplitscreenMultiplePlayers then

View File

@ -161,9 +161,9 @@ end
CoD.PersistentItemTombDisplay.UpdateQuestContainerAndTitle = function(f4_arg0, f4_arg1, updateRecord)
if f4_arg1.oldValue ~= 0 or f4_arg1.newValue ~= 0 then
if updateRecord ~= nil then
if f4_arg1.newValue <= 1 then
if f4_arg1.newValue == 1 then
f4_arg0.statusIcons[2].icon:setRGB(1, 1, 1)
else
elseif f4_arg1.newValue >= 2 and f4_arg1.newValue <= 5 then
local recordColor = CoD.QuestItemTombDisplay.ClientFieldNames[f4_arg1.newValue - 1].color
f4_arg0.statusIcons[2].icon:setRGB(recordColor.r, recordColor.g, recordColor.b)
end
@ -259,7 +259,7 @@ CoD.PersistentItemTombDisplay.UpdateQuestStates = function(f10_arg0, f10_arg1)
f10_arg0:setAlpha(1)
f10_arg0.icon:setAlpha(1)
f10_arg0.icon:setRGB(1, 1, 1)
else
elseif f10_arg1 >= 2 and f10_arg1 <= 5 then
local recordColor = CoD.QuestItemTombDisplay.ClientFieldNames[f10_arg1 - 1].color
f10_arg0:setAlpha(1)
f10_arg0.icon:setAlpha(1)

View File

@ -121,6 +121,7 @@ CoD.QuestItemDisplay.new = function(f1_arg0)
f1_arg0:registerEventHandler(CoD.QuestItemDisplay.KeyClientFieldName, CoD.QuestItemDisplay.UpdateKeyStatus)
f1_arg0:registerEventHandler(CoD.QuestItemDisplay.PlaneCraftedClientFieldName, CoD.QuestItemDisplay.UpdatedPlaneCompletedStatus)
f1_arg0.visible = true
CoD.QuestItemDisplay.QuestItemDisplayHUD = f1_arg0
return f1_arg0
end
@ -164,7 +165,7 @@ CoD.QuestItemDisplay.AddPersistentIcon = function(f2_arg0)
f2_local4.highlight:setTopBottom(true, true, 0, 0)
f2_local4.highlight:registerEventHandler("button_over", CoD.CraftablesIcon.HighlightButtonOver)
f2_local4.highlight:registerEventHandler("button_up", CoD.CraftablesIcon.HighlightButtonUp)
f2_local4:addElement(f2_local4.highlight)
f2_local3:addElement(f2_local4.highlight)
f2_arg0:addElement(self)
end
@ -309,6 +310,17 @@ CoD.QuestItemDisplay.PlayerPieceOwner = function(f4_arg0, f4_arg1)
end
CoD.QuestItemDisplay.UpdateQuest = function(f5_arg0, f5_arg1)
if f5_arg1.newValue == 0 then
CoD.QuestItemDisplay.initKeyStatusUpdated = false
end
if f5_arg1.oldValue == 0 and f5_arg1.newValue == 2 then
if not CoD.QuestItemDisplay.initKeyStatusUpdated then
CoD.QuestItemDisplay.initKeyStatusUpdated = true
CoD.QuestItemDisplay.UpdateKeyStatus(CoD.QuestItemDisplay.QuestItemDisplayHUD, f5_arg1, 1)
end
end
CoD.QuestItemDisplay.UpdateQuestStatus(f5_arg0, f5_arg1)
if f5_arg1.oldValue ~= 0 or f5_arg1.newValue ~= 0 then
if f5_arg0.questStatusContainer then
@ -493,17 +505,31 @@ CoD.QuestItemDisplay.UpdatePersistentIconState = function(f13_arg0, f13_arg1, f1
end
end
CoD.QuestItemDisplay.UpdateKeyStatus = function(f14_arg0, f14_arg1)
CoD.QuestItemDisplay.UpdateKeyStatus = function(f14_arg0, f14_arg1, initKeyState)
if not initKeyState then
CoD.QuestItemDisplay.HaveKeyInScoreboard = true
CoD.QuestItemDisplay.UpdateKeyIconState(f14_arg0, f14_arg1.oldValue, f14_arg1.newValue)
end
CoD.QuestItemDisplay.UpdateKeyIconState = function(f15_arg0, f15_arg1, f15_arg2)
CoD.QuestItemDisplay.UpdateKeyIconState(f14_arg0, f14_arg1.oldValue, f14_arg1.newValue, initKeyState)
end
CoD.QuestItemDisplay.UpdateKeyIconState = function(f15_arg0, f15_arg1, f15_arg2, initKeyState)
if initKeyState then
f15_arg2 = 1
end
if not CoD.QuestItemDisplay.CurrentMapName or f15_arg2 < 0 then
return
elseif f15_arg0.craftableIcon and f15_arg1 == 0 and f15_arg2 == 1 then
f15_arg0.craftableIcon:setAlpha(1)
f15_arg0.craftableIcon:setImage(CoD.QuestItemDisplay.KeyMaterial)
if initKeyState then
f15_arg0.craftableIcon:setAlpha(CoD.QuestItemDisplay.NeedItemAlpha)
else
f15_arg0.craftableIcon:setAlpha(1)
end
f15_arg0.craftableIcon.highlight:alternateStates(CoD.QuestItemDisplay.ONSCREEN_DURATION, CoD.CraftablesIcon.PulseRedBright, CoD.CraftablesIcon.PulseRedLow, 500, 500, CoD.CraftablesIcon.PulseWhite)
f15_arg0.craftableIcon.inUse = true
f15_arg0.persQuestContainer:setAlpha(1)