Crappy hot reloading of textures and Properties editor for textures

This commit is contained in:
Simon Lübeß
2023-01-03 22:21:26 +01:00
parent 427323744b
commit ee30920b56
17 changed files with 707 additions and 70 deletions
@@ -14,7 +14,7 @@ namespace GlitchyEditor.EditWindows
class ContentBrowserWindow : EditorWindow
{
// TODO: Get from project
const String ContentDirectory = "./content";
//const String ContentDirectory = "./content";
private append String _currentDirectory = .();
@@ -25,6 +25,8 @@ namespace GlitchyEditor.EditWindows
public EditorContentManager _manager;
public StringView SelectedFile => _selectedFile;
public this(EditorContentManager contentManager)
{
_manager = contentManager;
@@ -191,8 +193,8 @@ namespace GlitchyEditor.EditWindows
String fullpath = scope String(entry->Path);
// TODO: this is dirty
if (fullpath.StartsWith(ContentDirectory, .OrdinalIgnoreCase))
fullpath.Remove(0, ContentDirectory.Length);
if (fullpath.StartsWith(_manager.ContentDirectory, .OrdinalIgnoreCase))
fullpath.Remove(0, _manager.ContentDirectory.Length);
ImGui.SetDragDropPayload("CONTENT_BROWSER_ITEM", fullpath.CStr(), (.)fullpath.Length, .Once);