Пример #1
0
        //マクロ処理した行データを取得
        public List <StringGridRow> MakeMacroRows(StringGridRow args)
        {
            List <StringGridRow> list = new List <StringGridRow>();

            if (DataList.Count <= 0)
            {
                return(list);
            }

            StringGrid macroGrid = DataList[0].Grid;
            string     gridName  = args.Grid.Name + ":" + (args.RowIndex + 1).ToString() + "-> Macro : " + macroGrid.Name;
            StringGrid grid      = new StringGrid(gridName, args.Grid.SheetName, macroGrid.Type);

            grid.Macro          = new StringGrid.MacroInfo(args);
            grid.ColumnIndexTbl = macroGrid.ColumnIndexTbl;
            List <int> ignoreIndexArray = AdvParser.CreateMacroOrEntityIgnoreIndexArray(grid);

            for (int i = 0; i < DataList.Count; ++i)
            {
                StringGridRow macroData = DataList[i].Clone(() => (grid));
                macroData.Macro(args, Header, ignoreIndexArray);
                list.Add(macroData);
            }
            return(list);
        }
Пример #2
0
        public AdvCommandSprite(StringGridRow row, AdvSettingDataManager dataManager)
        {
            this.spriteName = AdvParser.ParseCell <string>(row, AdvColumnName.Arg1);
            string fileName = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Arg2, spriteName);

            if (!dataManager.TextureSetting.ContainsLabel(fileName))
            {
                Debug.LogError(row.ToErrorString(fileName + " is not contained in file setting"));
            }

            this.file      = AddLoadFile(dataManager.TextureSetting.LabelToFilePath(fileName));
            this.layerName = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Arg3, "");
            if (!string.IsNullOrEmpty(layerName) && !dataManager.LayerSetting.Contains(layerName, AdvLayerSettingData.LayerType.Sprite))
            {
                Debug.LogError(row.ToErrorString(layerName + " is not contained in layer setting"));
            }

            //表示位置
            float x;

            if (AdvParser.TryParseCell <float>(row, AdvColumnName.Arg4, out x))
            {
                this.x = x;
            }
            float y;

            if (AdvParser.TryParseCell <float>(row, AdvColumnName.Arg5, out y))
            {
                this.y = y;
            }
            //フェード時間
            this.fadeTime = AdvParser.ParseCellOptional <float>(row, AdvColumnName.Arg6, 0.2f);
        }
Пример #3
0
        void AddUrltList(List <AssetFilePathInfo> urlList, StringGridRow row, string csvDir)
        {
            string path    = AdvParser.ParseCell <string>(row, AdvColumnName.Param1);
            int    version = AdvParser.ParseCell <int>(row, AdvColumnName.Version);

            urlList.Add(new AssetFilePathInfo(FileNameToPath(path, csvDir), version));
        }
Пример #4
0
        /// <summary>
        /// コマンド名なしの場合のコマンドIDを取得
        /// </summary>
        /// <param name="row">行データ</param>
        /// <param name="dataManager">データマネージャー</param>
        /// <returns>生成するコマンドID</returns>
        static string ParseCommandID(StringGridRow row)
        {
            string id = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Command, "");

            if (id == "")
            {
                //コマンドなしは、テキスト表示が基本
                string arg1 = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Arg1, "");
                if (!string.IsNullOrEmpty(arg1))
                {
                    //パラメーターつきなので、キャラ表示
                    return(IdCharacter);
                }
                string text     = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Text, "");
                string pageCtrl = AdvParser.ParseCellOptional <string>(row, AdvColumnName.PageCtrl, "");
                if (text.Length > 0 || pageCtrl.Length > 0)
                {
                    //地の文
                    return(IdText);
                }
                else
                {                       //なにもないので空データ
                    return(null);
                }
            }
            else if (IsScenarioLabel(id))
            {
                //シナリオラベル
                id = IdScenarioLabel;
            }
            return(id);
        }
