mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2026-02-22 15:37:44 +01:00
Maybe fix weapon behavior with multiple restricted designs with identical weapon types.
This commit is contained in:
parent
71d6a658d6
commit
3d421881f6
12 changed files with 104 additions and 38 deletions
|
|
@ -77,7 +77,7 @@ public sealed class AutoDesignApplier : IDisposable
|
||||||
{
|
{
|
||||||
case EquipSlot.MainHand:
|
case EquipSlot.MainHand:
|
||||||
{
|
{
|
||||||
if (_jobChangeState.TryGetValue(current.Type, out var data))
|
if (_jobChangeState.TryGetValue(current.Type, actor.Job, out var data))
|
||||||
{
|
{
|
||||||
Glamourer.Log.Verbose(
|
Glamourer.Log.Verbose(
|
||||||
$"Changing Mainhand from {state.ModelData.Weapon(EquipSlot.MainHand)} | {state.BaseData.Weapon(EquipSlot.MainHand)} to {data.Item1} for 0x{actor.Address:X}.");
|
$"Changing Mainhand from {state.ModelData.Weapon(EquipSlot.MainHand)} | {state.BaseData.Weapon(EquipSlot.MainHand)} to {data.Item1} for 0x{actor.Address:X}.");
|
||||||
|
|
@ -89,7 +89,7 @@ public sealed class AutoDesignApplier : IDisposable
|
||||||
}
|
}
|
||||||
case EquipSlot.OffHand when current.Type == state.BaseData.MainhandType.Offhand():
|
case EquipSlot.OffHand when current.Type == state.BaseData.MainhandType.Offhand():
|
||||||
{
|
{
|
||||||
if (_jobChangeState.TryGetValue(current.Type, out var data))
|
if (_jobChangeState.TryGetValue(current.Type, actor.Job, out var data))
|
||||||
{
|
{
|
||||||
Glamourer.Log.Verbose(
|
Glamourer.Log.Verbose(
|
||||||
$"Changing Offhand from {state.ModelData.Weapon(EquipSlot.OffHand)} | {state.BaseData.Weapon(EquipSlot.OffHand)} to {data.Item1} for 0x{actor.Address:X}.");
|
$"Changing Offhand from {state.ModelData.Weapon(EquipSlot.OffHand)} | {state.BaseData.Weapon(EquipSlot.OffHand)} to {data.Item1} for 0x{actor.Address:X}.");
|
||||||
|
|
@ -204,7 +204,7 @@ public sealed class AutoDesignApplier : IDisposable
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_state.TryGetValue(id, out var state))
|
if (!_state.GetOrCreate(actor, out var state))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (oldJob.Id == newJob.Id && state.LastJob == newJob.Id)
|
if (oldJob.Id == newJob.Id && state.LastJob == newJob.Id)
|
||||||
|
|
@ -279,7 +279,7 @@ public sealed class AutoDesignApplier : IDisposable
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var mergedDesign = _designMerger.Merge(
|
var mergedDesign = _designMerger.Merge(
|
||||||
set.Designs.Where(d => d.IsActive(actor)).SelectMany(d => d.Design.AllLinks.Select(l => (l.Design, l.Flags & d.Type))),
|
set.Designs.Where(d => d.IsActive(actor)).SelectMany(d => d.Design.AllLinks.Select(l => (l.Design, l.Flags & d.Type, d.Jobs.Flags))),
|
||||||
state.ModelData.Customize, state.BaseData, true, _config.AlwaysApplyAssociatedMods);
|
state.ModelData.Customize, state.BaseData, true, _config.AlwaysApplyAssociatedMods);
|
||||||
_state.ApplyDesign(state, mergedDesign, new ApplySettings(0, StateSource.Fixed, respectManual, fromJobChange, false, false, false));
|
_state.ApplyDesign(state, mergedDesign, new ApplySettings(0, StateSource.Fixed, respectManual, fromJobChange, false, false, false));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ using Glamourer.State;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using OtterGui.Classes;
|
using OtterGui.Classes;
|
||||||
|
using Penumbra.GameData.Structs;
|
||||||
|
|
||||||
namespace Glamourer.Designs;
|
namespace Glamourer.Designs;
|
||||||
|
|
||||||
|
|
@ -50,8 +51,8 @@ public sealed class Design : DesignBase, ISavable, IDesignStandIn
|
||||||
public string Incognito
|
public string Incognito
|
||||||
=> Identifier.ToString()[..8];
|
=> Identifier.ToString()[..8];
|
||||||
|
|
||||||
public IEnumerable<(IDesignStandIn Design, ApplicationType Flags)> AllLinks
|
public IEnumerable<(IDesignStandIn Design, ApplicationType Flags, JobFlag Jobs)> AllLinks
|
||||||
=> LinkContainer.GetAllLinks(this).Select(t => ((IDesignStandIn)t.Link.Link, t.Link.Type));
|
=> LinkContainer.GetAllLinks(this).Select(t => ((IDesignStandIn)t.Link.Link, t.Link.Type, JobFlag.All));
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
using Glamourer.Interop.Material;
|
using Glamourer.Interop.Material;
|
||||||
using Glamourer.State;
|
using Glamourer.State;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
using Penumbra.GameData.Structs;
|
||||||
|
|
||||||
namespace Glamourer.Designs;
|
namespace Glamourer.Designs;
|
||||||
|
|
||||||
|
|
@ -15,7 +16,7 @@ public interface IDesignStandIn : IEquatable<IDesignStandIn>
|
||||||
public string SerializeName();
|
public string SerializeName();
|
||||||
public StateSource AssociatedSource();
|
public StateSource AssociatedSource();
|
||||||
|
|
||||||
public IEnumerable<(IDesignStandIn Design, ApplicationType Flags)> AllLinks { get; }
|
public IEnumerable<(IDesignStandIn Design, ApplicationType Flags, JobFlag Jobs)> AllLinks { get; }
|
||||||
|
|
||||||
public void AddData(JObject jObj);
|
public void AddData(JObject jObj);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,9 @@ public class DesignMerger(
|
||||||
{
|
{
|
||||||
public MergedDesign Merge(LinkContainer designs, in CustomizeArray currentCustomize, in DesignData baseRef, bool respectOwnership,
|
public MergedDesign Merge(LinkContainer designs, in CustomizeArray currentCustomize, in DesignData baseRef, bool respectOwnership,
|
||||||
bool modAssociations)
|
bool modAssociations)
|
||||||
=> Merge(designs.Select(d => ((IDesignStandIn)d.Link, d.Type)), currentCustomize, baseRef, respectOwnership, modAssociations);
|
=> Merge(designs.Select(d => ((IDesignStandIn)d.Link, d.Type, JobFlag.All)), currentCustomize, baseRef, respectOwnership, modAssociations);
|
||||||
|
|
||||||
public MergedDesign Merge(IEnumerable<(IDesignStandIn, ApplicationType)> designs, in CustomizeArray currentCustomize, in DesignData baseRef,
|
public MergedDesign Merge(IEnumerable<(IDesignStandIn, ApplicationType, JobFlag)> designs, in CustomizeArray currentCustomize, in DesignData baseRef,
|
||||||
bool respectOwnership, bool modAssociations)
|
bool respectOwnership, bool modAssociations)
|
||||||
{
|
{
|
||||||
var ret = new MergedDesign(designManager);
|
var ret = new MergedDesign(designManager);
|
||||||
|
|
@ -29,7 +29,7 @@ public class DesignMerger(
|
||||||
var startBodyType = currentCustomize.BodyType;
|
var startBodyType = currentCustomize.BodyType;
|
||||||
CustomizeFlag fixFlags = 0;
|
CustomizeFlag fixFlags = 0;
|
||||||
respectOwnership &= _config.UnlockedItemMode;
|
respectOwnership &= _config.UnlockedItemMode;
|
||||||
foreach (var (design, type) in designs)
|
foreach (var (design, type, jobs) in designs)
|
||||||
{
|
{
|
||||||
if (type is 0)
|
if (type is 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -44,8 +44,8 @@ public class DesignMerger(
|
||||||
ReduceMeta(data, applyMeta, ret, source);
|
ReduceMeta(data, applyMeta, ret, source);
|
||||||
ReduceCustomize(data, customizeFlags, ref fixFlags, ret, source, respectOwnership, startBodyType);
|
ReduceCustomize(data, customizeFlags, ref fixFlags, ret, source, respectOwnership, startBodyType);
|
||||||
ReduceEquip(data, equipFlags, ret, source, respectOwnership);
|
ReduceEquip(data, equipFlags, ret, source, respectOwnership);
|
||||||
ReduceMainhands(data, equipFlags, ret, source, respectOwnership);
|
ReduceMainhands(data, jobs, equipFlags, ret, source, respectOwnership);
|
||||||
ReduceOffhands(data, equipFlags, ret, source, respectOwnership);
|
ReduceOffhands(data, jobs, equipFlags, ret, source, respectOwnership);
|
||||||
ReduceCrests(data, crestFlags, ret, source);
|
ReduceCrests(data, crestFlags, ret, source);
|
||||||
ReduceParameters(data, parameterFlags, ret, source);
|
ReduceParameters(data, parameterFlags, ret, source);
|
||||||
ReduceMods(design as Design, ret, modAssociations);
|
ReduceMods(design as Design, ret, modAssociations);
|
||||||
|
|
@ -170,7 +170,7 @@ public class DesignMerger(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ReduceMainhands(in DesignData design, EquipFlag equipFlags, MergedDesign ret, StateSource source,
|
private void ReduceMainhands(in DesignData design, JobFlag allowedJobs, EquipFlag equipFlags, MergedDesign ret, StateSource source,
|
||||||
bool respectOwnership)
|
bool respectOwnership)
|
||||||
{
|
{
|
||||||
if (!equipFlags.HasFlag(EquipFlag.Mainhand))
|
if (!equipFlags.HasFlag(EquipFlag.Mainhand))
|
||||||
|
|
@ -186,10 +186,10 @@ public class DesignMerger(
|
||||||
ret.Design.GetDesignDataRef().SetItem(EquipSlot.MainHand, weapon);
|
ret.Design.GetDesignDataRef().SetItem(EquipSlot.MainHand, weapon);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret.Weapons.TryAdd(weapon.Type, (weapon, source));
|
ret.Weapons.TryAdd(weapon.Type, weapon, source, allowedJobs);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ReduceOffhands(in DesignData design, EquipFlag equipFlags, MergedDesign ret, StateSource source, bool respectOwnership)
|
private void ReduceOffhands(in DesignData design, JobFlag allowedJobs, EquipFlag equipFlags, MergedDesign ret, StateSource source, bool respectOwnership)
|
||||||
{
|
{
|
||||||
if (!equipFlags.HasFlag(EquipFlag.Offhand))
|
if (!equipFlags.HasFlag(EquipFlag.Offhand))
|
||||||
return;
|
return;
|
||||||
|
|
@ -205,7 +205,7 @@ public class DesignMerger(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (weapon.Valid)
|
if (weapon.Valid)
|
||||||
ret.Weapons.TryAdd(weapon.Type, (weapon, source));
|
ret.Weapons.TryAdd(weapon.Type, weapon, source, allowedJobs);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ReduceCustomize(in DesignData design, CustomizeFlag customizeFlags, ref CustomizeFlag fixFlags, MergedDesign ret,
|
private void ReduceCustomize(in DesignData design, CustomizeFlag customizeFlags, ref CustomizeFlag fixFlags, MergedDesign ret,
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,61 @@ using Penumbra.GameData.Structs;
|
||||||
|
|
||||||
namespace Glamourer.Designs.Links;
|
namespace Glamourer.Designs.Links;
|
||||||
|
|
||||||
|
public readonly struct WeaponList
|
||||||
|
{
|
||||||
|
private readonly Dictionary<FullEquipType, List<(EquipItem, StateSource, JobFlag)>> _list = new(4);
|
||||||
|
|
||||||
|
public IEnumerable<(EquipItem, StateSource, JobFlag)> Values
|
||||||
|
=> _list.Values.SelectMany(t => t);
|
||||||
|
|
||||||
|
public void Clear()
|
||||||
|
=> _list.Clear();
|
||||||
|
|
||||||
|
public bool TryAdd(FullEquipType type, EquipItem item, StateSource source, JobFlag flags)
|
||||||
|
{
|
||||||
|
if (!_list.TryGetValue(type, out var list))
|
||||||
|
{
|
||||||
|
list = new List<(EquipItem, StateSource, JobFlag)>(2);
|
||||||
|
_list.Add(type, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
var remainingFlags = list.Select(t => t.Item3)
|
||||||
|
.Aggregate(flags, (current, existingFlags) => current & ~existingFlags);
|
||||||
|
|
||||||
|
if (remainingFlags == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
list.Add((item, source, remainingFlags));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool TryGet(FullEquipType type, JobId id, out (EquipItem, StateSource) ret)
|
||||||
|
{
|
||||||
|
if (!_list.TryGetValue(type, out var list))
|
||||||
|
{
|
||||||
|
ret = default;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var flag = (JobFlag)(1ul << id.Id);
|
||||||
|
|
||||||
|
foreach (var (item, source, flags) in list)
|
||||||
|
{
|
||||||
|
if (flags.HasFlag(flag))
|
||||||
|
{
|
||||||
|
ret = (item, source);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = default;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WeaponList()
|
||||||
|
{ }
|
||||||
|
}
|
||||||
|
|
||||||
public sealed class MergedDesign
|
public sealed class MergedDesign
|
||||||
{
|
{
|
||||||
public MergedDesign(DesignManager designManager)
|
public MergedDesign(DesignManager designManager)
|
||||||
|
|
@ -24,14 +79,14 @@ public sealed class MergedDesign
|
||||||
{
|
{
|
||||||
var weapon = design.DesignData.Item(EquipSlot.MainHand);
|
var weapon = design.DesignData.Item(EquipSlot.MainHand);
|
||||||
if (weapon.Valid)
|
if (weapon.Valid)
|
||||||
Weapons.TryAdd(weapon.Type, (weapon, StateSource.Manual));
|
Weapons.TryAdd(weapon.Type, weapon, StateSource.Manual, JobFlag.All);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (design.DoApplyEquip(EquipSlot.OffHand))
|
if (design.DoApplyEquip(EquipSlot.OffHand))
|
||||||
{
|
{
|
||||||
var weapon = design.DesignData.Item(EquipSlot.OffHand);
|
var weapon = design.DesignData.Item(EquipSlot.OffHand);
|
||||||
if (weapon.Valid)
|
if (weapon.Valid)
|
||||||
Weapons.TryAdd(weapon.Type, (weapon, StateSource.Manual));
|
Weapons.TryAdd(weapon.Type, weapon, StateSource.Manual, JobFlag.All);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -42,8 +97,8 @@ public sealed class MergedDesign
|
||||||
AssociatedMods[mod] = settings;
|
AssociatedMods[mod] = settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public readonly DesignBase Design;
|
public readonly DesignBase Design;
|
||||||
public readonly Dictionary<FullEquipType, (EquipItem, StateSource)> Weapons = new(4);
|
public readonly WeaponList Weapons = new();
|
||||||
public readonly SortedList<Mod, ModSettings> AssociatedMods = [];
|
public readonly SortedList<Mod, ModSettings> AssociatedMods = [];
|
||||||
public StateSources Sources = new();
|
public StateSources Sources = new();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using Glamourer.Interop.Material;
|
||||||
using Glamourer.State;
|
using Glamourer.State;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using OtterGui.Services;
|
using OtterGui.Services;
|
||||||
|
using Penumbra.GameData.Structs;
|
||||||
|
|
||||||
namespace Glamourer.Designs.Special;
|
namespace Glamourer.Designs.Special;
|
||||||
|
|
||||||
|
|
@ -38,7 +39,7 @@ public class QuickSelectedDesign(QuickDesignCombo combo) : IDesignStandIn, IServ
|
||||||
public StateSource AssociatedSource()
|
public StateSource AssociatedSource()
|
||||||
=> StateSource.Manual;
|
=> StateSource.Manual;
|
||||||
|
|
||||||
public IEnumerable<(IDesignStandIn Design, ApplicationType Flags)> AllLinks
|
public IEnumerable<(IDesignStandIn Design, ApplicationType Flags, JobFlag Jobs)> AllLinks
|
||||||
=> combo.Design?.AllLinks ?? [];
|
=> combo.Design?.AllLinks ?? [];
|
||||||
|
|
||||||
public void AddData(JObject jObj)
|
public void AddData(JObject jObj)
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
using Glamourer.Interop.Material;
|
using Glamourer.Interop.Material;
|
||||||
using Glamourer.State;
|
using Glamourer.State;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
using Penumbra.GameData.Structs;
|
||||||
|
|
||||||
namespace Glamourer.Designs.Special;
|
namespace Glamourer.Designs.Special;
|
||||||
|
|
||||||
|
|
@ -45,7 +46,7 @@ public class RandomDesign(RandomDesignGenerator rng) : IDesignStandIn
|
||||||
public StateSource AssociatedSource()
|
public StateSource AssociatedSource()
|
||||||
=> StateSource.Manual;
|
=> StateSource.Manual;
|
||||||
|
|
||||||
public IEnumerable<(IDesignStandIn Design, ApplicationType Flags)> AllLinks
|
public IEnumerable<(IDesignStandIn Design, ApplicationType Flags, JobFlag Jobs)> AllLinks
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
|
@ -53,8 +54,8 @@ public class RandomDesign(RandomDesignGenerator rng) : IDesignStandIn
|
||||||
if (_currentDesign == null)
|
if (_currentDesign == null)
|
||||||
yield break;
|
yield break;
|
||||||
|
|
||||||
foreach (var (link, type) in _currentDesign.AllLinks)
|
foreach (var (link, type, jobs) in _currentDesign.AllLinks)
|
||||||
yield return (link, type);
|
yield return (link, type, jobs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
using Glamourer.Interop.Material;
|
using Glamourer.Interop.Material;
|
||||||
using Glamourer.State;
|
using Glamourer.State;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
using Penumbra.GameData.Structs;
|
||||||
|
|
||||||
namespace Glamourer.Designs.Special;
|
namespace Glamourer.Designs.Special;
|
||||||
|
|
||||||
|
|
@ -28,9 +29,9 @@ public class RevertDesign : IDesignStandIn
|
||||||
public StateSource AssociatedSource()
|
public StateSource AssociatedSource()
|
||||||
=> StateSource.Game;
|
=> StateSource.Game;
|
||||||
|
|
||||||
public IEnumerable<(IDesignStandIn Design, ApplicationType Flags)> AllLinks
|
public IEnumerable<(IDesignStandIn Design, ApplicationType Flags, JobFlag Jobs)> AllLinks
|
||||||
{
|
{
|
||||||
get { yield return (this, ApplicationType.All); }
|
get { yield return (this, ApplicationType.All, JobFlag.All); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddData(JObject jObj)
|
public void AddData(JObject jObj)
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@ public class ContextMenuService : IDisposable
|
||||||
|
|
||||||
private bool HandleItem(ItemId id)
|
private bool HandleItem(ItemId id)
|
||||||
{
|
{
|
||||||
var itemId = id.Id % 500000u;
|
var itemId = id.StripModifiers;
|
||||||
return _items.ItemData.TryGetValue(itemId, EquipSlot.MainHand, out _lastItem);
|
return _items.ItemData.TryGetValue(itemId, EquipSlot.MainHand, out _lastItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,21 @@
|
||||||
using OtterGui.Services;
|
using Glamourer.Designs.Links;
|
||||||
|
using OtterGui.Services;
|
||||||
using Penumbra.GameData.Actors;
|
using Penumbra.GameData.Actors;
|
||||||
using Penumbra.GameData.Enums;
|
using Penumbra.GameData.Enums;
|
||||||
using Penumbra.GameData.Structs;
|
using Penumbra.GameData.Structs;
|
||||||
|
|
||||||
namespace Glamourer.State;
|
namespace Glamourer.State;
|
||||||
|
|
||||||
public sealed class JobChangeState : Dictionary<FullEquipType, (EquipItem, StateSource)>, IService
|
public sealed class JobChangeState : IService
|
||||||
{
|
{
|
||||||
|
private readonly WeaponList _weaponList = new();
|
||||||
|
|
||||||
public ActorState? State { get; private set; }
|
public ActorState? State { get; private set; }
|
||||||
|
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
State = null;
|
State = null;
|
||||||
Clear();
|
_weaponList.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool HasState
|
public bool HasState
|
||||||
|
|
@ -21,10 +24,13 @@ public sealed class JobChangeState : Dictionary<FullEquipType, (EquipItem, State
|
||||||
public ActorIdentifier Identifier
|
public ActorIdentifier Identifier
|
||||||
=> State?.Identifier ?? ActorIdentifier.Invalid;
|
=> State?.Identifier ?? ActorIdentifier.Invalid;
|
||||||
|
|
||||||
public void Set(ActorState state, IEnumerable<(EquipItem, StateSource)> items)
|
public bool TryGetValue(FullEquipType slot, JobId jobId, out (EquipItem, StateSource) data)
|
||||||
|
=> _weaponList.TryGet(slot, jobId, out data);
|
||||||
|
|
||||||
|
public void Set(ActorState state, IEnumerable<(EquipItem, StateSource, JobFlag)> items)
|
||||||
{
|
{
|
||||||
foreach (var (item, source) in items.Where(p => p.Item1.Valid))
|
foreach (var (item, source, flags) in items.Where(p => p.Item1.Valid))
|
||||||
TryAdd(item.Type, (item, source));
|
_weaponList.TryAdd(item.Type, item, source, flags);
|
||||||
State = state;
|
State = state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -298,7 +298,7 @@ public class StateEditor(
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentType = state.BaseData.Item(weaponSlot).Type;
|
var currentType = state.BaseData.Item(weaponSlot).Type;
|
||||||
if (mergedDesign.Weapons.TryGetValue(currentType, out var weapon))
|
if (mergedDesign.Weapons.TryGet(currentType, state.LastJob, out var weapon))
|
||||||
{
|
{
|
||||||
var source = settings.UseSingleSource ? settings.Source :
|
var source = settings.UseSingleSource ? settings.Source :
|
||||||
weapon.Item2 is StateSource.Game ? StateSource.Game : settings.Source;
|
weapon.Item2 is StateSource.Game ? StateSource.Game : settings.Source;
|
||||||
|
|
@ -311,7 +311,7 @@ public class StateEditor(
|
||||||
if (settings.FromJobChange)
|
if (settings.FromJobChange)
|
||||||
jobChange.Set(state, mergedDesign.Weapons.Values.Select(m =>
|
jobChange.Set(state, mergedDesign.Weapons.Values.Select(m =>
|
||||||
(m.Item1, settings.UseSingleSource ? settings.Source :
|
(m.Item1, settings.UseSingleSource ? settings.Source :
|
||||||
m.Item2 is StateSource.Game ? StateSource.Game : settings.Source)));
|
m.Item2 is StateSource.Game ? StateSource.Game : settings.Source, m.Item3)));
|
||||||
|
|
||||||
foreach (var meta in MetaExtensions.AllRelevant.Where(mergedDesign.Design.DoApplyMeta))
|
foreach (var meta in MetaExtensions.AllRelevant.Where(mergedDesign.Design.DoApplyMeta))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 66687643da2163c938575ad6949c8d0fbd03afe7
|
Subproject commit 04237f8e80e2277ea99701bd240a09fcffe4db97
|
||||||
Loading…
Add table
Add a link
Reference in a new issue