Merge pull request #5240 from IntelOrca/refactor/config-cpp-2

Refactor config
This commit is contained in:
Ted John 2017-02-25 01:35:03 +00:00 committed by GitHub
commit af7af61536
133 changed files with 2513 additions and 1597 deletions

View File

@ -244,6 +244,10 @@
D41B741D1C210A7A0080A7B9 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D41B741C1C210A7A0080A7B9 /* libiconv.tbd */; };
D41B74731C2125E50080A7B9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D41B74721C2125E50080A7B9 /* Assets.xcassets */; };
D429FF421E36ABCD009342A6 /* tile_inspector.c in Sources */ = {isa = PBXBuildFile; fileRef = D429FF401E36ABCD009342A6 /* tile_inspector.c */; };
D42E337D1E5C27D600D630AF /* Config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D42E33751E5C27D600D630AF /* Config.cpp */; };
D42E337E1E5C27D600D630AF /* IniReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D42E33781E5C27D600D630AF /* IniReader.cpp */; };
D42E337F1E5C27D600D630AF /* IniWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D42E337A1E5C27D600D630AF /* IniWriter.cpp */; };
D42E33801E5C27D600D630AF /* KeyboardShortcuts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D42E337C1E5C27D600D630AF /* KeyboardShortcuts.cpp */; };
D433A5001E4A861F00D9A6DF /* SawyerChunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D433A4FA1E4A861F00D9A6DF /* SawyerChunk.cpp */; };
D433A5011E4A861F00D9A6DF /* SawyerChunkReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D433A4FC1E4A861F00D9A6DF /* SawyerChunkReader.cpp */; };
D433A5021E4A861F00D9A6DF /* SawyerChunkWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D433A4FE1E4A861F00D9A6DF /* SawyerChunkWriter.cpp */; };
@ -266,7 +270,6 @@
D44271FB1CC81B3200D84D28 /* ScreenshotCommands.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D44270DA1CC81B3200D84D28 /* ScreenshotCommands.cpp */; };
D44271FC1CC81B3200D84D28 /* SpriteCommands.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D44270DB1CC81B3200D84D28 /* SpriteCommands.cpp */; };
D44271FD1CC81B3200D84D28 /* cmdline_sprite.c in Sources */ = {isa = PBXBuildFile; fileRef = D44270DC1CC81B3200D84D28 /* cmdline_sprite.c */; };
D44271FE1CC81B3200D84D28 /* config.c in Sources */ = {isa = PBXBuildFile; fileRef = D44270DE1CC81B3200D84D28 /* config.c */; };
D44271FF1CC81B3200D84D28 /* Console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D44270E11CC81B3200D84D28 /* Console.cpp */; };
D44272001CC81B3200D84D28 /* Diagnostics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D44270E31CC81B3200D84D28 /* Diagnostics.cpp */; };
D44272011CC81B3200D84D28 /* Guard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D44270E71CC81B3200D84D28 /* Guard.cpp */; };
@ -719,6 +722,14 @@
D429FF3F1E36ABB3009342A6 /* tile_inspector.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = tile_inspector.h; sourceTree = "<group>"; };
D429FF401E36ABCD009342A6 /* tile_inspector.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tile_inspector.c; sourceTree = "<group>"; };
D429FF411E36ABCD009342A6 /* tile_inspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tile_inspector.h; sourceTree = "<group>"; };
D42E33751E5C27D600D630AF /* Config.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Config.cpp; sourceTree = "<group>"; };
D42E33761E5C27D600D630AF /* Config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Config.h; sourceTree = "<group>"; };
D42E33771E5C27D600D630AF /* ConfigEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConfigEnum.h; sourceTree = "<group>"; };
D42E33781E5C27D600D630AF /* IniReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IniReader.cpp; sourceTree = "<group>"; };
D42E33791E5C27D600D630AF /* IniReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IniReader.h; sourceTree = "<group>"; };
D42E337A1E5C27D600D630AF /* IniWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IniWriter.cpp; sourceTree = "<group>"; };
D42E337B1E5C27D600D630AF /* IniWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IniWriter.h; sourceTree = "<group>"; };
D42E337C1E5C27D600D630AF /* KeyboardShortcuts.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KeyboardShortcuts.cpp; sourceTree = "<group>"; };
D433A4FA1E4A861F00D9A6DF /* SawyerChunk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SawyerChunk.cpp; path = rct12/SawyerChunk.cpp; sourceTree = "<group>"; };
D433A4FB1E4A861F00D9A6DF /* SawyerChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SawyerChunk.h; path = rct12/SawyerChunk.h; sourceTree = "<group>"; };
D433A4FC1E4A861F00D9A6DF /* SawyerChunkReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SawyerChunkReader.cpp; path = rct12/SawyerChunkReader.cpp; sourceTree = "<group>"; };
@ -761,8 +772,6 @@
D44270DB1CC81B3200D84D28 /* SpriteCommands.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpriteCommands.cpp; sourceTree = "<group>"; usesTabs = 0; };
D44270DC1CC81B3200D84D28 /* cmdline_sprite.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cmdline_sprite.c; sourceTree = "<group>"; };
D44270DD1CC81B3200D84D28 /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = "<group>"; };
D44270DE1CC81B3200D84D28 /* config.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = config.c; sourceTree = "<group>"; };
D44270DF1CC81B3200D84D28 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
D44270E11CC81B3200D84D28 /* Console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Console.cpp; sourceTree = "<group>"; usesTabs = 0; };
D44270E21CC81B3200D84D28 /* Console.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Console.hpp; sourceTree = "<group>"; usesTabs = 0; };
D44270E31CC81B3200D84D28 /* Diagnostics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Diagnostics.cpp; sourceTree = "<group>"; usesTabs = 0; };
@ -1536,6 +1545,7 @@
children = (
D44270CF1CC81B3200D84D28 /* audio */,
D44270D61CC81B3200D84D28 /* cmdline */,
D42E33741E5C27D600D630AF /* config */,
D44270E01CC81B3200D84D28 /* core */,
D44271001CC81B3200D84D28 /* drawing */,
D44271181CC81B3200D84D28 /* interface */,
@ -1559,8 +1569,6 @@
D44270D51CC81B3200D84D28 /* cheats.h */,
D44270DC1CC81B3200D84D28 /* cmdline_sprite.c */,
D44270DD1CC81B3200D84D28 /* common.h */,
D44270DE1CC81B3200D84D28 /* config.c */,
D44270DF1CC81B3200D84D28 /* config.h */,
D44270FE1CC81B3200D84D28 /* diagnostic.c */,
D44270FF1CC81B3200D84D28 /* diagnostic.h */,
D442710E1CC81B3200D84D28 /* editor.c */,
@ -1607,6 +1615,21 @@
path = libxc;
sourceTree = "<group>";
};
D42E33741E5C27D600D630AF /* config */ = {
isa = PBXGroup;
children = (
D42E33751E5C27D600D630AF /* Config.cpp */,
D42E33761E5C27D600D630AF /* Config.h */,
D42E33771E5C27D600D630AF /* ConfigEnum.h */,
D42E33781E5C27D600D630AF /* IniReader.cpp */,
D42E33791E5C27D600D630AF /* IniReader.h */,
D42E337A1E5C27D600D630AF /* IniWriter.cpp */,
D42E337B1E5C27D600D630AF /* IniWriter.h */,
D42E337C1E5C27D600D630AF /* KeyboardShortcuts.cpp */,
);
path = config;
sourceTree = "<group>";
};
D43407BF1D0E14BE00C2B3D4 /* opengl */ = {
isa = PBXGroup;
children = (
@ -2723,6 +2746,7 @@
D44272001CC81B3200D84D28 /* Diagnostics.cpp in Sources */,
D464FEF11D31A6AA00CBABAC /* SmallSceneryObject.cpp in Sources */,
D44272471CC81B3200D84D28 /* ride_ratings.c in Sources */,
D42E337D1E5C27D600D630AF /* Config.cpp in Sources */,
D44272721CC81B3200D84D28 /* new_campaign.c in Sources */,
C686F93A1CDBC3B7009F9BFC /* spiral_slide.c in Sources */,
C686F9421CDBC3B7009F9BFC /* magic_carpet.c in Sources */,
@ -2788,6 +2812,7 @@
D49766831D03B9FE002222CD /* SoftwareDrawingEngine.cpp in Sources */,
C6E96E121E04067A0076A04F /* File.cpp in Sources */,
D464FEF21D31A6AA00CBABAC /* StexObject.cpp in Sources */,
D42E33801E5C27D600D630AF /* KeyboardShortcuts.cpp in Sources */,
C6E96E311E04072F0076A04F /* TitleSequenceManager.cpp in Sources */,
C686F9331CDBC3B7009F9BFC /* maze.c in Sources */,
C686F9241CDBC3B7009F9BFC /* suspended_swinging_coaster.c in Sources */,
@ -2806,12 +2831,14 @@
D44272571CC81B3200D84D28 /* clear_scenery.c in Sources */,
D442727D1CC81B3200D84D28 /* ride_list.c in Sources */,
C686F94E1CDBC3B7009F9BFC /* boat_ride.c in Sources */,
D42E337F1E5C27D600D630AF /* IniWriter.cpp in Sources */,
D44272891CC81B3200D84D28 /* themes.c in Sources */,
C686F9531CDBC3B7009F9BFC /* splash_boats.c in Sources */,
C686F9441CDBC3B7009F9BFC /* pirate_ship.c in Sources */,
652747EC1E41CE1B000F36FD /* SawyerEncoding.cpp in Sources */,
D44272791CC81B3200D84D28 /* publisher_credits.c in Sources */,
C686F91E1CDBC3B7009F9BFC /* reverse_freefall_coaster.c in Sources */,
D42E337E1E5C27D600D630AF /* IniReader.cpp in Sources */,
D442723B1CC81B3200D84D28 /* crash.cpp in Sources */,
C650B21A1CCABBDD00B4D91C /* tables.cpp in Sources */,
D44272291CC81B3200D84D28 /* LanguagePack.cpp in Sources */,
@ -3008,7 +3035,6 @@
C686F9111CDBC3B7009F9BFC /* heartline_twister_coaster.c in Sources */,
C6834A111DFDE8E300CE933A /* interop.c in Sources */,
C686F9231CDBC3B7009F9BFC /* steeplechase.c in Sources */,
D44271FE1CC81B3200D84D28 /* config.c in Sources */,
D44272871CC81B3200D84D28 /* staff_list.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;

View File

@ -35,7 +35,7 @@
extern "C"
{
#include "audio/audio.h"
#include "config.h"
#include "config/Config.h"
#include "editor.h"
#include "game.h"
#include "interface/chat.h"

View File

@ -25,7 +25,7 @@
extern "C"
{
#include "../config.h"
#include "../config/Config.h"
#include "../localisation/localisation.h"
#include "../OpenRCT2.h"
#include "../platform/platform.h"

View File

@ -24,7 +24,7 @@
extern "C"
{
#include "../config.h"
#include "../config/Config.h"
#include "../interface/viewport.h"
#include "../intro.h"
#include "../localisation/language.h"

View File

@ -15,7 +15,7 @@
#pragma endregion
#include "cheats.h"
#include "config.h"
#include "config/Config.h"
#include "game.h"
#include "interface/window.h"
#include "localisation/date.h"

View File

@ -20,7 +20,7 @@
extern "C"
{
#include "../config.h"
#include "../config/Config.h"
#include "../platform/crash.h"
}

File diff suppressed because it is too large Load Diff

View File

@ -1,333 +0,0 @@
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/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.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#ifndef _CONFIG_H_
#define _CONFIG_H_
#include "common.h"
#include "localisation/currency.h"
#include "platform/platform.h"
enum {
CONFIG_FLAG_ALWAYS_SHOW_GRIDLINES = (1 << 0),
CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS = (1 << 1),
CONFIG_FLAG_DISABLE_SMOOTH_LANDSCAPE = (1 << 2),
CONFIG_FLAG_SAVE_PLUGIN_DATA = (1 << 3)
};
enum {
SHORTCUT_CLOSE_TOP_MOST_WINDOW,
SHORTCUT_CLOSE_ALL_FLOATING_WINDOWS,
SHORTCUT_CANCEL_CONSTRUCTION_MODE,
SHORTCUT_PAUSE_GAME,
SHORTCUT_ZOOM_VIEW_OUT,
SHORTCUT_ZOOM_VIEW_IN,
SHORTCUT_ROTATE_VIEW_CLOCKWISE,
SHORTCUT_ROTATE_VIEW_ANTICLOCKWISE,
SHORTCUT_ROTATE_CONSTRUCTION_OBJECT,
SHORTCUT_UNDERGROUND_VIEW_TOGGLE,
SHORTCUT_REMOVE_BASE_LAND_TOGGLE,
SHORTCUT_REMOVE_VERTICAL_LAND_TOGGLE,
SHORTCUT_SEE_THROUGH_RIDES_TOGGLE,
SHORTCUT_SEE_THROUGH_SCENERY_TOGGLE,
SHORTCUT_INVISIBLE_SUPPORTS_TOGGLE,
SHORTCUT_INVISIBLE_PEOPLE_TOGGLE,
SHORTCUT_HEIGHT_MARKS_ON_LAND_TOGGLE,
SHORTCUT_HEIGHT_MARKS_ON_RIDE_TRACKS_TOGGLE,
SHORTCUT_HEIGHT_MARKS_ON_PATHS_TOGGLE,
SHORTCUT_ADJUST_LAND,
SHORTCUT_ADJUST_WATER,
SHORTCUT_BUILD_SCENERY,
SHORTCUT_BUILD_PATHS,
SHORTCUT_BUILD_NEW_RIDE,
SHORTCUT_SHOW_FINANCIAL_INFORMATION,
SHORTCUT_SHOW_RESEARCH_INFORMATION,
SHORTCUT_SHOW_RIDES_LIST,
SHORTCUT_SHOW_PARK_INFORMATION,
SHORTCUT_SHOW_GUEST_LIST,
SHORTCUT_SHOW_STAFF_LIST,
SHORTCUT_SHOW_RECENT_MESSAGES,
SHORTCUT_SHOW_MAP,
SHORTCUT_SCREENSHOT,
// New
SHORTCUT_REDUCE_GAME_SPEED,
SHORTCUT_INCREASE_GAME_SPEED,
SHORTCUT_OPEN_CHEAT_WINDOW,
SHORTCUT_REMOVE_TOP_BOTTOM_TOOLBAR_TOGGLE,
SHORTCUT_SCROLL_MAP_UP,
SHORTCUT_SCROLL_MAP_LEFT,
SHORTCUT_SCROLL_MAP_DOWN,
SHORTCUT_SCROLL_MAP_RIGHT,
SHORTCUT_OPEN_CHAT_WINDOW,
SHORTCUT_QUICK_SAVE_GAME,
SHORTCUT_SHOW_OPTIONS,
SHORTCUT_MUTE_SOUND,
SHORTCUT_WINDOWED_MODE_TOGGLE,
SHORTCUT_SHOW_MULTIPLAYER,
SHORTCUT_PAINT_ORIGINAL_TOGGLE,
SHORTCUT_DEBUG_PAINT_TOGGLE,
SHORTCUT_SEE_THROUGH_PATHS_TOGGLE,
SHORTCUT_COUNT
};
enum {
TEMPERATURE_FORMAT_C,
TEMPERATURE_FORMAT_F
};
enum {
MEASUREMENT_FORMAT_IMPERIAL,
MEASUREMENT_FORMAT_METRIC,
MEASUREMENT_FORMAT_SI
};
enum {
AUTOSAVE_EVERY_MINUTE,
AUTOSAVE_EVERY_5MINUTES,
AUTOSAVE_EVERY_15MINUTES,
AUTOSAVE_EVERY_30MINUTES,
AUTOSAVE_EVERY_HOUR,
AUTOSAVE_NEVER
};
enum {
DATE_FORMAT_DMY,
DATE_FORMAT_MDY,
DATE_FORMAT_YMD,
DATE_FORMAT_YDM
};
enum {
TITLE_SEQUENCE_RCT1,
TITLE_SEQUENCE_RCT1_AA,
TITLE_SEQUENCE_RCT1_AA_LL,
TITLE_SEQUENCE_RCT2,
TITLE_SEQUENCE_OPENRCT2,
TITLE_SEQUENCE_RANDOM
};
enum {
SORT_NAME_ASCENDING,
SORT_NAME_DESCENDING,
SORT_DATE_ASCENDING,
SORT_DATE_DESCENDING,
};
enum {
SCENARIO_SELECT_MODE_DIFFICULTY,
SCENARIO_SELECT_MODE_ORIGIN,
};
enum {
DRAWING_ENGINE_NONE = -1,
DRAWING_ENGINE_SOFTWARE,
DRAWING_ENGINE_SOFTWARE_WITH_HARDWARE_DISPLAY,
DRAWING_ENGINE_OPENGL,
};
typedef struct general_configuration {
uint8 play_intro;
uint8 confirmation_prompt;
uint8 screenshot_format;
utf8string rct1_path;
utf8string rct2_path;
sint8 measurement_format;
sint8 temperature_format;
sint8 currency_format;
sint32 custom_currency_rate;
sint8 custom_currency_affix;
utf8string custom_currency_symbol;
sint8 construction_marker_colour;
sint8 edge_scrolling;
sint8 always_show_gridlines;
sint8 landscape_smoothing;
sint8 show_height_as_units;
sint8 save_plugin_data;
uint8 debugging_tools;
//new
uint8 fullscreen_mode;
sint32 fullscreen_width;
sint32 fullscreen_height;
sint32 window_width;
sint32 window_height;
uint16 language;
uint8 window_snap_proximity;
uint8 autosave_frequency;
uint8 drawing_engine;
uint8 uncap_fps;
uint8 test_unfinished_tracks;
uint8 no_test_crashes;
uint8 date_format;
uint8 auto_staff_placement;
uint8 handymen_mow_default;
uint8 default_inspection_interval;
utf8string last_run_version;
uint8 invert_viewport_drag;
uint8 load_save_sort;
uint8 minimize_fullscreen_focus_loss;
uint8 day_night_cycle;
uint8 enable_light_fx;
uint8 upper_case_banners;
uint8 disable_lightning_effect;
uint8 allow_loading_with_incorrect_checksum;
uint8 steam_overlay_pause;
float window_scale;
uint8 scale_quality;
uint8 use_nn_at_integer_scales;
uint8 show_fps;
uint8 trap_cursor;
uint8 auto_open_shops;
uint8 scenario_select_mode;
uint8 scenario_unlocking_enabled;
uint8 scenario_hide_mega_park;
utf8string last_save_game_directory;
utf8string last_save_landscape_directory;
utf8string last_save_scenario_directory;
utf8string last_save_track_directory;
uint8 window_limit;
uint8 zoom_to_cursor;
uint8 render_weather_effects;
uint8 render_weather_gloom;
} general_configuration;
typedef struct interface_configuration {
uint8 toolbar_show_finances;
uint8 toolbar_show_research;
uint8 toolbar_show_cheats;
uint8 toolbar_show_news;
uint8 select_by_track_type;
uint8 console_small_font;
utf8string current_theme_preset;
utf8string current_title_sequence_preset;
uint32 object_selection_filter_flags;
} interface_configuration;
typedef struct sound_configuration {
uint8 master_volume;
uint8 title_music;
uint8 sound_enabled;
uint8 sound_volume;
uint8 ride_music_enabled;
uint8 ride_music_volume;
uint8 audio_focus;
utf8string device;
} sound_configuration;
typedef struct twitch_configuration {
utf8string channel;
uint8 enable_follower_peep_names;
uint8 enable_follower_peep_tracking;
uint8 enable_chat_peep_names;
uint8 enable_chat_peep_tracking;
uint8 enable_news;
} twitch_configuration;
typedef struct network_configuration {
utf8string player_name;
uint32 default_port;
utf8string default_password;
uint8 stay_connected;
uint8 advertise;
uint8 maxplayers;
utf8string server_name;
utf8string server_description;
utf8string server_greeting;
utf8string master_server_url;
utf8string provider_name;
utf8string provider_email;
utf8string provider_website;
uint8 known_keys_only;
uint8 log_chat;
} network_configuration;
typedef struct notification_configuration {
bool park_award;
bool park_marketing_campaign_finished;
bool park_warnings;
bool park_rating_warnings;
bool ride_broken_down;
bool ride_crashed;
bool ride_warnings;
bool ride_researched;
bool guest_warnings;
bool guest_lost;
bool guest_left_park;
bool guest_queuing_for_ride;
bool guest_on_ride;
bool guest_left_ride;
bool guest_bought_item;
bool guest_used_facility;
bool guest_died;
} notification_configuration;
typedef struct font_configuration {
utf8string file_name;
utf8string font_name;
sint8 x_offset;
sint8 y_offset;
uint8 size_tiny;
uint8 size_small;
uint8 size_medium;
uint8 size_big;
uint8 height_tiny;
uint8 height_small;
uint8 height_medium;
uint8 height_big;
} font_configuration;
// Define structures for any other settings here
typedef struct theme_features {
uint8 rct1_ride_lights;
uint8 rct1_park_lights;
uint8 rct1_scenario_font;
} theme_features;
typedef struct shortcut_entry {
uint8 key;
uint8 modifier;
} shortcut_entry;
extern general_configuration gConfigGeneral;
extern interface_configuration gConfigInterface;
extern sound_configuration gConfigSound;
extern twitch_configuration gConfigTwitch;
extern network_configuration gConfigNetwork;
extern notification_configuration gConfigNotifications;
extern font_configuration gConfigFonts;
extern uint16 gShortcutKeys[SHORTCUT_COUNT];
void config_get_default_path(utf8 *outPath, size_t size);
void config_set_defaults();
void config_release();
bool config_open_default();
bool config_save_default();
uint16 getLanguage();
void config_reset_shortcut_keys();
bool config_shortcut_keys_load();
bool config_shortcut_keys_save();
bool config_find_or_browse_install_directory();
void title_sequences_set_default();
void title_sequences_load_presets();
#endif

View File

@ -0,0 +1,708 @@
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/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.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#include <memory>
#include "../core/Console.hpp"
#include "../core/Exception.hpp"
#include "../core/FileStream.hpp"
#include "../core/Memory.hpp"
#include "../core/Path.hpp"
#include "../core/String.hpp"
#include "../drawing/IDrawingEngine.h"
#include "../interface/window.h"
#include "../network/network.h"
#include "../OpenRCT2.h"
#include "Config.h"
#include "IniReader.hpp"
#include "IniWriter.hpp"
extern "C"
{
#include "../localisation/currency.h"
#include "../localisation/date.h"
#include "../localisation/language.h"
#include "../platform/platform.h"
#include "../scenario/scenario.h"
}
namespace Config
{
#pragma region Enums
static auto Enum_MeasurementFormat = ConfigEnum<sint32>(
{
ConfigEnumEntry<sint32>("IMPERIAL", MEASUREMENT_FORMAT_IMPERIAL),
ConfigEnumEntry<sint32>("METRIC", MEASUREMENT_FORMAT_METRIC),
ConfigEnumEntry<sint32>("SI", MEASUREMENT_FORMAT_SI),
});
static auto Enum_Currency = ConfigEnum<sint32>(
{
ConfigEnumEntry<sint32>("GBP", CURRENCY_POUNDS),
ConfigEnumEntry<sint32>("USD", CURRENCY_DOLLARS),
ConfigEnumEntry<sint32>("FRF", CURRENCY_FRANC),
ConfigEnumEntry<sint32>("DEM", CURRENCY_DEUTSCHMARK),
ConfigEnumEntry<sint32>("JPY", CURRENCY_YEN),
ConfigEnumEntry<sint32>("ESP", CURRENCY_PESETA),
ConfigEnumEntry<sint32>("ITL", CURRENCY_LIRA),
ConfigEnumEntry<sint32>("NLG", CURRENCY_GUILDERS),
ConfigEnumEntry<sint32>("SEK", CURRENCY_KRONA),
ConfigEnumEntry<sint32>("EUR", CURRENCY_EUROS),
ConfigEnumEntry<sint32>("KRW", CURRENCY_WON),
ConfigEnumEntry<sint32>("RUB", CURRENCY_ROUBLE),
ConfigEnumEntry<sint32>("CZK", CURRENCY_CZECH_KORUNA),
ConfigEnumEntry<sint32>("HKD", CURRENCY_HKD),
ConfigEnumEntry<sint32>("TWD", CURRENCY_TWD),
ConfigEnumEntry<sint32>("CNY", CURRENCY_YUAN),
});
static auto Enum_CurrencySymbolAffix = ConfigEnum<sint32>(
{
ConfigEnumEntry<sint32>("PREFIX", CURRENCY_PREFIX),
ConfigEnumEntry<sint32>("SUFFIX", CURRENCY_SUFFIX),
});
static auto Enum_DateFormat = ConfigEnum<sint32>(
{
ConfigEnumEntry<sint32>("DD/MM/YY", DATE_FORMAT_DAY_MONTH_YEAR),
ConfigEnumEntry<sint32>("MM/DD/YY", DATE_FORMAT_MONTH_DAY_YEAR),
ConfigEnumEntry<sint32>("YY/MM/DD", DATE_FORMAT_YEAR_MONTH_DAY),
ConfigEnumEntry<sint32>("YY/DD/MM", DATE_FORMAT_YEAR_DAY_MONTH),
});
static auto Enum_DrawingEngine = ConfigEnum<sint32>(
{
ConfigEnumEntry<sint32>("SOFTWARE", DRAWING_ENGINE_SOFTWARE),
ConfigEnumEntry<sint32>("SOFTWARE_HWD", DRAWING_ENGINE_SOFTWARE_WITH_HARDWARE_DISPLAY),
ConfigEnumEntry<sint32>("OPENGL", DRAWING_ENGINE_OPENGL),
});
static auto Enum_Temperature = ConfigEnum<sint32>(
{
ConfigEnumEntry<sint32>("CELSIUS", TEMPERATURE_FORMAT_C),
ConfigEnumEntry<sint32>("FAHRENHEIT", TEMPERATURE_FORMAT_F),
});
/**
* Config enum wrapping LanguagesDescriptors.
*/
static class LanguageConfigEnum final : public IConfigEnum<sint32>
{
public:
std::string GetName(sint32 value) const override
{
return LanguagesDescriptors[value].locale;
}
sint32 GetValue(const std::string &key, sint32 defaultValue) const override
{
sint32 i = 0;
for (const auto &langDesc : LanguagesDescriptors)
{
if (String::Equals(key.c_str(), langDesc.locale))
{
return i;
}
i++;
}
return defaultValue;
}
} Enum_LanguageEnum;
#pragma endregion
static void ReadGeneral(IIniReader * reader)
{
if (reader->ReadSection("general"))
{
auto model = &gConfigGeneral;
model->always_show_gridlines = reader->GetBoolean("always_show_gridlines", false);
model->autosave_frequency = reader->GetSint32("autosave", AUTOSAVE_EVERY_5MINUTES);
model->confirmation_prompt = reader->GetBoolean("confirmation_prompt", false);
model->construction_marker_colour = reader->GetBoolean("construction_marker_colour", false);
model->currency_format = reader->GetEnum<sint32>("currency_format", CURRENCY_POUNDS, Enum_Currency);
model->custom_currency_rate = reader->GetSint32("custom_currency_rate", 10);
model->custom_currency_affix = reader->GetEnum<sint32>("custom_currency_affix", CURRENCY_SUFFIX, Enum_CurrencySymbolAffix);
model->custom_currency_symbol = reader->GetCString("custom_currency_symbol", "Ctm");
model->edge_scrolling = reader->GetBoolean("edge_scrolling", true);
model->fullscreen_mode = reader->GetSint32("fullscreen_mode", 0);
model->fullscreen_height = reader->GetSint32("fullscreen_height", -1);
model->fullscreen_width = reader->GetSint32("fullscreen_width", -1);
model->rct1_path = reader->GetCString("rct1_path", nullptr);
model->rct2_path = reader->GetCString("game_path", nullptr);
model->landscape_smoothing = reader->GetBoolean("landscape_smoothing", true);
model->language = reader->GetEnum<sint32>("language", LANGUAGE_ENGLISH_UK, Enum_LanguageEnum);
model->measurement_format = reader->GetEnum<sint32>("measurement_format", MEASUREMENT_FORMAT_METRIC, Enum_MeasurementFormat);
model->play_intro = reader->GetBoolean("play_intro", false);
model->save_plugin_data = reader->GetBoolean("save_plugin_data", true);
model->debugging_tools = reader->GetBoolean("debugging_tools", false);
model->show_height_as_units = reader->GetBoolean("show_height_as_units", false);
model->temperature_format = reader->GetEnum<sint32>("temperature_format", TEMPERATURE_FORMAT_C, Enum_Temperature);
model->window_height = reader->GetSint32("window_height", -1);
model->window_snap_proximity = reader->GetSint32("window_snap_proximity", 5);
model->window_width = reader->GetSint32("window_width", -1);
model->drawing_engine = reader->GetEnum<sint32>("drawing_engine", DRAWING_ENGINE_SOFTWARE, Enum_DrawingEngine);
model->uncap_fps = reader->GetBoolean("uncap_fps", false);
// Default config setting is false until ghost trains are implemented #4540
model->test_unfinished_tracks = reader->GetBoolean("test_unfinished_tracks", false);
model->no_test_crashes = reader->GetBoolean("no_test_crashes", false);
model->date_format = reader->GetEnum<sint32>("date_format", DATE_FORMAT_DAY_MONTH_YEAR, Enum_DateFormat);
model->auto_staff_placement = reader->GetBoolean("auto_staff", true);
model->handymen_mow_default = reader->GetBoolean("handymen_mow_default", false);
model->default_inspection_interval = reader->GetSint32("default_inspection_interval", 2);
model->last_run_version = reader->GetCString("last_run_version", nullptr);
model->invert_viewport_drag = reader->GetBoolean("invert_viewport_drag", false);
model->load_save_sort = reader->GetSint32("load_save_sort", SORT_NAME_ASCENDING);
model->minimize_fullscreen_focus_loss = reader->GetBoolean("minimize_fullscreen_focus_loss", true);
//Default config setting is false until the games canvas can be seperated from the effect
model->day_night_cycle = reader->GetBoolean("day_night_cycle", false);
model->enable_light_fx = reader->GetBoolean("enable_light_fx", false);
model->upper_case_banners = reader->GetBoolean("upper_case_banners", false);
model->disable_lightning_effect = reader->GetBoolean("disable_lightning_effect", false);
model->allow_loading_with_incorrect_checksum = reader->GetBoolean("allow_loading_with_incorrect_checksum", true);
model->steam_overlay_pause = reader->GetBoolean("steam_overlay_pause", true);
model->window_scale = reader->GetFloat("window_scale", 1.0f);
model->scale_quality = reader->GetSint32("scale_quality", 1);
model->use_nn_at_integer_scales = reader->GetBoolean("use_nn_at_integer_scales", true);
model->show_fps = reader->GetBoolean("show_fps", false);
model->trap_cursor = reader->GetBoolean("trap_cursor", false);
model->auto_open_shops = reader->GetBoolean("auto_open_shops", false);
model->scenario_select_mode = reader->GetSint32("scenario_select_mode", SCENARIO_SELECT_MODE_ORIGIN);
model->scenario_unlocking_enabled = reader->GetBoolean("scenario_unlocking_enabled", true);
model->scenario_hide_mega_park = reader->GetBoolean("scenario_hide_mega_park", true);
model->last_save_game_directory = reader->GetCString("last_game_directory", nullptr);
model->last_save_landscape_directory = reader->GetCString("last_landscape_directory", nullptr);
model->last_save_scenario_directory = reader->GetCString("last_scenario_directory", nullptr);
model->last_save_track_directory = reader->GetCString("last_track_directory", nullptr);
model->window_limit = reader->GetSint32("window_limit", WINDOW_LIMIT_MAX);
model->zoom_to_cursor = reader->GetBoolean("zoom_to_cursor", true);
model->render_weather_effects = reader->GetBoolean("render_weather_effects", true);
model->render_weather_gloom = reader->GetBoolean("render_weather_gloom", true);
}
}
static void WriteGeneral(IIniWriter * writer)
{
auto model = &gConfigGeneral;
writer->WriteSection("general");
writer->WriteBoolean("always_show_gridlines", model->always_show_gridlines);
writer->WriteSint32("autosave", model->autosave_frequency);
writer->WriteBoolean("confirmation_prompt", model->confirmation_prompt);
writer->WriteBoolean("construction_marker_colour", model->construction_marker_colour);
writer->WriteEnum<sint32>("currency_format", model->currency_format, Enum_Currency);
writer->WriteSint32("custom_currency_rate", model->custom_currency_rate);
writer->WriteEnum<sint32>("custom_currency_affix", model->custom_currency_affix, Enum_CurrencySymbolAffix);
writer->WriteString("custom_currency_symbol", model->custom_currency_symbol);
writer->WriteBoolean("edge_scrolling", model->edge_scrolling);
writer->WriteSint32("fullscreen_mode", model->fullscreen_mode);
writer->WriteSint32("fullscreen_height", model->fullscreen_height);
writer->WriteSint32("fullscreen_width", model->fullscreen_width);
writer->WriteString("rct1_path", model->rct1_path);
writer->WriteString("game_path", model->rct2_path);
writer->WriteBoolean("landscape_smoothing", model->landscape_smoothing);
writer->WriteEnum<sint32>("language", model->language, Enum_LanguageEnum);
writer->WriteEnum<sint32>("measurement_format", model->measurement_format, Enum_MeasurementFormat);
writer->WriteBoolean("play_intro", model->play_intro);
writer->WriteBoolean("save_plugin_data", model->save_plugin_data);
writer->WriteBoolean("debugging_tools", model->debugging_tools);
writer->WriteBoolean("show_height_as_units", model->show_height_as_units);
writer->WriteEnum<sint32>("temperature_format", model->temperature_format, Enum_Temperature);
writer->WriteSint32("window_height", model->window_height);
writer->WriteSint32("window_snap_proximity", model->window_snap_proximity);
writer->WriteSint32("window_width", model->window_width);
writer->WriteEnum<sint32>("drawing_engine", model->drawing_engine, Enum_DrawingEngine);
writer->WriteBoolean("uncap_fps", model->uncap_fps);
writer->WriteBoolean("test_unfinished_tracks", model->test_unfinished_tracks);
writer->WriteBoolean("no_test_crashes", model->no_test_crashes);
writer->WriteEnum<sint32>("date_format", model->date_format, Enum_DateFormat);
writer->WriteBoolean("auto_staff", model->auto_staff_placement);
writer->WriteBoolean("handymen_mow_default", model->handymen_mow_default);
writer->WriteSint32("default_inspection_interval", model->default_inspection_interval);
writer->WriteString("last_run_version", model->last_run_version);
writer->WriteBoolean("invert_viewport_drag", model->invert_viewport_drag);
writer->WriteSint32("load_save_sort", model->load_save_sort);
writer->WriteBoolean("minimize_fullscreen_focus_loss", model->minimize_fullscreen_focus_loss);
writer->WriteBoolean("day_night_cycle", model->day_night_cycle);
writer->WriteBoolean("enable_light_fx", model->enable_light_fx);
writer->WriteBoolean("upper_case_banners", model->upper_case_banners);
writer->WriteBoolean("disable_lightning_effect", model->disable_lightning_effect);
writer->WriteBoolean("allow_loading_with_incorrect_checksum", model->allow_loading_with_incorrect_checksum);
writer->WriteBoolean("steam_overlay_pause", model->steam_overlay_pause);
writer->WriteFloat("window_scale", model->window_scale);
writer->WriteSint32("scale_quality", model->scale_quality);
writer->WriteBoolean("use_nn_at_integer_scales", model->use_nn_at_integer_scales);
writer->WriteBoolean("show_fps", model->show_fps);
writer->WriteBoolean("trap_cursor", model->trap_cursor);
writer->WriteBoolean("auto_open_shops", model->auto_open_shops);
writer->WriteSint32("scenario_select_mode", model->scenario_select_mode);
writer->WriteBoolean("scenario_unlocking_enabled", model->scenario_unlocking_enabled);
writer->WriteBoolean("scenario_hide_mega_park", model->scenario_hide_mega_park);
writer->WriteString("last_game_directory", model->last_save_game_directory);
writer->WriteString("last_landscape_directory", model->last_save_landscape_directory);
writer->WriteString("last_scenario_directory", model->last_save_scenario_directory);
writer->WriteString("last_track_directory", model->last_save_track_directory);
writer->WriteSint32("window_limit", model->window_limit);
writer->WriteBoolean("zoom_to_cursor", model->zoom_to_cursor);
writer->WriteBoolean("render_weather_effects", model->render_weather_effects);
writer->WriteBoolean("render_weather_gloom", model->render_weather_gloom);
}
static void ReadInterface(IIniReader * reader)
{
if (reader->ReadSection("interface"))
{
auto model = &gConfigInterface;
model->toolbar_show_finances = reader->GetBoolean("toolbar_show_finances", true);
model->toolbar_show_research = reader->GetBoolean("toolbar_show_research", true);
model->toolbar_show_cheats = reader->GetBoolean("toolbar_show_cheats", false);
model->toolbar_show_news = reader->GetBoolean("toolbar_show_news", false);
model->select_by_track_type = reader->GetBoolean("select_by_track_type", false);
model->console_small_font = reader->GetBoolean("console_small_font", false);
model->current_theme_preset = reader->GetCString("current_theme", "*RCT2");
model->current_title_sequence_preset = reader->GetCString("current_title_sequence", "*OPENRCT2");
model->object_selection_filter_flags = reader->GetSint32("object_selection_filter_flags", 0x7EF);
}
}
static void WriteInterface(IIniWriter * writer)
{
auto model = &gConfigInterface;
writer->WriteSection("interface");
writer->WriteBoolean("toolbar_show_finances", model->toolbar_show_finances);
writer->WriteBoolean("toolbar_show_research", model->toolbar_show_research);
writer->WriteBoolean("toolbar_show_cheats", model->toolbar_show_cheats);
writer->WriteBoolean("toolbar_show_news", model->toolbar_show_news);
writer->WriteBoolean("select_by_track_type", model->select_by_track_type);
writer->WriteBoolean("console_small_font", model->console_small_font);
writer->WriteString("current_theme", model->current_theme_preset);
writer->WriteString("current_title_sequence", model->current_title_sequence_preset);
writer->WriteSint32("object_selection_filter_flags", model->object_selection_filter_flags);
}
static void ReadSound(IIniReader * reader)
{
if (reader->ReadSection("sound"))
{
auto model = &gConfigSound;
model->master_volume = reader->GetSint32("master_volume", 100);
model->title_music = reader->GetSint32("title_music", 2);
model->sound_enabled = reader->GetBoolean("sound", true);
model->sound_volume = reader->GetSint32("sound_volume", 100);
model->ride_music_enabled = reader->GetBoolean("ride_music", true);
model->ride_music_volume = reader->GetSint32("ride_music_volume", 100);
model->audio_focus = reader->GetBoolean("audio_focus", false);
model->device = reader->GetCString("audio_device", nullptr);
}
}
static void WriteSound(IIniWriter * writer)
{
auto model = &gConfigSound;
writer->WriteSection("sound");
writer->WriteSint32("master_volume", model->master_volume);
writer->WriteSint32("title_music", model->title_music);
writer->WriteBoolean("sound", model->sound_enabled);
writer->WriteSint32("sound_volume", model->sound_volume);
writer->WriteBoolean("ride_music", model->ride_music_enabled);
writer->WriteSint32("ride_music_volume", model->ride_music_volume);
writer->WriteBoolean("audio_focus", model->audio_focus);
writer->WriteString("audio_device", model->device);
}
static void ReadNetwork(IIniReader * reader)
{
if (reader->ReadSection("network"))
{
auto model = &gConfigNetwork;
model->player_name = reader->GetCString("player_name", "Player");
model->default_port = reader->GetSint32("default_port", NETWORK_DEFAULT_PORT);
model->default_password = reader->GetCString("default_password", nullptr);
model->stay_connected = reader->GetBoolean("stay_connected", true);
model->advertise = reader->GetBoolean("advertise", true);
model->maxplayers = reader->GetSint32("maxplayers", 16);
model->server_name = reader->GetCString("server_name", "Server");
model->server_description = reader->GetCString("server_description", nullptr);
model->server_greeting = reader->GetCString("server_greeting", nullptr);
model->master_server_url = reader->GetCString("master_server_url", nullptr);
model->provider_name = reader->GetCString("provider_name", nullptr);
model->provider_email = reader->GetCString("provider_email", nullptr);
model->provider_website = reader->GetCString("provider_website", nullptr);
model->known_keys_only = reader->GetBoolean("known_keys_only", false);
model->log_chat = reader->GetBoolean("log_chat", false);
}
}
static void WriteNetwork(IIniWriter * writer)
{
auto model = &gConfigNetwork;
writer->WriteSection("network");
writer->WriteString("player_name", model->player_name);
writer->WriteSint32("default_port", model->default_port);
writer->WriteString("default_password", model->default_password);
writer->WriteBoolean("stay_connected", model->stay_connected);
writer->WriteBoolean("advertise", model->advertise);
writer->WriteSint32("maxplayers", model->maxplayers);
writer->WriteString("server_name", model->server_name);
writer->WriteString("server_description", model->server_description);
writer->WriteString("server_greeting", model->server_greeting);
writer->WriteString("master_server_url", model->master_server_url);
writer->WriteString("provider_name", model->provider_name);
writer->WriteString("provider_email", model->provider_email);
writer->WriteString("provider_website", model->provider_website);
writer->WriteBoolean("known_keys_only", model->known_keys_only);
writer->WriteBoolean("log_chat", model->log_chat);
}
static void ReadNotifications(IIniReader * reader)
{
if (reader->ReadSection("notifications"))
{
auto model = &gConfigNotifications;
model->park_award = reader->GetBoolean("park_award", true);
model->park_marketing_campaign_finished = reader->GetBoolean("park_marketing_campaign_finished", true);
model->park_warnings = reader->GetBoolean("park_warnings", true);
model->park_rating_warnings = reader->GetBoolean("park_rating_warnings", true);
model->ride_broken_down = reader->GetBoolean("ride_broken_down", true);
model->ride_crashed = reader->GetBoolean("ride_crashed", true);
model->ride_warnings = reader->GetBoolean("ride_warnings", true);
model->ride_researched = reader->GetBoolean("ride_researched", true);
model->guest_warnings = reader->GetBoolean("guest_warnings", true);
model->guest_lost = reader->GetBoolean("guest_lost", false);
model->guest_left_park = reader->GetBoolean("guest_entered_left_park", true);
model->guest_queuing_for_ride = reader->GetBoolean("guest_queuing_for_ride", true);
model->guest_on_ride = reader->GetBoolean("guest_on_ride", true);
model->guest_left_ride = reader->GetBoolean("guest_left_ride", true);
model->guest_bought_item = reader->GetBoolean("guest_bought_item", true);
model->guest_used_facility = reader->GetBoolean("guest_used_facility", true);
model->guest_died = reader->GetBoolean("guest_died", true);
}
}
static void WriteNotifications(IIniWriter * writer)
{
auto model = &gConfigNotifications;
writer->WriteSection("notifications");
writer->WriteBoolean("park_award", model->park_award);
writer->WriteBoolean("park_marketing_campaign_finished", model->park_marketing_campaign_finished);
writer->WriteBoolean("park_warnings", model->park_warnings);
writer->WriteBoolean("park_rating_warnings", model->park_rating_warnings);
writer->WriteBoolean("ride_broken_down", model->ride_broken_down);
writer->WriteBoolean("ride_crashed", model->ride_crashed);
writer->WriteBoolean("ride_warnings", model->ride_warnings);
writer->WriteBoolean("ride_researched", model->ride_researched);
writer->WriteBoolean("guest_warnings", model->guest_warnings);
writer->WriteBoolean("guest_lost", model->guest_lost);
writer->WriteBoolean("guest_left_park", model->guest_left_park);
writer->WriteBoolean("guest_queuing_for_ride", model->guest_queuing_for_ride);
writer->WriteBoolean("guest_on_ride", model->guest_on_ride);
writer->WriteBoolean("guest_left_ride", model->guest_left_ride);
writer->WriteBoolean("guest_bought_item", model->guest_bought_item);
writer->WriteBoolean("guest_used_facility", model->guest_used_facility);
writer->WriteBoolean("guest_died", model->guest_died);
}
static void ReadTwitch(IIniReader * reader)
{
if (reader->ReadSection("sound"))
{
auto model = &gConfigTwitch;
model->channel = reader->GetCString("channel", nullptr);
model->enable_follower_peep_names = reader->GetBoolean("follower_peep_names", true);
model->enable_follower_peep_tracking = reader->GetBoolean("follower_peep_tracking", false);
model->enable_chat_peep_names = reader->GetBoolean("chat_peep_names", true);
model->enable_chat_peep_tracking = reader->GetBoolean("chat_peep_tracking", true);
model->enable_news = reader->GetBoolean("news", false);
}
}
static void WriteTwitch(IIniWriter * writer)
{
auto model = &gConfigTwitch;
writer->WriteSection("twitch");
writer->WriteString("channel", model->channel);
writer->WriteBoolean("follower_peep_names", model->enable_follower_peep_names);
writer->WriteBoolean("follower_peep_tracking", model->enable_follower_peep_tracking);
writer->WriteBoolean("chat_peep_names", model->enable_chat_peep_names);
writer->WriteBoolean("chat_peep_tracking", model->enable_chat_peep_tracking);
writer->WriteBoolean("news", model->enable_news);
}
static void ReadFont(IIniReader * reader)
{
if (reader->ReadSection("font"))
{
auto model = &gConfigFonts;
model->file_name = reader->GetCString("file_name", nullptr);
model->font_name = reader->GetCString("font_name", nullptr);
model->x_offset = reader->GetSint32("x_offset", false);
model->y_offset = reader->GetSint32("y_offset", true);
model->size_tiny = reader->GetSint32("size_tiny", true);
model->size_small = reader->GetSint32("size_small", false);
model->size_medium = reader->GetSint32("size_medium", false);
model->size_big = reader->GetSint32("size_big", false);
model->height_tiny = reader->GetSint32("height_tiny", false);
model->height_small = reader->GetSint32("height_small", false);
model->height_medium = reader->GetSint32("height_medium", false);
model->height_big = reader->GetSint32("height_big", false);
}
}
static void WriteFont(IIniWriter * writer)
{
auto model = &gConfigFonts;
writer->WriteSection("font");
writer->WriteString("file_name", model->file_name);
writer->WriteString("font_name", model->font_name);
writer->WriteSint32("x_offset", model->x_offset);
writer->WriteSint32("y_offset", model->y_offset);
writer->WriteSint32("size_tiny", model->size_tiny);
writer->WriteSint32("size_small", model->size_small);
writer->WriteSint32("size_medium", model->size_medium);
writer->WriteSint32("size_big", model->size_big);
writer->WriteSint32("height_tiny", model->height_tiny);
writer->WriteSint32("height_small", model->height_small);
writer->WriteSint32("height_medium", model->height_medium);
writer->WriteSint32("height_big", model->height_big);
}
static bool SetDefaults()
{
try
{
auto reader = std::unique_ptr<IIniReader>(CreateDefaultIniReader());
ReadGeneral(reader.get());
ReadInterface(reader.get());
ReadSound(reader.get());
ReadNetwork(reader.get());
ReadNotifications(reader.get());
ReadTwitch(reader.get());
ReadFont(reader.get());
return true;
}
catch (const Exception &)
{
return false;
}
}
static bool ReadFile(const std::string &path)
{
try
{
auto fs = FileStream(path, FILE_MODE_OPEN);
auto reader = std::unique_ptr<IIniReader>(CreateIniReader(&fs));
ReadGeneral(reader.get());
ReadInterface(reader.get());
ReadSound(reader.get());
ReadNetwork(reader.get());
ReadNotifications(reader.get());
ReadTwitch(reader.get());
ReadFont(reader.get());
return true;
}
catch (const Exception &)
{
return false;
}
}
static bool WriteFile(const std::string &path)
{
try
{
auto fs = FileStream(path, FILE_MODE_WRITE);
auto writer = std::unique_ptr<IIniWriter>(CreateIniWriter(&fs));
WriteGeneral(writer.get());
WriteInterface(writer.get());
WriteSound(writer.get());
WriteNetwork(writer.get());
WriteNotifications(writer.get());
WriteTwitch(writer.get());
WriteFont(writer.get());
return true;
}
catch (const Exception &ex)
{
Console::WriteLine("Error saving to '%s'", path.c_str());
Console::WriteLine(ex.GetMessage());
return false;
}
}
/**
* Attempts to find the RCT2 installation directory.
* This should be created from some other resource when OpenRCT2 grows.
* @param resultPath Pointer to where the absolute path of the RCT2 installation directory will be copied to.
* @returns 1 if successful, otherwise 0.
*/
static std::string FindRCT2Path()
{
log_verbose("config_find_rct2_path(...)");
static const utf8 * searchLocations[] =
{
"C:\\GOG Games\\RollerCoaster Tycoon 2 Triple Thrill Pack",
"C:\\Program Files\\Atari\\RollerCoaster Tycoon 2",
"C:\\Program Files\\GalaxyClient\\Games\\RollerCoaster Tycoon 2 Triple Thrill Pack",
"C:\\Program Files\\Infogrames\\RollerCoaster Tycoon 2",
"C:\\Program Files\\Infogrames Interactive\\RollerCoaster Tycoon 2",
"C:\\Program Files\\Steam\\steamapps\\common\\Rollercoaster Tycoon 2",
"C:\\Program Files (x86)\\Atari\\RollerCoaster Tycoon 2",
"C:\\Program Files (x86)\\GalaxyClient\\Games\\RollerCoaster Tycoon 2 Triple Thrill Pack",
"C:\\Program Files (x86)\\Infogrames\\RollerCoaster Tycoon 2",
"C:\\Program Files (x86)\\Infogrames Interactive\\RollerCoaster Tycoon 2",
"C:\\Program Files (x86)\\Steam\\steamapps\\common\\Rollercoaster Tycoon 2"
};
for (const utf8 * location : searchLocations)
{
if (platform_original_game_data_exists(location))
{
return location;
}
}
if (platform_original_game_data_exists(gExePath))
{
return gExePath;
}
return std::string();
}
}
extern "C"
{
GeneralConfiguration gConfigGeneral;
InterfaceConfiguration gConfigInterface;
SoundConfiguration gConfigSound;
TwitchConfiguration gConfigTwitch;
NetworkConfiguration gConfigNetwork;
NotificationConfiguration gConfigNotifications;
FontConfiguration gConfigFonts;
void config_set_defaults()
{
Config::SetDefaults();
}
bool config_open(const utf8 * path)
{
return Config::ReadFile(path);
}
bool config_save(const utf8 * path)
{
return Config::WriteFile(path);
}
void config_release()
{
SafeFree(gConfigGeneral.rct1_path);
SafeFree(gConfigGeneral.rct2_path);
SafeFree(gConfigGeneral.custom_currency_symbol);
SafeFree(gConfigGeneral.last_save_game_directory);
SafeFree(gConfigGeneral.last_save_landscape_directory);
SafeFree(gConfigGeneral.last_save_scenario_directory);
SafeFree(gConfigGeneral.last_save_track_directory);
SafeFree(gConfigGeneral.last_run_version);
SafeFree(gConfigInterface.current_theme_preset);
SafeFree(gConfigInterface.current_title_sequence_preset);
SafeFree(gConfigSound.device);
SafeFree(gConfigTwitch.channel);
SafeFree(gConfigNetwork.player_name);
SafeFree(gConfigNetwork.default_password);
SafeFree(gConfigNetwork.server_name);
SafeFree(gConfigNetwork.server_description);
SafeFree(gConfigNetwork.server_greeting);
SafeFree(gConfigNetwork.master_server_url);
SafeFree(gConfigNetwork.provider_name);
SafeFree(gConfigNetwork.provider_email);
SafeFree(gConfigNetwork.provider_website);
SafeFree(gConfigFonts.file_name);
SafeFree(gConfigFonts.font_name);
}
void config_get_default_path(utf8 * outPath, size_t size)
{
platform_get_user_directory(outPath, nullptr, size);
Path::Append(outPath, size, "config.ini");
}
bool config_open_default()
{
utf8 path[MAX_PATH];
config_get_default_path(path, sizeof(path));
if (config_open(path))
{
currency_load_custom_currency_config();
return true;
}
return false;
}
bool config_save_default()
{
utf8 path[MAX_PATH];
config_get_default_path(path, sizeof(path));
if (config_save(path))
{
return true;
}
return false;
}
bool config_find_or_browse_install_directory()
{
std::string path = Config::FindRCT2Path();
if (!path.empty())
{
Memory::Free(gConfigGeneral.rct2_path);
gConfigGeneral.rct2_path = String::Duplicate(path.c_str());
}
else
{
if (gOpenRCT2Headless)
{
return false;
}
while (1)
{
platform_show_messagebox("OpenRCT2 needs files from the original RollerCoaster Tycoon 2 in order to work. Please select the directory where you installed RollerCoaster Tycoon 2.");
utf8 * installPath = platform_open_directory_browser("Please select your RCT2 directory");
if (installPath == nullptr)
{
return false;
}
Memory::Free(gConfigGeneral.rct2_path);
gConfigGeneral.rct2_path = installPath;
if (platform_original_game_data_exists(installPath))
{
return true;
}
utf8 message[MAX_PATH];
snprintf(message, MAX_PATH, "Could not find %s" PATH_SEPARATOR "Data" PATH_SEPARATOR "g1.dat at this path", installPath);
platform_show_messagebox(message);
}
}
return true;
}
}

View File

@ -0,0 +1,233 @@
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/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.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#pragma once
#include "../common.h"
typedef struct GeneralConfiguration
{
// Paths
utf8 * rct1_path;
utf8 * rct2_path;
// Display
sint32 window_width;
sint32 window_height;
sint32 fullscreen_mode;
sint32 fullscreen_width;
sint32 fullscreen_height;
float window_scale;
sint32 drawing_engine;
sint32 scale_quality;
bool use_nn_at_integer_scales;
bool uncap_fps;
bool show_fps;
bool minimize_fullscreen_focus_loss;
// Map rendering
bool landscape_smoothing;
bool always_show_gridlines;
bool construction_marker_colour;
bool day_night_cycle;
bool enable_light_fx;
bool upper_case_banners;
bool render_weather_effects;
bool render_weather_gloom;
bool disable_lightning_effect;
// Localisation
sint32 language;
sint32 measurement_format;
sint32 temperature_format;
bool show_height_as_units;
sint32 date_format;
sint32 currency_format;
sint32 custom_currency_rate;
sint32 custom_currency_affix;
utf8 * custom_currency_symbol;
// Controls
bool edge_scrolling;
bool trap_cursor;
bool invert_viewport_drag;
bool zoom_to_cursor;
// Miscellaneous
bool play_intro;
sint32 window_snap_proximity;
bool allow_loading_with_incorrect_checksum;
bool save_plugin_data;
bool test_unfinished_tracks;
bool no_test_crashes;
bool debugging_tools;
sint32 autosave_frequency;
bool auto_staff_placement;
bool handymen_mow_default;
bool auto_open_shops;
sint32 default_inspection_interval;
sint32 window_limit;
sint32 scenario_select_mode;
bool scenario_unlocking_enabled;
bool scenario_hide_mega_park;
bool steam_overlay_pause;
bool confirmation_prompt;
sint32 load_save_sort;
utf8 * last_save_game_directory;
utf8 * last_save_landscape_directory;
utf8 * last_save_scenario_directory;
utf8 * last_save_track_directory;
utf8 * last_run_version;
sint32 screenshot_format;
} GeneralConfiguration;
typedef struct InterfaceConfiguration
{
bool toolbar_show_finances;
bool toolbar_show_research;
bool toolbar_show_cheats;
bool toolbar_show_news;
bool select_by_track_type;
bool console_small_font;
utf8 * current_theme_preset;
utf8 * current_title_sequence_preset;
sint32 object_selection_filter_flags;
} InterfaceConfiguration;
typedef struct SoundConfiguration
{
utf8 * device;
uint8 master_volume;
uint8 title_music;
bool sound_enabled;
uint8 sound_volume;
bool ride_music_enabled;
uint8 ride_music_volume;
bool audio_focus;
} SoundConfiguration;
typedef struct TwitchConfiguration
{
utf8 * channel;
bool enable_follower_peep_names;
bool enable_follower_peep_tracking;
bool enable_chat_peep_names;
bool enable_chat_peep_tracking;
bool enable_news;
} TwitchConfiguration;
typedef struct NetworkConfiguration
{
utf8 * player_name;
sint32 default_port;
utf8 * default_password;
bool stay_connected;
bool advertise;
sint32 maxplayers;
utf8 * server_name;
utf8 * server_description;
utf8 * server_greeting;
utf8 * master_server_url;
utf8 * provider_name;
utf8 * provider_email;
utf8 * provider_website;
bool known_keys_only;
bool log_chat;
} NetworkConfiguration;
typedef struct NotificationConfiguration
{
bool park_award;
bool park_marketing_campaign_finished;
bool park_warnings;
bool park_rating_warnings;
bool ride_broken_down;
bool ride_crashed;
bool ride_warnings;
bool ride_researched;
bool guest_warnings;
bool guest_lost;
bool guest_left_park;
bool guest_queuing_for_ride;
bool guest_on_ride;
bool guest_left_ride;
bool guest_bought_item;
bool guest_used_facility;
bool guest_died;
} NotificationConfiguration;
typedef struct FontConfiguration
{
utf8 * file_name;
utf8 * font_name;
sint32 x_offset;
sint32 y_offset;
sint32 size_tiny;
sint32 size_small;
sint32 size_medium;
sint32 size_big;
sint32 height_tiny;
sint32 height_small;
sint32 height_medium;
sint32 height_big;
} FontConfiguration;
enum SORT
{
SORT_NAME_ASCENDING,
SORT_NAME_DESCENDING,
SORT_DATE_ASCENDING,
SORT_DATE_DESCENDING,
};
enum TEMPERATURE_FORMAT
{
TEMPERATURE_FORMAT_C,
TEMPERATURE_FORMAT_F
};
enum MEASUREMENT_FORMAT
{
MEASUREMENT_FORMAT_IMPERIAL,
MEASUREMENT_FORMAT_METRIC,
MEASUREMENT_FORMAT_SI
};
#ifdef __cplusplus
extern "C"
{
#endif
extern GeneralConfiguration gConfigGeneral;
extern InterfaceConfiguration gConfigInterface;
extern SoundConfiguration gConfigSound;
extern TwitchConfiguration gConfigTwitch;
extern NetworkConfiguration gConfigNetwork;
extern NotificationConfiguration gConfigNotifications;
extern FontConfiguration gConfigFonts;
bool config_open(const utf8 * path);
bool config_save(const utf8 * path);
void config_get_default_path(utf8 *outPath, size_t size);
void config_set_defaults();
void config_release();
bool config_open_default();
bool config_save_default();
bool config_find_or_browse_install_directory();
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,79 @@
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/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.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#pragma once
#include <initializer_list>
#include <vector>
#include "../core/String.hpp"
template<typename T>
struct ConfigEnumEntry
{
std::string Key;
T Value;
ConfigEnumEntry(const std::string &key, T value)
: Key(key),
Value(value)
{
}
};
template<typename T>
interface IConfigEnum
{
virtual ~IConfigEnum() = default;
virtual std::string GetName(T value) const abstract;
virtual T GetValue(const std::string &key, T defaultValue) const abstract;
};
template<typename T>
class ConfigEnum final : public IConfigEnum<T>
{
private:
std::vector<ConfigEnumEntry<T>> _entries;
public:
ConfigEnum(std::initializer_list<ConfigEnumEntry<T>> entries)
{
_entries = entries;
}
std::string GetName(T value) const override
{
for (const auto &entry : _entries)
{
if (entry.Value == value)
{
return entry.Key;
}
}
return std::string();
}
T GetValue(const std::string &key, T defaultValue) const override
{
for (const auto &entry : _entries)
{
if (String::Equals(entry.Key, key, true))
{
return entry.Value;
}
}
return defaultValue;
}
};

View File

@ -0,0 +1,396 @@
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/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.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#include <initializer_list>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
#include "../common.h"
#include "../core/FileStream.hpp"
#include "../core/String.hpp"
#include "../core/StringBuilder.hpp"
#include "IniReader.hpp"
/**
* Simple tuple (start, length) representing a text span in a buffer.
*/
struct Span
{
size_t Start = 0;
size_t Length = 0;
Span() = default;
Span(size_t start, size_t length)
: Start(start),
Length(length)
{
}
};
/**
* Simple tuple (start, end) inclusive representing a range of lines.
*/
struct LineRange
{
size_t Start = 0;
size_t End = 0;
LineRange() = default;
LineRange(size_t start, size_t end)
: Start(start),
End(end)
{
}
};
class IniReader final : public IIniReader
{
private:
std::vector<uint8> _buffer;
std::vector<Span> _lines;
std::unordered_map<std::string, LineRange> _sections;
std::unordered_map<std::string, std::string> _values;
public:
IniReader(IStream * stream)
{
uint64 length = stream->GetLength() - stream->GetPosition();
_buffer.resize(length);
stream->Read(_buffer.data(), length);
RemoveBOM();
// Ensure there is a null terminator on the end, this is
// mainly for ParseLines's sake
if (_buffer.empty() || _buffer[length - 1] != 0)
{
_buffer.push_back(0);
}
ParseLines();
ParseSections();
}
bool ReadSection(const std::string &name) override
{
auto it = _sections.find(name);
if (it == _sections.end())
{
return false;
}
ParseSectionValues(it->second);
return true;
}
bool GetBoolean(const std::string &name, bool defaultValue) const override
{
bool result = defaultValue;
std::string value;
if (TryGetString(name, &value))
{
result = String::Equals(value, "true", true);
}
return result;
}
sint32 GetSint32(const std::string &name, sint32 defaultValue) const override
{
sint32 result = defaultValue;
std::string value;
if (TryGetString(name, &value))
{
try
{
result = std::stoi(value);
}
catch (std::exception)
{
}
}
return result;
}
float GetFloat(const std::string &name, float defaultValue) const override
{
float result = defaultValue;
std::string value;
if (TryGetString(name, &value))
{
try
{
result = std::stof(value);
}
catch (std::exception)
{
}
}
return result;
}
std::string GetString(const std::string &name, const std::string &defaultValue) const override
{
std::string result;
if (!TryGetString(name, &result))
{
result = defaultValue;
}
return result;
}
bool TryGetString(const std::string &name, std::string * outValue) const override
{
auto it = _values.find(name);
if (it == _values.end())
{
return false;
}
*outValue = it->second;
return true;
}
private:
void RemoveBOM()
{
if (_buffer.size() < 3)
{
return;
}
utf8 * file = (utf8 *)_buffer.data();
utf8 * content = String::SkipBOM(file);
if (file != content)
{
size_t skipLength = content - file;
_buffer.erase(_buffer.begin(), _buffer.begin() + skipLength);
}
}
void ParseLines()
{
size_t lineBegin = 0;
bool onNewLineCh = false;
for (size_t i = 0; i < _buffer.size(); i++)
{
char b = (char)_buffer[i];
if (b == 0 || b == '\n' || b == '\r')
{
if (!onNewLineCh)
{
onNewLineCh = true;
size_t lineEnd = i;
_lines.emplace_back(lineBegin, lineEnd - lineBegin);
}
}
else if (onNewLineCh)
{
onNewLineCh = false;
lineBegin = i;
}
}
}
void ParseSections()
{
std::string sectionName;
LineRange lineRange;
for (size_t i = 0; i < _lines.size(); i++)
{
std::string line = GetLine(i);
line = String::Trim(line);
if (line.size() > 3 && line[0] == '[')
{
size_t endIndex = line.find_first_of(']');
if (endIndex != std::string::npos)
{
// Add last section
if (!sectionName.empty())
{
lineRange.End = i - 1;
_sections[sectionName] = lineRange;
}
// Set up new section
sectionName = line.substr(1, endIndex - 1);
lineRange.Start = i;
}
}
}
// Add final section
if (!sectionName.empty())
{
lineRange.End = _lines.size() - 1;
_sections[sectionName] = lineRange;
}
}
void ParseSectionValues(LineRange range)
{
for (size_t i = range.Start + 1; i <= range.End; i++)
{
ParseValue(i);
}
}
void ParseValue(size_t lineIndex)
{
std::string line = GetLine(lineIndex);
line = TrimComment(line);
// Find assignment character
size_t equalsIndex = line.find_first_of('=');
if (equalsIndex == std::string::npos)
{
return;
}
// Get the key and value
std::string key = String::Trim(line.substr(0, equalsIndex));
std::string value = String::Trim(line.substr(equalsIndex + 1));
value = UnquoteValue(value);
value = UnescapeValue(value);
_values[key] = value;
}
std::string TrimComment(const std::string &s)
{
char inQuotes = 0;
bool escaped = false;
for (size_t i = 0; i < s.size(); i++)
{
char c = s[i];
if (inQuotes == 0 && c == '#' && !escaped)
{
return s.substr(0, i);
}
else if (c == inQuotes && !escaped)
{
inQuotes = 0;
}
else if ((c == '\'' || c == '"') && !escaped)
{
inQuotes = c;
}
escaped = (c == '\\' && !escaped);
}
return s;
}
std::string UnquoteValue(const std::string &s)
{
std::string result = s;
size_t length = s.size();
if (length >= 2)
{
if ((s[0] == '"' || s[0] == '\'') && s[0] == s[length - 1])
{
result = s.substr(1, length - 2);
}
}
return result;
}
std::string UnescapeValue(const std::string &s)
{
if (s.find_first_of('\\') == std::string::npos)
{
return s;
}
bool escaped = false;
auto sb = StringBuilder();
for (char c : s)
{
if (c == '\\' && !escaped)
{
escaped = true;
}
else
{
escaped = false;
sb.Append(&c, 1);
}
}
return std::string(sb.GetString());
}
std::string GetLine(size_t index)
{
utf8 * szBuffer = (utf8 *)_buffer.data();
auto span = _lines[index];
auto line = std::string(szBuffer + span.Start, span.Length);
return line;
}
};
class DefaultIniReader final : public IIniReader
{
public:
bool ReadSection(const std::string &name) override
{
return true;
}
bool GetBoolean(const std::string &name, bool defaultValue) const override
{
return defaultValue;
}
sint32 GetSint32(const std::string &name, sint32 defaultValue) const override
{
return defaultValue;
}
float GetFloat(const std::string &name, float defaultValue) const override
{
return defaultValue;
}
std::string GetString(const std::string &name, const std::string &defaultValue) const override
{
return defaultValue;
}
bool TryGetString(const std::string &name, std::string * outValue) const override
{
return false;
}
};
utf8 * IIniReader::GetCString(const std::string &name, const utf8 * defaultValue) const
{
std::string szValue;
if (!TryGetString(name, &szValue))
{
return String::Duplicate(defaultValue);
}
return String::Duplicate(szValue.c_str());
}
IIniReader * CreateIniReader(IStream * stream)
{
return new IniReader(stream);
}
IIniReader * CreateDefaultIniReader()
{
return new DefaultIniReader();
}

View File

@ -0,0 +1,51 @@
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/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.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#include <string>
#include "../common.h"
#include "ConfigEnum.hpp"
interface IStream;
interface IIniReader
{
virtual ~IIniReader() = default;
virtual bool ReadSection(const std::string &name) abstract;
virtual bool GetBoolean(const std::string &name, bool defaultValue) const abstract;
virtual sint32 GetSint32(const std::string &name, sint32 defaultValue) const abstract;
virtual float GetFloat(const std::string &name, float defaultValue) const abstract;
virtual std::string GetString(const std::string &name, const std::string &defaultValue) const abstract;
virtual bool TryGetString(const std::string &name, std::string * outValue) const abstract;
template<typename T>
T GetEnum(const std::string &name, T defaultValue, const IConfigEnum<T> &configEnum) const
{
std::string szValue;
if (!TryGetString(name, &szValue))
{
return defaultValue;
}
return configEnum.GetValue(szValue, defaultValue);
}
utf8 * GetCString(const std::string &name, const utf8 * defaultValue) const;
};
IIniReader * CreateIniReader(IStream * stream);
IIniReader * CreateDefaultIniReader();

View File

@ -0,0 +1,108 @@
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/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.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#include <sstream>
#include "../core/FileStream.hpp"
#include "../platform/platform.h"
#include "IniWriter.hpp"
class IniWriter final : public IIniWriter
{
private:
IStream * _stream;
bool _firstSection = true;
public:
IniWriter(IStream * stream)
: _stream(stream)
{
}
void WriteSection(const std::string &name) override
{
if (!_firstSection)
{
WriteLine();
}
_firstSection = false;
WriteLine("[" + name + "]");
}
void WriteBoolean(const std::string &name, bool value) override
{
WriteProperty(name, value ? "true" : "false");
}
void WriteSint32(const std::string &name, sint32 value) override
{
WriteProperty(name, std::to_string(value));
}
void WriteFloat(const std::string &name, float value) override
{
WriteProperty(name, std::to_string(value));
}
void WriteString(const std::string &name, const std::string &value) override
{
std::ostringstream buffer;
buffer << '"';
for (char c : value)
{
if (c == '\\' || c == '"')
{
buffer << '\\';
}
buffer << c;
}
buffer << '"';
WriteProperty(name, buffer.str());
}
void WriteEnum(const std::string &name, const std::string &key) override
{
WriteProperty(name, key);
}
private:
void WriteProperty(const std::string &name, const std::string &value)
{
WriteLine(name + " = " + value);
}
void WriteLine()
{
_stream->Write(PLATFORM_NEWLINE, String::SizeOf(PLATFORM_NEWLINE));
}
void WriteLine(const std::string &line)
{
_stream->Write(line.c_str(), line.size());
WriteLine();
}
};
void IIniWriter::WriteString(const std::string &name, const utf8 * value)
{
WriteString(name, String::ToStd(value));
}
IIniWriter * CreateIniWriter(IStream * stream)
{
return new IniWriter(stream);
}

View File

@ -0,0 +1,52 @@
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/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.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#include <string>
#include "../common.h"
#include "ConfigEnum.hpp"
interface IStream;
interface IIniWriter
{
virtual ~IIniWriter() = default;
virtual void WriteSection(const std::string &name) abstract;
virtual void WriteBoolean(const std::string &name, bool value) abstract;
virtual void WriteSint32(const std::string &name, sint32 value) abstract;
virtual void WriteFloat(const std::string &name, float value) abstract;
virtual void WriteString(const std::string &name, const std::string &value) abstract;
virtual void WriteEnum(const std::string &name, const std::string &key) abstract;
template<typename T>
void WriteEnum(const std::string &name, T value, const IConfigEnum<T> &configEnum)
{
std::string key = configEnum.GetName(value);
if (key.empty())
{
WriteSint32(name, value);
}
else
{
WriteEnum(name, key);
}
}
void WriteString(const std::string &name, const utf8 * value);
};
IIniWriter * CreateIniWriter(IStream * stream);

View File

@ -0,0 +1,162 @@
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/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.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#include "../common.h"
#include "../core/Console.hpp"
#include "../core/FileStream.hpp"
#include "../core/Memory.hpp"
#include "../core/Path.hpp"
#include "../core/String.hpp"
extern "C"
{
#include "../interface/keyboard_shortcut.h"
#include "../platform/platform.h"
}
// Current keyboard shortcuts
uint16 gShortcutKeys[SHORTCUT_COUNT];
namespace KeyboardShortcuts
{
// Default keyboard shortcuts
static const uint16 _defaultShortcutKeys[SHORTCUT_COUNT] =
{
SDL_SCANCODE_BACKSPACE, // SHORTCUT_CLOSE_TOP_MOST_WINDOW
SHIFT | SDL_SCANCODE_BACKSPACE, // SHORTCUT_CLOSE_ALL_FLOATING_WINDOWS
SDL_SCANCODE_ESCAPE, // SHORTCUT_CANCEL_CONSTRUCTION_MODE
SDL_SCANCODE_PAUSE, // SHORTCUT_PAUSE_GAME
SDL_SCANCODE_PAGEUP, // SHORTCUT_ZOOM_VIEW_OUT
SDL_SCANCODE_PAGEDOWN, // SHORTCUT_ZOOM_VIEW_IN
SDL_SCANCODE_RETURN, // SHORTCUT_ROTATE_VIEW_CLOCKWISE
SHIFT | SDL_SCANCODE_RETURN, // SHORTCUT_ROTATE_VIEW_ANTICLOCKWISE
SDL_SCANCODE_Z, // SHORTCUT_ROTATE_CONSTRUCTION_OBJECT
SDL_SCANCODE_1, // SHORTCUT_UNDERGROUND_VIEW_TOGGLE
SDL_SCANCODE_H, // SHORTCUT_REMOVE_BASE_LAND_TOGGLE
SDL_SCANCODE_V, // SHORTCUT_REMOVE_VERTICAL_LAND_TOGGLE
SDL_SCANCODE_3, // SHORTCUT_SEE_THROUGH_RIDES_TOGGLE
SDL_SCANCODE_4, // SHORTCUT_SEE_THROUGH_SCENERY_TOGGLE
SDL_SCANCODE_5, // SHORTCUT_INVISIBLE_SUPPORTS_TOGGLE
SDL_SCANCODE_6, // SHORTCUT_INVISIBLE_PEOPLE_TOGGLE
SDL_SCANCODE_8, // SHORTCUT_HEIGHT_MARKS_ON_LAND_TOGGLE
SDL_SCANCODE_9, // SHORTCUT_HEIGHT_MARKS_ON_RIDE_TRACKS_TOGGLE
SDL_SCANCODE_0, // SHORTCUT_HEIGHT_MARKS_ON_PATHS_TOGGLE
SDL_SCANCODE_F1, // SHORTCUT_ADJUST_LAND
SDL_SCANCODE_F2, // SHORTCUT_ADJUST_WATER
SDL_SCANCODE_F3, // SHORTCUT_BUILD_SCENERY
SDL_SCANCODE_F4, // SHORTCUT_BUILD_PATHS
SDL_SCANCODE_F5, // SHORTCUT_BUILD_NEW_RIDE
SDL_SCANCODE_F, // SHORTCUT_SHOW_FINANCIAL_INFORMATION
SDL_SCANCODE_D, // SHORTCUT_SHOW_RESEARCH_INFORMATION
SDL_SCANCODE_R, // SHORTCUT_SHOW_RIDES_LIST
SDL_SCANCODE_P, // SHORTCUT_SHOW_PARK_INFORMATION
SDL_SCANCODE_G, // SHORTCUT_SHOW_GUEST_LIST
SDL_SCANCODE_S, // SHORTCUT_SHOW_STAFF_LIST
SDL_SCANCODE_M, // SHORTCUT_SHOW_RECENT_MESSAGES
SDL_SCANCODE_TAB, // SHORTCUT_SHOW_MAP
PLATFORM_MODIFIER | SDL_SCANCODE_S, // SHORTCUT_SCREENSHOT
SDL_SCANCODE_MINUS, // SHORTCUT_REDUCE_GAME_SPEED,
SDL_SCANCODE_EQUALS, // SHORTCUT_INCREASE_GAME_SPEED,
PLATFORM_MODIFIER | ALT | SDL_SCANCODE_C, // SHORTCUT_OPEN_CHEAT_WINDOW,
SDL_SCANCODE_T, // SHORTCUT_REMOVE_TOP_BOTTOM_TOOLBAR_TOGGLE,
SDL_SCANCODE_UP, // SHORTCUT_SCROLL_MAP_UP
SDL_SCANCODE_LEFT, // SHORTCUT_SCROLL_MAP_LEFT
SDL_SCANCODE_DOWN, // SHORTCUT_SCROLL_MAP_DOWN
SDL_SCANCODE_RIGHT, // SHORTCUT_SCROLL_MAP_RIGHT
SDL_SCANCODE_C, // SHORTCUT_OPEN_CHAT_WINDOW
PLATFORM_MODIFIER | SDL_SCANCODE_F10, // SHORTCUT_QUICK_SAVE_GAME
SHORTCUT_UNDEFINED, // SHORTCUT_SHOW_OPTIONS
SHORTCUT_UNDEFINED, // SHORTCUT_MUTE_SOUND
ALT | SDL_SCANCODE_RETURN, // SHORTCUT_WINDOWED_MODE_TOGGLE
SHORTCUT_UNDEFINED, // SHORTCUT_SHOW_MULTIPLAYER
SHORTCUT_UNDEFINED, // SHORTCUT_PAINT_ORIGINAL_TOGGLE
SHORTCUT_UNDEFINED, // SHORTCUT_DEBUG_PAINT_TOGGLE
SHORTCUT_UNDEFINED, // SHORTCUT_SEE_THROUGH_PATHS_TOGGLE
};
constexpr sint32 CURRENT_FILE_VERSION = 1;
static void Reset()
{
Memory::Copy(gShortcutKeys, _defaultShortcutKeys, sizeof(gShortcutKeys));
}
static std::string GetPath()
{
utf8 path[MAX_PATH];
platform_get_user_directory(path, nullptr, sizeof(path));
Path::Append(path, sizeof(path), "hotkeys.cfg");
return path;
}
}
extern "C"
{
void config_reset_shortcut_keys()
{
KeyboardShortcuts::Reset();
}
bool config_shortcut_keys_load()
{
bool result = false;
try
{
std::string path = KeyboardShortcuts::GetPath();
auto fs = FileStream(path, FILE_MODE_OPEN);
uint16 version = fs.ReadValue<uint16>();
if (version == KeyboardShortcuts::CURRENT_FILE_VERSION)
{
for (sint32 i = 0; i < SHORTCUT_COUNT; i++)
{
gShortcutKeys[i] = fs.ReadValue<uint16>();
}
result = true;
}
else
{
result = false;
}
}
catch (const Exception &ex)
{
Console::WriteLine("Error reading shortcut keys: %s", ex.GetMessage());
}
return result;
}
bool config_shortcut_keys_save()
{
bool result = false;
try
{
std::string path = KeyboardShortcuts::GetPath();
auto fs = FileStream(path, FILE_MODE_WRITE);
fs.WriteValue<uint16>(KeyboardShortcuts::CURRENT_FILE_VERSION);
for (sint32 i = 0; i < SHORTCUT_COUNT; i++)
{
fs.WriteValue<uint16>(gShortcutKeys[i]);
}
result = true;
}
catch (const Exception &ex)
{
Console::WriteLine("Error writing shortcut keys: %s", ex.GetMessage());
}
return result;
}
}

View File

@ -393,4 +393,35 @@ namespace String
{
return String::Set(buffer, bufferSize, TrimStart(src));
}
std::string Trim(const std::string &s)
{
codepoint_t codepoint;
const utf8 * ch = s.c_str();
const utf8 * nextCh;
const utf8 * startSubstr = nullptr;
const utf8 * endSubstr = nullptr;
while ((codepoint = GetNextCodepoint(ch, &nextCh)) != '\0')
{
bool isWhiteSpace = codepoint <= WCHAR_MAX && iswspace((wchar_t)codepoint);
if (!isWhiteSpace)
{
if (startSubstr == nullptr)
{
startSubstr = ch;
}
endSubstr = ch;
}
ch = nextCh;
}
if (startSubstr == nullptr)
{
// String is all whitespace
return std::string();
}
size_t stringLength = endSubstr - startSubstr + 1;
return std::string(startSubstr, stringLength);
}
}

View File

@ -75,4 +75,5 @@ namespace String
utf8 * Trim(utf8 * str);
const utf8 * TrimStart(const utf8 * str);
utf8 * TrimStart(utf8 * buffer, size_t bufferSize, const utf8 * src);
std::string Trim(const std::string &s);
}

View File

@ -20,8 +20,13 @@
#include <SDL_video.h>
struct rct_drawpixelinfo;
interface IDrawingContext;
enum DRAWING_ENGINE
{
DRAWING_ENGINE_NONE = -1,
DRAWING_ENGINE_SOFTWARE,
DRAWING_ENGINE_SOFTWARE_WITH_HARDWARE_DISPLAY,
DRAWING_ENGINE_OPENGL,
};
enum DRAWING_ENGINE_FLAGS
{
@ -33,6 +38,11 @@ enum DRAWING_ENGINE_FLAGS
DEF_DIRTY_OPTIMISATIONS = 1 << 0,
};
#ifdef __cplusplus
struct rct_drawpixelinfo;
interface IDrawingContext;
interface IDrawingEngine
{
virtual ~IDrawingEngine() { }
@ -73,3 +83,5 @@ interface IRainDrawer
sint32 xStart,
sint32 yStart) abstract;
};
#endif

View File

@ -21,7 +21,7 @@
extern "C"
{
#include "../config.h"
#include "../config/Config.h"
#include "../drawing/drawing.h"
#include "../interface/screenshot.h"
#include "../localisation/string_ids.h"

View File

@ -19,7 +19,7 @@ extern "C"
#include "../interface/window.h"
#include "../world/climate.h"
#include "drawing.h"
#include "../config.h"
#include "../config/Config.h"
}
#include "IDrawingEngine.h"

