protected override void UpdateContents() { foreach (ChannelListItemControl control in _channelList) { control.Dispose(); } _channelList.Clear(); foreach (var k in UOChatManager.Channels) { var c = new ChannelListItemControl(k.Key, 195); _area.Add(c); _channelList.Add(c); } }
protected override void UpdateContents() { foreach (ChannelListItemControl control in _channelList) { control.Dispose(); } _channelList.Clear(); foreach (KeyValuePair <string, ChatChannel> k in ChatManager.Channels) { ChannelListItemControl c = new ChannelListItemControl(k.Key, 195); _databox.Add(c); _channelList.Add(c); } _databox.WantUpdateSize = true; _databox.ReArrangeChildren(); }
public ChatGump() : base(0, 0) { CanMove = true; AcceptMouseInput = true; CanCloseWithRightClick = true; WantUpdateSize = false; Width = 345; Height = 390; Add ( new ResizePic(0x0A28) { Width = Width, Height = Height } ); int startY = 25; Label text = new Label ( ResGumps.Channels, false, 0x0386, 345, 2, FontStyle.None, TEXT_ALIGN_TYPE.TS_CENTER ) { Y = startY }; Add(text); startY += 40; Add ( new BorderControl ( 61, startY - 3, 220 + 8, 200 + 6, 3 ) ); Add(new AlphaBlendControl(0) { X = 64, Y = startY, Width = 220, Height = 200 }); ScrollArea area = new ScrollArea ( 64, startY, 220, 200, true ) { ScrollbarBehaviour = ScrollbarBehaviour.ShowAlways }; Add(area); _databox = new DataBox(0, 0, 1, 1); _databox.WantUpdateSize = true; area.Add(_databox); foreach (KeyValuePair <string, ChatChannel> k in ChatManager.Channels) { ChannelListItemControl chan = new ChannelListItemControl(k.Key, 195); _databox.Add(chan); _channelList.Add(chan); } _databox.ReArrangeChildren(); startY = 275; text = new Label ( ResGumps.YourCurrentChannel, false, 0x0386, 345, 2, FontStyle.None, TEXT_ALIGN_TYPE.TS_CENTER ) { Y = startY }; Add(text); startY += 25; _currentChannelLabel = new Label ( ChatManager.CurrentChannelName, false, 0x0386, 345, 2, FontStyle.None, TEXT_ALIGN_TYPE.TS_CENTER ) { Y = startY }; Add(_currentChannelLabel); startY = 337; Button button = new Button(0, 0x0845, 0x0846, 0x0845) { X = 48, Y = startY + 5, ButtonAction = ButtonAction.Activate }; Add(button); button = new Button(1, 0x0845, 0x0846, 0x0845) { X = 123, Y = startY + 5, ButtonAction = ButtonAction.Activate }; Add(button); button = new Button(2, 0x0845, 0x0846, 0x0845) { X = 216, Y = startY + 5, ButtonAction = ButtonAction.Activate }; Add(button); text = new Label ( ResGumps.Join, false, 0x0386, 0, 2 ) { X = 65, Y = startY }; Add(text); text = new Label ( ResGumps.Leave, false, 0x0386, 0, 2 ) { X = 140, Y = startY }; Add(text); text = new Label ( ResGumps.Create, false, 0x0386, 0, 2 ) { X = 233, Y = startY }; Add(text); }
public UOChatGump() : base(0, 0) { CanMove = true; AcceptMouseInput = true; CanCloseWithRightClick = true; WantUpdateSize = false; Width = 345; Height = 390; Add(new ResizePic(0x0A28) { Width = Width, Height = Height }); int startY = 25; Label text = new Label("Channels", false, 0x0386, 345, 2, FontStyle.None, TEXT_ALIGN_TYPE.TS_CENTER) { Y = startY }; Add(text); startY += 40; Add(new BorderControl(61, startY - 3, 220 + 8, 200 + 6, 3)); Add(new AlphaBlendControl(0) { X = 64, Y = startY, Width = 220, Height = 200 }); _area = new ScrollArea(64, startY, 220, 200, true) { ScrollbarBehaviour = ScrollbarBehaviour.ShowAlways }; foreach (var k in UOChatManager.Channels) { var chan = new ChannelListItemControl(k.Key, 195); _area.Add(chan); _channelList.Add(chan); } Add(_area); startY = 275; text = new Label("Your current channel:", false, 0x0386, 345, 2, FontStyle.None, TEXT_ALIGN_TYPE.TS_CENTER) { Y = startY }; Add(text); startY += 25; _currentChannelLabel = new Label(UOChatManager.CurrentChannelName, false, 0x0386, 345, 2, FontStyle.None, TEXT_ALIGN_TYPE.TS_CENTER) { Y = startY }; Add(_currentChannelLabel); startY = 337; Button button = new Button(0, 0x0845, 0x0846, 0x0845) { X = 48, Y = startY + 5, ButtonAction = ButtonAction.Activate }; Add(button); button = new Button(1, 0x0845, 0x0846, 0x0845) { X = 123, Y = startY + 5, ButtonAction = ButtonAction.Activate }; Add(button); button = new Button(2, 0x0845, 0x0846, 0x0845) { X = 216, Y = startY + 5, ButtonAction = ButtonAction.Activate }; Add(button); text = new Label("Join", false, 0x0386, 0, 2, FontStyle.None, TEXT_ALIGN_TYPE.TS_LEFT) { X = 65, Y = startY }; Add(text); text = new Label("Leave", false, 0x0386, 0, 2, FontStyle.None, TEXT_ALIGN_TYPE.TS_LEFT) { X = 140, Y = startY }; Add(text); text = new Label("Create", false, 0x0386, 0, 2, FontStyle.None, TEXT_ALIGN_TYPE.TS_LEFT) { X = 233, Y = startY }; Add(text); }