mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Updated ImGui
This commit is contained in:
@@ -31,7 +31,58 @@ class AssetViewer : EditorWindow
|
||||
|
||||
ImGui.PushStyleVar(.CellPadding, .(0, 0));
|
||||
|
||||
bool alt_pressed = ImGui.GetIO().KeyAlt;
|
||||
ImGui.Columns(2);
|
||||
|
||||
if (ImGui.BeginChild("Assets"))
|
||||
{
|
||||
DrawAssetList();
|
||||
|
||||
ImGui.EndChild();
|
||||
}
|
||||
|
||||
ImGui.NextColumn();
|
||||
|
||||
if (ImGui.BeginChild("Files"))
|
||||
{
|
||||
DrawAssetViewer();
|
||||
|
||||
ImGui.EndChild();
|
||||
}
|
||||
|
||||
ImGui.Columns(1);
|
||||
|
||||
/*if (ImGui.BeginTable("AssetViewerTable", 2, .BordersInnerV | .Resizable | .Reorderable | .NoPadOuterX))
|
||||
{
|
||||
if (alt_pressed)
|
||||
{
|
||||
// Header anzeigen, damit sie neu angeordnet werden können
|
||||
ImGui.TableSetupColumn("Assets");
|
||||
ImGui.TableSetupColumn("Viewer");
|
||||
ImGui.TableHeadersRow();
|
||||
}
|
||||
ImGui.TableNextRow();
|
||||
ImGui.TableSetColumnIndex(0);
|
||||
|
||||
if (ImGui.BeginChild("Assets"))
|
||||
{
|
||||
//DrawAssetList();
|
||||
|
||||
ImGui.EndChild();
|
||||
}
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
|
||||
if (ImGui.BeginChild("Files"))
|
||||
{
|
||||
//DrawAssetViewer();
|
||||
|
||||
ImGui.EndChild();
|
||||
}
|
||||
|
||||
ImGui.EndTable();
|
||||
}*/
|
||||
|
||||
/*bool alt_pressed = ImGui.GetIO().KeyAlt;
|
||||
|
||||
if (ImGui.BeginTable("AssetViewerTable", 2, .BordersInnerV | .Resizable | .Reorderable | .NoPadOuterX))
|
||||
{
|
||||
@@ -42,13 +93,12 @@ class AssetViewer : EditorWindow
|
||||
ImGui.TableSetupColumn("Viewer");
|
||||
ImGui.TableHeadersRow();
|
||||
}
|
||||
|
||||
ImGui.TableNextRow();
|
||||
ImGui.TableSetColumnIndex(0);
|
||||
|
||||
|
||||
if (ImGui.BeginChild("Assets"))
|
||||
{
|
||||
DrawAssetList();
|
||||
//DrawAssetList();
|
||||
|
||||
ImGui.EndChild();
|
||||
}
|
||||
@@ -57,13 +107,13 @@ class AssetViewer : EditorWindow
|
||||
|
||||
if (ImGui.BeginChild("Files"))
|
||||
{
|
||||
DrawAssetViewer();
|
||||
//DrawAssetViewer();
|
||||
|
||||
ImGui.EndChild();
|
||||
}
|
||||
|
||||
ImGui.EndTable();
|
||||
}
|
||||
}*/
|
||||
|
||||
ImGui.PopStyleVar(1);
|
||||
|
||||
@@ -211,7 +261,7 @@ class TexturererViewerer
|
||||
|
||||
float maxDimension = max(width, height);
|
||||
|
||||
ImGui.SliderFloat2("Position", *(float[2]*)&_position, 2 * -maxDimension * _zoom, 2 * maxDimension * _zoom);
|
||||
ImGui.SliderFloat2("Position", ref *(float[2]*)&_position, 2 * -maxDimension * _zoom, 2 * maxDimension * _zoom);
|
||||
|
||||
ImGui.Separator();
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ namespace GlitchyEditor.EditWindows
|
||||
|
||||
SubTexture2D image = s_FolderTexture;
|
||||
|
||||
ImGui.ImageButton(image, (.)(DirectoryItemSize - padding));
|
||||
ImGui.ImageButton("", image, (.)(DirectoryItemSize - padding));
|
||||
|
||||
ImGui.PopStyleColor();
|
||||
|
||||
@@ -310,7 +310,7 @@ namespace GlitchyEditor.EditWindows
|
||||
// TODO: preview images
|
||||
SubTexture2D image = entry->IsDirectory ? s_FolderTexture : s_FileTexture;
|
||||
|
||||
ImGui.ImageButton(image, (.)(DirectoryItemSize - padding));
|
||||
ImGui.ImageButton("FileImage", image, (.)(DirectoryItemSize - padding));
|
||||
|
||||
ImGui.PopStyleColor();
|
||||
|
||||
|
||||
@@ -130,13 +130,14 @@ class LogWindow : EditorWindow
|
||||
ImGui.Vec2 buttonSize = .(maxSpace, maxSpace);
|
||||
|
||||
var col = ImGui.GetStyleColorVec4(.Button);
|
||||
ImGui.PushStyleVar(.FramePadding, ImGui.Vec2(2, 2));
|
||||
|
||||
if (_visibleMessageTypes.HasFlag(.Trace))
|
||||
ImGui.PushStyleColor(.Button, *col);
|
||||
else
|
||||
ImGui.PushStyleColor(.Button, .(0, 0, 0, 0));
|
||||
|
||||
if (ImGui.ImageButtonEx(1, s_TraceIcon, buttonSize, .Zero, .Ones, .(2, 2)))
|
||||
if (ImGui.ImageButtonEx(1, s_TraceIcon, buttonSize, .Zero, .Ones))
|
||||
_visibleMessageTypes ^= .Trace;
|
||||
|
||||
ImGui.PopStyleColor();
|
||||
@@ -146,7 +147,7 @@ class LogWindow : EditorWindow
|
||||
else
|
||||
ImGui.PushStyleColor(.Button, .(0, 0, 0, 0));
|
||||
|
||||
if (ImGui.ImageButtonEx(2, s_InfoIcon, buttonSize, .Zero, .Ones, .(2, 2)))
|
||||
if (ImGui.ImageButtonEx(2, s_InfoIcon, buttonSize, .Zero, .Ones))
|
||||
_visibleMessageTypes ^= .Info;
|
||||
|
||||
ImGui.PopStyleColor();
|
||||
@@ -156,7 +157,7 @@ class LogWindow : EditorWindow
|
||||
else
|
||||
ImGui.PushStyleColor(.Button, .(0, 0, 0, 0));
|
||||
|
||||
if (ImGui.ImageButtonEx(3, s_WarningIcon, buttonSize, .Zero, .Ones, .(2, 2)))
|
||||
if (ImGui.ImageButtonEx(3, s_WarningIcon, buttonSize, .Zero, .Ones))
|
||||
_visibleMessageTypes ^= .Warning;
|
||||
|
||||
ImGui.PopStyleColor();
|
||||
@@ -167,11 +168,13 @@ class LogWindow : EditorWindow
|
||||
ImGui.PushStyleColor(.Button, .(0, 0, 0, 0));
|
||||
|
||||
|
||||
if (ImGui.ImageButtonEx(4, s_ErrorIcon, buttonSize, .Zero, .Ones, .(2, 2)))
|
||||
if (ImGui.ImageButtonEx(4, s_ErrorIcon, buttonSize, .Zero, .Ones))
|
||||
_visibleMessageTypes ^= .Error;
|
||||
|
||||
ImGui.PopStyleColor();
|
||||
|
||||
ImGui.PopStyleVar();
|
||||
|
||||
ImGui.EndMenuBar();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user