Cavestory Mod API
|
Easy UI management. More...
#include <CSMAPI_BaseModeInstance.h>
Classes | |
class | GLOBAL_CONFIG_STRUCT |
Holds all global config variables for BaseModeInstance. More... | |
struct | ModeConfiguration |
Configuration class for BaseModeInstance. More... | |
struct | ModeInput |
Used for handling input. More... | |
Public Types | |
typedef void(* | ModeCallback_OnEnd) (BaseModeInstance *pMode, const int &iResult, bool &bDelete) |
Callback function for when a mode ends. | |
Public Member Functions | |
BaseModeInstance () | |
Initialize certain values. | |
ModeThreadId | StartAsyncOperation (ModeThreadInstance::ModeCallback_OnThreadLoop pOnLoopFunc, ModeThreadInstance::ModeCallback_OnThreadComplete pOnCompleteFunc=NULL, void *pUserData=NULL) |
Begin a thread-safe asynchronous operation. More... | |
bool | StopThread (ModeThreadId iThreadId, bool bWaitForFinish=false) |
Stop a thread. More... | |
void | StartAllNewThreads () |
Start all new threads. | |
void | FreeAllThreads () |
Stop & wait for all threads to finish. | |
void | EnforceBasicWindowSize (GUI_RECT *pRect) |
Ensure a rect conforms to the size of a basic window. More... | |
int | DrawBasicWindow (GUI_RECT *pRect=NULL) |
Draw a basic window. More... | |
VideoTexture * | GetLocalVideoTexture (int LocalIndex) |
Get a locally allocated video texture object by its index. More... | |
int | AllocTexture (int InsertIndex=-1, int Width=WINDOW_WIDTH, int Height=WINDOW_HEIGHT, int BitsPerPixel=32, int Magnification=-1, int WindowIndex=0) |
Allocate private resources. More... | |
void | FreeTexture (int Index) |
Free a previously allocated texture. More... | |
void | FreeAllTextures () |
Free all allocated textures. | |
bool | IsLocalTextureAllocated (int Index) |
Check to see if a texture at a given local index is allocated. More... | |
void | SelectTexture (int Index) |
Select a previously allocated surface. More... | |
int | GetSelectedTexture () |
Get the currently selected texture. More... | |
void | FinishTexture (int Index) |
Finish drawing a texture. More... | |
void | DrawTexture (int Index, int X=0, int Y=0, unsigned char Alpha=255, bool bSubPixels=false, bool bWrapCoordinates=false) |
Draw an allocated texture onto the screen. More... | |
int | GetTextureCenteredX (int Index) |
Get the screen-centered X position of a texture. More... | |
int | GetTextureCenteredY (int Index) |
Get the screen-centered Y position of a texture. More... | |
GUI_POINT | GetTextureCentered (int Index) |
Get the screen-centered position of a texture. More... | |
int | GetTextureWidth (int Index, bool Magnified=true) |
Get the width of an allocated texture. More... | |
int | GetTextureHeight (int Index, bool Magnified=true) |
Get the height of an allocated texture. More... | |
GUI_POINT | GetTextureRelativeMousePoint (int Index) |
Get the current mouse position relative to a texture. More... | |
virtual bool | StartMode () |
Initialize the mode in free-call mode. More... | |
virtual void | EndMode (int value=0x6FFFFFFF, bool bSchedule=false) |
End this mode. More... | |
void | SetModePaused (bool bValue) |
Set the 'paused' value for this mode. More... | |
virtual bool | ModeTick () |
Run this mode for one frame. More... | |
int | GetRetValue () |
Get the return value for this mode. More... | |
bool | IsModeFreeRunning () |
Check to see if this mode is running in freerun mode. More... | |
ModeConfiguration * | GetModeConfig () |
Get a pointer to this mode's config. More... | |
virtual void | SetDirty () |
Set this mode as dirty. | |
void | ReloadMode () |
Reload this mode. | |
void | ResetMode () |
Reset the mode. | |
void | SetRetValue (int value) |
Set the return value. More... | |
virtual int | DoMode () |
Run this mode until it stops. More... | |
Static Public Member Functions | |
static void | SetGlobalConfig (MODE_GLOBAL_CONFIG_TYPE eType, const char *pValue) |
Set the value of a global config variable. More... | |
static void | ProcessScheduleList () |
Process all schedules. | |
static EventScheduleId | Schedule (unsigned int iDelay, EventSchedulePayloadFunc pPayloadFunc, void *pUserData=NULL, BaseModeInstance *pOwner=NULL) |
Schedule an event for later. More... | |
static bool | CancelSchedule (EventScheduleId iEventId) |
static bool | IsSchedulePending (EventScheduleId iEventId) |
static void | ShowCursor () |
Show the cursor. More... | |
static void | HideCursor () |
Hide the cursor. More... | |
static void | SetCursor (CSMP_CURSOR_TYPE iType, int iEventId=-1, GUI_RECT *pRect=NULL) |
Set the current cursor. More... | |
static CSMP_CURSOR_TYPE | GetCursor (GUI_RECT **pRect=NULL, int *pEventId=NULL) |
Get the current cursor type. More... | |
static void | ReloadOpenModes () |
Reload all currently opened modes. | |
static void | ScheduleReloadOpenModes () |
Reload all currently opened modes. | |
static FontObject * | GetDefaultFont (unsigned int iMagnification=0) |
Get the default font that all GUIs should use. More... | |
static void | ReloadFont (const char *pFontName, const char *pFontPath, int iFontW=-1, int iFontH=-1, unsigned int iMagnification=0) |
Reload the default font. More... | |
static GameProcessMode | ShowTutorialPages (BaseModeInstance *pCaller, int iPageCount,...) |
Show a messagebox that allows the user to scroll through a list of tutorial pages. More... | |
static void | RunGameLogic (bool AllowACT=true) |
Run game logic. More... | |
static void | DrawGame (bool AllowACT=true, int OffsetX=0, int OffsetY=0, bool DoPutFade=true, bool bRunGameLogic=true) |
Draw game elements. More... | |
static void | DrawHUD (int OffsetX=0, int OffsetY=0) |
Draw HUD. | |
static GUI_POINT | GetControlKeySize (const KeyControlStruct *Buttons, int ButtonCount, bool StackControls=false, unsigned int CustomMagnification=0) |
Get the size of what DrawControls() would output to the screen. More... | |
static void | DrawControls (MENU_CONTROLS_DRAW_POSITION DrawPosition, Surface_Ids destSID, const KeyControlStruct *Buttons, int ButtonCount, bool Flash=false, bool StackControls=false, int Alpha=255, unsigned int CustomMagnification=0) |
Draw standard controls. More... | |
Public Attributes | |
struct { | |
ModeCallback_OnEnd OnEnd | |
This is called when the mode is ending, just before 'Free()'. More... | |
} | m_Callbacks |
void * | m_PrivData |
Pointer to private data structure, defined by each mode. | |
Protected Member Functions | |
virtual int | Init ()=0 |
Initialize this mode. More... | |
virtual int | Free ()=0 |
De-initialize this mode. More... | |
virtual int | GetMagnification () |
Fetch the magnification level for this UI. More... | |
virtual int | ModePixelToScreenPixel (int iInput) |
Convert a mode coordinate to screen coordinates. | |
virtual void | QueryMenuControls (KeyControlStruct pControlBuffer[32], int &pControlCount, bool &bStackControls) |
Ask the mode to populate pControlBuffer with its control scheme. More... | |
virtual void | ProcessLogic ()=0 |
Process the logic of this menu. | |
virtual void | ProcessMouse (GUI_POINT mouse_point)=0 |
Process this menu's mouse. More... | |
virtual void | ProcessKeys ()=0 |
Process key input. | |
virtual void | PreRender ()=0 |
Render everything to surfaces. | |
virtual void | Draw ()=0 |
Draw rendered surfaces. | |
virtual void | PostDraw () |
Draw rendered surfaces over top of everything else. | |
bool | IsTooltipOpen () |
Check to see if a tooltip is open. More... | |
bool | CreateTooltip (GUI_POINT point, FontObject *font, const char *text, int life_time=5000) |
Create a tooltip. More... | |
bool | CreateTextureTooltip (GUI_POINT point, FontObject *font, const char *text, int life_time=5000, int Magnification=-1) |
Create a texture tooltip. More... | |
bool | CloseTooltip (bool fade_out=true) |
Close the currently opened tooltip. More... | |
GUI_RECT * | GetTooltipRect () |
Get a pointer to the tooltip's rect. More... | |
void | SetTooltipPosition (GUI_POINT new_position) |
Set the tooltip's position. More... | |
void | ProcessTooltips () |
Process the current & old tooltips. | |
void | DrawTooltips () |
Draw the current & old tooltips. | |
uint32_t | GetRectHoverTime (GUI_POINT mouse_point, GUI_RECT rect) |
A helper method. More... | |
void | ResetRectHover () |
Reset rect hover system. | |
bool | CreateMenuControls (const KeyControlStruct *Buttons, int ButtonCount, bool StackControls=false) |
Create control surfaces. More... | |
void | DrawMenuControls (MENU_CONTROLS_DRAW_POSITION DrawPosition, MENU_CONTROLS_DRAW_FRAME DrawFrame) |
Draw the menu control surfaces generated by CreateMenuControls. More... | |
MENU_CONTROLS_ACTS | GetMenuControlsAct () |
Get the act number of the menu controls menu. More... | |
void | SetMenuControlsAct (MENU_CONTROLS_ACTS NewAct) |
Set the act number of the menu controls menu. More... | |
bool | GrabScreen () |
Backup the screen to a surface. | |
void | DrawScreenGrab () |
Draw the backed up screen. | |
void | UpdateScreenGrab () |
Update the screen grab surface. | |
void | ReleaseScreenGrab () |
Release this mode's screengrab. | |
void | DoEscapeMenu () |
Open the escape menu. More... | |
int | AllocSurface (int InsertIndex=-1, int Width=WINDOW_WIDTH, int Height=WINDOW_HEIGHT, unsigned int iMagnification=0) |
Allocate private resources. More... | |
int | LoadImageToSurface (const char *FileName, int InsertIndex=-1) |
Allocate private resources. More... | |
int | LoadImageToTexture (const char *FileName, int InsertIndex=-1) |
Allocate private resources. More... | |
int | LoadSurfaceIDToSurface (Surface_Ids SurfaceID, int InsertIndex=-1) |
Allocate private resources. More... | |
int | LoadSurfaceIDToTexture (Surface_Ids SurfaceID, int InsertIndex=-1) |
Allocate private resources. More... | |
void | FreeSurface (int Index) |
Free a previously allocated surface. More... | |
void | FreeAllSurfaces () |
Free all allocated surfaces. | |
bool | IsLocalSurfaceAllocated (int Index) |
Check to see if a surface at a given local index is allocated. More... | |
void | SelectSurface (int Index) |
Select a previously allocated surface. More... | |
int | GetSelectedSurface () |
Get the currently selected surface. More... | |
Surface_Ids | LocalSurfaceIndexToGlobal (int Index) |
Convert the local index of a surface we own to a global index. More... | |
int | GlobalSurfaceIndexToLocal (Surface_Ids sId) |
Convert the global index of a surface to a local index. More... | |
void | DrawSurface (int Index, int X=0, int Y=0, unsigned char Alpha=255, bool AbsolutePos=false) |
Draw an allocated surface on the screen. More... | |
int | GetSurfaceWidth (int Index) |
Get the width of an allocated surface. More... | |
int | GetSurfaceHeight (int Index) |
Get the height of an allocated surface. More... | |
int | GetCenteredX (int Index) |
Get the screen-centered X position of a surface. More... | |
int | GetCenteredY (int Index) |
Get the screen-centered Y position of a surface. More... | |
virtual GUI_POINT | TranslateMousePosition (GUI_POINT *pMouseInput, const GUI_POINT &pWindowOffset) |
Translate the mouse position to relative coordinates. More... | |
virtual GUI_POINT | TranslateMousePosition (GUI_POINT *pMouseInput) |
Translate the mouse position to relative coordinates. More... | |
virtual int | GetRelativeScreenWidth () |
Get the game window's width relative to this mode. More... | |
virtual int | GetRelativeScreenHeight () |
Get the game window's height relative to this mode. More... | |
bool | IsFocusedMode () |
Check to see if this mode is the currently focused mode. More... | |
void | InitControlMenu () |
Initialize the control menu. | |
bool | IsControlMenuOpen () |
Check to see if the control menu is open. More... | |
void | RemoveKey (int iInputFlags, KeyInputType iType=KeyInputType::KIT_Key) |
Remove key inputs after processing them. More... | |
GUI_POINT | GetRelativeMousePosition (int iIndex) |
Get the mouse position relative to a surface. More... | |
Static Protected Member Functions | |
static void | CancelAllModeSchedules (BaseModeInstance *pMode) |
Protected Attributes | |
ToolTipStruct | m_OldTooltip |
The tooltip that is fading out. | |
ToolTipStruct | m_CurTooltip |
The tooltip that is currently being shown. | |
ModeConfiguration | m_ModeConfig |
The configuration for this mode. | |
struct BaseModeInstance::ModeInput | m_ModeInput |
Surface_Ids | m_ScreenGrabSurf |
The screen grab surface ID. | |
bool | m_Dirty |
Controls whether this mode should re-render. | |
bool | m_End |
Controls whether this mode should end. | |
bool | m_FreeCall |
Controls whether this mode is in free-call mode. More... | |
bool | m_FreeCall_Paused |
Controls whether this mode is paused or not. | |
int | m_RetValue |
Controls the return value of DoMode() internally. More... | |
Static Protected Attributes | |
static GLOBAL_CONFIG_STRUCT | g_GlobalConfig |
The global configuration. | |
Friends | |
class | ModeInputVector |
class | ModeThreadInstance |
void | SetGameResolution (int iNewWidth, int iNewHeight, int iNewMagnification) |
void CAVESTORY_MOD_API | MessageBox_DrawMode (void *) |
int | ChatEmotes::CheckOpenList (BaseModeInstance *pMode) |
void | Platform::OpenBugReporter () |
Easy UI management.
This class controls most of the new UI in the game, and is packed with features to make developers' lives easy.
FreeRun instances are mode instances that run concurrently with other modes.
Instead of using #gKey, #gKeyTrg, etc. you should use the built-in m_ModeInput struct.
|
protected |
Allocate private resources.
Said resources are privated simply because they should not be tampered with.
InsertIndex | The index in the local surface table to insert the new surface at. Pass '-1' to start from 0. |
Width | The width of the surface. |
Height | The height of the surface. |
Magnification | The magnification level to use. Pass '0' to use GetMagnification() in its place. |
int BaseModeInstance::AllocTexture | ( | int | InsertIndex = -1 , |
int | Width = WINDOW_WIDTH , |
||
int | Height = WINDOW_HEIGHT , |
||
int | BitsPerPixel = 32 , |
||
int | Magnification = -1 , |
||
int | WindowIndex = 0 |
||
) |
Allocate private resources.
Said resources are privated simply because they should not be tampered with.
InsertIndex | The index in the local texture table to insert the new surface at. Pass '-1' to start from 0. |
Width | The width of the texture. |
Height | The height of the texture. |
BitsPerPixel | The bits per pixel. |
Magnification | Magnification level. Leave as '-1' to use the current magnification. |
WindowIndex | The index of the window. |
|
staticprotected |
Cancel | all schedules that belong to a mode instance. |
pMode | The mode to check ownership for. |
|
static |
Cancel | a schedule. |
iEventId | The schedule's ID. |
|
protected |
Close the currently opened tooltip.
fade_out | If true, the tooltip will not fade out, and will instead just instantly dissapear. |
|
protected |
Create control surfaces.
Buttons | A list of keys to use. |
ButtonCount | Number of keys included in Buttons. |
StackControls | Whether to display the controls from top to bottom, or left to right. |
|
protected |
Create a texture tooltip.
point | The point at which the tooltip should be shown at. |
font | The font that should be used to create this tooltip object. |
text | The text that should be shown on this tooltip. |
life_time | The life time of the tooltip, in milliseconds. |
Magnification | The magnification level of the texture. |
|
protected |
Create a tooltip.
point | The point at which the tooltip should be shown at. |
font | The font that should be used to create this tooltip object. |
text | The text that should be shown on this tooltip. |
life_time | The life time of the tooltip, in milliseconds. |
|
protected |
Open the escape menu.
|
virtual |
Run this mode until it stops.
This can be overwritten with a custom mode loop function. By default, this function runs in this order:
int BaseModeInstance::DrawBasicWindow | ( | GUI_RECT * | pRect = NULL | ) |
Draw a basic window.
pRect | The rect to draw the window with. Can be NULL. |
|
static |
Draw standard controls.
DrawPosition | The position to draw the controls at. |
destSID | The destination surface ID. |
Buttons | A list of keys to use. |
ButtonCount | Number of keys included in Buttons. |
Flash | Whether the keys should be pressed or not. |
StackControls | Whether to display the controls from top to bottom, or left to right. |
Alpha | The alpha of the menu. |
CustomMagnification | The custom magnification level to use. Pass '0' to use UI scale. |
|
static |
Draw game elements.
AllowACT | Allow game input. |
OffsetX | X offset for the camera. |
OffsetY | Y offset for the camera. |
DoPutFade | Whether to draw the fade. |
bRunGameLogic | Allow the game logic to run for this call. |
|
protected |
Draw the menu control surfaces generated by CreateMenuControls.
DrawPosition | The position to draw the menu controls at. |
DrawFrame | The frame of the menu controls UI. |
|
protected |
Draw an allocated surface on the screen.
Index | The index of the surface. |
X | The X position to draw the surface at. If MODE_DRAW_CENTERED_SURFACE, it will center it. |
Y | The Y position to draw the surface at. If MODE_DRAW_CENTERED_SURFACE, it will center it. |
Alpha | The alpha of the surface. |
AbsolutePos | If this is true, X and Y are not magnified. |
void BaseModeInstance::DrawTexture | ( | int | Index, |
int | X = 0 , |
||
int | Y = 0 , |
||
unsigned char | Alpha = 255 , |
||
bool | bSubPixels = false , |
||
bool | bWrapCoordinates = false |
||
) |
Draw an allocated texture onto the screen.
Index | The index of the texture. |
X | The X position to draw the texture at. If MODE_DRAW_CENTERED_SURFACE, it will center it. |
Y | The Y position to draw the texture at. If MODE_DRAW_CENTERED_SURFACE, it will center it. |
Alpha | The alpha of the texture. |
bSubPixels | Whether the specified X and Y values are subpixel coordinates or not. |
bWrapCoordinates | Wrap the input coordinates. |
|
virtual |
End this mode.
value | The return value the mode should return. |
bSchedule | Schedule the deletion if this is a freerun mode. |
void BaseModeInstance::EnforceBasicWindowSize | ( | GUI_RECT * | pRect | ) |
Ensure a rect conforms to the size of a basic window.
Helps to deal with broken tiles in the background of the window.
pRect | The rect to enforce the sizing rule on. |
void BaseModeInstance::FinishTexture | ( | int | Index | ) |
Finish drawing a texture.
The | index of the texture. |
|
protectedpure virtual |
De-initialize this mode.
Implemented in MessageBoxMode.
|
protected |
Free a previously allocated surface.
Index | The index of the surface. |
void BaseModeInstance::FreeTexture | ( | int | Index | ) |
Free a previously allocated texture.
Index | The index of the texture. |
|
protected |
Get the screen-centered X position of a surface.
Index | The index of the surface. |
|
protected |
Get the screen-centered Y position of a surface.
Index | The index of the surface. |
|
static |
Get the size of what DrawControls() would output to the screen.
Buttons | A list of keys to use. |
ButtonCount | Number of keys included in Buttons. |
StackControls | Whether to display the controls from top to bottom, or left to right. |
CustomMagnification | The custom magnification level to use. Pass '0' to use UI scale. |
|
static |
Get the current cursor type.
pValidRect | A pointer to a GUI_RECT object that will hold the valid cursortype area. Can be 'NULL'. |
pEventId | A pointer to an int object that will hold the event ID. Can be 'NULL'. |
|
static |
Get the default font that all GUIs should use.
iMagnification | The custom magnification level to use. Pass '0' for default magnification. |
VideoTexture* BaseModeInstance::GetLocalVideoTexture | ( | int | LocalIndex | ) |
Get a locally allocated video texture object by its index.
iLocalIndex | The local index of the texture. |
|
protectedvirtual |
Fetch the magnification level for this UI.
|
protected |
Get the act number of the menu controls menu.
|
inline |
Get a pointer to this mode's config.
A helper method.
It can be used to count how long the mouse pointer has stayed inside of a rect.
mouse_point | The position of the mouse. |
rect | The rect in which the mouse should be in. |
|
protected |
Get the mouse position relative to a surface.
iIndex | The local surface index to make the mouse position relative to. |
|
protectedvirtual |
Get the game window's height relative to this mode.
|
protectedvirtual |
Get the game window's width relative to this mode.
int BaseModeInstance::GetRetValue | ( | ) |
Get the return value for this mode.
|
protected |
Get the currently selected surface.
int BaseModeInstance::GetSelectedTexture | ( | ) |
Get the currently selected texture.
|
protected |
Get the height of an allocated surface.
Index | The index of the surface. |
|
protected |
Get the width of an allocated surface.
Index | The index of the surface. |
GUI_POINT BaseModeInstance::GetTextureCentered | ( | int | Index | ) |
Get the screen-centered position of a texture.
Index | The index of the surface. |
int BaseModeInstance::GetTextureCenteredX | ( | int | Index | ) |
Get the screen-centered X position of a texture.
Index | The index of the surface. |
int BaseModeInstance::GetTextureCenteredY | ( | int | Index | ) |
Get the screen-centered Y position of a texture.
Index | The index of the surface. |
int BaseModeInstance::GetTextureHeight | ( | int | Index, |
bool | Magnified = true |
||
) |
Get the height of an allocated texture.
Index | The index of the texture. |
Magnified | Whether the width should be magnified or not. |
GUI_POINT BaseModeInstance::GetTextureRelativeMousePoint | ( | int | Index | ) |
Get the current mouse position relative to a texture.
Index | The index of the texture. |
int BaseModeInstance::GetTextureWidth | ( | int | Index, |
bool | Magnified = true |
||
) |
Get the width of an allocated texture.
Index | The index of the texture. |
Magnified | Whether the width should be magnified or not. |
|
protected |
Get a pointer to the tooltip's rect.
|
protected |
Convert the global index of a surface to a local index.
Index | The index of the surface. |
|
static |
Hide the cursor.
|
protectedpure virtual |
Initialize this mode.
Implemented in MessageBoxMode.
|
protected |
Check to see if the control menu is open.
|
protected |
Check to see if this mode is the currently focused mode.
|
protected |
Check to see if a surface at a given local index is allocated.
Index | The index in the local surface table to check. |
bool BaseModeInstance::IsLocalTextureAllocated | ( | int | Index | ) |
Check to see if a texture at a given local index is allocated.
Index | The index in the local surface table to check. |
bool BaseModeInstance::IsModeFreeRunning | ( | ) |
Check to see if this mode is running in freerun mode.
|
static |
Checks | if a schedule is still pending. |
iEventId | The schedule's ID. |
|
inlineprotected |
Check to see if a tooltip is open.
Only checks m_CurTooltip.
|
protected |
Allocate private resources.
Said resources are privated simply because they should not be tampered with.
FileName | The filename to load. |
InsertIndex | The index in the local surface table to insert the new surface at. Pass '-1' to start from 0. |
|
protected |
Allocate private resources.
Said resources are privated simply because they should not be tampered with.
FileName | The filename to load. |
InsertIndex | The index in the local surface table to insert the new texture at. Pass '-1' to start from 0. |
|
protected |
Allocate private resources.
Said resources are privated simply because they should not be tampered with.
SurfaceID | The ID of the surface to copy. |
InsertIndex | The index in the local surface table to insert the new surface at. Pass '-1' to start from 0. |
|
protected |
Allocate private resources.
Said resources are privated simply because they should not be tampered with.
SurfaceID | The ID of the surface to copy. |
InsertIndex | The index in the local surface table to insert the new texture at. Pass '-1' to start from 0. |
|
protected |
Convert the local index of a surface we own to a global index.
Index | The index of the surface. |
|
virtual |
Run this mode for one frame.
|
protectedpure virtual |
Process this menu's mouse.
mouse_point | The mouse point. |
Implemented in MessageBoxMode.
|
protectedvirtual |
Ask the mode to populate pControlBuffer with its control scheme.
If pControlCount is set to 0, then the control menu will not be displayed.
pControlBuffer | Populate this buffer with KeyControlStruct. Max 32. |
pControlCount | Set this to how many keys were populated in pControlBuffer. |
bStackControls | Whether to display the controls from top to bottom, or left to right. |
|
static |
Reload the default font.
pFontName | The name of the font. |
pFontPath | The path of the font to try in. Do not lead with a trailing '/' or '\'. |
iMagnification | The custom magnification level to use. Pass '0' for default magnification. |
|
protected |
Remove key inputs after processing them.
Remove a keypress. This should always be used after checking input.
iInputFlags | The flags to remove. |
iType | The type of input to remove the key from. |
|
static |
Run game logic.
AllowACT | Allow game input. |
|
static |
Schedule an event for later.
iDelay | The delay in ms before the payload gets executed. |
pPayloadFunc | The function to call after the delay is exceeded. |
pUserData | The data to include in the call to pPayloadFunc. |
pOwner | The owner of this event. This will be passed to pPayloadFunc. Can be NULL. |
|
protected |
Select a previously allocated surface.
Index | The index of the surface. |
void BaseModeInstance::SelectTexture | ( | int | Index | ) |
Select a previously allocated surface.
Index | The index of the surface. |
|
static |
Set the current cursor.
iType | The cursor type to set. |
iEventId | An attached event ID, so GUI elements can identify if it was themselves that set a cursor. |
pRect | The rect that the mouse should stay within to keep this cursor type. If the mouse exits this rect, then it is set back to NORMAL. This can be 'NULL' to ignore this functionality. |
|
static |
Set the value of a global config variable.
eType | The type of the variable to configure. |
pValue | The value to set. |
|
protected |
Set the act number of the menu controls menu.
Param NewAct The new act descriptor.
void BaseModeInstance::SetModePaused | ( | bool | bValue | ) |
Set the 'paused' value for this mode.
bValue | If 'true', then this mode will be paused. |
void BaseModeInstance::SetRetValue | ( | int | value | ) |
Set the return value.
value | The value it should return. |
|
protected |
Set the tooltip's position.
new_position | The new position to set the tooltip to. |
|
static |
Show the cursor.
|
static |
Show a messagebox that allows the user to scroll through a list of tutorial pages.
pCaller | The mode that should be drawn underneath the tutorial. Can be NULL. |
iPageCount | The number of pages. |
... | Page text for each page. Only accepts char*. |
ModeThreadId BaseModeInstance::StartAsyncOperation | ( | ModeThreadInstance::ModeCallback_OnThreadLoop | pOnLoopFunc, |
ModeThreadInstance::ModeCallback_OnThreadComplete | pOnCompleteFunc = NULL , |
||
void * | pUserData = NULL |
||
) |
Begin a thread-safe asynchronous operation.
pOnLoopFunc | The onloop callback function. |
pOnLoopFunc | The oncomplete callback function. Can be NULL. |
pUserData | The userdata to use for the callback functions. Can be NULL. |
|
virtual |
Initialize the mode in free-call mode.
This allows you to do /other/ stuff and not be limited to the code specified in this mode.
bool BaseModeInstance::StopThread | ( | ModeThreadId | iThreadId, |
bool | bWaitForFinish = false |
||
) |
Stop a thread.
iThreadId | The thread's ID. |
bWaitForFinish | Wait for the thread to finish. |
|
protectedvirtual |
Translate the mouse position to relative coordinates.
pMouseInput | The mouse input to translate. Pass 'NULL' to use current mouse position. |
|
protectedvirtual |
Translate the mouse position to relative coordinates.
pMouseInput | The mouse input to translate. Pass 'NULL' to use current mouse position. |
pWindowOffset | The offset of the window. |
|
protected |
Controls whether this mode is in free-call mode.
Do NOT change this!
|
protected |
Controls the return value of DoMode() internally.
ModeCallback_OnEnd BaseModeInstance::OnEnd |
This is called when the mode is ending, just before 'Free()'.