BeatmapDifficultyMethodsName.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using HarmonyLib;
  2. namespace SongCore.HarmonyPatches
  3. {
  4. [HarmonyPatch(typeof(BeatmapDifficultyMethods))]
  5. [HarmonyPatch("Name", MethodType.Normal)]
  6. public class BeatmapDifficultyMethodsName
  7. {
  8. static void Postfix(BeatmapDifficulty difficulty, ref string __result)
  9. {
  10. if (!Plugin.displayDiffLabels) return;
  11. if (difficulty == BeatmapDifficulty.Easy)
  12. {
  13. if (HarmonyPatches.StandardLevelDetailViewRefreshContent.currentLabels.EasyOverride != "")
  14. __result = HarmonyPatches.StandardLevelDetailViewRefreshContent.currentLabels.EasyOverride.Replace(@"<", "<\u200B").Replace(@">", ">\u200B");
  15. }
  16. if (difficulty == BeatmapDifficulty.Normal)
  17. {
  18. if (HarmonyPatches.StandardLevelDetailViewRefreshContent.currentLabels.NormalOverride != "")
  19. __result = HarmonyPatches.StandardLevelDetailViewRefreshContent.currentLabels.NormalOverride.Replace(@"<", "<\u200B").Replace(@">", ">\u200B");
  20. }
  21. if (difficulty == BeatmapDifficulty.Hard)
  22. {
  23. if (HarmonyPatches.StandardLevelDetailViewRefreshContent.currentLabels.HardOverride != "")
  24. __result = HarmonyPatches.StandardLevelDetailViewRefreshContent.currentLabels.HardOverride.Replace(@"<", "<\u200B").Replace(@">", ">\u200B");
  25. }
  26. if (difficulty == BeatmapDifficulty.Expert)
  27. {
  28. if (HarmonyPatches.StandardLevelDetailViewRefreshContent.currentLabels.ExpertOverride != "")
  29. __result = HarmonyPatches.StandardLevelDetailViewRefreshContent.currentLabels.ExpertOverride.Replace(@"<", "<\u200B").Replace(@">", ">\u200B");
  30. }
  31. if (difficulty == BeatmapDifficulty.ExpertPlus)
  32. {
  33. if (HarmonyPatches.StandardLevelDetailViewRefreshContent.currentLabels.ExpertPlusOverride != "")
  34. __result = HarmonyPatches.StandardLevelDetailViewRefreshContent.currentLabels.ExpertPlusOverride.Replace(@"<", "<\u200B").Replace(@">", ">\u200B");
  35. }
  36. // Console.WriteLine(__result);
  37. }
  38. }
  39. }