added internal tank sights

This commit is contained in:
ottona 2024-08-17 02:17:15 +02:00
parent 20b6f773b0
commit 745d9cd2a4
7 changed files with 91 additions and 1 deletions

1
.gitattributes vendored
View File

@ -1,3 +1,4 @@
*.png filter=lfs diff=lfs merge=lfs -text
*.blend filter=lfs diff=lfs merge=lfs -text
*.ogg filter=lfs diff=lfs merge=lfs -text
*.svg filter=lfs diff=lfs merge=lfs -text

BIN
assets/images/orig/std-aim.svg (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b41smjmfrvy2c"
path="res://.godot/imported/std-aim.svg-abb931d75445fff632d732497bd89638.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/images/orig/std-aim.svg"
dest_files=["res://.godot/imported/std-aim.svg-abb931d75445fff632d732497bd89638.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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

BIN
assets/images/std-aim.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bajp34yia340k"
path="res://.godot/imported/std-aim.png-b2556b7524823387f18d383b4bdac92c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/images/std-aim.png"
dest_files=["res://.godot/imported/std-aim.png-b2556b7524823387f18d383b4bdac92c.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

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=16 format=3 uid="uid://d4nj7piinyfug"]
[gd_scene load_steps=17 format=3 uid="uid://d4nj7piinyfug"]
[ext_resource type="Script" path="res://assets/scripts/vehicles/scout/tank-base.gd" id="1_isgb6"]
[ext_resource type="ArrayMesh" uid="uid://bmabm3fx72638" path="res://assets/meshes/scout/body.obj" id="1_v8pu3"]
@ -7,6 +7,7 @@
[ext_resource type="Script" path="res://assets/scripts/weapons/autocannon.gd" id="5_17fqp"]
[ext_resource type="ArrayMesh" uid="uid://dg3d01n2gh18q" path="res://assets/meshes/scout/gun.obj" id="5_ymni4"]
[ext_resource type="AudioStream" uid="uid://dphgof1shqpni" path="res://assets/sounds/autocannon.ogg" id="6_0iaip"]
[ext_resource type="Texture2D" uid="uid://bajp34yia340k" path="res://assets/images/std-aim.png" id="7_wc5xn"]
[sub_resource type="ConvexPolygonShape3D" id="ConvexPolygonShape3D_5htdn"]
points = PackedVector3Array(1, 0.249958, 2.49971, -1, 0.249958, 2.49971, 0.442639, 0.110577, 2.71994, 1, -0.250026, 2.49971, 1, 0.249958, -2.5, 0.877056, 0.520238, 1.42108, -1, -0.250026, 2.49971, -0.442835, 0.110577, 2.71994, -0.877251, 0.520238, 1.42108, -1, 0.249958, -2.5, 0.442639, -0.110759, 2.71994, 0.492561, -0.650746, 1.62393, 1, -0.250026, -2.5, 0.877056, 0.520238, -2.19291, -1, -0.250026, -2.5, -0.490211, -0.650746, 1.62393, -0.442835, -0.110759, 2.71994, -0.877251, 0.520238, -2.19291, 0.492561, -0.650746, -2.04167, -0.490211, -0.650746, -2.04167)
@ -168,6 +169,15 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0747893, 10)
[node name="cam_int" type="Camera3D" parent="turret/autocannon"]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0.24, -0.0747893, 0.805)
[node name="aim" type="TextureRect" parent="turret/autocannon/cam_int"]
visible = false
offset_left = 746.0
offset_top = 476.0
offset_right = 1175.0
offset_bottom = 604.0
pivot_offset = Vector2(214, 64)
texture = ExtResource("7_wc5xn")
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="turret/autocannon"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0747893, 2.055)
stream = ExtResource("6_0iaip")

View File

@ -38,9 +38,11 @@ func _input(ie):
elif ie.button_index == MOUSE_BUTTON_RIGHT and ie.is_pressed():
if ext_view:
$turret/autocannon/cam_int.make_current()
$turret/autocannon/cam_int/aim.visible = true
ext_view = false
else:
$turret/autocannon/cam_ext.make_current()
$turret/autocannon/cam_int/aim.visible = false
ext_view = true
func shot_hit(obj):