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

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)