Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add load-ordering structure to databanks #947

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5b444fd
Rename cachebank file to uicache, as per the type. Also disambiguates…
Philiquaz Jul 21, 2024
7c3ef5c
fold imguiUtils into editordecorations
Philiquaz Jul 21, 2024
b8730a7
Move helpwindow to editor
Philiquaz Jul 21, 2024
5a289d1
Move alias decorators to editordecorations
Philiquaz Jul 21, 2024
756370a
Move aliasUtils to alias namespace
Philiquaz Jul 21, 2024
f7c2318
Start defining databank, studioresource, modify editorscreen and depe…
Philiquaz Aug 29, 2024
a926e13
Split paramdef from parambank, tentatively use databank based loading
Philiquaz Aug 29, 2024
98943ea
Concurrency fixes
Philiquaz Aug 29, 2024
81948b9
remove hamfisted vanilla solution - solve properly
Philiquaz Aug 29, 2024
253e3b6
Split meta into its own bank, another concurrency fix
Philiquaz Aug 29, 2024
f8a7449
Tweak. Still suspect there's a concurrency bug somewhere.
Philiquaz Aug 30, 2024
a3daaa0
Move res management code to studioresource
Philiquaz Aug 30, 2024
21e9ca7
Give up and use lock manually.
Philiquaz Aug 30, 2024
538b3af
Clean some imports
Philiquaz Aug 30, 2024
2de4308
Housekeeping
Philiquaz Aug 30, 2024
ac634fc
Explode parambank into many different files
Philiquaz Aug 30, 2024
c479678
Remove duplicate Project var
Philiquaz Aug 30, 2024
7e834b7
Split paramdiff into its own bank - broken!
Philiquaz Aug 30, 2024
46b74c5
Fix diffs at startup
Philiquaz Aug 30, 2024
37949c2
Split up settingsmenu code. Clean up help icons.
Philiquaz Oct 2, 2024
99e09e3
Divide CFG class (though no luck actually splitting it)
Philiquaz Oct 2, 2024
6202ecc
Potential fix for rare load order issue?
Philiquaz Oct 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 37 additions & 37 deletions src/StudioCore/AssetBrowser/AssetBrowserScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using StudioCore.Banks.AliasBank;
using StudioCore.Editor;
using StudioCore.Gui;
using StudioCore.Interface;
using StudioCore.Editor;
using StudioCore.MsbEditor;
using StudioCore.Platform;
using StudioCore.Scene;
Expand Down Expand Up @@ -218,7 +218,7 @@ public void OnGui()
if (ImGui.Begin($@"Asset Browser: Category##{SourceType}AssetBrowser_CategoryList"))
{
ImGui.Separator();
ImguiUtils.WrappedText("Categories:");
Editor.EditorDecorations.WrappedText("Categories:");
ImGui.Separator();

DisplayCategoryList();
Expand All @@ -235,7 +235,7 @@ public void OnGui()
DisplayTopSection();

ImGui.Separator();
ImguiUtils.WrappedText("Assets:");
Editor.EditorDecorations.WrappedText("Assets:");
ImGui.Separator();

DisplayBrowserList(AssetCategoryType.Character, _characterNameCache, chrReferenceDict);
Expand All @@ -255,7 +255,7 @@ public void OnGui()
ImGui.Indent(10.0f);

ImGui.Separator();
ImguiUtils.WrappedText("Actions:");
Editor.EditorDecorations.WrappedText("Actions:");
ImGui.Separator();

if (SourceType == AssetBrowserSource.MapEditor)
Expand Down Expand Up @@ -283,7 +283,7 @@ private void DisplayTopSection()
{
ImGui.Separator();
ImGui.InputText($"Search", ref _searchInput, 255);
ImguiUtils.ShowHoverTooltip("Separate terms are split via the + character.");
Editor.EditorDecorations.ShowHoverTooltip("Separate terms are split via the + character.");
}

private void DisplayCategoryList()
Expand Down Expand Up @@ -327,7 +327,7 @@ private void DisplayCategoryList()
if (CFG.Current.AssetBrowser_ShowAliasesInBrowser)
{
var labelName = AliasUtils.GetMapNameAlias(mapId);
AliasUtils.DisplayAlias(labelName);
EditorDecorations.DisplayAlias(labelName);
}
}
}
Expand Down Expand Up @@ -393,14 +393,14 @@ private void DisplayBrowserList(AssetCategoryType assetType, List<string> nameCa
if (CFG.Current.AssetBrowser_ShowAliasesInBrowser)
{
var aliasName = referenceDict[lowerName].name;
AliasUtils.DisplayAlias(aliasName);
EditorDecorations.DisplayAlias(aliasName);
}

// Tags
if (CFG.Current.AssetBrowser_ShowTagsInBrowser)
{
var tagString = string.Join(" ", referenceDict[lowerName].tags);
AliasUtils.DisplayTagAlias(tagString);
EditorDecorations.DisplayTagAlias(tagString);
}
}
}
Expand Down Expand Up @@ -462,14 +462,14 @@ private void DisplayBrowserList_MapPiece(AssetCategoryType assetType, Dictionary
if (CFG.Current.AssetBrowser_ShowAliasesInBrowser)
{
var aliasName = referenceDict[lowerName].name;
AliasUtils.DisplayAlias(aliasName);
EditorDecorations.DisplayAlias(aliasName);
}

// Tags
if (CFG.Current.AssetBrowser_ShowTagsInBrowser)
{
var tagString = string.Join(" ", referenceDict[lowerName].tags);
AliasUtils.DisplayTagAlias(tagString);
EditorDecorations.DisplayTagAlias(tagString);
}
}
}
Expand All @@ -483,41 +483,41 @@ private void DisplayActions_MapEditor()
if (_selectedName == null || _selectedName == "")
return;

