public SetUpCamp(ModContentPack content) : base(content) { settings = GetSettings <SetUpCampSettings>(); var harmony = new Harmony("Syrchalis.Rimworld.SetUpCamp"); MethodInfo method = typeof(Caravan).GetMethod("GetGizmos"); HarmonyMethod prefix = null; HarmonyMethod postfix = new HarmonyMethod(typeof(SetUpCamp).GetMethod("GetGizmosPostfix"));; harmony.Patch(method, prefix, postfix, null); #if DEBUG Log.Message("[SetUpCamp] loaded..."); #endif }
public override IEnumerable <Gizmo> GetGizmos() { SetUpCampSettings settings = LoadedModManager.GetMod <SetUpCamp>().GetSettings <SetUpCampSettings>(); foreach (Gizmo g in base.GetGizmos()) { yield return(g); g.disabledReason = null; } bool showDestroyButton = HasMap && SetUpCampSettings.permanentCamps; if (showDestroyButton) { yield return(new Command_Action { defaultLabel = "SetUpCampDestroyCamp".Translate(), defaultDesc = "SetUpCampDestroyCampDesc".Translate(), icon = ContentFinder <Texture2D> .Get("UI/Commands/DeleteCamp", true), action = delegate() { bool pawnblock = Map.mapPawns.AnyPawnBlockingMapRemoval; if (!pawnblock) { Find.WindowStack.Add(new Dialog_MessageBox("SetUpCampAbandonDialogue".Translate(), "AcceptButton".Translate(), delegate() { Messages.Message("SetUpCampAbandoned".Translate(), MessageTypeDefOf.TaskCompletion); shouldBeDeleted = true; Tick(); }, "CancelButton".Translate(), null, null, false, null, null)); } else { Messages.Message("SetUpCampStillInUse".Translate(), MessageTypeDefOf.RejectInput); shouldBeDeleted = false; } } }); } yield break; }
public SetUpCamp(ModContentPack content) : base(content) { settings = GetSettings <SetUpCampSettings>(); }