Jump to content

Remove parts of the HUD?


LiQuiD911

Recommended Posts

Hello! Could someone please point me where to look if I wanted to remove part of the hud? Like the objective list during exalt missions , the soldier/camera controls in the lower left corner (along with their tooltips), the radar in bomb missions etc.. I don't use them anyway and they clutter the screen.

Link to comment
Share on other sites

It's about time to learn unreal-script-fu xD

So let's suppose I found what I was looking for in UIInterfaceMgr and want to remove DialogBox. What is the next step? DialogBox := null and remove the line DialogBox.Init(XComPlayerController(m_pPres.Owner), self); ? Or am I supposed to mess with the "show" functions of each single element? Like add "Hide" at the end of DialogBox.OnInit()

 

class UIInterfaceMgr extends UIFxsMovie
config(UI);

var UIMessageMgr MessageMgr;
var UIAnchoredMessageMgr AnchoredMessageMgr;
var UINarrativeCommLink CommLink;
var UIDialogueBox DialogBox;
var private bool bShownNormally;
var private int ForceShowCount;

simulated function OnInit()
{
super.OnInit();
MessageMgr = m_pPres.Spawn(class'UIMessageMgr', m_pPres);
MessageMgr.Init(XComPlayerController(m_pPres.Owner), self);
AnchoredMessageMgr = m_pPres.Spawn(class'UIAnchoredMessageMgr', m_pPres);
AnchoredMessageMgr.Init(XComPlayerController(m_pPres.Owner), self);
CommLink = m_pPres.Spawn(class'UINarrativeCommLink', m_pPres);
CommLink.Init(XComPlayerController(m_pPres.Owner), self);
DialogBox = m_pPres.Spawn(class'UIDialogueBox', m_pPres);
DialogBox.Init(XComPlayerController(m_pPres.Owner), self);
// End:0x26A
if(XComPresentationLayerBase(m_pPres) != none)
{
XComPresentationLayerBase(m_pPres).InitUIScreens();
}
//return;
}

Edited by LiQuiD911
Link to comment
Share on other sites

Instead of messing with UnrealScript logic a different approach would be to prevent certain UI components from being placed in the HUD directly in the embedded Scaleform GFX files. Here's a few instructions to get you started:

  • grab a copy of Toolboks EW and extract GFX files from UICollection_Tactical_SF.upk (via Extract SWFs button inside Custom Mods tab)
  • grab a copy of JPEXS Free Flash Decompiler and open the TacticalHUD file with it (should be named UICollection_Tactical_SF_23.swf)
  • browse the list of sprite definitions and locate the TacticalHUD MC sprite:

http://i.imgur.com/gBvWoXg.png

  • observe how inside that sprite various sub-sprites are placed with descriptive names like theObjectivesList and theRadarMC
  • switch to Hex Dump view (in the File menu ribbon) and locate the corresponding DefineSprite entry:

http://i.imgur.com/75rEXrr.png

  • observe how selecting an element in the left-hand tree view will highlight the corresponding byte sequence in the right-hand hex view
  • open UICollection_Tactical_SF.upk with a hex editor (like HxD) and locate the highlighted byte sequence (for instance using a text search for "theObjectivesList")
  • select the highlighted sequence and use Edit -> Fill Selection... to replace the sequence with zero bytes:

http://i.imgur.com/hDGyAlY.png

  • et voilà, you now (deliberately) broke part of the HUD :smile:
  • repeat for other sprites

 

Note how the camera controls sprite (called MouseControls) is nowhere to be found inside the TacticalHUD MC sprite (or any other sprite for that matter). This is because the component is dynamically placed via ActionScript instead of being pre-placed and toggled on/off conditionally like the radar or objectives. One simple way to work around that is to garble the script identifier of the mouse controls sprite, like so:

  • open the TacticalHUD file in JPEXS and locate the DefineSprite tag of the MouseControls sprite (id 370):

http://i.imgur.com/rw1aMIA.png

  • ignore the sprite tag and observe how it's followed by an ExportAssets tag - this is used to define the script identifier
  • locate the highlighted byte sequence using a hex editor and replace the name part with any other byte sequence (e.g. zero bytes or random characters)

Now the script for dynamically attaching the mouse controls cannot find the corresponding sprite and therefore no such component will show up on the HUD.

 

Enjoy!

Link to comment
Share on other sites

Thank you for the detailed instructions! But I think I might have screwed something up following them because it broke the mouse/keyboard controls... However I managed to hide the elements I wanted by setting their spriteid to 0x0000.

 

Here are the patches if anyone wanted to lighten up their hud. They SHOULD work on any EW/LONGWAR version

 

 

 

MOD_NAME=HUD Cleaner -MOUSE CONTROLS-
DESCRIPTION=Removes the hud for the mouse controls
UPK_FILE=UICollection_Tactical_SF.upk

//button pause 327
FIND_HEX =47 01 86 00 3F 03 27 00
MODDED_HEX =00 00 86 00 3F 03 27 00

//button cursor down 330
FIND_HEX =4A 01 86 00 3F 03 27 00
MODDED_HEX =00 00 86 00 3F 03 27 00

//button cursor up 332
FIND_HEX =4C 01 86 00 3F 03 27 00
MODDED_HEX =00 00 86 00 3F 03 27 00

//button rotate right 335
FIND_HEX =4f 01 86 00 3F 03 27 00
MODDED_HEX =00 00 86 00 3F 03 27 00

//button rotate left 338
FIND_HEX =52 01 86 00 3F 03 27 00
MODDED_HEX =00 00 86 00 3F 03 27 00

//button next 341
FIND_HEX =55 01 86 00 3F 03 27 00
MODDED_HEX =00 00 86 00 3F 03 27 00

//button prev 344
FIND_HEX =58 01 86 00 3F 03 27 00
MODDED_HEX =00 00 86 00 3F 03 27 00

//button end 346
FIND_HEX =5a 01 86 00 3F 03 27 00
MODDED_HEX =00 00 86 00 3F 03 27 00

//button shotinfo 350
FIND_HEX =5e 01 96 00 3F 03 27 00
MODDED_HEX =00 00 96 00 3F 03 27 00

//button cancelshot 353
FIND_HEX =63 01 01 00 86 06 06 02
MODDED_HEX =00 00 01 00 86 06 06 02

//button spacer 355
FIND_HEX =61 01 86 00 3F 03 27 00
MODDED_HEX =00 00 86 00 3F 03 27 00

//button unit info 359
FIND_HEX =67 01 96 00 3F 03 27 00
MODDED_HEX =00 00 96 00 3F 03 27 00

 

 

 

MOD_NAME=UI CLEANER -OBJECTIVE LIST-
DESCRIPTION=Removes the objective list from the hud
UPK_FILE=UICollection_Tactical_SF.upk

//button objective list 474
FIND_HEX =da 01 01 00 86 06 06 03
MODDED_HEX =00 00 01 00 86 06 06 03

 

 

 

MOD_NAME=UI CLEANER -RADAR-
DESCRIPTION=Removes the radar from the hud
UPK_FILE=UICollection_Tactical_SF.upk

//button radar 470
FIND_HEX =d6 01 01 00 86 06 06 03 00
MODDED_HEX =00 00 01 00 86 06 06 03 00

 

 

 

 

http://i59.tinypic.com/2s9o9z8.png

Edited by LiQuiD911
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...