Some fixes (#359)

- Added message of the week to welcome screen interface
- Added face north when clicking compass
- Disabled the blank tab on game frame
- Fixed all of the dialogue issues I could find in rune mysteries
- Fixed a few typos and did a very minor clean up in the dialogue file still a lot more planned soon
- Disabled resizable on the client seeing as it doesnt work correct currently anyways
This commit is contained in:
Mr Extremez
2020-01-08 17:27:59 -06:00
committed by Daniel Ginovker
parent b1eaacf93c
commit db1f5ed785
22 changed files with 268 additions and 289 deletions
+78 -96
View File
@@ -29,7 +29,13 @@ import java.util.Date;
*/
@SuppressWarnings("serial")
public class Game extends RSApplet {
private boolean graphicsEnabled = true;
public static int random(final float range) {
return (int) (java.lang.Math.random() * (range + 1));
}
public static String intToKOrMilLongName(int i) {
String s = String.valueOf(i);
@@ -522,9 +528,9 @@ public class Game extends RSApplet {
}
}
public void processMenuClick() {
public boolean processMenuClick() {
if (activeInterfaceType != 0) {
return;
return false;
}
int j = super.clickMode3;
if (spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205) {
@@ -614,7 +620,7 @@ public class Game extends RSApplet {
if (RSInterface.interfaceCache[j2].parentID == backDialogID) {
activeInterfaceType = 3;
}
return;
return true;
}
}
}
@@ -628,6 +634,7 @@ public class Game extends RSApplet {
determineMenuSize();
}
}
return false;
}
public void saveMidi(boolean flag, byte abyte0[]) {
@@ -3049,8 +3056,7 @@ public class Game extends RSApplet {
inputTaken = true;
super.clickMode3 = 0;
}
processMenuClick();
if (fullScreenBackDialogID == -1) {
if (!processMenuClick()) {
processMainScreenClick();
processTabClick();
processChatModeClick();
@@ -3453,6 +3459,10 @@ public class Game extends RSApplet {
if (l >= 2000) {
l -= 2000;
}
if (l == 696) {
minimapInt1 = 0;
anInt1184 = 120;
}
if (l == 582) {
NPC npc = npcArray[i1];
if (npc != null) {
@@ -4763,7 +4773,7 @@ public class Game extends RSApplet {
inputDialogState = 0;
inputTaken = true;
}
} else if (backDialogID == -1 && fullScreenBackDialogID == -1) {
} else {
if (j >= 32 && j <= 122 && inputString.length() < 80) {
inputString += (char) j;
inputTaken = true;
@@ -5345,6 +5355,16 @@ public class Game extends RSApplet {
chatNames[0] = s1;
chatMessages[0] = s;
}
public void processMinimapActions() {
int x = super.mouseX;
int y = super.mouseY;
if (x >= 551 && x <= 577 && y >= 7 && y <= 40) {
menuActionName[1] = "Face North";
menuActionID[1] = 696;
menuActionRow = 2;
}
}
public void processTabClick() {
if (super.clickMode3 == 1) {
@@ -5383,11 +5403,11 @@ public class Game extends RSApplet {
tabID = 6;
tabAreaAltered = true;
}
if (super.saveClickX >= 540 && super.saveClickX <= 574 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[7] != -1) {
/*if (super.saveClickX >= 540 && super.saveClickX <= 574 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[7] != -1) {
needDrawTabArea = true;
tabID = 7;
tabAreaAltered = true;
}
}*/
if (super.saveClickX >= 572 && super.saveClickX <= 602 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1) {
needDrawTabArea = true;
tabID = 8;
@@ -5541,9 +5561,9 @@ public class Game extends RSApplet {
menuActionName[0] = "Cancel";
menuActionID[0] = 1107;
menuActionRow = 1;
if(fullScreenBackDialogID != -1) {
if (fullScreenInterfaceId != -1) {
anInt886 = 0;
buildInterfaceMenu(0, RSInterface.interfaceCache[fullScreenBackDialogID], super.mouseX, 0, super.mouseY, 0);
buildInterfaceMenu(0, RSInterface.interfaceCache[fullScreenInterfaceId], super.mouseX, 0, super.mouseY, 0);
if (anInt886 != anInt1026) {
anInt1026 = anInt886;
}
@@ -5587,6 +5607,7 @@ public class Game extends RSApplet {
inputTaken = true;
anInt1039 = anInt886;
}
processMinimapActions();
boolean flag = false;
while (!flag) {
flag = true;
@@ -5763,7 +5784,6 @@ public class Game extends RSApplet {
backDialogID = -1;
openInterfaceID = -1;
invOverlayInterfaceID = -1;
fullScreenBackDialogID = -1;
fullScreenInterfaceId = -1;
anInt1018 = -1;
aBoolean1149 = false;
@@ -7466,9 +7486,9 @@ public class Game extends RSApplet {
}
public void drawGameScreen() {
if (fullScreenBackDialogID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
if (fullScreenInterfaceId != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
if (loadingStage == 2) {
method119(anInt945, fullScreenBackDialogID);
method119(anInt945, fullScreenInterfaceId);
if (fullScreenInterfaceId != -1)
method119(anInt945, fullScreenInterfaceId);
anInt945 = 0;
@@ -7477,15 +7497,8 @@ public class Game extends RSApplet {
Texture.lineOffsets = gameScreenOffsets;
DrawingArea.setAllPixelsToZero();
welcomeScreenRaised = true;
RSInterface rSInterface = RSInterface.interfaceCache[fullScreenBackDialogID];
if (rSInterface.width == 512 && rSInterface.height == 334
&& rSInterface.type == 0) {
rSInterface.width = 765;
rSInterface.height = 503;
}
drawInterface(0, 0, rSInterface, 0);
if (fullScreenInterfaceId != -1) {
RSInterface class13_1 = RSInterface.interfaceCache[fullScreenInterfaceId];
if (openInterfaceID != -1) {
RSInterface class13_1 = RSInterface.interfaceCache[openInterfaceID];
if (class13_1.width == 512 && class13_1.height == 334
&& class13_1.type == 0) {
class13_1.width = 765;
@@ -7493,6 +7506,13 @@ public class Game extends RSApplet {
}
drawInterface(0, 0, class13_1, 0);
}
RSInterface rSInterface = RSInterface.interfaceCache[fullScreenInterfaceId];
if (rSInterface.width == 512 && rSInterface.height == 334
&& rSInterface.type == 0) {
rSInterface.width = 765;
rSInterface.height = 503;
}
drawInterface(0, 0, rSInterface, 0);
if (!menuOpen) {
processRightClick();
drawTooltip();
@@ -8468,10 +8488,12 @@ public class Game extends RSApplet {
if (anInt1055 == 1) {
multiOverlay.drawSprite(472, 296);
}
int k = 20;
int i1 = 0xffff00;
int x = baseX + (myPlayer.x - 6 >> 7);
int y = baseY + (myPlayer.y - 6 >> 7);
if (fpsOn) {
char c = '\u01FB';
int k = 20;
int i1 = 0xffff00;
if (super.fps < 15) {
i1 = 0xff0000;
}
@@ -8486,6 +8508,20 @@ public class Game extends RSApplet {
aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
k += 15;
}
if (showInfo) {
if (super.fps < 15)
i1 = 0xff0000;
aTextDrawingArea_1271.method385(0xffff00, "Fps:" + super.fps, 285, 5);
Runtime runtime = Runtime.getRuntime();
int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
i1 = 0xffff00;
if (j1 > 0x2000000 && lowMem)
i1 = 0xff0000;
k += 15;
aTextDrawingArea_1271.method385(0xffff00, "Mem:" + j1 + "k", 299, 5);
aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
}
if (anInt1104 != 0) {
int j = anInt1104 / 50;
int l = j / 60;
@@ -10867,10 +10903,6 @@ public class Game extends RSApplet {
backDialogID = -1;
inputTaken = true;
}
if (fullScreenBackDialogID != -1) {
fullScreenBackDialogID = -1;
welcomeScreenRaised = true;
}
if (fullScreenInterfaceId != -1) {
fullScreenInterfaceId = -1;
}
@@ -11002,10 +11034,6 @@ public class Game extends RSApplet {
backDialogID = -1;
inputTaken = true;
}
if (fullScreenBackDialogID != -1) {
fullScreenBackDialogID = -1;
welcomeScreenRaised = true;
}
if (fullScreenInterfaceId != -1) {
fullScreenInterfaceId = -1;
}
@@ -11067,9 +11095,6 @@ public class Game extends RSApplet {
if (backDialogID != -1) {
backDialogID = -1;
}
if (fullScreenBackDialogID != k15) {
fullScreenBackDialogID = k15;
}
if (fullScreenInterfaceId != k15) {
fullScreenInterfaceId = k9;
}
@@ -11201,61 +11226,31 @@ public class Game extends RSApplet {
backDialogID = -1;
inputTaken = true;
}
if (fullScreenBackDialogID != -1) {
fullScreenBackDialogID = -1;
welcomeScreenRaised = true;
}
if (fullScreenInterfaceId != -1) {
fullScreenInterfaceId = -1;
}
/*if (openInterfaceID != l7) {
openInterfaceID = l7;
}*/
if (inputDialogState != 0) {
inputDialogState = 0;
inputTaken = true;
}
/*
* 15244 = main Interface ID
* 17511 = Question Type
* 15819 = Christmas Type
* 15812 = Security Type
* 15801 = Item Scam Type
* 15791 = Password Safety
* 15774 = Good/Bad Password
* 15767 = Drama Type
*/
// 17511 = Question Type
// 15819 = Christmas Type
// 15812 = Security Type
// 15801 = Item Scam Type
// 15791 = Password Safety ?
// 15774 = Good/Bad Password
// 15767 = Drama Type ????
int[] welcome = {17511, 15812, 15801, 15791, 15774, 15767};
if (l7 == 15244) {
openInterfaceID = 15812;//secondary/bottom part
fullScreenBackDialogID = 15244;
/*} else if (l7 == 17511) {
openInterfaceID = 17511;
fullScreenBackDialogID = 15244;
} else if (l7 == 15819) {
openInterfaceID = 15819;
fullScreenBackDialogID = 15244;
} else if (l7 == 15812) {
openInterfaceID = 15812;
fullScreenBackDialogID = 15244;
} else if (l7 == 15801) {
openInterfaceID = 15801;
fullScreenBackDialogID = 15244;
} else if (l7 == 15791) {
openInterfaceID = 15791;
fullScreenBackDialogID = 15244;
} else if (l7 == 15774) {
openInterfaceID = 15774;
fullScreenBackDialogID = 15244;
} else if (l7 == 15767) {
openInterfaceID = 15767;
fullScreenBackDialogID = 15244;*/
} else {
openInterfaceID = l7;
}
if (Flo.getTodaysDate().contains(ClientSettings.SNOW_MONTH)) {
openInterfaceID = welcome[random(5)];
} else {
openInterfaceID = welcome[random(5)];
}
fullScreenInterfaceId = 15244;
} else {
openInterfaceID = l7;
}
aBoolean1149 = false;
pktType = -1;
return true;
return true;
}
if (pktType == 218) {
int i8 = inStream.method438();
@@ -11321,10 +11316,6 @@ public class Game extends RSApplet {
backDialogID = -1;
inputTaken = true;
}
if (fullScreenBackDialogID != -1) {
fullScreenBackDialogID = -1;
welcomeScreenRaised = true;
}
if (fullScreenInterfaceId != -1) {
fullScreenInterfaceId = -1;
}
@@ -11378,10 +11369,6 @@ public class Game extends RSApplet {
needDrawTabArea = true;
tabAreaAltered = true;
}
if (fullScreenBackDialogID != -1) {
fullScreenBackDialogID = -1;
welcomeScreenRaised = true;
}
if (fullScreenInterfaceId != -1) {
fullScreenInterfaceId = -1;
}
@@ -11514,10 +11501,6 @@ public class Game extends RSApplet {
inputTaken = true;
aBoolean1149 = false;
}
if (fullScreenBackDialogID != -1) {
fullScreenBackDialogID = -1;
welcomeScreenRaised = true;
}
if (fullScreenInterfaceId != -1) {
fullScreenInterfaceId = -1;
}
@@ -11721,7 +11704,6 @@ public class Game extends RSApplet {
public static int anInt854;
public int anInt855;
public int openInterfaceID;
public int fullScreenBackDialogID = -1;
public int fullScreenInterfaceId = -1;
public int xCameraPos;
public int zCameraPos;