mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-23 06:44:38 +01:00
Title Sequence editor
This commit is contained in:
@@ -846,6 +846,8 @@ static int cc_open(const char **argv, int argc) {
|
||||
window_options_open();
|
||||
} else if (strcmp(argv[0], "themes") == 0) {
|
||||
window_themes_open();
|
||||
} else if (strcmp(argv[0], "title_sequences") == 0) {
|
||||
window_title_editor_open(0);
|
||||
} else if (invalidTitle) {
|
||||
console_writeline_error("Cannot open this window in the title screen.");
|
||||
} else {
|
||||
@@ -898,7 +900,8 @@ char* console_window_table[] = {
|
||||
"inventions_list",
|
||||
"scenario_options",
|
||||
"options",
|
||||
"themes"
|
||||
"themes",
|
||||
"title_sequences"
|
||||
};
|
||||
|
||||
console_command console_command_table[] = {
|
||||
|
||||
@@ -83,6 +83,7 @@ theme_window_definition gThemeWindowDefinitions[] = {
|
||||
{ WC_STAFF, "staff", 5207, COLOURS_3(1, 4, 4) },
|
||||
{ WC_EDITOR_TRACK_BOTTOM_TOOLBAR, "editor_track_bottom_toolbar", 5247, COLOURS_3(135, 135, 135) },
|
||||
{ WC_EDITOR_SCENARIO_BOTTOM_TOOLBAR, "editor_scenario_bottom_toolbar", 5248, COLOURS_3(150, 150, 141) },
|
||||
{ WC_TITLE_EDITOR, "title_sequences", 5433, COLOURS_3(1, 15, 15) },
|
||||
};
|
||||
|
||||
#define COLOURS_RCT1(c0, c1, c2, c3, c4, c5) { { (c0), (c1), (c2), (c3), (c4), (c5) } }
|
||||
@@ -232,10 +233,10 @@ void theme_rename_preset(int preset, const char *newName)
|
||||
strcat(dest, ".ini");
|
||||
platform_file_move(src, dest);
|
||||
|
||||
strcpy(gConfigThemes.presets[gCurrentTheme].name, newName);
|
||||
strcpy(gConfigThemes.presets[preset].name, newName);
|
||||
|
||||
if (preset == gCurrentTheme) {
|
||||
gConfigInterface.current_theme_preset = gConfigThemes.presets[gCurrentTheme].name;
|
||||
gConfigInterface.current_theme_preset = gConfigThemes.presets[preset].name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
367
src/interface/title_sequences.c
Normal file
367
src/interface/title_sequences.c
Normal file
@@ -0,0 +1,367 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014 Ted John, Peter Hill
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* This file is part of OpenRCT2.
|
||||
*
|
||||
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "../localisation/string_ids.h"
|
||||
#include "window.h"
|
||||
#include "title_sequences.h"
|
||||
#include "../title.h"
|
||||
#include "../util/util.h"
|
||||
|
||||
|
||||
uint16 gCurrentTitleSequence;
|
||||
uint16 gCurrentPreviewTitleSequence;
|
||||
|
||||
title_command TitleScriptMakeCommand(int command, int parameter1, int parameter2)
|
||||
{
|
||||
title_command titleCommand = { (uint8)command, (uint8)parameter1, (uint8)parameter2 };
|
||||
return titleCommand;
|
||||
}
|
||||
|
||||
bool title_sequence_name_exists(const char *name)
|
||||
{
|
||||
for (int i = 0; i < gConfigTitleSequences.num_presets; i++) {
|
||||
if (_stricmp(gConfigTitleSequences.presets[i].name, name) == 0)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool title_sequence_save_exists(int preset, const char *name)
|
||||
{
|
||||
utf8 newName[MAX_PATH];
|
||||
char *extension = (char*)path_get_extension(name);
|
||||
strcpy(newName, name);
|
||||
if (_stricmp(extension, ".sv6") != 0 && _stricmp(extension, ".sc6") != 0)
|
||||
strcat(newName, ".sv6");
|
||||
for (int i = 0; i < gConfigTitleSequences.presets[preset].num_saves; i++) {
|
||||
if (_stricmp(gConfigTitleSequences.presets[preset].saves[i], newName) == 0)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void title_sequence_change_preset(int preset)
|
||||
{
|
||||
if (preset >= 0 && preset < gConfigTitleSequences.num_presets) {
|
||||
switch (preset) {
|
||||
case 0:
|
||||
gConfigInterface.current_title_sequence_preset = "*RCT2";
|
||||
break;
|
||||
case 1:
|
||||
gConfigInterface.current_title_sequence_preset = "*OPENRCT2";
|
||||
break;
|
||||
default:
|
||||
gConfigInterface.current_title_sequence_preset = gConfigTitleSequences.presets[preset].name;
|
||||
break;
|
||||
}
|
||||
gCurrentPreviewTitleSequence = preset;
|
||||
}
|
||||
window_invalidate_all();
|
||||
|
||||
// Switch to (and restart) this title sequence if it's valid
|
||||
title_refresh_sequence();
|
||||
}
|
||||
|
||||
void title_sequence_create_preset(const char *name)
|
||||
{
|
||||
if (filename_valid_characters(name) && !title_sequence_name_exists(name)) {
|
||||
int preset = gConfigTitleSequences.num_presets;
|
||||
gConfigTitleSequences.num_presets++;
|
||||
gConfigTitleSequences.presets = realloc(gConfigTitleSequences.presets, sizeof(title_sequence) * (size_t)gConfigTitleSequences.num_presets);
|
||||
strcpy(gConfigTitleSequences.presets[preset].name, name);
|
||||
gConfigTitleSequences.presets[preset].path[0] = 0;
|
||||
|
||||
gConfigTitleSequences.presets[preset].saves = malloc(0);
|
||||
gConfigTitleSequences.presets[preset].commands = malloc(0);
|
||||
gConfigTitleSequences.presets[preset].num_saves = 0;
|
||||
gConfigTitleSequences.presets[preset].num_commands = 0;
|
||||
|
||||
// Create the folder
|
||||
utf8 path[MAX_PATH];
|
||||
platform_get_user_directory(path, "title sequences");
|
||||
strcat(path, gConfigTitleSequences.presets[preset].name);
|
||||
platform_file_delete(path);
|
||||
platform_ensure_directory_exists(path);
|
||||
|
||||
title_sequence_save_preset_script(preset);
|
||||
title_sequence_change_preset(preset);
|
||||
}
|
||||
}
|
||||
|
||||
void title_sequence_duplicate_preset(int duplicate, const char *name)
|
||||
{
|
||||
if (duplicate >= 0 && duplicate < gConfigTitleSequences.num_presets && filename_valid_characters(name) && !title_sequence_name_exists(name)) {
|
||||
int preset = gConfigTitleSequences.num_presets;
|
||||
gConfigTitleSequences.num_presets++;
|
||||
gConfigTitleSequences.presets = realloc(gConfigTitleSequences.presets, sizeof(title_sequence) * (size_t)gConfigTitleSequences.num_presets);
|
||||
strcpy(gConfigTitleSequences.presets[preset].name, name);
|
||||
gConfigTitleSequences.presets[preset].path[0] = 0;
|
||||
|
||||
size_t savesSize = sizeof(char[TITLE_SEQUENCE_MAX_SAVE_LENGTH]) * gConfigTitleSequences.presets[duplicate].num_saves;
|
||||
size_t commandsSize = sizeof(title_command) * gConfigTitleSequences.presets[duplicate].num_commands;
|
||||
gConfigTitleSequences.presets[preset].saves = malloc(savesSize);
|
||||
gConfigTitleSequences.presets[preset].commands = malloc(commandsSize);
|
||||
memcpy(gConfigTitleSequences.presets[preset].saves, gConfigTitleSequences.presets[duplicate].saves, savesSize);
|
||||
memcpy(gConfigTitleSequences.presets[preset].commands, gConfigTitleSequences.presets[duplicate].commands, commandsSize);
|
||||
gConfigTitleSequences.presets[preset].num_saves = gConfigTitleSequences.presets[duplicate].num_saves;
|
||||
gConfigTitleSequences.presets[preset].num_commands = gConfigTitleSequences.presets[duplicate].num_commands;
|
||||
|
||||
bool loadmm = false;
|
||||
for (int i = 0; i < gConfigTitleSequences.presets[preset].num_commands; i++) {
|
||||
if (gConfigTitleSequences.presets[preset].commands[i].command == TITLE_SCRIPT_LOADMM) {
|
||||
loadmm = true;
|
||||
gConfigTitleSequences.presets[preset].commands[i].command = TITLE_SCRIPT_LOAD;
|
||||
gConfigTitleSequences.presets[preset].commands[i].saveIndex = gConfigTitleSequences.presets[duplicate].num_saves;
|
||||
}
|
||||
}
|
||||
|
||||
// Create the folder
|
||||
utf8 path[MAX_PATH], srcPath[MAX_PATH];
|
||||
platform_get_user_directory(path, "title sequences");
|
||||
strcat(path, gConfigTitleSequences.presets[preset].name);
|
||||
platform_file_delete(path);
|
||||
platform_ensure_directory_exists(path);
|
||||
|
||||
// Copy the saves
|
||||
char separator = platform_get_path_separator();
|
||||
for (int i = 0; i < gConfigTitleSequences.presets[preset].num_saves; i++) {
|
||||
if (gConfigTitleSequences.presets[duplicate].path[0]) {
|
||||
strcpy(srcPath, gConfigTitleSequences.presets[duplicate].path);
|
||||
strcat(srcPath, gConfigTitleSequences.presets[duplicate].saves[i]);
|
||||
}
|
||||
else {
|
||||
platform_get_user_directory(srcPath, "title sequences");
|
||||
strcat(srcPath, gConfigTitleSequences.presets[duplicate].name);
|
||||
strncat(srcPath, &separator, 1);
|
||||
strcat(srcPath, gConfigTitleSequences.presets[duplicate].saves[i]);
|
||||
}
|
||||
platform_get_user_directory(path, "title sequences");
|
||||
strcat(path, gConfigTitleSequences.presets[preset].name);
|
||||
strncat(path, &separator, 1);
|
||||
strcat(path, gConfigTitleSequences.presets[preset].saves[i]);
|
||||
|
||||
platform_file_copy(srcPath, path);
|
||||
}
|
||||
|
||||
if (loadmm) {
|
||||
title_sequence_add_save(preset, get_file_path(PATH_ID_SIXFLAGS_MAGICMOUNTAIN), "Six Flags Magic Mountain.SC6");
|
||||
}
|
||||
|
||||
title_sequence_save_preset_script(preset);
|
||||
//title_sequence_change_preset(preset);
|
||||
gCurrentTitleSequence = preset;
|
||||
}
|
||||
}
|
||||
|
||||
void title_sequence_delete_preset(int preset)
|
||||
{
|
||||
if (preset >= TITLE_SEQUENCE_DEFAULT_PRESETS && preset < gConfigTitleSequences.num_presets) {
|
||||
// Delete the folder
|
||||
utf8 path[MAX_PATH];
|
||||
char separator = platform_get_path_separator();
|
||||
platform_get_user_directory(path, "title sequences");
|
||||
strcat(path, gConfigTitleSequences.presets[preset].name);
|
||||
if (!platform_directory_delete(path)) {
|
||||
log_error("Failed to delete directory: \"%s\"", path);
|
||||
}
|
||||
|
||||
free(gConfigTitleSequences.presets[preset].saves);
|
||||
free(gConfigTitleSequences.presets[preset].commands);
|
||||
|
||||
for (int i = preset; i < gConfigTitleSequences.num_presets - 1; i++) {
|
||||
gConfigTitleSequences.presets[i] = gConfigTitleSequences.presets[i + 1];
|
||||
}
|
||||
gConfigTitleSequences.num_presets--;
|
||||
gConfigTitleSequences.presets = realloc(gConfigTitleSequences.presets, sizeof(title_sequence) * (size_t)gConfigTitleSequences.num_presets);
|
||||
|
||||
gCurrentTitleSequence--;
|
||||
if (gCurrentPreviewTitleSequence > preset)
|
||||
title_sequence_change_preset(gCurrentPreviewTitleSequence - 1);
|
||||
else if (gCurrentPreviewTitleSequence == preset)
|
||||
title_sequence_change_preset(0);
|
||||
}
|
||||
}
|
||||
|
||||
void title_sequence_rename_preset(int preset, const char *newName)
|
||||
{
|
||||
if (preset >= TITLE_SEQUENCE_DEFAULT_PRESETS && preset < gConfigTitleSequences.num_presets && filename_valid_characters(newName) && !title_sequence_name_exists(newName)) {
|
||||
// Rename the folder
|
||||
utf8 src[MAX_PATH], dest[MAX_PATH];
|
||||
platform_get_user_directory(src, "title sequences");
|
||||
platform_get_user_directory(dest, "title sequences");
|
||||
strcat(src, gConfigTitleSequences.presets[preset].name);
|
||||
strcat(dest, newName);
|
||||
platform_file_move(src, dest);
|
||||
|
||||
strcpy(gConfigTitleSequences.presets[preset].name, newName);
|
||||
|
||||
// Rename the config preset name if needed
|
||||
if (preset == gCurrentPreviewTitleSequence) {
|
||||
gConfigInterface.current_title_sequence_preset = gConfigTitleSequences.presets[preset].name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void title_sequence_add_save(int preset, const char *path, const char *newName)
|
||||
{
|
||||
utf8 newPath[MAX_PATH];
|
||||
char *extension = (char*)path_get_extension(newName);
|
||||
strcpy(newPath, newName);
|
||||
if (_stricmp(extension, ".sv6") != 0 && _stricmp(extension, ".sc6") != 0)
|
||||
strcat(newPath, ".sv6");
|
||||
if (preset >= TITLE_SEQUENCE_DEFAULT_PRESETS && preset < gConfigTitleSequences.num_presets && filename_valid_characters(newPath) && !title_sequence_save_exists(preset, newPath) && platform_file_exists(path)) {
|
||||
// Copy the save file
|
||||
char separator = platform_get_path_separator();
|
||||
platform_get_user_directory(newPath, "title sequences");
|
||||
strcat(newPath, gConfigTitleSequences.presets[preset].name);
|
||||
strncat(newPath, &separator, 1);
|
||||
strcat(newPath, newName);
|
||||
// Add the appropriate extension if needed
|
||||
if (_stricmp(extension, ".sv6") != 0 && _stricmp(extension, ".sc6") != 0)
|
||||
strcat(newPath, ".sv6");
|
||||
platform_file_copy(path, newPath);
|
||||
|
||||
gConfigTitleSequences.presets[preset].num_saves++;
|
||||
gConfigTitleSequences.presets[preset].saves = realloc(gConfigTitleSequences.presets[preset].saves, sizeof(char[TITLE_SEQUENCE_MAX_SAVE_LENGTH]) * (size_t)gConfigTitleSequences.presets[preset].num_saves);
|
||||
|
||||
strcpy(gConfigTitleSequences.presets[preset].saves[gConfigTitleSequences.presets[preset].num_saves - 1], newName);
|
||||
// Add the appropriate extension if needed
|
||||
if (_stricmp(extension, ".sv6") != 0 && _stricmp(extension, ".sc6") != 0)
|
||||
strcat(gConfigTitleSequences.presets[preset].saves[gConfigTitleSequences.presets[preset].num_saves - 1], ".sv6");
|
||||
}
|
||||
}
|
||||
|
||||
void title_sequence_remove_save(int preset, int index)
|
||||
{
|
||||
if (preset >= TITLE_SEQUENCE_DEFAULT_PRESETS && preset < gConfigTitleSequences.num_presets && index >= 0 && index < gConfigTitleSequences.presets[preset].num_saves) {
|
||||
// Delete the save file
|
||||
char separator = platform_get_path_separator();
|
||||
utf8 path[MAX_PATH];
|
||||
platform_get_user_directory(path, "title sequences");
|
||||
strcat(path, gConfigTitleSequences.presets[preset].name);
|
||||
strncat(path, &separator, 1);
|
||||
strcat(path, gConfigTitleSequences.presets[preset].saves[index]);
|
||||
platform_file_delete(path);
|
||||
|
||||
// Remove all references to this save in the commands and decrement save indecies
|
||||
for (int i = 0; i < gConfigTitleSequences.presets[preset].num_commands; i++) {
|
||||
if (gConfigTitleSequences.presets[preset].commands[i].command == TITLE_SCRIPT_LOAD) {
|
||||
if (gConfigTitleSequences.presets[preset].commands[i].saveIndex == index)
|
||||
gConfigTitleSequences.presets[preset].commands[i].saveIndex = 0xFF;
|
||||
else if (gConfigTitleSequences.presets[preset].commands[i].saveIndex > index && gConfigTitleSequences.presets[preset].commands[i].saveIndex != 0xFF)
|
||||
gConfigTitleSequences.presets[preset].commands[i].saveIndex--;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = index; i < gConfigTitleSequences.presets[preset].num_saves - 1; i++) {
|
||||
strcpy(gConfigTitleSequences.presets[preset].saves[i], gConfigTitleSequences.presets[preset].saves[i + 1]);
|
||||
}
|
||||
gConfigTitleSequences.presets[preset].num_saves--;
|
||||
gConfigTitleSequences.presets[preset].saves = realloc(gConfigTitleSequences.presets[preset].saves, sizeof(char[TITLE_SEQUENCE_MAX_SAVE_LENGTH]) * (size_t)gConfigTitleSequences.presets[preset].num_saves);
|
||||
title_sequence_save_preset_script(preset);
|
||||
}
|
||||
}
|
||||
|
||||
void title_sequence_rename_save(int preset, int index, const char *newName)
|
||||
{
|
||||
if (preset >= TITLE_SEQUENCE_DEFAULT_PRESETS && preset < gConfigTitleSequences.num_presets && index >= 0 && index < gConfigTitleSequences.presets[preset].num_saves &&
|
||||
filename_valid_characters(newName) && !title_sequence_save_exists(preset, newName)) {
|
||||
|
||||
// Rename the save file
|
||||
char separator = platform_get_path_separator();
|
||||
utf8 src[MAX_PATH], dest[MAX_PATH];
|
||||
platform_get_user_directory(src, "title sequences");
|
||||
platform_get_user_directory(dest, "title sequences");
|
||||
strcat(src, gConfigTitleSequences.presets[preset].name);
|
||||
strcat(dest, gConfigTitleSequences.presets[preset].name);
|
||||
strncat(src, &separator, 1);
|
||||
strncat(dest, &separator, 1);
|
||||
strcat(src, gConfigTitleSequences.presets[preset].saves[index]);
|
||||
strcat(dest, newName);
|
||||
// Add the appropriate extension if needed
|
||||
char *extension = (char*)path_get_extension(newName);
|
||||
if (_stricmp(extension, ".sv6") != 0 && _stricmp(extension, ".sc6") != 0)
|
||||
strcat(dest, ".sv6");
|
||||
platform_file_move(src, dest);
|
||||
|
||||
strcpy(gConfigTitleSequences.presets[preset].saves[index], newName);
|
||||
// Add the appropriate extension if needed
|
||||
if (_stricmp(extension, ".sv6") != 0 && _stricmp(extension, ".sc6") != 0)
|
||||
strcat(gConfigTitleSequences.presets[preset].saves[index], ".sv6");
|
||||
title_sequence_save_preset_script(preset);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void title_sequence_add_command(int preset, title_command command)
|
||||
{
|
||||
if (preset >= TITLE_SEQUENCE_DEFAULT_PRESETS && preset < gConfigTitleSequences.num_presets) {
|
||||
gConfigTitleSequences.presets[preset].commands = realloc(gConfigTitleSequences.presets[preset].commands, sizeof(title_command) * (size_t)(gConfigTitleSequences.presets[preset].num_commands + 1));
|
||||
gConfigTitleSequences.presets[preset].commands[gConfigTitleSequences.presets[preset].num_commands] = command;
|
||||
gConfigTitleSequences.presets[preset].num_commands++;
|
||||
title_sequence_save_preset_script(preset);
|
||||
}
|
||||
}
|
||||
void title_sequence_insert_command(int preset, int index, title_command command)
|
||||
{
|
||||
if (preset >= TITLE_SEQUENCE_DEFAULT_PRESETS && preset < gConfigTitleSequences.num_presets && index >= 0 && index <= gConfigTitleSequences.presets[preset].num_commands) {
|
||||
gConfigTitleSequences.presets[preset].commands = realloc(gConfigTitleSequences.presets[preset].commands, sizeof(title_command) * (size_t)(gConfigTitleSequences.presets[preset].num_commands + 1));
|
||||
for (int i = gConfigTitleSequences.presets[preset].num_commands; i > index; i--) {
|
||||
gConfigTitleSequences.presets[preset].commands[i] = gConfigTitleSequences.presets[preset].commands[i - 1];
|
||||
}
|
||||
gConfigTitleSequences.presets[preset].commands[index] = command;
|
||||
gConfigTitleSequences.presets[preset].num_commands++;
|
||||
title_sequence_save_preset_script(preset);
|
||||
}
|
||||
}
|
||||
|
||||
void title_sequence_delete_command(int preset, int index)
|
||||
{
|
||||
if (preset >= TITLE_SEQUENCE_DEFAULT_PRESETS && preset < gConfigTitleSequences.num_presets && index >= 0 && index < gConfigTitleSequences.presets[preset].num_commands) {
|
||||
for (int i = index; i < gConfigTitleSequences.presets[preset].num_commands - 1; i++) {
|
||||
gConfigTitleSequences.presets[preset].commands[i] = gConfigTitleSequences.presets[preset].commands[i + 1];
|
||||
}
|
||||
gConfigTitleSequences.presets[preset].num_commands--;
|
||||
gConfigTitleSequences.presets[preset].commands = realloc(gConfigTitleSequences.presets[preset].commands, sizeof(title_command) * (size_t)gConfigTitleSequences.presets[preset].num_commands);
|
||||
title_sequence_save_preset_script(preset);
|
||||
}
|
||||
}
|
||||
|
||||
void title_sequence_move_down_command(int preset, int index)
|
||||
{
|
||||
if (preset >= TITLE_SEQUENCE_DEFAULT_PRESETS && preset < gConfigTitleSequences.num_presets && index >= 0 && index + 1 < gConfigTitleSequences.presets[preset].num_commands) {
|
||||
title_command command = gConfigTitleSequences.presets[preset].commands[index];
|
||||
gConfigTitleSequences.presets[preset].commands[index] = gConfigTitleSequences.presets[preset].commands[index + 1];
|
||||
gConfigTitleSequences.presets[preset].commands[index + 1] = command;
|
||||
title_sequence_save_preset_script(preset);
|
||||
}
|
||||
}
|
||||
|
||||
void title_sequence_move_up_command(int preset, int index)
|
||||
{
|
||||
if (preset >= TITLE_SEQUENCE_DEFAULT_PRESETS && preset < gConfigTitleSequences.num_presets && index > 0 && index < gConfigTitleSequences.presets[preset].num_commands) {
|
||||
title_command command = gConfigTitleSequences.presets[preset].commands[index];
|
||||
gConfigTitleSequences.presets[preset].commands[index] = gConfigTitleSequences.presets[preset].commands[index - 1];
|
||||
gConfigTitleSequences.presets[preset].commands[index - 1] = command;
|
||||
title_sequence_save_preset_script(preset);
|
||||
}
|
||||
}
|
||||
68
src/interface/title_sequences.h
Normal file
68
src/interface/title_sequences.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014 Ted John, Peter Hill, Duncan Frost
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* This file is part of OpenRCT2.
|
||||
*
|
||||
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _TITLE_SEQUENCES_H_
|
||||
#define _TITLE_SEQUENCES_H_
|
||||
|
||||
#include "../common.h"
|
||||
#include "window.h"
|
||||
#include "../config.h"
|
||||
#include "../title.h"
|
||||
|
||||
#define TITLE_SEQUENCE_DEFAULT_PRESETS 2
|
||||
|
||||
title_command TitleScriptMakeCommand(int command, int parameter1, int parameter2);
|
||||
|
||||
#define TITLE_WAIT(t) TitleScriptMakeCommand(TITLE_SCRIPT_WAIT, t, 0)
|
||||
#define TITLE_LOADMM() TitleScriptMakeCommand(TITLE_SCRIPT_LOADMM, 0, 0)
|
||||
#define TITLE_LOCATION(x, y) TitleScriptMakeCommand(TITLE_SCRIPT_LOCATION, x, y)
|
||||
#define TITLE_ROTATE(n) TitleScriptMakeCommand(TITLE_SCRIPT_ROTATE, n, 0)
|
||||
#define TITLE_ZOOM(d) TitleScriptMakeCommand(TITLE_SCRIPT_ZOOM, d, 0)
|
||||
#define TITLE_RESTART() TitleScriptMakeCommand(TITLE_SCRIPT_RESTART, 0, 0)
|
||||
#define TITLE_LOAD(i) TitleScriptMakeCommand(TITLE_SCRIPT_LOAD, i, 0)
|
||||
|
||||
// The index of the current title sequence being edited
|
||||
extern uint16 gCurrentTitleSequence;
|
||||
// The index of the current title sequence being shown
|
||||
extern uint16 gCurrentPreviewTitleSequence;
|
||||
|
||||
bool title_sequence_name_exists(const char *name);
|
||||
bool title_sequence_save_exists(int preset, const char *name);
|
||||
|
||||
// Presets
|
||||
void title_sequence_change_preset(int preset);
|
||||
void title_sequence_create_preset(const char *name);
|
||||
void title_sequence_duplicate_preset(int duplicate, const char *name);
|
||||
void title_sequence_delete_preset(int preset);
|
||||
void title_sequence_rename_preset(int preset, const char *newName);
|
||||
|
||||
// Saves
|
||||
void title_sequence_add_save(int preset, const char *path, const char *newName);
|
||||
void title_sequence_remove_save(int preset, int index);
|
||||
void title_sequence_rename_save(int preset, int index, const char *newName);
|
||||
|
||||
// Commands
|
||||
void title_sequence_add_command(int preset, title_command command);
|
||||
void title_sequence_insert_command(int preset, int index, title_command command);
|
||||
void title_sequence_delete_command(int preset, int index);
|
||||
void title_sequence_move_down_command(int preset, int index);
|
||||
void title_sequence_move_up_command(int preset, int index);
|
||||
|
||||
#endif
|
||||
@@ -46,6 +46,7 @@ char gTextBoxInput[512] = { 0 };
|
||||
int gMaxTextBoxInputLength = 0;
|
||||
int gTextBoxFrameNo = 0;
|
||||
bool gUsingWidgetTextBox = 0;
|
||||
bool gLoadSaveTitleSequenceSave = 0;
|
||||
|
||||
// converted from uint16 values at 0x009A41EC - 0x009A4230
|
||||
// these are percentage coordinates of the viewport to center to, if a window is obscuring a location, the next is tried
|
||||
@@ -2486,6 +2487,7 @@ void window_cancel_textbox()
|
||||
gCurrentTextBox.window.classification,
|
||||
gCurrentTextBox.window.number
|
||||
);
|
||||
window_event_textinput_call(w, gCurrentTextBox.widget_index, NULL);
|
||||
gCurrentTextBox.window.classification = 255;
|
||||
gCurrentTextBox.window.number = 0;
|
||||
platform_stop_text_input();
|
||||
|
||||
@@ -414,6 +414,8 @@ enum {
|
||||
WC_THEMES = 119,
|
||||
WC_TILE_INSPECTOR = 120,
|
||||
WC_CHANGELOG = 121,
|
||||
WC_TITLE_EDITOR = 122,
|
||||
WC_TITLE_COMMAND_EDITOR = 123,
|
||||
|
||||
// Only used for colour schemes
|
||||
WC_STAFF = 220,
|
||||
@@ -444,9 +446,11 @@ enum {
|
||||
LOADSAVETYPE_GAME = 0 << 1,
|
||||
LOADSAVETYPE_LANDSCAPE = 1 << 1,
|
||||
LOADSAVETYPE_SCENARIO = 2 << 1,
|
||||
LOADSAVETYPE_TRACK = 3 << 1,
|
||||
LOADSAVETYPE_TRACK = 3 << 1
|
||||
};
|
||||
|
||||
extern bool gLoadSaveTitleSequenceSave;
|
||||
|
||||
|
||||
// rct2: 0x01420078
|
||||
extern rct_window* g_window_list;
|
||||
@@ -580,6 +584,8 @@ void window_publisher_credits_open();
|
||||
void window_track_manage_open();
|
||||
void window_viewport_open();
|
||||
void window_themes_open();
|
||||
void window_title_editor_open(int tab);
|
||||
void window_title_command_editor_open(int command, bool insert);
|
||||
void window_tile_inspector_open();
|
||||
void window_text_input_open(rct_window* call_w, int call_widget, rct_string_id title, rct_string_id description, rct_string_id existing_text, uint32 existing_args, int maxLength);
|
||||
void window_text_input_raw_open(rct_window* call_w, int call_widget, rct_string_id title, rct_string_id description, utf8string existing_text, int maxLength);
|
||||
|
||||
Reference in New Issue
Block a user