Exemplo n.º 1
0
        public UIGizmoTop100(UIScript script, UIGizmo parent)
        {
            Background = script.Create <UIImage>("BackgroundImageTop100Lists");
            this.Add(Background);

            script.LinkMembers(this, true);

            HiddenSubSlider = new UISlider();
            Top100SubList.Columns[0].TextureBounds        = new Microsoft.Xna.Framework.Vector2(17, 17);
            Top100SubList.Columns[0].TextureSelectedFrame = 1;
            Top100SubList.Columns[0].TextureHoverFrame    = 2;
            Top100SubList.OnChange += Top100SubList_OnChange;
            Top100SubList.AttachSlider(HiddenSubSlider);
            HiddenSubSlider.AttachButtons(Top100SubListScrollUpButton, Top100SubListScrollDownButton, 1);

            Top100Slider.AttachButtons(Top100ListScrollUpButton, Top100ListScrollDownButton, 1);
            Top100ResultList.AttachSlider(Top100Slider);
            Top100ResultList.Mask = true;
            Top100ResultList.SetSize(150, 138);
            Top100ResultList.OnDoubleClick += Top100ResultList_OnDoubleClick;

            //populateWithXMLHouses();

            Top100ResultList.OnDoubleClick += Top100ItemSelect;
            UpdateCooldown = 100;

            ListBoxColors = script.Create <UIListBoxTextStyle>("ListBoxColors", Top100ResultList.FontStyle);
        }
