Example #1
0
 protected void NumberInput(int marginLeft = 500, int marginTop = 200)
 {
     GUI.Box(new Rect(GuiBase.Width(290f), GuiBase.Height(110f), GuiBase.Width(660f), GuiBase.Height(480f)), string.Empty);
     GUI.Label(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)marginTop), GuiBase.Width(350f), GuiBase.Height(50f)), GuiBase.NumberInputText);
     marginTop += 50;
     GUI.Label(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)marginTop), GuiBase.Width(200f), GuiBase.Height(30f)), GuiBase.NumberInputNumber.GuiText, Gui.ChosenSkin.textField);
     marginTop += 40;
     this.AddInputButton(marginLeft, marginTop, 1);
     this.AddInputButton(marginLeft + 70, marginTop, 2);
     this.AddInputButton(marginLeft + 140, marginTop, 3);
     this.AddInputButton(marginLeft, marginTop + 35, 4);
     this.AddInputButton(marginLeft + 70, marginTop + 35, 5);
     this.AddInputButton(marginLeft + 140, marginTop + 35, 6);
     this.AddInputButton(marginLeft, marginTop + 70, 7);
     this.AddInputButton(marginLeft + 70, marginTop + 70, 8);
     this.AddInputButton(marginLeft + 140, marginTop + 70, 9);
     this.AddInputButton(marginLeft, marginTop + 105, 0);
     this.AddInputButton(marginLeft + 70, marginTop + 105, -1);
     this.AddInputButton(marginLeft + 140, marginTop + 105, -2);
     if (GUI.Button(new Rect(GuiBase.Width((float)(marginLeft + 105)), GuiBase.Height((float)(marginTop + 145)), GuiBase.Width(95f), GuiBase.Height(30f)), "OK"))
     {
         GuiBase.NumberInputAction(GuiBase.NumberInputNumber);
         this.ResetNumberInput();
     }
     if (GUI.Button(new Rect(GuiBase.Width((float)marginLeft), GuiBase.Height((float)(marginTop + 145)), GuiBase.Width(95f), GuiBase.Height(30f)), "Cancel"))
     {
         this.ResetNumberInput();
     }
 }