Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsakharov committed Nov 25, 2024
2 parents b7d073e + 36f92da commit 215f9be
Show file tree
Hide file tree
Showing 312 changed files with 2,844 additions and 14,334 deletions.
3 changes: 2 additions & 1 deletion Prowl.Editor/Assets/AssetDatabase.Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

using Prowl.Runtime;
using Prowl.Runtime.Utils;
using Prowl.Echo;

using Debug = Prowl.Runtime.Debug;

Expand Down Expand Up @@ -576,7 +577,7 @@ public static void SaveAsset(EngineObject assetInstance, bool pingAsset = true)
{
try
{
SerializedProperty serialized = Serializer.Serialize(assetInstance);
EchoObject serialized = Serializer.Serialize(assetInstance);
StringTagConverter.WriteToFile(serialized, fileInfo);

if(pingAsset)
Expand Down
7 changes: 1 addition & 6 deletions Prowl.Editor/Assets/AssetDatabase.Packages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@
// Licensed under the MIT License. See the LICENSE file in the project root for details.

using System.IO.Compression;
using System.Net.Http.Json;
using System.Text.Json;
using System.Text.Json.Serialization;

using BepuPhysics.CollisionDetection;

using Prowl.Editor.Utilities.SemVersion;
using Prowl.Runtime;
using Prowl.Runtime.Utils;

using Prowl.Editor.Utilities.SemVersion;

namespace Prowl.Editor.Assets;

#warning TODO: Support other sources then just Github, should support any git source, Also would be nice to look into NuGet support
Expand Down
4 changes: 2 additions & 2 deletions Prowl.Editor/Assets/Importers/MaterialImporter.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file is part of the Prowl Game Engine
// Licensed under the MIT License. See the LICENSE file in the project root for details.

using Prowl.Editor.Preferences;
using Prowl.Echo;
using Prowl.Editor.ScriptedEditors;
using Prowl.Runtime;
using Prowl.Runtime.Utils;
Expand Down Expand Up @@ -41,7 +41,7 @@ public class MaterialImporterEditor : ScriptedEditor

public override void OnEnable()
{
SerializedProperty tag = StringTagConverter.ReadFromFile((target as MetaFile).AssetPath);
EchoObject tag = StringTagConverter.ReadFromFile((target as MetaFile).AssetPath);
_editingMaterial = Serializer.Deserialize<Material>(tag);

_editor = CreateEditor(_editingMaterial);
Expand Down
1 change: 1 addition & 0 deletions Prowl.Editor/Assets/Importers/MeshImporter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of the Prowl Game Engine
// Licensed under the MIT License. See the LICENSE file in the project root for details.

using Prowl.Echo;
using Prowl.Runtime;
using Prowl.Runtime.Utils;

Expand Down
1 change: 1 addition & 0 deletions Prowl.Editor/Assets/Importers/PrefabImporter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of the Prowl Game Engine
// Licensed under the MIT License. See the LICENSE file in the project root for details.

using Prowl.Echo;
using Prowl.Runtime;
using Prowl.Runtime.Utils;

Expand Down
1 change: 1 addition & 0 deletions Prowl.Editor/Assets/Importers/SceneImporter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is part of the Prowl Game Engine
// Licensed under the MIT License. See the LICENSE file in the project root for details.

using Prowl.Echo;
using Prowl.Runtime;
using Prowl.Runtime.Utils;

Expand Down
4 changes: 2 additions & 2 deletions Prowl.Editor/Assets/Importers/ScriptableObjectImporter.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// This file is part of the Prowl Game Engine
// Licensed under the MIT License. See the LICENSE file in the project root for details.

using Prowl.Echo;
using Prowl.Editor.Preferences;
using Prowl.Editor.ScriptedEditors;
using Prowl.Runtime;
using Prowl.Runtime.Utils;

Expand All @@ -28,7 +28,7 @@ public class ScriptableObjectImporterEditor : ScriptedEditor

public override void OnEnable()
{
SerializedProperty tag = StringTagConverter.ReadFromFile((target as MetaFile).AssetPath);
EchoObject tag = StringTagConverter.ReadFromFile((target as MetaFile).AssetPath);
_editingObject = Serializer.Deserialize<ScriptableObject>(tag);
_objectEditor = null; // Replace this to load a Scripta
}
Expand Down
6 changes: 3 additions & 3 deletions Prowl.Editor/Assets/MetaFile.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file is part of the Prowl Game Engine
// Licensed under the MIT License. See the LICENSE file in the project root for details.

using Prowl.Runtime;
using Prowl.Echo;

namespace Prowl.Editor.Assets;

Expand Down Expand Up @@ -43,7 +43,7 @@ public void Save()
{
FileInfo file = new(AssetPath.FullName + ".meta");
version = MetaVersion;
SerializedProperty tag = Serializer.Serialize(this);
EchoObject tag = Serializer.Serialize(this);
StringTagConverter.WriteToFile(tag, file);
}

Expand All @@ -54,7 +54,7 @@ public void Save()
{
FileInfo file = new(assetFile + ".meta");
if (!File.Exists(file.FullName)) return null; // Doesnt Exist
SerializedProperty tag = StringTagConverter.ReadFromFile(file);
EchoObject tag = StringTagConverter.ReadFromFile(file);
MetaFile? meta = Serializer.Deserialize<MetaFile>(tag);
meta!.AssetPath = assetFile;
meta.lastModified = DateTime.UtcNow;
Expand Down
3 changes: 2 additions & 1 deletion Prowl.Editor/Build/DesktopPlayerBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Prowl.Runtime;
using Prowl.Runtime.Utils;
using Prowl.Runtime.Rendering;
using Prowl.Echo;

namespace Prowl.Editor.Build;

Expand Down Expand Up @@ -260,7 +261,7 @@ private static void PackScenes(AssetRef<Scene>[] scenes, string dataPath)
{
// Debug.Log($"Packing scene_{i}.prowl.");
AssetRef<Scene> scene = scenes[i];
SerializedProperty tag = Serializer.Serialize(scene.Res!);
EchoObject tag = Serializer.Serialize(scene.Res!);
BinaryTagConverter.WriteToFile(tag, new FileInfo(Path.Combine(dataPath, $"scene_{i}.prowl")));
}
}
Expand Down
2 changes: 1 addition & 1 deletion Prowl.Editor/Editor/AssetsBrowserWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

using System.Reflection;

using Prowl.Echo;
using Prowl.Editor.Assets;
using Prowl.Editor.Preferences;
using Prowl.Editor.Utilities;
using Prowl.Icons;
using Prowl.Runtime;
using Prowl.Runtime.GUI;
Expand Down
8 changes: 5 additions & 3 deletions Prowl.Editor/Editor/EditorGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ private static bool DrawProperties(ref object target, List<MemberInfo> members,
isPrefabModified = comp.GameObject.AffectedByPrefabLink != null && comp.GameObject.AffectedByPrefabLink.HasChange(comp, field.Name);

// Draw the property
bool propChange = DrawerAttribute.DrawProperty(ActiveGUI, field.Name + (isPrefabModified ? "*" : ""), i++, fieldType, ref fieldValue, config);
bool propChange = DrawerAttribute.DrawProperty(ActiveGUI, field.Name + (isPrefabModified ? "*" : ""), i++, fieldType, ref fieldValue, config, attributes.Cast<Attribute>().ToList());

HandleEndAttributes(imGuiAttributes);

Expand Down Expand Up @@ -363,7 +363,8 @@ public static bool DrawProperty(int index, string name, object target, string fi
if (fieldInfo != null)
{
object? obj = fieldInfo.GetValue(target);
bool changed = DrawerAttribute.DrawProperty(ActiveGUI, name, index, fieldInfo.FieldType, ref obj, config);
List<Attribute> attributes = fieldInfo.GetCustomAttributes<Attribute>(true).ToList();
bool changed = DrawerAttribute.DrawProperty(ActiveGUI, name, index, fieldInfo.FieldType, ref obj, config, attributes);
if (changed)
{
if (target is MonoBehaviour comp2)
Expand Down Expand Up @@ -404,7 +405,8 @@ public static bool DrawProperty(int index, string name, object target, string fi
if (propInfo != null)
{
object? obj = propInfo.GetValue(target);
bool changed = DrawerAttribute.DrawProperty(ActiveGUI, name, index, propInfo.PropertyType, ref obj, config);
List<Attribute> attributes = propInfo.GetCustomAttributes<Attribute>(true).ToList();
bool changed = DrawerAttribute.DrawProperty(ActiveGUI, name, index, propInfo.PropertyType, ref obj, config, attributes);
if (changed)
{
if (target is MonoBehaviour comp2)
Expand Down
4 changes: 3 additions & 1 deletion Prowl.Editor/Editor/GameWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,16 @@ protected override void Draw()
}
}

if (GeneralPreferences.Instance.AutoRefreshGameView || !hasFrame)
if ((GeneralPreferences.Instance.AutoRefreshGameView || !hasFrame) && PlayMode.Current != PlayMode.Mode.Paused)
{
Input.PushHandler(InputHandler);
if (!SceneManager.Draw(RenderTarget))
{
gui.Draw2D.DrawRect(innerRect, Color.red, 2);
gui.Draw2D.DrawText(Font.DefaultFont, "No Camera found", 40f, innerRect, Color.red);
return;
}
Input.PopHandler();
}

hasFrame = true;
Expand Down
4 changes: 2 additions & 2 deletions Prowl.Editor/Editor/HierarchyWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public void DrawGameObject(ref int index, GameObject entity, uint depth)
{
_renamingGO = null;
if (_renamingText != entity.Name)
UndoRedoManager.RecordAction(new ChangeFieldOnGameObjectAction(entity, nameof(GameObject.Name), name.Trim()));
UndoRedoManager.RecordAction(new ChangeFieldOnGameObjectAction(entity, nameof(GameObject.Name), _renamingText.Trim()));
}
//entity.Name = name;
_justStartedRename = false;
Expand Down Expand Up @@ -387,7 +387,7 @@ private static void HandleDrop(GameObject? entity)
}
else
{
UndoRedoManager.RecordAction(new SetParentAction(go.Identifier, entity.Identifier));
UndoRedoManager.RecordAction(new SetParentAction(go.Identifier, entity?.Identifier ?? Guid.Empty));
}

//if (entity != null)
Expand Down
3 changes: 2 additions & 1 deletion Prowl.Editor/Editor/NodeEditor/NodeEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,8 @@ protected bool DrawBackingField(Gui g, Node node, int fieldIndex, NodePort port)
if (showBacking)
{
object? value = fieldInfo.GetValue(node);
if (DrawerAttribute.DrawProperty(g, fieldInfo.Name, fieldIndex, fieldInfo.FieldType, ref value, EditorGUI.PropertyGridConfig.NoLabel))
List<Attribute> attributes = fieldInfo.GetCustomAttributes<Attribute>(true).ToList();
if (DrawerAttribute.DrawProperty(g, fieldInfo.Name, fieldIndex, fieldInfo.FieldType, ref value, EditorGUI.PropertyGridConfig.NoLabel, attributes))
{
changed |= true;

Expand Down
88 changes: 0 additions & 88 deletions Prowl.Editor/Editor/NodeEditor/RenderGraph/BlueprintWindow.cs

This file was deleted.

Loading

0 comments on commit 215f9be

Please sign in to comment.