Skip to content

Commit 1cdda87

Browse files
committed
add some UFOExtender options:
no alien freakout messages
1 parent 26ce27c commit 1cdda87

5 files changed

Lines changed: 16 additions & 9 deletions

File tree

bin/data/Language/en-GB.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,3 +1322,5 @@ en-GB:
13221322
STR_3X: "3x"
13231323
STR_FPS_LIMIT: "FPS limit"
13241324
STR_FPS_LIMIT_DESC: "Limits the number of screen updates per second, 0 for no limit. Note: this will only affect software modes, as OpenGL handles this itself."
1325+
STR_NOALIENPANICMESSAGES: "Supress panic messages for aliens"
1326+
STR_NOALIENPANICMESSAGES_DESC: "Don't show panic messages for aliens unless it is visible to the player."

bin/data/Language/en-US.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,3 +1322,5 @@ en-US:
13221322
STR_3X: "3x"
13231323
STR_FPS_LIMIT: "FPS limit"
13241324
STR_FPS_LIMIT_DESC: "Limits the number of screen updates per second, 0 for no limit. Note: this will only affect software modes, as OpenGL handles this itself."
1325+
STR_NOALIENPANICMESSAGES: "Supress panic messages for aliens"
1326+
STR_NOALIENPANICMESSAGES_DESC: "Don't show panic messages for aliens unless it is visible to the player."

src/Battlescape/BattlescapeGame.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,19 +1046,21 @@ bool BattlescapeGame::handlePanickingUnit(BattleUnit *unit)
10461046
{
10471047
UnitStatus status = unit->getStatus();
10481048
if (status != STATUS_PANICKING && status != STATUS_BERSERK) return false;
1049-
unit->setVisible(true);
1050-
getMap()->getCamera()->centerOnPosition(unit->getPosition());
10511049
_save->setSelectedUnit(unit);
10521050

10531051
// show a little infobox with the name of the unit and "... is panicking"
10541052
Game *game = _parentState->getGame();
1055-
if (status == STATUS_PANICKING)
1053+
if (unit->getVisible() || !Options::noAlienPanicMessages)
10561054
{
1057-
game->pushState(new InfoboxState(game, game->getLanguage()->getString("STR_HAS_PANICKED", unit->getGender()).arg(unit->getName(game->getLanguage()))));
1058-
}
1059-
else
1060-
{
1061-
game->pushState(new InfoboxState(game, game->getLanguage()->getString("STR_HAS_GONE_BERSERK", unit->getGender()).arg(unit->getName(game->getLanguage()))));
1055+
getMap()->getCamera()->centerOnPosition(unit->getPosition());
1056+
if (status == STATUS_PANICKING)
1057+
{
1058+
game->pushState(new InfoboxState(game, game->getLanguage()->getString("STR_HAS_PANICKED", unit->getGender()).arg(unit->getName(game->getLanguage()))));
1059+
}
1060+
else
1061+
{
1062+
game->pushState(new InfoboxState(game, game->getLanguage()->getString("STR_HAS_GONE_BERSERK", unit->getGender()).arg(unit->getName(game->getLanguage()))));
1063+
}
10621064
}
10631065

10641066
unit->abortTurn(); //makes the unit go to status STANDING :p

src/Engine/Options.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ void create()
164164
_info.push_back(OptionInfo("strafe", &strafe, false, "STR_STRAFE", "STR_BATTLESCAPE"));
165165
_info.push_back(OptionInfo("skipNextTurnScreen", &skipNextTurnScreen, false, "STR_SKIPNEXTTURNSCREEN", "STR_BATTLESCAPE"));
166166
_info.push_back(OptionInfo("TFTDDamage", &TFTDDamage, false, "STR_TFTDDAMAGE", "STR_BATTLESCAPE"));
167+
_info.push_back(OptionInfo("noAlienPanicMessages", &noAlienPanicMessages, false, "STR_NOALIENPANICMESSAGES", "STR_BATTLESCAPE"));
167168

168169
// controls
169170
_info.push_back(OptionInfo("keyOk", &keyOk, SDLK_RETURN, "STR_OK", "STR_GENERAL"));

src/Engine/Options.inc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ OPT PathPreview battleNewPreviewPath;
2929
OPT int battleScrollSpeed, battleDragScrollButton, battleFireSpeed, battleXcomSpeed, battleAlienSpeed, battleExplosionHeight, battlescapeScale;
3030
OPT bool traceAI, sneakyAI, battleInstantGrenade, battleNotifyDeath, battleTooltips, battleHairBleach, battleAutoEnd,
3131
strafe, showMoreStatsInInventoryView, allowPsionicCapture, skipNextTurnScreen, disableAutoEquip,
32-
battleUFOExtenderAccuracy, battleConfirmFireMode, battleSmoothCamera, TFTDDamage;
32+
battleUFOExtenderAccuracy, battleConfirmFireMode, battleSmoothCamera, TFTDDamage, noAlienPanicMessages;
3333
OPT SDLKey keyBattleLeft, keyBattleRight, keyBattleUp, keyBattleDown, keyBattleLevelUp, keyBattleLevelDown, keyBattleCenterUnit, keyBattlePrevUnit, keyBattleNextUnit, keyBattleDeselectUnit,
3434
keyBattleUseLeftHand, keyBattleUseRightHand, keyBattleInventory, keyBattleMap, keyBattleOptions, keyBattleEndTurn, keyBattleAbort, keyBattleStats, keyBattleKneel,
3535
keyBattleReserveKneel, keyBattleReload, keyBattlePersonalLighting, keyBattleReserveNone, keyBattleReserveSnap, keyBattleReserveAimed, keyBattleReserveAuto,

0 commit comments

Comments
 (0)