Skip to content

Latest commit

 

History

History
241 lines (195 loc) · 9.66 KB

File metadata and controls

241 lines (195 loc) · 9.66 KB

FUI File Structure Documentation

Base Information

FUI Files are Mojangs/4J's way of storing Game UI Assets.

FUI files use the LSB(Little Endian) byte order.

The following Table gives you Important information about each structure that can be represented in a FUI file:

Name Size (per element) Description
Header 0x98 Header Information (only exists once in each FUI file, always at offset 0)
Timeline 0x1c
TimelineAction 0x84
Shape 0x1c
ShapeComponent 0x2c
Vert 0x8 2D float Vertex
TimelineFrame 0x48
TimelineEvent 0x48
TimelineEventName 0x40 Name for a given event
Reference 0x48 Reference to Symbols in Imported Assests(Files)
Edittext 0x138
FontName 0x104
Symbol 0x48 Defined Symbols with Name and Object type (entry point for objects used in-game)
ImportAsset 0x40 file name to import references from
Bitmap 0x20 Information about an Image contained in the file
Image Data vary Image data where all color channels are swapped (RGBA => ABGR). only affects png files

Used structures in an FUI element

These structures are used in some Elements in an FUI file

Name Byte Size Description
Rect 0x10 A Representation of a Rectangle
RGBA 0x4 Base Color format used in files
Matrix 0x18 2D Matrix for Scale, Rotation and Translation
ColorTransform 0x20
FillStyle 0x24 Contains Information for filling
Object.eFuiObjectType 0x4 Describes the Type of an Element

Rect

Name Offset Byte Size Type Description
Min. X 0x0 4 float Minimun X position
Max. X 0x4 4 float Maximun X position
Min. Y 0x8 4 float Minimun Y position
Max. Y 0xc 4 float Maximun Y position

RGBA

Name Offset Byte Size Type Description
Color 0x0 4 int 8-bit Color in RGBA byte order

Matrix

Standard Matrix3x2

Name Offset Byte Size Type Description
M11 0x0 4 float Scale X
M12 0x4 4 float Skew X
M21 0x8 4 float Skew Y
M22 0xC 4 float Scale Y
M31 0x10 4 float Translation X
M32 0x14 4 float Translation Y

ColorTransform

Name Offset Byte Size Type Description
RedAddTerm 0x0 4 float
GrennAddTerm 0x4 4 float
BlueAddTerm 0x8 4 float
AlphaAddTerm 0xc 4 float
RedMultTerm 0x10 4 float
GrennMultTerm 0x14 4 float
BlueMultTerm 0x18 4 float
AlphaMultTerm 0x1c 4 float

FillStyle

Name Offset Byte Size Type Description
Type/Operation 0x0 4 int wheather to use a bitmap or fill area with a given color
Color 0x4 4 RGBA color to use when filling area
Bitmap Index 0x8 4 int Index of the bitmap to use
Matrix 0xc 0x18 Matrix matrix for area ?

FUI Header

The FUI file Header is the most crucial part of an fui file it holds infomation for allocating memory at runtime, counts of fui Objects and is part of the in-game fuifile class

Name Offset Byte Size Type Description
Signature 0x0 8 char[] FUI File Signature (b'\x01IUF\x00\x00\x00\x00') where (\x01) indecates the version of the fui file
Content Size 0x8 4 int Size of the up coming data in the FUI file
Swf File Name 0xc 0x40 char[] Name used to import file
Timeline Count 0x4c 4 int Count of Timeline Elements in a file
TimelineEventName Count 0x50 4 int Count of TimelineEventName Elements in a file
TimelineAction Count 0x54 4 int Count of TimelineAction Elements in a file
Shape Count 0x58 4 int Count of Shape Elements in a file
ShapeComponent Count 0x5c 4 int Count of ShapeComponent Elements in a file
Vert Count 0x60 4 int Count of Vert Elements in a file
TimelineFrame Count 0x64 4 int Count of TimelineFrame Elements in a file
TimelineEvent Count 0x68 4 int Count of TimelineEvent Elements in a file
Reference Count 0x6c 4 int Count of Reference Elements in a file
Edittext Count 0x70 4 int Count of Edittext Elements in a file
Symbol Count 0x74 4 int Count of Symbol Elements in a file
Bitmap Count 0x78 4 int Count of Bitmap Elements in a file
images size 0x7c 4 int Size of all Images in the file
FontName Count 0x80 4 int Count of FontName Elements in a file
ImportAsset Count 0x84 4 int Count of ImportAsset Elements in a file
Frame Size 0x88 0x10 Rect Size of the frame ?

