class Scene_Name
# -------------------------
def main
@actor = $game_actors[$game_temp.name_actor_id]
@edit_window = Window_NameEdit.new(@actor, $game_temp.name_max_char)
@input_window = Window_NameInput.new
@alert_window = Window_Base.new(188, 208, 264, 64)
@alert_window.contents = Bitmap.new(228, 32)
@alert_window.contents.font.name = "Arial"
@alert_window.contents.font.size = 24
@alert_window.contents.draw_text(0, 0, 228, 32, "You must enter a name.")
@alert_window.z = 1001
@alert_window.visible = false
c1 = "English"
c2 = "Space"
c3 = "Backspace"
c4 = "Default"
c5 = "Done"
commands = [c1, c2, c3, c4, c5]
@command_window = Window_NameCommand.new(160, commands)
@input_window.active = false
@input_window.visible = true
@command_window.index = 0
@command_window.visible = true
@command_window.active = true
@command_window.x = 0
@command_window.y = 128
@command_window.z = 1000
@alert_count = 0
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@edit_window.dispose
@input_window.dispose
@command_window.dispose
@alert_window.dispose
end
# -------------------------
def update
@edit_window.update
@input_window.update
@command_window.update
@alert_window.update
if @alert_window.visible == true && @alert_count > 0
@alert_count -= 1
if @alert_count <= 0
@command_window.active = true
@alert_window.visible = false
end
return
end
if @input_window.active == false
@command_window.active = true
end
if @command_window.active == false
@input_window.active = true
end
if Input.repeat?(Input::B) && @input_window.active == true
if @edit_window.index == 0
return
else
$game_system.se_play($data_system.cancel_se)
@edit_window.back
end
end
if Input.repeat?(Input::B) && @command_window.active == true
$game_system.se_play($data_system.buzzer_se)
return
end
if Input.trigger?(Input::C)
if @command_window.active == true
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
@input_window.mode = 1
@input_window.refresh
@command_window.active = false
@input_window.active = true
@input_window.index = 0
return
when 1
if @edit_window.index < $game_temp.name_max_char
$game_system.se_play($data_system.decision_se)
@edit_window.add(" ")
else
$game_system.se_play($data_system.buzzer_se)
end
return
when 2
$game_system.se_play($data_system.decision_se)
@edit_window.back
return
when 3
$game_system.se_play($data_system.decision_se)
@edit_window.restore_default
return
when 4
if @edit_window.name == ""
$game_system.se_play($data_system.buzzer_se)
@alert_window.visible = true
@command_window.active = false
@alert_count = 60
return
end
$game_system.se_play($data_system.decision_se)
@actor.name = @edit_window.name
$game_system.se_play($data_system.decision_se)
$scene = Scene_Map.new
return
end
end
if @edit_window.index == $game_temp.name_max_char &&
@input_window.active == true
$game_system.se_play($data_system.buzzer_se)
return
end
if @input_window.character == "" && @input_window.active == true
$game_system.se_play($data_system.buzzer_se)
return
end
if @input_window.character != nil && @input_window.active == true &&
@edit_window.index <= $game_temp.name_max_char
$game_system.se_play($data_system.decision_se)
if @input_window.mode == 1
@edit_window.char_type[@edit_window.index] = 1
else
@edit_window.char_type[@edit_window.index] = 2
end
@edit_window.add(@input_window.character)
end
return
end
end
end
That should do it.