示例#1
0
 public StartSpatialPropAnimEvent(LuaTable table) : base(table)
 {
     if (!GetProps(table, out var props))
     {
         return;
     }
     if (!GetValue(props, "spatialprops", out LuaTable sp))
     {
         return;
     }
     if (GetValue(sp, "q_orient", out Q_Orient))
     {
         SetFlags |= AnimVars.QOrient;
     }
     if (GetValue(sp, "orient", out Orient))
     {
         SetFlags |= AnimVars.Orient;
     }
     if (GetValue(sp, "axisrot", out LuaTable axisrot))
     {
         SetFlags |= AnimVars.AxisRot;
         if (!axisrot.TryGetVector3(1, out AxisRot.Axis))
         {
             FLLog.Error("Thn", "START_SPATIAL_PROP_ANIM axisrot missing axis");
             AxisRot.Axis = Vector3.UnitY;
         }
         AxisRot.Degrees = (float)axisrot[0];
     }
     if (GetValue(sp, "pos", out Pos))
     {
         SetFlags |= AnimVars.Pos;
     }
 }
示例#2
0
 public StartLightPropAnimEvent(LuaTable table) : base(table)
 {
     //Get Tables
     if (!GetProps(table, out var props))
     {
         return;
     }
     if (!GetValue(props, "lightprops", out LuaTable lights))
     {
         return;
     }
     //Set Properties
     if (GetValue(lights, "on", out On))
     {
         SetFlags |= AnimVars.On;
     }
     if (GetValue(lights, "diffuse", out Diffuse))
     {
         SetFlags |= AnimVars.Diffuse;
     }
     if (GetValue(lights, "ambient", out Ambient))
     {
         SetFlags |= AnimVars.Ambient;
     }
 }
 public StartFogPropAnimEvent(LuaTable table) : base(table)
 {
     //Get Tables
     if (!GetProps(table, out var props))
     {
         return;
     }
     if (!GetValue(props, "fogprops", out LuaTable fog))
     {
         return;
     }
     //Set Properties
     if (GetValue(fog, "fogon", out FogOn))
     {
         SetFlags |= AnimVars.FogOn;
     }
     if (GetValue(fog, "fogmode", out FogMode))
     {
         SetFlags |= AnimVars.FogMode;
     }
     if (GetValue(fog, "fogcolor", out FogColor))
     {
         SetFlags |= AnimVars.FogColor;
         FogColor *= (1 / 255f);
     }
     if (GetValue(fog, "fogdensity", out FogDensity))
     {
         SetFlags |= AnimVars.FogDensity;
     }
     if (GetValue(fog, "fogstart", out FogStart))
     {
         SetFlags |= AnimVars.FogStart;
     }
     if (GetValue(fog, "fogend", out FogEnd))
     {
         SetFlags |= AnimVars.FogEnd;
     }
 }