Skip to content

Commit

Permalink
NWN: Add back the main menu
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Feb 3, 2014
1 parent 9047140 commit 5eac1bb
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions src/engines/nwn/nwn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
#include "engines/aurora/resources.h"

#include "engines/nwn/nwn.h"
#include "engines/nwn/module.h"

#include "engines/nwn/gui/main/main.h"

namespace Engines {

Expand Down Expand Up @@ -133,11 +136,7 @@ void NWNEngine::run(const Common::UString &target) {
if (ConfigMan.getBool("showfps", false))
fps = new Graphics::Aurora::FPS;

playMenuMusic();

while (!EventMan.quitRequested()) {
EventMan.delay(10);
}
mainMenuLoop();

delete fps;

Expand Down Expand Up @@ -405,6 +404,31 @@ void NWNEngine::mainMenuLoop() {
// Start sound
playSound("gui_prompt", Sound::kSoundTypeSFX);

Module module;

while (!EventMan.quitRequested()) {
GUI *mainMenu = new MainMenu(module);

EventMan.flushEvents();

mainMenu->setVisible(true);
mainMenu->run();
mainMenu->setVisible(false);

delete mainMenu;
if (EventMan.quitRequested())
break;

stopMenuMusic();

module.run();
if (EventMan.quitRequested())
break;

playMenuMusic();
module.clear();
}

stopMenuMusic();
}

Expand Down

0 comments on commit 5eac1bb

Please sign in to comment.