alcoranpaul / DunGen

Procedural Dungeon Generator made for Flax Engine
MIT License
0 stars 0 forks source link

Adding to project does not initialize DunGenSetting #38

Closed alcoranpaul closed 1 month ago

alcoranpaul commented 1 month ago

After successfully adding the plugin to a project. When clicked on DunGen, it doesn't create the setting!

[ 00:00:05.154 ]: [Error] Missing file 'E:\Projects/Game Dev/Flax/testingDungeon/Content/Data/DunGenSettings.json'
[ 00:00:05.155 ]: [Warning] Failed to load asset @ E:\Projects/Game Dev/Flax/testingDungeon/Content/Data\DunGenSettings.json 
[ 00:00:05.159 ]: [Warning] Exception has been thrown during Window.OnMouseUp. Object reference not set to an instance of an object.
Stack strace:
   at DunGenEditor.DunGenWindow.Initialize(LayoutElementsContainer layout) in E:\Projects\Game Dev\Flax\testingDungeon\Plugins\DunGen\Source\DunGenEditor\DunGenWindow.cs:line 67
   at FlaxEditor.CustomEditors.CustomEditor.Initialize(CustomEditorPresenter presenter, LayoutElementsContainer layout, ValueContainer values) in D:\a\FlaxEngine\FlaxEngine\Source\Editor\CustomEditors\CustomEditor.cs:line 129
   at FlaxEditor.CustomEditors.CustomEditorPresenter.RootEditor.Initialize(LayoutElementsContainer layout) in D:\a\FlaxEngine\FlaxEngine\Source\Editor\CustomEditors\CustomEditorPresenter.cs:line 184
   at FlaxEditor.CustomEditors.CustomEditor.Initialize(CustomEditorPresenter presenter, LayoutElementsContainer layout, ValueContainer values) in D:\a\FlaxEngine\FlaxEngine\Source\Editor\CustomEditors\CustomEditor.cs:line 129
   at FlaxEditor.CustomEditors.CustomEditorPresenter.RootEditor.Setup(CustomEditorPresenter presenter) in D:\a\FlaxEngine\FlaxEngine\Source\Editor\CustomEditors\CustomEditorPresenter.cs:line 160
   at FlaxEditor.CustomEditors.CustomEditorPresenter.BuildLayout() in D:\a\FlaxEngine\FlaxEngine\Source\Editor\CustomEditors\CustomEditorPresenter.cs:line 404
   at FlaxEditor.CustomEditorWindow.Win.OnShow() in D:\a\FlaxEngine\FlaxEngine\Source\Editor\CustomEditorWindow.cs:line 45
   at FlaxEditor.GUI.Docking.DockWindow.Show(DockState state, DockPanel toDock, Boolean autoSelect, Nullable`1 splitterValue) in D:\a\FlaxEngine\FlaxEngine\Source\Editor\GUI\Docking\DockWindow.cs:line 238
   at FlaxEditor.CustomEditorWindow.Show(DockState state, DockPanel toDock, Boolean autoSelect, Nullable`1 splitterValue) in D:\a\FlaxEngine\FlaxEngine\Source\Editor\CustomEditorWindow.cs:line 105
   at DunGenEditor.DunGenEditor.ShowEditorWindow() in E:\Projects\Game Dev\Flax\testingDungeon\Plugins\DunGen\Source\DunGenEditor\DunGenEditor.cs:line 70
   at FlaxEditor.GUI.ToolStripButton.OnMouseUp(Float2 location, MouseButton button) in D:\a\FlaxEngine\FlaxEngine\Source\Editor\GUI\ToolStripButton.cs:line 201
   at FlaxEngine.GUI.ContainerControl.OnMouseUp(Float2 location, MouseButton button) in D:\a\FlaxEngine\FlaxEngine\Source\Engine\UI\GUI\ContainerControl.cs:line 1029
   at FlaxEngine.GUI.ContainerControl.OnMouseUp(Float2 location, MouseButton button) in D:\a\FlaxEngine\FlaxEngine\Source\Engine\UI\GUI\ContainerControl.cs:line 1029
   at FlaxEngine.GUI.WindowRootControl.OnMouseUp(Float2 location, MouseButton button) in D:\a\FlaxEngine\FlaxEngine\Source\Engine\UI\GUI\WindowRootControl.cs:line 305
   at FlaxEngine.Window.Internal_OnMouseUp(Float2& mousePos, MouseButton button) in D:\a\FlaxEngine\FlaxEngine\Source\Engine\Platform\Window.cs:line 242
   at FlaxEngine.Interop.NativeInterop.Invoker.InvokerNoRet2`3.MarshalAndInvoke(Object delegateContext, ManagedHandle instancePtr, IntPtr paramPtr) in D:\a\FlaxEngine\FlaxEngine\Source\Engine\Engine\NativeInterop.Invoker.cs:line 387
   at FlaxEngine.Interop.NativeInterop.InvokeMethod(ManagedHandle instanceHandle, ManagedHandle methodHandle, IntPtr paramPtr, IntPtr exceptionPtr) in D:\a\FlaxEngine\FlaxEngine\Source\Engine\Engine\NativeInterop.Unmanaged.cs:line 806
[ 00:00:05.159 ]: [Error] Exception has been thrown during Window.OnMouseUp.
Object reference not set to an instance of an object.
alcoranpaul commented 1 month ago

Related to #34

alcoranpaul commented 1 month ago

image

Path Should be ../DunGen/Content/.. not ../testingDunGen/Content

alcoranpaul commented 1 month ago
@ DunGenEditor
    public static string ContentPath => Path.Combine(Globals.ProjectFolder, "Plugins", "DunGen", "Content");
    public static string DebugPath => Path.Combine(ContentPath, DEBUG_PREFAB_FOLDER);
    public static string SettingsPath => Path.Combine(ContentPath, SETTINGS_PATH_FOLDER, SETTINGS_NAME + ".json");

Probably is a good idea to make this editable on the Editor Window

alcoranpaul commented 1 month ago

fix By 3faea47c733a974b0809a0258d101c406880c6e2