Game menu now shows up :) Input is not yet handled, so not yet usable. Some dummy placeholder datafiles included for the sake of having something testable
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3261 178a84e3-b1eb-0310-8ba1-8eac791a3b58
BIN
data/gui/difficulty_easy.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
data/gui/difficulty_hard.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
data/gui/difficulty_medium.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
data/gui/fonthaettenschweiler.bmp
Executable file
After Width: | Height: | Size: 192 KiB |
BIN
data/gui/gnu.png
Executable file
After Width: | Height: | Size: 22 KiB |
21
data/gui/karts.stkgui
Normal file
@ -0,0 +1,21 @@
|
||||
<div x="5%" y="1%" width="90%" height="99%" layout="vertical-row" >
|
||||
|
||||
<label width="100%" height="25" text="Choose a Kart (more players can join by pressing 'fire' now)" align="center" text_align="center" />
|
||||
|
||||
|
||||
<label width="100%" height="25" text="(P1) Keyboard 1" align="center" text_align="center" />
|
||||
<spinner id="player" width="40%" height="25" min_value="0" max_value="8" align="center"/>
|
||||
|
||||
<button text="TODO" width="40%" proportion="3" align="center"/>
|
||||
<label width="100%" height="25" text="Wilber" align="center" text_align="center" />
|
||||
|
||||
<ribbon_grid id="karts" proportion="2" width="100%" align="center" child_width="80" child_height="80"/>
|
||||
|
||||
<tabs width="100%" height="25" id="kartgroups">
|
||||
<button text="Standard"/>
|
||||
<button text="Add-Ons"/>
|
||||
<button text="All"/>
|
||||
</tabs>
|
||||
|
||||
</div>
|
||||
|
BIN
data/gui/karts1.png
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
data/gui/karts2.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
data/gui/karts3.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
data/gui/karts4.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
data/gui/karts5.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
data/gui/karts6.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
data/gui/karts7.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
data/gui/karts8.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
data/gui/logo.png
Normal file
After Width: | Height: | Size: 40 KiB |
24
data/gui/main.stkgui
Normal file
@ -0,0 +1,24 @@
|
||||
<div x="5%" y="2%" width="90%" height="96%" layout="vertical-row" >
|
||||
|
||||
<icon id="logo" align="center" icon="logo.png"/>
|
||||
|
||||
<spacer proportion="1" width="10"/>
|
||||
|
||||
<buttonbar id="menu_toprow" proportion="2" width="75%" align="center">
|
||||
<icon-button id="new" width="128" height="128" icon="main_race.png" text="Race"/>
|
||||
<icon-button id="network" width="128" height="128" icon="main_network.png" text="Networking"/>
|
||||
<icon-button id="challenges" width="128" height="128" icon="main_challenges.png" text="Challenges"/>
|
||||
</buttonbar>
|
||||
|
||||
<spacer proportion="1" width="10" proportion="1"/>
|
||||
|
||||
<buttonbar id="menu_bottomrow" proportion="2" width="85%" align="center">
|
||||
<icon-button id="options" width="128" height="128" icon="main_options.png" text="Options"/>
|
||||
<icon-button id="help" width="128" height="128" icon="main_help.png" text="Help"/>
|
||||
<icon-button id="about" width="128" height="128" icon="main_about.png" text="About"/>
|
||||
<icon-button id="quit" width="128" height="128" icon="main_quit.png" text="Quit"/>
|
||||
</buttonbar>
|
||||
|
||||
<spacer proportion="1" width="10" proportion="1"/>
|
||||
|
||||
</div>
|
BIN
data/gui/main_about.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
data/gui/main_challenges.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
data/gui/main_help.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
data/gui/main_network.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
data/gui/main_options.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
data/gui/main_quit.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
data/gui/main_race.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
data/gui/mode_3strikes.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
data/gui/mode_ftl.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
data/gui/mode_normal.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
data/gui/mode_tt.png
Normal file
After Width: | Height: | Size: 15 KiB |
32
data/gui/racesetup.stkgui
Normal file
@ -0,0 +1,32 @@
|
||||
<div x="5%" y="5%" width="90%" height="90%" layout="vertical-row" >
|
||||
|
||||
<label width="100%" height="25" text="Race Setup" align="center" text_align="center" />
|
||||
|
||||
<spacer proportion="1" width="25"/>
|
||||
|
||||
<div layout="horizontal-row" width="100%" height="75" align="center">
|
||||
<label proportion="1" height="100%" text="Number of AI karts" text_align="right" />
|
||||
<spacer width="50" height="25"/>
|
||||
<spinner id="aikartamount" proportion="3" height="100%" min_value="0" max_value="8" icon="karts%i.png"/>
|
||||
</div>
|
||||
|
||||
<spacer proportion="2" width="25"/>
|
||||
|
||||
<ribbon id="difficulty" height="135" width="65%" align="center">
|
||||
<icon-button id="novice" width="128" height="128" icon="difficulty_easy.png" text="Novice"/>
|
||||
<icon-button id="intermediate" width="128" height="128" icon="difficulty_medium.png" text="Intermediate"/>
|
||||
<icon-button id="expert" width="128" height="128" icon="difficulty_hard.png" text="Expert"/>
|
||||
</ribbon>
|
||||
|
||||
<spacer proportion="2" width="25"/>
|
||||
|
||||
<buttonbar id="gamemode" height="135" width="85%" align="center">
|
||||
<icon-button id="normal" width="128" height="128" icon="mode_normal.png" text="Snaky Sprint"/>
|
||||
<icon-button id="timetrial" width="128" height="128" icon="mode_tt.png" text="Time Trial"/>
|
||||
<icon-button id="ftl" width="128" height="128" icon="mode_ftl.png" text="Follow the Leader"/>
|
||||
<icon-button id="3strikes" width="128" height="128" icon="mode_3strikes.png" text="3 Strikes Battle"/>
|
||||
</buttonbar>
|
||||
|
||||
<spacer proportion="2" width="25"/>
|
||||
</div>
|
||||
|
BIN
data/gui/track1.png
Normal file
After Width: | Height: | Size: 120 KiB |
BIN
data/gui/track2.png
Normal file
After Width: | Height: | Size: 115 KiB |
BIN
data/gui/track3.png
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
data/gui/track4.png
Normal file
After Width: | Height: | Size: 84 KiB |
BIN
data/gui/track5.png
Normal file
After Width: | Height: | Size: 100 KiB |
BIN
data/gui/track6.png
Normal file
After Width: | Height: | Size: 72 KiB |
BIN
data/gui/track7.png
Normal file
After Width: | Height: | Size: 103 KiB |
BIN
data/gui/track8.png
Normal file
After Width: | Height: | Size: 81 KiB |
BIN
data/gui/track?.png
Normal file
After Width: | Height: | Size: 29 KiB |
25
data/gui/tracks.stkgui
Normal file
@ -0,0 +1,25 @@
|
||||
<div x="5%" y="1%" width="90%" height="99%" layout="vertical-row" >
|
||||
|
||||
<label width="100%" height="25" text="Grand Prix" align="center" text_align="center" />
|
||||
|
||||
<buttonbar id="gps" height="175" width="100%" align="center">
|
||||
<icon-button id="gp1" width="171" height="128" icon="track1.png" text="Penguin Playground"/>
|
||||
<icon-button id="gp2" width="171" height="128" icon="track2.png" text="Snag Drive"/>
|
||||
<icon-button id="gp3" width="171" height="128" icon="track3.png" text="To the Moon and Back"/>
|
||||
<icon-button id="gp4" width="171" height="128" icon="track4.png" text="At World's End"/>
|
||||
</buttonbar>
|
||||
|
||||
<label width="100%" height="25" text="All Tracks" align="center" text_align="center" />
|
||||
|
||||
<ribbon_grid id="tracks" proportion="1" width="100%" text="-" align="center" child_width="160" child_height="120" />
|
||||
|
||||
|
||||
<tabs width="100%" height="25" id="trackgroups">
|
||||
<button text="Standard"/>
|
||||
<button text="Add-Ons"/>
|
||||
<button text="All"/>
|
||||
</tabs>
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -18,6 +18,7 @@
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "gui/engine.hpp"
|
||||
|
||||
#include "user_config.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
@ -163,7 +164,9 @@ void IrrDriver::update(float dt)
|
||||
{
|
||||
m_device->getVideoDriver()->beginScene(true, true, video::SColor(255,100,101,140));
|
||||
m_scene_manager->drawAll();
|
||||
m_device->getGUIEnvironment()->drawAll();
|
||||
|
||||
GUIEngine::render();
|
||||
|
||||
m_device->getVideoDriver()->endScene();
|
||||
} // update
|
||||
|
||||
|
@ -2,16 +2,19 @@
|
||||
#include "gui/screen.hpp"
|
||||
#include "gui/skin.hpp"
|
||||
#include "gui/widget.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#include <iostream>
|
||||
|
||||
namespace GUIEngine
|
||||
{
|
||||
|
||||
IGUIEnvironment* g_env;
|
||||
IGUISkin* g_skin;
|
||||
IGUIFont* g_font;
|
||||
IrrlichtDevice* g_device;
|
||||
irr::video::IVideoDriver* g_driver;
|
||||
IGUIEnvironment* g_env;
|
||||
IGUISkin* g_skin;
|
||||
IGUIFont* g_font;
|
||||
IrrlichtDevice* g_device;
|
||||
irr::video::IVideoDriver* g_driver;
|
||||
|
||||
std::vector<Screen*> g_loaded_screens;
|
||||
Screen* g_current_screen = NULL;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
IrrlichtDevice* getDevice()
|
||||
@ -33,10 +36,12 @@ IGUIEnvironment* getGUIEnv()
|
||||
{
|
||||
return g_env;
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
std::vector<Screen*> g_loaded_screens;
|
||||
Screen* g_current_screen = NULL;
|
||||
// -----------------------------------------------------------------------------
|
||||
void clear()
|
||||
{
|
||||
g_env->clear();
|
||||
g_current_screen = NULL;
|
||||
}
|
||||
|
||||
void switchToScreen(const char* screen_name)
|
||||
{
|
||||
@ -90,7 +95,7 @@ void init(IrrlichtDevice* device_a, IVideoDriver* driver_a, void (*eventCallback
|
||||
g_skin = new Skin(g_env->getSkin());
|
||||
g_env->setSkin(g_skin);
|
||||
//g_skin = g_env->getSkin();
|
||||
g_font = g_env->getFont("fonthaettenschweiler.bmp");
|
||||
g_font = g_env->getFont( (file_manager->getGUIDir() + "/fonthaettenschweiler.bmp").c_str() );
|
||||
if (g_font) g_skin->setFont(g_font);
|
||||
|
||||
//g_skin->setFont(g_env->getBuiltInFont(), EGDF_TOOLTIP);
|
||||
@ -107,4 +112,4 @@ void render()
|
||||
g_env->drawAll();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -24,6 +24,8 @@ namespace GUIEngine
|
||||
|
||||
void init(irr::IrrlichtDevice* device, irr::video::IVideoDriver* driver, void (*eventCallback)(Widget* widget, std::string& name) );
|
||||
void switchToScreen(const char* );
|
||||
void clear();
|
||||
|
||||
Screen* getCurrentScreen();
|
||||
|
||||
void render();
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "gui/screen.hpp"
|
||||
#include "gui/engine.hpp"
|
||||
#include "gui/widget.hpp"
|
||||
#include "io/file_manager.hpp";
|
||||
#include <irrlicht.h>
|
||||
#include <iostream>
|
||||
#include <irrXML.h>
|
||||
@ -26,7 +27,8 @@ Screen::Screen(const char* file)
|
||||
// -----------------------------------------------------------------------------
|
||||
void Screen::loadFromFile()
|
||||
{
|
||||
IrrXMLReader* xml = irr::io::createIrrXMLReader( m_filename.c_str() );
|
||||
std::cout << "loading GUI screen from file " << (file_manager->getGUIDir() + "/" + m_filename).c_str() << std::endl;
|
||||
IrrXMLReader* xml = irr::io::createIrrXMLReader( (file_manager->getGUIDir() + "/" + m_filename).c_str() );
|
||||
parseScreenFileDiv(xml, m_widgets);
|
||||
m_loaded = true;
|
||||
calculateLayout();
|
||||
|
@ -21,7 +21,6 @@ namespace GUIEngine
|
||||
void parseScreenFileDiv(irr::io::IrrXMLReader* xml, ptr_vector<Widget>& append_to)
|
||||
{
|
||||
// parse XML file
|
||||
|
||||
while(xml && xml->read())
|
||||
{
|
||||
|
||||
@ -134,6 +133,8 @@ if(prop_name != NULL) widget.m_properties[prop_flag] = prop_name; else widget.m_
|
||||
READ_PROPERTY(max_value, PROP_MAX_VALUE);
|
||||
#undef READ_PROPERTY
|
||||
|
||||
//std::cout << "loaded widget " << id << std::endl;
|
||||
|
||||
// new div, continue parsing with this new div as new parent
|
||||
if( widget.m_type == WTYPE_DIV || widget.m_type == WTYPE_RIBBON)
|
||||
parseScreenFileDiv( xml, append_to[append_to.size()-1].m_children );
|
||||
|
48
src/gui/state_manager.cpp
Normal file
@ -0,0 +1,48 @@
|
||||
|
||||
#include "gui/state_manager.hpp"
|
||||
#include "gui/engine.hpp"
|
||||
#include "sdldrv.hpp"
|
||||
#include <vector>
|
||||
|
||||
namespace StateManager
|
||||
{
|
||||
std::vector<std::string> g_menu_stack;
|
||||
static bool g_game_mode = false;
|
||||
|
||||
void pushMenu(std::string name)
|
||||
{
|
||||
g_menu_stack.push_back(name);
|
||||
g_game_mode = false;
|
||||
GUIEngine::switchToScreen(name.c_str());
|
||||
}
|
||||
|
||||
void popMenu()
|
||||
{
|
||||
g_menu_stack.pop_back();
|
||||
g_game_mode = g_menu_stack[g_menu_stack.size()-1] == "race";
|
||||
GUIEngine::switchToScreen(g_menu_stack[g_menu_stack.size()-1].c_str());
|
||||
}
|
||||
|
||||
void resetAndGoToMenu(std::string name)
|
||||
{
|
||||
g_menu_stack.clear();
|
||||
g_menu_stack.push_back(name);
|
||||
g_game_mode = false;
|
||||
GUIEngine::switchToScreen(name.c_str());
|
||||
}
|
||||
|
||||
void enterGameState()
|
||||
{
|
||||
g_menu_stack.clear();
|
||||
g_menu_stack.push_back("race");
|
||||
g_game_mode = true;
|
||||
GUIEngine::clear();
|
||||
inputDriver->setMode(SDLDriver::INGAME);
|
||||
}
|
||||
|
||||
bool isGameState()
|
||||
{
|
||||
return g_game_mode;
|
||||
}
|
||||
|
||||
}
|
15
src/gui/state_manager.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef STATE_MANAGER_HPP
|
||||
#define STATE_MANAGER_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace StateManager
|
||||
{
|
||||
void pushMenu(std::string name);
|
||||
void popMenu();
|
||||
void resetAndGoToMenu(std::string name);
|
||||
void enterGameState();
|
||||
bool isGameState();
|
||||
}
|
||||
|
||||
#endif
|
@ -1,6 +1,7 @@
|
||||
#include "gui/screen.hpp"
|
||||
#include "gui/engine.hpp"
|
||||
#include "gui/my_button.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#include <irrlicht.h>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
@ -119,7 +120,9 @@ void Widget::readCoords(Widget* parent)
|
||||
|
||||
if(m_properties[PROP_ICON].size() > 0)
|
||||
{
|
||||
ITexture* texture = GUIEngine::getDriver()->getTexture(m_properties[PROP_ICON].c_str());
|
||||
ITexture* texture = GUIEngine::getDriver()->getTexture(
|
||||
(file_manager->getGUIDir() + "/" + m_properties[PROP_ICON]).c_str()
|
||||
);
|
||||
if(texture != NULL)
|
||||
{
|
||||
texture_w = texture->getSize().Width;
|
||||
@ -225,7 +228,7 @@ IconButtonWidget::IconButtonWidget(const bool clickable)
|
||||
// -----------------------------------------------------------------------------
|
||||
void IconButtonWidget::add()
|
||||
{
|
||||
ITexture* texture = GUIEngine::getDriver()->getTexture(m_properties[PROP_ICON].c_str());
|
||||
ITexture* texture = GUIEngine::getDriver()->getTexture((file_manager->getGUIDir() + "/" +m_properties[PROP_ICON]).c_str());
|
||||
//const int texture_w = texture->getSize().Width, texture_h = texture->getSize().Height;
|
||||
/*
|
||||
if(w < texture_w) ... ;
|
||||
@ -444,7 +447,7 @@ void RibbonWidget::add()
|
||||
|
||||
m_children[i].m_element = subbtn;
|
||||
subbtn->setUseAlphaChannel(true);
|
||||
subbtn->setImage( GUIEngine::getDriver()->getTexture(m_children[i].m_properties[PROP_ICON].c_str()) );
|
||||
subbtn->setImage( GUIEngine::getDriver()->getTexture((file_manager->getGUIDir() + "/" + m_children[i].m_properties[PROP_ICON]).c_str()) );
|
||||
|
||||
// ---- label part
|
||||
if(has_label)
|
||||
@ -536,7 +539,7 @@ void SpinnerWidget::add()
|
||||
if(m_graphical)
|
||||
{
|
||||
char imagefile[128];
|
||||
std::string& icon = m_properties[PROP_ICON];
|
||||
std::string icon = file_manager->getGUIDir() + "/" + m_properties[PROP_ICON];
|
||||
snprintf(imagefile, 128, icon.c_str(), m_value);
|
||||
ITexture* texture = GUIEngine::getDriver()->getTexture(imagefile);
|
||||
const int texture_width = texture->getSize().Width;
|
||||
@ -608,7 +611,7 @@ void SpinnerWidget::setValue(const int new_value)
|
||||
if(m_graphical)
|
||||
{
|
||||
char imagefile[128];
|
||||
std::string& icon = m_properties[PROP_ICON];
|
||||
std::string icon = file_manager->getGUIDir() + "/" + m_properties[PROP_ICON];
|
||||
snprintf(imagefile, 128, icon.c_str(), m_value);
|
||||
//((IGUIButton*)(m_children[1].m_element))->setImage(GUIEngine::getDriver()->getTexture(imagefile));
|
||||
((IGUIImage*)(m_children[1].m_element))->setImage(GUIEngine::getDriver()->getTexture(imagefile));
|
||||
@ -890,15 +893,16 @@ void RibbonGridWidget::updateItemDisplay()
|
||||
|
||||
if( trackid < track_amount )
|
||||
{
|
||||
button->setImage( GUIEngine::getDriver()->getTexture( m_items[trackid].m_sshot_file.c_str()) );
|
||||
std::string track_sshot = file_manager->getGUIDir() + "/" + m_items[trackid].m_sshot_file;
|
||||
button->setImage( GUIEngine::getDriver()->getTexture( track_sshot.c_str() ));
|
||||
button->setPressedImage( GUIEngine::getDriver()->getTexture( m_items[trackid].m_sshot_file.c_str()) );
|
||||
icon->m_properties[PROP_ID] = m_items[trackid].m_code_name;
|
||||
// trackid++;
|
||||
}
|
||||
else
|
||||
{
|
||||
button->setImage( GUIEngine::getDriver()->getTexture("track?.png") );
|
||||
button->setPressedImage( GUIEngine::getDriver()->getTexture("track?.png") );
|
||||
button->setImage( GUIEngine::getDriver()->getTexture( (file_manager->getGUIDir() + "/track?.png").c_str() ) );
|
||||
button->setPressedImage( GUIEngine::getDriver()->getTexture( (file_manager->getGUIDir() + "/track?.png").c_str() ) );
|
||||
icon->m_properties[PROP_ID] = "track?.png";
|
||||
}
|
||||
} // next column
|
||||
|
@ -21,6 +21,7 @@
|
||||
953EAAAF0F30A4220000D57D /* terrain_info.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 953EAAAE0F30A4220000D57D /* terrain_info.cpp */; };
|
||||
953EAAB20F30A4410000D57D /* triangle_mesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 953EAAB10F30A4410000D57D /* triangle_mesh.cpp */; };
|
||||
953EAAB60F30A4650000D57D /* translation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 953EAAB50F30A4650000D57D /* translation.cpp */; };
|
||||
953F038C0F6C880D00C77FE2 /* state_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 953F038B0F6C880D00C77FE2 /* state_manager.cpp */; };
|
||||
95C1E3F20F699079005D33E6 /* race_gui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C1E3F10F699079005D33E6 /* race_gui.cpp */; };
|
||||
95C1E4000F699427005D33E6 /* font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C1E3FF0F699427005D33E6 /* font.cpp */; };
|
||||
95C2B1F70F296546000D3E5D /* actionmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95C2AC210F296540000D3E5D /* actionmap.cpp */; };
|
||||
@ -267,6 +268,8 @@
|
||||
953EAAB10F30A4410000D57D /* triangle_mesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = triangle_mesh.cpp; path = ../../physics/triangle_mesh.cpp; sourceTree = SOURCE_ROOT; };
|
||||
953EAAB40F30A4650000D57D /* translation.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = translation.hpp; path = ../../utils/translation.hpp; sourceTree = SOURCE_ROOT; };
|
||||
953EAAB50F30A4650000D57D /* translation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = translation.cpp; path = ../../utils/translation.cpp; sourceTree = SOURCE_ROOT; };
|
||||
953F038B0F6C880D00C77FE2 /* state_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = state_manager.cpp; path = games/supertuxkart/src/gui/state_manager.cpp; sourceTree = SYSTEM_DEVELOPER_DIR; };
|
||||
953F038E0F6C8AD800C77FE2 /* state_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = state_manager.hpp; path = games/supertuxkart/src/gui/state_manager.hpp; sourceTree = SYSTEM_DEVELOPER_DIR; };
|
||||
95C1E3EB0F698F23005D33E6 /* race_gui.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = race_gui.hpp; path = games/supertuxkart/src/gui/race_gui.hpp; sourceTree = SYSTEM_DEVELOPER_DIR; };
|
||||
95C1E3F10F699079005D33E6 /* race_gui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = race_gui.cpp; path = games/supertuxkart/src/gui/race_gui.cpp; sourceTree = SYSTEM_DEVELOPER_DIR; };
|
||||
95C1E3FF0F699427005D33E6 /* font.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = font.cpp; path = games/supertuxkart/src/gui/font.cpp; sourceTree = SYSTEM_DEVELOPER_DIR; };
|
||||
@ -1191,6 +1194,8 @@
|
||||
950557850F696A900056E88C /* widget.hpp */,
|
||||
95C1E3F10F699079005D33E6 /* race_gui.cpp */,
|
||||
95C1E3EB0F698F23005D33E6 /* race_gui.hpp */,
|
||||
953F038E0F6C8AD800C77FE2 /* state_manager.hpp */,
|
||||
953F038B0F6C880D00C77FE2 /* state_manager.cpp */,
|
||||
);
|
||||
name = gui;
|
||||
path = games/supertuxkart/src/gui;
|
||||
@ -2750,6 +2755,7 @@
|
||||
9505578B0F696A900056E88C /* widget.cpp in Sources */,
|
||||
95C1E3F20F699079005D33E6 /* race_gui.cpp in Sources */,
|
||||
95C1E4000F699427005D33E6 /* font.cpp in Sources */,
|
||||
953F038C0F6C880D00C77FE2 /* state_manager.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -270,7 +270,11 @@ std::string FileManager::getTrackDir() const
|
||||
{
|
||||
return m_root_dir+"/data/tracks";
|
||||
} // getTrackDir
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
std::string FileManager::getGUIDir() const
|
||||
{
|
||||
return m_root_dir+"/data/gui";
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
std::string FileManager::getKartDir() const
|
||||
{
|
||||
|
@ -59,8 +59,9 @@ public:
|
||||
std::string getHomeDir () const;
|
||||
std::string getTrackDir () const;
|
||||
std::string getKartDir () const;
|
||||
std::string getItemsDir () const;
|
||||
std::string getItemsDir () const;
|
||||
std::string getTranslationDir() const;
|
||||
std::string getGUIDir () const;
|
||||
std::vector<std::string>getMusicDirs() const;
|
||||
std::string getTextureFile (const std::string& fname) const;
|
||||
std::string getKartFile (const std::string& fname,
|
||||
|
19
src/main.cpp
@ -71,6 +71,8 @@
|
||||
#include "tracks/track.hpp"
|
||||
#include "tracks/track_manager.hpp"
|
||||
#include "utils/translation.hpp"
|
||||
#include "gui/engine.hpp"
|
||||
#include "gui/state_manager.hpp"
|
||||
|
||||
// Only needed for bullet debug!
|
||||
#ifdef HAVE_GLUT
|
||||
@ -510,6 +512,11 @@ void CleanTuxKart()
|
||||
|
||||
//=============================================================================
|
||||
|
||||
// FIXME - temporary, move
|
||||
void eventCallback(GUIEngine::Widget* widget, std::string& name)
|
||||
{
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[] )
|
||||
{
|
||||
try {
|
||||
@ -562,12 +569,14 @@ int main(int argc, char *argv[] )
|
||||
//fntInit();
|
||||
init_fonts();
|
||||
|
||||
// TODO - show main menu here
|
||||
//widget_manager = new WidgetManager;
|
||||
//menu_manager->switchToMainMenu();
|
||||
|
||||
inputDriver->setMode(SDLDriver::INGAME);
|
||||
// prepare main menu
|
||||
IrrlichtDevice* device = irr_driver->getDevice();
|
||||
video::IVideoDriver* driver = device->getVideoDriver();
|
||||
GUIEngine::init(device, driver, &eventCallback);
|
||||
|
||||
if(!user_config->m_no_start_screen) StateManager::pushMenu("main.stkgui");
|
||||
else StateManager::enterGameState();
|
||||
|
||||
// Replay a race
|
||||
// =============
|
||||
if(history->replayHistory())
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "modes/world.hpp"
|
||||
#include "user_config.hpp"
|
||||
#include "network/network_manager.hpp"
|
||||
#include "gui/state_manager.hpp"
|
||||
|
||||
MainLoop* main_loop = 0;
|
||||
|
||||
@ -206,9 +207,6 @@ void MainLoop::run()
|
||||
glEnd () ;
|
||||
}
|
||||
|
||||
// TODO - render menus if necessary
|
||||
//GUIEngine::render();
|
||||
//menu_manager->update();
|
||||
sound_manager->update(dt);
|
||||
|
||||
#ifdef HAVE_IRRLICHT
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "karts/kart_properties_manager.hpp"
|
||||
#include "gui/font.hpp"
|
||||
#include "gui/race_gui.hpp"
|
||||
#include "gui/state_manager.hpp"
|
||||
|
||||
#define DEADZONE_MOUSE 150
|
||||
#define DEADZONE_MOUSE_SENSE 200
|
||||
@ -330,7 +331,10 @@ void SDLDriver::input(Input::InputType type, int id0, int id1, int id2,
|
||||
int value)
|
||||
{
|
||||
// TODO - menus handle SDL input
|
||||
if(!StateManager::isGameState()) return;
|
||||
|
||||
RaceGUI* menu = getRaceGUI(); // FIXME - input is handled in menu class??
|
||||
|
||||
//BaseGUI* menu = menu_manager->getCurrentMenu();
|
||||
|
||||
GameAction ga = m_action_map->getEntry(type, id0, id1, id2);
|
||||
|