mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-15 05:04:15 +01:00
Minimal cleanup on option descriptions.
This commit is contained in:
parent
3dc04293eb
commit
bb805345b1
6 changed files with 37 additions and 20 deletions
|
|
@ -136,7 +136,7 @@ public sealed partial class IndividualCollections : IReadOnlyList< (string Displ
|
||||||
return ( Penumbra.Config.UseCharacterCollectionInInspect ? identifier : ActorIdentifier.Invalid, SpecialResult.Card );
|
return ( Penumbra.Config.UseCharacterCollectionInInspect ? identifier : ActorIdentifier.Invalid, SpecialResult.Card );
|
||||||
}
|
}
|
||||||
|
|
||||||
return ( Penumbra.Config.UseCharacterCollectionInTryOn ? _actorManager.GetGlamourPlayer() : ActorIdentifier.Invalid, SpecialResult.Glamour );
|
return Penumbra.Config.UseCharacterCollectionInTryOn ? ( _actorManager.GetGlamourPlayer(), SpecialResult.Glamour ) : ( identifier, SpecialResult.Invalid );
|
||||||
}
|
}
|
||||||
default: return ( identifier, SpecialResult.Invalid );
|
default: return ( identifier, SpecialResult.Invalid );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,7 @@ public partial class TexToolsImporter
|
||||||
}
|
}
|
||||||
|
|
||||||
Mod.CreateOptionGroup( _currentModDirectory, group.SelectionType, name, groupPriority, groupPriority,
|
Mod.CreateOptionGroup( _currentModDirectory, group.SelectionType, name, groupPriority, groupPriority,
|
||||||
defaultSettings ?? 0, string.Empty, options );
|
defaultSettings ?? 0, group.Description, options );
|
||||||
++groupPriority;
|
++groupPriority;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,9 @@ internal class ModPackPage
|
||||||
internal class ModGroup
|
internal class ModGroup
|
||||||
{
|
{
|
||||||
public string GroupName = string.Empty;
|
public string GroupName = string.Empty;
|
||||||
public GroupType SelectionType = GroupType.Single;
|
public GroupType SelectionType = GroupType.Single;
|
||||||
public OptionList[] OptionList = Array.Empty< OptionList >();
|
public OptionList[] OptionList = Array.Empty< OptionList >();
|
||||||
|
public string Description = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
|
|
@ -46,7 +47,7 @@ internal class OptionList
|
||||||
public string ImagePath = string.Empty;
|
public string ImagePath = string.Empty;
|
||||||
public SimpleMod[] ModsJsons = Array.Empty< SimpleMod >();
|
public SimpleMod[] ModsJsons = Array.Empty< SimpleMod >();
|
||||||
public string GroupName = string.Empty;
|
public string GroupName = string.Empty;
|
||||||
public GroupType SelectionType = GroupType.Single;
|
public GroupType SelectionType = GroupType.Single;
|
||||||
public bool IsChecked = false;
|
public bool IsChecked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -128,16 +128,12 @@ public sealed partial class Mod
|
||||||
{
|
{
|
||||||
var group = mod._groups[ groupIdx ];
|
var group = mod._groups[ groupIdx ];
|
||||||
var option = group[ optionIdx ];
|
var option = group[ optionIdx ];
|
||||||
if( option.Description == newDescription )
|
if( option.Description == newDescription || option is not SubMod s )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = option switch
|
s.Description = newDescription;
|
||||||
{
|
|
||||||
SubMod s => s.Description = newDescription,
|
|
||||||
};
|
|
||||||
|
|
||||||
ModOptionChanged.Invoke( ModOptionChangeType.DisplayChange, mod, groupIdx, optionIdx, -1 );
|
ModOptionChanged.Invoke( ModOptionChangeType.DisplayChange, mod, groupIdx, optionIdx, -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -311,8 +311,13 @@ public partial class ConfigWindow
|
||||||
{
|
{
|
||||||
_newDescriptionIdx = groupIdx;
|
_newDescriptionIdx = groupIdx;
|
||||||
_newDesriptionOptionIdx = optionIdx;
|
_newDesriptionOptionIdx = optionIdx;
|
||||||
_newDescription = groupIdx < 0 ? mod.Description : optionIdx < 0 ? mod.Groups[ groupIdx ].Description : mod.Groups[ groupIdx ][ optionIdx ].Description;
|
_newDescription = groupIdx < 0
|
||||||
_mod = mod;
|
? mod.Description
|
||||||
|
: optionIdx < 0
|
||||||
|
? mod.Groups[ groupIdx ].Description
|
||||||
|
: mod.Groups[ groupIdx ][ optionIdx ].Description;
|
||||||
|
|
||||||
|
_mod = mod;
|
||||||
ImGui.OpenPopup( PopupName );
|
ImGui.OpenPopup( PopupName );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -365,6 +370,7 @@ public partial class ConfigWindow
|
||||||
{
|
{
|
||||||
Penumbra.ModManager.ChangeOptionDescription( _mod, _newDescriptionIdx, _newDesriptionOptionIdx, _newDescription );
|
Penumbra.ModManager.ChangeOptionDescription( _mod, _newDescriptionIdx, _newDesriptionOptionIdx, _newDescription );
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -486,7 +492,7 @@ public partial class ConfigWindow
|
||||||
ImGui.TableSetupColumn( "idx", ImGuiTableColumnFlags.WidthFixed, 60 * ImGuiHelpers.GlobalScale );
|
ImGui.TableSetupColumn( "idx", ImGuiTableColumnFlags.WidthFixed, 60 * ImGuiHelpers.GlobalScale );
|
||||||
ImGui.TableSetupColumn( "default", ImGuiTableColumnFlags.WidthFixed, ImGui.GetFrameHeight() );
|
ImGui.TableSetupColumn( "default", ImGuiTableColumnFlags.WidthFixed, ImGui.GetFrameHeight() );
|
||||||
ImGui.TableSetupColumn( "name", ImGuiTableColumnFlags.WidthFixed,
|
ImGui.TableSetupColumn( "name", ImGuiTableColumnFlags.WidthFixed,
|
||||||
panel._window._inputTextWidth.X - 68 * ImGuiHelpers.GlobalScale - ImGui.GetFrameHeight() );
|
panel._window._inputTextWidth.X - 72 * ImGuiHelpers.GlobalScale - ImGui.GetFrameHeight() - panel._window._iconButtonSize.X );
|
||||||
ImGui.TableSetupColumn( "description", ImGuiTableColumnFlags.WidthFixed, panel._window._iconButtonSize.X );
|
ImGui.TableSetupColumn( "description", ImGuiTableColumnFlags.WidthFixed, panel._window._iconButtonSize.X );
|
||||||
ImGui.TableSetupColumn( "delete", ImGuiTableColumnFlags.WidthFixed, panel._window._iconButtonSize.X );
|
ImGui.TableSetupColumn( "delete", ImGuiTableColumnFlags.WidthFixed, panel._window._iconButtonSize.X );
|
||||||
ImGui.TableSetupColumn( "priority", ImGuiTableColumnFlags.WidthFixed, 50 * ImGuiHelpers.GlobalScale );
|
ImGui.TableSetupColumn( "priority", ImGuiTableColumnFlags.WidthFixed, 50 * ImGuiHelpers.GlobalScale );
|
||||||
|
|
@ -547,6 +553,7 @@ public partial class ConfigWindow
|
||||||
{
|
{
|
||||||
panel._delayedActions.Enqueue( () => DescriptionEdit.OpenPopup( panel._mod, groupIdx, optionIdx ) );
|
panel._delayedActions.Enqueue( () => DescriptionEdit.OpenPopup( panel._mod, groupIdx, optionIdx ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
if( ImGuiUtil.DrawDisabledButton( FontAwesomeIcon.Trash.ToIconString(), panel._window._iconButtonSize,
|
if( ImGuiUtil.DrawDisabledButton( FontAwesomeIcon.Trash.ToIconString(), panel._window._iconButtonSize,
|
||||||
"Delete this option.\nHold Control while clicking to delete.", !ImGui.GetIO().KeyCtrl, true ) )
|
"Delete this option.\nHold Control while clicking to delete.", !ImGui.GetIO().KeyCtrl, true ) )
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ public partial class ConfigWindow
|
||||||
if( _mod.Groups.Count > 0 )
|
if( _mod.Groups.Count > 0 )
|
||||||
{
|
{
|
||||||
var useDummy = true;
|
var useDummy = true;
|
||||||
foreach(var (group, idx) in _mod.Groups.WithIndex().Where(g => g.Value.Type == GroupType.Single && g.Value.IsOption ))
|
foreach( var (group, idx) in _mod.Groups.WithIndex().Where( g => g.Value.Type == GroupType.Single && g.Value.IsOption ) )
|
||||||
{
|
{
|
||||||
ImGuiUtil.Dummy( _window._defaultSpace, useDummy );
|
ImGuiUtil.Dummy( _window._defaultSpace, useDummy );
|
||||||
useDummy = false;
|
useDummy = false;
|
||||||
|
|
@ -175,15 +175,27 @@ public partial class ConfigWindow
|
||||||
for( var idx2 = 0; idx2 < group.Count; ++idx2 )
|
for( var idx2 = 0; idx2 < group.Count; ++idx2 )
|
||||||
{
|
{
|
||||||
id.Push( idx2 );
|
id.Push( idx2 );
|
||||||
if( ImGui.Selectable( group[ idx2 ].Name, idx2 == selectedOption ) )
|
var option = group[ idx2 ];
|
||||||
|
if( ImGui.Selectable( option.Name, idx2 == selectedOption ) )
|
||||||
{
|
{
|
||||||
Penumbra.CollectionManager.Current.SetModSetting( _mod.Index, groupIdx, ( uint )idx2 );
|
Penumbra.CollectionManager.Current.SetModSetting( _mod.Index, groupIdx, ( uint )idx2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !string.IsNullOrEmpty( group[ idx2 ].Description ) )
|
if( option.Description.Length > 0 )
|
||||||
{
|
{
|
||||||
|
var hovered = ImGui.IsItemHovered();
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
ImGuiComponents.HelpMarker(group[idx2].Description);
|
using( var font = ImRaii.PushFont( UiBuilder.IconFont ) )
|
||||||
|
{
|
||||||
|
using var color = ImRaii.PushColor( ImGuiCol.Text, ImGui.GetColorU32( ImGuiCol.TextDisabled ) );
|
||||||
|
ImGuiUtil.RightAlign( FontAwesomeIcon.InfoCircle.ToIconString(), ImGui.GetStyle().ItemSpacing.X );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( hovered )
|
||||||
|
{
|
||||||
|
using var tt = ImRaii.Tooltip();
|
||||||
|
ImGui.TextUnformatted( option.Description );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
id.Pop();
|
id.Pop();
|
||||||
|
|
@ -211,19 +223,20 @@ public partial class ConfigWindow
|
||||||
Widget.BeginFramedGroup( group.Name, group.Description );
|
Widget.BeginFramedGroup( group.Name, group.Description );
|
||||||
for( var idx2 = 0; idx2 < group.Count; ++idx2 )
|
for( var idx2 = 0; idx2 < group.Count; ++idx2 )
|
||||||
{
|
{
|
||||||
|
var option = group[ idx2 ];
|
||||||
id.Push( idx2 );
|
id.Push( idx2 );
|
||||||
var flag = 1u << idx2;
|
var flag = 1u << idx2;
|
||||||
var setting = ( flags & flag ) != 0;
|
var setting = ( flags & flag ) != 0;
|
||||||
if( ImGui.Checkbox( group[ idx2 ].Name, ref setting ) )
|
if( ImGui.Checkbox( option.Name, ref setting ) )
|
||||||
{
|
{
|
||||||
flags = setting ? flags | flag : flags & ~flag;
|
flags = setting ? flags | flag : flags & ~flag;
|
||||||
Penumbra.CollectionManager.Current.SetModSetting( _mod.Index, groupIdx, flags );
|
Penumbra.CollectionManager.Current.SetModSetting( _mod.Index, groupIdx, flags );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !string.IsNullOrEmpty( group[ idx2 ].Description ) )
|
if( option.Description.Length > 0 )
|
||||||
{
|
{
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
ImGuiComponents.HelpMarker(group[idx2].Description);
|
ImGuiComponents.HelpMarker( option.Description );
|
||||||
}
|
}
|
||||||
|
|
||||||
id.Pop();
|
id.Pop();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue