Jump to content
Sign in to follow this  
LPBenji

Layer Window_MenuActor above Item Menu to fix bug?

Recommended Posts

Hey,

 

When I try using consumeable items in menu, I have this weird bug:

http://i.imgur.com/n1c9hDZ.png

 

I edited some of the menu myself,

 

I did edit, Window_MenuStatus and change "Get Window Height"

  #--------------------------------------------------------------------------
  # * Get Window Height
  #--------------------------------------------------------------------------
  def window_height
    Graphics.height - 296
  end

I also did try to center my menu screen and edited the Object Initialization above:

  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y + 128, window_width, window_height)
    @pending_index = -1
    refresh
  end

Also, I am using 3 Scripts to modify my Item Scene:

 

Icon Item List by modern algebra

http://rmrk.net/index.php?topic=47932.0

Customizable Item Menu also by modern algebra

http://rmrk.net/index.php/topic,46516.0.html

and

 

Remove Item Category Snippet:

 

 

class Window_ItemList < Window_Selectable
  
  def initialize(x, y, width, height)
    super
    @category = :none
    @data = []
    refresh
    self.oy = 0
  end
  
  def include?(item)
    return true if item
  end
end

class Scene_Item < Scene_ItemBase
  def start
    super
    create_help_window
    create_item_window
  end
  
  def create_item_window
    wy = @help_window.y + @help_window.height
    wh = Graphics.height - wy
    @item_window = Window_ItemList.new(0, wy, Graphics.width, wh)
    @item_window.viewport = @viewport
    @item_window.help_window = @help_window
    @item_window.set_handler(:ok,     method(:on_item_ok))
    @item_window.set_handler(:cancel, method(:on_item_cancel))
    @item_window.select_last
    @item_window.activate
  end
  
  def on_item_cancel
    return_scene
  end
end

 

 

it seems, this bug happens because of my dirty editing of the main menu (explained above).

Would there be some way to change the Z position of the Window_MenuActor to be higher than the Item

Menu. My idea would be, that the selection of actors then gets just layered on top of the item menu, instead

of replacing it and creating a bunch of spare space.

 

 

Hopefully someone can help me <3

 

cya ~

Share this post


Link to post
Share on other sites

VFlDhHO.png I have moved this thread to Ace Script Support. (=

 

It's not a bug.

When the party window pops out, then the stuff behind is cleared to prevent from messy look.

 

To remove the effect, get rid of the viewport thingie in Scene_ItemBase

in show_sub_window method:

@viewport.rect.x = @viewport.ox = cursor_left? ? 0 : window.width
@viewport.rect.width = width_remain

and hide_sub_window too I guess~

    @viewport.rect.x = @viewport.ox = 0
    @viewport.rect.width = Graphics.width

But after that, the window will be probably placed below the others, so you may need to tweak its 'z' position.

In Window_MenuActor -> initialize method add this:

self.y = 10 #or higher if still covered by other things

That should do it, though I haven't tested stuff.

Share this post


Link to post
Share on other sites

Hey!

Thanks <3

it worked, needed to put it at self.z = 200

(btw you wrote self.y but I fgured out that typo myself)

 

I guess I can use "self.x =" and "self.y =" to move the window to the location i want it right?

Edit: I can edit the Y position, but X seems to be locked, is there a way to change this?

 

 

 

S o l v e d

also, another minor detail is:

 http://i.imgur.com/CyIVxCE.png

 

There is this "blinking" selection area, that shows normally which actor is selected - and for some reason it splits the window size

in 4 (if i see this correctly),

can I somehow change it so the "blinking selection" covers the area I marked with the red dash lines?

 

Edit: Solved!

I edited line 42 of WindowMenu_Status and remove  / 4 ... sometimes testing around just works :D

 

 

 

<3 thanks so far

Edited by LPBenji

Share this post


Link to post
Share on other sites

Oh indeed I made a typo ~ I guess I was thinking about something else when typing. Sorry for that. =P

 

Yup, self.x/y sets the position~

 

As for the blinking area - you got it right ~ that's exactly where the amount of displayed 'items' at once is configured.

 

That's good you're trying stuff by yourself - that's how I learned what I know and how I'm still learning. ^^

 

 

So.. everything works now or is there something else? (=

Share this post


Link to post
Share on other sites

uhm, I cant change the X,

id like to center it but it kinda is sticky to the right side of the screen o_O

Share this post


Link to post
Share on other sites

Because it gets changed each time you select an item~

 

Script: Scene_ItemBase

  #--------------------------------------------------------------------------
  # * Determine if Cursor Is in Left Column
  #--------------------------------------------------------------------------
  def cursor_left?
    @item_window.index % 2 == 0
  end

  #--------------------------------------------------------------------------
  # * Show Subwindow
  #--------------------------------------------------------------------------
  def show_sub_window(window)
    width_remain = Graphics.width - window.width
    window.x = cursor_left? ? width_remain : 0 # HERE!~~~~~~~~~~~~~~~~~~~~~~~~~~
    @viewport.rect.x = @viewport.ox = cursor_left? ? 0 : window.width
    @viewport.rect.width = width_remain
    window.show.activate
  end

def cursor_left? checks if the cursor is in the first or the second column (by default you have two of them (hence % 2))

 

Now that line:

window.x = cursor_left? ? width_remain

asks if the highlighted item is on the left/right and then moves the window to the other side, for example if you have selected an item on the left, the window will appear to the right and vice versa.

 

Just remove that line and even the whole method, since it's not really needed when you want to set a particular position of the window manually.

Share this post


Link to post
Share on other sites

Glad you got it to work! ^^

Good luck!

9RWO0dm.png This thread is closed, due to being solved. If for some reason anybody would like to re-open this thread, just send me a PM. (=

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×