Track dyed clothes individually

This commit is contained in:
infinitefusion
2024-12-27 22:58:50 -05:00
parent 5e07802681
commit de8f9603dc
23 changed files with 3435 additions and 73 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -19,6 +19,10 @@ class Player < Trainer
attr_accessor :unlocked_hairstyles
attr_accessor :unlocked_card_backgrounds
attr_accessor :dyed_hats
attr_accessor :dyed_clothes
attr_accessor :last_worn_outfit
attr_accessor :last_worn_hat
@@ -121,6 +125,19 @@ class Player < Trainer
refreshPlayerOutfit()
end
def clothes_color=(value)
@clothes_color=value
$Trainer.dyed_clothes= {} if ! $Trainer.dyed_clothes
$Trainer.dyed_clothes[@clothes] = value
refreshPlayerOutfit()
end
def hat_color=(value)
@hat_color=value
$Trainer.dyed_hats= {} if ! $Trainer.dyed_hats
$Trainer.dyed_hats[@hat] = value
refreshPlayerOutfit()
end
def unlock_clothes(outfitID,silent=false)
update_global_clothes_list()
@@ -265,6 +282,10 @@ class Player < Trainer
@last_worn_outfit = nil
@last_worn_hat = nil
@dyed_hats = {}
@dyed_clothes = {}
@card_background = Settings::DEFAULT_TRAINER_CARD_BG
@unlocked_card_backgrounds = [@card_background]
end

View File

@@ -155,7 +155,6 @@ end
def get_clothes_by_id(id)
update_global_outfit_lists()
echoln $PokemonGlobal.clothes_data
return $PokemonGlobal.clothes_data.has_key?(id) ? $PokemonGlobal.clothes_data[id] : nil
end

View File

@@ -2,6 +2,14 @@ class ClothesMartAdapter < OutfitsMartAdapter
DEFAULT_NAME = "[unknown]"
DEFAULT_DESCRIPTION = "A piece of clothing that trainers can wear."
def toggleEvent(item)
if !isShop? && $Trainer.clothes_color != 0
if pbConfirmMessage(_INTL("Would you like to remove the dye?"))
$Trainer.clothes_color = 0
end
end
end
def initialize(stock = nil, isShop = nil)
super
end
@@ -29,10 +37,34 @@ class ClothesMartAdapter < OutfitsMartAdapter
return if !item
previewWindow.clothes = item.id
$Trainer.clothes = item.id
set_dye_color(item,previewWindow)
pbRefreshSceneMap
previewWindow.updatePreview()
end
def get_dye_color(item)
$Trainer.dyed_clothes= {} if ! $Trainer.dyed_clothes
if $Trainer.dyed_clothes.include?(item.id)
return $Trainer.dyed_clothes[item.id]
end
return 0
end
def set_dye_color(item,previewWindow)
if !isShop?
$Trainer.dyed_clothes= {} if ! $Trainer.dyed_clothes
if $Trainer.dyed_clothes.include?(item.id)
dye_color = $Trainer.dyed_clothes[item.id]
$Trainer.clothes_color = dye_color
previewWindow.clothes_color = dye_color
else
$Trainer.clothes_color=0
previewWindow.clothes_color=0
end
echoln $Trainer.dyed_clothes
end
end
def addItem(item)
changed_clothes = obtainClothes(item.id)

View File

@@ -3,11 +3,58 @@ class ClothesShopPresenter < PokemonMartScreen
end
def initialize(scene, stock, adapter = nil, versions=false)
super(scene,stock,adapter)
def initialize(scene, stock, adapter = nil, versions = false)
super(scene, stock, adapter)
@use_versions = versions
end
def putOnClothes(item)
@adapter.putOnOutfit(item)
@scene.pbEndBuyScene
end
def playerHatActionsMenu(item)
if $Trainer.hat_color != 0
choice = pbMessage("What would you like to do?", ["Wear", "Remove dye", "Cancel"])
if choice == 0
putOnClothes(item)
$Trainer.hat_color = @adapter.get_dye_color(item)
return
elsif choice == 1
if pbConfirm(_INTL("Are you sure you want to remove the dye from the {1}?", item.name))
$Trainer.hat_color = 0
end
return
end
else
if pbConfirm(_INTL("Would you like to put on the {1}?", item.name))
putOnClothes(item)
return
end
end
end
#returns if should stay in the menu
def playerClothesActionsMenu(item)
if $Trainer.clothes_color != 0
choice = pbMessage("What would you like to do?", ["Wear", "Remove dye", "Cancel"])
if choice == 0
putOnClothes(item)
$Trainer.clothes_color = @adapter.get_dye_color(item)
return false
elsif choice == 1
if pbConfirm(_INTL("Are you sure you want to remove the dye from the {1}?", item.name))
$Trainer.clothes_color = 0
end
return true
end
else
if pbConfirm(_INTL("Would you like to put on the {1}?", item.name))
putOnClothes(item)
return false
end
end
end
def pbBuyScreen
@scene.pbStartBuyScene(@stock, @adapter)
@@ -17,15 +64,21 @@ class ClothesShopPresenter < PokemonMartScreen
break if !item
if !@adapter.isShop?
if pbConfirm(_INTL("Would you like to put on the {1}?", item.name))
@adapter.putOnOutfit(item)
@scene.pbEndBuyScene
return
if @adapter.is_a?(ClothesMartAdapter)
stay_in_menu = playerClothesActionsMenu(item)
next if stay_in_menu
elsif @adapter.is_a?(HatsMartAdapter)
stay_in_menu = playerHatActionsMenu(item)
next if stay_in_menu
else
if pbConfirm(_INTL("Would you like to put on the {1}?", item.name))
putOnClothes(item)
return
end
next
end
next
end
itemname = @adapter.getDisplayName(item)
price = @adapter.getPrice(item)
if !price.is_a?(Integer)