Exemplo n.º 2
0
        public UIRelationshipDialog()
            : base(UIDialogStyle.Standard | UIDialogStyle.Close, true)
        {
            this.Caption = GameFacade.Strings.GetString("f106", "10");
            //f_web_inbtn = 0x1972454856DDBAC,
            //f_web_outbtn = 0x3D3AEF0856DDBAC,

            InnerBackground          = new UIImage(GetTexture((ulong)0x7A400000001)).With9Slice(13, 13, 13, 13);
            InnerBackground.Position = new Vector2(15, 65);
            InnerBackground.SetSize(510, 230);
            AddAt(3, InnerBackground);

            ResultsBox         = new UIListBox();
            ResultsBox.Columns = new UIListBoxColumnCollection();
            for (int i = 0; i < 3; i++)
            {
                ResultsBox.Columns.Add(new UIListBoxColumn()
                {
                    Width = 170
                });
            }
            ResultsBox.Position = new Vector2(25, 82);
            ResultsBox.SetSize(510, 230);
            ResultsBox.RowHeight          = 40;
            ResultsBox.NumVisibleRows     = 6;
            ResultsBox.SelectionFillColor = Color.TransparentBlack;
            Add(ResultsBox);

            var seat = new UIImage(GetTexture(0x19700000002));

            seat.Position = new Vector2(28, 28);
            Add(seat);

            IncomingButton          = new UIButton(GetTexture((ulong)0x1972454856DDBAC));
            IncomingButton.Position = new Vector2(33, 33);
            IncomingButton.Tooltip  = GameFacade.Strings.GetString("f106", "12");
            Add(IncomingButton);
            OutgoingButton          = new UIButton(GetTexture((ulong)0x3D3AEF0856DDBAC));
            OutgoingButton.Position = new Vector2(33, 33);
            OutgoingButton.Tooltip  = GameFacade.Strings.GetString("f106", "13");
            Add(OutgoingButton);

            SearchBox          = new UITextBox();
            SearchBox.Position = new Vector2(550 - 170, 37);
            SearchBox.SetSize(150, 25);
            SearchBox.OnEnterPress += SearchBox_OnEnterPress;
            Add(SearchBox);

            SortLabel                   = new UILabel();
            SortLabel.Caption           = GameFacade.Strings.GetString("f106", "1");
            SortLabel.Position          = new Vector2(95, 30);
            SortLabel.CaptionStyle      = SortLabel.CaptionStyle.Clone();
            SortLabel.CaptionStyle.Size = 8;
            Add(SortLabel);

            SearchLabel           = new UILabel();
            SearchLabel.Caption   = GameFacade.Strings.GetString("f106", "14");
            SearchLabel.Alignment = Framework.TextAlignment.Right;
            SearchLabel.Position  = new Vector2(550 - 230, 38);
            SearchLabel.Size      = new Vector2(50, 1);
            Add(SearchLabel);

            SortFriendButton          = new UIButton(GetTexture((ulong)0xCE300000001)); //gizmo_friendliestthumb = 0xCE300000001,
            SortFriendButton.Tooltip  = GameFacade.Strings.GetString("f106", "2");
            SortFriendButton.Position = new Vector2(95, 47);
            Add(SortFriendButton);

            SortEnemyButton          = new UIButton(GetTexture((ulong)0xCE600000001)); //gizmo_meanestthumb = 0xCE600000001,
            SortEnemyButton.Tooltip  = GameFacade.Strings.GetString("f106", "3");
            SortEnemyButton.Position = new Vector2(115, 47) + (new Vector2(17 / 2f, 14) - new Vector2(SortEnemyButton.Texture.Width / 8, SortEnemyButton.Texture.Height));
            Add(SortEnemyButton);

            SortAlmostFriendButton          = new UIButton(GetTexture((ulong)0x31600000001)); //gizmo_top100defaultthumb = 0x31600000001,
            SortAlmostFriendButton.Tooltip  = GameFacade.Strings.GetString("f106", "4");
            SortAlmostFriendButton.Position = new Vector2(135, 47)
                                              + (new Vector2(17 / 2f, 14) - new Vector2(SortAlmostFriendButton.Texture.Width / 8, SortAlmostFriendButton.Texture.Height));
            Add(SortAlmostFriendButton);

            SortAlmostEnemyButton          = new UIButton(GetTexture((ulong)0xCE400000001)); //gizmo_infamousthumb = 0xCE400000001,
            SortAlmostEnemyButton.Tooltip  = GameFacade.Strings.GetString("f106", "5");
            SortAlmostEnemyButton.Position = new Vector2(155, 47)
                                             + (new Vector2(17 / 2f, 14) - new Vector2(SortAlmostEnemyButton.Texture.Width / 8, SortAlmostEnemyButton.Texture.Height));
            Add(SortAlmostEnemyButton);

            SortRoommateButton          = new UIButton(GetTexture((ulong)0x4B700000001)); //ucp far zoom
            SortRoommateButton.Tooltip  = GameFacade.Strings.GetString("f106", "6");
            SortRoommateButton.Position = new Vector2(175, 47)
                                          + (new Vector2(17 / 2f, 14) - new Vector2(SortRoommateButton.Texture.Width / 8, SortRoommateButton.Texture.Height));
            Add(SortRoommateButton);

            //gizmo_scrollbarimg = 0x31000000001,
            //gizmo_scrolldownbtn = 0x31100000001,
            //gizmo_scrollupbtn = 0x31200000001,

            ResultsSlider             = new UISlider();
            ResultsSlider.Orientation = 1;
            ResultsSlider.Texture     = GetTexture(0x31000000001);
            ResultsSlider.MinValue    = 0;
            ResultsSlider.MaxValue    = 2;

            ResultsSlider.X = 529;
            ResultsSlider.Y = 72;
            ResultsSlider.SetSize(0, 214f);
            Add(ResultsSlider);

            SliderUpButton          = new UIButton(GetTexture(0x31200000001));
            SliderUpButton.Position = new Vector2(526, 65);
            Add(SliderUpButton);
            SliderDownButton          = new UIButton(GetTexture(0x31100000001));
            SliderDownButton.Position = new Vector2(526, 287);
            Add(SliderDownButton);

            ResultsSlider.AttachButtons(SliderUpButton, SliderDownButton, 1f);
            ResultsBox.AttachSlider(ResultsSlider);

            SetSize(560, 320);

            SortFriendButton.OnButtonClick       += (btn) => ChangeOrderFunc(OrderFriendly);
            SortEnemyButton.OnButtonClick        += (btn) => ChangeOrderFunc(OrderEnemy);
            SortAlmostFriendButton.OnButtonClick += (btn) => ChangeOrderFunc(OrderAlmostFriendly);
            SortAlmostEnemyButton.OnButtonClick  += (btn) => ChangeOrderFunc(OrderAlmostEnemy);
            SortRoommateButton.OnButtonClick     += (btn) => ChangeOrderFunc(OrderRoommate);

            ChangeOrderFunc(OrderFriendly);

            IncomingButton.OnButtonClick += (btn) => SetOutgoing(false);
            OutgoingButton.OnButtonClick += (btn) => SetOutgoing(true);

            TargetIcon           = new UIPersonButton();
            TargetIcon.FrameSize = UIPersonButtonSize.SMALL;
            TargetIcon.Position  = new Vector2(72, 35);
            Add(TargetIcon);

            CloseButton.OnButtonClick += CloseButton_OnButtonClick;

            FriendLabel          = new UILabel();
            FriendLabel.Position = new Vector2(35, 292);
            Add(FriendLabel);

            IncomingLabel           = new UILabel();
            IncomingLabel.Position  = new Vector2(540 - 36, 292);
            IncomingLabel.Size      = new Vector2(1, 1);
            IncomingLabel.Alignment = TextAlignment.Right;
            Add(IncomingLabel);

            SetOutgoing(true);
        }
