From a85849a52c5d7a8d3ee5132b24203936d9fc255b Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Sun, 17 Oct 2021 17:44:01 +0200 Subject: [PATCH] Added @screen.showimage(texture,[sound],[x],[y],[w],[h]) command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- P3D/Battle/BattleSystemV2/BattleScreen.vb | 1 + .../Data/Scripts/pewter/Fossil_Aerodactyl.dat | Bin 0 -> 262 bytes .../Data/Scripts/pewter/Fossil_Kabutops.dat | Bin 0 -> 254 bytes P3D/Content/Data/maps/pewter/museum.dat | Bin 52288 -> 52196 bytes .../Pokemon/Sprites/Aerodactyl_Fossil.png | Bin 0 -> 1816 bytes .../Pokemon/Sprites/Kabutops_Fossil.png | Bin 0 -> 1913 bytes P3D/Dialogues/ImageView.vb | 48 ++++++++++++++++++ P3D/Overworld/OverworldScreen.vb | 6 ++- P3D/P3D.vbproj | 13 +++++ P3D/Screens/Credits/CreditsScreen.vb | 1 + P3D/Screens/Inventory/NewInventoryScreen.vb | 6 ++- P3D/Screens/MainMenu/NewNewGameScreen.vb | 6 ++- P3D/Screens/MainMenu/PressStartScreen.vb | 1 + P3D/Screens/PC/HallOfFameScreen.vb | 1 + P3D/Screens/Pokemon/NameObjectScreen.vb | 1 + P3D/Screens/Screen.vb | 4 ++ .../V2/ScriptCommands/DoScreen.vb | 13 +++++ 17 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 P3D/Content/Data/Scripts/pewter/Fossil_Aerodactyl.dat create mode 100644 P3D/Content/Data/Scripts/pewter/Fossil_Kabutops.dat create mode 100644 P3D/Content/Pokemon/Sprites/Aerodactyl_Fossil.png create mode 100644 P3D/Content/Pokemon/Sprites/Kabutops_Fossil.png create mode 100644 P3D/Dialogues/ImageView.vb diff --git a/P3D/Battle/BattleSystemV2/BattleScreen.vb b/P3D/Battle/BattleSystemV2/BattleScreen.vb index d7cec07ae..7907cb230 100644 --- a/P3D/Battle/BattleSystemV2/BattleScreen.vb +++ b/P3D/Battle/BattleSystemV2/BattleScreen.vb @@ -149,6 +149,7 @@ Screen.TextBox.Showing = False Screen.PokemonImageView.Showing = False + Screen.ImageView.Showing = False Screen.ChooseBox.Showing = False Effect = New BasicEffect(Core.GraphicsDevice) diff --git a/P3D/Content/Data/Scripts/pewter/Fossil_Aerodactyl.dat b/P3D/Content/Data/Scripts/pewter/Fossil_Aerodactyl.dat new file mode 100644 index 0000000000000000000000000000000000000000..35a73cc59b1319373887ab0e36dc12641ca766ff GIT binary patch literal 262 zcmZvXy$ZrW5QL`|e1|Jzlfp6}Xk#syG9V!aJ@ih=i9e0+o0m|(90wxE7I!;4!?*i> zUDc{nkkv_EGfg$tNOP11y`{Wzx;^t7E~i>M)J!Xs13wp&mDW0wu)3fHRa)?N%(f&N z)Q67RXo(UiOE*cZ66YPqmy`WXo1gR(k4a1yxmLq92A+p%px5yRlXmUXu6ZICxCiG4 DukpVlz@obA@`mi&dK|A zrKBccsql;$(x=Bn$WC~v@#MOW;%`zpHXMXzEQFl2xz1Uz- znQ03e%b7vSSxJ4D=9`iIIn9sr!4#9ST$g8wzc9-4?Df{#Vt11|K2yg$rH;f!wgZasH<_%0ICvV6!n{2R!PtlDbpP?8CGZ}Ii;u#znQW=VXA}I`s49N^743!Ky olOOJ%I9ct~JD3hxR2|+xl}QYxK(+Y{1q{U?)jY8bwLl0V0Z|Ae0{{R3 delta 217 zcmaDdo%z5F<_%0ICx5Uri*;m3Whi3EXGmd4WJqQxVW?!tVNhUj1Bw&_VJ47Q$KVJQ zDFCXQVse$OGzA0Lml+F-Rl;s4tu0B~V>HP)=|1!~GK{|2X*$WK*O! VP*oB`DNuht(6nNpYU5l!)@n@s7mF^`o_94jX9gmK`KAn=F_JR zi&;uY%sjb%h_@-Q=hyyb>FF6(dmGLK!;f&l2*N1=H{c4x?*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prites/Kabutops_Fossil.png new file mode 100644 index 0000000000000000000000000000000000000000..413364742e4838d6011611a65e2a6a0360eaf561 GIT binary patch literal 1913 zcmc&#={pmO4@ ze-7N=dAmb17-q+mtS*+N{K2y~gyGbEXcyE0jPU>p;UIt$(1T*-!7Xqe#?SzY|Cbb2 zF5r^B%(Ls8gxURP*qk_c=NjSbMA7~YTl#+1F9Al-0$o6)Jx$W?2-XBiP;9Y@229-( zuoe^;Cn3Z$bOA6lDS9dQ_musP40MjUdxJgK$fvJv(VDH;R>=R>@RJT4@LG4WLu>l>Z0+r?B^6jv*#5dc2vzg2fAA^`oCRu+tIy6SiJr2knr?%TMl>7D;HX{~; z#f>qvWS!9f&8J^Eg#o5YSIy^|ZJUWRkiIpcr#9#|<^KTw@Em+E+`121wFX5Q$?YRb zU?J5+V{QITWD;+q0R=^2#~kU`0AqVJ!0~nU!#w$e*p(ocV=N_+HwsG-kx%peO751f z)K9Y>ES==2fSGo)|GsThh*^7&uK3a(Zgy7Z1~Xp9K>q@x9J#G|5E7d!rwHoZme6|#2l z-Oo}~ils6*glj2jzL2B+>(coYx?@lb3+07_HIZjwBUw4P{#*R}kaSo3{4|DI_}K+v zYpCF_YJ#cdcf+6e^gxC43)+i)iO^~)2zv$6X{=VOhDg{neyKfc1p)mBo@I6@E&_!c zt7OE1a8dlvrw*krCXwm*x>0@UqBDv{o#c~*n1;v3w^qk(ocTxwGgG?;N#L2kG78C$ zIGejH0~N)8vNaTPR_eINNxNZA<#kNnM7D)h2W|fptyBh6A~UyAm#?ZOWylHRxgK|9 zEsSac0BiZ+yQzyIee|^t5xpX@xMKEuUt%;IObL6lq&>loU}Mw;{ght=WClf0RQd^- zg)m*4V=g{$9he0gbWeZC+~sZ5V*&i}vYZ@0v(n5sB@3bq+dX-cec}Zzjr?L?RmyTz zv;Z)@C-o2MLaK*A~CGx^gWe%nzmHjPF z@CD$QL1Y2J6S{deI;g@I2DxEuL{{xFf1n(D7_ipqP@=C=a!=(C94^cjo`z`e#tc+e ztrh~kr%UVS1RJC6ySVO04o(l4mEuB%Q?}=%worrFd|}M+2CC&|9FD1!gmcVa}$ydS0^t+*ibOu9*(gXvz*FHQ!SaskFESfTIz#{ z$C}Omg0caYvSDtL(-XmIH4Jnd@>Fb^xlq!Qqhq!%r#WQTquRB1_tKs-R5hNut&t5m*oP pruF^h^}}3{(dCT(U+>1c@&F7)j$bv?(fsl@ft!;DzQKW*@eiJ2Jjnn6 literal 0 HcmV?d00001 diff --git a/P3D/Dialogues/ImageView.vb b/P3D/Dialogues/ImageView.vb new file mode 100644 index 000000000..ac5d68e09 --- /dev/null +++ b/P3D/Dialogues/ImageView.vb @@ -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 \ No newline at end of file diff --git a/P3D/Overworld/OverworldScreen.vb b/P3D/Overworld/OverworldScreen.vb index 191cee38e..ce59ed7dc 100644 --- a/P3D/Overworld/OverworldScreen.vb +++ b/P3D/Overworld/OverworldScreen.vb @@ -187,6 +187,9 @@ Public Class OverworldScreen If PokemonImageView.Showing = True Then PokemonImageView.Update() End If + If ImageView.Showing = True Then + ImageView.Update() + End If 'Middle click/Thumbstick press: Show first Pokémon in party. If ActionScript.IsReady = True Then @@ -198,7 +201,7 @@ Public Class OverworldScreen End If '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 ActionScript.IsReady = True And LevelLoader.MapScript = "" Then If Me.HandleServerRequests() = True Then @@ -333,6 +336,7 @@ Public Class OverworldScreen DrawGUI() PokemonImageView.Draw() + ImageView.Draw() TextBox.Draw() 'Only draw the ChooseBox when it's the current screen, cause the same ChooseBox might get used on other screens. diff --git a/P3D/P3D.vbproj b/P3D/P3D.vbproj index 83a17f63c..709711a50 100644 --- a/P3D/P3D.vbproj +++ b/P3D/P3D.vbproj @@ -13966,6 +13966,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest @@ -14011,6 +14014,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest @@ -27529,6 +27535,7 @@ + @@ -28579,6 +28586,12 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + PreserveNewest diff --git a/P3D/Screens/Credits/CreditsScreen.vb b/P3D/Screens/Credits/CreditsScreen.vb index d09b21dd8..f1d35785c 100644 --- a/P3D/Screens/Credits/CreditsScreen.vb +++ b/P3D/Screens/Credits/CreditsScreen.vb @@ -31,6 +31,7 @@ Public Class CreditsScreen Screen.TextBox.Showing = False Screen.PokemonImageView.Showing = False + Screen.ImageView.Showing = False Screen.ChooseBox.Showing = False Effect = New BasicEffect(Core.GraphicsDevice) diff --git a/P3D/Screens/Inventory/NewInventoryScreen.vb b/P3D/Screens/Inventory/NewInventoryScreen.vb index 31d65e3d5..9d6c66594 100644 --- a/P3D/Screens/Inventory/NewInventoryScreen.vb +++ b/P3D/Screens/Inventory/NewInventoryScreen.vb @@ -208,6 +208,7 @@ Public Class NewInventoryScreen DrawMessage() PokemonImageView.Draw() + ImageView.Draw() TextBox.Draw() ChooseBox.Draw() @@ -654,7 +655,7 @@ Public Class NewInventoryScreen UpdateShakeAnimation() ' 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 UpdateTabs() @@ -676,6 +677,9 @@ Public Class NewInventoryScreen If PokemonImageView.Showing = True Then PokemonImageView.Update() End If + If ImageView.Showing = True Then + ImageView.Update() + End If UpdateInfoAnimation() End If diff --git a/P3D/Screens/MainMenu/NewNewGameScreen.vb b/P3D/Screens/MainMenu/NewNewGameScreen.vb index fbb73b095..7c772c929 100644 --- a/P3D/Screens/MainMenu/NewNewGameScreen.vb +++ b/P3D/Screens/MainMenu/NewNewGameScreen.vb @@ -55,9 +55,12 @@ If PokemonImageView.Showing = True Then PokemonImageView.Update() End If + If ImageView.Showing = True Then + ImageView.Update() + End If '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 Camera.Update() Level.Update() @@ -98,6 +101,7 @@ Level.Draw() PokemonImageView.Draw() + ImageView.Draw() TextBox.Draw() 'Only draw the ChooseBox when it's the current screen, cause the same ChooseBox might get used on other screens. diff --git a/P3D/Screens/MainMenu/PressStartScreen.vb b/P3D/Screens/MainMenu/PressStartScreen.vb index d7440bb55..be259f82e 100644 --- a/P3D/Screens/MainMenu/PressStartScreen.vb +++ b/P3D/Screens/MainMenu/PressStartScreen.vb @@ -39,6 +39,7 @@ Public Class PressStartScreen TextBox.Showing = False PokemonImageView.Showing = False + ImageView.Showing = False ChooseBox.Showing = False GameModeManager.SetGameModePointer("Kolben") diff --git a/P3D/Screens/PC/HallOfFameScreen.vb b/P3D/Screens/PC/HallOfFameScreen.vb index e5e6a0e85..bb255df0c 100644 --- a/P3D/Screens/PC/HallOfFameScreen.vb +++ b/P3D/Screens/PC/HallOfFameScreen.vb @@ -134,6 +134,7 @@ If Me.loadedLevel = False Then Screen.TextBox.Showing = False Screen.PokemonImageView.Showing = False + Screen.ImageView.Showing = False Screen.ChooseBox.Showing = False Effect = New BasicEffect(Core.GraphicsDevice) diff --git a/P3D/Screens/Pokemon/NameObjectScreen.vb b/P3D/Screens/Pokemon/NameObjectScreen.vb index aecf291f2..2705d9996 100644 --- a/P3D/Screens/Pokemon/NameObjectScreen.vb +++ b/P3D/Screens/Pokemon/NameObjectScreen.vb @@ -152,6 +152,7 @@ Public Class NameObjectScreen End If PokemonImageView.Draw() + ImageView.Draw() End Sub Private Function TextboxPosition() As Vector2 diff --git a/P3D/Screens/Screen.vb b/P3D/Screens/Screen.vb index ba3b5bbda..a0b48825e 100644 --- a/P3D/Screens/Screen.vb +++ b/P3D/Screens/Screen.vb @@ -146,6 +146,10 @@ Public MustInherit Class Screen ''' A global PokemonImageView instance, that carries over screen instances. ''' Public Shared Property PokemonImageView() As PokemonImageView = New PokemonImageView() + ''' + ''' A global ImageView instance, that carries over screen instances. + ''' + Public Shared Property ImageView() As ImageView = New ImageView() #End Region diff --git a/P3D/World/ActionScript/V2/ScriptCommands/DoScreen.vb b/P3D/World/ActionScript/V2/ScriptCommands/DoScreen.vb index 755f17448..44f64c12f 100644 --- a/P3D/World/ActionScript/V2/ScriptCommands/DoScreen.vb +++ b/P3D/World/ActionScript/V2/ScriptCommands/DoScreen.vb @@ -110,6 +110,19 @@ Screen.PokemonImageView.Show(PokemonID, Shiny, Front) 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 Case "credits" Dim ending As String = "Johto"