Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add SFALL_CONFIG_PIPBOY_AVAILABLE_AT_GAMESTART support #314

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/pipboy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "random.h"
#include "scripts.h"
#include "settings.h"
#include "sfall_config.h"
#include "stat.h"
#include "svga.h"
#include "text_font.h"
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions src/sfall_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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, '\\');
Expand Down
1 change: 1 addition & 0 deletions src/sfall_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down