Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 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
5767eed
Deduplicate Action/ActionManager, name EditorAction as appropriate
Philiquaz Oct 3, 2024
8dcaae9
Move explicit modeleditor elements
Philiquaz Oct 3, 2024
e52cdba
base msbbank
Philiquaz Oct 3, 2024
2dbac0e
Move certain common render elements to separate folder
Philiquaz Oct 4, 2024
8283cc1
Split action while we're here
Philiquaz Oct 4, 2024
8ed0479
Split Map to its own file, store MSBs and msbIds in bank, locator fixes
Philiquaz Oct 14, 2024
32a3199
smol load order change
Philiquaz Oct 14, 2024
575f7a3
Fix maplist not being initalised, simplify arguments, comment
Philiquaz Oct 14, 2024
de0efdb
refactor location of assetdescriptor getter
Philiquaz Oct 14, 2024
b8bdb10
Put them back they're ingrained into msbeditor
Philiquaz Oct 15, 2024
f880fcc
Refactor: StudioCore.Scene->StudioCore.Renderer.Scene
Philiquaz Oct 15, 2024
7127ec2
Refactor: Move scene folder
Philiquaz Oct 15, 2024
ec17155
Refactor: StudioCore.DebugPrimitives->StudioCore.Renderer.DebugPrimit…
Philiquaz Oct 15, 2024
e128e66
Refactor: move files
Philiquaz Oct 15, 2024
05097c6
Refactor: StudioCore.Resource->StudioCore.Renderer.Resource
Philiquaz Oct 15, 2024
65ee293
Refactor: move files
Philiquaz Oct 15, 2024
8dee002
Refactor: Fix missing imports
Philiquaz Oct 15, 2024
6eb38c8
Refactor: StudioCore.Gui->StudioCore.Renderer.Gui
Philiquaz Oct 15, 2024
c578a4e
Refactor: move files
Philiquaz Oct 15, 2024
57ae0a8
Move TAE templates
Philiquaz Oct 15, 2024
2ea83e4
Move DDSDeswizzler, Transform, EulerUtils
Philiquaz Oct 15, 2024
1baa515
Move WorldView to renderer
Philiquaz Oct 15, 2024
aaa3792
Move Navgen
Philiquaz Oct 15, 2024
4b14729
Refactor: Move misc havok classes
Philiquaz Oct 15, 2024
776e1d8
Move StructExtensions
Philiquaz Oct 15, 2024
6478936
Move forkawesome, colorspacehandling, fix .xyz extension method
Philiquaz Oct 15, 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
87 changes: 43 additions & 44 deletions src/StudioCore/AssetBrowser/AssetBrowserScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@
using StudioCore.Banks;
using StudioCore.Banks.AliasBank;
using StudioCore.Editor;
using StudioCore.Gui;
using StudioCore.Interface;
using StudioCore.Renderer.Gui;
using StudioCore.Editor;
using StudioCore.MsbEditor;
using StudioCore.Platform;
using StudioCore.Scene;
using StudioCore.Renderer.Scene;
using StudioCore.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Threading;
using static Andre.Native.ImGuiBindings;
using Action = StudioCore.MsbEditor.Action;
using ActionManager = StudioCore.MsbEditor.ActionManager;
using CompoundAction = StudioCore.MsbEditor.CompoundAction;
using ActionManager = StudioCore.Editor.ActionManager;
using CompoundAction = StudioCore.Editor.CompoundAction;
namespace StudioCore.Editors.AssetBrowser;

public enum AssetBrowserSource
Expand Down Expand Up @@ -157,7 +156,7 @@ public void OnProjectChanged()
}
}

List<string> mapList = Locator.AssetLocator.GetFullMapList();
List<string> mapList = Locator.ActiveProject.MSBBank.GetFullMapList();

foreach (var mapId in mapList)
{
Expand Down Expand Up @@ -218,7 +217,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 +234,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 +254,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 +282,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 +326,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 +392,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 +461,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 +482,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 +534,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 Expand Up @@ -657,7 +656,7 @@ public void LoadModelAssetSelection()

public void SetObjectModelForSelection(string modelName, AssetCategoryType assetType, string assetMapId)
{
var actlist = new List<Action>();
var actlist = new List<EditorAction>();

var selected = _selection.GetFilteredSelection<Entity>();

Expand Down
9 changes: 0 additions & 9 deletions src/StudioCore/AssetLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,6 @@ public class AssetLocator

public bool CreateRecoveryProject() => Locator.ActiveProject.CreateRecoveryProject() != null;

/// <summary>
/// Gets the full list of maps in the game (excluding chalice dungeons). Basically if there's an msb for it,
/// it will be in this list.
/// </summary>
/// <returns></returns>
public List<string> GetFullMapList() => Locator.ActiveProject.AssetLocator.GetFullMapList();

public AssetDescription GetMapMSB(string mapid, bool writemode = false) => Locator.ActiveProject.AssetLocator.GetMapMSB(mapid, writemode);

public List<AssetDescription> GetMapBTLs(string mapid, bool writemode = false) => Locator.ActiveProject.AssetLocator.GetMapBTLs(mapid, writemode);

public AssetDescription GetMapNVA(string mapid, bool writemode = false) => Locator.ActiveProject.AssetLocator.GetMapNVA(mapid, writemode);
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