-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add screen listener for versioning. Currently not working for some
reason.
- Loading branch information
1 parent
37e302f
commit b889941
Showing
5 changed files
with
62 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
X2CommunityHighlander/Src/X2CommunityHighlander/Classes/X2CH_UIScreenListener_ShellSplash.uc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters