diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index 7f744626..0192dd02 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -79,6 +79,7 @@ public class CUE4ParseViewModel : ViewModel set => SetProperty(ref _modelIsWaitingAnimation, value); } + public bool IsSnooperOpen => _snooper is { Exists: true, IsVisible: true }; private Snooper _snooper; public Snooper SnooperViewer { diff --git a/FModel/ViewModels/ThreadWorkerViewModel.cs b/FModel/ViewModels/ThreadWorkerViewModel.cs index 8ebb4413..503b1819 100644 --- a/FModel/ViewModels/ThreadWorkerViewModel.cs +++ b/FModel/ViewModels/ThreadWorkerViewModel.cs @@ -52,7 +52,9 @@ public class ThreadWorkerViewModel : ViewModel public async Task Begin(Action action) { - if (!_applicationView.Status.IsReady) + if (_applicationView.CUE4Parse.IsSnooperOpen) + _applicationView.CUE4Parse.SnooperViewer.Close(); + else if (!_applicationView.Status.IsReady) { SignalOperationInProgress(); return; @@ -89,6 +91,8 @@ public class ThreadWorkerViewModel : ViewModel catch (OperationCanceledException) { _applicationView.Status.SetStatus(EStatusKind.Stopped); + if (_applicationView.CUE4Parse.IsSnooperOpen) + _applicationView.CUE4Parse.SnooperViewer.Close(); CurrentCancellationTokenSource = null; // kill token OperationCancelled = true; OperationCancelled = false; diff --git a/FModel/Views/Snooper/Lights/SpotLight.cs b/FModel/Views/Snooper/Lights/SpotLight.cs index 0b20f062..3800d888 100644 --- a/FModel/Views/Snooper/Lights/SpotLight.cs +++ b/FModel/Views/Snooper/Lights/SpotLight.cs @@ -18,7 +18,9 @@ public class SpotLight : Light Attenuation *= Constants.SCALE_DOWN_RATIO; InnerConeAngle = spot.GetOrDefault("InnerConeAngle", 50.0f); - OuterConeAngle = spot.GetOrDefault("OuterConeAngle", 60.0f); + OuterConeAngle = spot.GetOrDefault("OuterConeAngle", InnerConeAngle + 10); + if (OuterConeAngle < InnerConeAngle) + InnerConeAngle = OuterConeAngle - 10; } public SpotLight(FGuid model, Texture icon, UObject parent, UObject spot, Transform transform) : base(model, icon, parent, spot, transform) @@ -28,7 +30,9 @@ public class SpotLight : Light Attenuation *= Constants.SCALE_DOWN_RATIO; InnerConeAngle = spot.GetOrDefault("InnerConeAngle", 50.0f); - OuterConeAngle = spot.GetOrDefault("OuterConeAngle", 60.0f); + OuterConeAngle = spot.GetOrDefault("OuterConeAngle", InnerConeAngle + 10); + if (OuterConeAngle < InnerConeAngle) + InnerConeAngle = OuterConeAngle - 10; } public override void Render(int i, Shader shader) diff --git a/FModel/Views/Snooper/Shading/Material.cs b/FModel/Views/Snooper/Shading/Material.cs index 49e74068..c4114d89 100644 --- a/FModel/Views/Snooper/Shading/Material.cs +++ b/FModel/Views/Snooper/Shading/Material.cs @@ -19,6 +19,7 @@ public class Material : IDisposable public readonly CMaterialParams2 Parameters; public string Name; + public string Path; public int SelectedChannel; public int SelectedTexture; public bool IsUsed; @@ -43,6 +44,7 @@ public class Material : IDisposable { Parameters = new CMaterialParams2(); Name = ""; + Path = "None"; IsUsed = false; Diffuse = Array.Empty(); @@ -63,6 +65,7 @@ public class Material : IDisposable public void SwapMaterial(UMaterialInterface unrealMaterial) { Name = unrealMaterial.Name; + Path = unrealMaterial.GetPathName(); unrealMaterial.GetParams(Parameters, EMaterialFormat.AllLayers); } diff --git a/FModel/Views/Snooper/Shading/TextureHelper.cs b/FModel/Views/Snooper/Shading/TextureHelper.cs index b082aa4c..a3118384 100644 --- a/FModel/Views/Snooper/Shading/TextureHelper.cs +++ b/FModel/Views/Snooper/Shading/TextureHelper.cs @@ -37,6 +37,8 @@ public static class TextureHelper // B: Whatever (AO / S / E / ...) case "shootergame": case "divineknockout": + case "moonman": + case "marsman": { unsafe { diff --git a/FModel/Views/Snooper/SnimGui.cs b/FModel/Views/Snooper/SnimGui.cs index 5f5c8129..cb4b90d3 100644 --- a/FModel/Views/Snooper/SnimGui.cs +++ b/FModel/Views/Snooper/SnimGui.cs @@ -503,7 +503,7 @@ Snooper aims to give an accurate preview of models, materials, skeletal animatio else _swapper.Value = true; } ImGui.Separator(); - if (ImGui.Selectable("Copy Name to Clipboard")) ImGui.SetClipboardText(material.Name); + if (ImGui.Selectable("Copy Path to Clipboard")) ImGui.SetClipboardText(material.Path); }); ImGui.PopID(); } @@ -639,7 +639,7 @@ Snooper aims to give an accurate preview of models, materials, skeletal animatio material.ImGuiColors(material.Parameters.Colors); ImGui.TreePop(); } - if (ImGui.TreeNode("Referenced Textures")) + if (ImGui.TreeNode("All Textures")) { material.ImGuiDictionaries("textures", material.Parameters.Textures); ImGui.TreePop();