Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 2d4517e

Browse files
authored
Merge pull request #98 from cortex-command-community/Menus-Refactor
Menus Refactor
2 parents 3a90887 + 0356f37 commit 2d4517e

File tree

287 files changed

+6573
-4563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

287 files changed

+6573
-4563
lines changed

Base.rte/Activities/BrainVsBrain.lua

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -265,18 +265,21 @@ end
265265

266266

267267
function BrainvsBrain:EndActivity()
268-
-- Play sad music if no humans are left
269-
if self:HumanBrainCount() == 0 then
270-
AudioMan:ClearMusicQueue();
271-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
272-
AudioMan:QueueSilence(10);
273-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
274-
else
275-
-- But if humans are left, then play happy music!
276-
AudioMan:ClearMusicQueue();
277-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
278-
AudioMan:QueueSilence(10);
279-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
268+
-- Temp fix so music doesn't start playing if ending the Activity when changing resolution through the ingame settings.
269+
if not self:IsPaused() then
270+
-- Play sad music if no humans are left
271+
if self:HumanBrainCount() == 0 then
272+
AudioMan:ClearMusicQueue();
273+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
274+
AudioMan:QueueSilence(10);
275+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
276+
else
277+
-- But if humans are left, then play happy music!
278+
AudioMan:ClearMusicQueue();
279+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
280+
AudioMan:QueueSilence(10);
281+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
282+
end
280283
end
281284
end
282285

Base.rte/Activities/BunkerBreach.lua

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -233,18 +233,21 @@ end
233233

234234

235235
function BunkerBreach:EndActivity()
236-
-- Play sad music if no humans are left
237-
if self:HumanBrainCount() == 0 then
238-
AudioMan:ClearMusicQueue();
239-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
240-
AudioMan:QueueSilence(10);
241-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
242-
else
243-
-- But if humans are left, then play happy music!
244-
AudioMan:ClearMusicQueue();
245-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
246-
AudioMan:QueueSilence(10);
247-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
236+
-- Temp fix so music doesn't start playing if ending the Activity when changing resolution through the ingame settings.
237+
if not self:IsPaused() then
238+
-- Play sad music if no humans are left
239+
if self:HumanBrainCount() == 0 then
240+
AudioMan:ClearMusicQueue();
241+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
242+
AudioMan:QueueSilence(10);
243+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
244+
else
245+
-- But if humans are left, then play happy music!
246+
AudioMan:ClearMusicQueue();
247+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
248+
AudioMan:QueueSilence(10);
249+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
250+
end
248251
end
249252
end
250253

Base.rte/Activities/Harvester.lua

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,21 @@ end
8686

8787

8888
function Harvester:EndActivity()
89-
-- Play sad music if no humans are left
90-
if self:HumanBrainCount() == 0 then
91-
AudioMan:ClearMusicQueue();
92-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
93-
AudioMan:QueueSilence(10);
94-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
95-
else
96-
-- But if humans are left, then play happy music!
97-
AudioMan:ClearMusicQueue();
98-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
99-
AudioMan:QueueSilence(10);
100-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
89+
-- Temp fix so music doesn't start playing if ending the Activity when changing resolution through the ingame settings.
90+
if not self:IsPaused() then
91+
-- Play sad music if no humans are left
92+
if self:HumanBrainCount() == 0 then
93+
AudioMan:ClearMusicQueue();
94+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
95+
AudioMan:QueueSilence(10);
96+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
97+
else
98+
-- But if humans are left, then play happy music!
99+
AudioMan:ClearMusicQueue();
100+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
101+
AudioMan:QueueSilence(10);
102+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
103+
end
101104
end
102105
end
103106

Base.rte/Activities/KeepieUppie.lua

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,21 @@ end
6262

6363

6464
function KeepieUppie:EndActivity()
65-
-- Play sad music if no humans are left
66-
if self:HumanBrainCount() == 0 then
67-
AudioMan:ClearMusicQueue();
68-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
69-
AudioMan:QueueSilence(10);
70-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
71-
else
72-
-- But if humans are left, then play happy music!
73-
AudioMan:ClearMusicQueue();
74-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
75-
AudioMan:QueueSilence(10);
76-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
65+
-- Temp fix so music doesn't start playing if ending the Activity when changing resolution through the ingame settings.
66+
if not self:IsPaused() then
67+
-- Play sad music if no humans are left
68+
if self:HumanBrainCount() == 0 then
69+
AudioMan:ClearMusicQueue();
70+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
71+
AudioMan:QueueSilence(10);
72+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
73+
else
74+
-- But if humans are left, then play happy music!
75+
AudioMan:ClearMusicQueue();
76+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
77+
AudioMan:QueueSilence(10);
78+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
79+
end
7780
end
7881
end
7982

