mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix(bot): clean up hid padding code
This commit is contained in:
parent
80b685ae9b
commit
1f11dbf269
5 changed files with 24 additions and 14 deletions
|
|
@ -22,7 +22,7 @@ public static class HidUtils
|
|||
return hid != null;
|
||||
}
|
||||
|
||||
public static string HidTransform(string input, bool split, bool caps)
|
||||
public static string HidTransform(string input, bool split, bool caps, SystemConfig.HidPadFormat pad)
|
||||
{
|
||||
if (split && input.Length > 5)
|
||||
{
|
||||
|
|
@ -33,6 +33,19 @@ public static class HidUtils
|
|||
if (caps)
|
||||
input = input.ToUpper();
|
||||
|
||||
if (input.Length == 5)
|
||||
switch (pad)
|
||||
{
|
||||
case SystemConfig.HidPadFormat.Left:
|
||||
input = " " + input;
|
||||
if (split) input = " " + input;
|
||||
break;
|
||||
case SystemConfig.HidPadFormat.Right:
|
||||
input = input + " ";
|
||||
if (split) input = input + " ";
|
||||
break;
|
||||
}
|
||||
|
||||
return input;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue