mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-11-22 11:55:54 +01:00
Add main config header, explanation for channels
This commit is contained in:
parent
b69f1de11e
commit
1ca4e69d9a
@ -34,6 +34,12 @@ public abstract class MainConfig implements Config {
|
||||
|
||||
public static final String FILE_NAME = "config.yaml";
|
||||
|
||||
public static final String HEADER = String.join("\n", Arrays.asList(
|
||||
"Welcome to the DiscordSRV configuration file",
|
||||
"",
|
||||
""
|
||||
));
|
||||
|
||||
@Override
|
||||
public final String getFileName() {
|
||||
return FILE_NAME;
|
||||
@ -48,6 +54,12 @@ public abstract class MainConfig implements Config {
|
||||
}
|
||||
|
||||
@DefaultOnly(ChannelConfig.DEFAULT_KEY)
|
||||
@Comment("Channels configuration\n\n"
|
||||
+ "This is where everything related to in-game chat channels is configured.\n"
|
||||
+ "The key of this option is the in-game channel name (the default keys are \"global\" and \"default\")\n"
|
||||
+ "channel-ids and threads can be configured for all channels except \"default\"\n"
|
||||
+ "\"default\" is a special section which has the default values for all channels unless they are specified (overridden) under the channel's own section\n"
|
||||
+ "So if you don't specify a certain option under a channel's own section, the option will take it's value from the \"default\" section")
|
||||
public Map<String, BaseChannelConfig> channels = new LinkedHashMap<String, BaseChannelConfig>() {{
|
||||
put(GameChannel.DEFAULT_NAME, createDefaultChannel());
|
||||
put(ChannelConfig.DEFAULT_KEY, createDefaultBaseChannel());
|
||||
|
@ -22,6 +22,8 @@ import com.discordsrv.common.DiscordSRV;
|
||||
import com.discordsrv.common.config.main.MainConfig;
|
||||
import com.discordsrv.common.config.manager.loader.YamlConfigLoaderProvider;
|
||||
import com.discordsrv.common.config.manager.manager.TranslatedConfigManager;
|
||||
import org.spongepowered.configurate.ConfigurationOptions;
|
||||
import org.spongepowered.configurate.objectmapping.ObjectMapper;
|
||||
import org.spongepowered.configurate.yaml.YamlConfigurationLoader;
|
||||
|
||||
public abstract class MainConfigManager<C extends MainConfig>
|
||||
@ -32,6 +34,12 @@ public abstract class MainConfigManager<C extends MainConfig>
|
||||
super(discordSRV);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigurationOptions defaultOptions(ObjectMapper.Factory objectMapper) {
|
||||
return super.defaultOptions(objectMapper)
|
||||
.header(MainConfig.HEADER);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String fileName() {
|
||||
return MainConfig.FILE_NAME;
|
||||
|
Loading…
Reference in New Issue
Block a user