AlisterT / openjazz

OpenJazz
GNU General Public License v2.0
275 stars 49 forks source link

Don't show leading zeroes for the ammo count #71

Closed Calinou closed 12 months ago

Calinou commented 3 years ago

This makes the ammo count easier to read, especially since the 0 and 8 digits look very close to each other at a distance (or for those with poor eyesight). It also makes it more obvious when you're running low on ammo. This is less accurate to the original, but I think usability wins over accuracy here :slightly_smiling_face:

I'd like to apply this change to other HUD elements as well, but I couldn't figure it out from a quick look at the source code.

Preview

Before

image

After

image

carstene1ns commented 3 years ago

I think this is a good addition. However, staying close to the original engine should be priority here. We have a few compatibility features in the options, maybe we can add a "Clean HUD" - "Original HUD" there?

Calinou commented 3 years ago

We have a few compatibility features in the options, maybe we can add a "Clean HUD" - "Original HUD" there?

That makes sense. I'll look into it when I have time.

Do you know how the leading zeroes are drawn for the score, world and number of lives? From a quick look, this seems to be done in the Font class but I'm not sure how to modify it without breaking other places that might use it in the code.

carstene1ns commented 12 months ago

I am moving this into issue #79. With the new HUD, this issue will be solved.

Do you know how the leading zeroes are drawn for the score, world and number of lives?

These are actually part of the panel background, we would need to clear parts of it for this to work.

--- a/src/jj1/level/jj1levelframe.cpp
+++ b/src/jj1/level/jj1levelframe.cpp
@@ -418,6 +418,7 @@ void JJ1Level::draw () {
    // Show panel data

    // Show score
+   drawRect(20, canvasH - 27, 64, 7, LEVEL_BLACK); // clear
    panelSmallFont->showNumber(localPlayer->getScore(), 84, canvasH - 27);

    // Show time remaining