mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 18:27:24 +01:00
Fix some data issues. 0.1.3.1.
This commit is contained in:
parent
579ef97dcc
commit
9ec597cf2a
7 changed files with 197 additions and 201 deletions
|
|
@ -51,7 +51,7 @@ namespace Glamourer
|
||||||
=> new(sheet.First(), "Nothing", slot);
|
=> new(sheet.First(), "Nothing", slot);
|
||||||
|
|
||||||
static Item EmptyNpc(EquipSlot slot)
|
static Item EmptyNpc(EquipSlot slot)
|
||||||
=> new(new Lumina.Excel.GeneratedSheets.Item() { ModelMain = 9903 }, "Smallclothes (NPC)", slot);
|
=> new(new Lumina.Excel.GeneratedSheets.Item() { ModelMain = 9903, RowId = 1 }, "Smallclothes (NPC)", slot);
|
||||||
|
|
||||||
_itemsBySlot = new Dictionary<EquipSlot, List<Item>>()
|
_itemsBySlot = new Dictionary<EquipSlot, List<Item>>()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
BIN
Glamourer.zip
BIN
Glamourer.zip
Binary file not shown.
|
|
@ -5,8 +5,8 @@
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<RootNamespace>Glamourer</RootNamespace>
|
<RootNamespace>Glamourer</RootNamespace>
|
||||||
<AssemblyName>Glamourer</AssemblyName>
|
<AssemblyName>Glamourer</AssemblyName>
|
||||||
<FileVersion>0.1.3.0</FileVersion>
|
<FileVersion>0.1.3.1</FileVersion>
|
||||||
<AssemblyVersion>0.1.3.0</AssemblyVersion>
|
<AssemblyVersion>0.1.3.1</AssemblyVersion>
|
||||||
<Company>SoftOtter</Company>
|
<Company>SoftOtter</Company>
|
||||||
<Product>Glamourer</Product>
|
<Product>Glamourer</Product>
|
||||||
<Copyright>Copyright © 2020</Copyright>
|
<Copyright>Copyright © 2020</Copyright>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
"Description": "Adds functionality to change and store appearance of players, customization and equip. Requires Penumbra to be installed and activated to work. Can also add preview options to the Changed Items tab for Penumbra.",
|
"Description": "Adds functionality to change and store appearance of players, customization and equip. Requires Penumbra to be installed and activated to work. Can also add preview options to the Changed Items tab for Penumbra.",
|
||||||
"Tags": [ "Appearance", "Glamour", "Race", "Outfit", "Armor", "Clothes", "Skins", "Customization", "Design", "Character" ],
|
"Tags": [ "Appearance", "Glamour", "Race", "Outfit", "Armor", "Clothes", "Skins", "Customization", "Design", "Character" ],
|
||||||
"InternalName": "Glamourer",
|
"InternalName": "Glamourer",
|
||||||
"AssemblyVersion": "0.1.3.0",
|
"AssemblyVersion": "0.1.3.1",
|
||||||
"RepoUrl": "https://github.com/Ottermandias/Glamourer",
|
"RepoUrl": "https://github.com/Ottermandias/Glamourer",
|
||||||
"ApplicableVersion": "any",
|
"ApplicableVersion": "any",
|
||||||
"DalamudApiLevel": 8,
|
"DalamudApiLevel": 8,
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using System.Reflection;
|
|
||||||
using Dalamud.Game.ClientState.Objects.Enums;
|
|
||||||
using Dalamud.Game.ClientState.Objects.SubKinds;
|
|
||||||
using Dalamud.Game.ClientState.Objects.Types;
|
using Dalamud.Game.ClientState.Objects.Types;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Logging;
|
using Dalamud.Logging;
|
||||||
|
|
@ -11,7 +8,6 @@ using Glamourer.Customization;
|
||||||
using Glamourer.Designs;
|
using Glamourer.Designs;
|
||||||
using Glamourer.FileSystem;
|
using Glamourer.FileSystem;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using Penumbra.GameData.Structs;
|
|
||||||
using Penumbra.PlayerWatch;
|
using Penumbra.PlayerWatch;
|
||||||
|
|
||||||
namespace Glamourer.Gui
|
namespace Glamourer.Gui
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,25 @@
|
||||||
using System.Collections;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using Lumina.Text;
|
|
||||||
using Penumbra.GameData.Enums;
|
using Penumbra.GameData.Enums;
|
||||||
using Penumbra.GameData.Structs;
|
using Penumbra.GameData.Structs;
|
||||||
using Penumbra.PlayerWatch;
|
using Penumbra.PlayerWatch;
|
||||||
|
|
||||||
namespace Glamourer.Gui
|
namespace Glamourer.Gui;
|
||||||
|
|
||||||
|
internal partial class Interface
|
||||||
{
|
{
|
||||||
internal partial class Interface
|
|
||||||
{
|
|
||||||
private bool DrawStainSelector(ComboWithFilter<Stain> stainCombo, EquipSlot slot, StainId stainIdx)
|
private bool DrawStainSelector(ComboWithFilter<Stain> stainCombo, EquipSlot slot, StainId stainIdx)
|
||||||
{
|
{
|
||||||
stainCombo.PostPreview = null;
|
stainCombo.PostPreview = null;
|
||||||
if (_stains.TryGetValue((byte) stainIdx, out var stain))
|
if (_stains.TryGetValue((byte)stainIdx, out var stain))
|
||||||
{
|
{
|
||||||
var previewPush = PushColor(stain, ImGuiCol.FrameBg);
|
var previewPush = PushColor(stain, ImGuiCol.FrameBg);
|
||||||
stainCombo.PostPreview = () => ImGui.PopStyleColor(previewPush);
|
stainCombo.PostPreview = () => ImGui.PopStyleColor(previewPush);
|
||||||
}
|
}
|
||||||
|
|
||||||
var change = stainCombo.Draw(string.Empty, out var newStain) && !newStain.RowIndex.Equals(stainIdx);
|
var change = stainCombo.Draw(string.Empty, out var newStain) && !newStain.RowIndex.Equals(stainIdx);
|
||||||
if (!change && (byte) stainIdx != 0)
|
if (!change && (byte)stainIdx != 0)
|
||||||
{
|
{
|
||||||
ImGuiCustom.HoverTooltip("Right-click to clear.");
|
ImGuiCustom.HoverTooltip("Right-click to clear.");
|
||||||
if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
||||||
|
|
@ -40,7 +38,6 @@ namespace Glamourer.Gui
|
||||||
Glamourer.RevertableDesigns.Add(_player);
|
Glamourer.RevertableDesigns.Add(_player);
|
||||||
newStain.Write(_player.Address, slot);
|
newStain.Write(_player.Address, slot);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool DrawGlobalStainSelector(ComboWithFilter<Stain> stainCombo)
|
private bool DrawGlobalStainSelector(ComboWithFilter<Stain> stainCombo)
|
||||||
|
|
@ -69,25 +66,25 @@ namespace Glamourer.Gui
|
||||||
{
|
{
|
||||||
if (key is EquipSlot.OffHand && _selection?.Data.Equipment.OffHand.Set.Value == 0)
|
if (key is EquipSlot.OffHand && _selection?.Data.Equipment.OffHand.Set.Value == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
_selection?.Data.WriteStain(key, newStain.RowIndex);
|
_selection?.Data.WriteStain(key, newStain.RowIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
return _inDesignMode;
|
return _inDesignMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
Glamourer.RevertableDesigns.Add(_player);
|
Glamourer.RevertableDesigns.Add(_player);
|
||||||
foreach (var key in GetEquipSlotNames().Keys)
|
foreach (var key in GetEquipSlotNames().Keys)
|
||||||
{
|
|
||||||
newStain.Write(_player.Address, key);
|
newStain.Write(_player.Address, key);
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool DrawItemSelector(ComboWithFilter<Item> equipCombo, Lumina.Excel.GeneratedSheets.Item item, EquipSlot slot = EquipSlot.Unknown)
|
private bool DrawItemSelector(ComboWithFilter<Item> equipCombo, EquipItem item, EquipSlot slot = EquipSlot.Unknown)
|
||||||
{
|
{
|
||||||
var currentName = item.Name.ToString();
|
var currentName = item.Name;
|
||||||
var change = equipCombo.Draw(currentName, out var newItem, _itemComboWidth) && newItem.Base.RowId != item.RowId;
|
var change = equipCombo.Draw(currentName, out var newItem, _itemComboWidth) && newItem.Base.RowId != item.Id;
|
||||||
if (!change && !ReferenceEquals(item, SmallClothes))
|
if (!change && item.Name != SmallClothes.Name)
|
||||||
{
|
{
|
||||||
ImGuiCustom.HoverTooltip("Right-click to clear.");
|
ImGuiCustom.HoverTooltip("Right-click to clear.");
|
||||||
if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
||||||
|
|
@ -107,16 +104,15 @@ namespace Glamourer.Gui
|
||||||
Glamourer.RevertableDesigns.Add(_player);
|
Glamourer.RevertableDesigns.Add(_player);
|
||||||
newItem.Write(_player.Address);
|
newItem.Write(_player.Address);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool DrawCheckbox(CharacterEquipMask flag, ref CharacterEquipMask mask)
|
private static bool DrawCheckbox(CharacterEquipMask flag, ref CharacterEquipMask mask)
|
||||||
{
|
{
|
||||||
var tmp = (uint) mask;
|
var tmp = (uint)mask;
|
||||||
var ret = false;
|
var ret = false;
|
||||||
if (ImGui.CheckboxFlags($"##flag_{(uint) flag}", ref tmp, (uint) flag) && tmp != (uint) mask)
|
if (ImGui.CheckboxFlags($"##flag_{(uint)flag}", ref tmp, (uint)flag) && tmp != (uint)mask)
|
||||||
{
|
{
|
||||||
mask = (CharacterEquipMask) tmp;
|
mask = (CharacterEquipMask)tmp;
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -125,13 +121,13 @@ namespace Glamourer.Gui
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static readonly Lumina.Excel.GeneratedSheets.Item SmallClothes = new(){ Name = new SeString("Nothing"), RowId = 0 };
|
private static readonly EquipItem SmallClothes = new("Nothing", 0, 0, 0, 0, 0, 0, EquipSlot.Unknown);
|
||||||
private static readonly Lumina.Excel.GeneratedSheets.Item SmallClothesNpc = new(){ Name = new SeString("Smallclothes (NPC)"), RowId = 1 };
|
private static readonly EquipItem SmallClothesNpc = new("Smallclothes (NPC)", 1, 0, 9903, 0, 1, 0, EquipSlot.Unknown);
|
||||||
private static readonly Lumina.Excel.GeneratedSheets.Item Unknown = new(){ Name = new SeString("Unknown"), RowId = 2 };
|
private static readonly EquipItem Unknown = new("Unknown", 3, 0, 0, 0, 0, 0, EquipSlot.Unknown);
|
||||||
|
|
||||||
private Lumina.Excel.GeneratedSheets.Item Identify(SetId set, WeaponType weapon, ushort variant, EquipSlot slot)
|
private EquipItem Identify(SetId set, WeaponType weapon, ushort variant, EquipSlot slot)
|
||||||
{
|
{
|
||||||
return (uint) set switch
|
return (uint)set switch
|
||||||
{
|
{
|
||||||
0 => SmallClothes,
|
0 => SmallClothes,
|
||||||
9903 => SmallClothesNpc,
|
9903 => SmallClothesNpc,
|
||||||
|
|
@ -139,11 +135,11 @@ namespace Glamourer.Gui
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private Lumina.Excel.GeneratedSheets.Item ToItem(IEnumerable<EquipItem> items)
|
private static EquipItem ToItem(IEnumerable<EquipItem> items)
|
||||||
{
|
{
|
||||||
var item = items.FirstOrDefault();
|
var item = items.FirstOrDefault();
|
||||||
if (item.Valid)
|
if (item.Valid)
|
||||||
return Dalamud.GameData.GetExcelSheet<Lumina.Excel.GeneratedSheets.Item>()!.GetRow(item.Id) ?? Unknown;
|
return item;
|
||||||
|
|
||||||
return Unknown;
|
return Unknown;
|
||||||
}
|
}
|
||||||
|
|
@ -155,6 +151,9 @@ namespace Glamourer.Gui
|
||||||
var ret = DrawStainSelector(stainCombo, slot, equip.Stain);
|
var ret = DrawStainSelector(stainCombo, slot, equip.Stain);
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
var item = Identify(equip.Set, new WeaponType(), equip.Variant, slot);
|
var item = Identify(equip.Set, new WeaponType(), equip.Variant, slot);
|
||||||
|
if (item.Name == Unknown.Name)
|
||||||
|
item = new EquipItem($"Unknown ({item.ModelId.Value}, {item.Variant})", 0, 0, equip.Set, 0, equip.Variant,
|
||||||
|
FullEquipType.Unknown, slot);
|
||||||
ret |= DrawItemSelector(equipCombo, item, slot);
|
ret |= DrawItemSelector(equipCombo, item, slot);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -175,6 +174,8 @@ namespace Glamourer.Gui
|
||||||
var ret = DrawStainSelector(stainCombo, slot, weapon.Stain);
|
var ret = DrawStainSelector(stainCombo, slot, weapon.Stain);
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
var item = Identify(weapon.Set, weapon.Type, weapon.Variant, slot);
|
var item = Identify(weapon.Set, weapon.Type, weapon.Variant, slot);
|
||||||
|
if (item.Name == Unknown.Name)
|
||||||
|
item = new EquipItem($"Unknown ({weapon.Set.Value}, {weapon.Type.Value}, {weapon.Variant})", 0, 0, weapon.Set, weapon.Type, (byte) weapon.Variant, FullEquipType.Unknown, slot);
|
||||||
ret |= DrawItemSelector(equipCombo, item, slot);
|
ret |= DrawItemSelector(equipCombo, item, slot);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -233,5 +234,4 @@ namespace Glamourer.Gui
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
"Description": "Adds functionality to change and store appearance of players, customization and equip. Requires Penumbra to be installed and activated to work. Can also add preview options to the Changed Items tab for Penumbra.",
|
"Description": "Adds functionality to change and store appearance of players, customization and equip. Requires Penumbra to be installed and activated to work. Can also add preview options to the Changed Items tab for Penumbra.",
|
||||||
"Tags": [ "Appearance", "Glamour", "Race", "Outfit", "Armor", "Clothes", "Skins", "Customization", "Design", "Character" ],
|
"Tags": [ "Appearance", "Glamour", "Race", "Outfit", "Armor", "Clothes", "Skins", "Customization", "Design", "Character" ],
|
||||||
"InternalName": "Glamourer",
|
"InternalName": "Glamourer",
|
||||||
"AssemblyVersion": "0.1.3.0",
|
"AssemblyVersion": "0.1.3.1",
|
||||||
"TestingAssemblyVersion": "0.1.3.0",
|
"TestingAssemblyVersion": "0.1.3.1",
|
||||||
"RepoUrl": "https://github.com/Ottermandias/Glamourer",
|
"RepoUrl": "https://github.com/Ottermandias/Glamourer",
|
||||||
"ApplicableVersion": "any",
|
"ApplicableVersion": "any",
|
||||||
"DalamudApiLevel": 8,
|
"DalamudApiLevel": 8,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue