From f7f6d9eb423a16603dc887b71e4b3b8fa63d5a40 Mon Sep 17 00:00:00 2001 From: Louis Poirier Date: Fri, 2 Jan 2026 20:11:52 +0100 Subject: [PATCH 1/3] Add GetChildIndex method to inkCompoundWidget Simple utility along native `GetChild...` methods. It returns the index of a widget in its parent, or `-1` when not found. --- scripts/UI/Core/inkCompoundWidget | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 scripts/UI/Core/inkCompoundWidget diff --git a/scripts/UI/Core/inkCompoundWidget b/scripts/UI/Core/inkCompoundWidget new file mode 100644 index 00000000..09c1ce2f --- /dev/null +++ b/scripts/UI/Core/inkCompoundWidget @@ -0,0 +1,13 @@ +@addMethod(inkCompoundWidget) +public func GetChildIndex(child: wref) -> Int32 { + let i = 0; + while i < this.GetNumChildren() { + let widget = this.GetWidget(i); + if Equals(widget, child) { + return i; + } + + i += 1; + } + return -1; +} From 2f1ddefa67970a41eba193c4b0c6953ccfaf2412 Mon Sep 17 00:00:00 2001 From: Louis Poirier Date: Sat, 3 Jan 2026 13:14:07 +0100 Subject: [PATCH 2/3] Simplify GetChildIndex method using ArrayFindFirst --- scripts/UI/Core/inkCompoundWidget | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/scripts/UI/Core/inkCompoundWidget b/scripts/UI/Core/inkCompoundWidget index 09c1ce2f..3bbf6f68 100644 --- a/scripts/UI/Core/inkCompoundWidget +++ b/scripts/UI/Core/inkCompoundWidget @@ -1,13 +1,4 @@ @addMethod(inkCompoundWidget) public func GetChildIndex(child: wref) -> Int32 { - let i = 0; - while i < this.GetNumChildren() { - let widget = this.GetWidget(i); - if Equals(widget, child) { - return i; - } - - i += 1; - } - return -1; + return ArrayFindFirst(this.children.children, child); } From 101a9edafd940c61ab5d2572ede72d96fefd8216 Mon Sep 17 00:00:00 2001 From: Louis Poirier Date: Mon, 26 Jan 2026 16:51:49 +0100 Subject: [PATCH 3/3] refactor: add missing .reds extension for inkCompoundWidget --- scripts/UI/Core/{inkCompoundWidget => inkCompoundWidget.reds} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/UI/Core/{inkCompoundWidget => inkCompoundWidget.reds} (100%) diff --git a/scripts/UI/Core/inkCompoundWidget b/scripts/UI/Core/inkCompoundWidget.reds similarity index 100% rename from scripts/UI/Core/inkCompoundWidget rename to scripts/UI/Core/inkCompoundWidget.reds