-
Notifications
You must be signed in to change notification settings - Fork 73
Description
Currently the version check is done via templates, which was invented when XComGame was the only package being replaced. This has 2 downsides:
- Cannot use this info in
CreateTemplates(orOnPreCreateTemplates) - It relies on
XComGamecreating templates for other packages, which makes it unreliable for error detection since it will reportEnginereplacement as missing ifXComGameone wasn't loaded
While we cannot remove the existing approach due to BC, I propose we switch to a method of class-is-not-none and then getting default values, similar to how the CHEngineVersion template is created, in places which we control (eg. shell) and in future additions (eg. DLC2, #764)
X2WOTCCommunityHighlander/X2WOTCCommunityHighlander/Src/Engine/Classes/CHEngineVersion.uc
Lines 1 to 2 in fb9537d
| // CHL: We can't create templates in Engine, so we use this to create the template in XComGame | |
| class CHEngineVersion extends Object; |
X2WOTCCommunityHighlander/X2WOTCCommunityHighlander/Src/XComGame/Classes/CHXComGameVersion.uc
Lines 25 to 35 in fb9537d
| if (class'Engine.CHEngineVersion' != none) | |
| { | |
| class'X2TacticalGameRuleset'.static.ReleaseScriptLog("X2WOTCCommunityHighlander: Creating Engine version template..."); | |
| `CREATE_X2TEMPLATE(class'CHXComGameVersionTemplate', XComGameVersion, 'CHEngineVersion'); | |
| XComGameVersion.MajorVersion = class'Engine.CHEngineVersion'.default.MajorVersion; | |
| XComGameVersion.MinorVersion = class'Engine.CHEngineVersion'.default.MinorVersion; | |
| XComGameVersion.PatchVersion = class'Engine.CHEngineVersion'.default.PatchVersion; | |
| XComGameVersion.Commit = class'Engine.CHEngineVersion'.default.Commit; | |
| class'X2TacticalGameRuleset'.static.ReleaseScriptLog("X2WOTCCommunityHighlander: Created Engine version template with version" @ XComGameVersion.MajorVersion $ "." $ XComGameVersion.MinorVersion $ "." $ XComGameVersion.PatchVersion); | |
| Templates.AddItem(XComGameVersion); | |
| } |
Lines 46 to 47 in fb9537d
| Comps.AddItem(BuildComponent(Manager.FindStrategyElementTemplate('CHEngineVersion'), SelfVersion, "Engine", true, true)); | |
| Comps.AddItem(BuildComponent(Manager.FindStrategyElementTemplate('CHXComGameVersion'), SelfVersion, "XComGame", true, true)); |