mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-03-03 22:21:53 +07:00
Fixed an issue where picking up networked item wasn't loading assets
ClientEntityFactory#createItem now calls Item#load() Cursor will run Item#checkLoaded on cursor item and attempt setting cursor when loaded
This commit is contained in:
parent
907688a1d2
commit
faf8743a75
@ -54,6 +54,7 @@ public class Cursor implements ItemData.LocationListener {
|
||||
}
|
||||
|
||||
public void setCursor(DC dc, Index colormap, int id) {
|
||||
Gdx.app.log(TAG, "setCursor " + dc);
|
||||
if (cursor == null) {
|
||||
Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
|
||||
cursor = Gdx.graphics.newCursor(pixmap, 0, 0);
|
||||
@ -94,6 +95,9 @@ public class Cursor implements ItemData.LocationListener {
|
||||
}
|
||||
|
||||
public void act(float delta) {
|
||||
if (dc == null && item != null && item.checkLoaded()) {
|
||||
setCursor(item.invFile, item.invColormap, item.invColorIndex);
|
||||
}
|
||||
}
|
||||
|
||||
public void render(PaletteIndexedBatch batch) {
|
||||
|
@ -193,6 +193,7 @@ public class ClientEntityFactory extends ServerEntityFactory {
|
||||
* animations finish -- is this expected? or some issue with offsets? It's happening with
|
||||
* runes -- but keys are placed correctly and other items I've tried look fine.
|
||||
*/
|
||||
itemWrapper.item.load();
|
||||
return id;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user