Skip to content

Commit 47c3eb6

Browse files
committed
2 parents 56f67c3 + e1423e2 commit 47c3eb6

360 files changed

Lines changed: 5254 additions & 1238 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Assets/UI.Windows/Addons/DevicePreview/Editor/DevicePreviewAddon.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,19 @@ public override void Show(System.Action onClose) {
3030

3131
public override void OnFlowSettingsGUI() {
3232

33-
GUILayout.Label("Module Installed");
33+
GUILayout.Label(FlowAddon.MODULE_INSTALLED);
34+
35+
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
36+
{
37+
38+
if (GUILayout.Button("Open Preview") == true) {
39+
40+
DevicePreview.ShowEditor();
41+
42+
}
43+
44+
}
45+
EditorGUILayout.EndVertical();
3446

3547
}
3648

Assets/UI.Windows/Addons/DevicePreview/Resources/UI.Windows/DevicePreview/Images/Apple.meta

Lines changed: 0 additions & 5 deletions
This file was deleted.

Assets/UI.Windows/Addons/Flow/Core/Editor/FlowSystemEditorWindow.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ private void DrawSettings(float offsetY) {
647647
CustomGUI.Splitter();
648648

649649
#region ROOT WINDOW
650-
Flow.DrawModuleSettingsGUI("Root Window", () => {
650+
Flow.DrawModuleSettingsGUI(null, "Root Window", () => {
651651

652652
var rootWindow = FlowSystem.GetWindow(FlowSystem.GetRootWindow());
653653
if (rootWindow != null) {
@@ -669,7 +669,7 @@ private void DrawSettings(float offsetY) {
669669
#endregion
670670

671671
#region DEFAULT WINDOWS
672-
Flow.DrawModuleSettingsGUI("Default Windows", () => {
672+
Flow.DrawModuleSettingsGUI(null, "Default Windows", () => {
673673

674674
if (this.defaultWindows == null) {
675675

@@ -692,7 +692,7 @@ private void DrawSettings(float offsetY) {
692692
#endregion
693693

694694
#region TAGS
695-
Flow.DrawModuleSettingsGUI("Tags", () => {
695+
Flow.DrawModuleSettingsGUI(null, "Tags", () => {
696696

697697
if (this.tagsList == null) {
698698

@@ -787,7 +787,7 @@ private void DrawSettings(float offsetY) {
787787
#endregion
788788

789789
#region FLOW
790-
Flow.DrawModuleSettingsGUI("Flow Settings", () => {
790+
Flow.DrawModuleSettingsGUI(null, "Flow Settings", () => {
791791

792792
var flowWindowWithLayout = GUILayout.Toggle(FlowSystem.GetData().flowWindowWithLayout, "Window With Layout");
793793
if (flowWindowWithLayout != FlowSystem.GetData().flowWindowWithLayout) {

Assets/UI.Windows/Addons/Flow/Editor/FlowAddon.cs

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,51 @@ public interface IWindowFlowAddon : IWindowAddon {
1111
void OnFlowWindowGUI(FlowWindow window);
1212
void OnFlowSettingsGUI();
1313
void OnFlowToolbarGUI(GUIStyle toolbarButton);
14-
14+
15+
void Install();
16+
bool InstallationNeeded();
17+
1518
}
1619

1720
public class FlowAddon : IWindowFlowAddon {
21+
22+
public const string MODULE_INSTALLED = "The module is installed properly";
23+
public const string MODULE_HAS_ERRORS = "{0} Please, try to re-open Unity and/or reinstall the module.";
1824

1925
public string name;
2026

2127
public virtual void Show(System.Action onClose) {}
2228
public virtual void OnFlowSettingsGUI() {}
2329
public virtual void OnFlowWindowGUI(FlowWindow window) {}
2430
public virtual void OnFlowToolbarGUI(GUIStyle buttonStyle) {}
31+
32+
public virtual void Install() {}
33+
public virtual void Reinstall() {}
34+
public virtual bool InstallationNeeded() { return false; }
2535

2636
}
2737

2838
public class Flow : IWindowAddon {
2939

30-
public static void DrawModuleSettingsGUI(string caption, System.Action onGUI) {
40+
public static void DrawModuleSettingsGUI(IWindowFlowAddon addon, string caption, System.Action onGUI) {
3141

3242
GUILayout.Label(caption.ToSentenceCase().UppercaseWords(), EditorStyles.boldLabel);
33-
43+
3444
GUILayout.BeginVertical(FlowSystemEditorWindow.defaultSkin.box);//GUI.skin.box);
3545
{
36-
onGUI();
46+
if (addon != null && addon.InstallationNeeded() == true) {
47+
48+
if (GUILayoutExt.LargeButton("Install", 40f, 200f) == true) {
49+
50+
addon.Install();
51+
52+
}
53+
54+
} else {
55+
56+
onGUI();
57+
58+
}
3759
}
3860
GUILayout.EndVertical();
3961

@@ -101,7 +123,7 @@ public static void OnDrawSettingsGUI() {
101123

102124
foreach (var addon in flowAddons) {
103125

104-
Flow.DrawModuleSettingsGUI(addon.name, () => { addon.OnFlowSettingsGUI(); });
126+
Flow.DrawModuleSettingsGUI(addon, addon.name, () => { addon.OnFlowSettingsGUI(); });
105127

106128
}
107129

@@ -114,8 +136,7 @@ public static void OnDrawSettingsGUI() {
114136

115137
GUILayout.FlexibleSpace();
116138

117-
var content = new GUIContent("Install Modules...");
118-
if (GUILayout.Button(content, FlowSystemEditorWindow.defaultSkin.button, GUILayout.Height(40f), GUILayout.MaxWidth(200f)) == true) {
139+
if (GUILayoutExt.LargeButton("Install Modules...", 40f, 200f) == true) {
119140

120141
Application.OpenURL(VersionInfo.downloadLink);
121142

Assets/UI.Windows/Addons/Flow/Resources/UI.Windows/Icons.meta renamed to Assets/UI.Windows/Addons/Flow/Example/ExampleProject.Modules.meta

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/UI.Windows/Assets.meta renamed to Assets/UI.Windows/Addons/Flow/Example/ExampleProject.Modules/Social.meta

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/UI.Windows/Assets/UI.Windows.meta renamed to Assets/UI.Windows/Addons/Flow/Example/ExampleProject.Modules/Social/FB.meta

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

Assets/UI.Windows/Addons/Flow/Example/ExampleProject.Modules/Social/FB/FBSettings.asset.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/UI.Windows/Assets/UI.Windows/Addons.meta renamed to Assets/UI.Windows/Addons/Flow/Example/ExampleProject.Modules/Social/FB/Queries.meta

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)