-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pleasure to read the code :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look very good 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.QueueMainThread
stuff?System.Threading.Thread.CurrentThread.Name != "Simulation"
like inGuideWrapper.cs
?Answers on a postcard to usual address please :)
...Format()
method overloads.Prompt
helperFollowing prompts have been updated:
ShowError()
renamed toShowWarning()
now usesPrompt.Warning()
, affects:LoadingExtenion
has not been altered as it will be replaced by PRs Lifecycle part 1 - IUserMod #773 and Updated compatibility checker #699.