spec3

blep
Veteran
Joined
Jun 20, 2020
Messages
49
Reaction score
107
First Language
portuguese
Primarily Uses
RMMV
Hi! First of all, I'd like to apologize in case anything reads weird, English is not my first language. I made this account just to try to fix this problem. I searched the forum, but I couldn't find anything about it. Maybe my search terms didn't help, but, anyway, my search was unsuccessful. I thought it was more prudent to make a more direct topic (even more so because the message at the beginning of the original topic says that the plugin is not under maintenance).

Anyway, I'm using this plugin: https://forums.rpgmakerweb.com/inde...pad-in-game-text-editor-for-the-player.91259/

I found two problems with the plugin. In the attached image, it shows the way the notepad looks. I overlapped the blue and red bars to indicate the problem: the text "escapes" from the window, you type and it keeps writing without limit or border.

The problem with the blue bar (the text going infinitely to the right) I managed to fix.

I changed the code
Window_NotepadDetails.prototype.initialize = function(x, y, width, height) {
Window_NotepadBase.prototype.initialize.call(this, x, y, width, height);
this._row = 0;
this._maxLength = 0;
To
Window_NotepadDetails.prototype.initialize = function(x, y, width, height) {
Window_NotepadBase.prototype.initialize.call(this, x, y, width, height);
this._row = 0;
this._maxLength = 78;

I counted the characters from left to right and by trial and error I got the text to the limit. No automatic line break or anything like that, but it is something.

Now the problem is in the red bar.
As you can see from the image, from line 15 the text is cut off. I don't expect to have infinite scrolling in the window (I don't even know if it's possible) and I don't mind that each note has 14 lines. But it bothers me that the text is cut out.

I believe the problem is here, but I have no idea what to do to fix it.
Window_NotepadDetails.prototype.newLine = function() {
var nextLineString = this.text[this._row].slice(this._index);
this.text[this._row] = this.text[this._row].substr(0, this._index);
this.text.splice(this._row + 1, 0, nextLineString);
this._row++;
this._index = 0;
this.refresh();

Here's the code part in full context.

//=============================================================================
// Window_NotepadDetails
//=============================================================================
// This window contains the details of the note.
//=============================================================================

function Window_NotepadDetails() {
this.initialize.apply(this, arguments);
}

Window_NotepadDetails.prototype = Object.create(Window_NotepadBase.prototype);
Window_NotepadDetails.prototype.constructor = Window_NotepadDetails;

Window_NotepadDetails.prototype.initialize = function(x, y, width, height) {
Window_NotepadBase.prototype.initialize.call(this, x, y, width, height);
this._row = 0;
this._maxLength = 78; //changed (was 0)
};

Window_NotepadDetails.prototype.newLine = function() {
var nextLineString = this.text[this._row].slice(this._index);
this.text[this._row] = this.text[this._row].substr(0, this._index);
this.text.splice(this._row + 1, 0, nextLineString);
this._row++;
this._index = 0;
this.refresh();
};

If anyone can throw a light and help me solve this problem, I will be infinitely grateful. Again, I apologize if something got lost in translation.

edit 1: added one image without the color overlap to help see
edit 2: added some prints with a clean project doing the same thing
edit 3: gdrive was being a pain, here is the link to the clean/stripped demo with the edited plugin
edit 4: just noticed that in the demo it brings back the right side (blue bar) problem because the font is bigger :frown: but it's not a big deal, i guess
 

Attachments

  • Game_X085g6j1HC.png
    Game_X085g6j1HC.png
    54.5 KB · Views: 13
  • Game_X085g6j1HC.png
    Game_X085g6j1HC.png
    54.1 KB · Views: 17
  • clean project 1.png
    clean project 1.png
    111.5 KB · Views: 16
  • clean project 2.png
    clean project 2.png
    624.9 KB · Views: 13
Last edited:

Frigg

Quiet
Member
Joined
Jun 15, 2017
Messages
29
Reaction score
5
First Language
English
Primarily Uses
RMMV
I'm using the same plugin and ran into the same issue. I've posted it to a game dev discord to see if anyone knows, and I've contacted the creator. If anything comes out of this, you'll be the first to know.
 

Ischenderun

Warper
Member
Joined
Jan 3, 2021
Messages
3
Reaction score
7
First Language
Italiano
Primarily Uses
RMMZ
resolution: add a conditional branch at line 1773
JavaScript:
Window_NotepadDetails.prototype.newLine = function() {
    var nextLineString = this.text[this._row].slice(this._index);
    this.text[this._row] = this.text[this._row].substr(0, this._index);
    this.text.splice(this._row + 1, 0, nextLineString);
    // add this conditional branch
    if(this._row > 9){
        this._row = 0;
    }else{
        this._row++;   
    }
    
    this._index = 0;
    this.refresh();
Cursor come back at start line when the page is complete
 

Frigg

Quiet
Member
Joined
Jun 15, 2017
Messages
29
Reaction score
5
First Language
English
Primarily Uses
RMMV
resolution: add a conditional branch at line 1773
JavaScript:
Window_NotepadDetails.prototype.newLine = function() {
    var nextLineString = this.text[this._row].slice(this._index);
    this.text[this._row] = this.text[this._row].substr(0, this._index);
    this.text.splice(this._row + 1, 0, nextLineString);
    // add this conditional branch
    if(this._row > 9){
        this._row = 0;
    }else{
        this._row++;  
    }
   
    this._index = 0;
    this.refresh();
Cursor come back at start line when the page is complete
!!!!!!!!!! Holy smokes thank you so much!
 

Latest Threads

Latest Profile Posts

Hot chocolate and music make studying and note-taking much easier :kaoluv:
Until my hand cramps up from writing too much!
Doing RPG Maker News for 21st September 2021


Malak is still waiting for Dark Deception Chapter 4... This was him yesterday after another sugar crash.
Again, he's fine. He's just bored at this point, considering he's exhausted his entire vacation bucket list.
Am I the only one who files custom resources under specific folders to remember who to credit? :kaoswt2:
1632263519730.png
I always smile to myself when I see someone do the "immediate halt and spin around" from forgetting something. I find it sort of endearing how we all do it without ever being taught to.

Forum statistics

Threads
115,262
Messages
1,088,438
Members
149,864
Latest member
ratbyte
Top