Skip to content

Commit

Permalink
Add screen listener for versioning. Currently not working for some
Browse files Browse the repository at this point in the history
reason.
  • Loading branch information
MalucoMarinero committed Aug 7, 2017
1 parent 37e302f commit b889941
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 110 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", "{1C324CDF-E320-46CF-A407-B3C510845AAF}"
Project("{5DAE07AF-E217-45C1-8DE7-FF99D6011E8A}") = "X2CommunityHighlander", "X2CommunityHighlander\X2CommunityHighlander.x2proj", "{4D637F30-1C48-46C7-9C88-48598D80A595}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|XCOM 2 = Debug|XCOM 2
Default|XCOM 2 = Default|XCOM 2
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{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
{4D637F30-1C48-46C7-9C88-48598D80A595}.Debug|XCOM 2.ActiveCfg = Debug|XCOM 2
{4D637F30-1C48-46C7-9C88-48598D80A595}.Debug|XCOM 2.Build.0 = Debug|XCOM 2
{4D637F30-1C48-46C7-9C88-48598D80A595}.Default|XCOM 2.ActiveCfg = Debug|XCOM 2
{4D637F30-1C48-46C7-9C88-48598D80A595}.Default|XCOM 2.Build.0 = Debug|XCOM 2
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
class X2CH_UIScreenListener_ShellSplash extends UIScreenListener;

var UIText VersionText;

event OnInit(UIScreen Screen)
{
local UIShell ShellScreen;
local X2StrategyElementTemplateManager Manager;
local X2StrategyElementTemplate LWElem, CHElem;
local CHXComGameVersionTemplate CHVersion;
local LWXComGameVersionTemplate LWVersion;
local String VersionString;

if(UIShell(Screen) == none) // this captures UIShell and UIFinalShell
return;

ShellScreen = UIShell(Screen);

Manager = class'X2StrategyElementTemplateManager'.static.GetStrategyElementTemplateManager();

CHElem = Manager.FindStrategyElementTemplate('CHXComGameVersion');
LWElem = Manager.FindStrategyElementTemplate('LWXComGameVersion');

VersionString = "";

if (CHElem != none)
{
CHVersion = CHXComGameVersionTemplate(CHElem);
VersionString = VersionString $ "X2CommunityHighlander Version " $ CHVersion.MajorVersion $ "." $ CHVersion.MinorVersion $ ". ";
}

if (LWElem != none)
{
LWVersion = LWXComGameVersionTemplate(LWElem);
VersionString = VersionString $ "Long War Highlander Version " $ LWVersion.MajorVersion $ "." $ LWVersion.MinorVersion $ ". ";
}

`log("X2CH SCREEN LISTENER ON SPLASH");
VersionText = ShellScreen.Spawn(class'UIText', ShellScreen);
VersionText.InitText();
VersionText.SetText(VersionString);
VersionText.AnchorTopRight();
VersionText.SetPosition(10,10);
VersionText.SetSize(400,32);
VersionText.Show();
}

defaultProperties
{
ScreenClass = none
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,113 +8,11 @@
// Copyright (c) 2016 Firaxis Games, Inc. All rights reserved.
//---------------------------------------------------------------------------------------

class X2DownloadableContentInfo_X2CommunityHighlander extends X2DownloadableContentInfo;
class X2DownloadableContentInfo_X2CommunityHighlander extends X2DownloadableContentInfo config(Game);

/// <summary>
/// This method is run if the player loads a saved game that was created prior to this DLC / Mod being installed, and allows the
/// DLC / Mod to perform custom processing in response. This will only be called once the first time a player loads a save that was
/// create without the content installed. Subsequent saves will record that the content was installed.
/// </summary>
static event OnLoadedSavedGame()
{

}

/// <summary>
/// This method is run when the player loads a saved game directly into Strategy while this DLC is installed
/// </summary>
static event OnLoadedSavedGameToStrategy()
{

}

/// <summary>
/// Called when the player starts a new campaign while this DLC / Mod is installed. When a new campaign is started the initial state of the world
/// is contained in a strategy start state. Never add additional history frames inside of InstallNewCampaign, add new state objects to the start state
/// or directly modify start state objects
/// </summary>
static event InstallNewCampaign(XComGameState StartState)
{

}

/// <summary>
/// Called just before the player launches into a tactical a mission while this DLC / Mod is installed.
/// Allows dlcs/mods to modify the start state before launching into the mission
/// </summary>
static event OnPreMission(XComGameState StartGameState, XComGameState_MissionSite MissionState)
{

}

/// <summary>
/// Called when the player completes a mission while this DLC / Mod is installed.
/// </summary>
static event OnPostMission()
{

}

/// <summary>
/// Called when the player is doing a direct tactical->tactical mission transfer. Allows mods to modify the
/// start state of the new transfer mission if needed
/// </summary>
static event ModifyTacticalTransferStartState(XComGameState TransferStartState)
{

}

/// <summary>
/// Called after the player exits the post-mission sequence while this DLC / Mod is installed.
/// </summary>
static event OnExitPostMissionSequence()
{

}

/// <summary>
/// Called after the Templates have been created (but before they are validated) while this DLC / Mod is installed.
/// </summary>
static event OnPostTemplatesCreated()
{

}

/// <summary>
/// Called when the difficulty changes and this DLC is active
/// </summary>
static event OnDifficultyChanged()
{

`log("x2communityhighlander :: present and correct");
}

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

/// <summary>
/// Called when viewing mission blades with the Shadow Chamber panel, used primarily to modify tactical tags for spawning
/// Returns true when the mission's spawning info needs to be updated
/// </summary>
static function bool UpdateShadowChamberMissionInfo(StateObjectReference MissionRef)
{
return false;
}

/// <summary>
/// Called from X2AbilityTag:ExpandHandler after processing the base game tags. Return true (and fill OutString correctly)
/// to indicate the tag has been expanded properly and no further processing is needed.
/// </summary>
static function bool AbilityTagExpandHandler(string InString, out string OutString)
{
return false;
}
/// <summary>
/// Called from XComGameState_Unit:GatherUnitAbilitiesForInit after the game has built what it believes is the full list of
/// abilities for the unit based on character, class, equipment, et cetera. You can add or remove abilities in SetupData.
/// </summary>
static function FinalizeUnitAbilitiesForInit(XComGameState_Unit UnitState, out array<AbilitySetupData> SetupData, optional XComGameState StartState, optional XComGameState_Player PlayerState, optional bool bMultiplayerDisplay)
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ function int GetVersionNumber(optional out int Major, optional out int Minor, op
defaultproperties
{
MajorVersion = 1;
MinorVersion = 3;
MinorVersion = 4;
}

3 changes: 3 additions & 0 deletions X2CommunityHighlander/X2CommunityHighlander.x2proj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
<Content Include="Config\XComEngine.ini" />
<Content Include="Config\XComGame.ini" />
<Content Include="Localization\XComGame.int" />
<Content Include="Src\X2CommunityHighlander\Classes\X2CH_UIScreenListener_ShellSplash.uc">
<SubType>Content</SubType>
</Content>
<Content Include="Src\X2CommunityHighlander\Classes\X2DownloadableContentInfo_X2CommunityHighlander.uc" />
<Content Include="Src\XComGame\Classes\AnimNotify_CinescriptEvent.uc">
<SubType>Content</SubType>
Expand Down

0 comments on commit b889941

Please sign in to comment.