Skip to content

Commit

Permalink
Fix cursor not being saved with game data (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
inc0der authored Sep 30, 2020
1 parent 662bde3 commit bc1316a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Main {
utils.Comment.title('DataManager');
FnMacros.jsPatch(false, RmTouchInput, TouchInput);
FnMacros.jsPatch(true, RmStage, Stage);
FnMacros.jsPatch(false, RmGame_System, Game_System);
FnMacros.jsPatch(true, RmGame_System, Game_System);
FnMacros.jsPatch(true, RmScene_Base, Scene_Base);
FnMacros.jsPatch(true, RmScene_Map, Scene_Map);
#if compileMV
Expand Down
9 changes: 5 additions & 4 deletions src/core/Stage.hx
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ class Stage extends RmStage {

public function updateCursors(): Void {
var cursors: Array<Dynamic> = Main.params.cursors;
var needsUpdate: Bool = DataManager.isDatabaseLoaded() && CursorLoader.activeData == null;

if (needsUpdate && untyped GameSystem.activeCursor != null) {
CursorLoader.activeData = untyped GameSystem.activeCursor;

if (DataManager.isDatabaseLoaded() && untyped GameSystem.activeCursor != null) {
if (untyped GameSystem.activeCursor != CursorLoader.activeData) {
CursorLoader.activeData = untyped GameSystem.activeCursor;
}
}

if (CursorLoader.hasActiveData()) {
Expand Down
2 changes: 2 additions & 0 deletions src/scenes/Scene_Base.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package scenes;

import rm.core.TouchInput;
import core.CursorLoader;
import rm.Globals;
import rm.scenes.Scene_Base as RmScene_Base;

class Scene_Base extends RmScene_Base {
Expand All @@ -19,6 +20,7 @@ class Scene_Base extends RmScene_Base {

public function onCursorChange(data) {
untyped this._cursor.cursorData = data;
untyped Globals.GameSystem.activeCursor = data;
}

public function onCursorHoverChange(hoverName) {
Expand Down

0 comments on commit bc1316a

Please sign in to comment.