Skip to content

Commit

Permalink
Merge pull request #69 from ricardopetrere/master
Browse files Browse the repository at this point in the history
Possible fix for issues #17 and #57 (decimal places for percentage filter and ignore +100 option
  • Loading branch information
Slimmmo authored Jul 24, 2016
2 parents edf3023 + 28ea1eb commit ae60349
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ <h2>Total $ / hour : {{ref.totalMoneyPerSecond * 3600 | number}} ({{ref.totalMon
</uib-accordion-heading>
<label><input type="checkbox" class="form-control" data-ng-model="ref.noSingles"> Don't show +1 upgrades</label>
<label><input type="checkbox" class="form-control" data-ng-model="ref.noTens"> Don't show +10 upgrades</label>
<label><input type="checkbox" class="form-control" data-ng-model="ref.noHundreds"> Don't show +100 upgrades</label>
<br>
<br>
<div>
Expand Down Expand Up @@ -282,7 +283,7 @@ <h2>Total $ / hour : {{ref.totalMoneyPerSecond * 3600 | number}} ({{ref.totalMon
</tr>
<tr class="form-group">
<td class="form-group">
<input style="width:50px;" data-ng-model="filterTime.percentage" class="form-control text-center" type="text" pattern="[0-9]*" placeholder="%">
<input style="width:50px;" data-ng-model="filterTime.percentage" class="form-control text-center" type="text" pattern="[0-9]*[.]?[0-9]{0,3}" placeholder="%">
</td>
</tr>
<tr class="text-center">
Expand Down
10 changes: 7 additions & 3 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ advApp.controller('advController', ['$document', '$filter', '$scope', function($
}
$scope[planets[k]].noSingles = obj[planets[k]].noSingles || false;
$scope[planets[k]].noTens = obj[planets[k]].noTens || false;
$scope[planets[k]].noHundreds = obj[planets[k]].noHundreds || false;
if ('suit' in obj[planets[k]]) {
$scope[planets[k]].suits[obj[planets[k]].suit][0] = true;
}
Expand Down Expand Up @@ -402,10 +403,12 @@ advApp.controller('advController', ['$document', '$filter', '$scope', function($
if (!loc.noTens) {
inc.push(10);
}
inc.push(100);
if (!loc.noHundreds) {
inc.push(100);
}
$scope.updateFilterTime(loc);
for (; i < loc.investments.length; i++) {
while (inc.length > 3 - (loc.noSingles ? 1 : 0) - (loc.noTens ? 1 : 0)) {
while (inc.length > 3 - (loc.noSingles ? 1 : 0) - (loc.noTens ? 1 : 0) - (loc.noHundreds ? 1 : 0)) {
inc.pop();
}
if (i === 1 && $scope.isWorld('earth')) {
Expand Down Expand Up @@ -864,7 +867,7 @@ advApp.controller('advController', ['$document', '$filter', '$scope', function($
}
}
}
string += '\r\n ], \r\n "noSingles": ' + loc.noSingles + ',\r\n "noTens": ' + loc.noTens + ',\r\n "platinumboost": ' + loc.platinumboost;
string += '\r\n ], \r\n "noSingles": ' + loc.noSingles + ',\r\n "noTens": ' + loc.noTens + ',\r\n "noHundreds": ' + loc.noHundreds + ',\r\n "platinumboost": ' + loc.platinumboost;
for (i = 0; i < loc.suits.length; i++) {
if (loc.suits[i][0] === true) {
string += ',\r\n "suit": ' + i;
Expand Down Expand Up @@ -1366,6 +1369,7 @@ advApp.controller('advController', ['$document', '$filter', '$scope', function($
$scope[planets[p]].name = planets[p];
$scope[planets[p]].noSingles = false;
$scope[planets[p]].noTens = false;
$scope[planets[p]].noHundreds = false;
$scope[planets[p]].numAngels = 0;
$scope[planets[p]].platinum = [];
for (var i = 0; i < $scope.platinumboosts.length; i++) {
Expand Down

0 comments on commit ae60349

Please sign in to comment.