Furniture placement

This commit is contained in:
2026-01-09 22:27:51 +03:00
parent 272e202774
commit f86e7fd96c
11 changed files with 1089 additions and 326 deletions

View File

@@ -1372,8 +1372,81 @@ struct EditorGUIListener : public Ogre::RenderTargetListener {
cursorPosition);
modified = false;
}
}
ImGui::EndMenuBar();
}
if (ImGui::BeginMenu("Furniture")) {
if (ImGui::BeginMenu("Create New Furniture")) {
static char nameBuffer[32];
static int current_mesh = 0;
static std::vector<Ogre::String>
glb_names;
const std::vector<Ogre::String> &groups =
Ogre::ResourceGroupManager::
getSingleton()
.getResourceGroups();
if (glb_names.size() == 0) {
int i;
glb_names.push_back("");
for (i = 0; i < groups.size();
i++) {
std::vector<Ogre::String> names =
*Ogre::ResourceGroupManager::getSingleton()
.findResourceNames(
groups[i],
"furniture-*.glb");
glb_names.insert(
glb_names.end(),
names.begin(),
names.end());
}
}
ImGui::InputText(
"Furniture Name", nameBuffer,
IM_ARRAYSIZE(nameBuffer));
if (glb_names.size() > 0) {
if (ImGui::BeginCombo(
"Furniture Mesh",
glb_names[current_mesh]
.c_str())) {
int i;
for (i = 0;
i <
glb_names.size();
i++) {
bool isSelected =
i ==
current_mesh;
if (ImGui::Selectable(
(glb_names[i] +
"##select" +
Ogre::StringConverter::
toString(
i))
.c_str(),
isSelected)) {
current_mesh =
i;
}
if (isSelected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
} else
ImGui::Text(
"No furniture meshes found");
if (ImGui::MenuItem(
"Create Furniture")) {
}
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Edit Furniture")) {
if (ImGui::MenuItem("Edit Furniture")) {
}
ImGui::EndMenu();
}
ImGui::EndMenu();
}
ImGui::EndMenuBar();
}
ImGui::Spacing();
ImGui::BeginChild("WorldMap...", ImVec2(480, 480),