public override void Init(AvaliGraphicRequest req) { this.data = req.graphicData; this.path = req.path; this.color = req.color; this.drawSize = req.drawSize; List <StuffAppearanceDef> defsListForReading = DefDatabase <StuffAppearanceDef> .AllDefsListForReading; this.subGraphics = new AvaliGraphic[defsListForReading.Count]; for (int index = 0; index < this.subGraphics.Length; ++index) { StuffAppearanceDef stuffAppearance = defsListForReading[index]; string folderPath = req.path; if (!stuffAppearance.pathPrefix.NullOrEmpty()) { folderPath = stuffAppearance.pathPrefix + "/" + ((IEnumerable <string>)folderPath.Split('/')).Last <string>(); } Texture2D texture2D = ContentFinder <Texture2D> .GetAllInFolder(folderPath).Where <Texture2D>((Func <Texture2D, bool>)(x => x.name.EndsWith(stuffAppearance.defName))).FirstOrDefault <Texture2D>(); if ((UnityEngine.Object)texture2D != (UnityEngine.Object)null) { this.subGraphics[index] = AvaliGraphicDatabase.Get <AvaliGraphic_Single>(folderPath + "/" + texture2D.name, req.shader, this.drawSize, this.color); } } for (int index = 0; index < this.subGraphics.Length; ++index) { if (this.subGraphics[index] == null) { this.subGraphics[index] = this.subGraphics[(int)StuffAppearanceDefOf.Smooth.index]; } } }
public override void Init(AvaliGraphicRequest req) { this.data = req.graphicData; if (req.path.NullOrEmpty()) { throw new ArgumentNullException("folderPath"); } if ((UnityEngine.Object)req.shader == (UnityEngine.Object)null) { throw new ArgumentNullException("shader"); } this.path = req.path; this.color = req.color; this.colorTwo = req.colorTwo; this.drawSize = req.drawSize; List <Texture2D> list = ContentFinder <Texture2D> .GetAllInFolder(req.path).Where <Texture2D>((Func <Texture2D, bool>)(x => !x.name.EndsWith(Graphic_Single.MaskSuffix))).OrderBy <Texture2D, string>((Func <Texture2D, string>)(x => x.name)).ToList <Texture2D>(); if (list.NullOrEmpty <Texture2D>()) { Log.Error("Collection cannot init: No textures found at path " + req.path, false); this.subGraphics = new AvaliGraphic[1] { AvaliBaseContent.BadGraphic }; } else { this.subGraphics = new AvaliGraphic[list.Count]; for (int index = 0; index < list.Count; ++index) { string path = req.path + "/" + list[index].name; this.subGraphics[index] = AvaliGraphicDatabase.Get(typeof(Graphic_Single), path, req.shader, this.drawSize, this.color, this.colorTwo, this.colorThree, (AvaliGraphicData)null, req.shaderParameters); } } }
public static void Avali_SpecificHatPatch( ref Apparel apparel, ref BodyTypeDef bodyType, ref ApparelGraphicRecord rec) { if (bodyType != AvaliMod.AvaliDefs.Avali && bodyType != AvaliMod.AvaliDefs.Avali) { return; } if (apparel.def.apparel.LastLayer == ApparelLayerDefOf.Overhead) { string path = apparel.def.apparel.wornGraphicPath + "_" + bodyType.defName; if (!((Object)ContentFinder <Texture2D> .Get(path + "_north", false) == (Object)null) && !((Object)ContentFinder <Texture2D> .Get(path + "_east", false) == (Object)null) && !((Object)ContentFinder <Texture2D> .Get(path + "_south", false) == (Object)null)) { AvaliGraphic graphic = AvaliGraphicDatabase.Get <AvaliGraphic_Multi>(path, AvaliShaderDatabase.Tricolor, apparel.def.graphicData.drawSize, apparel.DrawColor); rec = new ApparelGraphicRecord(graphic, apparel); } } else if (!apparel.def.apparel.wornGraphicPath.NullOrEmpty()) { string str = apparel.def.apparel.wornGraphicPath + "_" + bodyType.defName; if ((Object)ContentFinder <Texture2D> .Get(str + "_north", false) == (Object)null || (Object)ContentFinder <Texture2D> .Get(str + "_east", false) == (Object)null || (Object)ContentFinder <Texture2D> .Get(str + "_south", false) == (Object)null) { AvaliGraphic graphic = AvaliGraphicDatabase.Get <AvaliGraphic_Multi>(apparel.def.apparel.wornGraphicPath, AvaliShaderDatabase.Tricolor, apparel.def.graphicData.drawSize, apparel.DrawColor); rec = new ApparelGraphicRecord(graphic, apparel); } } }
public override AvaliGraphic GetColoredVersion( Shader newShader, Color newColor, Color newColorTwo, Color newColorThree) { //Log.Message("Imtryingtogetthis"); return(AvaliGraphicDatabase.Get <AvaliGraphic_Multi>(this.path, newShader, this.drawSize, newColor, newColorTwo, newColorThree, this.data)); }
public override AvaliGraphic GetColoredVersion( Shader newShader, Color newColor, Color newColorTwo, Color newColorThree) { Log.Message("actuallythisone"); return(AvaliGraphicDatabase.Get <AvaliGraphic_Single>(this.path, newShader, this.drawSize, newColor, newColorTwo, Color.white, this.data)); }
public override AvaliGraphic GetColoredVersion( Shader newShader, Color newColor, Color newColorTwo, Color newColorThree) { //Log.Message("ormaybhetisone"); return(AvaliGraphicDatabase.Get <AvaliGraphic_StackCount>(this.path, newShader, this.drawSize, newColor, newColorTwo, newColorThree , this.data)); }
public virtual AvaliGraphic GetCopy(Vector2 newDrawSize) { return(AvaliGraphicDatabase.Get(this.GetType(), this.path, this.Shader, newDrawSize, this.color, this.colorTwo, this.colorThree)); }
public static AvaliGraphic Get( System.Type graphicClass, string path, Shader shader, Vector2 drawSize, Color color, Color colorTwo, Color colorThree) { //Log.Message("Was Got1"); return(AvaliGraphicDatabase.Get(graphicClass, path, shader, drawSize, color, colorTwo, colorThree, (AvaliGraphicData)null, (List <ShaderParameter>)null)); }
public override AvaliGraphic GetColoredVersion( Shader newShader, Color newColor, Color newColorTwo, Color newColorThree) { //Log.Message("butalsothert"); if (newColorTwo != Color.white) { Log.ErrorOnce("Cannot use Graphic_Random.GetColoredVersion with a non-white colorTwo.", 9910251, false); } return(AvaliGraphicDatabase.Get <AvaliGraphic_Random>(this.path, newShader, this.drawSize, newColor, Color.white, Color.white, this.data)); }
public override AvaliGraphic GetColoredVersion( Shader newShader, Color newColor, Color newColorTwo, Color newColorThree) { Log.Message("treidmoasrasd"); if (newColorTwo != Color.white) { Log.ErrorOnce("Cannot use Graphic_Appearances.GetColoredVersion with a non-white colorTwo.", 9910251, false); } return(AvaliGraphicDatabase.Get <AvaliGraphic_Appearances>(this.path, newShader, this.drawSize, newColor, Color.white, Color.white, this.data)); }
private void Init() { if (this.graphicClass == (System.Type)null) { this.cachedGraphic = (AvaliGraphic)null; } else { this.cachedGraphic = AvaliGraphicDatabase.Get(this.graphicClass, this.texPath, (this.shaderType ?? ShaderTypeDefOf.Cutout).Shader, this.drawSize, this.color, this.colorTwo, this.colorThree, this, this.shaderParameters); if ((double)this.onGroundRandomRotateAngle > 0.00999999977648258) { this.cachedGraphic = (AvaliGraphic) new AvaliGraphic_RandomRotated(this.cachedGraphic, this.onGroundRandomRotateAngle); } if (!this.Linked) { return; } this.cachedGraphic = (AvaliGraphic)AvaliGraphicUtility.WrapLinked(this.cachedGraphic, this.linkType); } }