static public void DrawDialogListUtil(DialogPartNode node)
    {
        GUICommon.DrawLineSpace(10f, 5f);

        ViNoEditorUtil.BeginGUIColor(Color.green, GUI.backgroundColor, GUI.contentColor);            //Color.black , Color.white );

        GUILayout.BeginHorizontal();

//			GUILayout.Space( Screen.width/2f );

        if (GUILayout.Button("+"))
        {
//			if( GUILayout.Button( ViNoEditorResources.plusIcon ) ){
//				node.AddData( new DialogPartData() );// AddData( node );
//				Debug.Log( "Register Scene Undo");
            Undo.RegisterUndo(node, node.name);
//					 Undo.SetSnapshotTarget( node , node.name );

            int itemNum = node.GetMessageNum();
            node.AddItemAt(itemNum);
            node.ReAssignDialogIDsInThisObject();
        }

        if (GUILayout.Button("-"))
        {
//			if( GUILayout.Button( ViNoEditorResources.minusIcon ) ){//} , GUILayout.Width( sa ) ) ){
            Undo.RegisterUndo(node, node.name);
//				if( EditorUtility.DisplayDialog( "Remove the Last Item ?" , "Are you sure you really want to remove?"
//					, "Yes", "Cancel" ) ){
            if (node.dlgDataList != null && node.dlgDataList.Count > 0)
            {
                node.dlgDataList.RemoveAt(node.dlgDataList.Count - 1);
            }
            node.ReAssignDialogIDsInThisObject();
//				}
        }

        GUILayout.EndHorizontal();

        ViNoEditorUtil.EndGUIColor();
    }
Пример #2
0
    // ViewMode 0 : Actions 1 : Edit Text.
    public static void DrawDialogItemBar( DialogPartNode node , ref DialogPartData unit , int index ,
												 ViNoTextBox textBox , ViNoTextBox nameTextBox )
    {
        #if true
            DrawItemBarBackground();
        #else
            EditorGUIUtility.LookLikeInspector();
        #endif

        EditorGUILayout.BeginHorizontal();
            unit.active = EditorGUILayout.Toggle( unit.active , GUILayout.Width( 10f ) );

        #if true
            EditorGUILayout.LabelField( "ID_" + unit.dialogID , GUILayout.Width( 42f ) );
        //*/
            unit.actionID = (DialogPartNodeActionType)EditorGUILayout.EnumPopup( unit.actionID , GUILayout.Width( 100f ) );

            if( node != null ){

        //			if( unit.actionID != DialogPartNodeActionType.ClearScene ){
                if( GUILayout.Button( "Edit" , GUILayout.Width( 40f ) ) ){
                    DialogItemInspector browser = EditorWindow.GetWindow( typeof(DialogItemInspector) ) as DialogItemInspector;
                    browser.InitWith( node , index );
                }
        //			}
        }

            switch( unit.actionID){
                case DialogPartNodeActionType.Dialog:
        //					unit.show = EditorGUILayout.Foldout( unit.show , "" );
                    break;
            }

        /*			if( GUILayout.Button( "View" , GUILayout.Width( 40f ) ) ){
                DialogPartNodeUtility.ViewDialog( unit , textBox , nameTextBox  );
                DialogPartNodeUtility.ViewScene( unit );
            }
        //*/

        #else
        //			EditorGUILayout.LabelField( "ID_" + unit.dialogID , GUILayout.Width( 42f ) );
        #endif
        /////////////////////////
        #if true

                if( GUILayout.Button( "+" , GUILayout.Width( 25f ) ) ){
                    node.AddItemAt( index + 1 );
                    node.ReAssignDialogIDsInThisObject();
                }

                if( GUILayout.Button( "-" , GUILayout.Width( 25f ) ) ){
                    if( EditorUtility.DisplayDialog( "Remove Item at ID_" + index.ToString() + " ?" , "Are you sure you really want to remove?"
                        , "Yes", "Cancel" ) ){
                        node.RemoveItemAt( index );
                        node.ReAssignDialogIDsInThisObject();
                    }
                }
        #else
        //			unit.show = EditorGUILayout.Foldout( unit.show , "_" );

        EditorGUILayout.BeginHorizontal();
            GUILayout.Space( 15f );
            unit.isName = EditorGUILayout.Toggle(  unit.isName , GUILayout.Width( 10f ) );
            EditorGUILayout.LabelField( "Name" , GUILayout.Width(40f ) , GUILayout.Height( 20f ) );
            if( unit.isName ){
                unit.nameText = EditorGUILayout.TextField( unit.nameText , GUI.skin.textArea, GUILayout.Width(75f ) , GUILayout.Height(20f));
            }

            unit.dialogText = EditorGUILayout.TextArea( unit.dialogText , GUI.skin.textArea );

            DrawBGMPopupField( node ,  unit );
            DrawSEPopupField( node ,  unit );
            DrawVoicePopupField( node ,  unit );

        EditorGUILayout.EndHorizontal();

        #endif

        EditorGUILayout.EndHorizontal();
    }
