color item icon backgrounds in the UI from visuals.toml
This commit is contained in:
@@ -55,7 +55,7 @@ MainWindow::MainWindow(Simulation* sim, const std::string& configDir,
|
||||
// REQ-UI-BUILD-ICON).
|
||||
const QString configDirPath = QString::fromStdString(m_configDir);
|
||||
m_itemIcons = std::make_unique<ItemIconCache>(
|
||||
QDir::cleanPath(configDirPath + "/../icons/items"));
|
||||
QDir::cleanPath(configDirPath + "/../icons/items"), &m_visuals);
|
||||
m_buildingIcons = std::make_unique<BuildingIconCache>(
|
||||
QDir::cleanPath(configDirPath + "/../icons/buildings"));
|
||||
|
||||
@@ -283,6 +283,9 @@ std::optional<GameConfig> MainWindow::reloadConfig()
|
||||
VisualsConfig newVisuals = VisualsLoader::load(m_configDir + "/visuals.toml");
|
||||
m_visuals = std::move(newVisuals);
|
||||
m_dimOverlay->setDimColor(m_visuals.overlays.modalDim);
|
||||
// The composed item squares carry the colors they were painted with, so they
|
||||
// are dropped for the new ones to take effect (REQ-UI-ITEM-ICON).
|
||||
m_itemIcons->clearPixmapCache();
|
||||
return newConfig;
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
|
||||
Reference in New Issue
Block a user