Fix config changes to trap/coffer locations not being applied when saving

This commit is contained in:
Liza 2023-02-26 17:43:20 +01:00
parent e45b72a655
commit 8279bfe9bf
2 changed files with 9 additions and 0 deletions

View File

@ -110,6 +110,12 @@ namespace Pal.Client.Floors
if (!_territoryState.IsInDeepDungeon() || !_floorService.IsReady(_territoryState.LastTerritory)) if (!_territoryState.IsInDeepDungeon() || !_floorService.IsReady(_territoryState.LastTerritory))
return; return;
if (_renderAdapter.RequireRedraw)
{
recreateLayout = true;
_renderAdapter.RequireRedraw = false;
}
ETerritoryType territoryType = (ETerritoryType)_territoryState.LastTerritory; ETerritoryType territoryType = (ETerritoryType)_territoryState.LastTerritory;
MemoryTerritory memoryTerritory = _floorService.GetTerritoryIfReady(territoryType)!; MemoryTerritory memoryTerritory = _floorService.GetTerritoryIfReady(territoryType)!;
if (_configuration.Mode == EMode.Online && memoryTerritory.SyncState == ESyncState.NotAttempted) if (_configuration.Mode == EMode.Online && memoryTerritory.SyncState == ESyncState.NotAttempted)

View File

@ -27,6 +27,8 @@ namespace Pal.Client.Rendering
_implementation = Recreate(null); _implementation = Recreate(null);
} }
public bool RequireRedraw { get; set; }
private IRenderer Recreate(ERenderer? currentRenderer) private IRenderer Recreate(ERenderer? currentRenderer)
{ {
ERenderer targetRenderer = _configuration.Renderer.SelectedRenderer; ERenderer targetRenderer = _configuration.Renderer.SelectedRenderer;
@ -46,6 +48,7 @@ namespace Pal.Client.Rendering
public void ConfigUpdated() public void ConfigUpdated()
{ {
_implementation = Recreate(_implementation.GetConfigValue()); _implementation = Recreate(_implementation.GetConfigValue());
RequireRedraw = true;
} }
public void Dispose() public void Dispose()