Skip to content

Commit

Permalink
chore: Menubar
Browse files Browse the repository at this point in the history
- Adjusted settings menubar dropdown
  • Loading branch information
vawser committed Dec 6, 2024
1 parent f114310 commit 297a77b
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 33 deletions.
7 changes: 4 additions & 3 deletions src/StudioCore/Configuration/CFG.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ public class CFG
public bool EnableEditor_GPARAM = true;
public bool EnableViewer_TEXTURE = true;

public bool EnableEditor_TAE_wip = false;
public bool EnableEditor_EMEVD_wip = false;
public bool EnableEditor_ESD_wip = false;
public bool EnableEditor_TAE = false;
public bool EnableEditor_EMEVD = false;
public bool EnableEditor_ESD = false;

public bool EnableEditor_MQB_wip = false;
public bool EnableEditor_HAVOK_wip = false;
public bool EnableEditor_MTD_wip = false;
Expand Down
13 changes: 8 additions & 5 deletions src/StudioCore/Core/CommonMenubarHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,16 @@ public void SettingsDropdown()
}
UIHelper.ShowHoverTooltip("Open the settings related to Gparam Editor in Smithbox.");

if (ImGui.MenuItem("Time Act Editor"))
if (CFG.Current.EnableEditor_TAE)
{
SettingsWindow.ToggleWindow(SelectedSettingTab.TimeActEditor);
if (ImGui.MenuItem("Time Act Editor"))
{
SettingsWindow.ToggleWindow(SelectedSettingTab.TimeActEditor);
}
UIHelper.ShowHoverTooltip("Open the settings related to Time Act Editor in Smithbox.");
}
UIHelper.ShowHoverTooltip("Open the settings related to Time Act Editor in Smithbox.");

