Skip to content

Commit

Permalink
Hidden movement background change frequency option
Browse files Browse the repository at this point in the history
  • Loading branch information
MeridianOXC committed Dec 29, 2023
1 parent bfaf3ee commit 8abbf53
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/Battlescape/NextTurnState.cpp
Expand Up @@ -69,8 +69,19 @@ NextTurnState::NextTurnState(SavedBattleGame *battleGame, BattlescapeState *stat
// set random hidden movement/next turn background for this turn
if (_battleGame->getSide() == FACTION_PLAYER)
{
_battleGame->setRandomHiddenMovementBackground(_game->getMod());
state->getMap()->refreshHiddenMovementBackground();
bool change = false;
if (Options::oxceHiddenMovementBackgroundChangeFrequency > 0)
{
if (_battleGame->getTurn() % Options::oxceHiddenMovementBackgroundChangeFrequency == 0)
{
change = true;
}
}
if (change)
{
_battleGame->setRandomHiddenMovementBackground(_game->getMod());
state->getMap()->refreshHiddenMovementBackground();
}
}

_currentTurn = _battleGame->getTurn() < 1 ? 1 : _battleGame->getTurn();
Expand Down
1 change: 1 addition & 0 deletions src/Engine/Options.cpp
Expand Up @@ -275,6 +275,7 @@ void create()
_info.push_back(OptionInfo("oxceShowBaseNameInPopups", &oxceShowBaseNameInPopups, false, "", "HIDDEN"));
_info.push_back(OptionInfo("oxceGeoscapeDebugLogMaxEntries", &oxceGeoscapeDebugLogMaxEntries, 1000, "", "HIDDEN"));
_info.push_back(OptionInfo("oxceGeoscapeEventsInstantDelivery", &oxceGeoscapeEventsInstantDelivery, true, "", "HIDDEN"));
_info.push_back(OptionInfo("oxceHiddenMovementBackgroundChangeFrequency", &oxceHiddenMovementBackgroundChangeFrequency, 1, "", "HIDDEN"));

// controls
_info.push_back(OptionInfo("keyOk", &keyOk, SDLK_RETURN, "STR_OK", "STR_GENERAL"));
Expand Down
1 change: 1 addition & 0 deletions src/Engine/Options.inc.h
Expand Up @@ -127,6 +127,7 @@ OPT bool oxceDisableInventoryTuCost;
OPT bool oxceShowBaseNameInPopups;
OPT int oxceGeoscapeDebugLogMaxEntries;
OPT bool oxceGeoscapeEventsInstantDelivery;
OPT int oxceHiddenMovementBackgroundChangeFrequency;

// Flags and other stuff that don't need OptionInfo's.
OPT bool mute, reload, newOpenGL, newScaleFilter, newHQXFilter, newXBRZFilter, newRootWindowedMode, newFullscreen, newAllowResize, newBorderless;
Expand Down

0 comments on commit 8abbf53

Please sign in to comment.