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

Embeds Redesign #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions huisbot/Utilities/Embeds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -507,24 +507,29 @@ public static Embed EffMissCount(int combo, int maxCombo, int sliderCount, int h
public static Embed DifficultyAttributes(HuisSimulationResponse score, HuisRework rework, OsuBeatmap beatmap)
{
// Construct some strings for the embed.
string difficulty = $"Aim: **{score.DifficultyAttributes.AimDifficulty:N2}★**\nSpeed: **{score.DifficultyAttributes.SpeedDifficulty:N2}★**";
difficulty += score.DifficultyAttributes.FlashlightDifficulty is null ? "" : $"\nFL: **{score.DifficultyAttributes.FlashlightDifficulty:N2}★**";
string difficulty = $"Aim: **{score.DifficultyAttributes.AimDifficulty:N2} ★**\n"
+ $"Speed: **{score.DifficultyAttributes.SpeedDifficulty:N2} ★**";
difficulty += score.DifficultyAttributes.FlashlightDifficulty is null ? "" : $"\nFL: **{score.DifficultyAttributes.FlashlightDifficulty:N2} ★**";
string strainCounts = $"Aim: **{score.DifficultyAttributes.AimDifficultStrainCount:N2}**\n"
+ $"Speed: **{score.DifficultyAttributes.SpeedDifficultStrainCount:N2}**";
string visualizer = $"[map visualizer](https://preview.tryz.id.vn/?b={beatmap.Id})";
string osu = $"[osu! page](https://osu.ppy.sh/b/{beatmap.Id})";
string huisRework = $"[Huis Rework]({rework.Url})";
string github = rework.CommitUrl is null ? "Source unavailable" : $"[Source]({rework.CommitUrl})";
string mapAttributes = $"Max Combo: **{beatmap.MaxCombo}x**\n"
+ $"Overall Difficulty: {beatmap.GetAdjustedOD(score.Score.Mods):0.##}\n"
+ $"Approach Rate: {beatmap.GetAdjustedAR(score.Score.Mods):0.##}";
string other = $"Speed Notes: {score.DifficultyAttributes.SliderFactor:N5}\n"
+ $"Slider Factor: {score.DifficultyAttributes.SliderFactor:N5}\n";
string advanced = $"[map visualizer](https://preview.tryz.id.vn/?b={beatmap.Id}) • ";
advanced += $"[Huis Rework]({rework.Url}) • ";
advanced += rework.CommitUrl is null ? "Source unavailable" : $"[Source]({rework.CommitUrl})";

return BaseEmbed
.WithColor(new Color(0x4061E9))
.WithTitle($"{beatmap.Artist} - {beatmap.Title} [{beatmap.Version}]{score.Score.Mods.PlusString} ({score.DifficultyAttributes.DifficultyRating:N2}★)")
.AddField("Difficulty", difficulty, true)
.AddField("Difficult Strains", strainCounts, true)
.AddField("Slider Factor", $"{score.DifficultyAttributes.SliderFactor:N5}", true)
.AddField($"Speed Notes: {score.DifficultyAttributes.SpeedNoteCount:N2}", visualizer, true)
.AddField($"Max Combo: {beatmap.MaxCombo}x", osu, true)
.AddField($"OD {beatmap.GetAdjustedOD(score.Score.Mods):0.##} AR {beatmap.GetAdjustedAR(score.Score.Mods):0.##}", $"{huisRework} • {github}", true)
.AddField(" ", " ", true)
.AddField("Map Attributes", mapAttributes, true)
.AddField("Other", other + advanced, true)
.AddField(" ", " ", true)
.WithUrl($"https://osu.ppy.sh/b/{beatmap.Id}")
.WithImageUrl($"https://assets.ppy.sh/beatmaps/{beatmap.SetId}/covers/[email protected]")
.WithFooter($"{rework.Name} • {BaseEmbed.Footer.Text}", BaseEmbed.Footer.IconUrl)
Expand Down