From 49f4e31bd9eb714400c9f188e506ea712272bcb8 Mon Sep 17 00:00:00 2001 From: Techwizz Date: Mon, 4 Dec 2023 01:17:25 -0700 Subject: [PATCH] Fixed https://git.techwizz-emu.com/the_adventures_of_teddy/public_issues/issues/23 --- export_presets.cfg | 14 ++++++++++---- scenes/HUD.tscn | 27 +++++++++++++++++++++++++++ scenes/settings.tscn | 32 ++++++++++++++++++++++++-------- scenes/toyfactory.tscn | 2 +- scripts/HUD.gd | 11 +++++++++++ scripts/global.gd | 1 + scripts/settings-file.gd | 6 +++++- scripts/settings.gd | 11 +++++++++++ 8 files changed, 90 insertions(+), 14 deletions(-) diff --git a/export_presets.cfg b/export_presets.cfg index cac44e7..b6db045 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -31,6 +31,7 @@ application/version="1.0" application/copyright="" application/copyright_localized={} application/min_macos_version="10.12" +application/export_angle=0 display/high_res=false xcode/platform_build="14C18" xcode/sdk_version="13.1" @@ -64,6 +65,7 @@ codesign/entitlements/app_sandbox/files_downloads=0 codesign/entitlements/app_sandbox/files_pictures=0 codesign/entitlements/app_sandbox/files_music=0 codesign/entitlements/app_sandbox/files_movies=0 +codesign/entitlements/app_sandbox/files_user_selected=0 codesign/entitlements/app_sandbox/helper_executables=[] codesign/custom_options=PackedStringArray() notarization/notarization=0 @@ -111,7 +113,7 @@ custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" -export_path="export/windows/teddy.x86_64" +export_path="export/Linux/teddy.x86_64" encryption_include_filters="" encryption_exclude_filters="" encrypt_pck=false @@ -177,14 +179,14 @@ package/signed=true package/app_category=2 package/retain_data_on_uninstall=false package/exclude_from_recents=false +package/show_in_android_tv=false +package/show_in_app_library=true +package/show_as_launcher_app=false launcher_icons/main_192x192="" launcher_icons/adaptive_foreground_432x432="" launcher_icons/adaptive_background_432x432="" graphics/opengl_debug=false xr_features/xr_mode=0 -xr_features/hand_tracking=0 -xr_features/hand_tracking_frequency=0 -xr_features/passthrough=0 screen/immersive_mode=true screen/support_small=true screen/support_normal=true @@ -342,6 +344,9 @@ permissions/write_sms=false permissions/write_social_stream=false permissions/write_sync_settings=false permissions/write_user_dictionary=false +xr_features/hand_tracking=0 +xr_features/hand_tracking_frequency=0 +xr_features/passthrough=0 [preset.3] @@ -387,6 +392,7 @@ application/product_name="" application/file_description="" application/copyright="" application/trademarks="" +application/export_angle=0 ssh_remote_deploy/enabled=false ssh_remote_deploy/host="user@host_ip" ssh_remote_deploy/port="22" diff --git a/scenes/HUD.tscn b/scenes/HUD.tscn index 09c9acf..a66a556 100644 --- a/scenes/HUD.tscn +++ b/scenes/HUD.tscn @@ -25,6 +25,7 @@ mouse_filter = 2 script = ExtResource("1_mqiiw") [node name="Health" type="ProgressBar" parent="."] +visible = false modulate = Color(0.890196, 0.137255, 0.0156863, 1) layout_mode = 0 offset_left = 20.0 @@ -35,6 +36,7 @@ value = 100.0 allow_greater = true [node name="Fatigue" type="ProgressBar" parent="."] +visible = false modulate = Color(1, 1, 0, 1) layout_mode = 0 offset_left = 20.0 @@ -43,6 +45,31 @@ offset_right = 165.0 offset_bottom = 629.0 value = 100.0 +[node name="Health-modern" type="ProgressBar" parent="."] +visible = false +modulate = Color(0.890196, 0.137255, 0.0156863, 1) +layout_mode = 0 +offset_left = 555.0 +offset_top = 314.0 +offset_right = 561.0 +offset_bottom = 333.0 +value = 100.0 +allow_greater = true +fill_mode = 3 +show_percentage = false + +[node name="Fatigue-modern" type="ProgressBar" parent="."] +visible = false +modulate = Color(1, 1, 0, 1) +layout_mode = 0 +offset_left = 589.0 +offset_top = 314.0 +offset_right = 595.0 +offset_bottom = 333.0 +value = 100.0 +fill_mode = 3 +show_percentage = false + [node name="Crosshair1" type="Sprite2D" parent="."] position = Vector2(575, 323) scale = Vector2(0.0351562, 0.0351562) diff --git a/scenes/settings.tscn b/scenes/settings.tscn index 31602ad..9c2c9d8 100644 --- a/scenes/settings.tscn +++ b/scenes/settings.tscn @@ -49,17 +49,17 @@ flat = true [node name="Label2" type="Label" parent="."] layout_mode = 0 offset_left = 522.0 -offset_top = 463.0 +offset_top = 435.0 offset_right = 606.0 -offset_bottom = 489.0 +offset_bottom = 461.0 text = "Fullscreen:" [node name="fullscreenBox" type="CheckBox" parent="."] layout_mode = 0 offset_left = 611.0 -offset_top = 463.0 +offset_top = 435.0 offset_right = 635.0 -offset_bottom = 487.0 +offset_bottom = 459.0 [node name="volLabel" type="Label" parent="."] layout_mode = 0 @@ -81,17 +81,31 @@ step = 0.01 [node name="Label3" type="Label" parent="."] layout_mode = 0 offset_left = 472.0 -offset_top = 496.0 +offset_top = 468.0 offset_right = 606.0 -offset_bottom = 519.0 +offset_bottom = 491.0 text = "Force Ultra-Wide:" [node name="wideBox" type="CheckBox" parent="."] layout_mode = 0 offset_left = 611.0 -offset_top = 497.0 +offset_top = 469.0 offset_right = 635.0 -offset_bottom = 521.0 +offset_bottom = 493.0 + +[node name="Label4" type="Label" parent="."] +offset_left = 508.0 +offset_top = 503.0 +offset_right = 606.0 +offset_bottom = 526.0 +text = "Health Style:" + +[node name="healthOptions" type="OptionButton" parent="."] +layout_mode = 0 +offset_left = 615.0 +offset_top = 504.0 +offset_right = 660.0 +offset_bottom = 524.0 [connection signal="ready" from="h_slider" to="." method="_on_h_slider_ready"] [connection signal="value_changed" from="h_slider" to="." method="_on_h_slider_value_changed"] @@ -100,3 +114,5 @@ offset_bottom = 521.0 [connection signal="ready" from="volumeSlider" to="." method="_on_volume_slider_ready"] [connection signal="value_changed" from="volumeSlider" to="." method="_on_volume_slider_value_changed"] [connection signal="pressed" from="wideBox" to="." method="_on_wide_box_pressed"] +[connection signal="item_selected" from="healthOptions" to="." method="_on_health_options_item_selected"] +[connection signal="ready" from="healthOptions" to="." method="_on_health_options_ready"] diff --git a/scenes/toyfactory.tscn b/scenes/toyfactory.tscn index c2c58c8..596a3f9 100644 --- a/scenes/toyfactory.tscn +++ b/scenes/toyfactory.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" path="res://scripts/maps/toyfactory.gd" id="1_xebe1"] [ext_resource type="PackedScene" uid="uid://ytbacsuahxie" path="res://scenes/HUD.tscn" id="2_irab1"] -[ext_resource type="PackedScene" uid="uid://i6p5x38pt23l" path="res://scenes/toyfactory-map.tscn" id="3_3k25h"] +[ext_resource type="PackedScene" uid="uid://lqlwqgor8cas" path="res://scenes/toyfactory-map.tscn" id="3_3k25h"] [ext_resource type="PackedScene" uid="uid://buyvavyuwmccw" path="res://joystick/virtual_joystick.tscn" id="4_nof1r"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_ell6n"] diff --git a/scripts/HUD.gd b/scripts/HUD.gd index 9646be4..fdc626b 100644 --- a/scripts/HUD.gd +++ b/scripts/HUD.gd @@ -19,12 +19,23 @@ func _ready(): minutes = roundTimer / 60 seconds = fmod(roundTimer, 60) $timer.text = "%02d:%02d" % [minutes, seconds] + if Global.healthStyle == 0: + $Health.visible = true + $Fatigue.visible = true + elif Global.healthStyle == 1: + $"Health-modern".visible = true + $"Fatigue-modern".visible = true + else: + $Health.visible = true + $Fatigue.visible = true func _process(delta): $startLabel.text = Global.HUDStartLabelText $Fatigue.value = Global.fatigue $Health.value = Global.playerHealth + $"Fatigue-modern".value = Global.fatigue + $"Health-modern".value = Global.playerHealth if roundOver: if Input.is_action_just_pressed("start_game"): print("Player with authority ID of " + str(Global.teddyAuthorityID) + " attempted to restart the round!") diff --git a/scripts/global.gd b/scripts/global.gd index 25a5fbe..7bcd85a 100644 --- a/scripts/global.gd +++ b/scripts/global.gd @@ -58,6 +58,7 @@ var respawnLocationChosen = false # When set to false, the game will be allowed var lastEnteredIP = "" # For keeping track of the last IP Address that was used var lastEnteredPort = "28000" # For keeping track of the last port that was used var stretchUI = false # Can be used for "enabling" ultra wide +var healthStyle = 0 # Changes the way the health/fatigue is displayed. 0 is classic, 1 is modern. @onready var main:Window = $"/root" func _ready(): diff --git a/scripts/settings-file.gd b/scripts/settings-file.gd index 737feb2..0e21836 100644 --- a/scripts/settings-file.gd +++ b/scripts/settings-file.gd @@ -9,7 +9,8 @@ var settings_template = { # Default values if we don't already have a settings f 'tutorialCompleted' : false, 'lastEnteredIP' : "", 'lastEnteredPort' : "28000", -'stretchUI' : false +'stretchUI' : false, +'healthStyle' : 0 } var settings_data = {} # This gets filled as soon as load_data() is called. @@ -42,6 +43,7 @@ func save_data(): settings_data['lastEnteredIP'] = Global.lastEnteredIP settings_data['lastEnteredPort'] = Global.lastEnteredPort settings_data['stretchUI'] = Global.stretchUI + settings_data['healthStyle'] = Global.healthStyle file.store_line(JSON.stringify(settings_data)) func load_data(): @@ -55,6 +57,7 @@ func load_data(): var lastEnteredIP = settings_data['lastEnteredIP'] var lastEnteredPort = settings_data['lastEnteredPort'] var stretchUI = settings_data['stretchUI'] + var healthStyle = settings_data['healthStyle'] Global.mouseSensitivity = mousesense Global.playerName = playername Global.volumeModifer = volume @@ -62,3 +65,4 @@ func load_data(): Global.lastEnteredIP = lastEnteredIP Global.lastEnteredPort = lastEnteredPort Global.stretchUI = stretchUI + Global.healthStyle = healthStyle diff --git a/scripts/settings.gd b/scripts/settings.gd index 8bddd9f..f669ddc 100644 --- a/scripts/settings.gd +++ b/scripts/settings.gd @@ -53,3 +53,14 @@ func _on_wide_box_pressed(): main.set_content_scale_aspect(Window.CONTENT_SCALE_ASPECT_KEEP) Global.stretchUI = false Global.save_data() + + +func _on_health_options_ready(): + $healthOptions.add_item("classic", 0) + $healthOptions.add_item("modern", 1) + $healthOptions.selected = Global.healthStyle + + +func _on_health_options_item_selected(index): + Global.healthStyle = index + Global.save_data()