forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds mutation overlay ordering that can be configured in JSON.
The ordering layer value can range from 0 to 9999. Layers with the same value will add the layers in whatever order the player has the mutations in. Most layers should contain mostly mutually exclusive mutations. Any modern tileset can override the layering by providing values for specific mutations in the tileset json.
- Loading branch information
1 parent
e2ccbcd
commit 021acfd
Showing
8 changed files
with
200 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
[ | ||
{ | ||
"type" : "overlay_order", | ||
"ordering" : | ||
[ | ||
{ | ||
"id" : [ "THRESH_CATTLE", "THRESH_CEPHALOPOD", "THRESH_SLIME", "WEB_RAPPEL", "WEB_ROPE", "WEB_SPINNER", "WEB_WALKER", "WEB_WEAVER", "WINGS_BAT", "WINGS_BIRD", "WINGS_BUTTERFLY", "WINGS_INSECT" ], | ||
"order" : 500 | ||
},{ | ||
"id" : [ "BEAUTIFUL", "BEAUTIFUL2", "BEAUTIFUL3", "LARGE", "PRETTY", "RADIOACTIVE1", "RADIOACTIVE2", "RADIOACTIVE3", "REGEN" ], | ||
"order" : 1000 | ||
},{ | ||
"id" : [ "ALBINO", "BARK", "CHITIN", "CHITIN2", "CHITIN3", "CHITIN_FUR", "CHITIN_FUR2", "CHITIN_FUR3", "FEATHERS", "FELINE_FUR", "FUR", "LEAVES", "LIGHT_FUR", "LUPINE_FUR", "LYNX_FUR", "PLANTSKIN", "SCALES", "SKIN_ROUGH", "SLEEK_SCALES", "SORES", "THORNS", "TROGLO2", "TROGLO3", "URSINE_FUR", "VISCOUS" ], | ||
"order" : 1500 | ||
},{ | ||
"id" : [ "ARACHNID_ARMS", "ARACHNID_ARMS_OK", "ARM_FEATHERS", "ARM_TENTACLES", "ARM_TENTACLES_4", "ARM_TENTACLES_8" ], | ||
"order" : 2000 | ||
},{ | ||
"id" : [ "PAWS", "PAWS_LARGE", "SLIME_HANDS" ], | ||
"order" : 2500 | ||
},{ | ||
"id" : [ "CLAWS", "CLAWS_RAT", "CLAWS_RETRACT", "LONG_FINGERNAILS", "VINES1", "VINES2", "VINES3" ], | ||
"order" : 3000 | ||
},{ | ||
"id" : [ "TAIL_CATTLE", "TAIL_CLUB", "TAIL_FIN", "TAIL_LONG", "TAIL_RAPTOR", "TAIL_RAT", "TAIL_STING", "TAIL_STUB", "TAIL_THICK" ], | ||
"order" : 3500 | ||
},{ | ||
"id" : [ "LEG_TENTACLES" ], | ||
"order" : 4000 | ||
},{ | ||
"id" : [ "HOOVES", "ROOTS1", "ROOTS2", "ROOTS3", "TALONS" ], | ||
"order" : 4500 | ||
},{ | ||
"id" : [ "FLOWERS" ], | ||
"order" : 5000 | ||
},{ | ||
"id" : [ "ELFA_EARS", "FELINE_EARS", "LUPINE_EARS", "URSINE_EARS" ], | ||
"order" : 5500 | ||
},{ | ||
"id" : [ "ANTENNAE", "ANTLERS", "CURVED_HORNS", "HORNS", "POINTED_HORNS" ], | ||
"order" : 6000 | ||
},{ | ||
"id" : [ "COMPOUND_EYES", "ELFAEYES", "FEL_EYE", "LIZ_EYE" ], | ||
"order" : 6500 | ||
},{ | ||
"id" : [ "BEAK", "BEAK_HUM", "BEAK_PECK", "MUZZLE", "MUZZLE_BEAR", "MUZZLE_LONG", "MUZZLE_RAT", "MINOTAUR", "SLIT_NOSTRILS", "SNOUT", "WHISKERS", "WHISKERS_RAT" ], | ||
"order" : 7000 | ||
},{ | ||
"id" : [ "FANGS", "MANDIBLES", "SABER_TEETH" ], | ||
"order" : 7500 | ||
},{ | ||
"id" : [ "FORKED_TONGUE" ], | ||
"order" : 8000 | ||
},{ | ||
"id" : [ "PROF_CYBERCOP", "PROF_FED", "PROF_PD_DET", "PROF_POLICE", "PROF_SWAT", "PHEROMONE_INSECT" ], | ||
"order" : 8500 | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "overlay_ordering.h" | ||
|
||
std::unordered_map<std::string, int> base_mutation_overlay_ordering; | ||
std::unordered_map<std::string, int> tileset_mutation_overlay_ordering; | ||
|
||
void load_overlay_ordering( JsonObject &jsobj ) | ||
{ | ||
JsonArray jarr = jsobj.get_array( "ordering" ); | ||
while( jarr.has_more() ) { | ||
JsonObject ordering = jarr.next_object(); | ||
|
||
JsonArray jsarr; | ||
int order = ordering.get_int( "order" ); | ||
if( ordering.has_array( "id" ) ) { | ||
jsarr = ordering.get_array( "id" ); | ||
while( jsarr.has_more() ) { | ||
std::string mut_id = jsarr.next_string(); | ||
base_mutation_overlay_ordering[mut_id] = order; | ||
} | ||
} else { | ||
std::string mut_id = ordering.get_string( "id" ); | ||
base_mutation_overlay_ordering[mut_id] = order; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef OVERLAY_ORDERING_H | ||
#define OVERLAY_ORDERING_H | ||
|
||
#include "json.h" | ||
|
||
#include <unordered_map> | ||
#include <string> | ||
|
||
extern std::unordered_map<std::string, int> base_mutation_overlay_ordering; | ||
extern std::unordered_map<std::string, int> tileset_mutation_overlay_ordering; | ||
|
||
void load_overlay_ordering( JsonObject &jsobj ); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters