-
sfernandez
Site Admin
- Posts: 3008
- Joined:
Re: Getting started with Unreal - lots of confusion
Hi,
If you have a way to convert the char id number into some text, then you can specify a converter in the style like this:
And the log string should specify the number as the content of the style tag: "Day 1, 4h: <char>552</> has spawned"
Could something like this work for you?
If you have a way to convert the char id number into some text, then you can specify a converter in the style like this:
Code: Select all
<Style x:Key="char" TargetType="ContentControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContentControl">
<TextBlock Text="{Binding Path=., Converter={StaticResource CharIdConverter}}" Foreground="DodgerBlue" FontWeight="Bold"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Could something like this work for you?
Re: Getting started with Unreal - lots of confusion
Thanks, that seems to be what I need. But how do I get the game world from within TryConvert? For some reason GetWorld() returns null from inside it so I assume I need some other way to get the world context, as I need access to my character subsystem to retrieve the name.
Additionally I am also not quite sure about the type conversions involved - am I supposed to return the FString I would ultimately retrieve from my subsystem as the name like this?
Additionally I am also not quite sure about the type conversions involved - am I supposed to return the FString I would ultimately retrieve from my subsystem as the name like this?
Code: Select all
result = Noesis::Boxing::Box<Noesis::String>(TCHAR_TO_UTF8(*charName));
Re: Getting started with Unreal - lots of confusion
Hi,
I'm not sure you even need a converter. You can just write the char ID when you add the string to the array, can't you? Those strings aren't meant to change, are they?
The way you use RichText::SetTryCreateInlineCallback is that you set it once. It's a global handler. You can then use a global variable to store the currect World to use within the function (or perhaps GWorld would just do). You can call the function once in you game module's startup function and then update the World variable as it changes.
Hope this helps!
I'm not sure you even need a converter. You can just write the char ID when you add the string to the array, can't you? Those strings aren't meant to change, are they?
The way you use RichText::SetTryCreateInlineCallback is that you set it once. It's a global handler. You can then use a global variable to store the currect World to use within the function (or perhaps GWorld would just do). You can call the function once in you game module's startup function and then update the World variable as it changes.
Hope this helps!
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 5 guests