Permalink
Browse files

Multiple HTML Menu changes

* Added 'Model' category to addons list
* Fixed a bug with pages in main menu for saves and demos
* Switched some parts of the menu to the language system
* Saves now have Currently Popular section
* Saves now allow to browse through tags in main menu too
* Demos now have Currently Popular section too
* Re arranged buttons in Saves and Demos submenus in main menu to match
addons list
  • Loading branch information...
1 parent a172321 commit ec25d7d98c4a6fba8bc9b704a725d7ce0f5f14c2 @robotboy655 robotboy655 committed Aug 20, 2014
@@ -1,8 +1,7 @@
-
function WorkshopFiles()
{
-
+
}
//
@@ -43,10 +42,10 @@ WorkshopFiles.prototype.Init = function( namespace, scope, RootScope )
this.Scope.Switch = function( type, offset )
{
- this.SwitchWithTag( type, offset, "" );
- scope.Tagged = type;
+ this.SwitchWithTag( type, offset, "" );
+ scope.Category = type;
}
-
+
this.Scope.SwitchWithTag = function( type, offset, searchtag, mapname )
{
// Fills in perpage
@@ -183,7 +182,7 @@ WorkshopFiles.prototype.ReceiveFileInfo = function( id, data )
if ( this.Scope.Files[k].id != id ) continue;
this.Scope.Files[k].filled = true;
- this.Scope.Files[k].info = data;
+ this.Scope.Files[k].info = data;
this.Changed();
}
@@ -212,7 +211,7 @@ WorkshopFiles.prototype.ReceiveVoteInfo = function( id, data )
{
if ( this.Scope.Files[k].id != id ) continue;
- this.Scope.Files[k].vote = data;
+ this.Scope.Files[k].vote = data;
this.Changed();
}
@@ -234,9 +233,8 @@ WorkshopFiles.prototype.Changed = function()
self.Scope.$digest();
}, 10 )
-
-}
+}
WorkshopFiles.prototype.RefreshDimensions = function()
{
@@ -269,4 +267,4 @@ WorkshopFiles.prototype.UpdatePageNav = function()
for ( var i=1; i<self.Scope.NumPages+1; i++ )
self.Scope.Pages.push( i );
-}
+}
@@ -14,7 +14,8 @@ function ControllerAddons( $scope, $element, $rootScope, $location )
"weapon",
"tool",
"npc",
- "vehicle"
+ "vehicle",
+ "model"
];
addon.Init( 'addon', $scope, $rootScope );
@@ -44,7 +44,7 @@ function ControllerNewGame( $scope, $element, $rootScope, $location )
if ( !$rootScope.Map ) $rootScope.Map = "gm_flatgrass";
if ( !$rootScope.MaxPlayers ) $rootScope.MaxPlayers = 1;
if ( !$rootScope.ServerSettings ) $rootScope.ServerSettings = ServerSettings;
- if ( !$rootScope.LastCategory ) $rootScope.LastCategory = $scope.CurrentCategory;
+ if ( !$rootScope.LastCategory ) $rootScope.LastCategory = $scope.CurrentCategory;
lua.Run( "UpdateServerSettings()" );
lua.Run( "LoadLastMap()" );
@@ -1,13 +1,30 @@
save = new WorkshopFiles();
-function ControllerSaves($scope, $rootScope, $location, $timeout, $routeParams) {
+function ControllerSaves($scope, $rootScope, $location, $timeout, $routeParams)
+{
- $rootScope.ShowBack = true;
+ $rootScope.ShowBack = true;
Scope = $scope;
save.Init( 'ws_save', $scope, $rootScope );
+ Scope.Categories =
+ [
+ "trending",
+ "popular",
+ "latest"
+ ];
+
+ Scope.SubCategories =
+ [
+ "scenes",
+ "machines",
+ "buildings",
+ "courses",
+ "others"
+ ];
+
$scope.LoadSave = function( entry )
{
if ( entry.local )
@@ -31,21 +48,21 @@ function ControllerSaves($scope, $rootScope, $location, $timeout, $routeParams)
if ( IS_SPAWN_MENU )
{
- if ($routeParams.Category)
+ if ( $routeParams.Category )
{
- $timeout(function () { $scope.SwitchWithTag( $routeParams.Category, 0, $routeParams.Tag, $scope.MapName ); }, 100 );
+ $timeout( function () { $scope.SwitchWithTag( $routeParams.Category, 0, $routeParams.Tag, $scope.MapName ); }, 100 );
return;
}
- $timeout(function () { $scope.SwitchWithTag('trending', 0, $scope.MapName ); }, 100 );
+ $timeout( function () { $scope.SwitchWithTag('trending', 0, $scope.MapName ); }, 100 );
}
else
{
- $scope.Switch('local', 0);
+ $scope.Switch( 'local', 0 );
}
}
function OnGameSaved()
{
Scope.Switch( 'local', 0 );
-}
+}
@@ -10,7 +10,7 @@
<li>&nbsp;</li>
<li><a class="{{IfElse( Category == 'subscribed', 'active', '' )}}" ng-click="Switch( 'subscribed', 0 )" ng-Tranny="'addons.subscribed'"></a>
- <ul ng-show="Tagged == 'subscribed'" class="submenu">
+ <ul ng-show="Category == 'subscribed'" class="submenu">
<li><a ng-click="DisableAllSubscribed()" ng-Tranny="'addons.disableall'"></a></li>
<li><a ng-click="EnableAllSubscribed()" ng-Tranny="'addons.enableall'"></a></li>
</ul>
@@ -45,8 +45,8 @@
<div style="position: absolute; left: 320px; top: 16px; bottom: 16px; right: 16px; padding: 16px; padding-top: 0;">
<h1 class="menuheader">
- <span ng-Tranny="'addons.'+Tagged">...</span>
- <small ng-Tranny="'addons.'+Tagged + '.subtitle'">...</small>
+ <span ng-Tranny="Tagged == '' && 'addons.'+Category || 'addons.'+Tagged">...</span>
+ <small ng-Tranny="Tagged == '' && 'addons.'+Category + '.subtitle' || 'addons.'+Tagged + '.subtitle'">...</small>
</h1>
<workshopcontainer>
@@ -8,15 +8,20 @@
<li><h2 ng-tranny="'demos'"></h2></li>
<li>&nbsp;</li>
-
+
<li><a class="{{IfElse( Category == 'local', 'active', '' )}}" ng-click="Switch( 'local', 0 )" ng-Tranny="'demos.local'"></a></li>
<li>&nbsp;</li>
+ <li><a class="{{IfElse( Category == 'trending', 'active', '' )}}" ng-click="Switch( 'trending', 0 )" ng-Tranny="'demos.trending'"></a></li>
<li><a class="{{IfElse( Category == 'popular', 'active', '' )}}" ng-click="Switch( 'popular', 0 )" ng-Tranny="'demos.popular'"></a></li>
<li><a class="{{IfElse( Category == 'latest', 'active', '' )}}" ng-click="Switch( 'latest', 0 )" ng-Tranny="'demos.latest'"></a></li>
- <li><a class="{{IfElse( Category == 'friends', 'active', '' )}}" ng-click="Switch( 'friends', 0 )" ng-Tranny="'demos.friends'"></a></li>
+
+ <li>&nbsp;</li>
+
<li><a class="{{IfElse( Category == 'mine', 'active', '' )}}" ng-click="Switch( 'mine', 0 )" ng-Tranny="'demos.mine'"></a></li>
+ <li><a class="{{IfElse( Category == 'friends', 'active', '' )}}" ng-click="Switch( 'friends', 0 )" ng-Tranny="'demos.friends'"></a></li>
+
<li>&nbsp;</li>
<li><a ng-click="OpenFolder( 'demos' )" ng-Tranny="'demos.openfolder'"></a></li>
@@ -8,15 +8,28 @@
<li><h2 ng-tranny="'saves'"></h2></li>
<li>&nbsp;</li>
-
+
<li><a class="{{IfElse( Category == 'local', 'active', '' )}}" ng-click="Switch( 'local', 0 )" ng-Tranny="'saves.local'"></a></li>
<li>&nbsp;</li>
- <li><a class="{{IfElse( Category == 'popular', 'active', '' )}}" ng-click="Switch( 'popular', 0 )" ng-Tranny="'saves.popular'"></a></li>
- <li><a class="{{IfElse( Category == 'latest', 'active', '' )}}" ng-click="Switch( 'latest', 0 )" ng-Tranny="'saves.latest'"></a></li>
- <li><a class="{{IfElse( Category == 'friends', 'active', '' )}}" ng-click="Switch( 'friends', 0 )" ng-Tranny="'saves.friends'"></a></li>
+ <li ng-repeat="cat in Categories" class="clickable {{IfElse( Category == cat, 'active', 'notactive' )}}">
+
+ <a ng-click="Switch( cat, 0 )" ng-Tranny="'saves.'+cat" ng-show="cat != ''" class="{{IfElse( Category == cat, 'active', 'notactive' )}}"></a>
+
+ <ul ng-show="Category == cat" style="margin-top: 4px; margin-bottom: 15px;">
+ <li ng-repeat="tag in SubCategories" class="clickable {{IfElse( Tagged == tag, 'active', 'notactive' )}}">
+ <a ng-click="SwitchWithTag( cat, 0, tag )" ng-Tranny="'saves.'+tag" ng-show="tag != ''" class="{{IfElse( Tagged == tag, 'active', 'notactive' )}}">{{subcat}}</a>
+ </li>
+ </ul>
+
+ </li>
+
+ <li>&nbsp;</li>
+
<li><a class="{{IfElse( Category == 'mine', 'active', '' )}}" ng-click="Switch( 'mine', 0 )" ng-Tranny="'saves.mine'"></a></li>
+ <li><a class="{{IfElse( Category == 'friends', 'active', '' )}}" ng-click="Switch( 'friends', 0 )" ng-Tranny="'saves.friends'"></a></li>
+
<li>&nbsp;</li>
<li><a ng-click="OpenFolder( 'saves' )" ng-Tranny="'saves.openfolder'"></a></li>
@@ -8,9 +8,9 @@
<li><h2 ng-tranny="'server_list'"></h2></li>
<li>&nbsp;</li>
<li><a class="{{IfElse( ServerType == 'internet', 'active', '' )}}" ng-tranny="'servers_internet'" ng-click="SwitchType( 'internet' )"></a></li>
- <li><a class="{{IfElse( ServerType == 'lan', 'active', '' )}}" ng-tranny="'servers_local'" ng-click="SwitchType( 'lan' )"></a></li>
- <li><a class="{{IfElse( ServerType == 'history', 'active', '' )}}" ng-tranny="'servers_history'" ng-click="SwitchType( 'history' )"></a></li>
<li><a class="{{IfElse( ServerType == 'favorite', 'active', '' )}}" ng-tranny="'servers_favorites'" ng-click="SwitchType( 'favorite' )"></a></li>
+ <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-tranny="'servers_refresh'" ng-click="Refresh()">refresh</a></li>
@@ -23,7 +23,7 @@
<div class="innerpage" ng-hide="CurrentGamemode != null">
- <h1 class="menuheader"><span>Gamemode</span><small>pick a gamemode from the list below</small></h1>
+ <h1 class="menuheader"><span ng-Tranny="'servers_gamemodes'"></span><small ng-Tranny="'servers_gamemodes.subtitle'"></small></h1>
<div class=' ' style="">

0 comments on commit ec25d7d

Please sign in to comment.