biud436 / MV

🏰 This plugin package includes helpful features to get you on your way to create your game in RPG Maker MV.
MIT License
64 stars 51 forks source link

Performance issues found in RS_WaveFilter.js, RS_ChoicePosition.js #12

Closed biud436 closed 4 years ago

biud436 commented 4 years ago

RS_ChoicePosition.js

imagehttp://disq.us/p/251qwbf

    Window_ChoiceList.prototype.setCenteredChoiceWindow = function() {
        this.width = this.windowWidth(); // Remove this.
        this.height = this.windowHeight();  // Remove this.
        var cw = this.width / 2;
        var ch = this.height / 2;
        var cx = Graphics.boxWidth / 2;
        var cy = Graphics.boxHeight / 2;
        var mx = cx - cw;
        var my = cy - ch;

        this.moveLenear(mx, my);

    };

    Window_ChoiceList.prototype.moveLenear = function (tx, ty) {
        if(this.x >= tx - 0.001 && this.y >= ty - 0.001 && isAudoDisable) {
            $gameSystem.setChoiceMoveable(false);
        }
        var t = performance.now();
        var dt = (t % 10000 / 10000) * 0.5;
        this.x = this.x + dt * (tx - this.x);
        this.y = this.y + dt * (ty - this.y);
    };

it has to refactor the complex variable called 'tx' and remove issue that raises to resize.

/**
 * The width of the window in pixels.
 *
 * @property width
 * @type Number
 */
Object.defineProperty(Window.prototype, 'width', {
    get: function() {
        return this._width;
    },
    set: function(value) {
        this._width = value;
        this._refreshAllParts();
    },
    configurable: true
});

RS_WaveFilter.js

image

  var alias_Game_Event_refresh = Game_Event.prototype.refresh;
  Game_Event.prototype.refresh = function() {
    alias_Game_Event_refresh.call(this);
    this.updateWaveEffect(); // TODO : Remove this.
  };

it happens sometimes. it seems to read a list of all events when executing certain event command.