Game Development Community

Console questions

by Vern Jensen · in Torque Game Builder · 08/25/2008 (1:18 pm) · 3 replies

1) I want to make the mouse cursor visible when the console appears, and invisible when it disappears. Any way to do this? Or a function I can call to determine if the console is visible or not?

2) How do I change the console so it does not appear when ~ is pushed, or it responds to a different key combination? (Such as Command ~) I'm wanting a different key combo for when my game ships.

#1
08/26/2008 (11:13 pm)
Comment out this line in common/gamescripts/common.cs

GlobalActionMap.bind(keyboard, $Game::ConsoleBind, toggleConsole);

Then you can bind your own key to a function that calls toggleConsole(); and canvas.hideCursor(); or canvas.showCursor();
#2
08/26/2008 (11:37 pm)
Also (for some reason) you can change the console key in commonConfig.xml.

Look at common/gui/console.gui, you might put something like Canvas.hideCursor/showCursor in ConsoleDlg::onWake/onSleep

Also ConsoleDlg.isActive() would tell you if the console is currently "on"
#3
08/26/2008 (11:57 pm)
Awesome, thanks so much!