Exemple #1
0
 public static AvaliGraphic Get <T>(
     string path,
     Shader shader,
     Vector2 drawSize,
     Color color,
     Color colorTwo,
     Color colorThree,
     AvaliGraphicData data)
     where T : AvaliGraphic, new()
 {
     //if (shader.name != "Custom/Cutout") { shadertest = shader; }
     //if (shader.name == "Custom/Cutout") { shader = shadertest; }
     //Log.Message("Was Got2: " + shader.name + " Color3: " + colorThree);
     return((AvaliGraphic)AvaliGraphicDatabase.GetInner <T>(new AvaliGraphicRequest(typeof(T), path, shader, drawSize, color, colorTwo, colorThree, data, 0, (List <ShaderParameter>)null)));
 }
Exemple #2
0
 public virtual AvaliGraphic GetShadowlessGraphic()
 {
     if (this.data == null || this.data.shadowData == null)
     {
         return(this);
     }
     if (this.cachedShadowlessGraphicInt == null)
     {
         AvaliGraphicData graphicData = new AvaliGraphicData();
         graphicData.CopyFrom(this.data);
         graphicData.shadowData          = (ShadowData)null;
         this.cachedShadowlessGraphicInt = graphicData.Graphic;
     }
     return(this.cachedShadowlessGraphicInt);
 }
Exemple #3
0
 public AvaliGraphicRequest(
     System.Type graphicClass,
     string path,
     Shader shader,
     Vector2 drawSize,
     Color color,
     Color colorTwo,
     Color colorThree,
     AvaliGraphicData graphicData,
     int renderQueue,
     List <ShaderParameter> shaderParameters)
 {
     this.graphicClass     = graphicClass;
     this.path             = path;
     this.shader           = shader;
     this.drawSize         = drawSize;
     this.color            = color;
     this.colorTwo         = colorTwo;
     this.colorThree       = colorThree;
     this.graphicData      = graphicData;
     this.renderQueue      = renderQueue;
     this.shaderParameters = shaderParameters.NullOrEmpty <ShaderParameter>() ? (List <ShaderParameter>)null : shaderParameters;
 }
Exemple #4
0
 public void CopyFrom(AvaliGraphicData other)
 {
     this.texPath                   = other.texPath;
     this.graphicClass              = other.graphicClass;
     this.shaderType                = other.shaderType;
     this.color                     = other.color;
     this.colorTwo                  = other.colorTwo;
     this.colorThree                = other.colorThree;
     this.drawSize                  = other.drawSize;
     this.drawOffset                = other.drawOffset;
     this.drawOffsetNorth           = other.drawOffsetNorth;
     this.drawOffsetEast            = other.drawOffsetEast;
     this.drawOffsetSouth           = other.drawOffsetSouth;
     this.drawOffsetWest            = other.drawOffsetSouth;
     this.onGroundRandomRotateAngle = other.onGroundRandomRotateAngle;
     this.drawRotated               = other.drawRotated;
     this.allowFlip                 = other.allowFlip;
     this.flipExtraRotation         = other.flipExtraRotation;
     this.shadowData                = other.shadowData;
     this.damageData                = other.damageData;
     this.linkType                  = other.linkType;
     this.linkFlags                 = other.linkFlags;
     this.cachedGraphic             = (AvaliGraphic)null;
 }
Exemple #5
0
        public static AvaliGraphic Get(
            System.Type graphicClass,
            string path,
            Shader shader,
            Vector2 drawSize,
            Color color,
            Color colorTwo,
            Color colorThree,
            AvaliGraphicData data,
            List <ShaderParameter> shaderParameters)
        {
            AvaliGraphicRequest req = new AvaliGraphicRequest(graphicClass, path, shader, drawSize, color, colorTwo, colorThree, data, 0, shaderParameters);

            // liQdComment 2 This is what the game requests
            if (req.graphicClass == typeof(Graphic_Multi))
            {
                //Log.Message("AvaliGraphic request of type Graphic_Multi");
                return((AvaliGraphic)AvaliGraphicDatabase.GetInner <AvaliGraphic_Multi>(req));
            }
            if (req.graphicClass == typeof(AvaliGraphic_Single))
            {
                return((AvaliGraphic)AvaliGraphicDatabase.GetInner <AvaliGraphic_Single>(req));
            }
            if (req.graphicClass == typeof(AvaliGraphic_Terrain))
            {
                return((AvaliGraphic)AvaliGraphicDatabase.GetInner <AvaliGraphic_Terrain>(req));
            }
            if (req.graphicClass == typeof(AvaliGraphic_Multi))
            {
                return((AvaliGraphic)AvaliGraphicDatabase.GetInner <AvaliGraphic_Multi>(req));
            }
            if (req.graphicClass == typeof(AvaliGraphic_Mote))
            {
                return((AvaliGraphic)AvaliGraphicDatabase.GetInner <AvaliGraphic_Mote>(req));
            }
            if (req.graphicClass == typeof(AvaliGraphic_Random))
            {
                return((AvaliGraphic)AvaliGraphicDatabase.GetInner <AvaliGraphic_Random>(req));
            }
            if (req.graphicClass == typeof(AvaliGraphic_Flicker))
            {
                return((AvaliGraphic)AvaliGraphicDatabase.GetInner <AvaliGraphic_Flicker>(req));
            }
            if (req.graphicClass == typeof(AvaliGraphic_Appearances))
            {
                return((AvaliGraphic)AvaliGraphicDatabase.GetInner <AvaliGraphic_Appearances>(req));
            }
            if (req.graphicClass == typeof(AvaliGraphic_StackCount))
            {
                return((AvaliGraphic)AvaliGraphicDatabase.GetInner <AvaliGraphic_StackCount>(req));
            }
            try
            {
                return((AvaliGraphic)GenGeneric.InvokeStaticGenericMethod(typeof(AvaliGraphicDatabase), req.graphicClass, "GetInner", (object)req));
            }
            catch (Exception ex)
            {
                Log.Error("Exception getting " + (object)graphicClass + " at " + path + ": " + ex.ToString(), false);
            }
            return(AvaliBaseContent.BadGraphic);
        }