Added @screen.showimage(texture,[sound],[x],[y],[w],[h]) command

To show an image like with @screen.showpokemon but one that's not necessarily the texture of a Pokémon, like the fossils at Pewter City, which I've also added textures for. Arguments in the title of this commit between brackets are optional.
This commit is contained in:
JappaWakka 2021-10-17 17:44:01 +02:00
parent 43f3e8ef6a
commit a85849a52c
17 changed files with 98 additions and 3 deletions

View File

@ -149,6 +149,7 @@
Screen.TextBox.Showing = False Screen.TextBox.Showing = False
Screen.PokemonImageView.Showing = False Screen.PokemonImageView.Showing = False
Screen.ImageView.Showing = False
Screen.ChooseBox.Showing = False Screen.ChooseBox.Showing = False
Effect = New BasicEffect(Core.GraphicsDevice) Effect = New BasicEffect(Core.GraphicsDevice)

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,48 @@
Public Class ImageView
Public Showing As Boolean = False
Public Delay As Single = 0.0F
Dim Texture As Texture2D
Public Sub Show(ByVal Texture As Texture2D, ByVal Sound As String)
Me.Delay = 8.0F
Me.Showing = True
If Sound <> "" Then
SoundManager.PlaySound(Sound)
End If
Me.Texture = Texture
End Sub
Public Sub Update()
If Delay > 0.0F Then
Delay -= 0.1F
If Delay <= 0.0F Then
Delay = 0.0F
End If
ElseIf Delay = 0.0F Then
If Controls.Accept() = True Or Controls.Dismiss() = True Then
Me.Showing = False
SoundManager.PlaySound("select")
End If
End If
End Sub
Public Sub Draw()
If Me.Showing = True Then
Dim p As Vector2 = Core.GetMiddlePosition(New Size(320, 320))
Canvas.DrawImageBorder(TextureManager.GetTexture("GUI\Menus\Menu", New Rectangle(0, 0, 48, 48), ""), 2, New Rectangle(CInt(p.X), CInt(p.Y), 320, 320))
Core.SpriteBatch.Draw(Me.Texture, New Rectangle(CInt(p.X) - 15, CInt(p.Y) - 90, 384, 384), Color.White)
If Me.Delay = 0.0F Then
Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Overworld\TextBox"), New Rectangle(CInt(p.X) + 144 + 160, CInt(p.Y) + 144 + 160 + 32, 16, 16), New Rectangle(0, 48, 16, 16), Color.White)
End If
End If
End Sub
End Class

View File

@ -187,6 +187,9 @@ Public Class OverworldScreen
If PokemonImageView.Showing = True Then If PokemonImageView.Showing = True Then
PokemonImageView.Update() PokemonImageView.Update()
End If End If
If ImageView.Showing = True Then
ImageView.Update()
End If
'Middle click/Thumbstick press: Show first Pokémon in party. 'Middle click/Thumbstick press: Show first Pokémon in party.
If ActionScript.IsReady = True Then If ActionScript.IsReady = True Then
@ -198,7 +201,7 @@ Public Class OverworldScreen
End If End If
'If no dialogue is showing, do level update tasks: 'If no dialogue is showing, do level update tasks:
If TextBox.Showing = False And ChooseBox.Showing = False And PokemonImageView.Showing = False Then If TextBox.Showing = False And ChooseBox.Showing = False And PokemonImageView.Showing = False And ImageView.Showing = False Then
'If no script is running and no MapScript is in the queue, update camera and the level. 'If no script is running and no MapScript is in the queue, update camera and the level.
If ActionScript.IsReady = True And LevelLoader.MapScript = "" Then If ActionScript.IsReady = True And LevelLoader.MapScript = "" Then
If Me.HandleServerRequests() = True Then If Me.HandleServerRequests() = True Then
@ -333,6 +336,7 @@ Public Class OverworldScreen
DrawGUI() DrawGUI()
PokemonImageView.Draw() PokemonImageView.Draw()
ImageView.Draw()
TextBox.Draw() TextBox.Draw()
'Only draw the ChooseBox when it's the current screen, cause the same ChooseBox might get used on other screens. 'Only draw the ChooseBox when it's the current screen, cause the same ChooseBox might get used on other screens.

View File

@ -13966,6 +13966,9 @@
<Content Include="Content\Pokemon\Overworld\Shiny\89_alola.png"> <Content Include="Content\Pokemon\Overworld\Shiny\89_alola.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Content\Pokemon\Sprites\Aerodactyl_Fossil.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Pokemon\Sprites\Arctovish.png"> <Content Include="Content\Pokemon\Sprites\Arctovish.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
@ -14011,6 +14014,9 @@
<Content Include="Content\Pokemon\Sprites\Grimer_alola.png"> <Content Include="Content\Pokemon\Sprites\Grimer_alola.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Content\Pokemon\Sprites\Kabutops_Fossil.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Pokemon\Sprites\Marowak_alola.png"> <Content Include="Content\Pokemon\Sprites\Marowak_alola.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
@ -27529,6 +27535,7 @@
<Compile Include="Battle\BattleAnimations\BABillSize.vb" /> <Compile Include="Battle\BattleAnimations\BABillSize.vb" />
<Compile Include="Battle\BattleAnimations\BASound.vb" /> <Compile Include="Battle\BattleAnimations\BASound.vb" />
<Compile Include="Battle\BattleSystemV2\QueryObjects\AnimationQueryObject.vb" /> <Compile Include="Battle\BattleSystemV2\QueryObjects\AnimationQueryObject.vb" />
<Compile Include="Dialogues\ImageView.vb" />
<Compile Include="Pokemon\Abilities\Aerilate.vb" /> <Compile Include="Pokemon\Abilities\Aerilate.vb" />
<Compile Include="Pokemon\Abilities\PsychicSurge.vb" /> <Compile Include="Pokemon\Abilities\PsychicSurge.vb" />
<Compile Include="Pokemon\Abilities\MistySurge.vb" /> <Compile Include="Pokemon\Abilities\MistySurge.vb" />
@ -28579,6 +28586,12 @@
<Content Include="Content\Data\Scripts\seafoam\articunomap.dat"> <Content Include="Content\Data\Scripts\seafoam\articunomap.dat">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<None Include="Content\Data\Scripts\pewter\Fossil_Aerodactyl.dat">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Data\Scripts\pewter\Fossil_Kabutops.dat">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Data\Scripts\tohjofalls\jjm.dat"> <None Include="Content\Data\Scripts\tohjofalls\jjm.dat">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>

View File

@ -31,6 +31,7 @@ Public Class CreditsScreen
Screen.TextBox.Showing = False Screen.TextBox.Showing = False
Screen.PokemonImageView.Showing = False Screen.PokemonImageView.Showing = False
Screen.ImageView.Showing = False
Screen.ChooseBox.Showing = False Screen.ChooseBox.Showing = False
Effect = New BasicEffect(Core.GraphicsDevice) Effect = New BasicEffect(Core.GraphicsDevice)

View File

@ -208,6 +208,7 @@ Public Class NewInventoryScreen
DrawMessage() DrawMessage()
PokemonImageView.Draw() PokemonImageView.Draw()
ImageView.Draw()
TextBox.Draw() TextBox.Draw()
ChooseBox.Draw() ChooseBox.Draw()
@ -654,7 +655,7 @@ Public Class NewInventoryScreen
UpdateShakeAnimation() UpdateShakeAnimation()
' Input update: ' Input update:
If TextBox.Showing = False And ChooseBox.Showing = False And PokemonImageView.Showing = False Then If TextBox.Showing = False And ChooseBox.Showing = False And PokemonImageView.Showing = False And ImageView.Showing = False Then
Dim isTabsSelected = _tabInControl Dim isTabsSelected = _tabInControl
UpdateTabs() UpdateTabs()
@ -676,6 +677,9 @@ Public Class NewInventoryScreen
If PokemonImageView.Showing = True Then If PokemonImageView.Showing = True Then
PokemonImageView.Update() PokemonImageView.Update()
End If End If
If ImageView.Showing = True Then
ImageView.Update()
End If
UpdateInfoAnimation() UpdateInfoAnimation()
End If End If

