private void DrawFloatMenu() { var options = new List <FloatMenuOption> { new FloatMenuOption("NoAreaAllowed".Translate(), () => Mod_Multiplayer.SetArea(Model.Base, null)) }; options.AddRange(from area in Find.CurrentMap.areaManager.AllAreas.Where(area => area.AssignableAsAllowed()) select new FloatMenuOption(area.Label, () => Mod_Multiplayer.SetArea(Model.Base, area))); options.Add(new FloatMenuOption(Lang.Get("Model.Selector.Manage").Italic(), () => Find.WindowStack.Add(new Dialog_ManageAreas(Find.CurrentMap)))); Find.WindowStack.Add(new FloatMenu(options)); }
private static void DrawButtons(Rect rect, ref float lineEndWidth) { if (Find.Selector.NumSelected != 1) { return; } var selected = Find.Selector.SingleSelectedThing; if (selected == null) { return; } lineEndWidth += ButtonSize; Widgets.InfoCardButton(rect.width - lineEndWidth, 0f, selected); if (!(selected is Pawn pawn) || !PlayerControlled(pawn)) { return; } if (pawn.playerSettings.UsesConfigurableHostilityResponse) { lineEndWidth += ButtonSize; HostilityResponseModeUtility.DrawResponseButton(new Rect(rect.width - lineEndWidth, 0f, ButtonSize, ButtonSize), pawn, false); lineEndWidth += GUIPlus.SmallPadding; } lineEndWidth += ButtonSize; var careRect = new Rect(rect.width - lineEndWidth, 0f, ButtonSize, ButtonSize); MedicalCareUtility.MedicalCareSelectButton(careRect, pawn); GUIPlus.DrawTooltip(careRect, new TipSignal(() => Lang.Get("InspectPane.MedicalCare", pawn.KindLabel, pawn.playerSettings.medCare.GetLabel()), GUIPlus.TooltipId), true); lineEndWidth += GUIPlus.SmallPadding; if (!pawn.IsColonist) { return; } lineEndWidth += ButtonSize; var canDoctor = !pawn.WorkTypeIsDisabled(WorkTypeDefOf.Doctor); var canDoctorPriority = (pawn.workSettings == null) || (pawn.workSettings?.GetPriority(WorkTypeDefOf.Doctor) > 0); var selfTendRect = new Rect(rect.width - lineEndWidth, 0f, ButtonSize, ButtonSize); var selfTendTip = "SelfTendTip".Translate(Faction.OfPlayer.def.pawnsPlural, 0.7f.ToStringPercent()).CapitalizeFirst(); if (!canDoctor) { selfTendTip += "\n\n" + "MessageCannotSelfTendEver".Translate(pawn.LabelShort, pawn); } else if (!canDoctorPriority) { selfTendTip += "\n\n" + "MessageSelfTendUnsatisfied".Translate(pawn.LabelShort, pawn); } GUIPlus.SetFont(GameFont.Tiny); var selfTend = pawn.playerSettings.selfTend; selfTend = GUIPlus.DrawToggle(selfTendRect, selfTend, new TipSignal(() => selfTendTip, GUIPlus.TooltipId), canDoctor, Textures.SelfTendOnIcon, Textures.SelfTendOffIcon); if (selfTend != pawn.playerSettings.selfTend) { Mod_Multiplayer.SetSelfTend(pawn, selfTend); } GUIPlus.ResetFont(); lineEndWidth += GUIPlus.SmallPadding; }
private void DrawFloatMenu() { var options = (from outfit in Current.Game.outfitDatabase.AllOutfits select new FloatMenuOption(outfit.label, () => Mod_Multiplayer.SetOutfit(Model.Base, outfit))).ToList(); options.Add(new FloatMenuOption(Lang.Get("Model.Selector.Manage").Italic(), () => Find.WindowStack.Add(new Dialog_ManageOutfits(Model.Base.outfits.CurrentOutfit)))); Find.WindowStack.Add(new FloatMenu(options)); }
private void DrawFloatMenu() { try { var model = Model; var options = (from food in Current.Game.foodRestrictionDatabase.AllFoodRestrictions select new FloatMenuOption(food.label, () => Mod_Multiplayer.SetFoodRestriction(model.Base, food))).ToList(); options.Add(new FloatMenuOption(Lang.Get("Model.Selector.Manage").Italic(), () => Find.WindowStack.Add(new Dialog_ManageFoodRestrictions(model.Base.foodRestriction.CurrentFoodRestriction)))); Find.WindowStack.Add(new FloatMenu(options)); } catch (Exception exception) { Mod.HandleError(exception); } }
private void DrawFloatMenu() { var hour = GenLocalDate.HourOfDay(Model.Base); var options = DefDatabase <TimeAssignmentDef> .AllDefs.Select(timeAssignment => new FloatMenuOption(Lang.Get("Model.Selector.SetTimeAssignment", hour, timeAssignment.LabelCap), () => Mod_Multiplayer.SetAssignment(Model.Base, hour, timeAssignment))).ToList(); options.Add(new FloatMenuOption(Lang.Get("Model.Selector.Manage").Italic(), () => Find.MainTabsRoot.SetCurrentTab(Access.MainButtonDefOfRestrict))); Find.WindowStack.Add(new FloatMenu(options)); }