mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 21:54:58 +00:00
Fixes swapping hats visual glitch when only wearing one hat
This commit is contained in:
@@ -81,6 +81,11 @@ class ClothesMartAdapter < OutfitsMartAdapter
|
||||
$Trainer.clothes != @worn_clothes
|
||||
end
|
||||
|
||||
def putOnSelectedOutfit()
|
||||
putOnClothes($Trainer.clothes)
|
||||
@worn_clothes = $Trainer.clothes
|
||||
end
|
||||
|
||||
def putOnOutfit(item)
|
||||
putOnClothes(item.id) if item
|
||||
@worn_clothes = item.id if item
|
||||
|
||||
@@ -48,7 +48,7 @@ class ClothesShopPresenter < PokemonMartScreen
|
||||
end
|
||||
|
||||
|
||||
# returns if should stay in the menu
|
||||
# returns true if should stay in the menu
|
||||
def playerClothesActionsMenu(item)
|
||||
cmd_wear = "Wear"
|
||||
cmd_dye = "Dye Kit"
|
||||
@@ -59,9 +59,9 @@ class ClothesShopPresenter < PokemonMartScreen
|
||||
choice = pbMessage("What would you like to do?", options, -1)
|
||||
|
||||
if options[choice] == cmd_wear
|
||||
putOnClothes(item)
|
||||
putOnClothes(item,false)
|
||||
$Trainer.clothes_color = @adapter.get_dye_color(item.id)
|
||||
return false
|
||||
return true
|
||||
elsif options[choice] == cmd_dye
|
||||
dyeClothes()
|
||||
end
|
||||
@@ -72,8 +72,8 @@ class ClothesShopPresenter < PokemonMartScreen
|
||||
putOnClothes(item)
|
||||
end
|
||||
|
||||
def quitMenuPrompt(item)
|
||||
return true if !@adapter.is_a?(HatsMartAdapter)
|
||||
def quitMenuPrompt()
|
||||
return true if !(@adapter.is_a?(HatsMartAdapter) || @adapter.is_a?(ClothesMartAdapter))
|
||||
boolean_changes_detected = @adapter.player_changed_clothes?
|
||||
return true if !boolean_changes_detected
|
||||
pbPlayCancelSE
|
||||
@@ -81,10 +81,10 @@ class ClothesShopPresenter < PokemonMartScreen
|
||||
cmd_discard = "Discard changes"
|
||||
cmd_cancel = "Cancel"
|
||||
options = [cmd_confirm,cmd_discard,cmd_cancel]
|
||||
choice = pbMessage("You have unsaved changes!",options,2)
|
||||
choice = pbMessage("You have unsaved changes!",options,3)
|
||||
case options[choice]
|
||||
when cmd_confirm
|
||||
confirmPutClothes(item)
|
||||
@adapter.putOnSelectedOutfit
|
||||
pbPlayDecisionSE
|
||||
return true
|
||||
when cmd_discard
|
||||
@@ -104,7 +104,7 @@ class ClothesShopPresenter < PokemonMartScreen
|
||||
#break if !item
|
||||
if !item
|
||||
break if @adapter.isShop?
|
||||
quit_menu_choice = quitMenuPrompt(item)
|
||||
quit_menu_choice = quitMenuPrompt()
|
||||
break if quit_menu_choice
|
||||
item = @scene.pbChooseBuyItem
|
||||
end
|
||||
|
||||
@@ -125,6 +125,8 @@ class ClothesShopPresenter < PokemonMartScreen
|
||||
end
|
||||
|
||||
def playerHatActionsMenu(item)
|
||||
echoln caller
|
||||
|
||||
cmd_confirm = "Confirm"
|
||||
cmd_remove = "Remove hat"
|
||||
cmd_cancel = "Cancel"
|
||||
|
||||
@@ -38,15 +38,28 @@ class HatShopView < ClothesShopView
|
||||
return @stock[itemwindow.index]
|
||||
end
|
||||
|
||||
def displayLayerIcons(selected_item=nil)
|
||||
def handleHatlessLayerIcons(selected_item)
|
||||
other_hat = @adapter.is_secondary_hat ? $Trainer.hat : $Trainer.hat2
|
||||
if !selected_item.is_a?(Hat)
|
||||
if @adapter.is_secondary_hat
|
||||
@sprites["wornHat_layer2"].bitmap=nil
|
||||
else
|
||||
@sprites["wornHat_layer1"].bitmap=nil
|
||||
end
|
||||
return
|
||||
end
|
||||
if !other_hat.is_a?(Hat)
|
||||
if @adapter.is_secondary_hat
|
||||
@sprites["wornHat_layer1"].bitmap=nil
|
||||
else
|
||||
@sprites["wornHat_layer2"].bitmap=nil
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
def displayLayerIcons(selected_item=nil)
|
||||
echoln selected_item
|
||||
handleHatlessLayerIcons(selected_item)
|
||||
|
||||
hat1Filename = getOverworldHatFilename($Trainer.hat)
|
||||
hat2Filename = getOverworldHatFilename($Trainer.hat2)
|
||||
|
||||
@@ -65,6 +78,10 @@ class HatShopView < ClothesShopView
|
||||
|
||||
@sprites["wornHat_layer1"].src_rect.set(0, 0, frame_width, frame_height) if hatBitmapWrapper
|
||||
@sprites["wornHat_layer2"].src_rect.set(0, 0, frame_width, frame_height) if hat2BitmapWrapper
|
||||
|
||||
echoln hatBitmapWrapper
|
||||
echoln hat2BitmapWrapper
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -157,6 +157,14 @@ class HatsMartAdapter < OutfitsMartAdapter
|
||||
$Trainer.hat != @worn_clothes || $Trainer.hat2 != @worn_clothes2
|
||||
end
|
||||
|
||||
def putOnSelectedOutfit()
|
||||
putOnHat($Trainer.hat,true,false) if $Trainer.hat
|
||||
putOnHat($Trainer.hat2,true,true) if $Trainer.hat2
|
||||
|
||||
@worn_clothes = $Trainer.hat
|
||||
@worn_clothes2 = $Trainer.hat2
|
||||
end
|
||||
|
||||
def putOnOutfit(item)
|
||||
return unless item.is_a?(Outfit)
|
||||
putOnHat(item.id,false,@is_secondary_hat)
|
||||
|
||||
Reference in New Issue
Block a user