music and sound volume can be modified in options. much left to do : make the gauge nicer-looking, save value to file, load value from file, make the slider start at an actual value, ...
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3390 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
35bb0035be
commit
5ddb03e272
@ -76,7 +76,6 @@ Benjamin Arnaudet
|
||||
MacIO
|
||||
- Cave X arena
|
||||
|
||||
|
||||
Ivar ten Cate (Varivar)
|
||||
- Old mine track
|
||||
- Tux Tollway track
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
@ -1,4 +1,6 @@
|
||||
|
||||
#include "audio/sound_manager.hpp"
|
||||
#include "audio/sfx_manager.hpp"
|
||||
#include "gui/state_manager.hpp"
|
||||
#include "gui/engine.hpp"
|
||||
#include "gui/widget.hpp"
|
||||
@ -284,6 +286,25 @@ namespace StateManager
|
||||
else if(selection == "players") replaceTopMostMenu("options_players.stkgui");
|
||||
else if(selection == "controls") replaceTopMostMenu("options_input.stkgui");
|
||||
}
|
||||
else if(name == "music_volume")
|
||||
{
|
||||
GUIEngine::GaugeWidget* w = dynamic_cast<GUIEngine::GaugeWidget*>
|
||||
(GUIEngine::getCurrentScreen()->getWidget("music_volume"));
|
||||
assert(w != NULL);
|
||||
|
||||
// TODO - save value to file, load value from file, make the slider start at an actual value
|
||||
sound_manager->setMasterMusicVolume( w->getValue() );
|
||||
}
|
||||
else if(name == "sfx_volume")
|
||||
{
|
||||
GUIEngine::GaugeWidget* w = dynamic_cast<GUIEngine::GaugeWidget*>
|
||||
(GUIEngine::getCurrentScreen()->getWidget("sfx_volume"));
|
||||
assert(w != NULL);
|
||||
|
||||
// TODO - save value to file, load value from file, make the slider start at an actual value
|
||||
sfx_manager->setMasterSFXVolume( w->getValue() );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -266,6 +266,13 @@ void GaugeWidget::add()
|
||||
m_element->setTabOrder(id);
|
||||
m_element->setTabGroup(false);
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
float GaugeWidget::getValue()
|
||||
{
|
||||
IGUIScrollBar* sb = dynamic_cast<IGUIScrollBar*>(m_element);
|
||||
assert(sb != NULL);
|
||||
return (float)sb->getPos() / sb->getMax();
|
||||
}
|
||||
|
||||
#if 0
|
||||
#pragma mark -
|
||||
|
@ -171,6 +171,7 @@ namespace GUIEngine
|
||||
void add();
|
||||
public:
|
||||
virtual ~GaugeWidget() {}
|
||||
float getValue();
|
||||
};
|
||||
|
||||
class SpinnerWidget : public Widget
|
||||
|
Loading…
x
Reference in New Issue
Block a user