Skip to content

Commit 07d1371

Browse files
author
Henning Berge
committed
If password or username is too long, only draw end
1 parent ef0d819 commit 07d1371

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/main/java/com/jagex/runescape/scene/tile/WallDecoration.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,22 @@ public static void drawLoadingScreen(int arg0, TypeFace fontBold, TypeFace fontS
361361
fontBold.drawShadowedStringCenter(Native.loginScreenMessageLineThree, 180, y1, 16776960, true);
362362
y1 += 15;
363363
y1 += 10;
364-
fontBold.drawShadowedString(English.username + Native.username + (MovedStatics.pulseCycle % 40 < 20 & MovedStatics.loginScreenFocus == 0 ? Native.justAnotherYellowBar : ""), 90, y1, true, 16777215);
364+
int width = fontBold.getStringWidth(English.username + Native.username + Native.justAnotherYellowBar);
365+
int offset = 0;
366+
while (width > 250) {
367+
offset++;
368+
width = fontBold.getStringWidth(English.username + Native.username.substring(offset) + Native.justAnotherYellowBar);
369+
}
370+
fontBold.drawShadowedString(English.username + Native.username.substring(offset) + (MovedStatics.pulseCycle % 40 < 20 & MovedStatics.loginScreenFocus == 0 ? Native.justAnotherYellowBar : ""), 90, y1, true, 16777215);
365371
y1 += 15;
366-
fontBold.drawShadowedString(English.password + Native.password.method61() + (MovedStatics.pulseCycle % 40 < 20 & MovedStatics.loginScreenFocus == 1 ? Native.justAnotherYellowBar : ""), 92, y1, true, 16777215);
372+
String starredPassword = Native.password.method61().toString();
373+
width = fontBold.getStringWidth(English.password + starredPassword + Native.justAnotherYellowBar);
374+
offset = 0;
375+
while (width > 250) {
376+
offset++;
377+
width = fontBold.getStringWidth(English.password + starredPassword.substring(offset) + Native.justAnotherYellowBar);
378+
}
379+
fontBold.drawShadowedString(English.password + starredPassword.substring(offset) + (MovedStatics.pulseCycle % 40 < 20 & MovedStatics.loginScreenFocus == 1 ? Native.justAnotherYellowBar : ""), 92, y1, true, 16777215);
367380
Class59.imgLoginScreenButton.drawImage(-73 + drawX, y2 + -20);
368381
y1 += 15;
369382
fontBold.drawShadowedStringCenter(English.login, drawX, y2 + 5, 16777215, true);

0 commit comments

Comments
 (0)