Skip to content

Commit

Permalink
Merge pull request #161 from scenario-labs/139-feature-classify-the-s…
Browse files Browse the repository at this point in the history
…cenario-windows-per-categories-or-at-least-by-importance

feat: 139 classify menu item
  • Loading branch information
Morgan-6Freedom authored Apr 3, 2024
2 parents f59e030 + ead9d97 commit 3a69fb1
Show file tree
Hide file tree
Showing 15 changed files with 14 additions and 115 deletions.
2 changes: 1 addition & 1 deletion package/Editor/CompositionEditor/CompositionEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class CompositionEditor : EditorWindow
internal RenderTexture renderTexture;
private Texture2D screenshot;

[MenuItem("Window/Scenario/Composition Editor")]
[MenuItem("Window/Scenario/Editors/Composition Editor", false,0)]
public static void ShowWindow()
{
var window = GetWindow<CompositionEditor>("Composition Editor");
Expand Down
2 changes: 1 addition & 1 deletion package/Editor/DataBuilder/DataBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private enum ScreenshotType
private float cameraDistance = 2f;
private float lightDistance = 2f;

[MenuItem("Window/Scenario/3d Data Builder")]
[MenuItem("Window/Scenario/Builders/3D Data Builder", false, 0)]
public static void ShowWindow()
{
GetWindow<DataBuilder>("3d Data Builder");
Expand Down
8 changes: 0 additions & 8 deletions package/Editor/Fonts.meta

This file was deleted.

8 changes: 0 additions & 8 deletions package/Editor/Fonts/Poppins.meta

This file was deleted.

2 changes: 1 addition & 1 deletion package/Editor/ImageEditor/ImageEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class ImageEditor : EditorWindow

private static float minimumWidth = 1775f;

[MenuItem("Window/Scenario/Image Editor")]
[MenuItem("Window/Scenario/Editors/Image Editor", false, 1)]
public static void ShowWindow()
{
ImageEditor window = GetWindow<ImageEditor>("Image Editor");
Expand Down
2 changes: 1 addition & 1 deletion package/Editor/Images/Images.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Images : EditorWindow

private static bool isVisible = false;

[MenuItem("Window/Scenario/Images")]
[MenuItem("Window/Scenario/Images", false, 10)]
public static void ShowWindow()
{
if (isVisible)
Expand Down
2 changes: 1 addition & 1 deletion package/Editor/InpaintingEditor/InpaintingEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class InpaintingEditor : EditorWindow
private static InpaintingEditorUI inpaintingEditorUI;
private static Texture2D inpaintingTexture;

[MenuItem("Window/Scenario/Inpainting Editor")]
[MenuItem("Window/Scenario/Editors/Inpainting Editor", false, 2)]
public static void ShowWindow()
{
InpaintingEditor window = GetWindow<InpaintingEditor>("Inpainting Editor");
Expand Down
2 changes: 1 addition & 1 deletion package/Editor/LayerEditor/LayerEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class LayerEditor : EditorWindow
private LayerEditorRightPanel rightPanel;
private ContextMenuActions contextMenuActions;

[MenuItem("Window/Layer Editor")]
[MenuItem("Window/Scenario/Editors/Layer Editor", false, 3)]
public static void ShowWindow()
{
GetWindow<LayerEditor>("Layer Editor");
Expand Down
2 changes: 1 addition & 1 deletion package/Editor/Models/Models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private void OnDestroy()

#region Public Methods

[MenuItem("Window/Scenario/Models")]
[MenuItem("Window/Scenario/Models", false, 11)]
public static void ShowWindow()
{
window = GetWindow<Models>("Models");
Expand Down
2 changes: 1 addition & 1 deletion package/Editor/PixelEditor/PixelEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class PixelEditor : EditorWindow
private static readonly float MinimumWidth = 1650f;
private PixelEditorUI pixelEditorUI = new();

[MenuItem("Window/Scenario/Pixel Editor")]
[MenuItem("Window/Scenario/Editors/Pixel Editor", false, 4)]
public static void ShowWindow()
{
var window = EditorWindow.GetWindow(typeof(PixelEditor), false, "Pixel Editor") as PixelEditor;
Expand Down
89 changes: 2 additions & 87 deletions package/Editor/Plugins/APIPricing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,95 +5,10 @@ namespace Scenario.Editor
{
public class APIPricingWindow : EditorWindow
{
private string[] headers = { "Steps", "512x512", "512x576", "512x640", "512x688", "512x704", "512x768", "512x912", "512x1024" };
private string[,] data = {
{ "30", "$0.010", "$0.011", "$0.013", "$0.013", "$0.014", "$0.015", "$0.018", "$0.020" },
{ "50", "$0.017", "$0.019", "$0.021", "$0.022", "$0.023", "$0.025", "$0.030", "$0.033" },
{ "100", "$0.033", "$0.038", "$0.042", "$0.045", "$0.046", "$0.050", "$0.059", "$0.067" },
{ "150", "$0.050", "$0.056", "$0.063", "$0.067", "$0.069", "$0.075", "$0.089", "$0.100" }
};
private string[,] additionalCosts = {
{ "Background removal", "$0.100 per image" },
{ "Upscaling", "$0.050 per image" },
{ "Magic Upscaling", "$0.050 per image" },
{ "Pixelate", "$0.025 per image" }
};
private string[,] additionalDetails = {
{ "Composition Control Multiplier", "1.2" },
{ "Generator training", "$5.00 per training" }
};

[MenuItem("Window/Scenario/API Pricing")]
[MenuItem("Window/Scenario/API Pricing", false, 101)]
public static void ShowWindow()
{
GetWindow<APIPricingWindow>("API Pricing");
}

void OnGUI()
{
DrawInfo();
DrawTable();
DrawAdditionalCosts();
DrawAdditionalDetails();
}

void DrawInfo()
{
GUILayout.Label("The Scenario API", EditorStyles.boldLabel);
EditorGUILayout.HelpBox("The Scenario API is a versatile tool for image generation and training generators. It's highly adaptable, making it easy to incorporate into games or third-party software. The flexible pricing structure operates on a pay-per-use system, with a monthly billing cycle and cost management options.", MessageType.Info);
GUILayout.Label("Pricing Structure", EditorStyles.boldLabel);
EditorGUILayout.HelpBox("The API pricing is designed for flexibility and affordability, and begins at a simple rate of 1 cent per image. Costs vary based on image resolution or the use of advanced features. Please refer to the tables below for detailed pricing per image, based on different features and configurations:", MessageType.Info);
}

void DrawTable()
{
EditorGUILayout.BeginVertical(GUI.skin.box);
EditorGUILayout.BeginHorizontal();
foreach (string header in headers)
{
GUILayout.Label(header, EditorStyles.boldLabel);
}
EditorGUILayout.EndHorizontal();
for (int i = 0; i < data.GetLength(0); i++)
{
EditorGUILayout.BeginHorizontal();
for (int j = 0; j < data.GetLength(1); j++)
{
GUILayout.Label(data[i, j], GUILayout.Width(70));
}
EditorGUILayout.EndHorizontal();
}
EditorGUILayout.EndVertical();
}

void DrawAdditionalCosts()
{
EditorGUILayout.Space();
EditorGUILayout.LabelField("Additional costs (cost per image)", EditorStyles.boldLabel);
EditorGUILayout.BeginVertical(GUI.skin.box);
for (int i = 0; i < additionalCosts.GetLength(0); i++)
{
EditorGUILayout.BeginHorizontal();
GUILayout.Label(additionalCosts[i, 0], GUILayout.Width(150));
GUILayout.Label(additionalCosts[i, 1]);
EditorGUILayout.EndHorizontal();
}
EditorGUILayout.EndVertical();
}

void DrawAdditionalDetails()
{
EditorGUILayout.Space();
EditorGUILayout.LabelField("Additional Details", EditorStyles.boldLabel);
EditorGUILayout.BeginVertical(GUI.skin.box);
for (int i = 0; i < additionalDetails.GetLength(0); i++)
{
EditorGUILayout.BeginHorizontal();
GUILayout.Label(additionalDetails[i, 0], GUILayout.Width(200));
GUILayout.Label(additionalDetails[i, 1]);
EditorGUILayout.EndHorizontal();
}
EditorGUILayout.EndVertical();
Application.OpenURL("https://docs.scenario.com/page/api-pricing");
}
}
}
2 changes: 1 addition & 1 deletion package/Editor/PromptWindow/PromptBuilderWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class PromptBuilderWindow : EditorWindow
public static Action<string> onReturn;
public static PromptBuilderWindow Instance;

[MenuItem("Window/Scenario/Prompt Builder")]
[MenuItem("Window/Scenario/Builders/Prompt Builder", false, 1)]
public static void ShowWindow()
{
Instance = GetWindow<PromptBuilderWindow>("Prompt Builder");
Expand Down
2 changes: 1 addition & 1 deletion package/Editor/PromptWindow/PromptWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class PromptWindow : EditorWindow
private byte[] pngBytesUploadImage = null;
private string fileName;

[MenuItem("Window/Scenario/Prompt Window")]
[MenuItem("Window/Scenario/Prompt Window", false, 5)]
public static void ShowWindow()
{
GetWindow<PromptWindow>("Prompt Window");
Expand Down
2 changes: 1 addition & 1 deletion package/Editor/Settings/PluginSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private void OnEnable()
}


[MenuItem("Window/Scenario/Scenario Settings")]
[MenuItem("Window/Scenario/Scenario Settings", false, 100)]
public static void ShowWindow()
{
GetWindow<PluginSettings>("Scenario Settings");
Expand Down
2 changes: 1 addition & 1 deletion package/Editor/UpscaleEditor/UpscaleEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class UpscaleEditor : EditorWindow
private static readonly float MinimumWidth = 1650f;
private static readonly UpscaleEditorUI UpscaleEditorUI = new();

[MenuItem("Window/Scenario/Upscale Editor")]
[MenuItem("Window/Scenario/Editors/Upscale Editor", false, 5)]
public static void ShowWindow()
{
var window = EditorWindow.GetWindow(typeof(UpscaleEditor), false, "Upscale Editor") as UpscaleEditor;
Expand Down

0 comments on commit 3a69fb1

Please sign in to comment.