Beispiel #1
0
        public AdvImportScenarioSheet(StringGrid original, AdvSettingDataManager dataManager, AdvMacroManager macroManager) : base(original.Name, original.SheetName, original.Type)
        {
            this.entityIndexTbl = new List <int>();
            this.entityDataList = new List <AdvEntityData>();
            base.headerRow      = original.HeaderRow;
            for (int i = 0; i < original.DataTopRow; i++)
            {
                base.AddRow(original.Rows[i].Strings);
            }
            List <StringGridRow> outputList = new List <StringGridRow>();

            foreach (StringGridRow row in original.Rows)
            {
                if (((row.RowIndex >= original.DataTopRow) && !row.IsEmptyOrCommantOut) && !macroManager.TryMacroExpansion(row, outputList, string.Empty))
                {
                    outputList.Add(row);
                }
            }
            foreach (StringGridRow row2 in outputList)
            {
                string[] strings;
                if (AdvEntityData.ContainsEntitySimple(row2))
                {
                    string[] strArray2;
                    if (AdvEntityData.TryCreateEntityStrings(row2, new Func <string, object>(dataManager.DefaultParam.GetParameter), out strArray2))
                    {
                        AdvEntityData item = new AdvEntityData(row2.Strings);
                        strings = strArray2;
                        this.entityDataList.Add(item);
                        this.entityIndexTbl.Add(base.Rows.Count);
                    }
                    else
                    {
                        strings = row2.Strings;
                    }
                }
                else
                {
                    strings = row2.Strings;
                }
                StringGridRow row3 = base.AddRow(strings);
                row3.DebugIndex = row2.DebugIndex;
                row3.DebugInfo  = row2.DebugInfo;
            }
            base.InitLink();
        }
Beispiel #2
0
        //インポート用の文字列グリッドを作成
        public AdvImportScenarioSheet(StringGrid original, AdvSettingDataManager dataManager, AdvMacroManager macroManager)
            : base(original.Name, original.SheetName, original.Type)
        {
            //ヘッダー(最初の一行目のはず)は、オリジナルを使う
            this.headerRow = original.HeaderRow;
            for (int i = 0; i < original.DataTopRow; ++i)
            {
                this.AddRow(original.Rows[i].Strings);
            }

            //マクロ展開
            List <StringGridRow> rowList = new List <StringGridRow>();

            foreach (StringGridRow row in original.Rows)
            {
                if (row.RowIndex < original.DataTopRow)
                {
                    continue;                                                           //データの行じゃない
                }
                if (row.IsEmptyOrCommantOut)
                {
                    continue;                                                           //データがない
                }
                //マクロ展開
                bool isMacro = macroManager.TryMacroExpansion(row, rowList, "");
                if (!isMacro)
                {
                    //マクロ展開がないので、普通に行を追加
                    rowList.Add(row);
                }
            }

            //データ部分はマクロ展開済みのもの
            foreach (var row in rowList)
            {
                StringGridRow data;

                string[] strings;
                //マクロの場合はエンティテイ処理のチェック
                //将来的にはマクロ展開抜きでいけそう
                if (AdvEntityData.ContainsEntitySimple(row))
                {
                    //エンティティ処理がある場合はそれをリストにいれてインデックスを
                    string[] entityStrings;
                    if (AdvEntityData.TryCreateEntityStrings(row, dataManager.DefaultParam.GetParameter, out entityStrings))
                    {
                        AdvEntityData entityData = new AdvEntityData(row.Strings);
                        strings = entityStrings;
                        entityDataList.Add(entityData);
                        entityIndexTbl.Add(this.Rows.Count);
                    }
                    else
                    {
                        strings = row.Strings;
                    }
                }
                else
                {
                    strings = row.Strings;
                }
                data            = this.AddRow(strings);
                data.DebugIndex = row.DebugIndex;
                data.DebugInfo  = row.DebugInfo;
            }
            this.InitLink();
        }
Beispiel #3
0
 public StringGridRowMacroed(StringGridRow row, AdvEntityData entityData)
 {
     this.row        = row;
     this.entityData = entityData;
 }
