Game Development Community

Strange bug on my side

by AIDan · in Torque Game Engine · 02/08/2002 (7:57 am) · 7 replies

Hi

When I have joined a game, the cursor does not change to mouselook.
Any idea??
Everything else is ok.
It also does not work with the PlayGui from FPS.

greetings
Daniel

#1
02/08/2002 (9:22 am)
There is a flag on the gui's now that indicate whether they need the cursor or not. If any control on the screen, or in your playgui, has that flag set the mouse won't go away.
#2
02/09/2002 (1:17 am)
I got the same bug with the original fps mod, but I'm loading my own common mod, too.

Is there any way to close all dialogues??

greetings
Daniel
#3
02/09/2002 (8:44 am)
Check your playgui.gui file and make sure you have noCursor=true; set in in the root PlayGui control. The cursor is managed in common/client/cursor.cs. You might try putting some echo commands in there to see why the cursor isn't being turned off...
#4
02/09/2002 (1:56 pm)
This is strange.

When I open the PlayGui, the cursor does not change, not matter if the cursor is on or off.

Reactivating the package did not fix the problem.

But I did not change the function.
function GuiCanvas::checkCursor(%this)
{
   %cursorShouldBeOn = false;
   for(%i = 0; %i < %this.getCount(); %i++)
   {
      %control = %this.getObject(%i);
      if(%control.noCursor $= "")
      {
         %cursorShouldBeOn = true;
         break;
      }
   }
   if(%cursorShouldBeOn != %this.isCursorOn())
   {
      if(%cursorShouldBeOn)
         cursorOn();
      else
         cursorOff();
   }
}

I replaced the function with this one.
function GuiCanvas::checkCursor(%this)
{
	%i= 0;
	while( (%i <%this.getCount()) || ( (!%this.getObject(%i)).noCursor) )
		%i++;
	
	if( ((!%this.getObject(%i)).noCursor) && (!%this.isCursorOn()) )
		cursorOn();
	else cursorOff();
}

But it did not help.

This is the setContent function
function GuiCanvas::setContent(%this, %ctrl)
{
   Parent::setContent(%this, %ctrl);
   %this.checkCursor();
}

I do not get one of the echos I have inserted, when I call:
Canvas.setContent(PlayGui);

I don't know where the bug is.
The only reason might be that an other function is called by using this command.

greetings
Daniel
#5
02/10/2002 (5:40 am)
I found the bug.
$cursorControlled is not true.

and the function which toggles the cursor is not called.
At the moment, I have to use CursorOn() and CursorOff() to toggle the cursor.

greetings
Daniel
#6
02/10/2002 (9:39 am)
$cursorControlled is set in that cursor.cs file, and I don't see any other reference to it anywhere. I'm not even sure why it's there. Did you delete that line by mistake? There should a $cursorControlled = true; line at the top of the file.
#7
02/10/2002 (11:22 am)
The original file was not executed.

I messed up the path, so in my file the functions and variables were missed, because I only rewrote one function.

Now it is working fine :)

I made many major changes, that is the reason why I searched so long for this little bug.
Thx for your help.

greetings
Daniel