RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Gumps not closing completely

arul

Sorceror
relog helps ?
If ya, so it could be probably same as stuck after death issue, its core issue since gump packet has changed in new clients.
 

Vorspire

Knight
Try this for the command:

Code:
   private static void ToolKit_OnCommand( CommandEventArgs e )
{
    Mobile from = e.Mobile;
   if( from.HasGump( typeof( GMToolKit ) ) )
   {
    from.SendMessage( "GM Tool-Kit is open, closing..." );
    from.CloseGump( typeof( GMToolKit ) );
   }
   else
   {
    from.SendMessage( "GM Tool-Kit is already closed..." );
   }
 
   if ( from.HasGump( typeof( GMMiniKit )) )
   {
    
    from.SendMessage( "GM Mini-Kit is open, closing..." );
    from.CloseGump( typeof( GMMiniKit ) );
   }
   else
   {
    from.SendMessage( "GM Mini-Kit is already closed..." );
   }
   return;
  }

I removed the bools, and tested this with different gumps.. it works like a charm :)
 

mdavis93

Sorceror
Yes, if I log off and back in, everything works fine.

Phantom said:
If you use the CloseGump method there is no way its not closed.

So you have an issue with your code, that says its open...
And I'm trying to hold off using 'backup' checks until it's determined that it's the only possible way. The from.CloseGump( Type type ) should do it. Once I've exhausted this possiblity, I'll use the boolean checks.
 

mdavis93

Sorceror
Admin Vorspire said:
Try this for the command:

Code:
   private static void ToolKit_OnCommand( CommandEventArgs e )
{
    Mobile from = e.Mobile;
   if( from.HasGump( typeof( GMToolKit ) ) )
   {
    from.SendMessage( "GM Tool-Kit is open, closing..." );
    from.CloseGump( typeof( GMToolKit ) );
   }
   else
   {
    from.SendMessage( "GM Tool-Kit is already closed..." );
   }
 
   if ( from.HasGump( typeof( GMMiniKit )) )
   {
 
    from.SendMessage( "GM Mini-Kit is open, closing..." );
    from.CloseGump( typeof( GMMiniKit ) );
   }
   else
   {
    from.SendMessage( "GM Mini-Kit is already closed..." );
   }
   return;
  }

I removed the bools, and tested this with different gumps.. it works like a charm :)


One problem.. You script only closes it.

If you read mine, it will close the gump if it's open, or open it if it is closed.

*Uses Command, Gump Not Open* -> Gump is now opened, showing GMToolKit first.
*Uses Command, MiniKit open* -> Command closes gump and does nothing further.
*Uses Command, ToolKit open* -> Command closes gump and does nothing further.

You see, this command is the "on/off" switch for the gump. It's the only way to start it, and the only way to exit it.
 

daat99

Moderator
Staff member
Try this code:
Code:
private static void ToolKit_OnCommand( CommandEventArgs e )
{
  Mobile from = e.Mobile;
  if( from.HasGump( typeof( GMToolKit ) ) )
  {
    from.SendMessage( "GMToolKit is open, now closing..." );
    from.CloseGump( typeof( GMToolKit ) );
  }
  else if( from.HasGump( typeof( GMMiniKit ) ) )
  {
    from.CloseGump( typeof( GMMiniKit ) );
    from.SendMessage( "GMMiniKit is open, now closing..." );
  }
  else
    from.SendGump( new GMToolKit() );
}
 

mdavis93

Sorceror
Says the same thing:

"GMToolKit is open, now closing..."

If I use the command while MiniKit is open, then it says

"GMMiniKit is open, now closing..."

it will repeat one of those two (which ever was open when I used the command to close it) indefinately until I re-log.
 

Vorspire

Knight
Ok here:

Code:
private static void GMToolKit_OnCommand( CommandEventArgs e)
  {
   Mobile from = e.Mobile;
   if( from.HasGump( typeof( GMToolKit)) )
   {
    from.SendMessage( "GM Tool-Kit is open, closing..." );
    from.CloseGump( typeof( GMToolKit) );
   }
 
   if ( from.HasGump( typeof( GMMiniKit )) )
   {
    from.SendMessage( "GM Mini-Kit is open, closing..." );
    from.CloseGump( typeof( GMMiniKit ) );
   }
   else
   {
    from.SendMessage( "GM Mini-Kit is closed, opening..." );
    from.SendGump( new GMMiniKit() );    
   }
   return;
  }
 }
}
 

daat99

Moderator
Staff member
Admin Vorspire said:
Ok here:

