use of me.fallenbreath.tweakermore.gui.HotkeyedBooleanResetListener in project tweakermore by Fallen-Breath.
the class WidgetListConfigOptionMixin method addBooleanAndHotkeyWidgets.
// #if MC < 11800
private void addBooleanAndHotkeyWidgets(int x, int y, int configWidth, IHotkeyTogglable config) {
IKeybind keybind = config.getKeybind();
int booleanBtnWidth = (configWidth - 24) / 2;
ConfigButtonBoolean booleanButton = new ConfigButtonBoolean(x, y, booleanBtnWidth, 20, config);
x += booleanBtnWidth + 2;
configWidth -= booleanBtnWidth + 2 + 22;
ConfigButtonKeybind keybindButton = new ConfigButtonKeybind(x, y, configWidth, 20, keybind, this.host);
x += configWidth + 2;
this.addWidget(new WidgetKeybindSettings(x, y, 20, 20, keybind, config.getName(), this.parent, this.host.getDialogHandler()));
x += 24;
ButtonGeneric resetButton = this.createResetButton(x, y, config);
ConfigOptionChangeListenerButton booleanChangeListener = new ConfigOptionChangeListenerButton(config, resetButton, null);
HotkeyedBooleanResetListener resetListener = new HotkeyedBooleanResetListener(config, booleanButton, keybindButton, resetButton, this.host);
this.host.addKeybindChangeListener(resetListener);
this.addButton(booleanButton, booleanChangeListener);
this.addButton(keybindButton, this.host.getButtonPressListener());
this.addButton(resetButton, resetListener);
}
Aggregations