|
Cavestory Mod API
|
The base class for GUI elements. More...
#include <CSMAPI_types.h>
Public Types | |
| enum | ProcessReturnType { PRT_DIRTY = 0b000001 , PRT_IGNORE_MOUSE = 0b000010 , PRT_IGNORE_KEYS = 0b000100 , PRT_SELECTED = 0b001000 , PRT_DISABLE_MOUSE_ON_MOVE = 0b010000 , PRT_CHANGED = 0b100000 } |
| Return flags for GuiBase::process and GuiBase::processKeys. More... | |
| typedef void(* | OnHoverChangeCallbackFunc) (GuiBase *, int value) |
| Hover callback. | |
| typedef void(* | OnValueChangeCallbackFunc) (GuiBase *, const char *&newValue) |
| Value change callback. | |
| typedef bool(* | OnValidateChangeCallbackFunc) (GuiBase *, const char *oldValue, char *newValue) |
| Validate change callback. | |
Public Member Functions | |
| GuiBase () | |
| Default constructor. | |
| virtual | ~GuiBase () |
| Default deconstructor. | |
| virtual const char * | getClassName () |
| Get this class' name. More... | |
| virtual void | setSelected (int value)=0 |
| Set this GUI element as selected or not. More... | |
| virtual void | setHovered (int value)=0 |
| Set this GUI element as hovered over or not. More... | |
| virtual bool | isSelected ()=0 |
| Check selection status. More... | |
| virtual bool | isHovered ()=0 |
| Check hover status. More... | |
| virtual bool | isHoverable ()=0 |
| Check hoverability status. More... | |
| virtual int | getSelectableCount () |
| Get the selectable number of elements in this element. More... | |
| virtual int | getHoverableCount () |
| Get the number of elements that can be hovered over in this element. More... | |
| virtual GuiBase * | getHoverable (int index) |
| Get a hoverable sub-element. More... | |
| virtual GuiBase * | getSelectable (int index) |
| Get a selectable sub-element. More... | |
| virtual bool | SelectOnMouseUp () |
| Select on mouse up. More... | |
| virtual void | setFont (FontObject *pFont) |
| Set the font for this GUI element. More... | |
| virtual FontObject * | getFont () |
| Get the font for this GUI element. More... | |
| virtual int | process (GUI_POINT mouse)=0 |
| Process mouse input for this element. More... | |
| virtual void | calculate ()=0 |
| Re-calculate this element's data. More... | |
| virtual void | render ()=0 |
| Render this element. | |
| virtual int | processKeys () |
| Process key input for this element. More... | |
| virtual void | importantRender () |
| Render the important bits of this element. More... | |
| virtual int | getMagnification () |
| GuiBase (const GuiBase &)=delete | |
| GuiBase & | operator= (const GuiBase &)=delete |
| GuiBase (GuiBase &&)=delete | |
| GuiBase & | operator= (GuiBase &&)=delete |
Public Attributes | |
| GuiBase * | pNext |
| GuiBase * | pPrev |
| OnValueChangeCallbackFunc | OnValueChange |
| Called in specific GuiBase children classes to indicate that a value has been changed. | |
| OnValidateChangeCallbackFunc | OnValidateChange |
| Called in specific GuiBase children classes to indicate that a value has been changed. | |
| GUI_RECT | rect |
| The display rect this GUI element will use. | |
| void * | userData |
| Custom user data. | |
| void * | userData2 |
| Custom user data. | |
| unsigned int | customMagnification |
| The magnification to display this element at. | |
| OnHoverChangeCallbackFunc | OnHoverChange |
| Called in specific GuiBase children classes to indicate that the GUI element is being hovered over. | |
| bool | has_special_mouse_processing |
| Has special mouse processing. | |
| GUI_RECT | hotspot_rect |
| The special hotspot rect. | |
| bool | has_special_hotspot_rect |
| Has special hotspot rect; If true, 'process' will be called everytime the mouse is inside of 'hotspot_rect' instead of 'rect'. | |
Static Public Attributes | |
| static unsigned int | defaultCustomMagnification |
| static GuiBase * | gFirst |
Protected Member Functions | |
| void | Link () |
| Link ourselves to the global GUI element linkage. | |
| void | Unlink () |
| Unlink ourselves from the global GUI element linkage. | |
The base class for GUI elements.
Return flags for GuiBase::process and GuiBase::processKeys.
|
pure virtual |
Re-calculate this element's data.
Implemented in SelectableListInfo, SystemMenuInfo, CaveStoryDialogBoxInfo, DrawBitmapInfo, CustomDrawInfo, TabBookInfo, GroupBoxInfo, DraggableWindowInfo, ColorPickerInfo, DropdownBoxInfo, ButtonInfo, SliderIntInfo, CheckBoxInfo, KeyInputInfo, TextInputInfo, ScrollAreaInfo, SelectableLabelInfo, LabelInfo, and CenteredTextInfo.
|
inlinevirtual |
Get this class' name.
Reimplemented in SelectableListInfo, SystemMenuInfo, CaveStoryDialogBoxInfo, DrawBitmapInfo, CustomDrawInfo, TabBookInfo, GroupBoxInfo, DraggableWindowInfo, ColorPickerInfo, DropdownBoxInfo, ButtonInfo, SliderIntInfo, CheckBoxInfo, KeyInputInfo, TextInputInfo, ScrollAreaInfo, SelectableLabelInfo, LabelInfo, and CenteredTextInfo.
|
inlinevirtual |
Get the font for this GUI element.
Reimplemented in TabBookInfo, GroupBoxInfo, DraggableWindowInfo, ColorPickerInfo, DropdownBoxInfo, ButtonInfo, SliderIntInfo, KeyInputInfo, TextInputInfo, SelectableLabelInfo, LabelInfo, and CenteredTextInfo.
|
inlinevirtual |
Get a hoverable sub-element.
| index | The sub-element's index. |
Reimplemented in ColorPickerInfo.
|
inlinevirtual |
Get the number of elements that can be hovered over in this element.
Reimplemented in SelectableListInfo, SystemMenuInfo, TabBookInfo, GroupBoxInfo, DraggableWindowInfo, ColorPickerInfo, DropdownBoxInfo, ButtonInfo, SliderIntInfo, CheckBoxInfo, KeyInputInfo, TextInputInfo, and SelectableLabelInfo.
|
inlinevirtual |
Get a selectable sub-element.
| index | The sub-element's index. |
Reimplemented in ColorPickerInfo.
|
inlinevirtual |
Get the selectable number of elements in this element.
Reimplemented in SelectableListInfo, SystemMenuInfo, TabBookInfo, GroupBoxInfo, DraggableWindowInfo, ColorPickerInfo, DropdownBoxInfo, ButtonInfo, SliderIntInfo, CheckBoxInfo, KeyInputInfo, TextInputInfo, and SelectableLabelInfo.
|
inlinevirtual |
Render the important bits of this element.
Reimplemented in SystemMenuInfo, ColorPickerInfo, DropdownBoxInfo, and SliderIntInfo.
|
pure virtual |
Check hoverability status.
Implemented in SelectableListInfo, SystemMenuInfo, CaveStoryDialogBoxInfo, DrawBitmapInfo, CustomDrawInfo, TabBookInfo, GroupBoxInfo, DraggableWindowInfo, ColorPickerInfo, DropdownBoxInfo, ButtonInfo, SliderIntInfo, CheckBoxInfo, KeyInputInfo, TextInputInfo, ScrollAreaInfo, SelectableLabelInfo, LabelInfo, and CenteredTextInfo.
|
pure virtual |
Check hover status.
Implemented in SelectableListInfo, SystemMenuInfo, CaveStoryDialogBoxInfo, DrawBitmapInfo, CustomDrawInfo, TabBookInfo, GroupBoxInfo, DraggableWindowInfo, ColorPickerInfo, DropdownBoxInfo, ButtonInfo, SliderIntInfo, CheckBoxInfo, KeyInputInfo, TextInputInfo, ScrollAreaInfo, SelectableLabelInfo, LabelInfo, and CenteredTextInfo.
|
pure virtual |
Check selection status.
Implemented in SelectableListInfo, SystemMenuInfo, CaveStoryDialogBoxInfo, DrawBitmapInfo, CustomDrawInfo, TabBookInfo, GroupBoxInfo, DraggableWindowInfo, ColorPickerInfo, DropdownBoxInfo, ButtonInfo, SliderIntInfo, CheckBoxInfo, KeyInputInfo, TextInputInfo, ScrollAreaInfo, SelectableLabelInfo, LabelInfo, and CenteredTextInfo.
|
pure virtual |
Process mouse input for this element.
Implemented in GroupBoxInfo, SelectableListInfo, SystemMenuInfo, CaveStoryDialogBoxInfo, DrawBitmapInfo, CustomDrawInfo, TabBookInfo, DraggableWindowInfo, ColorPickerInfo, DropdownBoxInfo, ButtonInfo, SliderIntInfo, CheckBoxInfo, KeyInputInfo, TextInputInfo, ScrollAreaInfo, SelectableLabelInfo, LabelInfo, and CenteredTextInfo.
|
inlinevirtual |
Process key input for this element.
Reimplemented in SystemMenuInfo, TabBookInfo, DraggableWindowInfo, DropdownBoxInfo, ButtonInfo, SliderIntInfo, CheckBoxInfo, KeyInputInfo, and TextInputInfo.
|
inlinevirtual |
Select on mouse up.
Reimplemented in SelectableListInfo, SliderIntInfo, KeyInputInfo, TextInputInfo, and SelectableLabelInfo.
|
inlinevirtual |
Set the font for this GUI element.
| pFont | The font object to use. |
Reimplemented in SelectableListInfo, SystemMenuInfo, TabBookInfo, GroupBoxInfo, DraggableWindowInfo, ColorPickerInfo, DropdownBoxInfo, ButtonInfo, SliderIntInfo, KeyInputInfo, TextInputInfo, SelectableLabelInfo, LabelInfo, and CenteredTextInfo.
|
pure virtual |
Set this GUI element as hovered over or not.
| value | The hover value. |
Implemented in SelectableListInfo, SystemMenuInfo, CaveStoryDialogBoxInfo, DrawBitmapInfo, CustomDrawInfo, TabBookInfo, GroupBoxInfo, DraggableWindowInfo, ColorPickerInfo, DropdownBoxInfo, ButtonInfo, SliderIntInfo, CheckBoxInfo, KeyInputInfo, TextInputInfo, ScrollAreaInfo, SelectableLabelInfo, LabelInfo, and CenteredTextInfo.
|
pure virtual |
Set this GUI element as selected or not.
| value | The selection value. |
Implemented in SelectableListInfo, SystemMenuInfo, CaveStoryDialogBoxInfo, DrawBitmapInfo, CustomDrawInfo, TabBookInfo, GroupBoxInfo, DraggableWindowInfo, ColorPickerInfo, DropdownBoxInfo, ButtonInfo, SliderIntInfo, CheckBoxInfo, KeyInputInfo, TextInputInfo, ScrollAreaInfo, SelectableLabelInfo, LabelInfo, and CenteredTextInfo.