Custom background for Scene_Shop

Status
Not open for further replies.

Mawichan

Veteran
Veteran
Joined
Jan 24, 2018
Messages
55
Reaction score
6
First Language
Spanish
Primarily Uses
RMVXA
I'm using eugene222's Custom Menu Backgrounds and Yanfly's Ace Shop Options. I noticed that there's an empty unecessary window that pops up layered in the middle between the items window and the status window. This window appears when I open the shop scene, but disappears once I select between the buy/sell/cancel commands.

This is what it looks like when I open the shop


This is what it looks like after the window disappears (what it should look like from the start).



The extra window only appears when these two scripts are used at the same time (provided the shop scene is added to the background image script's list of scenes to add bgs to).Deleting the shop scene from it prevents the extra window from appearing again on the shop, but of course it leaves it without a background.

On the other hand, deleting the Ace script allows the shop to have a background without mysterious empty windows popping up, but of course the shop is left with the default interface.

I reproduced the problem in a clean project to make these images, so I know one of those two scripts must be the one creating the window. The problem is I don't know which one or what script line/s are creating that window or for what reason it's appearing.

Any kind of help or suggestion would be greatly appreciated. These scripts work fine together otherwise, but the look of that window really bugs me off.
Thanks in advance!
 

Attachments

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,660
Reaction score
563
First Language
English
Primarily Uses
RMVXA
Can you provide a link to the demo for the clean project?
I tried myself but it doesn't give me the background like you in the shop window. So I can't see the problem.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
You can try this snippet, maybe it will help:
Code:
class Window
 
  attr_accessor :no_op_change
 
end

class Scene_Shop < Scene_MenuBase

  alias fix_it88826 create_dummy_window
  def create_dummy_window
    fix_it88826
    @dummy_window.no_op_change = true
  end
 
end

class Scene_MenuBase < Scene_Base
 
  def set_opacity(window)
    return if window.nil? || window.disposed? || window.no_op_change
    window.opacity = get_opacity
  end   
 
end
Put it below that menu background script.
As always, not tested. :p
 
Last edited:

Mawichan

Veteran
Veteran
Joined
Jan 24, 2018
Messages
55
Reaction score
6
First Language
Spanish
Primarily Uses
RMVXA
@Roninator2 That's weird, for the sake of testing I copied the scripts from their original page and didn't change them at all other than to add the background to the shop. Here's a link to the file, if you still feel like looking into it. It'd be much appreciated, I hope the link works.

@Sixth Your little patch does work! I guess that solves the problem, though I'd still like to have someone look at the file I linked above, if it's not too much trouble, because I really want to know what was causing this and to know if a patch was actually needed to solve this after all. I had spent like an hour or so looking at the ace shop script, fooling around with it, trying to identify which window went where and such hahaha.

Thanks a lot, dudes!
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
There is a weird part of the shop menu (in the default scripts) which is pretty much a terrible way of doing what has been done with it, but it works, so I guess, they just left it at that.
It's a dummy window (yeah, that name certainly fits it :D) that displays something that could have been easily displayed in the other window it replaces at a certain point (I think, it happens when the player switches between selling and buying,, but I checked that part of the code a very long time ago, so my memory can trick me). Either that, or it's used to hide something below that window at a certain time.
When one of these windows is shown, the other one is hidden normally. Somehow it shows up with these 2 scripts (I mean, I know that the background script changed it's opacity, but they should get shown and hidden with their visible property, so the opacity should not matter), but I didn't really check how, since I knew immediately which window it was.

If you want to backtrack what happened, just search for @dummy_window in the Scene_Shop script, check when is it created, what happens with it after and what methods are called on it. Just don't forget that Yanfly's Shop Menu script changes some part of it, so you should check that script too.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,250
First Language
Spanish
Primarily Uses
RMVXA
Either that, or it's used to hide something below that window at a certain time.
it is there to fill that space because the buy/sell actual windows have different structures, one is a plain item window, the other is an item list plus a number input, plus an inventory readout.

they're all triggered to hide, so the dummy window shouldn't transparent anything behind it, unless at some point any of those scripts un-hides them or changes their opacity.
it was badly done in the original, but it was one of those cases of "don't touch it, or else... "
...... and, somebody touched it.
 

Mawichan

Veteran
Veteran
Joined
Jan 24, 2018
Messages
55
Reaction score
6
First Language
Spanish
Primarily Uses
RMVXA
Ooohh
I noticed the dummy window thing when I was fooling around with the scripts, before I gave up and created this thread. The name sounded so suspicious lol.
But since I barely know Ruby it's not like I could have figured that much about it by myself. Trying to delete it from the Ace Shop script actually erased the gold window and still left the dummy there! I never tried anything on the default Scene_Shop, since it's rarely a good idea, especially for a know-nothing like me. I just thought that since it's there by default itwas important.

Well, since this issue stems from the default script, better leave that as is and use the snippet.
Thanks everyone for helping me better understand what was going on. Sixth, thank you very much for the fix!
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,834
Reaction score
5,221
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top