diff --git a/src/actor.h b/src/actor.h index 7de8a725e..e089de96a 100644 --- a/src/actor.h +++ b/src/actor.h @@ -323,6 +323,7 @@ enum MF6_BLOCKEDBYSOLIDACTORS = 0x00080000, // Blocked by solid actors, even if not solid itself MF6_ADDITIVEPOISONDAMAGE = 0x00100000, MF6_ADDITIVEPOISONDURATION = 0x00200000, + MF6_NOMENU = 0x00400000, // Player class should not appear in the class selection menu. // --- mobj.renderflags --- diff --git a/src/gi.cpp b/src/gi.cpp index 190d2b031..0a3f51dbb 100644 --- a/src/gi.cpp +++ b/src/gi.cpp @@ -250,6 +250,7 @@ void FMapInfoParser::ParseGameInfo() // Insert valid keys here. GAMEINFOKEY_CSTRING(titlePage, "titlePage", 8) GAMEINFOKEY_STRINGARRAY(creditPages, "creditPage", 8) + GAMEINFOKEY_STRINGARRAY(PlayerClasses, "playerclasses", 0) GAMEINFOKEY_STRING(titleMusic, "titleMusic") GAMEINFOKEY_FLOAT(titleTime, "titleTime") GAMEINFOKEY_FLOAT(advisoryTime, "advisoryTime") diff --git a/src/gi.h b/src/gi.h index ef9777553..df50060a9 100644 --- a/src/gi.h +++ b/src/gi.h @@ -79,6 +79,7 @@ struct gameinfo_t TArray finalePages; TArray infoPages; TArray DefaultWeaponSlots[10]; + TArray PlayerClasses; FString titleMusic; float titleTime; diff --git a/src/p_user.cpp b/src/p_user.cpp index eef4f5025..3fecc380f 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -95,40 +95,43 @@ bool FPlayerClass::CheckSkin (int skin) return false; } +bool ValidatePlayerClass(const PClass *ti, const char *name) +{ + if (!ti) + { + Printf ("Unknown player class '%s'\n", name); + return false; + } + else if (!ti->IsDescendantOf (RUNTIME_CLASS (APlayerPawn))) + { + Printf ("Invalid player class '%s'\n", name); + return false; + } + else if (ti->Meta.GetMetaString (APMETA_DisplayName) == NULL) + { + Printf ("Missing displayname for player class '%s'\n", name); + return false; + } + return true; +} + void SetupPlayerClasses () { FPlayerClass newclass; - newclass.Flags = 0; + for (unsigned i=0; iflags6 & MF6_NOMENU)) + { + newclass.Flags |= PCF_NOMENU; + } + PlayerClasses.Push (newclass); + } } } @@ -146,19 +149,7 @@ CCMD (addplayerclass) { const PClass *ti = PClass::FindClass (argv[1]); - if (!ti) - { - Printf ("Unknown player class '%s'\n", argv[1]); - } - else if (!ti->IsDescendantOf (RUNTIME_CLASS (APlayerPawn))) - { - Printf ("Invalid player class '%s'\n", argv[1]); - } - else if (ti->Meta.GetMetaString (APMETA_DisplayName) == NULL) - { - Printf ("Missing displayname for player class '%s'\n", argv[1]); - } - else + if (ValidatePlayerClass(ti, argv[1])) { FPlayerClass newclass; @@ -189,7 +180,8 @@ CCMD (playerclasses) { for (unsigned int i = 0; i < PlayerClasses.Size (); i++) { - Printf ("% 3d %s\n", i, + Printf ("%3d: Class = %s, Name = %s\n", i, + PlayerClasses[i].Type->TypeName.GetChars(), PlayerClasses[i].Type->Meta.GetMetaString (APMETA_DisplayName)); } } diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index 05e5bc3a7..54de97aa8 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -228,6 +228,7 @@ static FFlagDef ActorFlags[]= DEFINE_FLAG(MF6, ADDITIVEPOISONDAMAGE, AActor, flags6), DEFINE_FLAG(MF6, ADDITIVEPOISONDURATION, AActor, flags6), DEFINE_FLAG(MF6, BLOCKEDBYSOLIDACTORS, AActor, flags6), + DEFINE_FLAG(MF6, NOMENU, AActor, flags6), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), diff --git a/wadsrc/static/mapinfo/chex.txt b/wadsrc/static/mapinfo/chex.txt index 469277681..0dac3e7c9 100644 --- a/wadsrc/static/mapinfo/chex.txt +++ b/wadsrc/static/mapinfo/chex.txt @@ -52,6 +52,7 @@ gameinfo menufontcolor_highlight = "BLUE" menufontcolor_selection = "GOLD" menubackbutton = "M_BACK_H" + playerclasses = "ChexPlayer" } skill baby diff --git a/wadsrc/static/mapinfo/doomcommon.txt b/wadsrc/static/mapinfo/doomcommon.txt index 9fd4b9637..2a103d6a9 100644 --- a/wadsrc/static/mapinfo/doomcommon.txt +++ b/wadsrc/static/mapinfo/doomcommon.txt @@ -52,6 +52,7 @@ gameinfo menufontcolor_highlight = "YELLOW" menufontcolor_selection = "BRICK" menubackbutton = "M_BACK_D" + playerclasses = "DoomPlayer" } skill baby diff --git a/wadsrc/static/mapinfo/heretic.txt b/wadsrc/static/mapinfo/heretic.txt index b9f88e2b9..e6876ab2c 100644 --- a/wadsrc/static/mapinfo/heretic.txt +++ b/wadsrc/static/mapinfo/heretic.txt @@ -51,6 +51,7 @@ gameinfo menufontcolor_highlight = "YELLOW" menufontcolor_selection = "DARKGREEN" menubackbutton = "M_BACK_H" + playerclasses = "HereticPlayer" } skill baby diff --git a/wadsrc/static/mapinfo/hexen.txt b/wadsrc/static/mapinfo/hexen.txt index 8f0962a50..46682b56f 100644 --- a/wadsrc/static/mapinfo/hexen.txt +++ b/wadsrc/static/mapinfo/hexen.txt @@ -49,6 +49,7 @@ gameinfo menufontcolor_highlight = "YELLOW" menufontcolor_selection = "BRICK" menubackbutton = "M_BACK_X" + PlayerClasses = "FighterPlayer", "ClericPlayer", "MagePlayer" } skill baby diff --git a/wadsrc/static/mapinfo/strife.txt b/wadsrc/static/mapinfo/strife.txt index ffb70e696..edfe798e6 100644 --- a/wadsrc/static/mapinfo/strife.txt +++ b/wadsrc/static/mapinfo/strife.txt @@ -52,6 +52,7 @@ gameinfo menufontcolor_highlight = "GREEN" menufontcolor_selection = "GOLD" menubackbutton = "M_BACK_S" + PlayerClasses = "StrifePlayer" } skill baby