diff --git a/app_pojavlauncher/src/main/java/com/kdt/mcgui/mcAccountSpinner.java b/app_pojavlauncher/src/main/java/com/kdt/mcgui/mcAccountSpinner.java index ffe842589..e67721f73 100644 --- a/app_pojavlauncher/src/main/java/com/kdt/mcgui/mcAccountSpinner.java +++ b/app_pojavlauncher/src/main/java/com/kdt/mcgui/mcAccountSpinner.java @@ -34,6 +34,7 @@ import net.kdt.pojavlaunch.authenticator.microsoft.MicrosoftBackgroundLogin; import net.kdt.pojavlaunch.extra.ExtraConstants; import net.kdt.pojavlaunch.extra.ExtraCore; import net.kdt.pojavlaunch.extra.ExtraListener; +import net.kdt.pojavlaunch.services.ProgressService; import net.kdt.pojavlaunch.value.MinecraftAccount; import java.io.File; @@ -165,8 +166,10 @@ public class mcAccountSpinner extends AppCompatSpinner implements AdapterView.On public void removeCurrentAccount(){ int position = getSelectedItemPosition(); if(position == 0) return; - + File accountFile = new File(Tools.DIR_ACCOUNT_NEW, mAccountList.get(position)+".json"); + if(accountFile.exists()) accountFile.delete(); mAccountList.remove(position); + reloadAccounts(false, 0); } diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/LauncherActivity.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/LauncherActivity.java index 56f19971c..9ad320ca6 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/LauncherActivity.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/LauncherActivity.java @@ -108,24 +108,24 @@ public class LauncherActivity extends BaseActivity { private final ExtraListener mLaunchGameListener = (key, value) -> { if(mProgressLayout.hasProcesses()){ - Toast.makeText(this, "Tasks are in progress, please wait", Toast.LENGTH_LONG).show(); + Toast.makeText(this, R.string.tasks_ongoing, Toast.LENGTH_LONG).show(); return false; } String selectedProfile = LauncherPreferences.DEFAULT_PREF.getString(LauncherPreferences.PREF_KEY_CURRENT_PROFILE,""); if (LauncherProfiles.mainProfileJson == null || LauncherProfiles.mainProfileJson.profiles == null || !LauncherProfiles.mainProfileJson.profiles.containsKey(selectedProfile)){ - Toast.makeText(this, "No selected version", Toast.LENGTH_LONG).show(); + Toast.makeText(this, R.string.error_no_version, Toast.LENGTH_LONG).show(); return false; } MinecraftProfile prof = LauncherProfiles.mainProfileJson.profiles.get(selectedProfile); if (prof == null || prof.lastVersionId == null){ - Toast.makeText(this, "No selected version", Toast.LENGTH_LONG).show(); + Toast.makeText(this, R.string.error_no_version, Toast.LENGTH_LONG).show(); return false; } if(mAccountSpinner.getSelectedAccount() == null){ - Toast.makeText(this, "No selected minecraft account", Toast.LENGTH_LONG).show(); + Toast.makeText(this, R.string.no_saved_accounts, Toast.LENGTH_LONG).show(); return false; } diff --git a/app_pojavlauncher/src/main/res/values/strings.xml b/app_pojavlauncher/src/main/res/values/strings.xml index 44b71130d..8d35b4d13 100644 --- a/app_pojavlauncher/src/main/res/values/strings.xml +++ b/app_pojavlauncher/src/main/res/values/strings.xml @@ -316,4 +316,6 @@ Insert folder name Login done Add account + Tasks are in progress, please wait + No saved accounts