mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-21 23:37:47 +01:00
Add function that handles prepending DX11 dashes.
This commit is contained in:
parent
574a129772
commit
965f8efd80
4 changed files with 7 additions and 38 deletions
|
|
@ -79,21 +79,9 @@ public static class CustomizationSwap
|
|||
}
|
||||
|
||||
public static FileSwap CreateTex(MetaFileManager manager, Func<Utf8GamePath, FullPath> redirections, BodySlot slot, GenderRace race,
|
||||
PrimaryId idFrom, ref MtrlFile.Texture texture,
|
||||
ref bool dataWasChanged)
|
||||
PrimaryId idFrom, ref MtrlFile.Texture texture, ref bool dataWasChanged)
|
||||
{
|
||||
var path = texture.Path;
|
||||
var addedDashes = false;
|
||||
if (texture.DX11)
|
||||
{
|
||||
var fileName = Path.GetFileName(path);
|
||||
if (!fileName.StartsWith("--"))
|
||||
{
|
||||
path = path.Replace(fileName, $"--{fileName}");
|
||||
addedDashes = true;
|
||||
}
|
||||
}
|
||||
|
||||
var addedDashes = GamePaths.Tex.HandleDx11Path(texture, out var path);
|
||||
var newPath = ItemSwap.ReplaceAnyRace(path, race);
|
||||
newPath = ItemSwap.ReplaceAnyBody(newPath, slot, idFrom);
|
||||
newPath = ItemSwap.AddSuffix(newPath, ".tex", $"_{Path.GetFileName(texture.Path).GetStableHashCode():x8}", true);
|
||||
|
|
|
|||
|
|
@ -402,22 +402,10 @@ public static class EquipmentSwap
|
|||
=> CreateTex(manager, redirections, prefix, EquipSlot.Unknown, EquipSlot.Unknown, idFrom, idTo, ref texture, ref dataWasChanged);
|
||||
|
||||
public static FileSwap CreateTex(MetaFileManager manager, Func<Utf8GamePath, FullPath> redirections, char prefix, EquipSlot slotFrom,
|
||||
EquipSlot slotTo, PrimaryId idFrom,
|
||||
PrimaryId idTo, ref MtrlFile.Texture texture, ref bool dataWasChanged)
|
||||
EquipSlot slotTo, PrimaryId idFrom, PrimaryId idTo, ref MtrlFile.Texture texture, ref bool dataWasChanged)
|
||||
{
|
||||
var path = texture.Path;
|
||||
var addedDashes = false;
|
||||
if (texture.DX11)
|
||||
{
|
||||
var fileName = Path.GetFileName(path);
|
||||
if (!fileName.StartsWith("--"))
|
||||
{
|
||||
path = path.Replace(fileName, $"--{fileName}");
|
||||
addedDashes = true;
|
||||
}
|
||||
}
|
||||
|
||||
var newPath = ItemSwap.ReplaceAnyId(path, prefix, idFrom);
|
||||
var addedDashes = GamePaths.Tex.HandleDx11Path(texture, out var path);
|
||||
var newPath = ItemSwap.ReplaceAnyId(path, prefix, idFrom);
|
||||
newPath = ItemSwap.ReplaceSlot(newPath, slotTo, slotFrom, slotTo != slotFrom);
|
||||
newPath = ItemSwap.AddSuffix(newPath, ".tex", $"_{Path.GetFileName(texture.Path).GetStableHashCode():x8}");
|
||||
if (newPath != path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue