Menu Command Background help

Hi,

I'm working with PAC compact menu add-on: https://pacmanvx.wordpress.com/2012/07/16/pac-main-menu-ace-compact-addon/

Currently, I have a menu background for the command window only. I achieved this by using a script snippet by TheoAllen:
Code:
module Theo
  #----------------------------------------------------------------------------
  # To identify window name. Only use to debug. Set to false if not used.
  # Because extra sprite adds up an extra process.
  #----------------------------------------------------------------------------
    DisplayWindowName = false
  #----------------------------------------------------------------------------
 
  #----------------------------------------------------------------------------
  # Record all windows name here that you wish to display a background image
  # The format goes like:
  #
  # Window_ClassName => 'image name'
  # The image name must be located in Graphics/system
  #----------------------------------------------------------------------------
  WindowList = {
    Window_MenuCommand => 'Menu_Background',
 
  } # <-- Don't remove this
  #----------------------------------------------------------------------------
end

class Window_Base
 
  alias background_init initialize
  def initialize(*args)
    background_init(*args)
    text = self.class.to_s
    size = text_size(text)
    if Theo::DisplayWindowName
      @name_text = Sprite.new
      @name_text.bitmap = Bitmap.new(size.width+2, size.height)
      @name_text.bitmap.font.size = 19
      @name_text.bitmap.fill_rect(@name_text.bitmap.rect, Color.new(0,0,0,128))
      @name_text.bitmap.draw_text(@name_text.bitmap.rect, text)
    end
    if Theo::WindowList[self.class]
      @back_img = Sprite.new
      @back_img.bitmap = Cache.system(Theo::WindowList[self.class])
    end
    update_extra
  end
 
  alias bg_update update
  def update
    bg_update
    update_extra
  end
 
  def update_extra
    if @name_text
      @name_text.viewport = self.viewport
      @name_text.x = self.x
      @name_text.y = self.y
      @name_text.z = self.z + 1
      @name_text.visible = self.visible
    end
    if @back_img
      @back_img.viewport = self.viewport
      @back_img.x = 0
      @back_img.y =
      @back_img.z = self.z - 1
      @back_img.opacity = self.openness
      @back_img.visible = self.visible
    end
  end
 
  alias bg_dispose dispose
  def dispose
    bg_dispose
    dispose_extra
  end
 
  def dispose_extra
    @name_text.dispose if @name_text
    @back_img.dispose if @back_img
  end
 
end

My current predicament is that there's a sliding component to the Compact menu add on. Basically, anytime you have to make a character selection, the command window slides to the left, and the menu background does not slide with it.



Basically, what I'm trying to do is either have the background slide along with the compact command menu, or edit the compact menu so that the selection screen appears in the center above the command window, without it moving.

TL;DR - How can I edit the compact menu script so that the Status selection appears centered in the screen and doesn't slide the command window?
That gets rid of a lot of the code for that addon.
Ruby:
  #--------------------------------------------------------------------------
  # * Open Status Window
  #--------------------------------------------------------------------------
  def pac_mmc_open_status
#~     c = 0
#~     c = Graphics.width - @command_window.width if PAC::MM::Windows_Pos == :right
#~     unless @command_window.x == c
#~       s = PAC::MM::Compact::Move_Speed
#~       s *= -1 if PAC::MM::Windows_Pos != :right
#~       c = 0
#~     c = Graphics.width - @command_window.width if PAC::MM::Windows_Pos == :right
#~       begin
#~         @windows.each do |window| window.x += s end
        Graphics.update
#~       end until PAC::MM::Windows_Pos == :right ? @command_window.x >= c :
#~        @command_window.x <= c
#~       @windows.each do |window| window.x = c end
#~     end
    @status_window.x = (Graphics.width - @status_window.width) / 2
    @status_window.show if @status_window.visible == false
    @status_window.open if @status_window.openness == 0
  end
  #--------------------------------------------------------------------------
  # * Close Status Window
  #--------------------------------------------------------------------------
  def pac_mmc_close_status
    @status_window.close
    begin; @status_window.update; Graphics.update
    end until @status_window.openness == 0
#~     s = PAC::MM::Compact::Move_Speed
#~     s *= -1 if PAC::MM::Windows_Pos == :right
#~     c = (Graphics.width - @command_window.width) / 2
#~     begin
#~       @windows.each do |window| window.x += s end
      Graphics.update
#~     end until PAC::MM::Windows_Pos == :right ? @command_window.x <= c :
#~      @command_window.x >= c
#~     @windows.each do |window| window.x = c end
  end
I added in a position adjust for the status window

Also in the menu background script you're missing a value for the y. Line 61
Thanks, it’s actually correct in the editor. I just copied it too early.

thanks for this.
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/menu-command-background-help.138187/