Example #1
0
        public void UpdateInbox()
        {
            InboxListBox.Items.Clear();
            var inboxItems = FindController <InboxController>()?.GetSortedInbox(SortingFunctions[SortMode], SortOrder);

            if (inboxItems != null)
            {
                //populate list box
                foreach (var it in inboxItems)
                {
                    var time = new DateTime(it.Time);
                    time = time.ToLocalTime();
                    var dateformat = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
                    var item       = new UIListBoxItem(it, "", "", TypeIcons[it.Type], "", time.ToString("HH:mm ddd " + dateformat), "", it.Subject, "", it.SenderName)
                    {
                        CustomStyle = TypeStyles[it.Type],
                        UseDisabledStyleByDefault = it.ReadState > 0
                    };
                    InboxListBox.Items.Add(item);
                }
            }
            InboxListBox.Items = InboxListBox.Items;

            SummaryInfoTextLabel.Caption = GameFacade.Strings.GetString("200", "31", new string[] {
                InboxListBox.Items.Count.ToString(),
                InboxListBox.Items.Count(x => ((MessageItem)x.Data).ReadState == 0).ToString(),
            });
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        public void ToggleOpen()
        {
            if (open)
            {
                Background.Texture = backgroundCollapsedImage;
                Background.SetSize(backgroundCollapsedImage.Width, backgroundCollapsedImage.Height);
                MenuListBox.Items.Clear();
            }
            else
            {
                Background.Texture = backgroundExpandedImage;
                Background.SetSize(backgroundExpandedImage.Width, backgroundExpandedImage.Height);
                UIListBoxTextStyle Style = Script.Create <UIListBoxTextStyle>("SimMessageColors", MenuListBox.FontStyle);

                //TODO: This should eventually be made to show only a player's friends.
                foreach (UISim Avatar in Network.NetworkFacade.AvatarsInSession)
                {
                    UIListBoxItem AvatarItem = new UIListBoxItem(Avatar.GUID, Avatar.Name);
                    AvatarItem.CustomStyle = Style;
                    MenuListBox.Items.Add(AvatarItem);
                }
            }

            open = !open;
            MenuSlider.Visible           = open;
            MenuScrollUpButton.Visible   = open;
            MenuScrollDownButton.Visible = open;
            MenuListBox.Visible          = open;
        }
Example #5
0
        public void ToggleOpen()
        {
            if (open)
            {
                Background.Texture = backgroundCollapsedImage;
                Background.SetSize(backgroundCollapsedImage.Width, backgroundCollapsedImage.Height);
                MenuListBox.Items.Clear();
            }
            else
            {
                Background.Texture = backgroundExpandedImage;
                Background.SetSize(backgroundExpandedImage.Width, backgroundExpandedImage.Height);
                UIListBoxTextStyle Style = Script.Create<UIListBoxTextStyle>("SimMessageColors", MenuListBox.FontStyle);

                //TODO: This should eventually be made to show only a player's friends.
                foreach (UISim Avatar in Network.NetworkFacade.AvatarsInSession)
                {
                    UIListBoxItem AvatarItem = new UIListBoxItem(Avatar.GUID, Avatar.Name);
                    AvatarItem.CustomStyle = Style;
                    MenuListBox.Items.Add(AvatarItem);
                }
            }

            open = !open;
            MenuSlider.Visible = open;
            MenuScrollUpButton.Visible = open;
            MenuScrollDownButton.Visible = open;
            MenuListBox.Visible = open;
        }