[client] add AppTheme

This commit is contained in:
2019-07-09 17:45:07 +03:00
parent 24f5b0c218
commit 1ec1c3baae
14 changed files with 172 additions and 212 deletions

View File

@@ -1,28 +1,23 @@
package ru.m.tankz.view.common;
import haxework.view.ButtonView;
import haxework.view.HGroupView;
import haxework.view.LabelView;
import haxework.view.SelectView;
import ru.m.tankz.control.Controller;
import ru.m.tankz.control.PlayerControl;
@:template class SlotView extends HGroupView {
@:view("slot") var slotLabel:LabelView;
@:view("player") var playerButton:ButtonView;
@:view("slot") public var slotLabel:LabelView;
@:view("select") public var select:SelectView<Controller>;
public var control(default, set):PlayerControl;
private function set_control(value:PlayerControl):PlayerControl {
control = value;
slotLabel.text = '${control.playerId.team}(${control.playerId.index})';
playerButton.skinId = switch control.controller {
case HUMAN(_): "button.simple.active";
case _: "button.simple";
}
var name = ControllerParser.defaultName(control.controller);
playerButton.text = name != null ? name : "None";
slotLabel.skin = Style.textBox(value.color != null ? value.color : Style.textColor);
slotLabel.skin = theme.textBox(value.color != null ? value.color : theme.colors.text);
select.selected = control.controller;
return control;
}