mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 04:34:19 +01:00
Added button to immediately assign collection to current player.
This commit is contained in:
parent
37a56c56af
commit
0534fecc0c
1 changed files with 33 additions and 8 deletions
|
|
@ -166,7 +166,7 @@ public partial class ConfigWindow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.Dummy( Vector2.Zero );
|
ImGui.Dummy( _window._defaultSpace );
|
||||||
DrawNewIndividualCollection();
|
DrawNewIndividualCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -243,11 +243,13 @@ public partial class ConfigWindow
|
||||||
var buttonWidth1 = new Vector2( 90 * ImGuiHelpers.GlobalScale, 0 );
|
var buttonWidth1 = new Vector2( 90 * ImGuiHelpers.GlobalScale, 0 );
|
||||||
var buttonWidth2 = new Vector2( 120 * ImGuiHelpers.GlobalScale, 0 );
|
var buttonWidth2 = new Vector2( 120 * ImGuiHelpers.GlobalScale, 0 );
|
||||||
|
|
||||||
var combo = GetNpcCombo( _newKind );
|
var change = DrawNewCurrentPlayerCollection();
|
||||||
var change = DrawNewPlayerCollection( buttonWidth1, width );
|
|
||||||
|
change |= DrawNewPlayerCollection( buttonWidth1, width );
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
change |= DrawNewRetainerCollection( buttonWidth2 );
|
change |= DrawNewRetainerCollection( buttonWidth2 );
|
||||||
|
|
||||||
|
var combo = GetNpcCombo( _newKind );
|
||||||
change |= DrawNewNpcCollection( combo, buttonWidth1, width );
|
change |= DrawNewNpcCollection( combo, buttonWidth1, width );
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
change |= DrawNewOwnedCollection( buttonWidth2 );
|
change |= DrawNewOwnedCollection( buttonWidth2 );
|
||||||
|
|
@ -258,6 +260,27 @@ public partial class ConfigWindow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool DrawNewCurrentPlayerCollection()
|
||||||
|
{
|
||||||
|
var player = Penumbra.Actors.GetCurrentPlayer();
|
||||||
|
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 logged-in character detected.",
|
||||||
|
_ => string.Empty,
|
||||||
|
};
|
||||||
|
|
||||||
|
if( ImGuiUtil.DrawDisabledButton( "Assign Currently Played Character", _window._inputTextWidth, tt, result != IndividualCollections.AddResult.Valid ) )
|
||||||
|
{
|
||||||
|
Penumbra.CollectionManager.Individuals.Add( new[] { player }, Penumbra.CollectionManager.Default );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private void UpdateIdentifiers()
|
private void UpdateIdentifiers()
|
||||||
{
|
{
|
||||||
var combo = GetNpcCombo( _newKind );
|
var combo = GetNpcCombo( _newKind );
|
||||||
|
|
@ -306,7 +329,9 @@ public partial class ConfigWindow
|
||||||
private void UpdateIdentifiers( CollectionType type, ModCollection? _1, ModCollection? _2, string _3 )
|
private void UpdateIdentifiers( CollectionType type, ModCollection? _1, ModCollection? _2, string _3 )
|
||||||
{
|
{
|
||||||
if( type == CollectionType.Individual )
|
if( type == CollectionType.Individual )
|
||||||
|
{
|
||||||
UpdateIdentifiers();
|
UpdateIdentifiers();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue