Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 22, 2009, 11:20:19 PM (15 years ago)
Author:
rgrieder
Message:

Added lua convenience function for console commmands: orxonox.execute(cmd)
Also replaced the config commands with the actual orxonox.config function.

Location:
code/branches/presentation2/data/gui/scripts
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/data/gui/scripts/AudioMenu.lua

    r6388 r6403  
    5757    if masterscrollbar_active == false then
    5858        mastervolume = masterscrollbarwindow:getScrollPosition()
    59         orxonox.CommandExecutor:execute("config SoundManager soundVolume_ " .. mastervolume)
     59        orxonox.config("SoundManager", "soundVolume_", mastervolume)
    6060    end
    6161end
     
    6767function P.AudioMasterScrollbar_ended(e)
    6868    mastervolume = masterscrollbarwindow:getScrollPosition()
    69     orxonox.CommandExecutor:execute("config SoundManager soundVolume_ " .. mastervolume)
     69    orxonox.config("SoundManager", "soundVolume_", mastervolume)
    7070    masterscrollbar_active = false
    7171end
     
    8080    if musicscrollbar_active == false then
    8181        musicvolume = musicscrollbarwindow:getScrollPosition()
    82         orxonox.CommandExecutor:execute("config SoundManager ambientVolume_ " .. musicvolume)
     82        orxonox.config("SoundManager", "ambientVolume_", musicvolume)
    8383    end
    8484end
     
    9191    musicmutewindow:setSelected(false)
    9292    musicvolume = musicscrollbarwindow:getScrollPosition()
    93     orxonox.CommandExecutor:execute("config SoundManager ambientVolume_ " .. musicvolume)
     93    orxonox.config("SoundManager", "ambientVolume_", musicvolume)
    9494    musicscrollbar_active = false
    9595end
     
    104104    if effectsscrollbar_active == false then
    105105        effectsvolume = effectsscrollbarwindow:getScrollPosition()
    106         orxonox.CommandExecutor:execute("config SoundManager effectsVolume_ " .. effectsvolume)
     106        orxonox.config("SoundManager", "effectsVolume_", effectsvolume)
    107107    end
    108108end
     
    115115    effectsmutewindow:setSelected(false)
    116116    effectsvolume = effectsscrollbarwindow:getScrollPosition()
    117     orxonox.CommandExecutor:execute("config SoundManager effectsVolume_ " .. effectsvolume)
     117    orxonox.config("SoundManager", "effectsVolume_", effectsvolume)
    118118    effectsscrollbar_active = false
    119119end
     
    166166function P.AudioThemeListbox_changed(e)
    167167    if listboxwindow:isItemSelected(1) then
    168         orxonox.CommandExecutor:execute("setMood dnb")
     168        orxonox.execute("setMood dnb")
    169169    else
    170         orxonox.CommandExecutor:execute("setMood default")
     170        orxonox.execute("setMood default")
    171171    end
    172172end
  • code/branches/presentation2/data/gui/scripts/InGameMenu.lua

    r6363 r6403  
    3939    if doExit then
    4040        hideGUI("InGameMenu")
    41         orxonox.CommandExecutor:execute("exit")
     41        orxonox.execute("exit")
    4242    end
    4343end
  • code/branches/presentation2/data/gui/scripts/InitialiseGUI.lua

    r6387 r6403  
    175175function keyESC()
    176176    if nrOfActiveSheets == 1 and activeSheets[1] == "MainMenu" then
    177         orxonox.CommandExecutor:execute("exit")
     177        orxonox.execute("exit")
    178178    elseif nrOfActiveSheets > 0 then
    179         orxonox.CommandExecutor:execute("hideGUI "..activeSheets[nrOfActiveSheets])
     179        orxonox.execute("hideGUI "..activeSheets[nrOfActiveSheets])
    180180    else
    181181        showGUI("InGameMenu")
  • code/branches/presentation2/data/gui/scripts/MainMenu.lua

    r6206 r6403  
    1414-- events for MainMenu
    1515function P.QuickGameTestButton_clicked(e)
    16     orxonox.CommandExecutor:execute("startGame")
     16    orxonox.execute("startGame")
    1717end
    1818
     
    3434
    3535function P.ExitButton_clicked(e)
    36     orxonox.CommandExecutor:execute("exit")
     36    orxonox.execute("exit")
    3737end
    3838
  • code/branches/presentation2/data/gui/scripts/MouseControlsMenu.lua

    r6363 r6403  
    4747        scrollposition = mousenormalscrollbarwindow:getScrollPosition()
    4848        mousenormalsensitivity = (math.pow(64,scrollposition)+6)/14
    49         orxonox.CommandExecutor:execute("config KeyBinder mouseSensitivity_ " .. mousenormalsensitivity)
     49        orxonox.config("KeyBinder", "mouseSensitivity_", mousenormalsensitivity)
    5050    end
    5151end
     
    5858    scrollposition = mousenormalscrollbarwindow:getScrollPosition()
    5959    mousenormalsensitivity = (math.pow(64,scrollposition)+6)/14
    60     orxonox.CommandExecutor:execute("config KeyBinder mouseSensitivity_ " .. mousenormalsensitivity)
     60    orxonox.config("KeyBinder", "mouseSensitivity_", mousenormalsensitivity)
    6161    mousenormalscrollbar_active = false
    6262end
     
    6666        scrollposition = mousederivescrollbarwindow:getScrollPosition()
    6767        mousederivesensitivity = (math.pow(64,scrollposition)+6)/14
    68         orxonox.CommandExecutor:execute("config KeyBinder mouseSensitivityDerived_ " .. mousederivesensitivity)
     68        orxonox.config("KeyBinder", "mouseSensitivityDerived_", mousederivesensitivity)
    6969    end
    7070end
     
    7777    scrollposition = mousederivescrollbarwindow:getScrollPosition()
    7878    mousederivesensitivity = (math.pow(64,scrollposition)+6)/14
    79     orxonox.CommandExecutor:execute("config KeyBinder mouseSensitivityDerived_ " .. mousederivesensitivity)
     79    orxonox.config("KeyBinder", "mouseSensitivityDerived_", mousederivesensitivity)
    8080    mousederivescrollbar_active = false
    8181end
     
    8686        derivewindow:setSelected(false)
    8787        block = false
    88         orxonox.CommandExecutor:execute("config KeyBinder bDeriveMouseInput_ false")
     88        orxonox.config("KeyBinder", "bDeriveMouseInput_", 0)
    8989    end
    9090end
     
    9595        normalwindow:setSelected(false)
    9696        block = false
    97         orxonox.CommandExecutor:execute("config KeyBinder bDeriveMouseInput_ true")
     97        orxonox.config("KeyBinder", "bDeriveMouseInput_", 1)
    9898    end
    9999end
  • code/branches/presentation2/data/gui/scripts/MultiplayerMenu.lua

    r6388 r6403  
    7070    if choice then
    7171        orxonox.LevelManager:getInstance():setDefaultLevel(choice:getText() .. ".oxw")
    72         orxonox.CommandExecutor:execute(multiplayerMode)
     72        orxonox.execute(multiplayerMode)
    7373        hideAllGUIs()
    7474    end
  • code/branches/presentation2/data/gui/scripts/SingleplayerMenu.lua

    r6388 r6403  
    4242    if choice then
    4343        orxonox.LevelManager:getInstance():setDefaultLevel(choice:getText() .. ".oxw")
    44         orxonox.CommandExecutor:execute("startGame")
     44        orxonox.execute("startGame")
    4545        hideAllGUIs()
    4646    end
Note: See TracChangeset for help on using the changeset viewer.