Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
4sval committed Mar 3, 2023
1 parent edd3a47 commit aca754a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion FModel/ViewModels/ApplicationViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public async Task InitOodle()
public async Task InitImGuiSettings(bool forceDownload)
{
var imgui = Path.Combine(/*UserSettings.Default.OutputDirectory, ".data", */"imgui.ini");
if (!forceDownload || File.Exists(imgui)) return;
if (File.Exists(imgui) && !forceDownload) return;

await ApplicationService.ApiEndpointView.DownloadFileAsync("https://cdn.fmodel.app/d/configurations/imgui.ini", imgui);
if (new FileInfo(imgui).Length == 0)
Expand Down
2 changes: 1 addition & 1 deletion FModel/ViewModels/CUE4ParseViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ public void ExtractAndScroll(CancellationToken cancellationToken, string fullPat
TabControl.SelectedTab.SetDocumentText(solarisDigest.ReadableCode, false);
return true;
}
case UTexture2D texture when loadTextures:
case UTexture2D { IsVirtual: false } texture when loadTextures:
{
TabControl.SelectedTab.AddImage(texture, HasFlag(bulk, EBulkType.Auto));
return false;
Expand Down
3 changes: 2 additions & 1 deletion FModel/Views/Snooper/Animations/Skeleton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ private void TrackSkeleton(CAnimSet anim)
{
if (parentTrackIndex < 0) break;
info = anim.TrackBonesInfo[parentTrackIndex];
if (BonesIndicesByLoweredName.TryGetValue(info.Name.Text.ToLower(), out var parentBoneIndices) && parentBoneIndices.HasTrack)
if (boneIndices.LoweredParentBoneName.Equals(info.Name.Text, StringComparison.OrdinalIgnoreCase) && // same parent (name based)
BonesIndicesByLoweredName.TryGetValue(info.Name.Text.ToLower(), out var parentBoneIndices) && parentBoneIndices.HasTrack)
boneIndices.ParentTrackIndex = parentBoneIndices.BoneIndex;
else parentTrackIndex = info.ParentIndex;
} while (!boneIndices.HasParentTrack);
Expand Down
20 changes: 12 additions & 8 deletions FModel/Views/Snooper/SnimGui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,23 @@ private void DrawWorld(Snooper s)
{
if (ImGui.BeginTable("world_details", 2, ImGuiTableFlags.SizingStretchProp))
{
var b = false;
var length = s.Renderer.Options.Models.Count;
Layout("Renderer");ImGui.Text($" : {_renderer}");
Layout("Version");ImGui.Text($" : {_version}");
Layout("Loaded Models");ImGui.Text($" : x{length}");ImGui.SameLine();

var b = false;
if (ImGui.SmallButton("Save All"))
NoFramePaddingOnY(() =>
{
foreach (var model in s.Renderer.Options.Models.Values)
Layout("Renderer");ImGui.Text($" : {_renderer}");
Layout("Version");ImGui.Text($" : {_version}");
Layout("Loaded Models");ImGui.Text($" : x{length}");ImGui.SameLine();
if (ImGui.SmallButton("Save All"))
{
b |= s.Renderer.Options.TrySave(model.Export, out _, out _);
foreach (var model in s.Renderer.Options.Models.Values)
{
b |= s.Renderer.Options.TrySave(model.Export, out _, out _);
}
}
}
});

Modal("Saved", b, () =>
{
Expand Down

0 comments on commit aca754a

Please sign in to comment.