public void SetApparelColor(Apparel a, Color color) { #if DEBUG || DEBUG_APPAREL_COLOR Log.Warning("Start PawnOutfitTracker.SetApparelColor (Apparel: " + a.Label + " Color: " + color + ")"); #endif this.InitApparelColor(); int layer = Util.ToInt(this.GetOuterMostLayer(a)); SlotColor slotColor = this.ApparelColors[(int)layer]; slotColor.IsAssigned = true; slotColor.Color = color; this.ApparelColors[(int)layer] = slotColor; /*foreach (ApparelLayerDef layer in a.def.apparel.layers) * { #if DEBUG || DEBUG_APPAREL_COLOR * Log.Warning(" Setting layer " + layer); #endif * SlotColor slotColor = this.ApparelColors[(int)layer]; * slotColor.IsAssigned = true; * slotColor.Color = color; * this.ApparelColors[(int)layer] = slotColor; * }*/ #if DEBUG || DEBUG_APPAREL_COLOR Log.Warning("End PawnOutfitTracker.SetApparelColor (Apparel: " + a.Label + " Color: " + color + ")"); #endif }
public void ApplyApparelColor(Apparel a) { #if DEBUG || DEBUG_APPAREL_COLOR Log.Warning("Start PawnOutfitTracker.ApplyApparelColor (Apparel: " + a.Label + ")"); #endif int layer = Util.ToInt(this.GetOuterMostLayer(a)); if (this.ApparelColors != null && this.ApparelColors.Count > layer) { SlotColor slotColor = this.ApparelColors[layer]; //a.DrawColor = slotColor.Color; CompColorableUtility.SetColor(a, slotColor.Color, true); /*foreach (ApparelLayerDef layer in a.def.apparel.layers) * { * SlotColor slotColor = this.ApparelColors[(int)layer]; * if (slotColor.IsAssigned) * { * a.DrawColor = slotColor.Color; #if DEBUG || DEBUG_APPAREL_COLOR * Log.Warning(" Setting layer " + layer + " color to: " + slotColor.Color); #endif * break; * } #if DEBUG || DEBUG_APPAREL_COLOR * else * { * Log.Warning(" No color assigned for layer " + layer); * } #endif * }*/ } #if DEBUG || DEBUG_APPAREL_COLOR Log.Warning("End PawnOutfitTracker.ApplyApparelColor (Apparel: " + a.Label + ")"); #endif }
public void SetLayerColor(ApparelLayerDef layer, Color c) { int layerInt = Util.ToInt(layer); this.InitApparelColor(); if (this.ApparelColors != null && this.ApparelColors.Count > layerInt) { SlotColor sc = this.ApparelColors[layerInt]; sc.Color = c; sc.IsAssigned = true; this.ApparelColors[layerInt] = sc; } }
public Color GetLayerColor(ApparelLayerDef layer, bool getFromWorn = false) { int layerInt = Util.ToInt(layer); if (this.ApparelColors != null && this.ApparelColors.Count > layerInt) { SlotColor sc = this.ApparelColors[layerInt]; if (sc.IsAssigned) { return(sc.Color); } } if (getFromWorn) { foreach (Apparel a in this.Pawn.apparel.WornApparel) { if (a.def.apparel.LastLayer == layer) { return(a.DrawColor); } } } return(Color.white); }