-
Notifications
You must be signed in to change notification settings - Fork 19
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
Added Highscore window #32
base: master
Are you sure you want to change the base?
Added Highscore window #32
Conversation
I've added the floating window for entering high score, but there seems to be some kind of bug. Whenever the game ends (and the current highscore is greater than the previous one) the window is supposed to pop up, instead the application crashes. Would you please take a look? |
Can you attach a Debugger debug report? It will help in investigating without having to compile and test the code |
Here is the debug report |
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.
Your debug report will be a lot more useful if you compile the application in debug mode. I think you can use "make DEBUG=1" in the command line to do that. It should help seeing exactly where there is a problem.
Sure, here is the debug report built in Debugging mode |
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.
Just commenting on the visuals.
Plus:
- The app crashes when closing the window.
- In the main window, it'd be nice if the name of the current high-scoring person were shown as well as the high score.
|
||
HighscoreWindow::HighscoreWindow(const char* oldHighscorer, const int32 oldHighscore, const int32 newHighscore) | ||
: | ||
BWindow(BRect(200, 200, 600, 450), B_TRANSLATE("Enter you High Score"), B_TITLED_WINDOW, 0) |
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.
You don't actually enter your high score. Maybe something more celebratory as window title:
BWindow(BRect(200, 200, 600, 450), B_TRANSLATE("Enter you High Score"), B_TITLED_WINDOW, 0) | |
BWindow(BRect(200, 200, 600, 450), B_TRANSLATE("New high-score""), B_TITLED_WINDOW, 0) |
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.
The window doesn't need to be resizable or zoomable.
fInputBox->MakeFocus(); | ||
|
||
BStringView* line1 = new BStringView("line1", B_TRANSLATE("You achieved a new highscore, beating the one")); | ||
BString line2Text = B_TRANSLATE("by %oldHighscorer% by %deltaScore%."); |
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.
Needs to take into account if there's no old high score.
line3Text.ReplaceFirst("%newhighscore%", std::to_string(newHighscore).c_str()); | ||
BStringView* line2 = new BStringView("line2", line2Text.String()); | ||
BStringView* line3 = new BStringView("line3", line3Text.String()); | ||
|
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.
Why not just one BStringView with \n newlines?
It may be nicer to have the new high-score up at the top with the "Congratulations", maybe equally large font size, and everything center aligned:
Congratulations!
New high-score: 23000You've beaten {UserLoser}'s
old record by 1234 points!Please enter your name: [_______________]
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.
How do you submit your name?
Maybe with a BButton below it all "Hurray!".
Top score bar stays put on window resize Top score bar stays put on window resize (HaikuArchives#34) Add files from pull request HaikuArchives#32 Update layout on high score window Send BMessage to save score and name Designing the highscore window Redesign High-score window Handle previous score and username Handle no previous highscore Remove unnecessary include Upload new screenshot Change high-score message
For issue #21
I've added the floating window for entering highscore, as mentioned in the issue description. Please take a look.