// Token: 0x060000ED RID: 237 RVA: 0x0000A568 File Offset: 0x00008768 public void changeShirt(int whichShirt) { Color[] shirtData = new Color[FarmerRenderer.shirtsTexture.Bounds.Width * FarmerRenderer.shirtsTexture.Bounds.Height]; FarmerRenderer.shirtsTexture.GetData <Color>(shirtData); int index = whichShirt * 8 / FarmerRenderer.shirtsTexture.Bounds.Width * 32 * 128 + whichShirt * 8 % FarmerRenderer.shirtsTexture.Bounds.Width + FarmerRenderer.shirtsTexture.Width * Game1.pixelZoom; Color shirtSleeveColor = shirtData[index]; ColorChanger.swapColor(this.baseTexture, 256, (int)shirtSleeveColor.R, (int)shirtSleeveColor.G, (int)shirtSleeveColor.B); shirtSleeveColor = shirtData[index - FarmerRenderer.shirtsTexture.Width]; ColorChanger.swapColor(this.baseTexture, 257, (int)shirtSleeveColor.R, (int)shirtSleeveColor.G, (int)shirtSleeveColor.B); shirtSleeveColor = shirtData[index - FarmerRenderer.shirtsTexture.Width * 2]; ColorChanger.swapColor(this.baseTexture, 258, (int)shirtSleeveColor.R, (int)shirtSleeveColor.G, (int)shirtSleeveColor.B); }
public void changeShirt(int whichShirt) { Color[] array = new Color[FarmerRenderer.shirtsTexture.Bounds.Width * FarmerRenderer.shirtsTexture.Bounds.Height]; FarmerRenderer.shirtsTexture.GetData <Color>(array); int num = whichShirt * 8 / FarmerRenderer.shirtsTexture.Bounds.Width * 32 * 128 + whichShirt * 8 % FarmerRenderer.shirtsTexture.Bounds.Width + FarmerRenderer.shirtsTexture.Width * Game1.pixelZoom; Color color = array[num]; ColorChanger.swapColor(this.baseTexture, 256, (int)color.R, (int)color.G, (int)color.B); color = array[num - FarmerRenderer.shirtsTexture.Width]; ColorChanger.swapColor(this.baseTexture, 257, (int)color.R, (int)color.G, (int)color.B); color = array[num - FarmerRenderer.shirtsTexture.Width * 2]; ColorChanger.swapColor(this.baseTexture, 258, (int)color.R, (int)color.G, (int)color.B); }
public void changeShirt(int whichShirt) { Color[] data = new Color[FarmerRenderer.shirtsTexture.Bounds.Width * FarmerRenderer.shirtsTexture.Bounds.Height]; FarmerRenderer.shirtsTexture.GetData <Color>(data); int index = whichShirt * 8 / FarmerRenderer.shirtsTexture.Bounds.Width * 32 * 128 + whichShirt * 8 % FarmerRenderer.shirtsTexture.Bounds.Width + FarmerRenderer.shirtsTexture.Width * Game1.pixelZoom; Color color1 = data[index]; ColorChanger.swapColor(this.baseTexture, 256, (int)color1.R, (int)color1.G, (int)color1.B); Color color2 = data[index - FarmerRenderer.shirtsTexture.Width]; ColorChanger.swapColor(this.baseTexture, 257, (int)color2.R, (int)color2.G, (int)color2.B); Color color3 = data[index - FarmerRenderer.shirtsTexture.Width * 2]; ColorChanger.swapColor(this.baseTexture, 258, (int)color3.R, (int)color3.G, (int)color3.B); }
// Token: 0x060002FE RID: 766 RVA: 0x0003C754 File Offset: 0x0003A954 public static Texture2D changeColor(Texture2D texture, int targetColorIndex, int redtint, int greentint, int bluetint, int range) { Color[] data = new Color[texture.Width * texture.Height]; texture.GetData <Color>(data); Color targetColor = data[targetColorIndex]; for (int i = 0; i < data.Length; i++) { if (ColorChanger.IsSimilar(data[i], targetColor, range, range, range)) { data[i] = new Color((int)data[i].R + redtint, (int)data[i].G + greentint, (int)data[i].B + bluetint); } } texture.SetData <Color>(data); return(texture); }
public static Texture2D changeColor(Texture2D texture, int targetColorIndex, Color baseColor, int range) { Color[] data = new Color[texture.Width * texture.Height]; texture.GetData <Color>(data); Color test = data[targetColorIndex]; for (int index = 0; index < data.Length; ++index) { if (ColorChanger.IsSimilar(data[index], test, range, range, range)) { data[index] = new Color((int)baseColor.R + ((int)data[index].R - (int)test.R), (int)baseColor.G + ((int)data[index].G - (int)test.G), (int)baseColor.B + ((int)data[index].B - (int)test.B)); } } texture.SetData <Color>(data); return(texture); }
// Token: 0x060002FF RID: 767 RVA: 0x0003C7E8 File Offset: 0x0003A9E8 public static Texture2D changeColor(Texture2D texture, int targetColorIndex, Color baseColor, int range) { Color[] data = new Color[texture.Width * texture.Height]; texture.GetData <Color>(data); Color targetColor = data[targetColorIndex]; for (int i = 0; i < data.Length; i++) { if (ColorChanger.IsSimilar(data[i], targetColor, range, range, range)) { data[i] = new Color((int)(baseColor.R + (data[i].R - targetColor.R)), (int)(baseColor.G + (data[i].G - targetColor.G)), (int)(baseColor.B + (data[i].B - targetColor.B))); } } texture.SetData <Color>(data); return(texture); }
public static Texture2D changeColor(Texture2D texture, int targetColorIndex, int redtint, int greentint, int bluetint, int range) { Color[] array = new Color[texture.Width * texture.Height]; texture.GetData <Color>(array); Color test = array[targetColorIndex]; for (int i = 0; i < array.Length; i++) { if (ColorChanger.IsSimilar(array[i], test, range, range, range)) { array[i] = new Color((int)array[i].R + redtint, (int)array[i].G + greentint, (int)array[i].B + bluetint); } } texture.SetData <Color>(array); return(texture); }
public void recolorShoes(int which) { Texture2D texture2D = Game1.content.Load <Texture2D>("Characters\\Farmer\\shoeColors"); Color[] data = new Color[texture2D.Width * texture2D.Height]; texture2D.GetData <Color>(data); Color color1 = data[which * Game1.pixelZoom % (texture2D.Height * Game1.pixelZoom)]; Color color2 = data[which * Game1.pixelZoom % (texture2D.Height * Game1.pixelZoom) + 1]; Color color3 = data[which * Game1.pixelZoom % (texture2D.Height * Game1.pixelZoom) + 2]; Color color4 = data[which * Game1.pixelZoom % (texture2D.Height * Game1.pixelZoom) + 3]; ColorChanger.swapColor(this.baseTexture, 268, (int)color1.R, (int)color1.G, (int)color1.B); ColorChanger.swapColor(this.baseTexture, 269, (int)color2.R, (int)color2.G, (int)color2.B); ColorChanger.swapColor(this.baseTexture, 270, (int)color3.R, (int)color3.G, (int)color3.B); ColorChanger.swapColor(this.baseTexture, 271, (int)color4.R, (int)color4.G, (int)color4.B); }
public static Texture2D changeColor(Texture2D texture, int targetColorIndex, Color baseColor, int range) { Color[] array = new Color[texture.Width * texture.Height]; texture.GetData <Color>(array); Color test = array[targetColorIndex]; for (int i = 0; i < array.Length; i++) { if (ColorChanger.IsSimilar(array[i], test, range, range, range)) { array[i] = new Color((int)(baseColor.R + (array[i].R - test.R)), (int)(baseColor.G + (array[i].G - test.G)), (int)(baseColor.B + (array[i].B - test.B))); } } texture.SetData <Color>(array); return(texture); }
// Token: 0x060000EB RID: 235 RVA: 0x0000A320 File Offset: 0x00008520 public void recolorShoes(int which) { Texture2D shoeColors = Game1.content.Load <Texture2D>("Characters\\Farmer\\shoeColors"); Color[] shoeColorsData = new Color[shoeColors.Width * shoeColors.Height]; shoeColors.GetData <Color>(shoeColorsData); Color darkest = shoeColorsData[which * Game1.pixelZoom % (shoeColors.Height * Game1.pixelZoom)]; Color medium = shoeColorsData[which * Game1.pixelZoom % (shoeColors.Height * Game1.pixelZoom) + 1]; Color lightest = shoeColorsData[which * Game1.pixelZoom % (shoeColors.Height * Game1.pixelZoom) + 2]; Color lightest2 = shoeColorsData[which * Game1.pixelZoom % (shoeColors.Height * Game1.pixelZoom) + 3]; ColorChanger.swapColor(this.baseTexture, 268, (int)darkest.R, (int)darkest.G, (int)darkest.B); ColorChanger.swapColor(this.baseTexture, 269, (int)medium.R, (int)medium.G, (int)medium.B); ColorChanger.swapColor(this.baseTexture, 270, (int)lightest.R, (int)lightest.G, (int)lightest.B); ColorChanger.swapColor(this.baseTexture, 271, (int)lightest2.R, (int)lightest2.G, (int)lightest2.B); }
public int recolorSkin(int which) { Texture2D texture2D = Game1.content.Load <Texture2D>("Characters\\Farmer\\skinColors"); Color[] data = new Color[texture2D.Width * texture2D.Height]; if (which < 0) { which = texture2D.Height - 1; } if (which > texture2D.Height - 1) { which = 0; } texture2D.GetData <Color>(data); Color color1 = data[which * 3 % (texture2D.Height * 3)]; Color color2 = data[which * 3 % (texture2D.Height * 3) + 1]; Color color3 = data[which * 3 % (texture2D.Height * 3) + 2]; ColorChanger.swapColor(this.baseTexture, 260, (int)color1.R, (int)color1.G, (int)color1.B); ColorChanger.swapColor(this.baseTexture, 261, (int)color2.R, (int)color2.G, (int)color2.B); ColorChanger.swapColor(this.baseTexture, 262, (int)color3.R, (int)color3.G, (int)color3.B); return(which); }
// Token: 0x060000EC RID: 236 RVA: 0x0000A464 File Offset: 0x00008664 public int recolorSkin(int which) { Texture2D skinColors = Game1.content.Load <Texture2D>("Characters\\Farmer\\skinColors"); Color[] skinColorsData = new Color[skinColors.Width * skinColors.Height]; if (which < 0) { which = skinColors.Height - 1; } if (which > skinColors.Height - 1) { which = 0; } skinColors.GetData <Color>(skinColorsData); Color darkest = skinColorsData[which * 3 % (skinColors.Height * 3)]; Color medium = skinColorsData[which * 3 % (skinColors.Height * 3) + 1]; Color lightest = skinColorsData[which * 3 % (skinColors.Height * 3) + 2]; ColorChanger.swapColor(this.baseTexture, 260, (int)darkest.R, (int)darkest.G, (int)darkest.B); ColorChanger.swapColor(this.baseTexture, 261, (int)medium.R, (int)medium.G, (int)medium.B); ColorChanger.swapColor(this.baseTexture, 262, (int)lightest.R, (int)lightest.G, (int)lightest.B); return(which); }
public void recolorEyes(Color lightestColor) { Color[] data = new Color[23]; this.baseTexture.GetData <Color>(0, new Rectangle?(new Rectangle(256, 0, 23, 1)), data, 0, 23); Color other = FarmerRenderer.changeBrightness(lightestColor, -75); if (lightestColor.Equals(other)) { lightestColor.B += (byte)10; } for (int index = 256; index < data.Length; ++index) { if (lightestColor.Equals(data[index])) { ++lightestColor.G; } if (other.Equals(data[index])) { ++other.G; } } ColorChanger.swapColor(this.baseTexture, 276, (int)lightestColor.R, (int)lightestColor.G, (int)lightestColor.B); ColorChanger.swapColor(this.baseTexture, 277, (int)other.R, (int)other.G, (int)other.B); }
// Token: 0x060000EA RID: 234 RVA: 0x0000A224 File Offset: 0x00008424 public void recolorEyes(Color lightestColor) { Color[] tmp = new Color[23]; this.baseTexture.GetData <Color>(0, new Rectangle?(new Rectangle(256, 0, 23, 1)), tmp, 0, 23); Color darkerColor = FarmerRenderer.changeBrightness(lightestColor, -75); if (lightestColor.Equals(darkerColor)) { lightestColor.B += 10; } for (int i = 256; i < tmp.Length; i++) { if (lightestColor.Equals(tmp[i])) { lightestColor.G += 1; } if (darkerColor.Equals(tmp[i])) { darkerColor.G += 1; } } ColorChanger.swapColor(this.baseTexture, 276, (int)lightestColor.R, (int)lightestColor.G, (int)lightestColor.B); ColorChanger.swapColor(this.baseTexture, 277, (int)darkerColor.R, (int)darkerColor.G, (int)darkerColor.B); }
public void recolorEyes(Color lightestColor) { Color[] array = new Color[23]; this.baseTexture.GetData <Color>(0, new Rectangle?(new Rectangle(256, 0, 23, 1)), array, 0, 23); Color other = FarmerRenderer.changeBrightness(lightestColor, -75); if (lightestColor.Equals(other)) { lightestColor.B += 10; } for (int i = 256; i < array.Length; i++) { if (lightestColor.Equals(array[i])) { lightestColor.G += 1; } if (other.Equals(array[i])) { other.G += 1; } } ColorChanger.swapColor(this.baseTexture, 276, (int)lightestColor.R, (int)lightestColor.G, (int)lightestColor.B); ColorChanger.swapColor(this.baseTexture, 277, (int)other.R, (int)other.G, (int)other.B); }
public void colorTool(int level) { int initialLocation = 0; int startPixel = 0; switch (BaseName.Split(' ').Last()) { case "Hoe": initialLocation = 69129; startPixel = 65536; break; case "Pickaxe": initialLocation = 100749; startPixel = 98304; break; case "Axe": initialLocation = 134681; startPixel = 131072; break; case "Can": initialLocation = 168713; startPixel = 163840; break; } int red = 0; int green = 0; int blue = 0; switch (level) { case 1: red = 198; green = 108; blue = 43; break; case 2: red = 197; green = 226; blue = 222; break; case 3: red = 248; green = 255; blue = 73; break; case 4: red = 144; green = 135; blue = 181; break; } if (startPixel > 0 && level > 0) { if (BaseName.Contains("Can")) { ColorChanger.swapColor(Game1.toolSpriteSheet, initialLocation + 36, red * 5 / 4, green * 5 / 4, blue * 5 / 4, startPixel, startPixel + 32768); } ColorChanger.swapColor(Game1.toolSpriteSheet, initialLocation + 8, red, green, blue, startPixel, startPixel + 32768); ColorChanger.swapColor(Game1.toolSpriteSheet, initialLocation + 4, red * 3 / 4, green * 3 / 4, blue * 3 / 4, startPixel, startPixel + 32768); ColorChanger.swapColor(Game1.toolSpriteSheet, initialLocation, red * 3 / 8, green * 3 / 8, blue * 3 / 8, startPixel, startPixel + 32768); } }
public void colorTool(int level) { int num = 0; int num2 = 0; string a = this.name.Split(new char[] { ' ' }).Last <string>(); if (!(a == "Hoe")) { if (!(a == "Pickaxe")) { if (!(a == "Axe")) { if (a == "Can") { num = 168713; num2 = 163840; } } else { num = 134681; num2 = 131072; } } else { num = 100749; num2 = 98304; } } else { num = 69129; num2 = 65536; } int num3 = 0; int num4 = 0; int num5 = 0; switch (level) { case 1: num3 = 198; num4 = 108; num5 = 43; break; case 2: num3 = 197; num4 = 226; num5 = 222; break; case 3: num3 = 248; num4 = 255; num5 = 73; break; case 4: num3 = 144; num4 = 135; num5 = 181; break; } if (num2 > 0 && level > 0) { if (this.name.Contains("Can")) { ColorChanger.swapColor(Game1.toolSpriteSheet, num + 36, num3 * 5 / 4, num4 * 5 / 4, num5 * 5 / 4, num2, num2 + 32768); } ColorChanger.swapColor(Game1.toolSpriteSheet, num + 8, num3, num4, num5, num2, num2 + 32768); ColorChanger.swapColor(Game1.toolSpriteSheet, num + 4, num3 * 3 / 4, num4 * 3 / 4, num5 * 3 / 4, num2, num2 + 32768); ColorChanger.swapColor(Game1.toolSpriteSheet, num, num3 * 3 / 8, num4 * 3 / 8, num5 * 3 / 8, num2, num2 + 32768); } }
// Token: 0x06000300 RID: 768 RVA: 0x0003C89F File Offset: 0x0003AA9F public static Texture2D swapColor(Texture2D texture, int targetColorIndex, int red, int green, int blue) { return(ColorChanger.swapColor(texture, targetColorIndex, red, green, blue, 0, texture.Width * texture.Height)); }
public void colorTool(int level) { int targetColorIndex = 0; int startPixel = 0; string str = ((IEnumerable <string>) this.name.Split(' ')).Last <string>(); if (!(str == "Hoe")) { if (!(str == "Pickaxe")) { if (!(str == "Axe")) { if (str == "Can") { targetColorIndex = 168713; startPixel = 163840; } } else { targetColorIndex = 134681; startPixel = 131072; } } else { targetColorIndex = 100749; startPixel = 98304; } } else { targetColorIndex = 69129; startPixel = 65536; } int red = 0; int green = 0; int blue = 0; switch (level) { case 1: red = 198; green = 108; blue = 43; break; case 2: red = 197; green = 226; blue = 222; break; case 3: red = 248; green = (int)byte.MaxValue; blue = 73; break; case 4: red = 144; green = 135; blue = 181; break; } if (startPixel <= 0 || level <= 0) { return; } if (this.name.Contains("Can")) { ColorChanger.swapColor(Game1.toolSpriteSheet, targetColorIndex + 36, red * 5 / 4, green * 5 / 4, blue * 5 / 4, startPixel, startPixel + 32768); } ColorChanger.swapColor(Game1.toolSpriteSheet, targetColorIndex + 8, red, green, blue, startPixel, startPixel + 32768); ColorChanger.swapColor(Game1.toolSpriteSheet, targetColorIndex + 4, red * 3 / 4, green * 3 / 4, blue * 3 / 4, startPixel, startPixel + 32768); ColorChanger.swapColor(Game1.toolSpriteSheet, targetColorIndex, red * 3 / 8, green * 3 / 8, blue * 3 / 8, startPixel, startPixel + 32768); }
// Token: 0x060007B7 RID: 1975 RVA: 0x000A8808 File Offset: 0x000A6A08 public void colorTool(int level) { int initialLocation = 0; int startPixel = 0; string a = this.name.Split(new char[] { ' ' }).Last <string>(); if (!(a == "Hoe")) { if (!(a == "Pickaxe")) { if (!(a == "Axe")) { if (a == "Can") { initialLocation = 168713; startPixel = 163840; } } else { initialLocation = 134681; startPixel = 131072; } } else { initialLocation = 100749; startPixel = 98304; } } else { initialLocation = 69129; startPixel = 65536; } int red = 0; int green = 0; int blue = 0; switch (level) { case 1: red = 198; green = 108; blue = 43; break; case 2: red = 197; green = 226; blue = 222; break; case 3: red = 248; green = 255; blue = 73; break; case 4: red = 144; green = 135; blue = 181; break; } if (startPixel > 0 && level > 0) { if (this.name.Contains("Can")) { Game1.toolSpriteSheet = ColorChanger.swapColor(Game1.toolSpriteSheet, initialLocation + 36, red * 5 / 4, green * 5 / 4, blue * 5 / 4, startPixel, startPixel + 32768); } Game1.toolSpriteSheet = ColorChanger.swapColor(Game1.toolSpriteSheet, initialLocation + 8, red, green, blue, startPixel, startPixel + 32768); Game1.toolSpriteSheet = ColorChanger.swapColor(Game1.toolSpriteSheet, initialLocation + 4, red * 3 / 4, green * 3 / 4, blue * 3 / 4, startPixel, startPixel + 32768); Game1.toolSpriteSheet = ColorChanger.swapColor(Game1.toolSpriteSheet, initialLocation, red * 3 / 8, green * 3 / 8, blue * 3 / 8, startPixel, startPixel + 32768); } }