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

pressing escape and back on friend's profile returns to own profile #1615

Merged
merged 1 commit into from Oct 16, 2014

Conversation

@quizywiz
Copy link
Contributor

@quizywiz quizywiz commented Oct 10, 2014

for issue #1611

@quizywiz
Copy link
Contributor Author

@quizywiz quizywiz commented Oct 11, 2014

Hello,
The code works okay - it doesn't trigger the "your profile" scene when pressing back/escape on any other screen. That's because the condition "!visiting profile -> is current user" is true only when you're visiting someone else's profile.
I will fix the other two problems you've mentioned - coding style, and putting the code in the right place

@hiker
Copy link
Contributor

@hiker hiker commented Oct 12, 2014

Hi,

I checked, yes, technically you are right (I missed that you can't leave this screen with a different profile activated. But the state manager should now handle any screen specific settings - it is very hard to understand the code if you study (say) this screen, since it's not obvious that in a completely unrelated helper class the behaviour is modified.
Re your question: just above the code you modified in the state manager is the answer:

        if (getCurrentScreen() != NULL &&
            getCurrentScreen()->onEscapePressed()) popMenu();

The state manager calls onEscapePressed, and only if that returns true will it pop the menu. So you can easily handle that by adding the (virtual) function onEscapePressed.

Hope that helps, and thanks for your work!
Joerg

@quizywiz quizywiz force-pushed the quizywiz:master branch 2 times, most recently from f3ac178 to 7d38d52 Oct 12, 2014
Also, fixed bug where user info dialog was accessing m_enter_profile
after it was deleted
@quizywiz quizywiz force-pushed the quizywiz:master branch from a44a854 to 6dd9fef Oct 14, 2014
@quizywiz
Copy link
Contributor Author

@quizywiz quizywiz commented Oct 15, 2014

I've put it in the onEscapePressed function. I fixed a minor bug i found in another file too. :)

@hiker hiker merged commit 6dd9fef into supertuxkart:master Oct 16, 2014
1 check passed
1 check passed
@auriamg
continuous-integration/travis-ci The Travis CI build passed
Details
@hiker
Copy link
Contributor

@hiker hiker commented Oct 16, 2014

Thanks a lot - and good catch with the bug ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants