mirror of
https://github.com/thecatontheceiling/buckshotroulette-decomp.git
synced 2024-11-26 23:47:10 +00:00
v1.2.2 changes
- Localization fixes. - Top leaderboard scores can now be cycled with the arrow keys on the computer. - Added music toggle to audio/video settings.
This commit is contained in:
parent
a86f69ecf1
commit
cd02fa8dd8
@ -1,9 +1,11 @@
|
||||
class_name Achievement extends Node
|
||||
|
||||
func UnlockAchievement(apiname : String):
|
||||
if GlobalVariables.using_steam:
|
||||
Steam.setAchievement(apiname)
|
||||
Steam.storeStats()
|
||||
|
||||
func ClearAchievement(apiname : String):
|
||||
if GlobalVariables.using_steam:
|
||||
Steam.clearAchievement(apiname)
|
||||
Steam.storeStats()
|
||||
|
@ -17,9 +17,13 @@ class_name ButtonClass extends Node
|
||||
@export var ui_opacity_inactive : float = 1
|
||||
@export var ui_opacity_active : float = .78
|
||||
@export var resetting : bool
|
||||
@export var adding_cursor : bool
|
||||
@export var t : Label
|
||||
var mainActive = true
|
||||
var orig
|
||||
|
||||
func _ready():
|
||||
if (adding_cursor): orig = t.text
|
||||
ui_control = get_parent()
|
||||
get_parent().connect("focus_entered", OnHover)
|
||||
get_parent().connect("focus_exited", OnExit)
|
||||
@ -42,12 +46,14 @@ func OnHover():
|
||||
speaker_hover.play()
|
||||
ui.modulate.a = ui_opacity_active
|
||||
cursor.SetCursorImage("hover")
|
||||
if (adding_cursor): t.text = "< " + tr(orig) + " >"
|
||||
|
||||
func OnExit():
|
||||
if (isActive && mainActive):
|
||||
if (isDynamic):
|
||||
ui.modulate.a = ui_opacity_inactive
|
||||
cursor.SetCursorImage("point")
|
||||
if (adding_cursor): t.text = tr(orig)
|
||||
|
||||
signal is_pressed
|
||||
func OnPress():
|
||||
|
@ -51,8 +51,11 @@ func _unhandled_input(event):
|
||||
if (event.is_action_pressed("ui_right") && viewing):
|
||||
Interaction("right")
|
||||
|
||||
func DisableCRT():
|
||||
SetCRT(false)
|
||||
|
||||
func SetCRT(state : bool):
|
||||
if (state):
|
||||
if (state && GlobalVariables.using_steam):
|
||||
bathroom_normal.set_layer_mask_value(1, false)
|
||||
bathroom_broken.visible = true
|
||||
for obj in objarray_normal: obj.visible = false
|
||||
@ -80,11 +83,13 @@ func Interaction(alias : String):
|
||||
if (selection_range2 <= board.active_entry_count && window_index == 0):
|
||||
selection_range1 += 12
|
||||
selection_range2 += 12
|
||||
if (window_index == 0): board.DownloadEntries(selection_range1, selection_range2, "top")
|
||||
"left":
|
||||
branch_left.get_parent().get_child(1).Press()
|
||||
if (selection_range1 != 1 && window_index == 0):
|
||||
selection_range1 -= 12
|
||||
selection_range2 -= 12
|
||||
if (window_index == 0): board.DownloadEntries(selection_range1, selection_range2, "top")
|
||||
"window":
|
||||
branch_window.get_parent().get_child(1).Press()
|
||||
CycleWindow()
|
||||
|
@ -171,7 +171,7 @@ func FinalScore():
|
||||
label_array[4].text = text_beerDrank
|
||||
label_array[5].text = text_totalcash
|
||||
IncrementGlobalStats()
|
||||
if endless_overwriting: board.UploadScore(roundManager.double_or_nothing_rounds_beat, roundManager.double_or_nothing_score, roundManager.double_or_nothing_initial_score)
|
||||
if endless_overwriting && GlobalVariables.using_steam: board.UploadScore(roundManager.double_or_nothing_rounds_beat, roundManager.double_or_nothing_score, roundManager.double_or_nothing_initial_score)
|
||||
|
||||
var playerdata = {}
|
||||
|
||||
|
@ -1,8 +1,16 @@
|
||||
extends Node
|
||||
|
||||
var currentVersion = "v1.2.1 (STEAM)"
|
||||
var currentVersion_nr = "v1.2.2"
|
||||
var currentVersion_hotfix = 0
|
||||
var using_steam = true
|
||||
|
||||
var currentVersion = ""
|
||||
var versuffix_steam = " (STEAM)"
|
||||
var versuffix_itch = " (ITCH.IO)"
|
||||
|
||||
var using_gl = false
|
||||
var controllerEnabled = false
|
||||
var music_enabled = true
|
||||
|
||||
var colorblind = false
|
||||
var colorblind_color = Color(1, 1, 0)
|
||||
@ -11,3 +19,7 @@ var default_color_live = Color(1, 0.28, 0.29)
|
||||
var default_color_blank = Color(0.29, 0.5, 1)
|
||||
var colorblind_color_live = Color(1, 1, 1)
|
||||
var colorblind_color_blank = Color(0.34, 0.34, 0.34)
|
||||
|
||||
func _ready():
|
||||
if using_steam: currentVersion = currentVersion_nr + versuffix_steam
|
||||
else: currentVersion = currentVersion_nr + versuffix_itch
|
||||
|
@ -90,10 +90,12 @@ func MainBathroomStart():
|
||||
intbranch_bathroomdoor.interactionAllowed = true
|
||||
if (allowingPills):
|
||||
intbranch_pillbottle.interactionAllowed = true
|
||||
intbranch_crt.interactionAllowed = true
|
||||
if (GlobalVariables.using_steam): intbranch_crt.interactionAllowed = true
|
||||
if (cursor.controller_active): btn_bathroomdoor.grab_focus()
|
||||
controller.previousFocus = btn_bathroomdoor
|
||||
if (allowingPills): btn_pills.visible = true; btn_screen.visible = true
|
||||
if (allowingPills):
|
||||
btn_pills.visible = true
|
||||
if (GlobalVariables.using_steam): btn_screen.visible = true
|
||||
btn_bathroomdoor.visible = true
|
||||
anim_pillflicker.play("flicker pill")
|
||||
|
||||
@ -139,9 +141,10 @@ func RevivalBathroomStart():
|
||||
cursor.SetCursor(true, true)
|
||||
if (allowingPills):
|
||||
intbranch_pillbottle.interactionAllowed = true
|
||||
if (GlobalVariables.using_steam):
|
||||
intbranch_crt.interactionAllowed = true
|
||||
btn_pills.visible = true
|
||||
btn_screen.visible = true
|
||||
btn_pills.visible = true
|
||||
anim_pillflicker.play("flicker pill")
|
||||
if (cursor.controller_active): btn_bathroomdoor.grab_focus()
|
||||
controller.previousFocus = btn_bathroomdoor
|
||||
|
@ -14,5 +14,6 @@ func Prevent():
|
||||
if (loc == "ES" or loc == "JA"): self.get_parent().visible = false
|
||||
if (loc == "JA"): text_dealer.scale = Vector3(1.409, 2.466, 1.752)
|
||||
else:
|
||||
if (loc == "DE" or loc == "ES" or loc == "ES LATAM" or loc == "BR" or loc == "PT" or loc == "PL" or loc == "TR"): self.get_parent().text = "< >"
|
||||
else: self.get_parent().text = "< >"
|
||||
#if (loc == "DE" or loc == "ES" or loc == "ES LATAM" or loc == "BR" or loc == "PT" or loc == "PL" or loc == "TR"): self.get_parent().text = "< >"
|
||||
#else: self.get_parent().text = "< >"
|
||||
self.get_parent().text = ""
|
||||
|
@ -19,6 +19,7 @@ var active_entry_count = 0
|
||||
func _ready():
|
||||
display_instances_act = display_instances
|
||||
ClearDisplay()
|
||||
if !GlobalVariables.using_steam: return
|
||||
Steam.leaderboard_find_result.connect(_on_leaderboard_find_result)
|
||||
Steam.leaderboard_score_uploaded.connect(_on_leaderboard_score_uploaded)
|
||||
Steam.leaderboard_scores_downloaded.connect(_on_leaderboard_scores_downloaded)
|
||||
@ -167,10 +168,17 @@ func UpdateStats():
|
||||
func GetLeaderboard():
|
||||
Steam.findLeaderboard("double_or_nothing")
|
||||
|
||||
func UploadScore_Deprecated(rounds_beat, visible_score, initial_score):
|
||||
var ar = PackedInt32Array([initial_score, rounds_beat])
|
||||
var upload = initial_score * rounds_beat
|
||||
Steam.uploadLeaderboardScore(upload, true, ar, leaderboard_handle)
|
||||
|
||||
func UploadScore(rounds_beat, visible_score, initial_score):
|
||||
var ar = PackedInt32Array([initial_score, rounds_beat])
|
||||
var score_to_upload = initial_score * rounds_beat
|
||||
Steam.uploadLeaderboardScore(score_to_upload, true, ar, leaderboard_handle)
|
||||
var upload = initial_score
|
||||
for s in range(rounds_beat - 1): upload *= 2
|
||||
upload = val2compressed(upload)
|
||||
Steam.uploadLeaderboardScore(upload, true, ar, leaderboard_handle)
|
||||
|
||||
func _on_leaderboard_score_uploaded(success: int, this_handle: int, this_score: Dictionary) -> void:
|
||||
if success == 1:
|
||||
@ -188,6 +196,7 @@ func _on_leaderboard_find_result(handle: int, found: int) -> void:
|
||||
var checking_friends = false
|
||||
var checking_overview = false
|
||||
func DownloadEntries(range1 : int, range2 : int, alias : String):
|
||||
if !GlobalVariables.using_steam: return
|
||||
match alias:
|
||||
"top":
|
||||
checking_friends = false
|
||||
@ -221,7 +230,7 @@ func _on_leaderboard_scores_downloaded(message: String, this_leaderboard_handle:
|
||||
active_result_array = result
|
||||
active_entry_count = Steam.getLeaderboardEntryCount(leaderboard_handle)
|
||||
|
||||
for this_result in result: if (print_cur <= print_max): print("leaderboard result (", print_cur, "/", print_max, ")", this_result); print_cur += 1
|
||||
for this_result in result: if (print_cur <= print_max): print("leaderboard result (", print_cur, "/", print_max, ")", this_result, Steam.getFriendPersonaName(this_result.steam_id)); print_cur += 1
|
||||
UpdateDisplay()
|
||||
|
||||
func val2compressed(val):
|
||||
|
@ -49,6 +49,7 @@ func _ready():
|
||||
buttons_options[4].connect("is_pressed", ControllerEnable)
|
||||
buttons_options[5].connect("is_pressed", ControllerDisable)
|
||||
buttons_options[6].connect("is_pressed", ToggleColorblind)
|
||||
buttons_options[7].connect("is_pressed", ToggleMusic)
|
||||
|
||||
version.text = GlobalVariables.currentVersion
|
||||
|
||||
@ -177,6 +178,8 @@ func ResetControls():
|
||||
optionmanager.ResetControls()
|
||||
ResetButtons()
|
||||
|
||||
func ToggleMusic():
|
||||
optionmanager.AdjustSettings_music()
|
||||
func ToggleColorblind():
|
||||
optionmanager.ToggleColorblind()
|
||||
func DiscordLink():
|
||||
|
@ -46,6 +46,7 @@ var setting_windowed = false
|
||||
var setting_language = "EN"
|
||||
var setting_controllerEnabled = false
|
||||
var setting_colorblind = false
|
||||
var setting_music_enabled = true
|
||||
|
||||
func _ready():
|
||||
Printout()
|
||||
@ -63,6 +64,7 @@ func _ready():
|
||||
|
||||
func Printout():
|
||||
print("user current version: ", GlobalVariables.currentVersion)
|
||||
print("user current hotfix: ", GlobalVariables.currentVersion_hotfix)
|
||||
|
||||
func Adjust(alias : String):
|
||||
match(alias):
|
||||
@ -111,6 +113,19 @@ func ApplySettings_volume():
|
||||
UpdateDisplay()
|
||||
pass
|
||||
|
||||
func AdjustSettings_music():
|
||||
setting_music_enabled = !setting_music_enabled
|
||||
ApplySettings_music()
|
||||
|
||||
@export var anim_vinyl : AnimationPlayer
|
||||
func ApplySettings_music():
|
||||
if (setting_music_enabled): anim_vinyl.speed_scale = 1
|
||||
else: anim_vinyl.speed_scale = 0
|
||||
AudioServer.set_bus_mute(1, !setting_music_enabled)
|
||||
AudioServer.set_bus_mute(2, !setting_music_enabled)
|
||||
AudioServer.get_property_list()
|
||||
GlobalVariables.music_enabled = setting_music_enabled
|
||||
|
||||
func UpdateDisplay():
|
||||
ui_volume.text = str(snapped(setting_volume * 100, .01)) + "%"
|
||||
|
||||
@ -199,7 +214,8 @@ func SaveSettings():
|
||||
"setting_controllerEnabled" : setting_controllerEnabled,
|
||||
"setting_inputmap_keyboard": setting_inputmap_keyboard,
|
||||
"setting_inputmap_controller": setting_inputmap_controller,
|
||||
"setting_colorblind": setting_colorblind
|
||||
"setting_colorblind": setting_colorblind,
|
||||
"setting_music_enabled": setting_music_enabled
|
||||
}
|
||||
print("attempting to save settings")
|
||||
var file = FileAccess.open(savePath, FileAccess.WRITE)
|
||||
@ -223,12 +239,15 @@ func LoadSettings():
|
||||
if (data.has('setting_colorblind')):
|
||||
setting_colorblind = data.setting_colorblind
|
||||
if (checkmark_colorblind != null): checkmark_colorblind.UpdateCheckmark(setting_colorblind)
|
||||
if (data.has('setting_music_enabled')):
|
||||
setting_music_enabled = data.setting_music_enabled
|
||||
file.close()
|
||||
print("---------------------------------")
|
||||
print("user settings: ", data)
|
||||
print("---------------------------------")
|
||||
print("settings file closed")
|
||||
setting = true
|
||||
ApplySettings_music()
|
||||
ApplySettings_volume()
|
||||
ApplySettings_window()
|
||||
ApplySettings_language()
|
||||
|
@ -6,6 +6,7 @@ class_name PipelineManager extends Node
|
||||
@export var scene : String
|
||||
@export var overlay : Control
|
||||
|
||||
@export var main_array_lights : Array[Light3D]
|
||||
@export var main_array_hide : Array[Node3D]
|
||||
@export var main_array_toggle : Array[Node3D]
|
||||
@export var main_restroom : Node3D
|
||||
@ -40,5 +41,6 @@ func AdjustSettings(scene : String):
|
||||
await get_tree().create_timer(.1, false).timeout
|
||||
for i in main_array_toggle: i.visible = true
|
||||
main_light_tabletop2.light_energy = -3.54
|
||||
for i in main_array_lights: i.light_energy /= 2
|
||||
"heaven":
|
||||
env.environment.background_color = Color(1, 1, 1)
|
||||
|
@ -9,7 +9,6 @@ var data = {}
|
||||
|
||||
func _ready():
|
||||
if (!isMainMenu): LoadGame()
|
||||
pass
|
||||
|
||||
func SaveGame():
|
||||
print("attempting to save game")
|
||||
|
5
Steam.gd
5
Steam.gd
@ -3,16 +3,19 @@ extends Node
|
||||
var appid : int = 2835570
|
||||
|
||||
func _ready():
|
||||
if GlobalVariables.using_steam:
|
||||
process_priority = 1000
|
||||
set_process_internal(true)
|
||||
InitializeSteam()
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
Steam.run_callbacks()
|
||||
if GlobalVariables.using_steam: Steam.run_callbacks()
|
||||
|
||||
func InitializeSteam():
|
||||
if GlobalVariables.using_steam:
|
||||
OS.set_environment("SteamAppId", str(appid))
|
||||
OS.set_environment("SteamGameId", str(appid))
|
||||
|
||||
var INIT: Dictionary = Steam.steamInit(false)
|
||||
print("steam init: ", str(INIT))
|
||||
else: print("steam not initialized - not running steam version")
|
||||
|
Loading…
Reference in New Issue
Block a user