Fixes issue with hat swapping

This commit is contained in:
chardub
2025-03-09 15:38:16 -04:00
parent dc4ec939cd
commit 071621b8dd
9 changed files with 36 additions and 11 deletions

View File

@@ -70,6 +70,7 @@ class ClothesShopPresenter < PokemonMartScreen
def pbBuyScreen
@scene.pbStartBuyScene(@stock, @adapter)
@scene.select_specific_item(@adapter.worn_clothes) if !@adapter.isShop?
item = nil
loop do
item = @scene.pbChooseBuyItem

View File

@@ -24,13 +24,18 @@ class ClothesShopPresenter < PokemonMartScreen
end
def swapHats()
echoln "hat 1: #{$Trainer.hat}"
echoln "hat 2: #{$Trainer.hat2}"
$Trainer.hat, $Trainer.hat2 = $Trainer.hat2, $Trainer.hat
#$Trainer.hat_color,$Trainer.hat2_color=$Trainer.hat2_color,$Trainer.hat_color
pbSEPlay("GUI naming tab swap start")
new_selected_hat = @adapter.is_secondary_hat ? $Trainer.hat2 : $Trainer.hat
echoln "hat 1: #{$Trainer.hat}"
echoln "hat 2: #{$Trainer.hat2}"
echoln "new selected hat: #{new_selected_hat}"
@scene.select_specific_item(new_selected_hat,true)
@scene.updatePreviewWindow
end

View File

@@ -29,7 +29,6 @@ class ClothesShopView < PokemonMart_Scene
itemwindow.index=@adapter.items.length-1
itemwindow.refresh
end
i=0
for item in @adapter.items
next if !item.is_a?(Outfit)
@@ -117,7 +116,6 @@ class ClothesShopView < PokemonMart_Scene
def pbChooseBuyItem
itemwindow = @sprites["itemwindow"]
refreshStock(@adapter) if !itemwindow
select_specific_item(@adapter.worn_clothes) if !@adapter.isShop?
displayNewItem(itemwindow)
@sprites["helpwindow"].visible = false
pbActivateWindow(@sprites, "itemwindow") {

View File

@@ -7,8 +7,8 @@ class HatsMartAdapter < OutfitsMartAdapter
def initialize(stock = nil, isShop = nil, isSecondaryHat = false)
super(stock,isShop,isSecondaryHat)
@worn_clothes = $Trainer.hat(false)
@worn_clothes2 = $Trainer.hat(true)
@worn_clothes = $Trainer.hat
@worn_clothes2 = $Trainer.hat2
end
def toggleEvent(item)