Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 11, 2010, 10:20:44 AM (14 years ago)
Author:
dafrick
Message:

Merged notifications branch back to trunk.

Location:
code/trunk
Files:
5 edited
1 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/data/gui/scripts/GUISheet.lua

    r6748 r7403  
    4040end
    4141
     42-- Override this function if you need to do work just after the sheet has been hidden
     43function P:afterHide()
     44end
     45
    4246function P:load()
    4347    -- Load the layout that describes the sheet
  • code/trunk/data/gui/scripts/KeyBindMenu.lua

    r7163 r7403  
    113113        return "Joystick " .. name
    114114    elseif( string.find(group, "JoyStickAxes") ~= nil ) then
    115         return "Joystick Axis" .. string.sub(name, 5, 6) .. string.sub(name, string.find(name, 'Axis%d%d(.*)')+6)
     115        return "Joystick Axis " .. string.sub(name, 5, 6) .. string.sub(name, string.find(name, 'Axis%d%d(.*)')+6)
    116116    elseif( group == "MouseAxes" ) then
    117117        return "Mouse " .. string.sub(name, string.find(name, '.(.*)')+1) .. " " .. string.sub(name, 1, 1) .. "-Axis"
  • code/trunk/data/gui/scripts/MiscConfigMenu.lua

    r7284 r7403  
    5151    table.insert(P.nameList, "Number of Bots")
    5252    table.insert(P.nameList, "UnderAttack: game time")
    53     table.insert(P.nameList, "TeamDeathmatch: Numer of teams")
     53    table.insert(P.nameList, "TeamDeathmatch: Number of teams")
    5454    table.insert(P.nameList, "Playername")
    5555    table.insert(P.nameList, "Chat: display time")
  • code/trunk/data/gui/scripts/SheetManager.lua

    r6746 r7403  
    4343
    4444-- ?
    45 function showMenuSheet(name, bHidePrevious, ptr)
    46     local sheet = showMenuSheet(name, bHidePrevious)
     45function showMenuSheet(name, bHidePrevious, bNoInput, ptr)
     46    local sheet = showMenuSheet(name, bHidePrevious, bNoInput)
    4747    sheet.overlay = ptr
    4848    return sheet
     
    5050
    5151-- Shows the specified menu sheet and loads it if neccessary
    52 function showMenuSheet(name, bHidePrevious)
     52function showMenuSheet(name, bHidePrevious, bNoInput)
    5353    if name == "" then
    5454        return nil
     
    6363    end
    6464
     65    -- Set bNoInput to false if it hasn't been set.
     66    if bNoInput == nil then
     67        bNoInput = false
     68    end
     69
     70    -- Count the number of sheets that don't need input till the first that does.
     71    local counter = noInputSheetCounter()
    6572    -- Pause game control if this is the first menu to be displayed
    6673    -- HUGE HACK?
    67     if activeMenuSheets.size == 0 then
     74    if bNoInput == false and counter == 0 then
    6875        orxonox.HumanController:pauseControl()
    6976    end
     
    7279    if activeMenuSheets[name] ~= nil then
    7380        hideMenuSheet(name)
     81    end
     82
     83    if bNoInput == true then
     84        menuSheet.tShowCursor = TriBool.Dontcare
    7485    end
    7586
     
    7889    {
    7990        ["sheet"]          = menuSheet,
    80         ["bHidePrevious"]  = bHidePrevious
     91        ["bHidePrevious"]  = bHidePrevious,
     92        ["bNoInput"]       = bNoInput
    8193    }
    8294    table.insert(activeMenuSheets, sheetTuple) -- indexed array access
     
    89101
    90102    -- Handle input distribution
    91     inputMgr:enterState(menuSheet.inputState)
     103    if bNoInput == false then
     104        inputMgr:enterState(menuSheet.inputState)
     105    end
    92106
    93107    -- Only change cursor situation if menuSheet.tShowCursor ~= TriBool.Dontcare
     
    148162
    149163    -- Leave the input state
    150     inputMgr:leaveState(sheetTuple.sheet.inputState)
     164    if not sheetTuple.bNoInput then
     165        inputMgr:leaveState(sheetTuple.sheet.inputState)
     166    end
    151167   
    152168    -- CURSOR SHOWING
     
    162178    end
    163179
    164     -- Resume control if the last menu is hidden
    165     if activeMenuSheets.size == 0 then
     180    -- Count the number of sheets that don't need input till the first that does.
     181    local counter = noInputSheetCounter()
     182    -- Resume control if the last (non-noInput) menu is hidden
     183    if counter == 0 then
    166184        orxonox.HumanController:resumeControl()
    167185        hideCursor()
    168186    end
     187
     188    sheetTuple.sheet:afterHide()
    169189end
    170190
     
    178198function keyESC()
    179199    -- HUGE, very HUGE hacks!
    180     if activeMenuSheets.size == 1 and activeMenuSheets[1].sheet.name == "MainMenu" then
     200
     201    -- Count the number of sheets that don't need input till the first that does.
     202    local counter = noInputSheetCounter()
     203
     204    -- If the first sheet that needs input is the MainMenu.
     205    if counter == 1 and activeMenuSheets[1].sheet.name == "MainMenu" then
    181206        orxonox.execute("exit")
    182     elseif activeMenuSheets.size > 0 then
    183         orxonox.execute("hideGUI "..activeMenuSheets.topSheetTuple.sheet.name)
     207    -- If there is at least one sheet that needs input.
     208    elseif counter > 0 then
     209        orxonox.execute("hideGUI "..activeMenuSheets[counter].sheet.name)
    184210    else
    185211        showMenuSheet("InGameMenu")
     
    189215function setBackgroundImage(imageSet, imageName)
    190216    guiMgr:setBackgroundImage(imageSet, imageName)
     217end
     218
     219function noInputSheetCounter()
     220    -- Count the number of sheets that don't need input till the first that does.
     221    local counter = activeMenuSheets.size
     222    while counter > 0 and activeMenuSheets[counter].bNoInput do
     223        counter = counter - 1
     224    end
     225    return counter
    191226end
    192227
Note: See TracChangeset for help on using the changeset viewer.