i overthought it

This commit is contained in:
Chloe committed 2024-11-03 06:11:41 -07:00
1 parent 03e12bf701
commit 1fd72ba8bc
3 files changed
+27 -3

No files matched your search

@@ -25,6 +25,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
@@ -189,6 +190,16 @@ fun MainScreen(
beginLaunch = true
},
)
if (gdVersion < Constants.SUPPORTED_VERSION_CODE) {
ElevatedCard(modifier = Modifier.padding(8.dp)) {
Text(
stringResource(R.string.launcher_game_update_required),
textAlign = TextAlign.Center,
modifier = Modifier.padding(8.dp).sizeIn(maxWidth = 512.dp)
)
}
}
}
}
gdInstalled -> {
@@ -51,6 +51,8 @@ import com.geode.launcher.ui.theme.GeodeLauncherTheme
import com.geode.launcher.ui.theme.LocalTheme
import com.geode.launcher.ui.theme.Theme
import com.geode.launcher.ui.theme.Typography
import com.geode.launcher.utils.Constants
import com.geode.launcher.utils.GamePackageUtils
import com.geode.launcher.utils.LaunchUtils
import com.geode.launcher.utils.PreferenceUtils
import java.net.ConnectException
@@ -178,9 +180,16 @@ fun UpdateIndicator(
context.getString(R.string.preference_check_for_updates_success)
)
} else {
snackbarHostState.showSnackbar(
context.getString(R.string.preference_check_for_updates_none_found)
)
val gdInstalled = GamePackageUtils.isGameInstalled(context.packageManager)
if (gdInstalled && GamePackageUtils.getGameVersionCode(context.packageManager) < Constants.SUPPORTED_VERSION_CODE) {
snackbarHostState.showSnackbar(
context.getString(R.string.launcher_game_update_required_short)
)
} else {
snackbarHostState.showSnackbar(
context.getString(R.string.preference_check_for_updates_none_found)
)
}
}
}
else -> {}
+4
View File
@@ -33,6 +33,10 @@
<string name="launcher_unsupported_version_description">
The current version of Geometry Dash is not compatible with the version supported by the launcher. A launcher update is required to fix this.\nLaunch will continue, but crashes may occur!
</string>
<string name="launcher_game_update_required_short">A Geometry Dash update is required.</string>
<string name="launcher_game_update_required">The currently installed version of Geometry Dash is out-of-date. Please update to continue receiving Geode updates.</string>
<string name="launcher_update_available">A new launcher update is available!</string>
<string name="launcher_update_dismiss">Dismiss</string>
<string name="safe_mode_enable_title">Enable safe mode?</string>