public void SetData(Hashtable ht)
{
if(ht.ContainsKey("color"))
{
this.active = true;
this.color = int.Parse((string)ht["color"]);
if(ht.ContainsKey("shadowcolor"))
{
this.showShadow = true;
this.shadowColor = int.Parse((string)ht["shadowcolor"]);
this.shadowOffset.x = int.Parse((string)ht["x"]);
this.shadowOffset.y = int.Parse((string)ht["y"]);
}
this.visibleTime = float.Parse((string)ht["visibletime"]);
if(ht.ContainsKey("countinterpolate"))
{
this.countToValue = true;
this.countInterpolate = (EaseType)System.Enum.Parse(typeof(EaseType), (string)ht["countinterpolate"]);
this.countTime = float.Parse((string)ht["counttime"]);
this.startCountFrom = float.Parse((string)ht["startcountfrom"]);
}
if(ht.ContainsKey("fadeintime"))
{
this.fadeIn = true;
this.fadeInTime = float.Parse((string)ht["fadeintime"]);
this.fadeInStart = float.Parse((string)ht["fadeinstart"]);
this.fadeInEnd = float.Parse((string)ht["fadeinend"]);
this.fadeInInterpolate = (EaseType)System.Enum.Parse(typeof(EaseType), (string)ht["fadeininterpolate"]);
}
else this.fadeIn = false;
if(ht.ContainsKey("fadeouttime"))
{
this.fadeOut = true;
this.fadeOutTime = float.Parse((string)ht["fadeouttime"]);
this.fadeOutStart = float.Parse((string)ht["fadeoutstart"]);
this.fadeOutEnd = float.Parse((string)ht["fadeoutend"]);
this.fadeOutInterpolate =(EaseType) System.Enum.Parse(typeof(EaseType), (string)ht["fadeoutinterpolate"]);
}
else this.fadeOut = false;
if(ht.ContainsKey("localspace")) this.localSpace = true;
if(ht.ContainsKey(XMLHandler.NODES))
{
ArrayList s = ht[XMLHandler.NODES] as ArrayList;
foreach(Hashtable ht2 in s)
{
if(ht2[XMLHandler.NODE_NAME] as string == BattleTextSettings.BASEOFFSET)
{
this.baseOffset.x = float.Parse((string)ht2["x"]);
this.baseOffset.y = float.Parse((string)ht2["y"]);
this.baseOffset.z = float.Parse((string)ht2["z"]);
}
else if(ht2[XMLHandler.NODE_NAME] as string == BattleTextSettings.RANDOMOFFSET)
{
this.randomOffsetFrom.x = float.Parse((string)ht2["fx"]);
this.randomOffsetFrom.y = float.Parse((string)ht2["fy"]);
this.randomOffsetFrom.z = float.Parse((string)ht2["fz"]);
this.randomOffsetTo.x = float.Parse((string)ht2["tx"]);
this.randomOffsetTo.y = float.Parse((string)ht2["ty"]);
this.randomOffsetTo.z = float.Parse((string)ht2["tz"]);
}
else if(ht2[XMLHandler.NODE_NAME] as string == BattleTextSettings.ANIMATE)
{
this.animate = true;
if(ht2.ContainsKey("xspeed")) this.xSpeed = float.Parse((string)ht2["xspeed"]);
else
{
this.xRandom = true;
this.xMin = float.Parse((string)ht2["xmin"]);
this.xMax = float.Parse((string)ht2["xmax"]);
}
if(ht2.ContainsKey("yspeed")) this.ySpeed = float.Parse((string)ht2["yspeed"]);
else
{
this.yRandom = true;
this.yMin = float.Parse((string)ht2["ymin"]);
this.yMax = float.Parse((string)ht2["ymax"]);
}
if(ht2.ContainsKey("zspeed")) this.zSpeed = float.Parse((string)ht2["zspeed"]);
else
{
this.zRandom = true;
this.zMin = float.Parse((string)ht2["zmin"]);
this.zMax = float.Parse((string)ht2["zmax"]);
}
}
else if(ht2[XMLHandler.NODE_NAME] as string == BattleTextSettings.FLASH)
{
this.flash = true;
this.flashTime = float.Parse((string)ht2["flashtime"]);
this.flashChildren = bool.Parse((string)ht2["children"]);
this.flashInterpolate = (EaseType)System.Enum.Parse(typeof(EaseType), (string)ht2["flashinterpolate"]);
if(ht2.ContainsKey("fromcurrent")) this.fromCurrent = true;
if(ht2.ContainsKey("alphastart"))
{
this.flashAlpha = true;
this.alphaStart = float.Parse((string)ht2["alphastart"]);
this.alphaEnd = float.Parse((string)ht2["alphaend"]);
}
if(ht2.ContainsKey("redstart"))
{
this.flashRed = true;
this.redStart = float.Parse((string)ht2["redstart"]);
this.redEnd = float.Parse((string)ht2["redend"]);
}
if(ht2.ContainsKey("greenstart"))
{
this.flashGreen = true;
this.greenStart = float.Parse((string)ht2["greenstart"]);
this.greenEnd = float.Parse((string)ht2["greenend"]);
}
if(ht2.ContainsKey("bluestart"))
{
this.flashBlue = true;
this.blueStart = float.Parse((string)ht2["bluestart"]);
this.blueEnd = float.Parse((string)ht2["blueend"]);
}
}
else if(ht2[XMLHandler.NODE_NAME] as string == BattleTextSettings.TEXTOPT)
{
int id = int.Parse((string)ht2["id"]);
if(id < this.text.Length)
{
this.text[id] = ht2[XMLHandler.CONTENT] as string;
}
}
else if(ht2[XMLHandler.NODE_NAME] as string == BattleTextSettings.POSCHILD)
{
this.posChild = ht2[XMLHandler.CONTENT] as string;
}
else if(ht2[XMLHandler.NODE_NAME] as string == BattleTextSettings.PREFAB)
{
this.spawnPrefab = true;
this.prefabName = ht2[XMLHandler.CONTENT] as string;
this.prefabTime = float.Parse((string)ht2["time"]);
this.prefabOffset = VectorHelper.FromHashtable(ht2);
}
else if(ht2[XMLHandler.NODE_NAME] as string == BattleTextSettings.PREFABCHILD)
{
this.prefabChild = ht2[XMLHandler.CONTENT] as string;
}
else if(ht2[XMLHandler.NODE_NAME] as string == BattleTextSettings.AUDIO)
{
this.playAudio = true;
this.audioName = ht2[XMLHandler.CONTENT] as string;
}
}
}
}
else
{
this.active = false;
}
}