extract MainWindow::reloadConfig
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -9,6 +10,7 @@
|
||||
#include "BuildingId.h"
|
||||
#include "EscapeMenuRequestedEvent.h"
|
||||
#include "EventHandler.h"
|
||||
#include "GameConfig.h"
|
||||
#include "GameOverEvent.h"
|
||||
#include "LayoutDialogRequestedEvent.h"
|
||||
#include "ModalDimOverlay.h"
|
||||
@@ -58,6 +60,12 @@ private:
|
||||
void handleEvent(std::shared_ptr<const LayoutDialogRequestedEvent> event) override;
|
||||
void handleEvent(std::shared_ptr<const RecipeSelectionRequestedEvent> event) override;
|
||||
|
||||
// Reloads the game config and visuals.toml from disk (REQ-CFG-RELOAD), shared
|
||||
// by every restart path. On success the reloaded visuals are applied to this
|
||||
// window and the fresh GameConfig is returned; on failure a modal error dialog
|
||||
// is shown and std::nullopt is returned, leaving the window state untouched.
|
||||
std::optional<GameConfig> reloadConfig();
|
||||
|
||||
// Opens the shipyard layout configuration dialog for the given schematic and
|
||||
// current layout, applying the result via SetShipLayoutCommand (REQ-MOD-UI-DIALOG).
|
||||
void openShipLayoutDialog(BuildingId shipyardId,
|
||||
|
||||
Reference in New Issue
Block a user