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, "id" : 1,
"name" : "brick", "name" : "brick_flat",
"texture" : "/Textures/block/tileableSlabstone.png" "texture" : "/Textures/block/tileableSlabstone.png"
}, },
{ {
"id" : 2, "id" : 2,
"name" : "wood", "name" : "wood",
"texture" : "/Textures/wooden.png" "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 Cursor logic around blocks
Block destruction work Block destruction work
Block cursor custom textures Block cursor custom textures
New block type
Fix inventory item tooltip not clearing

View File

@ -244,4 +244,13 @@ public class NaturalInventoryPanel {
return div; 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){ if(Globals.virtualAudioSourceManager != null){
Globals.virtualAudioSourceManager.createVirtualAudioSource(AssetDataStrings.UI_SFX_INVENTORY_CLOSE, VirtualAudioSourceType.UI, false); Globals.virtualAudioSourceManager.createVirtualAudioSource(AssetDataStrings.UI_SFX_INVENTORY_CLOSE, VirtualAudioSourceType.UI, false);
} }
NaturalInventoryPanel.clearTooltip();
ToolbarInventoryPanel.clearTooltip();
Globals.renderingEngine.getPostProcessingPipeline().setApplyBlur(false); Globals.renderingEngine.getPostProcessingPipeline().setApplyBlur(false);
return false; return false;
}}); }});

View File

@ -251,4 +251,13 @@ public class ToolbarInventoryPanel {
return div; 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){ 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 * @param target The tooltip to destroy
*/ */
public static void destroy(Tooltip target){ public static void destroy(Tooltip target){
if(target == null){
throw new Error("Tooltip is null");
}
Globals.signalSystem.post(SignalType.UI_MODIFICATION,()->{ Globals.signalSystem.post(SignalType.UI_MODIFICATION,()->{
Window tooltipWindow = (Window)Globals.elementService.getWindow(WindowStrings.TOOLTIP_WINDOW); Window tooltipWindow = (Window)Globals.elementService.getWindow(WindowStrings.TOOLTIP_WINDOW);
tooltipWindow.removeChild(target); tooltipWindow.removeChild(target);

View File

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