natural inventory panel wrapping
Some checks reported errors
studiorailgun/Renderer/pipeline/head Something is wrong with the build of this commit

This commit is contained in:
austin 2025-05-13 15:00:53 -04:00
parent 03baa714d8
commit 6dddeadee5
3 changed files with 5 additions and 4 deletions

View File

@ -1750,6 +1750,8 @@ Inventory interaction type
Debug ui for natural inventory on entity view
Can open ui menu to view inventories of other entities on client
Fix windows not resizing internal framebuffer when yoga changes their dimensions
Inventory window max width
Natural inventory panel wraps on width limit

View File

@ -19,6 +19,7 @@ import electrosphere.renderer.ui.elements.Label;
import electrosphere.renderer.ui.elementtypes.ClickableElement.ClickEventCallback;
import electrosphere.renderer.ui.elementtypes.ContainerElement.YogaFlexDirection;
import electrosphere.renderer.ui.elementtypes.ContainerElement.YogaJustification;
import electrosphere.renderer.ui.elementtypes.ContainerElement.YogaWrap;
import electrosphere.renderer.ui.elementtypes.DraggableElement.DragEventCallback;
import electrosphere.renderer.ui.elementtypes.Element;
import electrosphere.renderer.ui.events.ClickEvent;
@ -106,6 +107,7 @@ public class NaturalInventoryPanel {
//contains all the item panels
Div panelContainer = Div.createDiv();
panelContainer.setFlexDirection(YogaFlexDirection.Row);
panelContainer.setWrap(YogaWrap.WRAP);
for(int i = 0; i < inventory.getCapacity(); i++){
String texturePath = "Textures/ui/uiFrame1.png";

View File

@ -14,8 +14,6 @@ import electrosphere.engine.signal.Signal.SignalType;
import electrosphere.entity.Entity;
import electrosphere.entity.state.inventory.InventoryUtils;
import electrosphere.renderer.ui.elements.Window;
import electrosphere.renderer.ui.elementtypes.ContainerElement.YogaAlignment;
import electrosphere.renderer.ui.elementtypes.ContainerElement.YogaJustification;
import electrosphere.renderer.ui.elementtypes.NavigableElement.NavigationEventCallback;
import electrosphere.renderer.ui.events.NavigationEvent;
@ -99,8 +97,7 @@ public class InventoryMainWindow {
*/
public static Window createInventoryWindow(Entity entity){
Window rVal = Window.createExpandableCenterAligned(Globals.renderingEngine.getOpenGLState());
rVal.setParentAlignItem(YogaAlignment.Center);
rVal.setParentJustifyContent(YogaJustification.Center);
rVal.setMaxWidth(Globals.WINDOW_WIDTH / 2);
rVal.setOnNavigationCallback(new NavigationEventCallback() {public boolean execute(NavigationEvent event){
WindowUtils.recursiveSetVisible(Globals.elementService.getWindow(WindowStrings.WINDOW_CHARACTER), false);