ItsMods

Full Version: Menu modding reference
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This post will contain definitions for Menufile elements.
i will keep filling this as im going.
leaving a example here on top:
Code:
#include "ui/menudef.h"
{
    menuDef
    {
        name            "selection_menu"
        visible            0
        fullscreen        0
        rect            0 0 640 480
        border            0

        onOpen
        {

        }
        
        onESC
        {
            close selection_menu;
        }
        
        itemDef
        {
            style            WINDOW_STYLE_FILLED
            rect            160 80 512 512
            backcolor        0.5 0.5 0.5 0.5
            visible            1
        }

        itemDef
        {
            rect            0 0 100 20
            visible            1
            type            ITEM_TYPE_BUTTON
            style            WINDOW_STYLE_FILLED
            origin            100 100
            backcolor        1 0 0 .5
            
            action
            {
                play "mouse_click";
                scriptMenuResponse "cats";
                close selection_menu;
            }
            
            onFocus
            {
                play "mouse_over";
            }
        }
    }
}

Please provide useful information as a respose.
Also give feedback if any of the information is wrong.


name
Quote:The name of the menu or element.
If this is the name of the menu, it has to match the name of the file.

example:
name "selection_menu"

rect
Quote:Creates a rect which can be filled with new elements, rect probably stands for "rectangle"

example:
rect 120 50 250 250

explanation:
rect <x> <y> <height> <width>

style
Quote:Defines the style of the menu-item within a rect.
Can be the following:
WINDOW_STYLE_FILLED
WINDOW_STYLE_SHADER
WINDOW_STYLE_EMPTY

example:
style WINDOW_STYLE_FILLED

type (very unfinished)
Quote:Sets the type of the element.
Can be the following:
ITEM_TYPE_BUTTON
ITEM_TYPE_TEXT

example:
type ITEM_TYPE_BUTTON

origin
Quote:Defines where the element originates from.

example:
origin 100 100

explanation:
origin <x> <y>

visible
Quote:Defines wether the element should be visible or not.
Values can be 1 or 0.
default: 1

example:
visible 0

forecolor
Quote:Defines the foregroundcolor of a rect, provided the rect is of the type WINDOW_STYLE_FILLED

example:
forecolor 0.1 0.1 0.1 0.5

explanation:
forecolor <red> <green> <blue> <alpha>


backcolor
Quote:Defines the background color of a rect, provided the rect is of the type WINDOW_STYLE_FILLED

example:
backcolor 0.5 0.5 0.5 0.5

explanation:
backcolor <red> <green> <blue> <alpha>

background
Quote:Sets a background for a rect provided the rect is of the type WINDOW_STYLE_SHADER
the value can be any valid material.

example:
background "hud_selection"

border
Quote:Defines wether a rect should have a border or not.
Values can be 1 or 0.
default: 0

example:
border 1

text
Quote:Sets a text for a ITEM_TYPE_TEXT element.

example:
text "Cat"

textscale
Quote:Sets the textscale for a ITEM_TYPE_TEXT element.
default: 1

example:
textscale 1.2

textfont (very unfinished)
Quote:Sets the font for a ITEM_TYPE_TEXT element.

values:
UI_FONT_NORMAL

example:
textfont UI_FONT_NORMAL

textaligny
Quote:Offset for the text on the y-axis.

default: 0

example:
textaligny 5

Tutorial by fixz - www.modbyte.se
Tutorial has been taken offline, i've no idea why but I saved a copy.

Good luck Smile
Very usefull! Thanks OMA
Very nice Smile

Thank you.
nice, thank you!