public void DrawSettings(ref Listing_StandardExpanding listing_Main, ref Rect rect) { /* * if (ShowRaces) * { * string label = "AdeptusMechanicus.Xenobiologis.ShowDarkEldar".Translate() + " Settings"; * string tooltip = string.Empty; * if (Dev) * { * label += " Main Length: " + MainMenuLength + " SubLength: " + MenuLength + " Passed: " + num2 + " Inc: " + inc; * } * * Listing_StandardExpanding listing_Race = listing_Main.BeginSection((num2 != 0 ? num2 : RaceSettings) + inc, false, 3, 4, 0); * if (listing_Race.CheckboxLabeled(label, ref Settings.ShowDarkEldar, Dev, ref inc, tooltip, false, true, ArmouryMain.collapseTex, ArmouryMain.expandTex)) * { * Listing_StandardExpanding listing_General = listing_Race.BeginSection(MenuLength, true); * listing_General.ColumnWidth *= 0.488f; * listing_General.CheckboxLabeled("AdeptusMechanicus.Xenobiologis.AllowDarkEldar".Translate() + (!factionExists ? "AdeptusMechanicus.Xenobiologis.NotYetAvailable".Translate() : !hidden ? "AdeptusMechanicus.Xenobiologis.Faction".Translate() : "AdeptusMechanicus.Xenobiologis.HiddenFaction".Translate()), * ref Settings.AllowDarkEldar, * null, * !factionExists || !Settings.AllowDarkEldarWeapons, * factionExists && Settings.AllowDarkEldarWeapons); * listing_General.NewColumn(); * listing_Race.EndSection(listing_General); * MenuLength = listing_General.CurHeight != 0 ? listing_General.CurHeight : listing_General.MaxColumnHeightSeen; * } * listing_Main.EndSection(listing_Race); * MainMenuLength = listing_Race.CurHeight; * num2 = MainMenuLength - inc; * } */ }
public static void IntergrationModOptionsMenu(Listing_StandardExpanding listing_Main) { string labelI = "AdeptusMechanicus.IntergrationOptions".Translate(); string tooltipI = "AdeptusMechanicus.IntergrationOptionsDesc".Translate(); if (Dev) { // Log.Message("showArmouryIntergrationOptions "+ showArmouryIntergrationOptions); // Log.Message("mod.patchesCount " + mod.PatchesCount); // Log.Message("AMAMod.lineheight " + AMAMod.lineheight); labelI = "AdeptusMechanicus.IntergrationOptions".Translate() + " Menu Length: " + mod.Length(showArmouryIntergrationOptions, mod.PatchesCount, AMAMod.lineheight, 0, 0) + " Total Length: " + Listing_ArmouryIntergrationLength + " " + showArmouryIntergrationOptions + " CurInc: " + Inc; } listing_Menu.maxOneColumn = true; // Armoury Mod Options /* * if (showArmouryIntergrationMenu) * { * if (listing_Main.ButtonText(labelI, ref showArmouryIntergrationOptions, Dev, ref Inc, tooltipI)) * { * Listing_StandardExpanding listing_ArmouryIntergration = listing_Main.BeginSection(listing_ArmouryIntergrationLength, false, 3); * // listing_ArmouryIntergration = listing_Main.BeginSection(MenuLengthIntergration, false, 0); * listing_ArmouryIntergration.Label("Changes to these settings require a restart to take effect." + (Dev ? " patchesCount: " + mod.patchesCount : "")); * Listing_StandardExpanding listing_General = listing_ArmouryIntergration.BeginSection(mod.Length(showArmouryIntergrationOptions, mod.patchesCount, AMAMod.lineheight, 0, 0), true); * listing_General.ColumnWidth *= 0.488f; * bool flag = false; * for (int i = 0; i < AMAMod.Patches.Count; i++) * { * var patch = AMAMod.Patches[i]; * var status = settings.PatchDisabled[patch]; * if (!flag && i + 1 > AMAMod.Patches.Count / 2) * { * listing_General.NewColumn(); * flag = true; * } * listing_General.CheckboxLabeled(patch.label, ref status, patch.tooltip); * * settings.PatchDisabled[patch] = status; * * } * listing_ArmouryIntergration.EndSection(listing_General); * listing_Main.EndSection(listing_ArmouryIntergration); * if (AdeptusIntergrationUtility.enabled_AlienRaces && Dev) * { * Listing_StandardExpanding listing_AlienRacesIntergration = listing_Main.BeginSection(120); * Listing_StandardExpanding listing_ImperialRacesIntergration = listing_AlienRacesIntergration.BeginSection(100); * * listing_AlienRacesIntergration.EndSection(listing_ImperialRacesIntergration); * * listing_Main.EndSection(listing_AlienRacesIntergration); * } * } * } */ }
public Listing_StandardExpanding BeginSection(float height, bool hidesection = false, int type = 0, int sectionBorder = 4, int bottomBorder = 4, Listing_StandardExpanding parent = null) { Rect rect = this.GetRect(height + sectionBorder + bottomBorder); this.frameRect = rect; if (parent != null) { parent.listingRect.height += rect.height; } if (!hidesection) { switch (type) { case 1: Widgets.DrawWindowBackground(rect); break; case 2: Widgets.DrawWindowBackgroundTutor(rect); break; case 3: Widgets.DrawOptionUnselected(rect); break; case 4: Widgets.DrawOptionSelected(rect); break; default: Widgets.DrawMenuSection(rect); break; } } Listing_StandardExpanding listing_Standard = new Listing_StandardExpanding(); Rect rect2 = new Rect(rect.x + sectionBorder, rect.y + sectionBorder, rect.width - sectionBorder * 2f, rect.height - (sectionBorder + bottomBorder)); listing_Standard.Begin(rect2); return(listing_Standard); }
public Listing_StandardExpanding BeginSection(float height, out Rect frane, out Rect contents, bool hidesection = false, int type = 0, int sectionBorder = 4, int bottomBorder = 4, Listing_StandardExpanding parent = null, bool extend = false) { frane = this.GetRect(height + sectionBorder + bottomBorder, null, extend); this.frameRect = frane; if (parent != null) { parent.curY += frane.height; } if (!hidesection) { switch (type) { case 1: Widgets.DrawWindowBackground(frane); break; case 2: Widgets.DrawWindowBackgroundTutor(frane); break; case 3: Widgets.DrawOptionUnselected(frane); break; case 4: Widgets.DrawOptionSelected(frane); break; default: Widgets.DrawMenuSection(frane); break; } } Listing_StandardExpanding listing_Standard = new Listing_StandardExpanding(); contents = new Rect(frane.x + sectionBorder, frane.y + sectionBorder, frane.width - sectionBorder * 2f, frane.height - (sectionBorder + bottomBorder)); listing_Standard.Begin(contents); return(listing_Standard); }
public Rect GetRect(float height, Listing_StandardExpanding parent = null, bool extend = false) { if (extend) { if (this.curY + height > this.listingRect.height) { this.listingRect.height = this.curY + height; } } this.NewColumnIfNeeded(height); Rect result = new Rect(this.curX, this.curY, this.ColumnWidth, height); this.curY += height; if (parent != null) { parent.curY += height; } if (listingRect.height < this.curY + height) { listingRect.height += height; } return(result); }
public void EndSection(Listing_StandardExpanding listing) { listing.End(); this.listingRect.height += listing.listingRect.height; }
public static void ArmouryModOptionsMenu(Listing_StandardExpanding listing_Main) { listing_Menu.maxOneColumn = true; // Armoury Mod Options // listing_Menu = listing_Main.BeginSection(listing_ArmouryLength, false, 3, 4, 0); listing_Menu = listing_Main.BeginSection(Listing_ArmouryLength, false, 3, 4, 0); // Armoury mod General Special rules options menu { Listing_StandardExpanding listing = listing_Menu.BeginSection(Listing_GeneralSpecialRulesLength, false, 3, 4, 0); if (listing.CheckboxLabeled("AdeptusMechanicus.ShowSpecialRules".Translate(), ref settings.ArmouryGeneralSpecialRules, "AdeptusMechanicus.ShowSpecialRulesDesc".Translate(), false, false, ArmouryMain.collapseTex, ArmouryMain.expandTex)) { Listing_StandardExpanding listing_General = listing.BeginSection(Listing_GeneralSpecialRulesContents, true, 0, 4, 0); listing_General.ColumnWidth *= 0.488f; listing_General.CheckboxLabeled("AdeptusMechanicus.AllowDeepStrike".Translate(), ref settings.AllowDeepStrike, "AdeptusMechanicus.AllowDeepStrikeDesc".Translate()); listing_General.NewColumn(); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowInfiltrate".Translate(), ref settings.AllowInfiltrate, "AdeptusMechanicus.AllowInfiltrateDesc".Translate()); listing.EndSection(listing_General); listing_General.listingRect.height = listing_General.MaxColumnHeightSeen; } listing_Menu.EndSection(listing); listing.listingRect.height = listing.MaxColumnHeightSeen; } // Armoury mod Weapon Special rules options menu { Listing_StandardExpanding listing = listing_Menu.BeginSection(Listing_WeaponSpecialRulesLength, false, 3, 4, 0); if (listing.CheckboxLabeled("AdeptusMechanicus.ShowWeaponSpecialRules".Translate(), ref settings.ShowAllowedWeaponSpecialRules, "AdeptusMechanicus.ShowWeaponSpecialRulesDesc".Translate(), false, false, ArmouryMain.collapseTex, ArmouryMain.expandTex)) { Listing_StandardExpanding listing_General = listing.BeginSection(Listing_WeaponSpecialRulesContents, true); listing_General.ColumnWidth *= 0.488f; listing_General.CheckboxLabeled("AdeptusMechanicus.AllowRapidFire".Translate(), ref settings.AllowRapidFire, "AdeptusMechanicus.AllowRapidFireDesc".Translate()); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowGetsHot".Translate(), ref settings.AllowGetsHot, "AdeptusMechanicus.AllowGetsHotDesc".Translate()); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowJams".Translate(), ref settings.AllowJams, "AdeptusMechanicus.AllowJamsDesc".Translate()); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowMultiShot".Translate(), ref settings.AllowMultiShot, "AdeptusMechanicus.AllowMultiShotDesc".Translate()); listing_General.NewColumn(); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowUserEffects".Translate(), ref settings.AllowUserEffects, "AdeptusMechanicus.AllowUserEffectsDesc".Translate()); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowForceWeaponEffect".Translate(), ref settings.AllowForceWeaponEffect, "AdeptusMechanicus.AllowForceWeaponEffectDesc".Translate()); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowRendingMeleeEffect".Translate(), ref settings.AllowRendingMeleeEffect, "AdeptusMechanicus.AllowRendingMeleeEffectDesc".Translate()); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowRendingRangedEffect".Translate(), ref settings.AllowRendingRangedEffect, "AdeptusMechanicus.AllowRendingRangedEffectDesc".Translate()); listing.EndSection(listing_General); listing_General.listingRect.height = listing_General.MaxColumnHeightSeen; } listing_Menu.EndSection(listing); listing.listingRect.height = listing.MaxColumnHeightSeen; } // Armoury mod Allowed Weapons options menu { Listing_StandardExpanding listing = listing_Menu.BeginSection(Listing_AllowedWeaponRulesLength, false, 3, 4, 0); if (listing.CheckboxLabeled("AdeptusMechanicus.ShowAllowedWeapons".Translate(), ref settings.ShowAllowedWeapons, "AdeptusMechanicus.ShowAllowedWeaponsDesc".Translate(), false, false, ArmouryMain.collapseTex, ArmouryMain.expandTex)) { Listing_StandardExpanding listing_General = listing.BeginSection(Listing_AllowedWeaponRulesContents, true); listing_General.ColumnWidth *= 0.32f; listing_General.CheckboxLabeled("AdeptusMechanicus.AllowImperialWeapons".Translate(), ref settings.AllowImperialWeapons, "AdeptusMechanicus.AllowImperialWeaponsDesc".Translate()); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowMechanicusWeapons".Translate(), ref settings.AllowMechanicusWeapons, "AdeptusMechanicus.AllowMechanicusWeaponsDesc".Translate()); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowChaosWeapons".Translate(), ref settings.AllowChaosWeapons, "AdeptusMechanicus.AllowChaosWeaponsDesc".Translate()); listing_General.NewColumn(); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowEldarWeapons".Translate(), ref settings.AllowEldarWeapons, "AdeptusMechanicus.AllowEldarWeaponsDesc".Translate()); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowDarkEldarWeapons".Translate(), ref settings.AllowDarkEldarWeapons, "AdeptusMechanicus.AllowDarkEldarWeaponsDesc".Translate()); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowTauWeapons".Translate(), ref settings.AllowTauWeapons, "AdeptusMechanicus.AllowTauWeaponsDesc".Translate()); listing_General.NewColumn(); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowOrkWeapons".Translate(), ref settings.AllowOrkWeapons, "AdeptusMechanicus.AllowOrkWeaponsDesc".Translate()); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowNecronWeapons".Translate(), ref settings.AllowNecronWeapons, "AdeptusMechanicus.AllowNecronWeaponsDesc".Translate()); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowTyranidWeapons".Translate(), ref settings.AllowTyranidWeapons, "AdeptusMechanicus.AllowTyranidWeaponsDesc".Translate()); listing.EndSection(listing_General); listing_General.listingRect.height = listing_General.MaxColumnHeightSeen; } listing_Menu.EndSection(listing); listing.listingRect.height = listing.MaxColumnHeightSeen; } // Armoury mod Performance options menu { Listing_StandardExpanding listing = listing_Menu.BeginSection(Listing_PerformanceOptionsLength, false, 3, 4, 0); if (listing.CheckboxLabeled("AdeptusMechanicus.ShowPerformanceOptions".Translate(), ref settings.ShowPerformanceOptions, "AdeptusMechanicus.ShowPerformanceOptionsDesc".Translate(), false, false, ArmouryMain.collapseTex, ArmouryMain.expandTex)) { Listing_StandardExpanding listing_General = listing.BeginSection(Listing_PerformanceOptionsContents, true); listing_General.ColumnWidth *= 0.32f; listing_General.CheckboxLabeled("AdeptusMechanicus.AllowProjectileTrail".Translate(), ref settings.AllowProjectileTrail, "AMAAllowProjectileTrailDesc".Translate()); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowProjectileGlow".Translate(), ref settings.AllowProjectileGlow, "AdeptusMechanicus.AllowProjectileGlowDesc".Translate()); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowMuzzlePosition".Translate(), ref settings.AllowMuzzlePosition, "AdeptusMechanicus.AllowMuzzlePositionDesc".Translate()); listing_General.NewColumn(); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowPauldronDrawer".Translate(), ref settings.AllowPauldronDrawer, "AdeptusMechanicus.AllowPauldronDrawerDesc".Translate()); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowExtraPartDrawer".Translate(), ref settings.AllowExtraPartDrawer, "AdeptusMechanicus.AllowExtraPartDrawerDesc".Translate()); listing_General.CheckboxLabeled("AdeptusMechanicus.AllowHediffPartDrawer".Translate(), ref settings.AllowHediffPartDrawer, "AdeptusMechanicus.AllowHediffPartDrawerDesc".Translate()); listing_General.NewColumn(); // listing_General.CheckboxLabeled("AdeptusMechanicus.AllowOrkWeapons".Translate(), ref settings.AllowOrkWeapons, "AdeptusMechanicus.AllowOrkWeaponsDesc".Translate()); // listing_General.CheckboxLabeled("AdeptusMechanicus.AllowNecronWeapons".Translate(), ref settings.AllowNecronWeapons, "AdeptusMechanicus.AllowNecronWeaponsDesc".Translate()); // listing_General.CheckboxLabeled("AdeptusMechanicus.AllowTyranidWeapons".Translate(), ref settings.AllowTyranidWeapons, "AdeptusMechanicus.AllowTyranidWeaponsDesc".Translate()); listing.EndSection(listing_General); listing_General.listingRect.height = listing_General.MaxColumnHeightSeen; } listing_Menu.EndSection(listing); listing.listingRect.height = listing.MaxColumnHeightSeen; } listing_Main.EndSection(listing_Menu); listing_Menu.listingRect.height = listing_Menu.MaxColumnHeightSeen; }