diff --git a/gulpfile.js b/gulpfile.js index c35d9bc..c8fa057 100755 --- a/gulpfile.js +++ b/gulpfile.js @@ -34,7 +34,7 @@ const config = new Project.Config({ meta: { title: 'Tank\'z', filename: 'tankz', - icon: 'resources/images/tank/player/tank_p3_0-0.png', + icon: 'src/client/resources/image/tank/pd-0.png', pack: 'ru.m.tankz', author: 'shmyga ', company: 'MegaLoMania', @@ -49,7 +49,7 @@ const config = new Project.Config({ 'src/common/resources' ], macros: [ - 'yield.parser.Parser.auto()', // ToDo: bug with extraParams.hxml in yield library + //'yield.parser.Parser.auto()', // ToDo: bug with extraParams.hxml in yield library `CompilationOption.set('build','${dateformat(new Date(), 'yyyy-mm-dd HH:MM:ss')}')`, ] }); @@ -71,6 +71,7 @@ const client = new Project( main: 'ru.m.tankz.Client', assets: ['src/client/resources'], //flags: ['bitmap_text'], + flags: ['dom'], }), module.exports.generate ).bind(module, gulp); diff --git a/package.json b/package.json index 52c1c6f..f5685cc 100755 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ }, "haxeDependencies": { "haxework": "git", - "lime": "7.1.1", - "openfl": "8.5.1", + "lime": "7.2.1", + "openfl": "8.8.0", "hxcpp": "4.0.4", "promhx": "1.1.0", "protohx": "0.4.6", diff --git a/src/client/haxe/ru/m/tankz/ClientView.yaml b/src/client/haxe/ru/m/tankz/ClientView.yaml index 5873e7f..1729680 100755 --- a/src/client/haxe/ru/m/tankz/ClientView.yaml +++ b/src/client/haxe/ru/m/tankz/ClientView.yaml @@ -12,10 +12,10 @@ views: views: - id: start $type: ru.m.tankz.frame.StartFrame - # - id: level - # $type: ru.m.tankz.frame.StartGameFrame - # - id: game - # $type: ru.m.tankz.frame.GameFrame + - id: level + $type: ru.m.tankz.frame.StartGameFrame + - id: game + $type: ru.m.tankz.frame.GameFrame # - id: network # $type: ru.m.tankz.frame.NetworkFrame - id: settings diff --git a/src/client/haxe/ru/m/tankz/Style.hx b/src/client/haxe/ru/m/tankz/Style.hx index 951018a..ed98a6e 100644 --- a/src/client/haxe/ru/m/tankz/Style.hx +++ b/src/client/haxe/ru/m/tankz/Style.hx @@ -2,7 +2,6 @@ package ru.m.tankz; import ru.m.skin.SimpleButtonSkin; import haxework.gui.skin.Skin; -import haxework.gui.skin.TextSkin; import haxework.gui.skin.ButtonBitmapSkin; import haxework.gui.utils.DrawUtil; import haxework.resources.IResources; @@ -15,22 +14,26 @@ class Style { private static var lightColor = 0x95937D; private static var darkColor = 0x777564; private static var textColor = 0xE7E0BB; + private static var fontFamily = "Courirer New"; public static function register() { - var text = new TextSkin(textColor, "Courirer New"); - //text.fontSize = 18; // ToDo: var button = new ButtonBitmapSkin(); button.fillType = FillType.NINEPATH; button.upImage = Assets.getBitmapData("resources/image/ui/button/normal.png"); button.downImage = Assets.getBitmapData("resources/image/ui/button/down.png"); button.overImage = Assets.getBitmapData("resources/image/ui/button/over.png"); + resources.skin.put("light", [Skin.color(lightColor)]); resources.skin.put("dark", [Skin.color(darkColor)]); - resources.skin.put("text", [text]); - resources.skin.put("button", [button, text]); + resources.skin.put("text", [Skin.text(textColor, 16, fontFamily)]); + resources.skin.put("button", [button, Skin.text(textColor, 18, fontFamily), Skin.size(250, 60)]); resources.skin.put("button.simple", [ new SimpleButtonSkin(lightColor, textColor), - text + Skin.text(textColor, 16, fontFamily), + Skin.size(100, 36), + ]); + resources.skin.put("button.close", [ + new ButtonBitmapSkin(Assets.getBitmapData("resources/image/ui/close.png")) ]); } } diff --git a/src/client/haxe/ru/m/tankz/frame/SettingsFrame.yaml b/src/client/haxe/ru/m/tankz/frame/SettingsFrame.yaml index 7b8264a..caaa236 100644 --- a/src/client/haxe/ru/m/tankz/frame/SettingsFrame.yaml +++ b/src/client/haxe/ru/m/tankz/frame/SettingsFrame.yaml @@ -21,4 +21,11 @@ views: controlIndex: 1 - id: close $type: haxework.gui.ButtonView - $style: close + skin: $r:skin:button.close + +onPress: $this:onPress + inLayout: false + hAlign: LEFT + vAlign: BOTTOM + leftMargin: 10 + bottomMargin: 10 + contentSize: true diff --git a/src/client/haxe/ru/m/tankz/frame/StartFrame.hx b/src/client/haxe/ru/m/tankz/frame/StartFrame.hx index e8dcbc2..fbb42b2 100644 --- a/src/client/haxe/ru/m/tankz/frame/StartFrame.hx +++ b/src/client/haxe/ru/m/tankz/frame/StartFrame.hx @@ -37,6 +37,6 @@ import ru.m.tankz.Type; private function startGame(type:GameType, presetId:PresetId):Void { state = new GameState(type, presetId); - //frameSwitcher.change(StartGameFrame.ID); + frameSwitcher.change(StartGameFrame.ID); } } diff --git a/src/client/haxe/ru/m/tankz/frame/StartFrame.yaml b/src/client/haxe/ru/m/tankz/frame/StartFrame.yaml index 1a10ab3..d09549a 100644 --- a/src/client/haxe/ru/m/tankz/frame/StartFrame.yaml +++ b/src/client/haxe/ru/m/tankz/frame/StartFrame.yaml @@ -4,8 +4,7 @@ pHeight: 100 views: - $type: haxework.gui.ImageView image: $asset:image:resources/image/ui/logo.png - width: 367 - height: 157 + contentSize: true bottomMargin: 15 - $type: haxework.gui.VGroupView contentSize: true @@ -14,24 +13,19 @@ views: $type: haxework.gui.ButtonView skin: $r:skin:button +onPress: $this:onPress - width: 250 - height: 60 text: Classic - id: dota $type: haxework.gui.ButtonView skin: $r:skin:button +onPress: $this:onPress - width: 250 - height: 60 text: DotA - id: network $type: haxework.gui.ButtonView skin: $r:skin:button +onPress: $this:onPress - width: 250 - height: 60 text: Network (in developing) fontColor: 0xff0000 + visible: false - $type: haxework.gui.LabelView skin: $r:skin:text inLayout: false @@ -48,8 +42,7 @@ views: vAlign: BOTTOM leftMargin: 10 bottomMargin: 10 - width: 64 - height: 64 + contentSize: true skin: - $type: haxework.gui.skin.ButtonBitmapSkin image: $asset:image:resources/image/ui/settings.png diff --git a/src/client/haxe/ru/m/tankz/frame/StartGameFrame.hx b/src/client/haxe/ru/m/tankz/frame/StartGameFrame.hx index 8e8b457..54a7d83 100644 --- a/src/client/haxe/ru/m/tankz/frame/StartGameFrame.hx +++ b/src/client/haxe/ru/m/tankz/frame/StartGameFrame.hx @@ -30,7 +30,6 @@ import ru.m.tankz.Type; private var preset:GamePreset; public function init():Void { - levels.dispatcher.addListener(this); presets.change.connect(function(presetId) this.presetId = presetId); } diff --git a/src/client/haxe/ru/m/tankz/frame/StartGameFrame.yaml b/src/client/haxe/ru/m/tankz/frame/StartGameFrame.yaml index e766625..e5bff2f 100644 --- a/src/client/haxe/ru/m/tankz/frame/StartGameFrame.yaml +++ b/src/client/haxe/ru/m/tankz/frame/StartGameFrame.yaml @@ -17,28 +17,21 @@ views: pHeight: 100 paddings: 10 scroll: - $type: haxework.gui.list.VScrollView + $type: haxework.gui.list.VScrollBarView width: 10 pHeight: 100 skin: - $type: haxework.gui.list.VScrollSkin - skin: - $type: haxework.gui.skin.ColorSkin - color: 0x000000 - alpha: 0 + - $type: [haxework.gui.list.ScrollBarSkin.vertical] - id: levels $type: haxework.gui.list.VListView factory: { $class: ru.m.tankz.frame.start.LevelView } + +onItemSelect: $this:onListItemClick pWidth: 50 pHeight: 100 paddings: 10 scroll: - $type: haxework.gui.list.VScrollView + $type: haxework.gui.list.VScrollBarView width: 10 pHeight: 100 skin: - $type: haxework.gui.list.VScrollSkin - skin: - $type: haxework.gui.skin.ColorSkin - color: "#000000" - alpha: 0 + - $type: [haxework.gui.list.ScrollBarSkin.vertical] diff --git a/src/client/haxe/ru/m/tankz/frame/game/IGamePanel.hx b/src/client/haxe/ru/m/tankz/frame/game/IGamePanel.hx index 0d32484..bb74d23 100644 --- a/src/client/haxe/ru/m/tankz/frame/game/IGamePanel.hx +++ b/src/client/haxe/ru/m/tankz/frame/game/IGamePanel.hx @@ -3,6 +3,6 @@ package ru.m.tankz.frame.game; import ru.m.tankz.game.Game; import haxework.gui.IView; -interface IGamePanel extends IView { +interface IGamePanel extends IView { public var game:Game; } diff --git a/src/client/haxe/ru/m/tankz/frame/settings/ActionView.hx b/src/client/haxe/ru/m/tankz/frame/settings/ActionView.hx index 5646a43..64e55fa 100755 --- a/src/client/haxe/ru/m/tankz/frame/settings/ActionView.hx +++ b/src/client/haxe/ru/m/tankz/frame/settings/ActionView.hx @@ -39,7 +39,7 @@ class KeyboardMap { @:template class ActionView extends HGroupView implements IListItemView { - public var item_index(default, set):Int; + public var item_index(default, default):Int; public var data(default, set):ActionItem; @:view var action(default, null):LabelView; @@ -55,11 +55,6 @@ class KeyboardMap { return KeyboardMap.getName(key); } - private function set_item_index(value:Int):Int { - item_index = value; - return item_index; - } - private function set_data(value:ActionItem):ActionItem { data = value; action.text = actionLabel(data.action); diff --git a/src/client/haxe/ru/m/tankz/frame/settings/SettingsEditor.yaml b/src/client/haxe/ru/m/tankz/frame/settings/SettingsEditor.yaml index d573c81..e4c5ffd 100644 --- a/src/client/haxe/ru/m/tankz/frame/settings/SettingsEditor.yaml +++ b/src/client/haxe/ru/m/tankz/frame/settings/SettingsEditor.yaml @@ -11,22 +11,16 @@ views: $type: haxework.gui.ButtonView +onPress: $this:onPress skin: $r:skin:button.simple - width: 100 - height: 36 text: Change - id: clear $type: haxework.gui.ButtonView +onPress: $this:onPress skin: $r:skin:button.simple - width: 100 - height: 36 text: Clear - id: reset $type: haxework.gui.ButtonView +onPress: $this:onPress skin: $r:skin:button.simple - width: 100 - height: 36 text: Reset - id: list $type: haxework.gui.list.VListView diff --git a/src/client/haxe/ru/m/tankz/frame/start/LevelView.yaml b/src/client/haxe/ru/m/tankz/frame/start/LevelView.yaml index cb96219..da20d90 100644 --- a/src/client/haxe/ru/m/tankz/frame/start/LevelView.yaml +++ b/src/client/haxe/ru/m/tankz/frame/start/LevelView.yaml @@ -10,6 +10,6 @@ views: pHeight: 100 text: "" skin: - $type: haxework.gui.skin.ColorSkin - color: 0x000000 - alpha: 0.2 + - $type: haxework.gui.skin.ColorSkin + color: 0x000000 + alpha: 0.2 diff --git a/src/client/haxe/ru/m/tankz/frame/start/PlayerView.hx b/src/client/haxe/ru/m/tankz/frame/start/PlayerView.hx index c544bec..7e7a92d 100644 --- a/src/client/haxe/ru/m/tankz/frame/start/PlayerView.hx +++ b/src/client/haxe/ru/m/tankz/frame/start/PlayerView.hx @@ -26,7 +26,7 @@ import ru.m.tankz.Type; @:provide var configBundle:IConfigBundle; private function init():Void { - control.onPress = this; + control.onPress.connect(onPress); } private function set_data(value:PlayerId):PlayerId { @@ -51,7 +51,7 @@ import ru.m.tankz.Type; } indexLabel.fontColor = cast color; var controlType = state.control.get(value); - control.skin = new ButtonBitmapSkin(Assets.getBitmapData('resources/image/ui/control/${controlType}.png')); + control.skin = [new ButtonBitmapSkin(Assets.getBitmapData('resources/image/ui/control/${controlType}.png'))]; return data; } @@ -66,4 +66,4 @@ import ru.m.tankz.Type; this.data = data; } } -} \ No newline at end of file +} diff --git a/src/client/haxe/ru/m/tankz/frame/start/PlayerView.yaml b/src/client/haxe/ru/m/tankz/frame/start/PlayerView.yaml index 52b528b..b1ac0cb 100644 --- a/src/client/haxe/ru/m/tankz/frame/start/PlayerView.yaml +++ b/src/client/haxe/ru/m/tankz/frame/start/PlayerView.yaml @@ -10,9 +10,9 @@ views: pHeight: 100 pWidth: 100 skin: - $type: haxework.gui.skin.ColorSkin - color: 0x000000 - alpha: 0.2 + - $type: haxework.gui.skin.ColorSkin + color: 0x000000 + alpha: 0.2 shadow: true shadowColor: 0x000000 - id: control diff --git a/src/client/haxe/ru/m/tankz/frame/start/PresetsView.hx b/src/client/haxe/ru/m/tankz/frame/start/PresetsView.hx index 2c0291e..10ff94c 100644 --- a/src/client/haxe/ru/m/tankz/frame/start/PresetsView.hx +++ b/src/client/haxe/ru/m/tankz/frame/start/PresetsView.hx @@ -29,8 +29,8 @@ class PresetsView extends HGroupView { removeAllViews(); for (item in data) { var view = new ToggleButtonView(); - view.skin = new SimpleButtonSkin(); - view.onSkin = new SimpleButtonSkin(0x00ff00); + view.skin = [new SimpleButtonSkin()]; + view.onSkin = [new SimpleButtonSkin(0x00ff00)]; view.text = item.id; view.width = 250; view.height = 36; @@ -38,7 +38,7 @@ class PresetsView extends HGroupView { view.fontColor = 0xffffff; view.fontSize = 18; view.shadowColor = 0x000000; - view.onPress = this; + view.onPress.connect(onPress); view.update(); addView(view); } diff --git a/src/client/haxe/ru/m/tankz/render/Render.hx b/src/client/haxe/ru/m/tankz/render/Render.hx index bcde305..42d2ceb 100755 --- a/src/client/haxe/ru/m/tankz/render/Render.hx +++ b/src/client/haxe/ru/m/tankz/render/Render.hx @@ -37,11 +37,11 @@ class Render extends SpriteView { entryLayer = new Sprite(); upLayer = new Sprite(); upperLayer = new Sprite(); - contentAsSprite.addChild(backgroundLayer); - contentAsSprite.addChild(groundLayer); - contentAsSprite.addChild(entryLayer); - contentAsSprite.addChild(upLayer); - contentAsSprite.addChild(upperLayer); + content.addChild(backgroundLayer); + content.addChild(groundLayer); + content.addChild(entryLayer); + content.addChild(upLayer); + content.addChild(upperLayer); reset(); }