What
When trying to assign a LocalisedString to LuaGuiElement::caption that contains or is a LuaProfiler it errors:Value must be a string in property tree at ROOT.caption[...]
Expected
I would expect it to accept the LuaProfiler and show its elapsed time/duration. On save load I would expect it to show `N/A` in place of the profiler's string similar to how it works in the console.Reproduction
Code: Select all
/c
game.player.gui.center.add{type = "frame", caption = game.create_profiler()}
Full Context
I was making a happy little GUI for a test runner, so the elapsed time for each test would be a nice to have. It also prints to the log file though (with the times of course), so it truly is just nice to have.I tested with labels and frames, and used this command for comparison, then save loaded:
Code: Select all
/c
game.print{"", "hi: ", game.create_profiler()}