public UIInbox() { var script = this.RenderScript("messageinbox.uis"); Background = new UIImage(backgroundImage); this.AddAt(0, Background); CloseButton.OnButtonClick += new ButtonClickDelegate(Close); UIUtils.MakeDraggable(Background, this); MessageButton.OnButtonClick += new ButtonClickDelegate(MessageButton_OnButtonClick); var msgStyleCSR = script.Create <UIListBoxTextStyle>("CSRMessageColors", InboxListBox.FontStyle); var msgStyleServer = script.Create <UIListBoxTextStyle>("ServerMessageColors", InboxListBox.FontStyle); var msgStyleGame = script.Create <UIListBoxTextStyle>("GameMessageColors", InboxListBox.FontStyle); var msgStyleSim = script.Create <UIListBoxTextStyle>("SimMessageColors", InboxListBox.FontStyle); var msgStyleClub = script.Create <UIListBoxTextStyle>("ClubMessageColors", InboxListBox.FontStyle); var msgStyleProperty = script.Create <UIListBoxTextStyle>("PropertyMessageColors", InboxListBox.FontStyle); var msgStyleNeighborhood = script.Create <UIListBoxTextStyle>("NeighborhoodMessageColors", InboxListBox.FontStyle); var item = new UIListBoxItem("idk", "!", "", "||", "", "21:21 - 4/2/2014", "", "The Sims Online", "", "Please stop remaking our game"); item.CustomStyle = msgStyleSim; InboxListBox.Items.Add(item); Dropdown = new UIInboxDropdown(); Dropdown.X = 162; Dropdown.Y = 13; this.Add(Dropdown); }
public UIInbox() { var script = this.RenderScript("messageinbox.uis"); Background = new UIImage(backgroundImage); this.AddAt(0, Background); CloseButton.OnButtonClick += new ButtonClickDelegate(Close); UIUtils.MakeDraggable(Background, this); MessageButton.OnButtonClick += new ButtonClickDelegate(MessageButton_OnButtonClick); var msgStyleCSR = script.Create<UIListBoxTextStyle>("CSRMessageColors", InboxListBox.FontStyle); var msgStyleServer = script.Create<UIListBoxTextStyle>("ServerMessageColors", InboxListBox.FontStyle); var msgStyleGame = script.Create<UIListBoxTextStyle>("GameMessageColors", InboxListBox.FontStyle); var msgStyleSim = script.Create<UIListBoxTextStyle>("SimMessageColors", InboxListBox.FontStyle); var msgStyleClub = script.Create<UIListBoxTextStyle>("ClubMessageColors", InboxListBox.FontStyle); var msgStyleProperty = script.Create<UIListBoxTextStyle>("PropertyMessageColors", InboxListBox.FontStyle); var msgStyleNeighborhood = script.Create<UIListBoxTextStyle>("NeighborhoodMessageColors", InboxListBox.FontStyle); var item = new UIListBoxItem("idk", "!", "", "||", "", "21:21 - 4/2/2014", "", "The Sims Online", "", "Please stop remaking our game"); item.CustomStyle = msgStyleSim; InboxListBox.Items.Add(item); Dropdown = new UIInboxDropdown(); Dropdown.X = 162; Dropdown.Y = 13; this.Add(Dropdown); }
public UIInbox() { var script = RenderScript("messageinbox.uis"); Background = new UIImage(backgroundImage); AddAt(0, Background); CloseButton.OnButtonClick += new ButtonClickDelegate(Close); UIUtils.MakeDraggable(Background, this); MessageButton.OnButtonClick += new ButtonClickDelegate(MessageButton_OnButtonClick); var msgStyleSim = script.Create <UIListBoxTextStyle>("SimMessageColors", InboxListBox.FontStyle); var msgStyleClub = script.Create <UIListBoxTextStyle>("ClubMessageColors", InboxListBox.FontStyle); var msgStyleCSR = script.Create <UIListBoxTextStyle>("CSRMessageColors", InboxListBox.FontStyle); var msgStyleServer = script.Create <UIListBoxTextStyle>("ServerMessageColors", InboxListBox.FontStyle); var msgStyleGame = script.Create <UIListBoxTextStyle>("GameMessageColors", InboxListBox.FontStyle); var msgStyleProperty = script.Create <UIListBoxTextStyle>("PropertyMessageColors", InboxListBox.FontStyle); var msgStyleNeighborhood = script.Create <UIListBoxTextStyle>("NeighborhoodMessageColors", InboxListBox.FontStyle); TypeIcons = new Texture2D[] { letterIconImage, voteIconImage, clubIconImage, maxisIconImage, tsoIconImage, houseIconImage, neighborIconImage, callIconImage }; TypeStyles = new UIListBoxTextStyle[] { msgStyleSim, msgStyleServer, msgStyleClub, msgStyleCSR, msgStyleGame, msgStyleProperty, msgStyleNeighborhood, msgStyleServer }; SortingFunctions = new Func <MessageItem, object>[] { x => x.Subject, x => x.SenderName, x => - x.Time, x => x.Type, x => x.Subtype, }; SortButtons = new UIButton[] { SubjectSortButton, NameSortButton, TimeSortButton, IconSortButton, AlertsSortButton, }; //swap these to give subject field a bit more space var posSwap = NameSortButton.Position; NameSortButton.Position = SubjectSortButton.Position; SubjectSortButton.Position = posSwap; for (int i = 0; i < 5; i++) { var btni = i; SortButtons[i].OnButtonClick += (btn) => { Sort(btni); }; } Dropdown = new UIInboxDropdown { X = 162, Y = 13 }; Add(Dropdown); SummaryInfoTextLabel.Alignment = TextAlignment.Center | TextAlignment.Middle; InboxListBox.AttachSlider(InboxSlider); InboxSlider.AttachButtons(InboxScrollUpButton, InboxScrollDownButton, 1f); InboxListBox.OnDoubleClick += OpenMessage; InboxListBox.Columns[2].TextureSelectedFrame = 1; InboxListBox.Columns[2].TextureHoverFrame = 2; DeleteButton.OnButtonClick += Delete; Sort(2); SortOrder = false; }