|
Xerakon Apprentice
Joined: 10 May 2011 Posts: 111
|
Posted: Thu Jun 21, 2012 6:41 am
#YESNO Button Stacking |
Hello,
Was wondering if it is possible to stack buttons vertically instead of having them spread horizontally across the popup window?
Also wondering if I can make a custom popup bar that I can click on with buttons in various places (think of a hyperspace layout map).
Thanks!
Jeremy |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Thu Jun 21, 2012 12:34 pm |
I'm pretty sure you can't do that with #YESNO buttons. It's old code from Zmud that hasn't been updated.
Depending on what you want to do with this "popup bar", you might be able to get something like it. Can you explain a little more what you had in mind? |
|
|
|
Xerakon Apprentice
Joined: 10 May 2011 Posts: 111
|
Posted: Thu Jun 21, 2012 1:42 pm |
Ah, okay.
Well, here's what I'm working with:
Coruscant Sector ( 75, 0 )
Mytaranor Sector ( -151, 13 )
Kanz Sector ( -10, -20 )
Corellian System ( 120, -25 )
Tatoo System ( -175, 78 )
Wroona System ( -31, 61 )
Perave System ( -200, 0 )
Ryloth System ( -253, 17 )
Bright Jewel System ( -100, 35 )
Raioballo Sector ( -48, 24 )
Alderaan System ( 50, 68 )
Hutt Space ( -100, 70 )
Adega System ( -229, 115 )
Chommell Sector ( -221, 78 )
Meridian Sector ( -100, -39 )
Kuat System ( 27, 111 )
Anoat Sector ( -243, -62 )
As you can see, a list of planets that are built on an x,y grid system. What I'm wanting to do, is to make a grid with the coordinates plotted onto it. And when I type in a command, it pops up onto my screen, then I just click where I want to travel to, and it starts the preparation syntaxes and such, then executes the travel to that system. Mainly, this is to help me see what planets are closest to which and such. Kind of like the galaxy map in SWTOR. |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Thu Jun 21, 2012 7:58 pm |
Ah. Hm. I don't think there is any way to set the X and Y coordinates of a button arbitrarily, but perhaps someone else will chime in with better information.
I can think of a way to do this with MXP hyperlinks on an ordinary text window, however. It would involve sorting the systems by Y coordinate, looping through them, and using %format() statements to position each one. You could send this formatted text to a window, which you could set up as a flyout. |
|
|
|
Xerakon Apprentice
Joined: 10 May 2011 Posts: 111
|
Posted: Sun Jun 24, 2012 7:10 pm |
Would you mind helping me out with that? I wouldn't even mind if it popped up on the main screen at this point. I just need a visual reference for this.
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Jun 25, 2012 1:24 am |
Is the set of systems (and their locations) a constant? In other words, will you always be displaying the same set of systems, in the same locations? Or will the systems displayed ever change?
If you just want to display the same set of systems permanently, the easiest way is to just figure out how you want them displayed. Try laying them out in a Word document, in Courier font. Once you have them laid out in Word, it will be very easy to display this permanently in a window. Then, to make each system name a clickable link, put some MXP code around it. For instance, replace the text
with
Code: |
<send 'TRAVEL COMMAND HERE'>Tatoo System</send> |
In that code, replace TRAVEL COMMAND HERE with whatever command you need to travel to Tatoo. It can be an alias, or a series of mud commands, or whatever.
If the display has to be calculate each time, then you'll need to explain how you figure out which systems go where on the display. |
|
|
|
Xerakon Apprentice
Joined: 10 May 2011 Posts: 111
|
Posted: Mon Jun 25, 2012 6:20 am |
The systems/locations themselves always stay the same, but I was thinking of changing it's center based on which planet I'm orbiting at the time. Or atleast a different color for the world. New windows are... well.. new to me. Is there different scripting needed to ensure that the info is sent to the main window after finishing selection?
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon Jun 25, 2012 9:08 pm |
doing things from a different window changes the context of the script so it's possible that something available to your main window won't be available to the other window. Usually this only affects things like the SQL database connections (lack of connection + SQL attempt = access violation) or access to the map (meaning the %room/%zone/%map related functions return null), but other possibilities may include access to regular variables and other settings you created.
However, if all you are doing is sending commands then you can take Rahab's code above and replace TRAVEL COMMAND HERE with :windowname:TRAVEL COMMAND HERE. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Xerakon Apprentice
Joined: 10 May 2011 Posts: 111
|
Posted: Mon Jun 25, 2012 10:04 pm |
Ah, okay. And the windowname is just what's up on top of the window? Or is there a separate ID with it? How do I find it?
|
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Mon Jun 25, 2012 11:33 pm |
It's the name of the window in the package editor. Chances are it is just what's on top of the window, that's the default, but it is possible to change the caption.
EDIT: Just tested it and it works with captions too, but you're still better off using the actual name of the window - if there's ever name conflicts, names take precedence over captions. |
|
|
|
Xerakon Apprentice
Joined: 10 May 2011 Posts: 111
|
Posted: Tue Jun 26, 2012 2:19 pm |
Can you help me with the command for bringing up the new window?
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Jun 26, 2012 4:38 pm |
Here's a complete setup.
Suppose you have created the following layout for your system map:
Code: |
Minbar
Trantor
Arisia
|
In the Package Editor, click New|New Window
Name the window Space Map
With the Space Map window selected in the Package Editor, click the Advanced tab at the bottom of the Editor
Uncheck the Command Line checkbox and the Status Bar checkbox
Set the radio button to No Network Connection
This should create a new window, probably as a tab near the top of Cmud
Drag the tab to wherever you want it docked
In the Package Editor, in the Space Map window, click New|Event
Name the event onLoad, and have the event execute an alias 'refresh'
Now, in the Space Map window, create the alias 'refresh', containing the following script:
Code: |
#CLR
#MXP { Minbar }
#MXP { }
#MXP { Trantor }
#MXP { }
#MXP { Arisia }
|
You can see that this will lay out your systems the way you want
Now, change it to add the MXP coding (in the following, my main window is named 'test'):
Code: |
#CLR
#MXP { <send ':test:goto Minbar'>Minbar</send> }
#MXP { }
#MXP { <send ':test:goto Trantor'>Trantor</send> }
#MXP { }
#MXP { <send ':test:goto Arisia'>Arisia</send> }
|
This should turn the text into clickable actions, executing the 'goto' command in the 'test' window
In your main window make the 'goto' alias, which executes whatever code you need to travel to the named system
You might also want an alias in your main window named 'remap' or something, which executes:
This will let you refresh the Space Map if it ever gets messed up somehow |
|
Last edited by Rahab on Tue Jun 26, 2012 4:42 pm; edited 2 times in total |
|
|
|
Xerakon Apprentice
Joined: 10 May 2011 Posts: 111
|
Posted: Tue Jun 26, 2012 8:39 pm |
Okay, I've got it, and it looks good. Thanks a bunch! Last few q's:
What's the coding for showing/hiding the extra window? I tried the #T+/- with and without ::'s around Space Map, but no dice.
I'm looking for it to just pop up at a command (remap is perfect for that), then go away at a trigger. |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Wed Jun 27, 2012 3:42 am |
#WINDOW will open a window, #CLOSE will close it. Keep in mind that when you open it it'll be blank, so you'll need to run your redrawing code at the same time. Also, if you only want it open at certain times, you may want to remove the onload event, so it doesn't open every time you launch the session.
|
|
|
|
|
|