mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
fix js chat
This commit is contained in:
parent
8b49601918
commit
f7be905972
2 changed files with 14 additions and 1 deletions
|
|
@ -81,7 +81,7 @@ class MarbleGame {
|
|||
|
||||
js.Browser.document.addEventListener('pointerlockchange', () -> {
|
||||
if (!paused && world != null) {
|
||||
if (world.finishTime == null && world._ready) {
|
||||
if (world.finishTime == null && world._ready && @:privateAccess !world.playGui.isChatFocused()) {
|
||||
if (js.Browser.document.pointerLockElement != @:privateAccess Window.getInstance().canvas) {
|
||||
handlePauseGame();
|
||||
// Focus the shit again
|
||||
|
|
@ -151,10 +151,21 @@ class MarbleGame {
|
|||
js.Browser.window.addEventListener('keydown', (e:js.html.KeyboardEvent) -> {
|
||||
var buttonCode = (e.keyCode);
|
||||
@:privateAccess Key.keyPressed[buttonCode] = Key.getFrame();
|
||||
if (world != null && @:privateAccess world.playGui.isChatFocused()) {
|
||||
@:privateAccess Window.getInstance().onKeyDown(e);
|
||||
}
|
||||
});
|
||||
js.Browser.window.addEventListener('keyup', (e:js.html.KeyboardEvent) -> {
|
||||
var buttonCode = (e.keyCode);
|
||||
@:privateAccess Key.keyPressed[buttonCode] = -Key.getFrame();
|
||||
if (world != null && @:privateAccess world.playGui.isChatFocused()) {
|
||||
@:privateAccess Window.getInstance().onKeyUp(e);
|
||||
}
|
||||
});
|
||||
js.Browser.window.addEventListener('keypress', (e:js.html.KeyboardEvent) -> {
|
||||
if (world != null && @:privateAccess world.playGui.isChatFocused()) {
|
||||
@:privateAccess Window.getInstance().onKeyPress(e);
|
||||
}
|
||||
});
|
||||
|
||||
pointercontainer.addEventListener('touchstart', (e:js.html.TouchEvent) -> {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import h3d.Vector;
|
|||
import src.ResourceLoader;
|
||||
import net.NetCommands;
|
||||
import net.Net;
|
||||
import src.MarbleGame;
|
||||
|
||||
@:publicFields
|
||||
@:structInit
|
||||
|
|
@ -78,6 +79,7 @@ class ChatCtrl extends GuiControl {
|
|||
this.chatHudInput.text.onFocusLost = (e) -> {
|
||||
this.chatInputBgText.text.visible = false;
|
||||
this.chatInputBg.bmp.visible = false;
|
||||
this.chatHudInput.text.text = "";
|
||||
sendText = "";
|
||||
chatFocused = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue