Comparing color tables and GUIStyle
Posted: Wed Nov 04, 2015 5:48 am
Greetings,
I would like to know the following:
1. How would I be able to compare the current player color with a color table of my own (granted my own table has the full rgba).
eg.
2. What is the best way to iterate through my table ?
eg.
3. I have no idea how to work with guistyle.
I created this:
However, whenever I try and use it in my code, it gives me an error stating that my_label doesn't exist... Can someone please explain this to me ? The wiki of guistyle only states the properties, but doesn't give a default value, min/max value, or any form of example of implementation.
4. I tried doing inline styles, and it will tell me that the key value doesn't exist
eg.
I would like to know the following:
1. How would I be able to compare the current player color with a color table of my own (granted my own table has the full rgba).
eg.
Code: Select all
if (game.player.color == mycolors.white || game.local_player.color == mycolors.white) then
--#change player color
eg.
Code: Select all
If (game.player.color in mycolors) then
--#true/false
I created this:
Code: Select all
data.raw["gui-style"].default["my_label"] =
{
type="label_style",
parent="label_style",
color={r=1,g=1,b=1},
fontcolor={r=0,g=0,b=0}
}
Code: Select all
path["flow"..ii].add({type="label",name="label"..ii, caption="caption", stype="my_label"})
4. I tried doing inline styles, and it will tell me that the key value doesn't exist
eg.
Code: Select all
player.gui.top.frame["flow"..ii]["label"..ii].style.fontcolor = {r=1,g=1,b=1}