mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-06-30 00:02:29 +08:00
Made events/room.js and state_manager.js jshinthint compliant
This commit is contained in:
@@ -292,8 +292,8 @@ Events.Room = [
|
|||||||
text: [
|
text: [
|
||||||
_('the wanderer leaves, cart loaded with wood')
|
_('the wanderer leaves, cart loaded with wood')
|
||||||
],
|
],
|
||||||
action: function(delay) {
|
action: function(inputDelay) {
|
||||||
var delay = delay || false;
|
var delay = inputDelay || false;
|
||||||
Events.saveDelay(function() {
|
Events.saveDelay(function() {
|
||||||
$SM.add('stores.wood', 300);
|
$SM.add('stores.wood', 300);
|
||||||
Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with wood.'));
|
Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with wood.'));
|
||||||
@@ -315,8 +315,8 @@ Events.Room = [
|
|||||||
text: [
|
text: [
|
||||||
_('the wanderer leaves, cart loaded with wood')
|
_('the wanderer leaves, cart loaded with wood')
|
||||||
],
|
],
|
||||||
action: function(delay) {
|
action: function(inputDelay) {
|
||||||
var delay = delay || false;
|
var delay = inputDelay || false;
|
||||||
Events.saveDelay(function() {
|
Events.saveDelay(function() {
|
||||||
$SM.add('stores.wood', 1500);
|
$SM.add('stores.wood', 1500);
|
||||||
Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with wood.'));
|
Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with wood.'));
|
||||||
@@ -371,8 +371,8 @@ Events.Room = [
|
|||||||
text: [
|
text: [
|
||||||
_('the wanderer leaves, cart loaded with furs')
|
_('the wanderer leaves, cart loaded with furs')
|
||||||
],
|
],
|
||||||
action: function(delay) {
|
action: function(inputDelay) {
|
||||||
var delay = delay || false;
|
var delay = inputDelay || false;
|
||||||
Events.saveDelay(function() {
|
Events.saveDelay(function() {
|
||||||
$SM.add('stores.fur', 300);
|
$SM.add('stores.fur', 300);
|
||||||
Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with furs.'));
|
Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with furs.'));
|
||||||
@@ -394,8 +394,8 @@ Events.Room = [
|
|||||||
text: [
|
text: [
|
||||||
_('the wanderer leaves, cart loaded with furs')
|
_('the wanderer leaves, cart loaded with furs')
|
||||||
],
|
],
|
||||||
action: function(delay) {
|
action: function(inputDelay) {
|
||||||
var delay = delay || false;
|
var delay = inputDelay || false;
|
||||||
Events.saveDelay(function() {
|
Events.saveDelay(function() {
|
||||||
$SM.add('stores.fur', 1500);
|
$SM.add('stores.fur', 1500);
|
||||||
Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with furs.'));
|
Notifications.notify(Room, _('the mysterious wanderer returns, cart piled high with furs.'));
|
||||||
|
|||||||
@@ -54,10 +54,10 @@ var StateManager = {
|
|||||||
createState: function(stateName, value) {
|
createState: function(stateName, value) {
|
||||||
var words = stateName.split(/[.\[\]'"]+/);
|
var words = stateName.split(/[.\[\]'"]+/);
|
||||||
//for some reason there are sometimes empty strings
|
//for some reason there are sometimes empty strings
|
||||||
for (var i = 0; i < words.length; i++) {
|
for (var j = 0; j < words.length; j++) {
|
||||||
if (words[i] === '') {
|
if (words[j] === '') {
|
||||||
words.splice(i, 1);
|
words.splice(j, 1);
|
||||||
i--;
|
j--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var obj = State;
|
var obj = State;
|
||||||
@@ -218,7 +218,7 @@ var StateManager = {
|
|||||||
|
|
||||||
fireUpdate: function(stateName, save){
|
fireUpdate: function(stateName, save){
|
||||||
var category = $SM.getCategory(stateName);
|
var category = $SM.getCategory(stateName);
|
||||||
if(stateName == undefined) stateName = category = 'all'; //best if this doesn't happen as it will trigger more stuff
|
if(stateName === undefined) stateName = category = 'all'; //best if this doesn't happen as it will trigger more stuff
|
||||||
$.Dispatch('stateUpdate').publish({'category': category, 'stateName':stateName});
|
$.Dispatch('stateUpdate').publish({'category': category, 'stateName':stateName});
|
||||||
if(save) Engine.saveGame();
|
if(save) Engine.saveGame();
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user