Base.rte/Activities/Massacre.lua

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,21 @@ end
8383

8484

8585
function Massacre:EndActivity()
86-
-- Play sad music if no humans are left
87-
if self:HumanBrainCount() == 0 then
88-
AudioMan:ClearMusicQueue();
89-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
90-
AudioMan:QueueSilence(10);
91-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
92-
else
93-
-- But if humans are left, then play happy music!
94-
AudioMan:ClearMusicQueue();
95-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
96-
AudioMan:QueueSilence(10);
97-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
86+
-- Temp fix so music doesn't start playing if ending the Activity when changing resolution through the ingame settings.
87+
if not self:IsPaused() then
88+
-- Play sad music if no humans are left
89+
if self:HumanBrainCount() == 0 then
90+
AudioMan:ClearMusicQueue();
91+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
92+
AudioMan:QueueSilence(10);
93+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
94+
else
95+
-- But if humans are left, then play happy music!
96+
AudioMan:ClearMusicQueue();
97+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
98+
AudioMan:QueueSilence(10);
99+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
100+
end
98101
end
99102
end
100103

Base.rte/Activities/MetaFight.lua

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -679,31 +679,34 @@ function MetaFight:EndActivity()
679679

680680
-- If there's no brains left in the scene at all after game over, then re-do the outcome
681681
self.NoBrainsLeft = self:NoTeamLeft();
682-
683-
-- This is now no-man's land
684-
if self.NoBrainsLeft then
685-
self.WinnerTeam = Activity.NOTEAM;
686-
SceneMan.Scene.TeamOwnership = Activity.NOTEAM;
687-
-- Should not clear blueprints because this wipes all placed loadouts info
688-
--SceneMan.Scene:ClearPlacedObjectSet(Scene.BLUEPRINT);
689-
-- Sad music
690-
AudioMan:ClearMusicQueue();
691-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
692-
AudioMan:QueueSilence(10);
693-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
694-
-- Also play sad music if no humans are left
695-
elseif self:HumanBrainCount() == 0 then
696-
AudioMan:ClearMusicQueue();
697-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
698-
AudioMan:QueueSilence(10);
699-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
700-
-- But if humans are left, then play happy music!
701-
else
702-
-- Win music!
703-
AudioMan:ClearMusicQueue();
704-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
705-
AudioMan:QueueSilence(10);
706-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
682+
683+
-- Temp fix so music doesn't start playing if ending the Activity when changing resolution through the ingame settings.
684+
if not self:IsPaused() then
685+
-- This is now no-man's land
686+
if self.NoBrainsLeft then
687+
self.WinnerTeam = Activity.NOTEAM;
688+
SceneMan.Scene.TeamOwnership = Activity.NOTEAM;
689+
-- Should not clear blueprints because this wipes all placed loadouts info
690+
--SceneMan.Scene:ClearPlacedObjectSet(Scene.BLUEPRINT);
691+
-- Sad music
692+
AudioMan:ClearMusicQueue();
693+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
694+
AudioMan:QueueSilence(10);
695+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
696+
-- Also play sad music if no humans are left
697+
elseif self:HumanBrainCount() == 0 then
698+
AudioMan:ClearMusicQueue();
699+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
700+
AudioMan:QueueSilence(10);
701+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
702+
-- But if humans are left, then play happy music!
703+
else
704+
-- Win music!
705+
AudioMan:ClearMusicQueue();
706+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
707+
AudioMan:QueueSilence(10);
708+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
709+
end
707710
end
708711

709712
-- Display appropriate message for each player, winner or loser

Base.rte/Activities/OneManArmy.lua

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -192,18 +192,21 @@ end
192192

193193

