Skip to content

Commit

Permalink
so i don't forget anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
qimiko committed Nov 15, 2024
1 parent 1d495cb commit 1d91357
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/src/main/java/com/geode/launcher/GeometryDashActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
val errorMessage = when {
abiMismatch && is64bit -> LaunchUtils.LauncherError.LINKER_NEEDS_32BIT
abiMismatch -> LaunchUtils.LauncherError.LINKER_NEEDS_64BIT
e.message?.contains("__gxx_personality_v0") == true ->
LaunchUtils.LauncherError.LINKER_FAILED_STL
else -> LaunchUtils.LauncherError.LINKER_FAILED
}

Expand Down
15 changes: 14 additions & 1 deletion app/src/main/java/com/geode/launcher/main/ErrorComponents.kt
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,20 @@ fun ErrorInfoBody(failureReason: LaunchUtils.LauncherError, modifier: Modifier =
else -> stringResource(R.string.load_failed_generic_error_description)
}

val context = LocalContext.current
val recommendations = when (failureReason) {
LaunchUtils.LauncherError.LINKER_FAILED -> listOf(
LaunchUtils.LauncherError.LINKER_FAILED_STL -> {
val isDeveloper = PreferenceUtils.get(context).getBoolean(PreferenceUtils.Key.DEVELOPER_MODE)

buildList {
add(stringResource(R.string.load_failed_recommendation_update))
add(stringResource(R.string.load_failed_recommendation_report))

if (isDeveloper)
add(stringResource(R.string.load_failed_recommendation_dev_stl))
}
}
LaunchUtils.LauncherError.LINKER_FAILED -> listOfNotNull(
stringResource(R.string.load_failed_recommendation_reinstall),
stringResource(R.string.load_failed_recommendation_update),
)
Expand Down Expand Up @@ -100,6 +112,7 @@ fun ErrorInfoTitle(failureReason: LaunchUtils.LauncherError) {
val message = when (failureReason) {
LaunchUtils.LauncherError.LINKER_NEEDS_64BIT,
LaunchUtils.LauncherError.LINKER_NEEDS_32BIT,
LaunchUtils.LauncherError.LINKER_FAILED_STL,
LaunchUtils.LauncherError.LINKER_FAILED -> stringResource(R.string.load_failed_link_error)
LaunchUtils.LauncherError.GENERIC -> stringResource(R.string.load_failed_generic_error)
LaunchUtils.LauncherError.CRASHED -> stringResource(R.string.load_failed_crashed)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/geode/launcher/utils/LaunchUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ object LaunchUtils {
enum class LauncherError {
LINKER_NEEDS_64BIT,
LINKER_NEEDS_32BIT,
LINKER_FAILED_STL,
LINKER_FAILED,
GENERIC,
CRASHED;
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
<string name="load_failed_recommendation_update">Verify that the latest versions of the launcher and Geometry Dash are installed.</string>
<string name="load_failed_recommendation_report">Report this issue to the developers.</string>
<string name="load_failed_recommendation_safe_mode">Hold the Launch button to launch in safe mode.</string>
<string name="load_failed_recommendation_dev_stl">Devs: If this is a locally built Geode version, please use the c++_shared ANDROID_STL!</string>

<string name="message_box_cancel">Cancel</string>
<string name="message_box_accept">OK</string>
Expand Down

0 comments on commit 1d91357

Please sign in to comment.