A RuneTek3 client (377) that is deobfuscated, converted to Kotlin, and includes QoL improvements.
0

Configure Feed

Select the types of activity you want to include in your feed.

Game: Refactored Method determineMenuSize

+69 -54
+69 -54
src/com/jagex/runescape/Game.java
··· 1502 1502 outBuffer.putLEShortDup(selectedInventorySlot); 1503 1503 } 1504 1504 } else if ((anInt1300 == 1 || menuHasAddFriend(menuActionRow - 1, aByte1161)) && menuActionRow > 2) 1505 - determineMenuSize(811); 1505 + determineMenuSize(); 1506 1506 else if (menuActionRow > 0) 1507 1507 processMenuActions(menuActionRow - 1); 1508 1508 atInventoryLoopCycle = 10; ··· 4260 4260 if (meta == 1 && menuActionRow > 0) 4261 4261 processMenuActions(menuActionRow - 1); 4262 4262 if (meta == 2 && menuActionRow > 0) 4263 - determineMenuSize(811); 4263 + determineMenuSize(); 4264 4264 } 4265 4265 } 4266 4266 ··· 8200 8200 anInt1246 = 0; 8201 8201 } 8202 8202 8203 - public void determineMenuSize(int i) { 8204 - int j = fontBold.getStringEffectWidth("Choose Option"); 8205 - for (int k = 0; k < menuActionRow; k++) { 8206 - int l = fontBold.getStringEffectWidth(menuActionTexts[k]); 8207 - if (l > j) 8208 - j = l; 8203 + private void determineMenuSize() { 8204 + int width = fontBold.getStringEffectWidth("Choose Option"); 8205 + 8206 + for (int i = 0; i < menuActionRow; i++) { 8207 + int rowWidth = fontBold.getStringEffectWidth(menuActionTexts[i]); 8208 + 8209 + if (rowWidth > width) 8210 + width = rowWidth; 8209 8211 } 8210 8212 8211 - j += 8; 8212 - if (i <= 0) 8213 - aBoolean1190 = !aBoolean1190; 8214 - int i1 = 15 * menuActionRow + 21; 8213 + width += 8; 8214 + int height = 15 * menuActionRow + 21; 8215 + 8215 8216 if (super.clickX > 4 && super.clickY > 4 && super.clickX < 516 && super.clickY < 338) { 8216 - int j1 = super.clickX - 4 - j / 2; 8217 - if (j1 + j > 512) 8218 - j1 = 512 - j; 8219 - if (j1 < 0) 8220 - j1 = 0; 8221 - int i2 = super.clickY - 4; 8222 - if (i2 + i1 > 334) 8223 - i2 = 334 - i1; 8224 - if (i2 < 0) 8225 - i2 = 0; 8217 + int x = super.clickX - 4 - width / 2; 8218 + 8219 + if (x + width > 512) 8220 + x = 512 - width; 8221 + if (x < 0) 8222 + x = 0; 8223 + 8224 + int y = super.clickY - 4; 8225 + 8226 + if (y + height > 334) 8227 + y = 334 - height; 8228 + if (y < 0) 8229 + y = 0; 8230 + 8226 8231 menuOpen = true; 8227 8232 anInt1304 = 0; 8228 - menuClickX = j1; 8229 - menuClickY = i2; 8230 - anInt1307 = j; 8231 - anInt1308 = 15 * menuActionRow + 22; 8233 + menuClickX = x; 8234 + menuClickY = y; 8235 + anInt1307 = width; 8236 + anInt1308 = height + 1; 8232 8237 } 8238 + 8233 8239 if (super.clickX > 553 && super.clickY > 205 && super.clickX < 743 && super.clickY < 466) { 8234 - int k1 = super.clickX - 553 - j / 2; 8235 - if (k1 < 0) 8236 - k1 = 0; 8237 - else if (k1 + j > 190) 8238 - k1 = 190 - j; 8239 - int j2 = super.clickY - 205; 8240 - if (j2 < 0) 8241 - j2 = 0; 8242 - else if (j2 + i1 > 261) 8243 - j2 = 261 - i1; 8240 + int x = super.clickX - 553 - width / 2; 8241 + 8242 + if (x < 0) 8243 + x = 0; 8244 + else if (x + width > 190) 8245 + x = 190 - width; 8246 + 8247 + int y = super.clickY - 205; 8248 + 8249 + if (y < 0) 8250 + y = 0; 8251 + else if (y + height > 261) 8252 + y = 261 - height; 8253 + 8244 8254 menuOpen = true; 8245 8255 anInt1304 = 1; 8246 - menuClickX = k1; 8247 - menuClickY = j2; 8248 - anInt1307 = j; 8249 - anInt1308 = 15 * menuActionRow + 22; 8256 + menuClickX = x; 8257 + menuClickY = y; 8258 + anInt1307 = width; 8259 + anInt1308 = height + 1; 8250 8260 } 8261 + 8251 8262 if (super.clickX > 17 && super.clickY > 357 && super.clickX < 496 && super.clickY < 453) { 8252 - int l1 = super.clickX - 17 - j / 2; 8253 - if (l1 < 0) 8254 - l1 = 0; 8255 - else if (l1 + j > 479) 8256 - l1 = 479 - j; 8257 - int k2 = super.clickY - 357; 8258 - if (k2 < 0) 8259 - k2 = 0; 8260 - else if (k2 + i1 > 96) 8261 - k2 = 96 - i1; 8263 + int x = super.clickX - 17 - width / 2; 8264 + 8265 + if (x < 0) 8266 + x = 0; 8267 + else if (x + width > 479) 8268 + x = 479 - width; 8269 + 8270 + int y = super.clickY - 357; 8271 + 8272 + if (y < 0) 8273 + y = 0; 8274 + else if (y + height > 96) 8275 + y = 96 - height; 8276 + 8262 8277 menuOpen = true; 8263 8278 anInt1304 = 2; 8264 - menuClickX = l1; 8265 - menuClickY = k2; 8266 - anInt1307 = j; 8267 - anInt1308 = 15 * menuActionRow + 22; 8279 + menuClickX = x; 8280 + menuClickY = y; 8281 + anInt1307 = width; 8282 + anInt1308 = height + 1; 8268 8283 } 8269 8284 } 8270 8285