#==============================================================================
# Auteur Inconnu ; Traduit Par Don Estebahn pour le forum de Rpg Fusion
#
# http://rpgfusionv2.1fr1.net/index.htm
#
# Merci à l'auteur de ce script sans qui je n'aurais jamais eu l'occasion
# de me la péter comme un porc pour avoir fait cette traduc minable.
# C'est 17 années de ma vie qui viennent de prendre un sens.
#
# Dédicace à deadcell qui vient sans le savoir de me rappeler que cette
# traduction existait. T'es un brave gars, jt'en dois une ;p.
#
# Dédicace également à Aktaan qui m'a fait une vraie reflexion de connard au
# moment où je lui ai annoncé cette nouvelle. Jretiens x).
# Enjoy!
#
#==============================================================================
class Window_Name < Window_Selectable
attr_accessor :string
attr_accessor :name
attr_accessor :default_name
attr_accessor :max_char
def initialize(actor, max_char)
super(135, 60, 440, 70)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 18
self.visible = true
self.active = true
@string = ""
@max_char = max_char
@actor = actor
@name = @actor.name
@name_text = @name.split(//)[0...@max_char]
for i in
0...@name_text.size @string += @name_text[i]
end
@default_name = @string
refresh
end
def add_char(char)
@string += char
end
def remove
@name_text = @string.split(//)
@string = ""
for i in
0...@name_text.size-1
@string += @name_text[i]
end
end
def refresh
self.contents.clear
@name_text = @string.split(//)
for i in 0...@max_char
text = @name_text[i]
if text == nil
text = "__"
end
x = 120 - @max_char * 14 + i * 28
self.contents.draw_text(x, 0, 28, 32, text, 1)
end
end
end#end of class
class Window_Array < Window_Selectable
attr_accessor :alpha
$checker = " "
ALPHABET_CHARACTER = [
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N",
"O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"," ", " ",
"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", " ", " ", " ", " ", " ", " "
]
def initialize
super(135, 130, 440, 330)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 18
self.visible = true
self.active = false
self.index = 0
@alpha = alpha
@item_max = ALPHABET_CHARACTER.size
refresh
end
def refresh
self.contents.clear
$checker = "capital"
for i in 0...28
x = 4 + i / 7 / 9 * 152 + i % 7 * 28
y = i / 7 % 9 * 32
self.contents.draw_text(x, y, 120, 32, ALPHABET_CHARACTER[i])
end
for i in 0...16
x = 150 + i / 4 / 9 * 152 + i % 4 * 28
y = i / 4 % 9 * 32
self.contents.draw_text(x, y, 120, 32, ALPHABET_CHARACTER[i + 28], 2)
end
end
def small_case
self.contents.clear
$checker = "small"
@new_alpha = []
for i in 0...ALPHABET_CHARACTER.size
@new_alpha.push(ALPHABET_CHARACTER[i].downcase)
end
for i in 0...28
x = 4 + i / 7 / 9 * 152 + i % 7 * 28
y = i / 7 % 9 * 32
self.contents.draw_text(x, y, 120, 32, @new_alpha[i])
end
for i in 0...16
x = 150 + i / 4 / 9 * 152 + i % 4 * 28
y = i / 4 % 9 * 32
self.contents.draw_text(x, y, 120, 32, @new_alpha[i + 28], 2)
end
end
def collect_char(character)
@alpha = " "
@character = character
if $checker == "small"
@alpha = @new_alpha[@character]
end
if $checker == "capital"
@alpha = ALPHABET_CHARACTER[@character]
end
return @alpha
end
def update_cursor_rect
x = 4 + @index / 7 / 9 * 152 + @index % 7 * 28
y = y = @index / 7 % 9 * 32
case @index
when 0...26
x = 4 + @index / 7 / 9 * 152 + @index % 7 * 28
y = @index / 7 % 9 * 32
when 27...43
x = 260 + (@index - 27) / 4 / 9 * 152 + (@index - 27) % 4 * 28
y = (@index - 27) / 4 % 9 * 32
end
self.cursor_rect.set(x - 5, y + 5, 22, 22)
end
def update
if self.active
super
if Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@index += 1
if @index == 37
@index = 0
end
end
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@index -= 1
if @index == -1
@index = 36
end
end
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
if @index >= 1 && @index <= 6 || @index >= 8 && @index <= 13 || @index >= 15 && @index <= 20 || @index >= 22 && @index <= 27
if @index >= 22 && @index <= 27
@index -= 22
else
@index += 6
end
elsif @index == 7 || @index == 14 || @index == 21
if @index == 21
@index -= 15
else
@index += 6
end
elsif @index == 28 || @index == 29 || @index == 32 || @index == 33 || @index == 36 || @index == 37
if @index == 36 || @index == 37
@index -= 9
else
@index += 3
end
elsif @index == 30 || @index == 31 || @index == 34 || @index ==35
if @index == 34 || @index == 35
@index -= 5
else
@index += 3
end
end
end#end of if statement
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
if @index <= 25 && @index >= 20 || @index <= 18 && @index >= 13 || @index <= 11 && @index >= 6 || @index <= 4 && @index >= 0 || @index == 43
if @index <= 4 && @index >= 0
@index += 22
elsif @index == 43
@index = 21
else
@index -= 6
end
elsif @index == 19 || @index == 12 || @index == 5
if @index == 5
@index = 20
else
@index -= 6
end
elsif @index == 35 || @index == 34 || @index == 31 || @index == 30 || @index == 27 || @index == 26
if @index == 27 || @index == 26
@index += 9
else
@index -= 3
end
elsif @index == 28 || @index == 29 || @index == 33 || @index == 32
if @index == 28 || @index == 29
@index += 5
else
@index -= 3
end
end
end
update_cursor_rect
end
end
end#end of class
class Scene_Namer
def initialize(actor_id , name_max)
@actor_id = actor_id
@name_max = name_max
end
def main
@rand_name = ["", "", "", "", "", "", "", "", ""]
@actor = $game_party.actors[@actor_id]
@window = Window_Base.new(0,0,130,130)
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.character("Faces/" + @actor.character_name, @actor.character_hue)
@sprite.z = 800
@sprite.x = 12
@sprite.y = 12
@choice = Window_Command.new(130, ["Défaut", "Capitales", "Minuscules", "Effacer"])
@choice.x = 0
@choice.y = 175
@lvl = Window_Help.new
@lvl.width = 130
@lvl.height = 150
@lvl.x = 0
@lvl.y = 120
@lvl.set_text("Level #{@actor.level}")
@lvl.opacity = 0
@cov = Window_Base.new(0,130,130,50)
@help = Window_Help.new()
@help.x = 135
@help.y = 0
@help.contents.draw_text(50,0,600,32,"Choisissez un nom")
@help.width = 440
@name_window = Window_Name.new(@actor, @name_max)
@content = Window_Array.new
list = ["Choisir", "Editer", "Quitter" ]
@command = Window_Command.new(130, list)
@command.active = false
@command.x = 0
@command.y = 330
@help_text = "TOUCHE X POUR BASCULER ENTRE LES MENUS"
@show = Window_Help.new
@show.width = 60
@show.height = 459
@show.y = 0
@show.x = 578
@show.contents = Bitmap.new(@show.width - 32, @show.height - 32)
@show.contents.font.name = "Tahoma"
@show.contents.font.size = 14
@new_text = @help_text.split("")
for i in
0...@new_text.size x = 10
y = i * 10
@show.contents.draw_text(x , y, 120, 32, @new_text[i])
end
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@window.dispose
@sprite.dispose
@choice.dispose
@lvl.dispose
@cov.dispose
@help.dispose
@name_window.dispose
@content.dispose
@command.dispose
@show.dispose
end
def update
@window.update
@sprite.update
@choice.update
@lvl.update
@cov.update
@help.update
@name_window.update
@content.update
@command.update
@show.update
if @choice.active
update_choice
return
end
if @command.active
update_command
return
end
if @content.active
update_content
return
end
end
def update_choice
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
case @choice.index
when 0
@name_window.string = @name_window.default_name
@name_window.refresh
when 1
@content.refresh
when 2
@content.small_case
when 3
@new_name = @rand_name[rand(@rand_name.size - 1)]
@name_window.string = @new_name
@name_window.refresh
end
end
if Input.trigger?(Input::B)
@choice.active = false
@command.active = true
end
end
def update_command
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
case @command.index
when 0
@counter = 0
@registered_name = @name_window.default_name
if @name_window.string == "" or nil
@name_window.string = @registered_name
@actor.name = @registered_name
@name_window.refresh
else
@actor.name = @name_window.string
end
@first_text = " Le nouveau nom du personnage est en train d'être mémorisé. "
@second_text = " Merci de patienter... "
@third_text = "#{@name_window.default_name} a été renommé #{@actor.name}."
@saved = Window_Help.new
@saved.x = 150
@saved.y = 250
@saved.z = 900
@saved.width = 350
loop do
@saved.update
Graphics.update
Input.update
@counter += 1
case @counter
when 7
@saved.set_text(@first_text)
when 65
@saved.set_text(@second_text)
when 150
@saved.set_text(@third_text)
when 195
break
end
end
@name_window.default_name = @actor.name
if @saved != nil
@saved.dispose
end
when 1
@command.active = false
@content.active = true
when 2
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
end
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@choice.active = true
@command.active = false
return
end
end
def update_content
if Input.trigger?(Input::C)
@compare = @name_window.string.split("")
if @compare.size - 1 == @name_window.max_char - 1
$game_system.se_play($data_system.buzzer_se)
return
else
$game_system.se_play($data_system.decision_se)
case @content.index
when 0...27
@name_window.add_char(@content.collect_char(@content.index))
when 27...44
@current = @content.index + 1
@name_window.add_char(@content.collect_char(@current))
end
end
@name_window.refresh
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@content.active = false
@command.active = true
return
end
if Input.trigger?(Input::X)
@compare = @name_window.string.split("")
if @compare.size <= 0
$game_system.se_play($data_system.buzzer_se)
return
else
$game_system.se_play($data_system.decision_se)
@name_window.remove
@name_window.refresh
end
end
end
end#end of class