2019-12-14 11:39:18 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 2016 EDuke32 developers and contributors
|
|
|
|
Copyright (C) 2019 Christoph Oelckers
|
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License version 2
|
|
|
|
as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#include "ns.h" // Must come before everything else!
|
|
|
|
#include "build.h"
|
|
|
|
#include "exhumed.h"
|
|
|
|
#include "engine.h"
|
|
|
|
#include "sound.h"
|
|
|
|
#include "names.h"
|
|
|
|
#include "version.h"
|
2020-04-12 06:09:38 +00:00
|
|
|
#include "raze_sound.h"
|
2020-08-25 19:34:12 +00:00
|
|
|
#include "gamestate.h"
|
2020-09-04 19:59:38 +00:00
|
|
|
#include "mapinfo.h"
|
|
|
|
#include "gamecontrol.h"
|
2020-10-04 16:31:48 +00:00
|
|
|
#include "v_draw.h"
|
2020-10-07 22:21:07 +00:00
|
|
|
#include "vm.h"
|
|
|
|
#include "razemenu.h"
|
2019-12-14 11:39:18 +00:00
|
|
|
|
|
|
|
#include "../../glbackend/glbackend.h"
|
|
|
|
|
|
|
|
|
|
|
|
BEGIN_PS_NS
|
|
|
|
|
|
|
|
void GameInterface::MenuOpened()
|
|
|
|
{
|
|
|
|
GrabPalette();
|
2020-10-07 22:21:07 +00:00
|
|
|
menuDelegate->FloatVar(NAME_zoomsize) = 0;
|
2019-12-14 11:39:18 +00:00
|
|
|
StopLocalSound();
|
|
|
|
}
|
|
|
|
|
|
|
|
void GameInterface::MenuSound(EMenuSounds snd)
|
|
|
|
{
|
|
|
|
switch (snd)
|
|
|
|
{
|
2020-10-07 22:21:07 +00:00
|
|
|
case ActivateSound:
|
|
|
|
PlayLocalSound(StaticSound[kSound31], 0, false, CHANF_UI);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CursorSound:
|
|
|
|
PlayLocalSound(StaticSound[kSound35], 0, false, CHANF_UI);
|
|
|
|
break;
|
2019-12-14 11:39:18 +00:00
|
|
|
|
2020-10-07 22:21:07 +00:00
|
|
|
case AdvanceSound:
|
|
|
|
case BackSound:
|
|
|
|
PlayLocalSound(StaticSound[kSound33], 0, false, CHANF_UI);
|
|
|
|
break;
|
2019-12-14 11:39:18 +00:00
|
|
|
|
2020-10-07 22:21:07 +00:00
|
|
|
default:
|
|
|
|
return;
|
2019-12-14 11:39:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-25 19:34:12 +00:00
|
|
|
void GameInterface::QuitToTitle()
|
|
|
|
{
|
2020-09-04 19:59:38 +00:00
|
|
|
gameaction = ga_mainmenu;
|
2020-08-25 19:34:12 +00:00
|
|
|
}
|
|
|
|
|
2020-09-25 17:36:50 +00:00
|
|
|
bool GameInterface::StartGame(FNewGameStartup& gs)
|
2019-12-14 11:39:18 +00:00
|
|
|
{
|
2020-10-09 21:58:34 +00:00
|
|
|
auto map = FindMapByLevelNum(gs.Skill); // 0 is training, 1 is the regular game - the game does not have skill levels.
|
2020-10-10 11:30:23 +00:00
|
|
|
DeferedStartGame(map, 1, true);
|
2020-09-25 17:36:50 +00:00
|
|
|
return true;
|
2019-12-14 11:39:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
FSavegameInfo GameInterface::GetSaveSig()
|
|
|
|
{
|
|
|
|
return { SAVESIG_PS, MINSAVEVER_PS, SAVEVER_PS };
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
END_PS_NS
|
2020-10-10 08:11:22 +00:00
|
|
|
|
|
|
|
using namespace Exhumed;
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION(_ListMenuItemExhumedPlasma, Draw)
|
|
|
|
{
|
|
|
|
menu_DoPlasma();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION(_ListMenuItemExhumedLogo, Draw)
|
|
|
|
{
|
2020-10-11 11:21:54 +00:00
|
|
|
auto nLogoTile = GameLogo();
|
2020-10-10 08:11:22 +00:00
|
|
|
DrawRel(nLogoTile, 160, 40);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|