●やりたい事:
コンフィグで数値を変えると、読み込むWindow画像が変るシステムを作ってみたい。
その前段階として、コンフィグ画面で変数を変更出来る項目を作る。
●やってみた事:
rmmz_windowsで以下の部分を変更してみました。
Window_Options.prototype.addVolumeOptions = function() {
this.addCommand(TextManager.bgmVolume, "bgmVolume");
this.addCommand(TextManager.bgsVolume, "bgsVolume");
this.addCommand(TextManager.meVolume, "meVolume");
this.addCommand(TextManager.seVolume, "seVolume");
this.addCommand("画像の変更", "changegraphic");
};
Window_Options.prototype.drawItem = function(index) {
const title = this.commandName(index);
if (title === "画像の変更") {
let status = $gameVariables.value(1);
const rect = this.itemLineRect(index);
const statusWidth = this.statusWidth();
const titleWidth = rect.width - statusWidth;
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
this.drawText(title, rect.x, rect.y, titleWidth, "left");
this.drawText(status, rect.x + titleWidth, rect.y, statusWidth, "right");
if (Input.isTriggered('right')) {
$gameVariables.setValue(1, $gameVariables.value(1) + 1);
}
if (Input.isTriggered('left')) {
$gameVariables.setValue(1, $gameVariables.value(1) + 1);
}
} else {
const status = this.statusText(index);
const rect = this.itemLineRect(index);
const statusWidth = this.statusWidth();
const titleWidth = rect.width - statusWidth;
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
this.drawText(title, rect.x, rect.y, titleWidth, "left");
this.drawText(status, rect.x + titleWidth, rect.y, statusWidth, "right");
}
};
●結果としてできた事・できなかった事:
コンフィグウインドウに項目は+されました。
左右を押せば変数も上昇します。
ただし内容がtrue or falseのままの所為か左右順番に押さないと変数が+1ずつ上昇しません。
●必要な情報:
項目の内容をtrue or falseから変更する方法。
右キーを押せば+1、左キーを押せば-1に変更出来る方法。
コンフィグで数値を変えると、読み込むWindow画像が変るシステムを作ってみたい。
その前段階として、コンフィグ画面で変数を変更出来る項目を作る。
●やってみた事:
rmmz_windowsで以下の部分を変更してみました。
Window_Options.prototype.addVolumeOptions = function() {
this.addCommand(TextManager.bgmVolume, "bgmVolume");
this.addCommand(TextManager.bgsVolume, "bgsVolume");
this.addCommand(TextManager.meVolume, "meVolume");
this.addCommand(TextManager.seVolume, "seVolume");
this.addCommand("画像の変更", "changegraphic");
};
Window_Options.prototype.drawItem = function(index) {
const title = this.commandName(index);
if (title === "画像の変更") {
let status = $gameVariables.value(1);
const rect = this.itemLineRect(index);
const statusWidth = this.statusWidth();
const titleWidth = rect.width - statusWidth;
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
this.drawText(title, rect.x, rect.y, titleWidth, "left");
this.drawText(status, rect.x + titleWidth, rect.y, statusWidth, "right");
if (Input.isTriggered('right')) {
$gameVariables.setValue(1, $gameVariables.value(1) + 1);
}
if (Input.isTriggered('left')) {
$gameVariables.setValue(1, $gameVariables.value(1) + 1);
}
} else {
const status = this.statusText(index);
const rect = this.itemLineRect(index);
const statusWidth = this.statusWidth();
const titleWidth = rect.width - statusWidth;
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
this.drawText(title, rect.x, rect.y, titleWidth, "left");
this.drawText(status, rect.x + titleWidth, rect.y, statusWidth, "right");
}
};
●結果としてできた事・できなかった事:
コンフィグウインドウに項目は+されました。
左右を押せば変数も上昇します。
ただし内容がtrue or falseのままの所為か左右順番に押さないと変数が+1ずつ上昇しません。
●必要な情報:
項目の内容をtrue or falseから変更する方法。
右キーを押せば+1、左キーを押せば-1に変更出来る方法。