예제 #1
0
        public TextScriptEditor(string Text)
        {
            InitializeComponent();

            DicScripts         = CutsceneScriptHolder.LoadAllScripts();
            txtTextScript.Text = Text;
        }
예제 #2
0
        public DialogEditor()
        {
            InitializeComponent();

            foreach (KeyValuePair <string, List <CutsceneScript> > ActiveScripts in CutsceneScriptHolder.GetScriptsByCategory())
            {
                ListBox NewScriptListBox = new ListBox();

                NewScriptListBox.Dock = DockStyle.Fill;
                NewScriptListBox.FormattingEnabled = true;
                NewScriptListBox.Location          = new Point(0, 0);
                NewScriptListBox.Name         = "lst" + ActiveScripts.Key;
                NewScriptListBox.Size         = new Size(248, 243);
                NewScriptListBox.TabIndex     = 4;
                NewScriptListBox.DoubleClick += new EventHandler(lstChoices_DoubleClick);
                NewScriptListBox.Items.AddRange(ActiveScripts.Value.ToArray());

                TabPage NewScriptTab = new TabPage();
                NewScriptTab.Controls.Add(NewScriptListBox);
                NewScriptTab.Location = new Point(4, 22);
                NewScriptTab.Name     = "tab" + ActiveScripts.Key;
                NewScriptTab.Size     = new Size(248, 243);
                NewScriptTab.TabIndex = 4;
                NewScriptTab.Text     = ActiveScripts.Key;
                NewScriptTab.UseVisualStyleBackColor = true;

                tabControl1.Controls.Add(NewScriptTab);
            }
        }
예제 #3
0
        private void CutsceneEditor_Shown(object sender, EventArgs e)
        {
            foreach (KeyValuePair <string, List <CutsceneScript> > ActiveScripts in CutsceneScriptHolder.GetScriptsByCategory())
            {
                ListBox NewScriptListBox = new ListBox();

                NewScriptListBox.Dock = DockStyle.Fill;
                NewScriptListBox.FormattingEnabled = true;
                NewScriptListBox.Location          = new Point(0, 0);
                NewScriptListBox.Name         = "lst" + ActiveScripts.Key;
                NewScriptListBox.Size         = new Size(248, 243);
                NewScriptListBox.TabIndex     = 4;
                NewScriptListBox.DoubleClick += new EventHandler(lstChoices_DoubleClick);
                NewScriptListBox.Items.AddRange(ActiveScripts.Value.ToArray());

                TabPage NewScriptTab = new TabPage();
                NewScriptTab.Controls.Add(NewScriptListBox);
                NewScriptTab.Location = new Point(4, 22);
                NewScriptTab.Name     = "tab" + ActiveScripts.Key;
                NewScriptTab.Size     = new Size(248, 243);
                NewScriptTab.TabIndex = 4;
                NewScriptTab.Text     = ActiveScripts.Key;
                NewScriptTab.UseVisualStyleBackColor = true;

                tabControl1.Controls.Add(NewScriptTab);
            }

            if (cutsceneViewer.ActiveCutscene.DicCutsceneScript.Count == 0)
            {
                cutsceneViewer.ActiveCutscene.DicCutsceneScript = CutsceneScriptHolder.LoadAllScripts();
            }

            cutsceneViewer.ActiveCutscene.Load();
            cutsceneViewer.Init(SelectScript);
        }
예제 #4
0
        private void LoadCutscene(string CutscenePath)
        {
            string Name = CutscenePath.Substring(0, CutscenePath.Length - 4).Substring(18);

            this.Text = Name + " - Project Eternity Cutscene Editor";

            ActiveCutscene            = new Cutscene(null, Name, CutsceneScriptHolder.LoadAllScripts());
            ActiveCutscene.IsInEditor = true;
        }
