From b71806b167267108b60ca14e388e969b5b37a80e Mon Sep 17 00:00:00 2001 From: oc Date: Wed, 23 May 2018 13:37:13 +0800 Subject: [PATCH] afterloaddata --- docs/event.md | 2 +- libs/core.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/event.md b/docs/event.md index ddcff95a..b1559bcc 100644 --- a/docs/event.md +++ b/docs/event.md @@ -1513,7 +1513,7 @@ core.insertAction([ 而在我们的存档中,是不会对怪物数据进行存储的,只会存各个变量和Flag,因此我们需要在读档后根据变量或Flag来调整怪物数据。 -我们可以在functions.js中的`afterLoadData`进行处理。 +我们可以在脚本编辑中的`afterLoadData`进行处理。 ``` js ////// 读档事件后,载入事件前,可以执行的操作 ////// diff --git a/libs/core.js b/libs/core.js index 8eee43fd..769249b6 100644 --- a/libs/core.js +++ b/libs/core.js @@ -889,6 +889,16 @@ core.prototype.debug = function() { core.control.debug(); } +////// 存档前 ////// +core.prototype.beforeSaveData = function (data) { + return core.events.beforeSaveData(data); +} + +////// 读档后 ////// +core.prototype.afterLoadData = function (data) { + return core.events.afterLoadData(data); +} + ////// 重置当前地图 ////// core.prototype.resetMap = function(floorId) { core.maps.resetMap(floorId);