Difference between revisions of "Understanding UPK side UI coding - XCOM:EU 2012"

From Nexus Mods Wiki
Jump to: navigation, search
(References)
(Details)
Line 26: Line 26:
 
* ''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.
 
* ''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.
 
* ''XG<name>UI'': referred in the code as the "manager".  Handles most data manipulation.
 +
 +
Many (if not most) ''ActionScript'' SWF files related to UIs are embedded in two UPK files:
 +
* Command1.upk
 +
** XComIcons.swf has '''icons'''
 +
* GlobalPersistentCookerData.upk
 +
 +
See the wiki article [[Flash SWF Editing]] for information about how to extract and edit SWF files.
  
 
==Examples==
 
==Examples==

Revision as of 04:19, 25 February 2014

Overview

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, with additional contributions from the UI Editing thread.

Programs and Tools

UE Explorer from:

Details

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.

Many (if not most) ActionScript SWF files related to UIs are embedded in two UPK files:

  • Command1.upk
    • XComIcons.swf has icons
  • GlobalPersistentCookerData.upk

See the wiki article Flash SWF Editing for information about how to extract and edit SWF files.

Examples

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.)

References

Referred to by this article:



That refer to this article:

  • None as yet