refactor(editor): streamline ImGui card management across various editors
- Refactored multiple editor classes to ensure that ImGui::End() is always called after ImGui::Begin(), enhancing state management and preventing potential rendering issues. - Updated the DungeonEditor, GraphicsEditor, ScreenEditor, MessageEditor, MusicEditor, and SpriteEditor to follow this pattern, improving code consistency and reliability. Benefits: - Improves the stability of the editor UI by ensuring proper handling of ImGui state. - Enhances code readability and maintainability by standardizing the usage of ImGui functions across different editor components.
This commit is contained in:
@@ -48,20 +48,20 @@ absl::Status MusicEditor::Update() {
|
||||
// Music Tracker Card
|
||||
if (tracker_card.Begin(card_manager.GetVisibilityFlag("music.tracker"))) {
|
||||
DrawTrackerView();
|
||||
tracker_card.End();
|
||||
}
|
||||
tracker_card.End();
|
||||
|
||||
// Instrument Editor Card
|
||||
if (instrument_card.Begin(card_manager.GetVisibilityFlag("music.instrument_editor"))) {
|
||||
DrawInstrumentEditor();
|
||||
instrument_card.End();
|
||||
}
|
||||
instrument_card.End();
|
||||
|
||||
// Assembly View Card
|
||||
if (assembly_card.Begin(card_manager.GetVisibilityFlag("music.assembly"))) {
|
||||
assembly_editor_.InlineUpdate();
|
||||
assembly_card.End();
|
||||
}
|
||||
assembly_card.End();
|
||||
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user