use of me.ivan1f.tweakerplus.gui.HotkeyedBooleanResetListener in project tweakerplus by Ivan-1F.
the class WidgetListConfigOptionMixin method addBooleanAndHotkeyWidgets$tweakerplus.
private void addBooleanAndHotkeyWidgets$tweakerplus(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