|
makena Apprentice
Joined: 11 Aug 2006 Posts: 100
|
Posted: Sat Nov 25, 2006 1:45 am
Button questions |
I can imagine the answer to this post is
"Buttons can only be placed within windows."
But, How can I create a set of buttons that is shared between multiple sessions?
I multiplay and would like to have all the same buttons on all the open session windows, without having to recreate/edit the setup each time for each session window.
Hope I explained myself well enough. |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Sat Nov 25, 2006 2:22 am |
They can be inside a package, and the package is associated with a window...
|
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sat Nov 25, 2006 3:29 am |
Arminas is basically right. It works just like it did in zMUD. You create a secondary window and put your buttons in there. Put this window within a separate package file, and then load this package file with any of the other sessions that you want to have these buttons.
In the future it will probably also be possible to just place the button definitions in a published module and then enable this module in whatever window you want to have the buttons. But I'm not sure if this works yet. |
|
|
|
The Raven Magician
Joined: 13 Oct 2000 Posts: 463
|
Posted: Mon Nov 27, 2006 7:37 pm |
Zugg, is there any way to discover the package name of the active session window? Or of the first window with a command line... or the window where a command is issued from... etc. Because if you can find out the active session's package name, you could have a separate module create the buttons it needs to in the settings of the main window.
Even if a better method is found for buttons, being able to discover the name of the main session (or sessions, if multiple MUDs are open at once... it might return a list|of|sessions) will be very important if people start sharing Modules. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Nov 27, 2006 10:04 pm |
You shouldn't need to know the package name...the package name is just the name of the *.pkg file that stuff is stored in, and that filename might change if the user makes a copy of a package. What you are looking for is the name of the window (remember that a window is a module, so this is the name of the module). And you can already get this using the %curwin variable. That gives you the name of the window that currently has keyboard focus.
|
|
|
|
The Raven Magician
Joined: 13 Oct 2000 Posts: 463
|
Posted: Tue Nov 28, 2006 1:58 am |
Thanks Zugg!
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Nov 28, 2006 3:31 pm |
I created a button in a module earlier that was in a different package to the main session window, and it displayed on the main session window just fine. Is that not supposed to work? I like it that way.
EDIT: Scratch that. It worked in 1.16, it doesn't in 1.17. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Nov 28, 2006 5:50 pm |
Fang, nothing should have changed in 1.17 to affect buttons, so maybe you can post the exact button that works in 1.16 but doesn't work in 1.17.
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Nov 28, 2006 6:01 pm |
I just created a new button with the name test and presto, it appeared at the top of the window. Gave it the command "#echo blah" to see if it worked, and pressing it sent the output to that window.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Nov 28, 2006 6:17 pm |
OK, I'm still confused. You said that it wasn't working in 1.17. And yet your last post seemed to indicate that it *is* working. Maybe I'm just brain-dead today, but can you give me a bit more detail and what is working and what isn't?
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Nov 28, 2006 7:48 pm |
Creating a button in a module in a separate package made it show up at the top of the main session window in 1.16. It doesn't in 1.17. I liked it when it did.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Nov 28, 2006 8:02 pm |
I know, that's what you said before. The problem is that I just don't believe it. Do you still have 1.16 on your system? Can you give me an exact step-by-step procedure for creating a button in another package that works in 1.16 and doesn't work in 1.17.
The problem is that the fixes added to 1.17 have nothing to do with buttons. The changes were very simple and only involved importing *.MUD files, user-defined functions, and pre-defined events. Nothing in those fixes should have made any difference to package or buttons. So I think it was probably already broken in 1.16. But maybe you can give me the exact procedure you used to make it work in 1.16. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Nov 28, 2006 10:02 pm |
I still had the installer for 1.16, so I installed it in a different folder to see if it works. It does. Here's how:
1) Load CMUD
2) Hit Esc
3) Click "Settings" on the toolbar to open the Package Editor.
4) Click the dropdown part of the "New" box and select module. Name it TestMod
5) Select the module so new settings are created in it.
6) Click New again but choose "Button"
7) Type in a name. Presto, your button appears! Here's a screenie. Here's the same thing done again in 1.17. No button this time. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Nov 29, 2006 1:18 am |
OK, I installed 1.16 to test this mystery. When I follow your steps, I don't get any button! And your screen shot looks just like mine, except mine doesn't have any button.
I don't know what is going on here.
OK, here is something strange...drag the button from the TestMod module into the Untitled window. Then it appears. Then drag it back to TestMod...it still appears. See if this works on 1.17.
Edited: confirmed that dragging it back and forth does the same thing on 1.17.
My guess is that there is something uninitialized that is causing the button to not be displayed the first time sometimes. |
|
|
|
ecourt Apprentice
Joined: 29 Dec 2000 Posts: 146 Location: USA
|
Posted: Thu Nov 30, 2006 9:48 pm |
I ran into this as well --
created button
Armor
toggle
Armor OFF -- Button color RED
Armor ON -- button color default
variable barmor
The first time in a session I type #var baromor 1, tbe button changes to depressed, but still shows "Armor OFF" -- Also when the button is in 0 (Armor OFF) -- it should show red -- sometimes it does, sometimes it don't -- then sometimes it displays both in RED.
Also something I thought odd -- If I change the variable name, or the value, The save button never becomes active.
edit:: I think I figured that last bit out -- if I go in and change something in the button, the save button doesn't become active, I exit , and my changes weren't saved.
oh boy -- and more --
when creating a new state for a button through the gui, the text seems to be ignored
crated a new button --
state 0 BEER
state 1 BeeR (background color blue)
variable bbeer
I can change the button by pressing or changing the variable, to pressed, and unpressed, but I never get the blue, and I never get the alternate text.
BTW :: My first button (armor) was create from command line
#BUTTON armor {Armor OFF} {} {Armor ON} {} {} {1} {} {} {} {} {} {} {} {124} {} {} {} "" {Inset} {} {armor} |
|
Last edited by ecourt on Thu Nov 30, 2006 10:14 pm; edited 2 times in total |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Nov 30, 2006 9:56 pm |
I read somewhere that multistate buttons aren't working yet - I'm not sure if this counts for toggles too.
|
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Thu Nov 30, 2006 11:58 pm |
No... Toggles are working but they are not refreshing. This means that you don't SEE that they are changing. Also Yes if you change a value in the button options the save button does not highlight. And, Yes changing some of the values save the button automatically and changing some of the values does not.
Also, If you disable and emediately enable any class it will refresh the buttons and redraw them. Making them change colors/text. This is NOT a good idea however it slows down everything.
I have posted all of this in other threads... |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed Dec 06, 2006 10:26 pm |
I thought for some reason that the bug I reported above was fixed, but it's still happening in 1.19. Just thought I'd update.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Dec 06, 2006 11:32 pm |
Nope, there were no button changes in 1.19. Probably no button changes in 1.20 either (focusing on multiple characters right now). Hopefully 1.21 will be RC1 and will have the button fixes.
|
|
|
|
|
|