From 4ddf6508406e4aec8c39559b6b83775179afb461 Mon Sep 17 00:00:00 2001 From: Henning Waberg Date: Tue, 1 Aug 2017 16:47:50 +0200 Subject: [PATCH] Solves Issue #271 Adds a DLCInfo hook to XComHumanPawn:UpdateAnimations --- X2CommunityHighlander.XCOM_sln | 10 +++++----- .../Classes/X2DownloadableContentInfo.uc | 11 +++++++++++ .../Src/XComGame/Classes/XComHumanPawn.uc | 18 ++++++++++++++++++ 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/X2CommunityHighlander.XCOM_sln b/X2CommunityHighlander.XCOM_sln index 9db7cc7..8a4ec7e 100644 --- a/X2CommunityHighlander.XCOM_sln +++ b/X2CommunityHighlander.XCOM_sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # XCOM ModBuddy Solution File, Format Version 11.00 VisualStudioVersion = 12.0.21005.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{5DAE07AF-E217-45C1-8DE7-FF99D6011E8A}") = "X2CommunityHighlander", "X2CommunityHighlander\X2CommunityHighlander.x2proj", "{D9823686-9E9B-480A-8036-FD6C01870FF8}" +Project("{5DAE07AF-E217-45C1-8DE7-FF99D6011E8A}") = "X2CommunityHighlander", "X2CommunityHighlander\X2CommunityHighlander.x2proj", "{63822BD3-E02C-499B-9328-628A89D1DFE1}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,10 +11,10 @@ Global Default|XCOM 2 = Default|XCOM 2 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D9823686-9E9B-480A-8036-FD6C01870FF8}.Debug|XCOM 2.ActiveCfg = Debug|XCOM 2 - {D9823686-9E9B-480A-8036-FD6C01870FF8}.Debug|XCOM 2.Build.0 = Debug|XCOM 2 - {D9823686-9E9B-480A-8036-FD6C01870FF8}.Default|XCOM 2.ActiveCfg = Default|XCOM 2 - {D9823686-9E9B-480A-8036-FD6C01870FF8}.Default|XCOM 2.Build.0 = Default|XCOM 2 + {63822BD3-E02C-499B-9328-628A89D1DFE1}.Debug|XCOM 2.ActiveCfg = Debug|XCOM 2 + {63822BD3-E02C-499B-9328-628A89D1DFE1}.Debug|XCOM 2.Build.0 = Debug|XCOM 2 + {63822BD3-E02C-499B-9328-628A89D1DFE1}.Default|XCOM 2.ActiveCfg = Default|XCOM 2 + {63822BD3-E02C-499B-9328-628A89D1DFE1}.Default|XCOM 2.Build.0 = Default|XCOM 2 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/X2CommunityHighlander/Src/XComGame/Classes/X2DownloadableContentInfo.uc b/X2CommunityHighlander/Src/XComGame/Classes/X2DownloadableContentInfo.uc index 2496d17..e658344 100644 --- a/X2CommunityHighlander/Src/XComGame/Classes/X2DownloadableContentInfo.uc +++ b/X2CommunityHighlander/Src/XComGame/Classes/X2DownloadableContentInfo.uc @@ -451,3 +451,14 @@ static function int RemoveDoomFromFortress(XComGameState_HeadquartersAlien Alien return 0; } /// End Issue #230 + +/// Start Issue #271 +/// +/// Called from XComHumanPawn:UpdateAnimations +/// CustomAnimSets will be added to the pawns animsets +/// +static function UpdateAnimations(out array CustomAnimSets, XComGameState_Unit UnitState, XComHumanPawn Pawn) +{ + +} +/// End Issue #271 \ No newline at end of file diff --git a/X2CommunityHighlander/Src/XComGame/Classes/XComHumanPawn.uc b/X2CommunityHighlander/Src/XComGame/Classes/XComHumanPawn.uc index 20dce2e..0843cf1 100644 --- a/X2CommunityHighlander/Src/XComGame/Classes/XComHumanPawn.uc +++ b/X2CommunityHighlander/Src/XComGame/Classes/XComHumanPawn.uc @@ -436,6 +436,12 @@ simulated exec function UpdateAnimations() { local CustomAnimParams AnimParams, RemoveParams; + // Variables for Issue #271 + local array DLCInfos; + local array CustomAnimSets; + local XComGameState_Unit UnitState; + local int i; + super.UpdateAnimations(); if( TorsoContent != none && TorsoContent.UnitPawnAnimSets.Length > 0 ) @@ -452,6 +458,18 @@ simulated exec function UpdateAnimations() } XComReaddCarryAnimSets(); + + // Start Issue #271 + DLCInfos = `ONLINEEVENTMGR.GetDLCInfos(false); + UnitState = XComGameState_Unit(`XCOMHISTORY.GetGameStateForObjectID(ObjectID)); + for(i = 0; i < DLCInfos.Length; ++i) + { + CustomAnimSets.Length = 0; + DLCInfos[i].UpdateAnimations(CustomAnimSets, UnitState, self); + if (CustomAnimSets.Length > 0) + XComAddAnimSetsExternal(CustomAnimSets); + } + // End Issue #271 } simulated function AddRequiredAnimSets()