diff --git a/CHANGELOG.md b/CHANGELOG.md index fd374f9..f5ea208 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ### Added -- Ability to change the camera position, you can also reset it to the default position. +- Ability to change the camera position, you can also reset it to the default position +- Auto Zoom to approximate map size ### Fixed @@ -13,7 +14,7 @@ ### Added -- Ability to change to zoom level to the approximate current map size. +- Ability to change to zoom level to the approximate current map size ### Changed @@ -49,7 +50,7 @@ ### Added -- Option that hides the UI at a certain zoom level. +- Option that hides the UI at a certain zoom level ### Fixed @@ -59,13 +60,13 @@ ### Added -- Toggle UI. +- Toggle UI ## [1.9.0] - 2022-01-27 ### Added -- Max and Min UI or Zoom. +- Max and Min UI or Zoom ### Changed @@ -73,7 +74,7 @@ ### Improvements -- Updated API for the optional Generic Mod Config Menu → [Here](https://www.nexusmods.com/stardewvalley/mods/5098). +- Updated API for the optional Generic Mod Config Menu → [Here](https://www.nexusmods.com/stardewvalley/mods/5098) - README file ### Fixed @@ -84,32 +85,32 @@ ### Improvements -- Added support for the new API version. +- Added support for the new API version ## [1.7.0] - 2021-05-17 ### Added -- Reset UI or Zoom. +- Reset UI or Zoom ## [1.6.0] - 2021-05-01 ### Added -- Control Zoom and UI levels anywhere if activated. +- Control Zoom and UI levels anywhere if activated ## [1.5.1] - 2021-04-12 ### Fixed -- Support for the optional Generic Mod Config Menu → [Here](https://www.nexusmods.com/stardewvalley/mods/5098). +- Support for the optional Generic Mod Config Menu → [Here](https://www.nexusmods.com/stardewvalley/mods/5098) - Some text typos ## [1.5.0] - 2021-04-11 ### Added -- Support for the optional Generic Mod Config Menu → [Here](https://www.nexusmods.com/stardewvalley/mods/5098). +- Support for the optional Generic Mod Config Menu → [Here](https://www.nexusmods.com/stardewvalley/mods/5098) ### Changed diff --git a/README.md b/README.md index d11dd49..d4e1066 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ Here's what you can change: `ZoomAndUIControlEverywhere` | `false` | If activated you can control your Zoom and UI Level anywhere. `IsHideUIWithCertainZoom` | `false` | If activated your UI hides when it reaches a certain zoom level. `PressAnyButtonToCenterCamera` | `true` | If activated any key you press will center the Camera. + `AutoZoomToMapSize` | `false` | If activated it auto zooms to map size. ## Compatibility ZoomLevel is compatible with Stardew Valley 1.5+ on Linux/Mac/Windows, both single-player, local co-op and multiplayer. diff --git a/ZoomLevel/ModConfig.cs b/ZoomLevel/ModConfig.cs index 86dd175..1781191 100644 --- a/ZoomLevel/ModConfig.cs +++ b/ZoomLevel/ModConfig.cs @@ -34,7 +34,8 @@ internal class ModConfig public bool SuppressControllerButton { get; set; } = true; public bool ZoomAndUIControlEverywhere { get; set; } = false; public bool IsHideUIWithCertainZoom { get; set; } = false; - public bool PressAnyButtonToCenterCamera { get; set; } = true; + + public bool AutoZoomToMapSize { get; set; } = false; } } \ No newline at end of file diff --git a/ZoomLevel/ModEntry.cs b/ZoomLevel/ModEntry.cs index 4c3e9fd..90e8256 100644 --- a/ZoomLevel/ModEntry.cs +++ b/ZoomLevel/ModEntry.cs @@ -21,8 +21,28 @@ public override void Entry(IModHelper helper) { configsForTheMod = helper.ReadConfig(); - helper.Events.GameLoop.GameLaunched += OnLaunched; + helper.Events.GameLoop.GameLaunched += this.OnLaunched; helper.Events.Input.ButtonPressed += this.Events_Input_ButtonPressed; + + //On area change and on load save + helper.Events.Player.Warped += this.Player_Warped; + helper.Events.GameLoop.DayStarted += this.GameLoop_DayStarted; + } + + private void GameLoop_DayStarted(object sender, DayStartedEventArgs e) + { + if (configsForTheMod.AutoZoomToMapSize == true) + { + ChangeZoomLevelToCurrentMapSize(); + } + } + + private void Player_Warped(object sender, WarpedEventArgs e) + { + if (configsForTheMod.AutoZoomToMapSize == true) + { + ChangeZoomLevelToCurrentMapSize(); + } } private void OnLaunched(object sender, GameLaunchedEventArgs e) @@ -64,6 +84,7 @@ private void OnLaunched(object sender, GameLaunchedEventArgs e) genericModConfigMenuAPI.AddBoolOption(ModManifest, () => configsForTheMod.ZoomAndUIControlEverywhere, (bool val) => configsForTheMod.ZoomAndUIControlEverywhere = val, () => Helper.Translation.Get("others.ZoomAndUIAnywhere.name"), () => Helper.Translation.Get("others.ZoomAndUIAnywhere.description")); genericModConfigMenuAPI.AddBoolOption(ModManifest, () => configsForTheMod.IsHideUIWithCertainZoom, (bool val) => configsForTheMod.IsHideUIWithCertainZoom = val, () => Helper.Translation.Get("others.HideUIWithCertainZoom.name"), () => Helper.Translation.Get("others.HideUIWithCertainZoom.description")); genericModConfigMenuAPI.AddBoolOption(ModManifest, () => configsForTheMod.PressAnyButtonToCenterCamera, (bool val) => configsForTheMod.PressAnyButtonToCenterCamera = val, () => Helper.Translation.Get("others.PressAnyButtonToCenterCamera.name"), () => Helper.Translation.Get("others.PressAnyButtonToCenterCamera.description")); + genericModConfigMenuAPI.AddBoolOption(ModManifest, () => configsForTheMod.AutoZoomToMapSize, (bool val) => configsForTheMod.AutoZoomToMapSize = val, () => Helper.Translation.Get("others.AutoZoomToMapSize.name"), () => Helper.Translation.Get("others.AutoZoomToMapSize.description")); } } diff --git a/ZoomLevel/i18n/default.json b/ZoomLevel/i18n/default.json index 9ab184e..957d7c3 100644 --- a/ZoomLevel/i18n/default.json +++ b/ZoomLevel/i18n/default.json @@ -55,5 +55,7 @@ "others.HideUIWithCertainZoom.description": "If activated your UI hides when it reaches a certain zoom level.\nIt can be changed by the 'Toggle Hide UI at Certain Zoom'.", "others.PressAnyButtonToCenterCamera.name": "Press Button to Center Camera", "others.PressAnyButtonToCenterCamera.description": "If activated your camera centers if any key is pressed.\nIf not, you will need to press the 'Reset Camera Movement' key.", + "others.AutoZoomToMapSize.name": "Auto Zoom to Map Size", + "others.AutoZoomToMapSize.description": "If activated it auto zooms to map size.\nIf not, it will not do that.", "hudMessages.HideUIWithCertainZoomIs.message": "Hide UI With Certain Zoom is now: {{value}}" } \ No newline at end of file diff --git a/ZoomLevel/i18n/en.json b/ZoomLevel/i18n/en.json index 9ab184e..957d7c3 100644 --- a/ZoomLevel/i18n/en.json +++ b/ZoomLevel/i18n/en.json @@ -55,5 +55,7 @@ "others.HideUIWithCertainZoom.description": "If activated your UI hides when it reaches a certain zoom level.\nIt can be changed by the 'Toggle Hide UI at Certain Zoom'.", "others.PressAnyButtonToCenterCamera.name": "Press Button to Center Camera", "others.PressAnyButtonToCenterCamera.description": "If activated your camera centers if any key is pressed.\nIf not, you will need to press the 'Reset Camera Movement' key.", + "others.AutoZoomToMapSize.name": "Auto Zoom to Map Size", + "others.AutoZoomToMapSize.description": "If activated it auto zooms to map size.\nIf not, it will not do that.", "hudMessages.HideUIWithCertainZoomIs.message": "Hide UI With Certain Zoom is now: {{value}}" } \ No newline at end of file