Hello Kanekos ! I'm coming to you for some help about dress up coding. I've been using a lot of your code but I'm in a stump now.
I want to show item 1 when item 1 is selected, item 2 when item 2 is selected BUT I also want to show item 3 and 2 when item 1 and 2 are selected at the same time. Do you have an idea on how to do that ?
Sorry if my question is unwelcome. I hope you have a lovely day.
Hi there! No worries about asking me questions but I'm a little confused haha
Is that a typo and you meant to say you want to "show item 1 and 2 when item 1 and 2 are selected at the same time"? Or you want to show another different item 3 (and not show item 1)...?
Essentially to display an item, I just append the imgHtml I defined for that item in clothesDB.js to the doll's container (line 96). Then I add the item to the selectedOutfit object (see clothesDB.js line 576 to 583) to keep track of what the doll is currently wearing.
For all categories other than accessories, I only allow one item to be equipped at a time. For accessories, I use an array to allow multiple items to be equipped.
If your ask is to show a different third item when item 1 and 2 are selected at the same time, then I don't think my code supports that function 😅 You'll have to add some custom logic for that.
Sorry if this is not very helpful or if it is not really what you're asking ^^;;; and let me know if you need more clarifications.
Hi there! No worries about asking me questions but I'm a little confused haha Is that a typo and you meant to say you want to "show item 1 and 2 when item 1 and 2 are selected at the same time"? Or you want to show another different item 3 (and not show item 1)...?
For showing two items under the same category at the same time, you can refer to my code for the accessories category - https://github.com/kanekos99/DressUp/blob/main/scripts/main.js (line 77 to 104)
Essentially to display an item, I just append the imgHtml I defined for that item in clothesDB.js to the doll's container (line 96). Then I add the item to the selectedOutfit object (see clothesDB.js line 576 to 583) to keep track of what the doll is currently wearing.
For all categories other than accessories, I only allow one item to be equipped at a time. For accessories, I use an array to allow multiple items to be equipped.
If your ask is to show a different third item when item 1 and 2 are selected at the same time, then I don't think my code supports that function 😅 You'll have to add some custom logic for that. Sorry if this is not very helpful or if it is not really what you're asking ^^;;; and let me know if you need more clarifications.