add SFALL_CONFIG_PIPBOY_AVAILABLE_AT_GAMESTART support

This commit is contained in:
sonil 2023-06-24 13:31:23 +08:00
parent fe035d8514
commit 6987892fcc
3 changed files with 10 additions and 1 deletions

View File

@ -39,6 +39,7 @@
#include "window_manager.h"
#include "word_wrap.h"
#include "worldmap.h"
#include "sfall_config.h"
namespace fallout {
@ -394,12 +395,14 @@ unsigned char _stat_flag;
static int gPipboyPrevTab;
bool PipBoyAvailableAtGameStart = false;
static FrmImage _pipboyFrmImages[PIPBOY_FRM_COUNT];
// 0x497004
int pipboyOpen(int intent)
{
if (!wmMapPipboyActive()) {
if (!wmMapPipboyActive() && !PipBoyAvailableAtGameStart) {
// You aren't wearing the pipboy!
const char* text = getmsg(&gMiscMessageList, &gPipboyMessageListItem, 7000);
showDialogBox(text, NULL, 0, 192, 135, _colorTable[32328], NULL, _colorTable[32328], 1);
@ -741,6 +744,9 @@ static void pipboyWindowFree()
// 0x497918
static void _pip_init_()
{
int configValue = 2;
configGetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_PIPBOY_AVAILABLE_AT_GAMESTART, &configValue);
PipBoyAvailableAtGameStart = configValue == 1;
}
// NOTE: Uncollapsed 0x497918.

View File

@ -62,6 +62,8 @@ bool sfallConfigInit(int argc, char** argv)
configSetString(&gSfallConfig, SFALL_CONFIG_SCRIPTS_KEY, SFALL_CONFIG_INI_CONFIG_FOLDER, "");
configSetString(&gSfallConfig, SFALL_CONFIG_SCRIPTS_KEY, SFALL_CONFIG_GLOBAL_SCRIPT_PATHS, "");
configSetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_PIPBOY_AVAILABLE_AT_GAMESTART, 2);
char path[COMPAT_MAX_PATH];
char* executable = argv[0];
char* ch = strrchr(executable, '\\');

View File

@ -72,6 +72,7 @@ namespace fallout {
#define SFALL_CONFIG_INI_CONFIG_FOLDER "IniConfigFolder"
#define SFALL_CONFIG_GLOBAL_SCRIPT_PATHS "GlobalScriptPaths"
#define SFALL_CONFIG_AUTO_QUICK_SAVE "AutoQuickSave"
#define SFALL_CONFIG_PIPBOY_AVAILABLE_AT_GAMESTART "PipBoyAvailableAtGameStart"
#define SFALL_CONFIG_BURST_MOD_DEFAULT_CENTER_MULTIPLIER 1
#define SFALL_CONFIG_BURST_MOD_DEFAULT_CENTER_DIVISOR 3