static void Postfix(Dialog_ManageOutfits __instance, Rect inRect) { if (Widgets.ButtonText(new Rect(480f, 0f, 150f, 35f), "SaveStorageSettings.LoadAsNew".Translate(), true, false, true)) { Outfit outfit = Current.Game.outfitDatabase.MakeNewOutfit(); SetSelectedOutfit(__instance, outfit); Find.WindowStack.Add(new LoadFilterDialog("Apparel_Management", outfit.filter)); } Outfit selectedOutfit = GetSelectedOutfit(__instance); if (selectedOutfit != null) { Text.Font = GameFont.Small; GUI.BeginGroup(new Rect(220f, 49f, 300, 32f)); if (Widgets.ButtonText(new Rect(0f, 0f, 150f, 32f), "SaveStorageSettings.LoadOutfit".Translate(), true, false, true)) { Find.WindowStack.Add(new LoadFilterDialog("Apparel_Management", selectedOutfit.filter)); } if (Widgets.ButtonText(new Rect(160f, 0f, 150f, 32f), "SaveStorageSettings.SaveOutfit".Translate(), true, false, true)) { Find.WindowStack.Add(new SaveFilterDialog("Apparel_Management", selectedOutfit.filter)); } GUI.EndGroup(); } }
public static void Dialog_ManageOutfits(Dialog_ManageOutfits __instance, Outfit selectedOutfit) { if (apparelGlobalFilterGet() == null) { var filter = new MarketValueFilter(); apparelGlobalFilterInfo.SetValue(null, filter); filter.SetAllow(ThingCategoryDefOf.Apparel, true); } }
public void DoOutfitHeader(Rect rect) { MouseoverSounds.DoRegion(rect); Rect rect2 = new Rect(rect.x, rect.y + (rect.height - 65f), Mathf.Min(rect.width, 360f), 32f); if (Widgets.ButtonText(rect2, "ManageOutfits".Translate())) { var window = new Dialog_ManageOutfits(null); Find.WindowStack.Add(window); PlayerKnowledgeDatabase.KnowledgeDemonstrated(ConceptDefOf.Outfits, KnowledgeAmount.Total); } UIHighlighter.HighlightOpportunity(rect2, "ManageOutfits"); }
public static void Before_DoWindowContents(Rect inRect, Dialog_ManageOutfits __instance) { if (GetSelectedOutfit(__instance) == null) { return; } if (!Settings.EnableOutfitFilter) { return; } ThingFilterUtil.QueueNextInvocationSearch(SearchCategories.Outfit); }
public void DoOutfitCell(Rect rect) { int num = Mathf.FloorToInt((rect.width - 4f) * 0.714285731f); int num2 = Mathf.FloorToInt((rect.width - 4f) * 0.2857143f); float x = rect.x; bool somethingIsForced = this.colonistGroup.pawns.First().outfits.forcedHandler.SomethingIsForced; Rect rect2 = new Rect(x, rect.y + 2f, num, rect.height - 4f); if (somethingIsForced) { rect2.width -= 4f + (float)num2; } Widgets.Dropdown(rect2, this.colonistGroup, (ColonistGroup group) => group.pawns.First().outfits.CurrentOutfit, Button_GenerateMenu, this.colonistGroup.pawns.First().outfits.CurrentOutfit.label.Truncate(rect2.width), null, this.colonistGroup.pawns.First().outfits.CurrentOutfit.label, null, null, paintable: true); x += rect2.width; x += 4f; Rect rect3 = new Rect(x, rect.y + 2f, num2, rect.height - 4f); if (somethingIsForced) { if (Widgets.ButtonText(rect3, "ClearForcedApparel".Translate())) { foreach (var pawn in this.colonistGroup.pawns) { pawn.outfits.forcedHandler.Reset(); } } x += (float)num2; x += 4f; } Rect rect4 = new Rect(x, rect.y + 2f, num2, rect.height - 4f); if (Widgets.ButtonText(rect4, "AssignTabEdit".Translate())) { var window = new Dialog_ManageOutfits(colonistGroup.pawns.First().outfits.CurrentOutfit); Find.WindowStack.Add(window); } x += (float)num2; }
private static void SetSelectedOutfit(Dialog_ManageOutfits dialog, Outfit selectedOutfit) { typeof(Dialog_ManageOutfits).GetProperty("SelectedOutfit", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetProperty).SetValue(dialog, selectedOutfit, null); }
private static Outfit GetSelectedOutfit(Dialog_ManageOutfits dialog) { return((Outfit)typeof(Dialog_ManageOutfits).GetProperty("SelectedOutfit", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetProperty).GetValue(dialog, null)); }
static void Postfix(Dialog_ManageOutfits __instance, ref Outfit __result) { __result = (Outfit)AccessTools.TypeByName("StorageSearch.Dialog_ManageOutfits_Patch") .GetProperty("SelectedOutfit", AccessTools.all).GetValue(null, null); }