refonte de l'inspecteur #61
This commit is contained in:
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