Skip to content
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

Show autosave configure notifcation after first typing in play mode #1263

Merged
merged 6 commits into from
Jul 29, 2019

Conversation

krasnotsvetov
Copy link
Collaborator

No description provided.

MainThreadDispatcher.Instance.Queue(() =>
{

var tab = UnityUtils.UnityVersion >= new Version(2018, 2) ? "_General" : "Rider";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding try-catch-log may be good idea here.

if (!lifetimeDefinition.isAlive)
return

val generalSettings = GeneralSettings.getInstance()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's move GeneralSettings.getInstance out of this scope, so it won't be calculated for every doc change

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops. Thanks!

val eventMulticaster = EditorFactory.getInstance().eventMulticaster
val documentListener: DocumentListener = object : DocumentListener {
override fun documentChanged(event: DocumentEvent) {
if (unityHost.model.editorState.valueOrDefault(EditorState.Disconnected) != EditorState.ConnectedPlay)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this works for o(1) then it's fine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, our model properties cache value

if (!unityHost.model.scriptCompilationDuringPlay.hasValue)
return

if (unityHost.model.scriptCompilationDuringPlay.valueOrThrow != ScriptCompilationDuringPlay.RecompileAndContinuePlaying)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why valueOrThrow? Isn't throwing assertions here too aggressive?

lifetimeDefinition.terminate()
}

panel.createActionLabel("Don't show again") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Do not show again"
Please avoid using "don't", "ain't" and other reductions in UI

@krasnotsvetov krasnotsvetov merged commit dc98e95 into 192 Jul 29, 2019
@citizenmatt citizenmatt added this to the Rider 2019.2 milestone Aug 14, 2019
@citizenmatt citizenmatt deleted the 192-vk-autosave branch August 14, 2019 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants