Skip to content

Instantly share code, notes, and snippets.

@triacontane
Created May 5, 2017 06:38
Show Gist options
  • Save triacontane/d01d92d072817a0d2268d6b77b12f5a6 to your computer and use it in GitHub Desktop.
Save triacontane/d01d92d072817a0d2268d6b77b12f5a6 to your computer and use it in GitHub Desktop.
ショップが購入のみの場合、売却コマンドを非表示にする
(function() {
'use strict';
var _Window_ShopCommand_maxCols = Window_ShopCommand.prototype.maxCols;
Window_ShopCommand.prototype.maxCols = function() {
var columnNumber = _Window_ShopCommand_maxCols.apply(this, arguments);
return this._purchaseOnly ? columnNumber - 1 : columnNumber;
};
var _Window_ShopCommand_makeCommandList = Window_ShopCommand.prototype.makeCommandList;
Window_ShopCommand.prototype.makeCommandList = function() {
_Window_ShopCommand_makeCommandList.apply(this, arguments);
if (this._purchaseOnly) {
this._list = this._list.filter(function(command) {
return command.symbol !== 'sell'
});
}
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment