Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ネームプレートの同期がズレるのを修正した #743

Merged
merged 4 commits into from
Dec 29, 2023

Conversation

cma2819
Copy link
Member

@cma2819 cma2819 commented Dec 28, 2023

ネームプレートごとに gsap のタイムラインが存在するため、 徐々に同期がズレて異なる情報が表示されるようになってしまっていました

  • SyncDisplayProvider を用意して、どの情報を表示するかを graphics 内で統一した
  • 副作用的に 名前 => 名前と表示されるときもフェードを挟まないようになった

Comment on lines 14 to 39
const participantSocials = [
...(currentRun?.runners.map((runner) =>
[
runner.twitter ? "twitter" : null,
runner.twitch ? "twitch" : null,
runner.nico ? "nico" : null,
].filter((v): v is DisplayLabel => v !== null),
) ?? []),
...(currentRun?.commentators.map((commentator) =>
[
commentator?.twitter ? "twitter" : null,
commentator?.twitch ? "twitch" : null,
commentator?.nico ? "nico" : null,
].filter((v): v is DisplayLabel => v !== null),
) ?? []),
];

const displayTwitter = participantSocials.some((socials) =>
socials.includes("twitter"),
);
const displayTwitch = participantSocials.some((socials) =>
socials.includes("twitch"),
);
const displayNico = participantSocials.some((socials) =>
socials.includes("nico"),
);
Copy link
Member

@Hoishin Hoishin Dec 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const participants = [
  ...currentRun?.runners,
  ...currentRun?.commentators,
];

const displayTwitter = participants.some(p => Boolean(p.twitter))
const displayTwitch = participants.some(p => Boolean(p.twitch))
const displayNico = participants.some(p => Boolean(p.nico))

とかでいい感じしますがあってますか

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そんな感じがよさそうだったので直しました

@yagamuu yagamuu self-requested a review December 28, 2023 16:52
@yagamuu
Copy link
Member

yagamuu commented Dec 28, 2023

マージされたら#720 はクローズで良さそう?という共有

@cma2819 cma2819 merged commit 98c4910 into master Dec 29, 2023
1 check passed
@cma2819 cma2819 deleted the nameplate-desync branch December 29, 2023 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants