From aac7417b000836908cdfb829f653e2916dbc0e71 Mon Sep 17 00:00:00 2001 From: thespbgamer Date: Fri, 9 Apr 2021 08:55:39 +0100 Subject: [PATCH] Co-op Working. Increased Minimum Api Version --- ZoomLevel/ModEntry.cs | 25 +++++++++++++++++++++---- ZoomLevel/manifest.json | 4 ++-- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/ZoomLevel/ModEntry.cs b/ZoomLevel/ModEntry.cs index 76573ca..ad00049 100644 --- a/ZoomLevel/ModEntry.cs +++ b/ZoomLevel/ModEntry.cs @@ -68,13 +68,21 @@ private void ChangeZoomLevel(float amount = 0) //Caps Max Zoom Out Level Game1.options.singlePlayerBaseZoomLevel = Game1.options.singlePlayerBaseZoomLevel <= modConfigs.MaxZoomOutLevelValue ? modConfigs.MaxZoomOutLevelValue : Game1.options.singlePlayerBaseZoomLevel; + //Monitor Current Zoom Level //this.Monitor.Log($"{Game1.options.singlePlayerBaseZoomLevel}.", LogLevel.Debug); - Program.gamePtr.refreshWindowSettings(); } else if (Context.IsSplitScreen) { - //this.Monitor.Log("There's no support for splitscreen.", LogLevel.Info); + //Changes ZoomLevel + Game1.options.localCoopBaseZoomLevel = (float)Math.Round(Game1.options.localCoopBaseZoomLevel + amount, 2); + + //Caps Max Zoom In Level + Game1.options.localCoopBaseZoomLevel = Game1.options.localCoopBaseZoomLevel >= modConfigs.MaxZoomInLevelValue ? modConfigs.MaxZoomInLevelValue : Game1.options.localCoopBaseZoomLevel; + + //Caps Max Zoom Out Level + Game1.options.localCoopBaseZoomLevel = Game1.options.localCoopBaseZoomLevel <= modConfigs.MaxZoomOutLevelValue ? modConfigs.MaxZoomOutLevelValue : Game1.options.localCoopBaseZoomLevel; } + Program.gamePtr.refreshWindowSettings(); } private void ChangeUILevel(float amount = 0) @@ -90,13 +98,22 @@ private void ChangeUILevel(float amount = 0) //Caps Max UI Zoom Out Level Game1.options.singlePlayerDesiredUIScale = Game1.options.singlePlayerDesiredUIScale <= modConfigs.MaxZoomOutLevelValue ? modConfigs.MaxZoomOutLevelValue : Game1.options.singlePlayerDesiredUIScale; + //Monitor Current UI Level //this.Monitor.Log($"{Game1.options.singlePlayerDesiredUIScale}.", LogLevel.Debug); - Program.gamePtr.refreshWindowSettings(); } else if (Context.IsSplitScreen) { - //this.Monitor.Log("There's no support for splitscreen.", LogLevel.Info); + //Changes UI Zoom Level + Game1.options.localCoopDesiredUIScale = (float)Math.Round(Game1.options.localCoopDesiredUIScale + amount, 2); + + //Caps Max UI Zoom In Level + Game1.options.localCoopDesiredUIScale = Game1.options.localCoopDesiredUIScale >= modConfigs.MaxZoomInLevelValue ? modConfigs.MaxZoomInLevelValue : Game1.options.localCoopDesiredUIScale; + + //Caps Max UI Zoom Out Level + Game1.options.localCoopDesiredUIScale = Game1.options.localCoopDesiredUIScale <= modConfigs.MaxZoomOutLevelValue ? modConfigs.MaxZoomOutLevelValue : Game1.options.localCoopDesiredUIScale; } + + Program.gamePtr.refreshWindowSettings(); } } } \ No newline at end of file diff --git a/ZoomLevel/manifest.json b/ZoomLevel/manifest.json index 793da7f..e5b80d4 100644 --- a/ZoomLevel/manifest.json +++ b/ZoomLevel/manifest.json @@ -1,10 +1,10 @@ { "Name": "ZoomLevel", "Author": "thespbgamer", - "Version": "1.3.0", + "Version": "1.4.0", "Description": "Mod that changes the zoom level with a simple keybind.", "UniqueID": "thespbgamer.ZoomLevel", "EntryDll": "ZoomLevel.dll", - "MinimumApiVersion": "3.9.0", + "MinimumApiVersion": "3.9.5", "UpdateKeys": [ "GitHub:thespbgamer/ZoomLevel", "Nexus:7363" ] } \ No newline at end of file