Servus,
ich probiere gerade schon seit Stunden rum bekomme es aber nicht hin....
Ziel ist es, dass in dem Fenster "Note_Window" der Text von Item.Note geladen wird, macht er aber nicht und ich raffe nicht warum....
Das Nicht-Richtig-Funktionierende Plugin:
Code: Scheinbar, ist hier irgendwo der Fehler :-(
- Scene_MenuBase.prototype.createNoteWindow = function() {
- this._noteWindow = new Window_Note();
- this.addWindow(this._noteWindow);
- };
- function Window_Note() {
- this.initialize.apply(this, arguments);
- }
- Window_Selectable.prototype.initialize = function(x, y, width, height) {
- Window_Base.prototype.initialize.call(this, x, y, width, height);
- this._index = -1;
- this._cursorFixed = false;
- this._cursorAll = false;
- this._stayCount = 0;
- this._helpWindow = null;
- this._noteWindow = null;
- this._handlers = {};
- this._touching = false;
- this._scrollX = 0;
- this._scrollY = 0;
- this.deactivate();
- };
- Window_Selectable.prototype.setNoteWindow = function(noteWindow) {
- this._noteWindow = noteWindow;
- this.callUpdateNote();
- };
- Window_Selectable.prototype.showNoteWindow = function() {
- if (this._noteWindow) {
- this._noteWindow.show();
- }
- };
- Window_Selectable.prototype.hideNoteWindow = function() {
- if (this._noteWindow) {
- this._noteWindow.hide();
- }
- };
- Window_Selectable.prototype.callUpdateNote = function() {
- if (this.active && this._noteWindow) {
- this.updateNote();
- }
- };
- Window_Selectable.prototype.updateNote = function() {
- this._noteWindow.clear();
- };
- Window_Selectable.prototype.setNoteWindowItem = function(item) {
- if (this._noteWindow) {
- this._noteWindow.setItem(item);
- }
- };
- Window_Note.prototype = Object.create(Window_Base.prototype);
- Window_Note.prototype.constructor = Window_Note;
- Window_Note.prototype.initialize = function(numLines) {
- var width = Graphics.boxWidth;
- var height = this.fittingHeight(numLines || 11);
- Window_Base.prototype.initialize.call(this, 76, 180, width - 76, height + 8);
- this._text = '';
- };
- Window_Note.prototype.setText = function(text) {
- if (this._text !== text) {
- this._text = text;
- this.refresh();
- }
- };
- Window_Note.prototype.clear = function() {
- this.setText('');
- };
- Window_Note.prototype.setItem = function(item) {
- this.setText(item ? item.note : '');
- };
- Window_Note.prototype.refresh = function() {
- this.contents.clear();
- this.drawTextEx(this._text, this.textPadding(), 0);
- };
- Window_ItemList.prototype.updateHelp = function() {
- this.setHelpWindowItem(this.item());
- this.setNoteWindowItem(this.item());
- };
Code: Bereich, der scheinbar gut klappt
- Window_Base.prototype.drawItemIcon = function(item, x, y, width) {
- width = width || 312;
- if (item) {
- var iconBoxWidth = Window_Base._iconWidth + 4;
- this.resetTextColor();
- this.drawIcon(item.iconIndex, x + 2, y + 2);
- }
- };
- Window_ItemCategory.prototype.maxCols = function() {
- if ($gameSwitches.value(762) == false) {
- var anzahl = 3
- } else {
- var anzahl = 2
- }
- return anzahl;
- };
- Window_ItemCategory.prototype.makeCommandList = function() {
- if ($gameSwitches.value(762) == false) {
- this.addCommand(TextManager.item, 'item');
- this.addCommand(TextManager.weapon, 'weapon');
- this.addCommand(TextManager.armor, 'armor');
- } else {
- this.addCommand("Angenommene Aufgaben", 'questA');
- this.addCommand("Abgeschlossene Aufgaben", 'questB');
- }
- };
- Window_ItemList.prototype.includes = function(item) {
- switch (this._category) {
- case 'item':
- return DataManager.isItem(item) && item.itypeId === 1;
- case 'weapon':
- return DataManager.isWeapon(item);
- case 'armor':
- return DataManager.isArmor(item);
- case 'keyItem':
- return DataManager.isItem(item) && item.itypeId === 2;
- case 'questA':
- return DataManager.isItem(item) && item.itypeId === 3;
- case 'questB':
- return DataManager.isItem(item) && item.itypeId === 4;
- default:
- return false;
- }
- };
- Window_ItemList.prototype.maxCols = function() {
- if ($gameSwitches.value(762) == false) {
- var spalten = 2
- } else {
- var spalten = 1
- }
- return spalten;
- };
- Window_ItemList.prototype.drawItem = function(index) {
- var item = this._data[index];
- if (item) {
- var numberWidth = this.numberWidth();
- var rect = this.itemRect(index);
- rect.width -= this.textPadding();
- this.changePaintOpacity(this.isEnabled(item));
- if ($gameSwitches.value(762) == false) {
- this.drawItemName(item, rect.x, rect.y, rect.width - numberWidth);
- this.drawItemNumber(item, rect.x, rect.y, rect.width);
- } else {
- this.drawItemIcon(item, rect.x, rect.y, rect.width - numberWidth);
- }
- this.changePaintOpacity(1);
- }
- };
- Window_ItemList.prototype.initialize = function(x, y, width, height) {
- if ($gameSwitches.value(762) == false) {
- Window_Selectable.prototype.initialize.call(this, x, y, width, height);
- } else {
- Window_Selectable.prototype.initialize.call(this, x, y, 76, height);
- }
- this._category = 'none';
- this._data = [];
- };
- Scene_Item.prototype.create = function() {
- Scene_ItemBase.prototype.create.call(this);
- this.createHelpWindow();
- this.createCategoryWindow();
- this.createItemWindow();
- this.createActorWindow();
- if ($gameSwitches.value(762) == true) {
- this.createNoteWindow();
- }
- };
- Scene_Item.prototype.createCategoryWindow = function() {
- this._categoryWindow = new Window_ItemCategory();
- this._categoryWindow.setHelpWindow(this._helpWindow);
- this._categoryWindow.setNoteWindow(this._noteWindow);
- this._categoryWindow.y = this._helpWindow.height;
- this._categoryWindow.setHandler('ok', this.onCategoryOk.bind(this));
- this._categoryWindow.setHandler('cancel', this.popScene.bind(this));
- this.addWindow(this._categoryWindow);
- };
- Scene_Item.prototype.createItemWindow = function() {
- var wy = this._categoryWindow.y + this._categoryWindow.height;
- var wh = Graphics.boxHeight - wy;
- this._itemWindow = new Window_ItemList(0, wy, Graphics.boxWidth, wh);
- this._itemWindow.setHelpWindow(this._helpWindow);
- this._itemWindow.setNoteWindow(this._noteWindow);
- this._itemWindow.setHandler('ok', this.onItemOk.bind(this));
- this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
- this.addWindow(this._itemWindow);
- this._categoryWindow.setItemWindow(this._itemWindow);
- };