예제 #1
0
        public override void OnRightClick(Pin pin = null)
        {
            var input = new UserInputUI(this.Settings["Value"]);

            input.OnSave += (s, e) =>
            {
                this.Settings["Value"] = input.Value;

                if (Main.netMode == NetmodeID.MultiplayerClient)
                {
                    WireMod.PacketHandler.SendChangeSetting(256, Main.myPlayer, this.LocationTile.X, this.LocationTile.Y, "Value", this.Settings["Value"]);
                }
            };

            WireMod.Instance.UserInputUserInterface.SetState(input);
            UserInputUI.Visible = true;
        }
예제 #2
0
        public override void OnRightClick(Pin pin = null)
        {
            var input = new UserInputUI(this.Settings["Value"]);

            input.OnSave += (s, e) =>
            {
                if (!int.TryParse(input.Value, out var value))
                {
                    Main.NewText($"Could not parse '{input.Value}' as an integer");
                    return;
                }

                this.Settings["Value"] = input.Value;

                if (Main.netMode == NetmodeID.MultiplayerClient)
                {
                    WireMod.PacketHandler.SendChangeSetting(256, Main.myPlayer, this.LocationTile.X, this.LocationTile.Y, "Value", this.Settings["Value"]);
                }
            };

            WireMod.Instance.UserInputUserInterface.SetState(input);
            UserInputUI.Visible = true;
        }