mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-27 04:00:42 +00:00
- added shareware checks to the "start game" menus.
This commit is contained in:
parent
cb63f5cdbf
commit
89bc194035
12 changed files with 55 additions and 15 deletions
|
@ -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;
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -645,6 +645,7 @@ void MainLoop ()
|
|||
}
|
||||
gi->ErrorCleanup();
|
||||
C_FullConsole();
|
||||
gameaction = ga_nothing;
|
||||
}
|
||||
catch (CVMAbortException &error)
|
||||
{
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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.; }
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
Loading…
Reference in a new issue