mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-02-21 20:18:14 +07:00
Added show ground labels for items (not selectable yet)
Added button to show all labels for items on the ground Fixed issue where dropped items were overwriting existing entities -- going to replace with ashley soon
This commit is contained in:
parent
053c975fe7
commit
abde0c9fdc
@ -3,6 +3,7 @@ package com.riiablo.map;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.Input;
|
||||
import com.badlogic.gdx.math.GridPoint2;
|
||||
import com.badlogic.gdx.math.MathUtils;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.math.Vector3;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
@ -87,7 +88,9 @@ public class MapListener {
|
||||
Riiablo.cursor.setItem(null);
|
||||
Entity item = new ItemHolder(cursor);
|
||||
item.position().set(gameScreen.player.position());
|
||||
gameScreen.entities.put(gameScreen.entities.size + 1, item);
|
||||
int randomId;
|
||||
while (gameScreen.entities.get(randomId = MathUtils.random.nextInt(Integer.MAX_VALUE)) != null);
|
||||
gameScreen.entities.put(randomId, item);
|
||||
requireRelease = true;
|
||||
return;
|
||||
}
|
||||
|
@ -103,6 +103,7 @@ public class GameScreen extends ScreenAdapter implements LoadingScreen.Loadable
|
||||
NpcMenu menu;
|
||||
NpcDialogBox dialog;
|
||||
Actor details;
|
||||
boolean showItems;
|
||||
|
||||
public TextArea input;
|
||||
TextArea output;
|
||||
@ -504,6 +505,23 @@ public class GameScreen extends ScreenAdapter implements LoadingScreen.Loadable
|
||||
details.draw(b, 1);
|
||||
b.end();
|
||||
}
|
||||
|
||||
|
||||
showItems = UIUtils.alt();
|
||||
if (showItems) {
|
||||
clearLabels();
|
||||
for (Entity entity : entities.values()) {
|
||||
if (entity instanceof ItemHolder) {
|
||||
Actor label = entity.getLabel();
|
||||
addLabel(label);
|
||||
}
|
||||
}
|
||||
layoutLabels();
|
||||
|
||||
b.begin();
|
||||
for (Actor label : labels) label.draw(b, 1);
|
||||
b.end();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user