예제 #5
0
        public override void Load()
        {
            if (PlayerRoster == null)
            {
                PlayerRoster = new Roster();
                PlayerRoster.LoadRoster();
            }

            base.Load();
            if (!IsServer)
            {
                LoadPreBattleMenu();
            }
            LoadMap();
            LoadMapAssets();
            LoadDeathmatchAIScripts();

            Dictionary <string, CutsceneScript> DeathmatchMapScripts = CutsceneScriptHolder.LoadAllScripts(typeof(DeathmatchMapCutsceneScriptHolder), this);

            foreach (CutsceneScript ActiveListScript in DeathmatchMapScripts.Values)
            {
                DicCutsceneScript.Add(ActiveListScript.Name, ActiveListScript);
            }

            SpiritMenu = new SpiritMenu(this);
            if (!IsServer)
            {
                SpiritMenu.Load();
            }

            BattleMapMenu = new MapMenu(this);
            if (!IsServer)
            {
                BattleMapMenu.Load(Content, FMODSystem);
            }

            UnitDeploymentScreen = new UnitDeploymentScreen(PlayerRoster);
            if (!IsServer)
            {
                UnitDeploymentScreen.Load(Content);
            }

            NonDemoScreen = new NonDemoScreen(this);
            if (!IsServer)
            {
                NonDemoScreen.Load();

                fntArial12 = Content.Load <SpriteFont>("Fonts/Arial12");
                fntArial16 = Content.Load <SpriteFont>("Fonts/Arial16");
            }
        }
예제 #6
0
        public override void Load()
        {
            base.Load();
            sprArrowUp = Content.Load <Texture2D>("Sorcerer Street/Ressources/Arrow Up");
            sprEndTurn = Content.Load <Texture2D>("Sorcerer Street/Ressources/End Turn");

            LoadMap();
            LoadMapAssets();

            Dictionary <string, CutsceneScript> ConquestScripts = CutsceneScriptHolder.LoadAllScripts(typeof(SorcererStreetMapCutsceneScriptHolder), this);

            foreach (CutsceneScript ActiveListScript in ConquestScripts.Values)
            {
                DicCutsceneScript.Add(ActiveListScript.Name, ActiveListScript);
            }

            OnNewTurn();
        }
예제 #7
0
        private void CutsceneEditor_Shown(object sender, EventArgs e)
        {
            if (ActiveCutscene.DicCutsceneScript.Count == 0)
            {
                ActiveCutscene.DicCutsceneScript = CutsceneScriptHolder.LoadAllScripts();
            }

            ActiveCutscene.Load();
            panDrawingSurface_Resize(sender, e);
            for (int S = 0; S < ActiveCutscene.DicActionScript.Count; S++)
            {
                InitScript(ActiveCutscene.DicActionScript[S]);
            }

            for (int D = 0; D < ActiveCutscene.ListDataContainer.Count; D++)
            {
                InitScript(ActiveCutscene.ListDataContainer[D]);
            }
        }
예제 #8
0
        private void LoadScripts()
        {
            ScriptingScriptHolder CoreScripts = new ScriptingScriptHolder();
            KeyValuePair <string, List <CutsceneScript> > NewScripts = CoreScripts.GetNameAndContent();

            foreach (CutsceneScript ActiveListScript in NewScripts.Value)
            {
                DicCutsceneScript.Add(ActiveListScript.Name, ActiveListScript);
            }
            VisualNovelCutsceneScriptHolder VNScripts = new VisualNovelCutsceneScriptHolder();
            KeyValuePair <string, List <CutsceneScript> > NewVNScripts = VNScripts.GetNameAndContent();

            foreach (CutsceneScript ActiveListScript in NewVNScripts.Value)
            {
                DicCutsceneScript.Add(ActiveListScript.Name, ActiveListScript);
            }

            Dictionary <string, CutsceneScript> BattleMapScripts = CutsceneScriptHolder.LoadAllScripts(typeof(BattleMapCutsceneScriptHolder), this);

            foreach (CutsceneScript ActiveListScript in BattleMapScripts.Values)
            {
                DicCutsceneScript.Add(ActiveListScript.Name, ActiveListScript);
            }
        }
