Skip to content

Commit e58c108

Browse files
committed
Make it possible to toggle extra graphics in framework mode on/off
1 parent 78454e5 commit e58c108

4 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/TSMapEditor/Config/Translations/en/Translation_en.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ TopBarMenu.Edit.Header=Edit
424424
TopBarMenu.View.ConfigureRenderedObjects=Configure Rendered Objects...
425425
TopBarMenu.View.ToggleImpassableCells=Toggle Impassable Cells
426426
TopBarMenu.View.ToggleIceGrowthPreview=Toggle IceGrowth Preview
427+
TopBarMenu.View.ToggleExtraGraphicsIn2DMode=Toggle Extra Graphics in 2D Mode
427428
TopBarMenu.View.ViewMinimap=View Minimap
428429
TopBarMenu.View.FindWaypoint=Find Waypoint...
429430
TopBarMenu.View.CenterOfMap=Center of Map

src/TSMapEditor/Rendering/MapView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ public void DrawTerrainTile(MapTile tile)
780780
new Rectangle(drawX, drawY, Constants.CellSizeX, Constants.CellSizeY),
781781
sourceRectangle, color, depthTop, depthBottom);
782782

783-
if (tmpImage.TmpImage.HasExtraData())
783+
if (tmpImage.TmpImage.HasExtraData() && (!EditorState.Is2DMode || UserSettings.Instance.DrawExtraGraphicsIn2DMode))
784784
{
785785
drawX = drawX + tmpImage.TmpImage.XExtra - tmpImage.TmpImage.X;
786786
drawY = drawPointWithoutCellHeight.Y + tmpImage.TmpImage.YExtra - tmpImage.TmpImage.Y;

src/TSMapEditor/Settings/UserSettings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public UserSettings()
4242

4343
ScrollRate,
4444
MapWideOverlayOpacity,
45+
DrawExtraGraphicsIn2DMode,
4546

4647
Theme,
4748
UseBoldFont,
@@ -102,6 +103,7 @@ public async Task SaveSettingsAsync()
102103

103104
public IntSetting ScrollRate = new IntSetting(MapView, nameof(ScrollRate), 15);
104105
public IntSetting MapWideOverlayOpacity = new IntSetting(MapView, nameof(MapWideOverlayOpacity), 50);
106+
public BoolSetting DrawExtraGraphicsIn2DMode = new BoolSetting(MapView, nameof(DrawExtraGraphicsIn2DMode), true);
105107

106108
public StringSetting Theme = new StringSetting(General, nameof(Theme), "Default");
107109
public BoolSetting UseBoldFont = new BoolSetting(General, nameof(UseBoldFont), false);

src/TSMapEditor/UI/TopBar/TopBarMenu.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ public override void Initialize()
171171
viewContextMenu.AddItem(" ", null, () => false, null, null);
172172
viewContextMenu.AddItem(Translate(this, "View.ToggleImpassableCells", "Toggle Impassable Cells"), () => mapUI.EditorState.HighlightImpassableCells = !mapUI.EditorState.HighlightImpassableCells, null, null, null);
173173
viewContextMenu.AddItem(Translate(this, "View.ToggleIceGrowthPreview", "Toggle IceGrowth Preview"), () => mapUI.EditorState.HighlightIceGrowth = !mapUI.EditorState.HighlightIceGrowth, null, null, null);
174+
viewContextMenu.AddItem(Translate(this, "View.ToggleExtraGraphicsIn2DMode", "Toggle Extra Graphics in 2D Mode"), ToggleExtraGraphicsIn2DMode, null, null, null);
174175
viewContextMenu.AddItem(" ", null, () => false, null, null);
175176
viewContextMenu.AddItem(Translate(this, "View.ViewMinimap", "View Minimap"), () => windowController.MinimapWindow.Open());
176177
viewContextMenu.AddItem(" ", null, () => false, null, null);
@@ -415,6 +416,13 @@ private void SmoothenIce()
415416
mapUI.InvalidateMap();
416417
}
417418

419+
private void ToggleExtraGraphicsIn2DMode()
420+
{
421+
UserSettings.Instance.DrawExtraGraphicsIn2DMode.UserDefinedValue = !UserSettings.Instance.DrawExtraGraphicsIn2DMode;
422+
_ = UserSettings.Instance.SaveSettingsAsync();
423+
mapUI.InvalidateMap();
424+
}
425+
418426
private void EnterTerrainGenerator()
419427
{
420428
if (windowController.TerrainGeneratorConfigWindow.TerrainGeneratorConfig == null)

0 commit comments

Comments
 (0)