|
migueltoroh Newbie
Joined: 16 Dec 2010 Posts: 3
|
Posted: Tue Aug 30, 2022 11:49 pm
Colors for Status Window |
Hello!
I recently started using the status window and I want to assign colors.
Right now I have it like this:
Shield: @shield
Resist: @resist
Protection: @protection
See: @see
Constitution: @con
Strengthen: @stren
Infravision: @ivis
Is there a way to only color the variable?
I set the variables like this:
#VAR shield %ansi(bold,cyan)ON
etc
But it's adding the color from the variable to the next, meaning it turns @shield AND Resist: to cyan instead of only turning @shield in cyan.
Thanks for the help! |
|
|
|
chaossdragon Apprentice
Joined: 09 Apr 2008 Posts: 168
|
Posted: Wed Aug 31, 2022 12:14 am |
close your coloring with %reset()
#VAR shield %ansi(bold,cyan)ON%reset()
usually I just set my color in the status windows code and not embed in the variable, this could lead to issues with reading the variable in a trigger...
#IF (@shield == ON) {Do this} [it potentially will see the variable as '%ansi(bold,cyan)ON%reset()' and fail to match.] |
|
|
|
migueltoroh Newbie
Joined: 16 Dec 2010 Posts: 3
|
Posted: Wed Aug 31, 2022 12:48 am |
Thanks for the reply, but I couldn't find %reset in cmud.
I tried adding #IF to the status window code but now it shows this:
Shield: #IF (OFF = ON) {} {}
How do you set color in the status window code? |
|
|
|
chaossdragon Apprentice
Joined: 09 Apr 2008 Posts: 168
|
Posted: Wed Aug 31, 2022 1:37 am |
https://i.imgur.com/ectXFkQ.png
here's an example of how it looks for me... main mud window is on left, chat captures are upper right, and lower right is my tracked status variables.
Sorry it's not %reset() but %ansi(reset)...
lol seems my cmud.db file is corrupted or something as i can not launch cmud due to that file being 'access denied' and it's not... |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Wed Aug 31, 2022 1:55 pm |
XML tags might be an easier way.
More color options and self-delimiting as well.
shield=<color red>on</color>
You can use all the colors in '#HELP %colorname' or just use hexadecimal color codes. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
migueltoroh Newbie
Joined: 16 Dec 2010 Posts: 3
|
Posted: Thu Sep 01, 2022 12:00 am |
Thanks guys! The reset works perfectly!
|
|
|
|
miegorengman Wanderer
Joined: 05 Sep 2008 Posts: 53
|
Posted: Fri Sep 02, 2022 5:47 am |
to add to what shalimar suggested, you can use xml within the window itself as well as functions to specify the colors you want from there based on something hard coded or using a variable....and definitely go for the hex color option...you can match virtually any color you want. I just type "hex color picker" into google and go from there.
i keep track of certain spells bein ON/off in my status window
here is the code within my status window...
Code: |
bai: <color %if(@baiStatus="ON",#87e82c,#0cede6)>@baiStatus</color> |
so when it is on my status window should show me:
bai: ON
and when it is off
bai: off |
|
|
|
|
|