Skip to content

Commit

Permalink
Fixed Camera Issues
Browse files Browse the repository at this point in the history
Updated Changelog
  • Loading branch information
thespbgamer committed Feb 2, 2023
1 parent 5a6a2d6 commit bc75c60
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Full Changelog

## [Unreleased] - ????-??-??

## [2.0.1] - 2023-02-02

### Changed

- Minimum SMAPI version to 3.18.2

### Fixed

- Camera movement issues with some mods


## [2.0.0] - 2023-02-01

### Added
Expand All @@ -24,7 +37,7 @@

### Changed

- Minimum API version to 3.18.1
- Minimum SMAPI version to 3.18.1


## [1.13.0] - 2022-07-24
Expand Down Expand Up @@ -178,7 +191,8 @@

- Initial release

[Unreleased]: https://github.com/thespbgamer/ZoomLevel/compare/2.0.0...HEAD
[Unreleased]: https://github.com/thespbgamer/ZoomLevel/compare/2.0.1...HEAD
[2.0.1]: https://github.com/thespbgamer/ZoomLevel/releases/tag/2.0.1
[2.0.0]: https://github.com/thespbgamer/ZoomLevel/releases/tag/2.0.0
[1.15.0]: https://github.com/thespbgamer/ZoomLevel/releases/tag/1.15.0
[1.14.0]: https://github.com/thespbgamer/ZoomLevel/releases/tag/1.14.0
Expand Down
9 changes: 8 additions & 1 deletion ZoomLevel/ModEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class ModEntry : Mod
private bool wasThePreviousButtonPressSucessfull;
private bool wasToggleUIScaleClicked;
private bool wasZoomLevelChanged;
private bool wasCameraFrozen;

private float uiScaleBeforeTheHidding;
private float currentUIScale;
Expand Down Expand Up @@ -82,6 +83,7 @@ private void GameLoop_SaveLoaded(object sender, SaveLoadedEventArgs e)
wasThePreviousButtonPressSucessfull = false;
wasToggleUIScaleClicked = false;
wasZoomLevelChanged = false;
wasCameraFrozen = false;

if (configsForTheMod.AutoZoomToMapSize == true)
{
Expand Down Expand Up @@ -193,6 +195,7 @@ private void Events_Input_ButtonPressed(object sender, ButtonPressedEventArgs e)
{
if (Game1.viewport.Y > 0)
{
wasCameraFrozen = true;
Game1.viewportFreeze = true;
Game1.viewport.Y -= configsForTheMod.CameraMovementSpeed;
}
Expand All @@ -202,6 +205,7 @@ private void Events_Input_ButtonPressed(object sender, ButtonPressedEventArgs e)
{
if (Game1.viewport.Y < Game1.currentLocation.map.DisplayHeight - Game1.viewport.Height)
{
wasCameraFrozen = true;
Game1.viewportFreeze = true;
Game1.viewport.Y += configsForTheMod.CameraMovementSpeed;
}
Expand All @@ -211,6 +215,7 @@ private void Events_Input_ButtonPressed(object sender, ButtonPressedEventArgs e)
{
if (Game1.viewport.X > 0)
{
wasCameraFrozen = true;
Game1.viewportFreeze = true;
Game1.viewport.X -= configsForTheMod.CameraMovementSpeed;
}
Expand All @@ -220,13 +225,15 @@ private void Events_Input_ButtonPressed(object sender, ButtonPressedEventArgs e)
{
if (Game1.viewport.X < Game1.currentLocation.map.DisplayWidth - Game1.viewport.Width)
{
wasCameraFrozen = true;
Game1.viewportFreeze = true;
Game1.viewport.X += configsForTheMod.CameraMovementSpeed;
}
wasThePreviousButtonPressSucessfull = true;
}
else if (Game1.viewportFreeze == true && (configsForTheMod.KeybindListResetCameraMovement.JustPressed() || configsForTheMod.PressAnyButtonToCenterCamera == true))
else if (wasCameraFrozen == true && Game1.viewportFreeze == true && (configsForTheMod.KeybindListResetCameraMovement.JustPressed() || configsForTheMod.PressAnyButtonToCenterCamera == true))
{
wasCameraFrozen = false;
Game1.viewportFreeze = false;
wasThePreviousButtonPressSucessfull = true;
}
Expand Down
2 changes: 1 addition & 1 deletion ZoomLevel/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Name": "Zoom Level",
"Author": "thespbgamer",
"Version": "2.0.0",
"Version": "2.0.1",
"Description": "Change the Zoom and UI levels with a simple keybind.Now with camera position change!",
"UniqueID": "thespbgamer.ZoomLevel",
"EntryDll": "ZoomLevel.dll",
Expand Down

0 comments on commit bc75c60

Please sign in to comment.