From 1a7e08d36145ad80a3d185adfbb2344ff4c0a523 Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Mon, 29 Apr 2024 16:56:47 +0200 Subject: [PATCH] Added "DisableMenus" map tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When set to 1, prevents the player from opening the start menu or accessing the PokéGear. --- P3D/Overworld/OverworldScreen.vb | 4 ++-- P3D/World/Level.vb | 13 +++++++++++++ P3D/World/LevelLoader.vb | 5 +++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/P3D/Overworld/OverworldScreen.vb b/P3D/Overworld/OverworldScreen.vb index 07779c543..2cac597b6 100644 --- a/P3D/Overworld/OverworldScreen.vb +++ b/P3D/Overworld/OverworldScreen.vb @@ -227,7 +227,7 @@ Public Class OverworldScreen 'Open the MenuScreen: If KeyBoardHandler.KeyPressed(KeyBindings.OpenInventoryKey) = True Or ControllerHandler.ButtonPressed(Buttons.X) = True Then - If Screen.Camera.IsMoving() = False And ActionScript.IsReady = True Then + If Screen.Camera.IsMoving() = False And ActionScript.IsReady = True AndAlso Screen.Level.DisableMenus = False Then Level.RouteSign.Hide() SoundManager.PlaySound("menu_open") Core.SetScreen(New NewMenuScreen(Me)) @@ -240,7 +240,7 @@ Public Class OverworldScreen NotificationPopupList(0).Dismiss() Else If Core.Player.HasPokegear = True Or GameController.IS_DEBUG_ACTIVE = True Or Core.Player.SandBoxMode = True Then - If Screen.Camera.IsMoving() = False And ActionScript.IsReady = True AndAlso Screen.Level.SaveOnly = False AndAlso Screen.Level.IsBugCatchingContest = False Then + If Screen.Camera.IsMoving() = False And ActionScript.IsReady = True AndAlso Screen.Level.SaveOnly = False AndAlso Screen.Level.DisableMenus = False AndAlso Screen.Level.IsBugCatchingContest = False Then Core.SetScreen(New GameJolt.PokegearScreen(Me, GameJolt.PokegearScreen.EntryModes.MainMenu, {})) End If End If diff --git a/P3D/World/Level.vb b/P3D/World/Level.vb index f7f3a60c9..ba02c7157 100644 --- a/P3D/World/Level.vb +++ b/P3D/World/Level.vb @@ -42,6 +42,7 @@ Public Class Level Public _DayTime As World.DayTimes = World.GetTime Private _environmentType As Integer = 0 Private _saveonly As Boolean = False + Private _disableMenus As Boolean = False Private _wildPokemonGrass As Boolean = True Private _wildPokemonFloor As Boolean = False Private _wildPokemonWater As Boolean = True @@ -394,6 +395,18 @@ Public Class Level End Set End Property + ''' + ''' If the player should be prevented from opening the start menu or accessing the PokéGear.. + ''' + Public Property DisableMenus As Boolean + Get + Return Me._disableMenus + End Get + Set(value As Boolean) + Me._disableMenus = value + End Set + End Property + ''' ''' The environment type for this map. ''' diff --git a/P3D/World/LevelLoader.vb b/P3D/World/LevelLoader.vb index 99b1c2787..6995da1e3 100644 --- a/P3D/World/LevelLoader.vb +++ b/P3D/World/LevelLoader.vb @@ -1021,6 +1021,11 @@ Else Screen.Level.SaveOnly = False End If + If TagExists(Tags, "DisableMenus") = True Then + Screen.Level.DisableMenus = CBool(GetTag(Tags, "DisableMenus")) + Else + Screen.Level.DisableMenus = False + End If If _reload = False Then If TagExists(Tags, "EnvironmentType") = True Then Screen.Level.EnvironmentType = CInt(GetTag(Tags, "EnvironmentType"))