void AddRadioGroup(string title, string groupName, string[] optionLabels, object[] optionValues) { var vbox = new UIVBoxContainer(); vbox.Add(new UILabel() { Caption = title }); for (var i = 0; i < optionLabels.Length; i++) { var formField = new UIHBoxContainer(); vbox.Add(formField); var radio = new UIRadioButton { RadioData = optionValues[i], RadioGroup = groupName }; radio.OnButtonClick += Radio_OnButtonClick; radio.Tooltip = optionLabels[i]; formField.Add(radio); formField.Add(new UILabel { Caption = optionLabels[i] }); } Container.Add(vbox); }
void InitUI() { Container = new UIHBoxContainer() { Spacing = 10 }; Add(Container); //Height AddRadioGroup("Height", "Height", new string[] { "Normal", "Tall", "Double Tall" }, new object[] { EODHeight.Normal, EODHeight.Tall, EODHeight.TallTall }); //Width AddRadioGroup("Length", "Length", new string[] { "Full", "Medium", "Short" }, new object[] { EODLength.Full, EODLength.Medium, EODLength.Short }); //Buttons AddRadioGroup("Buttons", "Buttons", new string[] { "0", "1", "2" }, new object[] { (byte)0, (byte)1, (byte)2 }); //Timer AddRadioGroup("Timer", "Timer", new string[] { "None", "Normal", "Straight" }, new object[] { EODTimer.None, EODTimer.Normal, EODTimer.Straight }); //Tips AddRadioGroup("Tips", "Tips", new string[] { "None", "Long", "Short" }, new object[] { EODTextTips.None, EODTextTips.Long, EODTextTips.Short }); var other = new UIVBoxContainer(); //Expandable AddCheckBox(other, "Expandable", "Expandable"); Container.Add(other); Container.AutoSize(); }
public UIHintAlert(UIHint hint) : base(new UIAlertOptions() { Title = "Hint (0 of 0)", Width = 700, Message = "", Buttons = new UIAlertButton[] { new UIAlertButton(UIAlertButtonType.Cancel, (btn) => { }, "Previous"), new UIAlertButton(UIAlertButtonType.OK, (btn) => { }), }, AllowBB = true }) { PrevButton = ButtonMap[UIAlertButtonType.Cancel]; PrevButton.OnButtonClick += (btn) => HintAdvance(-1); NextButton = ButtonMap[UIAlertButtonType.OK]; NextButton.OnButtonClick += (btn) => HintAdvance(1); OKText = NextButton.Caption; Hints = new List <UIHint>() { hint }; var formField = new UIHBoxContainer { X = 20 }; HideContainer = formField; Add(formField); var check = new UIButton(GetTexture(0x0000083600000001)) { Tooltip = "Mark all hints as read. Hints added by future updates will still be shown." }; check.OnButtonClick += x => { check.Selected = !check.Selected; }; HideHintCheck = check; formField.Add(check); formField.Add(new UILabel { Caption = "Hide Hints" }); Opacity = 1f; RenderHint(); }
public UILotSkillModeDialog(LotCategory category, uint originalValue) : base(UIDialogStyle.OK | UIDialogStyle.Close, true) { SetSize(400, 300); uint min = 0; if (!SkillGameplayCategory.TryGetValue(category, out min)) { min = 0; } Caption = GameFacade.Strings.GetString("f109", "5"); DescLabel = new UILabel { Caption = GameFacade.Strings.GetString("f109", "6") + ((min > 0) ? ("\n\n" + GameFacade.Strings.GetString("f109", "7")) : ""), Position = new Vector2(25, 40), Wrapped = true, Size = new Vector2(350, 200) }; Add(DescLabel); var vbox = new UIVBoxContainer(); for (uint i = 0; i < 3; i++) { var hbox = new UIHBoxContainer(); var radio = new UIRadioButton { RadioGroup = "skl", RadioData = i, Disabled = i < min, Selected = i == originalValue }; radio.OnButtonClick += Radio_OnButtonClick; hbox.Add(radio); hbox.Add(new UILabel { Caption = GameFacade.Strings.GetString("f109", (8 + i).ToString()) }); vbox.Add(hbox); } vbox.Position = new Vector2(25, 200); Add(vbox); vbox.AutoSize(); CloseButton.OnButtonClick += CloseButton_OnButtonClick; OKButton.OnButtonClick += OKButton_OnButtonClick; }
public UIDonatorDialog(UILotControl panel) : base(UIDialogStyle.Standard, false) { LotParent = panel; var modeHBox = new UIHBoxContainer(); modeHBox.Spacing = 20; for (int i = 0; i < 2; i++) { var hbox = new UIHBoxContainer(); var radio = new UIRadioButton(); radio.RadioGroup = "donateMode"; radio.RadioData = false; radio.Selected = (i == 0); radio.Tooltip = ModeNames[i]; var donate = (i > 0); radio.OnButtonClick += (btn) => { SetDonate(donate); }; ModeButtons[i] = radio; hbox.Add(radio); hbox.Add(new UILabel { Caption = ModeNames[i] }); modeHBox.Add(hbox); } modeHBox.AutoSize(); modeHBox.Position = new Vector2((400 - modeHBox.Size.X) / 2, 35); Add(modeHBox); SetSize(400, 100); Add(SummaryLabel = new UILabel() { Caption = "(100/100) Mayor Objects, (1999/2000) Donated Objects", Position = new Vector2(200, 70), Size = Vector2.One, Alignment = TextAlignment.Center | TextAlignment.Middle }); GameResized(); Caption = "Community Lot Buy Mode"; }
private void AddCheckBox(UIContainer parent, string caption, string groupName) { var formField = new UIHBoxContainer(); parent.Add(formField); var check = new UIButton(GetTexture(0x0000083600000001)); check.Tooltip = caption; check.OnButtonClick += x => { check.Selected = !check.Selected; SetOption(groupName, check.Selected); }; formField.Add(check); formField.Add(new UILabel { Caption = caption }); }
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 UIProfanityOptions() { //var alert = UIScreen.GlobalShowAlert(new UIAlertOptions { Title = "Not Implemented", Message = "This feature is not implemented yet!" }, true); var uis = this.RenderScript("profanitypanel.uis"); //don't draw, this currently breaks the uis parser //var bg = uis.Create<UIImage>("Background"); //AddAt(0, bg); Remove(PrevColorButton); Remove(NextColorButton); Remove(AddButton); Remove(SubtractButton); Remove(EnableFilterCheckButton); Remove(ProfanityFilterTitle); Remove(EntryBox); EnterWordLabel.Caption = GameFacade.Strings.GetString("f113", "5"); var ttsToggleContainer = new UIHBoxContainer(); ttsToggleContainer.Add(new UILabel() { Caption = GameFacade.Strings.GetString("f113", "1") }); var ttsMode = GlobalSettings.Default.TTSMode; for (int i = 0; i < 3; i++) { var radio = new UIRadioButton(); radio.RadioData = i; radio.RadioGroup = "ttsOpt"; radio.OnButtonClick += TTSOptSet; radio.Tooltip = GameFacade.Strings.GetString("f113", (2 + i).ToString()); radio.Selected = ttsMode == i; ttsToggleContainer.Add(radio); ttsToggleContainer.Add(new UILabel() { Caption = radio.Tooltip }); } ttsToggleContainer.Position = new Vector2(10, 10); Add(ttsToggleContainer); ttsToggleContainer.AutoSize(); var col = new Color(GlobalSettings.Default.ChatColor); ChatColor.CaptionStyle = ChatColor.CaptionStyle.Clone(); ChatColor.CaptionStyle.Color = col; ChatColor.CaptionStyle.Shadow = true; ChatColor.Caption = "#" + col.R.ToString("x2") + col.G.ToString("x2") + col.B.ToString("x2"); var changeBtn = new UIButton(); changeBtn.Caption = GameFacade.Strings.GetString("f113", "6"); changeBtn.Position = new Microsoft.Xna.Framework.Vector2(155 + 100, 74 - 7); Add(changeBtn); changeBtn.OnButtonClick += (btn1) => { UIAlert alert = null; alert = UIScreen.GlobalShowAlert(new UIAlertOptions() { Title = "", Message = GameFacade.Strings.GetString("f113", "8"), GenericAddition = new UIColorPicker(), Buttons = new UIAlertButton[] { new UIAlertButton(UIAlertButtonType.OK, (btn) => { //set the color var col2 = int.Parse(alert.ResponseText); GlobalSettings.Default.ChatColor = new Color(col2 >> 16, (byte)(col2 >> 8), (byte)col2).PackedValue; SetChatParams(); UIScreen.RemoveDialog(alert); }), new UIAlertButton(UIAlertButtonType.No, (btn) => { //set the color var rand = new Random(); GlobalSettings.Default.ChatColor = VMTSOAvatarState.RandomColours[rand.Next(VMTSOAvatarState.RandomColours.Length)].PackedValue; SetChatParams(); UIScreen.RemoveDialog(alert); }, GameFacade.Strings.GetString("f113", "7")), new UIAlertButton(UIAlertButtonType.Cancel) } }, true); }; var chatTimestampContainer = new UIHBoxContainer(); chatTimestampContainer.Add(new UILabel() { Caption = GameFacade.Strings.GetString("f113", "44") }); var chatShowTimestamp = GlobalSettings.Default.ChatShowTimestamp; var radioChatTSOff = new UIRadioButton(); radioChatTSOff.RadioData = false; radioChatTSOff.RadioGroup = "chatTSToggle"; radioChatTSOff.OnButtonClick += ChatTsOptSet; radioChatTSOff.Tooltip = GameFacade.Strings.GetString("f113", "45"); radioChatTSOff.Selected = chatShowTimestamp == false; chatTimestampContainer.Add(radioChatTSOff); chatTimestampContainer.Add(new UILabel() { Caption = radioChatTSOff.Tooltip }); var radioChatTSOn = new UIRadioButton(); radioChatTSOn.RadioData = true; radioChatTSOn.RadioGroup = "chatTSToggle"; radioChatTSOn.OnButtonClick += ChatTsOptSet; radioChatTSOn.Tooltip = GameFacade.Strings.GetString("f113", "46"); radioChatTSOn.Selected = chatShowTimestamp == true; chatTimestampContainer.Add(radioChatTSOn); chatTimestampContainer.Add(new UILabel() { Caption = radioChatTSOn.Tooltip }); chatTimestampContainer.Position = new Vector2(368, 10); Add(chatTimestampContainer); chatTimestampContainer.AutoSize(); var chatOpacityContainer = new UIHBoxContainer(); chatOpacityContainer.Position = new Vector2(368, 32); var chatOpacityLabel = new UILabel() { Caption = GameFacade.Strings.GetString("f113", "47") }; chatOpacityContainer.Add(chatOpacityLabel); var chatOpacity = GlobalSettings.Default.ChatWindowsOpacity; var chatOpacitySlider = new UISlider(); chatOpacitySlider.Orientation = 0; chatOpacitySlider.Texture = GetTexture(0x42500000001); chatOpacitySlider.MinValue = 20; chatOpacitySlider.MaxValue = 100; chatOpacitySlider.AllowDecimals = false; chatOpacitySlider.Position = chatOpacityLabel.Position + new Vector2(115, 24); chatOpacitySlider.Value = GlobalSettings.Default.ChatWindowsOpacity * 100; chatOpacitySlider.SetSize(140f, 0f); chatOpacityContainer.Add(chatOpacitySlider); Add(chatOpacityContainer); chatOpacityContainer.AutoSize(); PitchSlider = new UISlider(); PitchSlider.Orientation = 0; PitchSlider.Texture = GetTexture(0x42500000001); PitchSlider.MinValue = -100f; PitchSlider.MaxValue = 100f; PitchSlider.AllowDecimals = false; PitchSlider.Position = EnterWordLabel.Position + new Vector2(115, 3); PitchSlider.Value = GlobalSettings.Default.ChatTTSPitch; PitchSlider.SetSize(150f, 0f); Add(PitchSlider); chatOpacitySlider.OnChange += chatOpacitySlider_OnChange; PitchSlider.OnChange += PitchSlider_OnChange; }