Exemplo n.º 3
0
        public UIHintWindow() : base(UIDialogStyle.Close, true)
        {
            Caption = "Hints";
            SetSize(800, 600);

            CloseButton.OnButtonClick += (btn) => { UIScreen.RemoveDialog(this); };
            Opacity = 1f;

            InnerBackground          = new UIImage(GetTexture((ulong)0x7A400000001)).With9Slice(13, 13, 13, 13);
            InnerBackground.Position = new Vector2(15, 45);
            InnerBackground.SetSize(240, 530);
            AddAt(3, InnerBackground);

            AllHints = FSOFacade.Hints.LoadAllHints();
            var cats = AllHints.GroupBy(x => x.Category).OrderBy(x => x.FirstOrDefault(y => y.CatOrder != null)?.CatOrder ?? 0);

            int index = 0;

            foreach (var cat in cats)
            {
                var item = new UIHintListItem(true, cat.FirstOrDefault().Category, 0);
                item.ChildItems = new List <UIHintListItem>();
                foreach (var hint in cat)
                {
                    var subitem = new UIHintListItem(false, hint.Title, index++);
                    subitem.Hint = hint;
                    item.ChildItems.Add(subitem);
                }
                Categories.Add(item);
            }

            ListBox = new UIListBox()
            {
                Position = new Vector2(15 + 7, 45 + 6)
            };
            ListBox.SetSize(227, 530 - 12);
            ListBox.RowHeight = 24;
            ListBox.Columns   = new UIListBoxColumnCollection();
            ListBox.Columns.Add(new UIListBoxColumn()
            {
                Width = 227
            });
            ListBox.SelectionFillColor = new Color(250, 200, 140);
            ListBox.OnChange          += ListBox_OnChange;
            Add(ListBox);

            ResultsSlider             = new UISlider();
            ResultsSlider.Orientation = 1;
            ResultsSlider.Texture     = GetTexture(0x31000000001);
            ResultsSlider.MinValue    = 0;
            ResultsSlider.MaxValue    = 2;

            ResultsSlider.X = 260;
            ResultsSlider.Y = 51;
            ResultsSlider.SetSize(0, 514f);
            Add(ResultsSlider);

            SliderUpButton          = new UIButton(GetTexture(0x31200000001));
            SliderUpButton.Position = new Vector2(257, 44);
            Add(SliderUpButton);
            SliderDownButton          = new UIButton(GetTexture(0x31100000001));
            SliderDownButton.Position = new Vector2(257, 566);
            Add(SliderDownButton);

            ResultsSlider.AttachButtons(SliderUpButton, SliderDownButton, 1f);
            ListBox.AttachSlider(ResultsSlider);

            Icon          = new UIImage();
            Icon.Position = new Vector2(290, 65);
            Icon.SetSize(0, 0);
            Add(Icon);

            Title                     = new UILabel();
            Title.Position            = Icon.Position = new Vector2(290, 40);
            Title.Size                = new Vector2(492, 15);
            Title.CaptionStyle        = TextStyle.DefaultTitle;
            Title.CaptionStyle        = Title.CaptionStyle.Clone();
            Title.CaptionStyle.Color  = Color.White;
            Title.CaptionStyle.Size   = 14;
            Title.CaptionStyle.Shadow = true;
            Title.Alignment           = TextAlignment.Center | TextAlignment.Middle;
            Add(Title);

            RenderCategories();
        }