CloseDialogGump( )

Archive of the older Feature Request Forum Posts

Moderator: POL Developer

Locked
User avatar
ncrsn
Grandmaster Poster
Posts: 255
Joined: Fri Feb 10, 2006 12:15 am

CloseDialogGump( )

Post by ncrsn » Mon Mar 03, 2008 10:23 pm

Check out packet 0xBF and it's subcommand 4: http://packets.polserver.com/index.php? ... acket=0xBF.

What I'm asking for is core function to do the gump-closing trick. You see, when this packet is sent, client closes the gump, but never replies in any way. Thus process that sends the gump using SendGumpDialog() leaves hanging. There is really nothing you can do but .kill() it.

That would be fine, if it weren't the new (5.0.6c, at least) superb clients that remember where the user dragged the gump. Great feature if you happen to have a gump that is used often and a lot. Sadly this feature only works if the gumps id (which is the PID of the process that sends it!) remains the same. So, if process is killed, the actual location of gump gets lost.

While this problem could be solved, like, adding a new parameter to SendDialogGump(), which would of course be 'gump_id', I think that CloseDialogGump() (or CloseGump() if you want to be user friendly) would be more useful addon to core as overall.

So, to summarize the idea:
Add a function CloseDialogGump( character, gump_id ), which would send packet to player AND (this is THE FEATURE!) tell the process that sent the gump to stop waiting for it!

User avatar
CWO
POL Expert
Posts: 1151
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: CloseDialogGump( )

Post by CWO » Tue Feb 10, 2009 9:09 am

I wanna resurrect this topic because now I'm looking for this type of feature without firing a new script.

Maybe... SendDialogGump(who, layout, textlines, x := 0, y := 0, timeout := 0, gump_ID := 0);

User avatar
ncrsn
Grandmaster Poster
Posts: 255
Joined: Fri Feb 10, 2006 12:15 am

Re: CloseDialogGump( )

Post by ncrsn » Thu Mar 05, 2009 4:25 am

This looking good.

Nando_k added the above wished CloseGump() function to core some days ago, and aside the misconstructed packet in my version, it works. No longer is the gump sending process required be killed!

As an additional, though minor, feature request, it would be useful to allow response to be also other parameter types than integer. I'm thinking of error, but other may exists. CloseGump(who, pid, error{ "errortext" := "Gump closed by server." }); as an example would allow telling apart whether the gump was closed by a player or server. 0 is the value SendDialogGump returns if player closes gump using ESC (if allowed) or right clicking (if allowed). Of course this is workaroundable, so no need to work on it unless it's easy to add.

Nando
POL Developer
Posts: 262
Joined: Wed Sep 17, 2008 6:53 pm
Contact:

Re: CloseDialogGump( )

Post by Nando » Thu Mar 05, 2009 6:34 am

Sure, I was tired when I finished it and believed I should send 'response' as the 'buttonid' in the close gump packet. But I'll just send '0' and return anything you pass. :)

Locked