Commit 026a058c authored by Scott T's avatar Scott T

Rebase cleanup

parent 3e38179a
......@@ -3,7 +3,8 @@ package com.openrsc.client.entityhandling.defs;
public class ItemDef extends EntityDef {
public String command;
public int basePrice;
public int sprite;
public int authenticSpriteID;
public String spriteLocation;
public boolean stackable;
public boolean wieldable;
public int wearableID;
......@@ -14,12 +15,12 @@ public class ItemDef extends EntityDef {
private int isNotedFormOf = -1;
private int notedFormID = -1;
public ItemDef(String name, String description, String command, int basePrice, int sprite, boolean stackable,
public ItemDef(String name, String description, String command, int basePrice, int authenticSpriteID, boolean stackable,
boolean wieldable, int wearableID, int pictureMask, boolean membersItem, boolean quest, int id) {
super(name, description, id);
this.command = command;
this.basePrice = basePrice;
this.sprite = sprite;
this.authenticSpriteID = authenticSpriteID;
this.stackable = stackable;
this.wieldable = wieldable;
this.wearableID = wearableID;
......@@ -29,13 +30,14 @@ public class ItemDef extends EntityDef {
this.id = id;
}
public ItemDef(String name, String description, String command, int basePrice, int sprite, boolean stackable,
boolean wieldable, int wearableID, int pictureMask, boolean membersItem, boolean quest, int notedForm, int notedFormOf,
int id) {
public ItemDef(String name, String description, String command, int basePrice, int authenticSpriteID, String spriteLocation,
boolean stackable, boolean wieldable, int wearableID, int pictureMask, boolean membersItem,
boolean quest, int notedForm, int notedFormOf, int id) {
super(name, description, id);
this.command = command;
this.basePrice = basePrice;
this.sprite = sprite;
this.authenticSpriteID = authenticSpriteID;
this.stackable = stackable;
this.wieldable = wieldable;
this.wearableID = wearableID;
......@@ -45,13 +47,15 @@ public class ItemDef extends EntityDef {
this.id = id;
this.notedFormID = notedForm;
this.isNotedFormOf = notedFormOf;
this.spriteLocation = spriteLocation;
}
public ItemDef(int i, ItemDef item) {
super(item.name, "Swap this note at any bank for the equivalent item.", i);
this.command = item.command;
this.basePrice = item.basePrice;
this.sprite = 438;
this.authenticSpriteID = 438;
this.stackable = true;
this.wieldable = false;
this.pictureMask = 0;
......@@ -61,13 +65,15 @@ public class ItemDef extends EntityDef {
this.id = i;
}
public String getCommand() {
return command;
}
public int getSprite() {
return sprite;
}
public int getAuthenticSpriteID() { return authenticSpriteID; }
public String getSpriteLocation() { return this.spriteLocation; }
public int getBasePrice() {
return basePrice;
......@@ -104,4 +110,4 @@ public class ItemDef extends EntityDef {
public void setNotedForm(int id) {
this.notedFormID = id;
}
}
\ No newline at end of file
}
package com.openrsc.client.entityhandling.defs;
public class SpriteDef extends EntityDef {
private int authenticSpriteID;
private String spriteLocation;
public SpriteDef(String name, int authenticSpriteID, String spriteLocation, int id) {
super(name,"",id);
this.authenticSpriteID = authenticSpriteID;
this.spriteLocation = spriteLocation;
}
public int getAuthenticSpriteID() { return this.authenticSpriteID; }
public String getSpriteLocation() { return this.spriteLocation; }
}
......@@ -96,10 +96,12 @@ public class Sprite {
public int getID() {
return id;
}
public void setID(int id) { this.id = id; }
public String getPackageName() {
return packageName;
}
public void setPackageName(String name) { this.packageName = name; }
public void setShift(int xShift, int yShift) {
this.xShift = xShift;
......@@ -117,10 +119,12 @@ public class Sprite {
public int getXShift() {
return xShift;
}
public void setXShift(int value) { this.xShift = value; }
public int getYShift() {
return yShift;
}
public void setYShift(int value) { this.yShift = value; }
public int[] getPixels() {
return pixels;
......@@ -189,4 +193,4 @@ public class Sprite {
public void setUnknownByteArray(byte[] unknownByteArray) {
this.unknownByteArray = unknownByteArray;
}
}
\ No newline at end of file
}
package com.openrsc.interfaces;
import java.util.ArrayList;
import java.util.HashMap;
import orsc.graphics.two.GraphicsController;
import orsc.mudclient;
import java.util.ArrayList;
import java.util.HashMap;
public class NComponent {
public int x;
......@@ -183,8 +183,7 @@ public class NComponent {
if (drawBorder)
graphics().drawBoxBorder(drawX, width, drawY, height, !isHovered() ? borderColor : borderColorHovered);
if (drawSprite) {
graphics().drawSpriteClipping(spriteID, drawX, drawY, spriteWidth, spriteHeight, spriteOverlay, 0, false, 0,
1);
//graphics().drawSpriteClipping(spriteID, drawX, drawY, spriteWidth, spriteHeight, spriteOverlay, 0, false, 0, 1);
}
if (drawHorizLine) {
graphics().drawLineHoriz(drawX, drawY, horizWidth, horizColor);
......
package com.openrsc.interfaces.misc;
import com.openrsc.client.entityhandling.EntityHandler;
import orsc.Config;
import orsc.graphics.gui.Panel;
import orsc.graphics.two.GraphicsController;
import orsc.mudclient;
public final class AchievementGUI {
private int x, y;
private int width, height;
......@@ -57,7 +57,7 @@ public final class AchievementGUI {
graphics.drawBoxAlpha(rewardBoxX + 74, rewardBoxY, sizeX, sizeY, boxColor, 160);
graphics.drawBoxBorder(rewardBoxX + 74 - 1, sizeX + 2, rewardBoxY - 1, sizeY + 2, 0);
//rewardBox.setSprite(2150 + 130, 48, 32, 0);
graphics.drawSpriteClipping(2150 + 30, rewardBoxX + 74, rewardBoxY, 48, 32, 0, 0, false, 0,1);
graphics.drawSpriteClipping(mc.spriteSelect(EntityHandler.getItemDef(30)), rewardBoxX + 74, rewardBoxY, 48, 32, 0, 0, false, 0,1);
rewardBoxX += sizeX + 15;
......
......@@ -211,11 +211,11 @@ public final class AuctionHouse {
});
} else if (newAuctionItem != null) {
ItemDef def = EntityHandler.getItemDef(newAuctionItem.getItemID());
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + def.getSprite(), x + 40, y + 55, 48, 32,
mc.getSurface().drawSpriteClipping(mc.spriteSelect(def), x + 40, y + 55, 48, 32,
def.getPictureMask(), 0, false, 0, 1);
if (def.getNotedFormOf() >= 0) {
ItemDef originalDef = EntityHandler.getItemDef(def.getNotedFormOf());
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + originalDef.getSprite(), x + 47,
mc.getSurface().drawSpriteClipping(mc.spriteSelect(originalDef), x + 47,
y + 59, 33, 23, originalDef.getPictureMask(), 0, false, 0, 1);
}
//graphics.drawString("Fee: +" + (int) getFee() + "gp", x + 6, y + 101, 0xffffff, 0);
......@@ -279,11 +279,11 @@ public final class AuctionHouse {
if (inventorySlot < mc.getInventoryItemCount() && mc.getInventoryItems()[inventorySlot] != -1) {
ItemDef def = EntityHandler.getItemDef(mc.getInventoryItems()[inventorySlot]);
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + def.getSprite(), drawX, drawY, 48,
mc.getSurface().drawSpriteClipping(mc.spriteSelect(def), drawX, drawY, 48,
32, def.getPictureMask(), 0, false, 0, 1);
if (def.getNotedFormOf() >= 0) {
ItemDef originalDef = EntityHandler.getItemDef(def.getNotedFormOf());
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + originalDef.getSprite(), drawX + 7,
mc.getSurface().drawSpriteClipping(mc.spriteSelect(originalDef), drawX + 7,
drawY + 4, 33, 23, originalDef.getPictureMask(), 0, false, 0, 1);
}
graphics.drawString(String.valueOf(mc.getInventoryItemsCount()[inventorySlot]), drawX + 1,
......@@ -394,7 +394,7 @@ public final class AuctionHouse {
graphics.drawBoxAlpha(listX - 72, listY - 10, boxWidth + 1, boxHeight - 1, 0xfffffff, 128);
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + def.getSprite(), listX - 72, listY - 10, 48,
mc.getSurface().drawSpriteClipping(mc.spriteSelect(def), listX - 72, listY - 10, 48,
32, def.getPictureMask(), 0, false, 0, 1);
graphics.drawString(String.valueOf(ahItem.getAmount()), listX - 72 + 1, listY - 10 + 11, 65280, 3);
......@@ -785,7 +785,7 @@ public final class AuctionHouse {
graphics.drawString(basicNumber(price) + " gp (all)", listX + 295, listY + boxHeight / 2 + 10 - 4, 0xffffff, 0);
graphics.drawBoxAlpha(listX - 3, listY - 4, boxWidth + 1, boxHeight - 1, 0xfffffff, 128);
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + def.getSprite(), listX - 3, listY - 5, 48,
mc.getSurface().drawSpriteClipping(mc.spriteSelect(def), listX - 3, listY - 5, 48,
32, def.getPictureMask(), 0, false, 0, 1);
graphics.drawString(String.valueOf(ahItem.getAmount()), listX + 1 - 3, listY + 10 - 4, 65280, 1);
......@@ -833,7 +833,7 @@ public final class AuctionHouse {
graphics.drawBoxAlpha(selectX + 8, selectY + 22, 49, 33, 0xfffffff, 128);
graphics.drawBoxBorder(selectX + 8, 50, selectY + 22, 34, 0);
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + def.getSprite(), selectX + 8, selectY + 22, 48, 32,
mc.getSurface().drawSpriteClipping(mc.spriteSelect(def), selectX + 8, selectY + 22, 48, 32,
def.getPictureMask(), 0, false, 0, 1);
graphics.drawString(String.valueOf(ahItem.getAmount()), selectX + 10, selectY + 22 + 11, 65280, 1);
......
......@@ -323,13 +323,13 @@ public class BankInterface {
ItemDef def = EntityHandler.getItemDef(currentBankIDs.get(inventorySlot));
mc.getSurface().drawSpriteClipping(
mudclient.spriteItem + def.getSprite(),
mc.spriteSelect(def),
slotX, slotY, 48, 32,
def.getPictureMask(),
0, false, 0, 1);
if (def.getNotedFormOf() >= 0) { // Noted items
ItemDef originalDef = EntityHandler.getItemDef(def.getNotedFormOf());
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + originalDef.getSprite(),
mc.getSurface().drawSpriteClipping(mc.spriteSelect(originalDef),
slotX + 7, slotY + 5, 29, 19, originalDef.getPictureMask(), 0, false,
0, 1);
}
......
......@@ -116,7 +116,7 @@ public final class CustomBankInterface extends BankInterface {
mc.getSurface().drawString("" + tabs, tabX, tabY, 0xFFFFFF, 1);
break;
case FIRST_ITEM_IN_TAB:
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + EntityHandler.getItemDef(first_item).getSprite(),
mc.getSurface().drawSpriteClipping(mc.spriteSelect(EntityHandler.getItemDef(first_item)),
tabX, tabY, 48, 32, EntityHandler.getItemDef(first_item).getPictureMask(), 0, false, 0, 1);
mc.getSurface().drawString("" + tabs, tabX + 2, tabY + 12, 0xFFFFFF, 3);
break;
......@@ -240,11 +240,11 @@ public final class CustomBankInterface extends BankInterface {
// Dragging items
if (draggingBankSlot != -1 && bank.getControlText(bankSearch).isEmpty()) {
ItemDef def = EntityHandler.getItemDef(bankItems.get(draggingBankSlot).itemID);
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + def.getSprite(),
mc.getSurface().drawSpriteClipping(mc.spriteSelect(def),
mc.getMouseX(), mc.getMouseY(), 48, 32, def.getPictureMask(), 0, false, 0, 1);
if (def.getNotedFormOf() >= 0) {
ItemDef originalDef = EntityHandler.getItemDef(def.getNotedFormOf());
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + originalDef.getSprite(),
mc.getSurface().drawSpriteClipping(mc.spriteSelect(originalDef),
mc.getMouseX() + 7, mc.getMouseY() + 8, 29, 19,
originalDef.getPictureMask(), 0, false, 0, 1);
}
......@@ -255,11 +255,11 @@ public final class CustomBankInterface extends BankInterface {
if (bankSlotStart < bankItems.size() && bankItems.get(bankSlotStart).itemID != -1) {
ItemDef def = EntityHandler.getItemDef(bankItem.itemID);
if (draggingBankSlot != bankSlotStart) {
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + def.getSprite(), drawX, drawY, 48, 32,
mc.getSurface().drawSpriteClipping(mc.spriteSelect(def), drawX, drawY, 48, 32,
def.getPictureMask(), 0, false, 0, 1);
if (def.getNotedFormOf() >= 0) {
ItemDef originalDef = EntityHandler.getItemDef(def.getNotedFormOf());
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + originalDef.getSprite(), drawX + 7,
mc.getSurface().drawSpriteClipping(mc.spriteSelect(originalDef), drawX + 7,
drawY + 8, 29, 19, originalDef.getPictureMask(), 0, false, 0, 1);
}
drawString(mudclient.formatStackAmount(bankItem.amount), drawX + 1, drawY + 10, 1, 65280);
......@@ -371,11 +371,11 @@ public final class CustomBankInterface extends BankInterface {
if (draggingInventoryID != -1
&& (mc.getInventoryItemsCount()[draggingInventoryID]) != -1) {
ItemDef def = EntityHandler.getItemDef(mc.getInventoryItems()[draggingInventoryID]);
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + def.getSprite(),
mc.getSurface().drawSpriteClipping(mc.spriteSelect(def),
mc.getMouseX(), mc.getMouseY(), 48, 32, def.getPictureMask(), 0, false, 0, 1);
if (def.getNotedFormOf() >= 0) {
ItemDef originalDef = EntityHandler.getItemDef(def.getNotedFormOf());
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + originalDef.getSprite(),
mc.getSurface().drawSpriteClipping(mc.spriteSelect(originalDef),
mc.getMouseX() + 7, mc.getMouseY() + 8, 29, 19,
originalDef.getPictureMask(), 0, false, 0, 1);
}
......@@ -384,12 +384,12 @@ public final class CustomBankInterface extends BankInterface {
// Draw inventory-only items
if (inventorySlot < mc.getInventoryItemCount() && mc.getInventoryItems()[inventorySlot] != -1) {
ItemDef def = EntityHandler.getItemDef(mc.getInventoryItems()[inventorySlot]);
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + def.getSprite(), drawX, drawY, 48, 32,
mc.getSurface().drawSpriteClipping(mc.spriteSelect(def), drawX, drawY, 48, 32,
def.getPictureMask(), 0, false, 0, 1);
if (def.getNotedFormOf() >= 0) { // Noted items
ItemDef originalDef = EntityHandler.getItemDef(def.getNotedFormOf());
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + originalDef.getSprite(),
mc.getSurface().drawSpriteClipping(mc.spriteSelect(originalDef),
drawX + 7, drawY + 8, 29, 19, originalDef.getPictureMask(), 0, false,
0, 1);
}
......
......@@ -122,7 +122,7 @@ public final class DoSkillInterface {
lotsaText = skillDetail.length() >= 15;
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + def.getSprite(),
mc.getSurface().drawSpriteClipping(mc.spriteSelect(def),
curX, spriteY, 48, 32, def.getPictureMask(), 0, false, 0, 1);
int stringWidth = drawStringWrapped(skillDetail, curX, textY, 2, textColour);
......@@ -888,4 +888,4 @@ class DoSkillItem {
public void setSkillDetail(String skillDetail) {
this.skillDetail = skillDetail;
}
}
\ No newline at end of file
}
package com.openrsc.interfaces.misc;
import com.openrsc.client.entityhandling.EntityHandler;
import orsc.graphics.gui.Panel;
import orsc.graphics.two.GraphicsController;
import orsc.mudclient;
......@@ -106,9 +107,9 @@ public final class IronManInterface {
graphics.drawString("- " + (getIronManMode() >= 1 ? this.iron_man_restriction == 0 ? "PIN." : "Permanent." : "None."), x + (width / 2) + 49 + 27, y + 243, 0xFF981F, 0);
// iron helm, plate, legs sprites
graphics.drawSpriteClipping(2158, x + 410, y + 60, 48, 32, 0, 0, false, 0, 1);
graphics.drawSpriteClipping(2159, x + 390, y + 100, 48, 32, 0, 0, false, 0, 1);
graphics.drawSpriteClipping(2156, x + 425, y + 135, 48, 32, 0, 0, true, 0, 1);
graphics.drawSpriteClipping(mc.spriteSelect(EntityHandler.getItemDef(8)), x + 410, y + 60, 48, 32, 0, 0, false, 0, 1);
graphics.drawSpriteClipping(mc.spriteSelect(EntityHandler.getItemDef(9)), x + 390, y + 100, 48, 32, 0, 0, false, 0, 1);
graphics.drawSpriteClipping(mc.spriteSelect(EntityHandler.getItemDef(6)), x + 425, y + 135, 48, 32, 0, 0, true, 0, 1);
drawCloseButton(graphics, x + 457, y + 2, 21, 21, "X", new ButtonHandler() {
......@@ -162,7 +163,7 @@ public final class IronManInterface {
graphics.drawCircle(drawBoxX + 8 + 5, circleY, 8, 0x3A3026, 255, 0);
if(i == order[iron_man_mode]) {
graphics.drawSpriteClipping(2027, drawBoxX + 8, circleY - 5, 13, 10, 0, 0, false, 0, 1);
graphics.drawSpriteClipping(mc.spriteSelect(EntityHandler.GUIparts.get(EntityHandler.GUIPARTS.CHECKMARK.id())), drawBoxX + 8, circleY - 5, 13, 10, 0, 0, false, 0, 1);
}
}
......@@ -175,7 +176,7 @@ public final class IronManInterface {
}
});
graphics.drawSpriteClipping(2340, drawBoxX + 8, circleY + 21, 48, 32, 0, 0, false, 0, 1);
//graphics.drawSpriteClipping(2340, drawBoxX + 8, circleY + 21, 48, 32, 0, 0, false, 0, 1);
if(deactivationMenu)
graphics.drawBoxAlpha(x, y, width, height, 0, 192);
}
......@@ -216,7 +217,7 @@ public final class IronManInterface {
});
graphics.drawCircle(drawBoxX + 8 + 5, circleY, 8, 0x3A3026, 255, 0);
if(i == this.iron_man_restriction) {
graphics.drawSpriteClipping(2027, drawBoxX + 8, circleY - 5, 13, 10, 0, 0, false, 0, 1);
graphics.drawSpriteClipping(mc.spriteSelect(EntityHandler.GUIparts.get(EntityHandler.GUIPARTS.CHECKMARK.id())), drawBoxX + 8, circleY - 5, 13, 10, 0, 0, false, 0, 1);
}
drawBoxheight = 20;
drawBoxY += 45;
......@@ -308,4 +309,4 @@ public final class IronManInterface {
graphics.drawString(title, x + 20, y + titleY, 0xFFFFFF, 0);
graphics.drawWrappedCenteredString(description, x + descriptionX, y + titleY + descriptionY, wrapWidth, 0, 0xFF981F, true, false);
}
}
\ No newline at end of file
}
......@@ -105,11 +105,11 @@ public final class LostOnDeathInterface {
movedAtFlag = i;
}
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + def.getSprite(),
mc.getSurface().drawSpriteClipping(mc.spriteSelect(def),
curX, curY, 48, 32, def.getPictureMask(), 0, false, 0, 1);
if (def.getNotedFormOf() >= 0) {
ItemDef originalDef = EntityHandler.getItemDef(def.getNotedFormOf());
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + originalDef.getSprite(),
mc.getSurface().drawSpriteClipping(mc.spriteSelect(originalDef),
curX, curY, 48, 32, originalDef.getPictureMask(), 0, false, 0, 1);
}
......@@ -274,4 +274,4 @@ class OnDeathItem {
public void setLost(boolean lost) {
this.lost = lost;
}
}
\ No newline at end of file
}
......@@ -2,13 +2,12 @@ package com.openrsc.interfaces.misc;
import com.openrsc.client.entityhandling.EntityHandler;
import com.openrsc.client.entityhandling.defs.ItemDef;
import java.util.ArrayList;
import orsc.graphics.gui.Panel;
import orsc.graphics.two.GraphicsController;
import orsc.mudclient;
import java.util.ArrayList;
public final class SkillGuideInterface {
private ArrayList<SkillItem> skillItems;
......@@ -162,7 +161,7 @@ public final class SkillGuideInterface {
if(i != skillItems.size() - 1 && i != listEndPoint) {
mc.getSurface().drawBoxBorder(detailX - 75, width, allY, 37 + 1, 0);
}
mc.getSurface().drawSpriteClipping(mudclient.spriteItem + def.getSprite(),
mc.getSurface().drawSpriteClipping(mc.spriteSelect(def),
spriteX + 5, allY + 2, 48, 32, def.getPictureMask(), 0, false, 0, 1);
drawString(skillDetail, detailX + 10, allY + 25, 2, textColour);
......@@ -895,4 +894,4 @@ class SkillItem {
public void setSkillDetail(String skillDetail) {
this.skillDetail = skillDetail;
}
}
\ No newline at end of file
}
package orsc;
import com.openrsc.client.entityhandling.defs.SpriteDef;
import orsc.enumerations.ORSCharacterDirection;
public final class ORSCharacter {
......@@ -21,7 +22,7 @@ public final class ORSCharacter {
public int[] layerAnimation = new int[12];
public int healthCurrent = 0;
public int healthMax = 0;
public int incomingProjectileSprite = 0;
public SpriteDef incomingProjectileSprite;
public int level = -1;
public String message;
public int messageTimeout = 0;
......
package orsc;
import com.openrsc.client.entityhandling.EntityHandler;
import com.openrsc.client.model.Sprite;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.util.Properties;
import orsc.buffers.RSBufferUtils;
import orsc.buffers.RSBuffer_Bits;
import orsc.enumerations.MessageType;
......@@ -21,6 +15,12 @@ import orsc.util.FastMath;
import orsc.util.GenUtil;
import orsc.util.StringUtil;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.util.Properties;
public class PacketHandler {
private final RSBuffer_Bits packetsIncoming = new RSBuffer_Bits(30000);
......@@ -1415,7 +1415,7 @@ public class PacketHandler {
npc.attackingNpcServerIndex = shooterServerIndex;
npc.projectileRange = mc.getProjectileMaxRange();
npc.attackingPlayerServerIndex = -1;
npc.incomingProjectileSprite = sprite;
npc.incomingProjectileSprite = EntityHandler.projectiles.get(sprite);
}
} else if (updateType == 4) {
int sprite = packetsIncoming.getShort();
......@@ -1424,7 +1424,7 @@ public class PacketHandler {
npc.projectileRange = mc.getProjectileMaxRange();
npc.attackingNpcServerIndex = -1;
npc.attackingPlayerServerIndex = shooterServerIndex;
npc.incomingProjectileSprite = sprite;
npc.incomingProjectileSprite = EntityHandler.projectiles.get(sprite);
}
}
}
......@@ -1850,7 +1850,7 @@ public class PacketHandler {
mc.setIsSleeping(true);
mc.setInputTextFinal("");
Sprite sprite = mc.makeSleepSprite(new ByteArrayInputStream(packetsIncoming.dataBuffer, 1, length));
mc.getSurface().createCaptchaSprite(mudclient.spriteLogo + 2, sprite);
mc.getSurface().createCaptchaSprite(sprite);
mc.setSleepingStatusText(null);
}
......@@ -2078,7 +2078,7 @@ public class PacketHandler {
player.attackingNpcServerIndex = shooterServerIndex;
player.projectileRange = mc.getProjectileMaxRange();
player.attackingPlayerServerIndex = -1;
player.incomingProjectileSprite = sprite;
player.incomingProjectileSprite = EntityHandler.projectiles.get(sprite);
}
} else if (updateType == 4) {
int sprite = packetsIncoming.getShort();
......@@ -2087,7 +2087,7 @@ public class PacketHandler {
player.projectileRange = mc.getProjectileMaxRange();
player.attackingNpcServerIndex = -1;
player.attackingPlayerServerIndex = shooterServerIndex;
player.incomingProjectileSprite = sprite;
player.incomingProjectileSprite = EntityHandler.projectiles.get(sprite);
}
} else if (updateType == 5) {
if (player == null) {
......
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;
......@@ -25,6 +27,7 @@ public final class Panel {
private int colorK;
private int colorL;
private int[] controlArgInt;
private Sprite[] controlArgSprite;
private boolean[] controlClicked;
private int[] controlClickedListIndex;
private int controlCount = 0;
......@@ -62,6 +65,7 @@ public final class Panel {
this.controlY = new int[maxControls];
this.controlFlag = new boolean[maxControls];
this.controlArgInt = new int[maxControls];
this.controlArgSprite = new Sprite[maxControls];
this.controlListCurrentSize = new int[maxControls];
this.controlWidth = new int[maxControls];
this.controlVisible = new boolean[maxControls];
......@@ -297,11 +301,11 @@ public final class Panel {
}
}
public final int addSprite(int x, int y, int spriteID) {
public final int addSprite(int x, int y, Sprite e) {
try {
int width = this.graphics.sprites[spriteID].getWidth();
int height = this.graphics.sprites[spriteID].getHeight();
int width = e.getWidth();
int height = e.getHeight();
this.controlType[this.controlCount] = PanelControlType.SPRITE;
this.controlVisible[this.controlCount] = true;
this.controlClicked[this.controlCount] = false;
......@@ -309,10 +313,10 @@ public final class Panel {
this.controlY[this.controlCount] = y - height / 2;
this.controlWidth[this.controlCount] = width;
this.controlHeight[this.controlCount] = height;
this.controlArgInt[this.controlCount] = spriteID;
this.controlArgSprite[this.controlCount] = e;
return this.controlCount++;
} catch (RuntimeException var7) {
throw GenUtil.makeThrowable(var7, "qa.PA(" + spriteID + ',' + y + ',' + x + ',' + "dummy" + ')');
throw GenUtil.makeThrowable(var7, "qa.PA(" + e.getID() + ',' + y + ',' + x + ',' + "dummy" + ')');
}
}
......@@ -398,7 +402,7 @@ public final class Panel {
this.controlHeight[i]);
break;
case SPRITE:
this.renderSprite(this.controlX[i], this.controlY[i], this.controlArgInt[i]);
this.renderSprite(this.controlX[i], this.controlY[i], this.controlArgSprite[i]);
break;
case DECORATED_BOX:
this.renderDecoratedBox(this.controlX[i], this.controlY[i], this.controlWidth[i],
......@@ -634,7 +638,7 @@ public final class Panel {
if (MiscFunctions.drawBackgroundArrow) {
for (int xi = x - (y & 63); xi < width + x; xi += 128) {
for (int yi = y - (31 & y); y + height > yi; yi += 128) {
this.graphics.a(6 + mudclient.spriteUtil, 0, xi, 128, (int) yi);
this.graphics.a(this.graphics.spriteSelect(EntityHandler.GUIparts.get(EntityHandler.GUIPARTS.LEFTARROW.id())), 0, xi, 128, (int) yi);
}
}
}
......@@ -711,10 +715,10 @@ public final class Panel {
this.graphics.drawBoxBorder(x, width, y, height, this.colorF);
this.graphics.drawBoxBorder(1 + x, width - 2, 1 + y, height - 2, this.colorG);
this.graphics.drawBoxBorder(x + 2, width - 4, 2 + y, height - 4, this.colorH);
this.graphics.drawSprite(mudclient.spriteUtil + 2, x, y);
this.graphics.drawSprite(3 + mudclient.spriteUtil, width + x - 7, y);
this.graphics.drawSprite(4 + mudclient.spriteUtil, x, y - (7 - height));
this.graphics.drawSprite(5 + mudclient.spriteUtil, x + width - 7, height - 7 + y);
this.graphics.drawSprite(this.graphics.spriteSelect(EntityHandler.GUIparts.get(EntityHandler.GUIPARTS.DECORATEDBOXUL.id())), x, y);
this.graphics.drawSprite(this.graphics.spriteSelect(EntityHandler.GUIparts.get(EntityHandler.GUIPARTS.DECORATEDBOXUR.id())), width + x - 7, y);
this.graphics.drawSprite(this.graphics.spriteSelect(EntityHandler.GUIparts.get(EntityHandler.GUIPARTS.DECORATEDBOXLL.id())), x, y - (7 - height));
this.graphics.drawSprite(this.graphics.spriteSelect(EntityHandler.GUIparts.get(EntityHandler.GUIPARTS.DECORATEDBOXLR.id())), x + width - 7, height - 7 + y);
} catch (RuntimeException var7) {
throw GenUtil.makeThrowable(var7, "qa.V(" + y + ',' + width + ',' + "true" + ',' + x + ',' + height + ')');
}
......@@ -790,8 +794,8 @@ public final class Panel {
int barX = x + width - 12;
this.graphics.drawBoxBorder(barX, 12, y, height, 0);
this.graphics.drawSprite(0 + mudclient.spriteUtil, 1 + barX, y + 1);
this.graphics.drawSprite(mudclient.spriteUtil + 1, 1 + barX, height - 12 + y);
this.graphics.drawSprite(this.graphics.spriteSelect(EntityHandler.GUIparts.get(EntityHandler.GUIPARTS.MINIARROWUP.id())), 1 + barX, y + 1);
this.graphics.drawSprite(this.graphics.spriteSelect(EntityHandler.GUIparts.get(EntityHandler.GUIPARTS.MINIARROWDOWN.id())), 1 + barX, height - 12 + y);
this.graphics.drawLineHoriz(barX, 13 + y, 12, 0