diff --git a/src/client/haxe/ru/m/tankz/local/LocalGame.hx b/src/client/haxe/ru/m/tankz/local/LocalGame.hx index 5aae384..66fa986 100644 --- a/src/client/haxe/ru/m/tankz/local/LocalGame.hx +++ b/src/client/haxe/ru/m/tankz/local/LocalGame.hx @@ -28,7 +28,7 @@ class LocalGame extends GameRunner { var complete = false; var humansTeams:Array = []; for (control in controls) { - if (Std.is(HumanControl, control) && humansTeams.indexOf(control.playerId.team) == -1) { + if (Std.is(control, HumanControl) && humansTeams.indexOf(control.playerId.team) == -1) { humansTeams.push(control.playerId.team); } } diff --git a/src/client/haxe/ru/m/tankz/view/ResultFrame.hx b/src/client/haxe/ru/m/tankz/view/ResultFrame.hx index 7004729..0fbc429 100644 --- a/src/client/haxe/ru/m/tankz/view/ResultFrame.hx +++ b/src/client/haxe/ru/m/tankz/view/ResultFrame.hx @@ -51,7 +51,7 @@ import ru.m.tankz.view.common.LifeView; label += '\n${result.level.name}'; } levelLabel.text = label; - nextButton.visible = gameStorage.get(result.level.packId).isPresetAvailable(result.level.id + 1, result.state.presetId); + nextButton.disabled = !gameStorage.get(result.level.packId).isPresetAvailable(result.level.id + 1, result.state.presetId); nextButton.text = 'Next (${result.level.id + 1})'; } diff --git a/src/editor/haxe/ru/m/tankz/editor/Editor.hx b/src/editor/haxe/ru/m/tankz/editor/Editor.hx index 88bacda..2affa65 100644 --- a/src/editor/haxe/ru/m/tankz/editor/Editor.hx +++ b/src/editor/haxe/ru/m/tankz/editor/Editor.hx @@ -4,6 +4,7 @@ import haxework.provider.Provider; import haxework.resources.IResources; import haxework.resources.Resources; import haxework.view.Root; +import haxework.view.theme.ITheme; import ru.m.tankz.bundle.ConfigBundle; import ru.m.tankz.bundle.IConfigBundle; import ru.m.tankz.bundle.ILevelBundle; @@ -14,7 +15,8 @@ import ru.m.tankz.editor.view.MapFrame; class Editor { private static inline var TAG = 'Editor'; - @:provide private static var resources:IResources; + @:provide static var resources:IResources; + @:provide static var theme:ITheme; public static function main() { L.push(new haxework.log.TraceLogger()); @@ -31,7 +33,7 @@ class Editor { resources = new Resources(); resources.text.put('version', '${Const.VERSION}'); - AppTheme.register(); + theme = new AppTheme(); Provider.setFactory(IConfigBundle, ConfigBundle); Provider.setFactory(ILevelBundle, LevelBundle); diff --git a/src/editor/haxe/ru/m/tankz/editor/view/EditorView.yaml b/src/editor/haxe/ru/m/tankz/editor/view/EditorView.yaml index 2083992..e04f43f 100644 --- a/src/editor/haxe/ru/m/tankz/editor/view/EditorView.yaml +++ b/src/editor/haxe/ru/m/tankz/editor/view/EditorView.yaml @@ -1,15 +1,16 @@ --- $type: haxework.view.VGroupView -skinId: dark -geometry.size.stretch: true +style: dark +geometry.stretch: true layout.hAlign: center views: # Tabs - id: tabs - $type: haxework.view.ButtonGroup - geometry.margin.bottom: -2 - buttonSkinId: button.tab - +onDataSelect: $code:function(id) switcher.change(id) + $type: haxework.view.data.ButtonGroup + geometry.margin.bottom: -4 + layout.margin: 2 + buttonStyle: button.tab + +onDataSelect: ~function(id) switcher.change(id) data: - "map" - "tank" @@ -17,15 +18,12 @@ views: # Switcher - id: switcher $type: haxework.view.frame.FrameSwitcher - skinId: border - geometry.size.stretch: true - geometry.padding: 5 + geometry.stretch: true factory: _map_: {$class: ru.m.tankz.editor.view.MapFrame} _tank_: {$class: ru.m.tankz.editor.view.TankFrame} # Version - - $type: haxework.view.LabelView - skinId: text + - $type: haxework.view.form.LabelView geometry.position: absolute geometry.vAlign: top geometry.hAlign: right diff --git a/src/editor/haxe/ru/m/tankz/editor/view/MapFrame.yaml b/src/editor/haxe/ru/m/tankz/editor/view/MapFrame.yaml index c1d4073..bc32745 100644 --- a/src/editor/haxe/ru/m/tankz/editor/view/MapFrame.yaml +++ b/src/editor/haxe/ru/m/tankz/editor/view/MapFrame.yaml @@ -1,92 +1,85 @@ --- -geometry.size.stretch: true +geometry.stretch: true +geometry.padding: 10 +overflow.y: scroll layout: $type: haxework.view.layout.VerticalLayout margin: 2 vAlign: top hAlign: center views: - - $type: haxework.view.HGroupView + - $type: haxework.view.group.HGroupView layout.margin: 5 views: - - $type: haxework.view.ButtonView - skinId: button.simple + - $type: haxework.view.form.ButtonView text: Classic - +onPress: $code:function(_) type = 'classic' - - $type: haxework.view.ButtonView - skinId: button.simple + +onPress: ~function(_) type = 'classic' + - $type: haxework.view.form.ButtonView text: DotA - +onPress: $code:function(_) type = 'dota' - - $type: haxework.view.ButtonView - skinId: button.simple + +onPress: ~function(_) type = 'dota' + - $type: haxework.view.form.ButtonView text: DeathMatch - +onPress: $code:function(_) type = 'death' - - $type: haxework.view.HGroupView + +onPress: ~function(_) type = 'death' + - $type: haxework.view.group.HGroupView layout.vAlign: middle views: - - $type: haxework.view.LabelView - skinId: text + - $type: haxework.view.form.LabelView text: "Name:" - id: levelName - $type: haxework.view.InputView - skinId: text.box - geometry.size.width: 300 - geometry.size.height: 26 + $type: haxework.view.form.InputView + geometry.width: 300 + geometry.height: 26 text: "" - - $type: haxework.view.LabelView - skinId: text + - $type: haxework.view.form.LabelView text: "Size:" geometry.margin.left: 20 - id: width - $type: haxework.view.InputView - skinId: text.box - geometry.size.fixed: [50, 26] - - $type: haxework.view.LabelView - skinId: text + $type: haxework.view.form.InputView + geometry.width: 50 + geometry.height: 26 + - $type: haxework.view.form.LabelView text: "x" - id: height - $type: haxework.view.InputView - skinId: text.box - geometry.size.fixed: [50, 26] - - $type: haxework.view.ButtonView - skinId: button.start.small - +onPress: $code:applySize() - - $type: haxework.view.ButtonView - skinId: button.close.small - +onPress: $code:resetSize() + $type: haxework.view.form.InputView + geometry.width: 50 + geometry.height: 26 + - $type: haxework.view.form.ButtonView + style: button.start.small + +onPress: ~applySize() + - $type: haxework.view.form.ButtonView + style: button.close.small + +onPress: ~resetSize() # map - - $type: haxework.view.HGroupView + - $type: haxework.view.group.HGroupView views: - id: spawnPointList - $type: haxework.view.DataView + $type: haxework.view.data.DataView geometry.padding: 3 layout: $type: haxework.view.layout.VerticalLayout hAlign: center margin: 5 - factory: $code:ru.m.tankz.editor.view.map.SpawnPointView.factory - +onDataSelect: $this:selectSpawnPoint + factory: ~ru.m.tankz.editor.view.map.SpawnPointView.factory + +onDataSelect: ~selectSpawnPoint - id: mapView $type: ru.m.tankz.editor.view.map.MapEditView - id: brickList - $type: haxework.view.DataView + $type: haxework.view.data.DataView geometry.padding: 3 layout: $type: haxework.view.layout.VerticalLayout hAlign: center margin: 5 - factory: $code:ru.m.tankz.editor.view.map.BrickView.factory - +onDataSelect: $this:selectBrick - - $type: haxework.view.HGroupView + factory: ~ru.m.tankz.editor.view.map.BrickView.factory + +onDataSelect: ~selectBrick + - $type: haxework.view.group.HGroupView layout.margin: 5 views: - id: openButton - $type: haxework.view.ButtonView - skinId: button.simple + $type: haxework.view.form.ButtonView text: Open - +onPress: $code:open() + +onPress: ~open() - id: saveButton - $type: haxework.view.ButtonView - skinId: button.simple + $type: haxework.view.form.ButtonView text: Save - +onPress: $code:save() + +onPress: ~save() diff --git a/src/editor/haxe/ru/m/tankz/editor/view/TankFrame.hx b/src/editor/haxe/ru/m/tankz/editor/view/TankFrame.hx index b413439..0571272 100644 --- a/src/editor/haxe/ru/m/tankz/editor/view/TankFrame.hx +++ b/src/editor/haxe/ru/m/tankz/editor/view/TankFrame.hx @@ -1,9 +1,9 @@ package ru.m.tankz.editor.view; import haxework.color.Color; -import haxework.view.frame.FrameView; -import haxework.view.IGroupView; import haxework.view.form.InputView; +import haxework.view.frame.FrameView; +import haxework.view.group.IGroupView; import ru.m.tankz.editor.view.tank.TankView; @:template class TankFrame extends FrameView { diff --git a/src/editor/haxe/ru/m/tankz/editor/view/TankFrame.yaml b/src/editor/haxe/ru/m/tankz/editor/view/TankFrame.yaml index 346f418..e4850e1 100644 --- a/src/editor/haxe/ru/m/tankz/editor/view/TankFrame.yaml +++ b/src/editor/haxe/ru/m/tankz/editor/view/TankFrame.yaml @@ -1,5 +1,5 @@ --- -geometry.size.stretch: true +geometry.stretch: true geometry.padding: 10 layout: $type: haxework.view.layout.VerticalLayout @@ -7,8 +7,8 @@ layout: margin: 10 views: - id: tanks - $type: haxework.view.GroupView - geometry.size.width: 100% + $type: haxework.view.group.GroupView + geometry.width: 100% layout: $type: haxework.view.layout.TailLayout rowSize: 4 @@ -31,10 +31,9 @@ views: - $type: ru.m.tankz.editor.view.tank.TankView image: "$asset:image:resources/image/tank/bd-0.png" - id: color - $type: haxework.view.InputView - skinId: text.box - +onChange: $code:function(value) color = value - geometry.size.width: 120 + $type: haxework.view.form.InputView + +onChange: ~function(value) color = value + geometry.width: 120 layout.hAlign: right - $type: ru.m.tankz.editor.ColorView - +onSelect: $code:function(value) color = value + +onSelect: ~function(value) color = value diff --git a/src/editor/haxe/ru/m/tankz/editor/view/tank/TankView.hx b/src/editor/haxe/ru/m/tankz/editor/view/tank/TankView.hx index 4bba7f9..a089dd6 100644 --- a/src/editor/haxe/ru/m/tankz/editor/view/tank/TankView.hx +++ b/src/editor/haxe/ru/m/tankz/editor/view/tank/TankView.hx @@ -22,7 +22,7 @@ class TankView extends View { inline private function set_image(value:BitmapData):BitmapData { image = value; content.bitmapData = BitmapUtil.colorize(image, color); - setContentSize(image.width, image.height); + setSize(image.width, image.height); return image; }