-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add every igloo #23
base: main
Are you sure you want to change the base?
Add every igloo #23
Conversation
… modern igloo system
what happens when a room and an igloo share the same scene key? for example the Cave igloo and the actual Cave room having the same key |
if my above comment is actually an issue, then i have a proposed solution so constructor(key) {
super(`${key}Igloo`) And then createIgloo(args) {
let config = this.igloos[args.type]
const key = `${config.key}Igloo`
if (config.key in this.scene.manager.keys) {
this.scene.start(key, { args: args })
return this.scene.get(key)
} else {
return this.scene.add(key, config.scene, true, { args: args })
}
} |
You're right, I didn't test that in vanilla Yukon. It does indeed load the wrong scene in this case. Good fix proposal, will implement something similar. |
Fix the wrong scene appearing when an igloo and a loaded room have the same scene name by differentiating all igloo scene keys with a `-igloo` suffix
Fixed. |
Assets:
https://drive.google.com/file/d/1BjpMunXmFGUubPLuDxZL8Y0pQpk9m1rj/view?usp=sharing
Raw:
https://drive.google.com/file/d/1Bl3VFwAPguojeaiQGuW-Hxds3wo1LMUd/view?usp=sharing
Explanation of all changes
src/data/igloo.js
src/scenes/components/Button.js
src/scenes/igloos/IglooScene.js
Checks if an igloo has a floor before setting its depth. This prevents the game crashing on an igloo with no floor.
Checks for a -igloo-physics.json file first before looking for a -physics.json file. This is so IglooScenes with the same name as RoomScenes (like cave) don't accidentally use each other's physics data. Same naming convention is used with all animation, pack and multiatlas files, for the same reason.
src/scenes/interface/game/iglooedit/gridview/GridView.js
Also: