Merge remote-tracking branch 'upstream/master'

Conflicts:
	script/engine.js
	script/localization.js
This commit is contained in:
Travis Weston
2014-07-13 12:52:29 -04:00
13 changed files with 6188 additions and 42 deletions
+7
View File
@@ -6,3 +6,10 @@ A Minimalist Text Adventure Game
[Chinese translation](https://github.com/Tedko/CHN-Ver-of-ADarkRoom)
[Click to play](http://adarkroom.doublespeakgames.com/)
***Another Chinese Dark Room***
- [Home page](http://dreamz.cn/a-dark-room/index.html?lang=cn) Some Translations come from U77 team.
- [Git Repo](http://github.com/lilj/adarkroom)
+3 -1
View File
@@ -28,6 +28,8 @@
<script src="lib/base64.js"></script>
<script src="lib/translate.js"></script>
<script src="lang/langs.js"></script>
<script>
// try to read "lang" param's from url
var lang = decodeURIComponent((new RegExp('[?|&]lang=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null;
@@ -105,4 +107,4 @@
</div>
</div>
</body>
</html>
</html>
+3
View File
@@ -0,0 +1,3 @@
.button{width: 100px !important;}
#outsidePanel .button{width: 115px !important;}
.eventPanel .button {width: 122px !important;}
File diff suppressed because one or more lines are too long
+3047
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
+4
View File
@@ -844,6 +844,10 @@ msgstr "piège avec appât"
msgid "not enough scales"
msgstr "écaille insuffisante"
#: ../../script/localization.js:10
msgid "not enough cloth"
msgstr "chiffon insuffisante"
#: ../../script/localization.js:10
msgid "not enough teeth"
msgstr "dent insuffisante"
+3
View File
@@ -0,0 +1,3 @@
.button{width: 100px !important;}
#outsidePanel .button{width: 115px !important;}
.eventPanel .button {width: 122px !important;}
+3045
View File
File diff suppressed because it is too large Load Diff
+6
View File
@@ -0,0 +1,6 @@
var langs = {
'en':'english',
'fr':'français',
'cn':'简体中文',
'jp':'日本語'
}
+59 -35
View File
@@ -112,17 +112,21 @@
.addClass('menu')
.appendTo('body');
var selectWrap = $('<span>')
.addClass('select-wrap')
.appendTo(menu);
$('<select>')
.addClass('menuBtn')
.append($('<option>').text("language."))
.append($('<option>').text("english").val("en"))
.append($('<option>').text("français").val("fr"))
.change(Engine.switchLanguage)
.appendTo(selectWrap);
if(typeof langs != 'undefined'){
var selectWrap = $('<span>')
.addClass('select-wrap')
.appendTo(menu);
var select = $('<select>')
.addClass('menuBtn')
.append($('<option>').text("language."))
.change(Engine.switchLanguage)
.appendTo(selectWrap);
$.each(langs, function(name,display){
$('<option>').text(display).val(name).appendTo(select)
})
}
$('<span>')
.addClass('lightsOff menuBtn')
.text(_('lights off.'))
@@ -226,27 +230,26 @@
},
exportImport: function() {
Events.startEvent({
title: 'Export / Import',
scenes: {
start: {
text: [_('export or import save data, for backing up'),
_('or migrating computers')],
buttons: {
'export': {
text: _('export'),
onChoose: Engine.export64
},
'import': {
text: _('import'),
nextScene: {
1: 'confirm'
},
},
'cancel': {
text: _('cancel'),
nextScene: 'end'
}
Events.startEvent({
title: _('Export / Import'),
scenes: {
start: {
text: [
_('export or import save data, for backing up'),
_('or migrating computers')
],
buttons: {
'export': {
text: _('export'),
onChoose: Engine.export64
},
'import': {
text: _('import'),
nextScene: {1: 'confirm'},
},
'cancel': {
text: _('cancel'),
nextScene: 'end'
}
},
'confirm': {
@@ -263,6 +266,7 @@
},
'no': {
text: _('no'),
nextScene: 'end'
}
}
@@ -284,6 +288,21 @@
}
}
}
},
'inputImport': {
text: [_('put the save code here.')],
textarea: '',
buttons: {
'okay': {
text: _('import'),
nextScene: 'end',
onChoose: Engine.import64
},
'cancel': {
text: _('cancel'),
nextScene: 'end'
}
}
}
});
},
@@ -311,8 +330,9 @@
}
}
});
Engine.autoSelect('#description textarea')
},
import64: function(string64) {
Engine.disableSelection();
string64 = string64.replace(/\s/g, '');
@@ -322,7 +342,7 @@
localStorage.gameState = decodedSave;
location.reload();
},
event: function(cat, act) {
if(typeof ga === 'function') {
ga('send', 'event', cat, act);
@@ -428,7 +448,7 @@
}
return false;
},
turnLightsOff: function() {
var darkCss = Engine.findStylesheet('darkenLights');
if (darkCss == null) {
@@ -550,7 +570,7 @@
Engine.activeModule.keyDown(e);
}
}
return false;
return !(jQuery.inArray(window.event.keycode, [37,38,39,40]));
},
keyUp: function(e) {
@@ -629,6 +649,10 @@
document.onmousedown = eventPassthrough;
},
autoSelect: function(selector) {
$(selector).focus().select();
},
handleStateUpdates: function(e){
},
+8 -4
View File
@@ -20,11 +20,12 @@
_('hunter'),
_('trapper'),
_('tanner'),
_('grenade'),
_('bolas'),
_("charcutier"),
_('iron miner'),
_('coal miner'),
_('sulphur miner'),
_('armourer'),
_('sulphur miner'), _('armourer'),
_('steelworker'),
_('bait'),
_('cured meat'),
@@ -43,7 +44,7 @@
_('not enough steel'),
_('baited trap'),
_('not enough scales'),
_('not enough teeth'),
_('not enough cloth'), _('not enough teeth'),
_('not enough leather'),
_('the compass points east.'),
_('the compass points west.'),
@@ -54,6 +55,7 @@
_('the compass points southeast.'),
_('the compass points southwest.')
];
delete keywords;
//translate text in css by overriding attributes
@@ -66,6 +68,8 @@
div#outfitting:before{ content: \''+ _("supplies:") + '\'}\
div#perks:before{ content: \''+ _("perks:") + '\'}\
div#lootButtons:before { content: \''+ _("take:") + '\'}\
div#village:before{ content: \''+_('forest')+'\'}\
div#dropMenu:before { content: \''+ _("drop:") + '\'}\
div#village.noHuts:before { content: \'' + _("forest") + '\'}\
div#village:before { content: \'' + _("village") + '\'}\
').appendTo($('head'));
})();
+1 -1
View File
@@ -416,7 +416,7 @@ var Outside = {
}
}
population.text('pop ' + $SM.get('game.population') + '/' + this.getMaxPopulation());
population.text(_('pop ') + $SM.get('game.population') + '/' + this.getMaxPopulation());
var hasPeeps;
if($SM.get('game.buildings["hut"]', true) == 0) {