194194
function OneManArmy:EndActivity()
195-
--Play sad music if no humans are left
196-
if self:HumanBrainCount() == 0 then
197-
AudioMan:ClearMusicQueue();
198-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
199-
AudioMan:QueueSilence(10);
200-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
201-
else
202-
--But if humans are left, play happy music!
203-
AudioMan:ClearMusicQueue();
204-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
205-
AudioMan:QueueSilence(10);
206-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
195+
-- Temp fix so music doesn't start playing if ending the Activity when changing resolution through the ingame settings.
196+
if not self:IsPaused() then
197+
--Play sad music if no humans are left
198+
if self:HumanBrainCount() == 0 then
199+
AudioMan:ClearMusicQueue();
200+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
201+
AudioMan:QueueSilence(10);
202+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
203+
else
204+
--But if humans are left, play happy music!
205+
AudioMan:ClearMusicQueue();
206+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
207+
AudioMan:QueueSilence(10);
208+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
209+
end
207210
end
208211
end
209212

Base.rte/Activities/OneManArmyDiggers.lua

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,21 @@ end
158158

159159

160160
function OneManArmy:EndActivity()
161-
-- Play sad music if no humans are left
162-
if self:HumanBrainCount() == 0 then
163-
AudioMan:ClearMusicQueue();
164-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
165-
AudioMan:QueueSilence(10);
166-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
167-
else
168-
-- But if humans are left, then play happy music!
169-
AudioMan:ClearMusicQueue();
170-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
171-
AudioMan:QueueSilence(10);
172-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
161+
-- Temp fix so music doesn't start playing if ending the Activity when changing resolution through the ingame settings.
162+
if not self:IsPaused() then
163+
-- Play sad music if no humans are left
164+
if self:HumanBrainCount() == 0 then
165+
AudioMan:ClearMusicQueue();
166+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
167+
AudioMan:QueueSilence(10);
168+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
169+
else
170+
-- But if humans are left, then play happy music!
171+
AudioMan:ClearMusicQueue();
172+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
173+
AudioMan:QueueSilence(10);
174+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
175+
end
173176
end
174177
end
175178

Base.rte/Activities/Siege.lua

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -242,18 +242,21 @@ end
242242

243243

244244
function Siege:EndActivity()
245-
-- Play sad music if no humans are left
246-
if self:HumanBrainCount() == 0 then
247-
AudioMan:ClearMusicQueue();
248-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
249-
AudioMan:QueueSilence(10);
250-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
251-
else
252-
-- But if humans are left, then play happy music!
253-
AudioMan:ClearMusicQueue();
254-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
255-
AudioMan:QueueSilence(10);
256-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
245+
-- Temp fix so music doesn't start playing if ending the Activity when changing resolution through the ingame settings.
246+
if not self:IsPaused() then
247+
-- Play sad music if no humans are left
248+
if self:HumanBrainCount() == 0 then
249+
AudioMan:ClearMusicQueue();
250+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
251+
AudioMan:QueueSilence(10);
252+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
253+
else
254+
-- But if humans are left, then play happy music!
255+
AudioMan:ClearMusicQueue();
256+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
257+
AudioMan:QueueSilence(10);
258+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
259+
end
257260
end
258261
end
259262

Base.rte/Activities/SkirmishDefense.lua

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,21 @@ end
134134

135135

136136
function SkirmishDefense:EndActivity()
137-
-- Play sad music if no humans are left
138-
if self:HumanBrainCount() == 0 then
139-
AudioMan:ClearMusicQueue();
140-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
141-
AudioMan:QueueSilence(10);
142-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
143-
else
144-
-- But if humans are left, then play happy music!
145-
AudioMan:ClearMusicQueue();
146-
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
147-
AudioMan:QueueSilence(10);
148-
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
137+
-- Temp fix so music doesn't start playing if ending the Activity when changing resolution through the ingame settings.
138+
if not self:IsPaused() then
139+
-- Play sad music if no humans are left
140+
if self:HumanBrainCount() == 0 then
141+
AudioMan:ClearMusicQueue();
142+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/udiedfinal.ogg", 2, -1.0);
143+
AudioMan:QueueSilence(10);
144+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
145+
else
146+
-- But if humans are left, then play happy music!
147+
AudioMan:ClearMusicQueue();
148+
AudioMan:PlayMusic("Base.rte/Music/dBSoundworks/uwinfinal.ogg", 2, -1.0);
149+
AudioMan:QueueSilence(10);
150+
AudioMan:QueueMusicStream("Base.rte/Music/dBSoundworks/ccambient4.ogg");
151+
end
149152
end
150153
end
151154

0 commit comments

Comments
 (0)