fix variant icons
This commit is contained in:
parent
8afe57d54a
commit
9590d81720
|
@ -14,11 +14,6 @@ data: @Html(play.api.libs.json.Json.stringify(data)),
|
|||
routes: roundRoutes.controllers,
|
||||
i18n: @jsI18n()
|
||||
};
|
||||
lichess.variantIcons = {
|
||||
@lila.rating.PerfType.variants.map { variant =>
|
||||
@variant.key: @Html(s""""${variant.iconChar.toString}""""),
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
module.exports = {
|
||||
game: require('./game'),
|
||||
status: require('./status'),
|
||||
perf: require('./perf'),
|
||||
view: {
|
||||
status: require('./view/status'),
|
||||
user: require('./view/user'),
|
||||
|
|
13
ui/game/src/perf.js
Normal file
13
ui/game/src/perf.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
module.exports = {
|
||||
icons: {
|
||||
bullet: "T",
|
||||
blitz: ")",
|
||||
classical: "+",
|
||||
correspondence: ";",
|
||||
chess960: "'",
|
||||
kingOfTheHill: "(",
|
||||
threeCheck: ".",
|
||||
antichess: "@",
|
||||
atomic: ">"
|
||||
}
|
||||
};
|
|
@ -1,4 +1,5 @@
|
|||
var game = require('game').game;
|
||||
var perf = require('game').perf;
|
||||
var chessground = require('chessground');
|
||||
var renderTable = require('./table');
|
||||
var renderPromotion = require('../promotion').view;
|
||||
|
@ -36,7 +37,7 @@ function wheel(ctrl, e) {
|
|||
|
||||
function renderVariantReminder(ctrl) {
|
||||
if (ctrl.data.game.speed !== 'correspondence') return;
|
||||
var icon = lichess.variantIcons[ctrl.data.game.perf];
|
||||
var icon = perf.icons[ctrl.data.game.perf];
|
||||
if (!icon) return;
|
||||
return m('div', {
|
||||
class: 'variant_reminder is',
|
||||
|
|
Loading…
Reference in a new issue