mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 20:54:16 +01:00
Fix some ToDos, parallelization problems.
This commit is contained in:
parent
0ed94676ed
commit
8ea6893fc3
15 changed files with 50 additions and 41 deletions
|
|
@ -171,7 +171,7 @@ public static class ActorManagerExtensions
|
|||
{
|
||||
ObjectKind.MountType => manager.Data.Mounts,
|
||||
ObjectKind.Companion => manager.Data.Companions,
|
||||
(ObjectKind)15 => manager.Data.Ornaments, // TODO: CS Update
|
||||
ObjectKind.Ornament => manager.Data.Ornaments,
|
||||
ObjectKind.BattleNpc => manager.Data.BNpcs,
|
||||
ObjectKind.EventNpc => manager.Data.ENpcs,
|
||||
_ => new Dictionary<uint, string>(),
|
||||
|
|
@ -190,7 +190,7 @@ public static class ActorManagerExtensions
|
|||
ObjectKind.EventNpc => "Event NPC",
|
||||
ObjectKind.MountType => "Mount",
|
||||
ObjectKind.Companion => "Companion",
|
||||
(ObjectKind)15 => "Accessory", // TODO: CS update
|
||||
ObjectKind.Ornament => "Accessory",
|
||||
_ => kind.ToString(),
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public sealed partial class ActorManager : IDisposable
|
|||
{
|
||||
ObjectKind.MountType => Mounts.TryGetValue(dataId, out name),
|
||||
ObjectKind.Companion => Companions.TryGetValue(dataId, out name),
|
||||
(ObjectKind)15 => Ornaments.TryGetValue(dataId, out name), // TODO: CS Update
|
||||
ObjectKind.Ornament => Ornaments.TryGetValue(dataId, out name),
|
||||
ObjectKind.BattleNpc => BNpcs.TryGetValue(dataId, out name),
|
||||
ObjectKind.EventNpc => ENpcs.TryGetValue(dataId, out name),
|
||||
_ => false,
|
||||
|
|
|
|||
|
|
@ -179,9 +179,8 @@ public partial class ActorManager
|
|||
case "o":
|
||||
case "accessory":
|
||||
case "ornament":
|
||||
// TODO: Objectkind ornament.
|
||||
return FindDataId(split[1], Data.Ornaments, out id)
|
||||
? ((ObjectKind)15, id)
|
||||
? (ObjectKind.Ornament, id)
|
||||
: throw new IdentifierParseError($"Could not identify an Accessory named {split[1]}.");
|
||||
case "e":
|
||||
case "enpc":
|
||||
|
|
@ -334,7 +333,7 @@ public partial class ActorManager
|
|||
}
|
||||
case ObjectKind.MountType:
|
||||
case ObjectKind.Companion:
|
||||
case (ObjectKind)15: // TODO: CS Update
|
||||
case ObjectKind.Ornament:
|
||||
{
|
||||
owner = HandleCutscene(
|
||||
(FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject*)_objects.GetObjectAddress(actor->ObjectIndex - 1));
|
||||
|
|
@ -369,12 +368,12 @@ public partial class ActorManager
|
|||
/// Obtain the current companion ID for an object by its actor and owner.
|
||||
/// </summary>
|
||||
private unsafe uint GetCompanionId(FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject* actor,
|
||||
Character* owner) // TODO: CS Update
|
||||
Character* owner)
|
||||
{
|
||||
return (ObjectKind)actor->ObjectKind switch
|
||||
{
|
||||
ObjectKind.MountType => owner->Mount.MountId,
|
||||
(ObjectKind)15 => owner->Ornament.OrnamentId,
|
||||
ObjectKind.Ornament => owner->Ornament.OrnamentId,
|
||||
ObjectKind.Companion => actor->DataID,
|
||||
_ => actor->DataID,
|
||||
};
|
||||
|
|
@ -571,7 +570,7 @@ public partial class ActorManager
|
|||
{
|
||||
ObjectKind.MountType => Data.Mounts.ContainsKey(dataId),
|
||||
ObjectKind.Companion => Data.Companions.ContainsKey(dataId),
|
||||
(ObjectKind)15 => Data.Ornaments.ContainsKey(dataId), // TODO: CS Update
|
||||
ObjectKind.Ornament => Data.Ornaments.ContainsKey(dataId),
|
||||
ObjectKind.BattleNpc => Data.BNpcs.ContainsKey(dataId),
|
||||
_ => false,
|
||||
};
|
||||
|
|
@ -582,7 +581,7 @@ public partial class ActorManager
|
|||
{
|
||||
ObjectKind.MountType => Data.Mounts.ContainsKey(dataId),
|
||||
ObjectKind.Companion => Data.Companions.ContainsKey(dataId),
|
||||
(ObjectKind)15 => Data.Ornaments.ContainsKey(dataId), // TODO: CS Update
|
||||
ObjectKind.Ornament => Data.Ornaments.ContainsKey(dataId),
|
||||
ObjectKind.BattleNpc => Data.BNpcs.ContainsKey(dataId),
|
||||
ObjectKind.EventNpc => Data.ENpcs.ContainsKey(dataId),
|
||||
_ => false,
|
||||
|
|
|
|||
|
|
@ -138,6 +138,9 @@ public sealed class ItemData : DataSharer, IReadOnlyDictionary<FullEquipType, IR
|
|||
public IEnumerable<(uint, EquipItem)> AllItems(bool main)
|
||||
=> (main ? _mainItems : _offItems).Select(i => (i.Key, (EquipItem)i.Value));
|
||||
|
||||
public int TotalItemCount(bool main)
|
||||
=> main ? _mainItems.Count : _offItems.Count;
|
||||
|
||||
public bool TryGetValue(uint key, bool main, out EquipItem value)
|
||||
{
|
||||
var dict = main ? _mainItems : _offItems;
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ internal sealed class ObjectIdentification : DataSharer, IObjectIdentifier
|
|||
|
||||
var options = new ParallelOptions()
|
||||
{
|
||||
MaxDegreeOfParallelism = Environment.ProcessorCount / 2,
|
||||
MaxDegreeOfParallelism = Math.Max(1, Environment.ProcessorCount / 2),
|
||||
};
|
||||
|
||||
Parallel.ForEach(gameData.GetExcelSheet<BNpcBase>(language)!.Where(b => b.RowId < BnpcNames.Count), options, bNpc =>
|
||||
|
|
|
|||
|
|
@ -187,28 +187,28 @@ public static class FullEquipTypeExtensions
|
|||
FullEquipType.Scythe => "Scythe",
|
||||
FullEquipType.Nouliths => "Nouliths",
|
||||
FullEquipType.Shield => "Shield",
|
||||
FullEquipType.Saw => "Saw (Carpenter)",
|
||||
FullEquipType.CrossPeinHammer => "Hammer (Blacksmith)",
|
||||
FullEquipType.RaisingHammer => "Hammer (Armorsmith)",
|
||||
FullEquipType.LapidaryHammer => "Hammer (Goldsmith)",
|
||||
FullEquipType.Knife => "Knife (Leatherworker)",
|
||||
FullEquipType.Needle => "Needle (Weaver)",
|
||||
FullEquipType.Alembic => "Alembic (Alchemist)",
|
||||
FullEquipType.Frypan => "Frypan (Culinarian)",
|
||||
FullEquipType.Pickaxe => "Pickaxe (Miner)",
|
||||
FullEquipType.Hatchet => "Hatchet (Botanist)",
|
||||
FullEquipType.Saw => "Saw",
|
||||
FullEquipType.CrossPeinHammer => "Cross Pein Hammer",
|
||||
FullEquipType.RaisingHammer => "Raising Hammer",
|
||||
FullEquipType.LapidaryHammer => "Lapidary Hammer",
|
||||
FullEquipType.Knife => "Round Knife",
|
||||
FullEquipType.Needle => "Needle",
|
||||
FullEquipType.Alembic => "Alembic",
|
||||
FullEquipType.Frypan => "Frypan",
|
||||
FullEquipType.Pickaxe => "Pickaxe",
|
||||
FullEquipType.Hatchet => "Hatchet",
|
||||
FullEquipType.FishingRod => "Fishing Rod",
|
||||
FullEquipType.ClawHammer => "Clawhammer (Carpenter)",
|
||||
FullEquipType.File => "File (Blacksmith)",
|
||||
FullEquipType.Pliers => "Pliers (Armorsmith)",
|
||||
FullEquipType.GrindingWheel => "Grinding Wheel (Goldsmith)",
|
||||
FullEquipType.Awl => "Awl (Leatherworker)",
|
||||
FullEquipType.SpinningWheel => "Spinning Wheel (Weaver)",
|
||||
FullEquipType.Mortar => "Mortar (Alchemist)",
|
||||
FullEquipType.CulinaryKnife => "Knife (Culinarian)",
|
||||
FullEquipType.Sledgehammer => "Sledgehammer (Miner)",
|
||||
FullEquipType.GardenScythe => "Garden Scythe (Botanist)",
|
||||
FullEquipType.Gig => "Gig (Fisher)",
|
||||
FullEquipType.ClawHammer => "Clawhammer",
|
||||
FullEquipType.File => "File",
|
||||
FullEquipType.Pliers => "Pliers",
|
||||
FullEquipType.GrindingWheel => "Grinding Wheel",
|
||||
FullEquipType.Awl => "Awl",
|
||||
FullEquipType.SpinningWheel => "Spinning Wheel",
|
||||
FullEquipType.Mortar => "Mortar",
|
||||
FullEquipType.CulinaryKnife => "Culinary Knife",
|
||||
FullEquipType.Sledgehammer => "Sledgehammer",
|
||||
FullEquipType.GardenScythe => "Garden Scythe",
|
||||
FullEquipType.Gig => "Gig",
|
||||
_ => "Unknown",
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,9 @@ public readonly struct EquipItem
|
|||
Type = type;
|
||||
}
|
||||
|
||||
public string ModelString
|
||||
=> WeaponType == 0 ? $"{ModelId.Value}-{Variant}" : $"{ModelId.Value}-{WeaponType.Value}-{Variant}";
|
||||
|
||||
public static implicit operator EquipItem(PseudoEquipItem it)
|
||||
=> new(it.Item1, it.Item2, it.Item3, it.Item4, it.Item5, it.Item6, (FullEquipType)it.Item7);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue