2025-03-16 17:45:29 +01:00
import { t } from "./i18n/i18n" ;
2025-03-16 14:29:14 +01:00
2025-03-16 17:45:29 +01:00
import { OptionDef , OptionId } from "./types" ;
import { getSettingValue , setSettingValue } from "./settings" ;
2025-03-30 21:07:58 +02:00
import { hoursSpentPlaying } from "./pure_functions" ;
2025-03-07 11:34:11 +01:00
export const options = {
2025-03-16 17:45:29 +01:00
sound : {
default : true ,
name : t ( "main_menu.sounds" ) ,
help : t ( "main_menu.sounds_help" ) ,
} ,
"mobile-mode" : {
default : window . innerHeight > window . innerWidth ,
name : t ( "main_menu.mobile" ) ,
help : t ( "main_menu.mobile_help" ) ,
} ,
basic : {
default : false ,
name : t ( "main_menu.basic" ) ,
help : t ( "main_menu.basic_help" ) ,
} ,
2025-03-28 10:21:14 +01:00
colorful_coins : {
default : false ,
name : t ( "main_menu.colorful_coins" ) ,
help : t ( "main_menu.colorful_coins_help" ) ,
} ,
2025-04-03 16:10:51 +02:00
extra_bright : {
default : true ,
name : t ( "main_menu.extra_bright" ) ,
help : t ( "main_menu.extra_bright_help" ) ,
} ,
2025-04-04 12:07:24 +02:00
contrast : {
default : false ,
name : t ( "main_menu.contrast" ) ,
help : t ( "main_menu.contrast_help" ) ,
} ,
2025-03-23 15:48:21 +01:00
show_fps : {
default : false ,
name : t ( "main_menu.show_fps" ) ,
help : t ( "main_menu.show_fps_help" ) ,
} ,
2025-03-28 10:21:14 +01:00
show_stats : {
default : false ,
name : t ( "main_menu.show_stats" ) ,
help : t ( "main_menu.show_stats_help" ) ,
} ,
2025-03-16 17:45:29 +01:00
pointerLock : {
default : false ,
name : t ( "main_menu.pointer_lock" ) ,
help : t ( "main_menu.pointer_lock_help" ) ,
} ,
easy : {
default : false ,
name : t ( "main_menu.kid" ) ,
help : t ( "main_menu.kid_help" ) ,
} ,
// Could not get the sharing to work without loading androidx and all the modern android things so for now I'll just disable sharing in the android app
record : {
default : false ,
name : t ( "main_menu.record" ) ,
help : t ( "main_menu.record_help" ) ,
} ,
2025-03-29 17:40:07 +01:00
fullscreen : {
default : false ,
name : t ( "main_menu.fullscreen" ) ,
help : t ( "main_menu.fullscreen_help" ) ,
} ,
2025-03-30 21:07:58 +02:00
donation_reminder : {
default : hoursSpentPlaying ( ) > 5 ,
name : t ( "main_menu.donation_reminder" ) ,
help : t ( "main_menu.donation_reminder_help" ) ,
} ,
2025-04-01 21:43:36 +02:00
red_miss : {
2025-04-04 12:07:24 +02:00
default : true ,
2025-04-01 21:43:36 +02:00
name : t ( "main_menu.red_miss" ) ,
help : t ( "main_menu.red_miss_help" ) ,
} ,
2025-04-02 19:50:05 +02:00
comboIncreaseTexts : {
2025-04-04 12:07:24 +02:00
default : true ,
2025-04-02 19:50:05 +02:00
name : t ( "main_menu.comboIncreaseTexts" ) ,
help : t ( "main_menu.comboIncreaseTexts_help" ) ,
} ,
2025-03-11 13:56:42 +01:00
} as const satisfies { [ k : string ] : OptionDef } ;
2025-03-07 11:34:11 +01:00
2025-03-15 21:29:38 +01:00
export function isOptionOn ( key : OptionId ) {
2025-03-16 17:45:29 +01:00
return getSettingValue (
"breakout-settings-enable-" + key ,
options [ key ] ? . default ,
) ;
2025-03-15 21:29:38 +01:00
}
export function toggleOption ( key : OptionId ) {
2025-03-16 17:45:29 +01:00
setSettingValue ( "breakout-settings-enable-" + key , ! isOptionOn ( key ) ) ;
}