public UINewspaperItemButton() { BaseButton = new UINineSliceButton(); BaseButton.SetNineSlice(15, 15, 15, 15); BaseButton.Width = 180; BaseButton.Height = 48; BaseButton.OnButtonClick += (btn) => OnClicked?.Invoke(btn); Add(BaseButton); Title = new UILabel(); Title.CaptionStyle = Title.CaptionStyle.Clone(); Title.CaptionStyle.Size = 12; Title.CaptionStyle.Color = Color.White; Title.Alignment = TextAlignment.Left | TextAlignment.Top; Title.Position = new Vector2(7, -1); Add(Title); Body = new UITextEdit(); Body.TextStyle = Body.TextStyle.Clone(); Body.TextStyle.Size = 9; Body.TextStyle.LineHeightModifier = -5; Body.SetSize(167, 32); Body.Mode = UITextEditMode.ReadOnly; Body.Position = new Vector2(7, 15); Body.RemoveMouseEvent(); Add(Body); }
public void CommentResized() { if (Type == TREEBoxType.Label) { //auto resize based on text edit contents RecenterSize((int)TextEdit.TextStyle.MeasureString(TextEdit.CurrentText).X + 26, 26); } //fit the text box to the new size. var margin = (Type == TREEBoxType.Comment) ? 8 : 4; TextEdit.SetSize(Width - margin * 2, Height - margin * 2); TextEdit.Position = new Vector2(margin); if (Type == TREEBoxType.Comment) { TextEdit.Y -= 3; } }
public UIRatingSummaryPanel() { Body = new UITextEdit(); Body.TextStyle = Body.TextStyle.Clone(); Body.TextStyle.Size = 9; Body.TextStyle.LineHeightModifier = -4; Body.Position = new Vector2(5, 5); Body.SetSize(118, 81); Body.MaxLines = 5; Body.Mode = UITextEditMode.ReadOnly; Body.Position = new Vector2(7, 3); Body.BBCodeEnabled = true; Body.RemoveMouseEvent(); Add(Body); Body.Tooltip = GameFacade.Strings.GetString("f115", "94"); NameLabel = new UILabel(); NameLabel.CaptionStyle = NameLabel.CaptionStyle.Clone(); NameLabel.CaptionStyle.Size = 9; NameLabel.Position = new Vector2(122, 77); NameLabel.Alignment = TextAlignment.Right | TextAlignment.Top; NameLabel.Size = new Vector2(1, 1); NameLabel.CaptionStyle.Size = 9; Add(NameLabel); Rating = new UIRatingDisplay(true); Rating.Position = new Vector2(7, 80); Add(Rating); CurrentRating = new Binding <MayorRating>() .WithBinding(this, "Message", "MayorRating_Comment") .WithBinding(this, "HalfStars", "MayorRating_HalfStars") .WithBinding(this, "Name", "MayorRating_FromAvatar", (object id) => { return(((uint)id == 0) ? "Anon" : "unknown"); }); Size = new Vector2(128, 96); ClickHandler = ListenForMouse(new Rectangle(0, 0, 128, 96), new UIMouseEvent(OnMouseEvent)); }
public UIRatingContainer(bool rating) { Edit = new UITextEdit(); Edit.SetSize(420, 75); Edit.Mode = UITextEditMode.Editor; Edit.OnChange += Edit_OnChange; Edit.MaxLines = 4; Edit.MaxChars = 140; Edit.BackgroundTextureReference = UITextBox.StandardBackground; Edit.TextMargin = new Rectangle(8, 2, 8, 3); Add(Edit); Rating = new UIRatingDisplay(true); Rating.Position = new Vector2(5, 80); Rating.Settable = true; Rating.DisplayStars = 0; Rating.Visible = rating; Add(Rating); CurrentRatingLabel = new UILabel(); CurrentRatingLabel.Position = new Vector2(75, 77); CurrentRatingLabel.CaptionStyle = TextStyle.DefaultTitle.Clone(); CurrentRatingLabel.CaptionStyle.Shadow = true; CurrentRatingLabel.Caption = "0 Stars"; CurrentRatingLabel.Visible = rating; Add(CurrentRatingLabel); CharacterLimitDisplay = new UILabel(); CharacterLimitDisplay.Position = new Vector2(414, 77); CharacterLimitDisplay.Alignment = TextAlignment.Right | TextAlignment.Top; CharacterLimitDisplay.Size = new Vector2(1, 1); CharacterLimitDisplay.CaptionStyle = TextStyle.DefaultTitle.Clone(); CharacterLimitDisplay.CaptionStyle.Shadow = true; CharacterLimitDisplay.Caption = "0/140"; Add(CharacterLimitDisplay); var emoji = new UIEmojiSuggestions(Edit); Add(emoji); }
public void SetSize(int width, int height) { BaseButton.Width = width; BaseButton.Height = height; Body.SetSize(167, height - 16); }
protected override void InitUI() { BarGraphs = new UINewspaperPctBar[8]; for (int i = 0; i < 8; i++) { BarGraphs[i] = new UINewspaperPctBar(GameFacade.Strings.GetString("f108", (i + 1).ToString()), 0, 0, i == 7); BarGraphs[i].Position = new Vector2(80 + 45 * i, 45 + 187); Add(BarGraphs[i]); } GraphTab = new UINewspaperGraphTab(); GraphTab.Position = new Vector2(0, 187); Add(GraphTab); FrontTab = new UINewspaperCover(); FrontTab.Position = new Vector2(0, 187); FrontTab.OnShowNewsItem += FrontTab_OnShowNewsItem; Add(FrontTab); FrontTabBtn = new UIButton(GetTexture((ulong)GameContent.FileIDs.UIFileIDs.eod_dc_newcardbtn)); FrontTabBtn.Position = new Vector2(33 + 21, 55 + 5 + 187); FrontTabBtn.OnButtonClick += (btn) => SetTab(0); FrontTabBtn.Tooltip = GameFacade.Strings.GetString("f108", "14"); Add(FrontTabBtn); var ui = Content.Content.Get().CustomUI; BarTabBtn = new UIButton(ui.Get("eod_news_bar.png").Get(GameFacade.GraphicsDevice)); BarTabBtn.Position = new Vector2(33, 55 + 37 + 187); BarTabBtn.Tooltip = GameFacade.Strings.GetString("f108", "15"); BarTabBtn.OnButtonClick += (btn) => SetTab(1); Add(BarTabBtn); GraphTabBtn = new UIButton(ui.Get("eod_news_line.png").Get(GameFacade.GraphicsDevice)); GraphTabBtn.Position = new Vector2(38, 55 + 71 + 187); GraphTabBtn.Tooltip = GameFacade.Strings.GetString("f108", "16"); GraphTabBtn.OnButtonClick += (btn) => SetTab(2); Add(GraphTabBtn); TopBg = new UIImage(GetTexture((ulong)GameContent.FileIDs.UIFileIDs.eod_signs_readback)); TopBg.Position = new Vector2(20, 93); Add(TopBg); TopSlider = new UISlider(); TopSlider.Texture = GetTexture((ulong)GameContent.FileIDs.UIFileIDs.eod_signs_slider); TopSlider.Orientation = 1; TopSlider.SetSize(TopSlider.Texture.Width, 105); TopSlider.Position = new Vector2(425, 103); Add(TopSlider); TopText = new UITextEdit(); TopText.SetSize(366, 107 - 12); TopText.TextMargin = new Rectangle(12, 12, 12, 12); TopText.Position = new Vector2(53, 95); TopText.TextStyle = TopText.TextStyle.Clone(); TopText.TextStyle.LineHeightModifier = -3; TopText.CurrentText = GameFacade.Strings.GetString("f108", "19"); Add(TopText); TopText.AttachSlider(TopSlider); SetTab(0); OnContract(); }
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); }
public UIChatCategoryDialog(VMTSOChatChannel cat, bool isNew) : base(UIDialogStyle.OK | UIDialogStyle.Close, true) { Channel = cat; Caption = GameFacade.Strings.GetString("f113", "21") + cat.ID; var topVbox = new UIVBoxContainer(); var nameLabel = new UILabel(); nameLabel.Caption = GameFacade.Strings.GetString("f113", "22"); topVbox.Add(nameLabel); NameEdit = new UITextBox(); NameEdit.SetSize(200, 25); NameEdit.CurrentText = cat.Name; NameEdit.MaxChars = 8; topVbox.Add(NameEdit); var descLabel = new UILabel(); descLabel.Caption = GameFacade.Strings.GetString("f113", "23"); topVbox.Add(descLabel); DescEdit = new UITextEdit(); DescEdit.BackgroundTextureReference = UITextBox.StandardBackground; DescEdit.TextMargin = new Rectangle(8, 2, 8, 3); DescEdit.SetSize(400, 100); DescEdit.CurrentText = cat.Description; DescEdit.MaxChars = 256; DescEdit.MaxLines = 5; topVbox.Add(DescEdit); var flagLabel = new UILabel(); flagLabel.Caption = GameFacade.Strings.GetString("f113", "24"); topVbox.Add(flagLabel); var flagbox = new UIHBoxContainer(); for (var i = 0; i < 2; i++) { var caption = GameFacade.Strings.GetString("f113", (25 + i).ToString()); var check = new UIButton(GetTexture(0x0000083600000001)); check.Tooltip = caption; var flag = (VMTSOChatChannelFlags)(1 << i); check.OnButtonClick += x => { check.Selected = !check.Selected; cat.Flags ^= flag; }; check.Selected = (cat.Flags & flag) > 0; flagbox.Add(check); flagbox.Add(new UILabel { Caption = caption }); } topVbox.Add(flagbox); flagbox.AutoSize(); Add(topVbox); topVbox.AutoSize(); topVbox.Position = new Vector2(20, 35); UIVBoxContainer before = null; for (int j = 0; j < 2; j++) { var vbox = new UIVBoxContainer(); vbox.Add(new UILabel { Caption = (j == 0) ? GameFacade.Strings.GetString("f113", "35") : GameFacade.Strings.GetString("f113", "36") }); var viewMin = (j == 0); for (uint i = 0; i < 4; i++) { var hbox = new UIHBoxContainer(); var radio = new UIRadioButton(); radio.RadioGroup = (j == 0) ? "viewPerm" : "showPerm"; radio.RadioData = (VMTSOAvatarPermissions)i; radio.Selected = (viewMin)?(i == (int)cat.ViewPermMin): (i == (int)cat.SendPermMin); radio.Tooltip = GameFacade.Strings.GetString("f113", (37 + i).ToString()); radio.OnButtonClick += (btn) => { if (viewMin) { cat.ViewPermMin = (VMTSOAvatarPermissions)radio.RadioData; } else { cat.SendPermMin = (VMTSOAvatarPermissions)radio.RadioData; } }; hbox.Add(radio); hbox.Add(new UILabel { Caption = GameFacade.Strings.GetString("f113", (37 + i).ToString()) }); vbox.Add(hbox); } before = vbox; vbox.Position = new Vector2(20 + j * 200, topVbox.Size.Y + 50); Add(vbox); vbox.AutoSize(); } var buttonsHbox = new UIHBoxContainer(); if (!isNew) { var deleteButton = new UIButton(); deleteButton.Caption = GameFacade.Strings.GetString("f113", "33"); deleteButton.OnButtonClick += (btn) => { UIScreen.RemoveDialog(this); Channel.Flags |= VMTSOChatChannelFlags.Delete; OnDelete(); }; buttonsHbox.Add(deleteButton); } var setColorButton = new UIButton(); setColorButton.Caption = GameFacade.Strings.GetString("f113", "34"); setColorButton.CaptionStyle = setColorButton.CaptionStyle.Clone(); setColorButton.CaptionStyle.Color = cat.TextColor; setColorButton.CaptionStyle.Shadow = true; setColorButton.OnButtonClick += (btn) => { UIAlert alert = null; alert = UIScreen.GlobalShowAlert(new UIAlertOptions() { Title = "", Message = GameFacade.Strings.GetString("f113", "8"), Color = true, Buttons = new UIAlertButton[] { new UIAlertButton(UIAlertButtonType.OK, (btn2) => { //set the color var col = int.Parse(alert.ResponseText); cat.TextColor = new Color(col >> 16, (byte)(col >> 8), (byte)col); setColorButton.CaptionStyle.Color = cat.TextColor; setColorButton.Invalidate(); UIScreen.RemoveDialog(alert); }), new UIAlertButton(UIAlertButtonType.Cancel) } }, true); }; buttonsHbox.Add(setColorButton); buttonsHbox.AutoSize(); buttonsHbox.Position = new Vector2((440 - buttonsHbox.Size.X) / 2, topVbox.Size.Y + before.Size.Y + 65); Add(buttonsHbox); SetSize(440, (int)(topVbox.Size.Y + before.Size.Y + 115)); CloseButton.OnButtonClick += (btn) => { UIScreen.RemoveDialog(this); }; OKButton.OnButtonClick += (btn) => { Channel.Name = NameEdit.CurrentText; Channel.Description = DescEdit.CurrentText; UIScreen.RemoveDialog(this); }; }
public UILoginDialog(LoginScreen loginScreen) : base(UIDialogStyle.Standard, true) { this.m_LoginScreen = loginScreen; this.Caption = GameFacade.Strings.GetString("UIText", "209", "1"); SetSize(350, 225); m_TxtAccName = UITextEdit.CreateTextBox(); m_TxtAccName.X = 20; m_TxtAccName.Y = 72; m_TxtAccName.MaxChars = 16; m_TxtAccName.SetSize(310, 27); m_TxtAccName.CurrentText = "username"; this.Add(m_TxtAccName); m_TxtPass = UITextEdit.CreateTextBox(); m_TxtPass.X = 20; m_TxtPass.Y = 128; m_TxtPass.MaxChars = 16; m_TxtPass.CurrentText = "password"; m_TxtPass.SetSize(310, 27); this.Add(m_TxtPass); /** Login button **/ var loginBtn = new UIButton { X = 116, Y = 170, Width = 100, ID = "LoginButton", Caption = GameFacade.Strings.GetString("UIText", "209", "2") }; this.Add(loginBtn); loginBtn.OnButtonClick += new ButtonClickDelegate(loginBtn_OnButtonClick); var exitBtn = new UIButton { X = 226, Y = 170, Width = 100, ID = "ExitButton", Caption = GameFacade.Strings.GetString("UIText", "209", "3") }; this.Add(exitBtn); exitBtn.OnButtonClick += new ButtonClickDelegate(exitBtn_OnButtonClick); this.Add(new UILabel { Caption = GameFacade.Strings.GetString("UIText", "209", "4"), X = 24, Y = 50 }); this.Add(new UILabel { Caption = GameFacade.Strings.GetString("UIText", "209", "5"), X = 24, Y = 106 }); }
public UILoginDialog(Action login) : base(UIDialogStyle.Standard, true) { this.Login = login; this.Caption = GameFacade.Strings.GetString("UIText", "209", "1"); SetSize(350, 225); m_TxtAccName = UITextEdit.CreateTextBox(); m_TxtAccName.X = 20; m_TxtAccName.Y = 72; m_TxtAccName.MaxChars = 32; m_TxtAccName.SetSize(310, 27); m_TxtAccName.CurrentText = GlobalSettings.Default.LastUser; m_TxtAccName.OnChange += M_TxtAccName_OnChange; m_TxtAccName.OnTabPress += new KeyPressDelegate(m_TxtAccName_OnTabPress); m_TxtAccName.OnEnterPress += new KeyPressDelegate(loginBtn_OnButtonClick); this.Add(m_TxtAccName); m_TxtPass = UITextEdit.CreateTextBox(); m_TxtPass.X = 20; m_TxtPass.Y = 128; m_TxtPass.MaxChars = 64; m_TxtPass.SetSize(310, 27); m_TxtPass.Password = true; m_TxtPass.OnChange += M_TxtAccName_OnChange; //m_TxtPass.OnTabPress += new KeyPressDelegate(m_TxtPass_OnTabPress); m_TxtPass.OnEnterPress += new KeyPressDelegate(loginBtn_OnButtonClick); m_TxtPass.OnShiftTabPress += new KeyPressDelegate(m_TxtPass_OnShiftTabPress); this.Add(m_TxtPass); /** Login button **/ var loginBtn = new UIButton { X = 116, Y = 170, Width = 100, ID = "LoginButton", Caption = GameFacade.Strings.GetString("UIText", "209", "2") }; this.Add(loginBtn); loginBtn.OnButtonClick += new ButtonClickDelegate(loginBtn_OnButtonClick); var exitBtn = new UIButton { X = 226, Y = 170, Width = 100, ID = "ExitButton", Caption = GameFacade.Strings.GetString("UIText", "209", "3") }; this.Add(exitBtn); exitBtn.OnButtonClick += new ButtonClickDelegate(exitBtn_OnButtonClick); this.Add(new UILabel { Caption = GameFacade.Strings.GetString("UIText", "209", "4"), X = 24, Y = 50 }); this.Add(new UILabel { Caption = GameFacade.Strings.GetString("UIText", "209", "5"), X = 24, Y = 106 }); GameFacade.Screens.inputManager.SetFocus(m_TxtAccName); RefreshBlink(); }
public UIFullRatingItem(uint ratingID) { RatingID = ratingID; Body = new UITextEdit(); Body.TextStyle = Body.TextStyle.Clone(); Body.TextStyle.Size = 8; Body.TextStyle.Color = Color.White; Body.SetSize(454, 42); Body.MaxLines = 3; Body.Mode = UITextEditMode.ReadOnly; Body.Position = new Vector2(15, 20); Body.BBCodeEnabled = true; Body.RemoveMouseEvent(); Add(Body); StarLabel = new UILabel(); StarLabel.Position = new Vector2(75, 4); StarLabel.Alignment = TextAlignment.Left | TextAlignment.Top; StarLabel.Size = new Vector2(1, 1); Add(StarLabel); NameLabel = new UILabel(); NameLabel.Position = new Vector2(465, 4); NameLabel.Alignment = TextAlignment.Right | TextAlignment.Top; NameLabel.Size = new Vector2(1, 1); Add(NameLabel); Rating = new UIRatingDisplay(true); Rating.Position = new Vector2(9, 7); Add(Rating); CurrentRating = new Binding <MayorRating>() .WithBinding(this, "Message", "MayorRating_Comment") .WithBinding(this, "HalfStars", "MayorRating_HalfStars") .WithBinding(this, "Name", "MayorRating_FromAvatar", (object id) => { return(((uint)id == 0) ? "Anon" : "unknown"); }); var ui = Content.Content.Get().CustomUI; var btnTex = ui.Get("chat_cat.png").Get(GameFacade.GraphicsDevice); var btnCaption = TextStyle.DefaultLabel.Clone(); btnCaption.Size = 8; btnCaption.Shadow = true; if (GameFacade.EnableMod) { DeleteButton = new UIButton(btnTex); DeleteButton.Caption = "Delete"; DeleteButton.CaptionStyle = btnCaption; DeleteButton.OnButtonClick += DeletePost; DeleteButton.Width = 64; DeleteButton.X = 135; DeleteButton.Y = 4; Add(DeleteButton); } Size = new Vector2(475, 70); PxWhite = TextureGenerator.GetPxWhite(GameFacade.GraphicsDevice); }
public UISimCASPanel() { var ui = Content.Get().CustomUI; var gd = GameFacade.GraphicsDevice; SimTabButton = new UIStencilButton(ui.Get("cas_sim.png").Get(gd)); SimTabButton.Position = new Vector2(); SimTabButton.OnButtonClick += (btn) => { SetTab(0); }; Add(SimTabButton); PersonalityTabButton = new UIStencilButton(ui.Get("cas_per.png").Get(gd)); PersonalityTabButton.Position = new Vector2(0, 93); PersonalityTabButton.OnButtonClick += (btn) => { SetTab(1); }; Add(PersonalityTabButton); BioTabButton = new UIStencilButton(ui.Get("cas_bio.png").Get(gd)); BioTabButton.Position = new Vector2(0, 186); BioTabButton.OnButtonClick += (btn) => { SetTab(2); }; Add(BioTabButton); FirstNameTitle = new UILabel(); FirstNameTitle.Caption = "First Name"; FirstNameTitle.Position = new Vector2(96, 6); InitLabel(FirstNameTitle, 15); FirstNameTitle.CaptionStyle.Color = UIStyle.Current.SecondaryText; FirstNameTextBox = new UITextBox(); FirstNameTextBox.Position = new Vector2(94, 26); FirstNameTextBox.Alignment = TextAlignment.Center; FirstNameTextBox.SetSize(401, 48); FirstNameTextBox.TextStyle = FirstNameTextBox.TextStyle.Clone(); FirstNameTextBox.TextStyle.Color = UIStyle.Current.Text; FirstNameTextBox.TextStyle.Size = 25; Add(FirstNameTextBox); // SIM TAB SimGenderTitle = new UILabel(); SimGenderTitle.Caption = "Gender"; SimGenderTitle.Size = Vector2.One; SimGenderTitle.Position = new Vector2(113 + 32, 95); SimGenderTitle.Alignment = TextAlignment.Middle | TextAlignment.Center; InitLabel(SimGenderTitle, 15); SimAgeTitle = new UILabel(); SimAgeTitle.Caption = "Age"; SimAgeTitle.Size = Vector2.One; SimAgeTitle.Position = new Vector2(212 + 32, 95); SimAgeTitle.Alignment = TextAlignment.Middle | TextAlignment.Center; InitLabel(SimAgeTitle, 15); SimSkinTitle = new UILabel(); SimSkinTitle.Caption = "Skin Color"; SimSkinTitle.Size = Vector2.One; SimSkinTitle.Position = new Vector2(302 + 45, 95); SimSkinTitle.Alignment = TextAlignment.Middle | TextAlignment.Center; InitLabel(SimSkinTitle, 15); SimMaleBtn = new UIStencilButton(ui.Get("cas_male.png").Get(gd)); SimMaleBtn.OnButtonClick += (btn) => ChangeType(0, 'm'); SimMaleBtn.Position = new Vector2(113, 114); Add(SimMaleBtn); SimFemaleBtn = new UIStencilButton(ui.Get("cas_female.png").Get(gd)); SimFemaleBtn.OnButtonClick += (btn) => ChangeType(0, 'f'); SimFemaleBtn.Position = new Vector2(113, 191); Add(SimFemaleBtn); SimAdultBtn = new UIStencilButton(ui.Get("cas_adult.png").Get(gd)); SimAdultBtn.OnButtonClick += (btn) => ChangeType(1, 'a'); SimAdultBtn.Position = new Vector2(212, 114); Add(SimAdultBtn); SimChildBtn = new UIStencilButton(ui.Get("cas_child.png").Get(gd)); SimChildBtn.OnButtonClick += (btn) => ChangeType(1, 'c'); SimChildBtn.Position = new Vector2(212, 191); Add(SimChildBtn); SimSkinLgtBtn = new UIStencilButton(ui.Get("cas_skinlgt.png").Get(gd)); SimSkinLgtBtn.OnButtonClick += (btn) => ChangeSkin("lgt"); SimSkinLgtBtn.Position = new Vector2(302, 114); Add(SimSkinLgtBtn); SimSkinMedBtn = new UIStencilButton(ui.Get("cas_skinmed.png").Get(gd)); SimSkinMedBtn.OnButtonClick += (btn) => ChangeSkin("med"); SimSkinMedBtn.Position = new Vector2(302, 164); Add(SimSkinMedBtn); SimSkinDrkBtn = new UIStencilButton(ui.Get("cas_skindrk.png").Get(gd)); SimSkinDrkBtn.OnButtonClick += (btn) => ChangeSkin("drk"); SimSkinDrkBtn.Position = new Vector2(302, 214); Add(SimSkinDrkBtn); SimRandomBtn = new UIStencilButton(ui.Get("cas_rand.png").Get(gd)); SimRandomBtn.Position = new Vector2(405, 142); SimRandomBtn.OnButtonClick += SimRandomBtn_OnButtonClick; Add(SimRandomBtn); //PERSONALITY TAB PerNeatTitle = new UILabel(); PerNeatTitle.Position = new Vector2(99, 85); PerNeatTitle.Size = new Vector2(110, 1); PerNeatTitle.Alignment = TextAlignment.Right; PerNeatTitle.Caption = "Neat:"; InitLabel(PerNeatTitle, 15); PerOutgoingTitle = new UILabel(); PerOutgoingTitle.Position = new Vector2(99, 122); PerOutgoingTitle.Size = new Vector2(110, 1); PerOutgoingTitle.Alignment = TextAlignment.Right; PerOutgoingTitle.Caption = "Outgoing:"; InitLabel(PerOutgoingTitle, 15); PerActiveTitle = new UILabel(); PerActiveTitle.Position = new Vector2(99, 160); PerActiveTitle.Size = new Vector2(110, 1); PerActiveTitle.Alignment = TextAlignment.Right; PerActiveTitle.Caption = "Active:"; InitLabel(PerActiveTitle, 15); PerPlayfulTitle = new UILabel(); PerPlayfulTitle.Position = new Vector2(99, 200); PerPlayfulTitle.Size = new Vector2(110, 1); PerPlayfulTitle.Alignment = TextAlignment.Right; PerPlayfulTitle.Caption = "Playful:"; InitLabel(PerPlayfulTitle, 15); PerNiceTitle = new UILabel(); PerNiceTitle.Position = new Vector2(99, 238); PerNiceTitle.Size = new Vector2(110, 1); PerNiceTitle.Alignment = TextAlignment.Right; PerNiceTitle.Caption = "Nice:"; InitLabel(PerNiceTitle, 15); PersonalityTex = ui.Get("skill.png").Get(gd); for (int i = 0; i < 5; i++) { Personalities[i] = new UICASPersonalityBar(this); Personalities[i].Position = new Vector2(215, 87 + i * 38); Add(Personalities[i]); } //BIO TAB BioTitle = new UILabel(); BioTitle.Position = new Vector2(99, 85); BioTitle.Caption = "Bio:"; InitLabel(BioTitle, 15); BioBG = new UIImage(ui.Get("cas_bio_bg.png").Get(gd)).With9Slice(15, 15, 15, 15); BioBG.Position = new Vector2(99, 112); BioBG.SetSize(390, 152); Add(BioBG); BioEdit = new UITextEdit(); BioEdit.Position = new Vector2(107, 122); BioEdit.SetSize(371, 133); BioEdit.TextStyle = BioEdit.TextStyle.Clone(); BioEdit.TextStyle.Color = UIStyle.Current.Text; BioEdit.TextStyle.Size = 12; BioEdit.MaxLines = 7; Add(BioEdit); UpdateType(); SetTab(0); }