Merge branch 'Ottermandias:main' into main

This commit is contained in:
Limiana 2023-12-25 16:02:07 +03:00 committed by GitHub
commit 6fe68c59d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 51 additions and 90 deletions

View file

@ -39,8 +39,8 @@ public class AutoDesignApplier : IDisposable
private readonly IClientState _clientState;
private ActorState? _jobChangeState;
private readonly Dictionary<FullEquipType, (EquipItem, StateChanged.Source)> _jobChangeMainhand = new();
private readonly Dictionary<FullEquipType, (EquipItem, StateChanged.Source)> _jobChangeOffhand = new();
private readonly Dictionary<FullEquipType, (EquipItem, StateChanged.Source)> _jobChangeMainhand = [];
private readonly Dictionary<FullEquipType, (EquipItem, StateChanged.Source)> _jobChangeOffhand = [];
private void ResetJobChange()
{

View file

@ -108,8 +108,9 @@
</ItemGroup>
<Target Name="GetGitHash" BeforeTargets="GetAssemblyVersion" Returns="InformationalVersion">
<Exec Command="git rev-parse --short HEAD" ConsoleToMSBuild="true" StandardOutputImportance="low">
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitHash" />
<Exec Command="git rev-parse --short HEAD" ConsoleToMSBuild="true" StandardOutputImportance="low" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="GitCommitHashSuccess"/>
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitHash" Condition="$(GitCommitHashSuccess) == 0"/>
</Exec>
<PropertyGroup>
@ -122,6 +123,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="if $(Configuration) == Release powershell Copy-Item -Force $(TargetDir)$(SolutionName).json -Destination $(SolutionDir)" />
</Target>

View file

@ -28,7 +28,7 @@ public ref struct EquipDrawData(EquipSlot slot, in DesignData designData)
public static EquipDrawData FromDesign(DesignManager manager, Design design, EquipSlot slot)
=> new(slot, design.DesignData)
{
ItemSetter = i => manager.ChangeEquip(design, slot, i),
ItemSetter = slot.IsEquipmentPiece() ? i => manager.ChangeEquip(design, slot, i) : i => manager.ChangeWeapon(design, slot, i),
StainSetter = i => manager.ChangeStain(design, slot, i),
ApplySetter = b => manager.ChangeApplyEquip(design, slot, b),
ApplyStainSetter = b => manager.ChangeApplyStain(design, slot, b),

View file

@ -24,6 +24,7 @@ public class GlamourerChangelog
Add1_0_4_0(Changelog);
Add1_0_5_0(Changelog);
Add1_0_6_0(Changelog);
Add1_0_7_0(Changelog);
}
private (int, ChangeLogDisplayType) ConfigData()
@ -44,6 +45,16 @@ public class GlamourerChangelog
}
}
private static void Add1_0_7_0(Changelog log)
=> log.NextVersion("Version 1.0.7.0")
.RegisterHighlight("Glamourer now can set the free company crests on body slots, head slots and shields.")
.RegisterEntry("Fixed an issue with tooltips in certain combo selectors.")
.RegisterEntry("Fixed some issues with Hide Hat Gear and monsters turned into humans.")
.RegisterEntry(
"Hopefully fixed issues with icons used by Glamourer that are modified through Penumbra preventing Glamourer to even start in some cases.")
.RegisterEntry("Those icons might still not appear if they fail to load, but Glamourer should at least still work.", 1)
.RegisterEntry("Pre-emptively fixed a potential issue for the holidays.");
private static void Add1_0_6_0(Changelog log)
=> log.NextVersion("Version 1.0.6.0")
.RegisterHighlight("Added the option to define custom color groups and associate designs with them.")

View file

