mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-06-26 14:22:30 +08:00
Fixed whitespace conformity in outside.js
This commit is contained in:
+6
-7
@@ -219,8 +219,8 @@ var Outside = {
|
|||||||
|
|
||||||
schedulePopIncrease: function() {
|
schedulePopIncrease: function() {
|
||||||
var nextIncrease = Math.floor(Math.random()*(Outside._POP_DELAY[1] - Outside._POP_DELAY[0])) + Outside._POP_DELAY[0];
|
var nextIncrease = Math.floor(Math.random()*(Outside._POP_DELAY[1] - Outside._POP_DELAY[0])) + Outside._POP_DELAY[0];
|
||||||
Engine.log('next population increase scheduled in ' + nextIncrease + ' minutes');
|
Engine.log('next population increase scheduled in ' + nextIncrease + ' minutes');
|
||||||
Outside._popTimeout = setTimeout(Outside.increasePopulation, nextIncrease * 60 * 1000);
|
Outside._popTimeout = setTimeout(Outside.increasePopulation, nextIncrease * 60 * 1000);
|
||||||
},
|
},
|
||||||
|
|
||||||
updateWorkersView: function() {
|
updateWorkersView: function() {
|
||||||
@@ -322,7 +322,7 @@ var Outside = {
|
|||||||
$('<span>').text(num).appendTo(val);
|
$('<span>').text(num).appendTo(val);
|
||||||
|
|
||||||
if(key != 'gatherer') {
|
if(key != 'gatherer') {
|
||||||
$('<div>').addClass('upManyBtn').appendTo(val).click([10], Outside.increaseWorker);
|
$('<div>').addClass('upManyBtn').appendTo(val).click([10], Outside.increaseWorker);
|
||||||
$('<div>').addClass('upBtn').appendTo(val).click([1], Outside.increaseWorker);
|
$('<div>').addClass('upBtn').appendTo(val).click([1], Outside.increaseWorker);
|
||||||
$('<div>').addClass('dnBtn').appendTo(val).click([1], Outside.decreaseWorker);
|
$('<div>').addClass('dnBtn').appendTo(val).click([1], Outside.decreaseWorker);
|
||||||
$('<div>').addClass('dnManyBtn').appendTo(val).click([10], Outside.decreaseWorker);
|
$('<div>').addClass('dnManyBtn').appendTo(val).click([10], Outside.decreaseWorker);
|
||||||
@@ -345,7 +345,7 @@ var Outside = {
|
|||||||
increaseWorker: function(btn) {
|
increaseWorker: function(btn) {
|
||||||
var worker = $(this).closest('.workerRow').attr('key');
|
var worker = $(this).closest('.workerRow').attr('key');
|
||||||
if(Outside.getNumGatherers() > 0) {
|
if(Outside.getNumGatherers() > 0) {
|
||||||
var increaseAmt = Math.min(Outside.getNumGatherers(), btn.data);
|
var increaseAmt = Math.min(Outside.getNumGatherers(), btn.data);
|
||||||
Engine.log('increasing ' + worker + ' by ' + increaseAmt);
|
Engine.log('increasing ' + worker + ' by ' + increaseAmt);
|
||||||
$SM.add('game.workers["'+worker+'"]', increaseAmt);
|
$SM.add('game.workers["'+worker+'"]', increaseAmt);
|
||||||
}
|
}
|
||||||
@@ -354,7 +354,7 @@ var Outside = {
|
|||||||
decreaseWorker: function(btn) {
|
decreaseWorker: function(btn) {
|
||||||
var worker = $(this).closest('.workerRow').attr('key');
|
var worker = $(this).closest('.workerRow').attr('key');
|
||||||
if($SM.get('game.workers["'+worker+'"]') > 0) {
|
if($SM.get('game.workers["'+worker+'"]') > 0) {
|
||||||
var decreaseAmt = Math.min($SM.get('game.workers["'+worker+'"]') || 0, btn.data);
|
var decreaseAmt = Math.min($SM.get('game.workers["'+worker+'"]') || 0, btn.data);
|
||||||
Engine.log('decreasing ' + worker + ' by ' + decreaseAmt);
|
Engine.log('decreasing ' + worker + ' by ' + decreaseAmt);
|
||||||
$SM.add('game.workers["'+worker+'"]', decreaseAmt * -1);
|
$SM.add('game.workers["'+worker+'"]', decreaseAmt * -1);
|
||||||
}
|
}
|
||||||
@@ -604,8 +604,7 @@ var Outside = {
|
|||||||
handleStateUpdates: function(e){
|
handleStateUpdates: function(e){
|
||||||
if(e.category == 'stores'){
|
if(e.category == 'stores'){
|
||||||
Outside.updateVillage();
|
Outside.updateVillage();
|
||||||
} else if(e.stateName.indexOf('game.workers') == 0
|
} else if(e.stateName.indexOf('game.workers') == 0 || e.stateName.indexOf('game.population') == 0){
|
||||||
|| e.stateName.indexOf('game.population') == 0){
|
|
||||||
Outside.updateVillage();
|
Outside.updateVillage();
|
||||||
Outside.updateWorkersView();
|
Outside.updateWorkersView();
|
||||||
Outside.updateVillageIncome();
|
Outside.updateVillageIncome();
|
||||||
|
|||||||
Reference in New Issue
Block a user