ImguiUtils.WrappedText("Apply the selected asset attributes to your current object selection.");
ImguiUtils.WrappedText("");
Editor.EditorDecorations.WrappedText("Apply the selected asset attributes to your current object selection.");
Editor.EditorDecorations.WrappedText("");

ImGui.Checkbox("Update Name of Selected Object", ref CFG.Current.AssetBrowser_UpdateName);
ImguiUtils.ShowHoverTooltip("Update the Name property of the selected entity when it is changed to a selected asset.");
Editor.EditorDecorations.ShowHoverTooltip("Update the Name property of the selected entity when it is changed to a selected asset.");

if (Locator.AssetLocator.Type is GameType.EldenRing or GameType.ArmoredCoreVI)
{
ImGui.Checkbox("Update Instance ID of Selected Object", ref CFG.Current.AssetBrowser_UpdateInstanceID);
ImguiUtils.ShowHoverTooltip("Update the Name property of the selected entity when it is changed to a selected asset.");
ImguiUtils.WrappedText("");
Editor.EditorDecorations.ShowHoverTooltip("Update the Name property of the selected entity when it is changed to a selected asset.");
Editor.EditorDecorations.WrappedText("");
}

if (ImGui.Button("Apply##action_Asset_Apply", new Vector2(200, 32)))
{
ApplyMapAssetSelection();
}
ImguiUtils.WrappedText("");
Editor.EditorDecorations.WrappedText("");

ImGui.Separator();
ImguiUtils.WrappedText("Alias:");
Editor.EditorDecorations.WrappedText("Alias:");
ImGui.Separator();

ImguiUtils.WrappedText("Update the stored name and tag list for the selected asset here.");
ImguiUtils.WrappedText("");
Editor.EditorDecorations.WrappedText("Update the stored name and tag list for the selected asset here.");
Editor.EditorDecorations.WrappedText("");

