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

"You paid 1 credits" #4068

Closed
Amazinite opened this issue Dec 15, 2018 · 3 comments
Closed

"You paid 1 credits" #4068

Amazinite opened this issue Dec 15, 2018 · 3 comments
Labels
bug Something in the game is not behaving as intended
Milestone

Comments

@Amazinite
Copy link
Collaborator

image

Should be "1 credit".

@Amazinite Amazinite added the bug Something in the game is not behaving as intended label Dec 15, 2018
@tehhowch
Copy link
Collaborator

tehhowch commented Dec 15, 2018

Combination of rounding and formatting, I think.

Fractional values are plural (e.g. 1.05 minutes), but the formatter will round credits to whole values. The string is built using the raw value, not the formatted value.
Nope:

out << "You paid ";
// If you made payments of all three types, the punctuation needs to
// include commas, so just handle that separately here.
if(salariesPaid && mortgagesPaid && finesPaid)
out << Format::Credits(salariesPaid) << " credits in crew salaries, " << Format::Credits(mortgagesPaid)
<< " in mortgages, and " << Format::Credits(finesPaid) << " in fines.";
else
{
if(salariesPaid)
out << Format::Credits(salariesPaid) << ((mortgagesPaid || finesPaid) ?
" credits in crew salaries and " : " credits in crew salaries.");
if(mortgagesPaid)
out << Format::Credits(mortgagesPaid) << (salariesPaid ? " " : " credits ")
<< (finesPaid ? "in mortgage payments and " : "in mortgage payments.");
if(finesPaid)
out << Format::Credits(finesPaid) << ((salariesPaid || mortgagesPaid) ?
" in fines." : " credits in fines.");
}
return out.str();

Checks for single-credit payment just haven't been added in this section.

@tehhowch
Copy link
Collaborator

So the desired strings are like:

"You paid 1 credit in mortgage payments and 1,234 in fines."
"You paid 1 credit in fines."

or are we also wanting to insert the plural credits before fines:

"You paid 1 credit in mortgage payments and 1,234 credits in fines."

Current behavior is for credits to only appear once in the payment message.

(Crew salaries can only be 0 or >= 100 credits)

@tehhowch
Copy link
Collaborator

Fixed by 888da5b

@tehhowch tehhowch added this to the 0.9.9 (done) milestone Mar 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something in the game is not behaving as intended
Projects
None yet
Development

No branches or pull requests

2 participants