[editor] rename packages
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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<Dynamic>):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);
|
||||
}
|
||||
}
|
||||
|
||||
22
src/editor/haxe/ru/m/tankz/editor/view/EditorView.hx
Normal file
22
src/editor/haxe/ru/m/tankz/editor/view/EditorView.hx
Normal 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -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;
|
||||
@@ -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:
|
||||
@@ -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;
|
||||
@@ -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
|
||||
@@ -1,4 +1,4 @@
|
||||
package ru.m.tankz.editor.level;
|
||||
package ru.m.tankz.editor.view.map;
|
||||
|
||||
import ru.m.tankz.config.Config;
|
||||
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user