Allow launching through only the dummy launcher (need to wait for the runtime to extract first without an indicator)

This commit is contained in:
downthecrop 2023-07-29 22:32:13 -07:00
parent d38e576ab4
commit 176bfbcef0
6 changed files with 9 additions and 52 deletions

View file

@ -40,7 +40,7 @@
android:value="ratio_float" />
<activity
android:name=".DummyLauncher"
android:name=".TestStorageActivity"
android:exported="true"
android:label="@string/app_short_name"
android:launchMode="singleTop">
@ -52,6 +52,9 @@
<activity
android:name=".LauncherActivity"
android:label="@string/app_short_name" />
<activity
android:name=".DummyLauncher"
android:label="@string/app_short_name" />
<activity
android:name=".ImportControlActivity"
android:configChanges="keyboard|keyboardHidden"

View file

@ -1,9 +1,5 @@
package net.kdt.pojavlaunch;
import static net.kdt.pojavlaunch.Tools.launchGLJRE;
import androidx.appcompat.app.AppCompatActivity;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Intent;
@ -21,15 +17,12 @@ import android.widget.Toast;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import net.kdt.pojavlaunch.value.MinecraftAccount;
import net.kdt.pojavlaunch.value.launcherprofiles.MinecraftProfile;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
public class DummyLauncher extends AppCompatActivity {
public class DummyLauncher extends BaseActivity {
private FloatingActionButton fab;
private Button playHD;
@ -57,7 +50,6 @@ public class DummyLauncher extends AppCompatActivity {
Intent intent = new Intent(DummyLauncher.this, JavaGUILauncherActivity.class);
startActivity(intent);
});
fab.setOnClickListener(view -> showBottomDialog());
}

View file

@ -301,8 +301,4 @@ public class LauncherActivity extends BaseActivity {
mAccountSpinner = findViewById(R.id.account_spinner);
mProgressLayout = findViewById(R.id.progress_layout);
}
}

View file

@ -86,8 +86,6 @@ public class MainActivity extends BaseActivity implements ControlButtonMenuListe
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
minecraftProfile = LauncherProfiles.getCurrentProfile();
MCOptionUtils.load(Tools.getGameDirPath(minecraftProfile).getAbsolutePath());
GameService.startService(this);
initLayout(R.layout.activity_basemain);
CallbackBridge.addGrabListener(touchpad);
@ -138,23 +136,7 @@ public class MainActivity extends BaseActivity implements ControlButtonMenuListe
// FIXME: is it safe for multi thread?
GLOBAL_CLIPBOARD = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
touchCharInput.setCharacterSender(new LwjglCharSender());
if(minecraftProfile.pojavRendererName != null) {
Log.i("RdrDebug","__P_renderer="+minecraftProfile.pojavRendererName);
Tools.LOCAL_RENDERER = minecraftProfile.pojavRendererName;
}
setTitle("Minecraft " + minecraftProfile.lastVersionId);
// Minecraft 1.13+
String version = getIntent().getStringExtra(INTENT_MINECRAFT_VERSION);
version = version == null ? minecraftProfile.lastVersionId : version;
JMinecraftVersionList.Version mVersionInfo = Tools.getVersionInfo(version);
isInputStackCall = mVersionInfo.arguments != null;
CallbackBridge.nativeSetUseInputStackQueue(isInputStackCall);
CallbackBridge.nativeSetUseInputStackQueue(false);
Tools.getDisplayMetrics(this);
windowWidth = Tools.getDisplayFriendlyRes(currentDisplayMetrics.widthPixels, 1f);
windowHeight = Tools.getDisplayFriendlyRes(currentDisplayMetrics.heightPixels, 1f);
@ -176,9 +158,6 @@ public class MainActivity extends BaseActivity implements ControlButtonMenuListe
navDrawer.setAdapter(gameActionArrayAdapter);
navDrawer.setOnItemClickListener(gameActionClickListener);
drawerLayout.closeDrawers();
final String finalVersion = version;
minecraftGLView.setSurfaceReadyListener(() -> {
try {
// Setup virtual mouse right before launching
@ -200,10 +179,7 @@ public class MainActivity extends BaseActivity implements ControlButtonMenuListe
private void loadControls() {
try {
// Load keys
mControlLayout.loadLayout(
minecraftProfile.controlFile == null
? LauncherPreferences.PREF_DEFAULTCTRL_PATH
: Tools.CTRLMAP_PATH + "/" + minecraftProfile.controlFile);
mControlLayout.loadLayout(LauncherPreferences.PREF_DEFAULTCTRL_PATH);
} catch(IOException e) {
try {
Log.w("MainActivity", "Unable to load the control file, loading the default now", e);
@ -516,15 +492,11 @@ public class MainActivity extends BaseActivity implements ControlButtonMenuListe
MainActivity.mControlLayout.loadLayout((CustomControls)null);
MainActivity.mControlLayout.setModifiable(false);
System.gc();
MainActivity.mControlLayout.loadLayout(
minecraftProfile.controlFile == null
? LauncherPreferences.PREF_DEFAULTCTRL_PATH
: Tools.CTRLMAP_PATH + "/" + minecraftProfile.controlFile);
MainActivity.mControlLayout.loadLayout(LauncherPreferences.PREF_DEFAULTCTRL_PATH);
mDrawerPullButton.setVisibility(mControlLayout.hasMenuButton() ? View.GONE : View.VISIBLE);
} catch (IOException e) {
Tools.showError(this,e);
}
//((MainActivity) this).mControlLayout.loadLayout((CustomControls)null);
navDrawer.setAdapter(gameActionArrayAdapter);
navDrawer.setOnItemClickListener(gameActionClickListener);
isInEditor = false;

View file

@ -662,12 +662,6 @@ public class MinecraftGLSurface extends View implements GrabListener {
private void realStart(Surface surface){
// Initial size set
refreshSize();
//Load Minecraft options:
MCOptionUtils.set("fullscreen", "off");
MCOptionUtils.set("overrideWidth", String.valueOf(windowWidth));
MCOptionUtils.set("overrideHeight", String.valueOf(windowHeight));
MCOptionUtils.save();
getMcScale();
JREUtils.setupBridgeWindow(surface);

View file

@ -64,7 +64,7 @@ public class TestStorageActivity extends Activity {
AsyncAssetManager.unpackComponents(this);
AsyncAssetManager.unpackSingleFiles(this);
Intent intent = new Intent(this, LauncherActivity.class);
Intent intent = new Intent(this, DummyLauncher.class);
startActivity(intent);
finish();
}