Skip to content
Person8880 edited this page Sep 19, 2021 · 13 revisions

Overview

This plugin applies badges configured in Shine's user config.

Config

The default config file should look something like this:

{
    "BadgeNames": {
        "example": "Example Name"
    },
    "LogLevel": "INFO",
    "__Version": "2.3"
}

The file should be called "Badges.json" and should be placed in the directory defined as your plugin config directory (default is config://shine/plugins).

Option Description
BadgeNames Configures the name to show for the given badges when hovering over them on the scoreboard.

Assigning badges to groups

To assign a badge to a group, add either a "Badge" field, or a "Badges" field to the group's data. For example:

"SuperAdmin": {
    "IsBlacklist": true,
    "Immunity": 100,
    "Commands": [],
    "Badges": [ "crown", "heart" ]
},
"Admin": {
    "IsBlacklist": false,
    "Immunity": 50,
    "Commands": [ "sh_kick", "sh_ban" ],
    "Badge": "heart"
}

Assigning badges to users

You can also assign badges to users individually. It works the same as for groups, except you add the "Badge" or "Badges" entry to a user's data entry.

"123456": {
    "Group": "SuperAdmin",
    "Badge": "nyancat"
},

Assigning badges to columns

To assign badges to columns, use the following format for the "Badges" table:

"Badges": {
    "1": [
        "nyancat",
        "heart"
    ],
    "2": [
        "unicorn",
        "marine"
    ]
}

where the number index is the badge column, and each column contains a list of badges in it. You can assign up to 10 columns, with 5 being the middle (default) column.

Using a master table

If you want to always have certain badges live on certain columns, you can set a master table of badge columns in UserConfig.json as follows:

{
    "Badges": {
        "1": [
            "badge1", "badge1b"
        ],
        "2": [
            "badge2", "badge2b"
        ],
        "3": [
            "badge3"
        ]
    },
    "Groups": {
        "ExampleGroup1": {
            "Badges": [ "badge1", "badge2" ],
            ...
        },
        "ExampleGroup2": {
            "Badges": [ "badge1", "badge3" ],
            ...
        },
        ...
    },
    ...
}

In this example, ExampleGroup1 will have badge1 on their first column, and badge2 on their second, while ExampleGroup2 will have badge1 on their first column and badge3 on their third column.

Named Badge Lists

You can also use the master table to create named badge lists. Each list defined under Badges can be referenced in a user or group's badges using an object with a BadgeList field.

For example:

{
    "Badges": {
        "ExampleBadges": [
            // Lists can refer to other lists, which will expand to include all badges in the referenced list.
            "badge1", "badge1b", { "BadgeList": "ExtraBadges" } 
        ],
        "ExtraBadges": [
            "badge2", "badge2b"
        ]
    },
    "Groups": {
        "ExampleGroup1": {
            // This list will contain everything in the "ExampleBadges" list above.
            "Badges": [ { "BadgeList": "ExampleBadges" } ],
            ...
        },
        "ExampleGroup2": {
            "Badges": {
                "1": [ "badge3" ],
                // Badge list references can also be used per-column.
                "2": [ { "BadgeList": "ExampleBadges" } ]
            }
            ...
        },
        ...
    },
    ...
}

Forcing Badges

To force members of a group or individual users to have specific badges, add a ForcedBadges table to the user/group entry. Each key corresponds to a badge column.

For example:

{
    "Users": {
        "123456": {
            "ForcedBadges": {
            	"5": "clawmarks"
            },
            "Group": "ExampleGroup1"
        }
    },
    "Groups": {
    	"ExampleGroup1": {
    		"ForcedBadges": {
    			"4": "test"
    		}
    	}
    }
}

Here the user has badges forced in columns 4 and 5 and will be unable to change/remove them.

Clone this wiki locally