@ -37,9 +37,9 @@ public sealed class TextureService : TextureCache, IDisposable
}
}
private static IDalamudTextureWrap[] CreateSlotIcons(UiBuilder uiBuilder)
private static IDalamudTextureWrap?[] CreateSlotIcons(UiBuilder uiBuilder)
{
var ret = new IDalamudTextureWrap[12];
var ret = new IDalamudTextureWrap?[12];
using var uldWrapper = uiBuilder.LoadUld("ui/uld/ArmouryBoard.uld");
@ -49,20 +49,33 @@ public sealed class TextureService : TextureCache, IDisposable
return ret;
}
ret[0] = uldWrapper.LoadTexturePart("ui/uld/ArmouryBoard_hr1.tex", 1)!;
ret[1] = uldWrapper.LoadTexturePart("ui/uld/ArmouryBoard_hr1.tex", 2)!;
ret[2] = uldWrapper.LoadTexturePart("ui/uld/ArmouryBoard_hr1.tex", 3)!;
ret[3] = uldWrapper.LoadTexturePart("ui/uld/ArmouryBoard_hr1.tex", 5)!;
ret[4] = uldWrapper.LoadTexturePart("ui/uld/ArmouryBoard_hr1.tex", 6)!;
ret[5] = uldWrapper.LoadTexturePart("ui/uld/ArmouryBoard_hr1.tex", 8)!;
ret[6] = uldWrapper.LoadTexturePart("ui/uld/ArmouryBoard_hr1.tex", 9)!;
ret[7] = uldWrapper.LoadTexturePart("ui/uld/ArmouryBoard_hr1.tex", 10)!;
ret[8] = uldWrapper.LoadTexturePart("ui/uld/ArmouryBoard_hr1.tex", 11)!;
ret[9] = ret[8];
ret[10] = uldWrapper.LoadTexturePart("ui/uld/ArmouryBoard_hr1.tex", 0)!;
ret[11] = uldWrapper.LoadTexturePart("ui/uld/ArmouryBoard_hr1.tex", 7)!;
SetIcon(EquipSlot.Head, 1);
SetIcon(EquipSlot.Body, 2);
SetIcon(EquipSlot.Hands, 3);
SetIcon(EquipSlot.Legs, 5);
SetIcon(EquipSlot.Feet, 6);
SetIcon(EquipSlot.Ears, 8);
SetIcon(EquipSlot.Neck, 9);
SetIcon(EquipSlot.Wrists, 10);
SetIcon(EquipSlot.RFinger, 11);
SetIcon(EquipSlot.MainHand, 0);
SetIcon(EquipSlot.OffHand, 7);
ret[EquipSlot.LFinger.ToIndex()] = ret[EquipSlot.RFinger.ToIndex()];
uldWrapper.Dispose();
return ret;
void SetIcon(EquipSlot slot, int index)
{
try
{
ret[slot.ToIndex()] = uldWrapper.LoadTexturePart("ui/uld/ArmouryBoard_hr1.tex", index)!;
}
catch (Exception ex)
{
Glamourer.Log.Error($"Could not get empty slot texture for {slot.ToName()}, icon will be left empty. "
+ $"This may be because of incompatible mods affecting your character screen interface:\n{ex}");
ret[slot.ToIndex()] = null;
}
}
}
}

View file

@ -1,65 +0,0 @@
using Glamourer.Events;
using Glamourer.Services;
using Penumbra.GameData.Enums;
using Penumbra.GameData.Structs;
namespace Glamourer.State;
/// <remarks>Currently unused.</remarks>
public unsafe struct WeaponState
{
private fixed ulong _weapons[FullEquipTypeExtensions.NumWeaponTypes];
private fixed byte _sources[FullEquipTypeExtensions.NumWeaponTypes];
public CustomItemId? this[FullEquipType type]
{
get
{
if (!ToIndex(type, out var idx))
return null;
var weapon = _weapons[idx];
if (weapon == 0)
return null;
return new CustomItemId(weapon);
}
}
public EquipItem Get(ItemManager items, EquipItem value)
{
var id = this[value.Type];
if (id == null)
return value;
var item = items.Resolve(value.Type, id.Value);
return item.Type != value.Type ? value : item;
}
public void Set(FullEquipType type, EquipItem value, StateChanged.Source source)
{
if (!ToIndex(type, out var idx))
return;
_weapons[idx] = value.Id.Id;
_sources[idx] = (byte)source;
}
public void RemoveFixedDesignSources()
{
for (var i = 0; i < FullEquipTypeExtensions.NumWeaponTypes; ++i)
{
if (_sources[i] is (byte) StateChanged.Source.Fixed)
_sources[i] = (byte) StateChanged.Source.Manual;
}
}
private static bool ToIndex(FullEquipType type, out int index)
{
index = ToIndex(type);
return index is >= 0 and < FullEquipTypeExtensions.NumWeaponTypes;
}
private static int ToIndex(FullEquipType type)
=> (int)type - FullEquipTypeExtensions.WeaponTypesOffset;
}

View file

@ -17,8 +17,8 @@
"Character"
],
"InternalName": "Glamourer",
"AssemblyVersion": "1.0.6.1",
"TestingAssemblyVersion": "1.0.6.3",
"AssemblyVersion": "1.0.7.0",
"TestingAssemblyVersion": "1.0.7.0",
"RepoUrl": "https://github.com/Ottermandias/Glamourer",
"ApplicableVersion": "any",
"DalamudApiLevel": 9,
@ -26,9 +26,9 @@
"IsTestingExclusive": "False",
"DownloadCount": 1,
"LastUpdate": 1618608322,
"DownloadLinkInstall": "https://github.com/Ottermandias/Glamourer/releases/download/1.0.6.1/Glamourer.zip",
"DownloadLinkUpdate": "https://github.com/Ottermandias/Glamourer/releases/download/1.0.6.1/Glamourer.zip",
"DownloadLinkTesting": "https://github.com/Ottermandias/Glamourer/releases/download/testing_1.0.6.3/Glamourer.zip",
"DownloadLinkInstall": "https://github.com/Ottermandias/Glamourer/releases/download/1.0.7.0/Glamourer.zip",
"DownloadLinkUpdate": "https://github.com/Ottermandias/Glamourer/releases/download/1.0.7.0/Glamourer.zip",
"DownloadLinkTesting": "https://github.com/Ottermandias/Glamourer/releases/download/1.0.7.0/Glamourer.zip",
"IconUrl": "https://raw.githubusercontent.com/Ottermandias/Glamourer/main/images/icon.png"
}
]