[common] ticker update

This commit is contained in:
2019-06-02 22:09:13 +03:00
parent fb9a28c126
commit 5a3d5b974e
10 changed files with 114 additions and 42 deletions

View File

@@ -1,5 +1,6 @@
package ru.m.tankz.view;
import ru.m.tankz.game.IGame;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
import haxework.resources.IResources;
@@ -21,6 +22,7 @@ import ru.m.tankz.view.popup.LoginPopup;
@:provide var resources:IResources;
@:provide var switcher:FrameSwitcher;
@:provide var soundManager:SoundManager;
@:provide var game:IGame;
public function init():Void {
resources.text.put('version', '${Const.VERSION}');
@@ -37,6 +39,10 @@ import ru.m.tankz.view.popup.LoginPopup;
switcher.change(StartFrame.ID);
case Keyboard.M:
soundManager.mute = !soundManager.mute;
case Keyboard.P:
if (game != null) {
game.pause = !game.pause;
}
}
});
switcher.change(StartFrame.ID);
@@ -54,7 +60,8 @@ import ru.m.tankz.view.popup.LoginPopup;
logoutButton.visible = false;
loginButton.visible = true;
case ERROR(error):
L.e("ClientView", 'onConnectionState: ERROR', error);
//L.e("ClientView", 'onConnectionState: ERROR', error);
L.w("ClientView", 'onConnectionState: ERROR');
case _:
username.text = "";
logoutButton.visible = false;