Some Glamourer stuff.

This commit is contained in:
Ottermandias 2023-01-29 21:08:43 +01:00
parent 21e6a17d1c
commit 2ef9d3d56e
7 changed files with 55 additions and 48 deletions

@ -1 +1 @@
Subproject commit 43b78fd8dcdc12e0c2ba831bd037ad8e8a415e0e
Subproject commit 2c73fd57bf53fc3c9f390db0acc9e176607c2dbc

View file

@ -50,7 +50,7 @@ public abstract class DataSharer : IDisposable
}
catch (Exception ex)
{
PluginLog.Error($"Error creating shared actor data for {tag}:\n{ex}");
PluginLog.Error($"Error creating shared data for {tag}:\n{ex}");
return func();
}
}

View file

@ -29,7 +29,7 @@ public sealed class RestrictedGear : DataSharer
public readonly IReadOnlyDictionary<uint, uint> MaleToFemale;
public readonly IReadOnlyDictionary<uint, uint> FemaleToMale;
internal RestrictedGear(DalamudPluginInterface pi, ClientLanguage language, DataManager gameData)
public RestrictedGear(DalamudPluginInterface pi, ClientLanguage language, DataManager gameData)
: base(pi, language, 1)
{
_items = gameData.GetExcelSheet<Item>()!;
@ -78,14 +78,14 @@ public sealed class RestrictedGear : DataSharer
var f2m = new Dictionary<uint, uint>();
var rg = RaceGenderGroup.Where(c => c is not 0 and not uint.MaxValue).ToHashSet();
AddKnown(m2f, f2m);
UnhandledRestrictedGear(m2f, f2m, false); // Set this to true to create a print of unassigned gear on launch.
UnhandledRestrictedGear(rg, m2f, f2m, false); // Set this to true to create a print of unassigned gear on launch.
return new Tuple<IReadOnlySet<uint>, IReadOnlyDictionary<uint, uint>, IReadOnlyDictionary<uint, uint>>(rg, m2f, f2m);
}
// Add all unknown restricted gear and pair it with emperor's new gear on start up.
// Can also print unhandled items.
private void UnhandledRestrictedGear(Dictionary<uint, uint> m2f, Dictionary<uint, uint> f2m, bool print)
private void UnhandledRestrictedGear(IReadOnlySet<uint> rg, Dictionary<uint, uint> m2f, Dictionary<uint, uint> f2m, bool print)
{
if (print)
PluginLog.Information("#### MALE ONLY ######");
@ -148,7 +148,7 @@ public sealed class RestrictedGear : DataSharer
foreach (var item in _items.Where(i => i.EquipRestriction > 3))
{
if (RaceGenderSet.Contains((uint)item.ModelMain))
if (rg.Contains((uint)item.ModelMain))
continue;
++unhandled;
@ -409,6 +409,7 @@ public sealed class RestrictedGear : DataSharer
AddItem(m2f, f2m, 38254, 38258); // Valentione Emissary's Jacket <-> Valentione Emissary's Ruffled Dress
AddItem(m2f, f2m, 38255, 38259); // Valentione Emissary's Bottoms <-> Valentione Emissary's Culottes
AddItem(m2f, f2m, 38256, 38260); // Valentione Emissary's Boots <-> Valentione Emissary's Boots
AddItem(m2f, f2m, 32393, 39302, false); // Edenmete Gown of Casting <- Gaia's Attire
}
// The racial starter sets are available for all 4 slots each,

View file

@ -1,45 +1,44 @@
using System.Collections.Generic;
namespace Penumbra.GameData.Enums
{
public enum FileType : byte
{
Unknown,
Sound,
Imc,
Vfx,
Animation,
Pap,
MetaInfo,
Material,
Texture,
Model,
Shader,
Font,
Environment,
}
namespace Penumbra.GameData.Enums;
public static partial class Names
public enum FileType : byte
{
Unknown,
Sound,
Imc,
Vfx,
Animation,
Pap,
MetaInfo,
Material,
Texture,
Model,
Shader,
Font,
Environment,
}
public static partial class Names
{
public static readonly Dictionary< string, FileType > ExtensionToFileType = new()
{
public static readonly Dictionary< string, FileType > ExtensionToFileType = new()
{
{ ".mdl", FileType.Model },
{ ".tex", FileType.Texture },
{ ".mtrl", FileType.Material },
{ ".atex", FileType.Animation },
{ ".avfx", FileType.Vfx },
{ ".scd", FileType.Sound },
{ ".imc", FileType.Imc },
{ ".pap", FileType.Pap },
{ ".eqp", FileType.MetaInfo },
{ ".eqdp", FileType.MetaInfo },
{ ".est", FileType.MetaInfo },
{ ".exd", FileType.MetaInfo },
{ ".exh", FileType.MetaInfo },
{ ".shpk", FileType.Shader },
{ ".shcd", FileType.Shader },
{ ".fdt", FileType.Font },
{ ".envb", FileType.Environment },
};
}
{ ".mdl", FileType.Model },
{ ".tex", FileType.Texture },
{ ".mtrl", FileType.Material },
{ ".atex", FileType.Animation },
{ ".avfx", FileType.Vfx },
{ ".scd", FileType.Sound },
{ ".imc", FileType.Imc },
{ ".pap", FileType.Pap },
{ ".eqp", FileType.MetaInfo },
{ ".eqdp", FileType.MetaInfo },
{ ".est", FileType.MetaInfo },
{ ".exd", FileType.MetaInfo },
{ ".exh", FileType.MetaInfo },
{ ".shpk", FileType.Shader },
{ ".shcd", FileType.Shader },
{ ".fdt", FileType.Font },
{ ".envb", FileType.Environment },
};
}

View file

@ -2,7 +2,7 @@ using System;
namespace Penumbra.GameData.Structs;
public readonly struct SetId : IComparable< SetId >
public readonly struct SetId : IComparable< SetId >, IEquatable<SetId>, IEquatable<ushort>
{
public readonly ushort Value;
@ -15,6 +15,12 @@ public readonly struct SetId : IComparable< SetId >
public static explicit operator ushort( SetId id )
=> id.Value;
public bool Equals(SetId other)
=> Value == other.Value;
public bool Equals(ushort other)
=> Value == other;
public override string ToString()
=> Value.ToString();

View file

@ -35,7 +35,7 @@ public class Dalamud
[PluginService][RequiredVersion("1.0")] public static TitleScreenMenu TitleScreenMenu { get; private set; } = null!;
[PluginService][RequiredVersion("1.0")] public static GameGui GameGui { get; private set; } = null!;
[PluginService][RequiredVersion("1.0")] public static KeyState KeyState { get; private set; } = null!;
[PluginService][RequiredVersion("1.0")] public static SigScanner SigScanner { get; private set; } = null!;
[PluginService][RequiredVersion("1.0")] public static SigScanner SigScanner { get; private set; } = null!;
// @formatter:on
private static readonly object? DalamudConfig;

View file

@ -103,6 +103,7 @@ public class Penumbra : IDalamudPlugin
Framework = new FrameworkManager(Dalamud.Framework, Log);
CharacterUtility = new CharacterUtility();
Backup.CreateBackup( pluginInterface.ConfigDirectory, PenumbraBackupFiles() );
Config = Configuration.Load();