Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7403 for code/trunk/data


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:
11 edited
2 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
  • code/trunk/data/levels/Fight in our Back.oxw

    r7163 r7403  
    77    include("templates/spaceship_Transporter.oxt")
    88?>
    9 
    10 <NotificationQueue
    11     name     = "notification"
    12     position = "0.40, 0.05"
    13     font     = "VeraMono"
    14     textsize = 0.020
    15     length   = 3
    16     width    = 50
    17 />
    189
    1910<!--*****************************************************************************************************************************************************************************************-->
  • code/trunk/data/levels/Quest_PirateAttack.oxw

    r7163 r7403  
    1919    dofile("includes/CuboidSpaceStation.lua")
    2020?>
    21 
    22 <NotificationQueue
    23      name     = "notification"
    24      position = "0.40, 0.05"
    25      font     = "VeraMono"
    26      textsize = 0.020
    27      length   = 3
    28      width    = 50
    29 />
    30    
    31    
    3221   
    3322<Level
  • code/trunk/data/levels/old/princessaeryn.oxw

    r6417 r7403  
    88    dofile("includes/CuboidSpaceStation.lua")
    99?>
    10 
    11 <NotificationQueue
    12  name  = "notification"
    13  position = "1.0, 1.0"
    14  targets = "questsystem"
    15 />
    1610
    1711<Level
  • code/trunk/data/levels/old/questsystem.oxw

    r6417 r7403  
    44  include("templates/spaceship_assff.oxt")
    55?>
    6 
    7 <NotificationQueue
    8  name  = "notification"
    9  position = "1.0, 1.0"
    10  targets = "all"
    11 />
    126
    137<Level
  • code/trunk/data/levels/princessaeryn.oxw

    r7163 r7403  
    1414 description  = "The Tale of Princess Aeryn"
    1515>
    16 
    17   <NotificationQueue
    18    name   = "notification"
    19    position = "0.55, 0.05"
    20    font   = "VeraMono"
    21    textsize = 0.020
    22    length   = 3
    23    width  = 50
    24   />
    2516
    2617  <templates>
  • code/trunk/data/levels/tutorial.oxw

    r7210 r7403  
    1414  </templates>
    1515
    16   <NotificationQueue
    17    name   = "notification"
    18    position = "0.05, 0.05"
    19    font   = "VeraMono"
    20    textsize = 0.020
    21    length   = 3
    22    width  = 50
    23   />
    24 
    2516  <Scene
    2617   ambientlight = "0.5, 0.5, 0.5"
     
    2819  >
    2920
    30       <CommandNotification preMessage="Press '" postMessage="' to fire your primary weapon." command="fire 0">
     21      <CommandNotification preMessage="Move '" postMessage="' to look left." command="scale 1 rotateYaw">
    3122        <events>
    3223            <trigger>
    33                 <DistanceTrigger name=trigger position="0,0,-100" distance=10 target="Pawn">
    34                     <attached>
    35                         <Billboard position="0,0,0" colour="1.0,1.0,0" material="Examples/Flare" />
    36                     </attached>
    37                 </DistanceTrigger>
     24                <DistanceTrigger name=trigger position="0,0,-100" distance=10 target="Pawn" />
    3825            </trigger>
    3926        </events>
    4027    </CommandNotification>
     28    <Billboard position="0,0,-100" colour="1.0,1.0,0" material="Examples/Flare" />
    4129
    4230    <SimpleNotification message="Awesome!!!">
    4331        <events>
    4432            <trigger>
    45                 <DistanceTrigger name=trigger position="0,0,100" distance=10 target="Pawn">
    46                     <attached>
    47                         <Billboard position="0,0,0" colour="1.0,0,1.0" material="Examples/Flare" />
    48                     </attached>
    49                 </DistanceTrigger>
     33                <DistanceTrigger name=trigger position="0,0,100" distance=10 target="Pawn" />
    5034            </trigger>
    5135        </events>
    5236    </SimpleNotification>
     37    <Billboard position="0,0,100" colour="1.0,0,1.0" material="Examples/Flare" />
    5338 
    54 <Drone name="meineDrohne" primarythrust="80" auxilarythrust="10" rotationthrust="10" mass= "50" linearDamping = "0.9" angularDamping = "0.7">
    55   <attached>
    56     <Model scale="1" mesh="drone.mesh"/>
    57   </attached>
    58   <collisionShapes>
    59     <BoxCollisionShape position="0,0,0"      halfExtents="10, 10, 10" />
    60   </collisionShapes>
    61 </Drone>
    6239
    63     <Drone name="meineDrohne" primarythrust="80" auxilarythrust="10" rotationthrust="10" mass= "50" linearDamping = "0.9" angularDamping = "0.7">
    64       <attached>
    65         <Model scale="1" mesh="rocket.mesh"/>
    66       </attached>
    67       <collisionShapes>
    68         <BoxCollisionShape position="0,0,0"      halfExtents="10, 10, 10" />
    69       </collisionShapes>
    70     </Drone>
    7140
    7241    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
    7342
    74     <Model mesh="hs-w01.mesh" scale=10 position="0,0,-100" />
    75     <Model mesh="hs-w01s.mesh" scale=10 position="0,0,-100" />
    7643
    7744    <?lua
     
    8148    <?lua end ?>
    8249
    83     <GlobalShader compositor="Bloom" visible=false>
    84       <events>
    85         <visibility>
    86           <DistanceTrigger position="0,0,0" distance=30 target="Spectator" switch=true />
    87         </visibility>
    88       </events>
    89     </GlobalShader>
    90     <Model position="0,0,0" scale=8 mesh="ast1.mesh" />
    91     <StaticEntity position="0,0,0" collisionType=static>
    92       <collisionShapes>
    93         <SphereCollisionShape radius="20" />
    94       </collisionShapes>
    95     </StaticEntity>
    96 
    97 <!--
    98     <?lua
    99       for i = 1, 70, 1 do
    100     ?>
    101       <MovableEntity position="<?lua print(math.random() * 6000 - 3000)?>, <?lua print(math.random() * 6000 - 3000) ?>, <?lua print(math.random() * 1000 + 3000) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
    102         <attached>
    103           <Model scale="<?lua print(math.random() * 30 + 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
    104         </attached>
    105       </MovableEntity>
    106       <MovableEntity position="<?lua print(math.random() * 6000 - 3000)?>, <?lua print(math.random() * 6000 - 3000) ?>, <?lua print(math.random() * -1000 - 3000) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
    107         <attached>
    108           <Model scale="<?lua print(math.random() * 30 + 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
    109         </attached>
    110       </MovableEntity>
    111 
    112       <MovableEntity position="<?lua print(math.random() * 6000 - 3000)?>, <?lua print(math.random() * 1000 + 3000) ?>, <?lua print(math.random() * 6000 - 3000) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
    113         <attached>
    114           <Model scale="<?lua print(math.random() * 30 + 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
    115         </attached>
    116       </MovableEntity>
    117       <MovableEntity position="<?lua print(math.random() * 6000 - 3000)?>, <?lua print(math.random() * -1000 - 3000) ?>, <?lua print(math.random() * 6000 - 3000) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
    118         <attached>
    119           <Model scale="<?lua print(math.random() * 30 + 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
    120         </attached>
    121       </MovableEntity>
    122 
    123       <MovableEntity position="<?lua print(math.random() * 1000 + 3000)?>, <?lua print(math.random() * 6000 - 3000) ?>, <?lua print(math.random() * 6000 - 3000) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
    124         <attached>
    125           <Model scale="<?lua print(math.random() * 30 + 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
    126         </attached>
    127       </MovableEntity>
    128       <MovableEntity position="<?lua print(math.random() * -1000 - 3000)?>, <?lua print(math.random() * 6000 - 3000) ?>, <?lua print(math.random() * 6000 - 3000) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
    129         <attached>
    130           <Model scale="<?lua print(math.random() * 30 + 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
    131         </attached>
    132       </MovableEntity>
    133     <?lua end ?>
    134 -->
    13550
    13651  </Scene>
Note: See TracChangeset for help on using the changeset viewer.