mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 21:10:04 +00:00
Fix map layer update on placefile rename
This commit is contained in:
parent
117a473689
commit
95f4d03c7b
1 changed files with 15 additions and 2 deletions
|
|
@ -211,11 +211,13 @@ void MapWidgetImpl::ConnectSignals()
|
||||||
{
|
{
|
||||||
if (enabled && !enabledPlacefiles_.contains(name))
|
if (enabled && !enabledPlacefiles_.contains(name))
|
||||||
{
|
{
|
||||||
|
// Placefile enabled, add layer
|
||||||
enabledPlacefiles_.emplace(name);
|
enabledPlacefiles_.emplace(name);
|
||||||
UpdatePlacefileLayers();
|
UpdatePlacefileLayers();
|
||||||
}
|
}
|
||||||
else if (!enabled && enabledPlacefiles_.contains(name))
|
else if (!enabled && enabledPlacefiles_.contains(name))
|
||||||
{
|
{
|
||||||
|
// Placefile disabled, remove layer
|
||||||
enabledPlacefiles_.erase(name);
|
enabledPlacefiles_.erase(name);
|
||||||
RemovePlacefileLayer(name);
|
RemovePlacefileLayer(name);
|
||||||
}
|
}
|
||||||
|
|
@ -224,9 +226,20 @@ void MapWidgetImpl::ConnectSignals()
|
||||||
connect(placefileManager_.get(),
|
connect(placefileManager_.get(),
|
||||||
&manager::PlacefileManager::PlacefileRenamed,
|
&manager::PlacefileManager::PlacefileRenamed,
|
||||||
widget_,
|
widget_,
|
||||||
[this]()
|
[this](const std::string& oldName, const std::string& newName)
|
||||||
{
|
{
|
||||||
// TODO
|
if (enabledPlacefiles_.contains(oldName))
|
||||||
|
{
|
||||||
|
// Remove old placefile layer
|
||||||
|
enabledPlacefiles_.erase(oldName);
|
||||||
|
RemovePlacefileLayer(oldName);
|
||||||
|
}
|
||||||
|
if (!enabledPlacefiles_.contains(newName))
|
||||||
|
{
|
||||||
|
// Add new placefile layer
|
||||||
|
enabledPlacefiles_.emplace(newName);
|
||||||
|
UpdatePlacefileLayers();
|
||||||
|
}
|
||||||
widget_->update();
|
widget_->update();
|
||||||
});
|
});
|
||||||
connect(placefileManager_.get(),
|
connect(placefileManager_.get(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue