diff --git a/.travis.yml b/.travis.yml index 638f8e6..b4a913f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,9 @@ deploy: api_key: secure: FoiDMNJi5TpJEN1lcxaQ4o8P+p3KRv5W41A1Z7mvxmREsgEgZNzHGsEKssBJdchZOexFtQmQW5/KQBr2StgcYYThfyDs5et0G1xVUitRp5/WtJ40LZmvsA895aYOI5ZpyIeGKG1Xaa059kC5bAqgZNyhOaVRT+ulsNroYcgEM6qNU54D7K6bAy5WQKqIqVU6V8FdQxTp+6XHrvJBayY2vBROzSUch02dsI5+2PpWG+RHH6lT/WnDlmtaQwBO1UTNHn+WfJELbXcovY8SkmBuIjNnqkmAWhgcrOMJ1NGELV4L10kNyisx14M+kEsagIg7Le4qDp0nYuz1yKu8qjTfUdF4SCSvSDaCTTcC9IDRgCxpX9FrIgesDbzENQKggzXs/KHUgp1RBvuFQAOTrBX8/ThZ12pLnxDaVnfRgi1xjJzwKOHthu8ZorrcK9KVRZBdSsHqqrLJ6TUa+bjDUJQZn1NHkxFigpv718ki8ynL31qOxeeCjU6anJx+tGxVUWdfHR1SVvGrtaQ3ekXVV1IOVqAkLc8MdueLvZvDOwxniN/rW/HZQdbKEE+VZLT0vA8AJWs00tuJb/S0EJtFJ5lclNCsKToJmUKE3PW6I6EDH8ym4wzOorVBr4yW8Q3BUb5OJQipXs+V5ZfDdmf74INYpEKp9Lu1qA3T/YwmpJfnRFQ= file: - - "release/v0.35.2/aof-replay-client-0.1.8-darwin-x64.zip" - - "release/v0.35.2/aof-replay-client-0.1.8-win32-ia32.zip" - - "release/v0.35.2/aof-replay-client-0.1.8-win32-x64.zip" + - "release/v0.35.2/aof-replay-client-0.1.9-darwin-x64.zip" + - "release/v0.35.2/aof-replay-client-0.1.9-win32-ia32.zip" + - "release/v0.35.2/aof-replay-client-0.1.9-win32-x64.zip" on: tags: true all_branches: true diff --git a/src/app/js/controllers.js b/src/app/js/controllers.js index 8591b99..45c8d7e 100644 --- a/src/app/js/controllers.js +++ b/src/app/js/controllers.js @@ -14,7 +14,8 @@ app.controller('MainController', ['$scope', '$rootScope', '$mdDialog', } }; - $scope.ddragonBase = "http://ddragon.leagueoflegends.com/cdn/5.23.1/img/"; + $scope.ddragonBase = "http://ddragon.leagueoflegends.com/cdn/"; + $scope.ddragonVersion = "6.2.1/"; $scope.loading = true; $scope.msg = "Loading..."; $scope.replay = null; @@ -119,8 +120,11 @@ app.controller('MainController', ['$scope', '$rootScope', '$mdDialog', }); }); + ipc.on("staticData", function(event, obj) { + $scope.ddragonVersion = obj.version; + }); + ipc.on("clientInfo", function(event, obj) { - console.log(obj); $scope.$apply(function() { $scope.lolClientFound = obj.found; $scope.lolClientVersion = obj.version; diff --git a/src/app/tpl/main.html b/src/app/tpl/main.html index e873548..5ca2c22 100644 --- a/src/app/tpl/main.html +++ b/src/app/tpl/main.html @@ -34,10 +34,14 @@ {{ player.summonerName }} - +
-
-
+
+ +
+
+ +
@@ -64,10 +68,14 @@ - +
-
-
+
+ +
+
+ +
{{ player.summonerName }} diff --git a/src/index.js b/src/index.js index e44ed16..594142e 100644 --- a/src/index.js +++ b/src/index.js @@ -9,7 +9,8 @@ let _ = require("underscore"); let fs = require("fs"); let winston = require("winston"); -let ddragonBase = "http://ddragon.leagueoflegends.com/cdn/5.23.1/"; +let ddragonBase = "http://ddragon.leagueoflegends.com/cdn/"; +let ddragonVersion = "6.2.1/"; let replay = null; let mainWindow = null; let settings = {}; @@ -140,8 +141,10 @@ function getStaticData(callback) { staticData.leagues = body.leagues; fs.writeFileSync(app.getPath("userCache") + "/static", JSON.stringify(staticData)); + ddragonVersion = body.newestVersion.riotVersion + "/"; + logger.info("Getting champion info"); - request({ url: ddragonBase + "data/en_US/champion.json", json: true, timeout: 10000 }, function(err, response, body) { + request({ url: ddragonBase + ddragonVersion + "data/en_US/champion.json", json: true, timeout: 10000 }, function(err, response, body) { if (!err && response && response.statusCode == 200) { staticData.champions = body.data; } else { @@ -150,7 +153,7 @@ function getStaticData(callback) { }); logger.info("Getting summoner spell info"); - request({ url: ddragonBase + "data/en_US/summoner.json", json: true, timeout: 10000 }, function(err, response, body) { + request({ url: ddragonBase + ddragonVersion + "data/en_US/summoner.json", json: true, timeout: 10000 }, function(err, response, body) { if (!err && response && response.statusCode == 200) { staticData.summonerSpells = body.data; } else { @@ -207,6 +210,8 @@ ipc.on("ready", function(event, args) { mainWindow.webContents.send("loading", { loading: true, msg: "Retreiving static data..." }); getStaticData(function() { + mainWindow.webContents.send("staticData", { version: ddragonVersion }); + mainWindow.webContents.send("loading", { loading: true, msg: "Searching for league client..." }); lolClient.find(settings.lolClientPath, function(found) { diff --git a/src/package.json b/src/package.json index 381aa95..6b36c86 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "aof-replay-client", - "version": "0.1.8", + "version": "0.1.9", "main": "./index.js", "scripts": { "start": "cd .. && npm start",