Updated a number of simpler client scenes (read more)
Updated the ClientApplication class to help support the new design, but it's not finished because of that module's dependence on the various scenes. Updated the following scenes: * CleanUp * MainMenu * OptionsMenu The following source files (in client/scenes/) compile correctly: * base_scene.cpp * splash_screen.cpp * clean_up.cpp * main_menu.cpp * options_menu.cpp The folling source files (in client/scenes/) do not compile: * in_world.cpp * in_combat.cpp * lobby_menu.cpp
This commit is contained in:
@@ -30,15 +30,17 @@ OptionsMenu::OptionsMenu(lua_State* L): lua(L) {
|
||||
lua_getglobal(lua, "config");
|
||||
lua_getfield(lua, -1, "dir");
|
||||
lua_getfield(lua, -1, "interface");
|
||||
std::string interface = lua_tostring(lua, -1);
|
||||
lua_getfield(lua, -2, "fonts");
|
||||
std::string fonts = lua_tostring(lua, -1);
|
||||
|
||||
std::string interfaceDir = lua_tostring(lua, -2);
|
||||
std::string fontsDir = lua_tostring(lua, -1);
|
||||
|
||||
lua_pop(lua, 4);
|
||||
|
||||
//setup the utility objects
|
||||
image.LoadSurface(interface + "button_menu.bmp");
|
||||
image.LoadSurface(interfaceDir + "button_menu.bmp");
|
||||
image.SetClipH(image.GetClipH()/3);
|
||||
font.LoadSurface(fonts + "pk_white_8.bmp");
|
||||
font.LoadSurface(fontsDir + "pk_white_8.bmp");
|
||||
|
||||
//pass the utility objects
|
||||
backButton.SetImage(&image);
|
||||
@@ -91,7 +93,8 @@ void OptionsMenu::MouseButtonDown(SDL_MouseButtonEvent const& button) {
|
||||
}
|
||||
|
||||
void OptionsMenu::MouseButtonUp(SDL_MouseButtonEvent const& button) {
|
||||
if (backButton.MouseButtonUp(button) == Button::State::HOVER) {
|
||||
if (backButton.MouseButtonUp(button) == Button::State::HOVER &&
|
||||
button.button & SDL_BUTTON_LMASK) {
|
||||
SetNextScene(SceneList::MAINMENU);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user