[Script] [ACE] [ACE]The Witch's House Menu

NagiNagi Posts: 589Registered
[size=large][align=center]The Witch's House Menu
Author: SoulPour777
Edit: Nagisa[/align]
[/size]



[chapter]Thông tin[/chapter]
Làm cái Menu trông giống như The Witch's House. Hết!
Bao gồm:
- Không có số lượng Item
- Chỉ có Item và Load
- Chỉ hiển thị 1 trong 2: Key Item hoặc Item
Mình edit lại 1 tí:
- Item + Load + Game End
- Hiển thị Key Item và Item cùng lúc
- Tính sửa cái hiển thị số lượng item rồi nhưng mà đối với item mà có tên dài thì nó sẽ đè lên cái số nên thôi.


[chapter]Screenshots[/chapter]
Trước khi edit:
8Fegi.jpg

Sau khi edit: Thuốc là Item, Đèn cầy là Key Item
8Feel.jpg
8FehB.jpg

[chapter]Script[/chapter]
=begin
#==============================================================================
# **  Menu á la Majo no Ie
# **  By: SoulPour777
#------------------------------------------------------------------------------
#  This script configures the menu and the item to be compatible for making
#  good horror games.
#
#  Features:
    - Item Numbers have been ommited in the Key Items.
    - The Menu is designed a la Witch's House / Majo no Ie
    - Only contains Items and Load
    - The item description has been fixed.
#==============================================================================
=end

#==============================================================================#
# ** Window_ItemList
#==============================================================================#
class Window_ItemList < Window_Selectable

  def include?(item)
    case @category
    when :item
      item.is_a?(RPG::Item) && !item.key_item?
    when :weapon
      item.is_a?(RPG::Weapon)
    when :armor
      item.is_a?(RPG::Armor)
    when :key_item
      item.is_a?(RPG::Item) && item.key_item?
    when :all
      item.is_a?(RPG::Item)
    else
      false
    end
  end
  
end #class
#==============================================================================#
# ** End Window Item
#==============================================================================#

class Scene_Menu < Scene_MenuBase
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  alias start_new_command start
  def start
    super
    create_command_window
    create_status_window
  end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  alias create_command_window_majo_no_ie create_command_window
  def create_command_window
    @command_window = Window_MenuCommand.new
    @command_window.set_handler(:item,      method(:command_item))
    @command_window.set_handler(:load,      method(:command_load))
    @command_window.set_handler(:cancel,    method(:return_scene))
    @command_window.set_handler(:game_end,  method(:command_game_end))
  end
  
  def command_load
    SceneManager.call(Scene_Load)
  end

  def command_game_end
    SceneManager.call(Scene_End)
  end

end

class Window_MenuCommand < Window_Command
  
  alias majo_no_ie_initialize initialize
  def initialize
    super(18, 290)
    select_last
  end  
  #--------------------------------------------------------------------------
  def make_command_list
    add_main_commands
    add_original_commands
    add_game_end_command
  end
  #--------------------------------------------------------------------------
  # * Add Main Commands to List
  #--------------------------------------------------------------------------
  def add_main_commands
    add_command(Vocab::item,   :item,   main_commands_enabled)
    add_command("Load",        :load,   main_commands_enabled)
  end
  
  def add_game_end_command
    add_command(Vocab::game_end, :game_end)
  end
  
end

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :pending_index            # Pending position (for formation)
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(160, 280, window_width, window_height)
    @pending_index = -1
    refresh
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  alias soul_window_width window_width
  def window_width
    return 340
  end
  #--------------------------------------------------------------------------
  # * Get Window Height
  #--------------------------------------------------------------------------
  alias  soul_window_height window_height
  def window_height
    return 130
  end
  #--------------------------------------------------------------------------
  # * Get Number of Items
  #--------------------------------------------------------------------------
  def item_max
    return 1
  end
end

class Window_Base < Window
  
  alias majo_no_ie_draw_actor_level draw_actor_level
  def draw_actor_level(actor, x, y)
    change_color(system_color)
    draw_text(x, y, 32, line_height, "Age")
    change_color(normal_color)
    draw_text(x + 32, y, 24, line_height, actor.level, 2)
  end  
  
  alias majo_no_ie_draw_actor_simple_status draw_actor_simple_status
  def draw_actor_simple_status(actor, x, y)
    draw_actor_name(actor, x, y)
    draw_actor_level(actor, x, y + line_height * 1)
    draw_actor_hp(actor, 60 + 120, y + line_height * 1)
  end
  
end
#------------------------------------------------
# Removes the Item Number or Count
#------------------------------------------------
class Window_ItemList < Window_Selectable
  def draw_item(index)
    item = @data[index]
    if item
      rect = item_rect(index)
      rect.width -= 4
      draw_item_name(item, rect.x, rect.y, enable?(item))
    end
  end
end

class Window_Command < Window_Selectable
  def initialize(x, y)
    clear_command_list
    make_command_list
    super(x, y + 10, 130, window_height)
    refresh
    select(0)
    activate
  end
end

class Scene_Item < Scene_ItemBase
  def start
    super
    create_help_window
    create_item_window
  end
  def create_item_window

    @help_window.x = 68
    @help_window.width = 415
    wy = @help_window.height
    wh = Graphics.height - wy
    item_position = 67
    @item_window = Window_ItemList.new(item_position, wy, Graphics.height, 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(:return_scene))
    @item_window.category = :all
    # ^ change to :key_item or :item if you want to use key items or item instead
    @item_window.select_last
    @item_window.activate
  end
end

[chapter]Credit[/chapter]
SoulPour777
̶N̶̶a̶̶g̶̶i̶̶s̶̶a̶ -> Nếu thích


[chapter]Đôi lời[/chapter]
Trình còn gà... tập đú edit thử tí thôi, các bác đừng ném gạch em nha. :tuki:

Comments

Sign In or Register to comment.