diff --git a/package.json b/package.json index 591bfc8..a9f473d 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tankz", - "version": "0.8.4", + "version": "0.8.5", "private": true, "devDependencies": { "dateformat": "^3.0.3", diff --git a/src/client/haxe/ru/m/tankz/Client.hx b/src/client/haxe/ru/m/tankz/Client.hx index 72921b1..fedd427 100755 --- a/src/client/haxe/ru/m/tankz/Client.hx +++ b/src/client/haxe/ru/m/tankz/Client.hx @@ -1,16 +1,10 @@ package ru.m.tankz; +import ru.m.tankz.view.ClientView; import flash.Lib; import haxework.animate.Animate; -import ru.m.tankz.frame.StartFrame; -import flash.ui.Keyboard; -import flash.events.KeyboardEvent; -import flash.text.Font; -import haxework.gui.frame.FrameSwitcher; import haxework.gui.Root; import haxework.log.TraceLogger; -import haxework.provider.Provider; -import haxework.resources.IResources; #if flash import haxework.log.JSLogger; #end #if debug import haxework.log.SocketLogger; #end @@ -40,26 +34,3 @@ class Client { view.launch(); } } - -@:template class ClientView extends FrameSwitcher { - private static inline var TAG = 'Tankz'; - - @:provide var resources:IResources; - - public function init():Void { - var font:Font = Font.enumerateFonts()[0]; - resources.text.put('font', 'Bookman Old Style'); - resources.text.put('version', 'v${Const.VERSION} (${Const.BUILD})'); - Provider.set(FrameSwitcher, this); - } - - public function launch():Void { - content.stage.stageFocusRect = false; - content.stage.addEventListener(KeyboardEvent.KEY_UP, function(event:KeyboardEvent):Void { - if (event.keyCode == Keyboard.ESCAPE) { - change(StartFrame.ID); - } - }); - change(StartFrame.ID); - } -} diff --git a/src/client/haxe/ru/m/tankz/ClientView.yaml b/src/client/haxe/ru/m/tankz/ClientView.yaml deleted file mode 100755 index 3b209b9..0000000 --- a/src/client/haxe/ru/m/tankz/ClientView.yaml +++ /dev/null @@ -1,25 +0,0 @@ ---- -$type: haxework.gui.frame.FrameSwitcher -geometry.size.stretch: true -skinId: dark -views: - - id: start - $type: ru.m.tankz.frame.StartFrame - # classic - - id: classic.level - $type: ru.m.tankz.frame.classic.ClassicLevelFrame - - id: classic.game - $type: ru.m.tankz.frame.classic.ClassicGameFrame - # dota - - id: dota.level - $type: ru.m.tankz.frame.dota.DotaLevelFrame - - id: dota.game - $type: ru.m.tankz.frame.dota.DotaGameFrame - # result - - id: result - $type: ru.m.tankz.frame.ResultFrame - # - id: network - # $type: ru.m.tankz.frame.NetworkFrame - # settings - - id: settings - $type: ru.m.tankz.frame.SettingsFrame diff --git a/src/client/haxe/ru/m/tankz/Init.hx b/src/client/haxe/ru/m/tankz/Init.hx index cc4af88..e64b97d 100644 --- a/src/client/haxe/ru/m/tankz/Init.hx +++ b/src/client/haxe/ru/m/tankz/Init.hx @@ -22,7 +22,6 @@ import flash.Lib; import js.Browser; #end - class Init { private static function getHost():String { diff --git a/src/client/haxe/ru/m/tankz/Style.hx b/src/client/haxe/ru/m/tankz/Style.hx index 2e4bc6d..b78e0a2 100644 --- a/src/client/haxe/ru/m/tankz/Style.hx +++ b/src/client/haxe/ru/m/tankz/Style.hx @@ -1,10 +1,10 @@ package ru.m.tankz; -import haxework.gui.layout.Layout; import haxework.color.ColorUtil; import haxework.gui.core.Geometry; import haxework.gui.core.HAlign; import haxework.gui.core.VAlign; +import haxework.gui.layout.Layout; import haxework.gui.skin.Skin; import haxework.resources.IResources; import openfl.Assets; @@ -33,12 +33,12 @@ class Style { Skin.color(0x000000, 0.1), Skin.border(lightColor, 1, 2), Skin.text(textColor, 22, fontFamily), - Skin.size(200, 38), + Skin.geometry(new Geometry().setSize(200, 38).setMargin([0, 0, 0, 30])), ]); resources.skin.put("button", [ Skin.buttonColor(lightColor), Skin.text(textColor, 18, fontFamily), - Skin.size(250, 50) + Skin.size(250, 50), ]); resources.skin.put("text.box", [ Skin.color(0x000000, 0.1), diff --git a/src/client/haxe/ru/m/tankz/view/ClientView.hx b/src/client/haxe/ru/m/tankz/view/ClientView.hx new file mode 100644 index 0000000..9ee67d4 --- /dev/null +++ b/src/client/haxe/ru/m/tankz/view/ClientView.hx @@ -0,0 +1,31 @@ +package ru.m.tankz.view; + +import flash.events.KeyboardEvent; +import flash.text.Font; +import flash.ui.Keyboard; +import haxework.gui.frame.FrameSwitcher; +import haxework.resources.IResources; + +@:template class ClientView extends FrameSwitcher { + private static inline var TAG = 'Tankz'; + + @:provide var resources:IResources; + @:provide var switcher:FrameSwitcher; + + public function init():Void { + var font:Font = Font.enumerateFonts()[0]; + resources.text.put('font', 'Bookman Old Style'); + resources.text.put('version', 'v${Const.VERSION} (${Const.BUILD})'); + switcher = this; + } + + public function launch():Void { + content.stage.stageFocusRect = false; + content.stage.addEventListener(KeyboardEvent.KEY_UP, function(event:KeyboardEvent):Void { + if (event.keyCode == Keyboard.ESCAPE) { + change(StartFrame.ID); + } + }); + change(StartFrame.ID); + } +} diff --git a/src/client/haxe/ru/m/tankz/view/ClientView.yaml b/src/client/haxe/ru/m/tankz/view/ClientView.yaml new file mode 100755 index 0000000..014562f --- /dev/null +++ b/src/client/haxe/ru/m/tankz/view/ClientView.yaml @@ -0,0 +1,25 @@ +--- +$type: haxework.gui.frame.FrameSwitcher +geometry.size.stretch: true +skinId: dark +views: + - id: start + $type: ru.m.tankz.view.StartFrame + # classic + - id: classic.level + $type: ru.m.tankz.view.classic.ClassicLevelFrame + - id: classic.game + $type: ru.m.tankz.view.classic.ClassicGameFrame + # dota + - id: dota.level + $type: ru.m.tankz.view.dota.DotaLevelFrame + - id: dota.game + $type: ru.m.tankz.view.dota.DotaGameFrame + # result + - id: result + $type: ru.m.tankz.view.ResultFrame + # - id: network + # $type: ru.m.tankz.view.NetworkFrame + # settings + - id: settings + $type: ru.m.tankz.view.SettingsFrame diff --git a/src/client/haxe/ru/m/tankz/frame/NetworkFrame.hx b/src/client/haxe/ru/m/tankz/view/NetworkFrame.hx similarity index 99% rename from src/client/haxe/ru/m/tankz/frame/NetworkFrame.hx rename to src/client/haxe/ru/m/tankz/view/NetworkFrame.hx index 6b9a6a3..0fcca37 100644 --- a/src/client/haxe/ru/m/tankz/frame/NetworkFrame.hx +++ b/src/client/haxe/ru/m/tankz/view/NetworkFrame.hx @@ -1,4 +1,4 @@ -package ru.m.tankz.frame; +package ru.m.tankz.view; import haxework.gui.ButtonView; import haxework.gui.frame.IFrameSwitcher; @@ -105,4 +105,4 @@ import ru.m.tankz.proto.core.UserProto; network.startGame(); } } -} \ No newline at end of file +} diff --git a/src/client/haxe/ru/m/tankz/frame/NetworkFrame.yaml b/src/client/haxe/ru/m/tankz/view/NetworkFrame.yaml similarity index 93% rename from src/client/haxe/ru/m/tankz/frame/NetworkFrame.yaml rename to src/client/haxe/ru/m/tankz/view/NetworkFrame.yaml index 9713d8f..011829b 100644 --- a/src/client/haxe/ru/m/tankz/frame/NetworkFrame.yaml +++ b/src/client/haxe/ru/m/tankz/view/NetworkFrame.yaml @@ -44,7 +44,7 @@ views: text: Create - id: gameList $type: haxework.gui.list.VListView - factory: "@class:ru.m.tankz.frame.network.GameItemView" + factory: "@class:ru.m.tankz.view.network.GameItemView" pWidth: 100 pHeight: 100 paddings: 10 @@ -74,7 +74,7 @@ views: text: Leave - id: userList $type: haxework.gui.list.VListView - factory: "@class:ru.m.tankz.frame.network.UserItemView" + factory: "@class:ru.m.tankz.view.network.UserItemView" pWidth: 100 pHeight: 100 paddings: 10 @@ -87,4 +87,4 @@ views: skin: $type: haxework.gui.skin.ColorSkin color: "#000000" - alpha: 0 \ No newline at end of file + alpha: 0 diff --git a/src/client/haxe/ru/m/tankz/frame/ResultFrame.hx b/src/client/haxe/ru/m/tankz/view/ResultFrame.hx similarity index 92% rename from src/client/haxe/ru/m/tankz/frame/ResultFrame.hx rename to src/client/haxe/ru/m/tankz/view/ResultFrame.hx index 5a9a469..546e9c4 100644 --- a/src/client/haxe/ru/m/tankz/frame/ResultFrame.hx +++ b/src/client/haxe/ru/m/tankz/view/ResultFrame.hx @@ -1,4 +1,4 @@ -package ru.m.tankz.frame; +package ru.m.tankz.view; import haxework.gui.LabelView; import haxework.gui.ButtonView; @@ -6,9 +6,9 @@ import haxework.gui.DataView; import haxework.gui.frame.FrameSwitcher; import haxework.gui.VGroupView; import ru.m.tankz.control.Control; -import ru.m.tankz.frame.classic.ClassicGameFrame; -import ru.m.tankz.frame.common.LifeView; -import ru.m.tankz.frame.dota.DotaGameFrame; +import ru.m.tankz.view.classic.ClassicGameFrame; +import ru.m.tankz.view.common.LifeView; +import ru.m.tankz.view.dota.DotaGameFrame; import ru.m.tankz.game.GameState; import ru.m.tankz.preset.ClassicGame; import ru.m.tankz.preset.DotaGame; diff --git a/src/client/haxe/ru/m/tankz/frame/ResultFrame.yaml b/src/client/haxe/ru/m/tankz/view/ResultFrame.yaml similarity index 100% rename from src/client/haxe/ru/m/tankz/frame/ResultFrame.yaml rename to src/client/haxe/ru/m/tankz/view/ResultFrame.yaml diff --git a/src/client/haxe/ru/m/tankz/frame/SettingsFrame.hx b/src/client/haxe/ru/m/tankz/view/SettingsFrame.hx similarity index 93% rename from src/client/haxe/ru/m/tankz/frame/SettingsFrame.hx rename to src/client/haxe/ru/m/tankz/view/SettingsFrame.hx index 8fc7c3e..f765943 100644 --- a/src/client/haxe/ru/m/tankz/frame/SettingsFrame.hx +++ b/src/client/haxe/ru/m/tankz/view/SettingsFrame.hx @@ -1,4 +1,4 @@ -package ru.m.tankz.frame; +package ru.m.tankz.view; import haxework.gui.frame.FrameSwitcher; import haxework.gui.ButtonView; diff --git a/src/client/haxe/ru/m/tankz/frame/SettingsFrame.yaml b/src/client/haxe/ru/m/tankz/view/SettingsFrame.yaml similarity index 80% rename from src/client/haxe/ru/m/tankz/frame/SettingsFrame.yaml rename to src/client/haxe/ru/m/tankz/view/SettingsFrame.yaml index 2b1ab8c..46d2103 100644 --- a/src/client/haxe/ru/m/tankz/frame/SettingsFrame.yaml +++ b/src/client/haxe/ru/m/tankz/view/SettingsFrame.yaml @@ -9,9 +9,9 @@ views: - $type: haxework.gui.HGroupView layout.margin: 20 views: - - $type: ru.m.tankz.frame.settings.SettingsEditor + - $type: ru.m.tankz.view.settings.SettingsEditor controlIndex: 0 - - $type: ru.m.tankz.frame.settings.SettingsEditor + - $type: ru.m.tankz.view.settings.SettingsEditor controlIndex: 1 - $type: haxework.gui.HGroupView skinId: panel diff --git a/src/client/haxe/ru/m/tankz/frame/StartFrame.hx b/src/client/haxe/ru/m/tankz/view/StartFrame.hx similarity index 85% rename from src/client/haxe/ru/m/tankz/frame/StartFrame.hx rename to src/client/haxe/ru/m/tankz/view/StartFrame.hx index b521ab6..3fc1092 100644 --- a/src/client/haxe/ru/m/tankz/frame/StartFrame.hx +++ b/src/client/haxe/ru/m/tankz/view/StartFrame.hx @@ -1,7 +1,7 @@ -package ru.m.tankz.frame; +package ru.m.tankz.view; -import ru.m.tankz.frame.classic.ClassicLevelFrame; -import ru.m.tankz.frame.dota.DotaLevelFrame; +import ru.m.tankz.view.classic.ClassicLevelFrame; +import ru.m.tankz.view.dota.DotaLevelFrame; import haxework.gui.ButtonView; import haxework.gui.frame.FrameSwitcher; import haxework.gui.VGroupView; diff --git a/src/client/haxe/ru/m/tankz/frame/StartFrame.yaml b/src/client/haxe/ru/m/tankz/view/StartFrame.yaml similarity index 89% rename from src/client/haxe/ru/m/tankz/frame/StartFrame.yaml rename to src/client/haxe/ru/m/tankz/view/StartFrame.yaml index 354e1ec..94f2b7a 100644 --- a/src/client/haxe/ru/m/tankz/frame/StartFrame.yaml +++ b/src/client/haxe/ru/m/tankz/view/StartFrame.yaml @@ -2,11 +2,11 @@ views: - $type: haxework.gui.VGroupView skinId: container - layout.margin: 5 + layout.margin: 10 views: - $type: haxework.gui.ImageView image: $asset:image:resources/image/ui/logo.png - geometry.margin.bottom: 15 + geometry.margin.bottom: 30 - id: classic $type: haxework.gui.ButtonView skinId: button @@ -34,5 +34,6 @@ views: - $type: haxework.gui.SpriteView geometry.size.width: 100% - $type: haxework.gui.LabelView - skinId: text + geometry.padding: [20, 5] + skinId: text.box text: $r:text:version diff --git a/src/client/haxe/ru/m/tankz/frame/classic/ClassicGameFrame.hx b/src/client/haxe/ru/m/tankz/view/classic/ClassicGameFrame.hx similarity index 76% rename from src/client/haxe/ru/m/tankz/frame/classic/ClassicGameFrame.hx rename to src/client/haxe/ru/m/tankz/view/classic/ClassicGameFrame.hx index 1ff4cd6..6e71d1e 100755 --- a/src/client/haxe/ru/m/tankz/frame/classic/ClassicGameFrame.hx +++ b/src/client/haxe/ru/m/tankz/view/classic/ClassicGameFrame.hx @@ -1,8 +1,8 @@ -package ru.m.tankz.frame.classic; +package ru.m.tankz.view.classic; -import ru.m.tankz.frame.common.IGamePanel; +import ru.m.tankz.view.common.IGamePanel; import ru.m.tankz.render.Render; -import ru.m.tankz.frame.common.GameFrame; +import ru.m.tankz.view.common.GameFrame; @:template class ClassicGameFrame extends GameFrame { public static inline var ID = "classic.game"; diff --git a/src/client/haxe/ru/m/tankz/frame/classic/ClassicGameFrame.yaml b/src/client/haxe/ru/m/tankz/view/classic/ClassicGameFrame.yaml similarity index 75% rename from src/client/haxe/ru/m/tankz/frame/classic/ClassicGameFrame.yaml rename to src/client/haxe/ru/m/tankz/view/classic/ClassicGameFrame.yaml index 1dc3fb3..c408d60 100644 --- a/src/client/haxe/ru/m/tankz/frame/classic/ClassicGameFrame.yaml +++ b/src/client/haxe/ru/m/tankz/view/classic/ClassicGameFrame.yaml @@ -7,4 +7,4 @@ views: - id: render $type: ru.m.tankz.render.Render - id: panel - $type: ru.m.tankz.frame.classic.ClassicGamePanel + $type: ru.m.tankz.view.classic.ClassicGamePanel diff --git a/src/client/haxe/ru/m/tankz/frame/classic/ClassicGamePanel.hx b/src/client/haxe/ru/m/tankz/view/classic/ClassicGamePanel.hx similarity index 90% rename from src/client/haxe/ru/m/tankz/frame/classic/ClassicGamePanel.hx rename to src/client/haxe/ru/m/tankz/view/classic/ClassicGamePanel.hx index a293a8a..552dd86 100644 --- a/src/client/haxe/ru/m/tankz/frame/classic/ClassicGamePanel.hx +++ b/src/client/haxe/ru/m/tankz/view/classic/ClassicGamePanel.hx @@ -1,9 +1,9 @@ -package ru.m.tankz.frame.classic; +package ru.m.tankz.view.classic; import haxework.gui.LabelView; import haxework.gui.VGroupView; -import ru.m.tankz.frame.common.IGamePanel; -import ru.m.tankz.frame.common.LifeView; +import ru.m.tankz.view.common.IGamePanel; +import ru.m.tankz.view.common.LifeView; import ru.m.tankz.game.Game; import ru.m.tankz.preset.ClassicGame; diff --git a/src/client/haxe/ru/m/tankz/frame/classic/ClassicGamePanel.yaml b/src/client/haxe/ru/m/tankz/view/classic/ClassicGamePanel.yaml similarity index 77% rename from src/client/haxe/ru/m/tankz/frame/classic/ClassicGamePanel.yaml rename to src/client/haxe/ru/m/tankz/view/classic/ClassicGamePanel.yaml index fdd97cc..0402b5c 100644 --- a/src/client/haxe/ru/m/tankz/frame/classic/ClassicGamePanel.yaml +++ b/src/client/haxe/ru/m/tankz/view/classic/ClassicGamePanel.yaml @@ -12,14 +12,14 @@ views: - $type: haxework.gui.SpriteView geometry.size.height: 50% - id: bot - $type: ru.m.tankz.frame.common.LifeView + $type: ru.m.tankz.view.common.LifeView tank: ba scoreLabel.visible: false - id: player1 - $type: ru.m.tankz.frame.common.LifeView + $type: ru.m.tankz.view.common.LifeView tank: pa color: 0xFFFF00 - id: player2 - $type: ru.m.tankz.frame.common.LifeView + $type: ru.m.tankz.view.common.LifeView tank: pa color: 0x15C040 diff --git a/src/client/haxe/ru/m/tankz/frame/classic/ClassicLevelFrame.hx b/src/client/haxe/ru/m/tankz/view/classic/ClassicLevelFrame.hx similarity index 95% rename from src/client/haxe/ru/m/tankz/frame/classic/ClassicLevelFrame.hx rename to src/client/haxe/ru/m/tankz/view/classic/ClassicLevelFrame.hx index 1a5e5a3..daba984 100644 --- a/src/client/haxe/ru/m/tankz/frame/classic/ClassicLevelFrame.hx +++ b/src/client/haxe/ru/m/tankz/view/classic/ClassicLevelFrame.hx @@ -1,11 +1,11 @@ -package ru.m.tankz.frame.classic; +package ru.m.tankz.view.classic; import haxework.gui.ButtonView; import haxework.gui.DataView; import haxework.gui.frame.FrameSwitcher; import haxework.gui.ToggleButtonView; import ru.m.tankz.config.Config; -import ru.m.tankz.frame.common.LevelFrame; +import ru.m.tankz.view.common.LevelFrame; import ru.m.tankz.preset.ClassicGame; @:template class ClassicLevelFrame extends LevelFrame { diff --git a/src/client/haxe/ru/m/tankz/frame/classic/ClassicLevelFrame.yaml b/src/client/haxe/ru/m/tankz/view/classic/ClassicLevelFrame.yaml similarity index 100% rename from src/client/haxe/ru/m/tankz/frame/classic/ClassicLevelFrame.yaml rename to src/client/haxe/ru/m/tankz/view/classic/ClassicLevelFrame.yaml diff --git a/src/client/haxe/ru/m/tankz/frame/common/GameFrame.hx b/src/client/haxe/ru/m/tankz/view/common/GameFrame.hx similarity index 96% rename from src/client/haxe/ru/m/tankz/frame/common/GameFrame.hx rename to src/client/haxe/ru/m/tankz/view/common/GameFrame.hx index 84201e2..49a0a02 100644 --- a/src/client/haxe/ru/m/tankz/frame/common/GameFrame.hx +++ b/src/client/haxe/ru/m/tankz/view/common/GameFrame.hx @@ -1,4 +1,4 @@ -package ru.m.tankz.frame.common; +package ru.m.tankz.view.common; import ru.m.tankz.game.GameState; import flash.events.Event; @@ -6,7 +6,7 @@ import haxe.ds.Option; import haxe.Timer; import haxework.gui.frame.FrameSwitcher; import haxework.gui.GroupView; -import ru.m.tankz.frame.common.IGamePanel; +import ru.m.tankz.view.common.IGamePanel; import ru.m.tankz.game.Game; import ru.m.tankz.network.NetworkManager; import ru.m.tankz.render.Render; diff --git a/src/client/haxe/ru/m/tankz/frame/common/IGamePanel.hx b/src/client/haxe/ru/m/tankz/view/common/IGamePanel.hx similarity index 80% rename from src/client/haxe/ru/m/tankz/frame/common/IGamePanel.hx rename to src/client/haxe/ru/m/tankz/view/common/IGamePanel.hx index a5e52db..4ced7e8 100644 --- a/src/client/haxe/ru/m/tankz/frame/common/IGamePanel.hx +++ b/src/client/haxe/ru/m/tankz/view/common/IGamePanel.hx @@ -1,4 +1,4 @@ -package ru.m.tankz.frame.common; +package ru.m.tankz.view.common; import ru.m.tankz.game.Game; import haxework.gui.IView; diff --git a/src/client/haxe/ru/m/tankz/frame/common/LevelFrame.hx b/src/client/haxe/ru/m/tankz/view/common/LevelFrame.hx similarity index 98% rename from src/client/haxe/ru/m/tankz/frame/common/LevelFrame.hx rename to src/client/haxe/ru/m/tankz/view/common/LevelFrame.hx index f35b1ce..fea5a96 100644 --- a/src/client/haxe/ru/m/tankz/frame/common/LevelFrame.hx +++ b/src/client/haxe/ru/m/tankz/view/common/LevelFrame.hx @@ -1,4 +1,4 @@ -package ru.m.tankz.frame.common; +package ru.m.tankz.view.common; import haxework.gui.ButtonView; import haxework.gui.GroupView; diff --git a/src/client/haxe/ru/m/tankz/frame/common/LifeView.hx b/src/client/haxe/ru/m/tankz/view/common/LifeView.hx similarity index 96% rename from src/client/haxe/ru/m/tankz/frame/common/LifeView.hx rename to src/client/haxe/ru/m/tankz/view/common/LifeView.hx index 2c6b815..d2a9db9 100644 --- a/src/client/haxe/ru/m/tankz/frame/common/LifeView.hx +++ b/src/client/haxe/ru/m/tankz/view/common/LifeView.hx @@ -1,4 +1,4 @@ -package ru.m.tankz.frame.common; +package ru.m.tankz.view.common; import openfl.Assets; import haxework.gui.LabelView; diff --git a/src/client/haxe/ru/m/tankz/frame/common/LifeView.yaml b/src/client/haxe/ru/m/tankz/view/common/LifeView.yaml similarity index 100% rename from src/client/haxe/ru/m/tankz/frame/common/LifeView.yaml rename to src/client/haxe/ru/m/tankz/view/common/LifeView.yaml diff --git a/src/client/haxe/ru/m/tankz/frame/common/PlayerView.hx b/src/client/haxe/ru/m/tankz/view/common/PlayerView.hx similarity index 99% rename from src/client/haxe/ru/m/tankz/frame/common/PlayerView.hx rename to src/client/haxe/ru/m/tankz/view/common/PlayerView.hx index 224c320..3413b9f 100644 --- a/src/client/haxe/ru/m/tankz/frame/common/PlayerView.hx +++ b/src/client/haxe/ru/m/tankz/view/common/PlayerView.hx @@ -1,4 +1,4 @@ -package ru.m.tankz.frame.common; +package ru.m.tankz.view.common; import haxework.color.ColorUtil; import haxework.gui.DataView; diff --git a/src/client/haxe/ru/m/tankz/frame/common/PlayerView.yaml b/src/client/haxe/ru/m/tankz/view/common/PlayerView.yaml similarity index 100% rename from src/client/haxe/ru/m/tankz/frame/common/PlayerView.yaml rename to src/client/haxe/ru/m/tankz/view/common/PlayerView.yaml diff --git a/src/client/haxe/ru/m/tankz/frame/dota/DotaGameFrame.hx b/src/client/haxe/ru/m/tankz/view/dota/DotaGameFrame.hx similarity index 76% rename from src/client/haxe/ru/m/tankz/frame/dota/DotaGameFrame.hx rename to src/client/haxe/ru/m/tankz/view/dota/DotaGameFrame.hx index a76a4bf..6befb37 100755 --- a/src/client/haxe/ru/m/tankz/frame/dota/DotaGameFrame.hx +++ b/src/client/haxe/ru/m/tankz/view/dota/DotaGameFrame.hx @@ -1,7 +1,7 @@ -package ru.m.tankz.frame.dota; +package ru.m.tankz.view.dota; -import ru.m.tankz.frame.common.GameFrame; -import ru.m.tankz.frame.common.IGamePanel; +import ru.m.tankz.view.common.GameFrame; +import ru.m.tankz.view.common.IGamePanel; import ru.m.tankz.render.Render; @:template class DotaGameFrame extends GameFrame { diff --git a/src/client/haxe/ru/m/tankz/frame/dota/DotaGameFrame.yaml b/src/client/haxe/ru/m/tankz/view/dota/DotaGameFrame.yaml similarity index 77% rename from src/client/haxe/ru/m/tankz/frame/dota/DotaGameFrame.yaml rename to src/client/haxe/ru/m/tankz/view/dota/DotaGameFrame.yaml index a80c0c1..4db47b6 100644 --- a/src/client/haxe/ru/m/tankz/frame/dota/DotaGameFrame.yaml +++ b/src/client/haxe/ru/m/tankz/view/dota/DotaGameFrame.yaml @@ -5,6 +5,6 @@ views: layout.margin: 5 views: - id: panel - $type: ru.m.tankz.frame.dota.DotaGamePanel + $type: ru.m.tankz.view.dota.DotaGamePanel - id: render $type: ru.m.tankz.render.Render diff --git a/src/client/haxe/ru/m/tankz/frame/dota/DotaGamePanel.hx b/src/client/haxe/ru/m/tankz/view/dota/DotaGamePanel.hx similarity index 87% rename from src/client/haxe/ru/m/tankz/frame/dota/DotaGamePanel.hx rename to src/client/haxe/ru/m/tankz/view/dota/DotaGamePanel.hx index bfc7723..982025e 100644 --- a/src/client/haxe/ru/m/tankz/frame/dota/DotaGamePanel.hx +++ b/src/client/haxe/ru/m/tankz/view/dota/DotaGamePanel.hx @@ -1,9 +1,9 @@ -package ru.m.tankz.frame.dota; +package ru.m.tankz.view.dota; import haxework.gui.HGroupView; import haxework.gui.LabelView; -import ru.m.tankz.frame.common.IGamePanel; -import ru.m.tankz.frame.common.LifeView; +import ru.m.tankz.view.common.IGamePanel; +import ru.m.tankz.view.common.LifeView; import ru.m.tankz.game.Game; import ru.m.tankz.preset.DotaGame; diff --git a/src/client/haxe/ru/m/tankz/frame/dota/DotaGamePanel.yaml b/src/client/haxe/ru/m/tankz/view/dota/DotaGamePanel.yaml similarity index 82% rename from src/client/haxe/ru/m/tankz/frame/dota/DotaGamePanel.yaml rename to src/client/haxe/ru/m/tankz/view/dota/DotaGamePanel.yaml index 46c6ccc..4ef996a 100644 --- a/src/client/haxe/ru/m/tankz/frame/dota/DotaGamePanel.yaml +++ b/src/client/haxe/ru/m/tankz/view/dota/DotaGamePanel.yaml @@ -3,7 +3,7 @@ geometry.size.width: 100% layout.margin: 20 views: - id: radiant - $type: ru.m.tankz.frame.common.LifeView + $type: ru.m.tankz.view.common.LifeView tank: bc color: 0xff4422 - $type: haxework.gui.SpriteView @@ -16,6 +16,6 @@ views: - $type: haxework.gui.SpriteView geometry.size.width: 25% - id: dire - $type: ru.m.tankz.frame.common.LifeView + $type: ru.m.tankz.view.common.LifeView tank: bc color: 0x3284ff diff --git a/src/client/haxe/ru/m/tankz/frame/dota/DotaLevelFrame.hx b/src/client/haxe/ru/m/tankz/view/dota/DotaLevelFrame.hx similarity index 89% rename from src/client/haxe/ru/m/tankz/frame/dota/DotaLevelFrame.hx rename to src/client/haxe/ru/m/tankz/view/dota/DotaLevelFrame.hx index ff9dd7e..a7e277b 100644 --- a/src/client/haxe/ru/m/tankz/frame/dota/DotaLevelFrame.hx +++ b/src/client/haxe/ru/m/tankz/view/dota/DotaLevelFrame.hx @@ -1,10 +1,10 @@ -package ru.m.tankz.frame.dota; +package ru.m.tankz.view.dota; import haxework.gui.ButtonView; import haxework.gui.DataView; import haxework.gui.frame.FrameSwitcher; -import ru.m.tankz.frame.common.LevelFrame; -import ru.m.tankz.frame.common.PlayerView; +import ru.m.tankz.view.common.LevelFrame; +import ru.m.tankz.view.common.PlayerView; import ru.m.tankz.game.GameState; import ru.m.tankz.preset.DotaGame; diff --git a/src/client/haxe/ru/m/tankz/frame/dota/DotaLevelFrame.yaml b/src/client/haxe/ru/m/tankz/view/dota/DotaLevelFrame.yaml similarity index 100% rename from src/client/haxe/ru/m/tankz/frame/dota/DotaLevelFrame.yaml rename to src/client/haxe/ru/m/tankz/view/dota/DotaLevelFrame.yaml diff --git a/src/client/haxe/ru/m/tankz/frame/network/GameItemView.hx b/src/client/haxe/ru/m/tankz/view/network/GameItemView.hx similarity index 93% rename from src/client/haxe/ru/m/tankz/frame/network/GameItemView.hx rename to src/client/haxe/ru/m/tankz/view/network/GameItemView.hx index b8d3bc2..1bde8c4 100755 --- a/src/client/haxe/ru/m/tankz/frame/network/GameItemView.hx +++ b/src/client/haxe/ru/m/tankz/view/network/GameItemView.hx @@ -1,4 +1,4 @@ -package ru.m.tankz.frame.network; +package ru.m.tankz.view.network; import haxework.gui.HGroupView; import haxework.gui.LabelView; @@ -18,4 +18,4 @@ import ru.m.tankz.proto.core.GameInfoProto; label.text = '${data.type}'; return data; } -} \ No newline at end of file +} diff --git a/src/client/haxe/ru/m/tankz/frame/network/GameItemView.yaml b/src/client/haxe/ru/m/tankz/view/network/GameItemView.yaml similarity index 100% rename from src/client/haxe/ru/m/tankz/frame/network/GameItemView.yaml rename to src/client/haxe/ru/m/tankz/view/network/GameItemView.yaml diff --git a/src/client/haxe/ru/m/tankz/frame/network/UserItemView.hx b/src/client/haxe/ru/m/tankz/view/network/UserItemView.hx similarity index 93% rename from src/client/haxe/ru/m/tankz/frame/network/UserItemView.hx rename to src/client/haxe/ru/m/tankz/view/network/UserItemView.hx index bec63c0..30a1268 100755 --- a/src/client/haxe/ru/m/tankz/frame/network/UserItemView.hx +++ b/src/client/haxe/ru/m/tankz/view/network/UserItemView.hx @@ -1,4 +1,4 @@ -package ru.m.tankz.frame.network; +package ru.m.tankz.view.network; import haxework.gui.HGroupView; import haxework.gui.LabelView; @@ -18,4 +18,4 @@ import ru.m.tankz.proto.core.UserProto; label.text = '${data.uuid} -- ${data.name}'; return data; } -} \ No newline at end of file +} diff --git a/src/client/haxe/ru/m/tankz/frame/network/UserItemView.yaml b/src/client/haxe/ru/m/tankz/view/network/UserItemView.yaml similarity index 100% rename from src/client/haxe/ru/m/tankz/frame/network/UserItemView.yaml rename to src/client/haxe/ru/m/tankz/view/network/UserItemView.yaml diff --git a/src/client/haxe/ru/m/tankz/frame/settings/ActionView.hx b/src/client/haxe/ru/m/tankz/view/settings/ActionView.hx similarity index 98% rename from src/client/haxe/ru/m/tankz/frame/settings/ActionView.hx rename to src/client/haxe/ru/m/tankz/view/settings/ActionView.hx index 4b8513d..7d387a8 100755 --- a/src/client/haxe/ru/m/tankz/frame/settings/ActionView.hx +++ b/src/client/haxe/ru/m/tankz/view/settings/ActionView.hx @@ -1,4 +1,4 @@ -package ru.m.tankz.frame.settings; +package ru.m.tankz.view.settings; import haxework.gui.HGroupView; import haxework.gui.LabelView; diff --git a/src/client/haxe/ru/m/tankz/frame/settings/ActionView.yaml b/src/client/haxe/ru/m/tankz/view/settings/ActionView.yaml similarity index 100% rename from src/client/haxe/ru/m/tankz/frame/settings/ActionView.yaml rename to src/client/haxe/ru/m/tankz/view/settings/ActionView.yaml diff --git a/src/client/haxe/ru/m/tankz/frame/settings/SettingsEditor.hx b/src/client/haxe/ru/m/tankz/view/settings/SettingsEditor.hx similarity index 98% rename from src/client/haxe/ru/m/tankz/frame/settings/SettingsEditor.hx rename to src/client/haxe/ru/m/tankz/view/settings/SettingsEditor.hx index 21715d2..f41d819 100644 --- a/src/client/haxe/ru/m/tankz/frame/settings/SettingsEditor.hx +++ b/src/client/haxe/ru/m/tankz/view/settings/SettingsEditor.hx @@ -1,4 +1,4 @@ -package ru.m.tankz.frame.settings; +package ru.m.tankz.view.settings; import haxework.gui.ButtonView; import haxework.gui.DataView; diff --git a/src/client/haxe/ru/m/tankz/frame/settings/SettingsEditor.yaml b/src/client/haxe/ru/m/tankz/view/settings/SettingsEditor.yaml similarity index 100% rename from src/client/haxe/ru/m/tankz/frame/settings/SettingsEditor.yaml rename to src/client/haxe/ru/m/tankz/view/settings/SettingsEditor.yaml diff --git a/src/common/haxe/ru/m/tankz/bot/HardBotControl.hx b/src/common/haxe/ru/m/tankz/bot/HardBotControl.hx index 47a9d5f..34ade5e 100644 --- a/src/common/haxe/ru/m/tankz/bot/HardBotControl.hx +++ b/src/common/haxe/ru/m/tankz/bot/HardBotControl.hx @@ -10,6 +10,9 @@ class HardBotControl extends BotControl { private var actionTimer:Timer; override public function onCollision(with:EntityType):Void { + if (tank == null) { + return; + } switch (with) { case TANK(t): if (t.playerId.team != tank.playerId.team) {