Skip to content

Commit 04a9921

Browse files
committed
Add Auto Zoom option
1 parent 5c18e11 commit 04a9921

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

Mappy/Controllers/IntegrationsController.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ private void OpenMap(AgentMap* agent, OpenMapInfo* mapInfo)
158158
break;
159159
}
160160
}
161+
162+
if (System.SystemConfig.AutoZoom) {
163+
System.MapRenderer.Scale = DrawHelpers.GetMapScaleFactor() * 0.33f;
164+
}
161165
}, Service.Log, "Exception during OpenMap");
162166

163167
public void OpenMap(uint mapId)

Mappy/Data/SystemConfig.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public class SystemConfig : CharacterConfiguration {
8282
public bool ShowPlayerIcon = true;
8383
public float PlayerIconScale = 1.0f;
8484
public float MapScale = 1.0f;
85+
public bool AutoZoom = false;
8586

8687
// Do not persist this setting
8788
[JsonIgnore] public bool DebugMode = false;

Mappy/Windows/ConfigurationWindow.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public void Draw() {
5252
using (ImRaii.PushIndent()) {
5353
configChanged |= ImGui.Checkbox("Use Linear Zoom", ref System.SystemConfig.UseLinearZoom);
5454
configChanged |= ImGui.Checkbox("Scale icons with zoom", ref System.SystemConfig.ScaleWithZoom);
55+
configChanged |= ImGuiTweaks.Checkbox("Auto Zoom", ref System.SystemConfig.AutoZoom, "Automatically sets zoom to a reasonable value relative to the map size.");
5556

5657
ImGuiHelpers.ScaledDummy(5.0f);
5758

0 commit comments

Comments
 (0)