Skip to content

Commit ccf6397

Browse files
authored
Merge pull request #211 from charles-m-knox/config-options-resizable-and-render-flames
Add config options: renderFlames and resizable
2 parents 4926d1d + b6f3065 commit ccf6397

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

config/client-435.conf.example.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ game:
1414
roofsEnabled: true
1515
freeTeleports: false
1616
debugContextMenu: true
17+
renderFlames: true
18+
resizable: false
1719
shiftClickModifier: true
1820
serverDisplayName: Build 435

src/main/java/org/runejs/Configuration.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ public static void read() {
4343
SOUND_MUTED = (boolean) game.get("soundMuted");
4444
FREE_TELEPORTS = (boolean) game.get("freeTeleports");
4545
DEBUG_CONTEXT = (boolean) game.get("debugContextMenu");
46+
RESIZABLE = (boolean) game.get("resizable");
47+
RENDER_FLAMES = (boolean) game.get("renderFlames");
4648
SERVER_DISPLAY_NAME = (String) obj.get("serverDisplayName");
4749

4850
if (USERNAME == null) {
@@ -83,7 +85,8 @@ public static void read() {
8385
game.put("freeTeleports", FREE_TELEPORTS);
8486
game.put("debugContextMenu", DEBUG_CONTEXT);
8587
game.put("soundMuted", SOUND_MUTED);
86-
88+
game.put("resizable", RESIZABLE);
89+
game.put("renderFlames", RENDER_FLAMES);
8790

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

192+
/**
193+
* Enable resizable mode
194+
*/
195+
public static boolean RESIZABLE = false;
196+
197+
/**
198+
* Toggle rendering frames to reduce wasted processing power on the login
199+
* screen
200+
*/
201+
public static boolean RENDER_FLAMES = true;
202+
189203
/**
190204
* When rightclicking objects show id and location
191205
*/

src/main/java/org/runejs/client/GameShell.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,14 @@ public void openClientApplet(String cacheFolder, int cacheIndexes, int fileStore
241241
currentGameShell = this;
242242
clientFrame = new Frame();
243243
clientFrame.setTitle(Configuration.SERVER_DISPLAY_NAME);
244-
ScreenController.frameMode(ScreenMode.FIXED);
244+
if (Configuration.RESIZABLE == true) {
245+
ScreenController.frameMode(ScreenMode.RESIZABLE);
246+
clientFrame.setResizable(true);
247+
} else {
248+
ScreenController.frameMode(ScreenMode.FIXED);
249+
clientFrame.setResizable(false);
250+
}
245251
clientFrame.setPreferredSize(new Dimension(width, height));
246-
clientFrame.setResizable(ScreenController.frameMode == ScreenMode.RESIZABLE);
247252
clientFrame.addWindowListener(this);
248253
clientFrame.setVisible(true);
249254
clientFrame.toFront();

src/main/java/org/runejs/client/LoginScreen.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,9 @@ public static void drawLoadingScreen(TypeFace fontBold, TypeFace fontSmall) {
313313
Rasterizer.drawDiagonalLine(0,0, 42,42, 0xFF0000);
314314
}
315315

316-
renderFlames();
316+
if (Configuration.RENDER_FLAMES) {
317+
renderFlames();
318+
}
317319

318320
try {
319321
int offsetX = 0;

0 commit comments

Comments
 (0)