[RMXP] Personalizing ForeverZer0's diary script

Hello. In my game you can view the main character's diary in their room, and it updates as you go through quests and stuff. However, I've met some problems when trying to personalize it. This is the link to the script I'm using.

Spoiler: Diary script

The thing is that my game uses a transparent Windowskin since I use an image event to act as the textbox, so I want to do the same for the diary: use a PNG under it. However, every time I try to do this, the image displays over the diary, covering the contents. This is a screenshot:

Spoiler: Screenshot
IMG-20230313-WA0008.jpg

If anyone could help me I'd appreciate it. I only want to know how to display the image under the diary menu.
I wonder if you could just add a line to push the window z axis up higher.
from the default script there is only one window so it should be easy.
from this section
Ruby:
class Window_Diary < Window_Base

 attr_reader :lines

 def initialize
   super(0, 64, 640, 416)
   self.back_opacity = Diary::MAP_BACKGROUND ? 160 : 255
   self.contents = Bitmap.new(width - 32, height - 32)
   @lines = []
 end
I would add in self.z = 100

making it like this
Ruby:
class Window_Diary < Window_Base

 attr_reader :lines

 def initialize
   super(0, 64, 640, 416)
   self.back_opacity = Diary::MAP_BACKGROUND ? 160 : 255
   self.contents = Bitmap.new(width - 32, height - 32)
   self.z = 100
   @lines = []
 end
This is what I would do in VX Ace so it should work here.
If there are no errors and you still can't see the window then increase the number
I wonder if you could just add a line to push the window z axis up higher.
from the default script there is only one window so it should be easy.
from this section
Ruby:
class Window_Diary < Window_Base

 attr_reader :lines

 def initialize
   super(0, 64, 640, 416)
   self.back_opacity = Diary::MAP_BACKGROUND ? 160 : 255
   self.contents = Bitmap.new(width - 32, height - 32)
   @lines = []
 end
I would add in self.z = 100

making it like this
Ruby:
class Window_Diary < Window_Base

 attr_reader :lines

 def initialize
   super(0, 64, 640, 416)
   self.back_opacity = Diary::MAP_BACKGROUND ? 160 : 255
   self.contents = Bitmap.new(width - 32, height - 32)
   self.z = 100
   @lines = []
 end
This is what I would do in VX Ace so it should work here.
If there are no errors and you still can't see the window then increase the number
It worked! Now the text is over the image, thank you so much!! However, I can't see the title of the chapter. It should be above the purple thingy; when I erase the picture, it is there. I tried increasing the number but it doesn't do anything.

Spoiler: SCREENSHOT
1678729635114.png
OK i see what it is doing. It's pulling in window classes and putting them into an array.
I can see two options here.
Go to Window_Help and put the self.z line in it or we can add a line here to do both and you won't need the previous self.z.
I'm not 100% sure about the second option working, as I don't work with XP very much.
Try option 1, it shouldn't cause any issue with anything else.
OK i see what it is doing. It's pulling in window classes and putting them into an array.
I can see two options here.
Go to Window_Help and put the self.z line in it or we can add a line here to do both and you won't need the previous self.z.
I'm not 100% sure about the second option working, as I don't work with XP very much.
Try option 1, it shouldn't cause any issue with anything else.
You were right, it worked! Thank you!!! Now I only need to figure out how to change the font color and disable the image when you exit the diary. But that's something that I'll try to figure out by myself XD I'll report the thread as solved. Thank you again!
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/rmxp-personalizing-foreverzer0s-diary-script.155775/