/// <summary> /// バックログ追加 /// </summary> /// <param name="text">テキスト</param> /// <param name="characteName">キャラ名</param> /// <param name="voiceFile">ボイスファイル(nullでも良い)</param> public void Add(string text, AdvCharacterInfo characteInfo, AssetFile voiceFile) { AdvBacklog log; if (characteInfo == null) { log = new AdvBacklog(text, "", voiceFile, ""); } else { log = new AdvBacklog(text, characteInfo.NameText, voiceFile, characteInfo.Label); } backlogs.Add(log); if (backlogs.Count > MaxLog) { backlogs.RemoveAt(0); } }
/* * /// <summary> * /// ラベルからファイルパスを取得 * /// </summary> * /// <param name="name">キャラ名</param> * /// <param name="label">ラベル</param> * /// <returns>ファイルパス</returns> * public string LabelToPath(string name, string label) * { * //既に絶対URLならそのまま * if (UtageToolKit.IsAbsoluteUri(label)) * { * return label; * } * else * { * string key = ToFileKey(name, label); * AdvCharacterSettingData data = FindData(key); * if (data == null) * { * //ラベルをそのままファイル名扱いに * return label; * } * else * { * return data.FilePath; * } * } * } */ public AdvCharacterInfo ParseCharacterInfo(string nameText, string patternLabel, out string erroMsg) { string characterTag = ""; bool isHide = false; string msg = ""; Func <string, string, bool> callbackTagParse = (tagName, arg) => { switch (tagName) { case "Off": isHide = true; return(true); case "Character": characterTag = arg; return(true); default: msg = "Unkownn Tag <" + tagName + ">"; return(false); } }; patternLabel = ParserUtil.ParseTagTextToString(patternLabel, callbackTagParse); erroMsg = msg; if (!string.IsNullOrEmpty(characterTag) && !Contains(characterTag)) { if (!string.IsNullOrEmpty(erroMsg)) { erroMsg += "\n"; } erroMsg = "Unknown Character [" + characterTag + "] "; } AdvCharacterInfo info = GetCharacterInfoSub(nameText, characterTag, patternLabel, isHide); erroMsg += info.ErrorMsg; return(info); }
//テキストに変更があった場合 protected virtual bool TyrSetIcon(AdvPage page) { this.targetObject = null; AdvCharacterInfo info = page.CharacterInfo; if (info == null || info.Graphic == null || info.Graphic.Main == null) { return(false); } AdvGraphicInfo graphic = info.Graphic.Main; AdvCharacterSettingData settingData = graphic.SettingData as AdvCharacterSettingData; if (settingData == null) { return(false); } AdvCharacterSettingData.IconInfo iconInfo = settingData.Icon; if (iconInfo.IconType == AdvCharacterSettingData.IconInfo.Type.None) { return(false); } this.targetObject = Engine.GraphicManager.FindObject(info.Label); switch (iconInfo.IconType) { case AdvCharacterSettingData.IconInfo.Type.IconImage: SetIconImage(iconInfo.File); return(true); case AdvCharacterSettingData.IconInfo.Type.DicingPattern: SetIconDicingPattern(iconInfo.File, iconInfo.IconSubFileName); return(true); case AdvCharacterSettingData.IconInfo.Type.RectImage: IconGraphicType type = ParseIconGraphicType(graphic, info.Label); switch (type) { case IconGraphicType.Default: SetIconRectImage(graphic, iconInfo.IconRect); return(true); case IconGraphicType.Dicing: SetIconDicing(graphic, iconInfo.IconRect); return(true); case IconGraphicType.RenderTexture: SetIconRenderTexture(iconInfo.IconRect); return(true); case IconGraphicType.NotSupport: default: return(false); } case AdvCharacterSettingData.IconInfo.Type.None: default: return(false); } }
//データの追加 internal void AddData(AdvCommandText log, AdvCharacterInfo characterInfo) { dataList.Add(new AdvBacklogDataInPage(log, characterInfo)); }