Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Sat Mar 14, 2009 8:05 pm   

The XML scripting
 
This is the xml definition of a gauge:

Code:
<button name="c_gauge" type="Gauge" autosize="false" width="200" height="20" inset="true" toolstyle="true" transparent="false" color="#464370" textcolor="white" gaugelowcol="maroon" gaugebackcol="white" priority="2" id="16">


It has more features then the ZScript version. Is there a way to alias a gauge creation like this in a script? I would like to use text color.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Mar 16, 2009 4:36 pm   
 
Many of those button attributes cannot be adjusted in a script.

What exactly do you want to do? Change the text color of the guage within a script? Use %btncol().
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Mar 16, 2009 5:25 pm   
 
%btncol will adjust text color. You can also access many of these properties via the Lua scripting interface:
Code:
btn = zs.getbutton("c_gauge")
btn.textcol = 0x0000ff

would change the text color to red (colors are BGR instead of normal RGB). You can see all of the button properties available here: buttons

I noticed in v3.05 that there seems to be a bug that causes a button to disappear when doing the above script, and I've added that to the bug list. Resizing the window seems to bring back the buttons, so I'm not exactly sure what's happening and if there is a way within the script to also cause the button to reappear.
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Mon Mar 16, 2009 6:25 pm   
 
TY much for the solution, also that you have enabled its access Zugg.

The default color of my gauge when changed by a script to a non standard color also overwrites the text color of the gauge making the text invisible.

I will have to get over my fear of Lua to play with this cool new UI at it's fullest, but even at a glance can appreciate the change.
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Tue Apr 21, 2009 8:58 pm   
 
Zugg wrote:

Code:
btn = zs.getbutton("c_gauge")
btn.textcol = 0x0000ff

I noticed in v3.05 that there seems to be a bug that causes a button to disappear when doing the above script, and I've added that to the bug list. Resizing the window seems to bring back the buttons, so I'm not exactly sure what's happening and if there is a way within the script to also cause the button to reappear.


Still an issue in 3.06.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Apr 22, 2009 4:32 pm   
 
Yep, it is still on the bug list.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net