Custom background for Scene_Shop

● ARCHIVED · READ-ONLY
Started by Mawichan 8 posts View original ↗
  1. 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
    77227-300a0fb2265d6a1b09bc6ab5a434d50e.jpg

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

    77228-e30ae2c558c6f79c7d1fa0422d1411de.jpg

    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!
  2. 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.
  3. You can try this snippet, maybe it will help:
    Spoiler
    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
  4. @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!
  5. 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.
  6. Sixth said:
    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.
  7. 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!
  8. 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.