Hide "You have been disconnected" when 5 min logged
This commit is contained in:
@@ -34,7 +34,8 @@ public interface LoginScreenConfig extends Config
|
||||
@ConfigItem(
|
||||
keyName = "syncusername",
|
||||
name = "Sync username",
|
||||
description = "Syncs the username that is currently remembered between computers"
|
||||
description = "Syncs the username that is currently remembered between computers",
|
||||
position = 1
|
||||
)
|
||||
default boolean syncUsername()
|
||||
{
|
||||
@@ -44,13 +45,25 @@ public interface LoginScreenConfig extends Config
|
||||
@ConfigItem(
|
||||
keyName = "pasteenabled",
|
||||
name = "Ctrl-V paste",
|
||||
description = "Enables Ctrl+V pasting on the login screen"
|
||||
description = "Enables Ctrl+V pasting on the login screen",
|
||||
position = 2
|
||||
)
|
||||
default boolean pasteEnabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "hideDisconnect",
|
||||
name = "Hide 5 min log message",
|
||||
description = "Hides the \"You have been disconnected\" message which appears when you get 5 minute logged",
|
||||
position = 3
|
||||
)
|
||||
default boolean hideDisconnected()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "username",
|
||||
name = "",
|
||||
|
||||
@@ -83,6 +83,8 @@ public class LoginScreenPlugin extends Plugin implements KeyListener
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
client.setHideDisconnect(config.hideDisconnected());
|
||||
|
||||
applyUsername();
|
||||
keyManager.registerKeyListener(this);
|
||||
}
|
||||
@@ -97,6 +99,8 @@ public class LoginScreenPlugin extends Plugin implements KeyListener
|
||||
client.getPreferences().setRememberedUsername(usernameCache);
|
||||
}
|
||||
|
||||
client.setHideDisconnect(false);
|
||||
|
||||
keyManager.unregisterKeyListener(this);
|
||||
}
|
||||
|
||||
@@ -249,6 +253,12 @@ public class LoginScreenPlugin extends Plugin implements KeyListener
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getKey().equals("hideDisconnect"))
|
||||
{
|
||||
client.setHideDisconnect(config.hideDisconnected());
|
||||
return;
|
||||
}
|
||||
|
||||
updateConfig();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user