Merge pull request #2763 from open-osrs/its-not-really-an-option

rl-config: adjust warning dialogs
This commit is contained in:
Tyler Bochard
2020-08-01 17:46:22 -04:00
committed by GitHub
2 changed files with 33 additions and 41 deletions

View File

@@ -103,7 +103,7 @@ public interface RuneLiteConfig extends Config
keyName = "uiEnableCustomChrome", keyName = "uiEnableCustomChrome",
name = "Enable custom window chrome", name = "Enable custom window chrome",
description = "Use Runelite's custom window title and borders.", description = "Use Runelite's custom window title and borders.",
warning = "Please restart your client after changing this setting", warning = "Please restart your client after changing this setting.",
position = 6, position = 6,
titleSection = "uiTitle" titleSection = "uiTitle"
) )
@@ -116,8 +116,8 @@ public interface RuneLiteConfig extends Config
keyName = "borderless", keyName = "borderless",
name = "Windowed borderless", name = "Windowed borderless",
description = "Use windowed borderless mode", description = "Use windowed borderless mode",
warning = "Please restart your client after changing this setting", warning = "Please restart your client after changing this setting.",
position = 6, // I don't want to change all numbers and this moves it below the other 6, fight me position = 7,
titleSection = "uiTitle" titleSection = "uiTitle"
) )
default boolean borderless() default boolean borderless()
@@ -129,7 +129,7 @@ public interface RuneLiteConfig extends Config
keyName = "usernameInTitle", keyName = "usernameInTitle",
name = "Show display name in title", name = "Show display name in title",
description = "Toggles displaying of local player's display name in client title", description = "Toggles displaying of local player's display name in client title",
position = 7, position = 8,
titleSection = "uiTitle" titleSection = "uiTitle"
) )
default boolean usernameInTitle() default boolean usernameInTitle()
@@ -141,7 +141,7 @@ public interface RuneLiteConfig extends Config
keyName = "miscTitle", keyName = "miscTitle",
name = "Miscellaneous", name = "Miscellaneous",
description = "", description = "",
position = 8 position = 9
) )
default Title miscTitle() default Title miscTitle()
{ {
@@ -152,7 +152,7 @@ public interface RuneLiteConfig extends Config
keyName = "rememberScreenBounds", keyName = "rememberScreenBounds",
name = "Remember client position", name = "Remember client position",
description = "Save the position and size of the client after exiting", description = "Save the position and size of the client after exiting",
position = 9, position = 10,
titleSection = "miscTitle" titleSection = "miscTitle"
) )
default boolean rememberScreenBounds() default boolean rememberScreenBounds()
@@ -164,7 +164,7 @@ public interface RuneLiteConfig extends Config
keyName = "gameAlwaysOnTop", keyName = "gameAlwaysOnTop",
name = "Enable client always on top", name = "Enable client always on top",
description = "The game will always be on the top of the screen", description = "The game will always be on the top of the screen",
position = 10, position = 11,
titleSection = "miscTitle" titleSection = "miscTitle"
) )
default boolean gameAlwaysOnTop() default boolean gameAlwaysOnTop()
@@ -176,7 +176,7 @@ public interface RuneLiteConfig extends Config
keyName = "warningOnExit", keyName = "warningOnExit",
name = "Display warning on exit", name = "Display warning on exit",
description = "Toggles a warning popup when trying to exit the client", description = "Toggles a warning popup when trying to exit the client",
position = 11, position = 12,
titleSection = "miscTitle" titleSection = "miscTitle"
) )
default WarningOnExit warningOnExit() default WarningOnExit warningOnExit()
@@ -189,7 +189,7 @@ public interface RuneLiteConfig extends Config
keyName = "volume", keyName = "volume",
name = "Runelite Volume", name = "Runelite Volume",
description = "Sets the volume of custom Runelite sounds (not the client sounds)", description = "Sets the volume of custom Runelite sounds (not the client sounds)",
position = 12, position = 13,
titleSection = "miscTitle" titleSection = "miscTitle"
) )
@Units(Units.PERCENT) @Units(Units.PERCENT)
@@ -202,7 +202,7 @@ public interface RuneLiteConfig extends Config
keyName = "tooltipPosition", keyName = "tooltipPosition",
name = "Tooltip Position", name = "Tooltip Position",
description = "Configures whether to show the tooltip above or under the cursor", description = "Configures whether to show the tooltip above or under the cursor",
position = 13, position = 14,
titleSection = "miscTitle" titleSection = "miscTitle"
) )
default TooltipPositionType tooltipPosition() default TooltipPositionType tooltipPosition()
@@ -214,7 +214,7 @@ public interface RuneLiteConfig extends Config
keyName = "notificationsTitle", keyName = "notificationsTitle",
name = "Notifications", name = "Notifications",
description = "", description = "",
position = 14 position = 15
) )
default Title notificationsTitle() default Title notificationsTitle()
{ {
@@ -225,7 +225,7 @@ public interface RuneLiteConfig extends Config
keyName = "notificationTray", keyName = "notificationTray",
name = "Enable tray notifications", name = "Enable tray notifications",
description = "Enables tray notifications", description = "Enables tray notifications",
position = 15, position = 16,
titleSection = "notificationsTitle" titleSection = "notificationsTitle"
) )
default boolean enableTrayNotifications() default boolean enableTrayNotifications()
@@ -237,7 +237,7 @@ public interface RuneLiteConfig extends Config
keyName = "notificationRequestFocus", keyName = "notificationRequestFocus",
name = "Request focus on notification", name = "Request focus on notification",
description = "Configures the window focus request type on notification", description = "Configures the window focus request type on notification",
position = 16, position = 17,
titleSection = "notificationsTitle" titleSection = "notificationsTitle"
) )
default RequestFocusType notificationRequestFocus() default RequestFocusType notificationRequestFocus()
@@ -249,7 +249,7 @@ public interface RuneLiteConfig extends Config
keyName = "notificationSound", keyName = "notificationSound",
name = "Notification sound", name = "Notification sound",
description = "Enables the playing of a beep sound when notifications are displayed", description = "Enables the playing of a beep sound when notifications are displayed",
position = 17, position = 18,
titleSection = "notificationsTitle" titleSection = "notificationsTitle"
) )
default Notifier.NativeCustomOff notificationSound() default Notifier.NativeCustomOff notificationSound()
@@ -261,7 +261,7 @@ public interface RuneLiteConfig extends Config
keyName = "notificationGameMessage", keyName = "notificationGameMessage",
name = "Enable game message notifications", name = "Enable game message notifications",
description = "Puts a notification message in the chatbox", description = "Puts a notification message in the chatbox",
position = 18, position = 19,
titleSection = "notificationsTitle" titleSection = "notificationsTitle"
) )
default boolean enableGameMessageNotification() default boolean enableGameMessageNotification()
@@ -273,7 +273,7 @@ public interface RuneLiteConfig extends Config
keyName = "notificationFlash", keyName = "notificationFlash",
name = "Enable flash notification", name = "Enable flash notification",
description = "Flashes the game frame as a notification", description = "Flashes the game frame as a notification",
position = 19, position = 20,
titleSection = "notificationsTitle" titleSection = "notificationsTitle"
) )
default FlashNotification flashNotification() default FlashNotification flashNotification()
@@ -285,7 +285,7 @@ public interface RuneLiteConfig extends Config
keyName = "notificationFocused", keyName = "notificationFocused",
name = "Send notifications when focused", name = "Send notifications when focused",
description = "Toggles all notifications for when the client is focused", description = "Toggles all notifications for when the client is focused",
position = 20, position = 21,
titleSection = "notificationsTitle" titleSection = "notificationsTitle"
) )
default boolean sendNotificationsWhenFocused() default boolean sendNotificationsWhenFocused()
@@ -298,7 +298,7 @@ public interface RuneLiteConfig extends Config
keyName = "notificationFlashColor", keyName = "notificationFlashColor",
name = "Notification Flash Color", name = "Notification Flash Color",
description = "Sets the color of the notification flashes.", description = "Sets the color of the notification flashes.",
position = 21, position = 22,
titleSection = "notificationsTitle" titleSection = "notificationsTitle"
) )
default Color notificationFlashColor() default Color notificationFlashColor()
@@ -310,7 +310,7 @@ public interface RuneLiteConfig extends Config
keyName = "fontTitle", keyName = "fontTitle",
name = "Font", name = "Font",
description = "", description = "",
position = 22 position = 23
) )
default Title fontTitle() default Title fontTitle()
{ {
@@ -321,7 +321,7 @@ public interface RuneLiteConfig extends Config
keyName = "fontType", keyName = "fontType",
name = "Dynamic Overlay Font", name = "Dynamic Overlay Font",
description = "Configures what font type is used for in-game overlays such as player name, ground items, etc.", description = "Configures what font type is used for in-game overlays such as player name, ground items, etc.",
position = 23, position = 24,
titleSection = "fontTitle" titleSection = "fontTitle"
) )
default FontType fontType() default FontType fontType()
@@ -333,7 +333,7 @@ public interface RuneLiteConfig extends Config
keyName = "tooltipFontType", keyName = "tooltipFontType",
name = "Tooltip Font", name = "Tooltip Font",
description = "Configures what font type is used for in-game tooltips such as food stats, NPC names, etc.", description = "Configures what font type is used for in-game tooltips such as food stats, NPC names, etc.",
position = 24, position = 25,
titleSection = "fontTitle" titleSection = "fontTitle"
) )
default FontType tooltipFontType() default FontType tooltipFontType()
@@ -345,7 +345,7 @@ public interface RuneLiteConfig extends Config
keyName = "interfaceFontType", keyName = "interfaceFontType",
name = "Interface Overlay Font", name = "Interface Overlay Font",
description = "Configures what font type is used for in-game interface overlays such as panels, opponent info, clue scrolls etc.", description = "Configures what font type is used for in-game interface overlays such as panels, opponent info, clue scrolls etc.",
position = 25, position = 26,
titleSection = "fontTitle" titleSection = "fontTitle"
) )
default FontType interfaceFontType() default FontType interfaceFontType()
@@ -357,7 +357,7 @@ public interface RuneLiteConfig extends Config
keyName = "overlayTitle", keyName = "overlayTitle",
name = "Overlays", name = "Overlays",
description = "", description = "",
position = 26 position = 27
) )
default Title overlayTitle() default Title overlayTitle()
{ {
@@ -368,7 +368,7 @@ public interface RuneLiteConfig extends Config
keyName = "menuEntryShift", keyName = "menuEntryShift",
name = "Require Shift for overlay menu", name = "Require Shift for overlay menu",
description = "Overlay right-click menu will require shift to be added", description = "Overlay right-click menu will require shift to be added",
position = 27, position = 28,
titleSection = "overlayTitle" titleSection = "overlayTitle"
) )
default boolean menuEntryShift() default boolean menuEntryShift()
@@ -380,7 +380,7 @@ public interface RuneLiteConfig extends Config
keyName = "overlayBackgroundColor", keyName = "overlayBackgroundColor",
name = "Overlay Color", name = "Overlay Color",
description = "Configures the background color of infoboxes and overlays", description = "Configures the background color of infoboxes and overlays",
position = 28, position = 29,
titleSection = "overlayTitle" titleSection = "overlayTitle"
) )
@Alpha @Alpha
@@ -393,7 +393,7 @@ public interface RuneLiteConfig extends Config
keyName = "infoboxTitle", keyName = "infoboxTitle",
name = "Infoboxes", name = "Infoboxes",
description = "", description = "",
position = 29 position = 30
) )
default Title infoboxTitle() default Title infoboxTitle()
{ {
@@ -404,7 +404,7 @@ public interface RuneLiteConfig extends Config
keyName = "infoBoxVertical", keyName = "infoBoxVertical",
name = "Display infoboxes vertically", name = "Display infoboxes vertically",
description = "Toggles the infoboxes to display vertically", description = "Toggles the infoboxes to display vertically",
position = 30, position = 31,
titleSection = "infoboxTitle" titleSection = "infoboxTitle"
) )
default boolean infoBoxVertical() default boolean infoBoxVertical()
@@ -416,7 +416,7 @@ public interface RuneLiteConfig extends Config
keyName = "infoBoxSize", keyName = "infoBoxSize",
name = "Infobox size", name = "Infobox size",
description = "Configures the size of each infobox in pixels", description = "Configures the size of each infobox in pixels",
position = 31, position = 32,
titleSection = "infoboxTitle" titleSection = "infoboxTitle"
) )
@Units(Units.PIXELS) @Units(Units.PIXELS)
@@ -429,7 +429,7 @@ public interface RuneLiteConfig extends Config
keyName = "keybindsTitle", keyName = "keybindsTitle",
name = "Key binds", name = "Key binds",
description = "", description = "",
position = 32 position = 33
) )
default Title keybindsTitle() default Title keybindsTitle()
{ {
@@ -440,7 +440,7 @@ public interface RuneLiteConfig extends Config
keyName = "sidebarToggleKey", keyName = "sidebarToggleKey",
name = "Sidebar Toggle Key", name = "Sidebar Toggle Key",
description = "The key that will toggle the sidebar (accepts modifiers)", description = "The key that will toggle the sidebar (accepts modifiers)",
position = 33, position = 34,
titleSection = "keybindsTitle" titleSection = "keybindsTitle"
) )
default Keybind sidebarToggleKey() default Keybind sidebarToggleKey()
@@ -452,7 +452,7 @@ public interface RuneLiteConfig extends Config
keyName = "panelToggleKey", keyName = "panelToggleKey",
name = "Plugin Panel Toggle Key", name = "Plugin Panel Toggle Key",
description = "The key that will toggle the current or last opened plugin panel (accepts modifiers)", description = "The key that will toggle the current or last opened plugin panel (accepts modifiers)",
position = 34, position = 35,
titleSection = "keybindsTitle" titleSection = "keybindsTitle"
) )
default Keybind panelToggleKey() default Keybind panelToggleKey()
@@ -464,7 +464,7 @@ public interface RuneLiteConfig extends Config
keyName = "blockExtraMouseButtons", keyName = "blockExtraMouseButtons",
name = "Block Extra Mouse Buttons", name = "Block Extra Mouse Buttons",
description = "Blocks extra mouse buttons (4 and above)", description = "Blocks extra mouse buttons (4 and above)",
position = 35, position = 36,
titleSection = "keybindsTitle" titleSection = "keybindsTitle"
) )
default boolean blockExtraMouseButtons() default boolean blockExtraMouseButtons()

View File

@@ -1081,15 +1081,7 @@ class ConfigPanel extends PluginPanel
if (!Strings.isNullOrEmpty(configItem.warning())) if (!Strings.isNullOrEmpty(configItem.warning()))
{ {
final int result = JOptionPane.showOptionDialog(component, configItem.warning(), JOptionPane.showMessageDialog(component, configItem.warning(), "Warning", JOptionPane.WARNING_MESSAGE);
"Are you sure?", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE,
null, new String[]{"Yes", "No"}, "No");
if (result != JOptionPane.YES_OPTION)
{
rebuild(false);
return;
}
} }
if (component instanceof JCheckBox) if (component instanceof JCheckBox)