コード例 #1
0
        public UILargeBulletinSummary() : base("bulletin_large")
        {
            var ui = Content.Content.Get().CustomUI;
            var gd = GameFacade.GraphicsDevice;

            TitleLabel.CaptionStyle.Size = 12;
            TitleLabel.Size     = new Vector2(168, 39);
            TitleLabel.Position = new Vector2(36, 5);

            Body.CaptionStyle.Size = 9;
            Body.CaptionStyle.LineHeightModifier = -3;
            Body.MaxLines = 9;
            Body.Position = new Vector2(36, 44);
            Body.Size     = new Vector2(167, 65);

            PersonButton.Position = new Vector2(186, 157);
            DateLabel.Position    = new Vector2(32, 165);
            PromotedStar.Position = new Vector2(190, -17);

            LotThumb = new UILotThumbButtonAuto().WithDefaultClick();
            var lottex = ui.Get("bulletin_lot_btn.png").Get(gd);

            LotThumb.Init(lottex, lottex);
            LotThumb.Position = new Vector2(30, 107);
            Add(LotThumb);

            OffsetMultiplier = 0.75f;
        }
コード例 #2
0
        public UIBulletinPost()
        {
            var ui = Content.Content.Get().CustomUI;
            var gd = GameFacade.GraphicsDevice;

            var bigCaption = TextStyle.DefaultLabel.Clone();

            bigCaption.Color  = Color.White;
            bigCaption.Shadow = true;
            bigCaption.Size   = 28;
            BaseTitleStyle    = bigCaption.Clone();
            Add(TitleEdit     = new UITextEdit()
            {
                Position     = new Vector2(27, 40),
                Size         = new Vector2(542, 44),
                TextStyle    = bigCaption,
                Alignment    = TextAlignment.Middle | TextAlignment.Center,
                CurrentText  = "",
                MaxChars     = 64,
                FlashOnEmpty = true
            });

            var semiT = bigCaption.Clone();

            semiT.Color         *= 0.6f;
            semiT.Shadow         = false;
            Add(TitlePlaceholder = new UILabel()
            {
                Position     = new Vector2(27, 40),
                Size         = new Vector2(542, 44),
                CaptionStyle = semiT,
                Alignment    = TextAlignment.Middle | TextAlignment.Center,
                Caption      = GameFacade.Strings.GetString("f120", "23")
            });

            BackButton                     = new UIButton(ui.Get("vote_big_btn.png").Get(gd));
            BackButton.Width               = 150;
            BackButton.Caption             = GameFacade.Strings.GetString("f120", "13");
            BackButton.Tooltip             = GameFacade.Strings.GetString("f120", "15");
            BackButton.CaptionStyle        = BackButton.CaptionStyle.Clone();
            BackButton.CaptionStyle.Color  = Color.White;
            BackButton.CaptionStyle.Shadow = true;
            BackButton.CaptionStyle.Size   = 22;
            BackButton.Position            = new Vector2(30, 481);
            Add(BackButton);

            BackButton.OnButtonClick += GoBack;

            MiddleButton                     = new UIButton(ui.Get("vote_big_btn.png").Get(gd));
            MiddleButton.Width               = 150;
            MiddleButton.Caption             = GameFacade.Strings.GetString("f120", "35");
            MiddleButton.CaptionStyle        = BackButton.CaptionStyle.Clone();
            MiddleButton.CaptionStyle.Color  = Color.White;
            MiddleButton.CaptionStyle.Shadow = true;
            MiddleButton.CaptionStyle.Size   = 22;
            MiddleButton.Position            = new Vector2(220, 481);
            Add(MiddleButton);

            MiddleButton.OnButtonClick += MButtonClick;

            RightButton                     = new UIButton(ui.Get("vote_big_btn.png").Get(gd));
            RightButton.Width               = 150;
            RightButton.Caption             = GameFacade.Strings.GetString("f120", "12");
            RightButton.CaptionStyle        = BackButton.CaptionStyle.Clone();
            RightButton.CaptionStyle.Color  = Color.White;
            RightButton.CaptionStyle.Shadow = true;
            RightButton.CaptionStyle.Size   = 22;
            RightButton.Position            = new Vector2(410, 481);
            Add(RightButton);

            RightButton.OnButtonClick += RButtonClick;

            BodyText = new UITextEdit();
            BodyText.BackgroundTextureReference = UITextBox.StandardBackground;
            BodyText.TextMargin      = new Rectangle(8, 3, 8, 3);
            BodyText.FlashOnEmpty    = true;
            BodyText.MaxChars        = 1000;
            BodyText.ScrollbarGutter = 7;
            BodyText.TextMargin      = new Rectangle(12, 10, 12, 10);
            BodyText.SetSize(388, 346);
            BodyText.Position = new Vector2(22, 96);
            Add(BodyText);
            BodyText.ScrollbarImage = GetTexture(0x4AB00000001);
            BodyText.InitDefaultSlider();
            BodyText.OnChange += BodyText_OnChange;

            var emojis = new UIEmojiSuggestions(BodyText);

            DynamicOverlay.Add(emojis);
            emojis.Parent = this;

            var whiteText = TextStyle.DefaultLabel.Clone();

            whiteText.Color  = Color.White;
            whiteText.Shadow = true;

            Add(TimeLabel = new UILabel()
            {
                Position     = new Vector2(34, 442),
                CaptionStyle = whiteText
            });

            Add(TypeLabel = new UILabel()
            {
                Position     = new Vector2(34, 442),
                Size         = new Vector2(388 - 24, 1),
                Alignment    = TextAlignment.Right | TextAlignment.Top,
                CaptionStyle = whiteText
            });


            Add(PropertyButtonBG = new UIImage(ui.Get("bulletin_post_lot_bg.png").Get(gd))
            {
                Position = new Vector2(440, 101)
            });

            Add(PersonButtonBG = new UIImage(ui.Get("bulletin_post_ava_bg.png").Get(gd))
            {
                Position = new Vector2(449, 266 - 23)
            });

            Add(LotThumbButton = new UILotThumbButtonAuto()
            {
                Position = new Vector2(446, 107)
            });
            LotThumbButton.OnNameChange += (id, name) =>
            {
                if (id == 0)
                {
                    PropertyButtonName.Caption = GameFacade.Strings.GetString("f120", "28");
                }
                else
                {
                    PropertyButtonName.Caption = name;
                }
                if (EditorMode)
                {
                    LotThumbButton.LotTooltip = GameFacade.Strings.GetString("f120", "29");
                }
            };
            LotThumbButton.OnLotClick += PropertyButtonClick;
            LotThumbButton.Init(GetTexture(0x0000079300000001), GetTexture(0x0000079300000001));

            DynamicOverlay.Add(PersonButton = new UIBigPersonButton()
            {
                Position = new Vector2(452, 269 - 23)
            });

            PersonButton.OnNameChange += (id, name) =>
            {
                PersonButtonName.Caption = name;
            };

            Add(PropertyButtonName = new UILabel()
            {
                Position     = new Vector2(435, 202),
                Size         = new Vector2(151, 1),
                Alignment    = TextAlignment.Center | TextAlignment.Top,
                CaptionStyle = whiteText,
                Caption      = "",
                Wrapped      = true,
                MaxLines     = 4
            });

            Add(PersonButtonName = new UILabel()
            {
                Position     = new Vector2(435, 442 - 23),
                Size         = new Vector2(151, 1),
                Alignment    = TextAlignment.Center | TextAlignment.Top,
                CaptionStyle = whiteText,
                Caption      = "",
                Wrapped      = true,
                MaxLines     = 3
            });

            Size = new Vector2(600, 550);
        }