Spellforce-Spell-framework
Loading...
Searching...
No Matches
sf_ui_functions.h
Go to the documentation of this file.
1
8
9#pragma once
11
13 uint16_t x, uint16_t y, uint16_t width, uint16_t height,
14 const char *background_msb, const char *border_msb, float alpha)
15
17 CMnuLabel *new_label, CMnuContainer *parent,
18 char *mesh_char, char *label_char, uint8_t font_index,
19 uint16_t x_pos, uint16_t y_pos, uint16_t width, uint16_t height)
20
22 CMnuLabel *label_ptr, CMnuContainer *parent,
23 char *label_chars, uint8_t font_index,
24 uint16_t x_pos, uint16_t y_pos, uint16_t width, uint16_t height)
25
27 CMnuLabel *label, const char *text)
28
29DECLARE_FUNCTION(void, destroyLabel,
30 CMnuLabel *label)
31
33 CMnuContainer *parent,
34 char *button_mesh_default, char *button_mesh_pressed,
35 char *button_initial_load_mesh, char *button_mesh_disabled,
36 char *label_char, uint8_t font_index,
37 uint16_t x_pos, uint16_t y_pos, uint16_t width, uint16_t height,
38 int button_index, uint32_t callback_func_ptr)
39
40DECLARE_FUNCTION(void, destroyButton,
42
43DECLARE_FUNCTION(void, destroyContainer,
44 CMnuContainer *container)
45
46DECLARE_FUNCTION(void, setElementAlpha,
47 void *_this, float alpha)
48
49DECLARE_FUNCTION(uint32_t, getVisualControl,
51
52DECLARE_FUNCTION(void, setFont,
53 void *_this, void *input)
54
55DECLARE_FUNCTION(void, setBaseAlpha, void *_this, float alpha);
56DECLARE_FUNCTION(void, initializeMenuContainer, CMnuContainer * _this);
57DECLARE_FUNCTION(void, setupMenuContainerData, CMnuContainer *_this, float x, float y,
58 float width,
59 float height,
60 SF_String *background,
61 SF_String *border);
62
63DECLARE_FUNCTION(CMnuSmpButton *, initializeSmpButton, CMnuSmpButton *btn);
64
65DECLARE_FUNCTION(void, createButton, CMnuSmpButton *smpButton,
66 float x_pos, float y_pos,
67 float width, float height,
68 SF_String *default_mesh,
69 SF_String *unkn_mesh_string,
70 SF_String *pressed_mesh,
71 SF_String *disable_mesh);
72
73DECLARE_FUNCTION(void, setButtonIndex, void *, int index);
74
75DECLARE_FUNCTION(void, setMenuButtonFlag, void *container, char flag);
76
77DECLARE_FUNCTION(void, attachCallback, void *, void *,void *, void *);
78
79DECLARE_FUNCTION(void, vfunction16AttachCallback, void *_this, char p1);
80
81DECLARE_FUNCTION(void, vfunction176, void *_this, char p1);
82
83DECLARE_FUNCTION(void, vfunction25, void *_this, char p1);
84
85DECLARE_FUNCTION(void, CMnuBaseSetName, CMnuBase *_this, SF_String *name);
86
87DECLARE_FUNCTION(void, setButtonName, void *button, SF_String *string);
88
89DECLARE_FUNCTION(void, setMenuID, void *container, uint32_t id);
90
91DECLARE_FUNCTION(void, setContainerVisible, void *container, uint32_t visible, uint8_t _unknown);
92DECLARE_FUNCTION(void, setLabelColour, CMnuLabel *_this, float r, float g, float b, char flag);
93
94DECLARE_FUNCTION(void, containerAddControl, CMnuContainer *_this, CMnuBase *CMnubase, char c1, char c2, uint32_t p4);
95DECLARE_FUNCTION(void, menuLabelConstructor, CMnuLabel *_this);
96DECLARE_FUNCTION(void, initMenuElement, void *_this, float xpos, float ypos, float width, float height,
97 SF_String *string);
99DECLARE_FUNCTION(void, menuLabelSetFont, void *_this, SF_Font *font);
100DECLARE_FUNCTION(void, menuLabelSetString, CMnuLabel *_this, SF_String *string);
101DECLARE_FUNCTION(SF_Font *, getFont, SF_FontStruct *_this, uint32_t font_id);
102DECLARE_FUNCTION(uint32_t, setScreenName, void *_this, SF_String *name);
103DECLARE_FUNCTION(void, vfunction175, CMnuLabel *_this, uint8_t param_1);
104DECLARE_FUNCTION(void, setCanFocus, CMnuBase *_this, uint8_t value);
105DECLARE_FUNCTION(void, attachControlToScreen, void *_this, CMnuBase *param_1, uint8_t param_2);
106DECLARE_FUNCTION(void, vfunction12, CMnuBase *_this, float param_1, uint8_t param_2);
107DECLARE_FUNCTION(void, bringToFront, CMnuContainer *_this, void *param_1);
108DECLARE_FUNCTION(void, vfunction163, CMnuContainer *_this, void *param_1);
109
116typedef void *(__cdecl *newOperator_ptr)(uint32_t size);
117
125typedef uint32_t (__cdecl *SFprintf_ptr)(SF_String *_this, const wchar_t *format, ...);
126
127// TODO move breifs down to struct so Doxygen picks them up
129DECLARE_FUNCTION(SF_String *, SFStringConcat, SF_String *destination, SF_String *source);
130DECLARE_FUNCTION(SF_String *, SFStringConcatMulti, SF_String *_this, SF_String *destination, SF_String *source);
132DECLARE_FUNCTION(void, SFStringSetLength, SF_String *_this, uint32_t length);
134DECLARE_FUNCTION(SF_String *, SFStringFromWchar, SF_String *_this, wchar_t value, uint32_t length);
136DECLARE_FUNCTION(void, SFStringDestructor, SF_String *_this);
138DECLARE_FUNCTION(SF_String *, SFStringCopy, SF_String *destination, SF_String *source);
140DECLARE_FUNCTION(SF_String *, SFStringDeepCopy, SF_String *destination, SF_String *source);
142DECLARE_FUNCTION(char *, SFStringCMbStr, SF_String *source);
147DECLARE_FUNCTION(SF_String *, SFStringConstructor_wchar, SF_String *_this, const wchar_t *value);
148
149DECLARE_FUNCTION(uint32_t, vfunction187, void *_this, SF_String *name);
150
151DECLARE_FUNCTION(void, vfunction207, void *_this, CMnuBase *param_1, uint8_t param_2);
152
157typedef struct
158{
160
213
214 /* SF_String API? */
#define DECLARE_FUNCTION(type, name,...)
Declares a function with the specified return type, name, and arguments.
CMnuLabel *(__thiscall * attachMeshedLabel_ptr)(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)
SF_String *(__thiscall * SFStringConstructor_wchar_ptr)(SF_String *_this, const wchar_t *value)
void(__thiscall * vfunction175_ptr)(CMnuLabel *_this, uint8_t param_1)
void(__thiscall * createButton_ptr)(CMnuSmpButton *smpButton, float x_pos, float y_pos, float width, float height, SF_String *default_mesh, SF_String *unkn_mesh_string, SF_String *pressed_mesh, SF_String *disable_mesh)
void(__thiscall * setLabelColour_ptr)(CMnuLabel *_this, float r, float g, float b, char flag)
void(__thiscall * setFont_ptr)(void *_this, void *input)
void(__thiscall * bringToFront_ptr)(CMnuContainer *_this, void *param_1)
void(__thiscall * attachCallback_ptr)(void *, void *, void *, void *)
void(__thiscall * setMenuID_ptr)(void *container, uint32_t id)
void(__thiscall * setButtonName_ptr)(void *button, SF_String *string)
uint32_t(__thiscall * getVisualControl_ptr)(CMnuContainer *_this)
void(__thiscall * menuLabelSetString_ptr)(CMnuLabel *_this, SF_String *string)
CMnuSmpButton *(__thiscall * initializeSmpButton_ptr)(CMnuSmpButton *btn)
SF_Font *(__thiscall * getFont_ptr)(SF_FontStruct *_this, uint32_t font_id)
SF_String *(__thiscall * SFStringConcatMulti_ptr)(SF_String *_this, SF_String *destination, SF_String *source)
void(__thiscall * updateLabelText_ptr)(CMnuLabel *label, const char *text)
void(__thiscall * setElementAlpha_ptr)(void *_this, float alpha)
void(__thiscall * destroyButton_ptr)(CMnuSmpButton *button)
void *(__cdecl * newOperator_ptr)(uint32_t size)
operator new (global allocator). Declared manually (not via DECLARE_FUNCTION) because the real symbol...
SF_String *(__thiscall * SFStringCopy_ptr)(SF_String *destination, SF_String *source)
Shallow copy of source into destination.
void(__thiscall * attachControlToScreen_ptr)(void *_this, CMnuBase *param_1, uint8_t param_2)
void(__thiscall * containerAddControl_ptr)(CMnuContainer *_this, CMnuBase *CMnubase, char c1, char c2, uint32_t p4)
void(__thiscall * menuLabelConstructor_ptr)(CMnuLabel *_this)
SF_String *(__thiscall * SFStringConcat_ptr)(SF_String *destination, SF_String *source)
Appends source to destination.
void(__thiscall * vfunction207_ptr)(void *_this, CMnuBase *param_1, uint8_t param_2)
SF_FontStruct *(__thiscall * getFonts_ptr)(void)
SF_String *(__thiscall * SFStringDeepCopy_ptr)(SF_String *destination, SF_String *source)
Deep copy of source into destination (duplicates the buffer).
void(__thiscall * SFStringConstructor_ptr)(SF_String *_this)
zero-initializes an SF_String (no allocation).
void(__thiscall * setContainerVisible_ptr)(void *container, uint32_t visible, uint8_t _unknown)
void(__thiscall * initializeMenuContainer_ptr)(CMnuContainer *_this)
void(__thiscall * setBaseAlpha_ptr)(void *_this, float alpha)
void(__thiscall * setButtonIndex_ptr)(void *, int index)
void(__thiscall * SFStringDestructor_ptr)(SF_String *_this)
Frees the string's buffers. Call on every SF_String you constructed.
char *(__thiscall * SFStringCMbStr_ptr)(SF_String *source)
Returns the multibyte (char) representation of the string.
void(__thiscall * vfunction25_ptr)(void *_this, char p1)
void(__thiscall * destroyLabel_ptr)(CMnuLabel *label)
void(__thiscall * vfunction176_ptr)(void *_this, char p1)
void(__thiscall * destroyContainer_ptr)(CMnuContainer *container)
void(__thiscall * vfunction12_ptr)(CMnuBase *_this, float param_1, uint8_t param_2)
void(__thiscall * vfunction163_ptr)(CMnuContainer *_this, void *param_1)
void(__thiscall * SFStringSetLength_ptr)(SF_String *_this, uint32_t length)
(Re)allocates the string buffer to hold the given length.
CMnuLabel *(__thiscall * attachLabel_ptr)(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)
void(__thiscall * initMenuElement_ptr)(void *_this, float xpos, float ypos, float width, float height, SF_String *string)
CMnuSmpButton *(__thiscall * attachNewButton_ptr)(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)
SF_String *(__thiscall * SFStringFromWchar_ptr)(SF_String *_this, wchar_t value, uint32_t length)
Fills the string with length repetitions of the given wide char.
uint32_t(__cdecl * SFprintf_ptr)(SF_String *_this, const wchar_t *format,...)
printf-style formatting into an SF_String. Declared manually (not via DECLARE_FUNCTION) because the r...
void(__thiscall * setMenuButtonFlag_ptr)(void *container, char flag)
void(__thiscall * setupMenuContainerData_ptr)(CMnuContainer *_this, float x, float y, float width, float height, SF_String *background, SF_String *border)
CMnuContainer *(__thiscall * createContainer_ptr)(uint16_t x, uint16_t y, uint16_t width, uint16_t height, const char *background_msb, const char *border_msb, float alpha)
void(__thiscall * CMnuBaseSetName_ptr)(CMnuBase *_this, SF_String *name)
uint32_t(__thiscall * setScreenName_ptr)(void *_this, SF_String *name)
SF_String *(__thiscall * SFStringConstructor_char_ptr)(SF_String *_this, const char *char_string)
constructs an SF_String from a null-terminated char string.
void(__thiscall * setCanFocus_ptr)(CMnuBase *_this, uint8_t value)
void(__thiscall * vfunction16AttachCallback_ptr)(void *_this, char p1)
uint32_t(__thiscall * vfunction187_ptr)(void *_this, SF_String *name)
void(__thiscall * menuLabelSetFont_ptr)(void *_this, SF_Font *font)
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)
void __thiscall updateLabelText(CMnuLabel *label, const char *text)
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....
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)
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)
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)
void __thiscall SFStringConstructor(SF_String *_this)
Zero-initializes an SF_String (no allocation). Moved here from sf_vanilla_fix_hook....
Group of functions related to UI manipulation.
setContainerVisible_ptr setContainerVisible
setupMenuContainerData_ptr setupMenuContainerData
menuLabelSetFont_ptr menuLabelSetFont
SFStringConcatMulti_ptr SFStringConcatMulti
setBaseAlpha_ptr setBaseAlpha
getFont_ptr getFont
bringToFront_ptr bringToFront
setMenuID_ptr setMenuID
destroyButton_ptr destroyButton
SFStringCopy_ptr SFStringCopy
setCanFocus_ptr setCanFocus
destroyLabel_ptr destroyLabel
createButton_ptr createButton
attachNewButton_ptr attachNewButton
getFonts_ptr getFonts
menuLabelSetString_ptr menuLabelSetString
SFprintf_ptr SFprintf
SFStringConstructor_ptr SFStringConstructor
menuLabelConstructor_ptr menuLabelConstructor
setElementAlpha_ptr setElementAlpha
attachLabel_ptr attachLabel
vfunction175_ptr vfunction175
vfunction187_ptr vfunction187
initMenuElement_ptr initMenuElement
initializeMenuContainer_ptr initializeMenuContainer
vfunction16AttachCallback_ptr vfunction16AttachCallback
setButtonIndex_ptr setButtonIndex
SFStringFromWchar_ptr SFStringFromWchar
initializeSmpButton_ptr initializeSmpButton
setFont_ptr setFont
destroyContainer_ptr destroyContainer
setLabelColour_ptr setLabelColour
SFStringConcat_ptr SFStringConcat
vfunction25_ptr vfunction25
SFStringConstructor_wchar_ptr SFStringConstructor_wchar
setScreenName_ptr setScreenName
SFStringCMbStr_ptr SFStringCMbStr
vfunction207_ptr vfunction207
attachCallback_ptr attachCallback
vfunction12_ptr vfunction12
SFStringDestructor_ptr SFStringDestructor
updateLabelText_ptr updateLabelText
attachMeshedLabel_ptr attachMeshedLabel
getVisualControl_ptr getVisualControl
CMnuBaseSetName_ptr CMnuBaseSetName
setMenuButtonFlag_ptr setMenuButtonFlag
SFStringConstructor_char_ptr SFStringConstructor_char
attachControlToScreen_ptr attachControlToScreen
SFStringDeepCopy_ptr SFStringDeepCopy
createContainer_ptr createContainer
setButtonName_ptr setButtonName
newOperator_ptr newOperator
vfunction163_ptr vfunction163
vfunction176_ptr vfunction176
containerAddControl_ptr containerAddControl
SFStringSetLength_ptr SFStringSetLength