- Expose ConsoleState to scripts

- Make ConsoleState uint8_t sized
This commit is contained in:
nashmuhandes 2022-07-16 18:13:53 +08:00 committed by Christoph Oelckers
parent 69778667aa
commit c6ae73d6d2
5 changed files with 17 additions and 7 deletions

View file

@ -104,7 +104,9 @@ bool vidactive = false;
bool cursoron = false;
int ConBottom, ConScroll, RowAdjust;
uint64_t CursorTicker;
constate_e ConsoleState = c_up;
uint8_t ConsoleState = c_up;
DEFINE_GLOBAL(ConsoleState)
static int TopLine, InsertLine;

View file

@ -41,11 +41,10 @@
struct event_t;
typedef enum cstate_t
enum cstate_t : uint8_t
{
c_up=0, c_down=1, c_falling=2, c_rising=3
}
constate_e;
};
enum
{
@ -53,7 +52,7 @@ enum
};
extern int PrintColors[PRINTLEVELS + 2];
extern constate_e ConsoleState;
extern uint8_t ConsoleState;
// Initialize the console
void C_InitConsole (int width, int height, bool ingame);

View file

@ -56,7 +56,7 @@ CVAR(Bool, use_mouse, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR(Bool, k_allowfullscreentoggle, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
extern int paused, chatmodeon;
extern constate_e ConsoleState;
extern uint8_t ConsoleState;
extern bool ToggleFullscreen;
bool GUICapture;

View file

@ -57,7 +57,7 @@ CVAR (Bool, use_mouse, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
extern int WaitingForKey, chatmodeon;
extern constate_e ConsoleState;
extern uint8_t ConsoleState;
static const SDL_Keycode DIKToKeySym[256] =
{

View file

@ -143,6 +143,14 @@ enum EPrintLevel
PRINT_NOLOG = 2048, // Flag - do not print to log file
};
enum EConsoleState
{
c_up = 0,
c_down = 1,
c_falling = 2,
c_rising = 3
};
/*
// These are here to document the intrinsic methods and fields available on
// the built-in ZScript types
@ -211,6 +219,7 @@ struct _ native // These are the global variables, the struct is only here to av
native readonly int consoleplayer;
native readonly double NotifyFontScale;
native readonly int paused;
native readonly ui uint8 ConsoleState;
}
struct System native