fork download
  1. ### Save_Load_CallCommonEvent.js ###
  2.  
  3. ###:ja
  4. * @plugindesc セーブ時、ロード時にのみ、特定のコモンイベントを起動します。
  5. * @author mamunine
  6.  
  7. * @param SaveCommonID
  8. * @desc セーブ時に呼び出すコモンイベントID (1未満なら呼ばない)
  9. * @default 0
  10.  
  11. * @param LoadCommonID
  12. * @desc ロード時に呼び出すコモンイベントID (1未満なら呼ばない)
  13. * @default 0
  14. ###
  15.  
  16. params = PluginManager.parameters 'Save_Load_CallCommonEvent'
  17. saveCommonId = Number params['SaveCommonID'] || 0
  18. loadCommonId = Number params['LoadCommonID'] || 0
  19.  
  20. class @Scene_Save extends Scene_Save
  21. onSaveSuccess: ->
  22. super()
  23. return if saveCommonId < 1
  24. $gameTemp.reserveCommonEvent saveCommonId
  25. SceneManager.pop() if SceneManager.isPreviousScene Scene_Menu
  26. return
  27.  
  28. class @Scene_Load extends Scene_Load
  29. onLoadSuccess: ->
  30. super()
  31. return if loadCommonId < 1
  32. $gameTemp.reserveCommonEvent loadCommonId
  33. SceneManager.pop() if SceneManager.isPreviousScene Scene_Menu
  34. return
  35.  
Success #stdin #stdout 0.27s 27896KB
stdin
Standard input is empty
stdout
// Generated by CoffeeScript 1.9.3

/* Save_Load_CallCommonEvent.js */


/*:ja
 * @plugindesc セーブ時、ロード時にのみ、特定のコモンイベントを起動します。
 * @author mamunine

 * @param SaveCommonID
 * @desc セーブ時に呼び出すコモンイベントID (1未満なら呼ばない)
 * @default 0

 * @param LoadCommonID
 * @desc ロード時に呼び出すコモンイベントID (1未満なら呼ばない)
 * @default 0
 */

(function() {
  var loadCommonId, params, saveCommonId,
    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
    hasProp = {}.hasOwnProperty;

  params = PluginManager.parameters('Save_Load_CallCommonEvent');

  saveCommonId = Number(params['SaveCommonID'] || 0);

  loadCommonId = Number(params['LoadCommonID'] || 0);

  this.Scene_Save = (function(superClass) {
    extend(Scene_Save, superClass);

    function Scene_Save() {
      return Scene_Save.__super__.constructor.apply(this, arguments);
    }

    Scene_Save.prototype.onSaveSuccess = function() {
      Scene_Save.__super__.onSaveSuccess.call(this);
      if (saveCommonId < 1) {
        return;
      }
      $gameTemp.reserveCommonEvent(saveCommonId);
      if (SceneManager.isPreviousScene(Scene_Menu)) {
        SceneManager.pop();
      }
    };

    return Scene_Save;

  })(Scene_Save);

  this.Scene_Load = (function(superClass) {
    extend(Scene_Load, superClass);

    function Scene_Load() {
      return Scene_Load.__super__.constructor.apply(this, arguments);
    }

    Scene_Load.prototype.onLoadSuccess = function() {
      Scene_Load.__super__.onLoadSuccess.call(this);
      if (loadCommonId < 1) {
        return;
      }
      $gameTemp.reserveCommonEvent(loadCommonId);
      if (SceneManager.isPreviousScene(Scene_Menu)) {
        SceneManager.pop();
      }
    };

    return Scene_Load;

  })(Scene_Load);

}).call(this);