Skip to content

Commit

Permalink
allow switching zelda/sheik
Browse files Browse the repository at this point in the history
fixes #56
  • Loading branch information
jmlee337 committed Jul 16, 2024
1 parent d9d8506 commit 20475ed
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/renderer/ReplayList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,27 @@ const ReplayListItem = memo(function ReplayListItem({
<Avatar
alt={characterNames.get(player.externalCharacterId)}
src={getCharacterIcon(player.externalCharacterId, player.costumeIndex)}
style={{ height: '24px', width: '24px' }}
variant="square"
/>
) : undefined;
const avatarButton = (player.externalCharacterId === 18 ||
player.externalCharacterId === 19) && (
<IconButton
onClick={(event) => {
event.preventDefault();
event.stopPropagation();
if (player.externalCharacterId === 18) {
player.externalCharacterId = 19;
} else {
player.externalCharacterId = 18;
}
onOverride();
}}
>
{avatar}
</IconButton>
);
const name =
player.playerType === 0
? player.connectCode || player.nametag || `P${key}`
Expand Down Expand Up @@ -234,7 +252,7 @@ const ReplayListItem = memo(function ReplayListItem({
return (
<DroppableChip
active={replay.selected}
avatar={avatar}
avatar={avatarButton || avatar}
key={key}
label={name}
outlined
Expand Down

0 comments on commit 20475ed

Please sign in to comment.