Small class to display warning and error prompts#774
Conversation
Will probably only work while in-game, only tested from context of `LoadingExtension.OnLevelLoaded()`.
|
Nice. |
|
Any ideas on how to determine whether to use |
I think you can use it even from main thread. Doesn't seem to break anything if you do. Here is the code (game internals): public void QueueMainThread(Action action) {
if (Dispatcher.currentSafe == ThreadHelper.dispatcher)
{
action();
}
else
{
ThreadHelper.dispatcher.Dispatch(action);
}
} |
|
@krzychu124 is the EDIT: I'll test to find out... |
Yes, instance is almost always present. To be safe I suggest waiting until |
|
Just tested I can test for |
|
ready for review |
kvakvs
left a comment
There was a problem hiding this comment.
Pleasure to read the code :)
Just a simple helper to display warning/error prompts in center of screen.
There's a few places where these things are used, most notably:
GuideManager?Usage from call site:
TODO:
Singleton<SimulationManager>.instance.m_ThreadingWrapper.QueueMainThread, so they will only work while in-game. From main menu, that stuff isn't required.QueueMainThreadstuff?System.Threading.Thread.CurrentThread.Name != "Simulation"like inGuideWrapper.cs?Answers on a postcard to usual address please :)
...Format()method overloads.PrompthelperFollowing prompts have been updated:
ShowError()renamed toShowWarning()now usesPrompt.Warning(), affects:LoadingExtenionhas not been altered as it will be replaced by PRs Lifecycle part 1 - IUserMod #773 and Updated compatibility checker #699.