// Token: 0x0600008C RID: 140 RVA: 0x000038D7 File Offset: 0x00001AD7 public static void addColor(ColorVariable ColorVariable) { if (!ColorOptions.ColorDict2.ContainsKey(ColorVariable.identity)) { ColorOptions.ColorDict2.Add(ColorVariable.identity, ColorVariable); } }
// Token: 0x06000097 RID: 151 RVA: 0x000099C0 File Offset: 0x00007BC0 public ColorVariable(ColorVariable option) { this.identity = option.identity; this.name = option.name; this.color = option.color; this.origColor = option.origColor; this.disableAlpha = option.disableAlpha; }
// Token: 0x0600008E RID: 142 RVA: 0x0000981C File Offset: 0x00007A1C public static void LoadDict() { foreach (KeyValuePair <string, ColorVariable> keyValuePair in ColorOptions.ColorDict) { ColorVariable colorVariable; if (ColorOptions.ColorDict2.TryGetValue(keyValuePair.Key, out colorVariable)) { ColorVariable value = keyValuePair.Value; colorVariable.color = value.color; } } }
// Token: 0x06000214 RID: 532 RVA: 0x00014630 File Offset: 0x00012830 public static bool ColorButton(float width, ColorVariable color, float height = 25f) { Rect rect = GUILayoutUtility.GetRect(width, height, new GUILayoutOption[] { GUILayout.Height(height), GUILayout.Width(width) }); Drawing.DrawRect(rect, MenuComponent._OutlineBorderBlack); Rect rect2 = new Rect(rect.x + 4f, rect.y + 4f, rect.height - 8f, rect.height - 8f); bool result = GUI.Button(MenuUtilities.Inline(rect, 1f), " " + color.name, Prefab._ButtonStyle); Drawing.DrawRect(rect2, MenuComponent._OutlineBorderBlack); Drawing.DrawRect(MenuUtilities.Inline(rect2, 1f), MenuComponent._OutlineBorderLightGray); Drawing.DrawRect(MenuUtilities.Inline(rect2, 2f), color.color); return(result); }
// Token: 0x06000083 RID: 131 RVA: 0x00008BD8 File Offset: 0x00006DD8 public static void Tab() { ColorOptions.errorColor = new ColorVariable("errorColor", "#ERROR.NOTFOUND", Color.magenta, true); ColorOptions.preview = new ColorVariable("preview", "Цвет не выбран", Color.white, true); if (ColorOptions.selectedOption == null) { ColorOptions.previewselected = ColorOptions.preview; } Prefab.ScrollView(new Rect(0f, 0f, 395f, 406f), "Цвета", ref ColorsTab.ColorScroll, delegate() { GUILayout.Space(10f); List <KeyValuePair <string, ColorVariable> > list = ColorOptions.ColorDict2.ToList <KeyValuePair <string, ColorVariable> >(); list.Sort((KeyValuePair <string, ColorVariable> pair1, KeyValuePair <string, ColorVariable> pair2) => pair1.Value.name.CompareTo(pair2.Value.name)); for (int i = 0; i < list.Count; i++) { ColorVariable color = ColorUtilities.getColor(list[i].Value.identity); if (Prefab.ColorButton(350f, color, 25f)) { ColorOptions.selectedOption = color.identity; ColorOptions.previewselected = new ColorVariable(color); ColorsTab.LastColorPreview1 = color.color; } GUILayout.Space(3f); } if (Prefab.Button("Восстановить цвета", 350f, 25f)) { for (int j = 0; j < list.Count; j++) { ColorVariable color2 = ColorUtilities.getColor(list[j].Value.identity); color2.color = color2.origColor; MenuComponent.SetGUIColors(); ColorOptions.selectedOption = null; ColorsTab.LastColorPreview1 = ColorOptions.preview.color; } } GUILayout.Space(10f); }, 20); Rect previewRect = new Rect(400f, 0f, 211f, 120f); Prefab.MenuArea(previewRect, "Просмотр", delegate { Rect rect = new Rect(5f, 20f, previewRect.width - 10f, previewRect.height - 25f); Drawing.DrawRect(rect, MenuComponent._OutlineBorderBlack); Drawing.DrawRect(MenuUtilities.Inline(rect, 1f), MenuComponent._OutlineBorderLightGray); Rect rect2 = MenuUtilities.Inline(rect, 2f); Drawing.DrawRect(new Rect(rect2.x, rect2.y, rect2.width / 2f, rect2.height), ColorsTab.LastColorPreview1); Drawing.DrawRect(new Rect(rect2.x + rect2.width / 2f, rect2.y, rect2.width / 2f, rect2.height), ColorOptions.previewselected); }); Prefab.MenuArea(new Rect(previewRect.x, previewRect.y + previewRect.height + 5f, previewRect.width, 406f - previewRect.height - 5f), ColorOptions.previewselected.name, delegate { GUILayout.BeginArea(new Rect(10f, 20f, previewRect.width - 10f, 205f)); ColorOptions.previewselected.color.r = (int)((byte)Prefab.TextField(ColorOptions.previewselected.color.r, "R: ", 30, 0, 255)); ColorOptions.previewselected.color.r = (int)((byte)Prefab.Slider(0f, 255f, (float)ColorOptions.previewselected.color.r, 185)); GUILayout.FlexibleSpace(); ColorOptions.previewselected.color.g = (int)((byte)Prefab.TextField(ColorOptions.previewselected.color.g, "G: ", 30, 0, 255)); ColorOptions.previewselected.color.g = (int)((byte)Prefab.Slider(0f, 255f, (float)ColorOptions.previewselected.color.g, 185)); GUILayout.FlexibleSpace(); ColorOptions.previewselected.color.b = (int)((byte)Prefab.TextField(ColorOptions.previewselected.color.b, "B: ", 30, 0, 255)); ColorOptions.previewselected.color.b = (int)((byte)Prefab.Slider(0f, 255f, (float)ColorOptions.previewselected.color.b, 185)); GUILayout.FlexibleSpace(); if (!ColorOptions.previewselected.disableAlpha) { ColorOptions.previewselected.color.a = (int)((byte)Prefab.TextField(ColorOptions.previewselected.color.a, "A: ", 30, 0, 255)); ColorOptions.previewselected.color.a = (int)((byte)Prefab.Slider(0f, 255f, (float)ColorOptions.previewselected.color.a, 185)); } else { Prefab.TextField(ColorOptions.previewselected.color.a, "A: ", 30, 0, 255); Prefab.Slider(0f, 255f, (float)ColorOptions.previewselected.color.a, 185); } GUILayout.Space(100f); GUILayout.EndArea(); GUILayout.Space(160f); GUILayout.FlexibleSpace(); if (Prefab.Button("Снять выделение", 180f, 25f)) { ColorOptions.selectedOption = null; ColorsTab.LastColorPreview1 = ColorOptions.preview.color; } GUILayout.Space(3f); if (Prefab.Button("Восстановить", 180f, 25f)) { ColorUtilities.setColor(ColorOptions.previewselected.identity, ColorOptions.previewselected.origColor.ToColor()); ColorOptions.previewselected.color = ColorOptions.previewselected.origColor; MenuComponent.SetGUIColors(); } GUILayout.Space(3f); if (Prefab.Button("Применить", 180f, 25f)) { ColorUtilities.setColor(ColorOptions.previewselected.identity, ColorOptions.previewselected.color.ToColor()); MenuComponent.SetGUIColors(); ColorsTab.LastColorPreview1 = ColorOptions.previewselected.color; } GUILayout.Space(30f); }); }