MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / getStatusbarDescription

Method getStatusbarDescription

launcher/minecraft/MinecraftInstance.cpp:891–924  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

889}
890
891QString MinecraftInstance::getStatusbarDescription()
892{
893 QStringList traits;
894 if (hasVersionBroken())
895 {
896 traits.append(tr("broken"));
897 }
898
899 QString mcVersion = m_components->getComponentVersion("net.minecraft");
900 if (mcVersion.isEmpty())
901 {
902 // Load component info if needed
903 m_components->reload(Net::Mode::Offline);
904 mcVersion = m_components->getComponentVersion("net.minecraft");
905 }
906
907 QString description;
908 description.append(tr("Minecraft %1").arg(mcVersion));
909 if(m_settings->get("ShowGameTime").toBool())
910 {
911 if (lastTimePlayed() > 0) {
912 description.append(tr(", last played for %1").arg(Time::prettifyDuration(lastTimePlayed())));
913 }
914
915 if (totalTimePlayed() > 0) {
916 description.append(tr(", total played for %1").arg(Time::prettifyDuration(totalTimePlayed())));
917 }
918 }
919 if(hasCrashed())
920 {
921 description.append(tr(", has crashed."));
922 }
923 return description;
924}
925
926Task::Ptr MinecraftInstance::createUpdateTask(Net::Mode mode)
927{

Callers 2

retranslateUiMethod · 0.45
instanceChangedMethod · 0.45

Calls 5

appendMethod · 0.80
getComponentVersionMethod · 0.80
isEmptyMethod · 0.80
reloadMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected