Some more general cleanup.

This commit is contained in:
Ottermandias 2021-07-27 00:13:36 +02:00
parent 44fc83784d
commit 3679b780cf
13 changed files with 116 additions and 111 deletions

View file

@ -111,9 +111,9 @@ namespace Penumbra.Meta.Files
EquipSlot.Hands => 2,
EquipSlot.Wrists => 2,
EquipSlot.Legs => 3,
EquipSlot.RingR => 3,
EquipSlot.RFinger => 3,
EquipSlot.Feet => 4,
EquipSlot.RingL => 4,
EquipSlot.LFinger => 4,
_ => throw new InvalidEnumArgumentException(),
};
}

View file

@ -71,8 +71,8 @@ namespace Penumbra.Meta.Files
EquipSlot.Neck => Eqdp( ObjectType.Accessory, gr ),
EquipSlot.Ears => Eqdp( ObjectType.Accessory, gr ),
EquipSlot.Wrists => Eqdp( ObjectType.Accessory, gr ),
EquipSlot.RingL => Eqdp( ObjectType.Accessory, gr ),
EquipSlot.RingR => Eqdp( ObjectType.Accessory, gr ),
EquipSlot.LFinger => Eqdp( ObjectType.Accessory, gr ),
EquipSlot.RFinger => Eqdp( ObjectType.Accessory, gr ),
_ => throw new NotImplementedException(),
};
}

View file

@ -27,10 +27,10 @@ namespace Penumbra.UI
return;
}
var actors = ( Dictionary< string, CharEquipment >? )_plugin.PlayerWatcher.GetType()
var actors = ( Dictionary< string, ActorEquipment >? )_plugin.PlayerWatcher.GetType()
.GetField( "_equip", BindingFlags.Instance | BindingFlags.NonPublic )
?.GetValue( _plugin.PlayerWatcher )
?? new Dictionary< string, CharEquipment >();
?? new Dictionary< string, ActorEquipment >();
if( !actors.Any() )
{
return;
@ -48,7 +48,7 @@ namespace Penumbra.UI
ImGui.TableNextColumn();
ImGui.Text( actor.Key );
ImGui.TableNextColumn();
ImGui.Text( $"{actor.Value.Mainhand}" );
ImGui.Text( $"{actor.Value.MainHand}" );
ImGui.TableNextColumn();
ImGui.Text( $"{actor.Value.Head}" );
ImGui.TableNextColumn();
@ -67,7 +67,7 @@ namespace Penumbra.UI
ImGui.Text( "(not set)" );
}
ImGui.TableNextColumn();
ImGui.Text( identifier.Identify( actor.Value.Mainhand.Set, actor.Value.Mainhand.Type, actor.Value.Mainhand.Variant, EquipSlot.MainHand )?.Name.ToString() ?? "Unknown" );
ImGui.Text( identifier.Identify( actor.Value.MainHand.Set, actor.Value.MainHand.Type, actor.Value.MainHand.Variant, EquipSlot.MainHand )?.Name.ToString() ?? "Unknown" );
ImGui.TableNextColumn();
ImGui.Text( identifier.Identify( actor.Value.Head.Set, actor.Value.Head.Variant, 0, EquipSlot.Head )?.Name.ToString() ?? "Unknown" );
ImGui.TableNextColumn();
@ -82,13 +82,13 @@ namespace Penumbra.UI
ImGui.TableNextRow();
ImGui.TableNextColumn();
ImGui.TableNextColumn();
ImGui.Text( $"{actor.Value.Offhand}" );
ImGui.Text( $"{actor.Value.OffHand}" );
ImGui.TableNextColumn();
ImGui.Text( $"{actor.Value.Ear}" );
ImGui.Text( $"{actor.Value.Ears}" );
ImGui.TableNextColumn();
ImGui.Text( $"{actor.Value.Neck}" );
ImGui.TableNextColumn();
ImGui.Text( $"{actor.Value.Wrist}" );
ImGui.Text( $"{actor.Value.Wrists}" );
ImGui.TableNextColumn();
ImGui.Text( $"{actor.Value.LFinger}" );
ImGui.TableNextColumn();
@ -97,17 +97,17 @@ namespace Penumbra.UI
ImGui.TableNextRow();
ImGui.TableNextColumn();
ImGui.TableNextColumn();
ImGui.Text( identifier.Identify( actor.Value.Offhand.Set, actor.Value.Offhand.Type, actor.Value.Offhand.Variant, EquipSlot.Offhand )?.Name.ToString() ?? "Unknown" );
ImGui.Text( identifier.Identify( actor.Value.OffHand.Set, actor.Value.OffHand.Type, actor.Value.OffHand.Variant, EquipSlot.OffHand )?.Name.ToString() ?? "Unknown" );
ImGui.TableNextColumn();
ImGui.Text( identifier.Identify( actor.Value.Ear.Set, actor.Value.Ear.Variant, 0, EquipSlot.Ears )?.Name.ToString() ?? "Unknown" );
ImGui.Text( identifier.Identify( actor.Value.Ears.Set, actor.Value.Ears.Variant, 0, EquipSlot.Ears )?.Name.ToString() ?? "Unknown" );
ImGui.TableNextColumn();
ImGui.Text( identifier.Identify( actor.Value.Neck.Set, actor.Value.Neck.Variant, 0, EquipSlot.Neck )?.Name.ToString() ?? "Unknown" );
ImGui.TableNextColumn();
ImGui.Text( identifier.Identify( actor.Value.Wrist.Set, actor.Value.Wrist.Variant, 0, EquipSlot.Wrists )?.Name.ToString() ?? "Unknown" );
ImGui.Text( identifier.Identify( actor.Value.Wrists.Set, actor.Value.Wrists.Variant, 0, EquipSlot.Wrists )?.Name.ToString() ?? "Unknown" );
ImGui.TableNextColumn();
ImGui.Text( identifier.Identify( actor.Value.LFinger.Set, actor.Value.LFinger.Variant, 0, EquipSlot.RingL )?.Name.ToString() ?? "Unknown" );
ImGui.Text( identifier.Identify( actor.Value.LFinger.Set, actor.Value.LFinger.Variant, 0, EquipSlot.LFinger )?.Name.ToString() ?? "Unknown" );
ImGui.TableNextColumn();
ImGui.Text( identifier.Identify( actor.Value.RFinger.Set, actor.Value.RFinger.Variant, 0, EquipSlot.RingL )?.Name.ToString() ?? "Unknown" );
ImGui.Text( identifier.Identify( actor.Value.RFinger.Set, actor.Value.RFinger.Variant, 0, EquipSlot.LFinger )?.Name.ToString() ?? "Unknown" );
// @formatter:on
}

