Skip to content

Add Helper Methods for Scene Loading#93

Open
EvroDeveloper wants to merge 8 commits intoyowchap:mainfrom
EvroDeveloper:main
Open

Add Helper Methods for Scene Loading#93
EvroDeveloper wants to merge 8 commits intoyowchap:mainfrom
EvroDeveloper:main

Conversation

@EvroDeveloper
Copy link

@EvroDeveloper EvroDeveloper commented Feb 3, 2025

  • Added LoadLevel methods, supports string barcodes or Crate References, with optional overloads for specific loading scenes.
  • Added FadeLoadLevel methods, same parameters as all the Load level methods, but will trigger a short fadeout to black before loading the level (just like patch 3). Includes an extra bool parameter to specify if it should fade with the fast variant.

Also added the two types of LoadFade barcodes to CommonBarcodes

(this was all done on a chromebook via vscode, there may be errors and stuff)

MelonCoroutines.Start(FadeIntoLevel(new Barcode(levelBarcode), new Barcode(loadLevelBarcode), fastFade));
}

private static IEnumerator FadeIntoLevel(Barcode level, Barcode loadScene, bool fastFade = false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method has errors, fixed:

private static System.Collections.IEnumerator FadeIntoLevel(Barcode level, Barcode loadScene, bool fastFade = false)
{
    if (fastFade)
    {
        SpawnCrate(CommonBarcodes.Misc.LoadFadeFast, Vector3.zero);
        yield return new WaitForSeconds(0.5f);
    }
    else
    {
        SpawnCrate(CommonBarcodes.Misc.LoadFade, Vector3.zero);
        yield return new WaitForSeconds(2);
    }
    LoadLevel(level.ID, loadScene.ID);
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, should be fixed now!

@EvroDeveloper EvroDeveloper marked this pull request as ready for review February 5, 2025 13:44
Copy link
Contributor

@HAHOOS HAHOOS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested (pressed the "Load Random Level" in the DefaultMenu which was updated to use FadeLoadLevel. I do not believe it needs more testing than that as most of the code is the same), seems to work just fine

@adamd3v adamd3v added documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed labels Dec 22, 2025
@adamd3v
Copy link
Collaborator

adamd3v commented Dec 24, 2025

Does this feature work on Quest? I know that it may work fine on PCVR due to the WaitForSeconds yield instruction. On Quest, it may just skip the yield instruction and immediately run the level loading code.

@HAHOOS
Copy link
Contributor

HAHOOS commented Jan 25, 2026

Tested on Quest, the WaitForSeconds yield instruction is not being skipped

@adamd3v
Copy link
Collaborator

adamd3v commented Jan 25, 2026

Fantastic, I'll merge this soon! I'll have to examine the merge conflicts though and test the functionality out.

@EvroDeveloper
Copy link
Author

I believe I fixed the merge conflicts by merging from upstream and fixing the conflicts. Still new to contributing on GitHub so let me know if there is anything I missed, but it should hopefully be good now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants