From 24ae3a10bf14697ce0e7ed2a960170972702f01c Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 24 Mar 2024 15:57:50 +0100 Subject: [PATCH] Update to 203018db6f281dca5ea2f806bf89ff1427c4560a --- src/Misc.gd | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Misc.gd b/src/Misc.gd index f0ab90a..886b480 100644 --- a/src/Misc.gd +++ b/src/Misc.gd @@ -60,3 +60,14 @@ func format_stringarray(array: Array[String], item_before: String = "", item_aft output = output.replace("If you somehow see this text report this at https://git.staropensource.de/StarOpenSource/CORE/issues, thank you!", separator_final) return output + +func array_to_stringarray(array: Array) -> Array[String]: + var output: Array[String] = [] + + for item in array: + if typeof(item) != TYPE_STRING: + logger.error("Cannot convert Array to Array[String]: Item '" + str(item) + "' is not of type String") + return [] + output.append(item) + + return output