|
34 | 34 | #include "random.h" |
35 | 35 | #include "scripts.h" |
36 | 36 | #include "settings.h" |
| 37 | +#include "sfall_config.h" |
37 | 38 | #include "stat.h" |
38 | 39 | #include "svga.h" |
39 | 40 | #include "text_font.h" |
@@ -394,13 +395,14 @@ unsigned char _holo_flag; |
394 | 395 | unsigned char _stat_flag; |
395 | 396 |
|
396 | 397 | static int gPipboyPrevTab; |
| 398 | +static bool pipboy_available_at_game_start = false; |
397 | 399 |
|
398 | 400 | static FrmImage _pipboyFrmImages[PIPBOY_FRM_COUNT]; |
399 | 401 |
|
400 | 402 | // 0x497004 |
401 | 403 | int pipboyOpen(int intent) |
402 | 404 | { |
403 | | - if (!wmMapPipboyActive()) { |
| 405 | + if (!wmMapPipboyActive() && !pipboy_available_at_game_start) { |
404 | 406 | // You aren't wearing the pipboy! |
405 | 407 | const char* text = getmsg(&gMiscMessageList, &gPipboyMessageListItem, 7000); |
406 | 408 | showDialogBox(text, nullptr, 0, 192, 135, _colorTable[32328], nullptr, _colorTable[32328], 1); |
@@ -742,6 +744,19 @@ static void pipboyWindowFree() |
742 | 744 | // 0x497918 |
743 | 745 | static void _pip_init_() |
744 | 746 | { |
| 747 | + // SFALL: Make the pipboy available at the start of the game. |
| 748 | + // CE: The implementation is slightly different. SFALL has two values for |
| 749 | + // making the pipboy available at the start of the game. When the option is |
| 750 | + // set to (1), the `MOVIE_VSUIT` is automatically marked as viewed (the suit |
| 751 | + // grants the pipboy, see `wmMapPipboyActive`). Doing so exposes that movie |
| 752 | + // in the "Video Archives" section of the pipboy, which is likely an |
| 753 | + // undesired side effect. When the option is set to (2), the check is simply |
| 754 | + // bypassed. CE implements only the latter approach, as it does not have any |
| 755 | + // side effects. |
| 756 | + int value = 0; |
| 757 | + if (configGetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_PIPBOY_AVAILABLE_AT_GAMESTART, &value)) { |
| 758 | + pipboy_available_at_game_start = value == 1 || value == 2; |
| 759 | + } |
745 | 760 | } |
746 | 761 |
|
747 | 762 | // NOTE: Uncollapsed 0x497918. |
|
0 commit comments