Implement multi-session support and welcome screen in EditorManager
- Removed the homepage display logic and replaced it with a welcome screen that appears when no ROM is loaded or no active editors are present. - Enhanced session management by iterating through all sessions to check for active editors, allowing for better multi-session docking. - Introduced new methods for generating unique editor titles based on session context and added feature flags for per-session configurations. - Added safeguards for ROM loading state checks in editor methods to prevent operations on unloaded ROMs.
This commit is contained in:
@@ -46,6 +46,10 @@ void DungeonEditor::Initialize() {
|
||||
}
|
||||
|
||||
absl::Status DungeonEditor::Load() {
|
||||
if (!rom_ || !rom_->is_loaded()) {
|
||||
return absl::FailedPreconditionError("ROM not loaded");
|
||||
}
|
||||
|
||||
auto dungeon_man_pal_group = rom()->palette_group().dungeon_main;
|
||||
|
||||
// Use room loader component for loading rooms
|
||||
|
||||
@@ -83,6 +83,14 @@ class DungeonEditor : public Editor {
|
||||
}
|
||||
Rom* rom() const { return rom_; }
|
||||
|
||||
// ROM state methods (from Editor base class)
|
||||
bool IsRomLoaded() const override { return rom_ && rom_->is_loaded(); }
|
||||
std::string GetRomStatus() const override {
|
||||
if (!rom_) return "No ROM loaded";
|
||||
if (!rom_->is_loaded()) return "ROM failed to load";
|
||||
return absl::StrFormat("ROM loaded: %s", rom_->title());
|
||||
}
|
||||
|
||||
private:
|
||||
absl::Status RefreshGraphics();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user