26.03.2016, 16:59
(
Последний раз редактировалось lucesita; 15.10.2016 в 16:35.
)
example code:
this is what i get:
In global textdraw there are a space between "e" and "с" (contrase сa instead of contraseсa), but in perplayer version it gets displayed fine. This is why i think that the problem is when decoding the string from the jvm, because it happens only on global version (which uses a different way to get the string)
Код:
import net.gtaun.shoebill.common.StringUtils; import net.gtaun.shoebill.constant.TextDrawAlign; import net.gtaun.shoebill.constant.TextDrawFont; import net.gtaun.shoebill.data.Color; import net.gtaun.shoebill.event.player.PlayerConnectEvent; import net.gtaun.shoebill.object.Player; import net.gtaun.shoebill.object.PlayerTextdraw; import net.gtaun.shoebill.object.Textdraw; import net.gtaun.shoebill.object.TextdrawBase; import net.gtaun.shoebill.resource.Gamemode; /** * @author lucesita */ public class TextdrawTestGM extends Gamemode { private final String latinString = "Recuperar contraseсa"; @Override protected void onEnable() throws Throwable { getEventManager().registerHandler(PlayerConnectEvent.class, e -> { Player player = e.getPlayer(); player.toggleSpectating(true); // Remove spawn buttons PlayerTextdraw playerTD; playerTD = PlayerTextdraw.create(player, 222.363342f, 30.930297f); playerTD.setLetterSize(0.227482f, 1.369498f); playerTD.setTextSize(40.000000f, 115.287612f); playerTD.setAlignment(TextDrawAlign.get(2)); playerTD.setColor(new Color(-1)); playerTD.setUseBox(true); playerTD.setBoxColor(new Color(84215240)); playerTD.setShadowSize(0); playerTD.setOutlineSize(0); playerTD.setBackgroundColor(new Color(255)); playerTD.setFont(TextDrawFont.get(1)); playerTD.setProportional(true); playerTD.setSelectable(true); playerTD.show(); Textdraw globalTD; globalTD = Textdraw.create(222.363342f, 400.930297f); globalTD.setLetterSize(0.227482f, 1.369498f); globalTD.setTextSize(40.000000f, 115.287612f); globalTD.setAlignment(TextDrawAlign.get(2)); globalTD.setColor(new Color(-1)); globalTD.setUseBox(true); globalTD.setBoxColor(new Color(84215240)); globalTD.setShadowSize(0); globalTD.setOutlineSize(0); globalTD.setBackgroundColor(new Color(255)); globalTD.setFont(TextDrawFont.get(1)); globalTD.setProportional(true); globalTD.setSelectable(true); globalTD.show(player); // 2 tds showed, global at screen bottom, perplayer at screen top playerTD.setText(StringUtils.convertStringForTextdraw("playerTD: " + latinString)); globalTD.setText(StringUtils.convertStringForTextdraw("globalTD: " + latinString)); }); } @Override protected void onDisable() throws Throwable { } }
In global textdraw there are a space between "e" and "с" (contrase сa instead of contraseсa), but in perplayer version it gets displayed fine. This is why i think that the problem is when decoding the string from the jvm, because it happens only on global version (which uses a different way to get the string)