public bool TryGetAniFromJob(ScriptAniJob aniJob, out ScriptAni ani) { if (this.BaseInst.TryGetAniFromJob(aniJob.BaseAniJob, out Animation baseAni)) { ani = (ScriptAni)baseAni.ScriptObject; return(true); } ani = null; return(false); }
public void RemoveOverlayAni(ScriptAni ani) { this.baseAniJob.RemoveOverlayAni(ani.BaseAni); }
public virtual void AddOverlayAni(ScriptAni ani, ScriptOverlay ov) { this.baseAniJob.AddOverlayAni(ani.BaseAni, ov.BaseOverlay); }
public virtual void SetDefaultAni(ScriptAni ani) { this.baseAniJob.SetDefaultAni(ani.BaseAni); }
public ScriptAniJob(string codeName, string gothicName, ScriptAni defaultAni) : this() { this.CodeName = codeName; this.AniName = gothicName; this.SetDefaultAni(defaultAni); }
public ScriptAniJob(string codeName, ScriptAni defaultAni) : this(codeName) { this.SetDefaultAni(defaultAni); }
/// <summary> /// Create ScriptAni-objects from database table and output them as Dictionary aniByID. /// </summary> /// <param name="dataTable"></param> /// <param name="aniByID"></param> /// <returns></returns> public bool TryGenerateScriptAnis(List <List <object> > dataTable, out Dictionary <int, ScriptAni> aniByID) { aniByID = new Dictionary <int, ScriptAni>(); List <ColumnGetTypeInfo> info; TryGetColGetTypeInfo("ScriptAni", out info); try { foreach (List <object> row in dataTable) { var ani = new ScriptAni(); var aniID = -1; for (int c = 0; c < row.Count; c++) { switch (info[c].colName) { case "ScriptAniID": aniID = (int)row[c]; break; case "FPS": if (row[c] is int) { ani.FPS = (int)row[c]; } break; case "StartFrame": ani.StartFrame = (int)row[c]; break; case "EndFrame": ani.EndFrame = (int)row[c]; break; case "SpecialFrames": var rawSF = (string)row[c]; if (rawSF.Length == 0) { break; } // must split something like "Combo=1;..." and apply key and val var temp = rawSF.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); foreach (var t in temp) { if (t.Length == 0) { MakeLogWarning("Invalid SpecialFrame format detected for ScriptAni with id " + aniID + " => " + rawSF); break; } var keyAndVal = t.Split('='); ani.SetSpecialFrame((SpecialFrame)Enum.Parse(typeof(SpecialFrame), keyAndVal[0]), float.Parse(keyAndVal[1])); } break; } } if (aniID < 0) { throw new Exception("Did't find ScriptAniID in db-data!"); } aniByID.Add(aniID, ani); } } catch (Exception ex) { info = null; MakeLogError(ex); return(false); } return(true); }