-
Notifications
You must be signed in to change notification settings - Fork 17
Color System
David edited this page Dec 2, 2017
·
1 revision
The bot has a centralized color system. Internally it is accessed through the global g_Color variable. In scripting, it's accessed through the Color() function.
Color.ToHex(long): converts the numeric value of a color to its #RRGGBB equivalent.
Color.FromHex(string): converts a #RRGGBB string to a numeric value.
Color.List(): displays all of the custom colors in the main chat window
Color.Load(string): loads color information from the specified file (INI or SCLF)
Color.Save(string): saves the color information to the specified file (in INI format)
- Add private field and public GET/LET properties to the clsColor class.
- Set a default value for the color in the LoadDefaults() method.
- Load the color from the configuration in the LoadINI sub-function.
- Add the color to the clsColor.List() method.
- Add the color to the frmSettings UI by putting it in the LoadColors() method and the SaveColors() method. It is very important that it goes in the same relative spot in each method or the entire color system will be messed up.
- If it is a color used on frmChat it needs to be added to the frmChat.SetFormColors() method.
- Add a public GET property to the clsColor class. Have the property always return the static value (as a Long) of the color.