Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/data/gui/scripts/AudioMenu.lua @ 8649

Last change on this file since 8649 was 8351, checked in by rgrieder, 14 years ago

Merged kicklib2 branch back to trunk (includes former branches ois_update, mac_osx and kicklib).

Notes for updating

Linux:
You don't need an extra package for CEGUILua and Tolua, it's already shipped with CEGUI.
However you do need to make sure that the OgreRenderer is installed too with CEGUI 0.7 (may be a separate package).
Also, Orxonox now recognises if you install the CgProgramManager (a separate package available on newer Ubuntu on Debian systems).

Windows:
Download the new dependency packages versioned 6.0 and use these. If you have problems with that or if you don't like the in game console problem mentioned below, you can download the new 4.3 version of the packages (only available for Visual Studio 2005/2008).

Key new features:

  • *Support for Mac OS X*
  • Visual Studio 2010 support
  • Bullet library update to 2.77
  • OIS library update to 1.3
  • Support for CEGUI 0.7 —> Support for Arch Linux and even SuSE
  • Improved install target
  • Compiles now with GCC 4.6
  • Ogre Cg Shader plugin activated for Linux if available
  • And of course lots of bug fixes

There are also some regressions:

  • No support for CEGUI 0.5, Ogre 1.4 and boost 1.35 - 1.39 any more
  • In game console is not working in main menu for CEGUI 0.7
  • Tolua (just the C lib, not the application) and CEGUILua libraries are no longer in our repository. —> You will need to get these as well when compiling Orxonox
  • And of course lots of new bugs we don't yet know about
  • Property svn:eol-style set to native
