Add support for map icons
This commit is contained in:
parent
a496e22033
commit
be5960dba8
@ -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")
|
||||
|
||||
BIN
godot/maps/default_map/icon.png
Normal file
BIN
godot/maps/default_map/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
41
godot/maps/default_map/icon.png.import
Normal file
41
godot/maps/default_map/icon.png.import
Normal file
@ -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
|
||||
@ -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]
|
||||
|
||||
@ -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<Gd<TeamResource>>,
|
||||
#[export]
|
||||
pub music: Array<Gd<AudioStream>>,
|
||||
#[export]
|
||||
pub icon: Option<Gd<CompressedTexture2D>>,
|
||||
|
||||
base: Base<Resource>,
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user