Dictionary/Map support within Studio
Hi,
Is there a way to create a data structure the imitates an Unreal TMap in Studio? Looking at the documentation I need to use the Dictionary data type but that isn't an option within Studio. (Documentation link: https://www.noesisengine.com/docs/Gui.C ... ty-binding)
I am working on a system where our UI Designer can choose what named data to display in a given screen. That named data is stored within a map to allow for flexibility (some screens may want only 2 things displaying and others may want 4 but we want them named so art/design know what they're placing where in studio)
Cheers,
Charlie
Is there a way to create a data structure the imitates an Unreal TMap in Studio? Looking at the documentation I need to use the Dictionary data type but that isn't an option within Studio. (Documentation link: https://www.noesisengine.com/docs/Gui.C ... ty-binding)
I am working on a system where our UI Designer can choose what named data to display in a given screen. That named data is stored within a map to allow for flexibility (some screens may want only 2 things displaying and others may want 4 but we want them named so art/design know what they're placing where in studio)
Cheers,
Charlie
Re: Dictionary/Map support within Studio
Independently of Studio, I remember doing similar things using a Container type and a Converter to fetch a given value with Key as a ConverterParameter.
It takes a bit of boiler plate (Potentially container for a Dictionary, the converter, and all the bindings will maybe be a bit verbose, but doable, even in Noesis Studio, if you have access to add more converter and type, once the converter in place, it is all usable through the Editor)
It takes a bit of boiler plate (Potentially container for a Dictionary, the converter, and all the bindings will maybe be a bit verbose, but doable, even in Noesis Studio, if you have access to add more converter and type, once the converter in place, it is all usable through the Editor)
-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: Dictionary/Map support within Studio
Hi CharlieD,
This is something we still haven't implemented in Studio, but we have future plans to expose dictionary/map properties in our Data Structures. Could you please create a ticket in our bugtracker to follow the status of this feature?
As jinfox mentions (thanks!) you can use a converter to access a specific key in the meantime if you expose the map as a property:
Could you try that?
This is something we still haven't implemented in Studio, but we have future plans to expose dictionary/map properties in our Data Structures. Could you please create a ticket in our bugtracker to follow the status of this feature?
As jinfox mentions (thanks!) you can use a converter to access a specific key in the meantime if you expose the map as a property:
Code: Select all
<TextBlock Text="{Binding EntriesMap, Converter={StaticResource MapEntryConverter}, ConverterParameter=EntryA}"/>Re: Dictionary/Map support within Studio
Thank you both for your replies. I have created the bug here: https://www.noesisengine.com/bugs/view.php?id=4569
I am not sure what the convertor is achieving here as I can already access the values in the map by directly referencing it:
Please let me know if there is an edge case I haven't seen in my quick test I did last week!
Thanks again,
Charlie
I am not sure what the convertor is achieving here as I can already access the values in the map by directly referencing it:
Code: Select all
<TextBlock Text="{Binding MyMap[EntryA]}"/>
Thanks again,
Charlie
-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: Dictionary/Map support within Studio
Thanks for the report!
Your binding syntax is perfectly valid and works fine in NoesisGUi runtime.
The problem is that the dictionary syntax cannot be used in Studio, and what we proposed is a workaround that already works in Studio. The converter will take the Map as the value and the key as the ConverterParameter, and will return the corresponding entry in the Map.
Your binding syntax is perfectly valid and works fine in NoesisGUi runtime.
The problem is that the dictionary syntax cannot be used in Studio, and what we proposed is a workaround that already works in Studio. The converter will take the Map as the value and the key as the ConverterParameter, and will return the corresponding entry in the Map.
Who is online
Users browsing this forum: No registered users and 2 guests