diff --git a/scenes/car.tscn b/scenes/car.tscn index 0695827..8fd0ddf 100644 --- a/scenes/car.tscn +++ b/scenes/car.tscn @@ -141,12 +141,14 @@ motion_mode = 1 script = ExtResource("1_i5tet") [node name="sprite_features" type="Sprite2D" parent="CharacterBody_Car"] +visible = false z_index = 10 texture_filter = 1 scale = Vector2(0.5, 0.5) texture = ExtResource("3_k2wmt") [node name="sprite_body" type="Sprite2D" parent="CharacterBody_Car"] +visible = false z_index = 10 texture_filter = 1 scale = Vector2(0.5, 0.5) diff --git a/scenes/map_preview/map_04.png b/scenes/map_preview/map_04.png index 665cb9f..c2075c5 100644 Binary files a/scenes/map_preview/map_04.png and b/scenes/map_preview/map_04.png differ diff --git a/scenes/map_preview/no_preview.png b/scenes/map_preview/no_preview.png new file mode 100644 index 0000000..1fa4bfa Binary files /dev/null and b/scenes/map_preview/no_preview.png differ diff --git a/scenes/map_preview/no_preview.png.import b/scenes/map_preview/no_preview.png.import new file mode 100644 index 0000000..0fdde88 --- /dev/null +++ b/scenes/map_preview/no_preview.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://drgqjl330tj2p" +path="res://.godot/imported/no_preview.png-f86382d97f542fbe5004e6b0043a9cfc.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/map_preview/no_preview.png" +dest_files=["res://.godot/imported/no_preview.png-f86382d97f542fbe5004e6b0043a9cfc.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/scenes/menu.tscn b/scenes/menu.tscn index b4d468b..bf710a8 100644 --- a/scenes/menu.tscn +++ b/scenes/menu.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=3 uid="uid://b1uhymisifcho"] +[gd_scene load_steps=17 format=3 uid="uid://b1uhymisifcho"] [ext_resource type="Script" path="res://scripts/menu.gd" id="1_fushn"] [ext_resource type="Script" path="res://scripts/menudisplay.gd" id="2_jc4pv"] @@ -11,6 +11,7 @@ [ext_resource type="Script" path="res://scripts/rounds_selection.gd" id="7_cr4tq"] [ext_resource type="Texture2D" uid="uid://dku8jinmijays" path="res://scenes/map_preview/map_04.png" id="8_46b6b"] [ext_resource type="Texture2D" uid="uid://bst8p5s1sgurm" path="res://sprites/menu_bg.png" id="10_equk1"] +[ext_resource type="Texture2D" uid="uid://drgqjl330tj2p" path="res://scenes/map_preview/no_preview.png" id="11_3sx36"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_kpdum"] shader = ExtResource("3_vry7a") @@ -68,13 +69,6 @@ scale = Vector2(2.65635, 2.65635) texture = ExtResource("10_equk1") offset = Vector2(0.92, 14.62) -[node name="Playerlist" type="Label" parent="MenuDisplay"] -offset_left = 131.0 -offset_top = 58.0 -offset_right = 745.0 -offset_bottom = 572.0 -theme_override_font_sizes/font_size = 32 - [node name="countdown" type="Label" parent="MenuDisplay"] offset_left = 114.0 offset_top = 71.0 @@ -85,63 +79,63 @@ text = "5" [node name="MarginContainer" type="MarginContainer" parent="MenuDisplay"] offset_left = 317.0 -offset_top = 90.0 -offset_right = 357.0 -offset_bottom = 130.0 +offset_top = 51.245 +offset_right = 515.0 +offset_bottom = 637.245 [node name="VBoxContainer_Playerlist" type="VBoxContainer" parent="MenuDisplay/MarginContainer"] layout_mode = 2 [node name="Label" type="Label" parent="MenuDisplay/MarginContainer/VBoxContainer_Playerlist"] layout_mode = 2 -theme_override_font_sizes/font_size = 32 +theme_override_font_sizes/font_size = 40 text = "Press key" uppercase = true [node name="Label2" type="Label" parent="MenuDisplay/MarginContainer/VBoxContainer_Playerlist"] layout_mode = 2 -theme_override_font_sizes/font_size = 32 +theme_override_font_sizes/font_size = 40 text = "to join" uppercase = true [node name="Label3" type="Label" parent="MenuDisplay/MarginContainer/VBoxContainer_Playerlist"] layout_mode = 2 -theme_override_font_sizes/font_size = 32 +theme_override_font_sizes/font_size = 40 uppercase = true [node name="Label4" type="Label" parent="MenuDisplay/MarginContainer/VBoxContainer_Playerlist"] layout_mode = 2 -theme_override_font_sizes/font_size = 32 +theme_override_font_sizes/font_size = 40 uppercase = true [node name="Label5" type="Label" parent="MenuDisplay/MarginContainer/VBoxContainer_Playerlist"] layout_mode = 2 -theme_override_font_sizes/font_size = 32 +theme_override_font_sizes/font_size = 40 uppercase = true [node name="Label6" type="Label" parent="MenuDisplay/MarginContainer/VBoxContainer_Playerlist"] layout_mode = 2 -theme_override_font_sizes/font_size = 32 +theme_override_font_sizes/font_size = 40 uppercase = true [node name="Label7" type="Label" parent="MenuDisplay/MarginContainer/VBoxContainer_Playerlist"] layout_mode = 2 -theme_override_font_sizes/font_size = 32 +theme_override_font_sizes/font_size = 40 uppercase = true [node name="Label8" type="Label" parent="MenuDisplay/MarginContainer/VBoxContainer_Playerlist"] layout_mode = 2 -theme_override_font_sizes/font_size = 32 +theme_override_font_sizes/font_size = 40 uppercase = true [node name="Label9" type="Label" parent="MenuDisplay/MarginContainer/VBoxContainer_Playerlist"] layout_mode = 2 -theme_override_font_sizes/font_size = 32 +theme_override_font_sizes/font_size = 40 uppercase = true [node name="Label10" type="Label" parent="MenuDisplay/MarginContainer/VBoxContainer_Playerlist"] layout_mode = 2 -theme_override_font_sizes/font_size = 32 +theme_override_font_sizes/font_size = 40 uppercase = true [node name="btn_fullscreen" type="CheckButton" parent="MenuDisplay"] @@ -150,9 +144,10 @@ offset_top = 540.0 offset_right = 972.0 offset_bottom = 571.0 scale = Vector2(2, 2) +theme_override_constants/outline_size = 10 text = "Fullscreen" -[node name="Button" type="Button" parent="MenuDisplay"] +[node name="btn_save_whitelist" type="Button" parent="MenuDisplay"] offset_left = 862.0 offset_top = 602.0 offset_right = 1011.0 @@ -195,7 +190,7 @@ icon = ExtResource("8_46b6b") [node name="btn_map_05" type="Button" parent="MenuDisplay/map_container"] layout_mode = 2 toggle_mode = true -icon = ExtResource("3_p822h") +icon = ExtResource("11_3sx36") [node name="rounds_selection" type="OptionButton" parent="MenuDisplay"] offset_left = 690.0 @@ -220,6 +215,7 @@ offset_left = -70.0 offset_top = 3.0 offset_right = -7.0 offset_bottom = 26.0 +theme_override_constants/outline_size = 10 text = "Rounds:" [node name="AnimationPlayer" type="AnimationPlayer" parent="MenuDisplay"] @@ -232,7 +228,7 @@ autoplay = "menu_idle" wait_time = 5.0 [connection signal="toggled" from="MenuDisplay/btn_fullscreen" to="." method="_on_btn_fullscreen_toggled"] -[connection signal="pressed" from="MenuDisplay/Button" to="." method="_on_button_pressed"] +[connection signal="pressed" from="MenuDisplay/btn_save_whitelist" to="." method="_on_button_pressed"] [connection signal="map_changed" from="MenuDisplay/map_container" to="." method="_on_map_container_map_changed"] [connection signal="item_selected" from="MenuDisplay/rounds_selection" to="." method="_on_rounds_selection_item_selected"] [connection signal="item_selected" from="MenuDisplay/rounds_selection" to="MenuDisplay/rounds_selection" method="_on_item_selected"] diff --git a/scripts/menu.gd b/scripts/menu.gd index 2c19009..14379ba 100644 --- a/scripts/menu.gd +++ b/scripts/menu.gd @@ -2,7 +2,7 @@ extends Node @onready var countdown: Label = $MenuDisplay/countdown @onready var btn_fullscreen = $MenuDisplay/btn_fullscreen - +@onready var btn_save_whitelist= $MenuDisplay/btn_save_whitelist var keywhitelist func _ready(): @@ -15,9 +15,12 @@ func _ready(): btn_fullscreen.button_pressed=ConfigFileHandler.get_video_setting("fullscreen") keywhitelist=ConfigFileHandler.get_keywhitelist_setting() #empty list if disabled + btn_save_whitelist.disabled=keywhitelist.size()>0 #whitelist enabled, then disable save whitelist button + btn_save_whitelist.visible=!keywhitelist.size()>0 print("Loaded Keywhitelist="+str(keywhitelist)) - if keywhitelist.size()>0: #add whitelisted players if whitelist enabled and remove them afterwards to preset colors + #Preload players to set colors + if keywhitelist.size()>0: #add whitelisted players if whitelist enabled and remove them afterwards for k in keywhitelist: Gamestate.addPlayer(k) Gamestate.removeAllPlayers() @@ -46,9 +49,9 @@ func _unhandled_key_input(event: InputEvent) -> void: print("Key keycode:"+str(event.keycode)) var addedID=Gamestate.addPlayer(event.keycode) - $MenuDisplay.update_playerlist(Gamestate.players) + $MenuDisplay.update_playerlist(Gamestate.players,event.keycode) - if addedID!=-1: + if addedID!=-1: #player was added if len(Gamestate.getPlayerkeys())>=1: $Timer.start() else: @@ -83,7 +86,7 @@ func _on_btn_fullscreen_toggled(toggled_on: bool) -> void: DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN) else: DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED) - #ConfigFileHandler.save_video_setting("fullscreen", toggled_on) + ConfigFileHandler.save_video_setting("fullscreen", toggled_on) func _on_rounds_selection_item_selected(index: int) -> void: diff --git a/scripts/menudisplay.gd b/scripts/menudisplay.gd index 3bcbea8..7ee14e5 100644 --- a/scripts/menudisplay.gd +++ b/scripts/menudisplay.gd @@ -15,8 +15,7 @@ func updateCountdown(t): $countdown.text=str(t) -func update_playerlist(players:Array[Gamestate.Player]): - $Playerlist.text="" +func update_playerlist(players:Array[Gamestate.Player],flashplayer_keycode=-1): var Playerlabels=$MarginContainer/VBoxContainer_Playerlist.get_children() var i=0 for label in Playerlabels: @@ -24,7 +23,18 @@ func update_playerlist(players:Array[Gamestate.Player]): if i void: + var Playerlabels=$MarginContainer/VBoxContainer_Playerlist.get_children() + for label in Playerlabels: + var outlinesize=max(0,label.get_theme_constant("outline_size")-2*delta) + label.add_theme_constant_override("outline_size",outlinesize) +