mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-15 13:14:17 +01:00
Add Target button to collection assignments.
This commit is contained in:
parent
6b558c5940
commit
b64a9a51f8
1 changed files with 23 additions and 0 deletions
|
|
@ -244,6 +244,7 @@ public partial class ConfigWindow
|
||||||
var buttonWidth2 = new Vector2( 120 * ImGuiHelpers.GlobalScale, 0 );
|
var buttonWidth2 = new Vector2( 120 * ImGuiHelpers.GlobalScale, 0 );
|
||||||
|
|
||||||
var change = DrawNewCurrentPlayerCollection();
|
var change = DrawNewCurrentPlayerCollection();
|
||||||
|
change |= DrawNewTargetCollection();
|
||||||
|
|
||||||
change |= DrawNewPlayerCollection( buttonWidth1, width );
|
change |= DrawNewPlayerCollection( buttonWidth1, width );
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
|
|
@ -278,6 +279,28 @@ public partial class ConfigWindow
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool DrawNewTargetCollection()
|
||||||
|
{
|
||||||
|
var target = Dalamud.Targets.Target;
|
||||||
|
var player = Penumbra.Actors.FromObject( target, false, true );
|
||||||
|
var result = Penumbra.CollectionManager.Individuals.CanAdd( player );
|
||||||
|
var tt = result switch
|
||||||
|
{
|
||||||
|
IndividualCollections.AddResult.Valid => $"Assign a collection to {player}.",
|
||||||
|
IndividualCollections.AddResult.AlreadySet => AlreadyAssigned,
|
||||||
|
IndividualCollections.AddResult.Invalid => "No valid character in target detected.",
|
||||||
|
_ => string.Empty,
|
||||||
|
};
|
||||||
|
|
||||||
|
if( ImGuiUtil.DrawDisabledButton( "Assign Current Target", _window._inputTextWidth, tt, result != IndividualCollections.AddResult.Valid ) )
|
||||||
|
{
|
||||||
|
Penumbra.CollectionManager.Individuals.Add( new[] { player }, Penumbra.CollectionManager.Default );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
ImGuiComponents.HelpMarker( "- Bell Retainers also apply to Mannequins named after them, but not to outdoor retainers, since they only carry their owners name.\n"
|
ImGuiComponents.HelpMarker( "- Bell Retainers also apply to Mannequins named after them, but not to outdoor retainers, since they only carry their owners name.\n"
|
||||||
+ "- Some NPCs are available as Battle- and Event NPCs and need to be setup for both if desired.\n"
|
+ "- Some NPCs are available as Battle- and Event NPCs and need to be setup for both if desired.\n"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue