From af79109a0e526b64a494c50250daee041ce5caed Mon Sep 17 00:00:00 2001 From: Smidy13 <77650800+Smidy13@users.noreply.github.com> Date: Mon, 22 Nov 2021 12:01:56 +1300 Subject: [PATCH] Improvement: Adding Path to Create Reference --- .../UI/Spaces/Floating-Space/ListSelector.js | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Projects/Foundations/UI/Spaces/Floating-Space/ListSelector.js b/Projects/Foundations/UI/Spaces/Floating-Space/ListSelector.js index f88bbc83a..7768995ef 100644 --- a/Projects/Foundations/UI/Spaces/Floating-Space/ListSelector.js +++ b/Projects/Foundations/UI/Spaces/Floating-Space/ListSelector.js @@ -285,9 +285,21 @@ function newListSelector() { let index = i + selected let label = '' + let subLabel = '' if (index >= 0 && index < optionsList.length) { if (typeof(optionsList[index]) !== "string") { + + let path = UI.projects.visualScripting.utilities.hierarchy.getNodeNameTypePath(optionsList[index].payload.parentNode) + + for (let i = 0; i < path.length; i++) { + path[i].splice(1, 3) + } + label = optionsList[index].name + subLabel = path.join("->") + + if (label.length > 65) { label = label.substring(0,65) + " (cont...)" } + if (subLabel.length > 65) { subLabel = subLabel.substring(0,65) + " (cont...)" } if (optionsList[index].payload.uiObject.icon !== undefined) { icon = optionsList[index].payload.uiObject.icon @@ -333,13 +345,19 @@ function newListSelector() { let middleValue = Math.floor(VISIBLE_LABELS / 2) let evenOffset = 0 + let subOffset = 0 if (VISIBLE_LABELS % 2 === 0) { evenOffset = rowHeight / 2 } + if (subLabel !== '') { + subOffset = 10 + } + UI.projects.foundations.utilities.drawPrint.drawIcon(icon, 1 / 2, 1 / 2, - offset + SIZE, (i - middleValue) * rowHeight + evenOffset, SIZE, thisObject.container) - UI.projects.foundations.utilities.drawPrint.drawLabel(label, 1 / 2, 1 / 2, 0, (SIZE - fontSize) / 2 + (i - middleValue) * rowHeight + evenOffset, fontSize, thisObject.container, fontColor, undefined, undefined, opacity) + UI.projects.foundations.utilities.drawPrint.drawLabel(label, 1 / 2, 1 / 2, 0, (SIZE - fontSize) / 2 + (i - middleValue) * rowHeight + evenOffset - subOffset, fontSize, thisObject.container, fontColor, undefined, undefined, opacity) + UI.projects.foundations.utilities.drawPrint.drawLabel(subLabel, 1 / 2, 1 / 2, 0, (SIZE - fontSize) / 2 + (i - middleValue) * rowHeight + evenOffset + subOffset, fontSize / 2, thisObject.container, fontColor, undefined, undefined, opacity) } } }