diff --git a/src/common/resources/death/levels/level001.txt b/src/common/resources/death/levels/level001.txt index ed68093..fab49e0 100644 --- a/src/common/resources/death/levels/level001.txt +++ b/src/common/resources/death/levels/level001.txt @@ -1,4 +1,4 @@ -data: "002555520000255552000025555200002555520000255552000025555200002255220000225522000022552200000055000000005500000000550000111155111111115511111111551111111155111111115511111111551111555533555555553355555555335555555444455555544445555554444555555533555555553355555555335555111155111111115511111111551111111155111111115511111111551111000055000000005500000000550000002255220000225522000022552200002555520000255552000025555200002555520000255552000025555200" -points: [{index: 0, direction: right, y: 0, x: 0, team: alpha, type: tank}, {index: 0, direction: right, y: 0, x: 2, team: beta, type: tank}, {index: 0, direction: right, y: 0, x: 4, team: gamma, type: tank}, {index: 0, direction: right, y: 0, x: 6, team: delta, type: tank}, {index: 0, direction: right, y: 2, x: 0, team: epsilon, type: tank}, {index: 0, direction: right, y: 2, x: 2, team: zeta, type: tank}, {index: 0, direction: right, y: 2, x: 4, team: eta, type: tank}, {index: 0, direction: right, y: 2, x: 6, team: theta, type: tank}] name: garages +points: [{direction: right, x: 0, team: alpha, type: tank, y: 0, index: 0}, {direction: right, x: 9, team: beta, type: tank, y: 0, index: 0}, {direction: right, x: 19, team: gamma, type: tank, y: 0, index: 0}, {direction: right, x: 28, team: delta, type: tank, y: 0, index: 0}, {direction: right, x: 0, team: epsilon, type: tank, y: 13, index: 0}, {direction: right, x: 9, team: zeta, type: tank, y: 13, index: 0}, {direction: right, x: 19, team: eta, type: tank, y: 13, index: 0}, {direction: right, x: 28, team: theta, type: tank, y: 13, index: 0}] size: {width: 30, height: 15} +data: "002555520000255552000025555200002555520000255552000025555200002255220000225522000022552200000055000000005500000000550000111155111111115511111111551111111155111111115511111111551111555533555555553355555555335555555444455555544445555554444555555533555555553355555555335555111155111111115511111111551111111155111111115511111111551111000055000000005500000000550000002255220000225522000022552200002555520000255552000025555200002555520000255552000025555200" diff --git a/src/editor/haxe/ru/m/tankz/editor/Editor.hx b/src/editor/haxe/ru/m/tankz/editor/Editor.hx index b3cda5a..67a7b5b 100644 --- a/src/editor/haxe/ru/m/tankz/editor/Editor.hx +++ b/src/editor/haxe/ru/m/tankz/editor/Editor.hx @@ -1,60 +1,33 @@ package ru.m.tankz.editor; -import haxework.view.IGroupView; -import haxework.view.ToggleButtonView; -import haxework.view.IView; -import ru.m.tankz.editor.frame.LevelFrame; -import ru.m.tankz.bundle.LevelBundle; -import ru.m.tankz.bundle.ILevelBundle; -import ru.m.tankz.bundle.ConfigBundle; -import ru.m.tankz.bundle.IConfigBundle; -import haxework.view.ButtonView; -import haxework.view.frame.FrameSwitcher; -import haxework.view.VGroupView; -import haxework.view.Root; -import haxework.log.TraceLogger; import haxework.provider.Provider; import haxework.resources.IResources; import haxework.resources.Resources; -#if flash import haxework.log.JSLogger; #end -#if debug import haxework.log.SocketLogger; #end - - -@:template class EditorView extends VGroupView { - @:view public var switcher(default, null):FrameSwitcher; - @:view public var tabs(default, null):IGroupView; - - public function onPress(v:ButtonView):Void { - switcher.change(v.id); - } - - private function onFrameSwitch(frame:IView):Void { - for (view in tabs.views) cast(view, ToggleButtonView).on = view.id == frame.id; - } -} +import haxework.view.Root; +import ru.m.tankz.bundle.ConfigBundle; +import ru.m.tankz.bundle.IConfigBundle; +import ru.m.tankz.bundle.ILevelBundle; +import ru.m.tankz.bundle.LevelBundle; +import ru.m.tankz.editor.view.EditorView; +import ru.m.tankz.editor.view.MapFrame; class Editor { - private static inline var TAG = 'Editor'; + @:provide private static var resources:IResources; + public static function main() { - L.push(new TraceLogger()); + L.push(new haxework.log.TraceLogger()); #if flash - L.push(new JSLogger()); + L.push(new haxework.log.JSLogger()); #end #if debug - L.push(new SocketLogger()); + //L.push(new haxework.log.SocketLogger()); #end Const.init(); L.d(TAG, 'Debug: ${Const.DEBUG}'); L.i(TAG, 'Version: ${Const.VERSION}'); L.i(TAG, 'Build: ${Const.BUILD}'); - new Editor(); - } - - @:provide private var resources:IResources; - - public function new() { resources = new Resources(); resources.text.put('version', '${Const.VERSION}'); @@ -65,7 +38,6 @@ class Editor { var view = new EditorView(); Root.bind(view); - - view.switcher.change(LevelFrame.ID); + view.switcher.change(MapFrame.ID); } } diff --git a/src/editor/haxe/ru/m/tankz/editor/view/EditorView.hx b/src/editor/haxe/ru/m/tankz/editor/view/EditorView.hx new file mode 100644 index 0000000..7f28211 --- /dev/null +++ b/src/editor/haxe/ru/m/tankz/editor/view/EditorView.hx @@ -0,0 +1,22 @@ +package ru.m.tankz.editor.view; + +import haxework.view.ButtonView; +import haxework.view.frame.FrameSwitcher; +import haxework.view.IGroupView; +import haxework.view.IView; +import haxework.view.ToggleButtonView; +import haxework.view.VGroupView; + +@:template class EditorView extends VGroupView { + @:view public var switcher(default, null):FrameSwitcher; + @:view public var tabs(default, null):IGroupView; + + public function onPress(v:ButtonView):Void { + switcher.change(v.id); + } + + private function onFrameSwitch(frame:IView):Void { + for (view in tabs.views) cast(view, ToggleButtonView).on = view.id == frame.id; + } +} + diff --git a/src/editor/haxe/ru/m/tankz/editor/EditorView.yaml b/src/editor/haxe/ru/m/tankz/editor/view/EditorView.yaml similarity index 84% rename from src/editor/haxe/ru/m/tankz/editor/EditorView.yaml rename to src/editor/haxe/ru/m/tankz/editor/view/EditorView.yaml index 7be5584..fcbe836 100644 --- a/src/editor/haxe/ru/m/tankz/editor/EditorView.yaml +++ b/src/editor/haxe/ru/m/tankz/editor/view/EditorView.yaml @@ -9,10 +9,10 @@ views: $type: haxework.view.HGroupView geometry.margin.bottom: -2 views: - - id: level + - id: map $type: haxework.view.ToggleButtonView skinId: button.tab - text: Level + text: Map +onPress: $this:onPress - id: tank $type: haxework.view.ToggleButtonView @@ -27,10 +27,10 @@ views: geometry.size.stretch: true geometry.padding: 5 views: - - id: level - $type: ru.m.tankz.editor.frame.LevelFrame + - id: map + $type: ru.m.tankz.editor.view.MapFrame - id: tank - $type: ru.m.tankz.editor.frame.TankFrame + $type: ru.m.tankz.editor.view.TankFrame # Version - $type: haxework.view.LabelView skinId: text diff --git a/src/editor/haxe/ru/m/tankz/editor/frame/LevelFrame.hx b/src/editor/haxe/ru/m/tankz/editor/view/MapFrame.hx similarity index 92% rename from src/editor/haxe/ru/m/tankz/editor/frame/LevelFrame.hx rename to src/editor/haxe/ru/m/tankz/editor/view/MapFrame.hx index f333e38..a7f2093 100644 --- a/src/editor/haxe/ru/m/tankz/editor/frame/LevelFrame.hx +++ b/src/editor/haxe/ru/m/tankz/editor/view/MapFrame.hx @@ -1,4 +1,4 @@ -package ru.m.tankz.editor.frame; +package ru.m.tankz.editor.view; import haxework.view.ButtonView; import haxework.view.DataView; @@ -8,17 +8,17 @@ import haxework.view.VGroupView; import ru.m.tankz.bundle.IConfigBundle; import ru.m.tankz.config.Config; import ru.m.tankz.editor.FileUtil; -import ru.m.tankz.editor.level.BrickView; -import ru.m.tankz.editor.level.MapEditView; -import ru.m.tankz.editor.level.SpawnPointView; +import ru.m.tankz.editor.view.map.BrickView; +import ru.m.tankz.editor.view.map.MapEditView; +import ru.m.tankz.editor.view.map.SpawnPointView; import ru.m.tankz.preset.ClassicGame; import ru.m.tankz.preset.DotaGame; import ru.m.tankz.Type; import ru.m.tankz.util.LevelUtil; -@:template class LevelFrame extends VGroupView { - public static inline var ID = 'level'; - public static inline var TAG = 'level'; +@:template class MapFrame extends VGroupView { + public static inline var ID = 'map'; + public static inline var TAG = 'map'; @:view var gameClassicButton:ButtonView; @:view var gameDotaButton:ButtonView; diff --git a/src/editor/haxe/ru/m/tankz/editor/frame/LevelFrame.yaml b/src/editor/haxe/ru/m/tankz/editor/view/MapFrame.yaml similarity index 91% rename from src/editor/haxe/ru/m/tankz/editor/frame/LevelFrame.yaml rename to src/editor/haxe/ru/m/tankz/editor/view/MapFrame.yaml index 12225d1..125def6 100644 --- a/src/editor/haxe/ru/m/tankz/editor/frame/LevelFrame.yaml +++ b/src/editor/haxe/ru/m/tankz/editor/view/MapFrame.yaml @@ -58,9 +58,9 @@ views: $type: haxework.view.layout.VerticalLayout hAlign: center margin: 5 - factory: $code:ru.m.tankz.editor.level.SpawnPointView.factory + factory: $code:ru.m.tankz.editor.view.map.SpawnPointView.factory - id: mapView - $type: ru.m.tankz.editor.level.MapEditView + $type: ru.m.tankz.editor.view.map.MapEditView - id: brickList $type: haxework.view.DataView geometry.padding: 3 @@ -68,7 +68,7 @@ views: $type: haxework.view.layout.VerticalLayout hAlign: center margin: 5 - factory: $code:ru.m.tankz.editor.level.BrickView.factory + factory: $code:ru.m.tankz.editor.view.map.BrickView.factory - $type: haxework.view.HGroupView layout.margin: 5 views: diff --git a/src/editor/haxe/ru/m/tankz/editor/frame/TankFrame.hx b/src/editor/haxe/ru/m/tankz/editor/view/TankFrame.hx similarity index 89% rename from src/editor/haxe/ru/m/tankz/editor/frame/TankFrame.hx rename to src/editor/haxe/ru/m/tankz/editor/view/TankFrame.hx index 6f17247..72f71e9 100644 --- a/src/editor/haxe/ru/m/tankz/editor/frame/TankFrame.hx +++ b/src/editor/haxe/ru/m/tankz/editor/view/TankFrame.hx @@ -1,6 +1,6 @@ -package ru.m.tankz.editor.frame; +package ru.m.tankz.editor.view; -import ru.m.tankz.editor.tank.TankView; +import ru.m.tankz.editor.view.tank.TankView; import haxework.view.IGroupView; import haxework.color.Color; import haxework.view.InputView; diff --git a/src/editor/haxe/ru/m/tankz/editor/frame/TankFrame.yaml b/src/editor/haxe/ru/m/tankz/editor/view/TankFrame.yaml similarity index 71% rename from src/editor/haxe/ru/m/tankz/editor/frame/TankFrame.yaml rename to src/editor/haxe/ru/m/tankz/editor/view/TankFrame.yaml index 42b1723..4fa5172 100644 --- a/src/editor/haxe/ru/m/tankz/editor/frame/TankFrame.yaml +++ b/src/editor/haxe/ru/m/tankz/editor/view/TankFrame.yaml @@ -12,21 +12,21 @@ views: rowSize: 4 margin: 20 views: - - $type: ru.m.tankz.editor.tank.TankView + - $type: ru.m.tankz.editor.view.tank.TankView image: "$asset:image:resources/image/tank/pa-0.png" - - $type: ru.m.tankz.editor.tank.TankView + - $type: ru.m.tankz.editor.view.tank.TankView image: "$asset:image:resources/image/tank/pb-0.png" - - $type: ru.m.tankz.editor.tank.TankView + - $type: ru.m.tankz.editor.view.tank.TankView image: "$asset:image:resources/image/tank/pc-0.png" - - $type: ru.m.tankz.editor.tank.TankView + - $type: ru.m.tankz.editor.view.tank.TankView image: "$asset:image:resources/image/tank/pd-0.png" - - $type: ru.m.tankz.editor.tank.TankView + - $type: ru.m.tankz.editor.view.tank.TankView image: "$asset:image:resources/image/tank/ba-0.png" - - $type: ru.m.tankz.editor.tank.TankView + - $type: ru.m.tankz.editor.view.tank.TankView image: "$asset:image:resources/image/tank/bb-0.png" - - $type: ru.m.tankz.editor.tank.TankView + - $type: ru.m.tankz.editor.view.tank.TankView image: "$asset:image:resources/image/tank/bc-0.png" - - $type: ru.m.tankz.editor.tank.TankView + - $type: ru.m.tankz.editor.view.tank.TankView image: "$asset:image:resources/image/tank/bd-0.png" - id: color $type: haxework.view.InputView diff --git a/src/editor/haxe/ru/m/tankz/editor/level/BrickView.hx b/src/editor/haxe/ru/m/tankz/editor/view/map/BrickView.hx similarity index 90% rename from src/editor/haxe/ru/m/tankz/editor/level/BrickView.hx rename to src/editor/haxe/ru/m/tankz/editor/view/map/BrickView.hx index 44f2ebf..bf884f4 100644 --- a/src/editor/haxe/ru/m/tankz/editor/level/BrickView.hx +++ b/src/editor/haxe/ru/m/tankz/editor/view/map/BrickView.hx @@ -1,4 +1,4 @@ -package ru.m.tankz.editor.level; +package ru.m.tankz.editor.view.map; import ru.m.tankz.config.Config; diff --git a/src/editor/haxe/ru/m/tankz/editor/level/BrushView.hx b/src/editor/haxe/ru/m/tankz/editor/view/map/BrushView.hx similarity index 97% rename from src/editor/haxe/ru/m/tankz/editor/level/BrushView.hx rename to src/editor/haxe/ru/m/tankz/editor/view/map/BrushView.hx index 694745a..af15bde 100644 --- a/src/editor/haxe/ru/m/tankz/editor/level/BrushView.hx +++ b/src/editor/haxe/ru/m/tankz/editor/view/map/BrushView.hx @@ -1,4 +1,4 @@ -package ru.m.tankz.editor.level; +package ru.m.tankz.editor.view.map; import haxework.color.Color; import flash.display.Shape; diff --git a/src/editor/haxe/ru/m/tankz/editor/level/MapEditView.hx b/src/editor/haxe/ru/m/tankz/editor/view/map/MapEditView.hx similarity index 99% rename from src/editor/haxe/ru/m/tankz/editor/level/MapEditView.hx rename to src/editor/haxe/ru/m/tankz/editor/view/map/MapEditView.hx index 5596484..e80c60d 100644 --- a/src/editor/haxe/ru/m/tankz/editor/level/MapEditView.hx +++ b/src/editor/haxe/ru/m/tankz/editor/view/map/MapEditView.hx @@ -1,4 +1,4 @@ -package ru.m.tankz.editor.level; +package ru.m.tankz.editor.view.map; import ru.m.tankz.util.LevelUtil; import flash.display.Graphics; diff --git a/src/editor/haxe/ru/m/tankz/editor/level/SpawnPointView.hx b/src/editor/haxe/ru/m/tankz/editor/view/map/SpawnPointView.hx similarity index 96% rename from src/editor/haxe/ru/m/tankz/editor/level/SpawnPointView.hx rename to src/editor/haxe/ru/m/tankz/editor/view/map/SpawnPointView.hx index cce90b1..748d28d 100644 --- a/src/editor/haxe/ru/m/tankz/editor/level/SpawnPointView.hx +++ b/src/editor/haxe/ru/m/tankz/editor/view/map/SpawnPointView.hx @@ -1,4 +1,4 @@ -package ru.m.tankz.editor.level; +package ru.m.tankz.editor.view.map; import haxework.color.Color; import ru.m.tankz.config.Config; diff --git a/src/editor/haxe/ru/m/tankz/editor/tank/TankView.hx b/src/editor/haxe/ru/m/tankz/editor/view/tank/TankView.hx similarity index 96% rename from src/editor/haxe/ru/m/tankz/editor/tank/TankView.hx rename to src/editor/haxe/ru/m/tankz/editor/view/tank/TankView.hx index cb7d556..4bba7f9 100644 --- a/src/editor/haxe/ru/m/tankz/editor/tank/TankView.hx +++ b/src/editor/haxe/ru/m/tankz/editor/view/tank/TankView.hx @@ -1,4 +1,4 @@ -package ru.m.tankz.editor.tank; +package ru.m.tankz.editor.view.tank; import flash.display.Bitmap; import flash.display.BitmapData;