Double hats menu

This commit is contained in:
chardub
2025-03-09 12:48:32 -04:00
parent e9bdea5bad
commit 8b8b348ed1
10 changed files with 35 additions and 25 deletions

View File

@@ -66,9 +66,15 @@ def setHairColor(hue_shift)
refreshPlayerOutfit()
end
def shiftHatColor(incr)
$Trainer.hat_color = 0 if !$Trainer.hat_color
$Trainer.hat_color += incr
def shiftHatColor(incr,secondary_hat=false)
if secondary_hat
$Trainer.hat2_color = 0 if !$Trainer.hat2_color
$Trainer.hat2_color += incr
else
$Trainer.hat_color = 0 if !$Trainer.hat_color
$Trainer.hat_color += incr
end
refreshPlayerOutfit()
end
@@ -144,6 +150,7 @@ def generate_front_trainer_sprite_bitmap(allowEasterEgg=true, pokeball = nil,
clothes_id = nil, hat_id = nil, hat2_id=nil, hair_id = nil,
skin_tone_id = nil, hair_color = nil, hat_color = nil, clothes_color = nil,
hat2_color = nil)
clothes_id = $Trainer.clothes if !clothes_id
hat_id = $Trainer.hat if !hat_id
hat2_id = $Trainer.hat2 if !hat2_id

View File

@@ -115,8 +115,8 @@ def selectHairColor
end
def selectHatColor
original_color = $Trainer.hat_color
def selectHatColor(secondary_hat=false)
original_color = secondary_hat ? $Trainer.hat2_color : $Trainer.hat_color
display_outfit_preview()
commands = ["Shift up", "Shift down", "Reset", "Confirm", "Never Mind"]
previous_input = 0
@@ -126,24 +126,26 @@ def selectHatColor
case choice
when 0 #NEXT
pbSEPlay("GUI storage pick up", 80, 100)
shiftHatColor(10)
display_outfit_preview()
shiftHatColor(10,secondary_hat)
display_outfit_preview
ret = true
when 1 #PREVIOUS
pbSEPlay("GUI storage pick up", 80, 100)
shiftHatColor(-10)
display_outfit_preview()
shiftHatColor(-10,secondary_hat)
display_outfit_preview
ret = true
when 2 #Reset
pbSEPlay("GUI storage put down", 80, 100)
$Trainer.hat_color = 0
display_outfit_preview()
refreshPlayerOutfit()
$Trainer.hat_color = 0 if !secondary_hat
$Trainer.hat2_color = 0 if secondary_hat
display_outfit_preview
refreshPlayerOutfit
ret = false
when 3 #Confirm
break
else
$Trainer.hat_color = original_color
$Trainer.hat_color = original_color if !secondary_hat
$Trainer.hat2_color = original_color if secondary_hat
ret = false
break
end

View File

@@ -1,5 +1,5 @@
class TrainerClothesPreview
attr_writer :pokeball, :clothes, :hat, :hat2, :hair, :skin_tone, :hair_color, :hat_color, :clothes_color
attr_writer :pokeball, :clothes, :hat, :hat2, :hair, :skin_tone, :hair_color, :hat_color,:hat2_color, :clothes_color
def initialize(x = 0, y = 0, windowed = true, pokeball = nil)
@playerBitmap = nil

View File

@@ -76,9 +76,11 @@ def putOnHat(outfit_id, silent = false, is_secondary=false)
dye_color = $Trainer.dyed_hats[outfit_id]
if dye_color
$Trainer.hat_color = dye_color
$Trainer.hat_color = dye_color if !is_secondary
$Trainer.hat2_color = dye_color if is_secondary
else
$Trainer.hat_color = nil
$Trainer.hat_color = nil if !is_secondary
$Trainer.hat2_color = nil if is_secondary
end
$game_map.refreshPlayerOutfit()