Understanding UPK side UI coding - XCOM:EU 2012

From Nexus Mods Wiki
Revision as of 05:30, 6 August 2013 by Dubiousintent (talk | contribs) (Initialization)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


The Understanding ... - XCOM:EU 2012 series of articles present information that is an interpretation of Firaxis Games programming practices as discerned by individuals digging through the XCOM:EU 2012 game engine code, to make it easier for mod creators to follow the code logic. As such, it is best guess, good faith only information, and should not be taken as either authoritative or sanctioned by Firaxis Games. Discussion of the information presented here should be directed to the appropriate R&D series of threads on the Mod Talk forum of the Nexus Forums.

This article explains the general mechanism by which the UI is handled in UPK code. The relevant Mod Talk thread where it was initially presented is R&D to Increase Squad Size.

Programs and Tools

UE Explorer from:


Firaxis appears to use the following for the UPK UI coding conventions. Each UI functionality is typically broken into two parts:

  • UI<name>: the "driver" class typically has a function called GetMgr() that returns the appropriate manager class (i.e. XG<name>UI) associated with the UI. This class is always the one that contains the actionscript calls, and first handles any callbacks from the UI. Typically little or no data handling.
  • XG<name>UI: referred in the code as the "manager". Handles most data manipulation.


For the squad select UI, there is one "manager" and two UI "driver" classes:

  • UISquadSelect ("Driver").
  • UISquadSelect_Squadlist ("Driver"). Appears to handle individual soldier display info, calling the actionscript functions SetAddUnitText, SetSelected, SetUnitHelp, and SetUnitInfo (all of which are defined in the actionscript package Squadlist).
  • XGChooseSquadUI ("Manager").

(They appear to have slightly bent their naming convention here by not using the same core name.)


Referred to by this article:

That refer to this article:

  • None as yet