Jump to content
kusczackir77

make controller menu without F1 menu

Recommended Posts

Yeah I have tried that using a backslash. But it's still not working..

this is my script menu:

 

#===============================================================================
# *NEW Scene_NewControls
#===============================================================================
class Scene_NewControls < Scene_MenuBase
  def start
    super
    create_background
    create_base_windows
  end
  #-----------------------------------------------------------------------------
  # *NEW create_base_windows
  #-----------------------------------------------------------------------------
  def create_base_windows
    @help_window = Window_Help.new(1)
    @help_window.set_text("Controller Menu")
    @command_window = Window_ControlCommand.new
    @command_window.update
    @command_window.set_handler(:select_up, method(:command_up))
    @command_window.set_handler(:select_down, method(:command_down))
    @command_window.set_handler(:select_left, method(:command_left))
    @command_window.set_handler(:select_right, method(:command_right))
    @command_window.set_handler(:select_accept, method(:command_accept))
    @command_window.set_handler(:select_cancel, method(:command_cancel))
    @command_window.set_handler(:select_menu, method(:command_menu))
    @command_window.set_handler(:select_back, method(:command_back))
  end
  #-----------------------------------------------------------------------------
  # *NEW create_background
  #-----------------------------------------------------------------------------
  def create_background
    @background_sprite = Sprite.new
    @background_sprite.bitmap = SceneManager.background_bitmap
    @background_sprite.color.set(16, 16, 16, 128)
  end
  #-----------------------------------------------------------------------------
  # *def command_up
  #-----------------------------------------------------------------------------
  def command_up
    $game_temp.reserve_common_event(1)
  end
  #-----------------------------------------------------------------------------
  # *def command_down
  #-----------------------------------------------------------------------------  
  def command_down
    $game_temp.reserve_common_event(2)
  end
  #-----------------------------------------------------------------------------
  # *def command_left
  #-----------------------------------------------------------------------------
  def command_left
    $game_temp.reserve_common_event(3)
  end
  #-----------------------------------------------------------------------------
  # *def command_right
  #-----------------------------------------------------------------------------
  def command_right
    $game_temp.reserve_common_event(4)
  end
  #-----------------------------------------------------------------------------
  # *def command_accept
  #-----------------------------------------------------------------------------
  def command_accept
    $game_temp.reserve_common_event(5)
  end
  #-----------------------------------------------------------------------------
  # *def command_cancel
  #-----------------------------------------------------------------------------
  def command_cancel
    $game_temp.reserve_common_event(6)
  end
  #-----------------------------------------------------------------------------
  # *def command_menu
  #-----------------------------------------------------------------------------
  def command_menu
    $game_temp.reserve_common_event(7)
  end
  #-----------------------------------------------------------------------------
  # *def command_back
  #-----------------------------------------------------------------------------
  def command_back
    return_scene
  end
end
#==============================================================================
# *NEW Window_ControlCommand
#==============================================================================
class Window_ControlCommand < Window_Command
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64)
    self.openness = 0
    open
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    return Graphics.width
  end
  #--------------------------------------------------------------------------
  # *NEW make_command_List
  #--------------------------------------------------------------------------
  def make_command_list
    key_up = "\BKEYI[uP,AND]"
    key_down = "\BKEYI[DOWN,AND]"
    key_left = "\BKEYI[left,AND]"
    key_right = "\BKEYI[right,AND]"
    key_accept = "\BKEYI[C,AND]"
    key_cancel = "\BKEYI[b,AND]"
    key_menu = "\BKEYI[Z,AND]"
    add_command("Up"+(" "*(Graphics.width - 508))+key_up, :select_up)
    add_command("Down"+(" "*(Graphics.width - 510))+key_down, :select_down)
    add_command("Left"+(" "*(Graphics.width - 510))+key_left, :select_left)
    add_command("Right"+(" "*(Graphics.width - 511))+key_right, :select_right)
    add_command("A"+(" "*(Graphics.width - 507))+key_accept, :select_accept)
    add_command("B"+(" "*(Graphics.width - 507))+key_cancel, :select_cancel)
    add_command("Menu"+(" "*(Graphics.width - 510))+key_menu, :select_menu)
    add_command("Back", :select_back)
  end
end
#==============================================================================
# END
#==============================================================================

Edited by kusczackir77

Share this post


Link to post
Share on other sites

Hmmm... Normally I would suggest overriding the draw_item method to use draw_text_ext in the Window_ControlCommand class, so it would look like this:

 

  def draw_item(index)
    change_color(normal_color, command_enabled?(index))
    rect = item_rect_for_text(index)
    draw_text_ext(rect.x, rect.y, command_name(index))
  end

Share this post


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

  • Recently Browsing   0 members

    No registered users viewing this page.

×