Skip to content

Commit

Permalink
Solves Issue #271 (#272)
Browse files Browse the repository at this point in the history
* Solves Issue #271
Adds a DLCInfo hook to XComHumanPawn:UpdateAnimations

* Fixed unit state determination

* Moved UpdateAnimation hook to XComUnitPawn
  • Loading branch information
Musashi1584 authored and MalucoMarinero committed Aug 7, 2017
1 parent 8f2cf29 commit 63934b6
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 9 deletions.
10 changes: 5 additions & 5 deletions X2CommunityHighlander.XCOM_sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ 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", "{1C324CDF-E320-46CF-A407-B3C510845AAF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|XCOM 2 = Debug|XCOM 2
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
{1C324CDF-E320-46CF-A407-B3C510845AAF}.Debug|XCOM 2.ActiveCfg = Debug|XCOM 2
{1C324CDF-E320-46CF-A407-B3C510845AAF}.Debug|XCOM 2.Build.0 = Debug|XCOM 2
{1C324CDF-E320-46CF-A407-B3C510845AAF}.Default|XCOM 2.ActiveCfg = Default|XCOM 2
{1C324CDF-E320-46CF-A407-B3C510845AAF}.Default|XCOM 2.Build.0 = Default|XCOM 2
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ static event OnDifficultyChanged()

}

simulated function EnableDLCContentPopupCallback(eUIAction eAction)
{

}
//simulated function EnableDLCContentPopupCallback(eUIAction eAction)
//{
//
//}

/// <summary>
/// Called when viewing mission blades with the Shadow Chamber panel, used primarily to modify tactical tags for spawning
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,3 +451,14 @@ static function int RemoveDoomFromFortress(XComGameState_HeadquartersAlien Alien
return 0;
}
/// End Issue #230

/// Start Issue #271
/// <summary>
/// Called from XComUnitPawn:UpdateAnimations
/// CustomAnimSets will be added to the pawns animsets
/// </summary>
static function UpdateAnimations(out array<AnimSet> CustomAnimSets, XComGameState_Unit UnitState, XComUnitPawn Pawn)
{

}
/// End Issue #271
53 changes: 53 additions & 0 deletions X2CommunityHighlander/Src/XComGame/Classes/XComUnitPawn.uc
Original file line number Diff line number Diff line change
Expand Up @@ -3177,6 +3177,59 @@ function PlayHQIdleAnim(optional name OverrideAnimName, optional bool bIsCapture
{
}

// Start Issue #271
simulated exec function UpdateAnimations()
{
local XComGameStateHistory History;
local XComGameStateHistory TempHistory;
local UIScreenStack ScreenStack;
local array<X2DownloadableContentInfo> DLCInfos;
local array<AnimSet> CustomAnimSets;
local XComGameState_Unit UnitState;
local CharacterPoolManager CPManager;
local int i;

super.UpdateAnimations();

History = `XCOMHISTORY;
ScreenStack = `SCREENSTACK;

if (ScreenStack.GetCurrentScreen() == none) // We're at the Main Menu
{
`ONLINEEVENTMGR.LatestSaveState(TempHistory);
UnitState = XComGameState_Unit(TempHistory.GetGameStateForObjectID(ObjectID));
}
else if (`SCREENSTACK.IsInStack(class'UICharacterPool')) // We're at the Character Pool
{
CPManager = CharacterPoolManager(`XENGINE.GetCharacterPoolManager());
for (i = 0; i < CPManager.CharacterPool.Length; ++i)
{
UnitState = CPManager.CharacterPool[i];
if (UnitState.GetReference().ObjectID == ObjectID)
{
break;
}
}
}
else // We're at a Saved Game
{
UnitState = XComGameState_Unit(History.GetGameStateForObjectID(ObjectID));
}

if (UnitState != none)
{
DLCInfos = `ONLINEEVENTMGR.GetDLCInfos(false);
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

//Request from the narrative moment to play dialog
function QueueDialog(name DialogAnimName)
{
Expand Down

0 comments on commit 63934b6

Please sign in to comment.