Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

background: fix loading background along with scene #154

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

yookoala
Copy link
Contributor

@yookoala yookoala commented Mar 25, 2022

Why this PR is needed?

To reproduce my issue

  1. Create a script with scene and background together, for example:
    monogatari.script ({
    // The game starts here.
    'Start': [
    	'show scene #555555 with fadeIn',
    	'show background phone.jpg with fadeIn',
    	'Hello.',
    	'Time to test saving',
    	'After save',
         ],
    });
  2. Run the game.
  3. When you see "Hello.", save the game.
  4. After save, simply load the newly saved game.

Expected behaviour

See the word "Hello" with the background "phone.jpg".

Actual behaviour

See the word "Hello" with the background color #555555. No phone.jpg.

What this PR does?

  • Background should be of higher priority than scene. So the presents
    of Scene should not prevent Background from taking effect.

* Background should be of higher priority than scene. So the presents
  of Scene should not prevent Background from taking effect.
@yookoala
Copy link
Contributor Author

I'm not 100% sure about this. The original scene variable check might be doing something essential. But it did fix the problem for me.

* Fix the warning for "context", "cy" and etc. marked as undefined
  by eslint.
* Correctly display background image if not loaded by show scene.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant