make keybinds on booleans not silent
This commit is contained in:
parent
520638a9f0
commit
6e094bd55a
2 changed files with 9 additions and 4 deletions
|
@ -120,11 +120,16 @@ public abstract class Feature extends ToggleButton implements SetCommand {
|
|||
Component btn = new ToggleButton(config.value(), settings, config.value()).gate(gate).hover(description);
|
||||
subComponents.add(btn);
|
||||
if(keyBound != null) {
|
||||
String keyBindString = config.value();
|
||||
String keyBindString = "Toggle ";
|
||||
if(!keyBound.value().isEmpty())
|
||||
keyBindString = keyBound.value() + " " + keyBindString;
|
||||
keyBindString += keyBound.value();
|
||||
else
|
||||
keyBindString += config.value();
|
||||
String keyBindConfig = keyBindString + " Key";
|
||||
KeyBind keyBind = new KeyBind(null, () -> btn.click(0, 0, 0), gate);
|
||||
KeyBind keyBind = new KeyBind(null, () -> {
|
||||
btn.click(0, 0, 0);
|
||||
BaseBand.notify("Toggled " + config.value() + " in " + this + " " + (btn.green ? "§aon" : "§coff"));
|
||||
}, gate);
|
||||
subComponents.add(new KeyButton(keyBindString, settings, keyBindConfig).gate(AnyGate.get(f, this, null, keyBound.allowChangeGate())).hover(description));
|
||||
BaseBand.registerUpdater(settings.linkWith(keyBind, KeyBind.KEY_FIELD).name(keyBindConfig));
|
||||
BaseBand.registerKeyBind(keyBind);
|
||||
|
|
|
@ -41,7 +41,7 @@ public class ChatCrypt extends Feature {
|
|||
|
||||
@Config("Send")
|
||||
@Description("Encrypt sent messages")
|
||||
@KeyBound("Toggle")
|
||||
@KeyBound
|
||||
public boolean send;
|
||||
|
||||
@Config("Channel")
|
||||
|
|
Loading…
Add table
Reference in a new issue