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

Add TotalTimeLetter tag #34

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

Tenebrosful
Copy link
Contributor

@Tenebrosful Tenebrosful commented Mar 20, 2024

Hi, i wanted a better format for the total time with the h for hour replacing the :, so could be nice.

Feel free to change the name, naming is hard...

(Didn't tested because idk how to compile SDV mods but should works)

@Tenebrosful Tenebrosful changed the title Add TotalTimeLetterFormat tag Add TotalTimeLetter tag Mar 22, 2024
@Tenebrosful
Copy link
Contributor Author

image

@RuiNtD
Copy link
Owner

RuiNtD commented Mar 23, 2024

The original tag uses the same function that the SDV uses to format the time on the top right of the screen. If your game is set to French, I believe it should already be formatted with an h for hour.

case LocalizedContentManager.LanguageCode.fr:
    if (time % 100 != 0)
    {
        return text2 + "h" + time % 100;
    }

    return text2 + "h";

@Tenebrosful
Copy link
Contributor Author

The original tag uses the same function that the SDV uses to format the time on the top right of the screen. If your game is set to French, I believe it should already be formatted with an h for hour.

case LocalizedContentManager.LanguageCode.fr:
    if (time % 100 != 0)
    {
        return text2 + "h" + time % 100;
    }

    return text2 + "h";

That's the total save time spend, not currently time of the day

(Also i don't think that's a french thing, just wanted that because just XX:XX looks weird because you don't know if it's HH:MM or MM:SS)

@RuiNtD
Copy link
Owner

RuiNtD commented Mar 24, 2024

Considering how much this function changes the formatting based on language, it would make more sense to just replace the original function with a XhXm format.

@Tenebrosful
Copy link
Contributor Author

Considering how much this function changes the formatting based on language, it would make more sense to just replace the original function with a XhXm format.

I think we don't talk about the same thing, i'm talking about TotalTime that only use Utility.getHoursMinutesStringFromMiliseconds that is

public static string getHoursMinutesStringFromMilliseconds(ulong milliseconds)
{
    return milliseconds / 3600000 + ":" + ((milliseconds % 3600000 / 60000 < 10) ? "0" : "") + milliseconds % 3600000 / 60000;
}

and isn't location based. i think you talk about Time that use Game1.getTimeOfDayString

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants