Skip to content

Commit

Permalink
Update to some malilib changes
Browse files Browse the repository at this point in the history
  • Loading branch information
maruohon committed Apr 20, 2023
1 parent 273c5d0 commit b6e5d67
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/main/java/minihud/gui/widget/InfoLineConfigWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public InfoLineConfigWidget(InfoLineToggle config,
});

this.hotkeyButton = new KeyBindConfigButton(120, 20, config.getKeyBind(), ctx.getKeybindEditingScreen());
this.hotkeyButton.setValueChangeListener(this::updateWidgetState);
this.hotkeyButton.setValueChangeListener(this::onKeybindModified);

this.settingsWidget = new KeybindSettingsWidget(config.getKeyBind(), config.getDisplayName());
}
Expand Down Expand Up @@ -121,4 +121,16 @@ public boolean wasModified()
this.config.getLineOrder() != this.initialLineOrder ||
this.config.getKeyBind().matches(this.initialHotkeyValue) == false;
}

@Override
protected void onResetButtonClicked()
{
this.config.resetToDefault();
this.ctx.getListWidget().refreshEntries();
}

protected void onKeybindModified()
{
this.ctx.getListWidget().refreshEntries();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public StructureToggleConfigWidget(StructureToggle config,
});

this.hotkeyButton = new KeyBindConfigButton(120, 20, config.getKeyBind(), ctx.getKeybindEditingScreen());
this.hotkeyButton.setValueChangeListener(this::updateWidgetState);
this.hotkeyButton.setValueChangeListener(this::onKeybindModified);

this.settingsWidget = new KeybindSettingsWidget(config.getKeyBind(), config.getDisplayName());

Expand Down Expand Up @@ -116,4 +116,16 @@ public boolean wasModified()
this.config.getColorComponents().getIntegerValue() != this.initialComponentColor ||
this.config.getKeyBind().matches(this.initialHotkeyValue) == false;
}

@Override
protected void onResetButtonClicked()
{
this.config.resetToDefault();
this.ctx.getListWidget().refreshEntries();
}

protected void onKeybindModified()
{
this.ctx.getListWidget().refreshEntries();
}
}

0 comments on commit b6e5d67

Please sign in to comment.