WhiteScreenAnon
Novice
- Joined
- May 10, 2020
- Messages
- 56
whats up?Anon help me. My dumb ass needs help.
post where you are stuck
whats up?Anon help me. My dumb ass needs help.
Half of the characters in my name are "special" to you. Welcome, Игорь Юрьевич Кузнецов.You absolute fucking degenerate, avoiding special characters in names is not simply a "best practice". It's the only true basis of our civilization.
should be stringtoedit, I thinkWhat's my variable going to be?
one is string other is integer.public static int finalBuildPointAmount = 1;
private static string buildPointAmount = "1";
this makes value of this variable point to string in textboxbuildPointAmount = GL.TextField(buildPointAmount, 10, GL.Width(85f));
copied this directly from bag of tricks. it merely does what anon suggested and tries to turn string into integer.public static void SettingParse(ref string stringSetting, ref int finalSetting) {
if (int.TryParse(stringSetting, out int result)) {
finalSetting = result;
} else {
stringSetting = "";
}
}
this adds bp amount in textbox to kingdom as long as textbox is not empty string like this: ""if (GL.Button($"+{buildPointAmount} BP", GL.Width(160f))) {
if (!buildPointAmount.Equals(""))
KingdomState.Instance.BP = KingdomState.Instance.BP + finalBuildPointAmount;
}
string goldPrompt ="Input Amount of Gold: "
(the string is empty, because we do not know what a user will enter)string goldInput =""
goldInput =GUI.TextField(new Rect(10, 10, 200, 20), goldPrompt, 25)
int gold = Convert.ToInt32(goldInput)