GUI Editing - RTHKKona/MHGU-Modding GitHub Wiki

Credits to Fexty

Fexty modified his MHW GUI editor that works with MHGU's various GUI files.

MHGU-GUI-Editor

Explanation of GUI Files

The basic building blocks of GUI files are instances. Instances are basically where the code starts interacting with the GUI data and where rendering begins. Instances themselves don't have any visual representation and essentially just embody a UI element.

An instance usually has a set of init params which are applied upon object creation (at runtime). These can include Position, Scale, etc. The most prevalent instance type in GU is cGUIInstAnimation. This instance type always references an Animation (via an init param). Animations are the next lower level in the hierarchy. All visuals are wrapped in an animation even if they aren't technically animated (in which case it would just be a 0 frame animation).

Animations further reference sequences as well as objects. Objects are make up all visual elements of a GUI file and are represented as a tree structure with a parent-child relationship.

Like instances, objects also have init params. The init params of any given object also directly affect any child objects of that object. The root of an object tree is always a cGUIObjRoot, usually with one or more cGUIObjNull as direct children.

Here's some common object types: cGUIObjNull: Essentially serves as a way to apply broad parameter changes to all child objects, doesn't have any inherent functionality cGUIObjTexture: Displays a texture (or part of it) cGUIObjTextureSet: Displays multiple parts of a single texture cGUIObjPolygon: Just a regular polygon (I think it has to be a quad) with a color

Object parameters can also be animated via the use of sequences. An animation first defines a list of sequences, for example "DEFAULT", "SELECT", and "DISABLE". Objects can then animate their properties via the use of object-sequences, corresponding to a sequence. These can specify keyframes and values to animate. These animation values are known as Params. Furthermore, instances are also able to reference animations from different gui files. As an example of this, the chat.gui file references window_quest.gui so it doesn't have to redefine what a window is, etc.

Quest UI

In-quest UI is split across many gui files. You can find most of them in eng\GUI\01_quest. For example, the map for jurassic forest is in eng\GUI\01_quest\map\m01\map01dn.gui. The zoomed in map has a separate gui file for each area in eng\GUI\01_quest\map\m01\m01aXXdn.gui.

General Info

  • "Overview" is basically just some general info about the file
  • The Resource Manager is where you can add and remove textures from the file. You need to add a texture here before you can reference it in a texture object
  • Tree Viewer is basically where you'll be doing most editing. It displays the entire instance, animation, and object hierarchy as it is represented in-game

Tutorial

  • Check out this Video/Tutorial for more information.
  • Open up the preview window with View > Preview OR CTRL-SHIFT-P