View File

@ -55,9 +55,12 @@
If PokemonImageView.Showing = True Then If PokemonImageView.Showing = True Then
PokemonImageView.Update() PokemonImageView.Update()
End If End If
If ImageView.Showing = True Then
ImageView.Update()
End If
'If no dialogue is showing, do level update tasks: 'If no dialogue is showing, do level update tasks:
If TextBox.Showing = False And ChooseBox.Showing = False And PokemonImageView.Showing = False Then If TextBox.Showing = False And ChooseBox.Showing = False And PokemonImageView.Showing = False And ImageView.Showing = False Then
If Me.ActionScript.IsReady Then If Me.ActionScript.IsReady Then
Camera.Update() Camera.Update()
Level.Update() Level.Update()
@ -98,6 +101,7 @@
Level.Draw() Level.Draw()
PokemonImageView.Draw() PokemonImageView.Draw()
ImageView.Draw()
TextBox.Draw() TextBox.Draw()
'Only draw the ChooseBox when it's the current screen, cause the same ChooseBox might get used on other screens. 'Only draw the ChooseBox when it's the current screen, cause the same ChooseBox might get used on other screens.

View File

@ -39,6 +39,7 @@ Public Class PressStartScreen
TextBox.Showing = False TextBox.Showing = False
PokemonImageView.Showing = False PokemonImageView.Showing = False
ImageView.Showing = False
ChooseBox.Showing = False ChooseBox.Showing = False
GameModeManager.SetGameModePointer("Kolben") GameModeManager.SetGameModePointer("Kolben")

View File

@ -134,6 +134,7 @@
If Me.loadedLevel = False Then If Me.loadedLevel = False Then
Screen.TextBox.Showing = False Screen.TextBox.Showing = False
Screen.PokemonImageView.Showing = False Screen.PokemonImageView.Showing = False
Screen.ImageView.Showing = False
Screen.ChooseBox.Showing = False Screen.ChooseBox.Showing = False
Effect = New BasicEffect(Core.GraphicsDevice) Effect = New BasicEffect(Core.GraphicsDevice)

View File

@ -152,6 +152,7 @@ Public Class NameObjectScreen
End If End If
PokemonImageView.Draw() PokemonImageView.Draw()
ImageView.Draw()
End Sub End Sub
Private Function TextboxPosition() As Vector2 Private Function TextboxPosition() As Vector2

View File

@ -146,6 +146,10 @@ Public MustInherit Class Screen
''' A global PokemonImageView instance, that carries over screen instances. ''' A global PokemonImageView instance, that carries over screen instances.
''' </summary> ''' </summary>
Public Shared Property PokemonImageView() As PokemonImageView = New PokemonImageView() Public Shared Property PokemonImageView() As PokemonImageView = New PokemonImageView()
''' <summary>
''' A global ImageView instance, that carries over screen instances.
''' </summary>
Public Shared Property ImageView() As ImageView = New ImageView()
#End Region #End Region

View File

@ -110,6 +110,19 @@
Screen.PokemonImageView.Show(PokemonID, Shiny, Front) Screen.PokemonImageView.Show(PokemonID, Shiny, Front)
IsReady = True IsReady = True
CanContinue = False
Case "showimage"
Dim Texture As Texture2D = TextureManager.GetTexture(argument.GetSplit(0))
Dim Sound As String = ""
If argument.Split.Count > 1 Then
Sound = argument.GetSplit(1)
If argument.Split.Count > 2 Then
Texture = TextureManager.GetTexture(argument.GetSplit(0), New Rectangle(int(argument.GetSplit(2)), int(argument.GetSplit(3)), int(argument.GetSplit(4)), int(argument.GetSplit(5))), "")
End If
End If
Screen.ImageView.Show(Texture, Sound)
IsReady = True
CanContinue = False CanContinue = False
Case "credits" Case "credits"
Dim ending As String = "Johto" Dim ending As String = "Johto"