View file

@ -51,8 +51,8 @@ namespace Penumbra.UI
( "Ears", EquipSlot.Ears ),
( "Neck", EquipSlot.Neck ),
( "Wrist", EquipSlot.Wrists ),
( "Left Finger", EquipSlot.RingL ),
( "Right Finger", EquipSlot.RingR ),
( "Left Finger", EquipSlot.LFinger ),
( "Right Finger", EquipSlot.RFinger ),
};
private static readonly (string, Race)[] Races =
@ -308,8 +308,8 @@ namespace Penumbra.UI
EquipSlot.Neck => ( entry.HasFlag( EqdpEntry.Neck1 ), entry.HasFlag( EqdpEntry.Neck2 ) ),
EquipSlot.Ears => ( entry.HasFlag( EqdpEntry.Ears1 ), entry.HasFlag( EqdpEntry.Ears2 ) ),
EquipSlot.Wrists => ( entry.HasFlag( EqdpEntry.Wrists1 ), entry.HasFlag( EqdpEntry.Wrists2 ) ),
EquipSlot.RingR => ( entry.HasFlag( EqdpEntry.RingR1 ), entry.HasFlag( EqdpEntry.RingR2 ) ),
EquipSlot.RingL => ( entry.HasFlag( EqdpEntry.RingL1 ), entry.HasFlag( EqdpEntry.RingL2 ) ),
EquipSlot.RFinger => ( entry.HasFlag( EqdpEntry.RingR1 ), entry.HasFlag( EqdpEntry.RingR2 ) ),
EquipSlot.LFinger => ( entry.HasFlag( EqdpEntry.RingL1 ), entry.HasFlag( EqdpEntry.RingL2 ) ),
_ => ( false, false ),
};
}
@ -350,11 +350,11 @@ namespace Penumbra.UI
value = bit1 ? value | EqdpEntry.Wrists1 : value & ~EqdpEntry.Wrists1;
value = bit2 ? value | EqdpEntry.Wrists2 : value & ~EqdpEntry.Wrists2;
return value;
case EquipSlot.RingR:
case EquipSlot.RFinger:
value = bit1 ? value | EqdpEntry.RingR1 : value & ~EqdpEntry.RingR1;
value = bit2 ? value | EqdpEntry.RingR2 : value & ~EqdpEntry.RingR2;
return value;
case EquipSlot.RingL:
case EquipSlot.LFinger:
value = bit1 ? value | EqdpEntry.RingL1 : value & ~EqdpEntry.RingL1;
value = bit2 ? value | EqdpEntry.RingL2 : value & ~EqdpEntry.RingL2;
return value;