public void draw()
        {
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField(TC.get("Effect.PlaySound"));
            if (GUILayout.Button(clearImg))
            {
                musicPath = "";
                effect.setPath(musicPath);
            }
            GUILayout.Box(musicPath);
            if (GUILayout.Button(TC.get("Buttons.Select")))
            {
                MusicFileOpenDialog musicDialog =
                    (MusicFileOpenDialog)ScriptableObject.CreateInstance(typeof(MusicFileOpenDialog));
                musicDialog.Init(this, BaseFileOpenDialog.FileType.SCENE_MUSIC);
            }

            effect.setBackground(GUILayout.Toggle(effect.isBackground(), TC.get("PlaySoundEffect.BackgroundCheckBox")));
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.HelpBox(TC.get("PlaySoundEffect.Description"), MessageType.Info);
        }
Beispiel #2
0
        void ShowAssetChooser(AssetType type)
        {
            switch (type)
            {
            case AssetType.NAME_SOUND:
                MusicFileOpenDialog nameDialog =
                    (MusicFileOpenDialog)ScriptableObject.CreateInstance(typeof(MusicFileOpenDialog));
                nameDialog.Init(this, BaseFileOpenDialog.FileType.ITEM_DESCRIPTION_NAME_SOUND);
                break;

            case AssetType.BRIEF_DESCRIPTION_SOUND:
                MusicFileOpenDialog briefDialog =
                    (MusicFileOpenDialog)ScriptableObject.CreateInstance(typeof(MusicFileOpenDialog));
                briefDialog.Init(this, BaseFileOpenDialog.FileType.ITEM_DESCRIPTION_BRIEF_SOUND);
                break;

            case AssetType.DETAILED_DESCRIPTION_SOUND:
                MusicFileOpenDialog detailedOverDialog =
                    (MusicFileOpenDialog)ScriptableObject.CreateInstance(typeof(MusicFileOpenDialog));
                detailedOverDialog.Init(this, BaseFileOpenDialog.FileType.ITEM_DESCRIPTION_DETAILED_SOUND);
                break;
            }
        }
Beispiel #3
0
        void ShowAssetChooser(AssetType type)
        {
            switch (type)
            {
            case AssetType.BACKGROUND:
                ImageFileOpenDialog backgroundDialog =
                    (ImageFileOpenDialog)ScriptableObject.CreateInstance(typeof(ImageFileOpenDialog));
                backgroundDialog.Init(this, BaseFileOpenDialog.FileType.SCENE_BACKGROUND);
                break;

            case AssetType.FOREGROUND:
                ImageFileOpenDialog foregroundDialgo =
                    (ImageFileOpenDialog)ScriptableObject.CreateInstance(typeof(ImageFileOpenDialog));
                foregroundDialgo.Init(this, BaseFileOpenDialog.FileType.SCENE_FOREGROUND);
                break;

            case AssetType.MUSIC:
                MusicFileOpenDialog musicDialog =
                    (MusicFileOpenDialog)ScriptableObject.CreateInstance(typeof(MusicFileOpenDialog));
                musicDialog.Init(this, BaseFileOpenDialog.FileType.SCENE_MUSIC);
                break;
            }
        }
        void ShowAssetChooser(AssetType type)
        {
            switch (type)
            {
            case AssetType.SELECT_SLIDES:
                AnimationFileOpenDialog animationDialog =
                    (AnimationFileOpenDialog)ScriptableObject.CreateInstance(typeof(AnimationFileOpenDialog));
                animationDialog.Init(this, BaseFileOpenDialog.FileType.CUTSCENE_SLIDES);
                break;

            case AssetType.MUSIC:
                MusicFileOpenDialog musicDialog =
                    (MusicFileOpenDialog)ScriptableObject.CreateInstance(typeof(MusicFileOpenDialog));
                musicDialog.Init(this, BaseFileOpenDialog.FileType.CUTSCENE_MUSIC);
                break;

            case AssetType.VIDEOSCENE:
                VideoFileOpenDialog videoDialog =
                    (VideoFileOpenDialog)ScriptableObject.CreateInstance(typeof(VideoFileOpenDialog));
                videoDialog.Init(this, BaseFileOpenDialog.FileType.CUTSCENE_VIDEO);
                break;
            }
        }
Beispiel #5
0
        void OnGUI()
        {
            GUILayout.BeginHorizontal();

            GUILayout.Label(TC.get("Exit.ExitText"));

            GUILayout.Space(10);

            exitText = GUILayout.TextField(exitText);
            if (!exitText.Equals(exitTextLast))
            {
                OnChangeExitText(exitText);
            }

            GUILayout.EndHorizontal();


            GUILayout.Space(30);


            GUILayout.BeginHorizontal();
            if (audioPath != null && !audioPath.Equals(""))
            {
                GUILayout.Label(audioTexture);
                GUILayout.Space(5);
                GUILayout.Label(audioPath);
            }
            else
            {
                GUILayout.Label(noAudioTexture);
                GUILayout.Space(5);
                GUILayout.Label(TC.get("Conversations.NoAudio"));
            }
            if (GUILayout.Button(TC.get("Buttons.Select")))
            {
                MusicFileOpenDialog musicDialog =
                    (MusicFileOpenDialog)ScriptableObject.CreateInstance(typeof(MusicFileOpenDialog));
                musicDialog.Init(this, BaseFileOpenDialog.FileType.EXIT_MUSIC);
            }
            if (GUILayout.Button(clearTexture))
            {
                OnChangeExitAudio("");
            }
            GUILayout.EndHorizontal();


            GUILayout.BeginHorizontal();
            if (exitIconPath != null && !exitIconPath.Equals(""))
            {
                GUILayout.Label(exitTexture);
            }
            else
            {
                GUILayout.Label(defaultExitTexture);
            }
            if (GUILayout.Button(TC.get("Buttons.Select")))
            {
                ImageFileOpenDialog imageDialog =
                    (ImageFileOpenDialog)ScriptableObject.CreateInstance(typeof(ImageFileOpenDialog));
                imageDialog.Init(this, BaseFileOpenDialog.FileType.EXIT_ICON);
            }
            if (GUILayout.Button(clearTexture))
            {
                OnChangeExitText("");
            }
            GUILayout.EndHorizontal();


            GUILayout.BeginHorizontal();
            if (GUILayout.Button("OK"))
            {
                reference.OnDialogOk(textContent, this);
                this.Close();
            }
            GUILayout.EndHorizontal();
        }
Beispiel #6
0
        void OnGUI()
        {
            /*
             * Documentation area
             */
            GUILayout.BeginArea(animInfoRect);

            GUILayout.BeginVertical();
            GUILayout.Label(TC.get("Animation.Documentation"));
            GUILayout.Space(5);
            documentationTextContent = GUILayout.TextField(documentationTextContent);
            GUILayout.EndVertical();

            GUILayout.BeginVertical();
            useTransitonFlag = GUILayout.Toggle(useTransitonFlag, TC.get("Animation.UseTransitions"));
            if (useTransitonFlag != useTransitonFlagLast)
            {
                OnUseTransitonFlagLastChanged(useTransitonFlag);
            }
            slidesAnimationFlag = GUILayout.Toggle(slidesAnimationFlag, TC.get("Animation.Slides"));
            if (slidesAnimationFlag != slidesAnimationFlagLast)
            {
                OnSlidesAnimationFlagLastChanged(slidesAnimationFlag);
            }
            GUILayout.EndVertical();

            GUILayout.EndArea();

            /*
             * Transition panel
             */
            GUILayout.BeginArea(timelineRect);
            scrollPosition = GUILayout.BeginScrollView(scrollPosition, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(false), GUILayout.MaxHeight(0.25f * windowWidth));
            GUI.skin       = noBackgroundSkin;
            GUILayout.BeginHorizontal();
            for (int i = 0; i < workingAnimation.getFrames().Count; i++)
            {
                GUILayout.BeginHorizontal();
                if (selectedFrame == i)
                {
                    GUI.skin = selectedFrameSkin;
                }

                if (
                    GUILayout.Button(
                        workingAnimation.getFrames()[i].getImage(false, false, global::uAdventure.Core.Animation.ENGINE).texture, GUILayout.MaxHeight(0.2f * windowHeight), GUILayout.MaxWidth(0.2f * windowWidth)))
                {
                    OnFrameSelectionChanged(i);
                }
                GUI.skin = noBackgroundSkin;
                GUILayout.EndHorizontal();
            }
            GUI.skin = defaultSkin;
            GUILayout.EndHorizontal();
            GUILayout.EndScrollView();
            GUILayout.EndArea();


            /*
             * Transition button panel
             */
            GUILayout.BeginArea(timelineButtonsRect);
            GUILayout.BeginHorizontal();
            GUI.skin = noBackgroundSkin;
            if (GUILayout.Button(moveLeft))
            {
                workingAnimation.moveLeft(selectedFrame);
            }
            if (GUILayout.Button(clearImg))
            {
                if (selectedFrame >= 0)
                {
                    workingAnimation.removeFrame(selectedFrame);
                    selectedFrame--;
                }
            }
            if (GUILayout.Button(addTexture))
            {
                workingAnimation.addFrame(selectedFrame, null);
            }
            if (GUILayout.Button(duplicateImg))
            {
                workingAnimation.addFrame(selectedFrame, workingAnimation.getFrame(selectedFrame));
            }
            if (GUILayout.Button(moveRight))
            {
                workingAnimation.moveRight(selectedFrame);
            }
            GUI.skin = defaultSkin;
            GUILayout.EndHorizontal();
            GUILayout.EndArea();


            /*
             * Frame info panel
             */
            GUILayout.BeginArea(frameInfoRect);

            GUILayout.BeginHorizontal();
            GUILayout.Label(TC.get("Animation.Duration"));
            animationDurationString = GUILayout.TextField(animationDurationString);
            animationDurationString = (Regex.Match(animationDurationString, "^[0-9]{1,4}$").Success
                ? animationDurationString
                : animationDurationStringLast);
            if (!animationDurationString.Equals(animationDurationStringLast))
            {
                OnFrameDurationChanged(animationDurationString);
            }
            GUILayout.Space(5);
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label(TC.get("Animation.Image"));
            GUILayout.Box(imagePath, GUILayout.MinWidth(0.3f * windowWidth));
            if (GUILayout.Button(TC.get("Buttons.Select")))
            {
                ImageFileOpenDialog imageDialog =
                    (ImageFileOpenDialog)ScriptableObject.CreateInstance(typeof(ImageFileOpenDialog));
                imageDialog.Init(this, BaseFileOpenDialog.FileType.FRAME_IMAGE);
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label(TC.get("Animation.Sound"));
            GUILayout.Space(5);
            if (GUILayout.Button(clearImg))
            {
            }
            GUILayout.Box(soundPath, GUILayout.MinWidth(0.3f * windowWidth));
            if (GUILayout.Button(TC.get("Buttons.Select")))
            {
                MusicFileOpenDialog musicDialog =
                    (MusicFileOpenDialog)ScriptableObject.CreateInstance(typeof(MusicFileOpenDialog));
                musicDialog.Init(this, BaseFileOpenDialog.FileType.FRAME_MUSIC);
            }
            GUILayout.EndHorizontal();
            GUILayout.Space(20);
            GUILayout.BeginHorizontal();
            GUILayout.Label(TC.get("NextScene.Transition") + " " + TC.get("Animation.Duration"));
            transitionDurationString = GUILayout.TextField(transitionDurationString);
            transitionDurationString = (Regex.Match(transitionDurationString, "^[0-9]{1,4}$").Success
                ? transitionDurationString
                : transitionDurationStringLast);
            if (!transitionDurationString.Equals(transitionDurationStringLast))
            {
                OnTransitionDurationChanged(transitionDurationString);
            }
            GUILayout.EndHorizontal();
            GUILayout.EndArea();


            GUILayout.BeginArea(buttonRect);
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("OK"))
            {
                AnimationWriter.writeAnimation(cutscenePath, workingAnimation);
                reference.OnDialogOk("", this);
                this.Close();
            }
            if (GUILayout.Button(TC.get("GeneralText.Cancel")))
            {
                reference.OnDialogCanceled();
                this.Close();
            }
            GUILayout.EndHorizontal();
            GUILayout.EndArea();
        }