static void Postfix(Map ___map, bool __result, Area_Allowed area) { if (__result) { ___map.GetListerFilthInAreas().EnsureAreaHasKey(area); ___map.GetCleaningManager().MarkAddablesOutdated(); } }
public void Swap(Area_Allowed a, Area b) { int temp = areaIndex[a.ID]; areaIndex[a.ID] = areaIndex[b.ID]; areaIndex[b.ID] = temp; SortMap(); }
private static void ChangeColour(Area_Allowed area) { Find.WindowStack.Add(new Dialog_ColourPicker(area.Color, (colour) => { Traverse.Create(area).Field("colorInt").SetValue(colour); // we also need to clear the texture and material caches Traverse.Create(area).Field("colorTextureInt").SetValue(null); Traverse.Create(area).Field("drawer").SetValue(null); })); }
public void AddStartingAreas() { this.areas.Add(new Area_Home(this)); this.areas.Add(new Area_BuildRoof(this)); this.areas.Add(new Area_NoRoof(this)); this.areas.Add(new Area_SnowClear(this)); Area_Allowed area_Allowed = default(Area_Allowed); this.TryMakeNewAllowed(AllowedAreaMode.Humanlike, out area_Allowed); this.TryMakeNewAllowed(AllowedAreaMode.Animal, out area_Allowed); }
public bool TryMakeNewAllowed(out Area_Allowed area) { if (!CanMakeNewAllowed()) { area = null; return(false); } area = new Area_Allowed(this); areas.Add(area); SortAreas(); return(true); }
public bool TryMakeNewAllowed(AllowedAreaMode mode, out Area_Allowed area) { if (!this.CanMakeNewAllowed(mode)) { area = null; return(false); } area = new Area_Allowed(this, mode, null); this.areas.Add(area); this.SortAreas(); return(true); }
public static void setLabel(Area_Allowed area, string label) { use_native = true; try { area.SetLabel(label); } finally { use_native = false; } }
public static bool prefix(Area_Allowed __instance, string label) { if (use_native) { return(true); } else { setLabel(__instance, label); return(false); } }
//Unoptimized non-static AccessTools but this isn't called often public static void SetColor(this Area_Allowed area, Color color) { FieldInfo colorInfo = AccessTools.Field(typeof(Area_Allowed), "colorInt"); colorInfo.SetValue(area, color); FieldInfo colorTextureInfo = AccessTools.Field(typeof(Area_Allowed), "colorTextureInt"); colorTextureInfo.SetValue(area, null); FieldInfo drawerInfo = AccessTools.Field(typeof(Area_Allowed), "drawer"); drawerInfo.SetValue(area, null); }
private void SetArea(Designator_AreaAllowedExpand des, Area_Allowed a) { if (a == null) { return; } Type desType = typeof(Designator_AreaAllowed); FieldInfo areaToSet = desType.GetField("selectedArea", BindingFlags.NonPublic | BindingFlags.Static); if (areaToSet != null) { areaToSet.SetValue(null, a); } }
public bool TryMakeNewAllowed(out Area_Allowed area) { bool result; if (!this.CanMakeNewAllowed()) { area = null; result = false; } else { area = new Area_Allowed(this, null); this.areas.Add(area); this.SortAreas(); result = true; } return(result); }
public int AdjustFor(Area_Allowed area) { return(areaIndex.GetValueSafe(area.ID)); }
public static void Postfix(Area_Allowed __instance, ref int __result) { __result -= __instance.Map.GetComponent <MapComponent_AreaOrder>()?.AdjustFor(__instance) ?? 0; }
public Dialog_RecolorArea(Area_Allowed area) { this.area = area; this.curName = ColorUtility.ToHtmlStringRGB(area.Color).ToUpper(); }