diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-11-03 14:10:07 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-11-03 14:10:07 +0100 |
commit | 84365b6f901a9c0251a9f724a8d9f81a3787e97d (patch) | |
tree | 401e2bf99e6573d1d069f5044e7448067cdfb384 /UI | |
parent | a43499efa6c228cea3633f9661f3ff09127bd82d (diff) |
next commit
Diffstat (limited to 'UI')
-rw-r--r-- | UI/Assets/Button_Blue_9Slides.png | bin | 0 -> 4008 bytes | |||
-rw-r--r-- | UI/Assets/Button_Blue_9Slides.png.import | 34 | ||||
-rw-r--r-- | UI/Assets/Button_Blue_9Slides.png~ | bin | 0 -> 4022 bytes | |||
-rw-r--r-- | UI/Assets/Button_Green_9Slides.png | bin | 0 -> 4041 bytes | |||
-rw-r--r-- | UI/Assets/Button_Green_9Slides.png.import | 34 | ||||
-rw-r--r-- | UI/Assets/Button_Green_9Slides.png~ | bin | 0 -> 4042 bytes | |||
-rw-r--r-- | UI/Assets/background_pattern.png | bin | 0 -> 3610 bytes | |||
-rw-r--r-- | UI/Assets/background_pattern.png.import | 34 | ||||
-rw-r--r-- | UI/Assets/background_pattern.png~ | bin | 0 -> 3593 bytes | |||
-rw-r--r-- | UI/Camera.gd | 8 | ||||
-rw-r--r-- | UI/PlayersList.tscn | 16 | ||||
-rw-r--r-- | UI/TowerConfiguration.tscn | 10 | ||||
-rw-r--r-- | UI/lobby.gd | 5 | ||||
-rw-r--r-- | UI/panel_background_blue.tscn | 15 | ||||
-rw-r--r-- | UI/sliding_background.gdshader | 12 |
15 files changed, 152 insertions, 16 deletions
diff --git a/UI/Assets/Button_Blue_9Slides.png b/UI/Assets/Button_Blue_9Slides.png Binary files differnew file mode 100644 index 0000000..dd6c881 --- /dev/null +++ b/UI/Assets/Button_Blue_9Slides.png diff --git a/UI/Assets/Button_Blue_9Slides.png.import b/UI/Assets/Button_Blue_9Slides.png.import new file mode 100644 index 0000000..09c0736 --- /dev/null +++ b/UI/Assets/Button_Blue_9Slides.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bbk7ewy65ho7b" +path="res://.godot/imported/Button_Blue_9Slides.png-9944c5fb0ea9aac1d62d41936865ef14.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://UI/Assets/Button_Blue_9Slides.png" +dest_files=["res://.godot/imported/Button_Blue_9Slides.png-9944c5fb0ea9aac1d62d41936865ef14.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/UI/Assets/Button_Blue_9Slides.png~ b/UI/Assets/Button_Blue_9Slides.png~ Binary files differnew file mode 100644 index 0000000..022dafd --- /dev/null +++ b/UI/Assets/Button_Blue_9Slides.png~ diff --git a/UI/Assets/Button_Green_9Slides.png b/UI/Assets/Button_Green_9Slides.png Binary files differnew file mode 100644 index 0000000..15988a8 --- /dev/null +++ b/UI/Assets/Button_Green_9Slides.png diff --git a/UI/Assets/Button_Green_9Slides.png.import b/UI/Assets/Button_Green_9Slides.png.import new file mode 100644 index 0000000..b49b9a2 --- /dev/null +++ b/UI/Assets/Button_Green_9Slides.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://2rhkngx4m38c" +path="res://.godot/imported/Button_Green_9Slides.png-5556e4be0ff48c38f3909df48307d705.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://UI/Assets/Button_Green_9Slides.png" +dest_files=["res://.godot/imported/Button_Green_9Slides.png-5556e4be0ff48c38f3909df48307d705.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/UI/Assets/Button_Green_9Slides.png~ b/UI/Assets/Button_Green_9Slides.png~ Binary files differnew file mode 100644 index 0000000..78589da --- /dev/null +++ b/UI/Assets/Button_Green_9Slides.png~ diff --git a/UI/Assets/background_pattern.png b/UI/Assets/background_pattern.png Binary files differnew file mode 100644 index 0000000..29d8316 --- /dev/null +++ b/UI/Assets/background_pattern.png diff --git a/UI/Assets/background_pattern.png.import b/UI/Assets/background_pattern.png.import new file mode 100644 index 0000000..f6c2ecf --- /dev/null +++ b/UI/Assets/background_pattern.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://drtbodnnqibxr" +path="res://.godot/imported/background_pattern.png-c8606a54f9060306df3ed437d5249730.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://UI/Assets/background_pattern.png" +dest_files=["res://.godot/imported/background_pattern.png-c8606a54f9060306df3ed437d5249730.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/UI/Assets/background_pattern.png~ b/UI/Assets/background_pattern.png~ Binary files differnew file mode 100644 index 0000000..143acef --- /dev/null +++ b/UI/Assets/background_pattern.png~ diff --git a/UI/Camera.gd b/UI/Camera.gd index 60bb46d..e10c371 100644 --- a/UI/Camera.gd +++ b/UI/Camera.gd @@ -83,10 +83,10 @@ func _input(event): edge = edge.normalized() is_in_edge_mode = false - if event is InputEventMouseButton and event.is_pressed(): - Input.mouse_mode = Input.MOUSE_MODE_CONFINED - elif event.is_action_pressed("mouse_escape"): - Input.mouse_mode = Input.MOUSE_MODE_VISIBLE + #if event is InputEventMouseButton and event.is_pressed(): + #Input.mouse_mode = Input.MOUSE_MODE_CONFINED + #elif event.is_action_pressed("mouse_escape"): + #Input.mouse_mode = Input.MOUSE_MODE_VISIBLE func _process(delta): diff --git a/UI/PlayersList.tscn b/UI/PlayersList.tscn index 4ba62f7..fabc008 100644 --- a/UI/PlayersList.tscn +++ b/UI/PlayersList.tscn @@ -1,19 +1,25 @@ -[gd_scene load_steps=3 format=3 uid="uid://cxd6c4kbnk04c"] +[gd_scene load_steps=5 format=3 uid="uid://cxd6c4kbnk04c"] [ext_resource type="Script" path="res://UI/players_list.gd" id="1_67rpy"] +[ext_resource type="Theme" uid="uid://c7f1ftrx53ag1" path="res://theme.tres" id="1_igafg"] +[ext_resource type="PackedScene" uid="uid://dslebs7aarkoa" path="res://UI/panel_background_blue.tscn" id="2_3bkxi"] [ext_resource type="PackedScene" uid="uid://wxe1hpn013y8" path="res://UI/PlayersListItem.tscn" id="2_ug8m7"] [node name="PlayersList" type="PanelContainer"] offset_right = 192.0 offset_bottom = 43.0 +theme = ExtResource("1_igafg") script = ExtResource("1_67rpy") +[node name="PanelBackgroundBlue" parent="." instance=ExtResource("2_3bkxi")] +layout_mode = 2 + [node name="MarginContainer" type="MarginContainer" parent="."] layout_mode = 2 -theme_override_constants/margin_left = 8 -theme_override_constants/margin_top = 8 -theme_override_constants/margin_right = 8 -theme_override_constants/margin_bottom = 8 +theme_override_constants/margin_left = 16 +theme_override_constants/margin_top = 12 +theme_override_constants/margin_right = 16 +theme_override_constants/margin_bottom = 24 [node name="List" type="VBoxContainer" parent="MarginContainer"] unique_name_in_owner = true diff --git a/UI/TowerConfiguration.tscn b/UI/TowerConfiguration.tscn index 0f97073..ba8c2a9 100644 --- a/UI/TowerConfiguration.tscn +++ b/UI/TowerConfiguration.tscn @@ -1,17 +1,17 @@ [gd_scene load_steps=5 format=3 uid="uid://c05aq7xd4kx1p"] -[ext_resource type="Texture2D" uid="uid://b1b18rd0tqbar" path="res://core_outdoor.png" id="1_3ypmu"] +[ext_resource type="Texture2D" uid="uid://dujcs2ls3u6tj" path="res://Towers/Assets/spritesheet.png" id="2_m6q2y"] [ext_resource type="Script" path="res://UI/tower_configuration.gd" id="2_vvfd0"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_k0400"] [sub_resource type="AtlasTexture" id="AtlasTexture_7gm7m"] -atlas = ExtResource("1_3ypmu") -region = Rect2(400, 439, 32, 41) +atlas = ExtResource("2_m6q2y") +region = Rect2(5, 1, 62, 95) [node name="PanelContainer" type="PanelContainer"] custom_minimum_size = Vector2(74, 88) -offset_right = 80.0 +offset_right = 74.0 offset_bottom = 104.0 theme_override_styles/panel = SubResource("StyleBoxEmpty_k0400") script = ExtResource("2_vvfd0") @@ -21,7 +21,7 @@ texture_filter = 1 layout_mode = 2 mouse_default_cursor_shape = 2 texture = SubResource("AtlasTexture_7gm7m") -stretch_mode = 4 +stretch_mode = 5 [connection signal="gui_input" from="TextureRect" to="." method="_on_texture_rect_gui_input"] [connection signal="mouse_entered" from="TextureRect" to="TextureRect" method="_on_mouse_entered"] diff --git a/UI/lobby.gd b/UI/lobby.gd index 1cb4d5c..26a7b97 100644 --- a/UI/lobby.gd +++ b/UI/lobby.gd @@ -3,7 +3,7 @@ extends Control signal joined -var current_map_idx := 2 +var current_map_idx := 0 @onready var list: VBoxContainer = %PlayersList @@ -23,7 +23,6 @@ func _ready() -> void: ) for idx in %Maps.get_child_count(): %Maps.get_child(idx).pressed.connect(func(): - current_map_idx = idx set_map.rpc(idx) ) if not multiplayer.is_server(): @@ -84,6 +83,8 @@ func start(): @rpc("authority", "call_local") func set_map(index: int): + current_map_idx = index + for node: Button in %Maps.get_children(): node.add_theme_color_override("font_color", Color(1.0, 1.0, 1.0, 0.5)) diff --git a/UI/panel_background_blue.tscn b/UI/panel_background_blue.tscn new file mode 100644 index 0000000..60b7d28 --- /dev/null +++ b/UI/panel_background_blue.tscn @@ -0,0 +1,15 @@ +[gd_scene load_steps=2 format=3 uid="uid://dslebs7aarkoa"] + +[ext_resource type="Texture2D" uid="uid://bbk7ewy65ho7b" path="res://UI/Assets/Button_Blue_9Slides.png" id="1_5cttw"] + +[node name="PanelBackgroundBlue" type="NinePatchRect"] +self_modulate = Color(1, 1, 1, 0.941176) +texture_filter = 1 +texture = ExtResource("1_5cttw") +region_rect = Rect2(6, 0, 179, 186) +patch_margin_left = 32 +patch_margin_top = 32 +patch_margin_right = 32 +patch_margin_bottom = 32 +axis_stretch_horizontal = 2 +axis_stretch_vertical = 2 diff --git a/UI/sliding_background.gdshader b/UI/sliding_background.gdshader new file mode 100644 index 0000000..cf42b61 --- /dev/null +++ b/UI/sliding_background.gdshader @@ -0,0 +1,12 @@ +shader_type canvas_item; + +uniform sampler2D pattern_sampler : repeat_enable, filter_nearest; +uniform vec3 bg_color : source_color; +uniform vec3 pattern_color : source_color; +uniform float pattern_size = 256.0; +uniform float speed = 0.05; + +void fragment() { + vec2 uv = FRAGCOORD.xy / pattern_size; + COLOR.rgb = mix(pattern_color, bg_color, texture(pattern_sampler, uv + TIME * speed).x); +} |