Permalink
Browse files

Several server browser changes

* Fixed Double Click not working perfectly
* Hide "Refresh Listings" button when a gamemode is selected
* Hide the white box placeholder for player list if no server is
selected.
  • Loading branch information...
1 parent 9b0d685 commit 7658c99659a31ac3f96f68ca7c65b2f319f4bbe8 @robotboy655 robotboy655 committed Apr 3, 2015
Showing with 23 additions and 7 deletions.
  1. +16 −0 garrysmod/html/js/menu/control.Servers.js
  2. +7 −7 garrysmod/html/template/servers.html
@@ -53,6 +53,22 @@ function ControllerServers( $scope, $element, $rootScope, $location )
SetPlayerList( server.address, { "1": { "time": 3037.74, "score": 5, "name": "Sethxi" }, "2": { "time": 2029.34, "score": 0, "name": "RedDragon124" }, "3": { "time": 1405.02, "score": 0, "name": "Joke (0_0)" }, "4": { "time": 462.15, "score": 0, "name": "TheAimBot" }, "5": { "time": 301.32, "score": 0, "name": "DesanPL"} } );
lua.Run( "GetPlayerList( '"+server.address+"' )" );
+
+ if ( server.DoubleClick )
+ {
+ $scope.JoinServer( server );
+ return;
+ }
+
+ //
+ // ng-dblclick doesn't work properly in engine, so we fake it!
+ //
+ server.DoubleClick = true;
+
+ setTimeout( function()
+ {
+ server.DoubleClick = false;
+ }, 500 )
}
$scope.SelectGamemode = function( gm )
@@ -12,9 +12,9 @@
<li><a class="{{IfElse( ServerType == 'history', 'active', '' )}}" ng-tranny="'servers_history'" ng-click="SwitchType( 'history' )"></a></li>
<li><a class="{{IfElse( ServerType == 'lan', 'active', '' )}}" ng-tranny="'servers_local'" ng-click="SwitchType( 'lan' )"></a></li>
<li>&nbsp;</li>
- <li>&nbsp;</li>
- <li><a ng-hide="Refreshing[ ServerType ] == 'true'" ng-tranny="'servers_refresh'" ng-click="Refresh()">refresh</a></li>
- <li><a ng-hide="Refreshing[ ServerType ] == 'false'" ng-tranny="'servers_stoprefresh'" ng-click="DoStopRefresh()">Stop refresh</a></li>
+ <li ng-hide="CurrentGamemode != null">&nbsp;</li>
+ <li ng-hide="CurrentGamemode != null"><a ng-hide="Refreshing[ ServerType ] == 'true'" ng-tranny="'servers_refresh'" ng-click="Refresh()">refresh</a></li>
+ <li ng-hide="CurrentGamemode != null"><a ng-hide="Refreshing[ ServerType ] == 'false'" ng-tranny="'servers_stoprefresh'" ng-click="DoStopRefresh()">Stop refresh</a></li>
<li>&nbsp;</li>
<li><a ng-click="MenuOption( this, 'OpenServerBrowser')" ng-Tranny="'legacy_browser'"></a></li>
@@ -44,7 +44,7 @@ <h1 class="menuheader"><span ng-Tranny="'servers_gamemodes'"></span><small ng-Tr
<div class='gamemode {{gamemode.element_class}}' ng-repeat="gamemode in GamemodeList|orderBy:'-(order)'" ng-click="SelectGamemode( gamemode )">
- <img ng-src='../gamemodes/{{gamemode.name}}/icon24.png' onerror="MissingGamemodeIcon(this)"/>
+ <img ng-src='../gamemodes/{{gamemode.name}}/icon24.png' onerror="MissingGamemodeIcon(this)"/>
<div class='stats'>{{gamemode.num_players}} <span ng-tranny="'servers_players_on'"></span> {{gamemode.num_servers}} <span ng-tranny="'servers_servers'"></span></div>
<div class='name'>
@@ -87,7 +87,7 @@ <h1 class="menuheader">
<div class='body scrollable' style="top: 32px; left: 8px; right: 8px; bottom: 8px;">
- <div ng-repeat="server in CurrentGamemode.servers|filter:CurrentGamemode.Search|orderBy:CurrentGamemode.OrderBy:CurrentGamemode.OrderReverse|limitTo:128" class="server {{ServerClass(server)}} {{IfElse( CurrentGamemode.Selected == server, 'activeserver', '' )}}" ng-click="SelectServer( server )" ng-dblclick="JoinServer( server )">
+ <div ng-repeat="server in CurrentGamemode.servers|filter:CurrentGamemode.Search|orderBy:CurrentGamemode.OrderBy:CurrentGamemode.OrderReverse|limitTo:128" class="server {{ServerClass(server)}} {{IfElse( CurrentGamemode.Selected == server, 'activeserver', '' )}}" ng-click="SelectServer( server )">
<name><img src='img/server-passworded.png' style="margin-right: 8px;" ng-show="server.pass"/>{{server.name}}</name>
<ping>{{server.ping}}</ping>
<players>{{server.players}} / {{server.maxplayers}}</players>
@@ -100,8 +100,8 @@ <h1 class="menuheader">
</div>
- <div class='serverinfo'>
- <div ng-show="CurrentGamemode.Selected">
+ <div class='serverinfo' ng-show="CurrentGamemode.Selected">
+ <div>
<header>
<div class="cell" style="padding-bottom: 5px;">

0 comments on commit 7658c99

Please sign in to comment.