From 940934d318d3dcd80974fc45cda8cf87008289f1 Mon Sep 17 00:00:00 2001 From: BlackDog86 <122568778+BlackDog86@users.noreply.github.com> Date: Tue, 14 Jan 2025 21:08:39 +0000 Subject: [PATCH] Config gate creation of auto-generated photos (#1453) --- X2WOTCCommunityHighlander/Config/XComGame.ini | 6 ++++++ .../Src/XComGame/Classes/CHHelpers.uc | 7 +++++++ .../Src/XComGame/Classes/UIAfterAction.uc | 16 +++++++++++++--- .../Src/XComGame/Classes/UIMissionSummary.uc | 3 ++- .../Classes/UISoldierBondConfirmScreen.uc | 8 ++++++-- .../XComGame/Classes/XComHQPresentationLayer.uc | 3 ++- 6 files changed, 36 insertions(+), 7 deletions(-) diff --git a/X2WOTCCommunityHighlander/Config/XComGame.ini b/X2WOTCCommunityHighlander/Config/XComGame.ini index 8c32dbe5b..30a1c67e5 100644 --- a/X2WOTCCommunityHighlander/Config/XComGame.ini +++ b/X2WOTCCommunityHighlander/Config/XComGame.ini @@ -297,3 +297,9 @@ 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 in certain circumstances +;bDisableAutomaticMissionPhoto = true +;bDisableAutomaticMemorialPhoto = true +;bDisableAutomaticPromotionPhoto = true +;bDisableAutomaticBondPhoto = true \ No newline at end of file diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/CHHelpers.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/CHHelpers.uc index f5ca4e042..24b21e4e9 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/CHHelpers.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/CHHelpers.uc @@ -267,6 +267,13 @@ 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; +// Start Issue #1453 - Variables to disable automatic photobooth photos +var config bool bDisableAutomaticMissionPhoto; +var config bool bDisableAutomaticMemorialPhoto; +var config bool bDisableAutomaticPromotionPhoto; +var config bool bDisableAutomaticBondPhoto; +// End Issue #1453 + // Start Issue #885 enum EHLDelegateReturn { diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/UIAfterAction.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/UIAfterAction.uc index 91b1fbe6b..5d9060e73 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/UIAfterAction.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/UIAfterAction.uc @@ -111,9 +111,19 @@ simulated function InitScreen(XComPlayerController InitController, UIMovie InitM Navigator.SetSelected(m_kSlotList); isBondIconFocused = UIAfterAction_ListItem(m_kSlotList.GetSelectedItem()).BondIcon.bIsFocused; // bsg-jrebar (05/19/17): Keep focus on bond or promote - - LoadPhotoboothAutoGenDeadSoldiers(); - + + // Start 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(!class'CHHelpers'.default.bDisableAutomaticMemorialPhoto) + { + LoadPhotoboothAutoGenDeadSoldiers(); + } + // End Issue #1453 //In case of emergency, and we've missed the cinematic event etc., this will trigger the nave help UI to activate. SetTimer(10.0f, false, nameof(ForceNavHelpOn)); } diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/UIMissionSummary.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/UIMissionSummary.uc index ec796b55a..937efaeaa 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/UIMissionSummary.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/UIMissionSummary.uc @@ -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.bDisableAutomaticMissionPhoto) { NavHelp.ContinueButton.DisableButton(); diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/UISoldierBondConfirmScreen.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/UISoldierBondConfirmScreen.uc index 72517cb82..333dc5ca5 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/UISoldierBondConfirmScreen.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/UISoldierBondConfirmScreen.uc @@ -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(); - + // Start Issue #1453 - Config gate to disable auto-generation of soldier bond photo + if(!class'CHHelpers'.default.bDisableAutomaticBondPhoto) + { + KickOffAutoGen(); + } + // End Issue #1453 DialogData.eType = eDialog_Normal; DialogData.bMuteAcceptSound = true; DialogData.strTitle = m_strMakePosterTitle; diff --git a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComHQPresentationLayer.uc b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComHQPresentationLayer.uc index ade454ec9..054884a76 100644 --- a/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComHQPresentationLayer.uc +++ b/X2WOTCCommunityHighlander/Src/XComGame/Classes/XComHQPresentationLayer.uc @@ -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.bDisableAutomaticPromotionPhoto) { `HQPRES.GetPhotoboothAutoGen().AddPromotedSoldier(Unit.GetReference()); `HQPRES.GetPhotoboothAutoGen().RequestPhotos();