Spellforce-Spell-framework
Loading...
Searching...
No Matches
sf_ui_wrappers.h File Reference
#include "../../api/sfsf.h"
#include "../../asi/sf_asi.h"
Include dependency graph for sf_ui_wrappers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LOG_PRINTF_FMT(fmt_idx, arg_idx)

Functions

void __thiscall SFStringConstructor (SF_String *_this)
 Zero-initializes an SF_String (no allocation). Moved here from sf_vanilla_fix_hook.c; exposed as uiAPI.SFStringConstructor.
SF_String *__thiscall SFStringConstructor_char (SF_String *_this, const char *char_string)
 Constructs an SF_String from a null-terminated char string. Moved here from sf_vanilla_fix_hook.c; exposed as uiAPI.SFStringConstructor_char.
void __thiscall updateLabelText (CMnuLabel *label, const char *text)
void __thiscall show_mod_list (CMnuSmpButton *button)
void reset_mod_list_screen ()
 Forgets the cached mod list screen so the next open rebuilds it.
void wrap_text (const char *input, char *output, size_t max_width)
 Wraps text to a character width, inserting newlines.
void set_centred_label_text (CMnuLabel *label, const char *text, int panel_width, int y, int height)
 Repositions a label so its widest line sits centred in panel_width, then sets its text. Used by the mod list and custom campaign detail panels.
void apply_label_colour (CMnuLabel *label, float red, float green, float blue)
 Sets a label's normal and highlight colours in one call.
CMnuLabel *__thiscall attachLabel (CMnuLabel *label_ptr, CMnuContainer *parent, char *label_chars, uint8_t font_index, uint16_t x_pos, uint16_t y_pos, uint16_t width, uint16_t height)
CMnuLabel *__thiscall attachMeshedLabel (CMnuLabel *new_label, CMnuContainer *parent, char *mesh_char, char *label_char, uint8_t font_index, uint16_t x_pos, uint16_t y_pos, uint16_t width, uint16_t height)
CMnuSmpButton *__thiscall attachNewButton (CMnuContainer *parent, char *button_mesh_default, char *button_mesh_pressed, char *button_initial_load_mesh, char *button_mesh_disabled, char *label_char, uint8_t font_index, uint16_t x_pos, uint16_t y_pos, uint16_t width, uint16_t height, int button_index, uint32_t callback_func_ptr)
CMnuContainer *__thiscall createContainer (uint16_t x, uint16_t y, uint16_t width, uint16_t height, const char *background_msb, const char *border_msb, float alpha)

Macro Definition Documentation

◆ LOG_PRINTF_FMT

#define LOG_PRINTF_FMT ( fmt_idx,
arg_idx )

Definition at line 7 of file sf_ui_wrappers.h.

Function Documentation

◆ apply_label_colour()

void apply_label_colour ( CMnuLabel * label,
float red,
float green,
float blue )

Sets a label's normal and highlight colours in one call.

Sets both colour slots of a label. (normal and on hover).

Sets a label's normal and highlight colours in one call.

Definition at line 293 of file sf_ui_wrappers.c.

Here is the caller graph for this function:

◆ attachLabel()

CMnuLabel *__thiscall attachLabel ( CMnuLabel * label_ptr,
CMnuContainer * parent,
char * label_chars,
uint8_t font_index,
uint16_t x_pos,
uint16_t y_pos,
uint16_t width,
uint16_t height )

Definition at line 876 of file sf_ui_wrappers.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ attachMeshedLabel()

CMnuLabel *__thiscall attachMeshedLabel ( CMnuLabel * new_label,
CMnuContainer * parent,
char * mesh_char,
char * label_char,
uint8_t font_index,
uint16_t x_pos,
uint16_t y_pos,
uint16_t width,
uint16_t height )

Definition at line 833 of file sf_ui_wrappers.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ attachNewButton()

CMnuSmpButton *__thiscall attachNewButton ( CMnuContainer * parent,
char * button_mesh_default,
char * button_mesh_pressed,
char * button_initial_load_mesh,
char * button_mesh_disabled,
char * label_char,
uint8_t font_index,
uint16_t x_pos,
uint16_t y_pos,
uint16_t width,
uint16_t height,
int button_index,
uint32_t callback_func_ptr )

Definition at line 692 of file sf_ui_wrappers.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createContainer()

CMnuContainer *__thiscall createContainer ( uint16_t x,
uint16_t y,
uint16_t width,
uint16_t height,
const char * background_msb,
const char * border_msb,
float alpha )

Definition at line 537 of file sf_ui_wrappers.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset_mod_list_screen()

void reset_mod_list_screen ( )

Forgets the cached mod list screen so the next open rebuilds it.

Drops every cached mod list pointer, this will ensure we don't crash after a map load.

Must be called every time the main menu is constructed - the engine destroys the menu's control tree (and our containers with it) when a game loads.

Forgets the cached mod list screen so the next open rebuilds it.

Definition at line 166 of file sf_ui_wrappers.c.

Here is the caller graph for this function:

◆ set_centred_label_text()

void set_centred_label_text ( CMnuLabel * label,
const char * text,
int panel_width,
int y,
int height )

Repositions a label so its widest line sits centred in panel_width, then sets its text. Used by the mod list and custom campaign detail panels.

Repositions a label so its text block sits centred, then sets the text.

Repositions a label so its widest line sits centred in panel_width, then sets its text. Used by the mod list and custom campaign detail panels.

Definition at line 280 of file sf_ui_wrappers.c.

Here is the caller graph for this function:

◆ SFStringConstructor()

void __thiscall SFStringConstructor ( SF_String * _this)

Zero-initializes an SF_String (no allocation). Moved here from sf_vanilla_fix_hook.c; exposed as uiAPI.SFStringConstructor.

Definition at line 56 of file sf_ui_wrappers.c.

Here is the caller graph for this function:

◆ SFStringConstructor_char()

SF_String *__thiscall SFStringConstructor_char ( SF_String * _this,
const char * char_string )

Constructs an SF_String from a null-terminated char string. Moved here from sf_vanilla_fix_hook.c; exposed as uiAPI.SFStringConstructor_char.

Note
Relies on uiAPI.SFStringSetLength, which is registered at the very top of initialize_data_hooks() before any code path that can call this.

Definition at line 70 of file sf_ui_wrappers.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ show_mod_list()

void __thiscall show_mod_list ( CMnuSmpButton * button)

Definition at line 606 of file sf_ui_wrappers.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateLabelText()

void __thiscall updateLabelText ( CMnuLabel * label,
const char * text )

Helper function to update label text using SF_String

Parameters
labelThe label to update
textNew text to set

Definition at line 94 of file sf_ui_wrappers.c.

Here is the caller graph for this function:

◆ wrap_text()

void wrap_text ( const char * input,
char * output,
size_t max_width )

Wraps text to a character width, inserting newlines.

Definition at line 16 of file sf_ui_wrappers.c.

Here is the caller graph for this function: