add terminal

This commit is contained in:
2-1-1-2 2023-02-26 20:02:24 +01:00
parent 3400d98bc5
commit a2d605f3f5
15 changed files with 311 additions and 9 deletions

BIN
Assets/dossier/2.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/2.png-ec77914f10408dac8b3834c177cd6b3d.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/dossier/2.png"
dest_files=[ "res://.import/2.png-ec77914f10408dac8b3834c177cd6b3d.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
Assets/windows/0.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/0.png-3b009fc3e01f69ed1fecb9af943407bb.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/windows/0.png"
dest_files=[ "res://.import/0.png-3b009fc3e01f69ed1fecb9af943407bb.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
Assets/windows/1.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/1.png-863648f03ea7f8b235fc9b631fa64057.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/windows/1.png"
dest_files=[ "res://.import/1.png-863648f03ea7f8b235fc9b631fa64057.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
Assets/windows/2.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/2.png-81c8d69ce0b4aee009eaee27837fb52a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/windows/2.png"
dest_files=[ "res://.import/2.png-81c8d69ce0b4aee009eaee27837fb52a.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
Assets/windows/3.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/3.png-8cd85e1a01e81ed5ce496649eb5a3d23.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/windows/3.png"
dest_files=[ "res://.import/3.png-8cd85e1a01e81ed5ce496649eb5a3d23.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
Assets/windows/terminal.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/terminal.png-7762865b2ff0434ad1cdd13dcfda02c1.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/windows/terminal.png"
dest_files=[ "res://.import/terminal.png-7762865b2ff0434ad1cdd13dcfda02c1.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=10 format=2]
[gd_scene load_steps=11 format=2]
[ext_resource path="res://Assets/windows/folder_square.png" type="Texture" id=1]
[ext_resource path="res://Elements/Scripts/WindowHeader.gd" type="Script" id=2]
@ -6,6 +6,7 @@
[ext_resource path="res://Assets/warning2/2.png" type="Texture" id=4]
[ext_resource path="res://Assets/warning2/3.png" type="Texture" id=5]
[ext_resource path="res://Assets/warning2/0.png" type="Texture" id=6]
[ext_resource path="res://Assets/windows/terminal.png" type="Texture" id=7]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 555, 60 )
@ -18,7 +19,7 @@ animations = [ {
"frames": [ ExtResource( 6 ), ExtResource( 3 ), ExtResource( 4 ), ExtResource( 5 ) ],
"loop": false,
"name": "default",
"speed": 1.0
"speed": 0.6
} ]
[node name="Node2D" type="Node2D"]
@ -67,7 +68,31 @@ script = ExtResource( 2 )
position = Vector2( 488, -321 )
shape = SubResource( 2 )
[node name="Window3" type="Sprite" parent="."]
visible = false
position = Vector2( 56.9999, -12 )
scale = Vector2( 0.4, 0.4 )
texture = ExtResource( 7 )
[node name="Area2D" type="Area2D" parent="Window3"]
position = Vector2( 487.5, -490 )
script = ExtResource( 2 )
[node name="Header" type="CollisionShape2D" parent="Window3/Area2D"]
position = Vector2( -489.5, 171 )
scale = Vector2( 0.999999, 0.999999 )
shape = SubResource( 1 )
[node name="Area2D2" type="Area2D" parent="Window3"]
script = ExtResource( 2 )
[node name="CloseButton" type="CollisionShape2D" parent="Window3/Area2D2"]
position = Vector2( 488, -321 )
shape = SubResource( 2 )
[connection signal="input_event" from="Window/Area2D" to="Window/Area2D" method="_on_Area2D_input_event"]
[connection signal="input_event" from="Window/Area2D2" to="Window/Area2D" method="_on_Area2D2_input_event"]
[connection signal="input_event" from="Window2/Area2D" to="Window2/Area2D" method="_on_Area2D_input_event"]
[connection signal="input_event" from="Window2/Area2D2" to="Window/Area2D" method="_on_Area2D2_input_event"]
[connection signal="input_event" from="Window3/Area2D" to="Window3/Area2D" method="_on_Area2D_input_event"]
[connection signal="input_event" from="Window3/Area2D2" to="Window/Area2D" method="_on_Area2D2_input_event"]

View file

@ -65,4 +65,27 @@ autoplay = true
[node name="Alert" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 13 )
[node name="Terminal" parent="." instance=ExtResource( 2 )]
position = Vector2( 931, 120 )
[node name="Screen" parent="Terminal" instance=ExtResource( 9 )]
visible = false
position = Vector2( -304, 200 )
[node name="Button2" type="Button" parent="Terminal/Screen"]
margin_left = -90.0
margin_top = -36.0
margin_right = 187.0
margin_bottom = 33.0
theme = SubResource( 1 )
custom_colors/font_color = Color( 1, 1, 1, 1 )
custom_colors/font_color_hover = Color( 0.941176, 0.690196, 0.403922, 1 )
custom_fonts/font = ExtResource( 8 )
custom_styles/hover = ExtResource( 6 )
custom_styles/pressed = ExtResource( 5 )
custom_styles/normal = ExtResource( 4 )
text = "./hack"
script = ExtResource( 3 )
[connection signal="pressed" from="Directory/Screen/Button2" to="Directory/Screen/Button2" method="_on_Button_pressed"]
[connection signal="pressed" from="Terminal/Screen/Button2" to="Terminal/Screen/Button2" method="_on_Button_pressed"]

View file

@ -6,41 +6,67 @@ onready var mainMusic = $"MainMusic"
onready var eyeMusic = $"EyeMusic"
onready var alert = $"Alert"
onready var directory = $"Directory"
onready var terminal = $"Terminal"
var rng = RandomNumberGenerator.new()
const texture_file = preload("res://Assets/dossier/1.png")
const texture_terminal = preload("res://Assets/dossier/2.png") #à modifier
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
var icon = terminal.get_node("Sprite")
var window = terminal.get_node("Screen")
var button_window = window.get_node("Button2")
var name_term = terminal.get_node("Label")
var scale_icon = 0.35
rng.randomize()
var nbDossier = rng.randi_range(0, 3)
var nbDossier = rng.randi_range(4, 10)
for i in range(nbDossier):
var dossier = directory.duplicate()
var icon = dossier.get_node("Sprite")
var window = dossier.get_node("Screen")
var button_window = window.get_node("Button2")
# Une chance sur 2 d'avoir une icône
if rng.randi_range(0, 1) == 0:
# Text (icon)
var name_icon = dossier.get_node("Label")
icon = directory.get_node("Sprite")
window = directory.get_node("Screen")
button_window = window.get_node("Button2")
var name_icon = directory.get_node("Label")
name_icon.text = "Fichier"
# Texture (icon)
var scale_icon = 0.35
icon.scale = Vector2(scale_icon, scale_icon)
icon.texture = texture_file
# Background (window)
window.get_node("Window").visible = false
window.get_node("Window2").visible = true
window.get_node("Window3").visible = false
# Change button visibility
button_window.visible = false
var posY = i%4
var posX = i/4
if(posX == 0) : posY +=1
button_window.focus_mode = Button.FOCUS_NONE
dossier.position = Vector2(dossier.position.x, dossier.position.y + 150 * (i + 1))
dossier.position = Vector2(dossier.position.x + (150 * posX), dossier.position.y + 150 * (posY))
dossier.set_z_index(dossier.get_z_index() + 10 * (i + 1))
add_child(dossier)
icon = terminal.get_node("Sprite")
window = terminal.get_node("Screen")
name_term.text = "Terminal"
scale_icon = 0.05
icon.scale = Vector2(scale_icon, scale_icon)
icon.texture = texture_terminal
# Background (window)
window.get_node("Window").visible = false
window.get_node("Window2").visible = false
window.get_node("Window3").visible = true
# Change button visibility
button_window.visible = false
# Called every frame. 'delta' is the elapsed time since the previous frame.