Skip to content

Commit

Permalink
Merge pull request #211 from charles-m-knox/config-options-resizable-…
Browse files Browse the repository at this point in the history
…and-render-flames

Add config options: renderFlames and resizable
  • Loading branch information
Promises authored Sep 7, 2024
2 parents 4926d1d + b6f3065 commit ccf6397
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
2 changes: 2 additions & 0 deletions config/client-435.conf.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ game:
roofsEnabled: true
freeTeleports: false
debugContextMenu: true
renderFlames: true
resizable: false
shiftClickModifier: true
serverDisplayName: Build 435
16 changes: 15 additions & 1 deletion src/main/java/org/runejs/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public static void read() {
SOUND_MUTED = (boolean) game.get("soundMuted");
FREE_TELEPORTS = (boolean) game.get("freeTeleports");
DEBUG_CONTEXT = (boolean) game.get("debugContextMenu");
RESIZABLE = (boolean) game.get("resizable");
RENDER_FLAMES = (boolean) game.get("renderFlames");
SERVER_DISPLAY_NAME = (String) obj.get("serverDisplayName");

if (USERNAME == null) {
Expand Down Expand Up @@ -83,7 +85,8 @@ public static void read() {
game.put("freeTeleports", FREE_TELEPORTS);
game.put("debugContextMenu", DEBUG_CONTEXT);
game.put("soundMuted", SOUND_MUTED);

game.put("resizable", RESIZABLE);
game.put("renderFlames", RENDER_FLAMES);

Map<String, Object> clientConfig = new HashMap<String, Object>();
clientConfig.put("serverDisplayName", SERVER_DISPLAY_NAME);
Expand Down Expand Up @@ -186,6 +189,17 @@ public static void read() {
*/
public static boolean FREE_TELEPORTS = true;

/**
* Enable resizable mode
*/
public static boolean RESIZABLE = false;

/**
* Toggle rendering frames to reduce wasted processing power on the login
* screen
*/
public static boolean RENDER_FLAMES = true;

/**
* When rightclicking objects show id and location
*/
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/org/runejs/client/GameShell.java
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,14 @@ public void openClientApplet(String cacheFolder, int cacheIndexes, int fileStore
currentGameShell = this;
clientFrame = new Frame();
clientFrame.setTitle(Configuration.SERVER_DISPLAY_NAME);
ScreenController.frameMode(ScreenMode.FIXED);
if (Configuration.RESIZABLE == true) {
ScreenController.frameMode(ScreenMode.RESIZABLE);
clientFrame.setResizable(true);
} else {
ScreenController.frameMode(ScreenMode.FIXED);
clientFrame.setResizable(false);
}
clientFrame.setPreferredSize(new Dimension(width, height));
clientFrame.setResizable(ScreenController.frameMode == ScreenMode.RESIZABLE);
clientFrame.addWindowListener(this);
clientFrame.setVisible(true);
clientFrame.toFront();
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/runejs/client/LoginScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ public static void drawLoadingScreen(TypeFace fontBold, TypeFace fontSmall) {
Rasterizer.drawDiagonalLine(0,0, 42,42, 0xFF0000);
}

renderFlames();
if (Configuration.RENDER_FLAMES) {
renderFlames();
}

try {
int offsetX = 0;
Expand Down

0 comments on commit ccf6397

Please sign in to comment.