item work
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
f6fe44b178
commit
43bb67ca57
@ -1765,6 +1765,8 @@ Unified container movement utils
|
|||||||
Break up InventoryUtils class
|
Break up InventoryUtils class
|
||||||
Update inventory utility logic
|
Update inventory utility logic
|
||||||
Fix styling for inventory panel ui element
|
Fix styling for inventory panel ui element
|
||||||
|
Fix content serialization bug with attached items
|
||||||
|
Fix playing audio without item defined in natural inventory panel
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -182,7 +182,7 @@ public class ItemIconPanel {
|
|||||||
onReceiveItem.run();
|
onReceiveItem.run();
|
||||||
Item itemData = Globals.gameConfigCurrent.getItemMap().getItem(ItemUtils.getType(Globals.draggedItem));
|
Item itemData = Globals.gameConfigCurrent.getItemMap().getItem(ItemUtils.getType(Globals.draggedItem));
|
||||||
if(Globals.virtualAudioSourceManager != null){
|
if(Globals.virtualAudioSourceManager != null){
|
||||||
if(itemData.getItemAudio() != null && itemData.getItemAudio().getUIReleaseAudio() != null){
|
if(itemData != null && itemData.getItemAudio() != null && itemData.getItemAudio().getUIReleaseAudio() != null){
|
||||||
Globals.virtualAudioSourceManager.createVirtualAudioSource(itemData.getItemAudio().getUIReleaseAudio(), VirtualAudioSourceType.UI, false);
|
Globals.virtualAudioSourceManager.createVirtualAudioSource(itemData.getItemAudio().getUIReleaseAudio(), VirtualAudioSourceType.UI, false);
|
||||||
} else {
|
} else {
|
||||||
Globals.virtualAudioSourceManager.createVirtualAudioSource(AssetDataStrings.UI_SFX_ITEM_RELEASE, VirtualAudioSourceType.UI, false);
|
Globals.virtualAudioSourceManager.createVirtualAudioSource(AssetDataStrings.UI_SFX_ITEM_RELEASE, VirtualAudioSourceType.UI, false);
|
||||||
|
|||||||
@ -133,6 +133,7 @@ public class NaturalInventoryPanel {
|
|||||||
panel = ItemIconPanel.createPanel(currentItem, i, inventory);
|
panel = ItemIconPanel.createPanel(currentItem, i, inventory);
|
||||||
} else {
|
} else {
|
||||||
panel = ItemIconPanel.createEmptyItemPanel(() -> {
|
panel = ItemIconPanel.createEmptyItemPanel(() -> {
|
||||||
|
if(Globals.draggedItem != null){
|
||||||
NetworkMessage requestPickupMessage = InventoryMessage.constructclientRequestStoreItemMessage(
|
NetworkMessage requestPickupMessage = InventoryMessage.constructclientRequestStoreItemMessage(
|
||||||
Globals.clientSceneWrapper.mapClientToServerId(entity.getId()),
|
Globals.clientSceneWrapper.mapClientToServerId(entity.getId()),
|
||||||
InventoryProtocol.INVENTORY_TYPE_NATURAL,
|
InventoryProtocol.INVENTORY_TYPE_NATURAL,
|
||||||
@ -140,6 +141,7 @@ public class NaturalInventoryPanel {
|
|||||||
Globals.clientSceneWrapper.mapClientToServerId(Globals.draggedItem.getId())
|
Globals.clientSceneWrapper.mapClientToServerId(Globals.draggedItem.getId())
|
||||||
);
|
);
|
||||||
Globals.clientConnection.queueOutgoingMessage(requestPickupMessage);
|
Globals.clientConnection.queueOutgoingMessage(requestPickupMessage);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
panelContainer.addChild(panel);
|
panelContainer.addChild(panel);
|
||||||
|
|||||||
@ -862,7 +862,13 @@ public class GriddedDataCellManager implements DataCellManager, VoxelCellManager
|
|||||||
Long key = this.getServerDataCellKey(localWorldPos);
|
Long key = this.getServerDataCellKey(localWorldPos);
|
||||||
//generate content
|
//generate content
|
||||||
GriddedDataCellLoaderService.queueLocationBasedOperation(key, () -> {
|
GriddedDataCellLoaderService.queueLocationBasedOperation(key, () -> {
|
||||||
|
try {
|
||||||
serverContentManager.generateContentForDataCell(parent, localWorldPos, rVal, cellKey);
|
serverContentManager.generateContentForDataCell(parent, localWorldPos, rVal, cellKey);
|
||||||
|
} catch(Error e){
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
//generates physics for the cell in a dedicated thread then finally registers
|
//generates physics for the cell in a dedicated thread then finally registers
|
||||||
loadedCellsLock.lock();
|
loadedCellsLock.lock();
|
||||||
|
|||||||
@ -47,6 +47,10 @@ public class ContentSerialization {
|
|||||||
//do not serialize engine entities
|
//do not serialize engine entities
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
//don't serialize attached entities
|
||||||
|
if(AttachUtils.isAttached(entity)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if(type != null){
|
if(type != null){
|
||||||
EntitySerialization serializedEntity = ContentSerialization.constructEntitySerialization(entity);
|
EntitySerialization serializedEntity = ContentSerialization.constructEntitySerialization(entity);
|
||||||
rVal.serializedEntities.add(serializedEntity);
|
rVal.serializedEntities.add(serializedEntity);
|
||||||
@ -62,6 +66,9 @@ public class ContentSerialization {
|
|||||||
* @return The serialization of the entity
|
* @return The serialization of the entity
|
||||||
*/
|
*/
|
||||||
public static EntitySerialization constructEntitySerialization(Entity entity){
|
public static EntitySerialization constructEntitySerialization(Entity entity){
|
||||||
|
if(AttachUtils.isAttached(entity)){
|
||||||
|
throw new Error("Trying to serialize attached entity!");
|
||||||
|
}
|
||||||
EntitySerialization serializedEntity = new EntitySerialization();
|
EntitySerialization serializedEntity = new EntitySerialization();
|
||||||
serializedEntity.setPosition(EntityUtils.getPosition(entity));
|
serializedEntity.setPosition(EntityUtils.getPosition(entity));
|
||||||
serializedEntity.setRotation(EntityUtils.getRotation(entity));
|
serializedEntity.setRotation(EntityUtils.getRotation(entity));
|
||||||
@ -76,10 +83,8 @@ public class ContentSerialization {
|
|||||||
serializedEntity.setSubtype(CommonEntityUtils.getEntitySubtype(entity));
|
serializedEntity.setSubtype(CommonEntityUtils.getEntitySubtype(entity));
|
||||||
} break;
|
} break;
|
||||||
case ITEM: {
|
case ITEM: {
|
||||||
if(!AttachUtils.isAttached(entity)){
|
|
||||||
serializedEntity.setType(EntityType.ITEM.getValue());
|
serializedEntity.setType(EntityType.ITEM.getValue());
|
||||||
serializedEntity.setSubtype(CommonEntityUtils.getEntitySubtype(entity));
|
serializedEntity.setSubtype(CommonEntityUtils.getEntitySubtype(entity));
|
||||||
}
|
|
||||||
} break;
|
} break;
|
||||||
case FOLIAGE: {
|
case FOLIAGE: {
|
||||||
serializedEntity.setType(EntityType.FOLIAGE.getValue());
|
serializedEntity.setType(EntityType.FOLIAGE.getValue());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user