From b33b85374766841276bd59018703ee94c6cec952 Mon Sep 17 00:00:00 2001 From: shmyga Date: Tue, 19 Nov 2019 21:54:35 +0300 Subject: [PATCH] [client] update to template macro --- src/client/haxe/ru/m/tankz/view/ClientView.hx | 3 ++- src/client/haxe/ru/m/tankz/view/GameFrame.hx | 3 --- src/client/haxe/ru/m/tankz/view/common/NetworkStateView.hx | 3 ++- src/editor/haxe/ru/m/tankz/editor/view/TankFrame.hx | 3 --- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/client/haxe/ru/m/tankz/view/ClientView.hx b/src/client/haxe/ru/m/tankz/view/ClientView.hx index a55fb7a..6383b62 100644 --- a/src/client/haxe/ru/m/tankz/view/ClientView.hx +++ b/src/client/haxe/ru/m/tankz/view/ClientView.hx @@ -19,7 +19,8 @@ import ru.m.tankz.sound.SoundManager; @:provide var soundManager:SoundManager; @:provide static var bus:IControlBus; - public function init():Void { + public function new():Void { + super(); resources.text.put('version', '${Const.VERSION}'); resources.text.put('name', '${Const.NAME}'); switcher = switcherView; diff --git a/src/client/haxe/ru/m/tankz/view/GameFrame.hx b/src/client/haxe/ru/m/tankz/view/GameFrame.hx index dfdbb22..3013777 100644 --- a/src/client/haxe/ru/m/tankz/view/GameFrame.hx +++ b/src/client/haxe/ru/m/tankz/view/GameFrame.hx @@ -49,9 +49,6 @@ import ru.m.tankz.view.gamepad.GamepadView; public function new() { super(id, new DefaultLayout()); - } - - public function init():Void { bus.connect(gamepad); } diff --git a/src/client/haxe/ru/m/tankz/view/common/NetworkStateView.hx b/src/client/haxe/ru/m/tankz/view/common/NetworkStateView.hx index 7e635f5..bf25ba8 100644 --- a/src/client/haxe/ru/m/tankz/view/common/NetworkStateView.hx +++ b/src/client/haxe/ru/m/tankz/view/common/NetworkStateView.hx @@ -17,7 +17,8 @@ import ru.m.tankz.view.popup.LoginPopup; @:provide static var network:NetworkManager; - public function init():Void { + public function new():Void { + super(); network.stateSignal.connect(onConnectionChange); } diff --git a/src/editor/haxe/ru/m/tankz/editor/view/TankFrame.hx b/src/editor/haxe/ru/m/tankz/editor/view/TankFrame.hx index 0571272..f5d84fd 100644 --- a/src/editor/haxe/ru/m/tankz/editor/view/TankFrame.hx +++ b/src/editor/haxe/ru/m/tankz/editor/view/TankFrame.hx @@ -15,9 +15,6 @@ import ru.m.tankz.editor.view.tank.TankView; public function new() { super(ID); - } - - public function init():Void { color = 0x00ff00; }