mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 12:14:17 +01:00
Clean up UI
This commit is contained in:
parent
73ff3642fc
commit
bb9e7cac07
3 changed files with 66 additions and 12 deletions
|
|
@ -93,7 +93,6 @@ public sealed class ModelManager : SingleTaskQueue, IDisposable
|
||||||
if (_sklb == null)
|
if (_sklb == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// TODO: work out how i handle this havok deal. running it outside the framework causes an immediate ctd.
|
|
||||||
var xmlTask = _manager._framework.RunOnFrameworkThread(() => HavokConverter.HkxToXml(_sklb.Skeleton));
|
var xmlTask = _manager._framework.RunOnFrameworkThread(() => HavokConverter.HkxToXml(_sklb.Skeleton));
|
||||||
xmlTask.Wait(cancel);
|
xmlTask.Wait(cancel);
|
||||||
var xml = xmlTask.Result;
|
var xml = xmlTask.Result;
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,10 @@ public partial class ModEditWindow
|
||||||
private ModEditWindow _edit;
|
private ModEditWindow _edit;
|
||||||
|
|
||||||
public readonly MdlFile Mdl;
|
public readonly MdlFile Mdl;
|
||||||
public List<Utf8GamePath>? GamePaths { get; private set ;}
|
|
||||||
private readonly List<string>[] _attributes;
|
private readonly List<string>[] _attributes;
|
||||||
|
|
||||||
|
public List<Utf8GamePath>? GamePaths { get; private set ;}
|
||||||
|
public int GamePathIndex;
|
||||||
|
|
||||||
public bool PendingIo { get; private set; } = false;
|
public bool PendingIo { get; private set; } = false;
|
||||||
public string? IoException { get; private set; } = null;
|
public string? IoException { get; private set; } = null;
|
||||||
|
|
|
||||||
|
|
@ -34,16 +34,7 @@ public partial class ModEditWindow
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tab.GamePaths != null)
|
DrawExport(tab, disabled);
|
||||||
if (ImGuiUtil.DrawDisabledButton("bingo bango", Vector2.Zero, "description", tab.PendingIo))
|
|
||||||
tab.Export("C:\\Users\\ackwell\\blender\\gltf-tests\\bingo.gltf", tab.GamePaths.First());
|
|
||||||
ImGui.TextUnformatted("blippity blap");
|
|
||||||
if (tab.GamePaths != null)
|
|
||||||
foreach (var gamePath in tab.GamePaths)
|
|
||||||
ImGui.TextUnformatted(gamePath.ToString());
|
|
||||||
|
|
||||||
if (tab.IoException != null)
|
|
||||||
ImGui.TextUnformatted(tab.IoException);
|
|
||||||
|
|
||||||
var ret = false;
|
var ret = false;
|
||||||
|
|
||||||
|
|
@ -58,6 +49,68 @@ public partial class ModEditWindow
|
||||||
return !disabled && ret;
|
return !disabled && ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void DrawExport(MdlTab tab, bool disabled)
|
||||||
|
{
|
||||||
|
// IO on a disabled panel doesn't really make sense.
|
||||||
|
if (disabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!ImGui.CollapsingHeader("Export"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (tab.GamePaths == null)
|
||||||
|
{
|
||||||
|
if (tab.IoException == null)
|
||||||
|
ImGui.TextUnformatted("Resolving model game paths.");
|
||||||
|
else
|
||||||
|
ImGuiUtil.TextWrapped(tab.IoException);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawGamePathCombo(tab);
|
||||||
|
|
||||||
|
if (ImGuiUtil.DrawDisabledButton("Export to glTF", Vector2.Zero, "Exports this mdl file to glTF, for use in 3D authoring applications.", tab.PendingIo))
|
||||||
|
{
|
||||||
|
var gamePath = tab.GamePaths[tab.GamePathIndex];
|
||||||
|
|
||||||
|
_fileDialog.OpenSavePicker(
|
||||||
|
"Save model as glTF.",
|
||||||
|
".gltf",
|
||||||
|
Path.GetFileNameWithoutExtension(gamePath.Filename().ToString()),
|
||||||
|
".gltf",
|
||||||
|
(valid, path) => {
|
||||||
|
if (!valid)
|
||||||
|
return;
|
||||||
|
|
||||||
|
tab.Export(path, gamePath);
|
||||||
|
},
|
||||||
|
_mod!.ModPath.FullName,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tab.IoException != null)
|
||||||
|
ImGuiUtil.TextWrapped(tab.IoException);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DrawGamePathCombo(MdlTab tab)
|
||||||
|
{
|
||||||
|
using var combo = ImRaii.Combo("Game Path", tab.GamePaths![tab.GamePathIndex].ToString());
|
||||||
|
if (!combo)
|
||||||
|
return;
|
||||||
|
|
||||||
|
foreach (var (path, index) in tab.GamePaths.WithIndex())
|
||||||
|
{
|
||||||
|
if (!ImGui.Selectable(path.ToString(), index == tab.GamePathIndex))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
tab.GamePathIndex = index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private bool DrawModelMaterialDetails(MdlTab tab, bool disabled)
|
private bool DrawModelMaterialDetails(MdlTab tab, bool disabled)
|
||||||
{
|
{
|
||||||
if (!ImGui.CollapsingHeader("Materials"))
|
if (!ImGui.CollapsingHeader("Materials"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue