Skip to content

Commit

Permalink
config: move enable_game_modes from gameflow to config
Browse files Browse the repository at this point in the history
  • Loading branch information
walkawayy committed Sep 1, 2023
1 parent d87837d commit bffc9b0
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- fixed data portal issues in Atlantean Stronghold that could result in a crash (#227)
- fixed the camera in Natla's Mines when pulling the lever in room 67 (#352)
- fixed flame emitter saving and loading which caused rare crashing (#947)
- moved the enable_game_modes option from the gameflow to the config tool (#962)
- improve spanish localization and added translation for rotated pickups

## [2.15.3](https://github.com/rr-/Tomb1Main/compare/2.15.2...2.15.3) - 2023-08-15
Expand Down
3 changes: 0 additions & 3 deletions bin/cfg/Tomb1Main_gameflow.json5
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"savegame_fmt_legacy": "saveati.%d",
"savegame_fmt_bson": "save_tr1_%02d.dat",

// whether to allow user to select NG/NG+/etc. modes in the new game dialog
"enable_game_modes": true,

// disables saving except in the locations near the crystals.
"enable_save_crystals": false,

Expand Down
1 change: 0 additions & 1 deletion bin/cfg/Tomb1Main_gameflow_ub.json5
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"main_menu_picture": "data/titleh_ub.png",
"savegame_fmt_legacy": "saveuba.%d",
"savegame_fmt_bson": "save_trub_%02d.dat",
"enable_game_modes": true,
"enable_save_crystals": false,
"demo_delay": 16,
"water_color": [0.45, 1.0, 1.0],
Expand Down
2 changes: 2 additions & 0 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ bool Config_ReadFromJSON(const char *cfg_data)
READ_BOOL(load_music_triggers, true);
READ_BOOL(fix_item_rots, true);
READ_BOOL(restore_ps1_enemies, false);
READ_BOOL(enable_game_modes, true);

CLAMP(g_Config.start_lara_hitpoints, 1, LARA_HITPOINTS);
CLAMP(g_Config.fov_value, 30, 255);
Expand Down Expand Up @@ -423,6 +424,7 @@ bool Config_Write(void)
WRITE_BOOL(load_music_triggers);
WRITE_BOOL(fix_item_rots);
WRITE_BOOL(restore_ps1_enemies);
WRITE_BOOL(enable_game_modes);

// User settings
WRITE_BOOL(rendering.enable_bilinear_filter);
Expand Down
1 change: 1 addition & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ typedef struct {
bool load_music_triggers;
bool fix_item_rots;
bool restore_ps1_enemies;
bool enable_game_modes;

struct {
int32_t layout;
Expand Down
7 changes: 0 additions & 7 deletions src/game/gameflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,6 @@ static bool GameFlow_LoadScriptMeta(struct json_object_s *obj)
}
g_GameFlow.demo_delay = tmp_d * FRAMES_PER_SECOND;

tmp_i = json_object_get_bool(obj, "enable_game_modes", JSON_INVALID_BOOL);
if (tmp_i == JSON_INVALID_BOOL) {
LOG_ERROR("'enable_game_modes' must be a boolean");
return false;
}
g_GameFlow.enable_game_modes = tmp_i;

tmp_i =
json_object_get_bool(obj, "enable_save_crystals", JSON_INVALID_BOOL);
if (tmp_i == JSON_INVALID_BOOL) {
Expand Down
1 change: 0 additions & 1 deletion src/game/gameflow.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ typedef struct GAMEFLOW {
char *savegame_fmt_bson;
int8_t has_demo;
int32_t demo_delay;
int8_t enable_game_modes;
int8_t enable_save_crystals;
GAMEFLOW_LEVEL *levels;
char *strings[GS_NUMBER_OF];
Expand Down
2 changes: 1 addition & 1 deletion src/game/option/option_passport.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ void Option_Passport(INVENTORY_ITEM *inv_item)
if (g_InvMode == INV_TITLE_MODE
|| (g_CurrentLevel == g_GameFlow.gym_level_num
&& g_InvMode != INV_DEATH_MODE)) {
if (g_GameFlow.enable_game_modes) {
if (g_Config.enable_game_modes) {
Option_PassportInitNewGameRequester();
m_PassportMode = PASSPORT_MODE_NEW_GAME;
g_Input = (INPUT_STATE) { 0 };
Expand Down
4 changes: 4 additions & 0 deletions tools/config/Tomb1Main_ConfigTool/Resources/Lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@
"Title": "Restore PS1 enemies",
"Description": "Adds the mummy that appears in the PlayStation version of City of Khamoon, room 25.\nChanging this option will require restarting the level."
},
"enable_game_modes": {
"Title": "Enable game modes",
"Description": "Allows new game plus options to be selected from the new game passport menu.\n-New Game+: unlocks all weapons with infinite ammo; enemies have double the HP.\n-Japanese NG: weapons do double damage.\n-Japanese NG+: combination of New Game+ and Japanese NG."
},
"enable_timer_in_inventory": {
"Title": "Timer counts in inventory",
"Description": "Makes the in-game timer work even while the game is showing the inventory."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@
"DataType": "Bool",
"DefaultValue": false
},
{
"Field": "enable_game_modes",
"DataType": "Bool",
"DefaultValue": true
},
{
"Field": "enable_timer_in_inventory",
"DataType": "Bool",
Expand Down

0 comments on commit bffc9b0

Please sign in to comment.