Пример #5
0
        public void Parse(StringGridRow row)
        {
            this.RenderTextureType = AdvParser.ParseCellOptional <AdvRenderTextureMode>(row, AdvColumnName.RenderTexture, AdvRenderTextureMode.None);

            if (RenderTextureType != AdvRenderTextureMode.None)
            {
                try
                {
                    float[] rect = row.ParseCellArray <float>(AdvColumnName.RenderRect.QuickToString());
                    if (rect.Length != 4)
                    {
                        Debug.LogError(row.ToErrorString("IconRect. Array size is not 4"));
                    }
                    else
                    {
                        this.RenderTextureOffset = new Vector3(-rect[0], -rect[1], 1000);
                        this.RenderTextureSize   = new Vector2(rect[2], rect[3]);
                    }
                }
                catch (Exception)
                {
//					Debug.LogError(row.ToErrorString("IconRect. Array size is not 4"));
                }
            }
        }
        public AdvEffectDataShake(StringGridRow row)
        {
            this.targetName = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Arg1, "");
            if (!UtageToolKit.TryParaseEnum <TargetType>(this.targetName, out this.targetType))
            {
                this.targetType = TargetType.Default;
            }
            this.targetName = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Arg2, this.targetName);
            string defaultStr = " x=30 y=30";
            string arg        = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Arg3, defaultStr);

            if (!arg.Contains("x=") && !arg.Contains("y="))
            {
                arg += defaultStr;
            }
            string easeType = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Arg4, "");
            string loopType = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Arg5, "");

            this.tweenData = new iTweenData(iTweenType.ShakePosition.ToString(), arg, easeType, loopType);

            this.waitType = AdvParser.ParseCellOptional <WaitType>(row, AdvColumnName.Arg6, WaitType.Wait);

            if (!string.IsNullOrEmpty(tweenData.ErrorMsg))
            {
                Debug.LogError(row.ToErrorString(tweenData.ErrorMsg));
            }
        }
Пример #7
0
        internal AdvGraphicOperaitonArg(StringGridRow row, GraphicInfoList graphic, float fadeTime, bool isNoPtattern = false)
        {
            this.RowData      = row;
            this.Graphic      = graphic;
            this.FadeTime     = fadeTime;
            this.IsNoPtattern = isNoPtattern;

            this.Arg2 = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Arg2, "");
            this.Arg3 = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Arg3, "");
            this.Arg4 = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Arg4, "");
            this.Arg5 = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Arg5, "");
            float x;

            if (float.TryParse(Arg4, out x))
            {
                this.X = x;
            }
            float y;

            if (float.TryParse(Arg5, out y))
            {
                this.Y = y;
            }
            else
            {
                MotionPlayType type;
                if (UtageToolKit.TryParaseEnum <MotionPlayType>(Arg5, out type))
                {
                    PlayType = type;
                }
            }
        }
Пример #8
0
 public AdvFaceIconInfo(StringGridRow row)
 {
     this.FileName = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Icon, "");
     if (!string.IsNullOrEmpty(FileName))
     {
         if (!AdvParser.IsEmptyCell(row, AdvColumnName.IconSubFileName))
         {
             this.IconType        = AdvFaceIconInfo.Type.DicingPattern;
             this.IconSubFileName = AdvParser.ParseCell <string>(row, AdvColumnName.IconSubFileName);
         }
         else
         {
             this.IconType = AdvFaceIconInfo.Type.IconImage;
         }
     }
     else if (!AdvParser.IsEmptyCell(row, AdvColumnName.IconRect))
     {
         float[] rect = row.ParseCellArray <float>(AdvColumnName.IconRect.QuickToString());
         if (rect.Length == 4)
         {
             this.IconType = AdvFaceIconInfo.Type.RectImage;
             this.IconRect = new Rect(rect[0], rect[1], rect[2], rect[3]);
         }
         else
         {
             Debug.LogError(row.ToErrorString("IconRect. Array size is not 4"));
         }
     }
     else
     {
         this.IconType = Type.None;
     }
 }
