@@ -744,7 +744,6 @@ fun PlayButton(
744744 }
745745 }
746746
747-
748747 if (showSafeModeDialog) {
749748 SafeModeDialog (
750749 onDismiss = {
@@ -762,6 +761,20 @@ fun PlayButton(
762761 }
763762}
764763
764+ @Composable
765+ fun LaunchBlockedLabel (text : String ) {
766+ val context = LocalContext .current
767+
768+ Column (horizontalAlignment = Alignment .CenterHorizontally ) {
769+ Text (text, modifier = Modifier .padding(12 .dp))
770+ OutlinedButton (onClick = { onSettings(context) }) {
771+ Icon (Icons .Filled .Settings , contentDescription = null )
772+ Spacer (Modifier .size(ButtonDefaults .IconSpacing ))
773+ Text (context.getString(R .string.launcher_settings))
774+ }
775+ }
776+ }
777+
765778@Composable
766779fun MainScreen (
767780 gdInstalled : Boolean = true,
@@ -772,7 +785,6 @@ fun MainScreen(
772785 val context = LocalContext .current
773786
774787 val shouldUpdate by PreferenceUtils .useBooleanPreference(PreferenceUtils .Key .UPDATE_AUTOMATICALLY )
775-
776788 val autoUpdateState by releaseViewModel.uiState.collectAsState()
777789
778790 val geodeJustInstalled = (autoUpdateState as ? ReleaseViewModel .ReleaseUIState .Finished )
@@ -834,15 +846,23 @@ fun MainScreen(
834846
835847 when {
836848 gdInstalled && geodeInstalled -> {
837- val stopLaunch = releaseViewModel.isInUpdate || hasError
838- PlayButton (
839- stopAutomaticLaunch = stopLaunch,
840- blockLaunch = releaseViewModel.isInUpdate,
841- onPlayGame = { safeMode ->
842- launchInSafeMode = safeMode
843- beginLaunch = true
844- },
845- )
849+ val gdVersion = remember {
850+ LaunchUtils .getGeometryDashVersionCode(context.packageManager)
851+ }
852+
853+ if (gdVersion < Constants .SUPPORTED_VERSION_CODE ) {
854+ LaunchBlockedLabel (stringResource(R .string.game_outdated))
855+ } else {
856+ val stopLaunch = releaseViewModel.isInUpdate || hasError
857+ PlayButton (
858+ stopAutomaticLaunch = stopLaunch,
859+ blockLaunch = releaseViewModel.isInUpdate,
860+ onPlayGame = { safeMode ->
861+ launchInSafeMode = safeMode
862+ beginLaunch = true
863+ },
864+ )
865+ }
846866 }
847867 gdInstalled -> {
848868 Text (
@@ -871,20 +891,7 @@ fun MainScreen(
871891 }
872892 }
873893 }
874- else -> {
875- Text (
876- context.getString(R .string.game_not_found),
877- modifier = Modifier .padding(12 .dp)
878- )
879- OutlinedButton (onClick = { onSettings(context) }) {
880- Icon (
881- Icons .Filled .Settings ,
882- contentDescription = context.getString(R .string.launcher_settings_icon_alt)
883- )
884- Spacer (Modifier .size(ButtonDefaults .IconSpacing ))
885- Text (context.getString(R .string.launcher_settings))
886- }
887- }
894+ else -> LaunchBlockedLabel (stringResource(R .string.game_not_found))
888895 }
889896
890897 UpdateCard (
0 commit comments