if (FeatureFlags.EnableEditor_Evemd)
if (CFG.Current.EnableEditor_EMEVD)
{
if (ImGui.MenuItem("EMEVD Editor"))
{
Expand All @@ -215,7 +218,7 @@ public void SettingsDropdown()
UIHelper.ShowHoverTooltip("Open the settings related to Emevd Editor in Smithbox.");
}

if (FeatureFlags.EnableEditor_Esd)
if (CFG.Current.EnableEditor_ESD)
{
if (ImGui.MenuItem("ESD Editor"))
{
Expand Down
6 changes: 3 additions & 3 deletions src/StudioCore/Core/EditorHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,17 @@ public EditorHandler(IGraphicsContext _context)
}

// WIP
if (CFG.Current.EnableEditor_TAE_wip)
if (CFG.Current.EnableEditor_TAE)
{
EditorList.Add(TimeActEditor);
}

if (CFG.Current.EnableEditor_EMEVD_wip)
if (CFG.Current.EnableEditor_EMEVD)
{
EditorList.Add(EmevdEditor);
}

if (CFG.Current.EnableEditor_ESD_wip)
if (CFG.Current.EnableEditor_ESD)
{
EditorList.Add(EsdEditor);
}
Expand Down
14 changes: 7 additions & 7 deletions src/StudioCore/Editors/EmevdEditor/EmevdEditorScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public EmevdEditorScreen(Sdl2Window window, GraphicsDevice device)

public void EditDropdown()
{
if (!CFG.Current.EnableEditor_EMEVD_wip)
if (!CFG.Current.EnableEditor_EMEVD)
return;

if (ImGui.BeginMenu("Edit"))
Expand Down Expand Up @@ -108,7 +108,7 @@ public void EditDropdown()

public void ViewDropdown()
{
if (!CFG.Current.EnableEditor_EMEVD_wip)
if (!CFG.Current.EnableEditor_EMEVD)
return;

if (ImGui.BeginMenu("View"))
Expand Down Expand Up @@ -160,7 +160,7 @@ public void ViewDropdown()
/// </summary>
public void EditorUniqueDropdowns()
{
if (!CFG.Current.EnableEditor_EMEVD_wip)
if (!CFG.Current.EnableEditor_EMEVD)
return;

ToolMenubar.Display();
Expand All @@ -173,7 +173,7 @@ public void EditorUniqueDropdowns()
/// </summary>
public void OnGUI(string[] initcmd)
{
if (!CFG.Current.EnableEditor_EMEVD_wip)
if (!CFG.Current.EnableEditor_EMEVD)
return;

var scale = DPI.GetUIScale();
Expand Down Expand Up @@ -250,7 +250,7 @@ public void OnGUI(string[] initcmd)
/// </summary>
public void OnProjectChanged()
{
if (!CFG.Current.EnableEditor_EMEVD_wip)
if (!CFG.Current.EnableEditor_EMEVD)
return;

if (Smithbox.ProjectType != ProjectType.Undefined)
Expand All @@ -276,7 +276,7 @@ public void OnProjectChanged()
/// </summary>
public void Save()
{
if (!CFG.Current.EnableEditor_EMEVD_wip)
if (!CFG.Current.EnableEditor_EMEVD)
return;

if (Smithbox.ProjectType == ProjectType.Undefined)
Expand All @@ -290,7 +290,7 @@ public void Save()
/// </summary>
public void SaveAll()
{
if (!CFG.Current.EnableEditor_EMEVD_wip)
if (!CFG.Current.EnableEditor_EMEVD)
return;

if (Smithbox.ProjectType == ProjectType.Undefined)
Expand Down
14 changes: 7 additions & 7 deletions src/StudioCore/Editors/EsdEditor/EsdEditorScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public EsdEditorScreen(Sdl2Window window, GraphicsDevice device)

public void EditDropdown()
{
if (!CFG.Current.EnableEditor_ESD_wip)
if (!CFG.Current.EnableEditor_ESD)
return;

if (ImGui.BeginMenu("Edit"))
Expand Down Expand Up @@ -99,7 +99,7 @@ public void EditDropdown()

public void ViewDropdown()
{
if (!CFG.Current.EnableEditor_ESD_wip)
if (!CFG.Current.EnableEditor_ESD)
return;

if (ImGui.BeginMenu("View"))
Expand Down Expand Up @@ -151,7 +151,7 @@ public void ViewDropdown()
/// </summary>
public void EditorUniqueDropdowns()
{
if (!CFG.Current.EnableEditor_ESD_wip)
if (!CFG.Current.EnableEditor_ESD)
return;

ToolMenubar.Display();
Expand All @@ -162,7 +162,7 @@ public void EditorUniqueDropdowns()
/// </summary>
public void OnGUI(string[] initcmd)
{
if (!CFG.Current.EnableEditor_ESD_wip)
if (!CFG.Current.EnableEditor_ESD)
return;

var scale = DPI.GetUIScale();
Expand Down Expand Up @@ -231,7 +231,7 @@ public void OnGUI(string[] initcmd)

public void OnProjectChanged()
{
if (!CFG.Current.EnableEditor_ESD_wip)
if (!CFG.Current.EnableEditor_ESD)
return;

Selection.ResetScript();
Expand All @@ -255,7 +255,7 @@ public void OnProjectChanged()

public void Save()
{
if (!CFG.Current.EnableEditor_ESD_wip)
if (!CFG.Current.EnableEditor_ESD)
return;

if (Smithbox.ProjectType == ProjectType.Undefined)
Expand All @@ -267,7 +267,7 @@ public void Save()

public void SaveAll()
{
if (!CFG.Current.EnableEditor_ESD_wip)
if (!CFG.Current.EnableEditor_ESD)
return;

if (Smithbox.ProjectType == ProjectType.Undefined)
Expand Down
2 changes: 1 addition & 1 deletion src/StudioCore/Editors/ParamEditor/Tools/ToolWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ public void OnGui()
// Find Row Value Instances
if (ImGui.CollapsingHeader("Find Row Value Instances"))
{
UIHelper.WrappedText("Display all instances of a specificed value.");
UIHelper.WrappedText("Display all instances of a specified value.");
UIHelper.WrappedText("");

if (!Smithbox.EditorHandler.ParamEditor._activeView._selection.ActiveParamExists())
Expand Down
14 changes: 7 additions & 7 deletions src/StudioCore/Editors/TimeActEditor/TimeActEditorScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public TimeActEditorScreen(Sdl2Window window, GraphicsDevice device)
/// </summary>
public void OnGUI(string[] initcmd)
{
if (!CFG.Current.EnableEditor_TAE_wip)
if (!CFG.Current.EnableEditor_TAE)
return;

var scale = DPI.GetUIScale();
Expand Down Expand Up @@ -163,7 +163,7 @@ public void OnGUI(string[] initcmd)

public void EditDropdown()
{
if (!CFG.Current.EnableEditor_TAE_wip)
if (!CFG.Current.EnableEditor_TAE)
return;

if (ImGui.BeginMenu("Edit"))
Expand Down Expand Up @@ -217,7 +217,7 @@ public void EditDropdown()

public void ViewDropdown()
{
if (!CFG.Current.EnableEditor_TAE_wip)
if (!CFG.Current.EnableEditor_TAE)
return;

if (ImGui.BeginMenu("View"))
Expand Down Expand Up @@ -275,7 +275,7 @@ public void ViewDropdown()
/// </summary>
public void EditorUniqueDropdowns()
{
if (!CFG.Current.EnableEditor_TAE_wip)
if (!CFG.Current.EnableEditor_TAE)
return;

// ToolMenubar.DisplayMenu();
Expand All @@ -286,7 +286,7 @@ public void EditorUniqueDropdowns()
/// </summary>
public void OnProjectChanged()
{
if (!CFG.Current.EnableEditor_TAE_wip)
if (!CFG.Current.EnableEditor_TAE)
return;

Selection.OnProjectChanged();
Expand All @@ -303,7 +303,7 @@ public void OnProjectChanged()

public void Save()
{
if (!CFG.Current.EnableEditor_TAE_wip)
if (!CFG.Current.EnableEditor_TAE)
return;

if (Smithbox.ProjectType == ProjectType.Undefined)
Expand All @@ -328,7 +328,7 @@ public void Save()

public void SaveAll()
{
if (!CFG.Current.EnableEditor_TAE_wip)
if (!CFG.Current.EnableEditor_TAE)
return;

if (Smithbox.ProjectType == ProjectType.Undefined)
Expand Down

0 comments on commit 297a77b

Please sign in to comment.