have toggle for CC:keep

This commit is contained in:
Daniella / Tove 2024-05-26 02:02:54 +02:00
parent 3552b973c3
commit d5ee578f57

View file

@ -68,19 +68,21 @@ public class ChatCrypt extends Feature {
@Gate(1)
public int boxSize = 256;
@Config("Allow CC:keep")
@Gate(2)
public boolean allowCCKeep = true;
@Config("Keep Trypt instance")
@Gate(2)
@Marker(3)
public boolean keepTrypt = false;
@Config("Warning! More secure, worse QOL")
@MultiGate(and = {3, -2})
@Marker(-2)
public boolean _keep_info = true;
@Config("Reset Trypt")
@MultiGate(and = {2, 3})
public Button.ClickEvent resetTrypt = btn -> trypt = null;
public Button.ClickEvent resetTrypt = btn -> {
trypt = null;
HUD.notifyAndPrint("§c§lChat>§a Trypt instance reset.");
};
private Trypt trypt;
@ -89,7 +91,6 @@ public class ChatCrypt extends Feature {
@Config("Password")
public String password = "CLICK HERE";
@SuppressWarnings("ConstantValue")
public void onEnable() {
if(password.isEmpty() || password.equalsIgnoreCase("CLICK HERE")) {
toggle();
@ -135,7 +136,7 @@ public class ChatCrypt extends Feature {
GlobalUtil.LOGGER.debug("Successfully kept Trypt key up-to-date.");
}
else {
HUD.notifyAndPrint("§c§lChat>§c Unable to keep Trypt key up-to-date. Disabled keep. (Enable and sync by sending CC:keep)");
HUD.notifyAndPrint("§c§lChat>§c Unable to keep Trypt key up-to-date. Disabled keep." + (allowCCKeep ? " (Enable and sync by sending CC:keep)" : ""));
keepTrypt = false;
}
}
@ -143,7 +144,7 @@ public class ChatCrypt extends Feature {
sentEncrypted = null;
sentOriginal = null;
if(!useSBE && message.equals("CC:keep")) {
if(!useSBE && message.equals("CC:keep") && allowCCKeep) {
keepTrypt = true;
trypt = null;
HUD.notifyAndPrint("§c§lChat>§c Enabled and synchronized Trypt keep.");