Skip to content

Commit

Permalink
Added config settings for checks
Browse files Browse the repository at this point in the history
Fixed random commented out
  • Loading branch information
adm244 committed Jun 30, 2018
1 parent befce98 commit e343304
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
8 changes: 5 additions & 3 deletions code/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ internal DWORD WINAPI QueueHandler(LPVOID data)
}

if( IsActivated(&CommandRandom) ) {
/*int index = RandomInt(0, batches_count - 1);
int index = RandomInt(0, batches_count - 1);
QueuePut(&BatchQueue, (pointer)&batches[index]);
DisplayRandomSuccessMessage(batches[index].description);*/
DisplayRandomSuccessMessage(batches[index].description);

/*if (IsMenuOpen("VATSMenu")) {
DisplayMessage("Menu IS opened.");
Expand Down Expand Up @@ -292,7 +292,9 @@ internal DWORD WINAPI QueueHandler(LPVOID data)

internal bool IsActivationPaused()
{
return IsPlayerInDialogue() || IsInMenuMode() || IsMenuOpen("VATSMenu");
return (Settings.IgnoreInDialogue && IsPlayerInDialogue())
|| (Settings.IgnoreInMenu && IsInMenuMode())
|| (Settings.IgnoreInVATS && IsMenuOpen("VATSMenu"));
}

extern "C" void GameLoop()
Expand Down
9 changes: 9 additions & 0 deletions code/silverlib/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ OTHER DEALINGS IN THE SOFTWARE.
#define CONFIG_MESSAGE_TOGGLE_OFF "sMessageToggleOff"
#define CONFIG_TIMER "iTimeout"
#define CONFIG_AUTOSAVE "bAutoSave"
#define CONFIG_CHECK_MENU "bIgnoreInMenu"
#define CONFIG_CHECK_VATS "bIgnoreInVATS"
#define CONFIG_CHECK_DIALOGUE "bIgnoreInDialogue"

#define CONFIG_DEFAULT_SAVEFILE "f4silver_save"
#define CONFIG_DEFAULT_SAVENAME "F4Silver Save"
Expand Down Expand Up @@ -77,6 +80,9 @@ struct SilverSettings {
bool SavePreActivation;
bool SavePostActivation;
bool AutoSaveEnabled;
bool IgnoreInMenu;
bool IgnoreInVATS;
bool IgnoreInDialogue;
uint Timeout;
};

Expand All @@ -92,6 +98,9 @@ internal void SettingsInitialize(HMODULE module)
Settings.ShowMessagesDebug = IniReadBool(module, CONFIG_FILE, CONFIG_SETTINGS_SECTION, CONFIG_SHOWMESSAGES_DEBUG, true);
Settings.ShowMessagesRandom = IniReadBool(module, CONFIG_FILE, CONFIG_SETTINGS_SECTION, CONFIG_SHOWMESSAGES_RANDOM, true);
Settings.AutoSaveEnabled = IniReadBool(module, CONFIG_FILE, CONFIG_SETTINGS_SECTION, CONFIG_AUTOSAVE, true);
Settings.IgnoreInMenu = IniReadBool(module, CONFIG_FILE, CONFIG_SETTINGS_SECTION, CONFIG_CHECK_MENU, true);
Settings.IgnoreInVATS = IniReadBool(module, CONFIG_FILE, CONFIG_SETTINGS_SECTION, CONFIG_CHECK_VATS, true);
Settings.IgnoreInDialogue = IniReadBool(module, CONFIG_FILE, CONFIG_SETTINGS_SECTION, CONFIG_CHECK_DIALOGUE, true);

IniReadString(module, CONFIG_FILE, CONFIG_SETTINGS_SECTION, CONFIG_SAVEFILE,
CONFIG_DEFAULT_SAVEFILE, Strings.SaveFileName, STRING_SIZE);
Expand Down
3 changes: 3 additions & 0 deletions data/f4silver.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ bSaveGamePostActivation=0 ;Save game after command execution
bShowMessages=1 ;Show ingame messages
bShowMessagesDebug=1 ;Print messages to ingame console
bShowMessagesRandom=1 ;Show ingame messages on random command activation
bIgnoreInMenu=1
bIgnoreInVATS=1
bIgnoreInDialogue=1
sSaveFile=f4silver_save
sSaveName=F4Silver Save

Expand Down

0 comments on commit e343304

Please sign in to comment.