- added shareware checks to the "start game" menus.

This commit is contained in:
Christoph Oelckers 2020-09-25 19:36:50 +02:00
parent cb63f5cdbf
commit 89bc194035
12 changed files with 55 additions and 15 deletions

View file

@ -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;

View file

@ -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()

View file

@ -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);

View file

@ -645,6 +645,7 @@ void MainLoop ()
}
gi->ErrorCleanup();
C_FullConsole();
gameaction = ga_nothing;
}
catch (CVMAbortException &error)
{

View file

@ -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:

View file

@ -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()

View file

@ -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;

View file

@ -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;
}

View file

@ -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.; }

View file

@ -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()

View file

@ -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;

View file

@ -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

1 default Identifier Remarks Filter eng enc ena enz eni ens enj enb enl ent enw cs de el eo es esm esn esg esc esa esd esv eso esr ess esf esl esy esz esb ese esh esi esu fi fr hu it jp ko nl pl pt ptg ro ru sr
777 Sunglasses Off Sunglasses On SUNGLASSES OFF SUNGLASSES ON
778 Sunglasses Off Episodes, Skills, Maps SUNGLASSES OFF
779 L.A. Meltdown L.A. MELTDOWN Episodes, Skills, Maps
780 L.A. Meltdown L.A. MELTDOWN
781 Lunar Apocalypse LUNAR APOCALYPSE
782 Shrapnel City SHRAPNEL CITY
783 The Birth THE BIRTH
784
785 Piece Of Cake PIECE OF CAKE
786 Let's Rock LET'S ROCK
787 Lunar Apocalypse Come Get Some LUNAR APOCALYPSE COME GET SOME
788 Shrapnel City Damn I'm Good SHRAPNEL CITY DAMN I'M GOOD
789 The Birth THE BIRTH