public BuddyInfo(Widget parent) : base(parent) { av = new AvatarView(this); tbName = new TextBox(this); tbName.Move(10, 100); tbName.Resize(150, 20); tbName.KeyDown += OnNameTextBoxKeyDown; btnChat = new Button(this, 20); btnChat.Move(10, 165); btnChat.Text = "Private chat"; btnChat.Click += () => Chat.Raise(); btnRemove = new Button(this, 20); btnRemove.Move(10, 188); btnRemove.Click += () => RemoveBuddy.Raise(); btnInvite = new Button(this, 20); btnInvite.Move(10, 211); btnInvite.Text = "Invite to party"; btnInvite.Click += () => Invite.Raise(); btnDescribe = new Button(this, 20); btnDescribe.Move(10, 234); btnDescribe.Text = "Describe to..."; btnDescribe.Click += () => Describe.Raise(); btnExile = new Button(this, 20); btnExile.Move(10, 257); btnExile.Text = "Exile"; btnExile.Click += () => Exile.Raise(); lblLastSeen = new Label(this, Fonts.LabelText); lblLastSeen.AutoSize = true; lblLastSeen.Move(10, 150); groupSelector = new GroupSelector(this); groupSelector.Move(8, 128); groupSelector.Select += group => ChangeGroup.Raise(group); Clear(); }
public ClaimWindow(Widget parent, Rect area) : base(parent, "Stake") { this.area = area; this.selectedArea = area; this.rights = new ClaimRight[BuddyGroup.Colors.Length]; lblArea = new Label(this, Fonts.LabelText); lblCost = new Label(this, Fonts.LabelText); lblCost.Move(0, 15); var btnNorth = new Button(this, 80); btnNorth.Move(60, 40); btnNorth.Text = "Extend North"; btnNorth.Click += () => Extend(1, 0, 0, 0); var btnEast = new Button(this, 80); btnEast.Move(120, 65); btnEast.Text = "Extend East"; btnEast.Click += () => Extend(0, 1, 0, 0); var btnSouth = new Button(this, 80); btnSouth.Move(60, 90); btnSouth.Text = "Extend South"; btnSouth.Click += () => Extend(0, 0, 1, 0); var btnWest = new Button(this, 80); btnWest.Move(0, 65); btnWest.Text = "Extend West"; btnWest.Click += () => Extend(0, 0, 0, 1); var btnBuy = new Button(this, 60); btnBuy.Move(0, 190); btnBuy.Text = "Buy"; btnBuy.Click += () => Buy.Raise(this, EventArgs.Empty); var btnReset = new Button(this, 60); btnReset.Move(80, 190); btnReset.Text = "Reset"; btnReset.Click += Reset; var btnDestroy = new Button(this, 60); btnDestroy.Move(160, 190); btnDestroy.Text = "Declaim"; btnDestroy.Click += () => Declaim.Raise(this, EventArgs.Empty); var lblAssign = new Label(this, Fonts.LabelText); lblAssign.Move(0, 120); lblAssign.Text = "Assign permissions to memorized people:"; selector = new GroupSelector(this); selector.Group = 0; selector.Move(0, 135); selector.Select += OnGroupSelect; var chkTrespass = new RightCheckBox(this, ClaimRight.Trespassing); chkTrespass.Move(0, 155); chkTrespass.CheckedChanged += ToggleRight; var chkTheft = new RightCheckBox(this, ClaimRight.Theft); chkTheft.Move(90, 155); chkTheft.CheckedChanged += ToggleRight; var chkVandalism = new RightCheckBox(this, ClaimRight.Vandalism); chkVandalism.Move(145, 155); chkVandalism.CheckedChanged += ToggleRight; chkRights = new List <RightCheckBox>(); chkRights.AddRange(new [] { chkTrespass, chkTheft, chkVandalism }); UpdateLabels(); Pack(); }