diff --git a/godot/maps/default_map.tres b/godot/maps/default_map.tres index ef685fb..3d5df88 100644 --- a/godot/maps/default_map.tres +++ b/godot/maps/default_map.tres @@ -1,5 +1,6 @@ [gd_resource type="MapResource" format=3 uid="uid://c7n1tacc7a73t"] +[ext_resource type="Texture2D" uid="uid://bkugrxwqmw3lw" path="res://maps/default_map/icon.png" id="1_an43b"] [ext_resource type="AudioStream" uid="uid://d3tpaim4ia0xr" path="res://raw_assets/music/n-Dimensions (Main Theme - Retro Ver.mp3" id="1_bjd18"] [ext_resource type="PackedScene" uid="uid://7iooamjot1tg" path="res://maps/default_map/map0.tscn" id="1_k5804"] [ext_resource type="AudioStream" uid="uid://dkgm7o8u0w550" path="res://raw_assets/music/Red Doors 2.0 (GameClosure Edition).mp3" id="2_an43b"] @@ -12,3 +13,4 @@ name = "Default Map" scene = ExtResource("1_k5804") teams = Array[TeamResource]([ExtResource("2_kkbjr"), ExtResource("3_o48fm")]) music = Array[AudioStream]([ExtResource("1_bjd18"), ExtResource("2_an43b"), ExtResource("3_e1bs0")]) +icon = ExtResource("1_an43b") diff --git a/godot/maps/default_map/icon.png b/godot/maps/default_map/icon.png new file mode 100644 index 0000000..df5686f Binary files /dev/null and b/godot/maps/default_map/icon.png differ diff --git a/godot/maps/default_map/icon.png.import b/godot/maps/default_map/icon.png.import new file mode 100644 index 0000000..7045a3d --- /dev/null +++ b/godot/maps/default_map/icon.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bkugrxwqmw3lw" +path.s3tc="res://.godot/imported/icon.png-e76ac314614d31fd9b0de52e21ac82c0.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://maps/default_map/icon.png" +dest_files=["res://.godot/imported/icon.png-e76ac314614d31fd9b0de52e21ac82c0.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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=0 diff --git a/godot/scenes/lobby.tscn b/godot/scenes/lobby.tscn index e623fd5..2dc2234 100644 --- a/godot/scenes/lobby.tscn +++ b/godot/scenes/lobby.tscn @@ -1441,18 +1441,20 @@ layout_mode = 2 metadata/_edit_lock_ = true [node name="v_box_container2" type="VBoxContainer" parent="lobby" unique_id=653902328] +propagate_maximum_size = false layout_mode = 1 anchors_preset = 1 anchor_left = 1.0 anchor_right = 1.0 -offset_left = -835.0 -offset_top = 111.0 -offset_right = -727.0 -offset_bottom = 169.0 +offset_left = -857.0 +offset_top = 513.0 +offset_right = -557.0 +offset_bottom = 613.0 grow_horizontal = 0 [node name="option_button" type="OptionButton" parent="lobby/v_box_container2" unique_id=426342653] layout_mode = 2 +theme_override_constants/icon_max_width = 100 metadata/_edit_lock_ = true [node name="options_panel" type="Panel" parent="lobby" unique_id=1194589850] diff --git a/rust/src/map_resource.rs b/rust/src/map_resource.rs index 89b0038..9fd7802 100644 --- a/rust/src/map_resource.rs +++ b/rust/src/map_resource.rs @@ -1,4 +1,7 @@ -use godot::{classes::AudioStream, prelude::*}; +use godot::{ + classes::{AudioStream, CompressedTexture2D}, + prelude::*, +}; use crate::team_resource::TeamResource; @@ -13,6 +16,8 @@ pub struct MapResource { pub teams: Array>, #[export] pub music: Array>, + #[export] + pub icon: Option>, base: Base, } diff --git a/rust/src/ui/lobby.rs b/rust/src/ui/lobby.rs index 168c319..b75a7eb 100644 --- a/rust/src/ui/lobby.rs +++ b/rust/src/ui/lobby.rs @@ -98,7 +98,11 @@ impl IPanel for LobbyPanel { if let Some(map_selection) = &mut self.map_selection { let prev_selection = game.bind().selected_map_idx as i32; for map in game.bind().maps.iter_shared() { - map_selection.add_item(&map.bind().name); + if let Some(icon) = &map.bind().icon { + map_selection.add_icon_item(icon, &map.bind().name); + } else { + map_selection.add_item(&map.bind().name); + } } map_selection.select(prev_selection); if is_host {