Commit 9c3500f9 authored by Scott T's avatar Scott T

Merge runecrafting with current source

parents 3e29ede9 207dc520
......@@ -10,11 +10,11 @@ import android.view.View.OnKeyListener;
import android.view.View.OnTouchListener;
import orsc.Config;
import orsc.enumerations.MessageTab;
import orsc.graphics.two.Fonts;
import orsc.mudclient;
import static orsc.Config.C_LAST_ZOOM;
import static orsc.Config.S_ZOOM_VIEW_TOGGLE;
public class InputImpl implements OnGestureListener, OnKeyListener, OnTouchListener {
......@@ -80,37 +80,42 @@ public class InputImpl implements OnGestureListener, OnKeyListener, OnTouchListe
lastScrollOrRotate = System.currentTimeMillis();
// Disables zoom while visible
if (mudclient.auctionHouse.isVisible() || mudclient.onlineList.isVisible() || mudclient.skillGuideInterface.isVisible()
|| mudclient.questGuideInterface.isVisible() || mudclient.clan.getClanInterface().isVisible() || mudclient.experienceConfigInterface.isVisible()
|| mudclient.ironmanInterface.isVisible() || mudclient.achievementInterface.isVisible() || mudclient.doSkillInterface.isVisible()
|| mudclient.lostOnDeathInterface.isVisible() || mudclient.territorySignupInterface.isVisible() || mudclient.messageTabSelected != MessageTab.ALL)
return false;
if (mudclient.showUiTab == 0) {
if(Config.S_ZOOM_VIEW_TOGGLE || mudclient.getLocalPlayer().isStaff()) {
if(Config.C_SWIPE_TO_ZOOM) {
int zoomDistance = (int) (-distanceY * 5);
int newZoom = C_LAST_ZOOM + zoomDistance;
// Keep C_LAST_ZOOM aka the zoom increments on the range of [0, 255]
if (newZoom >= 0 && newZoom <= 255) {
C_LAST_ZOOM = newZoom;
// We probably want to send this on the client tick rather than each time a button is pressed
mudclient.saveZoomDistance();
}
}
}
else if(mudclient.cameraAllowPitchModification) {
mudclient.cameraPitch = (mudclient.cameraPitch + (int)(-distanceY * 10)) & 1023;
}
if (Config.C_SWIPE_TO_ROTATE) {
float clientDist = distanceX / (getWidth() / (float) mudclient.getGameWidth())
* 0.5F;
mudclient.cameraRotation = (255 & mudclient.cameraRotation + (int) (clientDist));
}
return true;
if (Config.S_ZOOM_VIEW_TOGGLE || mudclient.getLocalPlayer().isStaff()) {
if (Config.C_SWIPE_TO_ZOOM) {
int zoomDistance = (int) (-distanceY * 5);
int newZoom = C_LAST_ZOOM + zoomDistance;
// Keep C_LAST_ZOOM aka the zoom increments on the range of [0, 255]
if (newZoom >= 0 && newZoom <= 255) {
C_LAST_ZOOM = newZoom;
// We probably want to send this on the client tick rather than each time a button is pressed
mudclient.saveZoomDistance();
}
}
} else if (mudclient.cameraAllowPitchModification) {
mudclient.cameraPitch = (mudclient.cameraPitch + (int) (-distanceY * 10)) & 1023;
}
if (Config.C_SWIPE_TO_ROTATE) {
float clientDist = distanceX / (getWidth() / (float) mudclient.getGameWidth())
* 0.5F;
mudclient.cameraRotation = (255 & mudclient.cameraRotation + (int) (clientDist));
}
return true;
} else if (Config.C_SWIPE_TO_SCROLL) {
mudclient.runScroll((int) distanceY);
return true;
}
else if(Config.C_SWIPE_TO_SCROLL) {
mudclient.runScroll((int) distanceY);
return true;
}
return true;
return true;
}
@Override
......@@ -138,17 +143,17 @@ public class InputImpl implements OnGestureListener, OnKeyListener, OnTouchListe
}
// If we are not volume to rotate, then we are volume to zoom...
else {
if(Config.S_ZOOM_VIEW_TOGGLE) {
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
mudclient.keyUp = event.getAction() == KeyEvent.ACTION_DOWN;
return true;
}
if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
mudclient.keyDown = event.getAction() == KeyEvent.ACTION_DOWN;
return true;
}
}
}
if (Config.S_ZOOM_VIEW_TOGGLE) {
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
mudclient.keyUp = event.getAction() == KeyEvent.ACTION_DOWN;
return true;
}
if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
mudclient.keyDown = event.getAction() == KeyEvent.ACTION_DOWN;
return true;
}
}
}
if (event.getAction() == KeyEvent.ACTION_DOWN) {
int key = event.getUnicodeChar();
......
......@@ -44,7 +44,7 @@ public class Config {
public static final String DL_URL = "androidcheck.openrsc.com"; // needs to be set as public for the Android client to use
public static final String ANDROID_DOWNLOAD_PATH = "https://" + DL_URL + "/downloads/";
public static final String CACHE_URL = "https://" + DL_URL + "/downloads/cache/";
public static final int ANDROID_CLIENT_VERSION = 40; // Important! Depends on web server android_version.txt to check for an updated version
public static final int ANDROID_CLIENT_VERSION = 43; // Important! Depends on web server android_version.txt to check for an updated version
public static boolean F_SHOWING_KEYBOARD = false;
public static boolean C_HOLD_AND_CHOOSE = true;
public static int C_LONG_PRESS_TIMER = 5; // default hold timer setting
......
......@@ -501,7 +501,7 @@ public final class mudclient implements Runnable {
private int messageTabActivity_Private = 0;
private int messageTabActivity_Clan = 0;
private int messageTabActivity_Quest = 0;
private MessageTab messageTabSelected = MessageTab.ALL;
public MessageTab messageTabSelected = MessageTab.ALL;
private int midRegionBaseX;
private int midRegionBaseZ;
private int minimapRandom_1 = 0;
......@@ -648,20 +648,20 @@ public final class mudclient implements Runnable {
private int flag = 0;
private Timer tiktok = new Timer();
private NComponent mainComponent;
private OnlineListInterface onlineList;
public OnlineListInterface onlineList;
private NCustomComponent experienceOverlay;
private ProgressBarInterface batchProgressBar;
private BankPinInterface bankPinInterface;
private FishingTrawlerInterface fishingTrawlerInterface;
private AchievementGUI achievementInterface;
private IronManInterface ironmanInterface;
private AuctionHouse auctionHouse;
private SkillGuideInterface skillGuideInterface;
private QuestGuideInterface questGuideInterface;
private ExperienceConfigInterface experienceConfigInterface;
private DoSkillInterface doSkillInterface;
private LostOnDeathInterface lostOnDeathInterface;
private TerritorySignupInterface territorySignupInterface;
public AchievementGUI achievementInterface;
public IronManInterface ironmanInterface;
public AuctionHouse auctionHouse;
public SkillGuideInterface skillGuideInterface;
public QuestGuideInterface questGuideInterface;
public ExperienceConfigInterface experienceConfigInterface;
public DoSkillInterface doSkillInterface;
public LostOnDeathInterface lostOnDeathInterface;
public TerritorySignupInterface territorySignupInterface;
private String skillGuideChosen;
private String questGuideChosen;
private int questGuideProgress;
......@@ -2075,7 +2075,6 @@ public final class mudclient implements Runnable {
private void createMessageTabPanel(int var1) {
try {
this.panelMessageTabs = new Panel(this.getSurface(), 10);
this.panelMessageChat = this.panelMessageTabs.addScrollingList2(5, 269, 502, var1, 20, 1, true);
this.panelMessageEntry = this.panelMessageTabs.addLeftTextEntry(7, 324, 498, 14, 1, 80, false, true);
......@@ -4953,6 +4952,7 @@ public final class mudclient implements Runnable {
if (isAndroid() && Config.S_WANT_PLAYER_COMMANDS) { // on screen buttons for various player chat commands
if (F_SHOWING_KEYBOARD) {
C_SIDE_MENU_OVERLAY = false;
int uiX = 5;
int uiY = 5;
int uiWidth = 60;
......@@ -15228,7 +15228,6 @@ public final class mudclient implements Runnable {
panelMessageTabs.scrollMethodList(panelMessagePrivate, x);
else if (this.messageTabSelected == MessageTab.CLAN && !this.controlPressed)
panelMessageTabs.scrollMethodList(panelMessageClan, x);
//else if ();
}
private boolean isShowDialogBank() {
......
package com.openrsc.interfaces.misc.clan;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import orsc.Config;
import orsc.enumerations.InputXAction;
import orsc.enumerations.MenuItemAction;
......@@ -11,11 +16,6 @@ import orsc.graphics.gui.SocialLists;
import orsc.graphics.two.GraphicsController;
import orsc.mudclient;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
public final class ClanInterface {
public int clanGUIScroll;
public int clanSearchScroll;
......@@ -23,18 +23,15 @@ public final class ClanInterface {
public int clanName_field;
public int clanTag_field;
public int clanSearch_field;
public int selectedClanMate = -1;
public int selectedClanInSearch = -1;
public ArrayList<ClanResult> readClans;
private int selectedClanMate = -1;
private int selectedClanInSearch = -1;
private ArrayList<ClanResult> readClans;
public Panel clanSetupPanel;
Comparator<ClanResult> clanComperator = new Comparator<ClanResult>() {
@Override
public int compare(ClanResult o1, ClanResult o2) {
if (o1.getClanPoints() == o2.getClanPoints()) {
return o1.getClanName().compareTo(o2.getClanName());
}
return o1.getClanPoints() > o2.getClanPoints() ? -1 : 1;
private Comparator<ClanResult> clanComperator = (o1, o2) -> {
if (o1.getClanPoints() == o2.getClanPoints()) {
return o1.getClanName().compareTo(o2.getClanName());
}
return o1.getClanPoints() > o2.getClanPoints() ? -1 : 1;
};
private mudclient mc;
private int x, y;
......@@ -49,7 +46,7 @@ public final class ClanInterface {
private String[] clanMateTable = {"Username", "Rank", "Kills", "Deaths", "Ratio"};
private Menu rightClickMenu;
public ClanInterface(mudclient mc) {
ClanInterface(mudclient mc) {
this.mc = mc;
width = 408;
......@@ -58,7 +55,7 @@ public final class ClanInterface {
x = (mc.getGameWidth() / 2) - width;
y = (mc.getGameHeight() / 2) - height;
readClans = new ArrayList<ClanResult>();
readClans = new ArrayList<>();
clanSetupPanel = new Panel(mc.getSurface(), 15);
rightClickMenu = new Menu(mc.getSurface(), 1, "@ora@Choose Option");
......@@ -96,14 +93,14 @@ public final class ClanInterface {
return true;
}
public void drawClanMates(GraphicsController graphics) {
private void drawClanMates(GraphicsController graphics) {
clanSetupPanel.clearList(clanGUIScroll);
clanSetupPanel.show(clanGUIScroll);
int leftBoxW = 402;
int leftBoxH = 113;
int boxWidth = (int) (397);
int boxHeight = (int) (22);
int boxWidth = 397;
int boxHeight = 22;
int newX = x + 4;
int newY = y + 82;
......@@ -142,7 +139,7 @@ public final class ClanInterface {
break;
}
clanSetupPanel.setListEntry(clanGUIScroll, i + 1, "", 0, (String) null, (String) null);
clanSetupPanel.setListEntry(clanGUIScroll, i + 1, "", 0, null, null);
if (i < listStartPoint || i > listEndPoint)
continue;
......@@ -214,7 +211,7 @@ public final class ClanInterface {
clanSetupPanel.drawPanel();
}
public void drawInvite(GraphicsController graphics) {
private void drawInvite(GraphicsController graphics) {
clanSetupPanel.hide(clanGUIScroll);
clanSetupPanel.hide(clanSearchScroll);
int leftBoxW = width - 88;
......@@ -244,7 +241,7 @@ public final class ClanInterface {
});
}
public void drawClanMain(GraphicsController graphics) {
private void drawClanMain(GraphicsController graphics) {
clanSetupPanel.hide(clanGUIScroll);
clanSetupPanel.hide(clanSearchScroll);
clanSetupPanel.hide(clanName_field);
......@@ -352,8 +349,8 @@ public final class ClanInterface {
int width = 200;
int height = 28;
int boxWidth = (int) (387);
int boxHeight = (int) (32);
int boxWidth = 387;
int boxHeight = 32;
int newX = x + 4;
int newY = y + 96;
......@@ -426,7 +423,7 @@ public final class ClanInterface {
break;
}
graphics.drawString("Displaying search results For: " + (!searchTerm.isEmpty() ? "\"" + searchTerm.toLowerCase() + "\"" : "ALL") + " (" + (filteredList.size()) + ")", x + 5, y + 90, 0xf1f1f1, 0);
clanSetupPanel.setListEntry(clanSearchScroll, i + 1, "", 0, (String) null, (String) null);
clanSetupPanel.setListEntry(clanSearchScroll, i + 1, "", 0, null, null);
if (i < listStartPoint || i > listEndPoint)
continue;
......@@ -469,7 +466,7 @@ public final class ClanInterface {
clanSetupPanel.drawPanel();
}
public void drawClanSetup(GraphicsController graphics) {
private void drawClanSetup(GraphicsController graphics) {
int leftBoxW = 196;
int leftBoxH = 184;
if (mc.clan.inClan()) {
......@@ -697,7 +694,7 @@ public final class ClanInterface {
if (clickedIndex >= 0) {
mc.mouseButtonClick = 0;
menu_visible = false;
MenuItemAction act = this.rightClickMenu.getItemAction((int) clickedIndex);
MenuItemAction act = this.rightClickMenu.getItemAction(clickedIndex);
if (act == MenuItemAction.CLAN_PROMOTE) {
if (clickedIndex == 1) {
clickedIndex = 2;
......@@ -736,7 +733,7 @@ public final class ClanInterface {
selectedClanInSearch = -1;
}
public void resetAfterCreation() {
private void resetAfterCreation() {
clanActiveInterface = 1;
clanSetupPanel.setText(clanName_field, "");
clanSetupPanel.setText(clanTag_field, "");
......@@ -745,7 +742,7 @@ public final class ClanInterface {
clanSetupPanel.setFocus(-1);
}
protected void sendCreateClan(String name, String tag) {
private void sendCreateClan(String name, String tag) {
getClient().packetHandler.getClientStream().newPacket(199);
getClient().packetHandler.getClientStream().writeBuffer1.putByte(11);
getClient().packetHandler.getClientStream().writeBuffer1.putByte(0);
......@@ -765,7 +762,7 @@ public final class ClanInterface {
resetAll();
}
protected void sendClanAccept() {
private void sendClanAccept() {
getClient().packetHandler.getClientStream().newPacket(199);
getClient().packetHandler.getClientStream().writeBuffer1.putByte(11);
getClient().packetHandler.getClientStream().writeBuffer1.putByte(3);
......@@ -774,7 +771,7 @@ public final class ClanInterface {
resetAll();
}
protected void sendClanDecline() {
private void sendClanDecline() {
getClient().packetHandler.getClientStream().newPacket(199);
getClient().packetHandler.getClientStream().writeBuffer1.putByte(11);
getClient().packetHandler.getClientStream().writeBuffer1.putByte(4);
......@@ -783,7 +780,7 @@ public final class ClanInterface {
resetAll();
}
protected void sendClanRank(String playerName, int rank) {
private void sendClanRank(String playerName, int rank) {
getClient().packetHandler.getClientStream().newPacket(199);
getClient().packetHandler.getClientStream().writeBuffer1.putByte(11);
getClient().packetHandler.getClientStream().writeBuffer1.putByte(6);
......@@ -792,7 +789,7 @@ public final class ClanInterface {
getClient().packetHandler.getClientStream().finishPacket();
}
protected void sendClanSettings(int settingMode, int state) {
private void sendClanSettings(int settingMode, int state) {
getClient().packetHandler.getClientStream().newPacket(199);
getClient().packetHandler.getClientStream().writeBuffer1.putByte(11);
getClient().packetHandler.getClientStream().writeBuffer1.putByte(7);
......@@ -850,7 +847,7 @@ public final class ClanInterface {
private int membersTotal, clanPoints, canJoin, clanID, clanRank;
private String[] clanSearchSettings = {"@gr2@Anyone can join", "@yel@Invite only", "@red@Closed"};
public ClanResult(int clanID, String clanName, String clanTag, int members, int canJoin, int clanPoints, int clanRank) {
ClanResult(int clanID, String clanName, String clanTag, int members, int canJoin, int clanPoints, int clanRank) {
this.clanID = clanID;
this.clanName = clanName;
this.clanTag = clanTag;
......@@ -860,15 +857,15 @@ public final class ClanInterface {
this.clanRank = clanRank;
}
public int getClanGlobalRank() {
int getClanGlobalRank() {
return clanRank;
}
public String getClanSearchSettingByName(int i) {
String getClanSearchSettingByName(int i) {
return clanSearchSettings[i];
}
public int getClanPoints() {
int getClanPoints() {
return clanPoints;
}
......@@ -892,7 +889,7 @@ public final class ClanInterface {
this.clanTag = tag;
}
public int getClanMembersTotal() {
int getClanMembersTotal() {
return membersTotal;
}
}
......
......@@ -44,7 +44,7 @@ public class Config {
public static final String DL_URL = "game.openrsc.com"; // needs to be set as public for the Android client to use
public static final String ANDROID_DOWNLOAD_PATH = "https://" + DL_URL + "/downloads/";
public static final String CACHE_URL = "https://" + DL_URL + "/downloads/cache/";
public static final int ANDROID_CLIENT_VERSION = 40; // Important! Depends on web server android_version.txt to check for an updated version
public static final int ANDROID_CLIENT_VERSION = 43; // Important! Depends on web server android_version.txt to check for an updated version
public static boolean F_SHOWING_KEYBOARD = false;
public static boolean C_HOLD_AND_CHOOSE = true;
public static int C_LONG_PRESS_TIMER = 5; // default hold timer setting
......
package orsc;
import com.openrsc.client.model.Sprite;
import orsc.graphics.two.Fonts;
import orsc.multiclient.ClientPort;
import orsc.util.GenUtil;
import javax.imageio.ImageIO;
import javax.swing.*;
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.awt.AWTException;
import java.awt.Color;
import java.awt.Event;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.MouseInfo;
import java.awt.Robot;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import java.awt.image.BufferedImage;
import java.awt.image.DirectColorModel;
import java.awt.image.ImageConsumer;
import java.awt.image.ImageObserver;
import java.awt.image.ImageProducer;
import java.io.ByteArrayInputStream;
import javax.imageio.ImageIO;
import javax.swing.SwingUtilities;
import orsc.enumerations.MessageTab;
import orsc.graphics.two.Fonts;
import orsc.multiclient.ClientPort;
import orsc.util.GenUtil;
import static orsc.Config.C_LAST_ZOOM;
import static orsc.Config.S_ZOOM_VIEW_TOGGLE;
......@@ -176,7 +200,7 @@ public class ORSCApplet extends Applet implements MouseListener, MouseMotionList
mudclient.chatMessageInputCommit = mudclient.chatMessageInput;
}
if(keyCode == KeyEvent.VK_ALT) {
if (keyCode == KeyEvent.VK_ALT) {
mudclient.mouseLastProcessedX = mudclient.mouseX;
mudclient.mouseLastProcessedY = mudclient.mouseY;
}
......@@ -199,7 +223,7 @@ public class ORSCApplet extends Applet implements MouseListener, MouseMotionList
if (keyCode == KeyEvent.VK_PAGE_DOWN) mudclient.pageDown = false;
if (keyCode == KeyEvent.VK_PAGE_UP) mudclient.pageUp = false;
if(keyCode == KeyEvent.VK_ALT) {
if (keyCode == KeyEvent.VK_ALT) {
mudclient.mouseLastProcessedX = 0;
mudclient.mouseLastProcessedY = 0;
}
......@@ -267,15 +291,14 @@ public class ORSCApplet extends Applet implements MouseListener, MouseMotionList
mudclient.lastMouseAction = 0;
mudclient.currentMouseButtonDown = 0;
if(mudclient.mouseLastProcessedX != 0 && mudclient.mouseLastProcessedY != 0) {
if (mudclient.mouseLastProcessedX != 0 && mudclient.mouseLastProcessedY != 0) {
int distanceX = mudclient.mouseX - mudclient.mouseLastProcessedX;
int distanceY = mudclient.mouseY - mudclient.mouseLastProcessedY;
if (mudclient.showUiTab == 0) {
if((Config.S_ZOOM_VIEW_TOGGLE || mudclient.getLocalPlayer().isStaff()) && !var1.isControlDown()) {
if(Config.C_SWIPE_TO_ZOOM) {
int zoomDistance = distanceY;
int newZoom = C_LAST_ZOOM + zoomDistance;
if ((Config.S_ZOOM_VIEW_TOGGLE || mudclient.getLocalPlayer().isStaff()) && !var1.isControlDown()) {
if (Config.C_SWIPE_TO_ZOOM) {
int newZoom = C_LAST_ZOOM + distanceY;
// Keep C_LAST_ZOOM aka the zoom increments on the range of [0, 255]
if (newZoom >= 0 && newZoom <= 255) {
C_LAST_ZOOM = newZoom;
......@@ -283,25 +306,22 @@ public class ORSCApplet extends Applet implements MouseListener, MouseMotionList
mudclient.saveZoomDistance();
}
}
}
else if(mudclient.cameraAllowPitchModification) {
mudclient.cameraPitch = (mudclient.cameraPitch + (int)(-distanceY * 2)) & 1023;
} else if (mudclient.cameraAllowPitchModification) {
mudclient.cameraPitch = (mudclient.cameraPitch + (-distanceY * 2)) & 1023;
// Limit on the half circled where everything is right side up
if(mudclient.cameraPitch > 256 && mudclient.cameraPitch <= 512)
if (mudclient.cameraPitch > 256 && mudclient.cameraPitch <= 512)
mudclient.cameraPitch = 256;
if(mudclient.cameraPitch < 768 && mudclient.cameraPitch > 512)
if (mudclient.cameraPitch < 768 && mudclient.cameraPitch > 512)
mudclient.cameraPitch = 768;
}
if (Config.C_SWIPE_TO_ROTATE) {
float clientDist = distanceX / (getWidth() / (float) mudclient.getGameWidth());
mudclient.cameraRotation = (255 & mudclient.cameraRotation + (int) (clientDist));
}
}
else if(true|| Config.C_SWIPE_TO_SCROLL) {
mudclient.runScroll((int) distanceY);
} else {
mudclient.runScroll(distanceY);
}
// To make the mouse move:
......@@ -312,8 +332,9 @@ public class ORSCApplet extends Applet implements MouseListener, MouseMotionList
try {
Robot robot = new Robot();
//robot.mouseMove((int)getLocationOnScreen().getX() + mudclient.mouseLastProcessedX, (int)getLocationOnScreen().getY() + mudclient.mouseLastProcessedY);
robot.mouseMove((int)MouseInfo.getPointerInfo().getLocation().getX() - distanceX, (int)MouseInfo.getPointerInfo().getLocation().getY() - distanceY);
} catch (AWTException e) { }
robot.mouseMove((int) MouseInfo.getPointerInfo().getLocation().getX() - distanceX, (int) MouseInfo.getPointerInfo().getLocation().getY() - distanceY);
} catch (AWTException ignored) {
}
}
} catch (RuntimeException var3) {
throw GenUtil.makeThrowable(var3, "e.mouseMoved(" + (var1 != null ? "{...}" : "null") + ')');
......@@ -354,18 +375,25 @@ public class ORSCApplet extends Applet implements MouseListener, MouseMotionList
public final synchronized void mouseWheelMoved(MouseWheelEvent e) {
updateControlShiftState(e);
mudclient.runScroll(e.getWheelRotation());
// Disables zoom while visible
if (mudclient.auctionHouse.isVisible() || mudclient.onlineList.isVisible() || mudclient.skillGuideInterface.isVisible()
|| mudclient.questGuideInterface.isVisible() || mudclient.clan.getClanInterface().isVisible() || mudclient.experienceConfigInterface.isVisible()
|| mudclient.ironmanInterface.isVisible() || mudclient.achievementInterface.isVisible() || mudclient.doSkillInterface.isVisible()
|| mudclient.lostOnDeathInterface.isVisible() || mudclient.territorySignupInterface.isVisible() || mudclient.messageTabSelected != MessageTab.ALL)
return;
if (mudclient.showUiTab == 0 && (S_ZOOM_VIEW_TOGGLE || mudclient.getLocalPlayer().isStaff())) {
e.consume();
final int zoomIncrement = 10;
int zoomAmount = e.getWheelRotation() * zoomIncrement;
int newZoom = C_LAST_ZOOM + zoomAmount;
int zoomAmount = e.getWheelRotation() * zoomIncrement;
int newZoom = C_LAST_ZOOM + zoomAmount;
// Keep C_LAST_ZOOM aka the zoom increments on the range of [0, 255]
if (newZoom >= 0 && newZoom <= 255) {
C_LAST_ZOOM = newZoom;
// We probably want to send this on the client tick rather than each time a button is pressed
mudclient.saveZoomDistance();
}
return;
}
}
......
......@@ -2,11 +2,11 @@ package orsc.graphics.gui;
import com.openrsc.client.entityhandling.EntityHandler;
import com.openrsc.client.model.Sprite;
import orsc.MiscFunctions;
import orsc.enumerations.PanelControlType;
import orsc.graphics.two.Fonts;
import orsc.graphics.two.GraphicsController;
import orsc.mudclient;
import orsc.util.FastMath;
import orsc.util.GenUtil;
......@@ -277,7 +277,6 @@ public final class Panel {
public final int addScrollingList2(int x, int y, int width, int height, int maxSize, int font, boolean altColor) {
try {
this.controlType[this.controlCount] = PanelControlType.SCROLLING_LIST_2;
this.controlVisible[this.controlCount] = true;
this.controlClicked[this.controlCount] = false;
......@@ -826,7 +825,7 @@ public final class Panel {
barDraggerSize = 6;
}
int barDraggerY = (height - 27 - barDraggerSize) * scroll / (entryCount - maxLines);
int barDraggerY;
if (this.currentMouseButtonDown == 1 && this.currMouseX >= scrollBarStartX
&& 12 + scrollBarStartX >= this.currMouseX) {
if (y < this.currMouseY && this.currMouseY < 12 + y && scroll > 0) {
......@@ -931,7 +930,7 @@ public final class Panel {
barDraggerSize = 6;
}
int barDraggerY = (height - 27 - (spaceHeightText + spaceHeight) - barDraggerSize) * scroll / (entryCount - maxLines);
int barDraggerY;
if (this.currentMouseButtonDown == 1 && this.currMouseX >= scrollBarStartX
&& 12 + scrollBarStartX >= this.currMouseX) {
if (y < this.currMouseY && this.currMouseY < 12 + y && scroll > 0) {
......
......@@ -400,7 +400,7 @@ public final class mudclient implements Runnable {
private int messageTabActivity_Private = 0;
private int messageTabActivity_Clan = 0;
private int messageTabActivity_Quest = 0;
private MessageTab messageTabSelected = MessageTab.ALL;
public MessageTab messageTabSelected = MessageTab.ALL;
private int midRegionBaseX;
private int midRegionBaseZ;
private int minimapRandom_1 = 0;
......@@ -547,20 +547,20 @@ public final class mudclient implements Runnable {
private int flag = 0;
private Timer tiktok = new Timer();
private NComponent mainComponent;
private OnlineListInterface onlineList;
public OnlineListInterface onlineList;
private NCustomComponent experienceOverlay;
private ProgressBarInterface batchProgressBar;
private BankPinInterface bankPinInterface;
private FishingTrawlerInterface fishingTrawlerInterface;
private AchievementGUI achievementInterface;
private IronManInterface ironmanInterface;
private AuctionHouse auctionHouse;
private SkillGuideInterface skillGuideInterface;
private QuestGuideInterface questGuideInterface;
private ExperienceConfigInterface experienceConfigInterface;
private DoSkillInterface doSkillInterface;
private LostOnDeathInterface lostOnDeathInterface;
private TerritorySignupInterface territorySignupInterface;
public AchievementGUI achievementInterface;
public IronManInterface ironmanInterface;
public AuctionHouse auctionHouse;
public SkillGuideInterface skillGuideInterface;
public QuestGuideInterface questGuideInterface;
public ExperienceConfigInterface experienceConfigInterface;
public DoSkillInterface doSkillInterface;
public LostOnDeathInterface lostOnDeathInterface;
public TerritorySignupInterface territorySignupInterface;
private String skillGuideChosen;
private String questGuideChosen;
private int questGuideProgress;
......@@ -1974,7 +1974,6 @@ public final class mudclient implements Runnable {
private void createMessageTabPanel(int var1) {
try {
this.panelMessageTabs = new Panel(this.getSurface(), 10);
this.panelMessageChat = this.panelMessageTabs.addScrollingList2(5, 269, 502, var1, 20, 1, true);
this.panelMessageEntry = this.panelMessageTabs.addLeftTextEntry(7, 324, 498, 14, 1, 80, false, true);
......@@ -4852,6 +4851,7 @@ public final class mudclient implements Runnable {
if (isAndroid() && Config.S_WANT_PLAYER_COMMANDS) { // on screen buttons for various player chat commands
if (F_SHOWING_KEYBOARD) {
C_SIDE_MENU_OVERLAY = false;
int uiX = 5;
int uiY = 5;
int uiWidth = 60;
......@@ -15203,7 +15203,6 @@ public final class mudclient implements Runnable {
panelMessageTabs.scrollMethodList(panelMessagePrivate, x);
else if (this.messageTabSelected == MessageTab.CLAN && !this.controlPressed)