Beispiel #4
0
        //一ページ内のコマンド処理
        IEnumerator CoStartPage(AdvScenarioLabelData labelData, AdvScenarioPageData pageData, AdvCommand returnToCommand, bool skipPageHeaer)
        {
            if (pageData.CheckSkipByLocalize())
            {
                yield break;
            }

            int        index   = skipPageHeaer ? pageData.IndexTextTopCommand : 0;
            AdvCommand command = pageData.GetCommand(index);

            if (returnToCommand != null)
            {
                while (command != returnToCommand)
                {
                    command = pageData.GetCommand(++index);
                }
            }

            //復帰直後はIf内分岐は無効
            if (IfManager.OldSaveDataStart)
            {
                index   = pageData.GetIfSkipCommandIndex(index);
                command = pageData.GetCommand(index);
            }

            //ページ冒頭の状態をセーブデータとして記憶
            if (EnableSaveOnPageTop() && pageData.EnableSave)
            {
                SkipPageHeaerOnSave = false;
                Engine.SaveManager.UpdateAutoSaveData(Engine);
            }
            //システムパラメーターの変更があった場合にシステムセーブデータとして記憶
            CheckSystemDataWriteIfChanged();

            while (command != null)
            {
                if (command.IsEntityType)
                {
                    //エンティティコマンドの場合は、コマンドを作り直して差し替え
                    command = AdvEntityData.CreateEntityCommand(command, Engine, pageData);
                }

                //ifスキップチェック
                if (IfManager.CheckSkip(command))
                {
                    if (ScenarioPlayer.DebugOutputLog)
                    {
                        Debug.Log("Command If Skip: " + command.GetType() + " " + labelData.ScenarioLabel + ":" + pageData.PageNo);
                    }
                    command = pageData.GetCommand(++index);
                    continue;
                }

                currentCommand = command;
                //ロード
                command.Load();

                //テキスト表示開始時におけるオートセーブ
                if (EnableSaveTextTop() && pageData.EnableSaveTextTop(command))
                {
                    SkipPageHeaerOnSave = true;
                    //オートセーブデータ作成
                    Engine.SaveManager.UpdateAutoSaveData(Engine);
                    //システムパラメーターの変更があった場合にシステムセーブデータとして記憶
                    CheckSystemDataWriteIfChanged();
                }

                //ロード待ち
                while (!command.IsLoadEnd())
                {
                    IsLoading = true;
                    yield return(null);
                }
                IsLoading = false;

                //コマンド実行
                command.CurrentTread = this;
                if (ScenarioPlayer.DebugOutputLog)
                {
                    Debug.Log("Command : " + command.GetType() + " " + labelData.ScenarioLabel + ":" + pageData.PageNo);
                }
                ScenarioPlayer.OnBeginCommand.Invoke(command);
                command.DoCommand(Engine);

                //コマンド実行後にファイルをアンロード
                command.Unload();
                command.CurrentTread = null;

                while (ScenarioPlayer.IsPausing)
                {
                    yield return(null);
                }
                //コマンドの処理待ち
                while (true)
                {
                    command.CurrentTread = this;
                    ScenarioPlayer.OnUpdatePreWaitingCommand.Invoke(command);
                    if (!command.Wait(Engine))
                    {
                        break;
                    }
                    if (ScenarioPlayer.DebugOutputWaiting)
                    {
                        Debug.Log("Wait..." + command.GetType());
                    }
                    ScenarioPlayer.OnUpdateWaitingCommand.Invoke(command);
                    command.CurrentTread = null;
                    yield return(null);
                }
                command.CurrentTread = this;
                if (ScenarioPlayer.DebugOutputCommandEnd)
                {
                    Debug.Log("End :" + command.GetType() + " " + labelData.ScenarioLabel + ":" + pageData.PageNo);
                }
                ScenarioPlayer.OnEndCommand.Invoke(command);
                command.CurrentTread = null;

                Engine.UiManager.IsInputTrig       = false;
                Engine.UiManager.IsInputTrigCustom = false;

                if (IsBreakCommand)
                {
                    yield break;
                }
                command = pageData.GetCommand(++index);
            }
        }