In editor builds the intro & sneak peak will open the scenario editor.

This commit is contained in:
Justin Marshall
2020-06-23 19:23:21 -07:00
parent 6d50fb6fca
commit 96bc8e95ff
7 changed files with 119 additions and 19 deletions
+1
View File
@@ -70,6 +70,7 @@ extern bool Debug_Cheat;
extern bool Debug_Remap;
extern bool Debug_Flag;
extern bool Debug_Lose;
extern bool Debug_SkipBriefing;
extern bool Debug_Map;
extern bool Debug_Win;
extern bool Debug_Icon;
+1
View File
@@ -43,6 +43,7 @@ bool Debug_Remap = false;
bool Debug_Icon = false;
bool Debug_Flag = true;
bool Debug_Lose = false;
bool Debug_SkipBriefing = false;
bool Debug_Win = false;
bool Debug_Map = false; // true = map editor mode
bool Debug_Passable = false; // true = show passable/impassable terrain
+30 -1
View File
@@ -1294,6 +1294,34 @@ bool Select_Game(bool fade)
** Play a VQ
*/
case SEL_INTRO:
// jmarshall
#ifdef SCENARIO_EDITOR
Debug_Map = true;
Clear_Scenario();
//Scen.Set_Scenario_Name(1, SCEN_PLAYER_SPAIN, SCEN_DIR_EAST, SCEN_VAR_A);
strcpy(Scen.ScenarioName, "DEFAULTMAP.INI");
/*
** Create houses
*/
for (HousesType house = HOUSE_FIRST; house < HOUSE_COUNT; house++) {
new HouseClass(house);
}
PlayerPtr = HouseClass::As_Pointer(HOUSE_SPAIN);
PlayerPtr->IsHuman = true;
Base.House = HOUSE_USSR;
//LastHouse = HOUSE_GOOD;
Fill_In_Data();
//Size_Map(-1, -1, 30, 30);
Scen.Waypoint[WAYPT_REINF] = XY_Cell(Map.MapCellX + Map.MapCellWidth / 2, Map.MapCellY + Map.MapCellHeight / 2);
Scen.Waypoint[WAYPT_HOME] = XY_Cell(Map.MapCellX + Map.MapCellWidth / 2, Map.MapCellY + Map.MapCellHeight / 2);
// (*this)[TacticalCoord].IsWaypoint = 1;
Map.Flag_Cell(Coord_Cell(Map.TacticalCoord));
Map.Set_Tactical_Position(Cell_Coord(Scen.Waypoint[WAYPT_HOME] - (MAP_CELL_W * 4 * RESFACTOR) - (5 * RESFACTOR)));
Go_Editor(true);
process = false;
Debug_SkipBriefing = true;
#else
Theme.Fade_Out();
if (Debug_Flag) {
@@ -1313,7 +1341,8 @@ bool Select_Game(bool fade)
display = true;
fade = true;
selection = SEL_NONE;
#endif
// jmarshall end
break;
/*
+6 -1
View File
@@ -549,8 +549,13 @@ int Main_Menu(unsigned long )
TextButtonClass multibtn(BUTTON_MULTI, TXT_MULTIPLAYER_GAME, TPF_BUTTON, d_button_x, d_button_y, d_button_w, d_button_h);
d_button_y += d_button_dy;
// jmarshall - Intro button is going to be the scenario editor button.
#ifdef SCENARIO_EDITOR
TextButtonClass introbtn(BUTTON_INTRO, "Scenario Editor", TPF_BUTTON, d_button_x, d_button_y, d_button_w, d_button_h);
#else
TextButtonClass introbtn(BUTTON_INTRO, TXT_INTRO, TPF_BUTTON, d_button_x, d_button_y, d_button_w, d_button_h);
#endif
// jmarshall end
d_button_y += d_button_dy;
TextButtonClass exitbtn(BUTTON_EXIT, TXT_EXIT_GAME, TPF_BUTTON, d_button_x, d_button_y, d_button_w, d_button_h);
+21 -17
View File
@@ -399,26 +399,30 @@ bool Start_Scenario(char * name, bool briefing)
/*
** If there's no briefing movie, restate the mission at the beginning.
*/
char buffer[25];
if (Scen.BriefMovie != VQ_NONE) {
sprintf(buffer, "%s.VQA", VQName[Scen.BriefMovie]);
}
if (Session.Type == GAME_NORMAL && ( Scen.BriefMovie == VQ_NONE || !CCFileClass(buffer).Is_Available() ) ) {
/*
** Make sure the mouse is visible before showing the restatement.
*/
while(Get_Mouse_State()) {
Show_Mouse();
if (!Debug_SkipBriefing)
{
char buffer[25];
if (Scen.BriefMovie != VQ_NONE) {
sprintf(buffer, "%s.VQA", VQName[Scen.BriefMovie]);
}
if (Session.Type == GAME_NORMAL && (Scen.BriefMovie == VQ_NONE || !CCFileClass(buffer).Is_Available())) {
/*
** Make sure the mouse is visible before showing the restatement.
*/
while (Get_Mouse_State()) {
Show_Mouse();
}
Restate_Mission(Scen.ScenarioName, TXT_OK, TXT_NONE);
}
Restate_Mission(Scen.ScenarioName, TXT_OK, TXT_NONE);
}
if (briefing) {
Hide_Mouse();
VisiblePage.Clear();
Show_Mouse();
Play_Movie(Scen.ActionMovie, Scen.TransitTheme);
if (briefing) {
Hide_Mouse();
VisiblePage.Clear();
Show_Mouse();
Play_Movie(Scen.ActionMovie, Scen.TransitTheme);
}
}
Debug_SkipBriefing = false;
if (Scen.TransitTheme == THEME_NONE) {
Theme.Queue_Song(THEME_FIRST);
+3
View File
@@ -764,6 +764,9 @@ void ChronalVortexClass::Zap_Target (void)
void ChronalVortexClass::Coordinate_Remap ( GraphicViewPortClass *inbuffer, int x, int y, int width, int height, unsigned char *remap_table)
{
unsigned char getx,gety, remap_color, pixel_color;
// jmarshall - todo fix ChronalVortexClass
return;
// jmarshall end
BufferClass destbuf (width * height);