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

Commit

Permalink
STARK: Game opens with main menu look
Browse files Browse the repository at this point in the history
  • Loading branch information
Dougaak committed May 16, 2018
1 parent df3cd7d commit 57c5f99
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 6 deletions.
3 changes: 3 additions & 0 deletions engines/stark/services/userinterface.cpp
Expand Up @@ -75,6 +75,8 @@ void UserInterface::init() {
_fmvScreen = new FMVScreen(_gfx, _cursor);

_currentScreen = _mainMenuScreen;

_currentScreen->open();
}

void UserInterface::update() {
Expand Down Expand Up @@ -251,6 +253,7 @@ const Graphics::Surface *UserInterface::getGameWindowThumbnail() const {
}

void UserInterface::onScreenChanged() {
_mainMenuScreen->onScreenChanged();
_gameScreen->onScreenChanged();
_diaryIndexScreen->onScreenChanged();
}
Expand Down
2 changes: 1 addition & 1 deletion engines/stark/stark.cpp
Expand Up @@ -146,7 +146,7 @@ Common::Error StarkEngine::run() {
// Initialize the UI
_userInterface->init();

/*
/* Comment for testting the main menu
if (ConfMan.hasKey("save_slot")) {
// Load game from specified slot, if any
Expand Down
2 changes: 1 addition & 1 deletion engines/stark/ui/menu/locationscreen.cpp
Expand Up @@ -123,7 +123,7 @@ void StaticLocationScreen::onRender() {
}

void StaticLocationScreen::onScreenChanged() {
// Right now only focus on reseting the text texture
// Right now only focus on resetting the text texture
for (uint i = 0; i < _widgets.size(); i++) {
_widgets[i]->resetTextTexture();
}
Expand Down
88 changes: 87 additions & 1 deletion engines/stark/ui/menu/mainmenu.cpp
Expand Up @@ -12,7 +12,93 @@ MainMenuScreen::~MainMenuScreen() {
void MainMenuScreen::open() {
StaticLocationScreen::open();

//TODO: push back widgets
//TODO: Implement each handler
_widgets.push_back(new StaticLocationWidget(
"BGImage",
nullptr,
nullptr));

_widgets.push_back(new StaticLocationWidget(
"NewGame",
nullptr,
nullptr));
_widgets.back()->setupSounds(0, 1);

_widgets.push_back(new StaticLocationWidget(
"Continue",
nullptr,
nullptr));
_widgets.back()->setupSounds(0, 1);

_widgets.push_back(new StaticLocationWidget(
"Options",
nullptr,
nullptr));
_widgets.back()->setupSounds(0, 1);

_widgets.push_back(new StaticLocationWidget(
"Box",
nullptr,
nullptr));
_widgets.back()->setupSounds(0, 1);

_widgets.push_back(new StaticLocationWidget(
"Quit",
nullptr,
nullptr));
_widgets.back()->setupSounds(0, 1);

_widgets.push_back(new StaticLocationWidget(
"OptionHelp",
nullptr,
nullptr));
_widgets.back()->setVisible(false);

_widgets.push_back(new StaticLocationWidget(
"BeginHelp",
nullptr,
nullptr));
_widgets.back()->setVisible(false);

_widgets.push_back(new StaticLocationWidget(
"ContinueHelp",
nullptr,
nullptr));
_widgets.back()->setVisible(false);

_widgets.push_back(new StaticLocationWidget(
"BoxHelp",
nullptr,
nullptr));
_widgets.back()->setVisible(false);

_widgets.push_back(new StaticLocationWidget(
"QuitHelp",
nullptr,
nullptr));
_widgets.back()->setVisible(false);

_widgets.push_back(new StaticLocationWidget(
"Credits",
nullptr,
nullptr));
_widgets.back()->setupSounds(0, 1);

_widgets.push_back(new StaticLocationWidget(
"CreditHelp",
nullptr,
nullptr));
_widgets.back()->setVisible(false);

_widgets.push_back(new StaticLocationWidget(
"VERSION INFO",
nullptr,
nullptr));

_widgets.push_back(new StaticLocationWidget(
"VERSION INFO REALLY",
nullptr,
nullptr));
}

}
3 changes: 0 additions & 3 deletions engines/stark/ui/menu/mainmenu.h
Expand Up @@ -15,9 +15,6 @@ class MainMenuScreen : public StaticLocationScreen {

// StaticLocationScreen API
void open() override;

// Called when the screen resolution changes
void onScreenChanged();
};

}
Expand Down

0 comments on commit 57c5f99

Please sign in to comment.