gros dev pre proto
* Changement de l'UI, ajouts de l'inspecteur par carte et changement de police * Ajout d'un semblant d'exploration * Ajout de la sauvegarde des entités * Restructuration mineure de l'arborescence * Fix divers et réécriture des textes
This commit is contained in:
BIN
gui/game/card/assets/texture/reflect.png
Normal file
BIN
gui/game/card/assets/texture/reflect.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
40
gui/game/card/assets/texture/reflect.png.import
Normal file
40
gui/game/card/assets/texture/reflect.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cxoi7fd2em002"
|
||||
path="res://.godot/imported/reflect.png-bcb8dad250fa32818817143cee617537.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://gui/game/card/assets/texture/reflect.png"
|
||||
dest_files=["res://.godot/imported/reflect.png-bcb8dad250fa32818817143cee617537.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
|
||||
203
gui/game/card/card.tscn
Normal file
203
gui/game/card/card.tscn
Normal file
@@ -0,0 +1,203 @@
|
||||
[gd_scene load_steps=20 format=3 uid="uid://753270jjxmfg"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_m317d"]
|
||||
[ext_resource type="Script" uid="uid://b7f10wuounfan" path="res://gui/game/card/scripts/card.gd" id="2_kpm7h"]
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="2_plgbn"]
|
||||
[ext_resource type="Script" uid="uid://dj2pv1hiwjfv0" path="res://gui/game/card/scripts/card_info.gd" id="3_7wc8v"]
|
||||
[ext_resource type="Texture2D" uid="uid://bt3g5bmar0icf" path="res://common/icons/growth.svg" id="3_kpm7h"]
|
||||
[ext_resource type="Script" uid="uid://dgbh38j13g5kn" path="res://gui/game/card/scripts/card_section_info.gd" id="5_7wc8v"]
|
||||
[ext_resource type="Texture2D" uid="uid://0hbdgalf04e" path="res://common/icons/wood.svg" id="6_7wc8v"]
|
||||
[ext_resource type="Script" uid="uid://b4tkium34c831" path="res://gui/game/card/scripts/card_stat_info.gd" id="6_pmldi"]
|
||||
[ext_resource type="Texture2D" uid="uid://baaujfw8piywi" path="res://common/icons/dna.svg" id="7_mwhj8"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="7_pmldi"]
|
||||
[ext_resource type="Texture2D" uid="uid://deywxmh76nu5w" path="res://common/icons/caret-down.svg" id="11_kpm7h"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_gibok"]
|
||||
bg_color = Color(1, 1, 1, 1)
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
|
||||
[sub_resource type="Resource" id="Resource_mwhj8"]
|
||||
script = ExtResource("5_7wc8v")
|
||||
title_text = "Title"
|
||||
title_icon = ExtResource("6_7wc8v")
|
||||
text = "Text"
|
||||
metadata/_custom_type_script = "uid://dgbh38j13g5kn"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_plgbn"]
|
||||
script = ExtResource("3_7wc8v")
|
||||
title = "Hello"
|
||||
type_icon = ExtResource("6_7wc8v")
|
||||
texture = ExtResource("7_mwhj8")
|
||||
important_stat_text = "10"
|
||||
important_stat_icon = ExtResource("3_kpm7h")
|
||||
sections = Array[ExtResource("5_7wc8v")]([SubResource("Resource_mwhj8")])
|
||||
metadata/_custom_type_script = "uid://dj2pv1hiwjfv0"
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_vnqhg"]
|
||||
bg_color = Color(1, 1, 1, 1)
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
|
||||
[sub_resource type="Theme" id="Theme_on5kv"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_sx78e"]
|
||||
font = ExtResource("2_plgbn")
|
||||
font_size = 20
|
||||
|
||||
[sub_resource type="Animation" id="Animation_7wc8v"]
|
||||
resource_name = "expand"
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_pmldi"]
|
||||
_data = {
|
||||
&"expand": SubResource("Animation_7wc8v")
|
||||
}
|
||||
|
||||
[node name="Card" type="PanelContainer"]
|
||||
custom_minimum_size = Vector2(250, 0)
|
||||
offset_right = 140.0
|
||||
offset_bottom = 60.0
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
theme = ExtResource("1_m317d")
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_gibok")
|
||||
script = ExtResource("2_kpm7h")
|
||||
info = SubResource("Resource_plgbn")
|
||||
|
||||
[node name="GridContainer" type="GridContainer" parent="."]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("1_m317d")
|
||||
theme_override_constants/h_separation = 0
|
||||
theme_override_constants/v_separation = 0
|
||||
|
||||
[node name="CardUpperPart" type="PanelContainer" parent="GridContainer"]
|
||||
unique_name_in_owner = true
|
||||
self_modulate = Color(0.13725491, 0.39215687, 0.6666667, 1)
|
||||
clip_contents = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme = ExtResource("1_m317d")
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_vnqhg")
|
||||
|
||||
[node name="EntityTexture" type="TextureRect" parent="GridContainer/CardUpperPart"]
|
||||
unique_name_in_owner = true
|
||||
modulate = Color(1, 1, 1, 0.23137255)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("7_mwhj8")
|
||||
expand_mode = 1
|
||||
stretch_mode = 6
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="GridContainer/CardUpperPart"]
|
||||
layout_mode = 2
|
||||
theme = SubResource("Theme_on5kv")
|
||||
theme_override_constants/margin_left = 25
|
||||
|
||||
[node name="ContentContainer" type="VBoxContainer" parent="GridContainer/CardUpperPart/MarginContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("1_m317d")
|
||||
theme_override_constants/separation = 10
|
||||
|
||||
[node name="TitleContainer" type="HBoxContainer" parent="GridContainer/CardUpperPart/MarginContainer/ContentContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("1_m317d")
|
||||
|
||||
[node name="CardTitle" type="Label" parent="GridContainer/CardUpperPart/MarginContainer/ContentContainer/TitleContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Hello"
|
||||
label_settings = SubResource("LabelSettings_sx78e")
|
||||
|
||||
[node name="CardTypeIcon" type="TextureRect" parent="GridContainer/CardUpperPart/MarginContainer/ContentContainer/TitleContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(30, 30)
|
||||
layout_mode = 2
|
||||
theme = ExtResource("1_m317d")
|
||||
texture = ExtResource("6_7wc8v")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="CardStats" type="MarginContainer" parent="GridContainer/CardUpperPart/MarginContainer/ContentContainer"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme = ExtResource("1_m317d")
|
||||
theme_override_constants/margin_left = 0
|
||||
theme_override_constants/margin_top = 0
|
||||
theme_override_constants/margin_right = 40
|
||||
theme_override_constants/margin_bottom = 0
|
||||
|
||||
[node name="CardStatsContainer" type="VBoxContainer" parent="GridContainer/CardUpperPart/MarginContainer/ContentContainer/CardStats"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme = ExtResource("1_m317d")
|
||||
theme_override_constants/separation = 6
|
||||
|
||||
[node name="CardSections" type="MarginContainer" parent="GridContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CardSectionsContainer" type="VBoxContainer" parent="GridContainer/CardSections"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ImportantStat" type="MarginContainer" parent="."]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 0
|
||||
theme_override_constants/margin_top = 30
|
||||
theme_override_constants/margin_right = 0
|
||||
theme_override_constants/margin_bottom = 0
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="ImportantStat"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
use_top_left = true
|
||||
|
||||
[node name="ImportantStatIcon" type="TextureRect" parent="ImportantStat/CenterContainer"]
|
||||
unique_name_in_owner = true
|
||||
modulate = Color(1, 0.6509804, 0.09019608, 1)
|
||||
custom_minimum_size = Vector2(60, 60)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("3_kpm7h")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="ImportantStatText" type="Label" parent="ImportantStat/CenterContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "10"
|
||||
label_settings = ExtResource("7_pmldi")
|
||||
|
||||
[node name="ArrowDown" type="Control" parent="."]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 8
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="ArrowDown"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -24.0
|
||||
offset_top = -24.0
|
||||
offset_right = 24.0
|
||||
offset_bottom = 24.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 8
|
||||
texture = ExtResource("11_kpm7h")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_pmldi")
|
||||
}
|
||||
71
gui/game/card/card_section.tscn
Normal file
71
gui/game/card/card_section.tscn
Normal file
@@ -0,0 +1,71 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://bghefrgaujjt6"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dcmee2jvohudl" path="res://gui/game/card/scripts/card_section.gd" id="1_41hkv"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_t7m3x"]
|
||||
[ext_resource type="Script" uid="uid://dgbh38j13g5kn" path="res://gui/game/card/scripts/card_section_info.gd" id="2_3ktqg"]
|
||||
[ext_resource type="Texture2D" uid="uid://baaujfw8piywi" path="res://common/icons/dna.svg" id="2_41hkv"]
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="3_3ktqg"]
|
||||
|
||||
[sub_resource type="Theme" id="Theme_vlpjv"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ycbno"]
|
||||
script = ExtResource("2_3ktqg")
|
||||
title_colored = true
|
||||
title_text = "Hello"
|
||||
title_icon = ExtResource("2_41hkv")
|
||||
text = "Hello"
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_ycbno"]
|
||||
font = ExtResource("3_3ktqg")
|
||||
font_size = 15
|
||||
|
||||
[node name="CardSection" type="VBoxContainer"]
|
||||
offset_right = 176.0
|
||||
offset_bottom = 71.0
|
||||
theme = SubResource("Theme_vlpjv")
|
||||
theme_override_constants/separation = 6
|
||||
script = ExtResource("1_41hkv")
|
||||
info = SubResource("Resource_ycbno")
|
||||
|
||||
[node name="CardSectionTitle" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
theme = ExtResource("1_t7m3x")
|
||||
theme_override_constants/separation = 6
|
||||
|
||||
[node name="TitleIcon" type="TextureRect" parent="CardSectionTitle"]
|
||||
unique_name_in_owner = true
|
||||
modulate = Color(0.14509805, 0.75686276, 0.2784314, 1)
|
||||
custom_minimum_size = Vector2(20, 20)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_41hkv")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="TitleText" type="Label" parent="CardSectionTitle"]
|
||||
unique_name_in_owner = true
|
||||
modulate = Color(0.14509805, 0.75686276, 0.2784314, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme = ExtResource("1_t7m3x")
|
||||
text = "Hello"
|
||||
label_settings = SubResource("LabelSettings_ycbno")
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="CardSectionTextContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("1_t7m3x")
|
||||
theme_override_constants/margin_left = 25
|
||||
theme_override_constants/margin_top = 0
|
||||
theme_override_constants/margin_right = 0
|
||||
theme_override_constants/margin_bottom = 0
|
||||
|
||||
[node name="Text" type="RichTextLabel" parent="CardSectionTextContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme = ExtResource("1_t7m3x")
|
||||
theme_override_colors/default_color = Color(0.0627451, 0.05882353, 0.16862746, 1)
|
||||
bbcode_enabled = true
|
||||
text = "Hello"
|
||||
fit_content = true
|
||||
scroll_active = false
|
||||
37
gui/game/card/card_stat.tscn
Normal file
37
gui/game/card/card_stat.tscn
Normal file
@@ -0,0 +1,37 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://cpen6hj0rbw8x"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_6abif"]
|
||||
[ext_resource type="Script" uid="uid://c8xxhu28xm4hy" path="res://gui/game/card/scripts/card_stat.gd" id="2_30iht"]
|
||||
[ext_resource type="Texture2D" uid="uid://baaujfw8piywi" path="res://common/icons/dna.svg" id="3_30iht"]
|
||||
[ext_resource type="Script" uid="uid://b4tkium34c831" path="res://gui/game/card/scripts/card_stat_info.gd" id="3_c3wpw"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_n0n76"]
|
||||
script = ExtResource("3_c3wpw")
|
||||
|
||||
[node name="CardStat" type="HBoxContainer"]
|
||||
offset_right = 222.0
|
||||
offset_bottom = 30.0
|
||||
theme = ExtResource("1_6abif")
|
||||
theme_override_constants/separation = 6
|
||||
script = ExtResource("2_30iht")
|
||||
info = SubResource("Resource_n0n76")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(20, 20)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("3_30iht")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 4
|
||||
theme = ExtResource("1_6abif")
|
||||
bbcode_enabled = true
|
||||
text = "[b]10[/b] A very long text that will eventually break"
|
||||
fit_content = true
|
||||
scroll_active = false
|
||||
autowrap_mode = 2
|
||||
85
gui/game/card/card_visualiser.tscn
Normal file
85
gui/game/card/card_visualiser.tscn
Normal file
@@ -0,0 +1,85 @@
|
||||
[gd_scene load_steps=15 format=3 uid="uid://3ss8pvhsackj"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://753270jjxmfg" path="res://gui/game/card/card.tscn" id="1_we78f"]
|
||||
[ext_resource type="Shader" uid="uid://bqjwmomh851lc" path="res://common/vfx/materials/shaders/skew.gdshader" id="1_x54se"]
|
||||
[ext_resource type="Script" uid="uid://dj5pld5ragrjp" path="res://gui/game/card/scripts/card_visualiser.gd" id="2_ntbk8"]
|
||||
[ext_resource type="Script" uid="uid://dj2pv1hiwjfv0" path="res://gui/game/card/scripts/card_info.gd" id="3_5yk1o"]
|
||||
[ext_resource type="Script" uid="uid://dgbh38j13g5kn" path="res://gui/game/card/scripts/card_section_info.gd" id="4_7xkgc"]
|
||||
[ext_resource type="Script" uid="uid://b4tkium34c831" path="res://gui/game/card/scripts/card_stat_info.gd" id="5_1et8x"]
|
||||
[ext_resource type="Texture2D" uid="uid://bt3g5bmar0icf" path="res://common/icons/growth.svg" id="6_7xkgc"]
|
||||
[ext_resource type="Texture2D" uid="uid://bsvxhafoxwmw0" path="res://common/icons/cube-3d-sphere.svg" id="7_1et8x"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_r0jrf"]
|
||||
shader = ExtResource("1_x54se")
|
||||
shader_parameter/fov = 90.0
|
||||
shader_parameter/cull_back = true
|
||||
shader_parameter/y_rot = -6e-45
|
||||
shader_parameter/x_rot = -6e-45
|
||||
shader_parameter/inset = 0.0
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_5yk1o"]
|
||||
viewport_path = NodePath("SubViewport")
|
||||
|
||||
[sub_resource type="Resource" id="Resource_r0jrf"]
|
||||
script = ExtResource("3_5yk1o")
|
||||
title = "Hello"
|
||||
texture = ExtResource("6_7xkgc")
|
||||
metadata/_custom_type_script = "uid://dj2pv1hiwjfv0"
|
||||
|
||||
[sub_resource type="Animation" id="Animation_1et8x"]
|
||||
length = 0.3
|
||||
|
||||
[sub_resource type="Animation" id="Animation_7xkgc"]
|
||||
resource_name = "appear"
|
||||
length = 0.2
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_r0jrf"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_1et8x"),
|
||||
&"appear": SubResource("Animation_7xkgc")
|
||||
}
|
||||
|
||||
[node name="CardVisualiser" type="TextureRect"]
|
||||
material = SubResource("ShaderMaterial_r0jrf")
|
||||
offset_left = -24.0
|
||||
offset_right = 276.0
|
||||
offset_bottom = 110.0
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 4
|
||||
mouse_filter = 2
|
||||
texture = SubResource("ViewportTexture_5yk1o")
|
||||
stretch_mode = 4
|
||||
script = ExtResource("2_ntbk8")
|
||||
small_mode = true
|
||||
card_info = SubResource("Resource_r0jrf")
|
||||
|
||||
[node name="SubViewport" type="SubViewport" parent="."]
|
||||
unique_name_in_owner = true
|
||||
transparent_bg = true
|
||||
size = Vector2i(300, 110)
|
||||
|
||||
[node name="CardContainer" type="MarginContainer" parent="SubViewport"]
|
||||
unique_name_in_owner = true
|
||||
clip_contents = true
|
||||
offset_right = 350.0
|
||||
offset_bottom = 110.0
|
||||
size_flags_horizontal = 0
|
||||
theme_override_constants/margin_left = 25
|
||||
theme_override_constants/margin_top = 25
|
||||
theme_override_constants/margin_right = 25
|
||||
theme_override_constants/margin_bottom = 25
|
||||
|
||||
[node name="Card" parent="SubViewport/CardContainer" instance=ExtResource("1_we78f")]
|
||||
unique_name_in_owner = true
|
||||
self_modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 2
|
||||
mouse_filter = 2
|
||||
small_mode = true
|
||||
down_arrow = true
|
||||
info = SubResource("Resource_r0jrf")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_r0jrf")
|
||||
}
|
||||
57
gui/game/card/scripts/card.gd
Normal file
57
gui/game/card/scripts/card.gd
Normal file
@@ -0,0 +1,57 @@
|
||||
@tool
|
||||
extends PanelContainer
|
||||
class_name Card
|
||||
|
||||
const CARD_STAT_SCENE : PackedScene = preload("res://gui/game/card/card_stat.tscn")
|
||||
const CARD_SECTION_SCENE : PackedScene = preload("res://gui/game/card/card_section.tscn")
|
||||
|
||||
@export var small_mode : bool = false
|
||||
@export var down_arrow : bool = false
|
||||
|
||||
@export var info : CardInfo = CardInfo.new("Default Card Name")
|
||||
|
||||
@export_tool_button("Update", "Callable") var update_action = update
|
||||
|
||||
func _ready():
|
||||
update()
|
||||
|
||||
func update():
|
||||
%CardTitle.text = info.title
|
||||
%CardUpperPart.self_modulate = info.bg_color
|
||||
%CardTypeIcon.texture = info.type_icon
|
||||
%EntityTexture.texture = info.texture
|
||||
|
||||
%ImportantStatIcon.texture = info.important_stat_icon
|
||||
%ImportantStatText.text = info.important_stat_text
|
||||
|
||||
%ArrowDown.visible = down_arrow
|
||||
|
||||
self_modulate = Color.TRANSPARENT if small_mode else Color.WHITE
|
||||
%CardUpperPart.self_modulate.a = 0.7 if small_mode else 1.0
|
||||
|
||||
update_card_stats()
|
||||
update_card_sections()
|
||||
|
||||
func update_card_stats():
|
||||
for stat in %CardStatsContainer.get_children():
|
||||
stat.queue_free()
|
||||
|
||||
for stat_info in info.stats:
|
||||
if stat_info:
|
||||
var new_stat : CardStat = CARD_STAT_SCENE.instantiate() as CardStat
|
||||
new_stat.info = stat_info
|
||||
%CardStatsContainer.add_child(new_stat)
|
||||
|
||||
%CardStats.visible = len(info.stats) != 0 && small_mode == false
|
||||
|
||||
func update_card_sections():
|
||||
for stat in %CardSectionsContainer.get_children():
|
||||
stat.queue_free()
|
||||
|
||||
for sections_info in info.sections:
|
||||
if sections_info:
|
||||
var new_section : CardSection = CARD_SECTION_SCENE.instantiate() as CardSection
|
||||
new_section.info = sections_info
|
||||
%CardSectionsContainer.add_child(new_section)
|
||||
|
||||
%CardSections.visible = len(%CardSectionsContainer.get_children()) != 0 && small_mode == false
|
||||
1
gui/game/card/scripts/card.gd.uid
Normal file
1
gui/game/card/scripts/card.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b7f10wuounfan
|
||||
18
gui/game/card/scripts/card_info.gd
Normal file
18
gui/game/card/scripts/card_info.gd
Normal file
@@ -0,0 +1,18 @@
|
||||
extends Resource
|
||||
class_name CardInfo
|
||||
|
||||
@export var title : String
|
||||
@export var bg_color : Color = Color("2364aaff")
|
||||
@export var type_icon : Texture = preload("res://common/icons/cube-3d-sphere.svg")
|
||||
@export var texture : Texture
|
||||
|
||||
@export var important_stat_text : String
|
||||
@export var important_stat_icon : Texture
|
||||
|
||||
@export var stats : Array[CardStatInfo] = []
|
||||
@export var sections : Array[CardSectionInfo] = []
|
||||
|
||||
func _init(
|
||||
_title : String = "",
|
||||
):
|
||||
title = _title
|
||||
1
gui/game/card/scripts/card_info.gd.uid
Normal file
1
gui/game/card/scripts/card_info.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dj2pv1hiwjfv0
|
||||
20
gui/game/card/scripts/card_section.gd
Normal file
20
gui/game/card/scripts/card_section.gd
Normal file
@@ -0,0 +1,20 @@
|
||||
@tool
|
||||
extends VBoxContainer
|
||||
class_name CardSection
|
||||
|
||||
const DEFAULT_ICON_COLOR = Color("96b3dbff")
|
||||
const DEFAULT_TITLE_COLOR = Color("100f2bff")
|
||||
|
||||
@export var info : CardSectionInfo = CardSectionInfo.new()
|
||||
|
||||
func _ready():
|
||||
update()
|
||||
|
||||
@export_tool_button("Update", "Callable") var update_action = update
|
||||
|
||||
func update():
|
||||
%Text.text = info.text
|
||||
%TitleIcon.texture = info.title_icon
|
||||
%TitleText.text = info.title_text
|
||||
%TitleIcon.modulate = info.title_color if info.title_colored else DEFAULT_ICON_COLOR
|
||||
%TitleText.modulate = info.title_color if info.title_colored else DEFAULT_TITLE_COLOR
|
||||
1
gui/game/card/scripts/card_section.gd.uid
Normal file
1
gui/game/card/scripts/card_section.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dcmee2jvohudl
|
||||
15
gui/game/card/scripts/card_section_info.gd
Normal file
15
gui/game/card/scripts/card_section_info.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
extends Resource
|
||||
class_name CardSectionInfo
|
||||
|
||||
@export var title_colored : bool = false
|
||||
@export var title_color : Color = Color("25c147ff")
|
||||
@export var title_text : String = ""
|
||||
@export var title_icon : Texture = null
|
||||
@export_multiline var text : String = ""
|
||||
|
||||
func _init(
|
||||
_title_text : String = "",
|
||||
_text : String = ""
|
||||
):
|
||||
title_text = _title_text
|
||||
text = _text
|
||||
1
gui/game/card/scripts/card_section_info.gd.uid
Normal file
1
gui/game/card/scripts/card_section_info.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dgbh38j13g5kn
|
||||
20
gui/game/card/scripts/card_stat.gd
Normal file
20
gui/game/card/scripts/card_stat.gd
Normal file
@@ -0,0 +1,20 @@
|
||||
@tool
|
||||
extends HBoxContainer
|
||||
class_name CardStat
|
||||
|
||||
var is_ready = false
|
||||
|
||||
@export var info : CardStatInfo = CardStatInfo.new() :
|
||||
set(v):
|
||||
info = v
|
||||
if is_ready : update()
|
||||
|
||||
@export_tool_button("Update", "Callable") var update_action = update
|
||||
|
||||
func _ready():
|
||||
is_ready = true
|
||||
update()
|
||||
|
||||
func update():
|
||||
%RichTextLabel.text = info.text
|
||||
%TextureRect.texture = info.icon
|
||||
1
gui/game/card/scripts/card_stat.gd.uid
Normal file
1
gui/game/card/scripts/card_stat.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c8xxhu28xm4hy
|
||||
12
gui/game/card/scripts/card_stat_info.gd
Normal file
12
gui/game/card/scripts/card_stat_info.gd
Normal file
@@ -0,0 +1,12 @@
|
||||
extends Resource
|
||||
class_name CardStatInfo
|
||||
|
||||
@export var text : String = ""
|
||||
@export var icon : Texture = null
|
||||
|
||||
func _init(
|
||||
_text : String = "",
|
||||
_icon : Texture = null,
|
||||
):
|
||||
icon = _icon
|
||||
text = _text
|
||||
1
gui/game/card/scripts/card_stat_info.gd.uid
Normal file
1
gui/game/card/scripts/card_stat_info.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b4tkium34c831
|
||||
62
gui/game/card/scripts/card_visualiser.gd
Normal file
62
gui/game/card/scripts/card_visualiser.gd
Normal file
@@ -0,0 +1,62 @@
|
||||
@tool
|
||||
extends TextureRect
|
||||
|
||||
const MAX_ROT = 15
|
||||
const ZOOM_SCALE = 1.0
|
||||
|
||||
var wanted_rot : Vector2 = Vector2.ZERO
|
||||
var real_rot : Vector2 = Vector2.ZERO
|
||||
var wanted_scale : Vector2 = Vector2.ONE
|
||||
|
||||
var is_ready = false
|
||||
|
||||
@export var small_mode : bool = false :
|
||||
set(v):
|
||||
small_mode = v
|
||||
if is_ready : update()
|
||||
|
||||
@export var card_info : CardInfo = null :
|
||||
set(v):
|
||||
card_info = v
|
||||
if is_ready : update()
|
||||
|
||||
@export_tool_button("Update", "Callable") var update_action = update
|
||||
|
||||
func _ready():
|
||||
material = material.duplicate()
|
||||
update()
|
||||
is_ready = true
|
||||
|
||||
func _process(_d):
|
||||
var center_relative_mouse_position = (get_local_mouse_position() - size/2) / size
|
||||
|
||||
if is_mouse_over():
|
||||
wanted_rot = center_relative_mouse_position * MAX_ROT
|
||||
small_mode = false
|
||||
else:
|
||||
wanted_rot = Vector2.ZERO
|
||||
small_mode = true
|
||||
|
||||
real_rot = real_rot.lerp(wanted_rot, 0.1)
|
||||
|
||||
material.set_shader_parameter("y_rot", - real_rot.x)
|
||||
material.set_shader_parameter("x_rot", real_rot.y)
|
||||
|
||||
%SubViewport.size.y = %CardContainer.size.y
|
||||
size = %SubViewport.size
|
||||
|
||||
|
||||
func is_mouse_over() -> bool:
|
||||
var center_relative_mouse_position = (get_local_mouse_position() - size/2) / size
|
||||
|
||||
return (
|
||||
abs(center_relative_mouse_position.x) < 0.5
|
||||
and abs(center_relative_mouse_position.y) < 0.5
|
||||
)
|
||||
|
||||
func update():
|
||||
|
||||
if card_info:
|
||||
%Card.info = card_info
|
||||
%Card.small_mode = small_mode
|
||||
%Card.update()
|
||||
1
gui/game/card/scripts/card_visualiser.gd.uid
Normal file
1
gui/game/card/scripts/card_visualiser.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dj5pld5ragrjp
|
||||
Reference in New Issue
Block a user