1 /* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 *
21 */
22
23
24 #include "ultima/ultima8/gumps/main_menu_process.h"
25 #include "ultima/ultima8/gumps/menu_gump.h"
26 #include "ultima/ultima8/world/get_object.h"
27 #include "ultima/ultima8/audio/music_process.h"
28 #include "ultima/ultima8/world/actors/main_actor.h"
29
30 namespace Ultima {
31 namespace Ultima8 {
32
DEFINE_RUNTIME_CLASSTYPE_CODE(MainMenuProcess)33 DEFINE_RUNTIME_CLASSTYPE_CODE(MainMenuProcess)
34
35 MainMenuProcess::MainMenuProcess() : Process() {
36 _init = false;
37 }
38
39
run()40 void MainMenuProcess::run() {
41 MainActor *avatar = getMainActor();
42 if (avatar && avatar->isDead()) {
43 // stop death music
44 MusicProcess::get_instance()->playCombatMusic(0);
45 }
46
47 MenuGump::showMenu();
48
49 terminate();
50 }
51
saveData(Common::WriteStream * ws)52 void MainMenuProcess::saveData(Common::WriteStream *ws) {
53 CANT_HAPPEN();
54
55 Process::saveData(ws);
56 }
57
loadData(Common::ReadStream * rs,uint32 version)58 bool MainMenuProcess::loadData(Common::ReadStream *rs, uint32 version) {
59 if (!Process::loadData(rs, version)) return false;
60
61 return true;
62 }
63
64 } // End of namespace Ultima8
65 } // End of namespace Ultima
66