Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Commit

Permalink
STARK: First attempt on the main menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Dougaak committed May 16, 2018
1 parent 9b1616e commit df3cd7d
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 1 deletion.
1 change: 1 addition & 0 deletions engines/stark/module.mk
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ MODULE_OBJS := \
ui/cursor.o \
ui/menu/diaryindex.o \
ui/menu/locationscreen.o \
ui/menu/mainmenu.o \
ui/window.o \
ui/world/actionmenu.o \
ui/world/button.o \
Expand Down
7 changes: 6 additions & 1 deletion engines/stark/services/userinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

#include "engines/stark/ui/cursor.h"
#include "engines/stark/ui/menu/diaryindex.h"
#include "engines/stark/ui/menu/mainmenu.h"
#include "engines/stark/ui/world/inventorywindow.h"
#include "engines/stark/ui/world/fmvscreen.h"
#include "engines/stark/ui/world/gamescreen.h"
Expand All @@ -46,6 +47,7 @@ UserInterface::UserInterface(Gfx::Driver *gfx) :
_gfx(gfx),
_cursor(nullptr),
_diaryIndexScreen(nullptr),
_mainMenuScreen(nullptr),
_exitGame(false),
_fmvScreen(nullptr),
_gameScreen(nullptr),
Expand All @@ -67,9 +69,12 @@ UserInterface::~UserInterface() {
void UserInterface::init() {
_cursor = new Cursor(_gfx);

_currentScreen = _gameScreen = new GameScreen(_gfx, _cursor);
_mainMenuScreen = new MainMenuScreen(_gfx, _cursor);
_gameScreen = new GameScreen(_gfx, _cursor);
_diaryIndexScreen = new DiaryIndexScreen(_gfx, _cursor);
_fmvScreen = new FMVScreen(_gfx, _cursor);

_currentScreen = _mainMenuScreen;
}

void UserInterface::update() {
Expand Down
2 changes: 2 additions & 0 deletions engines/stark/services/userinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Driver;

class DiaryIndexScreen;
class GameScreen;
class MainMenuScreen;
class Cursor;
class FMVScreen;

Expand Down Expand Up @@ -139,6 +140,7 @@ class UserInterface {
GameScreen *_gameScreen;
FMVScreen *_fmvScreen;
DiaryIndexScreen *_diaryIndexScreen;
MainMenuScreen *_mainMenuScreen;
Screen *_currentScreen;

Gfx::Driver *_gfx;
Expand Down
4 changes: 4 additions & 0 deletions engines/stark/stark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ Common::Error StarkEngine::run() {
// Initialize the UI
_userInterface->init();

/*
if (ConfMan.hasKey("save_slot")) {
// Load game from specified slot, if any
loadGameState(ConfMan.getInt("save_slot"));
Expand All @@ -154,6 +156,8 @@ Common::Error StarkEngine::run() {
setStartupLocation();
}
*/

// Start running
mainLoop();

Expand Down
18 changes: 18 additions & 0 deletions engines/stark/ui/menu/mainmenu.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "engines/stark/ui/menu/mainmenu.h"

namespace Stark {

MainMenuScreen::MainMenuScreen(Gfx::Driver *gfx, Cursor *cursor) :
StaticLocationScreen(gfx, cursor, "MainMenuLocation", Screen::kScreenMainMenu) {
}

MainMenuScreen::~MainMenuScreen() {
}

void MainMenuScreen::open() {
StaticLocationScreen::open();

//TODO: push back widgets
}

}
1 change: 1 addition & 0 deletions engines/stark/ui/screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ namespace Stark {
class Screen {
public:
enum Name {
kScreenMainMenu,
kScreenGame,
kScreenFMV,
kScreenDiaryIndex
Expand Down

0 comments on commit df3cd7d

Please sign in to comment.