refactor for shared states and multi chapters
This commit is contained in:
parent
691b809b41
commit
b9bea16f78
13 changed files with 2308 additions and 1786 deletions
|
|
@ -322,6 +322,19 @@ class SceneManager {
|
|||
this.state.set(action.set, action.value);
|
||||
}
|
||||
|
||||
// Set value in shared state (for series games)
|
||||
if (action.setShared !== undefined) {
|
||||
this.state.setShared(action.setShared, action.value);
|
||||
}
|
||||
|
||||
// Mark a chapter as complete in shared state
|
||||
if (action.markChapterComplete !== undefined) {
|
||||
const sharedState = this.state.getSharedState();
|
||||
if (sharedState) {
|
||||
sharedState.markChapterComplete(action.markChapterComplete);
|
||||
}
|
||||
}
|
||||
|
||||
if (action.increment !== undefined) {
|
||||
this.state.increment(action.increment, action.amount || 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue