Skip to content
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.

In the code

Color class

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)

Adding a configurable color

  1. Add private field and public GET/LET properties to the clsColor class.
  2. Set a default value for the color in the LoadDefaults() method.
  3. Load the color from the configuration in the LoadINI sub-function.
  4. Add the color to the clsColor.List() method.
  5. 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.
  6. If it is a color used on frmChat it needs to be added to the frmChat.SetFormColors() method.

Adding a static color

  1. Add a public GET property to the clsColor class. Have the property always return the static value (as a Long) of the color.
Clone this wiki locally