Add tooltips for layer information in items tree

This commit is contained in:
fgnm
2024-02-05 10:03:31 +01:00
parent e26a9b2bb8
commit c47a43e044
5 changed files with 15 additions and 4 deletions
+5
View File
@@ -1,12 +1,17 @@
[0.1.4]
- Update libGDX to 1.12.1
- Update VisUI to 1.5.3
- Experimental support to fail safe exceptions
- Add tooltip for layer name in the items tree
- Bug fixing and stability improvements
**Runtime**
- Hotfix GWT compilation
- [BREAK CHANGE] Add entity parameter `ButtonListener`
- Improved buttons system: Allow to disable buttons, do not fire `click` when touch up is outside the entity bounds
- Fix shared layers instances with different library items instances
- Move to Legacy version of Talos VFX (Pool particles and stability improvements)
- Support for BVB runtime
[0.1.3]
- Update libGDX to 1.12.0
@@ -192,8 +192,8 @@ public class UIItemsTreeBox extends UICollapsibleBox {
name = EntityUtils.itemTypeNameMap.get(EntityFactory.UNKNOWN_TYPE);
}
node.setName(name);
ZIndexComponent zIndexComponent = zIndexComponentMapper.get(item);
node.setName(name, zIndexComponent.layerName);
node.setNodeValue(mainItemComponent.uniqueId, zIndexComponent.getGlobalZIndex());
if (mainItemComponent.entityType != EntityFactory.COMPOSITE_TYPE)
@@ -6,10 +6,13 @@ import com.badlogic.gdx.scenes.scene2d.ui.Tree;
import com.badlogic.gdx.utils.Pool;
import com.kotcrab.vis.ui.widget.VisLabel;
import com.kotcrab.vis.ui.widget.VisTable;
import games.rednblack.h2d.common.view.ui.StandardWidgetsFactory;
import games.rednblack.h2d.common.view.ui.widget.H2DTextTooltip;
public class UIItemsTreeNode extends Tree.Node<UIItemsTreeNode, UIItemsTreeValue, VisTable> implements Pool.Poolable {
VisLabel label;
Cell<VisLabel> lblCell;
H2DTextTooltip tooltip;
public UIItemsTreeNode() {
super(new VisTable());
@@ -19,6 +22,8 @@ public class UIItemsTreeNode extends Tree.Node<UIItemsTreeNode, UIItemsTreeValue
lblCell = getActor().add(label);
setValue(new UIItemsTreeValue());
tooltip = StandardWidgetsFactory.addTooltip(getActor(), "");
}
public void setNodeValue(String entityId, int zIndex) {
@@ -34,8 +39,9 @@ public class UIItemsTreeNode extends Tree.Node<UIItemsTreeNode, UIItemsTreeValue
label.setColor(r, g, b, a);
}
public void setName(String name) {
public void setName(String name, String layer) {
label.setText(name);
tooltip.setText(layer);
}
public void setPad(float top, float left, float bottom, float right) {