View File

@ -23,7 +23,7 @@
extern "C"
{
#include "../../config.h"
#include "../../config/Config.h"
#include "../../game.h"
#include "../../interface/screenshot.h"
#include "../../interface/viewport.h"

View File

@ -47,11 +47,11 @@ IDrawingEngine * DrawingEngineFactory::CreateOpenGL()
#include "../../IDrawingContext.h"
#include "../../IDrawingEngine.h"
#include "../../Rain.h"
#include "../../../config.h"
#include "../../../config/Config.h"
extern "C"
{
#include "../../../config.h"
#include "../../../config/Config.h"
#include "../../../interface/screenshot.h"
#include "../../../interface/window.h"
#include "../../../intro.h"

View File

@ -19,6 +19,7 @@
#ifdef __ENABLE_LIGHTFX__
#include <SDL.h>
#include "../common.h"
#include "drawing.h"

View File

@ -15,7 +15,7 @@
#pragma endregion
#include "../rct2/addresses.h"
#include "../config.h"
#include "../config/Config.h"
#include "../interface/colour.h"
#include "../localisation/localisation.h"
#include "../sprites.h"

View File

@ -24,7 +24,7 @@
extern "C"
{
#include "../config.h"
#include "../config/Config.h"
#include "../rct2/addresses.h"
#include "../util/util.h"
#include "drawing.h"

View File

@ -17,6 +17,7 @@
#include "../interface/colour.h"
#include "../interface/viewport.h"
#include "../localisation/localisation.h"
#include "../platform/platform.h"
#include "../sprites.h"
#include "../util/util.h"

View File

@ -16,7 +16,7 @@
#include "audio/audio.h"
#include "cheats.h"
#include "config.h"
#include "config/Config.h"
#include "editor.h"
#include "game.h"
#include "input.h"

View File

@ -16,7 +16,7 @@
#include <SDL_keycode.h>
#include "audio/audio.h"
#include "config.h"
#include "config/Config.h"
#include "game.h"
#include "input.h"
#include "interface/chat.h"

View File

@ -21,7 +21,7 @@
#include "Fonts.h"
extern "C" {
#include "../config.h"
#include "../config/Config.h"
#include "../drawing/drawing.h"
#include "../localisation/language.h"
}

View File

@ -22,7 +22,8 @@
extern "C"
{
#include "../common.h"
#include "../config.h"
#include "../config/Config.h"
#include "../platform/platform.h"
#include "themes.h"
#include "window.h"
}

View File

@ -17,7 +17,7 @@
#include <stdarg.h>
#include <SDL_scancode.h>
#include "../config.h"
#include "../config/Config.h"
#include "../drawing/drawing.h"
#include "../game.h"
#include "../input.h"

View File

@ -15,7 +15,7 @@
#pragma endregion
#include "../audio/audio.h"
#include "../config.h"
#include "../config/Config.h"
#include "../editor.h"
#include "../game.h"
#include "../input.h"

View File

@ -29,4 +29,72 @@ void keyboard_shortcut_handle(sint32 key);
void keyboard_shortcut_handle_command(sint32 shortcutIndex);
void keyboard_shortcut_format_string(char *buffer, size_t size, uint16 shortcutKey);
void config_reset_shortcut_keys();
bool config_shortcut_keys_load();
bool config_shortcut_keys_save();
typedef struct shortcut_entry {
uint8 key;
uint8 modifier;
} shortcut_entry;
enum {
SHORTCUT_CLOSE_TOP_MOST_WINDOW,
SHORTCUT_CLOSE_ALL_FLOATING_WINDOWS,
SHORTCUT_CANCEL_CONSTRUCTION_MODE,
SHORTCUT_PAUSE_GAME,
SHORTCUT_ZOOM_VIEW_OUT,
SHORTCUT_ZOOM_VIEW_IN,
SHORTCUT_ROTATE_VIEW_CLOCKWISE,
SHORTCUT_ROTATE_VIEW_ANTICLOCKWISE,
SHORTCUT_ROTATE_CONSTRUCTION_OBJECT,
SHORTCUT_UNDERGROUND_VIEW_TOGGLE,
SHORTCUT_REMOVE_BASE_LAND_TOGGLE,
SHORTCUT_REMOVE_VERTICAL_LAND_TOGGLE,
SHORTCUT_SEE_THROUGH_RIDES_TOGGLE,
SHORTCUT_SEE_THROUGH_SCENERY_TOGGLE,
SHORTCUT_INVISIBLE_SUPPORTS_TOGGLE,
SHORTCUT_INVISIBLE_PEOPLE_TOGGLE,
SHORTCUT_HEIGHT_MARKS_ON_LAND_TOGGLE,
SHORTCUT_HEIGHT_MARKS_ON_RIDE_TRACKS_TOGGLE,
SHORTCUT_HEIGHT_MARKS_ON_PATHS_TOGGLE,
SHORTCUT_ADJUST_LAND,
SHORTCUT_ADJUST_WATER,
SHORTCUT_BUILD_SCENERY,
SHORTCUT_BUILD_PATHS,
SHORTCUT_BUILD_NEW_RIDE,
SHORTCUT_SHOW_FINANCIAL_INFORMATION,
SHORTCUT_SHOW_RESEARCH_INFORMATION,
SHORTCUT_SHOW_RIDES_LIST,
SHORTCUT_SHOW_PARK_INFORMATION,
SHORTCUT_SHOW_GUEST_LIST,
SHORTCUT_SHOW_STAFF_LIST,
SHORTCUT_SHOW_RECENT_MESSAGES,
SHORTCUT_SHOW_MAP,
SHORTCUT_SCREENSHOT,
// New
SHORTCUT_REDUCE_GAME_SPEED,
SHORTCUT_INCREASE_GAME_SPEED,
SHORTCUT_OPEN_CHEAT_WINDOW,
SHORTCUT_REMOVE_TOP_BOTTOM_TOOLBAR_TOGGLE,
SHORTCUT_SCROLL_MAP_UP,
SHORTCUT_SCROLL_MAP_LEFT,
SHORTCUT_SCROLL_MAP_DOWN,
SHORTCUT_SCROLL_MAP_RIGHT,
SHORTCUT_OPEN_CHAT_WINDOW,
SHORTCUT_QUICK_SAVE_GAME,
SHORTCUT_SHOW_OPTIONS,
SHORTCUT_MUTE_SOUND,
SHORTCUT_WINDOWED_MODE_TOGGLE,
SHORTCUT_SHOW_MULTIPLAYER,
SHORTCUT_PAINT_ORIGINAL_TOGGLE,
SHORTCUT_DEBUG_PAINT_TOGGLE,
SHORTCUT_SEE_THROUGH_PATHS_TOGGLE,
SHORTCUT_COUNT
};
extern uint16 gShortcutKeys[SHORTCUT_COUNT];
#endif

View File

@ -15,7 +15,7 @@
#pragma endregion
#include "../audio/audio.h"
#include "../config.h"
#include "../config/Config.h"
#include "../drawing/drawing.h"
#include "../game.h"
#include "../Imaging.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../config.h"
#include "../config/Config.h"
#include "../drawing/drawing.h"
#include "../game.h"
#include "../input.h"

View File

@ -29,7 +29,7 @@
#include "viewport.h"
#include "widget.h"
#include "window.h"
#include "../config.h"
#include "../config/Config.h"
#define RCT2_FIRST_WINDOW (g_window_list)
#define RCT2_LAST_WINDOW (gWindowNextSlot - 1)

View File

@ -72,6 +72,10 @@
<ClCompile Include="audio\FileAudioSource.cpp" />
<ClCompile Include="audio\MemoryAudioSource.cpp" />
<ClCompile Include="audio\NullAudioSource.cpp" />
<ClCompile Include="config\Config.cpp" />
<ClCompile Include="config\IniReader.cpp" />
<ClCompile Include="config\IniWriter.cpp" />
<ClCompile Include="config\KeyboardShortcuts.cpp" />
<ClCompile Include="FileClassifier.cpp" />
<ClCompile Include="network\ServerList.cpp" />
<ClCompile Include="ParkImporter.cpp" />
@ -88,7 +92,6 @@
<ClCompile Include="cmdline\ScreenshotCommands.cpp" />
<ClCompile Include="cmdline\SpriteCommands.cpp" />
<ClCompile Include="cmdline_sprite.c" />
<ClCompile Include="config.c" />
<ClCompile Include="core\Console.cpp" />
<ClCompile Include="core\Diagnostics.cpp" />
<ClCompile Include="core\File.cpp" />
@ -419,6 +422,10 @@
<ClInclude Include="audio\AudioFormat.h" />
<ClInclude Include="audio\AudioMixer.h" />
<ClInclude Include="audio\AudioSource.h" />
<ClInclude Include="config\Config.h" />
<ClInclude Include="config\ConfigEnum.hpp" />
<ClInclude Include="config\IniReader.hpp" />
<ClInclude Include="config\IniWriter.hpp" />
<ClInclude Include="FileClassifier.h" />
<ClInclude Include="network\ServerList.h" />
<ClInclude Include="rct12.h" />
@ -433,7 +440,6 @@
<ClInclude Include="cmdline\CommandLine.hpp" />
<ClInclude Include="cmdline_sprite.h" />
<ClInclude Include="common.h" />
<ClInclude Include="config.h" />
<ClInclude Include="core\Collections.hpp" />
<ClInclude Include="core\Console.hpp" />
<ClInclude Include="core\Diagnostics.hpp" />

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../config.h"
#include "../config/Config.h"
#include "../util/util.h"
#include "currency.h"
#include "string_ids.h"

View File

@ -23,7 +23,7 @@
#include <errno.h>
#endif // __WINDOWS__
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../util/util.h"
#include "date.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../config.h"
#include "../config/Config.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"
#include "../peep/peep.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../interface/window.h"
#include "../localisation/date.h"

View File

@ -25,7 +25,7 @@
extern "C"
{
#include "../config.h"
#include "../config/Config.h"
#include "../localisation/date.h"
#include "../management/finance.h"
#include "../peep/peep.h"

View File

@ -51,7 +51,7 @@ sint32 _pickup_peep_old_x = SPRITE_LOCATION_NULL;
#include "../rct2/S6Exporter.h"
extern "C" {
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../interface/chat.h"
#include "../interface/window.h"
@ -1629,7 +1629,7 @@ void Network::Server_Handle_AUTH(NetworkConnection& connection, NetworkPacket& p
}
}
if (gConfigNetwork.maxplayers <= player_list.size()) {
if ((size_t)gConfigNetwork.maxplayers <= player_list.size()) {
connection.AuthStatus = NETWORK_AUTH_FULL;
} else
if (connection.AuthStatus == NETWORK_AUTH_VERIFIED) {

View File

@ -35,7 +35,7 @@
extern "C"
{
#include "../config.h"
#include "../config/Config.h"
#include "../drawing/drawing.h"
#include "../game.h"
#include "../interface/console.h"

View File

@ -43,7 +43,7 @@
extern "C"
{
#include "../config.h"
#include "../config/Config.h"
#include "../localisation/localisation.h"
#include "../object.h"
#include "../object_list.h"

View File

@ -23,7 +23,7 @@
extern "C"
{
#include "../config.h"
#include "../config/Config.h"
#include "../drawing/drawing.h"
#include "../localisation/localisation.h"
#include "../rct1.h"

View File

@ -15,7 +15,7 @@
#pragma endregion
#include "../paint.h"
#include "../../config.h"
#include "../../config/Config.h"
#include "../../game.h"
#include "../../interface/viewport.h"
#include "../../localisation/localisation.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../../config.h"
#include "../../config/Config.h"
#include "../../game.h"
#include "../../interface/viewport.h"
#include "../../localisation/localisation.h"

View File

@ -20,7 +20,7 @@
#include "../../world/scenery.h"
#include "../../game.h"
#include "../../ride/track.h"
#include "../../config.h"
#include "../../config/Config.h"
#include "../../localisation/localisation.h"
#include "../../interface/colour.h"
#include "../../interface/viewport.h"

View File

@ -21,7 +21,7 @@
#include "../../ride/ride_data.h"
#include "../../ride/track_data.h"
#include "../../ride/track_paint.h"
#include "../../config.h"
#include "../../config/Config.h"
#include "../../world/sprite.h"
#include "../../world/banner.h"
#include "../../world/entrance.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../../config.h"
#include "../../config/Config.h"
#include "../../game.h"
#include "../../interface/viewport.h"
#include "../../localisation/localisation.h"

View File

@ -15,7 +15,7 @@
#pragma endregion
#include "map_element.h"
#include "../../config.h"
#include "../../config/Config.h"
#include "../../game.h"
#include "../../interface/viewport.h"
#include "../../localisation/date.h"

View File

@ -17,7 +17,7 @@
#include "map_element.h"
#include "../paint.h"
#include "../supports.h"
#include "../../config.h"
#include "../../config/Config.h"
#include "../../game.h"
#include "../../interface/viewport.h"
#include "../../localisation/localisation.h"

View File

@ -15,7 +15,7 @@
#pragma endregion
#include "../../cheats.h"
#include "../../config.h"
#include "../../config/Config.h"
#include "../../interface/viewport.h"
#include "../../peep/staff.h"
#include "../../rct2.h"

View File

@ -17,7 +17,7 @@
#include "paint.h"
#include "../drawing/drawing.h"
#include "../localisation/localisation.h"
#include "../config.h"
#include "../config/Config.h"
#include "../interface/viewport.h"
#include "map_element/map_element.h"
#include "sprite/sprite.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../../config.h"
#include "../../config/Config.h"
#include "../../drawing/lightfx.h"
#include "../../interface/viewport.h"
#include "../../paint/sprite/sprite.h"

View File

@ -17,7 +17,7 @@
#include "../audio/audio.h"
#include "../audio/AudioMixer.h"
#include "../cheats.h"
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../input.h"
#include "../interface/window.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../interface/viewport.h"
#include "../localisation/date.h"

View File

@ -33,7 +33,7 @@
#include <fnmatch.h>
#include <locale.h>
#include "../config.h"
#include "../config/Config.h"
#include "../localisation/language.h"
#include "../localisation/string_ids.h"
#include "../util/util.h"
@ -461,7 +461,7 @@ bool platform_open_common_file_dialog(utf8 *outFilename, file_dialog_desc *desc,
return 1;
}
utf8 *platform_open_directory_browser(utf8 *title) {
utf8 *platform_open_directory_browser(const utf8 *title) {
size_t size;
dialog_type dtype;
sint32 exit_value;

View File

@ -22,7 +22,7 @@
#include "platform.h"
#include "../util/util.h"
#include "../localisation/language.h"
#include "../config.h"
#include "../config/Config.h"
bool platform_check_steam_overlay_attached() {
STUB();
@ -105,7 +105,7 @@ void platform_show_messagebox(const char * message)
}
}
utf8 *platform_open_directory_browser(utf8 *title)
utf8 *platform_open_directory_browser(const utf8 *title)
{
@autoreleasepool
{

View File

@ -195,7 +195,7 @@ void platform_get_user_directory(utf8 *outPath, const utf8 *subDirectory, size_t
utf8* platform_get_username();
void platform_show_messagebox(const utf8 * message);
bool platform_open_common_file_dialog(utf8 *outFilename, file_dialog_desc *desc, size_t outSize);
utf8 *platform_open_directory_browser(utf8 *title);
utf8 *platform_open_directory_browser(const utf8 *title);
uint8 platform_get_locale_currency();
uint8 platform_get_currency_value(const char *currencyCode);
uint16 platform_get_locale_language();

View File

@ -26,7 +26,7 @@
#include <pwd.h>
#include <time.h>
#include <SDL_syswm.h>
#include "../config.h"
#include "../config/Config.h"
#include "../localisation/language.h"
#include "../OpenRCT2.h"
#include "../util/util.h"

View File

@ -16,8 +16,9 @@
#include "../audio/audio.h"
#include "../audio/AudioMixer.h"
#include "../config.h"
#include "../config/Config.h"
#include "../drawing/drawing.h"
#include "../drawing/IDrawingEngine.h"
#include "../drawing/lightfx.h"
#include "../editor.h"
#include "../game.h"

View File

@ -31,7 +31,7 @@
#include <SDL_syswm.h>
#include <sys/stat.h>
#include "../config.h"
#include "../config/Config.h"
#include "../localisation/language.h"
#include "../OpenRCT2.h"
#include "../util/util.h"
@ -694,7 +694,7 @@ bool platform_open_common_file_dialog(utf8 *outFilename, file_dialog_desc *desc,
return result;
}
utf8 *platform_open_directory_browser(utf8 *title)
utf8 *platform_open_directory_browser(const utf8 *title)
{
BROWSEINFOW bi;
wchar_t pszBuffer[MAX_PATH], wctitle[256];

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "config.h"
#include "config/Config.h"
#include "game.h"
#include "localisation/string_ids.h"
#include "rct1.h"

View File

@ -19,7 +19,7 @@
#include <time.h>
#include "audio/audio.h"
#include "audio/AudioMixer.h"
#include "config.h"
#include "config/Config.h"
#include "drawing/drawing.h"
#include "drawing/lightfx.h"
#include "editor.h"
@ -27,6 +27,7 @@
#include "input.h"
#include "interface/chat.h"
#include "interface/console.h"
#include "interface/keyboard_shortcut.h"
#include "interface/viewport.h"
#include "intro.h"
#include "localisation/date.h"

View File

@ -27,7 +27,7 @@
extern "C"
{
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../interface/viewport.h"
#include "../interface/window.h"

View File

@ -29,7 +29,7 @@
extern "C"
{
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../interface/viewport.h"
#include "../localisation/date.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../../config.h"
#include "../../config/Config.h"
#include "../../interface/viewport.h"
#include "../../paint/paint.h"
#include "../../paint/supports.h"

View File

@ -18,7 +18,7 @@
#include "../audio/AudioMixer.h"
#include "../cheats.h"
#include "../common.h"
#include "../config.h"
#include "../config/Config.h"
#include "../editor.h"
#include "../game.h"
#include "../input.h"

View File

@ -15,7 +15,7 @@
#pragma endregion
#include "../../common.h"
#include "../../config.h"
#include "../../config/Config.h"
#include "../../interface/viewport.h"
#include "../../world/sprite.h"
#include "../../paint/paint.h"

View File

@ -16,7 +16,7 @@
#include "../audio/audio.h"
#include "../cheats.h"
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../interface/viewport.h"
#include "../localisation/localisation.h"

View File

@ -15,7 +15,7 @@
#pragma endregion
#include "../audio/audio.h"
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../localisation/localisation.h"
#include "../localisation/string_ids.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../config.h"
#include "../config/Config.h"
#include "../drawing/drawing.h"
#include "../paint/supports.h"
#include "../interface/viewport.h"

View File

@ -16,7 +16,7 @@
#include "../audio/audio.h"
#include "../audio/AudioMixer.h"
#include "../config.h"
#include "../config/Config.h"
#include "../editor.h"
#include "../game.h"
#include "../interface/viewport.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../../config.h"
#include "../../config/Config.h"
#include "../../interface/viewport.h"
#include "../../world/sprite.h"
#include "../../paint/paint.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../../config.h"
#include "../../config/Config.h"
#include "../../interface/viewport.h"
#include "../../paint/paint.h"
#include "../../paint/supports.h"

View File

@ -32,8 +32,9 @@
extern "C"
{
#include "../config.h"
#include "../config/Config.h"
#include "../localisation/localisation.h"
#include "../platform/platform.h"
#include "../rct2.h"
#include "scenario.h"
}

View File

@ -16,7 +16,7 @@
#include "../audio/audio.h"
#include "../cheats.h"
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../interface/viewport.h"
#include "../localisation/date.h"

View File

@ -21,7 +21,6 @@
#include "../management/finance.h"
#include "../management/research.h"
#include "../object.h"
#include "../platform/platform.h"
#include "../rct12.h"
#include "../rct2.h"
#include "../rct2/addresses.h"
@ -343,6 +342,20 @@ enum {
OBJECTIVE_MONTHLY_FOOD_INCOME
};
enum {
SCENARIO_SELECT_MODE_DIFFICULTY,
SCENARIO_SELECT_MODE_ORIGIN,
};
enum {
AUTOSAVE_EVERY_MINUTE,
AUTOSAVE_EVERY_5MINUTES,
AUTOSAVE_EVERY_15MINUTES,
AUTOSAVE_EVERY_30MINUTES,
AUTOSAVE_EVERY_HOUR,
AUTOSAVE_NEVER
};
#define AUTOSAVE_PAUSE 0
extern const rct_string_id ScenarioCategoryStringIds[SCENARIO_CATEGORY_COUNT];
@ -368,7 +381,7 @@ extern rct_s6_info gS6Info;
extern char gScenarioName[64];
extern char gScenarioDetails[256];
extern char gScenarioCompletedBy[32];
extern char gScenarioSavePath[MAX_PATH];
extern char gScenarioSavePath[260];
extern char gScenarioExpansionPacks[3256];
extern sint32 gFirstTimeSave;
extern uint16 gSavedAge;

View File

@ -26,7 +26,7 @@
extern "C"
{
#include "../audio/audio.h"
#include "../config.h"
#include "../config/Config.h"
#include "../drawing/drawing.h"
#include "../game.h"
#include "../input.h"

View File

@ -15,7 +15,7 @@
#pragma endregion
#include "../game.h"
#include "../config.h"
#include "../config/Config.h"
#include "../localisation/localisation.h"
#include "../interface/viewport.h"
#include "../interface/widget.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../interface/widget.h"
#include "../interface/window.h"

View File

@ -18,7 +18,7 @@
* 'Custom currency configuration' window definition and logic.
*/
#include "../config.h"
#include "../config/Config.h"
#include "../localisation/localisation.h"
#include "../interface/widget.h"
#include "../interface/window.h"

View File

@ -15,7 +15,7 @@
#pragma endregion
#include "../audio/audio.h"
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../editor.h"
#include "../input.h"

View File

@ -17,7 +17,7 @@
#pragma warning(disable : 4295) // 'identifier': array is too small to include a terminating null character
#include "../audio/audio.h"
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../editor.h"
#include "../interface/themes.h"

View File

@ -15,9 +15,10 @@
#pragma endregion
#include "../audio/audio.h"
#include "../localisation/localisation.h"
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"
#include "../platform/platform.h"
#include "../rct2.h"
#include "error.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../interface/graph.h"
#include "../interface/widget.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../input.h"
#include "../interface/themes.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../input.h"
#include "../management/marketing.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../interface/themes.h"
#include "../interface/widget.h"

View File

@ -20,11 +20,12 @@
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"
#include "../object/ObjectManager.h"
#include "../platform/platform.h"
#include "../ride/ride.h"
#include "../ride/track.h"
#include "../ride/track_design.h"
#include "../ride/TrackDesignRepository.h"
#include "../object/ObjectManager.h"
#include "../sprites.h"
#include "../util/util.h"
#include "error.h"

View File

@ -15,7 +15,7 @@
#pragma endregion
#include <time.h>
#include "../config.h"
#include "../config/Config.h"
#include "../editor.h"
#include "../game.h"
#include "../interface/themes.h"

View File

@ -14,10 +14,11 @@
*****************************************************************************/
#pragma endregion
#include "../localisation/localisation.h"
#include "../input.h"
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"
#include "../platform/platform.h"
static rct_widget window_map_tooltip_widgets[] = {
{ WWT_IMGBTN, 0, 0, 199, 0, 29, 0xFFFFFFFF, STR_NONE },

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../config.h"
#include "../config/Config.h"
#include "../interface/themes.h"
#include "../interface/widget.h"
#include "../interface/window.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../localisation/localisation.h"
#include "../interface/widget.h"

View File

@ -15,7 +15,7 @@
#pragma endregion
#include "../audio/audio.h"
#include "../config.h"
#include "../config/Config.h"
#include "../game.h"
#include "../interface/widget.h"
#include "../interface/window.h"

View File

@ -14,7 +14,7 @@
*****************************************************************************/
#pragma endregion
#include "../config.h"
#include "../config/Config.h"
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"
@ -33,23 +33,23 @@ typedef struct notification_def {
} notification_def;
static const notification_def NewsItemOptionDefinitions[] = {
{ NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_AWARD, offsetof(notification_configuration, park_award) },
{ NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_MARKETING_CAMPAIGN_FINISHED, offsetof(notification_configuration, park_marketing_campaign_finished) },
{ NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_WARNINGS, offsetof(notification_configuration, park_warnings) },
{ NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_RATING_WARNINGS, offsetof(notification_configuration, park_rating_warnings) },
{ NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_BROKEN_DOWN, offsetof(notification_configuration, ride_broken_down) },
{ NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_CRASHED, offsetof(notification_configuration, ride_crashed) },
{ NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_WARNINGS, offsetof(notification_configuration, ride_warnings) },
{ NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_RESEARCHED, offsetof(notification_configuration, ride_researched) },
{ NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_WARNINGS, offsetof(notification_configuration, guest_warnings) },
{ NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_LOST, offsetof(notification_configuration, guest_lost) },
{ NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_LEFT_PARK, offsetof(notification_configuration, guest_left_park) },
{ NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_QUEUING_FOR_RIDE, offsetof(notification_configuration, guest_queuing_for_ride) },
{ NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_ON_RIDE, offsetof(notification_configuration, guest_on_ride) },
{ NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_LEFT_RIDE, offsetof(notification_configuration, guest_left_ride) },
{ NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_BOUGHT_ITEM, offsetof(notification_configuration, guest_bought_item) },
{ NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_USED_FACILITY, offsetof(notification_configuration, guest_used_facility) },
{ NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_DIED, offsetof(notification_configuration, guest_died) },
{ NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_AWARD, offsetof(NotificationConfiguration, park_award) },
{ NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_MARKETING_CAMPAIGN_FINISHED, offsetof(NotificationConfiguration, park_marketing_campaign_finished) },
{ NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_WARNINGS, offsetof(NotificationConfiguration, park_warnings) },
{ NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_RATING_WARNINGS, offsetof(NotificationConfiguration, park_rating_warnings) },
{ NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_BROKEN_DOWN, offsetof(NotificationConfiguration, ride_broken_down) },
{ NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_CRASHED, offsetof(NotificationConfiguration, ride_crashed) },
{ NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_WARNINGS, offsetof(NotificationConfiguration, ride_warnings) },
{ NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_RESEARCHED, offsetof(NotificationConfiguration, ride_researched) },
{ NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_WARNINGS, offsetof(NotificationConfiguration, guest_warnings) },
{ NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_LOST, offsetof(NotificationConfiguration, guest_lost) },
{ NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_LEFT_PARK, offsetof(NotificationConfiguration, guest_left_park) },
{ NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_QUEUING_FOR_RIDE, offsetof(NotificationConfiguration, guest_queuing_for_ride) },
{ NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_ON_RIDE, offsetof(NotificationConfiguration, guest_on_ride) },
{ NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_LEFT_RIDE, offsetof(NotificationConfiguration, guest_left_ride) },
{ NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_BOUGHT_ITEM, offsetof(NotificationConfiguration, guest_bought_item) },
{ NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_USED_FACILITY, offsetof(NotificationConfiguration, guest_used_facility) },
{ NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_DIED, offsetof(NotificationConfiguration, guest_died) },
};
enum WINDOW_NEWS_WIDGET_IDX {

Some files were not shown because too many files have changed in this diff Show More