mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2026-08-01 14:39:16 -06:00
2009scape branding
This commit is contained in:
parent
ed4cae15e7
commit
1262d7cbd4
5 changed files with 81 additions and 47 deletions
|
|
@ -469,6 +469,7 @@ public abstract class GameShell extends Applet implements Runnable, FocusListene
|
|||
focus = focusIn;
|
||||
}
|
||||
this.mainLoop();
|
||||
setWindowTitle();
|
||||
}
|
||||
|
||||
public static GraphicsDevice getCurrentDevice() {
|
||||
|
|
@ -686,6 +687,7 @@ public abstract class GameShell extends Applet implements Runnable, FocusListene
|
|||
frame.setVisible(true);
|
||||
frame.setBackground(Color.black);
|
||||
frame.toFront();
|
||||
frame.setIconImage(new javax.swing.ImageIcon(getClass().getResource("/saradomin.png")).getImage());
|
||||
@Pc(44) Insets insets = frame.getInsets();
|
||||
frame.setSize(insets.left + frameWidth + insets.right, insets.top + frameHeight + insets.bottom);
|
||||
GameShell.setFpsTarget(getCurrentDevice().getDisplayMode().getRefreshRate());
|
||||
|
|
@ -700,6 +702,38 @@ public abstract class GameShell extends Applet implements Runnable, FocusListene
|
|||
}
|
||||
}
|
||||
|
||||
private void setWindowTitle() {
|
||||
if (GlobalJsonConfig.instance != null) {
|
||||
String modeString = "2009Scape [Local]";
|
||||
switch (GlobalJsonConfig.instance.ip_management) {
|
||||
case "play.2009scape.org":
|
||||
modeString = "2009Scape [Live]";
|
||||
break;
|
||||
case "test.2009scape.org":
|
||||
modeString = "2009Scape [Test]";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (PlayerList.self != null) {
|
||||
JagString name = PlayerList.self.username;
|
||||
if (name != null)
|
||||
modeString += " - " + name.toString();
|
||||
else modeString += " - At Login";
|
||||
}
|
||||
if (frame != null)
|
||||
frame.setTitle(modeString);
|
||||
}
|
||||
}
|
||||
|
||||
private final void configureTargetFPS() {
|
||||
int refreshRate = getCurrentDevice().getDisplayMode().getRefreshRate();
|
||||
if (refreshRate == java.awt.DisplayMode.REFRESH_RATE_UNKNOWN) {
|
||||
refreshRate = 60; //just assume 60hz and call it a day.
|
||||
}
|
||||
GameShell.setFpsTarget(refreshRate);
|
||||
}
|
||||
|
||||
@OriginalMember(owner = "client!rc", name = "windowOpened", descriptor = "(Ljava/awt/event/WindowEvent;)V")
|
||||
@Override
|
||||
public final void windowOpened(@OriginalArg(0) WindowEvent event) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue