mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: new rating stat style
This commit is contained in:
1 parent
3b94034767
commit
298b89b227
5 files changed
+40
-28
No files matched your search
@@ -17,7 +17,7 @@ import { CommandRegistry } from '../events/interactionCreate';
|
||||
export const ratingStatsCommand = new Promise<CommandRegistry>((resolve) => {
|
||||
resolve({
|
||||
command:
|
||||
createLocalizedCommand('rating-stats').addStringOption(
|
||||
createLocalizedCommand('rating-session').addStringOption(
|
||||
addUsernameChoices,
|
||||
),
|
||||
|
||||
@@ -43,12 +43,13 @@ export const ratingStatsCommand = new Promise<CommandRegistry>((resolve) => {
|
||||
const [statsB2] = (await getRatingNeighbors(region, id, 0)).neighbors;
|
||||
|
||||
if (!statsA) {
|
||||
return t`bot.commands.rating_stats.errors.unrecorded_stats`;
|
||||
return t`bot.commands.rating_session.errors.unrecorded_stats`;
|
||||
}
|
||||
if (!statsB1) {
|
||||
return translate('bot.commands.rating_stats.errors.no_participation', [
|
||||
markdownEscape(accountInfo.nickname),
|
||||
]);
|
||||
return translate(
|
||||
'bot.commands.rating_session.errors.no_participation',
|
||||
[markdownEscape(accountInfo.nickname)],
|
||||
);
|
||||
}
|
||||
|
||||
const delta = deltaBkrlBlitzStats(statsA, accountInfo.statistics.rating!);
|
||||
@@ -58,7 +59,7 @@ export const ratingStatsCommand = new Promise<CommandRegistry>((resolve) => {
|
||||
<TitleBar
|
||||
title={accountInfo.nickname}
|
||||
// image={clanImage} // TODO: add league icon here
|
||||
description={t`bot.commands.rating_stats.body.subtitle`}
|
||||
description={t`bot.commands.rating_session.body.subtitle`}
|
||||
/>
|
||||
|
||||
{delta.battles === 0 && (
|
||||
@@ -19,7 +19,6 @@ export function HeroStat({ stats, locale }: WN8DisplayProps) {
|
||||
let color: string;
|
||||
let heroStat: string | number;
|
||||
let subtitle: string | number | undefined;
|
||||
let subtitleImage: string | undefined;
|
||||
|
||||
if (stats.type === 'random') {
|
||||
const percentile =
|
||||
@@ -44,41 +43,52 @@ export function HeroStat({ stats, locale }: WN8DisplayProps) {
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
gap: -16,
|
||||
gap: stats.type === 'rating' ? -20 : -16,
|
||||
}}
|
||||
>
|
||||
<Glow color={color} />
|
||||
|
||||
<div
|
||||
style={{
|
||||
width: 128,
|
||||
height: 80,
|
||||
width: stats.type === 'rating' ? 112 : 128,
|
||||
height: stats.type === 'rating' ? 112 : 80,
|
||||
backgroundColor: color,
|
||||
borderRadius: 40,
|
||||
borderRadius: stats.type === 'rating' ? 8 : 40,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
gap: -4,
|
||||
transform: stats.type === 'rating' ? 'rotate(45deg)' : '',
|
||||
}}
|
||||
>
|
||||
<span
|
||||
<div
|
||||
style={{
|
||||
fontWeight: 900,
|
||||
fontSize: 32,
|
||||
color: theme.colors.textHighContrast,
|
||||
transform: stats.type === 'rating' ? 'rotate(-45deg)' : '',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
}}
|
||||
>
|
||||
{heroStat}
|
||||
</span>
|
||||
<span
|
||||
style={{
|
||||
fontSize: 16,
|
||||
color: theme.colors.textHighContrast,
|
||||
}}
|
||||
>
|
||||
{subtitle}
|
||||
</span>
|
||||
<span
|
||||
style={{
|
||||
fontWeight: 900,
|
||||
fontSize: 32,
|
||||
color: theme.colors.textHighContrast,
|
||||
}}
|
||||
>
|
||||
{heroStat}
|
||||
</span>
|
||||
<span
|
||||
style={{
|
||||
fontSize: 16,
|
||||
color: theme.colors.textHighContrast,
|
||||
}}
|
||||
>
|
||||
{subtitle}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Glow color={color} direction="reverse" />
|
||||
|
||||
@@ -33,6 +33,7 @@ export default function AllStatsOverview({
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: -64,
|
||||
width: '100%',
|
||||
}}
|
||||
|
||||
@@ -26,7 +26,7 @@ import { permissionsCommand } from '../../commands/permissions';
|
||||
import { pingCommand } from '../../commands/ping';
|
||||
import { playerInfoCommand } from '../../commands/playerInfo';
|
||||
import { ratingLeaderboardCommand } from '../../commands/ratingLeaderboard';
|
||||
import { ratingStatsCommand } from '../../commands/ratingStats';
|
||||
import { ratingStatsCommand } from '../../commands/ratingSession';
|
||||
import { researchCommand } from '../../commands/research';
|
||||
import { searchClansCommand } from '../../commands/searchClans';
|
||||
import { searchPlayersCommand } from '../../commands/searchPlayers';
|
||||
|
||||
+2
-2
@@ -541,8 +541,8 @@
|
||||
}
|
||||
},
|
||||
|
||||
"rating_stats": {
|
||||
"$": "rating-stats",
|
||||
"rating_session": {
|
||||
"$": "rating-session",
|
||||
"description": "Rating player's statistics",
|
||||
|
||||
"body": {
|
||||
|
||||
Reference in new issue
Block a user