Пример #9
0
		public bool TryParseMacro(StringGridRow row, AdvSettingDataManager dataManager, out List<AdvCommand> commnadList)
		{
			commnadList = null;
			string commandName = AdvParser.ParseCellOptional<string>(row, AdvColumnName.Command,"");
			AdvMacroData data;
			if( macroDataTbl.TryGetValue(commandName, out data ) )
			{
				commnadList = new List<AdvCommand>();
				List<StringGridRow> macroRows = data.MakeMacroRows(row);
				foreach( StringGridRow macroRow in macroRows )
				{
					List<AdvCommand> list;
					if( TryParseMacro( macroRow, dataManager, out list ) )
					{
						commnadList.AddRange(list);
					}
					else
					{
						commnadList.Add(AdvCommandParser.CreateCommand(macroRow, dataManager));
					}
				}
				return true;
			}
			else
			{
				return false;
			}
		}
Пример #10
0
        public AdvCommandSelection(StringGridRow row, AdvSettingDataManager dataManager)
        {
            this.jumpLabel = AdvCommandParser.ParseScenarioLabel(row, AdvColumnName.Arg1);
            this.text      = AdvParser.ParseCell <string>(row, AdvColumnName.Text);
            string expStr = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Arg2, "");

            if (string.IsNullOrEmpty(expStr))
            {
                this.exp = null;
            }
            else
            {
                this.exp = dataManager.DefaultParam.CreateExpressionBoolean(expStr);
                if (this.exp.ErrorMsg != null)
                {
                    Debug.LogError(row.ToErrorString(this.exp.ErrorMsg));
                }
            }

            string selectedExpStr = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Arg3, "");

            if (string.IsNullOrEmpty(selectedExpStr))
            {
                this.selectedExp = null;
            }
            else
            {
                this.selectedExp = dataManager.DefaultParam.CreateExpression(selectedExpStr);
                if (this.selectedExp.ErrorMsg != null)
                {
                    Debug.LogError(row.ToErrorString(this.selectedExp.ErrorMsg));
                }
            }
        }
Пример #11
0
        //行のデータが、マクロ行だったら
        //出力行リストにマクロ展開して追加
        public bool TryMacroExpansion(StringGridRow row, List <StringGridRow> outputList, string debugMsg)
        {
            string       commandName = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Command, "");
            AdvMacroData data;

            if (!macroDataTbl.TryGetValue(commandName, out data))
            {
                //マクロ処理なし
                return(false);
            }

            if (string.IsNullOrEmpty(debugMsg))
            {
                debugMsg = row.Grid.Name + ":" + (row.RowIndex + 1).ToString();
            }

            debugMsg += " -> MACRO " + data.Header.Grid.Name;
            //マクロ展開したデータを取得
            List <StringGridRow> macroRows = data.MacroExpansion(row, debugMsg);

            //マクロ展開した行を追加していく
            foreach (StringGridRow macroRow in macroRows)
            {
                //マクロ内マクロ展開(再起呼び出し)
                if (TryMacroExpansion(macroRow, outputList, macroRow.DebugInfo))
                {
                    continue;
                }

                outputList.Add(macroRow);
            }
            return(true);
        }
Пример #12
0
        public GraphicInfo(StringGridRow row)
        {
            this.RowData  = row;
            this.fileName = AdvParser.ParseCell <string>(row, AdvColumnName.FileName);
            try
            {
                this.pivot = ParserUtil.ParsePivotOptional(AdvParser.ParseCellOptional <string>(row, AdvColumnName.Pivot, ""), pivot);
            }
            catch (System.Exception e)
            {
                Debug.LogError(row.ToErrorString(e.Message));
            }

            try
            {
                this.scale = ParserUtil.ParseScale2DOptional(AdvParser.ParseCellOptional <string>(row, AdvColumnName.Scale, ""), this.scale);
            }
            catch (System.Exception e)
            {
                Debug.LogError(row.ToErrorString(e.Message));
            }
            this.CondionalExpression = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Conditional, "");
            this.version             = AdvParser.ParseCellOptional <int>(row, AdvColumnName.Version, 0);
//			this.IgnoreLoad = AdvParser.ParseCellOptional<bool>(row, AdvColumnName.IgnoreLoad, false);
        }
Пример #13
0
        /// <summary>
        /// コマンド名なしの場合のコマンドIDを取得
        /// </summary>
        /// <param name="row">行データ</param>
        /// <param name="dataManager">データマネージャー</param>
        /// <returns>生成するコマンドID</returns>
        static string ParseCommandID(StringGridRow row)
        {
            Profiler.BeginSample("ParseCommandID");
            string id = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Command, "");

            if (string.IsNullOrEmpty(id))
            {
                //コマンドなしは、テキスト表示が基本
                if (!AdvParser.IsEmptyCell(row, AdvColumnName.Arg1))
                {
                    Profiler.EndSample();
                    //パラメーターつきなので、キャラ表示
                    return(IdCharacter);
                }
                if (!AdvParser.IsEmptyCell(row, AdvColumnName.Text) || !AdvParser.IsEmptyCell(row, AdvColumnName.PageCtrl))
                {
                    Profiler.EndSample();
                    //テキスト表示
                    return(IdText);
                }
                else
                {                   //なにもないので空データ
                    Profiler.EndSample();
                    return(null);
                }
            }
            else if (IsScenarioLabel(id))
            {
                //シナリオラベル
                id = IdScenarioLabel;
            }
            Profiler.EndSample();
            return(id);
        }
Пример #14
0
        /// <summary>
        /// StringGridの一行からデータ初期化
        /// </summary>
        /// <param name="row">初期化するためのデータ</param>
        /// <returns>成否</returns>
        public override bool InitFromStringGridRow(StringGridRow row)
        {
            string key = AdvParser.ParseCell <string>(row, AdvColumnName.Label);

            if (string.IsNullOrEmpty(key))
            {
                return(false);
            }
            else
            {
                InitKey(key);
                this.type            = AdvParser.ParseCell <ParamType>(row, AdvColumnName.Type);
                this.parameterString = AdvParser.ParseCell <string>(row, AdvColumnName.Value);
                switch (type)
                {
                case ParamType.Bool:
                    parameter = AdvParser.ParseCell <bool>(row, AdvColumnName.Value);
                    break;

                case ParamType.Float:
                    parameter = AdvParser.ParseCell <float>(row, AdvColumnName.Value);
                    break;

                case ParamType.Int:
                    parameter = AdvParser.ParseCell <int>(row, AdvColumnName.Value);
                    break;

                case ParamType.String:
                    parameter = AdvParser.ParseCell <string>(row, AdvColumnName.Value);
                    break;
                }
                this.fileType = AdvParser.ParseCellOptional <FileType>(row, AdvColumnName.FileType, FileType.Default);
                return(true);
            }
        }
Пример #15
0
        /// <summary>
        /// バージョン
        /// </summary>
//		public int Version { get; private set; }


        /// <summary>
        /// StringGridの一行からデータ初期化
        /// </summary>
        /// <param name="row">初期化するためのデータ</param>
        /// <returns>成否</returns>
        public override bool InitFromStringGridRow(StringGridRow row)
        {
            if (row.IsEmptyOrCommantOut)
            {
                return(false);
            }

            this.RowData = row;
            string key = AdvParser.ParseCell <string>(row, AdvColumnName.Label);

            if (string.IsNullOrEmpty(key))
            {
                return(false);
            }
            else
            {
                InitKey(key);
                this.Type     = AdvParser.ParseCell <SoundType>(row, AdvColumnName.Type);
                this.fileName = AdvParser.ParseCell <string>(row, AdvColumnName.FileName);
//				this.isStreaming = AdvParser.ParseCellOptional<bool>(row, AdvColumnName.Streaming, false);
//				this.Version = AdvParser.ParseCellOptional<int>(row, AdvColumnName.Version, 0);
                this.Title     = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Title, "");
                this.IntroTime = AdvParser.ParseCellOptional <float>(row, AdvColumnName.IntroTime, 0);
                this.Volume    = AdvParser.ParseCellOptional <float>(row, AdvColumnName.Volume, 1);
                return(true);
            }
        }
Пример #16
0
        //起動用CSVをコンバート
        CsvInfo ConvertBootSetting(List <AdvExcelSheets> excelSheets, string chapterName, int version)
        {
            if (string.IsNullOrEmpty(chapterName))
            {
                chapterName = AdvSheetParser.SheetNameBoot;
            }
            StringGrid grid = new StringGrid(chapterName, chapterName, CsvType.Tsv);

            grid.AddRow(new List <string> {
                AdvParser.Localize(AdvColumnName.Tag), AdvParser.Localize(AdvColumnName.Param1), AdvParser.Localize(AdvColumnName.Version)
            });
            ///起動用データをコンバート
            foreach (var excel in excelSheets)
            {
                string excelName = System.IO.Path.GetFileNameWithoutExtension(excel.Path);
                //シナリオ設定シートは個別にコンバート
                AddFileDataToTsv(grid, version, excelName, AdvSheetParser.SheetNameScenario);
                foreach (var sheet in excel.SettingsSheets)
                {
                    AddFileDataToTsv(grid, version, excelName, sheet.SheetName);
                }
            }

            string path = chapterName;

            return(new CsvInfo(grid, path));
        }
Пример #17
0
        public AdvCommandBgEvent(StringGridRow row, AdvSettingDataManager dataManager)
        {
            this.label = AdvParser.ParseCell <string>(row, AdvColumnName.Arg1);
            if (!dataManager.TextureSetting.ContainsLabel(label))
            {
                Debug.LogError(row.ToErrorString(label + " is not contained in file setting"));
            }

            this.file = AddLoadFile(dataManager.TextureSetting.LabelToFilePath(label));
            //表示位置
            float x;

            if (AdvParser.TryParseCell <float>(row, AdvColumnName.Arg4, out x))
            {
                this.x = x;
            }
            float y;

            if (AdvParser.TryParseCell <float>(row, AdvColumnName.Arg5, out y))
            {
                this.y = y;
            }
            //フェード時間
            this.fadeTime = AdvParser.ParseCellOptional <float>(row, AdvColumnName.Arg6, 0.2f);
        }
Пример #18
0
        public bool TryParse(StringGridRow row)
        {
            string key = AdvParser.ParseCell <string>(row, AdvColumnName.Label);

            if (string.IsNullOrEmpty(key))
            {
                return(false);
            }
            else
            {
                this.key             = key;
                this.type            = AdvParser.ParseCell <ParamType>(row, AdvColumnName.Type);
                this.parameterString = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Value, "");
                this.fileType        = AdvParser.ParseCellOptional <FileType>(row, AdvColumnName.FileType, FileType.Default);
                try
                {
                    ParseParameterString();
                    return(true);
                }
                catch
                {
                    return(false);
                }
            }
        }
Пример #19
0
        public AdvGraphicInfo(string dataType, int index, string key, StringGridRow row, IAdvSettingData advSettindData)
        {
            this.DataType    = dataType;
            this.Index       = index;
            this.Key         = key;
            this.SettingData = advSettindData;
            this.RowData     = row;

            switch (DataType)
            {
            case AdvGraphicInfo.TypeParticle:
                this.FileType = AdvGraphicInfo.FileTypeParticle;
                break;

            default:
                this.FileType = AdvParser.ParseCellOptional <string>(row, AdvColumnName.FileType, "");
                break;
            }

            this.FileName = AdvParser.ParseCell <string>(row, AdvColumnName.FileName);
            try
            {
                this.Pivot = ParserUtil.ParsePivotOptional(AdvParser.ParseCellOptional <string>(row, AdvColumnName.Pivot, ""), new Vector2(0.5f, 0.5f));
            }
            catch (System.Exception e)
            {
                Debug.LogError(row.ToErrorString(e.Message));
            }

            try
            {
                this.Pivot0 = ParserUtil.ParsePivotOptional(AdvParser.ParseCellOptional <string>(row, AdvColumnName.Pivot0, ""), new Vector2(0.5f, 0.5f));
            }
            catch (System.Exception e)
            {
                Debug.LogError(row.ToErrorString(e.Message));
            }

            try
            {
                this.Scale = ParserUtil.ParseScale3DOptional(AdvParser.ParseCellOptional <string>(row, AdvColumnName.Scale, ""), Vector3.one);
            }
            catch (System.Exception e)
            {
                Debug.LogError(row.ToErrorString(e.Message));
            }

            Vector3 pos;

            pos.x         = AdvParser.ParseCellOptional <float>(row, AdvColumnName.X, 0);
            pos.y         = AdvParser.ParseCellOptional <float>(row, AdvColumnName.Y, 0);
            pos.z         = AdvParser.ParseCellOptional <float>(row, AdvColumnName.Z, 0);
            this.Position = pos;

            this.SubFileName = AdvParser.ParseCellOptional <string>(row, AdvColumnName.SubFileName, "");

            this.ConditionalExpression = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Conditional, "");
            this.RenderTextureSetting.Parse(row);
        }
Пример #20
0
 public AdvCommandIf(StringGridRow row, AdvSettingDataManager dataManger)
 {
     this.exp = dataManger.DefaultParam.CreateExpressionBoolean(AdvParser.ParseCell <string>(row, AdvColumnName.Arg1));
     if (this.exp.ErrorMsg != null)
     {
         Debug.LogError(row.ToErrorString(this.exp.ErrorMsg));
     }
 }
Пример #21
0
        /// <summary>
        /// StringGridの一行からデータ初期化
        /// </summary>
        /// <param name="row">初期化するためのデータ</param>
        /// <returns>成否</returns>
        public override bool InitFromStringGridRow(StringGridRow row)
        {
            string key = AdvParser.ParseCell <string>(row, AdvColumnName.FileName);

            InitKey(key);
            this.version = AdvParser.ParseCellOptional <int>(row, AdvColumnName.Version, 0);
            return(true);
        }
        // シナリオラベルを解析
        static public string ParseScenarioLabel(StringGridRow row, AdvColumnName columnName)
        {
            string label = AdvParser.ParseCell <string>(row, columnName);

            if (!IsScenarioLabel(label))
            {
                Debug.LogError(row.ToErrorString(LanguageAdvErrorMsg.LocalizeTextFormat(AdvErrorMsg.NotScenarioLabel, label)));
            }
            return(label.Substring(1));
        }
Пример #23
0
        /// <summary>
        /// StringGridの一行からデータ初期化
        /// </summary>
        /// <param name="row">初期化するためのデータ</param>
        /// <returns>成否</returns>
        public override bool InitFromStringGridRow(StringGridRow row)
        {
            string key = AdvCommandParser.ParseScenarioLabel(row, AdvColumnName.ScenarioLabel);

            InitKey(key);
            this.title            = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Title, "");
            this.thumbnailName    = AdvParser.ParseCell <string>(row, AdvColumnName.Thumbnail);
            this.thumbnailVersion = AdvParser.ParseCellOptional <int>(row, AdvColumnName.ThumbnailVersion, 0);
            return(true);
        }
Пример #24
0
        /// <summary>
        /// StringGridの一行からデータ初期化
        /// </summary>
        /// <param name="row">初期化するためのデータ</param>
        /// <returns>成否</returns>
        public override bool InitFromStringGridRow(StringGridRow row)
        {
            this.RowData = row;
            string key = AdvParser.ParseCell <string>(row, AdvColumnName.FileName);

            InitKey(key);
            this.version          = AdvParser.ParseCellOptional <int>(row, AdvColumnName.Version, 0);
            this.ScenaioSheetName = FilePathUtil.GetFileNameWithoutExtension(key);
            return(true);
        }
Пример #25
0
        //連続するデータとして追加できる場合はする。基本はしない
        protected override AdvCharacterSettingData ParseFromStringGridRow(AdvCharacterSettingData last, StringGridRow row, AdvBootSetting bootSetting)
        {
            //キャラ名
            string name = AdvParser.ParseCellOptional <string>(row, AdvColumnName.CharacterName, "");
            //表示パターン
            string pattern = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Pattern, "");
            //表示名
            string nameText = AdvParser.ParseCellOptional <string>(row, AdvColumnName.NameText, "");

            //キャラ名が空白なら、直前と同じキャラ名を使う
            if (string.IsNullOrEmpty(name))
            {
                if (last == null)
                {
                    Debug.LogError(row.ToErrorString("Not Found Chacter Name"));
                    return(null);
                }
                name = last.Name;
            }

            //表示名が空で、直前のデータとキャラ名が同じならその名前を使う
            if (string.IsNullOrEmpty(nameText))
            {
                if (last != null && (name == last.Name))
                {
                    nameText = last.NameText;
                }
                else
                {
                    nameText = name;
                }
            }

            AdvCharacterSettingData data = new AdvCharacterSettingData();

            data.Init(name, pattern, nameText, row);

            if (!Dictionary.ContainsKey(data.Key))
            {
                AddData(data);
                data.BootInit(bootSetting);
                if (!defaultKey.ContainsKey(name))
                {
                    defaultKey.Add(name, data.Key);
                }
                return(data);
            }
            else
            {
                string errorMsg = "";
                errorMsg += row.ToErrorString(ColorUtil.AddColorTag(data.Key, Color.red) + "  is already contains");
                Debug.LogError(errorMsg);
            }
            return(null);
        }
