main menu
This commit is contained in:
parent
29254dbda0
commit
089ebc4797
35 changed files with 389 additions and 117 deletions
|
|
@ -6,6 +6,7 @@ using Newlon.Components.Plants;
|
|||
public partial class Previewport : SubViewport
|
||||
{
|
||||
private RuntimePlantData current_display;
|
||||
private Texture2D start_Field;
|
||||
|
||||
[Export] private Label title;
|
||||
[Export] private RichTextLabel description;
|
||||
|
|
@ -13,6 +14,7 @@ public partial class Previewport : SubViewport
|
|||
public override void _Ready()
|
||||
{
|
||||
GetParent().GetViewport().GuiFocusChanged += OnFocusChanged;
|
||||
start_Field = GetNode<Sprite2D>("FrameField").Texture;
|
||||
}
|
||||
|
||||
public void OnFocusChanged(Control node)
|
||||
|
|
@ -30,6 +32,12 @@ public partial class Previewport : SubViewport
|
|||
{
|
||||
current_display.QueueFree();
|
||||
}
|
||||
if (resource.customFrame != null && resource.customFrame.almanachField != null)
|
||||
{
|
||||
GetNode<Sprite2D>("FrameField").Texture = resource.customFrame.almanachField;
|
||||
}
|
||||
else
|
||||
GetNode<Sprite2D>("FrameField").Texture = start_Field;
|
||||
current_display = resource.Scene.Instantiate<RuntimePlantData>();
|
||||
title.Text = resource.display_name;
|
||||
description.Text = resource.display_description;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue