Make use of the new lua UserInterface in survival02
This commit is contained in:
@@ -1017,9 +1017,6 @@ Actors:
|
|||||||
AlliesBase: waypoint
|
AlliesBase: waypoint
|
||||||
Location: 39,37
|
Location: 39,37
|
||||||
Owner: Neutral
|
Owner: Neutral
|
||||||
Timer: MissionTimer
|
|
||||||
Location: 5,5
|
|
||||||
Owner: Soviets
|
|
||||||
|
|
||||||
Smudges:
|
Smudges:
|
||||||
|
|
||||||
@@ -1070,11 +1067,6 @@ Rules:
|
|||||||
DropItems: E1,E1,E2,E4,E4,E1,E1,E2,E4,E4
|
DropItems: E1,E1,E2,E4,E4,E1,E1,E2,E4,E4
|
||||||
QuantizedFacings: 8
|
QuantizedFacings: 8
|
||||||
DisplayBeacon: false
|
DisplayBeacon: false
|
||||||
MissionTimer:
|
|
||||||
ParatroopersPower:
|
|
||||||
ChargeTime: 600
|
|
||||||
Description: Soviet reinforcements arrive in
|
|
||||||
DisplayTimer: True
|
|
||||||
MINV:
|
MINV:
|
||||||
Mine:
|
Mine:
|
||||||
AvoidFriendly: yes
|
AvoidFriendly: yes
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ GuardHarvester = function(unit, harvester)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
ticked = TimerTicks
|
||||||
Tick = function()
|
Tick = function()
|
||||||
if soviets.HasNoRequiredUnits() then
|
if soviets.HasNoRequiredUnits() then
|
||||||
if DestroyObj then
|
if DestroyObj then
|
||||||
@@ -98,10 +99,18 @@ Tick = function()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if DateTime.Minutes(5) == TimerTicks - DateTime.GameTime then
|
if DateTime.Minutes(5) == ticked then
|
||||||
Media.PlaySpeechNotification(allies, "WarningFiveMinutesRemaining")
|
Media.PlaySpeechNotification(allies, "WarningFiveMinutesRemaining")
|
||||||
InitCountDown()
|
InitCountDown()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if 0 < ticked then
|
||||||
|
UserInterface.SetMissionText("Soviet reinforcements arrive in " .. Utils.FormatTime(ticked), TimerColor)
|
||||||
|
ticked = ticked - 1
|
||||||
|
elseif 0 == ticked then
|
||||||
|
FinishTimer()
|
||||||
|
ticked = ticked - 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
SendSovietParadrops = function(table)
|
SendSovietParadrops = function(table)
|
||||||
@@ -195,6 +204,18 @@ FinalAttack = function()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
FinishTimer = function()
|
||||||
|
for i = 0, 9, 1 do
|
||||||
|
local c = TimerColor
|
||||||
|
if i % 2 == 0 then
|
||||||
|
c = HSLColor.New(255, 255, 255)
|
||||||
|
end
|
||||||
|
|
||||||
|
Trigger.AfterDelay(DateTime.Seconds(i), function() UserInterface.SetMissionText("Soviet reinforcements have arrived!", c) end)
|
||||||
|
end
|
||||||
|
Trigger.AfterDelay(DateTime.Seconds(10), function() UserInterface.SetMissionText("") end)
|
||||||
|
end
|
||||||
|
|
||||||
wave = 1
|
wave = 1
|
||||||
SendParadrops = function()
|
SendParadrops = function()
|
||||||
SendSovietParadrops(ParaWaves[wave][2])
|
SendSovietParadrops(ParaWaves[wave][2])
|
||||||
@@ -277,6 +298,7 @@ end
|
|||||||
|
|
||||||
InitMission = function()
|
InitMission = function()
|
||||||
Camera.Position = AlliesBase.CenterPosition
|
Camera.Position = AlliesBase.CenterPosition
|
||||||
|
TimerColor = HSLColor.New(0, 255, 128)
|
||||||
|
|
||||||
Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(allies, "MissionTimerInitialised") end)
|
Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(allies, "MissionTimerInitialised") end)
|
||||||
|
|
||||||
@@ -286,7 +308,6 @@ InitMission = function()
|
|||||||
SpawnSovietVehicle(NewSovietEntryPoints, NewSovietRallyPoints)
|
SpawnSovietVehicle(NewSovietEntryPoints, NewSovietRallyPoints)
|
||||||
FinalAttack()
|
FinalAttack()
|
||||||
Producing = false
|
Producing = false
|
||||||
Timer.Destroy()
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Trigger.AfterDelay(AttackTicks, SendParadrops)
|
Trigger.AfterDelay(AttackTicks, SendParadrops)
|
||||||
|
|||||||
Reference in New Issue
Block a user