Added inventory display and item display.
This commit is contained in:
@@ -21,6 +21,16 @@ public partial class ResourceLoader
|
||||
return GD.Load<PackedScene>($"res://Prefabs/Robot/RobotDisplay.tscn");
|
||||
}
|
||||
|
||||
public static PackedScene LoadItemDisplay()
|
||||
{
|
||||
return GD.Load<PackedScene>($"res://Prefabs/Crafting/ItemDisplay.tscn");
|
||||
}
|
||||
|
||||
public static Texture2D LoadPath(string path)
|
||||
{
|
||||
return GD.Load<Texture2D>(path);
|
||||
}
|
||||
|
||||
public static Dictionary<string, MeshInstance3D> LoadTiles()
|
||||
{
|
||||
Dictionary<string, MeshInstance3D> tileMeshes = new Dictionary<string, MeshInstance3D>();
|
||||
|
||||
@@ -15,6 +15,7 @@ public partial class UIHandler : Control
|
||||
[Export] PanelContainer options;
|
||||
[Export] Control uiContent;
|
||||
[Export] PanelContainer menu;
|
||||
[Export] PanelContainer inventory;
|
||||
|
||||
bool receivedRobotJumpSignal = false;
|
||||
public override void _Ready()
|
||||
@@ -37,6 +38,7 @@ public partial class UIHandler : Control
|
||||
if (Input.IsActionJustPressed("map")) HandleMapButton();
|
||||
if (Input.IsActionJustPressed("menu")) HandleMenuButton();
|
||||
if (Input.IsActionJustPressed("robot_list")) HandleRobotListButton();
|
||||
if (Input.IsActionJustPressed("inventory")) HandleInventoryButton();
|
||||
DisplayStats();
|
||||
}
|
||||
|
||||
@@ -56,6 +58,11 @@ public partial class UIHandler : Control
|
||||
OpenUIElement(robotList);
|
||||
}
|
||||
|
||||
public void HandleInventoryButton()
|
||||
{
|
||||
OpenUIElement(inventory);
|
||||
}
|
||||
|
||||
public void DisplayStats()
|
||||
{
|
||||
FPS.Text = Engine.GetFramesPerSecond().ToString() + " FPS";
|
||||
@@ -86,7 +93,6 @@ public partial class UIHandler : Control
|
||||
{
|
||||
foreach (PanelContainer child in uiContent.GetChildren())
|
||||
{
|
||||
GD.Print(child == element);
|
||||
if (child == element) continue;
|
||||
child.Visible = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user