Code:
private static void GMToolKit_OnCommand( CommandEventArgs e)
  {
   Mobile from = e.Mobile;
   if( from.HasGump( typeof( GMToolKit)) )
   {
    from.SendMessage( "GM Tool-Kit is open, closing..." );
    from.CloseGump( typeof( GMToolKit) );
   }
 
   if ( from.HasGump( typeof( GMMiniKit )) )
   {
    from.SendMessage( "GM Mini-Kit is open, closing..." );
    from.CloseGump( typeof( GMMiniKit ) );
   }
   else
   {
    from.SendMessage( "GM Mini-Kit is closed, opening..." );
    from.SendGump( new GMMiniKit() );    
   }
   return;
  }
 }
}
That code makes no sense.
Why do you add a return at the end of the method ???


Try to add this line to the case 0 in the OnResponce of the gumps (use similar line for toolkit):
Code:
state.Mobile.CloseGump( typeof( GMMiniKit ) );
 

Vorspire

Knight
daat99 said:
That code makes no sense.
Why do you add a return at the end of the method ???


Try to add this line to the case 0 in the OnResponce of the gumps (use similar line for toolkit):
Code:
state.Mobile.CloseGump( typeof( GMMiniKit ) );


he complains that it keeps looping through the messages, adding a return; will assure that will never happen.. also, adding a return; stabilizes the code further, in my eyes :/

the code i have wrote makes perfect sense and will do exactly what he wants it to do, you have to trust me on that.. but only he can verify it, if im wrong then i appologise :/


ORIGINAL: I also recommend (if you havent already done so) to never close the GMMiniKit gump when the button to open the GMToolKit gump is pressed.. or it can start looping :( just make sure that the GMMiniKit gump is NEVER closed unless the GM uses the GMToolKit Command ^^

Just remove
Code:
from.CloseGump( typeof( GMMiniKit ) );
from all of the button cases in your gump scripts :)
 

daat99

Moderator
Staff member
Admin Vorspire said:
he complains that it keeps looping through the messages, adding a return; will assure that will never happen.. also, adding a return; stabilizes the code further, in my eyes :/

the code i have wrote makes perfect sense and will do exactly what he wants it to do, you have to trust me on that.. but only he can verify it, if im wrong then i appologise :/


ORIGINAL: I also recommend (if you havent already done so) to never close the GMMiniKit gump when the button to open the GMToolKit gump is pressed.. or it can start looping :( just make sure that the GMMiniKit gump is NEVER closed unless the GM uses the GMToolKit Command ^^

Just remove
Code:
from.CloseGump( typeof( GMMiniKit ) );
from all of the button cases in your gump scripts :)
Wrong, he complained that it always show the message when he use the command, there is no loop there.
You only add a return when you want to stop the prossessing of the current method without continuing to the further code or when you need to return the value.
This is a void method that don't return a value and you added it at the end so it doesn't stop anything.

The code that you have won't change anything from what he already have since the problem is most likely in the gump itself (most likely the case 0).
 

daat99

Moderator
Staff member
Admin Vorspire said:
it really makes no difference if its there or not then ( return; )
It makes no difference which is exactly why it makes no sence.
There's absolutly no reason to add code that does nothing, especially on purpose.
 

Vorspire

Knight
it wasnt on purpose :/ i just have a habbit of doing that, it makes the code look more stable to me for some reason lol

id edit it out, but the chances that hes gonna read the rest of this messy thread are slim and he will end up re-posting again...
 

mdavis93

Sorceror
1) The MiniKit will only close by the toolkit command. I will have it set to "Closable=false"

2) The gump closes fine when a button is clicked

3) When the toolkit command is used and one of the two gumps are open, it's suppose to wipe the gump. The next time you use the command it should see that neither gump exists to you and open the ToolKit gump

4) It doesn't open the gump. It loops saying "GMToolKit" ( or "GMMiniKit", whichever the command closed) is open.. closing now. (this code is only located in the toolkit command handler
 

daat99

Moderator
Staff member
mdavis93 said:
1) The MiniKit will only close by the toolkit command. I will have it set to "Closable=false"

2) The gump closes fine when a button is clicked

3) When the toolkit command is used and one of the two gumps are open, it's suppose to wipe the gump. The next time you use the command it should see that neither gump exists to you and open the ToolKit gump

4) It doesn't open the gump. It loops saying "GMToolKit" ( or "GMMiniKit", whichever the command closed) is open.. closing now. (this code is only located in the toolkit command handler
Please post the updated scripts as you have them now.
 

mdavis93

Sorceror
Admin Vorspire said:
seriously, did you use my code at all?

No.

Your code only closes the gump. I need it to close the gump that is open, and then stop. If neither gump is open, I need it to open the ToolKit gump. Your code doesn't do that.
 

daat99

Moderator
Staff member
mdavis93 said:
No.

Your code only closes the gump. I need it to close the gump that is open, and then stop. If neither gump is open, I need it to open the ToolKit gump. Your code doesn't do that.
Did you tired the code I gave you?
We gave you a lot of stuff to change since post #20, please change them and update acordingly in a new post.
 
Top