Add shield icon for friendly players
This commit is contained in:
parent
4a9c600058
commit
06cc3006b3
BIN
godot/assets/shield.png
Normal file
BIN
godot/assets/shield.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
42
godot/assets/shield.png.import
Normal file
42
godot/assets/shield.png.import
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://bsniorq6w5yif"
|
||||||
|
path.s3tc="res://.godot/imported/shield.png-46d74908b0ac118b50397d7021ae31f8.s3tc.ctex"
|
||||||
|
path.etc2="res://.godot/imported/shield.png-46d74908b0ac118b50397d7021ae31f8.etc2.ctex"
|
||||||
|
metadata={
|
||||||
|
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||||
|
"vram_texture": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/shield.png"
|
||||||
|
dest_files=["res://.godot/imported/shield.png-46d74908b0ac118b50397d7021ae31f8.s3tc.ctex", "res://.godot/imported/shield.png-46d74908b0ac118b50397d7021ae31f8.etc2.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
|
||||||
69
godot/raw_assets/shield.svg
Normal file
69
godot/raw_assets/shield.svg
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
width="210mm"
|
||||||
|
height="297mm"
|
||||||
|
viewBox="0 0 210 297"
|
||||||
|
version="1.1"
|
||||||
|
id="svg1"
|
||||||
|
sodipodi:docname="shield.svg"
|
||||||
|
inkscape:export-filename="shield.png"
|
||||||
|
inkscape:export-xdpi="120"
|
||||||
|
inkscape:export-ydpi="120"
|
||||||
|
inkscape:version="1.4.4 (dcaf3e7d9e, 2026-05-05)"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="namedview1"
|
||||||
|
pagecolor="#707070"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:showpageshadow="2"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pagecheckerboard="0"
|
||||||
|
inkscape:deskcolor="#d1d1d1"
|
||||||
|
inkscape:document-units="mm"
|
||||||
|
inkscape:zoom="2.0157702"
|
||||||
|
inkscape:cx="325.43393"
|
||||||
|
inkscape:cy="625.56735"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1011"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="layer1" />
|
||||||
|
<defs
|
||||||
|
id="defs1">
|
||||||
|
<linearGradient
|
||||||
|
id="swatch1"
|
||||||
|
inkscape:swatch="solid">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#ffffff;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop1" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#swatch1"
|
||||||
|
id="linearGradient1"
|
||||||
|
x1="68.176541"
|
||||||
|
y1="152.4058"
|
||||||
|
x2="112.93352"
|
||||||
|
y2="152.4058"
|
||||||
|
gradientUnits="userSpaceOnUse" />
|
||||||
|
</defs>
|
||||||
|
<g
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1">
|
||||||
|
<path
|
||||||
|
style="fill:url(#linearGradient1);stroke:#ffffff;stroke-width:0.232;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="m 69.036035,130.06022 c -0.835514,-0.0624 -0.495,12.4182 -0.7425,18.6273 -0.145103,13.8704 13.039939,21.6681 22.578776,26.7446 9.061802,-4.96419 22.165139,-11.66904 21.944839,-26.74075 0,-6.22586 0.53532,-18.65854 -0.6328,-18.62979 z"
|
||||||
|
id="path1"
|
||||||
|
sodipodi:nodetypes="cccccc" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.2 KiB |
43
godot/raw_assets/shield.svg.import
Normal file
43
godot/raw_assets/shield.svg.import
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://dqt6nwl0qssxx"
|
||||||
|
path="res://.godot/imported/shield.svg-6ff2b0db9fbbf7869e9c39b74eb33ede.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://raw_assets/shield.svg"
|
||||||
|
dest_files=["res://.godot/imported/shield.svg-6ff2b0db9fbbf7869e9c39b74eb33ede.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
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=false
|
||||||
|
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=1
|
||||||
|
svg/scale=1.0
|
||||||
|
editor/scale_with_editor_scale=false
|
||||||
|
editor/convert_colors_with_editor_theme=false
|
||||||
@ -7,6 +7,7 @@
|
|||||||
[ext_resource type="FontFile" uid="uid://hptdnjg4ec58" path="res://font/static/SpaceGrotesk-Medium.ttf" id="4_7rax4"]
|
[ext_resource type="FontFile" uid="uid://hptdnjg4ec58" path="res://font/static/SpaceGrotesk-Medium.ttf" id="4_7rax4"]
|
||||||
[ext_resource type="AudioStream" uid="uid://uq0o8gkpqhfa" path="res://raw_assets/sfx/ball/zapsplat_foley_stick_swing_air_whoosh_very_fast_hard_003_110413.mp3" id="4_qn18y"]
|
[ext_resource type="AudioStream" uid="uid://uq0o8gkpqhfa" path="res://raw_assets/sfx/ball/zapsplat_foley_stick_swing_air_whoosh_very_fast_hard_003_110413.mp3" id="4_qn18y"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bnha3gon4700q" path="res://scenes/map/arrow.tscn" id="5_qn18y"]
|
[ext_resource type="PackedScene" uid="uid://bnha3gon4700q" path="res://scenes/map/arrow.tscn" id="5_qn18y"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bsniorq6w5yif" path="res://assets/shield.png" id="8_f0y0w"]
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_1cgct"]
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_1cgct"]
|
||||||
|
|
||||||
@ -40,7 +41,7 @@ curve = SubResource("Curve_qn18y")
|
|||||||
[sub_resource type="ViewportTexture" id="ViewportTexture_rmxnb"]
|
[sub_resource type="ViewportTexture" id="ViewportTexture_rmxnb"]
|
||||||
viewport_path = NodePath("double_health_bar_sprite/health_bar_viewport")
|
viewport_path = NodePath("double_health_bar_sprite/health_bar_viewport")
|
||||||
|
|
||||||
[node name="player" type="RemotePlayer" unique_id=845968872 node_paths=PackedStringArray("soldier_mesh", "collider", "effects", "spectator_camera", "camera_origin", "name_label", "health_bar", "double_health_bar", "health_bar_sprite", "double_health_bar_sprite", "ball_pickup_sfx", "ball_throw_sfx", "arrow")]
|
[node name="player" type="RemotePlayer" unique_id=845968872 node_paths=PackedStringArray("soldier_mesh", "collider", "effects", "spectator_camera", "camera_origin", "name_label", "health_bar", "double_health_bar", "health_bar_sprite", "double_health_bar_sprite", "ball_pickup_sfx", "ball_throw_sfx", "arrow", "shield_sprite")]
|
||||||
move_speed = 7.0
|
move_speed = 7.0
|
||||||
soldier_mesh = NodePath("soldier_m")
|
soldier_mesh = NodePath("soldier_m")
|
||||||
collider = NodePath("collision_shape_3d")
|
collider = NodePath("collision_shape_3d")
|
||||||
@ -58,6 +59,7 @@ ball_pickup_sfx = NodePath("ball_pickup_sfx")
|
|||||||
ball_throw_sfx = NodePath("ball_throw_sfx")
|
ball_throw_sfx = NodePath("ball_throw_sfx")
|
||||||
arrow = NodePath("arrow")
|
arrow = NodePath("arrow")
|
||||||
telefrag_area_prefab = ExtResource("1_8dfyr")
|
telefrag_area_prefab = ExtResource("1_8dfyr")
|
||||||
|
shield_sprite = NodePath("shield_icon")
|
||||||
telegrenade_cd = 10.0
|
telegrenade_cd = 10.0
|
||||||
collision_layer = 2
|
collision_layer = 2
|
||||||
collision_mask = 100
|
collision_mask = 100
|
||||||
@ -151,3 +153,10 @@ bus = &"SFX"
|
|||||||
|
|
||||||
[node name="arrow" parent="." unique_id=1231591993 instance=ExtResource("5_qn18y")]
|
[node name="arrow" parent="." unique_id=1231591993 instance=ExtResource("5_qn18y")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6812112, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6812112, 0)
|
||||||
|
|
||||||
|
[node name="shield_icon" type="Sprite3D" parent="." unique_id=1425349947]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5157857, 0)
|
||||||
|
visible = false
|
||||||
|
pixel_size = 0.001
|
||||||
|
billboard = 1
|
||||||
|
texture = ExtResource("8_f0y0w")
|
||||||
|
|||||||
@ -59,6 +59,8 @@ pub struct RemotePlayer {
|
|||||||
arrow: Option<Gd<Node3D>>,
|
arrow: Option<Gd<Node3D>>,
|
||||||
#[export]
|
#[export]
|
||||||
telefrag_area_prefab: Option<Gd<PackedScene>>,
|
telefrag_area_prefab: Option<Gd<PackedScene>>,
|
||||||
|
#[export]
|
||||||
|
shield_sprite: Option<Gd<Sprite3D>>,
|
||||||
|
|
||||||
pub player_id: Option<u16>,
|
pub player_id: Option<u16>,
|
||||||
pub player_name: String,
|
pub player_name: String,
|
||||||
@ -421,6 +423,19 @@ impl ICharacterBody3D for RemotePlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.buffs.clone().update_effects(self);
|
self.buffs.clone().update_effects(self);
|
||||||
|
|
||||||
|
self.run_deferred(|s| {
|
||||||
|
if let Some(game) = Game::singleton()
|
||||||
|
&& let Some(self_player) = game.bind().find_player(game.bind().self_id.unwrap_or(0))
|
||||||
|
&& let Some(remote_player) = game.bind().find_player(s.player_id.unwrap_or(0))
|
||||||
|
&& self_player.data.team == remote_player.data.team
|
||||||
|
&& let Some(sprite) = &mut s.shield_sprite
|
||||||
|
&& let Some(team) = game.bind().get_team(remote_player.data.team)
|
||||||
|
{
|
||||||
|
sprite.set_visible(true);
|
||||||
|
sprite.set_modulate(team.bind().color());
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn process(&mut self, delta: f64) {
|
fn process(&mut self, delta: f64) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user