Closed lyssieth closed 1 year ago
Looks like there's some problem rendering the Unicode "✔" and "✖" under wine. My quick hack to get it usable is just to patch the .dll:
#!/usr/bin/python3
with open('ToyBox.dll', 'rb+') as f:
c = f.read()
c = c.replace("<color=green><b>✔</b></color>".encode('utf-16-le'),
"<color=green><b>+</b></color>".encode('utf-16-le'))
f.seek(0)
f.truncate(0)
f.write(c)
I am not familiar enough with the internals of Unity modding to really advise about how to properly fix it, though.
If that's the case, I think installing a font which provides emojis should work? I'll do some testing first.
Okay, installing an emoji font didn't work.
However, here's my script for anyone that wants it:
#!/usr/bin/env python
with open('ToyBox.dll', 'rb+') as f:
c = f.read()
c = c.replace("<color=green><b>✔</b></color>".encode('utf-16-le'),
"<color=green><b>X</b></color>".encode('utf-16-le'))
c = c.replace("<color=#B8B8B8FF>✖</color>".encode('utf-16-le'),
"<color=#B8B8B8FF>-</color>".encode('utf-16-le'))
f.seek(0)
f.truncate(0)
f.write(c)
@lyssieth
I fixed your script and the bug is gone:
#!/usr/bin/env python
with open('ToyBox.dll', 'rb+') as f:
c = f.read()
c = c.replace("✔".encode('utf-16-le'),
"+".encode('utf-16-le'))
c = c.replace("✖".encode('utf-16-le'),
"-".encode('utf-16-le'))
f.seek(0)
f.truncate(0)
f.write(c)
This is caused by ✔ showing up in about 4 places in the source code.
https://github.com/cabarius/ToyBox/blob/master/ModKit/UI/GUIHelper.cs#L7 https://github.com/cabarius/ToyBox/blob/master/ModKit/UI/UI%2BControls.cs#L68 https://github.com/cabarius/ToyBox/blob/master/ModKit/UI/UI%2BElements.cs#7 https://github.com/cabarius/ToyBox/blob/master/ModKit/UI/UI%2BToggles.cs#14
One of them is not in the format of
<color=green><b>✔</b></color>
See https://github.com/cabarius/ToyBox/blob/master/ModKit/UI/UI%2BControls.cs#L68
if (GL.Button("✔".green(), GUI.skin.box, AutoWidth())
@lyssieth
I fixed your script and the bug is gone:
#!/usr/bin/env python with open('ToyBox.dll', 'rb+') as f: c = f.read() c = c.replace("✔".encode('utf-16-le'), "+".encode('utf-16-le')) c = c.replace("✖".encode('utf-16-le'), "-".encode('utf-16-le')) f.seek(0) f.truncate(0) f.write(c)
This is caused by heavy_check_mark showing up in about 4 places in the source code.
https://github.com/cabarius/ToyBox/blob/master/ModKit/UI/GUIHelper.cs#L7 https://github.com/cabarius/ToyBox/blob/master/ModKit/UI/UI%2BControls.cs#L68 https://github.com/cabarius/ToyBox/blob/master/ModKit/UI/UI%2BElements.cs#7 https://github.com/cabarius/ToyBox/blob/master/ModKit/UI/UI%2BToggles.cs#14
One of them is not in the format of
<color=green><b>✔</b></color>
See https://github.com/cabarius/ToyBox/blob/master/ModKit/UI/UI%2BControls.cs#L68
if (GL.Button("✔".green(), GUI.skin.box, AutoWidth())
That did it, my thanks to all of you!
@cabarius , I fixed this on ModKit solasta code base
I would propably remove all fancy characters, I know it won't look as good but it will be more portable:
public static string FormatOn = "▼".color(RGBA.white).Bold() + " {0}";
public static string FormatOff = "▶".color(RGBA.lime).Bold() + " {0}";
public static string FormatNone = " ▪".color(RGBA.white) + " {0}";
with simplier ascii ones like V
>
.
and so on, just a thought. And I totally understand if this is does not work, we are an odd usecase (I am using proton (wine)).
After failing to get the patch scripts working, I have found out that the font "Unifont" will display the characters. https://unifoundry.com/pub/unifont/unifont-13.0.06/font-builds/unifont-13.0.06.ttf
Any instructions on how to install this font? Where does Linux users should drop it?
For me at least if you open the font, whatever font viewer your distro uses should give you the option to install the font (I use Linux Mint so it has a font viewer installed by default). If you're using Wine, you should use Winetricks to install it.
This issue will be closed because it is older than a year. The here mentioned Bug/Feature might already be fixed or implemented. If the bug still persists/the Feature is still requested, please reopen the issue or create a new one.
Describe the bug Wherever there are toggles (I'm assuming they're meant to be checkboxes), there are just black lines which don't indicate their checked/unchecked state. (see screenshot)
To Reproduce
Expected behavior Checkboxes or toggle buttons with a clear indication of state
Save Files Save files aren't necessary, this is visible on the main menu as well.
Screenshots
Settings.xml Completely unchanged, file has not even been generated yet
Version Info:
Additional Notes: Unity Mod Manager was installed using 'Assembly' mode as that's recommended for Linux gaming.