|
Orang Apprentice
Joined: 22 Jul 2004 Posts: 118 Location: USA
|
Posted: Tue Aug 05, 2008 3:46 pm
Button resizing |
I made this button for a script, and it works fine, except for it won't fit the button ID on it completely. I looked at the help but it doesn't really explain how to do this. I just want it to be resized enough to fit the id on there. Here's the code:
Code: |
#alias buttonchange {#if (@isStealthOn = 0) {#unbutton 1;#gag;#button 1 Width100 {Stealth~: off} {stealth}} {#unbutton 1;#gag;#button 1 Width100 {Stealth~: on} {nostealth}}} {} |
Thank you. |
|
|
|
Toxic Adept
Joined: 27 May 2008 Posts: 299
|
Posted: Tue Aug 05, 2008 4:20 pm |
Edit the button in the PE and change the dimensions of it.
|
|
|
|
Toxic Adept
Joined: 27 May 2008 Posts: 299
|
Posted: Tue Aug 05, 2008 4:23 pm |
hmm Just do this...
#BUTTON 1 {Stealth~: %if(@isStealthOn,on,off)}
Thats untested, but Im assuming it would work.
There is no need to delete and remake your button just to change the value of it. |
|
|
|
Orang Apprentice
Joined: 22 Jul 2004 Posts: 118 Location: USA
|
Posted: Tue Aug 05, 2008 9:10 pm |
Thanks. That worked
|
|
|
|
Orang Apprentice
Joined: 22 Jul 2004 Posts: 118 Location: USA
|
Posted: Tue Aug 05, 2008 9:16 pm |
But how do I change the width of it so it can fit "Stealth: off"? (that is, how do I do that from the #button command, not the PE).
Thanks again. |
|
|
|
Toxic Adept
Joined: 27 May 2008 Posts: 299
|
Posted: Tue Aug 05, 2008 9:17 pm |
why do you need to do it from the #BUTTON command? theres no reason to make this button via script... Make it in the package editor with that value and let it stay... It should change depending on the state of @isStealthOn
|
|
|
|
Orang Apprentice
Joined: 22 Jul 2004 Posts: 118 Location: USA
|
Posted: Tue Aug 05, 2008 9:19 pm |
Toxic wrote: |
why do you need to do it from the #BUTTON command? theres no reason to make this button via script... Make it in the package editor with that value and let it stay... It should change depending on the state of @isStealthOn |
Because this is part of a much larger script that I have saved as a .txt file. |
|
|
|
Toxic Adept
Joined: 27 May 2008 Posts: 299
|
Posted: Tue Aug 05, 2008 9:21 pm |
As a txt file? Are you writing this for CMUD? because you can't import .txt files into cmud.
|
|
|
|
Orang Apprentice
Joined: 22 Jul 2004 Posts: 118 Location: USA
|
Posted: Tue Aug 05, 2008 9:23 pm |
Yes you can. Click on editor, open file, then click "send". I do it all the time.
|
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Wed Aug 06, 2008 2:47 am |
Well, using that way you can't use most of the new CMUD features, since they are only available in the XML... Why not use XML for your script?
|
|
|
|
Orang Apprentice
Joined: 22 Jul 2004 Posts: 118 Location: USA
|
Posted: Wed Aug 06, 2008 2:51 am |
I have now idea even how to begin learning XML.
Plus I didn't know it was that important to know it. |
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Wed Aug 06, 2008 3:15 am |
It's not important to know it. You don't need to know it. (In CMUD) it's just a method of storing settings. But you can export to it and import from it and it will contain other propeties of settings that are not in the txt file.
|
|
|
|
Orang Apprentice
Joined: 22 Jul 2004 Posts: 118 Location: USA
|
Posted: Wed Aug 06, 2008 3:19 am |
How do I use it?
|
|
|
|
Toxic Adept
Joined: 27 May 2008 Posts: 299
|
Posted: Wed Aug 06, 2008 1:46 pm |
Create your settings in cmud then highlight and right click and chose export selection to xml (or something like that, forgot exact wording). Then if you want to look at it, get something like notepad++ to view it. But if your just trying to distribute to others... send it out in that form and they can import it via file/import xml.
|
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Wed Aug 06, 2008 3:56 pm |
Or you can even use standard notepad (but it's not as good).
|
|
|
|
|
|