Skip to content

Commit

Permalink
Merge branch 'release/0.1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Valandur committed Sep 18, 2015
2 parents 0e42c16 + 3b86f8e commit 6d7cc79
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 11 deletions.
4 changes: 4 additions & 0 deletions src/app/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ body {
color: green;
}

.client-found-warning {
color: orange;
}

.client-found-false {
color: red;
}
Expand Down
24 changes: 21 additions & 3 deletions src/app/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,26 @@ app.controller('MainController', ['$scope', '$rootScope', '$mdDialog',
function($scope, $rootScope, $mdDialog) {

var ipc = require('ipc');


var matchClientVersionToReplayVersion = function() {
if ($scope.lolClientVersion && $scope.replay && $scope.replay.riotVersion) {
var regex = $scope.lolClientVersion.match(/(?:.*?\s)(\d+)\.(\d+)\./);
var replay = $scope.replay.riotVersion.split('.');
if (regex.length == 3) {
$scope.replayVersionMatch = (regex[1] == replay[0] && regex[2] == replay[1] );
}
}
};

$scope.loading = true;
$scope.msg = "Loading...";
$scope.replay = null;
$scope.lolClientFound = false;
$scope.lolClientVersion = "";
$scope.lolClientVersionShort = "";
$scope.aofClientInfo = {};

$scope.replayVersionMatch = true;

$scope.settings = [ { id: 1, name: "Select LoL Client" }, { id: 2, name: "Client info" }, { id: 3, name: "Send current log to aof.gg" } ];

$scope.showAofClientInfo = function(event) {
Expand Down Expand Up @@ -66,7 +78,7 @@ app.controller('MainController', ['$scope', '$rootScope', '$mdDialog',

ipc.on("loading", function(obj) {
$scope.$apply(function() {
$scope.loading = obj.loading
$scope.loading = obj.loading;
$scope.msg = obj.msg;
});
});
Expand All @@ -81,12 +93,18 @@ app.controller('MainController', ['$scope', '$rootScope', '$mdDialog',
$scope.$apply(function() {
$scope.lolClientFound = obj.found;
$scope.lolClientVersion = obj.version;
var regex = $scope.lolClientVersion.match(/(?:.*?\s)(\d+)\.(\d+)\./);
if (regex.length == 3) {
$scope.lolClientVersionShort = regex[1] + "." + regex[2];
}
matchClientVersionToReplayVersion();
});
});

ipc.on("parsedReplayFile", function(obj) {
$scope.$apply(function() {
$scope.replay = obj;
matchClientVersionToReplayVersion();
});
});

Expand Down
4 changes: 2 additions & 2 deletions src/app/tpl/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
</div>
<md-content ng-hide="loading" style="height: 493px" flex>
<md-button class="md-icon-button" style="float:right;">
<md-icon id="clientFound" ng-class="lolClientFound ? 'client-found-true' : 'client-found-false'">{{ lolClientFound ? 'check_circle' : 'error' }}</md-icon>
<md-icon id="clientFound" ng-class="lolClientFound ? replayVersionMatch ? 'client-found-true' : 'client-found-warning' : 'client-found-false'">{{ lolClientFound ? replayVersionMatch ? 'check_circle' : 'warning' : 'error' }}</md-icon>
<md-tooltip md-direction="left">
{{ lolClientFound ? "LoL Client found: " : "No LoL Client found!" }} {{ lolClientVersion }}
{{ lolClientFound ? replayVersionMatch ? "LoL Client found: " : "Replay version does not match LoL version. You may not be able to play this replay. LoL Client: " : "No LoL Client found!" }} {{ lolClientVersionShort }}
</md-tooltip>
</md-button>
<md-button class="aof md-raised md-primary md-button md-default-theme" style="top: 3px;" ng-click="openFile()">Open file...</md-button>
Expand Down
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ let staticData = {
]
};


// Create folder for log files
fs.mkdirSync(app.getPath("userCache") + "/logs/");

if (!fs.existsSync(app.getPath("userCache") + "/logs/")){
fs.mkdirSync(app.getPath("userCache") + "/logs/");
}

// Add loggers
let logFile = app.getPath("userCache") + "/logs/" + (new Date()).getTime() + ".log";
Expand All @@ -49,10 +49,10 @@ logger.add(winston.transports.File, {
// Add global error handlers
process.on("uncaughtException", function (error) {
logger.error("App Uncaught exception: " + error);
}
});
process.on("error", function (error) {
logger.error("App Error: " + error);
}
});


// Log operating system
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aof-replay-client",
"version": "0.1.2",
"version": "0.1.3",
"main": "./index.js",
"scripts": {
"start": "./node_modules/.bin/electron ."
Expand Down

0 comments on commit 6d7cc79

Please sign in to comment.