mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-15 05:04:15 +01:00
InstallerInfo (weird name?) => OptionGroup
This commit is contained in:
parent
70371b6467
commit
87c4172168
6 changed files with 19 additions and 19 deletions
|
|
@ -21,7 +21,7 @@ namespace Penumbra.Importer
|
||||||
|
|
||||||
public ImporterState State { get; private set; }
|
public ImporterState State { get; private set; }
|
||||||
|
|
||||||
public long TotalProgress { get; private set; } = 0;
|
public long TotalProgress { get; private set; }
|
||||||
public long CurrentProgress { get; private set; }
|
public long CurrentProgress { get; private set; }
|
||||||
|
|
||||||
public float Progress
|
public float Progress
|
||||||
|
|
@ -249,7 +249,7 @@ namespace Penumbra.Importer
|
||||||
|
|
||||||
private static void AddMeta( DirectoryInfo baseFolder, DirectoryInfo groupFolder, ModGroup group, ModMeta meta )
|
private static void AddMeta( DirectoryInfo baseFolder, DirectoryInfo groupFolder, ModGroup group, ModMeta meta )
|
||||||
{
|
{
|
||||||
var inf = new InstallerInfo
|
var inf = new OptionGroup
|
||||||
{
|
{
|
||||||
SelectionType = group.SelectionType,
|
SelectionType = group.SelectionType,
|
||||||
GroupName = group.GroupName!,
|
GroupName = group.GroupName!,
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ namespace Penumbra.Models
|
||||||
const string duplicates = "Duplicates";
|
const string duplicates = "Duplicates";
|
||||||
if( !_mod.Groups.ContainsKey( duplicates ) )
|
if( !_mod.Groups.ContainsKey( duplicates ) )
|
||||||
{
|
{
|
||||||
InstallerInfo info = new()
|
OptionGroup info = new()
|
||||||
{
|
{
|
||||||
GroupName = duplicates,
|
GroupName = duplicates,
|
||||||
SelectionType = SelectType.Single,
|
SelectionType = SelectType.Single,
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ namespace Penumbra.Models
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct InstallerInfo
|
public struct OptionGroup
|
||||||
{
|
{
|
||||||
public string GroupName;
|
public string GroupName;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace Penumbra.Models
|
||||||
|
|
||||||
public Dictionary< string, string > FileSwaps { get; } = new();
|
public Dictionary< string, string > FileSwaps { get; } = new();
|
||||||
|
|
||||||
public Dictionary< string, InstallerInfo > Groups { get; set; } = new();
|
public Dictionary< string, OptionGroup > Groups { get; set; } = new();
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public bool HasGroupWithConfig { get; set; } = false;
|
public bool HasGroupWithConfig { get; set; } = false;
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ namespace Penumbra.UI
|
||||||
|
|
||||||
private bool _editMode = false;
|
private bool _editMode = false;
|
||||||
private int _selectedGroupIndex = 0;
|
private int _selectedGroupIndex = 0;
|
||||||
private InstallerInfo? _selectedGroup = null;
|
private OptionGroup? _selectedGroup = null;
|
||||||
private int _selectedOptionIndex = 0;
|
private int _selectedOptionIndex = 0;
|
||||||
private Option? _selectedOption = null;
|
private Option? _selectedOption = null;
|
||||||
private (string label, string name)[]? _changedItemsList = null;
|
private (string label, string name)[]? _changedItemsList = null;
|
||||||
|
|
@ -99,7 +99,7 @@ namespace Penumbra.UI
|
||||||
|
|
||||||
if( _selectedGroup?.Options.Count > 0 )
|
if( _selectedGroup?.Options.Count > 0 )
|
||||||
{
|
{
|
||||||
_selectedOption = ( ( InstallerInfo )_selectedGroup ).Options[ _selectedOptionIndex ];
|
_selectedOption = ( ( OptionGroup )_selectedGroup ).Options[ _selectedOptionIndex ];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -545,7 +545,7 @@ namespace Penumbra.UI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawMultiSelectorCheckBox( InstallerInfo group, int idx, int flag, string label )
|
private void DrawMultiSelectorCheckBox( OptionGroup group, int idx, int flag, string label )
|
||||||
{
|
{
|
||||||
var opt = group.Options[ idx ];
|
var opt = group.Options[ idx ];
|
||||||
var enabled = ( flag & ( 1 << idx ) ) != 0;
|
var enabled = ( flag & ( 1 << idx ) ) != 0;
|
||||||
|
|
@ -557,7 +557,7 @@ namespace Penumbra.UI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawMultiSelector( InstallerInfo group )
|
private void DrawMultiSelector( OptionGroup group )
|
||||||
{
|
{
|
||||||
if( group.Options.Count == 0 )
|
if( group.Options.Count == 0 )
|
||||||
{
|
{
|
||||||
|
|
@ -574,7 +574,7 @@ namespace Penumbra.UI
|
||||||
ImGuiCustom.EndFramedGroup();
|
ImGuiCustom.EndFramedGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawSingleSelector( InstallerInfo group )
|
private void DrawSingleSelector( OptionGroup group )
|
||||||
{
|
{
|
||||||
if( group.Options.Count < 2 )
|
if( group.Options.Count < 2 )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ namespace Penumbra.UI
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var group = ( InstallerInfo )_selectedGroup!;
|
var group = ( OptionGroup )_selectedGroup!;
|
||||||
if( ImGui.Combo( LabelOptionSelect, ref _selectedOptionIndex, group.Options.Select( O => O.OptionName ).ToArray(),
|
if( ImGui.Combo( LabelOptionSelect, ref _selectedOptionIndex, group.Options.Select( O => O.OptionName ).ToArray(),
|
||||||
group.Options.Count ) )
|
group.Options.Count ) )
|
||||||
{
|
{
|
||||||
|
|
@ -103,7 +103,7 @@ namespace Penumbra.UI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool DrawMultiSelectorEditBegin( InstallerInfo group )
|
private bool DrawMultiSelectorEditBegin( OptionGroup group )
|
||||||
{
|
{
|
||||||
var groupName = group.GroupName;
|
var groupName = group.GroupName;
|
||||||
if( ImGuiCustom.BeginFramedGroupEdit( ref groupName )
|
if( ImGuiCustom.BeginFramedGroupEdit( ref groupName )
|
||||||
|
|
@ -114,7 +114,7 @@ namespace Penumbra.UI
|
||||||
Mod.Conf.Remove( group.GroupName );
|
Mod.Conf.Remove( group.GroupName );
|
||||||
if( groupName.Length > 0 )
|
if( groupName.Length > 0 )
|
||||||
{
|
{
|
||||||
Meta.Groups[ groupName ] = new InstallerInfo()
|
Meta.Groups[ groupName ] = new OptionGroup()
|
||||||
{ GroupName = groupName, SelectionType = SelectType.Multi, Options = group.Options };
|
{ GroupName = groupName, SelectionType = SelectType.Multi, Options = group.Options };
|
||||||
Mod.Conf[ groupName ] = oldConf;
|
Mod.Conf[ groupName ] = oldConf;
|
||||||
}
|
}
|
||||||
|
|
@ -125,7 +125,7 @@ namespace Penumbra.UI
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawMultiSelectorEditAdd( InstallerInfo group, float nameBoxStart )
|
private void DrawMultiSelectorEditAdd( OptionGroup group, float nameBoxStart )
|
||||||
{
|
{
|
||||||
var newOption = "";
|
var newOption = "";
|
||||||
ImGui.SetCursorPosX( nameBoxStart );
|
ImGui.SetCursorPosX( nameBoxStart );
|
||||||
|
|
@ -139,7 +139,7 @@ namespace Penumbra.UI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawMultiSelectorEdit( InstallerInfo group )
|
private void DrawMultiSelectorEdit( OptionGroup group )
|
||||||
{
|
{
|
||||||
var nameBoxStart = CheckMarkSize;
|
var nameBoxStart = CheckMarkSize;
|
||||||
var flag = Mod!.Conf[ group.GroupName ];
|
var flag = Mod!.Conf[ group.GroupName ];
|
||||||
|
|
@ -190,7 +190,7 @@ namespace Penumbra.UI
|
||||||
ImGuiCustom.EndFramedGroup();
|
ImGuiCustom.EndFramedGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool DrawSingleSelectorEditGroup( InstallerInfo group )
|
private bool DrawSingleSelectorEditGroup( OptionGroup group )
|
||||||
{
|
{
|
||||||
var groupName = group.GroupName;
|
var groupName = group.GroupName;
|
||||||
if( ImGui.InputText( $"##{groupName}_add", ref groupName, 64, ImGuiInputTextFlags.EnterReturnsTrue )
|
if( ImGui.InputText( $"##{groupName}_add", ref groupName, 64, ImGuiInputTextFlags.EnterReturnsTrue )
|
||||||
|
|
@ -206,7 +206,7 @@ namespace Penumbra.UI
|
||||||
if( groupName.Length > 0 )
|
if( groupName.Length > 0 )
|
||||||
{
|
{
|
||||||
Meta.Groups.Add( groupName,
|
Meta.Groups.Add( groupName,
|
||||||
new InstallerInfo() { GroupName = groupName, Options = group.Options, SelectionType = SelectType.Single } );
|
new OptionGroup() { GroupName = groupName, Options = group.Options, SelectionType = SelectType.Single } );
|
||||||
Mod.Conf[ groupName ] = oldConf;
|
Mod.Conf[ groupName ] = oldConf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -216,7 +216,7 @@ namespace Penumbra.UI
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private float DrawSingleSelectorEdit( InstallerInfo group )
|
private float DrawSingleSelectorEdit( OptionGroup group )
|
||||||
{
|
{
|
||||||
var code = Mod!.Conf[ group.GroupName ];
|
var code = Mod!.Conf[ group.GroupName ];
|
||||||
var selectionChanged = false;
|
var selectionChanged = false;
|
||||||
|
|
@ -288,7 +288,7 @@ namespace Penumbra.UI
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Meta.Groups[ newGroup ] = new InstallerInfo()
|
Meta.Groups[ newGroup ] = new OptionGroup()
|
||||||
{
|
{
|
||||||
GroupName = newGroup,
|
GroupName = newGroup,
|
||||||
SelectionType = selectType,
|
SelectionType = selectType,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue