diff --git a/source/blood/src/blood.h b/source/blood/src/blood.h index e7300f64d..cf59adac2 100644 --- a/source/blood/src/blood.h +++ b/source/blood/src/blood.h @@ -79,7 +79,7 @@ struct GameInterface : ::GameInterface void MenuOpened() override; void MenuClosed() override; bool CanSave() override; - void StartGame(FNewGameStartup& gs) override; + bool StartGame(FNewGameStartup& gs) override; void DrawNativeMenuText(int fontnum, int state, double xpos, double ypos, float fontscale, const char* text, int flags) override; void DrawMenuCaption(const DVector2& origin, const char* text) override; bool SaveGame(FSaveGameNode*) override; diff --git a/source/blood/src/d_menu.cpp b/source/blood/src/d_menu.cpp index 3f6448f0d..c2ee4cc57 100644 --- a/source/blood/src/d_menu.cpp +++ b/source/blood/src/d_menu.cpp @@ -239,11 +239,21 @@ bool GameInterface::CanSave() return (gamestate == GS_LEVEL && gPlayer[myconnectindex].pXSprite->health != 0); } -void GameInterface::StartGame(FNewGameStartup& gs) +bool GameInterface::StartGame(FNewGameStartup& gs) { + if (gs.Episode >= 1) + { + if (g_gameType & GAMEFLAG_SHAREWARE) + { + M_StartMessage(GStrings("BUYBLOOD"), 1, -1); // unreachable because we do not support Blood SW versions yet. + return false; + } + } + sfxKillAllSounds(); auto map = FindMapByLevelNum(levelnum(gs.Episode, gs.Level)); DeferedStartGame(map, gs.Skill); + return true; } FSavegameInfo GameInterface::GetSaveSig() diff --git a/source/core/gamestruct.h b/source/core/gamestruct.h index 62edcee70..f4c029f60 100644 --- a/source/core/gamestruct.h +++ b/source/core/gamestruct.h @@ -78,7 +78,7 @@ struct GameInterface virtual void MenuSound(EMenuSounds snd) {} virtual bool CanSave() { return true; } virtual void CustomMenuSelection(int menu, int item) {} - virtual void StartGame(FNewGameStartup& gs) {} + virtual bool StartGame(FNewGameStartup& gs) { return false; } virtual FSavegameInfo GetSaveSig() { return { "", 0, 0}; } virtual bool DrawSpecialScreen(const DVector2 &origin, int tilenum) { return false; } virtual void DrawCenteredTextScreen(const DVector2& origin, const char* text, int position, bool withbg = true); diff --git a/source/core/mainloop.cpp b/source/core/mainloop.cpp index e50ac27de..63d554745 100644 --- a/source/core/mainloop.cpp +++ b/source/core/mainloop.cpp @@ -645,6 +645,7 @@ void MainLoop () } gi->ErrorCleanup(); C_FullConsole(); + gameaction = ga_nothing; } catch (CVMAbortException &error) { diff --git a/source/core/menu/menu.cpp b/source/core/menu/menu.cpp index 0e971049f..79618ff10 100644 --- a/source/core/menu/menu.cpp +++ b/source/core/menu/menu.cpp @@ -463,12 +463,14 @@ bool M_SetMenu(FName menu, int param, FName caller) switch (menu.GetIndex()) { case NAME_Startgame: - M_ClearMenus(); // must be done before starting the level. if (caller == NAME_Mainmenu || caller == NAME_IngameMenu) NewGameStartupInfo.Episode = param; - STAT_StartNewGame(gVolumeNames[NewGameStartupInfo.Episode], NewGameStartupInfo.Skill); - inputState.ClearAllInput(); + if (gi->StartGame(NewGameStartupInfo)) + { + M_ClearMenus(); + STAT_StartNewGame(gVolumeNames[NewGameStartupInfo.Episode], NewGameStartupInfo.Skill); + inputState.ClearAllInput(); + } - gi->StartGame(NewGameStartupInfo); return false; case NAME_CustomSubMenu1: diff --git a/source/exhumed/src/d_menu.cpp b/source/exhumed/src/d_menu.cpp index 87059e203..52eebf57a 100644 --- a/source/exhumed/src/d_menu.cpp +++ b/source/exhumed/src/d_menu.cpp @@ -162,10 +162,11 @@ void GameInterface::MenuClosed() } -void GameInterface::StartGame(FNewGameStartup& gs) +bool GameInterface::StartGame(FNewGameStartup& gs) { auto map = FindMapByLevelNum(gs.Episode); DeferedStartGame(map, 0); // 0 is training, 1 is the regular game - the game does not have skill levels. + return true; } FSavegameInfo GameInterface::GetSaveSig() diff --git a/source/exhumed/src/exhumed.h b/source/exhumed/src/exhumed.h index c4d669ba4..bcfaac9f4 100644 --- a/source/exhumed/src/exhumed.h +++ b/source/exhumed/src/exhumed.h @@ -241,7 +241,7 @@ struct GameInterface : ::GameInterface void MenuOpened() override; void MenuSound(EMenuSounds snd) override; void MenuClosed() override; - void StartGame(FNewGameStartup& gs) override; + bool StartGame(FNewGameStartup& gs) override; FSavegameInfo GetSaveSig() override; void DrawMenuCaption(const DVector2& origin, const char* text) override; bool LoadGame(FSaveGameNode* sv) override; diff --git a/source/games/duke/src/d_menu.cpp b/source/games/duke/src/d_menu.cpp index 598054433..89ddc99b3 100644 --- a/source/games/duke/src/d_menu.cpp +++ b/source/games/duke/src/d_menu.cpp @@ -263,8 +263,17 @@ bool GameInterface::CanSave() return (sprite[myplayer.i].extra > 0); } -void GameInterface::StartGame(FNewGameStartup& gs) +bool GameInterface::StartGame(FNewGameStartup& gs) { + if (gs.Episode >= 1) + { + if (g_gameType & GAMEFLAG_SHAREWARE) + { + M_StartMessage(GStrings("BUYDUKE"), 1, -1); + return false; + } + } + int32_t skillsound = PISTOL_BODYHIT; soundEngine->StopAllChannels(); @@ -289,7 +298,9 @@ void GameInterface::StartGame(FNewGameStartup& gs) if (map) { DeferedStartGame(map, gs.Skill); + return true; } + return false; } diff --git a/source/games/duke/src/duke3d.h b/source/games/duke/src/duke3d.h index d5b079606..ccee45dbc 100644 --- a/source/games/duke/src/duke3d.h +++ b/source/games/duke/src/duke3d.h @@ -39,7 +39,7 @@ struct GameInterface : public ::GameInterface void MenuSound(EMenuSounds snd) override; void MenuClosed() override; bool CanSave() override; - void StartGame(FNewGameStartup& gs) override; + bool StartGame(FNewGameStartup& gs) override; FSavegameInfo GetSaveSig() override; void DrawCenteredTextScreen(const DVector2& origin, const char* text, int position, bool bg) override; double SmallFontScale() override { return isRR() ? 0.5 : 1.; } diff --git a/source/sw/src/d_menu.cpp b/source/sw/src/d_menu.cpp index 8f1d31039..cacf40f9a 100644 --- a/source/sw/src/d_menu.cpp +++ b/source/sw/src/d_menu.cpp @@ -189,19 +189,26 @@ bool GameInterface::CanSave() return (gamestate == GS_LEVEL && !CommEnabled && numplayers ==1 && /*!DemoMode &&*/ !TEST(Player[myconnectindex].Flags, PF_DEAD)); } -void GameInterface::StartGame(FNewGameStartup& gs) +bool GameInterface::StartGame(FNewGameStartup& gs) { PLAYERp pp = Player + screenpeek; int handle = 0; int zero = 0; MapRecord* map; - if (gs.Episode >= 1) + if (gs.Episode >= 1) + { + if (g_gameType & GAMEFLAG_SHAREWARE) + { + M_StartMessage(GStrings("BUYSW"), 1, -1); + return false; + } map = FindMapByLevelNum(5); + } else map = FindMapByLevelNum(1); - if (!map) return; + if (!map) return false; CameraTestMode = false; StopFX(); @@ -227,6 +234,7 @@ void GameInterface::StartGame(FNewGameStartup& gs) Net_ClearFifo(); } DeferedStartGame(map, gs.Skill); + return true; } FSavegameInfo GameInterface::GetSaveSig() diff --git a/source/sw/src/game.h b/source/sw/src/game.h index e5197eb3e..7638daa19 100644 --- a/source/sw/src/game.h +++ b/source/sw/src/game.h @@ -2191,7 +2191,7 @@ struct GameInterface : ::GameInterface void MenuSound(EMenuSounds snd) override; void MenuClosed() override; bool CanSave() override; - void StartGame(FNewGameStartup& gs) override; + bool StartGame(FNewGameStartup& gs) override; FSavegameInfo GetSaveSig() override; void DrawMenuCaption(const DVector2& origin, const char* text) override; bool LoadGame(FSaveGameNode* sv) override; diff --git a/wadsrc/static/language.csv b/wadsrc/static/language.csv index 8c89e0e12..454186ee1 100644 --- a/wadsrc/static/language.csv +++ b/wadsrc/static/language.csv @@ -777,6 +777,13 @@ the final three episodes.",BUYDUKE,not used,,,,,,,,,,,,,,,,,,,"Joci versiunea gr "Buy the complete version of Blood for three new episodes plus eight BloodBath-only levels!",BUYBLOOD,not used,,,,,,,,,,,,,,,,,,,Cumpără versiunea completă a jocului Blood pentru încă trei episoade și încă opt hărți pentru modul BloodBath!,, +"Be sure to call 800-3DREALMS today +and order the game. +You are only playing the first +four levels, and are missing most +of the game, weapons and monsters. +See the ordering information. +",BUYSW,,,,,,,,,,,,,,,,,,,,,, "Loading and saving games not supported in this demo version of Blood.","BLOOD_SW_BLOCK