mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
fix console tilde thing
This commit is contained in:
parent
43c9d64f33
commit
8b28d74e04
2 changed files with 13 additions and 0 deletions
|
|
@ -201,6 +201,7 @@ class MarbleGame {
|
|||
canvas.pushDialog(console);
|
||||
} else {
|
||||
@:privateAccess console.isShowing = false;
|
||||
console.unfocus();
|
||||
canvas.popDialog(console, false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,6 +95,14 @@ class ConsoleDlg extends GuiControl {
|
|||
consoleInput.text.backgroundColor = 0xFFFFFFFF;
|
||||
consoleInput.text.selectionColor.set(1, 1, 1);
|
||||
consoleInput.text.selectionTile = h2d.Tile.fromColor(0x808080, 0, hxd.Math.ceil(consoleInput.text.font.lineHeight));
|
||||
consoleInput.text.onKeyDown = (e) -> {
|
||||
if (e.keyCode == hxd.Key.QWERTY_TILDE)
|
||||
e.cancel = true;
|
||||
}
|
||||
consoleInput.text.onTextInput = (e) -> {
|
||||
if (e.charCode == '`'.code)
|
||||
e.cancel = true;
|
||||
}
|
||||
|
||||
this.addChild(consoleInput);
|
||||
|
||||
|
|
@ -120,6 +128,10 @@ class ConsoleDlg extends GuiControl {
|
|||
scroll.setScrollMax(consoleContent.text.textHeight);
|
||||
}
|
||||
|
||||
public function unfocus() {
|
||||
@:privateAccess consoleInput.text.interactive.blur();
|
||||
}
|
||||
|
||||
public override function update(dt:Float, mouseState:MouseState) {
|
||||
super.update(dt, mouseState);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue