Started playing around with GUI's in Mudlet, good stuff. Got some gauges together, health, willpower etc (this is in Aetolia), and they all work fine and dandy. Next I got the bright idea of a visual limb damage tracker, so I created a series of gauges to look like a head, torso, arms and legs and grouped them together to make this nice little stick figure type deal, all went fine. Next I went ahead and coded the damage tracker which is working marvelously, but here is the hitch in this giddy-up: I can't get the gauges to change color. Here is what I am using for the gauges:
function create_torso_green()
move_man_y = 550
move_man_x = 1200
createGauge("opptorso", 0, 0, 0, 0, "", "green")
moveGauge("opptorso", move_man_x,move_man_y+42)
resizeGauge("opptorso", 40,60)
setGaugeStyleSheet("opptorso", [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #00ff00, stop: 0.1 #00ff00, stop: 0.49 #00ff00, stop: 0.5 #00ff00, stop: 1 #00ff00);
border-top: 1px black solid;
border-left: 1px black solid;
border-bottom: 1px black solid;
border-radius: 7;
padding: 3px;]],
[[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bd3333, stop: 0.1 #bd2020, stop: 0.49 #990000, stop: 0.5 #700000, stop: 1 #990000);
border-width: 1px;
border-color: black;
border-style: solid;
border-radius: 7;
padding: 3px;]])
createLabel("oppparrytorso",50,50,10,10,0);
setTextFormat("oppparrytorso", 25,25,25, 255,255,255, 0,0,0 )
setBackgroundColor("oppparrytorso",0,0,0,0)
echoUserWindow("oppparrytorso", "<center><font color=\"black\">Torso</font></center>")
moveWindow("oppparrytorso", move_man_x,move_man_y+42)
resizeWindow("oppparrytorso",40,60)
end
function create_torso_yellow()
move_man_y = 550
move_man_x = 1200
createGauge("opptorso", 0, 0, 0, 0, "", "green")
moveGauge("opptorso", move_man_x,move_man_y+42)
resizeGauge("opptorso", 40,60)
setGaugeStyleSheet("opptorso", [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffff00, stop: 0.1 #ffff00, stop: 0.49 #ffff00, stop: 0.5 #ffff00, stop: 1 #ffff00);
border-top: 1px black solid;
border-left: 1px black solid;
border-bottom: 1px black solid;
border-radius: 7;
padding: 3px;]],
[[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bd3333, stop: 0.1 #bd2020, stop: 0.49 #990000, stop: 0.5 #700000, stop: 1 #990000);
border-width: 1px;
border-color: black;
border-style: solid;
border-radius: 7;
padding: 3px;]])
createLabel("oppparrytorso",50,50,10,10,0);
setTextFormat("oppparrytorso", 25,25,25, 255,255,255, 0,0,0 )
setBackgroundColor("oppparrytorso",0,0,0,0)
echoUserWindow("oppparrytorso", "<center><font color=\"black\">Torso</font></center>")
moveWindow("oppparrytorso", move_man_x,move_man_y+42)
resizeWindow("oppparrytorso",40,60)
end
function create_torso_orange()
move_man_y = 550
move_man_x = 1200
createGauge("opptorso", 0, 0, 0, 0, "", "green")
moveGauge("opptorso", move_man_x,move_man_y+42)
resizeGauge("opptorso", 40,60)
setGaugeStyleSheet("opptorso", [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ff9900, stop: 0.1 #ff9900, stop: 0.49 #ff9900, stop: 0.5 #ff9900, stop: 1 #ff9900);
border-top: 1px black solid;
border-left: 1px black solid;
border-bottom: 1px black solid;
border-radius: 7;
padding: 3px;]],
[[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bd3333, stop: 0.1 #bd2020, stop: 0.49 #990000, stop: 0.5 #700000, stop: 1 #990000);
border-width: 1px;
border-color: black;
border-style: solid;
border-radius: 7;
padding: 3px;]])
createLabel("oppparrytorso",50,50,10,10,0);
setTextFormat("oppparrytorso", 25,25,25, 255,255,255, 0,0,0 )
setBackgroundColor("oppparrytorso",0,0,0,0)
echoUserWindow("oppparrytorso", "<center><font color=\"black\">Torso</font></center>")
moveWindow("oppparrytorso", move_man_x,move_man_y+42)
resizeWindow("oppparrytorso",40,60)
end
function create_torso_red()
move_man_y = 550
move_man_x = 1200
createGauge("opptorso", 0, 0, 0, 0, "", "green")
moveGauge("opptorso", move_man_x,move_man_y+42)
resizeGauge("opptorso", 40,60)
setGaugeStyleSheet("opptorso", [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ff0000, stop: 0.1 #ff0000, stop: 0.49 #ff0000, stop: 0.5 #ff0000, stop: 1 #ff0000);
border-top: 1px black solid;
border-left: 1px black solid;
border-bottom: 1px black solid;
border-radius: 7;
padding: 3px;]],
[[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bd3333, stop: 0.1 #bd2020, stop: 0.49 #990000, stop: 0.5 #700000, stop: 1 #990000);
border-width: 1px;
border-color: black;
border-style: solid;
border-radius: 7;
padding: 3px;]])
createLabel("oppparrytorso",50,50,10,10,0);
setTextFormat("oppparrytorso", 25,25,25, 255,255,255, 0,0,0 )
setBackgroundColor("oppparrytorso",0,0,0,0)
echoUserWindow("oppparrytorso", "<center><font color=\"black\">Torso</font></center>")
moveWindow("oppparrytorso", move_man_x,move_man_y+42)
resizeWindow("oppparrytorso",40,60)
end
I know some of the names in there are weird, but originally it was going to track parrying, but seeing how you don't actually see someone parrying, it quickly became obsolete and is now my damage tracker. Now I have a separate script for each limb, and then in each script I am using the same function but four times, one for a green counter and one for yellow, orange and red. Green of course is a healthy limb, yellow is level 1 damage orange level 2 and red being critical damage. I worked everything in for the left arm just to get things going and it works, but it quits working after a while and sometimes it will make the torso yellow for a second and glitch out. What I am figuring is that I am actually layering gauges on top of each other since I am not deleting the previous gauge before the new one is called and mudlet doesn't like this. I've searched around but can't figure out how to make a single gauge that will just change colour based on the value of a variable. If anyone has any ideas how to do this, please let me know!