Having the json to have a TRUE/FALSE for full BP unlock so admins can do testing
JSON code block change:
[JsonProperty("Unlock all blueprints for players with admin permission")]
public bool UnlockAllForAdmin = true;Code block change:
private void UpdatePlayerBPs(BasePlayer player, bool defaultOnly = false)
{
List<int> toUnlock = Pool.Get<List<int>>();
toUnlock.AddRange(_defaultBlueprints);
//NEW SECTION
if (config.UnlockAllForAdmin && HasPerm(player.UserIDString, permadmin))
{
toUnlock.Clear();
toUnlock.AddRange(_permissionBPs[permunlockall]); // Admin - ALL BPs with perm
}
// END OF NEW SECTION
else if (!defaultOnly)
{
foreach (var perm in _permissionBPs)
{
if (!HasPerm(player.UserIDString, perm.Key)) continue;
foreach (int id in perm.Value)
if (!toUnlock.Contains(id)) toUnlock.Add(id);
}
}
// ... unchanged code
}JSON prevew:
{
"Unlock all blueprints for players with admin permission": true,
"Simple Mode (disables advance blueprint management options)": false,
"Update players on permission change (automatically updates a players BPs when their permissions change)": true,
"Wipe BPs with Map Wipe": false,
"Blacklist (items from being automatically learnt)": [],
"DefaultBPs (Blueprints to be automatically learnt)": [],
"Assign custom BP unlocks to various perms (permission, BP List": {
"customperm1": [
"rock"
.... tested it a couple of time but no guarantee it 100% works. just an idea, if you want to incorporate it.