mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 18:27:24 +01:00
Fix some stains and add comments
This commit is contained in:
parent
514e8253b7
commit
bf32795c08
14 changed files with 30 additions and 25 deletions
|
|
@ -278,7 +278,7 @@ public class DesignBase
|
||||||
=> new()
|
=> new()
|
||||||
{
|
{
|
||||||
["ItemId"] = id.Id,
|
["ItemId"] = id.Id,
|
||||||
["Stain"] = stains.ToString(),
|
["Stain"] = stains.ToString(), // Maybe change the "Stain" into "Stains" ?
|
||||||
["Crest"] = crest,
|
["Crest"] = crest,
|
||||||
["Apply"] = apply,
|
["Apply"] = apply,
|
||||||
["ApplyStain"] = applyStain,
|
["ApplyStain"] = applyStain,
|
||||||
|
|
@ -525,7 +525,7 @@ public class DesignBase
|
||||||
static (CustomItemId, StainIds, bool, bool, bool, bool) ParseItem(EquipSlot slot, JToken? item)
|
static (CustomItemId, StainIds, bool, bool, bool, bool) ParseItem(EquipSlot slot, JToken? item)
|
||||||
{
|
{
|
||||||
var id = item?["ItemId"]?.ToObject<ulong>() ?? ItemManager.NothingId(slot).Id;
|
var id = item?["ItemId"]?.ToObject<ulong>() ?? ItemManager.NothingId(slot).Id;
|
||||||
var stains = (item?["Stain"]?.ToObject<StainIds>() ?? StainIds.None);
|
var stains = (item?["Stain"]?.ToObject<StainIds>() ?? StainIds.None); // Unsure
|
||||||
var crest = item?["Crest"]?.ToObject<bool>() ?? false;
|
var crest = item?["Crest"]?.ToObject<bool>() ?? false;
|
||||||
var apply = item?["Apply"]?.ToObject<bool>() ?? false;
|
var apply = item?["Apply"]?.ToObject<bool>() ?? false;
|
||||||
var applyStain = item?["ApplyStain"]?.ToObject<bool>() ?? false;
|
var applyStain = item?["ApplyStain"]?.ToObject<bool>() ?? false;
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,7 @@ public class DesignConverter(
|
||||||
return System.Convert.ToBase64String(compressed);
|
return System.Convert.ToBase64String(compressed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<(EquipSlot Slot, EquipItem Item, StainId Stain)> FromDrawData(IReadOnlyList<CharacterArmor> armors,
|
public IEnumerable<(EquipSlot Slot, EquipItem Item, StainIds Stains)> FromDrawData(IReadOnlyList<CharacterArmor> armors,
|
||||||
CharacterWeapon mainhand, CharacterWeapon offhand, bool skipWarnings)
|
CharacterWeapon mainhand, CharacterWeapon offhand, bool skipWarnings)
|
||||||
{
|
{
|
||||||
if (armors.Count != 10)
|
if (armors.Count != 10)
|
||||||
|
|
@ -194,7 +194,7 @@ public class DesignConverter(
|
||||||
item = ItemManager.NothingItem(slot);
|
item = ItemManager.NothingItem(slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
yield return (slot, item, armor.Stains.Stain1); // To change
|
yield return (slot, item, armor.Stains);
|
||||||
}
|
}
|
||||||
|
|
||||||
var mh = _items.Identify(EquipSlot.MainHand, mainhand.Skeleton, mainhand.Weapon, mainhand.Variant);
|
var mh = _items.Identify(EquipSlot.MainHand, mainhand.Skeleton, mainhand.Weapon, mainhand.Variant);
|
||||||
|
|
@ -204,7 +204,7 @@ public class DesignConverter(
|
||||||
mh = _items.DefaultSword;
|
mh = _items.DefaultSword;
|
||||||
}
|
}
|
||||||
|
|
||||||
yield return (EquipSlot.MainHand, mh, mainhand.Stains.Stain1); // To change
|
yield return (EquipSlot.MainHand, mh, mainhand.Stains);
|
||||||
|
|
||||||
var oh = _items.Identify(EquipSlot.OffHand, offhand.Skeleton, offhand.Weapon, offhand.Variant, mh.Type);
|
var oh = _items.Identify(EquipSlot.OffHand, offhand.Skeleton, offhand.Weapon, offhand.Variant, mh.Type);
|
||||||
if (!skipWarnings && !oh.Valid)
|
if (!skipWarnings && !oh.Valid)
|
||||||
|
|
@ -215,7 +215,7 @@ public class DesignConverter(
|
||||||
oh = ItemManager.NothingItem(FullEquipType.Shield);
|
oh = ItemManager.NothingItem(FullEquipType.Shield);
|
||||||
}
|
}
|
||||||
|
|
||||||
yield return (EquipSlot.OffHand, oh, offhand.Stains.Stain1); // To change
|
yield return (EquipSlot.OffHand, oh, offhand.Stains);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ComputeMaterials(DesignMaterialManager manager, in StateMaterialManager materials,
|
private static void ComputeMaterials(DesignMaterialManager manager, in StateMaterialManager materials,
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,8 @@ public unsafe struct DesignData
|
||||||
public bool SetStain(EquipSlot slot, StainIds stains)
|
public bool SetStain(EquipSlot slot, StainIds stains)
|
||||||
=> slot.ToIndex() switch
|
=> slot.ToIndex() switch
|
||||||
{
|
{
|
||||||
|
// Those need to be changed
|
||||||
|
|
||||||
0 => SetIfDifferent(ref _equipmentBytes[3], stains),
|
0 => SetIfDifferent(ref _equipmentBytes[3], stains),
|
||||||
1 => SetIfDifferent(ref _equipmentBytes[7], stains),
|
1 => SetIfDifferent(ref _equipmentBytes[7], stains),
|
||||||
2 => SetIfDifferent(ref _equipmentBytes[11], stains),
|
2 => SetIfDifferent(ref _equipmentBytes[11], stains),
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ public unsafe struct NpcData
|
||||||
.Append('-')
|
.Append('-')
|
||||||
.Append(span[i].Variant.Id.ToString("D3"))
|
.Append(span[i].Variant.Id.ToString("D3"))
|
||||||
.Append('-')
|
.Append('-')
|
||||||
.Append(span[i].Stains.ToString())
|
.Append(span[i].Stains.ToString()) // Unsure
|
||||||
.Append(", ");
|
.Append(", ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -66,7 +66,7 @@ public unsafe struct NpcData
|
||||||
.Append('-')
|
.Append('-')
|
||||||
.Append(Mainhand.Variant.Id.ToString("D3"))
|
.Append(Mainhand.Variant.Id.ToString("D3"))
|
||||||
.Append('-')
|
.Append('-')
|
||||||
.Append(Mainhand.Stains.ToString())
|
.Append(Mainhand.Stains.ToString()) // Unsure
|
||||||
.Append(", ")
|
.Append(", ")
|
||||||
.Append(Offhand.Skeleton.Id.ToString("D4"))
|
.Append(Offhand.Skeleton.Id.ToString("D4"))
|
||||||
.Append('-')
|
.Append('-')
|
||||||
|
|
@ -74,7 +74,7 @@ public unsafe struct NpcData
|
||||||
.Append('-')
|
.Append('-')
|
||||||
.Append(Offhand.Variant.Id.ToString("D3"))
|
.Append(Offhand.Variant.Id.ToString("D3"))
|
||||||
.Append('-')
|
.Append('-')
|
||||||
.Append(Offhand.Stains.ToString());
|
.Append(Offhand.Stains.ToString()); // Unsure
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -221,7 +221,7 @@ public unsafe class ModelEvaluationPanel(
|
||||||
|
|
||||||
if (ImGui.SmallButton("Change Piece"))
|
if (ImGui.SmallButton("Change Piece"))
|
||||||
_updateSlotService.UpdateArmor(model, slot,
|
_updateSlotService.UpdateArmor(model, slot,
|
||||||
new CharacterArmor((PrimaryId)(slot == EquipSlot.Hands ? 6064 : slot == EquipSlot.Head ? 6072 : 1), 1, new()));
|
new CharacterArmor((PrimaryId)(slot == EquipSlot.Hands ? 6064 : slot == EquipSlot.Head ? 6072 : 1), 1, StainIds.None));
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
if (ImGui.SmallButton("Change Stain"))
|
if (ImGui.SmallButton("Change Stain"))
|
||||||
_updateSlotService.UpdateStain(model, slot, StainIds.None);
|
_updateSlotService.UpdateStain(model, slot, StainIds.None);
|
||||||
|
|
|
||||||
|
|
@ -234,7 +234,9 @@ public class UnlockOverview
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.Flags.HasFlag(ItemFlags.IsDyable1))
|
if (item.Flags.HasFlag(ItemFlags.IsDyable1))
|
||||||
ImGui.TextUnformatted("Dyable");
|
ImGui.TextUnformatted("Dyable1");
|
||||||
|
if (item.Flags.HasFlag(ItemFlags.IsDyable2))
|
||||||
|
ImGui.TextUnformatted("Dyable2");
|
||||||
if (item.Flags.HasFlag(ItemFlags.IsTradable))
|
if (item.Flags.HasFlag(ItemFlags.IsTradable))
|
||||||
ImGui.TextUnformatted("Tradable");
|
ImGui.TextUnformatted("Tradable");
|
||||||
if (item.Flags.HasFlag(ItemFlags.IsCrestWorthy))
|
if (item.Flags.HasFlag(ItemFlags.IsCrestWorthy))
|
||||||
|
|
|
||||||
|
|
@ -384,7 +384,7 @@ public class UnlockTable : Table<EquipItem>, IDisposable
|
||||||
=> Tooltip = "Whether the item is dyable.";
|
=> Tooltip = "Whether the item is dyable.";
|
||||||
|
|
||||||
protected override bool GetValue(EquipItem item)
|
protected override bool GetValue(EquipItem item)
|
||||||
=> item.Flags.HasFlag(ItemFlags.IsDyable1);
|
=> item.Flags.HasFlag(ItemFlags.IsDyable1); // Unsure
|
||||||
}
|
}
|
||||||
|
|
||||||
private sealed class TradableColumn : YesNoColumn<EquipItem>
|
private sealed class TradableColumn : YesNoColumn<EquipItem>
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public unsafe class ChangeCustomizeService : EventWrapperRef2<Model, CustomizeAr
|
||||||
_penumbraReloaded = penumbraReloaded;
|
_penumbraReloaded = penumbraReloaded;
|
||||||
_interop = interop;
|
_interop = interop;
|
||||||
_changeCustomizeHook = Create();
|
_changeCustomizeHook = Create();
|
||||||
_original = (delegate* unmanaged[Stdcall]<Human*, byte*, bool, bool>)Human.MemberFunctionPointers.UpdateDrawData;
|
_original = (delegate* unmanaged[Stdcall]<Human*, byte*, bool, bool>)Human.MemberFunctionPointers.UpdateDrawData; // Unsure
|
||||||
interop.InitializeFromAttributes(this);
|
interop.InitializeFromAttributes(this);
|
||||||
_penumbraReloaded.Subscribe(Restore, PenumbraReloaded.Priority.ChangeCustomizeService);
|
_penumbraReloaded.Subscribe(Restore, PenumbraReloaded.Priority.ChangeCustomizeService);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ public sealed class CmaFile
|
||||||
var set = mainhand["Item1"]?.ToObject<ushort>() ?? items.DefaultSword.PrimaryId;
|
var set = mainhand["Item1"]?.ToObject<ushort>() ?? items.DefaultSword.PrimaryId;
|
||||||
var type = mainhand["Item2"]?.ToObject<ushort>() ?? items.DefaultSword.SecondaryId;
|
var type = mainhand["Item2"]?.ToObject<ushort>() ?? items.DefaultSword.SecondaryId;
|
||||||
var variant = mainhand["Item3"]?.ToObject<byte>() ?? items.DefaultSword.Variant;
|
var variant = mainhand["Item3"]?.ToObject<byte>() ?? items.DefaultSword.Variant;
|
||||||
var stains = mainhand["Item4"]?.ToObject<StainIds>() ?? StainIds.None;
|
var stains = mainhand["Item4"]?.ToObject<StainIds>() ?? StainIds.None; // Unsure
|
||||||
var item = items.Identify(EquipSlot.MainHand, set, type, variant);
|
var item = items.Identify(EquipSlot.MainHand, set, type, variant);
|
||||||
|
|
||||||
data.SetItem(EquipSlot.MainHand, item.Valid ? item : items.DefaultSword);
|
data.SetItem(EquipSlot.MainHand, item.Valid ? item : items.DefaultSword);
|
||||||
|
|
|
||||||
|
|
@ -91,14 +91,14 @@ public sealed unsafe class PrepareColorSet
|
||||||
switch (index.DrawObject)
|
switch (index.DrawObject)
|
||||||
{
|
{
|
||||||
case MaterialValueIndex.DrawObjectType.Human:
|
case MaterialValueIndex.DrawObjectType.Human:
|
||||||
return index.SlotIndex < 10 ? actor.Model.GetArmor(((uint)index.SlotIndex).ToEquipSlot()).Stains : new();
|
return index.SlotIndex < 10 ? actor.Model.GetArmor(((uint)index.SlotIndex).ToEquipSlot()).Stains : StainIds.None;
|
||||||
case MaterialValueIndex.DrawObjectType.Mainhand:
|
case MaterialValueIndex.DrawObjectType.Mainhand:
|
||||||
var mainhand = (Model)actor.AsCharacter->DrawData.WeaponDataSpan[1].DrawObject;
|
var mainhand = (Model)actor.AsCharacter->DrawData.WeaponDataSpan[1].DrawObject;
|
||||||
return mainhand.IsWeapon ? (StainId)mainhand.AsWeapon->ModelUnknown : new();
|
return mainhand.IsWeapon ? (StainId)mainhand.AsWeapon->ModelUnknown : StainIds.None;
|
||||||
case MaterialValueIndex.DrawObjectType.Offhand:
|
case MaterialValueIndex.DrawObjectType.Offhand:
|
||||||
var offhand = (Model)actor.AsCharacter->DrawData.WeaponDataSpan[1].DrawObject;
|
var offhand = (Model)actor.AsCharacter->DrawData.WeaponDataSpan[1].DrawObject;
|
||||||
return offhand.IsWeapon ? (StainId)offhand.AsWeapon->ModelUnknown : new();
|
return offhand.IsWeapon ? (StainId)offhand.AsWeapon->ModelUnknown : StainIds.None;
|
||||||
default: return new();
|
default: return StainIds.None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ public unsafe class MetaService : IDisposable
|
||||||
if (!actor.IsCharacter)
|
if (!actor.IsCharacter)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
actor.AsCharacter->DrawData.SetVisor(value);
|
actor.AsCharacter->DrawData.SetVisor(value); // Unsure
|
||||||
|
|
||||||
// The function seems to not do anything if the head is 0, but also breaks for carbuncles turned human, sometimes?
|
// The function seems to not do anything if the head is 0, but also breaks for carbuncles turned human, sometimes?
|
||||||
/* var old = actor.AsCharacter->DrawData.Head.Id;
|
/* var old = actor.AsCharacter->DrawData.Head.Id;
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ public class ItemManager
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ValidateStain(StainIds stains, out StainIds ret, bool allowUnknown)
|
public string ValidateStain(StainIds stains, out StainIds ret, bool allowUnknown)
|
||||||
{
|
{
|
||||||
if (allowUnknown || IsStainValid(stains[0]) && IsStainValid(stains[1]))
|
if (allowUnknown || IsStainValid(stains[0]) && IsStainValid(stains[1])) // Unsure
|
||||||
{
|
{
|
||||||
ret = stains;
|
ret = stains;
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ internal class FunEquipSet
|
||||||
{
|
{
|
||||||
public Group(ushort headS, byte headV, ushort bodyS, byte bodyV, ushort handsS, byte handsV, ushort legsS, byte legsV, ushort feetS,
|
public Group(ushort headS, byte headV, ushort bodyS, byte bodyV, ushort handsS, byte handsV, ushort legsS, byte legsV, ushort feetS,
|
||||||
byte feetV, StainId[]? stains = null)
|
byte feetV, StainId[]? stains = null)
|
||||||
: this(new CharacterArmor(headS, headV, new()), new CharacterArmor(bodyS, bodyV, new()), new CharacterArmor(handsS, handsV, new()),
|
: this(new CharacterArmor(headS, headV, StainIds.None), new CharacterArmor(bodyS, bodyV, StainIds.None), new CharacterArmor(handsS, handsV, StainIds.None),
|
||||||
new CharacterArmor(legsS, legsV, new()), new CharacterArmor(feetS, feetV, new()), stains)
|
new CharacterArmor(legsS, legsV, StainIds.None), new CharacterArmor(feetS, feetV, StainIds.None), stains)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public static Group FullSetWithoutHat(ushort modelSet, byte variant, StainId[]? stains = null)
|
public static Group FullSetWithoutHat(ushort modelSet, byte variant, StainId[]? stains = null)
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ public unsafe class FunModule : IDisposable
|
||||||
&& actor.OnlineStatus is OnlineStatus.PvEMentor or OnlineStatus.PvPMentor or OnlineStatus.TradeMentor
|
&& actor.OnlineStatus is OnlineStatus.PvEMentor or OnlineStatus.PvPMentor or OnlineStatus.TradeMentor
|
||||||
&& slot.IsEquipment())
|
&& slot.IsEquipment())
|
||||||
{
|
{
|
||||||
armor = new CharacterArmor(6117, 1, new());
|
armor = new CharacterArmor(6117, 1, StainIds.None);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -237,6 +237,7 @@ public unsafe class FunModule : IDisposable
|
||||||
private static IReadOnlyList<CharacterArmor> DolphinBodies
|
private static IReadOnlyList<CharacterArmor> DolphinBodies
|
||||||
=>
|
=>
|
||||||
[
|
[
|
||||||
|
// Unsure about those
|
||||||
new CharacterArmor(6089, 1, new(4, 4)), // Toad
|
new CharacterArmor(6089, 1, new(4, 4)), // Toad
|
||||||
new CharacterArmor(6089, 1, new(4, 4)), // Toad
|
new CharacterArmor(6089, 1, new(4, 4)), // Toad
|
||||||
new CharacterArmor(6089, 1, new(4, 4)), // Toad
|
new CharacterArmor(6089, 1, new(4, 4)), // Toad
|
||||||
|
|
@ -255,7 +256,7 @@ public unsafe class FunModule : IDisposable
|
||||||
armor = slot switch
|
armor = slot switch
|
||||||
{
|
{
|
||||||
EquipSlot.Body => DolphinBodies[_rng.Next(0, DolphinBodies.Count - 1)],
|
EquipSlot.Body => DolphinBodies[_rng.Next(0, DolphinBodies.Count - 1)],
|
||||||
EquipSlot.Head => new CharacterArmor(5040, 1, new(0, 0)),
|
EquipSlot.Head => new CharacterArmor(5040, 1, StainIds.None),
|
||||||
_ => armor,
|
_ => armor,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -272,7 +273,7 @@ public unsafe class FunModule : IDisposable
|
||||||
|
|
||||||
private static void SetCrown(Span<CharacterArmor> armor)
|
private static void SetCrown(Span<CharacterArmor> armor)
|
||||||
{
|
{
|
||||||
var clown = new CharacterArmor(6117, 1, new());
|
var clown = new CharacterArmor(6117, 1, StainIds.None);
|
||||||
armor[0] = clown;
|
armor[0] = clown;
|
||||||
armor[1] = clown;
|
armor[1] = clown;
|
||||||
armor[2] = clown;
|
armor[2] = clown;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue