[editor] rename packages

This commit is contained in:
2019-06-13 11:02:54 +03:00
parent c534cf20fd
commit 5798fa9db7
13 changed files with 67 additions and 73 deletions

View File

@@ -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 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} size: {width: 30, height: 15}
data: "002555520000255552000025555200002555520000255552000025555200002255220000225522000022552200000055000000005500000000550000111155111111115511111111551111111155111111115511111111551111555533555555553355555555335555555444455555544445555554444555555533555555553355555555335555111155111111115511111111551111111155111111115511111111551111000055000000005500000000550000002255220000225522000022552200002555520000255552000025555200002555520000255552000025555200"

View File

@@ -1,60 +1,33 @@
package ru.m.tankz.editor; 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.provider.Provider;
import haxework.resources.IResources; import haxework.resources.IResources;
import haxework.resources.Resources; import haxework.resources.Resources;
#if flash import haxework.log.JSLogger; #end import haxework.view.Root;
#if debug import haxework.log.SocketLogger; #end import ru.m.tankz.bundle.ConfigBundle;
import ru.m.tankz.bundle.IConfigBundle;
import ru.m.tankz.bundle.ILevelBundle;
@:template class EditorView extends VGroupView { import ru.m.tankz.bundle.LevelBundle;
@:view public var switcher(default, null):FrameSwitcher; import ru.m.tankz.editor.view.EditorView;
@:view public var tabs(default, null):IGroupView; import ru.m.tankz.editor.view.MapFrame;
public function onPress(v:ButtonView):Void {
switcher.change(v.id);
}
private function onFrameSwitch(frame:IView<Dynamic>):Void {
for (view in tabs.views) cast(view, ToggleButtonView).on = view.id == frame.id;
}
}
class Editor { class Editor {
private static inline var TAG = 'Editor'; private static inline var TAG = 'Editor';
@:provide private static var resources:IResources;
public static function main() { public static function main() {
L.push(new TraceLogger()); L.push(new haxework.log.TraceLogger());
#if flash #if flash
L.push(new JSLogger()); L.push(new haxework.log.JSLogger());
#end #end
#if debug #if debug
L.push(new SocketLogger()); //L.push(new haxework.log.SocketLogger());
#end #end
Const.init(); Const.init();
L.d(TAG, 'Debug: ${Const.DEBUG}'); L.d(TAG, 'Debug: ${Const.DEBUG}');
L.i(TAG, 'Version: ${Const.VERSION}'); L.i(TAG, 'Version: ${Const.VERSION}');
L.i(TAG, 'Build: ${Const.BUILD}'); L.i(TAG, 'Build: ${Const.BUILD}');
new Editor();
}
@:provide private var resources:IResources;
public function new() {
resources = new Resources(); resources = new Resources();
resources.text.put('version', '${Const.VERSION}'); resources.text.put('version', '${Const.VERSION}');
@@ -65,7 +38,6 @@ class Editor {
var view = new EditorView(); var view = new EditorView();
Root.bind(view); Root.bind(view);
view.switcher.change(MapFrame.ID);
view.switcher.change(LevelFrame.ID);
} }
} }

View File

@@ -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<Dynamic>):Void {
for (view in tabs.views) cast(view, ToggleButtonView).on = view.id == frame.id;
}
}

View File

@@ -9,10 +9,10 @@ views:
$type: haxework.view.HGroupView $type: haxework.view.HGroupView
geometry.margin.bottom: -2 geometry.margin.bottom: -2
views: views:
- id: level - id: map
$type: haxework.view.ToggleButtonView $type: haxework.view.ToggleButtonView
skinId: button.tab skinId: button.tab
text: Level text: Map
+onPress: $this:onPress +onPress: $this:onPress
- id: tank - id: tank
$type: haxework.view.ToggleButtonView $type: haxework.view.ToggleButtonView
@@ -27,10 +27,10 @@ views:
geometry.size.stretch: true geometry.size.stretch: true
geometry.padding: 5 geometry.padding: 5
views: views:
- id: level - id: map
$type: ru.m.tankz.editor.frame.LevelFrame $type: ru.m.tankz.editor.view.MapFrame
- id: tank - id: tank
$type: ru.m.tankz.editor.frame.TankFrame $type: ru.m.tankz.editor.view.TankFrame
# Version # Version
- $type: haxework.view.LabelView - $type: haxework.view.LabelView
skinId: text skinId: text

View File

@@ -1,4 +1,4 @@
package ru.m.tankz.editor.frame; package ru.m.tankz.editor.view;
import haxework.view.ButtonView; import haxework.view.ButtonView;
import haxework.view.DataView; import haxework.view.DataView;
@@ -8,17 +8,17 @@ import haxework.view.VGroupView;
import ru.m.tankz.bundle.IConfigBundle; import ru.m.tankz.bundle.IConfigBundle;
import ru.m.tankz.config.Config; import ru.m.tankz.config.Config;
import ru.m.tankz.editor.FileUtil; import ru.m.tankz.editor.FileUtil;
import ru.m.tankz.editor.level.BrickView; import ru.m.tankz.editor.view.map.BrickView;
import ru.m.tankz.editor.level.MapEditView; import ru.m.tankz.editor.view.map.MapEditView;
import ru.m.tankz.editor.level.SpawnPointView; import ru.m.tankz.editor.view.map.SpawnPointView;
import ru.m.tankz.preset.ClassicGame; import ru.m.tankz.preset.ClassicGame;
import ru.m.tankz.preset.DotaGame; import ru.m.tankz.preset.DotaGame;
import ru.m.tankz.Type; import ru.m.tankz.Type;
import ru.m.tankz.util.LevelUtil; import ru.m.tankz.util.LevelUtil;
@:template class LevelFrame extends VGroupView { @:template class MapFrame extends VGroupView {
public static inline var ID = 'level'; public static inline var ID = 'map';
public static inline var TAG = 'level'; public static inline var TAG = 'map';
@:view var gameClassicButton:ButtonView; @:view var gameClassicButton:ButtonView;
@:view var gameDotaButton:ButtonView; @:view var gameDotaButton:ButtonView;

View File

@@ -58,9 +58,9 @@ views:
$type: haxework.view.layout.VerticalLayout $type: haxework.view.layout.VerticalLayout
hAlign: center hAlign: center
margin: 5 margin: 5
factory: $code:ru.m.tankz.editor.level.SpawnPointView.factory factory: $code:ru.m.tankz.editor.view.map.SpawnPointView.factory
- id: mapView - id: mapView
$type: ru.m.tankz.editor.level.MapEditView $type: ru.m.tankz.editor.view.map.MapEditView
- id: brickList - id: brickList
$type: haxework.view.DataView $type: haxework.view.DataView
geometry.padding: 3 geometry.padding: 3
@@ -68,7 +68,7 @@ views:
$type: haxework.view.layout.VerticalLayout $type: haxework.view.layout.VerticalLayout
hAlign: center hAlign: center
margin: 5 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 - $type: haxework.view.HGroupView
layout.margin: 5 layout.margin: 5
views: views:

View File

@@ -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.view.IGroupView;
import haxework.color.Color; import haxework.color.Color;
import haxework.view.InputView; import haxework.view.InputView;

View File

@@ -12,21 +12,21 @@ views:
rowSize: 4 rowSize: 4
margin: 20 margin: 20
views: 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" 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" 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" 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" 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" 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" 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" 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" image: "$asset:image:resources/image/tank/bd-0.png"
- id: color - id: color
$type: haxework.view.InputView $type: haxework.view.InputView

View File

@@ -1,4 +1,4 @@
package ru.m.tankz.editor.level; package ru.m.tankz.editor.view.map;
import ru.m.tankz.config.Config; import ru.m.tankz.config.Config;

View File

@@ -1,4 +1,4 @@
package ru.m.tankz.editor.level; package ru.m.tankz.editor.view.map;
import haxework.color.Color; import haxework.color.Color;
import flash.display.Shape; import flash.display.Shape;

View File

@@ -1,4 +1,4 @@
package ru.m.tankz.editor.level; package ru.m.tankz.editor.view.map;
import ru.m.tankz.util.LevelUtil; import ru.m.tankz.util.LevelUtil;
import flash.display.Graphics; import flash.display.Graphics;

View File

@@ -1,4 +1,4 @@
package ru.m.tankz.editor.level; package ru.m.tankz.editor.view.map;
import haxework.color.Color; import haxework.color.Color;
import ru.m.tankz.config.Config; import ru.m.tankz.config.Config;

View File

@@ -1,4 +1,4 @@
package ru.m.tankz.editor.tank; package ru.m.tankz.editor.view.tank;
import flash.display.Bitmap; import flash.display.Bitmap;
import flash.display.BitmapData; import flash.display.BitmapData;