private void AddToggle(FieldInfo field, string additionalInfo = "") { var toggle = new UIToggleImage(TextureManager.Load("Images/UI/Settings_Toggle"), 13, 13, new Point(17, 1), new Point(1, 1)); toggle.SetState((bool)field.GetValue(typeof(NPC))); toggle.OnClick += (evt, elm) => field.SetValue(typeof(NPC), toggle.IsOn); toggleList.Add(toggle); var text = new UIText($"Toggle NPC.{field.Name} {additionalInfo}"); textList.Add(text); }
private void AddToggle(string fieldName, string additionalInfo = "") { // get field Type type = typeof(NPC); var field = type.GetField(fieldName, BindingFlags.Public | BindingFlags.Static); // append toggle var toggle = new UIToggleImage(TextureManager.Load("Images/UI/Settings_Toggle"), 13, 13, new Point(17, 1), new Point(1, 1)); toggle.SetState((bool)field.GetValue(type)); toggle.OnClick += (evt, elm) => field.SetValue(type, toggle.IsOn); toggleList.Add(toggle); // append text var text = new UIText($"Toggle NPC.{fieldName} {additionalInfo}"); textList.Add(text); }
public UIRadio(string name, int number, UIPanel panel, int left, int top, int on) { group = new UIToggleImage[number]; for (int i = 0; i < number; i++) { group[i] = new UIToggleImage(Texture, 14, 14, new Point(16, 0), new Point(0, 0)); group[i].Left.Set(left + i * 20, 0f); group[i].Top.Set(top, 0f); group[i].Width.Set(16, 0f); group[i].Height.Set(16, 0f); group[i].OnClick += ButtonClicked; panel.Append(group[i]); } this.name = name; group[on].SetState(true); UIText text = new UIText(name); text.Top.Set(top, 0f); text.Left.Set(left + 4 * 20, 0f); text.Height.Set(15, 0f); text.Width.Set(95, 0f); panel.Append(text); }
public void InitializePage() { this.RemoveAllChildren(); this._categoryButtons.Clear(); this._achievementElements.Clear(); this._achievementsList = (UIList)null; bool largeForOtherLanguages = true; int num = largeForOtherLanguages.ToInt() * 100; UIElement element1 = new UIElement(); element1.Width.Set(0.0f, 0.8f); element1.MaxWidth.Set(800f + (float)num, 0.0f); element1.MinWidth.Set(600f + (float)num, 0.0f); element1.Top.Set(220f, 0.0f); element1.Height.Set(-220f, 1f); element1.HAlign = 0.5f; this._outerContainer = element1; this.Append(element1); UIPanel uiPanel = new UIPanel(); uiPanel.Width.Set(0.0f, 1f); uiPanel.Height.Set(-110f, 1f); uiPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f; uiPanel.PaddingTop = 0.0f; element1.Append((UIElement)uiPanel); this._achievementsList = new UIList(); this._achievementsList.Width.Set(-25f, 1f); this._achievementsList.Height.Set(-50f, 1f); this._achievementsList.Top.Set(50f, 0.0f); this._achievementsList.ListPadding = 5f; uiPanel.Append((UIElement)this._achievementsList); UITextPanel <LocalizedText> uiTextPanel1 = new UITextPanel <LocalizedText>(Language.GetText("UI.Achievements"), 1f, true); uiTextPanel1.HAlign = 0.5f; uiTextPanel1.Top.Set(-33f, 0.0f); uiTextPanel1.SetPadding(13f); uiTextPanel1.BackgroundColor = new Color(73, 94, 171); element1.Append((UIElement)uiTextPanel1); UITextPanel <LocalizedText> uiTextPanel2 = new UITextPanel <LocalizedText>(Language.GetText("UI.Back"), 0.7f, true); uiTextPanel2.Width.Set(-10f, 0.5f); uiTextPanel2.Height.Set(50f, 0.0f); uiTextPanel2.VAlign = 1f; uiTextPanel2.HAlign = 0.5f; uiTextPanel2.Top.Set(-45f, 0.0f); uiTextPanel2.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver); uiTextPanel2.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut); uiTextPanel2.OnClick += new UIElement.MouseEvent(this.GoBackClick); element1.Append((UIElement)uiTextPanel2); this._backpanel = (UIElement)uiTextPanel2; List <Achievement> achievementsList = Main.Achievements.CreateAchievementsList(); for (int index = 0; index < achievementsList.Count; ++index) { UIAchievementListItem achievementListItem = new UIAchievementListItem(achievementsList[index], largeForOtherLanguages); this._achievementsList.Add((UIElement)achievementListItem); this._achievementElements.Add(achievementListItem); } UIScrollbar scrollbar = new UIScrollbar(); scrollbar.SetView(100f, 1000f); scrollbar.Height.Set(-50f, 1f); scrollbar.Top.Set(50f, 0.0f); scrollbar.HAlign = 1f; uiPanel.Append((UIElement)scrollbar); this._achievementsList.SetScrollbar(scrollbar); UIElement element2 = new UIElement(); element2.Width.Set(0.0f, 1f); element2.Height.Set(32f, 0.0f); element2.Top.Set(10f, 0.0f); Asset <Texture2D> texture = (Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Achievement_Categories", (AssetRequestMode)1); for (int index = 0; index < 4; ++index) { UIToggleImage uiToggleImage = new UIToggleImage(texture, 32, 32, new Point(34 * index, 0), new Point(34 * index, 34)); uiToggleImage.Left.Set((float)(index * 36 + 8), 0.0f); uiToggleImage.SetState(true); uiToggleImage.OnClick += new UIElement.MouseEvent(this.FilterList); this._categoryButtons.Add(uiToggleImage); element2.Append((UIElement)uiToggleImage); } uiPanel.Append(element2); }
// Token: 0x060010BA RID: 4282 RVA: 0x00405D28 File Offset: 0x00403F28 public void InitializePage() { base.RemoveAllChildren(); this._categoryButtons.Clear(); this._achievementElements.Clear(); this._achievementsList = null; bool flag = true; int num = flag.ToInt() * 100; UIElement uIElement = new UIElement(); uIElement.Width.Set(0f, 0.8f); uIElement.MaxWidth.Set(800f + (float)num, 0f); uIElement.MinWidth.Set(600f + (float)num, 0f); uIElement.Top.Set(220f, 0f); uIElement.Height.Set(-220f, 1f); uIElement.HAlign = 0.5f; this._outerContainer = uIElement; base.Append(uIElement); UIPanel uIPanel = new UIPanel(); uIPanel.Width.Set(0f, 1f); uIPanel.Height.Set(-110f, 1f); uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f; uIPanel.PaddingTop = 0f; uIElement.Append(uIPanel); this._achievementsList = new UIList(); this._achievementsList.Width.Set(-25f, 1f); this._achievementsList.Height.Set(-50f, 1f); this._achievementsList.Top.Set(50f, 0f); this._achievementsList.ListPadding = 5f; uIPanel.Append(this._achievementsList); UITextPanel <LocalizedText> uITextPanel = new UITextPanel <LocalizedText>(Language.GetText("UI.Achievements"), 1f, true); uITextPanel.HAlign = 0.5f; uITextPanel.Top.Set(-33f, 0f); uITextPanel.SetPadding(13f); uITextPanel.BackgroundColor = new Color(73, 94, 171); uIElement.Append(uITextPanel); UITextPanel <LocalizedText> uITextPanel2 = new UITextPanel <LocalizedText>(Language.GetText("UI.Back"), 0.7f, true); uITextPanel2.Width.Set(-10f, 0.5f); uITextPanel2.Height.Set(50f, 0f); uITextPanel2.VAlign = 1f; uITextPanel2.HAlign = 0.5f; uITextPanel2.Top.Set(-45f, 0f); uITextPanel2.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver); uITextPanel2.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut); uITextPanel2.OnClick += new UIElement.MouseEvent(this.GoBackClick); uIElement.Append(uITextPanel2); this._backpanel = uITextPanel2; List <Achievement> list = Main.Achievements.CreateAchievementsList(); for (int i = 0; i < list.Count; i++) { UIAchievementListItem item = new UIAchievementListItem(list[i], flag); this._achievementsList.Add(item); this._achievementElements.Add(item); } UIScrollbar uIScrollbar = new UIScrollbar(); uIScrollbar.SetView(100f, 1000f); uIScrollbar.Height.Set(-50f, 1f); uIScrollbar.Top.Set(50f, 0f); uIScrollbar.HAlign = 1f; uIPanel.Append(uIScrollbar); this._achievementsList.SetScrollbar(uIScrollbar); UIElement uIElement2 = new UIElement(); uIElement2.Width.Set(0f, 1f); uIElement2.Height.Set(32f, 0f); uIElement2.Top.Set(10f, 0f); Texture2D texture = TextureManager.Load("Images/UI/Achievement_Categories"); for (int j = 0; j < 4; j++) { UIToggleImage uIToggleImage = new UIToggleImage(texture, 32, 32, new Point(34 * j, 0), new Point(34 * j, 34)); uIToggleImage.Left.Set((float)(j * 36 + 8), 0f); uIToggleImage.SetState(true); uIToggleImage.OnClick += new UIElement.MouseEvent(this.FilterList); this._categoryButtons.Add(uIToggleImage); uIElement2.Append(uIToggleImage); } uIPanel.Append(uIElement2); }
public override void OnInitialize() { UIElement uIElement = new UIElement(); uIElement.Width.Set(0f, 0.8f); uIElement.MaxWidth.Set(800f, 0f); uIElement.MinWidth.Set(600f, 0f); uIElement.Top.Set(220f, 0f); uIElement.Height.Set(-220f, 1f); uIElement.HAlign = 0.5f; _outerContainer = uIElement; Append(uIElement); UIPanel uIPanel = new UIPanel(); uIPanel.Width.Set(0f, 1f); uIPanel.Height.Set(-110f, 1f); uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f; uIPanel.PaddingTop = 0f; uIElement.Append(uIPanel); _achievementsList = new UIList(); _achievementsList.Width.Set(-25f, 1f); _achievementsList.Height.Set(-50f, 1f); _achievementsList.Top.Set(50f, 0f); _achievementsList.ListPadding = 5f; uIPanel.Append(_achievementsList); UITextPanel uITextPanel = new UITextPanel("Achievements", 1f, large: true); uITextPanel.HAlign = 0.5f; uITextPanel.Top.Set(-33f, 0f); uITextPanel.SetPadding(13f); uITextPanel.BackgroundColor = new Color(73, 94, 171); uIElement.Append(uITextPanel); UITextPanel uITextPanel2 = new UITextPanel("Back", 0.7f, large: true); uITextPanel2.Width.Set(-10f, 0.5f); uITextPanel2.Height.Set(50f, 0f); uITextPanel2.VAlign = 1f; uITextPanel2.HAlign = 0.5f; uITextPanel2.Top.Set(-45f, 0f); uITextPanel2.OnMouseOver += FadedMouseOver; uITextPanel2.OnMouseOut += FadedMouseOut; uITextPanel2.OnClick += GoBackClick; uIElement.Append(uITextPanel2); List <Achievement> list = Main.Achievements.CreateAchievementsList(); for (int i = 0; i < list.Count; i++) { UIAchievementListItem item = new UIAchievementListItem(list[i]); _achievementsList.Add(item); _achievementElements.Add(item); } UIScrollbar uIScrollbar = new UIScrollbar(); uIScrollbar.SetView(100f, 1000f); uIScrollbar.Height.Set(-50f, 1f); uIScrollbar.Top.Set(50f, 0f); uIScrollbar.HAlign = 1f; uIPanel.Append(uIScrollbar); _achievementsList.SetScrollbar(uIScrollbar); UIElement uIElement2 = new UIElement(); uIElement2.Width.Set(0f, 1f); uIElement2.Height.Set(32f, 0f); uIElement2.Top.Set(10f, 0f); Texture2D texture = TextureManager.Load("Images/UI/Achievement_Categories"); for (int j = 0; j < 4; j++) { UIToggleImage uIToggleImage = new UIToggleImage(texture, 32, 32, new Point(34 * j, 0), new Point(34 * j, 34)); uIToggleImage.Left.Set(j * 36 + 8, 0f); uIToggleImage.SetState(value: true); uIToggleImage.OnClick += FilterList; _categoryButtons.Add(uIToggleImage); uIElement2.Append(uIToggleImage); } uIPanel.Append(uIElement2); }
public override void OnInitialize() { UIElement element1 = new UIElement(); element1.Width.Set(0.0f, 0.8f); element1.MaxWidth.Set(800f, 0.0f); element1.MinWidth.Set(600f, 0.0f); element1.Top.Set(220f, 0.0f); element1.Height.Set(-220f, 1f); element1.HAlign = 0.5f; _outerContainer = element1; Append(element1); UIPanel uiPanel = new UIPanel(); uiPanel.Width.Set(0.0f, 1f); uiPanel.Height.Set(-110f, 1f); uiPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f; uiPanel.PaddingTop = 0.0f; element1.Append(uiPanel); _achievementsList = new UIList(); _achievementsList.Width.Set(-25f, 1f); _achievementsList.Height.Set(-50f, 1f); _achievementsList.Top.Set(50f, 0.0f); _achievementsList.ListPadding = 5f; uiPanel.Append(_achievementsList); UITextPanel uiTextPanel1 = new UITextPanel("Achievements", 1f, true); uiTextPanel1.HAlign = 0.5f; uiTextPanel1.Top.Set(-33f, 0.0f); uiTextPanel1.SetPadding(13f); uiTextPanel1.BackgroundColor = new Color(73, 94, 171); element1.Append(uiTextPanel1); UITextPanel uiTextPanel2 = new UITextPanel("Back", 0.7f, true); uiTextPanel2.Width.Set(-10f, 0.5f); uiTextPanel2.Height.Set(50f, 0.0f); uiTextPanel2.VAlign = 1f; uiTextPanel2.HAlign = 0.5f; uiTextPanel2.Top.Set(-45f, 0.0f); uiTextPanel2.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); uiTextPanel2.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); uiTextPanel2.OnClick += new UIElement.MouseEvent(GoBackClick); element1.Append(uiTextPanel2); List <Achievement> achievementsList = Main.Achievements.CreateAchievementsList(); for (int index = 0; index < achievementsList.Count; ++index) { UIAchievementListItem achievementListItem = new UIAchievementListItem(achievementsList[index]); _achievementsList.Add((UIElement)achievementListItem); _achievementElements.Add(achievementListItem); } UIScrollbar scrollbar = new UIScrollbar(); scrollbar.SetView(100f, 1000f); scrollbar.Height.Set(-50f, 1f); scrollbar.Top.Set(50f, 0.0f); scrollbar.HAlign = 1f; uiPanel.Append((UIElement)scrollbar); _achievementsList.SetScrollbar(scrollbar); UIElement element2 = new UIElement(); element2.Width.Set(0.0f, 1f); element2.Height.Set(32f, 0.0f); element2.Top.Set(10f, 0.0f); Texture2D texture = TextureManager.Load("Images/UI/Achievement_Categories"); for (int index = 0; index < 4; ++index) { UIToggleImage uiToggleImage = new UIToggleImage(texture, 32, 32, new Point(34 * index, 0), new Point(34 * index, 34)); uiToggleImage.Left.Set((float)(index * 36 + 8), 0.0f); uiToggleImage.SetState(true); uiToggleImage.OnClick += new UIElement.MouseEvent(FilterList); _categoryButtons.Add(uiToggleImage); element2.Append((UIElement)uiToggleImage); } uiPanel.Append(element2); }
public override void OnInitialize() { Camera.fixedscreen = Main.LocalPlayer.position - new Vector2(Main.screenWidth / 2, Main.screenHeight / 2); TabPanel Menu = new TabPanel(400, 350, new Tab("Better Zoom", new BZUI()), new Tab(" Camera Control", this) ); Menu.Left.Set(DragableUIPanel.lastPos.X, 0f); Menu.Top.Set(DragableUIPanel.lastPos.Y, 0f); Menu.OnCloseBtnClicked += () => ModContent.GetInstance <BetterZoom>().userInterface.SetState(null); Append(Menu); speed = new UIFloatRangedDataValue("Tracking Speed", 1, 0.1f, 100); var speedSldr = new UIRange <float>(speed); speedSldr.Width.Set(0, 1); speedSldr.MarginTop = 50; speedSldr.MarginLeft = -20; Menu.Append(speedSldr); Menu.Append(new UIText("Control Trackers: ") { MarginTop = 130, MarginLeft = 210 }); UIHoverImageButton PathTrackerBtn = new UIHoverImageButton("BetterZoom/Assets/PathTrackerButton", "Place Path tracker"); PathTrackerBtn.OnClick += (evt, elm) => placing = TrackerID.PathTracker; PathTrackerBtn.MarginLeft = 245; PathTrackerBtn.MarginTop = 155; Menu.Append(PathTrackerBtn); UIHoverImageButton EraseTrackerBtn = new UIHoverImageButton("BetterZoom/Assets/EraserButton", "Erase Trackers"); EraseTrackerBtn.OnClick += (evt, elm) => erasing = !erasing; EraseTrackerBtn.MarginLeft = 245; EraseTrackerBtn.MarginTop = 190; Menu.Append(EraseTrackerBtn); UIHoverImageButton DelBtn = new UIHoverImageButton("BetterZoom/Assets/DelButton", "Delete all Trackers"); DelBtn.OnClick += DeleteAll; DelBtn.MarginLeft = 285; DelBtn.MarginTop = 190; Menu.Append(DelBtn); UIHoverImageButton EntityBtn = new UIHoverImageButton("BetterZoom/Assets/EntityTrackerButton", "Place Entity Tracker"); EntityBtn.OnClick += ToggleEnityTracker; EntityBtn.MarginLeft = 285; EntityBtn.MarginTop = 155; Menu.Append(EntityBtn); UIHoverImageButton MoveBtn = new UIHoverImageButton("BetterZoom/Assets/MoveButton", "Move Path Tracker"); MoveBtn.OnClick += (evt, elm) => moving = !moving; MoveBtn.MarginLeft = 325; MoveBtn.MarginTop = 190; Menu.Append(MoveBtn); lockScreenBtn = new UIToggleImage(TextureManager.Load("Images/UI/Settings_Toggle"), 13, 13, new Point(17, 1), new Point(1, 1)); lockScreenBtn.MarginTop = 100; lockScreenBtn.MarginLeft = 250; lockScreenBtn.OnClick += (evt, elm) => Camera.ToggleLock(); lockScreenBtn.Append(new UIText("Lock Screen", 0.9f) { MarginLeft = -230 }); Menu.Append(lockScreenBtn); Menu.Append(new UIText("Control Screen: ") { MarginTop = 130, MarginLeft = 20 }); // Dpad var Dpad = UIHelper.Dpad(60, 155); for (int i = 0; i < Dpad.Length; i++) { Menu.Append(Dpad[i]); } Dpad[0].OnMouseDown += (evt, elm) => Camera.MoveRelativeTo(new Vector2(0, -5f)); Dpad[1].OnMouseDown += (evt, elm) => Camera.MoveRelativeTo(new Vector2(0, 5f)); Dpad[2].OnMouseDown += (evt, elm) => Camera.MoveRelativeTo(new Vector2(-5f, 0)); Dpad[3].OnMouseDown += (evt, elm) => Camera.MoveRelativeTo(new Vector2(5f, 0)); var hideTrackersBtn = new UIToggleImage(TextureManager.Load("Images/UI/Settings_Toggle"), 13, 13, new Point(17, 1), new Point(1, 1)); hideTrackersBtn.MarginTop = 250; hideTrackersBtn.MarginLeft = 250; hideTrackersBtn.OnClick += (evt, elm) => TrackerUI.hide = !TrackerUI.hide; hideTrackersBtn.Append(new UIText("Hide Trackers", 0.9f) { MarginLeft = -230 }); Menu.Append(hideTrackersBtn); // Control Buttons playButton = new UITextPanel <string>("Play"); playButton.VAlign = 0.9f; playButton.HAlign = 0.1f; playButton.OnClick += (evt, elm) => Camera.PlayStopTracking(); Menu.Append(playButton); UITextPanel <string> pauseButton = new UITextPanel <string>("Pause"); pauseButton.VAlign = 0.9f; pauseButton.HAlign = 0.5f; pauseButton.OnClick += (evt, elm) => { Camera.PauseTracking(); pauseButton.SetText(text: Camera.Playing ? "Pause" : "Resume"); }; Menu.Append(pauseButton); var repeatBtn = new UITextPanel <string>("Repeat"); repeatBtn.VAlign = 0.9f; repeatBtn.HAlign = 0.9f; repeatBtn.OnClick += (evt, elm) => { Camera.repeat = !Camera.repeat; repeatBtn.SetText(text: Camera.repeat ? "End" : "Repeat"); }; Menu.Append(repeatBtn); }
public override void OnInitialize() { TabPanel Menu = new TabPanel(400, 400, new Tab("Better Zoom", this), new Tab(" Camera Control", new CCUI()) ); Menu.Left.Set(DragableUIPanel.lastPos.X, 0f); Menu.Top.Set(DragableUIPanel.lastPos.Y, 0f); Menu.OnCloseBtnClicked += () => ModContent.GetInstance <BetterZoom>().userInterface.SetState(null); Append(Menu); zoom = new UIFloatRangedDataValue("Zoom", 1, -1f, 10); zoomSldr = new UIRange <float>(zoom); zoom.OnValueChanged += () => BetterZoom.zoom = zoom.Data; zoomSldr.Width.Set(0, 1); zoomSldr.MarginTop = 50; zoomSldr.MarginLeft = -20; Menu.Append(zoomSldr); uiScale = new UIFloatRangedDataValue("", 1, 0.2f, 2); uiScaleSldr = new UIRange <float>(uiScale); uiScaleSldr.Width.Set(0, 1); uiScaleSldr.MarginTop = 100; uiScaleSldr.MarginLeft = -20; Menu.Append(uiScaleSldr); var uiScaleBtn = new UITextPanel <string>("UI Scale"); uiScaleBtn.SetPadding(4); uiScaleBtn.MarginLeft = 40; uiScaleBtn.OnClick += (evt, elm) => BetterZoom.uiScale = uiScale.Data; uiScaleSldr.Append(uiScaleBtn); UIToggleImage flipBgBtn = new UIToggleImage(TextureManager.Load("Images/UI/Settings_Toggle"), 13, 13, new Point(17, 1), new Point(1, 1)); flipBgBtn.MarginTop = 150; flipBgBtn.MarginLeft = 250; flipBgBtn.OnClick += (evt, elm) => BetterZoom.flipBackground = !BetterZoom.flipBackground; flipBgBtn.SetState(BetterZoom.flipBackground); flipBgBtn.Append(new UIText("Flip Background", 0.9f) { MarginLeft = -230 }); Menu.Append(flipBgBtn); UIToggleImage zoomBgBtn = new UIToggleImage(TextureManager.Load("Images/UI/Settings_Toggle"), 13, 13, new Point(17, 1), new Point(1, 1)); zoomBgBtn.MarginTop = 200; zoomBgBtn.MarginLeft = 250; zoomBgBtn.OnClick += (evt, elm) => BetterZoom.zoomBackground = !BetterZoom.zoomBackground; zoomBgBtn.SetState(BetterZoom.zoomBackground); zoomBgBtn.Append(new UIText("Zoom Background", 0.9f) { MarginLeft = -230 }); Menu.Append(zoomBgBtn); UIFloatRangedDataValue hotbarScale = new UIFloatRangedDataValue("Hotbar Scale", 1, 0.2f, 5); var hotbarScaleSldr = new UIRange <float>(hotbarScale); hotbarScaleSldr.Width.Set(0, 1); hotbarScaleSldr.MarginTop = 250; hotbarScaleSldr.MarginLeft = -20; hotbarScale.OnValueChanged += () => BetterZoom.hotbarScale = hotbarScale.Data; Menu.Append(hotbarScaleSldr); UIFloatRangedDataValue miniMapScale = new UIFloatRangedDataValue("Minimap Scale", 1, 0.2f, 5); var miniMapScaleSldr = new UIRange <float>(miniMapScale); miniMapScaleSldr.Width.Set(0, 1); miniMapScaleSldr.MarginTop = 300; miniMapScaleSldr.MarginLeft = -20; miniMapScale.OnValueChanged += () => BetterZoom.minimapScale = miniMapScale.Data; Menu.Append(miniMapScaleSldr); /*UIFloatRangedDataValue offScreenRange = new UIFloatRangedDataValue("offscreen Range", 192, -1000f, 1000); * var offScreenRangeSldr = new UIRange<float>(offScreenRange); * offScreenRangeSldr.Width.Set(0, 1); * offScreenRangeSldr.MarginTop = 350; * offScreenRangeSldr.MarginLeft = -20; * offScreenRange.OnValueChanged += () => BetterZoom.offscrnRange = offScreenRange.Data; * Menu.Append(offScreenRangeSldr);*/ var resetBtn = new UITextPanel <string>("Set to Default"); resetBtn.SetPadding(4); resetBtn.MarginLeft = 20; resetBtn.Top.Set(-40, 1); resetBtn.OnClick += (evt, elm) => { zoom.ResetToDefaultValue(); uiScale.ResetToDefaultValue(); uiScale.SetValue(1); flipBgBtn.SetState(true); zoomBgBtn.SetState(false); hotbarScale.ResetToDefaultValue(); miniMapScale.ResetToDefaultValue(); }; Menu.Append(resetBtn); }