View File

@@ -93,6 +93,7 @@ class ClothesShopView < PokemonMart_Scene
def pbChooseBuyItem
itemwindow = @sprites["itemwindow"]
refreshStock(@adapter) if !itemwindow
displayNewItem(itemwindow)
@sprites["helpwindow"].visible = false
pbActivateWindow(@sprites, "itemwindow") {

View File

@@ -49,6 +49,7 @@ class HatsMartAdapter < OutfitsMartAdapter
if item.is_a?(Outfit)
previewWindow.hat = item.id
$Trainer.hat = item.id# unless $Trainer.hat==nil
set_dye_color(item,previewWindow)
else
$Trainer.hat=nil
previewWindow.hat= nil
@@ -56,6 +57,31 @@ class HatsMartAdapter < OutfitsMartAdapter
pbRefreshSceneMap
previewWindow.updatePreview()
end
def get_dye_color(item)
$Trainer.dyed_hats= {} if ! $Trainer.dyed_hats
if $Trainer.dyed_hats.include?(item.id)
return $Trainer.dyed_hats[item.id]
end
return 0
end
def set_dye_color(item,previewWindow)
if !isShop?
$Trainer.dyed_hats= {} if ! $Trainer.dyed_hats
if $Trainer.dyed_hats.include?(item.id)
dye_color = $Trainer.dyed_hats[item.id]
$Trainer.hat_color = dye_color
previewWindow.hat_color = dye_color
else
$Trainer.hat_color=0
previewWindow.hat_color=0
end
echoln $Trainer.dyed_hats
end
end
def addItem(item)
return unless item.is_a?(Outfit)

View File

@@ -49,22 +49,37 @@ def obtainNewHairstyle(full_outfit_id)
end
def putOnClothes(outfit_id, silent = false)
$Trainer.dyed_clothes= {} if ! $Trainer.dyed_clothes
$Trainer.last_worn_outfit = $Trainer.clothes
outfit = get_clothes_by_id(outfit_id)
$Trainer.clothes = outfit_id
$Trainer.clothes_color = nil
dye_color = $Trainer.dyed_clothes[outfit_id]
if dye_color
$Trainer.clothes_color = dye_color
else
$Trainer.clothes_color = nil
end
$game_map.update
refreshPlayerOutfit()
putOnOutfitMessage(outfit) if !silent
end
def putOnHat(outfit_id, silent = false)
$Trainer.dyed_hats= {} if ! $Trainer.dyed_hats
$Trainer.last_worn_hat = $Trainer.hat
outfit = get_hat_by_id(outfit_id)
$Trainer.hat = outfit_id
$Trainer.hat_color = nil
$game_map.
refreshPlayerOutfit()
dye_color = $Trainer.dyed_clothes[outfit_id]
if dye_color
$Trainer.clothes_color = dye_color
else
$Trainer.clothes_color = nil
end
$game_map.refreshPlayerOutfit()
putOnOutfitMessage(outfit) if !silent
end

View File

@@ -1489,6 +1489,8 @@ def isPlayerFemale()
return pbGet(VAR_TRAINER_GENDER) == GENDER_FEMALE
end
def optionsMenu(options = [], cmdIfCancel = -1, startingOption = 0)
cmdIfCancel = -1 if !cmdIfCancel
result = pbShowCommands(nil, options, cmdIfCancel, startingOption)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -168,6 +168,7 @@
117b.png
117c.png
117d.png
117m.png
118.png
118a.png
118b.png
@@ -546,6 +547,7 @@
143q.png
143r.png
143s.png
143x.png
143z.png
144.png
144a.png
@@ -1538,7 +1540,6 @@
222b.png
222c.png
222d.png
222e.png
223.png
223a.png
223b.png
@@ -1596,6 +1597,7 @@
229j.png
229k.png
229l.png
229m.png
22a.png
22b.png
22c.png
@@ -3030,6 +3032,7 @@
342m.png
342n.png
342o.png
342p.png
343.png
343a.png
343b.png
@@ -3130,7 +3133,6 @@
350h.png
350i.png
350j.png
350m.png
351.png
351a.png
351b.png
@@ -4872,6 +4874,7 @@
5.png
50.png
500.png
500a.png
501.png
50a.png
50b.png
@@ -5065,6 +5068,7 @@
63d.png
63e.png
63f.png
63g.png
64.png
64a.png
64b.png
@@ -5074,6 +5078,7 @@
64f.png
64g.png
64h.png
64i.png
65.png
65a.png
65b.png
@@ -5081,6 +5086,7 @@
65d.png
65e.png
65f.png
65g.png
66.png
66a.png
66b.png
@@ -5498,4 +5504,7 @@
9j.png
9k.png
9l.png
9m.png
9m.png
CUSTOM_SPRITES
desktop.ini
list_files.bat

File diff suppressed because it is too large Load Diff