void DrawMarkDownInspector()
		{
			GUI.enabled = true;
			if (_markdownGui == null)
			{
				_markdownGui = new MarkdownGUI();
				_markdownGui.ProcessSource
					(
						Utils.GetFileContents
							(
								AssetDatabase.GetAssetPath(target)
							)
					);
				_markdownGui.ProcessSource
					(
						Utils.GetFileContents
						(
						AssetDatabase.GetAssetPath(target)
						)
						);
			}

			_scroll = GUILayout.BeginScrollView(_scroll);
			
			if ( _markdownGui.OnGUILayout_MardkDownTextArea())
			{
				//Debug.Log("hello");
				Repaint();
			}

			GUILayout.EndScrollView();
		}
        public override void OnInspectorGUI()
        {
            ChangeLog _target = target as ChangeLog;

            EditorGUILayout.Separator();

            if (_target.RequestEditingFlag)
            {
                EditorGUILayout.LabelField("Are you sure?");
                Repaint();
            }
            //EditorGUILayout.LabelField("Current Version",_target.CurrentVersion .ToString());

            if (_currentLogEntry.Text==null)
            {
                _currentLogEntry.Version = new VersionInfo();
                _currentLogEntry.Text = "";
            }

            _currentLogEntry.Text = GUILayout.TextField(_currentLogEntry.Text,500,GUILayout.Height(200));

            if (GUILayout.Button("Save"))
            {
                if (ArrayUtility.Contains<ChangeLogEntry>(_target.Log,_currentLogEntry))
                {
                    EntryMarkDownGuiLUT[_currentLogEntry].ProcessSource(_currentLogEntry.Text);
                    Repaint();
                    return;
                    //ArrayUtility. <ChangeLogEntry>(ref _target.Log,_currentLogEntry);
                }else{
                    ArrayUtility.Insert<ChangeLogEntry>(ref _target.Log,0,_currentLogEntry);
                }
                EditorUtility.SetDirty(_target);
            }

            foreach(ChangeLogEntry entry in _target.Log)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label("Version "+entry.Version.ToShortString());
                GUILayout.FlexibleSpace();

                if(GUILayout.Button("Edit"))
                {
                    _currentLogEntry = entry;
                    Repaint();
                }

                if (GUILayout.Button("Delete"))
                {
                    ArrayUtility.Remove<ChangeLogEntry>(ref _target.Log,entry);
                    EditorUtility.SetDirty(_target);
                    return;
                }

                GUILayout.EndHorizontal();

                if (!EntryMarkDownGuiLUT.ContainsKey(entry))
                {
                    MarkdownGUI _mdGui = new MarkdownGUI();
                    _mdGui.ProcessSource(entry.Text);

                    EntryMarkDownGuiLUT.Add(entry,_mdGui);
                }

                EntryMarkDownGuiLUT[entry].OnGUILayout_MardkDownTextArea();
            }

            //EditorGUILayout.BeginHorizontal();
            //GUILayout.FlexibleSpace();
            /*
            if (!_markdownGui.HasContent)
            {
                _target.processedContent =	_markdownGui.ProcessSource(_target.content);
            //	Debug.Log(_target.processedContent);
            }

            _markdownGui.OnGUILayout_MardkDownTextArea();

            //EditorGUILayout.EndHorizontal();
            */
        }
Exemplo n.º 3
0
        void OnGUI_Disclaimer()
        {
            GUILayout.BeginVertical();

            if ( _disclaimerMarkdownGUI == null )
            {
                _disclaimerMarkdownGUI = new MarkdownGUI() ;
                _disclaimerMarkdownGUI.ProcessSource(_disclaimer_label);
                _disclaimerMarkdownGUI.UserGuiSkin(GUI.skin);

            }

            _disclaimerMarkdownGUI.OnGUILayout_MardkDownTextArea("Label Medium");

            GUILayout.Label(_disclaimer_license_label,"Label FinePrint");

            GUILayout.BeginHorizontal();
                if ( GUILayout.Button("Learn more (online)","Button",GUILayout.Width(200)) )
                {

                    Help.BrowseURL(__REST_URL_BASE__+ "link/wiki");
                }

                GUILayout.FlexibleSpace();

                if ( GUILayout.Button(_youtubeQuickIntroGUIContent,"Button",GUILayout.Width(200)) )
                {
                    Help.BrowseURL(__REST_URL_BASE__+ "youtube/intro");
                }

            GUILayout.EndHorizontal();

                GUILayout.Space(5);

                if (!_disclaimer_pass)
                {
                    if ( GUILayout.Button("Use the ecosystem!","Button Green") )
                    {
                        _disclaimer_pass = true;
                        //Debug.Log(_disclaimerPass_key+"-"+Application.dataPath);
                        EditorPrefs.SetBool(_disclaimerPass_key+"-"+Application.dataPath,true);

                    }
                }else{
                    if ( GUILayout.Button("Back to the Browser","Button") )
                    {
                        ShowDisclaimer = false;

                    }
                }

                GUILayout.FlexibleSpace();

                GUILayout.BeginVertical("Box");

                    GUILayout.BeginHorizontal();
                        GUILayout.FlexibleSpace();
                        GUILayout.Label("Repositories services used by the Ecosystem");

                        GUILayout.FlexibleSpace();
                    GUILayout.EndHorizontal();
                    GUILayout.BeginHorizontal();

                        GUISkin _currentSkin = GUI.skin;
                        GUI.skin = EcosystemSkin;
                        GUILayout.FlexibleSpace();
                        if( GUILayout.Button("","Snipt Logo") )
                        {
                            Application.OpenURL("https://snipt.net/");
                        }
                        GUILayout.FlexibleSpace();
                        if (GUILayout.Button("","Github Logo") )
                        {
                            Application.OpenURL("https://github.com/");
                        }
                        GUI.skin = _currentSkin;
                        GUILayout.FlexibleSpace();
                    GUILayout.EndHorizontal();
                GUILayout.EndVertical();

                    GUILayout.FlexibleSpace();

                    GUILayout.BeginHorizontal();
                    if( GUILayout.Button("","Label UI Kit Credit") )
                    {
                        Application.OpenURL("http://www.killercreations.co.uk/volcanic-ui-kit.php");
                    }
                    GUILayout.FlexibleSpace();
                    if (GUILayout.Button("","Label Jean Fabre Url") )
                    {
                        Application.OpenURL("http://hutonggames.com/playmakerforum/index.php?action=profile;u=33");
                    }
                GUILayout.EndHorizontal();

            GUILayout.EndVertical();
        }