Alphabetical order for workers

I had missed this completely. Workers are listed in alphabetical order in English. Now they are ordered in other languages too.

Alphabetical order for outfit
This commit is contained in:
Andrea Rendine
2015-05-18 19:39:12 +02:00
committed by Blake Grotewold
parent 7babe5d102
commit c4535c029a
2 changed files with 13 additions and 17 deletions
+7 -10
View File
@@ -242,6 +242,7 @@ var Outside = {
var gatherer = $('div#workers_row_gatherer', workers);
for(var k in $SM.get('game.workers')) {
var lk = _(k);
var workerCount = $SM.get('game.workers["'+k+'"]');
var row = $('div#workers_row_' + k.replace(' ', '-'), workers);
if(row.length === 0) {
@@ -250,23 +251,19 @@ var Outside = {
var curPrev = null;
workers.children().each(function(i) {
var child = $(this);
var cName = child.attr('id').substring(12).replace('-', ' ');
var cName = child.children('.row_key').text();
if(cName != 'gatherer') {
if(cName < k && (curPrev == null || cName > curPrev)) {
curPrev = cName;
if(cName < lk) {
curPrev = child.attr('id');
}
}
});
if(curPrev == null && gatherer.length === 0) {
row.prependTo(workers);
}
else if(curPrev == null)
{
} else if(curPrev == null) {
row.insertAfter(gatherer);
}
else
{
row.insertAfter(workers.find('#workers_row_' + curPrev.replace(' ', '-')));
} else {
row.insertAfter(workers.find('#'+ curPrev));
}
} else {