mirror of https://github.com/OpenRCT2/OpenRCT2.git
Remove gS6Info
This commit is contained in:
parent
4b980d6b58
commit
b45a20549e
|
@ -189,7 +189,7 @@ static void ShortcutAdjustLand()
|
|||
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
|
||||
return;
|
||||
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gS6Info.editor_step == EditorStep::LandscapeEditor)
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gEditorStep == EditorStep::LandscapeEditor)
|
||||
{
|
||||
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
|
||||
{
|
||||
|
@ -208,7 +208,7 @@ static void ShortcutAdjustWater()
|
|||
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
|
||||
return;
|
||||
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gS6Info.editor_step == EditorStep::LandscapeEditor)
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gEditorStep == EditorStep::LandscapeEditor)
|
||||
{
|
||||
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
|
||||
{
|
||||
|
@ -227,7 +227,7 @@ static void ShortcutBuildScenery()
|
|||
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
|
||||
return;
|
||||
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gS6Info.editor_step == EditorStep::LandscapeEditor)
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gEditorStep == EditorStep::LandscapeEditor)
|
||||
{
|
||||
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
|
||||
{
|
||||
|
@ -246,7 +246,7 @@ static void ShortcutBuildPaths()
|
|||
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
|
||||
return;
|
||||
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gS6Info.editor_step == EditorStep::LandscapeEditor)
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gEditorStep == EditorStep::LandscapeEditor)
|
||||
{
|
||||
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
|
||||
{
|
||||
|
@ -353,7 +353,7 @@ static void ShortcutShowMap()
|
|||
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
|
||||
return;
|
||||
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gS6Info.editor_step == EditorStep::LandscapeEditor)
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gEditorStep == EditorStep::LandscapeEditor)
|
||||
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
|
||||
context_open_window(WC_MAP);
|
||||
}
|
||||
|
@ -396,7 +396,7 @@ static void ShortcutClearScenery()
|
|||
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
|
||||
return;
|
||||
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gS6Info.editor_step == EditorStep::LandscapeEditor)
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gEditorStep == EditorStep::LandscapeEditor)
|
||||
{
|
||||
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
|
||||
{
|
||||
|
@ -422,7 +422,7 @@ static void ShortcutQuickSaveGame()
|
|||
{
|
||||
auto intent = Intent(WC_LOADSAVE);
|
||||
intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE);
|
||||
intent.putExtra(INTENT_EXTRA_PATH, std::string{ gS6Info.name });
|
||||
intent.putExtra(INTENT_EXTRA_PATH, gScenarioName);
|
||||
context_open_intent(&intent);
|
||||
}
|
||||
}
|
||||
|
@ -439,7 +439,7 @@ static void ShortcutLoadGame()
|
|||
static void ShortcutOpenSceneryPicker()
|
||||
{
|
||||
if ((gScreenFlags & (SCREEN_FLAGS_TITLE_DEMO | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))
|
||||
|| (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR && gS6Info.editor_step != EditorStep::LandscapeEditor))
|
||||
|| (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR && gEditorStep != EditorStep::LandscapeEditor))
|
||||
return;
|
||||
|
||||
rct_window* window_scenery = window_find_by_class(WC_SCENERY);
|
||||
|
@ -713,7 +713,7 @@ void ShortcutManager::RegisterDefaultShortcuts()
|
|||
{
|
||||
window_close_all();
|
||||
}
|
||||
else if (gS6Info.editor_step == EditorStep::LandscapeEditor)
|
||||
else if (gEditorStep == EditorStep::LandscapeEditor)
|
||||
{
|
||||
window_close_top();
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ InteractionInfo ViewportInteractionGetItemLeft(const ScreenCoordsXY& screenCoord
|
|||
return info;
|
||||
|
||||
//
|
||||
if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gS6Info.editor_step != EditorStep::RollercoasterDesigner)
|
||||
if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gEditorStep != EditorStep::RollercoasterDesigner)
|
||||
return info;
|
||||
|
||||
info = get_map_coordinates_from_pos(
|
||||
|
@ -248,7 +248,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor
|
|||
return info;
|
||||
|
||||
//
|
||||
if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gS6Info.editor_step != EditorStep::RollercoasterDesigner)
|
||||
if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gEditorStep != EditorStep::RollercoasterDesigner)
|
||||
return info;
|
||||
|
||||
auto flags = static_cast<int32_t>(~EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Water));
|
||||
|
|
|
@ -126,7 +126,7 @@ rct_window* window_editor_bottom_toolbar_open()
|
|||
void window_editor_bottom_toolbar_jump_back_to_object_selection()
|
||||
{
|
||||
window_close_all();
|
||||
gS6Info.editor_step = EditorStep::ObjectSelection;
|
||||
gEditorStep = EditorStep::ObjectSelection;
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ void window_editor_bottom_toolbar_jump_back_to_landscape_editor()
|
|||
window_close_all();
|
||||
set_all_scenery_items_invented();
|
||||
scenery_set_default_placement_configuration();
|
||||
gS6Info.editor_step = EditorStep::LandscapeEditor;
|
||||
gEditorStep = EditorStep::LandscapeEditor;
|
||||
context_open_window(WC_MAP);
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ static void window_editor_bottom_toolbar_jump_back_to_invention_list_set_up()
|
|||
{
|
||||
window_close_all();
|
||||
context_open_window(WC_EDITOR_INVENTION_LIST);
|
||||
gS6Info.editor_step = EditorStep::InventionsListSetUp;
|
||||
gEditorStep = EditorStep::InventionsListSetUp;
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ void window_editor_bottom_toolbar_jump_back_to_options_selection()
|
|||
{
|
||||
window_close_all();
|
||||
context_open_window(WC_EDITOR_SCENARIO_OPTIONS);
|
||||
gS6Info.editor_step = EditorStep::OptionsSelection;
|
||||
gEditorStep = EditorStep::OptionsSelection;
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ void window_editor_bottom_toolbar_jump_forward_to_invention_list_set_up()
|
|||
{
|
||||
window_close_all();
|
||||
context_open_window(WC_EDITOR_INVENTION_LIST);
|
||||
gS6Info.editor_step = EditorStep::InventionsListSetUp;
|
||||
gEditorStep = EditorStep::InventionsListSetUp;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -241,7 +241,7 @@ void window_editor_bottom_toolbar_jump_forward_to_options_selection()
|
|||
{
|
||||
window_close_all();
|
||||
context_open_window(WC_EDITOR_SCENARIO_OPTIONS);
|
||||
gS6Info.editor_step = EditorStep::OptionsSelection;
|
||||
gEditorStep = EditorStep::OptionsSelection;
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
|
||||
|
@ -253,7 +253,7 @@ void window_editor_bottom_toolbar_jump_forward_to_objective_selection()
|
|||
{
|
||||
window_close_all();
|
||||
context_open_window(WC_EDITOR_OBJECTIVE_OPTIONS);
|
||||
gS6Info.editor_step = EditorStep::ObjectiveSelection;
|
||||
gEditorStep = EditorStep::ObjectiveSelection;
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
|
||||
|
@ -273,7 +273,7 @@ void window_editor_bottom_toolbar_jump_forward_to_save_scenario()
|
|||
window_close_all();
|
||||
auto intent = Intent(WC_LOADSAVE);
|
||||
intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_SCENARIO);
|
||||
intent.putExtra(INTENT_EXTRA_PATH, std::string{ gS6Info.name });
|
||||
intent.putExtra(INTENT_EXTRA_PATH, gScenarioName);
|
||||
context_open_intent(&intent);
|
||||
}
|
||||
|
||||
|
@ -288,12 +288,12 @@ static void window_editor_bottom_toolbar_mouseup([[maybe_unused]] rct_window* w,
|
|||
if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER)
|
||||
|| (GetNumFreeEntities() == MAX_ENTITIES && !(gParkFlags & PARK_FLAGS_SPRITES_INITIALISED)))
|
||||
{
|
||||
previous_button_mouseup_events[EnumValue(gS6Info.editor_step)]();
|
||||
previous_button_mouseup_events[EnumValue(gEditorStep)]();
|
||||
}
|
||||
}
|
||||
else if (widgetIndex == WIDX_NEXT_STEP_BUTTON)
|
||||
{
|
||||
next_button_mouseup_events[EnumValue(gS6Info.editor_step)]();
|
||||
next_button_mouseup_events[EnumValue(gEditorStep)]();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -336,11 +336,11 @@ void window_editor_bottom_toolbar_invalidate(rct_window* w)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (gS6Info.editor_step == EditorStep::ObjectSelection)
|
||||
if (gEditorStep == EditorStep::ObjectSelection)
|
||||
{
|
||||
hide_previous_step_button();
|
||||
}
|
||||
else if (gS6Info.editor_step == EditorStep::RollercoasterDesigner)
|
||||
else if (gEditorStep == EditorStep::RollercoasterDesigner)
|
||||
{
|
||||
hide_next_step_button();
|
||||
}
|
||||
|
@ -363,7 +363,7 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
bool drawPreviousButton = false;
|
||||
bool drawNextButton = false;
|
||||
|
||||
if (gS6Info.editor_step == EditorStep::ObjectSelection)
|
||||
if (gEditorStep == EditorStep::ObjectSelection)
|
||||
{
|
||||
drawNextButton = true;
|
||||
}
|
||||
|
@ -395,7 +395,7 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].bottom + w->windowPos.y, FilterPaletteID::Palette51);
|
||||
}
|
||||
|
||||
if ((drawPreviousButton || drawNextButton) && gS6Info.editor_step != EditorStep::RollercoasterDesigner)
|
||||
if ((drawPreviousButton || drawNextButton) && gEditorStep != EditorStep::RollercoasterDesigner)
|
||||
{
|
||||
gfx_filter_rect(
|
||||
dpi, window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].left + w->windowPos.x,
|
||||
|
@ -420,7 +420,7 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
gfx_fill_rect_inset(dpi, { topLeft, bottomRight }, w->colours[1], INSET_RECT_F_30);
|
||||
}
|
||||
|
||||
if ((drawPreviousButton || drawNextButton) && gS6Info.editor_step != EditorStep::RollercoasterDesigner)
|
||||
if ((drawPreviousButton || drawNextButton) && gEditorStep != EditorStep::RollercoasterDesigner)
|
||||
{
|
||||
gfx_fill_rect_inset(dpi, { topLeft, bottomRight }, w->colours[1], INSET_RECT_F_30);
|
||||
}
|
||||
|
@ -431,7 +431,7 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
+ w->windowPos.x;
|
||||
int16_t stateY = w->height - 0x0C + w->windowPos.y;
|
||||
DrawTextBasic(
|
||||
dpi, { stateX, stateY }, EditorStepNames[EnumValue(gS6Info.editor_step)], {},
|
||||
dpi, { stateX, stateY }, EditorStepNames[EnumValue(gEditorStep)], {},
|
||||
{ static_cast<colour_t>(NOT_TRANSLUCENT(w->colours[2]) | COLOUR_FLAG_OUTLINE), TextAlignment::CENTRE });
|
||||
|
||||
if (drawPreviousButton)
|
||||
|
@ -455,7 +455,7 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
+ w->windowPos.x;
|
||||
int16_t textY = window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].top + 6 + w->windowPos.y;
|
||||
|
||||
rct_string_id stringId = EditorStepNames[EnumValue(gS6Info.editor_step) - 1];
|
||||
rct_string_id stringId = EditorStepNames[EnumValue(gEditorStep) - 1];
|
||||
if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER)
|
||||
stringId = STR_EDITOR_STEP_OBJECT_SELECTION;
|
||||
|
||||
|
@ -463,7 +463,7 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
DrawTextBasic(dpi, { textX, textY + 10 }, stringId, {}, { textColour, TextAlignment::CENTRE });
|
||||
}
|
||||
|
||||
if ((drawPreviousButton || drawNextButton) && gS6Info.editor_step != EditorStep::RollercoasterDesigner)
|
||||
if ((drawPreviousButton || drawNextButton) && gEditorStep != EditorStep::RollercoasterDesigner)
|
||||
{
|
||||
gfx_draw_sprite(
|
||||
dpi, ImageId(SPR_NEXT),
|
||||
|
@ -484,7 +484,7 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
+ w->windowPos.x;
|
||||
int16_t textY = window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].top + 6 + w->windowPos.y;
|
||||
|
||||
rct_string_id stringId = EditorStepNames[EnumValue(gS6Info.editor_step) + 1];
|
||||
rct_string_id stringId = EditorStepNames[EnumValue(gEditorStep) + 1];
|
||||
if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER)
|
||||
stringId = STR_EDITOR_STEP_ROLLERCOASTER_DESIGNER;
|
||||
|
||||
|
|
|
@ -1269,7 +1269,7 @@ static void window_editor_object_selection_manage_tracks()
|
|||
set_every_ride_type_invented();
|
||||
set_every_ride_entry_invented();
|
||||
|
||||
gS6Info.editor_step = EditorStep::DesignsManager;
|
||||
gEditorStep = EditorStep::DesignsManager;
|
||||
|
||||
int32_t entry_index = 0;
|
||||
for (; object_entry_get_chunk(ObjectType::Ride, entry_index) == nullptr; entry_index++)
|
||||
|
|
|
@ -375,11 +375,11 @@ static void window_editor_objective_options_main_mouseup(rct_window* w, rct_widg
|
|||
break;
|
||||
}
|
||||
case WIDX_SCENARIO_NAME:
|
||||
window_text_input_raw_open(w, WIDX_SCENARIO_NAME, STR_SCENARIO_NAME, STR_ENTER_SCENARIO_NAME, gS6Info.name, 64);
|
||||
window_text_input_raw_open(w, WIDX_SCENARIO_NAME, STR_SCENARIO_NAME, STR_ENTER_SCENARIO_NAME, gScenarioName.c_str(), 64);
|
||||
break;
|
||||
case WIDX_DETAILS:
|
||||
window_text_input_raw_open(
|
||||
w, WIDX_DETAILS, STR_PARK_SCENARIO_DETAILS, STR_ENTER_SCENARIO_DESCRIPTION, gS6Info.details, 256);
|
||||
w, WIDX_DETAILS, STR_PARK_SCENARIO_DETAILS, STR_ENTER_SCENARIO_DESCRIPTION, gScenarioDetails.c_str(), 256);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ static void window_editor_objective_options_show_category_dropdown(rct_window* w
|
|||
WindowDropdownShowTextCustomWidth(
|
||||
{ w->windowPos.x + dropdownWidget->left, w->windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1,
|
||||
w->colours[1], 0, Dropdown::Flag::StayOpen, 5, dropdownWidget->width() - 3);
|
||||
Dropdown::SetChecked(gS6Info.category, true);
|
||||
Dropdown::SetChecked(gScenarioCategory, true);
|
||||
}
|
||||
|
||||
static void window_editor_objective_options_arg_1_increase(rct_window* w)
|
||||
|
@ -654,9 +654,9 @@ static void window_editor_objective_options_main_dropdown(rct_window* w, rct_wid
|
|||
window_editor_objective_options_set_objective(w, newObjectiveType);
|
||||
break;
|
||||
case WIDX_CATEGORY_DROPDOWN:
|
||||
if (gS6Info.category != static_cast<uint8_t>(dropdownIndex))
|
||||
if (gScenarioCategory != static_cast<uint8_t>(dropdownIndex))
|
||||
{
|
||||
gS6Info.category = static_cast<uint8_t>(dropdownIndex);
|
||||
gScenarioCategory = static_cast<SCENARIO_CATEGORY>(dropdownIndex);
|
||||
w->Invalidate();
|
||||
}
|
||||
break;
|
||||
|
@ -708,19 +708,19 @@ static void window_editor_objective_options_main_textinput(rct_window* w, rct_wi
|
|||
auto action = ParkSetNameAction(text);
|
||||
GameActions::Execute(&action);
|
||||
|
||||
if (gS6Info.name[0] == '\0')
|
||||
if (gScenarioName.empty())
|
||||
{
|
||||
auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark();
|
||||
String::Set(gS6Info.name, sizeof(gS6Info.name), park.Name.c_str());
|
||||
gScenarioName = park.Name;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WIDX_SCENARIO_NAME:
|
||||
safe_strcpy(gS6Info.name, text, std::size(gS6Info.name));
|
||||
gScenarioName = text;
|
||||
w->Invalidate();
|
||||
break;
|
||||
case WIDX_DETAILS:
|
||||
safe_strcpy(gS6Info.details, text, std::size(gS6Info.details));
|
||||
gScenarioDetails = text;
|
||||
w->Invalidate();
|
||||
break;
|
||||
}
|
||||
|
@ -899,7 +899,7 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi
|
|||
|
||||
auto ft = Formatter();
|
||||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<const char*>(gS6Info.name);
|
||||
ft.Add<const char*>(gScenarioName.c_str());
|
||||
DrawTextEllipsised(dpi, screenCoords, width, STR_WINDOW_SCENARIO_NAME, ft);
|
||||
|
||||
// Scenario details label
|
||||
|
@ -912,7 +912,7 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi
|
|||
|
||||
ft = Formatter();
|
||||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<const char*>(gS6Info.details);
|
||||
ft.Add<const char*>(gScenarioDetails.c_str());
|
||||
DrawTextWrapped(dpi, screenCoords, width, STR_BLACK_STRING, ft);
|
||||
|
||||
// Scenario category label
|
||||
|
@ -921,7 +921,7 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi
|
|||
|
||||
// Scenario category value
|
||||
screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_CATEGORY].left + 1, w->widgets[WIDX_CATEGORY].top };
|
||||
stringId = ScenarioCategoryStringIds[gS6Info.category];
|
||||
stringId = ScenarioCategoryStringIds[gScenarioCategory];
|
||||
DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, &stringId);
|
||||
}
|
||||
|
||||
|
|
|
@ -1057,7 +1057,7 @@ static void window_loadsave_select(rct_window* w, const char* path)
|
|||
save_path(&gConfigGeneral.last_save_scenario_directory, pathBuffer);
|
||||
int32_t parkFlagsBackup = gParkFlags;
|
||||
gParkFlags &= ~PARK_FLAGS_SPRITES_INITIALISED;
|
||||
gS6Info.editor_step = EditorStep::Invalid;
|
||||
gEditorStep = EditorStep::Invalid;
|
||||
safe_strcpy(gScenarioFileName, pathBuffer, sizeof(gScenarioFileName));
|
||||
int32_t success = scenario_save(pathBuffer, gConfigGeneral.save_plugin_data ? 3 : 2);
|
||||
gParkFlags = parkFlagsBackup;
|
||||
|
@ -1071,7 +1071,7 @@ static void window_loadsave_select(rct_window* w, const char* path)
|
|||
else
|
||||
{
|
||||
context_show_error(STR_FILE_DIALOG_TITLE_SAVE_SCENARIO, STR_SCENARIO_SAVE_FAILED, {});
|
||||
gS6Info.editor_step = EditorStep::ObjectiveSelection;
|
||||
gEditorStep = EditorStep::ObjectiveSelection;
|
||||
window_loadsave_invoke_callback(MODAL_RESULT_FAIL, pathBuffer);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <openrct2/platform/platform.h>
|
||||
#include <openrct2/ui/UiContext.h>
|
||||
#include <openrct2/windows/Intent.h>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
|
|
@ -220,7 +220,7 @@ static void window_save_prompt_mouseup(rct_window* w, rct_widgetindex widgetInde
|
|||
{
|
||||
intent = new Intent(WC_LOADSAVE);
|
||||
intent->putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE);
|
||||
intent->putExtra(INTENT_EXTRA_PATH, std::string{ gS6Info.name });
|
||||
intent->putExtra(INTENT_EXTRA_PATH, gScenarioName);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -558,7 +558,7 @@ static void window_top_toolbar_dropdown(rct_window* w, rct_widgetindex widgetInd
|
|||
{
|
||||
auto intent = Intent(WC_LOADSAVE);
|
||||
intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE);
|
||||
intent.putExtra(INTENT_EXTRA_PATH, std::string{ gS6Info.name });
|
||||
intent.putExtra(INTENT_EXTRA_PATH, gScenarioName);
|
||||
context_open_intent(&intent);
|
||||
}
|
||||
else
|
||||
|
@ -682,20 +682,20 @@ static void window_top_toolbar_invalidate(rct_window* w)
|
|||
window_top_toolbar_widgets[WIDX_NEWS].type = WindowWidgetType::Empty;
|
||||
window_top_toolbar_widgets[WIDX_NETWORK].type = WindowWidgetType::Empty;
|
||||
|
||||
if (gS6Info.editor_step != EditorStep::LandscapeEditor)
|
||||
if (gEditorStep != EditorStep::LandscapeEditor)
|
||||
{
|
||||
window_top_toolbar_widgets[WIDX_LAND].type = WindowWidgetType::Empty;
|
||||
window_top_toolbar_widgets[WIDX_WATER].type = WindowWidgetType::Empty;
|
||||
}
|
||||
|
||||
if (gS6Info.editor_step != EditorStep::RollercoasterDesigner)
|
||||
if (gEditorStep != EditorStep::RollercoasterDesigner)
|
||||
{
|
||||
window_top_toolbar_widgets[WIDX_RIDES].type = WindowWidgetType::Empty;
|
||||
window_top_toolbar_widgets[WIDX_CONSTRUCT_RIDE].type = WindowWidgetType::Empty;
|
||||
window_top_toolbar_widgets[WIDX_FASTFORWARD].type = WindowWidgetType::Empty;
|
||||
}
|
||||
|
||||
if (gS6Info.editor_step != EditorStep::LandscapeEditor && gS6Info.editor_step != EditorStep::RollercoasterDesigner)
|
||||
if (gEditorStep != EditorStep::LandscapeEditor && gEditorStep != EditorStep::RollercoasterDesigner)
|
||||
{
|
||||
window_top_toolbar_widgets[WIDX_MAP].type = WindowWidgetType::Empty;
|
||||
window_top_toolbar_widgets[WIDX_SCENERY].type = WindowWidgetType::Empty;
|
||||
|
@ -3284,7 +3284,7 @@ static void top_toolbar_init_map_menu(rct_window* w, rct_widget* widget)
|
|||
auto i = 0;
|
||||
gDropdownItemsFormat[i++] = STR_SHORTCUT_SHOW_MAP;
|
||||
gDropdownItemsFormat[i++] = STR_EXTRA_VIEWPORT;
|
||||
if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && gS6Info.editor_step == EditorStep::LandscapeEditor)
|
||||
if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && gEditorStep == EditorStep::LandscapeEditor)
|
||||
{
|
||||
gDropdownItemsFormat[i++] = STR_MAPGEN_WINDOW_TITLE;
|
||||
}
|
||||
|
@ -3312,7 +3312,7 @@ static void top_toolbar_init_map_menu(rct_window* w, rct_widget* widget)
|
|||
static void top_toolbar_map_menu_dropdown(int16_t dropdownIndex)
|
||||
{
|
||||
int32_t customStartIndex = 3;
|
||||
if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && gS6Info.editor_step == EditorStep::LandscapeEditor)
|
||||
if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && gEditorStep == EditorStep::LandscapeEditor)
|
||||
{
|
||||
customStartIndex++;
|
||||
}
|
||||
|
|
|
@ -48,6 +48,8 @@
|
|||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
EditorStep gEditorStep;
|
||||
|
||||
namespace Editor
|
||||
{
|
||||
static std::array<std::vector<uint8_t>, EnumValue(ObjectType::Count)> _editorSelectedObjectFlags;
|
||||
|
@ -90,9 +92,9 @@ namespace Editor
|
|||
object_list_load();
|
||||
OpenRCT2::GetContext()->GetGameState()->InitAll(150);
|
||||
gScreenFlags = SCREEN_FLAGS_SCENARIO_EDITOR;
|
||||
gS6Info.editor_step = EditorStep::ObjectSelection;
|
||||
gEditorStep = EditorStep::ObjectSelection;
|
||||
gParkFlags |= PARK_FLAGS_SHOW_REAL_GUEST_NAMES;
|
||||
gS6Info.category = SCENARIO_CATEGORY_OTHER;
|
||||
gScenarioCategory = SCENARIO_CATEGORY_OTHER;
|
||||
viewport_init_all();
|
||||
rct_window* mainWindow = context_open_window_view(WV_EDITOR_MAIN);
|
||||
mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ());
|
||||
|
@ -136,17 +138,11 @@ namespace Editor
|
|||
}
|
||||
gParkFlags |= PARK_FLAGS_NO_MONEY;
|
||||
|
||||
safe_strcpy(gS6Info.name, gScenarioName.c_str(), sizeof(gS6Info.name));
|
||||
safe_strcpy(gS6Info.details, gScenarioDetails.c_str(), sizeof(gS6Info.details));
|
||||
gS6Info.objective_type = gScenarioObjective.Type;
|
||||
gS6Info.objective_arg_1 = gScenarioObjective.Year;
|
||||
gS6Info.objective_arg_2 = gScenarioObjective.Currency;
|
||||
gS6Info.objective_arg_3 = gScenarioObjective.NumGuests;
|
||||
climate_reset(gClimate);
|
||||
|
||||
gScreenFlags = SCREEN_FLAGS_SCENARIO_EDITOR;
|
||||
gS6Info.editor_step = EditorStep::ObjectiveSelection;
|
||||
gS6Info.category = SCENARIO_CATEGORY_OTHER;
|
||||
gEditorStep = EditorStep::ObjectiveSelection;
|
||||
gScenarioCategory = SCENARIO_CATEGORY_OTHER;
|
||||
viewport_init_all();
|
||||
News::InitQueue();
|
||||
context_open_window_view(WV_EDITOR_MAIN);
|
||||
|
@ -168,7 +164,7 @@ namespace Editor
|
|||
object_list_load();
|
||||
OpenRCT2::GetContext()->GetGameState()->InitAll(150);
|
||||
SetAllLandOwned();
|
||||
gS6Info.editor_step = EditorStep::ObjectSelection;
|
||||
gEditorStep = EditorStep::ObjectSelection;
|
||||
viewport_init_all();
|
||||
rct_window* mainWindow = context_open_window_view(WV_EDITOR_MAIN);
|
||||
mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ());
|
||||
|
@ -189,7 +185,7 @@ namespace Editor
|
|||
object_list_load();
|
||||
OpenRCT2::GetContext()->GetGameState()->InitAll(150);
|
||||
SetAllLandOwned();
|
||||
gS6Info.editor_step = EditorStep::ObjectSelection;
|
||||
gEditorStep = EditorStep::ObjectSelection;
|
||||
viewport_init_all();
|
||||
rct_window* mainWindow = context_open_window_view(WV_EDITOR_MAIN);
|
||||
mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ());
|
||||
|
@ -250,7 +246,7 @@ namespace Editor
|
|||
load_from_sv4(path);
|
||||
ClearMapForEditing(true);
|
||||
|
||||
gS6Info.editor_step = EditorStep::LandscapeEditor;
|
||||
gEditorStep = EditorStep::LandscapeEditor;
|
||||
gScreenAge = 0;
|
||||
gScreenFlags = SCREEN_FLAGS_SCENARIO_EDITOR;
|
||||
viewport_init_all();
|
||||
|
@ -264,7 +260,7 @@ namespace Editor
|
|||
load_from_sc4(path);
|
||||
ClearMapForEditing(false);
|
||||
|
||||
gS6Info.editor_step = EditorStep::LandscapeEditor;
|
||||
gEditorStep = EditorStep::LandscapeEditor;
|
||||
gScreenAge = 0;
|
||||
gScreenFlags = SCREEN_FLAGS_SCENARIO_EDITOR;
|
||||
viewport_init_all();
|
||||
|
@ -293,7 +289,7 @@ namespace Editor
|
|||
|
||||
ClearMapForEditing(loadedFromSave);
|
||||
|
||||
gS6Info.editor_step = EditorStep::LandscapeEditor;
|
||||
gEditorStep = EditorStep::LandscapeEditor;
|
||||
gScreenAge = 0;
|
||||
gScreenFlags = SCREEN_FLAGS_SCENARIO_EDITOR;
|
||||
viewport_init_all();
|
||||
|
@ -314,7 +310,7 @@ namespace Editor
|
|||
importer->Import();
|
||||
|
||||
ClearMapForEditing(true);
|
||||
gS6Info.editor_step = EditorStep::LandscapeEditor;
|
||||
gEditorStep = EditorStep::LandscapeEditor;
|
||||
gScreenAge = 0;
|
||||
gScreenFlags = SCREEN_FLAGS_SCENARIO_EDITOR;
|
||||
viewport_init_all();
|
||||
|
@ -414,7 +410,7 @@ namespace Editor
|
|||
return;
|
||||
}
|
||||
|
||||
switch (gS6Info.editor_step)
|
||||
switch (gEditorStep)
|
||||
{
|
||||
case EditorStep::ObjectSelection:
|
||||
if (window_find_by_class(WC_EDITOR_OBJECT_SELECTION))
|
||||
|
|
|
@ -44,6 +44,8 @@ enum class EditorStep : uint8_t
|
|||
Invalid = 255, // 255
|
||||
};
|
||||
|
||||
extern EditorStep gEditorStep;
|
||||
|
||||
void editor_open_windows_for_current_step();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -458,14 +458,14 @@ void finish_object_selection()
|
|||
{
|
||||
set_every_ride_type_invented();
|
||||
set_every_ride_entry_invented();
|
||||
gS6Info.editor_step = EditorStep::RollercoasterDesigner;
|
||||
gEditorStep = EditorStep::RollercoasterDesigner;
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
else
|
||||
{
|
||||
set_all_scenery_items_invented();
|
||||
scenery_set_default_placement_configuration();
|
||||
gS6Info.editor_step = EditorStep::LandscapeEditor;
|
||||
gEditorStep = EditorStep::LandscapeEditor;
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
}
|
||||
|
|
112108
src/openrct2/ParkFile
112108
src/openrct2/ParkFile
File diff suppressed because it is too large
Load Diff
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "Cheats.h"
|
||||
#include "Context.h"
|
||||
#include "Editor.h"
|
||||
#include "GameState.h"
|
||||
#include "OpenRCT2.h"
|
||||
#include "ParkImporter.h"
|
||||
|
@ -127,8 +128,6 @@ namespace OpenRCT2
|
|||
|
||||
// Initial cash will eventually be removed
|
||||
gInitialCash = gCash;
|
||||
String::Set(gS6Info.name, sizeof(gS6Info.name), gScenarioName.c_str());
|
||||
String::Set(gS6Info.details, sizeof(gS6Info.details), gScenarioName.c_str());
|
||||
}
|
||||
|
||||
void Save(IStream& stream)
|
||||
|
@ -293,7 +292,7 @@ namespace OpenRCT2
|
|||
void ReadWriteScenarioChunk(OrcaStream& os)
|
||||
{
|
||||
os.ReadWriteChunk(ParkFileChunkType::SCENARIO, [](OrcaStream::ChunkStream& cs) {
|
||||
cs.ReadWrite(gS6Info.category);
|
||||
cs.ReadWrite(gScenarioCategory);
|
||||
ReadWriteStringTable(cs, gScenarioName, "en-GB");
|
||||
|
||||
auto& park = GetContext()->GetGameState()->GetPark();
|
||||
|
@ -381,6 +380,8 @@ namespace OpenRCT2
|
|||
cs.ReadWrite(gLandPrice);
|
||||
cs.ReadWrite(gConstructionRightsPrice);
|
||||
cs.ReadWrite(gGrassSceneryTileLoopPosition); // TODO (this needs to be xy32)
|
||||
|
||||
cs.ReadWrite(gEditorStep);
|
||||
});
|
||||
if (!found)
|
||||
{
|
||||
|
|
|
@ -322,6 +322,13 @@ namespace OpenRCT2
|
|||
}
|
||||
}
|
||||
|
||||
void ReadWrite(bool& value)
|
||||
{
|
||||
uint8_t value8 = value ? 1 : 0;
|
||||
ReadWrite(&value8, sizeof(value8));
|
||||
value = value8 != 0;
|
||||
}
|
||||
|
||||
void ReadWrite(CoordsXY& coords)
|
||||
{
|
||||
ReadWrite(coords.x);
|
||||
|
@ -371,11 +378,6 @@ namespace OpenRCT2
|
|||
return v;
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
template<> void ReadWrite(std::string_view& v) = delete;
|
||||
|
||||
template<>
|
||||
#endif
|
||||
void ReadWrite(std::string& v)
|
||||
{
|
||||
if (_mode == Mode::READING)
|
||||
|
@ -409,9 +411,6 @@ namespace OpenRCT2
|
|||
Write(sv);
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
template<>
|
||||
#endif
|
||||
void Write(const std::string_view& v)
|
||||
{
|
||||
if (_mode == Mode::READING)
|
||||
|
@ -425,9 +424,6 @@ namespace OpenRCT2
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
template<>
|
||||
#endif
|
||||
void Write(const std::string& v)
|
||||
{
|
||||
Write(std::string_view(v));
|
||||
|
@ -505,7 +501,7 @@ namespace OpenRCT2
|
|||
|
||||
template<typename T, typename = std::enable_if<std::is_integral<T>::value>> T ReadInteger()
|
||||
{
|
||||
if (sizeof(T) > 4)
|
||||
if constexpr (sizeof(T) > 4)
|
||||
{
|
||||
if (std::is_signed<T>())
|
||||
{
|
||||
|
@ -522,7 +518,7 @@ namespace OpenRCT2
|
|||
}
|
||||
else
|
||||
{
|
||||
if (std::is_signed<T>())
|
||||
if constexpr (std::is_signed<T>())
|
||||
{
|
||||
int32_t raw{};
|
||||
Read(&raw, sizeof(raw));
|
||||
|
@ -547,7 +543,7 @@ namespace OpenRCT2
|
|||
|
||||
template<typename T, typename = std::enable_if<std::is_integral<T>::value>> void WriteInteger(T value)
|
||||
{
|
||||
if (sizeof(T) > 4)
|
||||
if constexpr (sizeof(T) > 4)
|
||||
{
|
||||
if (std::is_signed<T>())
|
||||
{
|
||||
|
|
|
@ -350,7 +350,7 @@ void window_close_top()
|
|||
|
||||
if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
|
||||
{
|
||||
if (gS6Info.editor_step != EditorStep::LandscapeEditor)
|
||||
if (gEditorStep != EditorStep::LandscapeEditor)
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1083,7 +1083,7 @@ void main_window_zoom(bool zoomIn, bool atCursor)
|
|||
{
|
||||
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
|
||||
return;
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gS6Info.editor_step == EditorStep::LandscapeEditor)
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gEditorStep == EditorStep::LandscapeEditor)
|
||||
{
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER))
|
||||
{
|
||||
|
|
|
@ -339,9 +339,9 @@ private:
|
|||
// Do map initialisation, same kind of stuff done when loading scenario editor
|
||||
auto context = OpenRCT2::GetContext();
|
||||
context->GetGameState()->InitAll(mapSize);
|
||||
gS6Info.editor_step = EditorStep::ObjectSelection;
|
||||
gEditorStep = EditorStep::ObjectSelection;
|
||||
gParkFlags |= PARK_FLAGS_SHOW_REAL_GUEST_NAMES;
|
||||
gS6Info.category = SCENARIO_CATEGORY_OTHER;
|
||||
gScenarioCategory = SCENARIO_CATEGORY_OTHER;
|
||||
}
|
||||
|
||||
std::string GetRCT1ScenarioName()
|
||||
|
@ -2323,8 +2323,6 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
String::Set(gS6Info.name, sizeof(gS6Info.name), name.c_str());
|
||||
String::Set(gS6Info.details, sizeof(gS6Info.details), details.c_str());
|
||||
gScenarioName = name;
|
||||
gScenarioDetails = details;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include "../Context.h"
|
||||
#include "../Diagnostic.h"
|
||||
#include "../Editor.h"
|
||||
#include "../Game.h"
|
||||
#include "../GameState.h"
|
||||
#include "../OpenRCT2.h"
|
||||
|
@ -195,21 +196,19 @@ public:
|
|||
{
|
||||
Initialise();
|
||||
|
||||
// _s6.header
|
||||
gS6Info = _s6.info;
|
||||
gEditorStep = _s6.info.editor_step;
|
||||
gScenarioCategory = static_cast<SCENARIO_CATEGORY>(_s6.info.category);
|
||||
|
||||
// Some scenarios have their scenario details in UTF-8, due to earlier bugs in OpenRCT2.
|
||||
if (!IsLikelyUTF8(_s6.info.name) && !IsLikelyUTF8(_s6.info.details))
|
||||
{
|
||||
auto temp = rct2_to_utf8(_s6.info.name, RCT2LanguageId::EnglishUK);
|
||||
safe_strcpy(gS6Info.name, temp.data(), sizeof(gS6Info.name));
|
||||
auto temp2 = rct2_to_utf8(_s6.info.details, RCT2LanguageId::EnglishUK);
|
||||
safe_strcpy(gS6Info.details, temp2.data(), sizeof(gS6Info.details));
|
||||
gScenarioName = rct2_to_utf8(_s6.info.name, RCT2LanguageId::EnglishUK);
|
||||
gScenarioDetails = rct2_to_utf8(_s6.info.details, RCT2LanguageId::EnglishUK);
|
||||
}
|
||||
else
|
||||
{
|
||||
safe_strcpy(gS6Info.name, _s6.info.name, sizeof(gS6Info.name));
|
||||
safe_strcpy(gS6Info.details, _s6.info.details, sizeof(gS6Info.details));
|
||||
gScenarioName = _s6.info.name;
|
||||
gScenarioDetails = _s6.info.details;
|
||||
}
|
||||
|
||||
gDateMonthsElapsed = static_cast<int32_t>(_s6.elapsed_months);
|
||||
|
|
|
@ -1974,7 +1974,7 @@ void Ride::UpdateAll()
|
|||
// Remove all rides if scenario editor
|
||||
if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
|
||||
{
|
||||
switch (gS6Info.editor_step)
|
||||
switch (gEditorStep)
|
||||
{
|
||||
case EditorStep::ObjectSelection:
|
||||
case EditorStep::LandscapeEditor:
|
||||
|
|
|
@ -932,7 +932,7 @@ bool Vehicle::SoundCanPlay() const
|
|||
if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
|
||||
return false;
|
||||
|
||||
if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gS6Info.editor_step != EditorStep::RollercoasterDesigner)
|
||||
if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gEditorStep != EditorStep::RollercoasterDesigner)
|
||||
return false;
|
||||
|
||||
if (sound1_id == OpenRCT2::Audio::SoundId::Null && sound2_id == OpenRCT2::Audio::SoundId::Null)
|
||||
|
@ -1376,7 +1376,7 @@ void vehicle_update_all()
|
|||
if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
|
||||
return;
|
||||
|
||||
if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gS6Info.editor_step != EditorStep::RollercoasterDesigner)
|
||||
if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gEditorStep != EditorStep::RollercoasterDesigner)
|
||||
return;
|
||||
|
||||
for (auto vehicle : TrainManager::View())
|
||||
|
|
|
@ -58,7 +58,7 @@ const rct_string_id ScenarioCategoryStringIds[SCENARIO_CATEGORY_COUNT] = {
|
|||
STR_DLC_PARKS, STR_BUILD_YOUR_OWN_PARKS,
|
||||
};
|
||||
|
||||
rct_s6_info gS6Info;
|
||||
SCENARIO_CATEGORY gScenarioCategory;
|
||||
std::string gScenarioName;
|
||||
std::string gScenarioDetails;
|
||||
std::string gScenarioCompletedBy;
|
||||
|
@ -107,12 +107,9 @@ void scenario_begin()
|
|||
gHistoricalProfit = gInitialCash - gBankLoan;
|
||||
gCash = gInitialCash;
|
||||
|
||||
gScenarioDetails = std::string_view(gS6Info.details, 256);
|
||||
gScenarioName = std::string_view(gS6Info.name, 64);
|
||||
|
||||
{
|
||||
utf8 normalisedName[64];
|
||||
ScenarioSources::NormaliseName(normalisedName, sizeof(normalisedName), gS6Info.name);
|
||||
ScenarioSources::NormaliseName(normalisedName, sizeof(normalisedName), gScenarioName.c_str());
|
||||
|
||||
rct_string_id localisedStringIds[3];
|
||||
if (language_get_localised_scenario_strings(normalisedName, localisedStringIds))
|
||||
|
@ -585,18 +582,6 @@ static bool scenario_prepare_rides_for_save()
|
|||
*/
|
||||
bool scenario_prepare_for_save()
|
||||
{
|
||||
auto& park = GetContext()->GetGameState()->GetPark();
|
||||
auto parkName = park.Name.c_str();
|
||||
|
||||
gS6Info.entry.flags = 255;
|
||||
if (gS6Info.name[0] == 0)
|
||||
String::Set(gS6Info.name, sizeof(gS6Info.name), parkName);
|
||||
|
||||
gS6Info.objective_type = gScenarioObjective.Type;
|
||||
gS6Info.objective_arg_1 = gScenarioObjective.Year;
|
||||
gS6Info.objective_arg_2 = gScenarioObjective.Currency;
|
||||
gS6Info.objective_arg_3 = gScenarioObjective.NumGuests;
|
||||
|
||||
// This can return false if the goal is 'Finish 5 roller coaster' and there are too few.
|
||||
if (!scenario_prepare_rides_for_save())
|
||||
{
|
||||
|
|
|
@ -436,7 +436,7 @@ extern uint16_t gScenarioParkRatingWarningDays;
|
|||
extern money32 gScenarioCompletedCompanyValue;
|
||||
extern money32 gScenarioCompanyValueRecord;
|
||||
|
||||
extern rct_s6_info gS6Info;
|
||||
extern SCENARIO_CATEGORY gScenarioCategory;
|
||||
extern std::string gScenarioName;
|
||||
extern std::string gScenarioDetails;
|
||||
extern std::string gScenarioCompletedBy;
|
||||
|
|
|
@ -227,7 +227,7 @@ namespace OpenRCT2::Scripting
|
|||
}
|
||||
};
|
||||
|
||||
static const DukEnumMap<uint32_t> ParkFlagMap({
|
||||
static const DukEnumMap<uint64_t> ParkFlagMap({
|
||||
{ "open", PARK_FLAGS_PARK_OPEN },
|
||||
{ "scenarioCompleteNameInput", PARK_FLAGS_SCENARIO_COMPLETE_NAME_INPUT },
|
||||
{ "forbidLandscapeChanges", PARK_FLAGS_FORBID_LANDSCAPE_CHANGES },
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "../actions/ParkSetParameterAction.h"
|
||||
#include "../config/Config.h"
|
||||
#include "../core/Memory.hpp"
|
||||
#include "../core/String.hpp"
|
||||
#include "../interface/Colour.h"
|
||||
#include "../interface/Window.h"
|
||||
#include "../localisation/Localisation.h"
|
||||
|
@ -303,8 +304,8 @@ void Park::Initialise()
|
|||
finance_reset_history();
|
||||
award_reset();
|
||||
|
||||
gS6Info.name[0] = '\0';
|
||||
format_string(gS6Info.details, 256, STR_NO_DETAILS_YET, nullptr);
|
||||
gScenarioName = "";
|
||||
gScenarioDetails = String::ToStd(language_get_string(STR_NO_DETAILS_YET));
|
||||
}
|
||||
|
||||
void Park::Update(const Date& date)
|
||||
|
|
Loading…
Reference in New Issue