[client] yaml layouts
This commit is contained in:
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"pWidth": 100, "pHeight": 100,
|
|
||||||
"views": [
|
|
||||||
{
|
|
||||||
"id": "state", "@type": "haxework.gui.LabelView", "@style": "label",
|
|
||||||
"pWidth": 100, "height": 20
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "render", "@type": "ru.m.tankz.render.Render",
|
|
||||||
"contentSize": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"pWidth": 100, "pHeight": 100,
|
|
||||||
"views": [
|
|
||||||
{
|
|
||||||
"id":"levels", "@type":"haxework.gui.list.VListView<Int>",
|
|
||||||
"factory": "@class:ru.m.tankz.view.frames.list.LevelView",
|
|
||||||
"pWidth":100,
|
|
||||||
"pHeight":100,
|
|
||||||
"paddings":10,
|
|
||||||
"scroll":{
|
|
||||||
"@type":"haxework.gui.list.VScrollView",
|
|
||||||
"width":10, "pHeight":100,
|
|
||||||
"skin":{"@type":"haxework.gui.list.VScrollSkin"}
|
|
||||||
},
|
|
||||||
"skin": {
|
|
||||||
"@type": "haxework.gui.skin.ColorSkin",
|
|
||||||
"color": "0x000000", "alpha": 0.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
{
|
|
||||||
"pWidth": 100, "pHeight": 100,
|
|
||||||
"views": [
|
|
||||||
{
|
|
||||||
"@type": "haxework.gui.ImageView",
|
|
||||||
"image": "@asset:image:resources/images/logo/logo.png",
|
|
||||||
"contentSize": true, "bottomMargin": 15
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"@type": "haxework.gui.LabelView", "@style": "label",
|
|
||||||
"fontSize": 20, "topMargin": 15,
|
|
||||||
"contentSize": true,
|
|
||||||
"text": "Classic"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "classic_1p",
|
|
||||||
"@type": "haxework.gui.ButtonView",
|
|
||||||
"text": "1 Player",
|
|
||||||
"@style": "button"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "classic_2p",
|
|
||||||
"@type": "haxework.gui.ButtonView",
|
|
||||||
"text": "2 Player",
|
|
||||||
"@style": "button"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"@type": "haxework.gui.LabelView", "@style": "label",
|
|
||||||
"fontSize": 20, "topMargin": 15,
|
|
||||||
"contentSize": true,
|
|
||||||
"text": "DotA"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "dota_1p",
|
|
||||||
"@type": "haxework.gui.ButtonView",
|
|
||||||
"text": "1 Player",
|
|
||||||
"@style": "button"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "dota_2p_coop",
|
|
||||||
"@type": "haxework.gui.ButtonView",
|
|
||||||
"text": "2 COOP",
|
|
||||||
"@style": "button"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "dota_2p_vs",
|
|
||||||
"@type": "haxework.gui.ButtonView",
|
|
||||||
"text": "2 VS",
|
|
||||||
"@style": "button"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
{
|
|
||||||
"@type": "haxework.gui.VGroupView",
|
|
||||||
"pWidth": 100, "pHeight": 100,
|
|
||||||
"views": [
|
|
||||||
{
|
|
||||||
"id": "switcher", "@type": "haxework.gui.frame.FrameSwitcher",
|
|
||||||
"pWidth": 100, "pHeight": 100,
|
|
||||||
"skin": {
|
|
||||||
"@type": "haxework.gui.skin.BitmapSkin",
|
|
||||||
"image": "@asset:image:resources/images/background.png",
|
|
||||||
"fillType": "REPEAT"
|
|
||||||
},
|
|
||||||
"views": [
|
|
||||||
{
|
|
||||||
"id": "start",
|
|
||||||
"@type": "ru.m.tankz.view.frames.StartFrame"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "level",
|
|
||||||
"@type": "ru.m.tankz.view.frames.LevelFrame"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "game",
|
|
||||||
"@type": "ru.m.tankz.view.frames.GameFrame"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"@type": "haxework.gui.LabelView",
|
|
||||||
"inLayout": false,
|
|
||||||
"contentSize": true,
|
|
||||||
"vAlign": "BOTTOM",
|
|
||||||
"hAlign": "RIGHT",
|
|
||||||
"text": "@res:text:version",
|
|
||||||
"@style": "label"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"level": {
|
|
||||||
"width": 440, "height": 44,
|
|
||||||
"margins": 5,
|
|
||||||
"views": [
|
|
||||||
{
|
|
||||||
"id": "label",
|
|
||||||
"@type": "haxework.gui.LabelView",
|
|
||||||
"pWidth": 100, "pHeight": 100, "text": "",
|
|
||||||
"@style": "label"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"skin": {
|
|
||||||
"@type": "haxework.gui.skin.ColorSkin",
|
|
||||||
"color": "0x000000", "alpha": 0.2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
{
|
|
||||||
"button": {
|
|
||||||
"width":250, "height":60,
|
|
||||||
"skin": {
|
|
||||||
"@type": "haxework.gui.skin.ButtonBitmapSkin",
|
|
||||||
"upImage": "@asset:image:resources/images/control/button_normal.png",
|
|
||||||
"downImage": "@asset:image:resources/images/control/button_down.png",
|
|
||||||
"overImage": "@asset:image:resources/images/control/button_over.png",
|
|
||||||
"fillType": "NINEPATH"
|
|
||||||
},
|
|
||||||
"fontFamily":"@res:text:font", "fontEmbed":true, "fontColor":"0xE7E0BB", "fontSize":20
|
|
||||||
},
|
|
||||||
|
|
||||||
"label": {
|
|
||||||
"fontColor": "0xffffff",
|
|
||||||
"fontEmbed": false,
|
|
||||||
"fontFamily": "@res:text:fontName",
|
|
||||||
"fontSize": 16,
|
|
||||||
"shadowColor": "0x000000"
|
|
||||||
},
|
|
||||||
|
|
||||||
"input": {
|
|
||||||
"fontColor": "0xffffff",
|
|
||||||
"fontEmbed": false,
|
|
||||||
"fontFamily": "@res:text:fontName",
|
|
||||||
"fontSize": 16,
|
|
||||||
"shadowColor": "0x000000",
|
|
||||||
"skin": {
|
|
||||||
"@type": "haxework.gui.skin.ColorSkin",
|
|
||||||
"color": "0x000000"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,34 +1,37 @@
|
|||||||
package ru.m.tankz;
|
package ru.m.tankz;
|
||||||
|
|
||||||
|
import flash.events.KeyboardEvent;
|
||||||
|
import flash.text.Font;
|
||||||
|
import flash.ui.Keyboard;
|
||||||
|
import haxework.gui.ButtonView;
|
||||||
|
import haxework.gui.frame.IFrameSwitcher;
|
||||||
|
import haxework.gui.Root;
|
||||||
|
import haxework.gui.VGroupView;
|
||||||
|
import haxework.gui.ViewBuilder;
|
||||||
|
import haxework.log.TraceLogger;
|
||||||
|
import haxework.provider.Provider;
|
||||||
|
import haxework.resources.IResources;
|
||||||
|
import haxework.resources.Resources;
|
||||||
|
import ru.m.connect.IConnection;
|
||||||
|
import ru.m.tankz.frame.StartFrame;
|
||||||
import ru.m.tankz.game.ClassicGame;
|
import ru.m.tankz.game.ClassicGame;
|
||||||
import ru.m.tankz.game.DotaGame;
|
import ru.m.tankz.game.DotaGame;
|
||||||
import ru.m.tankz.game.Game;
|
import ru.m.tankz.game.Game;
|
||||||
import flash.ui.Keyboard;
|
|
||||||
import flash.events.KeyboardEvent;
|
|
||||||
import flash.text.Font;
|
|
||||||
import ru.m.tankz.view.frames.StartFrame;
|
|
||||||
import haxework.log.SocketLogger;
|
|
||||||
import haxework.resources.Resources;
|
|
||||||
import haxework.resources.IResources;
|
|
||||||
import haxework.gui.VGroupView;
|
|
||||||
import haxework.gui.ViewBuilder;
|
|
||||||
import haxework.gui.ButtonView;
|
|
||||||
import ru.m.tankz.PacketBuilder;
|
import ru.m.tankz.PacketBuilder;
|
||||||
import haxework.log.JSLogger;
|
#if flash import haxework.log.JSLogger; #end
|
||||||
import haxework.gui.frame.IFrameSwitcher;
|
#if debug import haxework.log.SocketLogger; #end
|
||||||
import haxework.provider.Provider;
|
|
||||||
import haxework.gui.frame.FrameSwitcher;
|
|
||||||
import haxework.gui.Root;
|
|
||||||
import openfl.Assets;
|
|
||||||
import ru.m.connect.IConnection;
|
|
||||||
import haxework.log.TraceLogger;
|
|
||||||
|
|
||||||
@:template("layout/main.json", "layout/styles.json")
|
|
||||||
class MainView extends VGroupView implements ViewBuilder {}
|
interface ClientViewLayout {
|
||||||
|
var switcher(default, null):IFrameSwitcher;
|
||||||
|
}
|
||||||
|
|
||||||
|
@:template('ru/m/tankz/Client.yaml', 'ru/m/tankz/Style.yaml')
|
||||||
|
class ClientView extends VGroupView implements ClientViewLayout implements ViewBuilder {}
|
||||||
|
|
||||||
class Client implements IConnectionHandler {
|
class Client implements IConnectionHandler {
|
||||||
|
|
||||||
private static inline var TAG = "Tankz";
|
private static inline var TAG = 'Tankz';
|
||||||
|
|
||||||
public static function main() {
|
public static function main() {
|
||||||
L.push(new TraceLogger());
|
L.push(new TraceLogger());
|
||||||
@@ -39,31 +42,31 @@ class Client implements IConnectionHandler {
|
|||||||
L.push(new SocketLogger());
|
L.push(new 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 Client();
|
new Client();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private var view:MainView;
|
private var view:ClientView;
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
Provider.setFactory(IResources, Resources);
|
Provider.setFactory(IResources, Resources);
|
||||||
|
|
||||||
var font:Font = Font.enumerateFonts()[0];
|
var font:Font = Font.enumerateFonts()[0];
|
||||||
Provider.get(IResources).text.put("font", "Bookman Old Style");
|
Provider.get(IResources).text.put('font', 'Bookman Old Style');
|
||||||
Provider.get(IResources).text.put("version", 'v${Const.VERSION} b${Const.BUILD}');
|
Provider.get(IResources).text.put('version', 'v${Const.VERSION} b${Const.BUILD}');
|
||||||
|
|
||||||
Provider.set(IPacketBuilder, new PacketBuilder());
|
Provider.set(IPacketBuilder, new PacketBuilder());
|
||||||
#if flash
|
#if flash
|
||||||
Provider.set(IConnection, new ru.m.connect.flash.FlashConnection("localhost", 5001));
|
Provider.set(IConnection, new ru.m.connect.flash.FlashConnection('localhost', 5001));
|
||||||
#elseif html5
|
#elseif html5
|
||||||
Provider.set(IConnection, new ru.m.connect.js.JsConnection("localhost", 5001));
|
Provider.set(IConnection, new ru.m.connect.js.JsConnection('localhost', 5001));
|
||||||
#end
|
#end
|
||||||
|
|
||||||
//Provider.get(IConnection).handler.addListener(this);
|
//Provider.get(IConnection).handler.addListener(this);
|
||||||
view = new MainView();
|
view = new ClientView();
|
||||||
Provider.set(IFrameSwitcher, view.switcher);
|
Provider.set(IFrameSwitcher, view.switcher);
|
||||||
Root.bind(view);
|
Root.bind(view);
|
||||||
view.content.stage.stageFocusRect = false;
|
view.content.stage.stageFocusRect = false;
|
||||||
@@ -82,7 +85,7 @@ class Client implements IConnectionHandler {
|
|||||||
|
|
||||||
public function onPress(view:ButtonView):Void {
|
public function onPress(view:ButtonView):Void {
|
||||||
switch (view.id) {
|
switch (view.id) {
|
||||||
case "logout":
|
case 'logout':
|
||||||
Provider.get(IConnection).disconnect();
|
Provider.get(IConnection).disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -94,7 +97,7 @@ class Client implements IConnectionHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function onError(error:Dynamic):Void {
|
public function onError(error:Dynamic):Void {
|
||||||
L.e(TAG, "", error);
|
L.e(TAG, '', error);
|
||||||
//view.switcher.change(AuthFrame.ID);
|
//view.switcher.change(AuthFrame.ID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
27
src/client/haxe/ru/m/tankz/Client.yaml
Executable file
27
src/client/haxe/ru/m/tankz/Client.yaml
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
$type: haxework.gui.VGroupView
|
||||||
|
pWidth: 100
|
||||||
|
pHeight: 100
|
||||||
|
views:
|
||||||
|
- id: switcher
|
||||||
|
$type: haxework.gui.frame.FrameSwitcher
|
||||||
|
pWidth: 100
|
||||||
|
pHeight: 100
|
||||||
|
skin:
|
||||||
|
$type: haxework.gui.skin.BitmapSkin
|
||||||
|
image: "@asset:image:resources/images/background.png"
|
||||||
|
fillType: REPEAT
|
||||||
|
views:
|
||||||
|
- id: start
|
||||||
|
$type: ru.m.tankz.frame.StartFrame
|
||||||
|
- id: level
|
||||||
|
$type: ru.m.tankz.frame.LevelFrame
|
||||||
|
- id: game
|
||||||
|
$type: ru.m.tankz.frame.GameFrame
|
||||||
|
- $type: haxework.gui.LabelView
|
||||||
|
$style: label
|
||||||
|
inLayout: false
|
||||||
|
contentSize: true
|
||||||
|
vAlign: BOTTOM
|
||||||
|
hAlign: RIGHT
|
||||||
|
text: "@res:text:version"
|
||||||
21
src/client/haxe/ru/m/tankz/Style.yaml
Normal file
21
src/client/haxe/ru/m/tankz/Style.yaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
button:
|
||||||
|
width: 250
|
||||||
|
height: 60
|
||||||
|
skin:
|
||||||
|
$type: haxework.gui.skin.ButtonBitmapSkin
|
||||||
|
upImage: "@asset:image:resources/images/control/button_normal.png"
|
||||||
|
downImage: "@asset:image:resources/images/control/button_down.png"
|
||||||
|
overImage: "@asset:image:resources/images/control/button_over.png"
|
||||||
|
fillType: NINEPATH
|
||||||
|
fontFamily: "@res:text:font"
|
||||||
|
fontEmbed: true
|
||||||
|
fontColor: "#E7E0BB"
|
||||||
|
fontSize: 20
|
||||||
|
|
||||||
|
label:
|
||||||
|
fontColor: "#ffffff"
|
||||||
|
fontEmbed: false
|
||||||
|
fontFamily: Courirer New
|
||||||
|
fontSize: 16
|
||||||
|
shadowColor: 0x000000
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
package ru.m.tankz.view.frames;
|
package ru.m.tankz.frame;
|
||||||
|
|
||||||
import haxe.ds.Option;
|
|
||||||
import haxe.ds.Option;
|
|
||||||
import flash.events.Event;
|
import flash.events.Event;
|
||||||
|
import haxe.ds.Option;
|
||||||
import haxe.Timer;
|
import haxe.Timer;
|
||||||
import haxework.gui.frame.IFrameSwitcher;
|
import haxework.gui.frame.IFrameSwitcher;
|
||||||
import haxework.gui.LabelView;
|
import haxework.gui.LabelView;
|
||||||
@@ -22,8 +21,7 @@ interface GameFrameLayout {
|
|||||||
var render(default, null):Render;
|
var render(default, null):Render;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@:template("ru/m/tankz/frame/GameFrame.yaml", "ru/m/tankz/Style.yaml")
|
||||||
@:template("layout/frames/game.json", "layout/styles.json")
|
|
||||||
class GameFrame extends VGroupView implements ViewBuilder implements IPacketHandler implements GameFrameLayout {
|
class GameFrame extends VGroupView implements ViewBuilder implements IPacketHandler implements GameFrameLayout {
|
||||||
|
|
||||||
private static inline var TAG = "GameFrame";
|
private static inline var TAG = "GameFrame";
|
||||||
12
src/client/haxe/ru/m/tankz/frame/GameFrame.yaml
Normal file
12
src/client/haxe/ru/m/tankz/frame/GameFrame.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
pWidth: 100
|
||||||
|
pHeight: 100
|
||||||
|
views:
|
||||||
|
- id: state
|
||||||
|
$type: haxework.gui.LabelView
|
||||||
|
$style: label
|
||||||
|
pWidth: 100
|
||||||
|
height: 20
|
||||||
|
- id: render
|
||||||
|
$type: ru.m.tankz.render.Render
|
||||||
|
contentSize: true
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package ru.m.tankz.view.frames;
|
package ru.m.tankz.frame;
|
||||||
|
|
||||||
import ru.m.tankz.config.ConfigBundle;
|
import ru.m.tankz.config.ConfigBundle;
|
||||||
import haxework.gui.frame.IFrameSwitcher;
|
import haxework.gui.frame.IFrameSwitcher;
|
||||||
@@ -14,7 +14,7 @@ interface LevelFrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@:template("layout/frames/level.json", "layout/styles.json")
|
@:template("ru/m/tankz/frame/LevelFrame.yaml", "ru/m/tankz/Style.yaml")
|
||||||
class LevelFrame extends VGroupView implements ViewBuilder implements LevelFrameLayout {
|
class LevelFrame extends VGroupView implements ViewBuilder implements LevelFrameLayout {
|
||||||
public static inline var ID = "level";
|
public static inline var ID = "level";
|
||||||
|
|
||||||
20
src/client/haxe/ru/m/tankz/frame/LevelFrame.yaml
Normal file
20
src/client/haxe/ru/m/tankz/frame/LevelFrame.yaml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
pWidth: 100
|
||||||
|
pHeight: 100
|
||||||
|
views:
|
||||||
|
- id: levels
|
||||||
|
$type: haxework.gui.list.VListView<Int>
|
||||||
|
factory: "@class:ru.m.tankz.frame.level.LevelView"
|
||||||
|
pWidth: 100
|
||||||
|
pHeight: 100
|
||||||
|
paddings: 10
|
||||||
|
scroll:
|
||||||
|
$type: haxework.gui.list.VScrollView
|
||||||
|
width: 10
|
||||||
|
pHeight: 100
|
||||||
|
skin:
|
||||||
|
$type: haxework.gui.list.VScrollSkin
|
||||||
|
skin:
|
||||||
|
$type: haxework.gui.skin.ColorSkin
|
||||||
|
color: "#000000"
|
||||||
|
alpha: 0
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package ru.m.tankz.view.frames;
|
package ru.m.tankz.frame;
|
||||||
|
|
||||||
import haxework.gui.ButtonView;
|
import haxework.gui.ButtonView;
|
||||||
import haxework.gui.frame.IFrameSwitcher;
|
import haxework.gui.frame.IFrameSwitcher;
|
||||||
@@ -19,7 +19,7 @@ interface StartFrameLayout {
|
|||||||
var dota_2p_vs(default, null):ButtonView;
|
var dota_2p_vs(default, null):ButtonView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@:template("layout/frames/start.json", "layout/styles.json")
|
@:template("ru/m/tankz/frame/StartFrame.yaml", "ru/m/tankz/Style.yaml")
|
||||||
class StartFrame extends VGroupView implements ViewBuilder implements StartFrameLayout {
|
class StartFrame extends VGroupView implements ViewBuilder implements StartFrameLayout {
|
||||||
|
|
||||||
public static inline var ID = "start";
|
public static inline var ID = "start";
|
||||||
40
src/client/haxe/ru/m/tankz/frame/StartFrame.yaml
Normal file
40
src/client/haxe/ru/m/tankz/frame/StartFrame.yaml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
pWidth: 100
|
||||||
|
pHeight: 100
|
||||||
|
views:
|
||||||
|
- $type: haxework.gui.ImageView
|
||||||
|
image: "@asset:image:resources/images/logo/logo.png"
|
||||||
|
contentSize: true
|
||||||
|
bottomMargin: 15
|
||||||
|
- $type: haxework.gui.LabelView
|
||||||
|
$style: label
|
||||||
|
fontSize: 20
|
||||||
|
topMargin: 15
|
||||||
|
contentSize: true
|
||||||
|
text: Classic
|
||||||
|
- id: classic_1p
|
||||||
|
$type: haxework.gui.ButtonView
|
||||||
|
text: 1 Player
|
||||||
|
$style: button
|
||||||
|
- id: classic_2p
|
||||||
|
$type: haxework.gui.ButtonView
|
||||||
|
text: 2 Player
|
||||||
|
$style: button
|
||||||
|
- $type: haxework.gui.LabelView
|
||||||
|
$style: label
|
||||||
|
fontSize: 20
|
||||||
|
topMargin: 15
|
||||||
|
contentSize: true
|
||||||
|
text: DotA
|
||||||
|
- id: dota_1p
|
||||||
|
$type: haxework.gui.ButtonView
|
||||||
|
text: 1 Player
|
||||||
|
$style: button
|
||||||
|
- id: dota_2p_coop
|
||||||
|
$type: haxework.gui.ButtonView
|
||||||
|
text: 2 COOP
|
||||||
|
$style: button
|
||||||
|
- id: dota_2p_vs
|
||||||
|
$type: haxework.gui.ButtonView
|
||||||
|
text: 2 VS
|
||||||
|
$style: button
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package ru.m.tankz.view.frames.list;
|
package ru.m.tankz.frame.level;
|
||||||
|
|
||||||
import haxework.gui.ViewBuilder;
|
import haxework.gui.ViewBuilder;
|
||||||
import haxework.gui.HGroupView;
|
import haxework.gui.HGroupView;
|
||||||
@@ -10,7 +10,7 @@ interface LevelViewLayout {
|
|||||||
var label(default, null):LabelView;
|
var label(default, null):LabelView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@:template("layout/other.json@level", "layout/styles.json")
|
@:template("ru/m/tankz/frame/level/LevelView.yaml", "ru/m/tankz/Style.yaml")
|
||||||
class LevelView extends HGroupView implements ViewBuilder implements IListItemView<Int> implements LevelViewLayout {
|
class LevelView extends HGroupView implements ViewBuilder implements IListItemView<Int> implements LevelViewLayout {
|
||||||
|
|
||||||
public var item_index(default, default):Int;
|
public var item_index(default, default):Int;
|
||||||
15
src/client/haxe/ru/m/tankz/frame/level/LevelView.yaml
Normal file
15
src/client/haxe/ru/m/tankz/frame/level/LevelView.yaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
width: 440
|
||||||
|
height: 44
|
||||||
|
margins: 5
|
||||||
|
views:
|
||||||
|
- id: label
|
||||||
|
$type: haxework.gui.LabelView
|
||||||
|
$style: label
|
||||||
|
pWidth: 100
|
||||||
|
pHeight: 100
|
||||||
|
text: ""
|
||||||
|
skin:
|
||||||
|
$type: haxework.gui.skin.ColorSkin
|
||||||
|
color: "#000000"
|
||||||
|
alpha: 0.2
|
||||||
@@ -3,14 +3,14 @@ package ru.m.tankz.editor;
|
|||||||
import flash.text.Font;
|
import flash.text.Font;
|
||||||
import haxework.gui.ButtonView;
|
import haxework.gui.ButtonView;
|
||||||
import haxework.gui.frame.FrameSwitcher;
|
import haxework.gui.frame.FrameSwitcher;
|
||||||
import haxework.gui.GroupView;
|
import haxework.gui.VGroupView;
|
||||||
import haxework.gui.Root;
|
import haxework.gui.Root;
|
||||||
import haxework.gui.ViewBuilder;
|
import haxework.gui.ViewBuilder;
|
||||||
import haxework.log.TraceLogger;
|
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;
|
||||||
import ru.m.tankz.view.frames.LevelFrame;
|
import ru.m.tankz.frame.LevelFrame;
|
||||||
#if flash import haxework.log.JSLogger; #end
|
#if flash import haxework.log.JSLogger; #end
|
||||||
#if debug import haxework.log.SocketLogger; #end
|
#if debug import haxework.log.SocketLogger; #end
|
||||||
|
|
||||||
@@ -19,12 +19,12 @@ interface EditorViewLayout {
|
|||||||
var switcher(default, null):FrameSwitcher;
|
var switcher(default, null):FrameSwitcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
@:template("ru/m/tankz/editor/Editor.yaml", "ru/m/tankz/editor/Style.json")
|
@:template('ru/m/tankz/editor/Editor.yaml', 'ru/m/tankz/editor/Style.yaml')
|
||||||
class EditorView extends GroupView implements ViewBuilder implements EditorViewLayout {}
|
class EditorView extends VGroupView implements ViewBuilder implements EditorViewLayout {}
|
||||||
|
|
||||||
class Editor {
|
class Editor {
|
||||||
|
|
||||||
private static inline var TAG = "Tankz.Editor";
|
private static inline var TAG = 'Editor';
|
||||||
|
|
||||||
public static function main() {
|
public static function main() {
|
||||||
L.push(new TraceLogger());
|
L.push(new TraceLogger());
|
||||||
@@ -35,9 +35,9 @@ class Editor {
|
|||||||
L.push(new SocketLogger());
|
L.push(new 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();
|
new Editor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,8 +47,8 @@ class Editor {
|
|||||||
Provider.setFactory(IResources, Resources);
|
Provider.setFactory(IResources, Resources);
|
||||||
|
|
||||||
var font:Font = Font.enumerateFonts()[0];
|
var font:Font = Font.enumerateFonts()[0];
|
||||||
Provider.get(IResources).text.put("font", "Bookman Old Style");
|
Provider.get(IResources).text.put('font', 'Bookman Old Style');
|
||||||
Provider.get(IResources).text.put("version", 'v${Const.VERSION} b${Const.BUILD}');
|
Provider.get(IResources).text.put('version', 'v${Const.VERSION} b${Const.BUILD}');
|
||||||
|
|
||||||
view = new EditorView({handler: this});
|
view = new EditorView({handler: this});
|
||||||
Root.bind(view);
|
Root.bind(view);
|
||||||
|
|||||||
@@ -1,43 +1,48 @@
|
|||||||
$type: haxework.gui.GroupView
|
---
|
||||||
|
$type: haxework.gui.VGroupView
|
||||||
pWidth: 100
|
pWidth: 100
|
||||||
pHeight: 100
|
pHeight: 100
|
||||||
|
skin:
|
||||||
|
$type: haxework.gui.skin.BitmapSkin
|
||||||
|
image: "@asset:image:resources/images/background.png"
|
||||||
|
fillType: REPEAT
|
||||||
views:
|
views:
|
||||||
|
# Tabs
|
||||||
|
- $type: haxework.gui.HGroupView
|
||||||
|
contentSize: true
|
||||||
|
views:
|
||||||
|
- id: btn_level
|
||||||
|
$type: haxework.gui.ButtonView
|
||||||
|
$style: button
|
||||||
|
text: Level
|
||||||
|
onPress: "@link:handler"
|
||||||
|
- id: btn_tank
|
||||||
|
$type: haxework.gui.ButtonView
|
||||||
|
$style: button
|
||||||
|
text: Tank
|
||||||
|
onPress: "@link:handler"
|
||||||
|
- $type: haxework.gui.SpriteView
|
||||||
|
height: 3
|
||||||
|
pWidth: 100
|
||||||
|
skin:
|
||||||
|
$type: haxework.gui.skin.ColorSkin
|
||||||
|
color: "#aaaaaa"
|
||||||
# Switcher
|
# Switcher
|
||||||
- id: switcher
|
- id: switcher
|
||||||
$type: haxework.gui.frame.FrameSwitcher
|
$type: haxework.gui.frame.FrameSwitcher
|
||||||
pWidth: 100
|
pWidth: 100
|
||||||
pHeight: 100
|
pHeight: 100
|
||||||
skin:
|
paddings: 5
|
||||||
$type: haxework.gui.skin.BitmapSkin
|
|
||||||
image: '@asset:image:resources/images/background.png'
|
|
||||||
fillType: REPEAT
|
|
||||||
views:
|
views:
|
||||||
- id: level
|
- id: level
|
||||||
$type: ru.m.tankz.editor.frame.LevelFrame
|
$type: ru.m.tankz.editor.frame.LevelFrame
|
||||||
- id: tank
|
- id: tank
|
||||||
$type: ru.m.tankz.editor.frame.TankFrame
|
$type: ru.m.tankz.editor.frame.TankFrame
|
||||||
# Tabs
|
|
||||||
- $type: haxework.gui.HGroupView
|
|
||||||
vAlign: TOP
|
|
||||||
hAlign: CENTER
|
|
||||||
contentSize: true
|
|
||||||
inLayout: false
|
|
||||||
views:
|
|
||||||
- id: btn_level
|
|
||||||
$type: haxework.gui.ButtonView
|
|
||||||
text: Level
|
|
||||||
'@style': button
|
|
||||||
onPress: '@link:handler'
|
|
||||||
- id: btn_tank
|
|
||||||
$type: haxework.gui.ButtonView
|
|
||||||
text: Tank
|
|
||||||
'@style': button
|
|
||||||
onPress: '@link:handler'
|
|
||||||
# Version
|
# Version
|
||||||
- $type: haxework.gui.LabelView
|
- $type: haxework.gui.LabelView
|
||||||
|
$style: label
|
||||||
inLayout: false
|
inLayout: false
|
||||||
contentSize: true
|
contentSize: true
|
||||||
vAlign: BOTTOM
|
vAlign: BOTTOM
|
||||||
hAlign: RIGHT
|
hAlign: RIGHT
|
||||||
'@style': label
|
text: "@res:text:version"
|
||||||
text: '@res:text:version'
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"button": {
|
|
||||||
"width": 150,
|
|
||||||
"height": 20,
|
|
||||||
"margins": 2,
|
|
||||||
"skin": {
|
|
||||||
"@type": "haxework.gui.skin.ButtonColorSkin",
|
|
||||||
"color": "0xaaff00"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"label": {
|
|
||||||
"fontColor": "0xffffff",
|
|
||||||
"fontEmbed": false,
|
|
||||||
"fontFamily": "@res:text:fontName",
|
|
||||||
"fontSize": 16,
|
|
||||||
"shadowColor": "0x000000"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
|
---
|
||||||
button:
|
button:
|
||||||
height: 20
|
height: 20
|
||||||
width: 150
|
width: 150
|
||||||
|
margins: 2
|
||||||
skin:
|
skin:
|
||||||
$type: haxework.gui.skin.ButtonColorSkin
|
$type: haxework.gui.skin.ButtonColorSkin
|
||||||
color: 0xaaff00
|
color: 0xaaff00
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ interface LevelFrameLayout {
|
|||||||
var brickList(default, null):VListView<BrickConfig>;
|
var brickList(default, null):VListView<BrickConfig>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@:template('ru/m/tankz/editor/frame/LevelFrame.yaml', 'ru/m/tankz/editor/Style.json')
|
@:template('ru/m/tankz/editor/frame/LevelFrame.yaml', 'ru/m/tankz/editor/Style.yaml')
|
||||||
class LevelFrame extends VGroupView implements ViewBuilder implements LevelFrameLayout {
|
class LevelFrame extends VGroupView implements ViewBuilder implements LevelFrameLayout {
|
||||||
public static inline var ID = 'level';
|
public static inline var ID = 'level';
|
||||||
public static inline var TAG = 'level';
|
public static inline var TAG = 'level';
|
||||||
|
|||||||
@@ -1,30 +1,32 @@
|
|||||||
|
---
|
||||||
$type: haxework.gui.VGroupView
|
$type: haxework.gui.VGroupView
|
||||||
pWidth: 100
|
pWidth: 100
|
||||||
pHeight: 100
|
pHeight: 100
|
||||||
layoutMargin: 2
|
layoutMargin: 2
|
||||||
|
layoutVAlign: TOP
|
||||||
views:
|
views:
|
||||||
- $type: haxework.gui.HGroupView
|
- $type: haxework.gui.HGroupView
|
||||||
contentSize: true
|
contentSize: true
|
||||||
views:
|
views:
|
||||||
- id: gameClassicButton
|
- id: gameClassicButton
|
||||||
$type: haxework.gui.ButtonView
|
$type: haxework.gui.ButtonView
|
||||||
|
$style: button
|
||||||
text: Classic
|
text: Classic
|
||||||
'@style': button
|
|
||||||
- id: gameDotaButton
|
- id: gameDotaButton
|
||||||
$type: haxework.gui.ButtonView
|
$type: haxework.gui.ButtonView
|
||||||
|
$style: button
|
||||||
text: DotA
|
text: DotA
|
||||||
'@style': button
|
|
||||||
- $type: haxework.gui.HGroupView
|
- $type: haxework.gui.HGroupView
|
||||||
contentSize: true
|
contentSize: true
|
||||||
views:
|
views:
|
||||||
- id: openButton
|
- id: openButton
|
||||||
$type: haxework.gui.ButtonView
|
$type: haxework.gui.ButtonView
|
||||||
|
$style: button
|
||||||
text: Open
|
text: Open
|
||||||
'@style': button
|
|
||||||
- id: saveButton
|
- id: saveButton
|
||||||
$type: haxework.gui.ButtonView
|
$type: haxework.gui.ButtonView
|
||||||
|
$style: button
|
||||||
text: Save
|
text: Save
|
||||||
'@style': button
|
|
||||||
- id: fileNameLabel
|
- id: fileNameLabel
|
||||||
$type: haxework.gui.LabelView
|
$type: haxework.gui.LabelView
|
||||||
contentSize: true
|
contentSize: true
|
||||||
@@ -33,7 +35,7 @@ views:
|
|||||||
views:
|
views:
|
||||||
- id: spawnPointList
|
- id: spawnPointList
|
||||||
$type: haxework.gui.list.VListView<SpawnPoint>
|
$type: haxework.gui.list.VListView<SpawnPoint>
|
||||||
factory: '@class:ru.m.tankz.editor.level.SpawnPointView'
|
factory: "@class:ru.m.tankz.editor.level.SpawnPointView"
|
||||||
width: 56
|
width: 56
|
||||||
pHeight: 100
|
pHeight: 100
|
||||||
scroll:
|
scroll:
|
||||||
@@ -51,7 +53,7 @@ views:
|
|||||||
contentSize: true
|
contentSize: true
|
||||||
- id: brickList
|
- id: brickList
|
||||||
$type: haxework.gui.list.VListView<BrickConfig>
|
$type: haxework.gui.list.VListView<BrickConfig>
|
||||||
factory: '@class:ru.m.tankz.editor.level.BrickView'
|
factory: "@class:ru.m.tankz.editor.level.BrickView"
|
||||||
width: 30
|
width: 30
|
||||||
pHeight: 100
|
pHeight: 100
|
||||||
scroll:
|
scroll:
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ interface TankFrameLayout {
|
|||||||
var colorB(default, null):InputView;
|
var colorB(default, null):InputView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@:template('ru/m/tankz/editor/frame/TankFrame.yaml')
|
@:template('ru/m/tankz/editor/frame/TankFrame.yaml', 'ru/m/tankz/editor/Style.yaml')
|
||||||
class TankFrame extends HGroupView implements ViewBuilder implements TankFrameLayout {
|
class TankFrame extends HGroupView implements ViewBuilder implements TankFrameLayout {
|
||||||
public static inline var ID = 'tank';
|
public static inline var ID = 'tank';
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
$type: haxework.gui.HGroupView
|
$type: haxework.gui.HGroupView
|
||||||
pWidth: 100
|
pWidth: 100
|
||||||
pHeight: 100
|
pHeight: 100
|
||||||
@@ -5,28 +6,28 @@ views:
|
|||||||
- $type: ru.m.tankz.editor.tank.TankView
|
- $type: ru.m.tankz.editor.tank.TankView
|
||||||
contentSize: true
|
contentSize: true
|
||||||
rightMargin: 20
|
rightMargin: 20
|
||||||
image: '@asset:image:resources/image/tank/bc-0.png'
|
image: "@asset:image:resources/image/tank/bc-0.png"
|
||||||
color: '#ff4422'
|
color: "#ff4422"
|
||||||
- $type: ru.m.tankz.editor.tank.TankView
|
- $type: ru.m.tankz.editor.tank.TankView
|
||||||
contentSize: true
|
contentSize: true
|
||||||
rightMargin: 20
|
rightMargin: 20
|
||||||
image: '@asset:image:resources/image/tank/bc-0.png'
|
image: "@asset:image:resources/image/tank/bc-0.png"
|
||||||
color: '#f055a0'
|
color: "#f055a0"
|
||||||
- $type: ru.m.tankz.editor.tank.TankView
|
- $type: ru.m.tankz.editor.tank.TankView
|
||||||
contentSize: true
|
contentSize: true
|
||||||
rightMargin: 20
|
rightMargin: 20
|
||||||
image: '@asset:image:resources/image/tank/bc-0.png'
|
image: "@asset:image:resources/image/tank/bc-0.png"
|
||||||
color: '#2244ff'
|
color: "#2244ff"
|
||||||
- id: tank
|
- id: tank
|
||||||
$type: ru.m.tankz.editor.tank.TankView
|
$type: ru.m.tankz.editor.tank.TankView
|
||||||
contentSize: true
|
contentSize: true
|
||||||
rightMargin: 20
|
rightMargin: 20
|
||||||
image: '@asset:image:resources/image/tank/bc-0.png'
|
image: "@asset:image:resources/image/tank/bc-0.png"
|
||||||
- id: colorR
|
- id: colorR
|
||||||
$type: haxework.gui.InputView
|
$type: haxework.gui.InputView
|
||||||
width: 30
|
width: 30
|
||||||
height: 20
|
height: 20
|
||||||
text: 'a0'
|
text: "a0"
|
||||||
skin:
|
skin:
|
||||||
$type: haxework.gui.skin.ColorSkin
|
$type: haxework.gui.skin.ColorSkin
|
||||||
color: 0xffffff
|
color: 0xffffff
|
||||||
@@ -34,7 +35,7 @@ views:
|
|||||||
$type: haxework.gui.InputView
|
$type: haxework.gui.InputView
|
||||||
width: 30
|
width: 30
|
||||||
height: 20
|
height: 20
|
||||||
text: '55'
|
text: "55"
|
||||||
skin:
|
skin:
|
||||||
$type: haxework.gui.skin.ColorSkin
|
$type: haxework.gui.skin.ColorSkin
|
||||||
color: 0xffffff
|
color: 0xffffff
|
||||||
@@ -42,7 +43,7 @@ views:
|
|||||||
$type: haxework.gui.InputView
|
$type: haxework.gui.InputView
|
||||||
width: 30
|
width: 30
|
||||||
height: 20
|
height: 20
|
||||||
text: 'f0'
|
text: "f0"
|
||||||
skin:
|
skin:
|
||||||
$type: haxework.gui.skin.ColorSkin
|
$type: haxework.gui.skin.ColorSkin
|
||||||
color: 0xffffff
|
color: 0xffffff
|
||||||
|
|||||||
Reference in New Issue
Block a user