The Window_MenuMessage is being processed/updated first before the Window_MenuCommand. In Window_Message, the method
input_pause is called from
process_input and yields the Fiber (i.e. halts further processing of the message) until the player inputs B or C. Immediately after that, there's an
Input.update. So after updating Window_MenuMessage, Window_MenuCommand (and subsequently all the other windows in your scene) do not know that the player triggered the C button during that frame, requiring a second press of the button on the next frame or later.
The obvious solution is to comment out that
Input.update but I don't know what consequences that can create.
EDIT:
Played with it a bit more. This is what I was able to come up with:
module MenuManager
MENU_DESCRIPTIONS ={ main_message: 'What will you do?'}
def self.method_wait_for_message=(method)
@method_wait_for_message = method
end
def self.wait_for_message
@method_wait_for_message.call if @method_wait_for_message
end
def self.menu_open
$game_message.add(MENU_DESCRIPTIONS[:main_message])
#MenuManager.wait_for_message
end
end
#■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
# This window displays party member status on the menu screen.
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :pending_index # Pending position (for formation)
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, window_width, window_height)
@pending_index = -1
refresh
end
def window_width
Graphics.width
end
def window_height
fitting_height(6)
end
def item_max
$game_party.members.size
end
def item_height
(height - standard_padding * 2) / 6
end
def draw_item(index, *args)
actor_id = index
return unless actor_id
actor = $game_party.members[actor_id]
rect = item_rect(index)
draw_actor_simple_status(actor, rect.x, rect.y)
end
def draw_actor_simple_status(actor, x, y)
draw_actor_name(actor, x+25, y)
draw_actor_icons(actor, x+120, y + 1, 122)
draw_actor_hp(actor, x + 260, y - 3)
draw_actor_mp(actor, x + 390, y - 3)
end
end
#■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
class Game_Message
attr_accessor :all_text_drawn
def done_drawing?
@all_text_drawn == true
end
end
#■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
class Window_MenuMessage < Window_Message
def window_height
fitting_height(9)
end
def update_placement
self.y = fitting_height(7) + 4
self.opacity = 0
end
#--------------------------------------------------------------------------
# * Main Processing of Fiber
#--------------------------------------------------------------------------
def fiber_main
$game_message.visible = true
update_background
update_placement
loop do
if $game_message.has_text?
$game_message.all_text_drawn = false
process_all_text
else
$game_message.all_text_drawn = true
end
process_input
$game_message.clear
Fiber.yield
break if Input.trigger?(:C) && !text_continue?
end
close_and_wait
$game_message.visible = false
@fiber = nil
end
#--------------------------------------------------------------------------
# * Input Processing
#--------------------------------------------------------------------------
def process_input
if $game_message.choice?
input_choice
elsif $game_message.num_input?
input_number
elsif $game_message.item_choice?
input_item
end
end
end
#■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
class Window_MenuCommand < Window_Command
def update
return unless $game_message.done_drawing?
super
end
end
#■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
class Scene_Menu
def start
super
create_all_windows
init_windows
end
def post_start
super
#MenuManager.method_wait_for_message = method(:wait_for_message)
MenuManager.menu_open
end
#def update_for_wait
#update_basic
#end
#def wait_for_message
#@message_window.update
#update_for_wait while $game_message.visible
#end
def create_all_windows
create_status_window
create_message_window
create_info_window
create_command_window
end
def init_windows
end
def create_status_window
@status_window = Window_MenuStatus.new(0, 0)
end
def create_message_window
@message_window = Window_MenuMessage.new
@message_back = Window_Base.new(0, @status_window.height+24, Graphics.width, 56)
end
def create_info_window
@info_viewport = Viewport.new
@info_viewport.rect.y = Graphics.height - @status_window.height
@info_viewport.rect.height = @status_window.height
@info_viewport.z = 100
@info_viewport.ox = 64
@status_window.viewport = @info_viewport
end
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_MenuCommand.new
@command_window.set_handler(:item, method(:command_item))
@command_window.set_handler(:cancel, method(:return_scene))
end
end