Skip to content

Commit

Permalink
Config gate creation of auto-generated photos (#1453)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackDog86 committed Jan 14, 2025
1 parent 7bdf62b commit 2e75e8e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 5 deletions.
3 changes: 3 additions & 0 deletions X2WOTCCommunityHighlander/Config/XComGame.ini
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,6 @@ iMixedCharacterPoolChance = 50

;;; Issue #1398 - Change to adjust the delay of the 'Squad member dead' voiceline after a unit is killed
fSquadMemberDeadVoicelineDelay = 3.0f

; Issue #1453 - Uncomment to disable automatic photobooth poster generation (when set, only photos manually taken by the player will be saved)
;bDisableAutomaticPhotos = true
3 changes: 3 additions & 0 deletions X2WOTCCommunityHighlander/Src/XComGame/Classes/CHHelpers.uc
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ var config bool bForce24hclockLeadingZero;
// Variable for Issue #1398 - Number of seconds to wait after a unit is killed before playing the 'OnSquadMemberDead' voiceline
var config float fSquadMemberDeadVoicelineDelay;

// Variable for Issue #1453
var config bool bDisableAutomaticPhotos;

// Start Issue #885
enum EHLDelegateReturn
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,14 @@ function LoadPhotoboothAutoGenDeadSoldiers()
Unit = XComGameState_Unit(`XCOMHISTORY.GetGameStateForObjectID(XComHQ.Squad[SquadIndex].ObjectID));

// Check for high ranking soldier death,
if (!Unit.bCaptured && Unit.IsDead() && Unit.GetSoldierRank() >= 3)
// Single Line for Issue #1453 - Additional config gate to disable automatic memorial photo
/// HL-Docs: feature:DisableAutoPhotobooth; issue:1453; tags:strategy,tactical
/// Several places in the game (UIAfterAction, XComHQPresentationLayer, UISoldierBondConfirmScree and UIMissionSummary)
/// request the auto-generation of photos for the photobooth. Such photos are coded to be taken when the user doesn't take
/// a photo manually at the end of a mission, when a soldier above Sergeant rank dies, when a soldier is promoted to Sergeant
/// or Major rank and when two soldiers are bonded. The auto-photos are usually of poor quality and the ability to disable
/// them is a useful feature for modders.
if (!Unit.bCaptured && Unit.IsDead() && Unit.GetSoldierRank() >= 3 && !class'CHHelpers'.default.bDisableAutomaticPhotos)
{
`HQPRES.GetPhotoboothAutoGen().AddDeadSoldier(Unit.GetReference());
bRequestAdded = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,8 @@ simulated function CloseScreenTakePhoto()
{
bClosingScreen = true;
if (!BattleData.IsMultiplayer() && !bAllSoldiersDead && !bUserPhotoTaken)
// Single Line for Issue #1453 - Additional config gate to disable automatic mission-end photo
if (!BattleData.IsMultiplayer() && !bAllSoldiersDead && !bUserPhotoTaken && !class'CHHElpers'.default.bDisableAutomaticPhotos)
{
NavHelp.ContinueButton.DisableButton();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,12 @@ function ConfirmClicked(UIButton Button)
// Ask the player if they want to make a poster when forming the first bond
if (BondData.BondLevel == 0)
{
KickOffAutoGen();

// Begin Issue #1453 - Config gate to disable auto-generation of soldier bond photo
if(!class'CHHelpers'.default.bDisableAutomaticPhotos)
{
KickOffAutoGen();
}
// End Issue #1453
DialogData.eType = eDialog_Normal;
DialogData.bMuteAcceptSound = true;
DialogData.strTitle = m_strMakePosterTitle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,8 @@ function UIArmory_Promotion(StateObjectReference UnitRef, optional bool bInstant

// Check for rank up to Sergeant or Major
bValidRankUp = (PreviousRank < 3 && Unit.GetSoldierRank() >= 3) || (PreviousRank < 6 && Unit.GetSoldierRank() >= 6);
if (!Unit.bCaptured && Unit.IsAlive() && bValidRankUp)
// Single Line for Issue #1453 - Additional config gate to disable auto-generation of promotion photo
if (!Unit.bCaptured && Unit.IsAlive() && bValidRankUp && !class'CHHelpers'.default.bDisableAutomaticPhotos)
{
`HQPRES.GetPhotoboothAutoGen().AddPromotedSoldier(Unit.GetReference());
`HQPRES.GetPhotoboothAutoGen().RequestPhotos();
Expand Down

0 comments on commit 2e75e8e

Please sign in to comment.