mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-21 16:09:27 +01:00
Show an invalid material count
This commit is contained in:
parent
c96adcf557
commit
078688454a
1 changed files with 17 additions and 2 deletions
|
|
@ -293,7 +293,21 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
private bool DrawModelMaterialDetails(MdlTab tab, bool disabled)
|
private bool DrawModelMaterialDetails(MdlTab tab, bool disabled)
|
||||||
{
|
{
|
||||||
if (!ImGui.CollapsingHeader("Materials"))
|
var invalidMaterialCount = tab.Mdl.Materials.Count(material => !tab.ValidateMaterial(material));
|
||||||
|
|
||||||
|
var oldPos = ImGui.GetCursorPosY();
|
||||||
|
var header = ImGui.CollapsingHeader("Materials");
|
||||||
|
var newPos = ImGui.GetCursorPos();
|
||||||
|
if (invalidMaterialCount > 0)
|
||||||
|
{
|
||||||
|
var text = $"{invalidMaterialCount} invalid material{(invalidMaterialCount > 1 ? "s" : "")}";
|
||||||
|
var size = ImGui.CalcTextSize(text).X;
|
||||||
|
ImGui.SetCursorPos(new Vector2(ImGui.GetContentRegionAvail().X - size, oldPos + ImGui.GetStyle().FramePadding.Y));
|
||||||
|
ImGuiUtil.TextColored(0xFF0000FF, text);
|
||||||
|
ImGui.SetCursorPos(newPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!header)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
using var table = ImRaii.Table(string.Empty, disabled ? 2 : 4, ImGuiTableFlags.SizingFixedFit);
|
using var table = ImRaii.Table(string.Empty, disabled ? 2 : 4, ImGuiTableFlags.SizingFixedFit);
|
||||||
|
|
@ -382,7 +396,8 @@ public partial class ModEditWindow
|
||||||
{
|
{
|
||||||
ImGuiComponents.HelpMarker(
|
ImGuiComponents.HelpMarker(
|
||||||
"Materials must be either relative (e.g. \"/filename.mtrl\")\n"
|
"Materials must be either relative (e.g. \"/filename.mtrl\")\n"
|
||||||
+ "or absolute (e.g. \"bg/full/path/to/filename.mtrl\").",
|
+ "or absolute (e.g. \"bg/full/path/to/filename.mtrl\"),\n"
|
||||||
|
+ "and must end in \".mtrl\".",
|
||||||
FontAwesomeIcon.TimesCircle);
|
FontAwesomeIcon.TimesCircle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue