//=====================================================================================================\\ public override void DoSettingsWindowContents(Rect rect) { Color headerColor = new Color( r: 1.0f, g: 0.9725490f, b: 0.239215686f, a: 1.0f ); GUIStyleState headerState = new GUIStyleState() { textColor = headerColor }; GUIStyle headerStyle = new GUIStyle(Text.CurFontStyle); headerStyle.fontStyle = FontStyle.Bold; headerStyle.normal = headerState; GUIStyle hdStyle = new GUIStyle(Text.CurFontStyle); hdStyle.alignment = TextAnchor.MiddleLeft; hdStyle.fontSize = 11; hdStyle.fontStyle = FontStyle.Bold; hdStyle.normal = new GUIStyleState() { textColor = new Color( r: 1.0f, g: 0.74117647f, b: 0.2392156862f, a: 1.0f ) }; hdStyle.padding = new RectOffset(4, 0, 0, 0); Listing_Standard listing = new Listing_Standard(GameFont.Small); Listing_Standard listingPresets = new Listing_Standard(GameFont.Small); List <KeyValuePair <string, int> > overrides = new IndividualOverrides().ViewInternalOverrides(); // 3 headers // 2 table headers // 2 spacers // 23 ish listing.regulars // individualoverrides.count float height = (3 * (Verse.Text.LineHeight + 2)) // include 2 for bottom border + (2 * (hdStyle.lineHeight)) // table headers + (2 * 15) // spacer hight 15 + (23 * (Verse.Text.LineHeight + 7)) // divider line is 7 in regular listing entries + (overrides.Count * (Verse.Text.LineHeight + 3)) // divider line is 3 in overrides + 40; // for fudge making Rect mainRect = new Rect( x: 0, y: 0, width: rect.width - 25, //25 for scrollbar height: height ); Widgets.BeginScrollView(rect, ref this.settings.ScrollPosition, mainRect, true); Rect mainLeft = mainRect.LeftPart(0.78f); Rect mainRight = mainRect.RightPart(0.20f); // PRESETS listingPresets.ColumnWidth = mainRight.width; listingPresets.Begin(mainRight); Rect section = listingPresets.GetRect(Verse.Text.LineHeight + 2); TextAnchor anchor = Text.Anchor; Text.Anchor = TextAnchor.UpperLeft; GUI.Box(section, Translator.Translate("OgreStack.SectionHeader.Presets"), headerStyle); Text.Anchor = anchor; Color color = GUI.color; GUI.color = Color.grey; Widgets.DrawLineHorizontal(section.x, section.y + section.height - 1, section.width); Widgets.DrawLineHorizontal(section.x, section.y + section.height - 2, section.width); GUI.color = color; // Ogre section = listingPresets.GetRect(hdStyle.lineHeight); GUI.Box(section, Translator.Translate("OgreStack.Presets.Section.Ogre"), hdStyle); section = listingPresets.GetRect(7); color = GUI.color; GUI.color = Color.grey; Widgets.DrawLineHorizontal(section.x, section.y + 3, section.width); GUI.color = color; foreach (Preset p in Presets.GetOgrePresets()) { section = listingPresets.GetRect(Verse.Text.LineHeight); GUI.SetNextControlName(p.NameKey); if (Widgets.ButtonText(section, Translator.Translate(p.NameKey))) { p.Modify(this.settings); } section = listingPresets.GetRect(1); } listingPresets.GetRect(7); // Scalar section = listingPresets.GetRect(hdStyle.lineHeight); GUI.Box(section, Translator.Translate("OgreStack.Presets.Section.Scalar"), hdStyle); section = listingPresets.GetRect(7); color = GUI.color; GUI.color = Color.grey; Widgets.DrawLineHorizontal(section.x, section.y + 3, section.width); GUI.color = color; foreach (Preset p in Presets.GetScalarPresets()) { section = listingPresets.GetRect(Verse.Text.LineHeight); GUI.SetNextControlName(p.NameKey); if (Widgets.ButtonText(section, Translator.Translate(p.NameKey))) { p.Modify(this.settings); } section = listingPresets.GetRect(1); } listingPresets.End(); // SETTINGS listing.ColumnWidth = mainLeft.width; listing.Begin(mainLeft); section = listing.GetRect(Verse.Text.LineHeight + 2); anchor = Text.Anchor; Text.Anchor = TextAnchor.UpperLeft; GUI.Box(section, Translator.Translate("OgreStack.SectionHeader.Settings"), headerStyle); Text.Anchor = anchor; color = GUI.color; GUI.color = Color.grey; Widgets.DrawLineHorizontal(section.x, section.y + section.height - 1, section.width); Widgets.DrawLineHorizontal(section.x, section.y + section.height - 2, section.width); GUI.color = color; Rect header = listing.GetRect(hdStyle.lineHeight); GUI.Box(GenUI.LeftPart(header, 0.6f), Translator.Translate("OgreStack.Settings.Category"), hdStyle); Rect headerInputs = GenUI.RightPart(header, 0.4f); Rect boxModeHd = GenUI.LeftHalf(headerInputs); GUI.Box(boxModeHd, Translator.Translate("OgreStack.Settings.Mode"), hdStyle); GUI.Box(GenUI.RightHalf(headerInputs), Translator.Translate("OgreStack.Settings.Value"), hdStyle); TooltipHandler.TipRegion(boxModeHd, Translator.Translate("OgreStack.Settings.Mode.Desc")); List <Category> allCats = new List <Category>(OgreStackMod._PROCESSING_ORDER); allCats.Add(Category.Other); foreach (Category c in allCats) { // separator line Rect divider = listing.GetRect(7); color = GUI.color; GUI.color = Color.grey; Widgets.DrawLineHorizontal(divider.x, divider.y + 3, divider.width); GUI.color = color; // Container for row Rect container = listing.GetRect(Verse.Text.LineHeight); Widgets.DrawHighlightIfMouseover(container); // Category Rect boxCategory = GenUI.LeftPart(container, 0.6f); anchor = Text.Anchor; Text.Anchor = TextAnchor.MiddleLeft; Widgets.Label(boxCategory, Translator.Translate("OgreStack.Settings." + c.ToString() + ".Title")); Text.Anchor = anchor; TooltipHandler.TipRegion(boxCategory, Translator.Translate("OgreStack.Settings." + c.ToString() + ".Desc")); // MODE Rect boxInputs = GenUI.RightPart(container, 0.4f); //Rect boxMode = GenUI.LeftHalf(boxInputs); Rect boxMode = GenUI.LeftPart(boxInputs, 0.49f); Rect boxValue = GenUI.Rounded(GenUI.RightHalf(boxInputs)); Widgets.Dropdown <MultiplierMode, MultiplierMode>( rect: boxMode, // no idea what target // and getPayload are for/do target: MultiplierMode.Fixed, getPayload: (s) => { return(s); }, // This appears to update automatically buttonLabel: Translator.Translate("OgreStack.Settings.Mode." + this.settings.Values[c].Mode.ToString()), menuGenerator: (s) => { List <Widgets.DropdownMenuElement <MultiplierMode> > rv = new List <Widgets.DropdownMenuElement <MultiplierMode> >(); rv.Add(new Widgets.DropdownMenuElement <MultiplierMode>() { option = new FloatMenuOption(Translator.Translate("OgreStack.Settings.Mode.Scalar"), () => { this.settings.Values[c].Mode = MultiplierMode.Scalar; }), payload = MultiplierMode.Scalar }); rv.Add(new Widgets.DropdownMenuElement <MultiplierMode>() { option = new FloatMenuOption(Translator.Translate("OgreStack.Settings.Mode.Fixed"), () => { this.settings.Values[c].Mode = MultiplierMode.Fixed; }), payload = MultiplierMode.Fixed }); return(rv); } ); // VALUE this.settings.Values[c].Buffer = Widgets.TextField(boxValue, this.settings.Values[c].Buffer); if (!this.settings.Values[c].ParseBuffer()) { color = GUI.color; GUI.color = new Color(0.662745f, 0f, 0f); Widgets.DrawBox(GenUI.Rounded(boxValue), 2); GUI.color = color; } } Rect space = listing.GetRect(15); section = listing.GetRect(Verse.Text.LineHeight + 2); anchor = Text.Anchor; Text.Anchor = TextAnchor.UpperLeft; GUI.Box(section, Translator.Translate("OgreStack.SectionHeader.SingleThingDefTargeting"), headerStyle); Text.Anchor = anchor; color = GUI.color; GUI.color = Color.grey; Widgets.DrawLineHorizontal(section.x, section.y + section.height - 1, section.width); Widgets.DrawLineHorizontal(section.x, section.y + section.height - 2, section.width); GUI.color = color; anchor = Text.Anchor; Text.Anchor = TextAnchor.MiddleLeft; Widgets.Label(listing.GetRect(Verse.Text.LineHeight * 3), Translator.Translate("OgreStack.Settings.SingleThingDefTargeting.Desc", DataUtil.GenerateFilePath(DataUtil._OVERRIDES_FILE_NAME).Replace("/", "\\"))); Text.Anchor = anchor; header = listing.GetRect(hdStyle.lineHeight); anchor = Text.Anchor; Text.Anchor = TextAnchor.MiddleLeft; GUI.Box(GenUI.LeftPart(header, 0.35f), Translator.Translate("OgreStack.Settings.DefName"), hdStyle); GUI.Box(GenUI.RightPart(header, 0.65f), Translator.Translate("OgreStack.Settings.StackLimit"), hdStyle); Text.Anchor = anchor; foreach (KeyValuePair <string, int> kvp in overrides) { string defName = kvp.Key; int stackLimit = kvp.Value; // separator line Rect divider = listing.GetRect(3); color = GUI.color; GUI.color = Color.grey; Widgets.DrawLineHorizontal(divider.x, divider.y + 1, divider.width); GUI.color = color; // Container for row Rect container = listing.GetRect(Verse.Text.LineHeight); Widgets.DrawHighlightIfMouseover(container); // DefName Rect boxDefName = GenUI.LeftPart(container, 0.35f); anchor = Text.Anchor; Text.Anchor = TextAnchor.MiddleLeft; Widgets.Label(boxDefName, defName); Text.Anchor = anchor; // StackLimit Rect boxStackLimit = GenUI.RightPart(container, 0.65f); anchor = Text.Anchor; Text.Anchor = TextAnchor.MiddleLeft; Widgets.Label(boxStackLimit, stackLimit.ToString()); Text.Anchor = anchor; // Show The Rule // * ends up text wrapping, so its not really // * very helpful IMO TooltipHandler.TipRegion(container, "From Rule:\n<item defName=\"" + defName + "\" stackLimit=\"" + stackLimit.ToString() + "\" />"); } // DEBUG space = listing.GetRect(15); section = listing.GetRect(Verse.Text.LineHeight + 2); anchor = Text.Anchor; Text.Anchor = TextAnchor.UpperLeft; GUI.Box(section, Translator.Translate("OgreStack.SectionHeader.Debug"), headerStyle); Text.Anchor = anchor; color = GUI.color; GUI.color = Color.grey; Widgets.DrawLineHorizontal(section.x, section.y + section.height - 1, section.width); Widgets.DrawLineHorizontal(section.x, section.y + section.height - 2, section.width); GUI.color = color; Rect oContainer = listing.GetRect(Verse.Text.LineHeight); Widgets.DrawHighlightIfMouseover(oContainer); Rect oLeft = GenUI.LeftPart(oContainer, 0.8f); anchor = Text.Anchor; Text.Anchor = TextAnchor.MiddleLeft; Widgets.Label(oLeft, Translator.Translate("OgreStack.Settings.CSV.Title")); Text.Anchor = anchor; TooltipHandler.TipRegion(oLeft, Translator.Translate("OgreStack.Settings.CSV.Desc", DataUtil.GenerateFilePath("OgreStack_DefsList.csv").Replace("/", "\\"))); Rect oRight = GenUI.RightPart(oContainer, 0.2f); Widgets.Checkbox(oRight.x + oRight.width - 26, oRight.y, ref this.settings.IsDebug); //oContainer = listing.GetRect(Verse.Text.LineHeight); //GUI.SetNextControlName("preset_test"); //if (Widgets.ButtonText(oContainer, "Test")) //{ // this.settings.Values[Category.SmallVolumeResource].Buffer = "999"; // if (this.settings.Values[Category.SmallVolumeResource].Mode == MultiplierMode.Fixed) // { // this.settings.Values[Category.SmallVolumeResource].Mode = MultiplierMode.Scalar; // } // else // { // this.settings.Values[Category.SmallVolumeResource].Mode = MultiplierMode.Fixed; // } //} //TooltipHandler.TipRegion(oContainer, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed porttitor rhoncus lacus, sed condimentum odio pretium sed. Pellentesque luctus velit id magna efficitur interdum. Duis nec dictum ante. Morbi urna nibh, ullamcorper id blandit viverra, molestie et risus. In hac habitasse platea dictumst. Suspendisse ut dictum velit, in vestibulum erat. Proin vel ultrices ante, eget tristique lorem. Donec scelerisque rutrum fermentum. Vivamus pulvinar nec augue a convallis. Donec ut tellus lorem. Maecenas at pharetra libero, a iaculis risus. Sed dui tellus, euismod sit amet egestas vitae, convallis at eros. Quisque sed placerat quam, vel luctus erat. Suspendisse leo tellus, porta in laoreet in, feugiat quis mi. Suspendisse fermentum aliquam metus id sollicitudin. Curabitur consectetur lacus ac dolor scelerisque vestibulum."); listing.End(); Widgets.EndScrollView(); }
// Token: 0x06000012 RID: 18 RVA: 0x000023B4 File Offset: 0x000005B4 public override void DoSettingsWindowContents(Rect inRect) { string text = "RWP_RepairThreshold_Label".Translate(new object[] { Settings.RepairThreshold }); string str = Translator.Translate("RWP_RepairThreshold_Desc"); string label = Translator.Translate("RWP_PrioritizeRottable_Label"); string tooltip = Translator.Translate("RWP_PrioritizeRottable_Desc"); string label2 = Translator.Translate("RWP_PrioritizeDeteriorating_Label"); string tooltip2 = Translator.Translate("RWP_PrioritizeDeteriorating_Desc"); string text2 = "RWP_DeterioratableMinHealthPercent_Label".Translate(new object[] { Settings.DeterioratableMinHealthPercent }); string str2 = Translator.Translate("RWP_DeterioratableMinHealthPercent_Label_Desc"); Listing_Standard listing_Standard = new Listing_Standard(); listing_Standard.ColumnWidth = inRect.width; listing_Standard.Begin(inRect); listing_Standard.Gap(20f); Rect rect = listing_Standard.GetRect(Text.LineHeight); Rect rect2 = GenUI.Rounded(GenUI.LeftHalf(rect)); Rect rect3 = GenUI.Rounded(GenUI.RightHalf(rect)); Widgets.Label(rect2, text); if (Mouse.IsOver(rect2)) { Widgets.DrawHighlight(rect2); } TooltipHandler.TipRegion(rect2, str); if (Widgets.ButtonText(new Rect(rect3.xMin, rect3.y, rect3.height, rect3.height), "-", true, false, true) && Settings.RepairThreshold <= 100 && Settings.RepairThreshold > 0) { Settings.RepairThreshold--; } Settings.RepairThreshold = Mathf.RoundToInt(Widgets.HorizontalSlider(new Rect(rect3.xMin + rect3.height + 10f, rect3.y, rect3.width - (rect3.height * 2f + 20f), rect3.height), (float)Settings.RepairThreshold, 0f, 100f, true, null, null, null, -1f)); if (Widgets.ButtonText(new Rect(rect3.xMax - rect3.height, rect3.y, rect3.height, rect3.height), "+", true, false, true) && Settings.RepairThreshold < 100 && Settings.RepairThreshold >= 0) { Settings.RepairThreshold++; } listing_Standard.Gap(20f); listing_Standard.CheckboxLabeled(label, ref Settings.PrioritizeRottable, tooltip); listing_Standard.Gap(20f); listing_Standard.CheckboxLabeled(label2, ref Settings.PrioritizeDeteriorating, tooltip2); listing_Standard.Gap(20f); Rect rect4 = listing_Standard.GetRect(Text.LineHeight); Rect rect5 = GenUI.Rounded(GenUI.LeftHalf(rect4)); Rect rect6 = GenUI.Rounded(GenUI.RightHalf(rect4)); Widgets.Label(rect5, text2); if (Mouse.IsOver(rect5)) { Widgets.DrawHighlight(rect5); } TooltipHandler.TipRegion(rect5, str2); if (Widgets.ButtonText(new Rect(rect6.xMin, rect6.y, rect6.height, rect6.height), "-", true, false, true) && Settings.DeterioratableMinHealthPercent <= 100 && Settings.DeterioratableMinHealthPercent > 0) { Settings.DeterioratableMinHealthPercent--; } Settings.DeterioratableMinHealthPercent = Mathf.RoundToInt(Widgets.HorizontalSlider(new Rect(rect6.xMin + rect6.height + 10f, rect6.y, rect6.width - (rect6.height * 2f + 20f), rect6.height), (float)Settings.DeterioratableMinHealthPercent, 0f, 100f, true, null, null, null, -1f)); if (Widgets.ButtonText(new Rect(rect6.xMax - rect6.height, rect6.y, rect6.height, rect6.height), "+", true, false, true) && Settings.DeterioratableMinHealthPercent < 100 && Settings.DeterioratableMinHealthPercent >= 0) { Settings.DeterioratableMinHealthPercent++; } listing_Standard.End(); }