@@ -162,7 +162,10 @@ class MainActivity : Activity() {
162162 val fanLedColor : Int ,
163163 val logoLedEnabled : Boolean ,
164164 val logoLedEffect : String ,
165- val logoLedColor : Int
165+ val logoLedColor : Int ,
166+ val shoulderLedEnabled : Boolean ,
167+ val shoulderLedEffect : String ,
168+ val shoulderLedColor : Int
166169 )
167170
168171 private fun getSavedGameModeProfile (): GameModeProfile {
@@ -176,7 +179,10 @@ class MainActivity : Activity() {
176179 fanLedColor = prefs().getInt(gameModeFanLedColorKey, 5 ),
177180 logoLedEnabled = prefs().getBoolean(" game_mode_logo_led_enabled" , true ),
178181 logoLedEffect = prefs().getString(" game_mode_logo_led_effect" , " steady" ) ? : " steady" ,
179- logoLedColor = prefs().getInt(" game_mode_logo_led_color" , 1 )
182+ logoLedColor = prefs().getInt(" game_mode_logo_led_color" , 1 ),
183+ shoulderLedEnabled = prefs().getBoolean(" game_mode_shoulder_led_enabled" , true ),
184+ shoulderLedEffect = prefs().getString(" game_mode_shoulder_led_effect" , " breathe" ) ? : " breathe" ,
185+ shoulderLedColor = prefs().getInt(" game_mode_shoulder_led_color" , 8 )
180186 )
181187 }
182188
@@ -192,6 +198,9 @@ class MainActivity : Activity() {
192198 .putBoolean(" game_mode_logo_led_enabled" , profile.logoLedEnabled)
193199 .putString(" game_mode_logo_led_effect" , profile.logoLedEffect)
194200 .putInt(" game_mode_logo_led_color" , profile.logoLedColor)
201+ .putBoolean(" game_mode_shoulder_led_enabled" , profile.shoulderLedEnabled)
202+ .putString(" game_mode_shoulder_led_effect" , profile.shoulderLedEffect)
203+ .putInt(" game_mode_shoulder_led_color" , profile.shoulderLedColor)
195204 .apply ()
196205 }
197206
@@ -2778,6 +2787,9 @@ class MainActivity : Activity() {
27782787 var gmLogoLedEnabled = current.logoLedEnabled
27792788 var gmLogoLedEffect = current.logoLedEffect
27802789 var gmLogoLedColor = current.logoLedColor
2790+ var gmShoulderLedEnabled = current.shoulderLedEnabled
2791+ var gmShoulderLedEffect = current.shoulderLedEffect
2792+ var gmShoulderLedColor = current.shoulderLedColor
27812793
27822794 val logoLabel = TextView (this ).apply {
27832795 text = " Logo LED"
@@ -2863,13 +2875,115 @@ class MainActivity : Activity() {
28632875 container.addView(logoColorRow)
28642876 container.addView(logoColorRow2)
28652877
2878+ val shoulderLabel = TextView (this ).apply {
2879+ text = " Shoulder LEDs"
2880+ textSize = 13f
2881+ setTextColor(textSecondary)
2882+ setPadding(0 , dp(12 ), 0 , dp(6 ))
2883+ }
2884+
2885+ val shoulderEnable = CheckBox (this ).apply {
2886+ text = " Enable shoulder LEDs"
2887+ isChecked = gmShoulderLedEnabled
2888+ textSize = 14f
2889+ setTextColor(textPrimary)
2890+ buttonTintList = android.content.res.ColorStateList .valueOf(accent)
2891+ setOnCheckedChangeListener { _, checked ->
2892+ gmShoulderLedEnabled = checked
2893+ }
2894+ }
2895+
2896+ lateinit var shoulderSteadyBtn: Button
2897+ lateinit var shoulderBreatheBtn: Button
2898+ lateinit var shoulderFlashingBtn: Button
2899+
2900+ fun refreshShoulderEffectButtons () {
2901+ shoulderSteadyBtn.background = roundedFill(if (gmShoulderLedEffect == " steady" ) panelPressed else Color .parseColor(" #1E2633" ), 999 )
2902+ shoulderBreatheBtn.background = roundedFill(if (gmShoulderLedEffect == " breathe" ) panelPressed else Color .parseColor(" #1E2633" ), 999 )
2903+ shoulderFlashingBtn.background = roundedFill(if (gmShoulderLedEffect == " flashing" ) panelPressed else Color .parseColor(" #1E2633" ), 999 )
2904+ }
2905+
2906+ fun gmShoulderEffectBtn (label : String , value : String ): Button {
2907+ return filterChip(label, gmShoulderLedEffect == value) {
2908+ gmShoulderLedEffect = value
2909+ refreshShoulderEffectButtons()
2910+ }
2911+ }
2912+
2913+ val shoulderEffectRow = LinearLayout (this ).apply {
2914+ orientation = LinearLayout .HORIZONTAL
2915+ }
2916+
2917+ shoulderSteadyBtn = gmShoulderEffectBtn(" Steady" , " steady" )
2918+ shoulderBreatheBtn = gmShoulderEffectBtn(" Breathe" , " breathe" )
2919+ shoulderFlashingBtn = gmShoulderEffectBtn(" Flashing" , " flashing" )
2920+
2921+ shoulderEffectRow.addView(shoulderSteadyBtn)
2922+ shoulderEffectRow.addView(space(dp(8 )))
2923+ shoulderEffectRow.addView(shoulderBreatheBtn)
2924+ shoulderEffectRow.addView(space(dp(8 )))
2925+ shoulderEffectRow.addView(shoulderFlashingBtn)
2926+
2927+ lateinit var shoulderColorRow: LinearLayout
2928+ lateinit var shoulderColorRow2: LinearLayout
2929+
2930+ fun refreshShoulderColorDots () {
2931+ shoulderColorRow.getChildAt(0 ).background = colorDotDrawable(" #FF0000" , gmShoulderLedColor == 1 )
2932+ shoulderColorRow.getChildAt(2 ).background = colorDotDrawable(" #FF8C00" , gmShoulderLedColor == 3 )
2933+ shoulderColorRow.getChildAt(4 ).background = colorDotDrawable(" #FFD600" , gmShoulderLedColor == 4 )
2934+ shoulderColorRow.getChildAt(6 ).background = colorDotDrawable(" #00E676" , gmShoulderLedColor == 5 )
2935+ shoulderColorRow2.getChildAt(0 ).background = colorDotDrawable(" #00E5FF" , gmShoulderLedColor == 6 )
2936+ shoulderColorRow2.getChildAt(2 ).background = colorDotDrawable(" #1565FF" , gmShoulderLedColor == 7 )
2937+ shoulderColorRow2.getChildAt(4 ).background = colorDotDrawable(" #A020F0" , gmShoulderLedColor == 8 )
2938+ shoulderColorRow2.getChildAt(6 ).background = colorDotDrawable(" #FF69B4" , gmShoulderLedColor == 9 )
2939+ }
2940+
2941+ fun gmShoulderColorDot (id : Int , hex : String ): View {
2942+ return colorDotGeneric(hex, gmShoulderLedColor == id) {
2943+ gmShoulderLedColor = id
2944+ refreshShoulderColorDots()
2945+ }
2946+ }
2947+
2948+ shoulderColorRow = LinearLayout (this ).apply {
2949+ orientation = LinearLayout .HORIZONTAL
2950+ setPadding(0 , dp(10 ), 0 , 0 )
2951+ addView(gmShoulderColorDot(1 , " #FF0000" ))
2952+ addView(space(dp(10 )))
2953+ addView(gmShoulderColorDot(3 , " #FF8C00" ))
2954+ addView(space(dp(10 )))
2955+ addView(gmShoulderColorDot(4 , " #FFD600" ))
2956+ addView(space(dp(10 )))
2957+ addView(gmShoulderColorDot(5 , " #00E676" ))
2958+ }
2959+
2960+ shoulderColorRow2 = LinearLayout (this ).apply {
2961+ orientation = LinearLayout .HORIZONTAL
2962+ setPadding(0 , dp(10 ), 0 , 0 )
2963+ addView(gmShoulderColorDot(6 , " #00E5FF" ))
2964+ addView(space(dp(10 )))
2965+ addView(gmShoulderColorDot(7 , " #1565FF" ))
2966+ addView(space(dp(10 )))
2967+ addView(gmShoulderColorDot(8 , " #A020F0" ))
2968+ addView(space(dp(10 )))
2969+ addView(gmShoulderColorDot(9 , " #FF69B4" ))
2970+ }
2971+
2972+ container.addView(shoulderLabel)
2973+ container.addView(shoulderEnable)
2974+ container.addView(shoulderEffectRow)
2975+ container.addView(shoulderColorRow)
2976+ container.addView(shoulderColorRow2)
2977+
28662978 container.addView(buttonRow)
28672979
28682980 refreshPumpButtons()
28692981 refreshLedEffectButtons()
28702982 refreshLedColorDots()
28712983 refreshPresetBubbles()
28722984 refreshLogoColorDots()
2985+ refreshShoulderEffectButtons()
2986+ refreshShoulderColorDots()
28732987
28742988 val dialog = AlertDialog .Builder (this )
28752989 .setView(scroll)
@@ -2892,7 +3006,10 @@ class MainActivity : Activity() {
28923006 fanLedColor = gmFanLedColor,
28933007 logoLedEnabled = gmLogoLedEnabled,
28943008 logoLedEffect = gmLogoLedEffect,
2895- logoLedColor = gmLogoLedColor
3009+ logoLedColor = gmLogoLedColor,
3010+ shoulderLedEnabled = gmShoulderLedEnabled,
3011+ shoulderLedEffect = gmShoulderLedEffect,
3012+ shoulderLedColor = gmShoulderLedColor
28963013 )
28973014 )
28983015 Toast .makeText(this , " Game profile saved" , Toast .LENGTH_SHORT ).show()
0 commit comments