예제 #9
0
        public override void Load()
        {
            fntFinlanderFont   = Content.Load <SpriteFont>("Fonts/Finlander Font");
            fntMultiDialogFont = Content.Load <SpriteFont>("Fonts/VisualNovelMultiDialogFont");

            LeftPosition  = new Vector2(0, Constants.Height - VNBoxHeight);
            RightPosition = new Vector2(Constants.Width, Constants.Height - VNBoxHeight);

            if (VisualNovelPath != null)
            {
                FileStream   FS = new FileStream("Content/Visual Novels/" + VisualNovelPath + ".pevn", FileMode.Open, FileAccess.Read);
                BinaryReader BR = new BinaryReader(FS, Encoding.UTF8);
                BR.BaseStream.Seek(0, SeekOrigin.Begin);

                #region Assets

                int CharacterCount = BR.ReadInt32();
                for (int C = 0; C < CharacterCount; C++)
                {
                    ListCharacter.Add(new VisualNovelCharacter(BR));
                }

                int BustCharacterCount = BR.ReadInt32();
                for (int i = 0; i < BustCharacterCount; i++)
                {
                    ListBustPortrait.Add(new SimpleAnimation(BR, Content, "Visual Novels/Bust Portraits/"));
                }

                int PortraitCharacterCount = BR.ReadInt32();
                for (int i = 0; i < PortraitCharacterCount; i++)
                {
                    ListPortrait.Add(new SimpleAnimation(BR, Content, "Visual Novels/Portraits/"));
                }

                int BackgroundCount = BR.ReadInt32();//Number of backgrounds.
                for (int i = 0; i < BackgroundCount; i++)
                {
                    string Name = BR.ReadString();
                    string Path = BR.ReadString();
                    ListBackground.Add(new VisualNovelBackground(Name, Path, Content.Load <Texture2D>("Visual Novels/Backgrounds/" + Path)));
                }

                #endregion

                #region Dialog

                int ListDialogCount = BR.ReadInt32();//Number of script.
                for (int D = 0; D < ListDialogCount; D++)
                {
                    //Base info.
                    int PositionX = BR.ReadInt32();
                    int PositionY = BR.ReadInt32();

                    //Get the index of the assets used.
                    int LeftCharacterIndex           = BR.ReadInt32();
                    int LeftCharacterPortraitIndex   = BR.ReadInt32();
                    int RightCharacterIndex          = BR.ReadInt32();
                    int RightCharacterPortraitIndex  = BR.ReadInt32();
                    int TopCharacterIndex            = BR.ReadInt32();
                    int TopCharacterPortraitIndex    = BR.ReadInt32();
                    int BottomCharacterIndex         = BR.ReadInt32();
                    int BottomCharacterPortraitIndex = BR.ReadInt32();
                    int BackgroundIndex = BR.ReadInt32();

                    //Init the assets.

                    #region Left Character

                    SimpleAnimation LeftCharacter;
                    if (LeftCharacterIndex > 0)
                    {
                        if (LeftCharacterPortraitIndex <= ListCharacter[LeftCharacterIndex - 1].LoadedCharacter.ArrayPortraitBustPath.Length)
                        {
                            string ActivePortraitName = ListCharacter[LeftCharacterIndex - 1].LoadedCharacter.ArrayPortraitBustPath[LeftCharacterPortraitIndex - 1];
                            string PortraitType       = "Bust Portraits";
                            string FullName           = PortraitType + "/" + ActivePortraitName;

                            LeftCharacter = new SimpleAnimation(ActivePortraitName, ActivePortraitName, Content.Load <Texture2D>("Visual Novels/" + FullName));
                        }
                        else
                        {
                            LeftCharacter = new SimpleAnimation(ListBustPortrait[LeftCharacterPortraitIndex - ListCharacter[LeftCharacterIndex - 1].LoadedCharacter.ArrayPortraitBustPath.Length - 1]);
                        }
                    }
                    else if (LeftCharacterIndex == 0 && LeftCharacterPortraitIndex > 0)
                    {
                        LeftCharacter = new SimpleAnimation(ListBustPortrait[LeftCharacterPortraitIndex - 1]);
                    }
                    else
                    {
                        LeftCharacter = null;
                    }

                    if (LeftCharacter != null)
                    {
                        if (LeftCharacter.IsAnimated)
                        {
                            LeftCharacter = new SimpleAnimation(LeftCharacter.Name, LeftCharacter.Path, new AnimationLooped(LeftCharacter.Path));
                            LeftCharacter.Load(Content, "");
                        }

                        if (LeftCharacterIndex > 0)
                        {
                            LeftCharacter.Path = ListCharacter[LeftCharacterIndex - 1].LoadedCharacter.FullName;
                        }
                    }

                    #endregion

                    #region Right Character

                    SimpleAnimation RightCharacter;
                    if (RightCharacterIndex > 0)
                    {
                        if (RightCharacterPortraitIndex <= ListCharacter[RightCharacterIndex - 1].LoadedCharacter.ArrayPortraitBustPath.Length)
                        {
                            string ActivePortraitName = ListCharacter[RightCharacterIndex - 1].LoadedCharacter.ArrayPortraitBustPath[RightCharacterPortraitIndex - 1];
                            string PortraitType       = "Bust Portraits";
                            string FullName           = PortraitType + "/" + ActivePortraitName;

                            RightCharacter = new SimpleAnimation(ActivePortraitName, ActivePortraitName, Content.Load <Texture2D>("Visual Novels/" + FullName));
                        }
                        else
                        {
                            RightCharacter = new SimpleAnimation(ListBustPortrait[RightCharacterPortraitIndex - ListCharacter[RightCharacterIndex - 1].LoadedCharacter.ArrayPortraitBustPath.Length - 1]);
                        }
                    }
                    else if (RightCharacterIndex == 0 && RightCharacterPortraitIndex > 0)
                    {
                        RightCharacter = new SimpleAnimation(ListBustPortrait[RightCharacterPortraitIndex - 1]);
                    }
                    else
                    {
                        RightCharacter = null;
                    }

                    if (RightCharacter != null)
                    {
                        if (RightCharacter.IsAnimated)
                        {
                            RightCharacter = new SimpleAnimation(RightCharacter.Name, RightCharacter.Path, new AnimationLooped(RightCharacter.Path));
                            RightCharacter.Load(Content, "");
                        }

                        if (RightCharacterIndex > 0)
                        {
                            RightCharacter.Path = ListCharacter[RightCharacterIndex - 1].LoadedCharacter.FullName;
                        }
                    }

                    #endregion

                    #region Top Character

                    SimpleAnimation TopCharacter;

                    if (TopCharacterIndex > 0)
                    {
                        if (TopCharacterPortraitIndex <= ListCharacter[TopCharacterIndex - 1].LoadedCharacter.ArrayPortraitBoxPath.Length)
                        {
                            string ActivePortraitName = ListCharacter[TopCharacterIndex - 1].LoadedCharacter.ArrayPortraitBoxPath[TopCharacterPortraitIndex - 1];
                            string PortraitType       = "Portraits";
                            string FullName           = PortraitType + "/" + ActivePortraitName;

                            TopCharacter = new SimpleAnimation(ActivePortraitName, ActivePortraitName, Content.Load <Texture2D>("Visual Novels/" + FullName));
                        }
                        else
                        {
                            TopCharacter = new SimpleAnimation(ListPortrait[TopCharacterPortraitIndex - ListCharacter[TopCharacterIndex - 1].LoadedCharacter.ArrayPortraitBoxPath.Length - 1]);
                        }
                    }
                    else if (TopCharacterIndex == 0 && TopCharacterPortraitIndex > 0)
                    {
                        TopCharacter = new SimpleAnimation(ListPortrait[TopCharacterPortraitIndex - 1]);
                    }
                    else
                    {
                        TopCharacter = null;
                    }

                    if (TopCharacter != null)
                    {
                        if (TopCharacter.IsAnimated)
                        {
                            TopCharacter = new SimpleAnimation(TopCharacter.Name, TopCharacter.Path, new AnimationLooped(TopCharacter.Path));
                            TopCharacter.Load(Content, "");
                        }

                        if (TopCharacterIndex > 0)
                        {
                            TopCharacter.Path = ListCharacter[TopCharacterIndex - 1].LoadedCharacter.FullName;
                        }
                    }

                    #endregion

                    #region Bottom Character

                    SimpleAnimation BottomCharacter;

                    if (BottomCharacterIndex > 0)
                    {
                        if (BottomCharacterPortraitIndex <= ListCharacter[BottomCharacterIndex - 1].LoadedCharacter.ArrayPortraitBoxPath.Length)
                        {
                            string ActivePortraitName = ListCharacter[BottomCharacterIndex - 1].LoadedCharacter.ArrayPortraitBoxPath[BottomCharacterPortraitIndex - 1];
                            string PortraitType       = "Portraits";
                            string FullName           = PortraitType + "/" + ActivePortraitName;

                            BottomCharacter = new SimpleAnimation(ActivePortraitName, ActivePortraitName, Content.Load <Texture2D>("Visual Novels/" + FullName));
                        }
                        else
                        {
                            BottomCharacter = new SimpleAnimation(ListPortrait[BottomCharacterPortraitIndex - ListCharacter[BottomCharacterIndex - 1].LoadedCharacter.ArrayPortraitBoxPath.Length - 1]);
                        }
                    }
                    else if (BottomCharacterIndex == 0 && BottomCharacterPortraitIndex > 0)
                    {
                        BottomCharacter = new SimpleAnimation(ListPortrait[BottomCharacterPortraitIndex - 1]);
                    }
                    else
                    {
                        BottomCharacter = null;
                    }

                    if (BottomCharacter != null)
                    {
                        if (BottomCharacter.IsAnimated)
                        {
                            BottomCharacter = new SimpleAnimation(BottomCharacter.Name, BottomCharacter.Path, new AnimationLooped(BottomCharacter.Path));
                            BottomCharacter.Load(Content, "");
                        }

                        if (BottomCharacterIndex > 0)
                        {
                            BottomCharacter.Path = ListCharacter[BottomCharacterIndex - 1].LoadedCharacter.FullName;
                        }
                    }

                    #endregion

                    VisualNovelBackground Back;
                    if (BackgroundIndex > 0)
                    {
                        Back = ListBackground[BackgroundIndex - 1];
                    }
                    else
                    {
                        Back = null;
                    }

                    int ActiveChar       = BR.ReadByte();
                    int ActiveTopChar    = BR.ReadByte();
                    int ActiveBottomChar = BR.ReadByte();

                    //Load the texts.
                    string Text        = BR.ReadString();
                    string TextPreview = BR.ReadString();
                    string TextTop     = BR.ReadString();
                    bool   OverrideCharacterPriority = BR.ReadBoolean();

                    //Init the Dialog.
                    Dialog NewDialog = new Dialog(LeftCharacter, RightCharacter, TopCharacter, BottomCharacter, Back, (Dialog.ActiveBustCharacterStates)ActiveChar, Text, TextPreview);
                    NewDialog.TopPortaitVisibleState    = (Dialog.PortaitVisibleStates)ActiveTopChar;
                    NewDialog.BottomPortaitVisibleState = (Dialog.PortaitVisibleStates)ActiveBottomChar;
                    NewDialog.TextTop  = TextTop;
                    NewDialog.Position = new Point(PositionX, PositionY);

                    NewDialog.OverrideCharacterPriority = OverrideCharacterPriority;
                    if (OverrideCharacterPriority)
                    {
                        int ListSpeakerPriorityCount = BR.ReadInt32();
                        for (int S = 0; S < ListSpeakerPriorityCount; ++S)
                        {
                            NewDialog.ListSpeakerPriority.Add(new SpeakerPriority((SpeakerPriority.PriorityTypes)BR.ReadByte(), BR.ReadString()));
                        }
                    }

                    //Add its linked dialogs.
                    int LinkedDialogsSize = BR.ReadInt32();
                    for (int L = 0; L < LinkedDialogsSize; L++)
                    {
                        NewDialog.ListNextDialog.Add(BR.ReadInt32());
                    }
                    ListDialog.Add(NewDialog);

                    //Check if it's a Timeline Dialog.
                    if (PositionX == 0)
                    {
                        Timeline.Add(NewDialog);
                    }

                    Dictionary <string, CutsceneScript> Scripts = CutsceneScriptHolder.LoadAllScripts();

                    NewDialog.CutsceneBefore = new Cutscene(null, BR, Scripts);
                    NewDialog.CutsceneAfter  = new Cutscene(null, BR, Scripts);
                }

                #endregion

                BR.Close();
                FS.Close();
            }
            if (Timeline.Count > 0)
            {
                Timeline.Sort(delegate(Dialog d1, Dialog d2) { return(d1.Position.Y.CompareTo(d2.Position.Y)); });
                CurrentDialog = Timeline[0];
                UpdateTextChoices();

                if (CurrentDialog.CutsceneBefore != null)
                {
                    PushScreen(CurrentDialog.CutsceneBefore);
                }
            }

            if (UseLocalization)
            {
                ReadLocalizationFile();
            }
        }