diff --git a/Debugging.gd b/Debugging.gd index bd44a2d..e12c981 100644 --- a/Debugging.gd +++ b/Debugging.gd @@ -2,8 +2,9 @@ class_name Debug extends Node @export var debugging : bool @export var timescale : TimeScaleManager + func _unhandled_input(event): - if (debugging): + if GlobalVariables.mp_debugging: if (event.is_action_pressed(",")): Engine.time_scale = 1 timescale.moving = false diff --git a/GlobalVariables.gd b/GlobalVariables.gd index fcde210..0cbf078 100644 --- a/GlobalVariables.gd +++ b/GlobalVariables.gd @@ -1,7 +1,7 @@ extends Node -var currentVersion_nr = "v2.0.0" -var currentVersion_hotfix = 2 +var currentVersion_nr = "v2.1.0" +var currentVersion_hotfix = 10 var using_steam = true var currentVersion = "" @@ -13,9 +13,14 @@ var discord_link = "https://discord.gg/UdjMNaKkQe" var using_gl = false var controllerEnabled = false var music_enabled = true +var current_button_hovered_over : Control var colorblind = false var colorblind_color = Color(1, 1, 0) +var greyscale_death = false +var looping_input_main = false +var looping_input_secondary = false +var cursor_state_after_toggle = false var default_color_live = Color(1, 0.28, 0.29) var default_color_blank = Color(0.29, 0.5, 1) @@ -42,6 +47,228 @@ var command_line_checked = false #whether or not the command line has been check var version_to_check : String = "" #full version string that includes major, minor, patch, hotfix var steam_id_version_checked_array : Array[int] #array of steam IDs that have the version checked. this must match the steam lobby member array IDs var returning_to_main_menu_on_popup_close : bool #whether or not closing the popup window will return the user to the main menu +var active_match_customization_dictionary : Dictionary #match customization dictionary that will be used in the game. gets cleared on game end etc +var stashed_match_customization_dictionary : Dictionary #match customization dictionary that will be stored in the current game session +var previous_match_customization_differences : Dictionary #previously active match customization differences that were received by the host + +var debug_match_customization = { + "number_of_rounds": 3, + "skipping_intro": false, + "round_property_array": [ + { + "round_index": 0, + "starting_health": -1, + "item_properties": [ + { + "item_id": 1, #handsaw + "max_per_player": 2, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 2, #magnifying glass + "max_per_player": 2, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 3, #jammer + "max_per_player": 1, + "max_on_table": 1, + "is_ingame": true}, + { + "item_id": 4, #cigarettes + "max_per_player": 1, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 5, #beer + "max_per_player": 8, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 6, #burner phone + "max_per_player": 8, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 8, #adrenaline + "max_per_player": 4, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 9, #inverter + "max_per_player": 4, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 10, #remote + "max_per_player": 1, + "max_on_table": 2, + "is_ingame": true}], + "shell_load_properties": [ + { + "sequence_index": 0, + "number_of_blanks": -1, + "number_of_lives": -1, + "number_of_items": -1,}, + { + "sequence_index": 1, + "number_of_blanks": -1, + "number_of_lives": -1, + "number_of_items": -1,}, + { + "sequence_index": 2, + "number_of_blanks": -1, + "number_of_lives": -1, + "number_of_items": -1,}, + { + "sequence_index": 3, + "number_of_blanks": -1, + "number_of_lives": -1, + "number_of_items": -1,},]}, + { + "round_index": 1, + "starting_health": -1, + "item_properties": [ + { + "item_id": 1, #handsaw + "max_per_player": 2, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 2, #magnifying glass + "max_per_player": 2, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 3, #jammer + "max_per_player": 1, + "max_on_table": 1, + "is_ingame": true}, + { + "item_id": 4, #cigarettes + "max_per_player": 1, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 5, #beer + "max_per_player": 8, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 6, #burner phone + "max_per_player": 8, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 8, #adrenaline + "max_per_player": 4, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 9, #inverter + "max_per_player": 4, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 10, #remote + "max_per_player": 1, + "max_on_table": 2, + "is_ingame": true}], + "shell_load_properties": [ + { + "sequence_index": 0, + "number_of_blanks": -1, + "number_of_lives": -1, + "number_of_items": -1,}, + { + "sequence_index": 1, + "number_of_blanks": -1, + "number_of_lives": -1, + "number_of_items": -1,}, + { + "sequence_index": 2, + "number_of_blanks": -1, + "number_of_lives": -1, + "number_of_items": -1,}, + { + "sequence_index": 3, + "number_of_blanks": -1, + "number_of_lives": -1, + "number_of_items": -1,},] + }, + { + "round_index": 2, + "starting_health": -1, + "item_properties": [ + { + "item_id": 1, #handsaw + "max_per_player": 2, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 2, #magnifying glass + "max_per_player": 2, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 3, #jammer + "max_per_player": 1, + "max_on_table": 1, + "is_ingame": true}, + { + "item_id": 4, #cigarettes + "max_per_player": 1, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 5, #beer + "max_per_player": 8, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 6, #burner phone + "max_per_player": 8, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 8, #adrenaline + "max_per_player": 4, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 9, #inverter + "max_per_player": 4, + "max_on_table": 32, + "is_ingame": true}, + { + "item_id": 10, #remote + "max_per_player": 1, + "max_on_table": 2, + "is_ingame": true}], + "shell_load_properties": [ + { + "sequence_index": 0, + "number_of_blanks": -1, + "number_of_lives": -1, + "number_of_items": -1,}, + { + "sequence_index": 1, + "number_of_blanks": -1, + "number_of_lives": -1, + "number_of_items": -1,}, + { + "sequence_index": 2, + "number_of_blanks": -1, + "number_of_lives": -1, + "number_of_items": -1,}, + { + "sequence_index": 3, + "number_of_blanks": -1, + "number_of_lives": -1, + "number_of_items": -1,},] + } + ] +} func _ready(): if using_steam: currentVersion = currentVersion_nr + versuffix_steam @@ -51,6 +278,9 @@ func _ready(): original_volume_linear_music = db_to_linear(AudioServer.get_bus_volume_db(1)) version_to_check = currentVersion_nr + "." + str(currentVersion_hotfix) print("running full version name: ", version_to_check) + if GlobalVariables.mp_debugging: + TranslationServer.set_locale("EN") + active_match_customization_dictionary = debug_match_customization func _unhandled_input(event): if GlobalVariables.mp_debugging: @@ -70,7 +300,6 @@ func _unhandled_input(event): var language_array = ["EN", "EE", "RU", "ES LATAM", "ES", "FR", "IT", "JA", "KO", "PL", "PT", "DE", "TR", "UA", "ZHS", "ZHT"] var index = 0 func SwapLanguage(dir : bool): - return if dir: if index == language_array.size() - 1: index = 0 diff --git a/ItemInteraction.gd b/ItemInteraction.gd index d406dbd..5560df4 100644 --- a/ItemInteraction.gd +++ b/ItemInteraction.gd @@ -1,3 +1,4 @@ + class_name ItemInteraction extends Node @export var medicine : Medicine diff --git a/KeyRebinding.gd b/KeyRebinding.gd index 8621845..219229d 100644 --- a/KeyRebinding.gd +++ b/KeyRebinding.gd @@ -29,6 +29,7 @@ func UpdateBindList(): bindkey_keyboard = bindkey_keyboard.trim_suffix("(Physical)") bindkey_keyboard = bindkey_keyboard.replace(" ", "") bindkey_controller = bindkey_controller.left(firstindex) + bindkey_controller = bindkey_controller.replace("Joypad Motion on", "") keylabel.text = bindkey_keyboard + ", " + bindkey_controller options.ParseInputMapDictionary() diff --git a/MenuManager.gd b/MenuManager.gd index f1613b1..7258a1d 100644 --- a/MenuManager.gd +++ b/MenuManager.gd @@ -53,6 +53,7 @@ func _ready(): buttons_options[5].connect("is_pressed", ControllerDisable) buttons_options[6].connect("is_pressed", ToggleColorblind) buttons_options[7].connect("is_pressed", ToggleMusic) + buttons_options[8].connect("is_pressed", ToggleGreyscaleDeath) version.text = GlobalVariables.currentVersion @@ -253,6 +254,8 @@ func ToggleMusic(): optionmanager.AdjustSettings_music() func ToggleColorblind(): optionmanager.ToggleColorblind() +func ToggleGreyscaleDeath(): + optionmanager.ToggleGreyscaleDeath() func DiscordLink(): OS.shell_open(GlobalVariables.discord_link) func RebindControls(): diff --git a/OptionsManager.gd b/OptionsManager.gd index 41cdc5b..ca1f0a5 100644 --- a/OptionsManager.gd +++ b/OptionsManager.gd @@ -13,7 +13,8 @@ var defaultOption_inputmap_keyboard = { "ui_up": InputMap.action_get_events("ui_up")[0], "ui_down": InputMap.action_get_events("ui_down")[0], "reset": InputMap.action_get_events("reset")[0], - "exit game": InputMap.action_get_events("exit game")[0] + "exit game": InputMap.action_get_events("exit game")[0], + "free look toggle": InputMap.action_get_events("free look toggle")[0], } var defaultOption_inputmap_controller = { "ui_accept": InputMap.action_get_events("ui_accept")[1], @@ -23,7 +24,8 @@ var defaultOption_inputmap_controller = { "ui_up": InputMap.action_get_events("ui_up")[1], "ui_down": InputMap.action_get_events("ui_down")[1], "reset": InputMap.action_get_events("reset")[1], - "exit game": InputMap.action_get_events("exit game")[1] + "exit game": InputMap.action_get_events("exit game")[1], + "free look toggle": InputMap.action_get_events("free look toggle")[1], } @export var ui_windowed : CanvasItem @@ -35,6 +37,7 @@ var defaultOption_inputmap_controller = { @export var menu : MenuManager @export var ui_volume : Label @export var checkmark_colorblind : Checkmark +@export var checkmark_greyscale : Checkmark const savePath := "user://buckshotroulette_options_12.shell" var data = {} @@ -46,6 +49,7 @@ var setting_windowed = false var setting_language = "EN" var setting_controllerEnabled = false var setting_colorblind = false +var setting_greyscale_death = true var setting_music_enabled = true func _ready(): @@ -60,6 +64,7 @@ func _ready(): ApplySettings_controller() ApplySettings_language() ApplySettings_inputmap() + ApplySettings_greyscaledeath() func Printout(): print("user current version: ", GlobalVariables.currentVersion) @@ -101,6 +106,11 @@ func ToggleColorblind(): checkmark_colorblind.UpdateCheckmark(setting_colorblind) ApplySettings_colorblind() +func ToggleGreyscaleDeath(): + setting_greyscale_death = !setting_greyscale_death + checkmark_greyscale.UpdateCheckmark(setting_greyscale_death) + ApplySettings_greyscaledeath() + func AdjustLanguage(alias : String): setting_language = alias ApplySettings_language() @@ -164,7 +174,8 @@ func ParseInputMapDictionary(): "ui_up": var_to_str(InputMap.action_get_events("ui_up")[0]), "ui_down": var_to_str(InputMap.action_get_events("ui_down")[0]), "reset": var_to_str(InputMap.action_get_events("reset")[0]), - "exit game": var_to_str(InputMap.action_get_events("exit game")[0]) + "exit game": var_to_str(InputMap.action_get_events("exit game")[0]), + "free look toggle": var_to_str(InputMap.action_get_events("free look toggle")[0]) } setting_inputmap_controller = { "ui_accept": var_to_str(InputMap.action_get_events("ui_accept")[1]), @@ -174,7 +185,8 @@ func ParseInputMapDictionary(): "ui_up": var_to_str(InputMap.action_get_events("ui_up")[1]), "ui_down": var_to_str(InputMap.action_get_events("ui_down")[1]), "reset": var_to_str(InputMap.action_get_events("reset")[1]), - "exit game": var_to_str(InputMap.action_get_events("exit game")[1]) + "exit game": var_to_str(InputMap.action_get_events("exit game")[1]), + "free look toggle": var_to_str(InputMap.action_get_events("free look toggle")[1]) } func ResetControls(): @@ -204,6 +216,10 @@ func ApplySettings_language(): func ApplySettings_colorblind(): GlobalVariables.colorblind = setting_colorblind +func ApplySettings_greyscaledeath(): + GlobalVariables.greyscale_death = setting_greyscale_death + checkmark_greyscale.UpdateCheckmark(GlobalVariables.greyscale_death) + func SaveSettings(): data = { #"has_read_introduction": roundManager.playerData.hasReadIntroduction, @@ -214,7 +230,8 @@ func SaveSettings(): "setting_inputmap_keyboard": setting_inputmap_keyboard, "setting_inputmap_controller": setting_inputmap_controller, "setting_colorblind": setting_colorblind, - "setting_music_enabled": setting_music_enabled + "setting_music_enabled": setting_music_enabled, + "setting_greyscale_death": setting_greyscale_death, } print("attempting to save settings") var file = FileAccess.open(savePath, FileAccess.WRITE) @@ -240,6 +257,9 @@ func LoadSettings(): if (checkmark_colorblind != null): checkmark_colorblind.UpdateCheckmark(setting_colorblind) if (data.has('setting_music_enabled')): setting_music_enabled = data.setting_music_enabled + if (data.has('setting_greyscale_death')): + setting_greyscale_death = data.setting_greyscale_death + if (checkmark_greyscale != null): checkmark_greyscale.UpdateCheckmark(setting_greyscale_death) file.close() print("---------------------------------") print("user settings: ", data) @@ -253,5 +273,6 @@ func LoadSettings(): ApplySettings_controller() ApplySettings_inputmap() ApplySettings_colorblind() + ApplySettings_greyscaledeath() receivedFile = true else: print("user does not have settings file")