This commit is contained in:
2015-04-20 17:59:23 +03:00
parent 74a632f118
commit 93c8912dc0
11 changed files with 1373 additions and 51 deletions

View File

@@ -3,11 +3,7 @@ package ru.m.tankz;
import haxework.gui.ButtonView;
import flash.display.Sprite;
import haxework.gui.IGroupView;
import ru.m.tankz.view.frames.GameReadyFrame;
import ru.m.tankz.PacketBuilder;
import flash.text.TextFieldType;
import flash.Lib;
import flash.text.TextField;
import haxework.log.JSLogger;
import ru.m.tankz.data.GameData;
import haxework.frame.IFrameSwitcher;
@@ -42,7 +38,7 @@ class Client implements IConnectionHandler {
public function new() {
var bytes = Assets.getBytes("resources/layout/main.json");
var form:Dynamic = Json.parse(bytes.readUTFBytes(bytes.bytesAvailable));
view = GuiBuilder.build(form, {listener:this});
view = GuiBuilder.build(form);
new Root(view);
switcher = view.findViewById("switcher");
logout = view.findViewById("top:logout");
@@ -58,13 +54,6 @@ class Client implements IConnectionHandler {
#end
switcher.change(AuthFrame.ID);
/*var tf = new TextField();
tf.type = TextFieldType.INPUT;
tf.text = "Azaza";
tf.border = true;
tf.borderColor = 0xff0000;
Lib.current.addChild(tf);*/
}
public function onPress(view:ButtonView):Void {

View File

@@ -8,7 +8,6 @@ import protohx.Message;
import haxework.frame.IFrameSwitcher;
import ru.m.tankz.proto.LoginRequest;
import ru.m.tankz.proto.LoginResponse;
import ru.m.core.connect.IConnection;
import haxework.provider.Provider;
import haxe.crypto.Md5;
import haxework.gui.InputView;

View File

@@ -4,7 +4,7 @@ import ru.m.tankz.proto.JoinGameResponse;
import ru.m.tankz.proto.JoinGameRequest;
import ru.m.tankz.proto.CreateGameResponse;
import ru.m.tankz.proto.CreateGameRequest;
import ru.m.tankz.view.frames.game.GameView;
import ru.m.tankz.view.frames.list.GameView;
import haxework.frame.IFrameSwitcher;
import haxework.gui.ButtonView;
import haxework.gui.LabelView;

View File

@@ -7,7 +7,7 @@ import ru.m.tankz.proto.PersonSelectRequest;
import haxework.gui.list.ListView;
import protohx.Message;
import ru.m.core.connect.IConnection;
import ru.m.tankz.view.frames.person.PersonView;
import ru.m.tankz.view.frames.list.PersonView;
import ru.m.tankz.data.GameData;
import haxework.provider.Provider;
import ru.m.tankz.proto.Person;

View File

@@ -1,31 +0,0 @@
package ru.m.tankz.view.frames.game;
import ru.m.tankz.proto.Person;
import haxework.gui.list.ListView.IListItemView;
import haxework.gui.LabelView;
import haxework.gui.skin.ColorSkin;
import haxework.gui.HGroupView;
class PersonView extends HGroupView implements IListItemView<Person> {
public var item_index(default, default):Int;
public var data(default, set):Person;
private var nameLabel:LabelView;
public function new() {
super();
pWidth = 100;
height = 50;
skin = new ColorSkin(0xffffff);
nameLabel = new LabelView();
addView(nameLabel);
}
private function set_data(value:Person):Person {
this.data = value;
nameLabel.text = value.name;
return this.data;
}
}

View File

@@ -1,4 +1,4 @@
package ru.m.tankz.view.frames.game;
package ru.m.tankz.view.frames.list;
import ru.m.tankz.proto.Person;
import ru.m.tankz.proto.Game;

View File

@@ -1,4 +1,4 @@
package ru.m.tankz.view.frames.person;
package ru.m.tankz.view.frames.list;
import haxework.gui.list.ListView.IListItemView;
import haxework.gui.LabelView;