mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-17 08:50:29 +02:00
Initial Lua Script implementation. Credit/Timer now renders.
This commit is contained in:
+40
-4
@@ -60,6 +60,7 @@
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
#include "function.h"
|
||||
#include "MapScript.h"
|
||||
#ifdef WIN32
|
||||
#include "tcpip.h"
|
||||
#include "ccdde.h"
|
||||
@@ -110,6 +111,9 @@ bool Is_Mission_Counterstrike (char *file_name);
|
||||
bool Is_Mission_Aftermath (char *file_name);
|
||||
#endif
|
||||
|
||||
MapScript* mapScript = nullptr;
|
||||
bool mapScriptPlayStart = false;
|
||||
|
||||
/***********************************************************************************************
|
||||
* ScenarioClass::ScenarioClass -- Constructor for the scenario control object. *
|
||||
* *
|
||||
@@ -312,12 +316,26 @@ bool ScenarioClass::Set_Global_To(int global, bool value)
|
||||
bool Start_Scenario(char * name, bool briefing)
|
||||
{
|
||||
//BG Theme.Queue_Song(THEME_QUIET);
|
||||
Theme.Stop();
|
||||
Theme.Stop();
|
||||
IsTanyaDead = SaveTanya;
|
||||
if (!Read_Scenario(name)) {
|
||||
return(false);
|
||||
}
|
||||
|
||||
// jmarshall: map scripts
|
||||
if (mapScript) {
|
||||
delete mapScript;
|
||||
}
|
||||
mapScript = new MapScript();
|
||||
if (!mapScript->Init(name)) {
|
||||
delete mapScript;
|
||||
mapScript = nullptr;
|
||||
}
|
||||
else {
|
||||
mapScriptPlayStart = true;
|
||||
}
|
||||
// jmarshall end
|
||||
|
||||
/*
|
||||
** Play the winning movie and then start the next scenario.
|
||||
*/
|
||||
@@ -351,15 +369,21 @@ Theme.Stop();
|
||||
|
||||
// }
|
||||
Theme.Stop();
|
||||
|
||||
if (briefing) {
|
||||
// jmarshall - map scripts
|
||||
if (mapScript) {
|
||||
Hide_Mouse();
|
||||
VisiblePage.Clear();
|
||||
Show_Mouse();
|
||||
mapScript->CallFunction("map_briefing");
|
||||
}
|
||||
else if (briefing) {
|
||||
Hide_Mouse();
|
||||
VisiblePage.Clear();
|
||||
Show_Mouse();
|
||||
Play_Movie(Scen.IntroMovie);
|
||||
Play_Movie(Scen.BriefMovie);
|
||||
}
|
||||
|
||||
// jmarshall end
|
||||
/*
|
||||
** If there's no briefing movie, restate the mission at the beginning.
|
||||
*/
|
||||
@@ -396,6 +420,18 @@ Theme.Stop();
|
||||
return(true);
|
||||
}
|
||||
|
||||
void Scenario_PlayMapStart(void) {
|
||||
if (!mapScript)
|
||||
return;
|
||||
|
||||
if (!mapScriptPlayStart)
|
||||
return;
|
||||
|
||||
mapScript->CallFunction("map_start");
|
||||
|
||||
mapScriptPlayStart = false;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************************************
|
||||
* Set_Scenario_Difficulty -- Sets the difficulty of the scenario. *
|
||||
|
||||
Reference in New Issue
Block a user