Skip to content

Commit

Permalink
player stats for azerothshard
Browse files Browse the repository at this point in the history
  • Loading branch information
Yehonal committed Dec 6, 2016
1 parent b9bce16 commit 9f9f362
Show file tree
Hide file tree
Showing 13 changed files with 421 additions and 56 deletions.
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@

PvE statistics system for World of Warcraft

## Contribute

You can help us [opening a new issue](https://github.com/Helias/TC-PvEstats/issues/new) to report a bug or a suggestion

or you can donate to support us

[![Donate](https://www.paypal.com/en_GB/i/btn/btn_donateCC_LG.gif "Donate")](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=52AZFFD86N39Q)

## [Live Demo](http://usefulness.altervista.org/PvEstats/)

# ![PvEstats](https://raw.githubusercontent.com/Helias/TC-PvEstats/master/screens/PvEstats.png)
Expand Down
2 changes: 1 addition & 1 deletion config.js.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(function () {
var app = angular.module('pvestats');
var app = angular.module('playerstats');

/* Edit with path of TC-JSON-API */
app.api = "../TC-JSON-API/public/index.php/";
Expand Down
7 changes: 7 additions & 0 deletions css/select.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 89 additions & 1 deletion css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ body {
color: white;
}

.title, .title:hover {
color: #fff;
}

.table-striped > tbody > tr:nth-child(2n+1) > td, .table-striped > tbody > tr:nth-child(2n+1) > th {
background-color: rgba(38,50,56, 0.9);
}

.table-striped tr:hover {
color: white;
color: #ffd100;
cursor: pointer;
}

Expand All @@ -17,6 +21,7 @@ td { font-size: 20px; }
.alliance { color: #2196f3; }
.horde { color: #f44336; }
.alliance, .horde { font-weight: bold; }
.guid { color: #00ff00; }

.yellowText { color: #ffd100; }

Expand Down Expand Up @@ -55,6 +60,21 @@ td { font-size: 20px; }

.guild { color: #4caf50; }

.guild_link { color: #76ff03; }
.guild_link:hover { color: #ffd100; }

.guildrank { color: #ffd100; }

.guildSelect, .guildSelect * {
background-color: #361409 !important;
color: #ffd100;
border-color: none;
border: none;
background-image: none;
}

.guildSelect div:hover { opacity: 0.6; }

.achievement_container {
width: 540px;
margin: 0px auto;
Expand Down Expand Up @@ -181,6 +201,55 @@ td { font-size: 20px; }
text-decoration: none;
}

.search {
height: 35px;
width: 35px;
background-color: #361409;
color: #ffd100;
font-size: 12px;

text-decoration: none;
}

.search-input {
height: 35px;
width: 105px;
background-color: #361409;
color: #ffd100;
font-size: 12px;

text-decoration: none;
border: none;
padding: 10px;
}

.arrow {
height: 35px;
width: 35px;
background-color: #361409;
color: #ffd100;
font-size: 18px;

text-decoration: none;
}

.arrow-left {
border: none;
border-radius: 1em;
border-top-right-radius: 0em;
border-bottom-right-radius: 0em;
}
.arrow-right {
border: none;
border-radius: 1em;
border-top-left-radius: 0em;
border-bottom-left-radius: 0em;
}

.arrow-home {
font-size: 18px;
}

#inside-menu {
top: 8px;
padding: 14px;
Expand Down Expand Up @@ -217,3 +286,22 @@ td { font-size: 20px; }
}

.navigation-items a:hover { background-color: #222; }

.inline { display: inline; }

.nav-tabs { border-bottom: 1px solid #361409; }

.nav-tabs > li > a,
.nav-tabs > li:hover > a {
background-color: #361409;
color: #ffd100;
border: none;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:focus,
.nav-tabs > li.active > a:hover {
background-color: #361409;
color: #00ff00;
border: none;
}
Binary file added img/achievement.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!DOCTYPE html>
<html lang="en" ng-app="pvestats">
<html lang="en" ng-app="playerstats">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=0.6, user-scalable=no">
<meta name="description" content="TrinityCore PvE Stats">
<meta name="author" content="ShinDarth, Helias">

<title>PvEstats</title>
<title>PlayerStats</title>

<!-- Javascript -->
<script src="js/lib/angular.min.js"></script>
Expand All @@ -15,6 +15,7 @@
<script src="js/lib/angular-sanitize.js"></script>
<script src="js/lib/ui-bootstrap.min.js"></script>
<script src="js/lib/loading-bar.min.js"></script>
<script src="js/lib/select.min.js"></script>
<script src="js/app/app.js"></script>
<script src="js/app/routes.js"></script>
<script src="config.js"></script>
Expand All @@ -23,6 +24,7 @@
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<link rel="stylesheet" href="css/loading-bar.min.css">
<link rel="stylesheet" href="css//select.min.css">
<link rel="stylesheet" href="css/style.css">

<!--[if IE]>
Expand All @@ -35,13 +37,11 @@
<div class="container">
<div class="row">
<div class="col-xs-12">
<br>
<p class="h1 text-center">PvEstats</p>
<br>
<p class="h1 text-center"><a href="#/" class="title">PlayerStats</a></p>
<br>
<div ui-view></div>
<hr>
<p class="text-center credits">Created by <a target="_blank" href="https://github.com/Helias"><strong>Helias</strong></a> && <a target="_blank" href="https://github.com/ShinDarth"><strong>ShinDarth</strong></a></p>
<p class="text-center credits">Created by <a target="_blank" href="https://github.com/Helias"><strong>Helias</strong></a>, <a target="_blank" href="https://github.com/ShinDarth"><strong>ShinDarth</strong></a> &amp;&amp; <a target="_blank" href="https://github.com/Yehonal"><strong>Yehonal</strong></a></p>
</div>
</div>
</div>
Expand Down
128 changes: 123 additions & 5 deletions js/app/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function () {
'use strict';

var app = angular.module('pvestats', ['ui.router', 'ui.bootstrap', 'chieffancypants.loadingBar', 'ngAnimate', 'ngSanitize']);
var app = angular.module('playerstats', ['ui.router', 'ui.bootstrap', 'chieffancypants.loadingBar', 'ngAnimate', 'ngSanitize', 'ui.select']);

/* Sidebar*/
app.controller('SidebarController', function($scope) {
Expand Down Expand Up @@ -33,10 +33,35 @@
};
});

app.controller('rankController', function($scope, $http, $state) {
app.controller('rankController', function($scope, $rootScope, $http, $state, $stateParams) {

$scope.from = $stateParams.from == null ? 0 : $stateParams.from;
$scope.name = $stateParams.name == null ? '' : $stateParams.name;
$scope.guild = $stateParams.guild == null ? '' : $stateParams.guild;

$scope.getGuildId = function(val, reload) {
$scope.guild = val;

if (reload != null)
$state.go('guild', {from: $scope.from, name: $scope.name, guild: $scope.guild});
};

$scope.guildId = $scope.guild;

$scope.search = $scope.name;

/* Retrieve guild data */
$http.get( app.api + "guilds")
.success(function (data, status, header, config) {
$scope.Guilds = data;
$scope.Guilds.unshift({guildid:"", name:"Guild..."});
})
.error(function (data, status, header, config) {
console.log("[ERROR] $http.get request failed in players rankController!");
});

/* Retrieve all achievement_progress data */
$http.get( app.api + "character_achievement" )
$http.get( app.api + "character_achievement?from=" + $scope.from + "&name=" + $scope.name + "&guild=" + $scope.guild )
.success(function (data, status, header, config) {
$scope.ranks = data;

Expand All @@ -50,17 +75,101 @@
$scope.ranks[i].faction = "horde";
}
}

})
.error(function (data, status, header, config) {
console.log("[ERROR] $http.get request failed in rankController!");
console.log("[ERROR] $http.get request failed in players rankController!");
});

// OnClick (tr) go to player details
$scope.showPlayerStats = function(id) {
$state.go('player', {id: id});
};

/* Manage Guild Tab */
$scope.loadedGuildTab = false;

$scope.guildTab = function() {

if (!$scope.loadedGuildTab) {
$scope.loadedGuildTab = true;
$scope.fromGuild = 0;

$scope.getGuildData(0);
}

};

$scope.getGuildData = function(start, searchGuild) {
$scope.fromGuild = start;

if (searchGuild == null)
searchGuild = "";

$http.get( app.api + "guild_points?from=" + start + "&name=" + searchGuild)
.success(function (data, status, header, config) {
$scope.guilds = data;

for (var i = 0; i < $scope.guilds.length; i++)
$scope.guilds[i].Points = parseFloat($scope.guilds[i].Points).toFixed(2);
})
.error(function (data, status, header, config) {
console.log("[ERROR] $http.get request failed in guild rankController!");
});

};

/* Manage LifePoints Tab */
$scope.loadedLifePointsTab = false;

$scope.getLifePointsGuild = function(val) {
$scope.gLifePoints = val;
};

$scope.lifePointsTab = function() {

if (!$scope.loadedLifePointsTab) {
$scope.loadedLifePointsTab = true;
$scope.fromLifePoints = 0;

$scope.getLifePointsData(0);
}

};

$scope.getLifePointsData = function(start, searchPlayer, guild) {
$scope.fromLifePoints = start;

if (searchPlayer == null)
searchPlayer = "";

if (guild == null)
guild = "";

$scope.gLifePoints = guild;

/* Retrieve all lifepoints data */
$http.get( app.api + "character_achievement?from=" + $scope.fromLifePoints + "&name=" + searchPlayer + "&guild=" + $scope.gLifePoints + "&lifepoints=1")
.success(function (data, status, header, config) {
$scope.players = data;

for (var i = 0; i < $scope.players.length; i++)
{
if ($scope.players[i] != null) {
// get faction
if ($scope.players[i].race == 1 || $scope.players[i].race == 3 || $scope.players[i].race == 4 || $scope.players[i].race == 7 || $scope.players[i].race == 11)
$scope.players[i].faction = "alliance";
else
$scope.players[i].faction = "horde";
}
}

})
.error(function (data, status, header, config) {
console.log("[ERROR] $http.get request failed in players rankController!");
});

};

});

app.controller('playerController', function($scope, $rootScope, $http, $stateParams, $state) {
Expand All @@ -82,6 +191,15 @@
console.log("[ERROR] $http.get request failed in playerController!");
});

/* Retrieve azth Points */
$http.get( app.api + "character_achievement?guid=" + $stateParams.id )
.success(function (data, status, header, config) {
$rootScope.charPoints = data[0].Points;
})
.error(function (data, status, header, config) {
console.log("[ERROR] $http.get request failed in playerController!");
});

/* Retrieve all achievement_category data */
$http.get( app.api + "achievement_category" )
.success(function (data, status, header, config) {
Expand Down
Loading

0 comments on commit 9f9f362

Please sign in to comment.