ToolsPage.cs 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using TheraBytes.BetterUi;
  6. using UnityEditor;
  7. using UnityEngine;
  8. namespace TheraBytes.BetterUi.Editor
  9. {
  10. public class ToolsPage : WizardPage
  11. {
  12. public override string NameId { get { return "ToolsPage"; } }
  13. public ToolsPage(IWizard wizard)
  14. : base(wizard)
  15. {
  16. }
  17. protected override void OnInitialize()
  18. {
  19. Add(new SeparatorWizardPageElement());
  20. Add(new InfoWizardPageElement("Tools", InfoType.Header));
  21. Add(new InfoWizardPageElement("You can open the tools via the buttons below. However, you can also find them in the menu 'Tools -> Better UI'.", InfoType.InfoBox));
  22. Add(new SeparatorWizardPageElement());
  23. Add(new InfoWizardPageElement("Snap Anchors", InfoType.Header));
  24. Add(new InfoWithButtonWizardPageElement("Snap Anchors allows you to move the anchors of selected UI elements to the desired position with one click. " +
  25. "Get rid of pixel positions and sizes and start working with relative sizes!",
  26. new InfoWithButtonWizardPageElement.ButtonInfo("Open", SnapAnchorsWindow.ShowWindow),
  27. new InfoWithButtonWizardPageElement.ButtonInfo("Documentation", () => Application.OpenURL("https://documentation.therabytes.de/better-ui/SnapAnchors.html"))));
  28. Add(new SeparatorWizardPageElement());
  29. Add(new InfoWizardPageElement("Align & Distribute", InfoType.Header));
  30. Add(new InfoWithButtonWizardPageElement("Do sou want to align multiple object? Or do you want to distribute predefined objects evenly without using a Layout Group? " +
  31. "The Align & Distribute Tool will allow this along with a lot of configuration options to you.",
  32. new InfoWithButtonWizardPageElement.ButtonInfo("Open", AlignDistribute.AlignDistributeWindow.ShowWindow),
  33. new InfoWithButtonWizardPageElement.ButtonInfo("Documentation", () => Application.OpenURL("https://documentation.therabytes.de/better-ui/AlignDistribute.html"))));
  34. Add(new SeparatorWizardPageElement());
  35. Add(new InfoWizardPageElement("Smart Parent", InfoType.Header));
  36. Add(new InfoWithButtonWizardPageElement("Do you need to move or resize an object but keep the screen positions of its childs? " +
  37. "Do you want to snap the size of the parent to the extents of its children? This tool makes it eaily possible!",
  38. new InfoWithButtonWizardPageElement.ButtonInfo("Open", SmartParentWindow.ShowWindow),
  39. new InfoWithButtonWizardPageElement.ButtonInfo("Documentation", () => Application.OpenURL("https://documentation.therabytes.de/better-ui/")))); // TODO
  40. Add(new SeparatorWizardPageElement());
  41. Add(new InfoWizardPageElement("Pick Resolution", InfoType.Header));
  42. Add(new InfoWithButtonWizardPageElement("Do you want to quickly switch between resolutions without having to open the drop down in the game view all the time? " +
  43. "This tool will help you and also allows to filter resolutions and change the tool window to integrate best in your layout. " +
  44. "You can also switch between / simulate your Screen configurations with it.",
  45. new InfoWithButtonWizardPageElement.ButtonInfo("Open", ResolutionPicker.ShowWindow),
  46. new InfoWithButtonWizardPageElement.ButtonInfo("Documentation", () => Application.OpenURL("https://documentation.therabytes.de/better-ui/PickResolution.html"))));
  47. }
  48. protected override void BeforeGui()
  49. {
  50. InfoWithButtonWizardPageElement.ButtonWidth = 160;
  51. }
  52. }
  53. }