mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 00:01:54 +08:00
Unified legend
Legends on boxes and lists are currently added via CSS and as stylesheets cannot be localised, translated strings rely upon an additional inline CSS. This commit inserts localised legends as "data-legend" attributes on proper elements, and then this attribute is shown by stylesheet rule content: attr(data-legend). No need of localisation script and more compact CSS rules.
This commit is contained in:
committed by
Blake Grotewold
parent
93649307f6
commit
92f7cf683e
+2
-2
@@ -424,10 +424,10 @@ var Outside = {
|
||||
var hasPeeps;
|
||||
if($SM.get('game.buildings["hut"]', true) === 0) {
|
||||
hasPeeps = false;
|
||||
village.addClass('noHuts');
|
||||
village.attr('data-legend', _('forest'));
|
||||
} else {
|
||||
hasPeeps = true;
|
||||
village.removeClass('noHuts');
|
||||
village.attr('data-legend', _('village'));
|
||||
}
|
||||
|
||||
if(needsAppend && village.children().length > 1) {
|
||||
|
||||
Reference in New Issue
Block a user