Skip to content

Instantly share code, notes, and snippets.

@Neceros

Neceros/.cs

Created Apr 27, 2020
Embed
What would you like to do?
settings
public override void DoSettingsWindowContents(Rect inRect)
{
Vector2 size = new Vector2(520f, 450f);
Text.Font = GameFont.Small;
Rect rect = new Rect(0f, 0f, size.x, size.y).ContractedBy(10f);
Rect viewRect = new Rect(0f, 0f, rect.width - 16f, scrollViewHeight);
Widgets.BeginScrollView(rect, ref scrollPosition, viewRect, true);
Listing_Standard listing = new Listing_Standard();
listing.Begin(inRect);
listing.Settings_Header("YieldsHeader".Translate(), Color.clear);
listing.Settings_SliderLabeled(AddResultToLabel("OYMultiplyAmountLabelSilver".Translate(), OreYieldsSettings.multiplySilverYield, OreYieldsSettings.yieldSilver), "%", ref OreYieldsSettings.multiplySilverYield, 0f, 10f, 1, 1);
listing.Settings_SliderLabeled(AddResultToLabel("OYMultiplyAmountLabelGold".Translate(), OreYieldsSettings.multiplyGoldYield, OreYieldsSettings.yieldGold), "%", ref OreYieldsSettings.multiplyGoldYield, 0f, 10f, 1, 1);
listing.Settings_SliderLabeled(AddResultToLabel("OYMultiplyAmountLabelSteel".Translate(), OreYieldsSettings.multiplySteelYield, OreYieldsSettings.yieldSteel), "%", ref OreYieldsSettings.multiplySteelYield, 0f, 10f, 1, 1);
listing.Settings_SliderLabeled(AddResultToLabel("OYMultiplyAmountLabelPlasteel".Translate(), OreYieldsSettings.multiplyPlasteelYield, OreYieldsSettings.yieldPlasteel), "%", ref OreYieldsSettings.multiplyPlasteelYield, 0f, 10f, 1, 1);
listing.Settings_SliderLabeled(AddResultToLabel("OYMultiplyAmountLabelUranium".Translate(), OreYieldsSettings.multiplyUraniumYield, OreYieldsSettings.yieldUranium), "%", ref OreYieldsSettings.multiplyUraniumYield, 0f, 10f, 1, 1);
listing.Settings_SliderLabeled(AddResultToLabel("OYMultiplyAmountLabelJade".Translate(), OreYieldsSettings.multiplyJadeYield, OreYieldsSettings.yieldJade), "%", ref OreYieldsSettings.multiplyJadeYield, 0f, 10f, 1, 1);
listing.Settings_SliderLabeled(AddResultToLabel("OYMultiplyAmountLabelComps".Translate(), OreYieldsSettings.multiplyCompsYield, OreYieldsSettings.yieldComps), "%", ref OreYieldsSettings.multiplyCompsYield, 0f, 10f, 1, 1);
if (OreYieldsSettings.yieldSilver * OreYieldsSettings.multiplySilverYield >= 75 ||
OreYieldsSettings.yieldGold * OreYieldsSettings.multiplyGoldYield >= 75 ||
OreYieldsSettings.yieldSteel * OreYieldsSettings.multiplySteelYield >= 75 ||
OreYieldsSettings.yieldPlasteel * OreYieldsSettings.multiplyPlasteelYield >= 75 ||
OreYieldsSettings.yieldUranium * OreYieldsSettings.multiplyUraniumYield >= 75 ||
OreYieldsSettings.yieldJade * OreYieldsSettings.multiplyJadeYield >= 75 ||
OreYieldsSettings.yieldComps * OreYieldsSettings.multiplyCompsYield >= 75)
{
listing.Label("OYStackWarning".Translate());
}
listing.Gap(12f);
listing.Settings_Header("MassHeader".Translate(), Color.clear);
listing.Settings_SliderLabeled(AddResultToLabel("multiplySilverMass".Translate(), OreYieldsSettings.multiplySilverMass, OreYieldsSettings.massSilver), "%", ref OreYieldsSettings.multiplySilverMass, 0f, 3f, 1, 1);
listing.Settings_SliderLabeled(AddResultToLabel("multiplyGoldMass".Translate(), OreYieldsSettings.multiplyGoldMass, OreYieldsSettings.massGold), "%", ref OreYieldsSettings.multiplyGoldMass, 0f, 3f, 1, 1);
listing.Settings_SliderLabeled(AddResultToLabel("multiplySteelMass".Translate(), OreYieldsSettings.multiplySteelMass, OreYieldsSettings.massSteel), "%", ref OreYieldsSettings.multiplySteelMass, 0f, 3f, 1, 1);
listing.Settings_SliderLabeled(AddResultToLabel("multiplyPlasteelMass".Translate(), OreYieldsSettings.multiplyPlasteelMass, OreYieldsSettings.massPlasteel), "%", ref OreYieldsSettings.multiplyPlasteelMass, 0f, 3f, 1, 1);
listing.Settings_SliderLabeled(AddResultToLabel("multiplyUraniumMass".Translate(), OreYieldsSettings.multiplyUraniumMass, OreYieldsSettings.massUranium), "%", ref OreYieldsSettings.multiplyUraniumMass, 0f, 3f, 1, 1);
listing.Settings_SliderLabeled(AddResultToLabel("multiplyJadeMass".Translate(), OreYieldsSettings.multiplyJadeMass, OreYieldsSettings.massJade), "%", ref OreYieldsSettings.multiplyJadeMass, 0f, 3f, 1, 1);
listing.Settings_SliderLabeled(AddResultToLabel("multiplyCompsMass".Translate(), OreYieldsSettings.multiplyCompsMass, OreYieldsSettings.massComps), "%", ref OreYieldsSettings.multiplyCompsMass, 0f, 3f, 1, 1);
listing.Gap(24f);
resetDefaults = listing.ButtonText("ResetDefaults".Translate());
listing.End();
base.DoSettingsWindowContents(inRect);
Widgets.EndScrollView();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment