tooltip fix + new block type
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-04-26 18:21:29 -04:00
parent 3173f1f2e9
commit d790c1df8a
9 changed files with 35 additions and 3 deletions

View File

@ -6,13 +6,18 @@
},
{
"id" : 1,
"name" : "brick",
"name" : "brick_flat",
"texture" : "/Textures/block/tileableSlabstone.png"
},
{
"id" : 2,
"name" : "wood",
"texture" : "/Textures/wooden.png"
},
{
"id" : 3,
"name" : "brick_fant",
"texture" : "/Textures/block/ruin_wall_01.png"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

View File

@ -1554,6 +1554,8 @@ Align block lookups for interaction targeting
Cursor logic around blocks
Block destruction work
Block cursor custom textures
New block type
Fix inventory item tooltip not clearing

View File

@ -244,4 +244,13 @@ public class NaturalInventoryPanel {
return div;
}
/**
* Clears the tooltip
*/
public static void clearTooltip(){
if(itemTooltip != null){
Tooltip.destroy(itemTooltip);
}
}
}

View File

@ -51,6 +51,8 @@ public class PlayerInventoryWindow {
if(Globals.virtualAudioSourceManager != null){
Globals.virtualAudioSourceManager.createVirtualAudioSource(AssetDataStrings.UI_SFX_INVENTORY_CLOSE, VirtualAudioSourceType.UI, false);
}
NaturalInventoryPanel.clearTooltip();
ToolbarInventoryPanel.clearTooltip();
Globals.renderingEngine.getPostProcessingPipeline().setApplyBlur(false);
return false;
}});

View File

@ -251,4 +251,13 @@ public class ToolbarInventoryPanel {
return div;
}
/**
* Clears the tooltip
*/
public static void clearTooltip(){
if(itemTooltip != null){
Tooltip.destroy(itemTooltip);
}
}
}

View File

@ -377,7 +377,7 @@ public class CursorState {
}
}
if(clearBlockCursor){
CursorState.hide();
Globals.clientSceneWrapper.getScene().removeEntityFromTag(Globals.playerBlockCursor, EntityTags.DRAWABLE);
}
}
}

View File

@ -145,6 +145,9 @@ public class Tooltip extends StandardDrawableContainerElement {
* @param target The tooltip to destroy
*/
public static void destroy(Tooltip target){
if(target == null){
throw new Error("Tooltip is null");
}
Globals.signalSystem.post(SignalType.UI_MODIFICATION,()->{
Window tooltipWindow = (Window)Globals.elementService.getWindow(WindowStrings.TOOLTIP_WINDOW);
tooltipWindow.removeChild(target);

View File

@ -629,9 +629,11 @@ public class Window implements DrawableElement, ContainerElement, NavigableEleme
@Override
public void removeChild(Element child) {
if(childList.contains(child)){
Yoga.YGNodeRemoveChild(yogaNode, child.getYogaNode());
}
childList.remove(child);
child.setParent(null);
Yoga.YGNodeRemoveChild(yogaNode, child.getYogaNode());
}
@Override