client/New()
..()
var/obj/clay/c=new
screen+=c
clayref=c
client/proc
updatefiregui()
var/x=text2num(winget(src,"default.heat" ,"text"))
winset(src,"default.heatlabel" ,"text=[round(x)]%")
var/icon/clay=icon(clayref.icon,clayref.icon_state)
if(x>oldheat)
var/y=round(x-oldheat)
clay.Blend(rgb(y,0,0),ICON_ADD)
Debug("->Fire RGB added [y]")
else
var/y=round(oldheat-x)
clay.Blend(rgb(y,0,0),ICON_SUBTRACT)
Debug("->Fire RGB removed [y]")
oldheat=x
Debug("Fire GUI updated")
Problem description:
Alright, I have this code, and it's not blending the red in rgb(). I have a similar code which works just fine.
client/proc
updateoxygui()
var/x=text2num(winget(src,"default.oxy" ,"text"))
winset(src,"default.oxylabel" ,"text=[round(x)]%")
var/icon/clay=icon(clayref.icon,clayref.icon_state)
if(x>oldoxygen)
var/y=round(x-oldoxygen)
clay.Blend(rgb(y,y,y),ICON_SUBTRACT)
Debug("->Oxygen RGB added [rgb(y,y,y)]")
else
var/y=round(oldoxygen-x)
clay.Blend(rgb(y,y,y),ICON_ADD)
Debug("->Oxygen RGB removed [rgb(y,y,y)]")
oldoxygen=x
clayref.icon=clay
Debug("Oxygen GUI updated")
Am I just doing something wrong?
I trust you can follow the rest. =)