refactor: Improve Editor Management and UI Consistency
- Removed PushID and PopID calls in EditorManager to prevent ID stack corruption, relying on window titles for uniqueness. - Updated ImGui window size and position settings to use FirstUseEver for maximizing on first open, enhancing user experience. - Replaced AgentUI::PopPanelStyle with ImGui::PopStyleColor in multiple locations for consistency in style management. - Ensured all EditorCard instances consistently call End after Begin, improving code clarity and preventing potential rendering issues.
This commit is contained in:
@@ -43,14 +43,18 @@ absl::Status SpriteEditor::Update() {
|
||||
static gui::EditorCard vanilla_card("Vanilla Sprites", ICON_MD_PEST_CONTROL_RODENT);
|
||||
static gui::EditorCard custom_card("Custom Sprites", ICON_MD_ADD_MODERATOR);
|
||||
|
||||
if (show_vanilla_editor_ && vanilla_card.Begin(&show_vanilla_editor_)) {
|
||||
DrawVanillaSpriteEditor();
|
||||
vanilla_card.End();
|
||||
if (show_vanilla_editor_) {
|
||||
if (vanilla_card.Begin(&show_vanilla_editor_)) {
|
||||
DrawVanillaSpriteEditor();
|
||||
}
|
||||
vanilla_card.End(); // ALWAYS call End after Begin
|
||||
}
|
||||
|
||||
if (show_custom_editor_ && custom_card.Begin(&show_custom_editor_)) {
|
||||
DrawCustomSprites();
|
||||
custom_card.End();
|
||||
if (show_custom_editor_) {
|
||||
if (custom_card.Begin(&show_custom_editor_)) {
|
||||
DrawCustomSprites();
|
||||
}
|
||||
custom_card.End(); // ALWAYS call End after Begin
|
||||
}
|
||||
|
||||
return status_.ok() ? absl::OkStatus() : status_;
|
||||
|
||||
Reference in New Issue
Block a user