refactor: Implement session-aware card titles for multi-session support
- Added a helper method, MakeCardTitle, to generate session-aware titles for editor cards based on the current session context. - Updated various editor files to utilize the new MakeCardTitle method, ensuring consistent card naming across multiple sessions. - Refactored card initialization in AssemblyEditor, GraphicsEditor, DungeonEditorV2, OverworldEditor, and SpriteEditor to support dynamic session titles, enhancing user experience and clarity.
This commit is contained in:
@@ -40,8 +40,9 @@ absl::Status SpriteEditor::Update() {
|
||||
DrawToolset();
|
||||
gui::VerticalSpacing(2.0f);
|
||||
|
||||
static gui::EditorCard vanilla_card("Vanilla Sprites", ICON_MD_PEST_CONTROL_RODENT);
|
||||
static gui::EditorCard custom_card("Custom Sprites", ICON_MD_ADD_MODERATOR);
|
||||
// Create session-aware cards (non-static for multi-session support)
|
||||
gui::EditorCard vanilla_card(MakeCardTitle("Vanilla Sprites").c_str(), ICON_MD_PEST_CONTROL_RODENT);
|
||||
gui::EditorCard custom_card(MakeCardTitle("Custom Sprites").c_str(), ICON_MD_ADD_MODERATOR);
|
||||
|
||||
if (show_vanilla_editor_) {
|
||||
if (vanilla_card.Begin(&show_vanilla_editor_)) {
|
||||
|
||||
Reference in New Issue
Block a user