Integrate Dungeon Editor System and Object Editor for Enhanced Dungeon Management

- Introduced a new DungeonEditorSystem to streamline dungeon editing functionalities, including room properties management and object editing.
- Enhanced the DungeonEditor class to initialize the new editor system and manage room properties effectively.
- Added comprehensive object editing capabilities with a dedicated DungeonObjectEditor, supporting object insertion, deletion, and real-time preview.
- Implemented improved UI components for editing dungeon settings, including integrated editing panels for various object types.
- Enhanced error handling and validation throughout the dungeon editing process to ensure robust functionality.
- Updated integration tests to cover new features and validate the overall performance of the dungeon editing system.
This commit is contained in:
scawful
2025-09-24 22:48:47 -04:00
parent b9a4d07745
commit ccd4e8cf4b
23 changed files with 7435 additions and 259 deletions

View File

@@ -456,5 +456,52 @@ void MemoryEditorPopup(const std::string& label, std::span<uint8_t> memory) {
}
}
// Custom hex input functions that properly respect width
bool InputHexByteCustom(const char* label, uint8_t* data, float input_width) {
ImGui::PushID(label);
// Create a simple hex input that respects width
char buf[8];
snprintf(buf, sizeof(buf), "%02X", *data);
ImGui::SetNextItemWidth(input_width);
bool changed = ImGui::InputText(label, buf, sizeof(buf),
ImGuiInputTextFlags_CharsHexadecimal |
ImGuiInputTextFlags_AutoSelectAll);
if (changed) {
unsigned int temp;
if (sscanf(buf, "%X", &temp) == 1) {
*data = static_cast<uint8_t>(temp & 0xFF);
}
}
ImGui::PopID();
return changed;
}
bool InputHexWordCustom(const char* label, uint16_t* data, float input_width) {
ImGui::PushID(label);
// Create a simple hex input that respects width
char buf[8];
snprintf(buf, sizeof(buf), "%04X", *data);
ImGui::SetNextItemWidth(input_width);
bool changed = ImGui::InputText(label, buf, sizeof(buf),
ImGuiInputTextFlags_CharsHexadecimal |
ImGuiInputTextFlags_AutoSelectAll);
if (changed) {
unsigned int temp;
if (sscanf(buf, "%X", &temp) == 1) {
*data = static_cast<uint16_t>(temp & 0xFFFF);
}
}
ImGui::PopID();
return changed;
}
} // namespace gui
} // namespace yaze

View File

@@ -36,6 +36,12 @@ IMGUI_API bool InputHexByte(const char *label, uint8_t *data,
IMGUI_API bool InputHexByte(const char *label, uint8_t *data, uint8_t max_value,
float input_width = 50.f, bool no_step = false);
// Custom hex input functions that properly respect width
IMGUI_API bool InputHexByteCustom(const char *label, uint8_t *data,
float input_width = 50.f);
IMGUI_API bool InputHexWordCustom(const char *label, uint16_t *data,
float input_width = 70.f);
IMGUI_API void Paragraph(const std::string &text);
IMGUI_API bool ClickableText(const std::string &text);