Example #1
0
    public static void OnGUI_a( DialogPartNode node , ref DialogPartData unit , int index , ViNoTextBox textBox , ViNoTextBox nameTextBox , int viewMode )
    {
        if( ! EditorGUIUtility.isProSkin ){
                GUICommon.DrawLineSpace( 0f , 1f );
            }

            switch( viewMode ){
                case 0 : // Actions.
                    DrawActionViewMode( unit.actionID , node , ref unit , index , textBox , nameTextBox );
                    break;

                case 1: // Edit Text.
                    DrawEditTextViewMode( unit.actionID , node , ref unit , index , textBox , nameTextBox );
                    break;

        //				case 2:	// XML.
        //					DialogPartNodeInspector.DrawXMLImportField( node );
        //					break;
            }
        /*
        case 1:

            EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField ( "DIALOG_ID:" + unit.dialogID.ToString () , GUILayout.Width( 100f) );
                unit.dialogText = EditorGUILayout.TextArea( unit.dialogText , GUI.skin.textArea );

            EditorGUILayout.EndHorizontal();

            break;
        }
        //*/
    }
Example #2
0
 public static void ViewDialog( DialogPartData data , ViNoTextBox dialogTextBox , ViNoTextBox nameTextBox )
 {
     if( dialogTextBox != null ){
         dialogTextBox.SetText( data.dialogText );
     }
     if( nameTextBox != null ){
         nameTextBox.SetText( data.nameText );
     }
 }
Example #3
0
    public static void DrawActionViewMode( DialogPartNodeActionType action ,  DialogPartNode node , ref DialogPartData unit , int index , ViNoTextBox textBox , ViNoTextBox nameTextBox )
    {
        switch( action ){
            case DialogPartNodeActionType.EnterActor:
                DrawEnterActorActionsView( node , ref unit );
                break;

            case DialogPartNodeActionType.ExitActor:
                if( unit.exitActorEntries != null  && unit.exitActorEntries.Length != 0 ){
                    int actorNum = unit.exitActorEntries.Length;

                    GUILayout.BeginHorizontal();
                        GUILayout.Space( 30f );
                        string label = "";
                        for( int i=0;i<actorNum;i++){
                            label +=  unit.exitActorEntries[ i ].actorName;
                            if( i < actorNum - 1 ){
                                label += ",";
                            }
                        }
                        GUILayout.Label( label , GUILayout.Width( 100f ) );

                    GUILayout.EndHorizontal();
            }
            break;

        /*			case DialogPartNodeActionType.Selections:
                if( unit.selection == null ){
                    unit.selection = new SelectionsNode1.SelectUnit();
                }
                OnGUISelectionNode1Unit( unit.selection );
                break;

            case DialogPartNodeActionType.Scene:
                DrawLayoutSceneField( unit );
        //				break;
        //*/

            case DialogPartNodeActionType.Dialog:
                EditorGUILayout.BeginHorizontal();
                GUILayout.Space( 15f );

                GUILayout.Box( ViNoEditorResources.dialogIcon , GUILayout.Width( 30f ) ,  GUILayout.Height( 25f ) );

        /*				string subStr = ( unit.dialogText.Length > k_TextDispNum )?  unit.dialogText.Substring( 0  , k_TextDispNum ) : unit.dialogText;
                subStr += "...";
                subStr = subStr.Replace( "\n" , "" );
        //*/
        //				unit.nameText  = unit.nameText .Replace ( "\n" , "" );
        //				unit.show = EditorGUILayout.Foldout( unit.show  ,"ID_" + unit.dialogID + ":" + unit.nameText + " < " + subStr );
                if( unit.isName ){
                    if( string.IsNullOrEmpty( unit.nameText) ){
        //									unit.show = EditorGUILayout.Foldout( unit.show , subStr );
                        EditorGUILayout.LabelField( unit.dialogText );// subStr );
                    }
                    else{
        //									unit.show = EditorGUILayout.Foldout( unit.show , unit.nameText + " : " + subStr );
                        EditorGUILayout.LabelField( unit.nameText + " : " + unit.dialogText ); //subStr );
                    }
                }
                else{
        //								unit.show = EditorGUILayout.Foldout( unit.show , subStr );
                    EditorGUILayout.LabelField( unit.dialogText );//unit.nameText + " : " + subStr );
                }

                unit.isClearMessageAfter = EditorGUILayout.Toggle( unit.isClearMessageAfter ,  GUILayout.Width( 10f ) );
                EditorGUILayout.LabelField( "ClearMessage" , GUILayout.Width( 80f ) , GUILayout.Height( 20f ) );

            EditorGUILayout.EndHorizontal();

        /*			EditorGUILayout.BeginHorizontal();
                GUILayout.Space( 30f );

            EditorGUILayout.EndHorizontal();
        //*/
            break;
        }
    }
Example #4
0
    public static void DrawEditTextViewMode( DialogPartNodeActionType action , DialogPartNode node , ref DialogPartData unit , int index , ViNoTextBox textBox , ViNoTextBox nameTextBox )
    {
        //		EditorGUILayout.LabelField( unit.actionName );
        switch( action ){
            case DialogPartNodeActionType.Dialog:
                DrawLayoutNameField( unit );
                DrawLayoutDialogTextField( unit );
                break;

            default:

                DrawItemBarBackground();

                EditorGUILayout.BeginHorizontal();

                    GUILayout.Space( 15f );
        //				EditorGUILayout.SelectableLabel( action.ToString() );
                    EditorGUILayout.LabelField( "[" + action.ToString() + "]" );

                EditorGUILayout.EndHorizontal();
                break;
        }
    }
Example #5
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();
    }
Example #6
0
    /// <summary>
    /// Finds the text box objects.
    /// </summary>
    public void FindTextBoxObjects( )
    {
        SystemUIEvent system = GameObject.FindObjectOfType( typeof( SystemUIEvent ) ) as SystemUIEvent;
        if( system != null ){
            m_NameTextBox = system.GetTextBoxBy( m_NameHndName );
            m_ViNoTextBox = system.GetTextBoxBy( m_DialogHndName );
        }
        else{
            GameObject nameTextObj = GameObject.Find( m_NameHndName );
            if( nameTextObj != null ){
                m_NameTextBox = nameTextObj.GetComponent<ViNoTextBox>();
            }

            GameObject textObj = GameObject.Find( m_DialogHndName );
            if( textObj != null ){
                m_ViNoTextBox = textObj.GetComponent<ViNoTextBox>();
            }
        }
    }
Example #7
0
    public void ChangeTargetTextBox( byte id )
    {
        if( messageBoxes == null ){
            Debug.LogError( "SystemUIEvent messageBoxes Not Attached. please attach some textboxes." );
            return;
        }

        if( messageBoxes.Length <= id ){
            Debug.LogError( "SystemUIEvent Text Message Target ID error. the id : " + id.ToString() );
            return;
        }

        if( systemUIRoot != null ){
            if( ! systemUIRoot.activeInHierarchy ){
                systemUIRoot.SetActive( true );
            }
        }

        ViNoDebugger.Log( "SystemUIEvent" , "ChangeTargetTextBox :" + id);

        if( deactivePrevMessageTarget ){
            // Deactivate prev textBox.
            if( currentTextBox != null && currentTextBox != messageBoxes[ id ] ){
                currentTextBox.gameObject.SetActive( false );
            }
        }
        currentTextBox = messageBoxes[ id ];

        // Deactivate all textboxes.
        //		ShowAllTextBoxes( false );
        // or DeactiveColor.
        // DeactiveColorTextBoxes();

        // Activate Current.
        if( ! currentTextBox.gameObject.activeInHierarchy ){
            currentTextBox.gameObject.SetActive( true );
        }

        VM.Instance.m_MsgTargetTextBox = currentTextBox;
    }