Added Tag Renaming
This commit is contained in:
parent
482bff685b
commit
0f354642a6
20
imgui.ini
20
imgui.ini
@ -1,6 +1,6 @@
|
||||
[Window][DockSpace]
|
||||
Pos=0,0
|
||||
Size=1280,720
|
||||
Size=1920,1177
|
||||
Collapsed=0
|
||||
|
||||
[Window][Debug##Default]
|
||||
@ -9,26 +9,26 @@ Size=400,400
|
||||
Collapsed=0
|
||||
|
||||
[Window][Inspector]
|
||||
Pos=948,27
|
||||
Size=324,448
|
||||
Pos=1588,27
|
||||
Size=324,748
|
||||
Collapsed=0
|
||||
DockId=0x00000005,0
|
||||
|
||||
[Window][OpenGL Output]
|
||||
Pos=374,27
|
||||
Size=572,313
|
||||
Size=1212,770
|
||||
Collapsed=0
|
||||
DockId=0x00000003,0
|
||||
|
||||
[Window][Performance]
|
||||
Pos=948,477
|
||||
Size=324,235
|
||||
Pos=1588,777
|
||||
Size=324,392
|
||||
Collapsed=0
|
||||
DockId=0x00000006,0
|
||||
|
||||
[Window][Logger]
|
||||
Pos=374,342
|
||||
Size=572,370
|
||||
Pos=374,799
|
||||
Size=1212,370
|
||||
Collapsed=0
|
||||
DockId=0x00000004,0
|
||||
|
||||
@ -40,12 +40,12 @@ DockId=0x00000007,0
|
||||
|
||||
[Window][Scene Window]
|
||||
Pos=8,27
|
||||
Size=364,685
|
||||
Size=364,1142
|
||||
Collapsed=0
|
||||
DockId=0x00000009,0
|
||||
|
||||
[Docking][Data]
|
||||
DockSpace ID=0x14621557 Window=0x3DA2F1DE Pos=8,27 Size=1264,685 Split=X Selected=0xF7365A5A
|
||||
DockSpace ID=0x14621557 Window=0x3DA2F1DE Pos=8,27 Size=1904,1142 Split=X Selected=0xF7365A5A
|
||||
DockNode ID=0x00000009 Parent=0x14621557 SizeRef=364,1142 HiddenTabBar=1 Selected=0x3DC5AC3F
|
||||
DockNode ID=0x0000000A Parent=0x14621557 SizeRef=1538,1142 Split=X
|
||||
DockNode ID=0x00000007 Parent=0x0000000A SizeRef=357,1142 Selected=0x7737E8B2
|
||||
|
@ -2,110 +2,110 @@ Entities:
|
||||
- ID: 0
|
||||
Name: Carrrrr Yeaaa
|
||||
Components:
|
||||
Mesh:
|
||||
vao: 2
|
||||
indexCount: 200000
|
||||
textureID: 1
|
||||
Transform:
|
||||
Position: [0, 2.79999995, -12.6000004]
|
||||
Rotation: [149.699997, -137.899994, -39.2999992]
|
||||
Scale: [1, 1, 1]
|
||||
Mesh:
|
||||
vao: 2
|
||||
indexCount: 200000
|
||||
textureID: 1
|
||||
- ID: 1
|
||||
Name: Cube Yay
|
||||
Name: Left Cube
|
||||
Components:
|
||||
Transform:
|
||||
Position: [-11.6999998, -2, -21.7999992]
|
||||
Rotation: [-9, -18.6000004, -28.1000004]
|
||||
Scale: [1, 1, 1]
|
||||
Mesh:
|
||||
vao: 1
|
||||
indexCount: 36
|
||||
textureID: 2
|
||||
Transform:
|
||||
Position: [-11.8999996, -2, -21.7999992]
|
||||
Rotation: [-9, -18.6000004, -28.1000004]
|
||||
Scale: [1, 1, 1]
|
||||
- ID: 2
|
||||
Name: Cube Yay 2
|
||||
Name: Right Cube Top
|
||||
Components:
|
||||
Transform:
|
||||
Position: [8, -8.10000038, -20.6000004]
|
||||
Rotation: [-86.3000031, 0, -66]
|
||||
Scale: [1, 1, 1]
|
||||
Mesh:
|
||||
vao: 1
|
||||
indexCount: 36
|
||||
textureID: 3
|
||||
Transform:
|
||||
Position: [7.80000019, -8.10000038, -20.6000004]
|
||||
Rotation: [-86.3000031, 0, -66]
|
||||
Scale: [1, 1, 1]
|
||||
- ID: 3
|
||||
Name: Cube Yay 3
|
||||
Name: Center Grass
|
||||
Components:
|
||||
Transform:
|
||||
Position: [-0.600000024, -3.4000001, -17.7000008]
|
||||
Rotation: [-23.5, 15.8999996, -59.9000015]
|
||||
Scale: [1, 1, 1]
|
||||
Mesh:
|
||||
vao: 1
|
||||
indexCount: 36
|
||||
textureID: 4
|
||||
Transform:
|
||||
Position: [-1.20000005, -3.4000001, -17.7000008]
|
||||
Rotation: [-23.5, 15.8999996, -59.9000015]
|
||||
Scale: [1, 1, 1]
|
||||
- ID: 4
|
||||
Name: Cube Yay 4
|
||||
Name: Right Most
|
||||
Components:
|
||||
Transform:
|
||||
Position: [8.10000038, 0.5, -12]
|
||||
Rotation: [-17.2999992, -16.1000004, -19.2999992]
|
||||
Scale: [1, 1, 1]
|
||||
Mesh:
|
||||
vao: 1
|
||||
indexCount: 36
|
||||
textureID: 5
|
||||
Transform:
|
||||
Position: [8.10000038, 0.800000012, -12]
|
||||
Rotation: [-17.2999992, -16.1000004, -19.2999992]
|
||||
Scale: [1, 1, 1]
|
||||
- ID: 5
|
||||
Name: Cube Yay 5
|
||||
Name: Left Screen Mirror
|
||||
Components:
|
||||
Transform:
|
||||
Position: [-6.80000019, 2.70000005, -13.8000002]
|
||||
Rotation: [-39.7000008, 0, -33.2000008]
|
||||
Scale: [1, 1, 1]
|
||||
Mesh:
|
||||
vao: 1
|
||||
indexCount: 36
|
||||
textureID: 6
|
||||
Transform:
|
||||
Position: [-6.80000019, 2.29999995, -13.8000002]
|
||||
Rotation: [-39.7000008, 0, -33.2000008]
|
||||
Scale: [1, 1, 1]
|
||||
- ID: 6
|
||||
Name: Cube Yay 6
|
||||
Name: Top Left
|
||||
Components:
|
||||
Transform:
|
||||
Position: [-6.9000001, -6, -18]
|
||||
Rotation: [15.8000002, -18.2000008, -11.1000004]
|
||||
Scale: [1, 1, 1]
|
||||
Mesh:
|
||||
vao: 1
|
||||
indexCount: 36
|
||||
textureID: 3
|
||||
Transform:
|
||||
Position: [-6.5, -6, -18]
|
||||
Rotation: [15.8000002, -18.2000008, -11.1000004]
|
||||
Scale: [1, 1, 1]
|
||||
- ID: 7
|
||||
Name: Cube Yay 7
|
||||
Name: Bottom Grass
|
||||
Components:
|
||||
Mesh:
|
||||
vao: 1
|
||||
indexCount: 36
|
||||
textureID: 4
|
||||
Transform:
|
||||
Position: [6.5, 1.79999995, -23.8999996]
|
||||
Rotation: [-16.1000004, -15.8999996, -35]
|
||||
Scale: [1, 1, 1]
|
||||
Mesh:
|
||||
vao: 1
|
||||
indexCount: 36
|
||||
textureID: 4
|
||||
- ID: 8
|
||||
Name: Cube Yay 8
|
||||
Name: Back Wood
|
||||
Components:
|
||||
Transform:
|
||||
Position: [-7.80000019, -1, -29.7999992]
|
||||
Rotation: [22.5, -34.2999992, 0]
|
||||
Scale: [1, 1, 1]
|
||||
Mesh:
|
||||
vao: 1
|
||||
indexCount: 36
|
||||
textureID: 1
|
||||
Transform:
|
||||
Position: [-7.80000019, 0.200000003, -29.7999992]
|
||||
Rotation: [22.5, -34.2999992, 0]
|
||||
Scale: [1, 1, 1]
|
||||
- ID: 9
|
||||
Name: Cube Yay 9
|
||||
Name: Right Brick
|
||||
Components:
|
||||
Transform:
|
||||
Position: [5.5, -3.20000005, -19.5]
|
||||
Rotation: [-41.4000015, -24.8999996, -52.2999992]
|
||||
Scale: [1, 1, 1]
|
||||
Mesh:
|
||||
vao: 1
|
||||
indexCount: 36
|
||||
textureID: 2
|
||||
Transform:
|
||||
Position: [5.5, -2.9000001, -19.5]
|
||||
Rotation: [-41.4000015, -24.8999996, -52.2999992]
|
||||
Scale: [1, 1, 1]
|
||||
textureID: 2
|
@ -19,13 +19,55 @@ void InspectorWindow::Show()
|
||||
if (ImGui::Begin("Inspector"))
|
||||
{
|
||||
// Title label (white text)
|
||||
const char *objectName = "No Object Selected";
|
||||
if (g_SelectedObject)
|
||||
{
|
||||
objectName = g_SelectedObject->name.c_str();
|
||||
ImGui::Text("Editing Object: %s", objectName);
|
||||
|
||||
if (g_SelectedObject == nullptr)
|
||||
{
|
||||
ImGui::Text("No object selected.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Display object name and component count
|
||||
ImGui::Text("Editing Object: %s", g_SelectedObject->name.c_str());
|
||||
ImGui::Text("Components: %d", g_SelectedObject->GetComponentCount());
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
// Begin two-column layout for labels and inputs
|
||||
ImGui::Columns(2, "InspectorColumns", true); // 2 columns, ID "InspectorColumns", border=true
|
||||
ImGui::SetColumnWidth(0, 100.0f); // Optional: Set fixed width for the first column
|
||||
|
||||
// Label in the first column
|
||||
ImGui::Text("Tag:");
|
||||
ImGui::NextColumn(); // Move to the second column
|
||||
|
||||
// Define buffer size
|
||||
const size_t BUFFER_SIZE = 256;
|
||||
|
||||
// Allocate buffer and copy the current string
|
||||
char buffer[BUFFER_SIZE];
|
||||
std::strncpy(buffer, g_SelectedObject->name.c_str(), BUFFER_SIZE - 1);
|
||||
buffer[BUFFER_SIZE - 1] = '\0'; // Ensure null-termination
|
||||
|
||||
// Unique identifier for the InputText to prevent ImGui state conflicts
|
||||
const char *inputLabel = "##TagInput";
|
||||
|
||||
// Render InputText widget
|
||||
if (ImGui::InputText(inputLabel, buffer, BUFFER_SIZE))
|
||||
{
|
||||
// Update the GameObject's name if modified
|
||||
g_SelectedObject->name = buffer;
|
||||
}
|
||||
|
||||
ImGui::NextColumn(); // Move back to the first column (if adding more fields)
|
||||
|
||||
// End columns
|
||||
ImGui::Columns(1);
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
@ -36,9 +78,7 @@ void InspectorWindow::Show()
|
||||
std::shared_ptr<TransformComponent> transform = g_SelectedObject->GetComponent<TransformComponent>();
|
||||
std::shared_ptr<MeshComponent> mesh = g_SelectedObject->GetComponent<MeshComponent>();
|
||||
|
||||
|
||||
// Color the Transform header
|
||||
|
||||
|
||||
if (transform && g_SelectedObject) //! Funny: I did not put a null check here and it broke everything.
|
||||
{
|
||||
@ -251,8 +291,6 @@ void InspectorWindow::Show()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (mesh && g_SelectedObject) //! Funny: I did not put a null check here and it broke everything.
|
||||
{
|
||||
|
||||
@ -324,7 +362,7 @@ void InspectorWindow::Show()
|
||||
}
|
||||
ImGui::End();
|
||||
|
||||
} //
|
||||
} //
|
||||
|
||||
// Restore style
|
||||
ImGui::PopStyleVar(3);
|
||||
|
@ -9,6 +9,11 @@
|
||||
extern int LoaddedAssets;
|
||||
extern int g_GPU_Triangles_drawn_to_screen;
|
||||
|
||||
const char* polygonModeOptions[] = { "Fill", "Wireframe", "Points" };
|
||||
const int numPolygonModes = sizeof(polygonModeOptions) / sizeof(polygonModeOptions[0]);
|
||||
|
||||
int polygonMode = 0;
|
||||
|
||||
// Initialize static members
|
||||
int PerformanceWindow::m_OpenGLCallCount = 0;
|
||||
int PerformanceWindow::m_TriangleCount = 0;
|
||||
@ -181,6 +186,24 @@ void PerformanceWindow::Show(float fps, float ms)
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
if (ImGui::Combo("Polygon Mode", &polygonMode, polygonModeOptions, numPolygonModes))
|
||||
{
|
||||
switch (polygonMode)
|
||||
{
|
||||
case 0:
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
break;
|
||||
case 1:
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
break;
|
||||
case 2:
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);
|
||||
break;
|
||||
default:
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user