refonte de l'inspecteur #61
This commit is contained in:
69
gui/game/inspector/inspector.tscn
Normal file
69
gui/game/inspector/inspector.tscn
Normal file
@@ -0,0 +1,69 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://d3lff5fui1k0c"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_f5bv4"]
|
||||
[ext_resource type="Texture2D" uid="uid://c2pgaklnj5w3d" path="res://gui/game/assets/texture/Tablette info.png" id="2_a8c2j"]
|
||||
[ext_resource type="Script" uid="uid://b36bjfq4sng36" path="res://gui/game/inspector/scripts/inspector.gd" id="3_a8c2j"]
|
||||
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="3_qfinp"]
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="4_yijvw"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ek73b"]
|
||||
atlas = ExtResource("3_qfinp")
|
||||
region = Rect2(76, 75, 124, 135)
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_ek73b"]
|
||||
font = ExtResource("4_yijvw")
|
||||
font_size = 20
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_n4kem"]
|
||||
font_size = 12
|
||||
|
||||
[node name="Inspector" type="TextureRect"]
|
||||
custom_minimum_size = Vector2(0, 300)
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 8
|
||||
theme = ExtResource("1_f5bv4")
|
||||
texture = ExtResource("2_a8c2j")
|
||||
expand_mode = 3
|
||||
stretch_mode = 4
|
||||
script = ExtResource("3_a8c2j")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/margin_left = 40
|
||||
theme_override_constants/margin_top = 40
|
||||
theme_override_constants/margin_right = 25
|
||||
theme_override_constants/margin_bottom = 75
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("1_f5bv4")
|
||||
|
||||
[node name="Texture" type="TextureRect" parent="MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(0, 50)
|
||||
layout_mode = 2
|
||||
texture = SubResource("AtlasTexture_ek73b")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Title" type="Label" parent="MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "fdqsd dqsdq dsqdqsd"
|
||||
label_settings = SubResource("LabelSettings_ek73b")
|
||||
horizontal_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="Desc" type="Label" parent="MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
text = "Ceci est une pelle qui sert exclusivement à faire des choses intéressantes. Ceci est une pelle qui sert exclusivement à faire des choses intéressantes. Ceci est une pelle qui sert exclusivement à faire des choses intéressantes. Ceci est une pelle qui sert exclusivement à faire des choses intéressantes. "
|
||||
label_settings = SubResource("LabelSettings_n4kem")
|
||||
autowrap_mode = 3
|
||||
clip_text = true
|
||||
35
gui/game/inspector/scripts/inspector.gd
Normal file
35
gui/game/inspector/scripts/inspector.gd
Normal file
@@ -0,0 +1,35 @@
|
||||
extends Control
|
||||
class_name Inspector
|
||||
|
||||
var info : Info = null :
|
||||
set(i):
|
||||
info = i
|
||||
update_info(i)
|
||||
|
||||
func _ready():
|
||||
update_info(info)
|
||||
|
||||
func update_info(i : Info):
|
||||
if i == null:
|
||||
visible = false
|
||||
else :
|
||||
visible = true
|
||||
if i.texture:
|
||||
%Texture.texture = i.texture
|
||||
%Texture.visible = i.texture != null
|
||||
%Title.text = i.title
|
||||
%Desc.text = i.description
|
||||
|
||||
class Info:
|
||||
var title : String
|
||||
var texture: Texture
|
||||
var description : String
|
||||
|
||||
func _init(
|
||||
_title : String = "",
|
||||
_description : String = "",
|
||||
_texture : Texture = null,
|
||||
):
|
||||
title = _title
|
||||
description = _description
|
||||
texture = _texture
|
||||
1
gui/game/inspector/scripts/inspector.gd.uid
Normal file
1
gui/game/inspector/scripts/inspector.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b36bjfq4sng36
|
||||
Reference in New Issue
Block a user