25 lines
776 B
Haxe
25 lines
776 B
Haxe
package ru.m.tankz.view.common;
|
|
|
|
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") 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})';
|
|
slotLabel.skin = theme.textBox(value.color != null ? value.color : theme.colors.text);
|
|
select.selected = control.controller;
|
|
return control;
|
|
}
|
|
|
|
}
|