Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upAdded "overlay" functionality for player/NPCs. #8993
Conversation
This comment has been minimized.
This comment has been minimized.
kevingranade
reviewed
Sep 14, 2014
| // next clothing | ||
| // TODO: worry about correct order of clothing overlays | ||
| for(const item& worn_item : worn) { | ||
| if(worn_item.is_null()) { |
This comment has been minimized.
This comment has been minimized.
kevingranade
Sep 14, 2014
Member
Can this actually happen? 'worn' can be empty, but that results in not entering the loop at all.
This comment has been minimized.
This comment has been minimized.
CIB
Sep 14, 2014
Author
Contributor
It probably can't happen, but I wasn't sure at that point. There certainly are bugs where you get null items in your inventory, though I guess it wouldn't be too horrible to include those(they'll just not get rendered).
This comment has been minimized.
This comment has been minimized.
|
@Mshock777 I'm sure anything will look better than my coder art. Just testing functionality. I think to make this properly work, you'd have to design the character sprite from scratch to work well with overlays, the way e.g. DCSS does it. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Just for the record: You can use Edit: no item in the worn vector should ever have null pointer as type, actually they should all have pointers to |
This comment has been minimized.
This comment has been minimized.
|
pinch self This is happening? pinch self this IS happening!!! |
This comment has been minimized.
This comment has been minimized.
|
Well, Waldo wanted his stuff replaced anyway. Mshock, ease off the sexism. The PC tiles were both kinda stereotypical there, and unifying 'em a bit would probably be worthwhile. |
This comment has been minimized.
This comment has been minimized.
|
btw, not ready for merge yet, need to still replace the item->type thing as BevapDin pointed out. |
This comment has been minimized.
This comment has been minimized.
|
This is so cool! |
Rivet-the-Zombie
added
the
in progress
label
Sep 15, 2014
This comment has been minimized.
This comment has been minimized.
|
Okay, ready. |
Rivet-the-Zombie
removed
the
in progress
label
Sep 15, 2014
This comment has been minimized.
This comment has been minimized.
|
I have a question, in what order overlays will be drawn? Like knee-high boots should be over pants,trenchcoats too. And, as I imagine, layered clothes work properly? |
This comment has been minimized.
This comment has been minimized.
|
Yeah, order is still an issue. How does layered clothing work? It allows you to re-arrange anything that covers the same slot? If so, using that should work for doing rendering order properly. Otherwise: eyes > head > mouth > torso > boots = hands > legs = arms? |
This comment has been minimized.
This comment has been minimized.
|
I think mouth is over head. |
kevingranade
merged commit 93a99ac
into
CleverRaven:master
Sep 17, 2014
1 check passed
This comment has been minimized.
This comment has been minimized.
|
Cool! // TODO: distinguish between male/female? I think it is good idea, if it also work with only one available. Some tileset makers will prefer to do only one, others might want to separate. |
This comment has been minimized.
This comment has been minimized.
|
FWIW no mutation discriminates based on character sex/gender, and neither does any gear. |
This comment has been minimized.
This comment has been minimized.
|
Indeed. Still, men and women look different, even when dressed up in same clothing. And it does not have to be same clothing. Men pants and women pants are both pants, yet they often differ. Some tileset makers might want to differentiate. |




CIB commentedSep 14, 2014
New tileset IDs:
Yes, this currently requires all character sprites to be compatible. Probably not an issue, otherwise we'll really want to think of a better system than mangling stuff into IDs with
_.Tested this by modifying existing tileset.
{ "rotates": false, "id": "overlay_wielded_crowbar", "fg": 2470, "bg": 2 }, { "rotates": false, "id": "overlay_worn_sunglasses", "fg": 2471, "bg": 2 }, { "rotates": false, "id": "overlay_wielded_sunglasses", "fg": 2472, "bg": 2 }, { "rotates": false, "id": "overlay_mutation_ARM_TENTACLES", "fg": 2473, "bg": 2 }Wielded crowbar, worn sunglasses:

Wielded sunglasses:

Tentacle arms:
