Dungeon Room Re-import and Old Models Deleted
This commit is contained in:
@@ -34,58 +34,58 @@ public partial class DataViewer : Control
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
Instantiator = new Instantiator(GetTree());
|
||||
LoadModel();
|
||||
Instantiator = new Instantiator(GetTree());
|
||||
LoadModel();
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (Input.IsActionPressed(GameInputs.MoveLeft))
|
||||
CameraPivot.RotateY(_cameraSpeed);
|
||||
if (Input.IsActionPressed(GameInputs.MoveRight))
|
||||
CameraPivot.RotateY(-_cameraSpeed);
|
||||
if (Input.IsActionPressed(GameInputs.StrafeLeft))
|
||||
Camera3D.Position = Camera3D.Position.MoveToward(CameraPivot.Position, (float)delta * 2f);
|
||||
if (Input.IsActionPressed(GameInputs.StrafeRight))
|
||||
Camera3D.Position = Camera3D.Position.MoveToward(CameraPivot.Position, -(float)delta * 2f);
|
||||
if (Input.IsActionPressed(GameInputs.MoveLeft))
|
||||
CameraPivot.RotateY(_cameraSpeed);
|
||||
if (Input.IsActionPressed(GameInputs.MoveRight))
|
||||
CameraPivot.RotateY(-_cameraSpeed);
|
||||
if (Input.IsActionPressed(GameInputs.StrafeLeft))
|
||||
Camera3D.Position = Camera3D.Position.MoveToward(CameraPivot.Position, (float)delta * 2f);
|
||||
if (Input.IsActionPressed(GameInputs.StrafeRight))
|
||||
Camera3D.Position = Camera3D.Position.MoveToward(CameraPivot.Position, -(float)delta * 2f);
|
||||
|
||||
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));
|
||||
_currentModel.SetCurrentDirection(_currentModel.GlobalBasis, -CameraPivot.Basis.Z);
|
||||
_currentModel.PlayIdleAnimation();
|
||||
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));
|
||||
_currentModel.SetCurrentDirection(_currentModel.GlobalBasis, -CameraPivot.Basis.Z);
|
||||
_currentModel.PlayIdleAnimation();
|
||||
|
||||
if (Input.IsActionJustPressed(GameInputs.Attack))
|
||||
_currentModel.PlayPrimaryAttackAnimation();
|
||||
if (Input.IsActionJustPressed(GameInputs.AltAttack))
|
||||
_currentModel.PlaySecondaryAttackAnimation();
|
||||
if (Input.IsActionJustPressed(GameInputs.Inventory) && _currentModel is ICanActivate canActivate)
|
||||
canActivate.Activate();
|
||||
if (Input.IsActionPressed(GameInputs.StrafeRight))
|
||||
_currentModel.PlayWalkAnimation();
|
||||
if (Input.IsActionJustPressed(GameInputs.Attack))
|
||||
_currentModel.PlayPrimaryAttackAnimation();
|
||||
if (Input.IsActionJustPressed(GameInputs.AltAttack))
|
||||
_currentModel.PlaySecondaryAttackAnimation();
|
||||
if (Input.IsActionJustPressed(GameInputs.Inventory) && _currentModel is ICanActivate canActivate)
|
||||
canActivate.Activate();
|
||||
if (Input.IsActionPressed(GameInputs.StrafeRight))
|
||||
_currentModel.PlayWalkAnimation();
|
||||
|
||||
if (Input.IsActionJustPressed(GameInputs.Next))
|
||||
{
|
||||
// Load next model
|
||||
_currentModel.CallDeferred(MethodName.QueueFree);
|
||||
_modelIndex = (_modelIndex + 1) % DataViewerRepository.ModelRepository.Count;
|
||||
GD.Print(_modelIndex);
|
||||
CallDeferred(MethodName.LoadModel);
|
||||
}
|
||||
if (Input.IsActionJustPressed(GameInputs.Previous))
|
||||
{
|
||||
// Load previous model
|
||||
_currentModel.CallDeferred(MethodName.QueueFree);
|
||||
_modelIndex = (_modelIndex - 1 < 0 ? DataViewerRepository.ModelRepository.Count : _modelIndex) - 1;
|
||||
CallDeferred(MethodName.LoadModel);
|
||||
}
|
||||
if (Input.IsActionJustPressed(GameInputs.Next))
|
||||
{
|
||||
// Load next model
|
||||
_currentModel.CallDeferred(MethodName.QueueFree);
|
||||
_modelIndex = (_modelIndex + 1) % DataViewerRepository.ModelRepository.Count;
|
||||
GD.Print(_modelIndex);
|
||||
CallDeferred(MethodName.LoadModel);
|
||||
}
|
||||
if (Input.IsActionJustPressed(GameInputs.Previous))
|
||||
{
|
||||
// Load previous model
|
||||
_currentModel.CallDeferred(MethodName.QueueFree);
|
||||
_modelIndex = (_modelIndex - 1 < 0 ? DataViewerRepository.ModelRepository.Count : _modelIndex) - 1;
|
||||
CallDeferred(MethodName.LoadModel);
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadModel()
|
||||
{
|
||||
var modelScene = DataViewerRepository.ModelRepository.ElementAt(_modelIndex);
|
||||
_currentModel = modelScene.Instantiate<EnemyModelView2D>();
|
||||
ModelPivot.AddChild(_currentModel);
|
||||
EnemyName.Text = _currentModel.EnemyLoreInfo.Name;
|
||||
Description.Text = _currentModel.EnemyLoreInfo.Description;
|
||||
var modelScene = DataViewerRepository.ModelRepository.ElementAt(_modelIndex);
|
||||
_currentModel = modelScene.Instantiate<EnemyModelView2D>();
|
||||
ModelPivot.AddChild(_currentModel);
|
||||
EnemyName.Text = _currentModel.EnemyLoreInfo.Name;
|
||||
Description.Text = _currentModel.EnemyLoreInfo.Description;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
[ext_resource type="Script" uid="uid://bgaflnnur26vk" path="res://src/data_viewer/DataViewer.cs" id="1_1qako"]
|
||||
[ext_resource type="Theme" uid="uid://daxuhpmyxwxck" path="res://src/ui/inventory_menu/InventoryDialogueSelectionStyle.tres" id="2_bef6s"]
|
||||
[ext_resource type="Texture2D" uid="uid://iwcftnraw2k0" path="res://src/map/assets/sarco altar_greeen2.png" id="3_3wl4s"]
|
||||
[ext_resource type="PackedScene" uid="uid://c16i1gmg6yu5a" path="res://src/data_viewer/DataViewerRepository.tscn" id="3_ejdn0"]
|
||||
[ext_resource type="Texture2D" uid="uid://bh0crf4qonrh5" path="res://src/map/dungeon/models/Set A/03. Antechamber A/ANTECHAMBER_TYPE1_VER2_8311.png" id="3_hpkd1"]
|
||||
[ext_resource type="PackedScene" uid="uid://bjg8wyvp8q6oc" path="res://src/enemy/enemy_types/02. michael/MichaelModelView.tscn" id="4_bef6s"]
|
||||
[ext_resource type="PackedScene" uid="uid://dcm53j3rncxdm" path="res://src/enemy/enemy_types/06. chariot/ChariotModelView.tscn" id="5_vk1lh"]
|
||||
[ext_resource type="PackedScene" uid="uid://bimjnsu52y3xi" path="res://src/enemy/enemy_types/01. sproingy/SproingyModelView.tscn" id="6_hpkd1"]
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_dvixg"]
|
||||
shading_mode = 0
|
||||
albedo_texture = ExtResource("3_hpkd1")
|
||||
albedo_texture = ExtResource("3_3wl4s")
|
||||
|
||||
[node name="DataViewer" type="Control"]
|
||||
layout_mode = 3
|
||||
|
||||
Reference in New Issue
Block a user