Skip to content

Commit

Permalink
Merge pull request #79243 from Maleclypse/Default-backgrounds-opt-out…
Browse files Browse the repository at this point in the history
…-flag

SKIP_DEFAULT_BACKGROUND
  • Loading branch information
GuardianDll authored Jan 21, 2025
2 parents fc3f0e4 + 1505ae7 commit 953dbcf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion data/json/professions.json
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@
{ "level": 3, "name": "cooking" }
],
"traits": [ "PROF_CHURL", "ILLITERATE" ],
"flags": [ "SCEN_ONLY" ]
"flags": [ "SCEN_ONLY", "SKIP_DEFAULT_BACKGROUND" ]
},
{
"type": "profession",
Expand Down
13 changes: 7 additions & 6 deletions data/mods/Xedra_Evolved/player/professions.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
"points": 7,
"proficiencies": [ "prof_wp_netherium_abomination", "prof_unarmed_familiar", "prof_traps" ],
"skills": [ { "level": 2, "name": "gun" }, { "level": 3, "name": "rifle" }, { "level": 1, "name": "survival" } ],
"flags": [ "SKIP_DEFAULT_BACKGROUND" ],
"items": {
"both": {
"entries": [
Expand Down Expand Up @@ -597,7 +598,7 @@
},
"female": { "entries": [ { "item": "chestwrap" } ] }
},
"flags": [ "SCEN_ONLY" ]
"flags": [ "SCEN_ONLY", "SKIP_DEFAULT_BACKGROUND" ]
},
{
"type": "profession",
Expand All @@ -624,7 +625,7 @@
},
"female": { "entries": [ { "item": "chestwrap" } ] }
},
"flags": [ "SCEN_ONLY" ]
"flags": [ "SCEN_ONLY", "SKIP_DEFAULT_BACKGROUND" ]
},
{
"type": "profession",
Expand All @@ -651,7 +652,7 @@
},
"female": { "entries": [ { "item": "chestwrap" } ] }
},
"flags": [ "SCEN_ONLY" ]
"flags": [ "SCEN_ONLY", "SKIP_DEFAULT_BACKGROUND" ]
},
{
"type": "profession",
Expand All @@ -678,7 +679,7 @@
},
"female": { "entries": [ { "item": "chestwrap" } ] }
},
"flags": [ "SCEN_ONLY" ]
"flags": [ "SCEN_ONLY", "SKIP_DEFAULT_BACKGROUND" ]
},
{
"type": "profession",
Expand All @@ -705,7 +706,7 @@
},
"female": { "entries": [ { "item": "chestwrap" } ] }
},
"flags": [ "SCEN_ONLY" ]
"flags": [ "SCEN_ONLY", "SKIP_DEFAULT_BACKGROUND" ]
},
{
"type": "profession",
Expand All @@ -732,7 +733,7 @@
},
"female": { "entries": [ { "item": "chestwrap" } ] }
},
"flags": [ "SCEN_ONLY" ]
"flags": [ "SCEN_ONLY", "SKIP_DEFAULT_BACKGROUND" ]
},
{
"type": "profession",
Expand Down
1 change: 1 addition & 0 deletions doc/JSON/JSON_FLAGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1402,6 +1402,7 @@ The purpose of these flags is to allow reuse of blueprints to create the "same"
### Profession
- ```SCEN_ONLY``` Profession can be chosen only as part of the appropriate scenario.
- ```SKIP_DEFAULT_BACKGROUND``` This profession will not add the default background package of hobbies (`adult_basic_background`).
### Starting Location
Expand Down
4 changes: 3 additions & 1 deletion src/newcharacter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
static const std::string flag_CHALLENGE( "CHALLENGE" );
static const std::string flag_CITY_START( "CITY_START" );
static const std::string flag_SECRET( "SECRET" );
static const std::string flag_SKIP_DEFAULT_BACKGROUND( "SKIP_DEFAULT_BACKGROUND" );

static const flag_id json_flag_auto_wield( "auto_wield" );
static const flag_id json_flag_no_auto_equip( "no_auto_equip" );
Expand Down Expand Up @@ -800,7 +801,8 @@ bool avatar::create( character_type type, const std::string &tempname )
}

// Don't apply the default backgrounds on a template
if( type != character_type::TEMPLATE ) {
if( type != character_type::TEMPLATE &&
!get_scenario()->has_flag( flag_SKIP_DEFAULT_BACKGROUND ) ) {
add_default_background();
}

Expand Down

0 comments on commit 953dbcf

Please sign in to comment.