diff --git a/src/d_event.h b/src/d_event.h index 9e90054a3..962286b8f 100644 --- a/src/d_event.h +++ b/src/d_event.h @@ -55,7 +55,7 @@ struct event_t }; -typedef enum +enum gameaction_t : int { ga_nothing, ga_loadlevel, @@ -75,7 +75,7 @@ typedef enum ga_screenshot, ga_togglemap, ga_fullconsole, -} gameaction_t; +}; diff --git a/src/doomdef.h b/src/doomdef.h index 5a1d1f95f..a07985bb6 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -64,7 +64,7 @@ typedef enum // The current state of the game: whether we are // playing, gazing at the intermission screen, // the game final animation, or a demo. -typedef enum +enum gamestate_t : int { GS_LEVEL, GS_INTERMISSION, @@ -79,7 +79,7 @@ typedef enum GS_FORCEWIPEFADE = -2, GS_FORCEWIPEBURN = -3, GS_FORCEWIPEMELT = -4 -} gamestate_t; +}; extern gamestate_t gamestate; diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index 41d8644ea..735fddba7 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -851,7 +851,10 @@ void InitThingdef() fieldptr = new PField("playeringame", parray, VARF_Native | VARF_Static | VARF_ReadOnly, (intptr_t)&playeringame); Namespaces.GlobalNamespace->Symbols.AddSymbol(fieldptr); - fieldptr = new PField("gameaction", TypeUInt8, VARF_Native | VARF_Static, (intptr_t)&gameaction); + fieldptr = new PField("gameaction", TypeUInt32, VARF_Native | VARF_Static, (intptr_t)&gameaction); + Namespaces.GlobalNamespace->Symbols.AddSymbol(fieldptr); + + fieldptr = new PField("gamestate", TypeSInt32, VARF_Native | VARF_Static | VARF_ReadOnly, (intptr_t)&gamestate); Namespaces.GlobalNamespace->Symbols.AddSymbol(fieldptr); fieldptr = new PField("skyflatnum", TypeTextureID, VARF_Native | VARF_Static | VARF_ReadOnly, (intptr_t)&skyflatnum); diff --git a/wadsrc/static/zscript/constants.txt b/wadsrc/static/zscript/constants.txt index 6996da6cc..e2390cfd1 100644 --- a/wadsrc/static/zscript/constants.txt +++ b/wadsrc/static/zscript/constants.txt @@ -1029,6 +1029,18 @@ enum PaletteFlashFlags PF_HAZARD = 8, }; +enum EGameState +{ + GS_LEVEL, + GS_INTERMISSION, + GS_FINALE, + GS_DEMOSCREEN, + GS_FULLCONSOLE, + GS_HIDECONSOLE, + GS_STARTUP, + GS_TITLELEVEL, +} + enum EGameAction { ga_nothing,