Redesign character areas a bit
This commit is contained in:
@@ -154,10 +154,14 @@ public class ProfilePanel
|
|||||||
|
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
var isShouldDraw = ImGui.CollapsingHeader("Character settings");
|
var isShouldDraw = ImGui.CollapsingHeader("Add character");
|
||||||
|
|
||||||
if (isShouldDraw)
|
if (isShouldDraw)
|
||||||
DrawCharacterArea();
|
DrawAddCharactersArea();
|
||||||
|
|
||||||
|
ImGui.Separator();
|
||||||
|
|
||||||
|
DrawCharacterListArea();
|
||||||
|
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
@@ -242,7 +246,7 @@ public class ProfilePanel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawCharacterArea()
|
private void DrawAddCharactersArea()
|
||||||
{
|
{
|
||||||
using (var style = ImRaii.PushStyle(ImGuiStyleVar.ButtonTextAlign, new Vector2(0, 0.5f)))
|
using (var style = ImRaii.PushStyle(ImGuiStyleVar.ButtonTextAlign, new Vector2(0, 0.5f)))
|
||||||
{
|
{
|
||||||
@@ -285,9 +289,11 @@ public class ProfilePanel
|
|||||||
if (ImGuiUtil.DrawDisabledButton("Apply to selected NPC", buttonWidth, string.Empty, !_actorAssignmentUi.CanSetNpc))
|
if (ImGuiUtil.DrawDisabledButton("Apply to selected NPC", buttonWidth, string.Empty, !_actorAssignmentUi.CanSetNpc))
|
||||||
_manager.AddCharacter(_selector.Selected!, _actorAssignmentUi.NpcIdentifier);
|
_manager.AddCharacter(_selector.Selected!, _actorAssignmentUi.NpcIdentifier);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ImGui.Separator();
|
private void DrawCharacterListArea()
|
||||||
|
{
|
||||||
var isDefaultLP = _manager.DefaultLocalPlayerProfile == _selector.Selected;
|
var isDefaultLP = _manager.DefaultLocalPlayerProfile == _selector.Selected;
|
||||||
var isDefaultLPOrCurrentProfilesEnabled = (_manager.DefaultLocalPlayerProfile?.Enabled ?? false) || (_selector.Selected?.Enabled ?? false);
|
var isDefaultLPOrCurrentProfilesEnabled = (_manager.DefaultLocalPlayerProfile?.Enabled ?? false) || (_selector.Selected?.Enabled ?? false);
|
||||||
using (ImRaii.Disabled(isDefaultLPOrCurrentProfilesEnabled))
|
using (ImRaii.Disabled(isDefaultLPOrCurrentProfilesEnabled))
|
||||||
@@ -306,6 +312,11 @@ public class ProfilePanel
|
|||||||
ImGuiUtil.HoverTooltip("Can only be changed when both currently selected and profile where this checkbox is checked are disabled.");
|
ImGuiUtil.HoverTooltip("Can only be changed when both currently selected and profile where this checkbox is checked are disabled.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui.SameLine();
|
||||||
|
using(ImRaii.Disabled(true))
|
||||||
|
ImGui.Button("##splitter", new Vector2(1, ImGui.GetFrameHeight()));
|
||||||
|
ImGui.SameLine();
|
||||||
|
|
||||||
var isDefault = _manager.DefaultProfile == _selector.Selected;
|
var isDefault = _manager.DefaultProfile == _selector.Selected;
|
||||||
var isDefaultOrCurrentProfilesEnabled = (_manager.DefaultProfile?.Enabled ?? false) || (_selector.Selected?.Enabled ?? false);
|
var isDefaultOrCurrentProfilesEnabled = (_manager.DefaultProfile?.Enabled ?? false) || (_selector.Selected?.Enabled ?? false);
|
||||||
using (ImRaii.Disabled(isDefaultOrCurrentProfilesEnabled))
|
using (ImRaii.Disabled(isDefaultOrCurrentProfilesEnabled))
|
||||||
@@ -323,11 +334,12 @@ public class ProfilePanel
|
|||||||
ImGui.PopStyleColor();
|
ImGui.PopStyleColor();
|
||||||
ImGuiUtil.HoverTooltip("Can only be changed when both currently selected and profile where this checkbox is checked are disabled.");
|
ImGuiUtil.HoverTooltip("Can only be changed when both currently selected and profile where this checkbox is checked are disabled.");
|
||||||
}
|
}
|
||||||
|
bool appliesToMultiple = _manager.DefaultProfile == _selector.Selected || _manager.DefaultLocalPlayerProfile == _selector.Selected;
|
||||||
|
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
using var dis = ImRaii.Disabled(appliesToMultiple);
|
using var dis = ImRaii.Disabled(appliesToMultiple);
|
||||||
using var table = ImRaii.Table("CharacterTable", 2, ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollX | ImGuiTableFlags.ScrollY, new Vector2(ImGui.GetContentRegionAvail().X, 150));
|
using var table = ImRaii.Table("CharacterTable", 2, ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollX | ImGuiTableFlags.ScrollY, new Vector2(ImGui.GetContentRegionAvail().X, 200));
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -344,7 +356,6 @@ public class ProfilePanel
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//warn: .ToList() might be performance critical at some point
|
//warn: .ToList() might be performance critical at some point
|
||||||
//the copying via ToList is done because manipulations with .Templates list result in "Collection was modified" exception here
|
//the copying via ToList is done because manipulations with .Templates list result in "Collection was modified" exception here
|
||||||
var charas = _selector.Selected!.Characters.WithIndex().ToList();
|
var charas = _selector.Selected!.Characters.WithIndex().ToList();
|
||||||
@@ -402,7 +413,6 @@ public class ProfilePanel
|
|||||||
"Several profiles are trying to affect this character. This profile is being applied.");
|
"Several profiles are trying to affect this character. This profile is being applied.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
_endAction?.Invoke();
|
_endAction?.Invoke();
|
||||||
_endAction = null;
|
_endAction = null;
|
||||||
|
|||||||
@@ -101,7 +101,21 @@ public class BoneEditorPanel
|
|||||||
|
|
||||||
using (var style = ImRaii.PushStyle(ImGuiStyleVar.ButtonTextAlign, new Vector2(0, 0.5f)))
|
using (var style = ImRaii.PushStyle(ImGuiStyleVar.ButtonTextAlign, new Vector2(0, 0.5f)))
|
||||||
{
|
{
|
||||||
var isShouldDraw = ImGui.CollapsingHeader("Preview settings");
|
string characterText = null!;
|
||||||
|
|
||||||
|
if (_templateFileSystemSelector.IncognitoMode)
|
||||||
|
characterText = "Previewing on: incognito active";
|
||||||
|
else
|
||||||
|
characterText = _editorManager.Character.IsValid ? $"Previewing on: {(_editorManager.Character.Type == Penumbra.GameData.Enums.IdentifierType.Owned ?
|
||||||
|
_editorManager.Character.ToNameWithoutOwnerName() : _editorManager.Character.ToString())}" : "No valid character selected";
|
||||||
|
|
||||||
|
ImGuiUtil.PrintIcon(FontAwesomeIcon.User);
|
||||||
|
ImGui.SameLine();
|
||||||
|
ImGui.Text(characterText);
|
||||||
|
|
||||||
|
ImGui.Separator();
|
||||||
|
|
||||||
|
var isShouldDraw = ImGui.CollapsingHeader("Change preview character");
|
||||||
|
|
||||||
if (isShouldDraw)
|
if (isShouldDraw)
|
||||||
{
|
{
|
||||||
@@ -111,10 +125,6 @@ public class BoneEditorPanel
|
|||||||
{
|
{
|
||||||
if (!_templateFileSystemSelector.IncognitoMode)
|
if (!_templateFileSystemSelector.IncognitoMode)
|
||||||
{
|
{
|
||||||
ImGui.Text(_editorManager.Character.IsValid ? $"Applies to {(_editorManager.Character.Type == Penumbra.GameData.Enums.IdentifierType.Owned ?
|
|
||||||
_editorManager.Character.ToNameWithoutOwnerName() : _editorManager.Character.ToString())}" : "No valid character selected");
|
|
||||||
ImGui.Separator();
|
|
||||||
|
|
||||||
_actorAssignmentUi.DrawWorldCombo(width.X / 2);
|
_actorAssignmentUi.DrawWorldCombo(width.X / 2);
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
_actorAssignmentUi.DrawPlayerInput(width.X / 2);
|
_actorAssignmentUi.DrawPlayerInput(width.X / 2);
|
||||||
|
|||||||
Reference in New Issue
Block a user