Merge branch 'graphical-qol' into 'master'

Support for minimap_filter and aa_samples fields

See merge request 2009scape/09launcher!3
This commit is contained in:
Ceikry 2022-04-15 13:15:33 +00:00
commit c5caec90f3
2 changed files with 32 additions and 0 deletions

View file

@ -47,6 +47,13 @@ object Json {
rcm["left_click_attack"] = SettingsWindow.enableLeftClickAttack.isToggled rcm["left_click_attack"] = SettingsWindow.enableLeftClickAttack.isToggled
launcher["closeOnClientLaunch"] = SettingsWindow.closeLauncherOnLaunch.isToggled launcher["closeOnClientLaunch"] = SettingsWindow.closeLauncherOnLaunch.isToggled
launcher["notifyUpdates"] = Settings.CHECK_FOR_UPDATES launcher["notifyUpdates"] = Settings.CHECK_FOR_UPDATES
customization["minimap_filter"] = SettingsWindow.minimapFilter.isToggled
customization["aa_samples"] = when(SettingsWindow.aaSamples.selectedIndex)
{
0 -> 0
1 -> 8
else -> 16
}
val ip = when(SettingsWindow.profileMode.selectedIndex) val ip = when(SettingsWindow.profileMode.selectedIndex)
{ {
@ -113,6 +120,14 @@ object Json {
SettingsWindow.loginTheme.text = customization.getOrDefault("login_theme","scape main").toString() SettingsWindow.loginTheme.text = customization.getOrDefault("login_theme","scape main").toString()
SettingsWindow.enableSnowDecember.isToggled = customization.getOrDefault("december_snow", true) as Boolean SettingsWindow.enableSnowDecember.isToggled = customization.getOrDefault("december_snow", true) as Boolean
SettingsWindow.enableLeftClickAttack.isToggled = rcm.getOrDefault("left_click_attack", false) as Boolean SettingsWindow.enableLeftClickAttack.isToggled = rcm.getOrDefault("left_click_attack", false) as Boolean
SettingsWindow.minimapFilter.isToggled = customization.getOrDefault("minimap_filter",true) as Boolean
SettingsWindow.aaSamples.selectedIndex = when(customization.getOrDefault("aa_samples",0).toString().toInt())
{
0 -> 0
8 -> 1
16 -> 2
else -> 0
}
SettingsWindow.closeLauncherOnLaunch.isToggled = launcher.getOrDefault("closeOnClientLaunch", true) as Boolean SettingsWindow.closeLauncherOnLaunch.isToggled = launcher.getOrDefault("closeOnClientLaunch", true) as Boolean
Settings.CHECK_FOR_UPDATES = launcher.getOrDefault("notifyUpdates", true) as Boolean Settings.CHECK_FOR_UPDATES = launcher.getOrDefault("notifyUpdates", true) as Boolean

View file

@ -19,6 +19,7 @@ object SettingsWindow : JFrame("Client Settings") {
val xpDropModeOptions = arrayOf("instant","incremental") val xpDropModeOptions = arrayOf("instant","incremental")
val xpTrackModeOptions = arrayOf("total xp","recent skill") val xpTrackModeOptions = arrayOf("total xp","recent skill")
val profileOptions = arrayOf("Live","Testing","Local") val profileOptions = arrayOf("Live","Testing","Local")
val aaOptions = arrayOf("0", "8", "16")
var tabs = ArrayList<JPanel>() var tabs = ArrayList<JPanel>()
var buttons = ArrayList<ImgButton>() var buttons = ArrayList<ImgButton>()
@ -49,6 +50,8 @@ object SettingsWindow : JFrame("Client Settings") {
val checkForLauncherUpdates = Checkbox() val checkForLauncherUpdates = Checkbox()
var RCMPreviewInitialized = false var RCMPreviewInitialized = false
val profileMode = JComboBox(profileOptions) val profileMode = JComboBox(profileOptions)
val minimapFilter = Checkbox()
val aaSamples = JComboBox(aaOptions)
init { init {
isUndecorated = true isUndecorated = true
@ -100,6 +103,9 @@ object SettingsWindow : JFrame("Client Settings") {
val loginThemePanel = getThemedPanel(BorderLayout()) val loginThemePanel = getThemedPanel(BorderLayout())
val enableSnowDecemberPanel = getThemedPanel(BorderLayout()) val enableSnowDecemberPanel = getThemedPanel(BorderLayout())
val enableLeftClickAttackPanel = getThemedPanel(BorderLayout()) val enableLeftClickAttackPanel = getThemedPanel(BorderLayout())
val minimapFilterPanel = getThemedPanel(BorderLayout())
val aaSamplesPanel = getThemedPanel(BorderLayout())
val xpToggleLabel = getLabel("XP Drops Enabled") val xpToggleLabel = getLabel("XP Drops Enabled")
val xpDropLabel = getLabel("XP Drop Mode") val xpDropLabel = getLabel("XP Drop Mode")
val xpTrackLabel = getLabel("XP Track Mode") val xpTrackLabel = getLabel("XP Track Mode")
@ -109,6 +115,8 @@ object SettingsWindow : JFrame("Client Settings") {
val loginThemeLabel = getLabel("Login Theme") val loginThemeLabel = getLabel("Login Theme")
val enableSnowDecemberLabel = getLabel("Enable Snow During December") val enableSnowDecemberLabel = getLabel("Enable Snow During December")
val enableLeftClickAttackLabel = getLabel("Enable Left Click Attack") val enableLeftClickAttackLabel = getLabel("Enable Left Click Attack")
val minimapFilterLabel = getLabel("Smoother Minimap")
val aaSamplesLabel = getLabel("Override HD Anti-Aliasing Level")
for(field in arrayOf(loginTheme, xpDropMode, xpTrackMode, slayerColor, slayerOpacity)) for(field in arrayOf(loginTheme, xpDropMode, xpTrackMode, slayerColor, slayerOpacity))
{ {
@ -157,6 +165,15 @@ object SettingsWindow : JFrame("Client Settings") {
enableLeftClickAttackPanel.add(enableLeftClickAttackLabel, BorderLayout.WEST) enableLeftClickAttackPanel.add(enableLeftClickAttackLabel, BorderLayout.WEST)
enableLeftClickAttackPanel.add(enableLeftClickAttack, BorderLayout.EAST) enableLeftClickAttackPanel.add(enableLeftClickAttack, BorderLayout.EAST)
pane.add(enableLeftClickAttackPanel) pane.add(enableLeftClickAttackPanel)
pane.add(getSeparator())
minimapFilterPanel.add(minimapFilterLabel, BorderLayout.WEST)
minimapFilterPanel.add(minimapFilter, BorderLayout.EAST)
pane.add(minimapFilterPanel)
aaSamplesPanel.add(aaSamplesLabel, BorderLayout.WEST)
aaSamplesPanel.add(aaSamples, BorderLayout.EAST)
pane.add(aaSamplesPanel)
addTab(pane, button, getLabel("Misc Settings")) addTab(pane, button, getLabel("Misc Settings"))
} }