This commit is contained in:
Lyssa 2024-11-16 15:24:36 +04:00 committed by GitHub
parent 6f47bf7fb4
commit a914e17fe9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 265 additions and 9 deletions

View File

@ -2,8 +2,9 @@ class_name Debug extends Node
@export var debugging : bool @export var debugging : bool
@export var timescale : TimeScaleManager @export var timescale : TimeScaleManager
func _unhandled_input(event): func _unhandled_input(event):
if (debugging): if GlobalVariables.mp_debugging:
if (event.is_action_pressed(",")): if (event.is_action_pressed(",")):
Engine.time_scale = 1 Engine.time_scale = 1
timescale.moving = false timescale.moving = false

View File

@ -1,7 +1,7 @@
extends Node extends Node
var currentVersion_nr = "v2.0.0" var currentVersion_nr = "v2.1.0"
var currentVersion_hotfix = 2 var currentVersion_hotfix = 10
var using_steam = true var using_steam = true
var currentVersion = "" var currentVersion = ""
@ -13,9 +13,14 @@ var discord_link = "https://discord.gg/UdjMNaKkQe"
var using_gl = false var using_gl = false
var controllerEnabled = false var controllerEnabled = false
var music_enabled = true var music_enabled = true
var current_button_hovered_over : Control
var colorblind = false var colorblind = false
var colorblind_color = Color(1, 1, 0) 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_live = Color(1, 0.28, 0.29)
var default_color_blank = Color(0.29, 0.5, 1) 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 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 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 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(): func _ready():
if using_steam: currentVersion = currentVersion_nr + versuffix_steam 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)) original_volume_linear_music = db_to_linear(AudioServer.get_bus_volume_db(1))
version_to_check = currentVersion_nr + "." + str(currentVersion_hotfix) version_to_check = currentVersion_nr + "." + str(currentVersion_hotfix)
print("running full version name: ", version_to_check) 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): func _unhandled_input(event):
if GlobalVariables.mp_debugging: 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 language_array = ["EN", "EE", "RU", "ES LATAM", "ES", "FR", "IT", "JA", "KO", "PL", "PT", "DE", "TR", "UA", "ZHS", "ZHT"]
var index = 0 var index = 0
func SwapLanguage(dir : bool): func SwapLanguage(dir : bool):
return
if dir: if dir:
if index == language_array.size() - 1: if index == language_array.size() - 1:
index = 0 index = 0

View File

@ -1,3 +1,4 @@
class_name ItemInteraction extends Node class_name ItemInteraction extends Node
@export var medicine : Medicine @export var medicine : Medicine

View File

@ -29,6 +29,7 @@ func UpdateBindList():
bindkey_keyboard = bindkey_keyboard.trim_suffix("(Physical)") bindkey_keyboard = bindkey_keyboard.trim_suffix("(Physical)")
bindkey_keyboard = bindkey_keyboard.replace(" ", "") bindkey_keyboard = bindkey_keyboard.replace(" ", "")
bindkey_controller = bindkey_controller.left(firstindex) bindkey_controller = bindkey_controller.left(firstindex)
bindkey_controller = bindkey_controller.replace("Joypad Motion on", "")
keylabel.text = bindkey_keyboard + ", " + bindkey_controller keylabel.text = bindkey_keyboard + ", " + bindkey_controller
options.ParseInputMapDictionary() options.ParseInputMapDictionary()

View File

@ -53,6 +53,7 @@ func _ready():
buttons_options[5].connect("is_pressed", ControllerDisable) buttons_options[5].connect("is_pressed", ControllerDisable)
buttons_options[6].connect("is_pressed", ToggleColorblind) buttons_options[6].connect("is_pressed", ToggleColorblind)
buttons_options[7].connect("is_pressed", ToggleMusic) buttons_options[7].connect("is_pressed", ToggleMusic)
buttons_options[8].connect("is_pressed", ToggleGreyscaleDeath)
version.text = GlobalVariables.currentVersion version.text = GlobalVariables.currentVersion
@ -253,6 +254,8 @@ func ToggleMusic():
optionmanager.AdjustSettings_music() optionmanager.AdjustSettings_music()
func ToggleColorblind(): func ToggleColorblind():
optionmanager.ToggleColorblind() optionmanager.ToggleColorblind()
func ToggleGreyscaleDeath():
optionmanager.ToggleGreyscaleDeath()
func DiscordLink(): func DiscordLink():
OS.shell_open(GlobalVariables.discord_link) OS.shell_open(GlobalVariables.discord_link)
func RebindControls(): func RebindControls():

View File

@ -13,7 +13,8 @@ var defaultOption_inputmap_keyboard = {
"ui_up": InputMap.action_get_events("ui_up")[0], "ui_up": InputMap.action_get_events("ui_up")[0],
"ui_down": InputMap.action_get_events("ui_down")[0], "ui_down": InputMap.action_get_events("ui_down")[0],
"reset": InputMap.action_get_events("reset")[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 = { var defaultOption_inputmap_controller = {
"ui_accept": InputMap.action_get_events("ui_accept")[1], "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_up": InputMap.action_get_events("ui_up")[1],
"ui_down": InputMap.action_get_events("ui_down")[1], "ui_down": InputMap.action_get_events("ui_down")[1],
"reset": InputMap.action_get_events("reset")[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 @export var ui_windowed : CanvasItem
@ -35,6 +37,7 @@ var defaultOption_inputmap_controller = {
@export var menu : MenuManager @export var menu : MenuManager
@export var ui_volume : Label @export var ui_volume : Label
@export var checkmark_colorblind : Checkmark @export var checkmark_colorblind : Checkmark
@export var checkmark_greyscale : Checkmark
const savePath := "user://buckshotroulette_options_12.shell" const savePath := "user://buckshotroulette_options_12.shell"
var data = {} var data = {}
@ -46,6 +49,7 @@ var setting_windowed = false
var setting_language = "EN" var setting_language = "EN"
var setting_controllerEnabled = false var setting_controllerEnabled = false
var setting_colorblind = false var setting_colorblind = false
var setting_greyscale_death = true
var setting_music_enabled = true var setting_music_enabled = true
func _ready(): func _ready():
@ -60,6 +64,7 @@ func _ready():
ApplySettings_controller() ApplySettings_controller()
ApplySettings_language() ApplySettings_language()
ApplySettings_inputmap() ApplySettings_inputmap()
ApplySettings_greyscaledeath()
func Printout(): func Printout():
print("user current version: ", GlobalVariables.currentVersion) print("user current version: ", GlobalVariables.currentVersion)
@ -101,6 +106,11 @@ func ToggleColorblind():
checkmark_colorblind.UpdateCheckmark(setting_colorblind) checkmark_colorblind.UpdateCheckmark(setting_colorblind)
ApplySettings_colorblind() ApplySettings_colorblind()
func ToggleGreyscaleDeath():
setting_greyscale_death = !setting_greyscale_death
checkmark_greyscale.UpdateCheckmark(setting_greyscale_death)
ApplySettings_greyscaledeath()
func AdjustLanguage(alias : String): func AdjustLanguage(alias : String):
setting_language = alias setting_language = alias
ApplySettings_language() ApplySettings_language()
@ -164,7 +174,8 @@ func ParseInputMapDictionary():
"ui_up": var_to_str(InputMap.action_get_events("ui_up")[0]), "ui_up": var_to_str(InputMap.action_get_events("ui_up")[0]),
"ui_down": var_to_str(InputMap.action_get_events("ui_down")[0]), "ui_down": var_to_str(InputMap.action_get_events("ui_down")[0]),
"reset": var_to_str(InputMap.action_get_events("reset")[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 = { setting_inputmap_controller = {
"ui_accept": var_to_str(InputMap.action_get_events("ui_accept")[1]), "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_up": var_to_str(InputMap.action_get_events("ui_up")[1]),
"ui_down": var_to_str(InputMap.action_get_events("ui_down")[1]), "ui_down": var_to_str(InputMap.action_get_events("ui_down")[1]),
"reset": var_to_str(InputMap.action_get_events("reset")[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(): func ResetControls():
@ -204,6 +216,10 @@ func ApplySettings_language():
func ApplySettings_colorblind(): func ApplySettings_colorblind():
GlobalVariables.colorblind = setting_colorblind GlobalVariables.colorblind = setting_colorblind
func ApplySettings_greyscaledeath():
GlobalVariables.greyscale_death = setting_greyscale_death
checkmark_greyscale.UpdateCheckmark(GlobalVariables.greyscale_death)
func SaveSettings(): func SaveSettings():
data = { data = {
#"has_read_introduction": roundManager.playerData.hasReadIntroduction, #"has_read_introduction": roundManager.playerData.hasReadIntroduction,
@ -214,7 +230,8 @@ func SaveSettings():
"setting_inputmap_keyboard": setting_inputmap_keyboard, "setting_inputmap_keyboard": setting_inputmap_keyboard,
"setting_inputmap_controller": setting_inputmap_controller, "setting_inputmap_controller": setting_inputmap_controller,
"setting_colorblind": setting_colorblind, "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") print("attempting to save settings")
var file = FileAccess.open(savePath, FileAccess.WRITE) var file = FileAccess.open(savePath, FileAccess.WRITE)
@ -240,6 +257,9 @@ func LoadSettings():
if (checkmark_colorblind != null): checkmark_colorblind.UpdateCheckmark(setting_colorblind) if (checkmark_colorblind != null): checkmark_colorblind.UpdateCheckmark(setting_colorblind)
if (data.has('setting_music_enabled')): if (data.has('setting_music_enabled')):
setting_music_enabled = data.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() file.close()
print("---------------------------------") print("---------------------------------")
print("user settings: ", data) print("user settings: ", data)
@ -253,5 +273,6 @@ func LoadSettings():
ApplySettings_controller() ApplySettings_controller()
ApplySettings_inputmap() ApplySettings_inputmap()
ApplySettings_colorblind() ApplySettings_colorblind()
ApplySettings_greyscaledeath()
receivedFile = true receivedFile = true
else: print("user does not have settings file") else: print("user does not have settings file")