1
0
mirror of synced 2025-02-08 22:59:41 +01:00

Display Score

This commit is contained in:
Stepland 2020-05-07 12:13:03 +02:00
parent ff8b139e6a
commit d0368f6fbc
3 changed files with 37 additions and 13 deletions

View File

@ -44,6 +44,13 @@
## Gameplay ## Gameplay
- Precise Input handling, the dirty way - Precise Input handling, the dirty way
- Sort out the wierdness when hitting early - Sort out the wierdness when hitting early
- Score
- compute
- Combo
- compute
- display
- Shutter
- compute
## Misc ## Misc
- Handling Resolution changes - Handling Resolution changes

11
TODO.md
View File

@ -8,17 +8,19 @@
## Gameplay Screen ## Gameplay Screen
- Score - Score
- compute
- display
- Combo
- compute
- display - display
- Shutter - Shutter
- display
- Density Graph
## Results Screen ## Results Screen
## Windows and macOS builds ## Windows and macOS builds
# v0.2.0
## Misc
- "Value" class with delayed update for *n i c e* score display
# v1.0.0 # v1.0.0
## Music Select Screen ## Music Select Screen
- bound memory usage of Toolkit::Cache - bound memory usage of Toolkit::Cache
@ -42,7 +44,6 @@
## Misc ## Misc
- Make Drawables lazily react to resolution changes - Make Drawables lazily react to resolution changes
- "Value" class with delayed update for *n i c e* score updates
- update .memon spec and memoncpp to support BPM Changes - update .memon spec and memoncpp to support BPM Changes
## FB9 Support ## FB9 Support

View File

@ -81,12 +81,12 @@ namespace Gameplay {
update_note_index(music_time); update_note_index(music_time);
window.clear(sf::Color(7, 23, 53)); window.clear(sf::Color(7, 23, 53));
// Draw Combo // Draw Combo
auto combo_now = combo.load(); auto current_combo = combo.load();
if (combo_now >= 4) { if (current_combo >= 4) {
sf::Text combo_text; sf::Text combo_text;
combo_text.setFont(shared.fallback_font.black); combo_text.setFont(shared.fallback_font.black);
combo_text.setFillColor(sf::Color(23, 78, 181)); combo_text.setFillColor(sf::Color(18, 59, 135));
combo_text.setString(std::to_string(combo_now)); combo_text.setString(std::to_string(current_combo));
combo_text.setCharacterSize(static_cast<unsigned int>(1.5*get_panel_step())); combo_text.setCharacterSize(static_cast<unsigned int>(1.5*get_panel_step()));
Toolkit::set_local_origin_normalized(combo_text, 0.5f, 0.5f); Toolkit::set_local_origin_normalized(combo_text, 0.5f, 0.5f);
combo_text.setPosition( combo_text.setPosition(
@ -95,6 +95,19 @@ namespace Gameplay {
); );
window.draw(combo_text); window.draw(combo_text);
} }
auto current_score = score.get_score();
sf::Text score_text;
score_text.setFont(shared.fallback_font.black);
score_text.setFillColor(sf::Color(29, 98, 226));
score_text.setString(std::to_string(current_score));
score_text.setCharacterSize(static_cast<unsigned int>(45.f/768.f*get_screen_width()));
Toolkit::set_local_origin_normalized(score_text, 1.f, 1.f);
score_text.setPosition(
500.f/768.f*get_screen_width(),
370.f/768.f*get_screen_width()
);
window.draw(score_text);
// Draw Notes // Draw Notes
for (auto i = note_index.load(); i < notes.size(); ++i) { for (auto i = note_index.load(); i < notes.size(); ++i) {
@ -124,7 +137,9 @@ namespace Gameplay {
} }
window.draw(shared.button_highlight); window.draw(shared.button_highlight);
window.draw(shared.black_frame); window.draw(shared.black_frame);
draw_debug(); if (debug) {
draw_debug();
}
ImGui::SFML::Render(window); ImGui::SFML::Render(window);
window.display(); window.display();
} }
@ -234,9 +249,10 @@ namespace Gameplay {
if (ImGui::Begin("Gameplay Debug")) { if (ImGui::Begin("Gameplay Debug")) {
ImGui::Text("Combo : %lu", combo.load()); ImGui::Text("Combo : %lu", combo.load());
if (ImGui::TreeNode("Score")) { if (ImGui::TreeNode("Score")) {
ImGui::Text("Raw : %d", score.get_score()); ImGui::Text("Raw : %d", score.get_score());
ImGui::Text("Final : %d", score.get_final_score()); ImGui::Text("Final : %d", score.get_final_score());
if (ImGui::TreeNode("Counts")) { ImGui::Text("Shutter value : %d", score.shutter);
if (ImGui::TreeNode("Judgement Counts")) {
ImGui::Text("PERFECT : %lu", score.judgement_counts.at(Data::Judgement::Perfect)); ImGui::Text("PERFECT : %lu", score.judgement_counts.at(Data::Judgement::Perfect));
ImGui::Text("GREAT : %lu", score.judgement_counts.at(Data::Judgement::Great)); ImGui::Text("GREAT : %lu", score.judgement_counts.at(Data::Judgement::Great));
ImGui::Text("GOOD : %lu", score.judgement_counts.at(Data::Judgement::Good)); ImGui::Text("GOOD : %lu", score.judgement_counts.at(Data::Judgement::Good));