init
This commit is contained in:
commit
8084ac50b3
1629 changed files with 238620 additions and 0 deletions
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
*/
|
||||
|
||||
package dev.loki.lovisual.addon;
|
||||
|
||||
import dev.loki.lovisual.api.v0.module.ModuleExtensionContext;
|
||||
import dev.loki.lovisual.config.SettingDef;
|
||||
import dev.loki.lovisual.config.values.ConfigValue;
|
||||
import dev.loki.lovisual.config.values.ModeValue;
|
||||
import dev.loki.lovisual.features.module.Module;
|
||||
|
||||
final class ModuleExtensionContextImpl implements ModuleExtensionContext {
|
||||
private final String addonId;
|
||||
private final Module module;
|
||||
|
||||
ModuleExtensionContextImpl(String addonId, Module module) {
|
||||
this.addonId = addonId;
|
||||
this.module = module;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String addonId() {
|
||||
return addonId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String moduleId() {
|
||||
return module.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Module module() {
|
||||
return module;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSetting(SettingDef setting) {
|
||||
module.addExtensionSetting(setting);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigValue<?> getConfigValue(String configName) {
|
||||
return module.getConfigValue(configName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addModeOption(String configName, String option) {
|
||||
ConfigValue<?> value = getConfigValue(configName);
|
||||
return value instanceof ModeValue mode && mode.addOption(option);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue