The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dialog pages
Author Message
richm
Journeyman
*

Posts: 58
Likes Given: 4
Likes Received: 4 in 3 posts
Joined: Aug 2014
Reputation: 0



Post: #1
dialog pages
Hello

Can someone explain the correct way to call different pages in dialogs? Ive never used them before Confused

I have created a dialog with 2 "pages" in GumpStudio. Page 0, 1 and 2.

I know page 0 is effectively background for the whole dialog, and Page 1 is the "start" page for the dialog.

I have 1 button on Page 1 and 1 button on Page 2. The idea is that Page 1 button opens page 2, page 2 button goes back to page 1. Like a forward/backwards button.

ON=0 // PAGE 1 BUTTON
SRC.DIALOG d_resources 2 //This seems to work
return 1

ON=1 //PAGE 2 button
SRC.DIALOG d_resources 1 //This seems to work also
return 1

However, despite "noclose" not being set, if I type the command to call the dialog at page 1 and then right click, it opens page 2. If i right click that it just stays there when it should close?




Also, the "x, y" part of the dialog seems to make no difference what so ever?

this is the bit i mean...

[DIALOG d_whatever]
50, 50 <-----------------------

I can set this to 0, 0 or 500, 500 and it doesn't change the location of the dialog when it pops up. Any ideas?

Thanks all
08-11-2014 02:35 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: dialog pages
Button 0 is "fired" when you are trying to close the dialog, no matter the page you are in Smile

So when you are in page 2 and right click the dialog, button 0 fires and page 2 is displayed again.
08-11-2014 03:17 AM
Find all posts by this user Like Post Quote this message in a reply
richm
Journeyman
*

Posts: 58
Likes Given: 4
Likes Received: 4 in 3 posts
Joined: Aug 2014
Reputation: 0



Post: #3
RE: dialog pages
(08-11-2014 03:17 AM)darksun84 Wrote:  Button 0 is "fired" when you are trying to close the dialog, no matter the page you are in Smile

So when you are in page 2 and right click the dialog, button 0 fires and page 2 is displayed again.


Ah right ok so that makes sense.
I guess then all my code goes on button 1 then... ?

So how can i check to see what page is open... is there a simple way or should i incorporate some tags into it and check on those? Or should i be working with ON=1 and ON=2? :/

Cheers
(This post was last modified: 08-11-2014 06:35 AM by richm.)
08-11-2014 06:35 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #4
RE: dialog pages
try with on = 1 and on on = 2 Big Grin
08-11-2014 06:58 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes darksun84's post
richm
Journeyman
*

Posts: 58
Likes Given: 4
Likes Received: 4 in 3 posts
Joined: Aug 2014
Reputation: 0



Post: #5
RE: dialog pages
Ah thanks

had to also change the button code to "BUTTON X Y ID ID 1 0 1" and "BUTTON X Y ID ID 1 0 2" from "BUTTON X Y ID ID 1 0 0" and "BUTTON X Y ID ID 1 0 1"as well but is now working Smile

Its been a long time since i made anything Big Grin
08-11-2014 07:12 AM
Find all posts by this user Like Post Quote this message in a reply
eberk
Apprentice
*

Posts: 2
Likes Given: 0
Likes Received: 2 in 1 posts
Joined: Aug 2014
Reputation: 0



Post: #6
RE: dialog pages
why wont u just try to change them like
"BUTTON X Y ID ID 0 1 0" and "BUTTON X Y ID ID 0 2 0" without button id u can use "page" parameter in BUTTON
08-11-2014 10:15 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 2 users Like eberk's post
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #7
RE: dialog pages
the sphere always send all dialog pages to the client, you just need to make it change the page using "BUTTON x y id id 0 2 0", in other words, these numbers means:
0: there's no real button action (you cant use ON=2, ON=3, etc), since there's no action, sphere will automatically define that button as an "page button"
2: this will open page 2
0: as I said before, the button doesn't have a real action, so it doesnt need a tag number to use ON=2, ON=3, etc

you can open dialogs directly on a specific page using DIALOG d_something 2 too, this will open the dialog directly on page 2, but it's only recommended to open the dialog, not to change pages if the dialog is already open. If you change pages using this, sphere will send the entire dialog again to the client everytime you hit the button. If you use the first method above, the client can change the dialog page itself without need to reload the dialog (this will make it load faster)
(This post was last modified: 08-11-2014 10:42 AM by Coruja.)
08-11-2014 10:41 AM
Find all posts by this user Like Post Quote this message in a reply
richm
Journeyman
*

Posts: 58
Likes Given: 4
Likes Received: 4 in 3 posts
Joined: Aug 2014
Reputation: 0



Post: #8
RE: dialog pages
thanks for the advice Coruja & eberk. It was only a small script so the way its done should be ok.

Ill try your method on what i am currently working on as theres significantly more pages Confused no doubt ill be back on here soon for help Big Grin
08-11-2014 06:09 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)