Пример #3
0
    public static void DrawDialogListUtil( DialogPartNode node )
    {
        GUICommon.DrawLineSpace( 10f , 5f );

        ViNoEditorUtil.BeginGUIColor( Color.green , GUI.backgroundColor , GUI.contentColor );//Color.black , Color.white );

        GUILayout.BeginHorizontal();

        //			GUILayout.Space( Screen.width/2f );

            if( GUILayout.Button( "+" ) ){
        //			if( GUILayout.Button( ViNoEditorResources.plusIcon ) ){
        //				node.AddData( new DialogPartData() );// AddData( node );
        //				Debug.Log( "Register Scene Undo");
                Undo.RegisterUndo ( node , node.name );
        //					 Undo.SetSnapshotTarget( node , node.name );

                int itemNum = node.GetMessageNum();
                node.AddItemAt( itemNum );
                node.ReAssignDialogIDsInThisObject();
            }

            if( GUILayout.Button( "-" ) ){
        //			if( GUILayout.Button( ViNoEditorResources.minusIcon ) ){//} , GUILayout.Width( sa ) ) ){
                Undo.RegisterUndo ( node , node.name );
        //				if( EditorUtility.DisplayDialog( "Remove the Last Item ?" , "Are you sure you really want to remove?"
        //					, "Yes", "Cancel" ) ){
                    if( node.dlgDataList != null && node.dlgDataList.Count > 0 ){
                        node.dlgDataList.RemoveAt( node.dlgDataList.Count - 1 );
                    }
                    node.ReAssignDialogIDsInThisObject();
        //				}
            }

        GUILayout.EndHorizontal();

        ViNoEditorUtil.EndGUIColor();
    }
Пример #4
0
    // ViewMode 0 : Actions 1 : Edit Text.
    static public void DrawDialogItemBar(DialogPartNode node, ref DialogPartData unit, int index,
                                         ViNoTextBox textBox, ViNoTextBox nameTextBox)
    {
#if true
        DrawItemBarBackground();
#else
        EditorGUIUtility.LookLikeInspector();
#endif

        EditorGUILayout.BeginHorizontal();
        unit.active = EditorGUILayout.Toggle(unit.active, GUILayout.Width(10f));

#if true
        EditorGUILayout.LabelField("ID_" + unit.dialogID, GUILayout.Width(42f));
//*/
        unit.actionID = (DialogPartNodeActionType)EditorGUILayout.EnumPopup(unit.actionID, GUILayout.Width(100f));

        if (node != null)
        {
//			if( unit.actionID != DialogPartNodeActionType.ClearScene ){
            if (GUILayout.Button("Edit", GUILayout.Width(40f)))
            {
                DialogItemInspector browser = EditorWindow.GetWindow(typeof(DialogItemInspector)) as DialogItemInspector;
                browser.InitWith(node, index);
            }
//			}
        }

        switch (unit.actionID)
        {
        case DialogPartNodeActionType.Dialog:
//					unit.show = EditorGUILayout.Foldout( unit.show , "" );
            break;
        }

/*			if( GUILayout.Button( "View" , GUILayout.Width( 40f ) ) ){
 *                              DialogPartNodeUtility.ViewDialog( unit , textBox , nameTextBox  );
 *                              DialogPartNodeUtility.ViewScene( unit );
 *                      }
 * //*/
#else
//			EditorGUILayout.LabelField( "ID_" + unit.dialogID , GUILayout.Width( 42f ) );
#endif
/////////////////////////
#if true
        if (GUILayout.Button("+", GUILayout.Width(25f)))
        {
            node.AddItemAt(index + 1);
            node.ReAssignDialogIDsInThisObject();
        }

        if (GUILayout.Button("-", GUILayout.Width(25f)))
        {
            if (EditorUtility.DisplayDialog("Remove Item at ID_" + index.ToString() + " ?", "Are you sure you really want to remove?"
                                            , "Yes", "Cancel"))
            {
                node.RemoveItemAt(index);
                node.ReAssignDialogIDsInThisObject();
            }
        }
#else
//			unit.show = EditorGUILayout.Foldout( unit.show , "_" );

        EditorGUILayout.BeginHorizontal();
        GUILayout.Space(15f);
        unit.isName = EditorGUILayout.Toggle(unit.isName, GUILayout.Width(10f));
        EditorGUILayout.LabelField("Name", GUILayout.Width(40f), GUILayout.Height(20f));
        if (unit.isName)
        {
            unit.nameText = EditorGUILayout.TextField(unit.nameText, GUI.skin.textArea, GUILayout.Width(75f), GUILayout.Height(20f));
        }

        unit.dialogText = EditorGUILayout.TextArea(unit.dialogText, GUI.skin.textArea);

        DrawBGMPopupField(node, unit);
        DrawSEPopupField(node, unit);
        DrawVoicePopupField(node, unit);

        EditorGUILayout.EndHorizontal();
#endif

        EditorGUILayout.EndHorizontal();
    }