Added "DisableMenus" map tag

When set to 1, prevents the player from opening the start menu or accessing the PokéGear.
This commit is contained in:
JappaWakka 2024-04-29 16:56:47 +02:00
parent ee05af333c
commit 1a7e08d361
3 changed files with 20 additions and 2 deletions

@ -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

@ -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
''' <summary>
''' If the player should be prevented from opening the start menu or accessing the PokéGear..
''' </summary>
Public Property DisableMenus As Boolean
Get
Return Me._disableMenus
End Get
Set(value As Boolean)
Me._disableMenus = value
End Set
End Property
''' <summary>
''' The environment type for this map.
''' </summary>

@ -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"))