ImguiUtils.WrappedText("Name:");
Editor.EditorDecorations.WrappedText("Name:");
ImGui.InputText($"##Name", ref _refUpdateName, 255);
ImguiUtils.ShowHoverTooltip("Alias name given to this asset.");
ImguiUtils.WrappedText("");
Editor.EditorDecorations.ShowHoverTooltip("Alias name given to this asset.");
Editor.EditorDecorations.WrappedText("");

ImguiUtils.WrappedText("Tags:");
Editor.EditorDecorations.WrappedText("Tags:");
ImGui.InputText($"##Tags", ref _refUpdateTags, 255);
ImguiUtils.ShowHoverTooltip("Tags associated with this asset. Tags are separated with the , character.");
ImguiUtils.WrappedText("");
Editor.EditorDecorations.ShowHoverTooltip("Tags associated with this asset. Tags are separated with the , character.");
Editor.EditorDecorations.WrappedText("");

if (ImGui.Button("Update##action_AssetAlias_Update", new Vector2(200, 32)))
{
Expand All @@ -535,31 +535,31 @@ private void DisplayActions_ModelEditor()
if (_selectedName == null || _selectedName == "")
return;

ImguiUtils.WrappedText("Load the selected asset.");
ImguiUtils.WrappedText("");
Editor.EditorDecorations.WrappedText("Load the selected asset.");
Editor.EditorDecorations.WrappedText("");

if (ImGui.Button("Load##action_Asset_Load", new Vector2(200, 32)))
{
LoadModelAssetSelection();
}
ImguiUtils.WrappedText("");
Editor.EditorDecorations.WrappedText("");

ImGui.Separator();
ImguiUtils.WrappedText("Alias:");
Editor.EditorDecorations.WrappedText("Alias:");
ImGui.Separator();

ImguiUtils.WrappedText("Update the stored name and tag list for the selected asset here.");
ImguiUtils.WrappedText("");
Editor.EditorDecorations.WrappedText("Update the stored name and tag list for the selected asset here.");
Editor.EditorDecorations.WrappedText("");

ImguiUtils.WrappedText("Name:");
Editor.EditorDecorations.WrappedText("Name:");
ImGui.InputText($"##Name", ref _refUpdateName, 255);
ImguiUtils.ShowHoverTooltip("Alias name given to this asset.");
ImguiUtils.WrappedText("");
Editor.EditorDecorations.ShowHoverTooltip("Alias name given to this asset.");
Editor.EditorDecorations.WrappedText("");

ImguiUtils.WrappedText("Tags:");
Editor.EditorDecorations.WrappedText("Tags:");
ImGui.InputText($"##Tags", ref _refUpdateTags, 255);
ImguiUtils.ShowHoverTooltip("Tags associated with this asset. Tags are separated with the , character.");
ImguiUtils.WrappedText("");
Editor.EditorDecorations.ShowHoverTooltip("Tags associated with this asset. Tags are separated with the , character.");
Editor.EditorDecorations.WrappedText("");

if (ImGui.Button("Update##action_AssetAlias_Update", new Vector2(200, 32)))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,9 @@
using System.Threading.Tasks;
using static Andre.Native.ImGuiBindings;

namespace StudioCore.Interface;
namespace StudioCore.Banks.AliasBank;
public static class AliasUtils
{
public static void DisplayAlias(string aliasName)
{
if (aliasName != "")
{
ImGui.SameLine();
ImGui.PushTextWrapPos(0);
ImGui.TextColored(new Vector4(1.0f, 1.0f, 0.0f, 1.0f), @$"{aliasName}");
ImGui.PopTextWrapPos();
}
}
public static void DisplayTagAlias(string aliasName)
{
if (aliasName != "")
{
ImGui.SameLine();
ImGui.PushTextWrapPos(0);
ImGui.TextColored(new Vector4(0.0f, 1.0f, 0.0f, 1.0f), @$"[{aliasName}]");
ImGui.PopTextWrapPos();
}
}

public static string GetTagListString(List<string> refTagList)
{
var tagListStr = "";
Expand Down
Loading
Loading