File size: 6.4 KB
RevLine 
[6363]1-- AudioMenu.lua
2
[6746]3local P = createMenuSheet("AudioMenu")
[6363]4
[6746]5function P.onLoad()
[6363]6    soundMgr = orxonox.SoundManager:getInstance()
7    block = false
8    masterscrollbar_active = false
9    musicscrollbar_active = false
10    effectsscrollbar_active = false
[6370]11    mastervolume = soundMgr:getVolume(orxonox.SoundType.All)
12    musicvolume = soundMgr:getVolume(orxonox.SoundType.Music)
13    effectsvolume = soundMgr:getVolume(orxonox.SoundType.Effects)
14    mastermute = soundMgr:getMute(orxonox.SoundType.All)
15    musicmute = soundMgr:getMute(orxonox.SoundType.Music)
16    effectsmute = soundMgr:getMute(orxonox.SoundType.Effects)
[6363]17    masterscrollbarwindow = tolua.cast(winMgr:getWindow("orxonox/MasterScrollbar"),"CEGUI::Scrollbar")
18    musicscrollbarwindow = tolua.cast(winMgr:getWindow("orxonox/MusicScrollbar"),"CEGUI::Scrollbar")
19    effectsscrollbarwindow = tolua.cast(winMgr:getWindow("orxonox/EffectsScrollbar"),"CEGUI::Scrollbar")
20    mastermutewindow = tolua.cast(winMgr:getWindow("orxonox/MasterCheckbox"),"CEGUI::Checkbox")
21    musicmutewindow = tolua.cast(winMgr:getWindow("orxonox/MusicCheckbox"),"CEGUI::Checkbox")
22    effectsmutewindow = tolua.cast(winMgr:getWindow("orxonox/EffectsCheckbox"),"CEGUI::Checkbox")
23    masterscrollbarwindow:setScrollPosition(mastervolume)
24    musicscrollbarwindow:setScrollPosition(musicvolume)
25    effectsscrollbarwindow:setScrollPosition(effectsvolume)
26    mastermutewindow:setSelected(mastermute)
27    musicmutewindow:setSelected(musicmute)
28    effectsmutewindow:setSelected(effectsmute)
29    choice = "Default"
30    listboxwindow = winMgr:getWindow("orxonox/AudioThemeListbox")
31    local themeList = {}
32    table.insert(themeList, "Default")
33    table.insert(themeList, "Drum n' Bass")
[8351]34    table.insert(themeList, "8-Bit Style")
35    table.insert(themeList, "Corny Jazz")
[6363]36    for k,v in pairs(themeList) do
[6388]37        item = CEGUI.createListboxTextItem(v)
[6746]38        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
[6363]39        CEGUI.toListbox(listboxwindow):addItem(item)
40    end
[6406]41    if orxonox.getConfig("MoodManager", "mood_") == "dnb" then
42        listboxwindow:setItemSelectState(1,true)
[8351]43    elseif orxonox.getConfig("MoodManager", "mood_") == "eightbit" then
44        listboxwindow:setItemSelectState(2,true)
45    elseif orxonox.getConfig("MoodManager", "mood_") == "jazzy" then
46        listboxwindow:setItemSelectState(3,true)
[6406]47    else
48        listboxwindow:setItemSelectState(0,true)
49    end
[7689]50
[8079]51    P:setButton(1, 1, {
[7689]52            ["button"] = winMgr:getWindow("orxonox/AudioBackButton"),
[8079]53            ["callback"]  = P.AudioBackButton_clicked
54    })
[6363]55end
56
57function P.AudioMasterScrollbar_changed(e)
58    if mastermute then
59        block = true
60        mastermutewindow:setSelected(false)
61        block = false
62        mastermute = false
63    end
64    if masterscrollbar_active == false then
65        mastervolume = masterscrollbarwindow:getScrollPosition()
[6403]66        orxonox.config("SoundManager", "soundVolume_", mastervolume)
[6363]67    end
68end
69
70function P.AudioMasterScrollbar_started(e)
71    masterscrollbar_active = true
72end
73
74function P.AudioMasterScrollbar_ended(e)
75    mastervolume = masterscrollbarwindow:getScrollPosition()
[6403]76    orxonox.config("SoundManager", "soundVolume_", mastervolume)
[6363]77    masterscrollbar_active = false
78end
79
80function P.AudioMusicScrollbar_changed(e)
81    if musicmute then
82        block = true
83        musicmutewindow:setSelected(false)
84        block = false
85        musicmute = false
86    end
87    if musicscrollbar_active == false then
88        musicvolume = musicscrollbarwindow:getScrollPosition()
[6403]89        orxonox.config("SoundManager", "ambientVolume_", musicvolume)
[6363]90    end
91end
92
93function P.AudioMusicScrollbar_started(e)
94    musicscrollbar_active = true
95end
96
97function P.AudioMusicScrollbar_ended(e)
98    musicmutewindow:setSelected(false)
99    musicvolume = musicscrollbarwindow:getScrollPosition()
[6403]100    orxonox.config("SoundManager", "ambientVolume_", musicvolume)
[6363]101    musicscrollbar_active = false
102end
103
104function P.AudioEffectsScrollbar_changed(e)
105    if effectsmute then
106        block = true
107        effectsmutewindow:setSelected(false)
108        block = false
109        effectsmute = false
110    end
111    if effectsscrollbar_active == false then
112        effectsvolume = effectsscrollbarwindow:getScrollPosition()
[6403]113        orxonox.config("SoundManager", "effectsVolume_", effectsvolume)
[6363]114    end
115end
116
117function P.AudioEffectsScrollbar_started(e)
118    effectsscrollbar_active = true
119end
120
121function P.AudioEffectsScrollbar_ended(e)
122    effectsmutewindow:setSelected(false)
123    effectsvolume = effectsscrollbarwindow:getScrollPosition()
[6403]124    orxonox.config("SoundManager", "effectsVolume_", effectsvolume)
[6363]125    effectsscrollbar_active = false
126end
127
128function P.AudioMuteMasterCheckbox_clicked(e)
129    if block == false then
130        if mastermute then
131            masterscrollbarwindow:setScrollPosition(mastervolume)
132            mastermute = false
133        else
134            temp = masterscrollbarwindow:getScrollPosition()
135            masterscrollbarwindow:setScrollPosition(0)
136            mastervolume = temp
137            mastermute = true
138        end
139    end
[6370]140    soundMgr:toggleMute(orxonox.SoundType.All)
[6363]141end
142
143function P.AudioMuteMusicCheckbox_clicked(e)
144    if block == false then
145        if musicmute then
146            musicscrollbarwindow:setScrollPosition(musicvolume)
147            musicmute = false
148        else
149            temp = musicscrollbarwindow:getScrollPosition()
150            musicscrollbarwindow:setScrollPosition(0)
151            musicvolume = temp
152            musicmute = true
153        end
154    end
[6370]155    soundMgr:toggleMute(orxonox.SoundType.Music)
[6363]156end
157
158function P.AudioMuteEffectsCheckbox_clicked(e)
159    if block == false then
160        if effectsmute then
161            effectsscrollbarwindow:setScrollPosition(effectsvolume)
162            effectsmute = false
163        else
164            temp = effectsscrollbarwindow:getScrollPosition()
165            effectsscrollbarwindow:setScrollPosition(0)
166            effectsvolume = temp
167            effectsmute = true
168        end
169    end
[6370]170    soundMgr:toggleMute(orxonox.SoundType.Effects)
[6363]171end
172
173function P.AudioThemeListbox_changed(e)
174    if listboxwindow:isItemSelected(1) then
[6406]175        orxonox.config("MoodManager", "mood_", "dnb")
[8351]176    elseif listboxwindow:isItemSelected(2) then
177        orxonox.config("MoodManager", "mood_", "eightbit")
178    elseif listboxwindow:isItemSelected(3) then
179        orxonox.config("MoodManager", "mood_", "jazzy")
[6363]180    else
[6406]181        orxonox.config("MoodManager", "mood_", "default")
[6363]182    end
183end
184
185function P.AudioBackButton_clicked(e)
[6746]186    hideMenuSheet(P.name)
[6363]187end
188
189return P
190
Note: See TracBrowser for help on using the repository browser.