Save-Point
2MenuLines ACE - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+--- Thread: 2MenuLines ACE (/thread-8250.html)



2MenuLines ACE - kyonides - 03-17-2021

2MenuLines ACE

by Kyonides Arkanthes


Introduction

This scriptlet allows you to distribute the main menu windows the same way the alternative plugin did in RMMV.

This is how it looks like in MV. You'd get something quite similar for VX ACE.

[Image: 02up-Menuace.png]

The Scriptlet

Code:
# * 2MenuLines ACE
#   Scripter : Kyonides Arkanthes
#   2021-03-16 - v. 1.0.0

# This script recreates RMMV's horizontal main menu.

class Window_MenuCommand
  @@last_command_symbol = nil
end

class HorzMenuCommandWindow < Window_MenuCommand
  def self.init_command_position() @@last_command_symbol = nil end
  def window_width() Graphics.width end
  def window_height() 72 end
  def col_max() 4 end
  def row_max() 2 end
end

class Window_HorzMenuStatus <  Window_MenuStatus
  def window_width() Graphics.width end
  def window_height() Graphics.height - 120 end
  def item_width() width / 2 - spacing end
  def item_height() (height - standard_padding * 2) / 2 end
  def col_max() 2 end
  def row_max() 2 end
  def item_rect(index)
    rect = super
    rect.x = index % row_max * (item_width + spacing - 8)
    rect.y = index / row_max * item_height
    rect.width += 16
    rect
  end

  def draw_item(index)
    a = $game_party.members[index]
    enabled = $game_party.battle_members.include?(a)
    rect = item_rect(index)
    rx = rect.x
    ry = rect.y
    lh = line_height + 2
    draw_item_background(index)
    draw_face(a.face_name, a.face_index, rx + 4, ry + 20, enabled)
    draw_actor_name(a, rx + 108, ry)
    draw_actor_level(a, rx + 108, ry + lh)
    draw_actor_class(a, rx + 108, ry + lh * 2)
    draw_actor_hp(a, rx + 108, ry + lh * 3)
    draw_actor_mp(a, rx + 108, ry + lh * 4)
  end
end

class MapNameWindow < Window_Base
  def initialize(mx, my)
    super(mx, my, 280, fitting_height(1))
    create_contents
    self.back_opacity = 160
    contents.draw_text(4, 0, width - 32, 24, $game_map.display_name, 1)
  end
end

class Scene_Map
  def call_menu
    Sound.play_ok
    SceneManager.call(Scene_Menu)
    HorzMenuCommandWindow.init_command_position
  end
end

class Scene_Menu
  def create_command_window
    @command_window = HorzMenuCommandWindow.new
    @command_window.set_handler(:item,      method(:command_item))
    @command_window.set_handler(:skill,     method(:command_personal))
    @command_window.set_handler(:equip,     method(:command_personal))
    @command_window.set_handler(:status,    method(:command_personal))
    @command_window.set_handler(:formation, method(:command_formation))
    @command_window.set_handler(:save,      method(:command_save))
    @command_window.set_handler(:game_end,  method(:command_game_end))
    @command_window.set_handler(:cancel,    method(:return_scene))
  end

  def create_status_window
    @map_window = MapNameWindow.new(0, @command_window.height)
    @gold_window.x = Graphics.width - @gold_window.width
    @gold_window.y = @command_window.height
    h = @command_window.height + @gold_window.height
    @status_window = Window_HorzMenuStatus.new(0, h)
  end
end


Terms & Conditions

Free for use in any game, just any.
You will need to send me a copy of your full game if you ever include 2 or more of my scripts. Laughing