- Timestamp:
- Dec 3, 2009, 8:10:07 PM (15 years ago)
- Location:
- code/branches/presentation2/data/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/data/gui/layouts/AudioMenu.layout
r6206 r6233 15 15 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 16 16 <Property Name="VertFormatting" Value="TopAligned" /> 17 <Property Name="UnifiedAreaRect" Value="{{0. 15,0},{0.325,0},{0.85,0},{0.6,0}}" />17 <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.325,0},{0.8,0},{0.6,0}}" /> 18 18 <Window Type="TaharezLook/StaticText" Name="orxonox/MasterVolume" > 19 <Property Name="Text" Value="Master volume " />19 <Property Name="Text" Value="Master volume " /> 20 20 <Property Name="InheritsAlpha" Value="False" /> 21 21 <Property Name="HorzFormatting" Value="HorzCentred" /> 22 22 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 23 23 <Property Name="VertFormatting" Value="TopAligned" /> 24 <Property Name="UnifiedAreaRect" Value="{{0.0 3,0},{0.2,0},{0.34,0},{0.4,0}}" />24 <Property Name="UnifiedAreaRect" Value="{{0.041666,0},{0.2,0},{0.5625,0},{0.4,0}}" /> 25 25 <Window Type="TaharezLook/HorizontalScrollbar" Name="orxonox/MasterScrollbar" > 26 26 <Property Name="PageSize" Value="0" /> … … 31 31 <Property Name="StepSize" Value="0.1" /> 32 32 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 33 <Property Name="UnifiedAreaRect" Value="{{0.0 5,0},{0.6,0},{0.95,0},{0.8,0}}" />33 <Property Name="UnifiedAreaRect" Value="{{0.04,0},{0.6,0},{0.71,0},{0.8,0}}" /> 34 34 <Event Name="ThumbTrackStarted" Function="AudioMenu.AudioMasterScrollbar_started" /> 35 35 <Event Name="ThumbTrackEnded" Function="AudioMenu.AudioMasterScrollbar_ended" /> 36 36 <Event Name="ScrollPosChanged" Function="AudioMenu.AudioMasterScrollbar_changed" /> 37 37 </Window> 38 <Window Type="TaharezLook/Checkbox" Name="orxonox/MasterCheckbox" > 39 <Property Name="Text" Value="Mute" /> 40 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 41 <Property Name="UnifiedAreaRect" Value="{{0.775,0},{0.45,0},{0.96,0},{0.9,0}}" /> 42 <Event Name="CheckStateChanged" Function="AudioMenu.AudioMuteMasterCheckbox_clicked"/> 43 </Window> 38 44 </Window> 39 45 <Window Type="TaharezLook/StaticText" Name="orxonox/MusicVolume" > 40 <Property Name="Text" Value="Music volume " />46 <Property Name="Text" Value="Music volume " /> 41 47 <Property Name="InheritsAlpha" Value="False" /> 42 48 <Property Name="HorzFormatting" Value="HorzCentred" /> 43 49 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 44 50 <Property Name="VertFormatting" Value="TopAligned" /> 45 <Property Name="UnifiedAreaRect" Value="{{0.0 3,0},{0.45,0},{0.34,0},{0.65,0}}" />51 <Property Name="UnifiedAreaRect" Value="{{0.041666,0},{0.45,0},{0.5625,0},{0.65,0}}" /> 46 52 <Window Type="TaharezLook/HorizontalScrollbar" Name="orxonox/MusicScrollbar" > 47 53 <Property Name="PageSize" Value="0" /> … … 52 58 <Property Name="StepSize" Value="0.1" /> 53 59 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 54 <Property Name="UnifiedAreaRect" Value="{{0.0 5,0},{0.6,0},{0.95,0},{0.8,0}}" />60 <Property Name="UnifiedAreaRect" Value="{{0.04,0},{0.6,0},{0.71,0},{0.8,0}}" /> 55 61 <Event Name="ThumbTrackStarted" Function="AudioMenu.AudioMusicScrollbar_started" /> 56 62 <Event Name="ThumbTrackEnded" Function="AudioMenu.AudioMusicScrollbar_ended" /> 57 63 <Event Name="ScrollPosChanged" Function="AudioMenu.AudioMusicScrollbar_changed" /> 58 64 </Window> 65 <Window Type="TaharezLook/Checkbox" Name="orxonox/MusicCheckbox" > 66 <Property Name="Text" Value="Mute" /> 67 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 68 <Property Name="UnifiedAreaRect" Value="{{0.775,0},{0.45,0},{0.96,0},{0.9,0}}" /> 69 <Event Name="CheckStateChanged" Function="AudioMenu.AudioMuteMusicCheckbox_clicked"/> 70 </Window> 59 71 </Window> 60 72 <Window Type="TaharezLook/StaticText" Name="orxonox/EffectsVolume" > 61 <Property Name="Text" Value="Effects volume " />73 <Property Name="Text" Value="Effects volume " /> 62 74 <Property Name="InheritsAlpha" Value="False" /> 63 75 <Property Name="HorzFormatting" Value="HorzCentred" /> 64 76 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 65 77 <Property Name="VertFormatting" Value="TopAligned" /> 66 <Property Name="UnifiedAreaRect" Value="{{0.0 3,0},{0.7,0},{0.34,0},{0.9,0}}" />78 <Property Name="UnifiedAreaRect" Value="{{0.041666,0},{0.7,0},{0.5625,0},{0.9,0}}" /> 67 79 <Window Type="TaharezLook/HorizontalScrollbar" Name="orxonox/EffectsScrollbar" > 68 80 <Property Name="PageSize" Value="0" /> … … 73 85 <Property Name="StepSize" Value="0.1" /> 74 86 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 75 <Property Name="UnifiedAreaRect" Value="{{0.0 5,0},{0.6,0},{0.95,0},{0.8,0}}" />87 <Property Name="UnifiedAreaRect" Value="{{0.04,0},{0.6,0},{0.71,0},{0.8,0}}" /> 76 88 <Event Name="ThumbTrackStarted" Function="AudioMenu.AudioEffectsScrollbar_started" /> 77 89 <Event Name="ThumbTrackEnded" Function="AudioMenu.AudioEffectsScrollbar_ended" /> 78 90 <Event Name="ScrollPosChanged" Function="AudioMenu.AudioEffectsScrollbar_changed" /> 91 </Window> 92 <Window Type="TaharezLook/Checkbox" Name="orxonox/EffectsCheckbox" > 93 <Property Name="Text" Value="Mute" /> 94 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 95 <Property Name="UnifiedAreaRect" Value="{{0.775,0},{0.45,0},{0.96,0},{0.9,0}}" /> 96 <Event Name="CheckStateChanged" Function="AudioMenu.AudioMuteEffectsCheckbox_clicked"/> 79 97 </Window> 80 98 </Window> … … 85 103 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 86 104 <Property Name="VertFormatting" Value="TopAligned" /> 87 <Property Name="UnifiedAreaRect" Value="{{0.6 6,0},{0.2,0},{0.97,0},{0.9,0}}" />105 <Property Name="UnifiedAreaRect" Value="{{0.604166,0},{0.2,0},{0.958333,0},{0.9,0}}" /> 88 106 <Window Type="TaharezLook/Combobox" Name="orxonox/AudioThemeCombobox" > 89 107 <Property Name="AlwaysOnTop" Value="True" /> … … 95 113 </Window> 96 114 </Window> 97 <Window Type="TaharezLook/Checkbox" Name="orxonox/MasterCheckbox" >98 <Property Name="Text" Value="Mute master" />99 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />100 <Property Name="UnifiedAreaRect" Value="{{0.375,0},{0.275,0},{0.625,0},{0.375,0}}" />101 <Event Name="CheckStateChanged" Function="AudioMenu.AudioMuteMasterCheckbox_clicked"/>102 </Window>103 <Window Type="TaharezLook/Checkbox" Name="orxonox/MusicCheckbox" >104 <Property Name="Text" Value="Mute music" />105 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />106 <Property Name="UnifiedAreaRect" Value="{{0.375,0},{0.525,0},{0.625,0},{0.625,0}}" />107 <Event Name="CheckStateChanged" Function="AudioMenu.AudioMuteMusicCheckbox_clicked"/>108 </Window>109 <Window Type="TaharezLook/Checkbox" Name="orxonox/EffectsCheckbox" >110 <Property Name="Text" Value="Mute effects" />111 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />112 <Property Name="UnifiedAreaRect" Value="{{0.375,0},{0.775,0},{0.625,0},{0.875,0}}" />113 <Event Name="CheckStateChanged" Function="AudioMenu.AudioMuteEffectsCheckbox_clicked"/>114 </Window>115 115 </Window> 116 116 <Window Type="TaharezLook/Button" Name="orxonox/AudioBackButton" > … … 120 120 <Event Name="Clicked" Function="AudioMenu.AudioBackButton_clicked"/> 121 121 </Window> 122 <Window Type="TaharezLook/StaticText" Name="orxonox/AudioAvailable" >123 <Property Name="Text" Value="Changes in audio settings are not yet available." />124 <Property Name="TextColours" Value="FFFF0000" />125 <Property Name="InheritsAlpha" Value="False" />126 <Property Name="HorzFormatting" Value="HorzCentred" />127 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />128 <Property Name="VertFormatting" Value="TopAligned" />129 <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.75,0},{0.75,0},{0.8,0}}" />130 </Window>131 122 </Window> 132 123 </GUILayout> -
code/branches/presentation2/data/gui/layouts/SettingsMenu.layout
r6206 r6233 26 26 <Window Type="TaharezLook/Button" Name="orxonox/MultiplayerOptionsButton" > 27 27 <Property Name="Text" Value="Multiplayer options" /> 28 <Property Name="Disabled" Value="True" /> 28 29 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 29 30 <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.454545,0},{0.45,0},{0.636363,0}}" /> -
code/branches/presentation2/data/gui/scripts/AudioMenu.lua
r6206 r6233 14 14 function P:init() 15 15 soundMgr = orxonox.SoundManager:getInstance() 16 block = false 16 17 masterscrollbar_active = false 17 18 musicscrollbar_active = false … … 20 21 musicvolume = soundMgr:getVolume(orxonox.SoundType.ambient) 21 22 effectsvolume = soundMgr:getVolume(orxonox.SoundType.effects) 22 window = tolua.cast(winMgr:getWindow("orxonox/MasterScrollbar"),"CEGUI::Scrollbar") 23 window:setScrollPosition(mastervolume) 24 window = tolua.cast(winMgr:getWindow("orxonox/MusicScrollbar"),"CEGUI::Scrollbar") 25 window:setScrollPosition(musicvolume) 26 window = tolua.cast(winMgr:getWindow("orxonox/EffectsScrollbar"),"CEGUI::Scrollbar") 27 window:setScrollPosition(effectsvolume) 28 dropdown = winMgr:getWindow("orxonox/AudioThemeCombobox") 23 mastermute = soundMgr:getMute(orxonox.SoundType.none) 24 musicmute = soundMgr:getMute(orxonox.SoundType.ambient) 25 effectsmute = soundMgr:getMute(orxonox.SoundType.effects) 26 masterscrollbarwindow = tolua.cast(winMgr:getWindow("orxonox/MasterScrollbar"),"CEGUI::Scrollbar") 27 musicscrollbarwindow = tolua.cast(winMgr:getWindow("orxonox/MusicScrollbar"),"CEGUI::Scrollbar") 28 effectsscrollbarwindow = tolua.cast(winMgr:getWindow("orxonox/EffectsScrollbar"),"CEGUI::Scrollbar") 29 mastermutewindow = tolua.cast(winMgr:getWindow("orxonox/MasterCheckbox"),"CEGUI::Checkbox") 30 musicmutewindow = tolua.cast(winMgr:getWindow("orxonox/MusicCheckbox"),"CEGUI::Checkbox") 31 effectsmutewindow = tolua.cast(winMgr:getWindow("orxonox/EffectsCheckbox"),"CEGUI::Checkbox") 32 masterscrollbarwindow:setScrollPosition(mastervolume) 33 musicscrollbarwindow:setScrollPosition(musicvolume) 34 effectsscrollbarwindow:setScrollPosition(effectsvolume) 35 mastermutewindow:setSelected(mastermute) 36 musicmutewindow:setSelected(musicmute) 37 effectsmutewindow:setSelected(effectsmute) 38 choice = "Default" 39 dropdownwindow = winMgr:getWindow("orxonox/AudioThemeCombobox") 29 40 local themeList = {} 30 41 table.insert(themeList, "Default") … … 33 44 item = CEGUI.createListboxTextItem(v) 34 45 item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush") 35 CEGUI.toCombobox(dropdown ):addItem(item)46 CEGUI.toCombobox(dropdownwindow):addItem(item) 36 47 end 48 dropdownwindow:setItemSelectState(0,true) 37 49 end 38 50 39 51 function P.AudioMasterScrollbar_changed(e) 52 if mastermute then 53 block = true 54 mastermutewindow:setSelected(false) 55 block = false 56 mastermute = false 57 end 40 58 if masterscrollbar_active == false then 41 window = tolua.cast(winMgr:getWindow("orxonox/MasterScrollbar"),"CEGUI::Scrollbar") 42 volume = window:getScrollPosition() 43 orxonox.CommandExecutor:execute("config SoundManager soundVolume_ " .. volume) 59 mastervolume = masterscrollbarwindow:getScrollPosition() 60 orxonox.CommandExecutor:execute("config SoundManager soundVolume_ " .. mastervolume) 44 61 end 45 62 end … … 50 67 51 68 function P.AudioMasterScrollbar_ended(e) 52 window = tolua.cast(winMgr:getWindow("orxonox/MasterScrollbar"),"CEGUI::Scrollbar") 53 volume = window:getScrollPosition() 54 orxonox.CommandExecutor:execute("config SoundManager soundVolume_ " .. volume) 69 mastervolume = masterscrollbarwindow:getScrollPosition() 70 orxonox.CommandExecutor:execute("config SoundManager soundVolume_ " .. mastervolume) 55 71 masterscrollbar_active = false 56 72 end 57 73 58 74 function P.AudioMusicScrollbar_changed(e) 75 if musicmute then 76 block = true 77 musicmutewindow:setSelected(false) 78 block = false 79 musicmute = false 80 end 59 81 if musicscrollbar_active == false then 60 window = tolua.cast(winMgr:getWindow("orxonox/MusicScrollbar"),"CEGUI::Scrollbar") 61 volume = window:getScrollPosition() 62 orxonox.CommandExecutor:execute("config SoundManager ambientVolume_ " .. volume) 82 musicvolume = musicscrollbarwindow:getScrollPosition() 83 orxonox.CommandExecutor:execute("config SoundManager ambientVolume_ " .. musicvolume) 63 84 end 64 85 end … … 69 90 70 91 function P.AudioMusicScrollbar_ended(e) 71 window = tolua.cast(winMgr:getWindow("orxonox/MusicScrollbar"),"CEGUI::Scrollbar")72 volume =window:getScrollPosition()73 orxonox.CommandExecutor:execute("config SoundManager ambientVolume_ " .. volume)92 musicmutewindow:setSelected(false) 93 musicvolume = musicscrollbarwindow:getScrollPosition() 94 orxonox.CommandExecutor:execute("config SoundManager ambientVolume_ " .. musicvolume) 74 95 musicscrollbar_active = false 75 96 end 76 97 77 98 function P.AudioEffectsScrollbar_changed(e) 99 if effectsmute then 100 block = true 101 effectsmutewindow:setSelected(false) 102 block = false 103 effectsmute = false 104 end 78 105 if effectsscrollbar_active == false then 79 window = tolua.cast(winMgr:getWindow("orxonox/EffectsScrollbar"),"CEGUI::Scrollbar") 80 volume = window:getScrollPosition() 81 orxonox.CommandExecutor:execute("config SoundManager effectsVolume_ " .. volume) 106 effectsvolume = effectsscrollbarwindow:getScrollPosition() 107 orxonox.CommandExecutor:execute("config SoundManager effectsVolume_ " .. effectsvolume) 82 108 end 83 109 end … … 88 114 89 115 function P.AudioEffectsScrollbar_ended(e) 90 window = tolua.cast(winMgr:getWindow("orxonox/EffectsScrollbar"),"CEGUI::Scrollbar")91 volume =window:getScrollPosition()92 orxonox.CommandExecutor:execute("config SoundManager effectsVolume_ " .. volume)116 effectsmutewindow:setSelected(false) 117 effectsvolume = effectsscrollbarwindow:getScrollPosition() 118 orxonox.CommandExecutor:execute("config SoundManager effectsVolume_ " .. effectsvolume) 93 119 effectsscrollbar_active = false 94 120 end 95 121 96 122 function P.AudioMuteMasterCheckbox_clicked(e) 97 -- if 98 -- mastervolume = soundMgr:getVolume(orxonox.SoundType.none) 99 -- window = tolua.cast(winMgr:getWindow("orxonox/MasterScrollbar"),"CEGUI::Scrollbar") 100 -- window:setScrollPosition(0) 101 -- end 102 soundMgr:toggleMute(orxonox.SoundType.none) 123 if block == false then 124 if mastermute then 125 masterscrollbarwindow:setScrollPosition(mastervolume) 126 mastermute = false 127 else 128 temp = masterscrollbarwindow:getScrollPosition() 129 masterscrollbarwindow:setScrollPosition(0) 130 mastervolume = temp 131 mastermute = true 132 end 133 soundMgr:toggleMute(orxonox.SoundType.none) 134 end 103 135 end 104 136 105 137 function P.AudioMuteMusicCheckbox_clicked(e) 106 soundMgr:toggleMute(orxonox.SoundType.ambient) 138 if block == false then 139 if musicmute then 140 musicscrollbarwindow:setScrollPosition(musicvolume) 141 musicmute = false 142 else 143 temp = musicscrollbarwindow:getScrollPosition() 144 musicscrollbarwindow:setScrollPosition(0) 145 musicvolume = temp 146 musicmute = true 147 end 148 soundMgr:toggleMute(orxonox.SoundType.ambient) 149 end 107 150 end 108 151 109 152 function P.AudioMuteEffectsCheckbox_clicked(e) 110 soundMgr:toggleMute(orxonox.SoundType.effects) 153 if block == false then 154 if effectsmute then 155 effectsscrollbarwindow:setScrollPosition(effectsvolume) 156 effectsmute = false 157 else 158 temp = effectsscrollbarwindow:getScrollPosition() 159 effectsscrollbarwindow:setScrollPosition(0) 160 effectsvolume = temp 161 effectsmute = true 162 end 163 soundMgr:toggleMute(orxonox.SoundType.effects) 164 end 111 165 end 112 166 113 167 function P.AudioThemeCombobox_changed(e) 114 -- local choice = winMgr:getWindow("orxonox/AudioThemeCombobox"):getFirstSelectedItem() 115 -- if choice == "Default" then 116 -- orxonox.CommandExecutor:execute("setMood default") 117 -- debug("default selected") 118 -- end 119 -- if choice == "Drum 'n Bass" then 120 -- orxonox.CommandExecutor:execute("setMood dnb") 121 -- debug("dnb selected") 122 -- end 168 if dropdownwindow:isItemSelected(1) then 169 orxonox.CommandExecutor:execute("setMood dnb") 170 else 171 orxonox.CommandExecutor:execute("setMood default") 172 end 123 173 end 124 174
Note: See TracChangeset
for help on using the changeset viewer.