| 889 | } |
| 890 | |
| 891 | QString 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 | |
| 926 | Task::Ptr MinecraftInstance::createUpdateTask(Net::Mode mode) |
| 927 | { |
no test coverage detected