Skip to content

Commit

Permalink
Updated Creating plugin config panels (markdown)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhertlein committed May 9, 2020
1 parent a58911e commit 58abfc7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Creating-plugin-config-panels.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
Config options are expressed by using `@ConfigItem` annotations within a subclass of `Config`.

To get your config to be accessible from the RuneLite settings panel, you will need to flag a getter in your main plugin class with `@Provides`:

```
public class MyCoolPlugin extends Plugin {
@Inject
private MyCoolConfig config;
@Provides
MyCoolConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(MyCoolConfig.class);
}
```

In this example, a method with `boolean` return type will create a checkbox in its associated config panel, which will be checked by default:

```
Expand Down

0 comments on commit 58abfc7

Please sign in to comment.