In progress work for swapping models for data viewer

This commit is contained in:
2024-12-04 21:45:12 -08:00
parent f0cfd39471
commit 270ded8ef7
3 changed files with 44 additions and 0 deletions

View File

@@ -9,6 +9,8 @@ public partial class DataViewer : Control
{
public override void _Notification(int what) => this.Notify(what);
public IInstantiator Instantiator { get; set; } = default!;
[Export]
public float _cameraSpeed = 0.01f;
@@ -20,6 +22,11 @@ public partial class DataViewer : Control
[Node] public Label RotationLabel { get; set; } = default!;
public void Initialize()
{
Instantiator = new Instantiator(GetTree());
}
public override void _Process(double delta)
{
if (Input.IsActionPressed(GameInputs.MoveLeft))
@@ -37,5 +44,18 @@ public partial class DataViewer : Control
Camera3D.Position = Camera3D.Position.Clamp(new Vector3(0, 0, 1), new Vector3(0, 0, 4));
ModelPivot.Rotation = ModelPivot.Rotation.Clamp(Mathf.DegToRad(-60), Mathf.DegToRad(60));
if (Input.IsActionJustPressed(GameInputs.Interact))
{
// do nothing
}
if (Input.IsActionJustPressed(GameInputs.Next))
{
// Load next model
}
if (Input.IsActionJustPressed(GameInputs.Previous))
{
// Load previous model
}
}
}

View File

@@ -241,3 +241,17 @@ grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("2_bef6s")
placeholder_text = "Placeholder Text"
[node name="Label" type="Label" parent="CenterContainer/VBoxContainer/BottomPanel"]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -369.0
offset_top = -76.0
grow_horizontal = 0
grow_vertical = 0
theme = ExtResource("2_bef6s")
text = "Press ○ to exit"