KevinBlast/common/ui/ConsoleDlg.gui

75 lines
1.5 KiB
Plaintext
Raw Normal View History

2024-03-10 20:27:00 -04:00
//--- OBJECT WRITE BEGIN ---
new GuiControl(ConsoleDlg) {
profile = "GuiDefaultProfile";
new GuiWindowCtrl()
{
profile = "GuiWindowProfile";
position = "0 0";
extent = "640 370";
text = "Console";
new GuiScrollCtrl()
{
profile = "GuiScrollProfile";
position = "0 0";
extent = "640 350";
hScrollBar = "alwaysOn";
vScrollBar = "alwaysOn";
horizSizing = "width";
vertSizing = "height";
new GuiConsole("testArrayCtrl")
{
profile = "GuiConsoleProfile";
position = "0 0";
};
};
new GuiConsoleEditCtrl("ConsoleEntry")
{
profile = "GuiTextEditProfile";
position = "0 350";
extent = "640 20";
historySize = 20;
altCommand = "ConsoleEntry::eval();";
horizSizing = "width";
vertSizing = "top";
};
};
};
//--- OBJECT WRITE END ---
$ConsoleActive = false;
function ConsoleEntry::eval()
{
%text = ConsoleEntry.getValue();
echo("==>" @ %text);
eval(%text);
ConsoleEntry.setValue("");
}
function ToggleConsole(%make)
{
if (%make)
{
if ($ConsoleActive)
{
if ( $enableDirectInput )
activateKeyboard();
Canvas.popDialog(ConsoleDlg);
$ConsoleActive = false;
}
else
{
if ( $enableDirectInput )
deactivateKeyboard();
Canvas.pushDialog(ConsoleDlg, 99);
$ConsoleActive = true;
}
}
}