Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/microbe_stage/gui/ExtinctionBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/// </summary>
public partial class ExtinctionBox : CustomWindow
{
public string AmountSuffix = Constants.MICROBE_POPULATION_SUFFIX;
#pragma warning disable CA2213
[Export]
private Control extinctionMenu = null!;
Expand Down Expand Up @@ -143,8 +144,7 @@ private void UpdateContinueOption()
{
continueButton.Visible = true;
continueText.ExtendedBbcode = Localization.Translate("CONTINUE_AS_SPECIES")
.FormatSafe(ShowContinueAs.FormattedNameBbCode,
StringUtils.ThreeDigitFormat(ShowContinueAs.Population));
.FormatSafe(ShowContinueAs.FormattedNameBbCode, $"{ShowContinueAs.Population} {AmountSuffix}");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to create an AmountSuffix field on the class, just use the constant value directly

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is what I thought, but it's how it was done in already existing code in this project.
Screenshot 2025-12-22 070821
Screenshot 2025-12-22 070536

It is exported here though. Is that why it's supposed to be done in this case or should it be changed here as well?

Regardless, I have made the changes and am adding those to this pull request.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm interesting, tbh I have no idea what it's for, it seems there is no point in making it an exported value here. Maybe it's some left-over code? Git says our lead programmer wrote these lines, so we would need to wait until he's back from the break.

If you look in two other places where this value is used you can see that it is used directly, example:

predictionDetailsText.Append(new LocalizedString("ENERGY_SUMMARY_LINE", Round(energyResult.Value.TotalEnergyGathered), Round(energyResult.Value.IndividualCost), $"{energyResult.Value.UnadjustedPopulation} {Constants.MICROBE_POPULATION_SUFFIX}"));

I would propose to also do it like that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason why the suffix is made configurable is that each species type will in the future need to have its own value, for example multicell and especially macroscopic species will not have trillions of members. So there should be enough configurability put in the code that deals with the suffises so that it isn't a major headache later to solve. Without reading my own older code, I bet that that was what I was doing but obviously as the different suffix constants aren't made yet, the design might not be fully "tested" so to speak.

The nonconfigurability un auto-evo is kind of fine for now as auto-evo is not implemented for any other species type than microbes. But yes there as well the suffix will need to be made configurable.

p.s. I'm still on break but I couldn't help seeing the notification with some reference being made to me so I ended up reading the notification and then writing this message.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hhyyrylainen I'm not sure when you'll be back, but I also just returned from a holiday break, so I wanted to ask a question about this. Right now, even in my example photos, there are >999T values still being represented with a T. I think when I was playing before, I saw numbers with the Q suffix at the end. If we're currently using the T for all microbes, are those values also using an older system, or are they using a newer suffix system than what I got approved here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StringUtils.FormatNumber is the right way to ask to format big numbers. I haven't yet looked at the code here as I've had over 100 notification emails to go through, but also you need to multiply the number by population *= Constants.MICROBE_POPULATION_MULTIPLIER; first if the species is a microbe.

continueText.Visible = true;
}
else
Expand Down
4 changes: 3 additions & 1 deletion src/microbe_stage/gui/PatchDetailsPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
public partial class PatchDetailsPanel : PanelContainer, IArchiveUpdatable
{
public const ushort SERIALIZATION_VERSION = 1;
public string AmountSuffix = Constants.MICROBE_POPULATION_SUFFIX;

#pragma warning disable CA2213
[Export]
Expand Down Expand Up @@ -441,7 +442,8 @@ private void UpdatePatchDetails()
foreach (var species in SelectedPatch.SpeciesInPatch.Keys.OrderBy(s => s.FormattedName))
{
speciesList.AppendLine(Localization.Translate("SPECIES_WITH_POPULATION").FormatSafe(
species.FormattedNameBbCode, SelectedPatch.GetSpeciesSimulationPopulation(species)));
species.FormattedNameBbCode,
$"{SelectedPatch.GetSpeciesSimulationPopulation(species)} {AmountSuffix}"));
}

speciesInfoDisplay.ExtendedBbcode = speciesList.ToString();
Expand Down