player can now choose between different shields and weapons. added consumable items (healing potion)
This commit is contained in:
@@ -175,6 +175,12 @@ public class UI {
|
||||
|
||||
// DRAW PLAYER ITEMS
|
||||
for(int i = 0; i < panel.player.inventory.size(); i++) {
|
||||
|
||||
// EQUIP CURSOR
|
||||
if(panel.player.inventory.get(i) == panel.player.currentWeapon || panel.player.inventory.get(i) == panel.player.currentShield) {
|
||||
graphics2d.setColor(new Color(240, 190,90));
|
||||
graphics2d.fillRoundRect(slotX, slotY, panel.tileSize, panel.tileSize, 10, 10);
|
||||
}
|
||||
graphics2d.drawImage(panel.player.inventory.get(i).down1, slotX, slotY, null);
|
||||
slotX += slotSize;
|
||||
if (i == 4 || i == 9 || i == 14) {
|
||||
@@ -230,7 +236,7 @@ public class UI {
|
||||
int height = panel.tileSize*4;
|
||||
drawSubWindow(x, y, width, height);
|
||||
|
||||
graphics2d.setFont(graphics2d.getFont().deriveFont(Font.PLAIN, 28F));
|
||||
graphics2d.setFont(graphics2d.getFont().deriveFont(Font.PLAIN, 30F));
|
||||
x += panel.tileSize;
|
||||
y += panel.tileSize;
|
||||
|
||||
@@ -300,12 +306,12 @@ public class UI {
|
||||
public int getAlignedToRightX(String text, int tailX) {
|
||||
return tailX - (int) graphics2d.getFontMetrics().getStringBounds(text, graphics2d).getWidth();
|
||||
}
|
||||
public int getItemIndex() {
|
||||
return slotCol + slotRow*5;
|
||||
}
|
||||
public void addMessage(String text) {
|
||||
messages.add(text);
|
||||
messageCounter.add(0);
|
||||
}
|
||||
public int getItemIndex() {
|
||||
return slotCol + slotRow*5;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user