mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-24 01:19:23 +01:00
Add support for previewing non-existing items from Penumbra.
This commit is contained in:
parent
03043ba2c9
commit
9a02ba2987
4 changed files with 29 additions and 5 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
using Glamourer.Designs;
|
using Glamourer.Designs;
|
||||||
using Glamourer.Events;
|
using Glamourer.Events;
|
||||||
using Glamourer.Interop;
|
using Glamourer.Interop;
|
||||||
using Glamourer.Interop.Penumbra;
|
using Glamourer.Interop.Penumbra;
|
||||||
|
|
@ -168,12 +168,23 @@ public sealed class PenumbraChangedItemTooltip : IDisposable
|
||||||
{
|
{
|
||||||
case ChangedItemType.ItemOffhand:
|
case ChangedItemType.ItemOffhand:
|
||||||
case ChangedItemType.Item:
|
case ChangedItemType.Item:
|
||||||
|
{
|
||||||
if (!_items.ItemData.TryGetValue(id, type is ChangedItemType.Item ? EquipSlot.MainHand : EquipSlot.OffHand, out var item))
|
if (!_items.ItemData.TryGetValue(id, type is ChangedItemType.Item ? EquipSlot.MainHand : EquipSlot.OffHand, out var item))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CreateTooltip(item, "[Glamourer] ", false);
|
CreateTooltip(item, "[Glamourer] ", false);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
case ChangedItemType.CustomArmor:
|
||||||
|
{
|
||||||
|
var (model, variant, slot) = IdentifiedItem.Split(id);
|
||||||
|
var item = _items.Identify(slot.ToSlot(), model, variant);
|
||||||
|
if (item.Valid)
|
||||||
|
CreateTooltip(item, "[Glamourer] ", false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
case ChangedItemType.Customization:
|
case ChangedItemType.Customization:
|
||||||
|
{
|
||||||
var (race, gender, index, value) = IdentifiedCustomization.Split(id);
|
var (race, gender, index, value) = IdentifiedCustomization.Split(id);
|
||||||
if (!_objects.Player.Model.IsHuman)
|
if (!_objects.Player.Model.IsHuman)
|
||||||
return;
|
return;
|
||||||
|
|
@ -183,6 +194,7 @@ public sealed class PenumbraChangedItemTooltip : IDisposable
|
||||||
ImGui.TextUnformatted("[Glamourer] Right-Click to apply to current actor.");
|
ImGui.TextUnformatted("[Glamourer] Right-Click to apply to current actor.");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -212,17 +224,29 @@ public sealed class PenumbraChangedItemTooltip : IDisposable
|
||||||
{
|
{
|
||||||
case ChangedItemType.Item:
|
case ChangedItemType.Item:
|
||||||
case ChangedItemType.ItemOffhand:
|
case ChangedItemType.ItemOffhand:
|
||||||
|
{
|
||||||
if (!_items.ItemData.TryGetValue(id, type is ChangedItemType.Item ? EquipSlot.MainHand : EquipSlot.OffHand, out var item))
|
if (!_items.ItemData.TryGetValue(id, type is ChangedItemType.Item ? EquipSlot.MainHand : EquipSlot.OffHand, out var item))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ApplyItem(state, item);
|
ApplyItem(state, item);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
case ChangedItemType.CustomArmor:
|
||||||
|
{
|
||||||
|
var (model, variant, slot) = IdentifiedItem.Split(id);
|
||||||
|
var item = _items.Identify(slot.ToSlot(), model, variant);
|
||||||
|
if (item.Valid)
|
||||||
|
ApplyItem(state, item);
|
||||||
|
return;
|
||||||
|
}
|
||||||
case ChangedItemType.Customization:
|
case ChangedItemType.Customization:
|
||||||
|
{
|
||||||
var (race, gender, index, value) = IdentifiedCustomization.Split(id);
|
var (race, gender, index, value) = IdentifiedCustomization.Split(id);
|
||||||
var customize = state.ModelData.Customize;
|
var customize = state.ModelData.Customize;
|
||||||
if (CheckGenderRace(customize, race, gender) && VerifyValue(customize, index, value))
|
if (CheckGenderRace(customize, race, gender) && VerifyValue(customize, index, value))
|
||||||
_stateManager.ChangeCustomize(state, index, value, ApplySettings.Manual);
|
_stateManager.ChangeCustomize(state, index, value, ApplySettings.Manual);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -236,7 +260,7 @@ public sealed class PenumbraChangedItemTooltip : IDisposable
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var oldItem = state.ModelData.Item(slot);
|
var oldItem = state.ModelData.Item(slot);
|
||||||
if (oldItem.ItemId != item.ItemId)
|
if (oldItem.Id != item.Id)
|
||||||
_lastItems[slot.ToIndex()] = oldItem;
|
_lastItems[slot.ToIndex()] = oldItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ public readonly record struct ModSettings(Dictionary<string, List<string>> Setti
|
||||||
=> new();
|
=> new();
|
||||||
}
|
}
|
||||||
|
|
||||||
public unsafe class PenumbraService : IDisposable
|
public class PenumbraService : IDisposable
|
||||||
{
|
{
|
||||||
public const int RequiredPenumbraBreakingVersion = 5;
|
public const int RequiredPenumbraBreakingVersion = 5;
|
||||||
public const int RequiredPenumbraFeatureVersion = 0;
|
public const int RequiredPenumbraFeatureVersion = 0;
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 552246e595ffab2aaba2c75f578d564f8938fc9a
|
Subproject commit 97e9f427406f82a59ddef764b44ecea654a51623
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit d9d4b286d54ad4027a1e8a2bbf900ee79aefaa93
|
Subproject commit 66bc00dc8517204e58c6515af5aec0ba6d196716
|
||||||
Loading…
Add table
Add a link
Reference in a new issue