mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Change behavior for directory names.
This commit is contained in:
parent
a9546e31ee
commit
012052daa0
5 changed files with 28 additions and 2 deletions
|
|
@ -76,7 +76,7 @@ public class ModNormalizer(ModManager modManager, Configuration config, SaveServ
|
|||
else
|
||||
{
|
||||
var groupDir = ModCreator.NewOptionDirectory(mod.ModPath, container.Group.Name, config.ReplaceNonAsciiOnImport);
|
||||
var optionDir = ModCreator.NewOptionDirectory(groupDir, container.GetName(), config.ReplaceNonAsciiOnImport);
|
||||
var optionDir = ModCreator.NewOptionDirectory(groupDir, container.GetDirectoryName(), config.ReplaceNonAsciiOnImport);
|
||||
containers[container] = optionDir.FullName;
|
||||
}
|
||||
}
|
||||
|
|
@ -286,7 +286,7 @@ public class ModNormalizer(ModManager modManager, Configuration config, SaveServ
|
|||
|
||||
void HandleSubMod(DirectoryInfo groupDir, IModDataContainer option, Dictionary<Utf8GamePath, FullPath> newDict)
|
||||
{
|
||||
var name = option.GetName();
|
||||
var name = option.GetDirectoryName();
|
||||
var optionDir = ModCreator.CreateModFolder(groupDir, name, config.ReplaceNonAsciiOnImport, true);
|
||||
|
||||
newDict.Clear();
|
||||
|
|
|
|||
|
|
@ -48,6 +48,25 @@ public class CombinedDataContainer(IModGroup group) : IModDataContainer
|
|||
return sb.ToString(0, sb.Length - 3);
|
||||
}
|
||||
|
||||
public unsafe string GetDirectoryName()
|
||||
{
|
||||
if (Name.Length > 0)
|
||||
return Name;
|
||||
|
||||
var index = GetDataIndex();
|
||||
if (index == 0)
|
||||
return "None";
|
||||
|
||||
var text = stackalloc char[IModGroup.MaxCombiningOptions].Slice(0, Group.Options.Count);
|
||||
for (var i = 0; i < Group.Options.Count; ++i)
|
||||
{
|
||||
text[Group.Options.Count - 1 - i] = (index & 1) is 0 ? '0' : '1';
|
||||
index >>= 1;
|
||||
}
|
||||
|
||||
return new string(text);
|
||||
}
|
||||
|
||||
public string GetFullName()
|
||||
=> $"{Group.Name}: {GetName()}";
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@ public class DefaultSubMod(IMod mod) : IModDataContainer
|
|||
public string GetName()
|
||||
=> FullName;
|
||||
|
||||
public string GetDirectoryName()
|
||||
=> GetName();
|
||||
|
||||
public string GetFullName()
|
||||
=> FullName;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ public interface IModDataContainer
|
|||
public MetaDictionary Manipulations { get; set; }
|
||||
|
||||
public string GetName();
|
||||
public string GetDirectoryName();
|
||||
public string GetFullName();
|
||||
public (int GroupIndex, int DataIndex) GetDataIndices();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@ public abstract class OptionSubMod(IModGroup group) : IModOption, IModDataContai
|
|||
public string GetName()
|
||||
=> Name;
|
||||
|
||||
public string GetDirectoryName()
|
||||
=> GetName();
|
||||
|
||||
public string GetFullName()
|
||||
=> FullName;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue