Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
console/cmd: add /set
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Sep 19, 2024
1 parent c23a11d commit ad5a115
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- `/give`
- `/kill`
- `/flip`
- `/set`
- added an ability to remap the console key (#163)
- added `/tp` console command's ability to teleport to specific items
- added `/fly` console command's ability to open nearest doors
Expand Down
5 changes: 5 additions & 0 deletions data/ship/cfg/TR2X_gameflow.json5
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,14 @@
},

"game_strings": {
"MISC_OFF": "Off",
"MISC_ON": "On",
"OSD_COMMAND_BAD_INVOCATION": "Invalid invocation: %s",
"OSD_COMMAND_UNAVAILABLE": "This command is not currently available",
"OSD_COMPLETE_LEVEL": "Level complete!",
"OSD_CONFIG_OPTION_GET": "%s is currently set to %s",
"OSD_CONFIG_OPTION_SET": "%s changed to %s",
"OSD_CONFIG_OPTION_UNKNOWN_OPTION": "Unknown option: %s",
"OSD_CURRENT_HEALTH_GET": "Current Lara's health: %d",
"OSD_CURRENT_HEALTH_SET": "Lara's health set to %d",
"OSD_DOOR_CLOSE": "Close Sesame!",
Expand Down
13 changes: 13 additions & 0 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,16 @@ bool Config_Write(void)
File_CreateDirectory(DIR_CONFIG);
return ConfigFile_Write(m_ConfigPath, &Config_Dump);
}

void Config_Sanitize(void)
{
}

void Config_ApplyChanges(void)
{
}

const CONFIG_OPTION *Config_GetOptionMap(void)
{
return g_ConfigOptionMap;
}
5 changes: 5 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <libtrx/config/config_option.h>

#include <stdbool.h>

typedef struct {
Expand All @@ -14,3 +16,6 @@ extern CONFIG g_Config;

bool Config_Read(void);
bool Config_Write(void);
void Config_Sanitize(void);
void Config_ApplyChanges(void);
const CONFIG_OPTION *Config_GetOptionMap(void);
2 changes: 2 additions & 0 deletions src/game/console_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "global/vars.h"
#include "lara/lara_misc.h"

#include <libtrx/game/console/commands/config.h>
#include <libtrx/game/console/commands/pos.h>
#include <libtrx/game/console/commands/set_health.h>
#include <libtrx/game/console/common.h>
Expand Down Expand Up @@ -579,6 +580,7 @@ CONSOLE_COMMAND *g_ConsoleCommands[] = {
&(CONSOLE_COMMAND) { .prefix = "abortion", .proc = Console_Cmd_Abortion },
&(CONSOLE_COMMAND) { .prefix = "natlastinks",
.proc = Console_Cmd_Abortion },
&g_Console_Cmd_Config,
&g_Console_Cmd_Pos,
&g_Console_Cmd_SetHealth,
NULL,
Expand Down

0 comments on commit ad5a115

Please sign in to comment.