More icon updates

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@4219 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2009-11-14 00:04:47 +00:00
parent b2af9653f4
commit e276aad85f
6 changed files with 30 additions and 15 deletions

View File

@ -2,6 +2,8 @@ All icons come from Open Game Art (art by onyum.com, comissionned by Bart Kelsey
Except : Except :
random_kart.png, released under CC-BY-SA 3+, based on elements from onyum.com icons, by Marianne Gagnon
Logo and Logo_slim : under CC-BY-SA 3.0+ by 'rastapax' Logo and Logo_slim : under CC-BY-SA 3.0+ by 'rastapax'
main_*.png icons, released under Creative-Commons BY-SA 3, By yeKcim (Anthony Carré) main_*.png icons, released under Creative-Commons BY-SA 3, By yeKcim (Anthony Carré)

BIN
data/gui/random_kart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -215,7 +215,7 @@ void DynamicRibbonWidget::setSubElements()
for(int i=0; i<m_col_amount; i++) for(int i=0; i<m_col_amount; i++)
{ {
IconButtonWidget* icon = new IconButtonWidget(); IconButtonWidget* icon = new IconButtonWidget();
icon->m_properties[PROP_ICON]="gui/track_random.png"; icon->m_properties[PROP_ICON]="gui/main_help.png";
// set size to get proper ratio (as most textures are saved scaled down to 256x256) // set size to get proper ratio (as most textures are saved scaled down to 256x256)
icon->m_properties[PROP_WIDTH] = m_properties[PROP_CHILD_WIDTH]; icon->m_properties[PROP_WIDTH] = m_properties[PROP_CHILD_WIDTH];
@ -586,9 +586,9 @@ void DynamicRibbonWidget::updateItemDisplay()
} }
else else
{ {
button->setImage( GUIEngine::getDriver()->getTexture( (file_manager->getGUIDir() + "/track_random.png").c_str() ) ); button->setImage( GUIEngine::getDriver()->getTexture( (file_manager->getGUIDir() + "/main_help.png").c_str() ) );
button->setPressedImage( GUIEngine::getDriver()->getTexture( (file_manager->getGUIDir() + "/track_random.png").c_str() ) ); button->setPressedImage( GUIEngine::getDriver()->getTexture( (file_manager->getGUIDir() + "/main_help.png").c_str() ) );
icon->m_properties[PROP_ID] = "gui/track_random.png"; icon->m_properties[PROP_ID] = "gui/main_help.png";
} }
} // next column } // next column
} // next row } // next row

View File

@ -105,7 +105,7 @@ TrackInfoDialog::TrackInfoDialog(const std::string& trackIdent, const irr::core:
hscores_header->setTextAlignment(EGUIA_CENTER, EGUIA_CENTER); hscores_header->setTextAlignment(EGUIA_CENTER, EGUIA_CENTER);
ITexture* texture = irr_driver->getTexture( (file_manager->getGUIDir() + "/track_random.png").c_str() ) ; ITexture* texture = irr_driver->getTexture( (file_manager->getGUIDir() + "/random_kart.png").c_str() ) ;
std::string game_mode_ident = RaceManager::getIdentOf( race_manager->getMinorMode() ); std::string game_mode_ident = RaceManager::getIdentOf( race_manager->getMinorMode() );
const HighscoreEntry::HighscoreType type = "HST_" + game_mode_ident; const HighscoreEntry::HighscoreType type = "HST_" + game_mode_ident;

View File

@ -639,7 +639,7 @@ public:
ModelViewWidget* w3 = m_parent->m_kart_widgets[playerID].modelView; ModelViewWidget* w3 = m_parent->m_kart_widgets[playerID].modelView;
assert( w3 != NULL ); assert( w3 != NULL );
if (selectionID == "gui/track_random.png") if (selectionID == "randomkart")
{ {
// Random kart // Random kart
scene::IMesh* model = item_manager->getItemModel(Item::ITEM_BONUS_BOX); scene::IMesh* model = item_manager->getItemModel(Item::ITEM_BONUS_BOX);
@ -901,6 +901,9 @@ void KartSelectionScreen::init()
} }
} }
// add random
w->addItem(_("Random Kart"), "randomkart", file_manager->getGUIDir()+"/random_kart.png");
/* /*
TODO: Ultimately, it'd be nice to *not* delete g_player_karts so that TODO: Ultimately, it'd be nice to *not* delete g_player_karts so that
@ -961,7 +964,7 @@ void KartSelectionScreen::allPlayersDone()
{ {
std::string selection = m_kart_widgets[n].m_kartInternalName; std::string selection = m_kart_widgets[n].m_kartInternalName;
if (selection == "gui/track_random.png") if (selection == "randomkart")
{ {
// FIXME: in multiplayer game, if two players select' random' make sure they don't select // FIXME: in multiplayer game, if two players select' random' make sure they don't select
// the same kart or an already selected kart // the same kart or an already selected kart

View File

@ -17,6 +17,7 @@
#include "challenges/unlock_manager.hpp" #include "challenges/unlock_manager.hpp"
#include "guiengine/widget.hpp" #include "guiengine/widget.hpp"
#include "io/file_manager.hpp"
#include "states_screens/state_manager.hpp" #include "states_screens/state_manager.hpp"
#include "states_screens/tracks_screen.hpp" #include "states_screens/tracks_screen.hpp"
#include "states_screens/dialogs/track_info_dialog.hpp" #include "states_screens/dialogs/track_info_dialog.hpp"
@ -39,16 +40,24 @@ void TracksScreen::eventCallback(Widget* widget, const std::string& name, const
if (name == "tracks") if (name == "tracks")
{ {
DynamicRibbonWidget* w2 = dynamic_cast<DynamicRibbonWidget*>(widget); DynamicRibbonWidget* w2 = dynamic_cast<DynamicRibbonWidget*>(widget);
if(w2 != NULL) if (w2 != NULL)
{ {
std::cout << "Clicked on track " << w2->getSelectionIDString(GUI_PLAYER_ID).c_str() << std::endl; const std::string selection = w2->getSelectionIDString(GUI_PLAYER_ID);
std::cout << "Clicked on track " << selection.c_str() << std::endl;
Track* clickedTrack = track_manager->getTrack(w2->getSelectionIDString(GUI_PLAYER_ID)); if (selection == "random_track")
if (clickedTrack != NULL)
{ {
ITexture* screenshot = GUIEngine::getDriver()->getTexture( clickedTrack->getScreenshotFile().c_str() ); // TODO
}
new TrackInfoDialog( clickedTrack->getIdent(), clickedTrack->getName().c_str(), screenshot, 0.8f, 0.7f); else
{
Track* clickedTrack = track_manager->getTrack(selection);
if (clickedTrack != NULL)
{
ITexture* screenshot = GUIEngine::getDriver()->getTexture( clickedTrack->getScreenshotFile().c_str() );
new TrackInfoDialog( clickedTrack->getIdent(), clickedTrack->getName().c_str(), screenshot, 0.8f, 0.7f);
}
} }
} }
} }
@ -81,7 +90,8 @@ void TracksScreen::init()
} }
w->addItem(curr->getName(), curr->getIdent(), curr->getScreenshotFile()); w->addItem(curr->getName(), curr->getIdent(), curr->getScreenshotFile());
} }
w->addItem(_("Random Track"), "random_track", file_manager->getGUIDir() + "/track_random.png");
if (hasLockedTracks) if (hasLockedTracks)
{ {
w->addItem(_("Locked Tracks"), "Lock", "textures/gui_lock.png"); w->addItem(_("Locked Tracks"), "Lock", "textures/gui_lock.png");