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) [Chinese translation](https://github.com/Tedko/CHN-Ver-of-ADarkRoom)
[Click to play](http://adarkroom.doublespeakgames.com/) [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/base64.js"></script>
<script src="lib/translate.js"></script> <script src="lib/translate.js"></script>
<script src="lang/langs.js"></script>
<script> <script>
// try to read "lang" param's from url // try to read "lang" param's from url
var lang = decodeURIComponent((new RegExp('[?|&]lang=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null; var lang = decodeURIComponent((new RegExp('[?|&]lang=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null;
@@ -105,4 +107,4 @@
</div> </div>
</div> </div>
</body> </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" msgid "not enough scales"
msgstr "écaille insuffisante" msgstr "écaille insuffisante"
#: ../../script/localization.js:10
msgid "not enough cloth"
msgstr "chiffon insuffisante"
#: ../../script/localization.js:10 #: ../../script/localization.js:10
msgid "not enough teeth" msgid "not enough teeth"
msgstr "dent insuffisante" 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') .addClass('menu')
.appendTo('body'); .appendTo('body');
var selectWrap = $('<span>') if(typeof langs != 'undefined'){
.addClass('select-wrap') var selectWrap = $('<span>')
.appendTo(menu); .addClass('select-wrap')
$('<select>') .appendTo(menu);
.addClass('menuBtn') var select = $('<select>')
.append($('<option>').text("language.")) .addClass('menuBtn')
.append($('<option>').text("english").val("en")) .append($('<option>').text("language."))
.append($('<option>').text("français").val("fr")) .change(Engine.switchLanguage)
.change(Engine.switchLanguage) .appendTo(selectWrap);
.appendTo(selectWrap);
$.each(langs, function(name,display){
$('<option>').text(display).val(name).appendTo(select)
})
}
$('<span>') $('<span>')
.addClass('lightsOff menuBtn') .addClass('lightsOff menuBtn')
.text(_('lights off.')) .text(_('lights off.'))
@@ -226,27 +230,26 @@
}, },
exportImport: function() { exportImport: function() {
Events.startEvent({ Events.startEvent({
title: 'Export / Import', title: _('Export / Import'),
scenes: { scenes: {
start: { start: {
text: [_('export or import save data, for backing up'), text: [
_('or migrating computers')], _('export or import save data, for backing up'),
buttons: { _('or migrating computers')
'export': { ],
text: _('export'), buttons: {
onChoose: Engine.export64 'export': {
}, text: _('export'),
'import': { onChoose: Engine.export64
text: _('import'), },
nextScene: { 'import': {
1: 'confirm' text: _('import'),
}, nextScene: {1: 'confirm'},
}, },
'cancel': { 'cancel': {
text: _('cancel'), text: _('cancel'),
nextScene: 'end' nextScene: 'end'
}
} }
}, },
'confirm': { 'confirm': {
@@ -263,6 +266,7 @@
}, },
'no': { 'no': {
text: _('no'), text: _('no'),
nextScene: 'end' 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) { import64: function(string64) {
Engine.disableSelection(); Engine.disableSelection();
string64 = string64.replace(/\s/g, ''); string64 = string64.replace(/\s/g, '');
@@ -322,7 +342,7 @@
localStorage.gameState = decodedSave; localStorage.gameState = decodedSave;
location.reload(); location.reload();
}, },
event: function(cat, act) { event: function(cat, act) {
if(typeof ga === 'function') { if(typeof ga === 'function') {
ga('send', 'event', cat, act); ga('send', 'event', cat, act);
@@ -428,7 +448,7 @@
} }
return false; return false;
}, },
turnLightsOff: function() { turnLightsOff: function() {
var darkCss = Engine.findStylesheet('darkenLights'); var darkCss = Engine.findStylesheet('darkenLights');
if (darkCss == null) { if (darkCss == null) {
@@ -550,7 +570,7 @@
Engine.activeModule.keyDown(e); Engine.activeModule.keyDown(e);
} }
} }
return false; return !(jQuery.inArray(window.event.keycode, [37,38,39,40]));
}, },
keyUp: function(e) { keyUp: function(e) {
@@ -629,6 +649,10 @@
document.onmousedown = eventPassthrough; document.onmousedown = eventPassthrough;
}, },
autoSelect: function(selector) {
$(selector).focus().select();
},
handleStateUpdates: function(e){ handleStateUpdates: function(e){
}, },
+8 -4
View File
@@ -20,11 +20,12 @@
_('hunter'), _('hunter'),
_('trapper'), _('trapper'),
_('tanner'), _('tanner'),
_('grenade'),
_('bolas'),
_("charcutier"), _("charcutier"),
_('iron miner'), _('iron miner'),
_('coal miner'), _('coal miner'),
_('sulphur miner'), _('sulphur miner'), _('armourer'),
_('armourer'),
_('steelworker'), _('steelworker'),
_('bait'), _('bait'),
_('cured meat'), _('cured meat'),
@@ -43,7 +44,7 @@
_('not enough steel'), _('not enough steel'),
_('baited trap'), _('baited trap'),
_('not enough scales'), _('not enough scales'),
_('not enough teeth'), _('not enough cloth'), _('not enough teeth'),
_('not enough leather'), _('not enough leather'),
_('the compass points east.'), _('the compass points east.'),
_('the compass points west.'), _('the compass points west.'),
@@ -54,6 +55,7 @@
_('the compass points southeast.'), _('the compass points southeast.'),
_('the compass points southwest.') _('the compass points southwest.')
]; ];
delete keywords; delete keywords;
//translate text in css by overriding attributes //translate text in css by overriding attributes
@@ -66,6 +68,8 @@
div#outfitting:before{ content: \''+ _("supplies:") + '\'}\ div#outfitting:before{ content: \''+ _("supplies:") + '\'}\
div#perks:before{ content: \''+ _("perks:") + '\'}\ div#perks:before{ content: \''+ _("perks:") + '\'}\
div#lootButtons:before { content: \''+ _("take:") + '\'}\ 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')); ').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; var hasPeeps;
if($SM.get('game.buildings["hut"]', true) == 0) { if($SM.get('game.buildings["hut"]', true) == 0) {