qmlFrontend/qml/qmlFrontend/LobbyPage.qml
branchqmlfrontend
changeset 11427 c6c6a4b32cea
parent 11424 8a5cc31483c6
child 11428 e045dc60c37e
equal deleted inserted replaced
11426:25e0f427f57e 11427:c6c6a4b32cea
    63                                , "map": map
    63                                , "map": map
    64                                , "script": script
    64                                , "script": script
    65                                , "scheme": scheme
    65                                , "scheme": scheme
    66                                , "weapons": weapons
    66                                , "weapons": weapons
    67                            })
    67                            })
       
    68             onRoomUpdated: {
       
    69                 var i = roomsListModel.count - 1;
       
    70                 while ((i >= 0) && (roomsListModel.get(i).name !== name)) --i
       
    71 
       
    72                 if(i >= 0) {
       
    73                     roomsListModel.set(i, {
       
    74                                            "name" : newName
       
    75                                            , "players": players
       
    76                                            , "teams": teams
       
    77                                            , "host": host
       
    78                                            , "map": map
       
    79                                            , "script": script
       
    80                                            , "scheme": scheme
       
    81                                            , "weapons": weapons
       
    82                                        })
       
    83                 }
       
    84             }
    68             onRoomRemoved: {
    85             onRoomRemoved: {
    69                 var i = roomsListModel.count - 1;
    86                 var i = roomsListModel.count - 1;
    70                 while ((i >= 0) && (roomsListModel.get(i).name !== name)) --i
    87                 while ((i >= 0) && (roomsListModel.get(i).name !== name)) --i
    71 
    88 
    72                 if(i >= 0) roomsListModel.remove(i, 1)
    89                 if(i >= 0) roomsListModel.remove(i, 1)
    75     }
    92     }
    76 
    93 
    77     Chat {
    94     Chat {
    78         id: lobbyChat;
    95         id: lobbyChat;
    79         x: 0;
    96         x: 0;
    80         y: 100;
    97         y: 300;
    81         width: parent.width;
    98         width: parent.width;
    82         height: parent.height - y;
    99         height: parent.height - y;
    83     }
   100     }
    84 }
   101 }
    85 
   102