Пример #26
0
 // 選択肢終了などの特別なコマンドを自動生成する場合、そのIDを返す
 public override string[] GetExtraCommandIdArray(AdvCommand next)
 {
     if (AdvParser.IsEmptyTextCommand(RowData))
     {
         return(null);
     }
     else
     {
         return(new string[] { AdvCommandParser.IdText });
     }
 }
Пример #27
0
        public AdvCommandBgm(StringGridRow row, AdvSettingDataManager dataManager)
        {
            string label = AdvParser.ParseCell <string>(row, AdvColumnName.Arg1);

            if (!dataManager.SoundSetting.Contains(label, SoundType.Bgm))
            {
                Debug.LogError(row.ToErrorString(label + " is not contained in file setting"));
            }

            this.file = AddLoadFile(dataManager.SoundSetting.LabelToFilePath(label, SoundType.Bgm));
        }
Пример #28
0
        //マクロシートからマクロデータを作って追加。追加なければfalse
        public bool TryAddMacroData(string name, StringGrid grid)
        {
            if (!IsMacroName(name))
            {
                return(false);
            }

            int index = 0;

            while (index < grid.Rows.Count)
            {
                StringGridRow row = grid.Rows[index];
                ++index;
                if (row.RowIndex < grid.DataTopRow)
                {
                    continue;                                                                   //データの行じゃない
                }
                if (row.IsEmptyOrCommantOut)
                {
                    continue;                                                                                                   //データがない
                }
                string macroName;
                if (TryParseMacoBegin(row, out macroName))
                {
                    List <StringGridRow> rowList = new List <StringGridRow>();
                    while (index < grid.Rows.Count)
                    {
                        StringGridRow macroRow = grid.Rows[index];
                        ++index;
                        if (macroRow.IsEmptyOrCommantOut)
                        {
                            continue;                                                                                                   //データがない
                        }
                        if (AdvParser.ParseCellOptional <string>(macroRow, AdvColumnName.Command, "") == "EndMacro")
                        {
                            break;
                        }

                        rowList.Add(macroRow);
                    }

                    if (macroDataTbl.ContainsKey(macroName))
                    {
                        Debug.LogError(row.ToErrorString(macroName + " is already contains "));
                    }
                    else
                    {
                        macroDataTbl.Add(macroName, new AdvMacroData(macroName, row, rowList));
                    }
                }
            }

            return(true);
        }
Пример #29
0
        public override bool InitFromStringGridRow(StringGridRow row)
        {
            string key = AdvCommandParser.ParseScenarioLabel(row, AdvColumnName.ScenarioLabel);

            base.InitKey(key);
            this.title            = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Title, string.Empty);
            this.thumbnailName    = AdvParser.ParseCell <string>(row, AdvColumnName.Thumbnail);
            this.thumbnailVersion = AdvParser.ParseCellOptional <int>(row, AdvColumnName.ThumbnailVersion, 0);
            this.category         = AdvParser.ParseCellOptional <string>(row, AdvColumnName.Categolly, string.Empty);
            base.RowData          = row;
            return(true);
        }
Пример #30
0
        public AdvCommandAmbience(StringGridRow row, AdvSettingDataManager dataManager)
        {
            string label = AdvParser.ParseCell <string>(row, AdvColumnName.Arg1);

            if (!dataManager.SoundSetting.Contains(label, SoundType.Ambience))
            {
                Debug.LogError(row.ToErrorString(label + " is not contained in file setting"));
            }

            this.file   = AddLoadFile(dataManager.SoundSetting.LabelToFilePath(label, SoundType.Ambience));
            this.isLoop = AdvParser.ParseCellOptional <bool>(row, AdvColumnName.Arg2, false);
        }