use of fi.dy.masa.malilib.config.options.ConfigBooleanHotkeyed in project Tweak-My-Client by Hendrix-Shen.
the class MixinDisconnectedScreen method onPressAutoReconnect.
private void onPressAutoReconnect() {
ConfigBooleanHotkeyed featureAutoReconnect = Configs.Feature.FEATURE_AUTO_RECONNECT;
featureAutoReconnect.setBooleanValue(!featureAutoReconnect.getBooleanValue());
if (featureAutoReconnect.getBooleanValue()) {
AutoReconnectUtils.ReconnectTimer = Configs.Generic.AUTO_RECONNECT_TIMER.getIntegerValue() * 20;
}
}
use of fi.dy.masa.malilib.config.options.ConfigBooleanHotkeyed in project tweakermore by Fallen-Breath.
the class WidgetListConfigOptionMixin method specialJudgeCustomConfigBooleanHotkeyed.
/**
* Stolen from malilib 1.18 v0.11.4
* to make compact ConfigBooleanHotkeyed option panel works
*/
@Inject(method = "wasConfigModified", at = @At(value = "INVOKE", target = "Lfi/dy/masa/malilib/gui/GuiConfigsBase$ConfigOptionWrapper;getConfig()Lfi/dy/masa/malilib/config/IConfigBase;", ordinal = 0, remap = false), cancellable = true, remap = false)
private void specialJudgeCustomConfigBooleanHotkeyed(CallbackInfoReturnable<Boolean> cir) {
IConfigBase config = this.wrapper.getConfig();
if (config instanceof ConfigBooleanHotkeyed && TweakerMoreConfigs.hasConfig(config)) {
ConfigBooleanHotkeyed booleanHotkey = (ConfigBooleanHotkeyed) config;
IKeybind keybind = booleanHotkey.getKeybind();
cir.setReturnValue(this.initialBoolean != booleanHotkey.getBooleanValue() || !Objects.equals(this.initialStringValue, keybind.getStringValue()) || !Objects.equals(this.initialKeybindSettings, keybind.getSettings()));
}
}
use of fi.dy.masa.malilib.config.options.ConfigBooleanHotkeyed in project tweakermore by Fallen-Breath.
the class WidgetListConfigOptionMixin method initInitialState.
// #if MC < 11800
/**
* Stolen from malilib 1.18 v0.11.4
* to make compact ConfigBooleanHotkeyed option panel works
*/
@Inject(method = "<init>", at = @At("TAIL"), remap = false)
private void initInitialState(CallbackInfo ci) {
if (isTweakerMoreConfigGui() && this.wrapper.getType() == GuiConfigsBase.ConfigOptionWrapper.Type.CONFIG) {
IConfigBase config = wrapper.getConfig();
if (config instanceof ConfigBooleanHotkeyed) {
this.initialBoolean = ((ConfigBooleanHotkeyed) config).getBooleanValue();
this.initialStringValue = ((ConfigBooleanHotkeyed) config).getKeybind().getStringValue();
this.initialKeybindSettings = ((ConfigBooleanHotkeyed) config).getKeybind().getSettings();
}
}
}
use of fi.dy.masa.malilib.config.options.ConfigBooleanHotkeyed in project tweakerplus by Ivan-1F.
the class WidgetListConfigOptionMixin method initInitialState$tweakerplus.
/**
* Stolen from malilib 1.18 v0.11.4
* to make compact ConfigBooleanHotkeyed option panel works
*/
@Inject(method = "<init>", at = @At("TAIL"), remap = false)
private void initInitialState$tweakerplus(CallbackInfo ci) {
if (isTweakerPlusConfigGui() && this.wrapper.getType() == GuiConfigsBase.ConfigOptionWrapper.Type.CONFIG) {
IConfigBase config = wrapper.getConfig();
if (config instanceof ConfigBooleanHotkeyed) {
this.initialBoolean = ((ConfigBooleanHotkeyed) config).getBooleanValue();
this.initialStringValue = ((ConfigBooleanHotkeyed) config).getKeybind().getStringValue();
this.initialKeybindSettings = ((ConfigBooleanHotkeyed) config).getKeybind().getSettings();
}
}
}
use of fi.dy.masa.malilib.config.options.ConfigBooleanHotkeyed in project tweakerplus by Ivan-1F.
the class WidgetListConfigOptionMixin method specialJudgeCustomConfigBooleanHotkeyed$tweakerplus.
/**
* Stolen from malilib 1.18 v0.11.4
* to make compact ConfigBooleanHotkeyed option panel works
*/
@Inject(method = "wasConfigModified", at = @At(value = "INVOKE", target = "Lfi/dy/masa/malilib/gui/GuiConfigsBase$ConfigOptionWrapper;getConfig()Lfi/dy/masa/malilib/config/IConfigBase;", ordinal = 0, remap = false), cancellable = true, remap = false)
private void specialJudgeCustomConfigBooleanHotkeyed$tweakerplus(CallbackInfoReturnable<Boolean> cir) {
IConfigBase config = this.wrapper.getConfig();
if (config instanceof ConfigBooleanHotkeyed && TweakerPlusConfigs.hasConfig(config)) {
ConfigBooleanHotkeyed booleanHotkey = (ConfigBooleanHotkeyed) config;
IKeybind keybind = booleanHotkey.getKeybind();
cir.setReturnValue(this.initialBoolean != booleanHotkey.getBooleanValue() || !Objects.equals(this.initialStringValue, keybind.getStringValue()) || !Objects.equals(this.initialKeybindSettings, keybind.getSettings()));
}
}
Aggregations