Skip to content

Commit

Permalink
Fix TextMenu.Option right side is too wide
Browse files Browse the repository at this point in the history
TextMenu.Option render the right side with font size of 80%, but uses 100% when calculating the width, so the more characters, the bigger the error. This pr fixes the issue.
  • Loading branch information
DemoJameson committed Apr 17, 2023
1 parent 7acf2db commit c6e53fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Celeste.Mod.mm/Patches/TextMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ public override float RightWidth() {
List<string> currentContent = Values.Select(val => val.Item1).ToList();
if (!cachedRightWidthContent.SequenceEqual(currentContent)) {
// contents changed, or the width wasn't computed yet.
cachedRightWidth = orig_RightWidth();
cachedRightWidth = orig_RightWidth() * 0.8f + 44f;
cachedRightWidthContent = currentContent;
}
return cachedRightWidth;
Expand Down Expand Up @@ -558,7 +558,7 @@ public static void PatchTextMenuOptionColor(ILContext context, CustomAttribute a
cursor.Next.OpCode = OpCodes.Ldfld;
cursor.Next.Operand = f_UnselectedColor;
}

public static void PatchTextMenuSettingUpdate(ILContext il, CustomAttribute _) {
MethodReference m_MouseButtonsHash = il.Method.DeclaringType.FindMethod("_MouseButtonsHash");
FieldReference f_Binding_Mouse = MonoModRule.Modder.FindType("Monocle.Binding").Resolve().FindField("Mouse");
Expand Down

0 comments on commit c6e53fd

Please sign in to comment.