parent
5731cd6058
commit
ba1715d9b0
18
src/game.cc
18
src/game.cc
|
@ -891,6 +891,24 @@ int gameSetGlobalVar(int var, int value)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SFALL: Display karma changes.
|
||||||
|
if (var == GVAR_PLAYER_REPUTATION) {
|
||||||
|
bool shouldDisplayKarmaChanges = false;
|
||||||
|
configGetBool(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_DISPLAY_KARMA_CHANGES_KEY, &shouldDisplayKarmaChanges);
|
||||||
|
if (shouldDisplayKarmaChanges) {
|
||||||
|
int diff = value - gGameGlobalVars[var];
|
||||||
|
if (diff != 0) {
|
||||||
|
char formattedMessage[80];
|
||||||
|
if (diff > 0) {
|
||||||
|
sprintf(formattedMessage, "You gained %d karma.", diff);
|
||||||
|
} else {
|
||||||
|
sprintf(formattedMessage, "You lost %d karma.", -diff);
|
||||||
|
}
|
||||||
|
displayMonitorAddMessage(formattedMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gGameGlobalVars[var] = value;
|
gGameGlobalVars[var] = value;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -29,6 +29,7 @@ bool sfallConfigInit(int argc, char** argv)
|
||||||
configSetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_MAIN_MENU_FONT_COLOR, 0);
|
configSetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_MAIN_MENU_FONT_COLOR, 0);
|
||||||
configSetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_SKIP_OPENING_MOVIES_KEY, 0);
|
configSetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_SKIP_OPENING_MOVIES_KEY, 0);
|
||||||
configSetString(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_STARTING_MAP_KEY, "");
|
configSetString(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_STARTING_MAP_KEY, "");
|
||||||
|
configSetBool(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_DISPLAY_KARMA_CHANGES_KEY, false);
|
||||||
|
|
||||||
char path[COMPAT_MAX_PATH];
|
char path[COMPAT_MAX_PATH];
|
||||||
char* executable = argv[0];
|
char* executable = argv[0];
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#define SFALL_CONFIG_MAIN_MENU_FONT_COLOR "MainMenuFontColour"
|
#define SFALL_CONFIG_MAIN_MENU_FONT_COLOR "MainMenuFontColour"
|
||||||
#define SFALL_CONFIG_SKIP_OPENING_MOVIES_KEY "SkipOpeningMovies"
|
#define SFALL_CONFIG_SKIP_OPENING_MOVIES_KEY "SkipOpeningMovies"
|
||||||
#define SFALL_CONFIG_STARTING_MAP_KEY "StartingMap"
|
#define SFALL_CONFIG_STARTING_MAP_KEY "StartingMap"
|
||||||
|
#define SFALL_CONFIG_DISPLAY_KARMA_CHANGES_KEY "DisplayKarmaChanges"
|
||||||
|
|
||||||
extern bool gSfallConfigInitialized;
|
extern bool gSfallConfigInitialized;
|
||||||
extern Config gSfallConfig;
|
extern Config gSfallConfig;
|
||||||
|
|
Loading…
Reference in New Issue