示例#1
0
        public void HoverResponse_without_range_has_well_formed_serialization()
        {
            var hoverResponse = new HoverResponse(
                new MarkupContent(MarkupKind.Markdown, "content"));
            var json = SerializeToLspString(hoverResponse);

            this.Assent(json, _configuration);
        }
示例#2
0
        public static void LoadSettings()
        {
            Theme.hoverResponse            = EditorPrefs.GetInt("EditorTheme-HoverResponse", 3).As <HoverResponse>();
            Theme.separatePlaymodeSettings = EditorPrefs.GetBool("EditorTheme-SeparatePlaymodeSettings", false);
            Theme.suffix     = EditorApplication.isPlayingOrWillChangePlaymode && Theme.separatePlaymodeSettings ? "-Playmode" : "";
            Theme.themeIndex = Theme.all.FindIndex(x => x.name == EditorPrefs.GetString("EditorTheme" + Theme.suffix, "Default")).Max(0);
            var theme = Theme.all[Theme.themeIndex];

            Theme.suffix       = "-" + theme.name + Theme.suffix;
            Theme.fontsetIndex = ThemeFontset.all.FindIndex(x => x.name == EditorPrefs.GetString("EditorFontset" + Theme.suffix, theme.fontset.name)).Max(0);
            Theme.paletteIndex = ThemePalette.all.FindIndex(x => x.name == EditorPrefs.GetString("EditorPalette" + Theme.suffix, theme.palette.name)).Max(0);
            Theme.skinsetIndex = ThemeSkinset.all.FindIndex(x => x.name == EditorPrefs.GetString("EditorSkinset" + Theme.suffix, theme.skinset.name)).Max(0);
            Theme.iconsetIndex = ThemeIconset.all.FindIndex(x => x.name == EditorPrefs.GetString("EditorIconset" + Theme.suffix, theme.iconset.name)).Max(0);
        }
示例#3
0
        public static void DrawOptions()
        {
            var  theme = Theme.active;
            bool open  = "Options".ToLabel().DrawFoldout("Theme.Options");

            if (EditorGUIExtension.lastChanged)
            {
                GUI.changed = false;
            }
            if (open)
            {
                EditorGUI.indentLevel += 1;
                //Theme.verticalSpacing = Theme.verticalSpacing.Draw("Vertical Spacing");
                Theme.hoverResponse            = Theme.hoverResponse.Draw("Hover Response").As <HoverResponse>();
                Theme.separatePlaymodeSettings = Theme.separatePlaymodeSettings.Draw("Separate Playmode Settings");
                if (EditorGUIExtension.lastChanged && Application.isPlaying)
                {
                    EditorPrefs.SetBool("EditorTheme-SeparatePlaymodeSettings", Theme.separatePlaymodeSettings);
                    Theme.Reset(true);
                    return;
                }
                foreach (var variant in theme.skinset.variants)
                {
                    variant.active = variant.active.Draw(variant.name);
                    if (EditorGUIExtension.lastChanged)
                    {
                        Theme.Refresh();
                        EditorPrefs.SetBool("EditorTheme-Skinset-" + variant.name + Theme.suffix, variant.active);
                    }
                }
                Theme.window.wantsMouseMove = Theme.hoverResponse != HoverResponse.None;
                EditorPrefs.SetInt("EditorTheme-HoverResponse", Theme.hoverResponse.ToInt());
                EditorPrefs.SetBool("EditorTheme-SeparatePlaymodeSettings", Theme.separatePlaymodeSettings);
                GUILayout.Space(2);
                EditorGUI.indentLevel -= 1;
            }
        }