var/const/canCastStyle = {"
body {
color:green;
}
"}
var/const/cantCastStyle = {"
body {
color:red;
}
"}
Player
proc
updateSpellPanel()
var/count = 0
for(var/Spell/spell in contents)
if(!istype(spell)) continue
var/style
if(spell.canCast(src))
style = canCastStyle
else
style = cantCastStyle
winset(src,"spellGrid","current-cell=[++count]")
winset(src,"spellGrid","style=[style]")
src << output(spell, "spellGrid")
winset(src,"spellGrid","cells=[count]")
EDIT: Just realized that I probably should have posted this under "Code Problems". Sorry.