diff --git a/data/gui/main.stkgui b/data/gui/main.stkgui index f1ee699b9..9ecc5a373 100644 --- a/data/gui/main.stkgui +++ b/data/gui/main.stkgui @@ -1,22 +1,22 @@ <div x="5%" y="2%" width="90%" height="96%" layout="vertical-row" > -<icon id="logo" align="center" icon="logo.png"/> +<icon id="logo" align="center" icon="gui/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"/> + <icon-button id="new" width="128" height="128" icon="gui/main_race.png" text="Race"/> + <icon-button id="network" width="128" height="128" icon="gui/main_network.png" text="Networking"/> + <icon-button id="challenges" width="128" height="128" icon="gui/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"/> + <icon-button id="options" width="128" height="128" icon="gui/main_options.png" text="Options"/> + <icon-button id="help" width="128" height="128" icon="gui/main_help.png" text="Help"/> + <icon-button id="about" width="128" height="128" icon="gui/main_about.png" text="About"/> + <icon-button id="quit" width="128" height="128" icon="gui/main_quit.png" text="Quit"/> </buttonbar> <spacer proportion="1" width="10" proportion="1"/> diff --git a/data/gui/options_av.stkgui b/data/gui/options_av.stkgui index 9f47c3ba7..93dc66c45 100644 --- a/data/gui/options_av.stkgui +++ b/data/gui/options_av.stkgui @@ -3,9 +3,9 @@ <label align="center" text="SuperTuxKart Options"/> <ribbon id="options_choice" height="20%" width="75%" align="center"> - <icon-button id="audio_video" width="128" height="128" icon="options_audio_video.png" text="Audio/Video"/> - <icon-button id="players" width="128" height="128" icon="options_players.png" text="Players"/> - <icon-button id="controls" width="128" height="128" icon="options_input.png" text="Controls"/> + <icon-button id="audio_video" width="128" height="128" icon="gui/options_audio_video.png" text="Audio/Video"/> + <icon-button id="players" width="128" height="128" icon="gui/options_players.png" text="Players"/> + <icon-button id="controls" width="128" height="128" icon="gui/options_input.png" text="Controls"/> </ribbon> <spacer proportion="1" width="10" proportion="1"/> diff --git a/data/gui/options_input.stkgui b/data/gui/options_input.stkgui index cabaef2b9..64551fa96 100644 --- a/data/gui/options_input.stkgui +++ b/data/gui/options_input.stkgui @@ -3,9 +3,9 @@ <label align="center" text="SuperTuxKart Options"/> <ribbon id="options_choice" height="20%" width="75%" align="center"> - <icon-button id="audio_video" width="128" height="128" icon="options_audio_video.png" text="Audio/Video"/> - <icon-button id="players" width="128" height="128" icon="options_players.png" text="Players"/> - <icon-button id="controls" width="128" height="128" icon="options_input.png" text="Controls"/> + <icon-button id="audio_video" width="128" height="128" icon="gui/options_audio_video.png" text="Audio/Video"/> + <icon-button id="players" width="128" height="128" icon="gui/options_players.png" text="Players"/> + <icon-button id="controls" width="128" height="128" icon="gui/options_input.png" text="Controls"/> </ribbon> <spacer proportion="1" width="10" proportion="1"/> diff --git a/data/gui/options_players.stkgui b/data/gui/options_players.stkgui index 674417633..061c01fa3 100644 --- a/data/gui/options_players.stkgui +++ b/data/gui/options_players.stkgui @@ -3,9 +3,9 @@ <label align="center" text="SuperTuxKart Options"/> <ribbon id="options_choice" height="20%" width="75%" align="center"> - <icon-button id="audio_video" width="128" height="128" icon="options_audio_video.png" text="Audio/Video"/> - <icon-button id="players" width="128" height="128" icon="options_players.png" text="Players"/> - <icon-button id="controls" width="128" height="128" icon="options_input.png" text="Controls"/> + <icon-button id="audio_video" width="128" height="128" icon="gui/options_audio_video.png" text="Audio/Video"/> + <icon-button id="players" width="128" height="128" icon="gui/options_players.png" text="Players"/> + <icon-button id="controls" width="128" height="128" icon="gui/options_input.png" text="Controls"/> </ribbon> <spacer proportion="1" width="10" proportion="1"/> diff --git a/data/gui/racesetup.stkgui b/data/gui/racesetup.stkgui index 451270fa3..bb0144e17 100644 --- a/data/gui/racesetup.stkgui +++ b/data/gui/racesetup.stkgui @@ -7,24 +7,24 @@ <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"/> + <spinner id="aikartamount" proportion="3" height="100%" min_value="0" max_value="8" icon="gui/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"/> + <icon-button id="novice" width="128" height="128" icon="gui/difficulty_easy.png" text="Novice"/> + <icon-button id="intermediate" width="128" height="128" icon="gui/difficulty_medium.png" text="Intermediate"/> + <icon-button id="expert" width="128" height="128" icon="gui/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"/> + <icon-button id="normal" width="128" height="128" icon="gui/mode_normal.png" text="Snaky Sprint"/> + <icon-button id="timetrial" width="128" height="128" icon="gui/mode_tt.png" text="Time Trial"/> + <icon-button id="ftl" width="128" height="128" icon="gui/mode_ftl.png" text="Follow the Leader"/> + <icon-button id="3strikes" width="128" height="128" icon="gui/mode_3strikes.png" text="3 Strikes Battle"/> </buttonbar> <spacer proportion="2" width="25"/> diff --git a/data/gui/tracks.stkgui b/data/gui/tracks.stkgui index bce2f7370..49c08427f 100644 --- a/data/gui/tracks.stkgui +++ b/data/gui/tracks.stkgui @@ -3,10 +3,10 @@ <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"/> + <icon-button id="gp1" width="171" height="128" icon="gui/track1.png" text="Penguin Playground"/> + <icon-button id="gp2" width="171" height="128" icon="gui/track2.png" text="Snag Drive"/> + <icon-button id="gp3" width="171" height="128" icon="gui/track3.png" text="To the Moon and Back"/> + <icon-button id="gp4" width="171" height="128" icon="gui/track4.png" text="At World's End"/> </buttonbar> <label width="100%" height="25" text="All Tracks" align="center" text_align="center" /> diff --git a/src/gui/state_manager.cpp b/src/gui/state_manager.cpp index d12930654..b5201e2e7 100644 --- a/src/gui/state_manager.cpp +++ b/src/gui/state_manager.cpp @@ -71,14 +71,14 @@ namespace StateManager if(!karts_menu_inited) { - w->addItem("Gnu","k1","gnu.png"); - w->addItem("Wilber","k2","gnu.png"); - w->addItem("Tux","k3","gnu.png"); - w->addItem("Puffy","k4","gnu.png"); - w->addItem("Hexley","k5","gnu.png"); - w->addItem("Sushi","k6","gnu.png"); - w->addItem("Nolok","k7","gnu.png"); - w->addItem("Mozilla","k8","gnu.png"); + w->addItem("Gnu","k1","gui/gnu.png"); + w->addItem("Wilber","k2","gui/gnu.png"); + w->addItem("Tux","k3","gui/gnu.png"); + w->addItem("Puffy","k4","gui/gnu.png"); + w->addItem("Hexley","k5","gui/gnu.png"); + w->addItem("Sushi","k6","gui/gnu.png"); + w->addItem("Nolok","k7","gui/gnu.png"); + w->addItem("Mozilla","k8","gui/gnu.png"); karts_menu_inited = true; } w->updateItemDisplay(); @@ -213,14 +213,14 @@ namespace StateManager if(!track_menu_inited) { - w->addItem("Track 1","t1","track1.png"); - w->addItem("Track 2","t2","track2.png"); - w->addItem("Track 3","t3","track3.png"); - w->addItem("Track 4","t4","track4.png"); - w->addItem("Track 5","t5","track5.png"); - w->addItem("Track 6","t6","track6.png"); - w->addItem("Track 7","t7","track7.png"); - w->addItem("Track 8","t8","track8.png"); + w->addItem("Track 1","t1","gui/track1.png"); + w->addItem("Track 2","t2","gui/track2.png"); + w->addItem("Track 3","t3","gui/track3.png"); + w->addItem("Track 4","t4","gui/track4.png"); + w->addItem("Track 5","t5","gui/track5.png"); + w->addItem("Track 6","t6","gui/track6.png"); + w->addItem("Track 7","t7","gui/track7.png"); + w->addItem("Track 8","t8","gui/track8.png"); track_menu_inited = true; } w->updateItemDisplay(); diff --git a/src/gui/widget.cpp b/src/gui/widget.cpp index 92583e34c..80ecbef82 100644 --- a/src/gui/widget.cpp +++ b/src/gui/widget.cpp @@ -125,7 +125,7 @@ void Widget::readCoords(Widget* parent) if(m_properties[PROP_ICON].size() > 0) { ITexture* texture = GUIEngine::getDriver()->getTexture( - (file_manager->getGUIDir() + "/" + m_properties[PROP_ICON]).c_str() + (file_manager->getDataDir() + "/" + m_properties[PROP_ICON]).c_str() ); if(texture != NULL) { @@ -232,7 +232,7 @@ IconButtonWidget::IconButtonWidget(const bool clickable) // ----------------------------------------------------------------------------- void IconButtonWidget::add() { - ITexture* texture = GUIEngine::getDriver()->getTexture((file_manager->getGUIDir() + "/" +m_properties[PROP_ICON]).c_str()); + ITexture* texture = GUIEngine::getDriver()->getTexture((file_manager->getDataDir() + "/" +m_properties[PROP_ICON]).c_str()); //const int texture_w = texture->getSize().Width, texture_h = texture->getSize().Height; /* if(w < texture_w) ... ; @@ -467,7 +467,7 @@ void RibbonWidget::add() m_children[i].m_element = subbtn; subbtn->setUseAlphaChannel(true); - subbtn->setImage( GUIEngine::getDriver()->getTexture((file_manager->getGUIDir() + "/" + m_children[i].m_properties[PROP_ICON]).c_str()) ); + subbtn->setImage( GUIEngine::getDriver()->getTexture((file_manager->getDataDir() + "/" + m_children[i].m_properties[PROP_ICON]).c_str()) ); // ---- label part if(has_label) @@ -559,7 +559,7 @@ void SpinnerWidget::add() if(m_graphical) { char imagefile[128]; - std::string icon = file_manager->getGUIDir() + "/" + m_properties[PROP_ICON]; + std::string icon = file_manager->getDataDir() + "/" + 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; @@ -631,7 +631,7 @@ void SpinnerWidget::setValue(const int new_value) if(m_graphical) { char imagefile[128]; - std::string icon = file_manager->getGUIDir() + "/" + m_properties[PROP_ICON]; + std::string icon = file_manager->getDataDir() + "/" + 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)); @@ -707,7 +707,7 @@ void RibbonGridWidget::add() for(int i=0; i<m_col_amount; i++) { IconButtonWidget* icon = new IconButtonWidget(); - icon->m_properties[PROP_ICON]="track_random.png"; + icon->m_properties[PROP_ICON]="gui/track_random.png"; // set size to get proper ratio (as most textures are saved sccaled down to 256x256) icon->m_properties[PROP_WIDTH] = m_properties[PROP_CHILD_WIDTH]; @@ -919,7 +919,7 @@ void RibbonGridWidget::updateItemDisplay() if( trackid < track_amount ) { - std::string track_sshot = file_manager->getGUIDir() + "/" + m_items[trackid].m_sshot_file; + std::string track_sshot = file_manager->getDataDir() + "/" + m_items[trackid].m_sshot_file; button->setImage( GUIEngine::getDriver()->getTexture( track_sshot.c_str() )); button->setPressedImage( GUIEngine::getDriver()->getTexture( track_sshot.c_str()) ); icon->m_properties[PROP_ID] = m_items[trackid].m_code_name; @@ -929,7 +929,7 @@ void RibbonGridWidget::updateItemDisplay() { button->setImage( GUIEngine::getDriver()->getTexture( (file_manager->getGUIDir() + "/track_random.png").c_str() ) ); button->setPressedImage( GUIEngine::getDriver()->getTexture( (file_manager->getGUIDir() + "/track_random.png").c_str() ) ); - icon->m_properties[PROP_ID] = "track_random.png"; + icon->m_properties[PROP_ID] = "gui/track_random.png"; } } // next column } // next row diff --git a/src/io/file_manager.cpp b/src/io/file_manager.cpp index 7e1802885..fe414f3eb 100644 --- a/src/io/file_manager.cpp +++ b/src/io/file_manager.cpp @@ -279,6 +279,11 @@ std::string FileManager::getTrackDir() const return m_root_dir+"/data/tracks"; } // getTrackDir //----------------------------------------------------------------------------- +std::string FileManager::getDataDir() const +{ + return m_root_dir+"/data/"; +} +//----------------------------------------------------------------------------- std::string FileManager::getGUIDir() const { return m_root_dir+"/data/gui"; diff --git a/src/io/file_manager.hpp b/src/io/file_manager.hpp index 96339c5d2..26faaa1bd 100644 --- a/src/io/file_manager.hpp +++ b/src/io/file_manager.hpp @@ -62,6 +62,7 @@ public: std::string getHomeDir () const; std::string getTrackDir () const; std::string getKartDir () const; + std::string getDataDir () const; std::string getItemsDir () const; std::string getTranslationDir() const; std::string getGUIDir () const;