Timeline

Name Offset Byte Size Type Description
Symbol Index 0x0 4 int Index of the symbol to use. -1 if it has no symbol linked.
Frame Index 0x4 2 short Index in TimelineFrame array
Frame Count 0x6 2 short Count of how many TimelineFrame's are used
Action Index 0x8 2 short Index in TimelineAction array
Action Count 0xa 2 short Count of how many TimelineAction's are used
Rectangle 0xc 0x10 Rect Unknown Rect

TimelineAction

Name Offset Byte Size Type Description
Action Type 0x0 2 uint16_t similar to SWF 3 actions
Frame Index 0x2 2 short
String Arg 0 0x4 0x40 char[]
String Arg 1 0x44 0x40 char[]

Shape

Name Offset Byte Size Type Description
Unknown 0x0 4 int
Shape Component Index 0x4 4 int
Shape Component Count 0x8 4 int
Rectangle 0xc 0x10 Rect Size of th given Shape(Component)

ShapeComponent

Name Offset Byte Size Type Description
Fill Info 0x0 0x24 FillStyle Component Fill Info
Vert Index 0x24 4 int
Vert Count 0x28 4 int

Vert

Name Offset Byte Size Type Description
X 0x0 4 float X Position of the Vertex
Y 0x4 4 float Y Position of the Vertex

TimelineFrame

Name Offset Byte Size Type Description
Frame Name 0x0 0x40 char[] Name of the Frame
Event Index 0x40 4 int Index to start from TimelineEvent
Event Count 0x44 4 int Count of TimelineEvents that get used

TimelineEvent

Name Offset Byte Size Type Description
Event Type 0x0 0x2 uint16_t
Object Type 0x2 0x2 uint8_t
Unknown 0x3 0x1 uint8_t
Unknown 0x4 0x2 short
Index 0x6 0x2 short
Unknown 0x8 0x2 short
Name Index 0xa 0x2 short index to look up in TimelineEventName buffer
Matrix 0xc 0x18 Matrix
ColorTransform 0x24 0x20 ColorTransform
Color 0x44 4 RGBA

TimelineEventName

Name Offset Byte Size Type Description
Event Name 0x0 0x40 char[] Name of the Timeline Event

Reference

Name Offset Byte Size Type Description
Symbol Index 0x0 4 int Index of Symbol (resolved at runtime)
Name 0x4 0x40 char[] Reference to a Symbol that is contained in an Import asset
Index 0x44 4 int File Index (resolved at runtime)

Edittext

Name Offset Byte Size Type Description
Unknown 0x0 4 int
Rectangle 0x4 0x10 Rect
Font Id 0x14 4 int
Unknown 0x18 4 float
Color 0x1c 4 RGBA
Unknown 0x20 0x18 int 6 unknwon int
Html text 0x38 0x100 char[]

FontName

Name Offset Byte Size Type Description
Id 0x0 4 int
Font Name 0x4 0x100 char[] Name of the Font

Symbol

Name Offset Byte Size Type Description
Symbol Name 0x0 0x40 char[] Name of the Symbol
Object Type 0x40 4 int Symbols can only have two types (2 = Timeline, 3 = Bitmap)
Index 0x44 4 int Index mapped to the object type list

ImportAsset

Name Offset Byte Size Type Description
Name 0x0 0x40 char[] File Name to import from

Bitmap

Name Offset Byte Size Type Description
Symbol Index 0x0 4 int Index of a given symbol (-1 if not set).
Format 0x4 4 int Format to use (see Bitmap).
Width 0x8 4 int Width of the given Image (possiblly used for memory allocation)
Height 0xc 4 int Height of the given Image (possiblly used for memory allocation)
Offset 0x10 4 int Offset of the Image
Size 0x14 4 int Size of the image
Zlib Data Offset 0x18 4 int zlib data start offset (only set when JPEG_WITH_ALPHA_DATA is set)
Texture handle 0x1c 4 int when set to 0 it'll auto generate the required texture buffer else look it up in a loaded texture map