public Aparence(Aparence toClone) { topCornerLeft = toClone.topCornerLeft; topCornerRight = toClone.topCornerRight; topCenter = toClone.topCenter; border = toClone.border; font = toClone.font; }
public static void Command(string[] command, Shell shell, CommandStructure value) { switch (command.Length) { case 1: if (command [0] == "help") { Help(shell, value); value.correct = true; } else { for (int i = 0; i < aparences.Length; ++i) { if (command [0] == aparences [i].Name) { Apply(shell, aparences [i].aparence); value.correct = true; return; } } Help(shell, value); } break; case 4: float r, g, b; Color c; try { r = float.Parse(command[1]); g = float.Parse(command[2]); b = float.Parse(command[3]); c = new Color(r / 255f, g / 255f, b / 255f); } catch { Help(shell, value); return; } for (int i = 0; i < aparences.Length; ++i) { if (command [0] == aparences[i].Name) { Aparence a = new Aparence(aparences [i].aparence, c, c, Color.black); //TODO add back to parameter Apply(shell, a); value.correct = true; return; } } break; default: Help(shell, value); break; } }
public Aparence(Aparence toClone, Color frame, Color text, Color background) { topCornerLeft = toClone.topCornerLeft; topCornerRight = toClone.topCornerRight; topCenter = toClone.topCenter; border = toClone.border; font = toClone.font; borderColor = frame; textColor = text; backgroundColor = background; }
/// <summary> /// Changes the shell theme. /// </summary> public void ChangeTheme(Aparence a) { topCornerLeft.sprite = a.topCornerLeft; topCornerRight.sprite = a.topCornerRight; topCenter.sprite = a.topCenter; borderTopLeft.sprite = a.border; borderTopRight.sprite = a.border; borderRight.color = a.borderColor; borderLeft.color = a.borderColor; borderBottom.color = a.borderColor; backgroundBody.color = a.backgroundColor; headerText.color = a.textColor; bodyText.color = a.textColor; headerText.font = a.font; bodyText.font = a.font; RaiseEventFull(OnChangeTheme, name); }
public static void Apply(Shell shell, Aparence at) { shell.ChangeTheme(at); }