Clean up trading screen a little

This commit is contained in:
JappaWakka 2025-02-28 11:03:36 +01:00
parent a7bb36f10c
commit 9be1e7838b

View File

@ -524,7 +524,7 @@ Public Class TradeScreen
BuyItemsList.Add(i) BuyItemsList.Add(i)
End If End If
Next Next
Me.BuyItemsList = (From i As TradeItem In BuyItemsList Order By i.GetItem().Name).ToList() Me.BuyItemsList = (From i As TradeItem In BuyItemsList Order By i.GetItem().OneLineName).ToList()
End Sub End Sub
Private Sub UpdateBuyItems() Private Sub UpdateBuyItems()
@ -598,7 +598,7 @@ Public Class TradeScreen
End If End If
' Buy button: ' Buy button:
If New Rectangle(664 + 64, 484 + 64 + 22, 64 * 3, 64).Contains(MouseHandler.MousePosition) = True Then If New Rectangle(664 + 32, 484 + 64 + 22, 64 * 3, 64).Contains(MouseHandler.MousePosition) = True Then
Me.ButtonBuyItemsBuy() Me.ButtonBuyItemsBuy()
End If End If
End If End If
@ -739,7 +739,7 @@ Public Class TradeScreen
If i <= Me.BuyItemsList.Count - 1 Then If i <= Me.BuyItemsList.Count - 1 Then
Dim p As Integer = i - Scroll Dim p As Integer = i - Scroll
DrawButton(New Vector2(100, 100 + p * 96), 5, Me.BuyItemsList(i).GetItem().Name, 16, Me.BuyItemsList(i).GetItem().Texture) DrawButton(New Vector2(100, 100 + p * 96), 5, Me.BuyItemsList(i).GetItem().OneLineName, 16, Me.BuyItemsList(i).GetItem().Texture)
End If End If
Next Next
@ -775,7 +775,7 @@ Public Class TradeScreen
If selectedItem.Amount > -1 Then If selectedItem.Amount > -1 Then
bannerText = " | In Stock: " & selectedItem.Amount bannerText = " | In Stock: " & selectedItem.Amount
End If End If
Me.DrawBanner(New Vector2(665, 430), 30, "In Inventory: " & amount & bannerText, FontManager.MiniFont, 400) Me.DrawBanner(New Vector2(664, 430), 30, "In Inventory: " & amount & bannerText, FontManager.MainFont, 400)
' - button: ' - button:
Core.SpriteBatch.Draw(texture, New Rectangle(664, 484, 64, 64), New Rectangle(16, 32, 16, 16), Color.White) Core.SpriteBatch.Draw(texture, New Rectangle(664, 484, 64, 64), New Rectangle(16, 32, 16, 16), Color.White)
@ -804,12 +804,12 @@ Public Class TradeScreen
Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\GamePad\xboxControllerButtonA"), New Rectangle(664 + 12, 484 + 64 + 34, 40, 40), Color.White) Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\GamePad\xboxControllerButtonA"), New Rectangle(664 + 12, 484 + 64 + 34, 40, 40), Color.White)
End If End If
Me.DrawButton(New Vector2(664 + 64, 484 + 64 + 22), 1, "Buy", 64) Me.DrawButton(New Vector2(664 + 32, 484 + 64 + 22), 1, "Buy", 64)
End If End If
End If End If
' Current balance: ' Current balance:
Me.DrawBanner(New Vector2(665, 110), 30, "Current balance: " & GetCurrencyDisplay(), FontManager.MiniFont, 400) Me.DrawBanner(New Vector2(664, 110), 30, "Current balance: " & GetCurrencyDisplay(), FontManager.MainFont, 400)
' Cursor draw: ' Cursor draw:
Me.DrawMainCursor() Me.DrawMainCursor()
@ -952,7 +952,7 @@ Public Class TradeScreen
End If End If
End If End If
Next Next
Me.SellItemsList = (From i As TradeItem In SellItemsList Order By i.GetItem().Name).ToList() Me.SellItemsList = (From i As TradeItem In SellItemsList Order By i.GetItem().OneLineName).ToList()
End Sub End Sub
Private Sub UpdateSellItems() Private Sub UpdateSellItems()
@ -1009,7 +1009,7 @@ Public Class TradeScreen
End If End If
' Buy button: ' Buy button:
If New Rectangle(664 + 64, 484 + 64 + 22, 64 * 3, 64).Contains(MouseHandler.MousePosition) = True Then If New Rectangle(664 + 32, 484 + 64 + 22, 64 * 3, 64).Contains(MouseHandler.MousePosition) = True Then
SoundManager.PlaySound("select") SoundManager.PlaySound("select")
Me.ButtonSellItemsSell() Me.ButtonSellItemsSell()
End If End If
@ -1104,7 +1104,7 @@ Public Class TradeScreen
If i <= Me.SellItemsList.Count - 1 Then If i <= Me.SellItemsList.Count - 1 Then
Dim p As Integer = i - Scroll Dim p As Integer = i - Scroll
DrawButton(New Vector2(100, 100 + p * 96), 5, Me.SellItemsList(i).GetItem().Name, 16, Me.SellItemsList(i).GetItem().Texture) DrawButton(New Vector2(100, 100 + p * 96), 5, Me.SellItemsList(i).GetItem().OneLineName, 16, Me.SellItemsList(i).GetItem().Texture)
End If End If
Next Next
@ -1132,7 +1132,7 @@ Public Class TradeScreen
While amount.Length < 3 While amount.Length < 3
amount = "0" & amount amount = "0" & amount
End While End While
Me.DrawBanner(New Vector2(665, 430), 30, "In Bag " & amount, FontManager.MiniFont, 400) Me.DrawBanner(New Vector2(664, 430), 30, "In Inventory: " & amount, FontManager.MainFont, 400)
' - button: ' - button:
Core.SpriteBatch.Draw(texture, New Rectangle(664, 484, 64, 64), New Rectangle(16, 32, 16, 16), Color.White) Core.SpriteBatch.Draw(texture, New Rectangle(664, 484, 64, 64), New Rectangle(16, 32, 16, 16), Color.White)
@ -1161,12 +1161,12 @@ Public Class TradeScreen
Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\GamePad\xboxControllerButtonA"), New Rectangle(664 + 12, 484 + 64 + 34, 40, 40), Color.White) Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\GamePad\xboxControllerButtonA"), New Rectangle(664 + 12, 484 + 64 + 34, 40, 40), Color.White)
End If End If
Me.DrawButton(New Vector2(664 + 64, 484 + 64 + 22), 1, "Sell", 64) Me.DrawButton(New Vector2(664 + 32, 484 + 64 + 22), 1, "Sell", 64)
End If End If
End If End If
' Current balance: ' Current balance:
Me.DrawBanner(New Vector2(665, 110), 30, "Current balance: " & GetCurrencyDisplay(), FontManager.MiniFont, 400) Me.DrawBanner(New Vector2(664, 110), 30, "Current balance: " & GetCurrencyDisplay(), FontManager.MainFont, 400)
' Cursor draw: ' Cursor draw:
Me.DrawMainCursor() Me.DrawMainCursor()
@ -1222,11 +1222,11 @@ Public Class TradeScreen
Dim tradeItem As TradeItem = Me.SellItemsList(Me.Scroll + Me.Cursor) Dim tradeItem As TradeItem = Me.SellItemsList(Me.Scroll + Me.Cursor)
Dim text As String = "Do you want to sell" & Environment.NewLine & Me.SellItemsAmount & " " & tradeItem.GetItem().Name & "?" Dim text As String = "Do you want to sell" & Environment.NewLine & Me.SellItemsAmount & " " & tradeItem.GetItem().OneLineName & "?"
Core.SpriteBatch.DrawString(FontManager.MiniFont, Core.SpriteBatch.DrawString(FontManager.MainFont,
text, text,
New Vector2(Core.windowSize.Width / 2.0F - FontManager.MiniFont.MeasureString(text).X, Core.windowSize.Height / 2.0F - 170), New Vector2(Core.windowSize.Width / 2.0F - FontManager.MainFont.MeasureString(text).X, Core.windowSize.Height / 2.0F - 170),
Color.White, 0.0F, Vector2.Zero, 2.0F, SpriteEffects.None, 0.0F) Color.White, 0.0F, Vector2.Zero, 2.0F, SpriteEffects.None, 0.0F)
DrawButton(New Vector2(Core.windowSize.Width / 2.0F - 192, Core.windowSize.Height / 2.0F - 60), 4, "Sell", 16, Nothing) DrawButton(New Vector2(Core.windowSize.Width / 2.0F - 192, Core.windowSize.Height / 2.0F - 60), 4, "Sell", 16, Nothing)
@ -1275,9 +1275,9 @@ Public Class TradeScreen
Core.SpriteBatch.Draw(Me.texture, New Rectangle(CInt(Position.X) + 64 * (Width + 1), CInt(Position.Y), 64, 64), New Rectangle(16, 16, 16, 16), Color.White, 0.0F, Vector2.Zero, SpriteEffects.FlipHorizontally, 0.0F) Core.SpriteBatch.Draw(Me.texture, New Rectangle(CInt(Position.X) + 64 * (Width + 1), CInt(Position.Y), 64, 64), New Rectangle(16, 16, 16, 16), Color.White, 0.0F, Vector2.Zero, SpriteEffects.FlipHorizontally, 0.0F)
If Image Is Nothing Then If Image Is Nothing Then
Core.SpriteBatch.DrawString(FontManager.MainFont, Text, New Vector2(TextOffset + CInt(Position.X), CInt(Position.Y) + 16), Color.Black, 0.0F, Vector2.Zero, 1.25F, SpriteEffects.None, 0.0F) Core.SpriteBatch.DrawString(FontManager.MainFont, Text, New Vector2(TextOffset + CInt(Position.X), CInt(Position.Y) + 16), Color.Black, 0.0F, Vector2.Zero, 1.0F, SpriteEffects.None, 0.0F)
Else Else
Core.SpriteBatch.DrawString(FontManager.MainFont, Text, New Vector2(4 + 16 + Image.Width + TextOffset + CInt(Position.X), CInt(Position.Y) + 16), Color.Black, 0.0F, Vector2.Zero, 1.25F, SpriteEffects.None, 0.0F) Core.SpriteBatch.DrawString(FontManager.MainFont, Text, New Vector2(4 + 16 + Image.Width + TextOffset + CInt(Position.X), CInt(Position.Y) + 16), Color.Black, 0.0F, Vector2.Zero, 1.0F, SpriteEffects.None, 0.0F)
Core.SpriteBatch.Draw(Image, New Rectangle(CInt(Position.X) + TextOffset + 8, CInt(Position.Y) + 19, Image.Width, Image.Height), Color.White) Core.SpriteBatch.Draw(Image, New Rectangle(CInt(Position.X) + TextOffset + 8, CInt(Position.Y) + 19, Image.Width, Image.Height), Color.White)
End If End If
End Sub End Sub
@ -1342,7 +1342,7 @@ Public Class TradeScreen
Case Currencies.Coins Case Currencies.Coins
Return GetCurrencyAmount().ToString() & " Coins" Return GetCurrencyAmount().ToString() & " Coins"
Case Currencies.Pokédollar Case Currencies.Pokédollar
Return GetCurrencyAmount().ToString() & " Pokémon Dollars" Return GetCurrencyAmount().ToString() & "$"
End Select End Select
Return "" Return ""
End Function End Function