[Mensagem] New Messagem System 3.0
Página 1 de 1
[Mensagem] New Messagem System 3.0
NMS - Neo Message System 3.0 Beta
Autor: Woratana
Modo de Usar: Cole acima do Main. Instruções no script.
Função: Ele personaliza a mensagem. (Ícones, Faces de outros lados, negrito, itálico, sublinhado...
Créditos: Mako, Yatzumo, Straycat, Erzengel, RPG, Dubalex, Modern Algebra, Equilibrium Keeper, e Woratama.
Código
Espero que gostem.
FLw
Autor: Woratana
Modo de Usar: Cole acima do Main. Instruções no script.
Função: Ele personaliza a mensagem. (Ícones, Faces de outros lados, negrito, itálico, sublinhado...
Créditos: Mako, Yatzumo, Straycat, Erzengel, RPG, Dubalex, Modern Algebra, Equilibrium Keeper, e Woratama.
Código
- Spoiler:
- Código:
#===============================================================
# + [VX] [ NMS - Neo Message System 3.0 Beta ] +
#--------------------------------------------------------------
# >> por Woratana [woratana@hotmail.com]
# >> Thaiware RPG Maker Community
# >> Agradecimentos especiais: Mako, Yatzumo, Straycat, Erzengel, RPG,
# Dubalex, Modern Algebra, Equilibrium Keeper
#--------------------------------------------------------------
# >> Tradução para português por Khas\Kbça (Santuario Rpg Maker)
# Inclui: NEO-FACE SYSTEM ADVANCE (Version 3.0) por Woratana
#===============================================================
# Nota:
# Esse script começou a ser feito quando o Maker VX em ingles
# não estava pronto, então alguns comentarios estão em japones
# Esse script possui a ultima versão do Neo-Face System, então você
# precisa remover as versões do Neo-Face System se estiverem instaladas.
=begin
=============================================
+ NMS 3 Beta + [07/06/2008]
- Adicionado 'Text Remove List'
- Mudar Tamanho e Posição da janela temporiarios
- Você pode chamar o script:
$game_message.create_nms_data
para resetar a 'data" do NMS ou criar "data" para o Save Antigo
- Bug arrumado: Escrever a classe do Ator
- Bug arrumado: Box do nome fora da tela
- Adicione NAMEBOX_Y_PLUS_TOP para arrumar o bug do nome fora da tela quando mostra no topo
- Ajustar diferentes opacidades para o fundo da caixa de texto.
- Auto-ajusta caso a caixa de texto fique fora da tela
- Você pode mudar a face no meio da conversa, ou mudar o tamanho dela
=============================================
=============================================
+ NMS 2.3 + [11/03/2008 - 06/04/2008]
- Remover cor para os recursos [Escrever Texto]
- Recurso 'Texto Rapido'
- Face animada
- Reproduzir SE/ME
- Som ao desenhar letra
- Scroll Text Verticalmente e horizontalmente
- Corte automatico de texto (não funciona perfeitamente)
- Hex Color (Agradecimento especial: RPG & Erzengel)
- Mensagem em pop-up (Trabalho em progresso)
- Adicione o codigo do script nos comentarios de certas configurações,
então o usuario pode mudar pelo comando chamar script no game.
=============================================
=====================================
+ LISTA DE COMANDOS DO NMS 2.0 +
=====================================
Use estes comandos na caixa de mensagem
--------------------------
>> [COMANDOS ESPECIAIS] Chamando eventos e usos especiais
--------------------------
\ce[ID do Ev. Comum] << Chama um Evento comum imediatamente
\ani[ID da Animação] << Mostra animação em 'neste evento'
\bal[ID do balão] << Mostra um Balão de emoticon 'neste evento'
*Note: Neste Evento = Evento em que a mensagem é exibida
--------------------------
>> [COMANDOS DA BOX DE MENSAGEM]
--------------------------
* Propriedades temporarias só podem ser usadas uma vez
\wx[x] << Ajustar X temporario para x
\wy[y] << Ajustar Y temporario para Y
\ww[comprimento] << Ajustar comprimento temporario para width
\wh[altura] << Ajustar altura temporaria para height
----------------------------------------
>> +[ POP TEXT ]+
----------------------------------------
Pop text é o Box de mensagem que será mostrado acima do character
e terá um tamanho igual a mensagem a ser exibida.
Você pode chamar o Pop Text dessa maneira
\p[character]
* character: Evento que você deseja colocar o texto acima
0 para o Heroi
-1 para este evento
1 ou mais para evento de id X
----------------------------------------
>> +[ Texto Rapido ]+ a.k.a. Atalho
----------------------------------------
Adicione e chame um texto com um atalho
Você pode usar sintaxe especial nele. Ex "Welcome to \c[10]Syria Village\c[0]"
Use o comando seguinte para adicionar o texto
$nms.qt[ID do texto rapido] = 'Texto que você quer'
Use o comando abaixo para chamar o texto
\qt[ID do texto rapido]
--------------------------
>> [Desenhar imagem]
--------------------------
Desenhar Icone + Nome:
\dw[ID da arma]
\da[ID da armadura]
\di[ID do item]
\ds[ID da habilidade]
Desenhar Icone:
\ic[ID do icone]
Desenhar imagem da pasta System
\dp[Nome da imagem]
--------------------------
>> [Escrever texto]
--------------------------
Nome do Mapa atual:
\map
Nome do Personagem (por ID)
\nc[ID]
Nome do Personagem (por posição no grupo)
\np[posição]
Nome de Monstros:
\nm[monster ID]
\nt[troop ID]
Nomes variados:
\nw[ID da arma]
\na[ID da armadura]
\ns[ID da habilidade]
\ni[ID do item]
Preço do item
\price[ID do item]
--------------------------
>> [EFEITOS NO TEXTO]
--------------------------
\fn[Nome da Fonte] << Muda fonte
\fs[Tamanho da Fonte] << Muda tamanho da fonte
\delay[Intervalo] << Muda o intervalo entre letras (60 frames = 1sec)
\ref << Reseta Nome da Fonte
\res << Reseta Tamanho da Fonte
\red << Reseta Intervalo
\b << Liga\Desliga texto em negrito
\i << Liga\Desliga texto italico
\sh << Liga\Desliga texto com sombra
\lbl << Liga\Desliga modo letra por letra
--------------------------
>> [Box de Nome e Face]
--------------------------
\nb[Nome a ser exibido] << Exibe a Box de Nome na mensagem atual
\rnb[Nome a ser exibido] << Repete a Box de Nome
Com esse comando a Box de Nome será exibida das mensagens seguintes, a menos que
você coloque \nb[Name] na mensagem ou pare o comando digitando \rnb[]
\sd[lado] << Muda o lado da face. Use:
0 - Esquerda, face normal
1 - Esquerda, face Neo
-1 - Direita, face normal
2 - Direita, face Neo
$nms.color = [R,G,B] << Muda a cor do texto na Box de Nome
Variando de 0 a 255, coloque:
R - Vermelho
G - Verde
B - Azul
Use um dos comandos abaixo para desenhar uma nova face.
\fa[nome,index]
\fa[nome,index,novo_lado]
nome: Nome da Imagem da Face
index: Index (0 - 7)
novo_lado: Lado novo da Face
--------------------------
>> [SOM]
--------------------------
\se[filename] << Play SE
\me[filename] << Play ME
\bgm[filename] << Play BGM
Onde filename é o nome do arquivo
\typ << Liga\Desliga o som em cada letra
--------------------------
>> [COMANDOS VARIADOS]
--------------------------
\cb << Liga\Desliga a opção de passar texto a frente (o jogador pressiona enter para avançar)
\nl << Inicia uma nova linha
\sc[x] << Cria um espaço em branco de x pixels
\w[x] << Esperar X frames
\c[#XXXXXX] << Usar cores hexadecimais no texto
----------------------------------
>>Funções padrão do VX
----------------------------------
\v[variable ID] << Escreve valor da variavel
\n[actor ID] << Escreve nome do ator
\c[color ID] << Muda a cor do texto (conforme a windowskin em uso)
\g << Mostra janela de ouro
\. << Espera 15 frames
\| << Espera 60 frames
\! << Espera o jogador pressionar alguma tecla para continuar
\> << Passa a frente o modo letra por letra na linha atual
\< << Para o modo letra por letra na linha atual
\^ <<Fecha a Box de mensagem
\\ << Escreve '\'
=end
class Window_Base
#---------------------------------
# [INICIO] CONFIGURAÇÃO DO script
#-------------------------------
#---------------------------------
# ? SISTEMA DE MENSAGEM
#-------------------------------
NMS_FONT_NAME = Font.default_name # Nome da fonte
NMS_FONT_SIZE = 20 # Tamanho da FOnte
# Ajustes de Cor (Variando na windowskin)
NMS_ITEM_NAME_COLOR_ID = 5 #Itens
NMS_WEAPON_NAME_COLOR_ID = 10 #Armas
NMS_ARMOR_NAME_COLOR_ID = 4 #Armaduras
NMS_SKILL_NAME_COLOR_ID = 2 #Habilidades
NMS_DELAY_PER_LETTER = 0 # Intervalo (em frames) no modo letra por letra
TEXT_X_PLUS = 0 # Adicional X no texto horizontal
CHOICE_INPUT_X_PLUS = 0 # Adicional X na caixa de escolhas
NMS_MSGWIN_X = 0 # Posição padrão X da janela de mensagens
NMS_MSGWIN_WIDTH = 544 # COmprimento padrão da janela de mensagens
NMS_MSGWIN_MIN_HEIGHT = 128 # Altura minima da janela de mensagens
NMS_MAX_LINE = 4 # Maximo de linhas por pagina
NMS_GET_NEXT_LINE = false # Pegar mensagem da proxima linha, se a box não estiver cheia
NMS_MSG_BACK = "MessageBack" # Nome da imagem de fundo da mensagem (pasta System)
NMS_MSG_BACK_OPACITY = 255 # Opacidade do fundo de mensagem
NMS_TEXT_SCROLL = false # Usar Scroll vertical?
NMS_TEXT_AUTO_CUT = false # O texto inicia uma linha nova se a anterior estiver cheia (pode conter bugs nessa função)
NMS_TEXT_AUTO_SCROLL_HORIZONTAL = false # Usar Scroll horizontal?
# Não irá funcionar se NMS_TEXT_AUTO_CUT estiver em true
NMS_TEXT_AUTO_SCROLL_HORIZONTAL_DELAY = 1 # Intervalo do Scroll
NMS_USER_NEW_LINE = false # Se true, o texto só irá a uma nova linha ao digitar \nl
NMS_REMOVE_LIST = [] # Lista de texto que você quer remover da mensagem
#Por exemplo, NMS_REMOVE_LIST = ['test', '[MS]']
# irá remover 'test' e '[MS]' antes de mostrar a mensagem
#---------------------------------
# ? FACE SYSTEM
#-------------------------------
#------------------------------------------------
# ** Configuração
#----------------------------------------------
DEFAULT_FACE_SIDE = 0 # Lado padrão da face
# 0 - Esquerda, face normal
# 1 - Esquerda, face Neo
# -1 - Direita, face normal
# 2 - Direita, face Neo
FACE_X_PLUS = 0 # Adicional face X
FACE_Y_PLUS = 0 # Adicional face Y
MOVE_TEXT = true # Mover o texto conforme o lado da face
FADE_EFFECT = true # Efeito Fade ao mostrar face
FADE_SPEED = 20 # Velocidade
FADE_ONLY_FIRST = true # Usar efeito somente na primeira janela de mensagem?
MOVE_EFFECT = true # Efeito de Mover ao mostrar face
MOVE_SPEED = 10 # Velocidade
MOVE_ONLY_FIRST = true # Usar efeito somente na primeira janela de mensagem?
FADE_MOVE_WHEN_USE_NEW_FACE = true # Efeito fade ao trocar de face?
#-------------------------------
# ** NEO FACE SYSTEM
#----------------------------
EightFaces_File = false # Usar 8 faces no arquivo ou somente 1
#-------------------------------
# ** ANIMATED FACE SYSTEM
#----------------------------
ANIMATE_FACE_DELAY = 6 # Intervalo de animação em faces
ANIMATE_FACE_CONTINUE = false # Continuar face animada ao parar de escrever?
#------------------------------------
# ? NAME BOX SYSTEM
#----------------------------------
NAMEBOX_SKIN = 'Window' # Nome da windowskin da Box de nome, em 'Graphics/System'
NAMEBOX_OPACITY = 255 # Opacidade da box de nome
NAMEBOX_OPACITY_DIM_BG = 0 # Opacidade da box de nome usando background solido
NAMEBOX_OPACITY_NO_BG = 0 # Opacidade da box de nome usando background transparente
NAMEBOX_BACK_OPACITY = 195# Opacidade do fundo da box
NAMEBOX_X_PLUS_NOR = 100 # Adicional X da Box de Nome
NAMEBOX_X_PLUS_NEO = 160 # Adicional X da Box de Nome Neo
NAMEBOX_Y_PLUS = 0 # Adicional Y da Box de Nome
NAMEBOX_Y_PLUS_TOP = 140 #Adicional Y da Box de Nome, se estiver no topo
NAMEBOX_TEXT_FONT = Font.default_name # Nome da fonte usada na Box de Nome
NAMEBOX_TEXT_SIZE = Font.default_size # Tamanho da fonte
NAMEBOX_TEXT_HEIGHT_PLUS = 2 # Aumentar altura do texo?
NAMEBOX_TEXT_BOLD = false # Texto em negrito?
NAMEBOX_TEXT_OUTLINE = false # Texto com contorno?
NAMEBOX_TEXT_DEFAULT_COLOR = [255,255,255] #Cor do texto, em RGB
NAMEBOX_TEXT_AFTER_NAME = ":" # Texto após o nome, use "" para desativar
NAMEBOX_BOX_WIDTH_PLUS = 6 # Aumentar Comprimento
NAMEBOX_BOX_HEIGHT_PLUS = 7 # Aumentar Altura
MOVE_NAMEBOX = true # Mover Box de Nome ao lado da face?
#---------------------------------
# ? SISTEMA DE SOM
#-------------------------------
TYPING_SOUND = true # Usar som ao digitar?
TYPING_SOUND_FILE = 'Open1' # Nome da SE usada
TYPING_SOUND_VOLUME = 40 # Volume da SE
TYPING_SOUND_SKIP = 4 # Atraso (em frames) ao tocar SE
#---------------------------------
# [END] SETUP script PART
#-------------------------------
end
$worale = {} if $worale == nil
$worale["NMS"] = true
class Window_Message < Window_Selectable
#--------------------------------------------------------------------------
# ? ALIAS
#--------------------------------------------------------------------------
alias wor_nms_winmsg_ini initialize
def initialize
wor_nms_winmsg_ini
$nms = $game_message
contents.font.name = $nms.nms_fontname
contents.font.size = $nms.nms_fontsize
@face = Sprite.new
@face.z = self.z + 5
@nametxt = Sprite.new
@nametxt.z = self.z + 15
@namebox = nil
@ori_x = 0
@name_text = nil
@showtime = 0 # To check if this is first time it shows message (For face)
@face_data = Array.new(3)
@face_data_old = Array.new(3)
#NMS 2++
self.width = $nms.msg_w
self.height = $nms.msg_h
update_window_size(true)
self.x = $nms.msg_x
@typse_count = 0
@delay_text = 0
@no_press_input = false
@biggest_text_height = 0
@all_text_width = 0
@animf_dl = 0 # Animation Face Delay
@animf = false # Using Animation Face?
@animf_ind = 0 # Animation Face Index
@pop = nil # Pop ID
end
#--------------------------------------------------------------------------
# ? ??
#--------------------------------------------------------------------------
def dispose
super
dispose_gold_window
dispose_number_input_window
dispose_back_sprite
end
#--------------------------------------------------------------------------
# ? EDITED
#--------------------------------------------------------------------------
def update
super
if self.visible == true
update_back_sprite
update_gold_window
update_number_input_window
update_show_fast
update_window_size
update_animate_face if @animf
@typse_count -= 1 if @typse_count > 0
if @name_text != nil
draw_name(@name_text,self.x,self.y)
end
if @face.bitmap != nil
# UPDATE FADE IN EFFECT
if @face.opacity < 255
@face.opacity += FADE_SPEED
end
# UPDATE MOVE IN EFFECT
if $nms.face_move and @ori_x != @face.x
if (@ori_x > @face.x and @face.x + MOVE_SPEED < @ori_x) or (@ori_x < @face.x and @face.x - MOVE_SPEED > @ori_x)
@face.x += MOVE_SPEED if @ori_x > @face.x
@face.x -= MOVE_SPEED if @ori_x < @face.x
else
@face.x = @ori_x
end
end
end
end
unless @opening or @closing
if @wait_count > 0
@wait_count -= 1
elsif self.pause
input_pause
elsif self.active
input_choice
elsif @number_input_window.visible
input_number
elsif @text != nil
if @delay_text > 0
@delay_text -= 1
else
update_message
end
elsif continue?
@showtime += 1
start_message
open
$game_message.visible = true
else
close
@showtime = 0
if @face.bitmap != nil
@face.bitmap.dispose
end
clear_namebox if @namebox != nil
$game_message.visible = @closing
end
end
end
#--------------------------------------------------------------------------
# ? NEW
#--------------------------------------------------------------------------
def update_window_size(direct = false, create_bitmap = true)
if (self.width != $nms.msg_w or self.height != $nms.msg_h) or direct
self.width = $nms.msg_w if $nms.msg_w > 32
self.height = $nms.msg_h if $nms.msg_h > 32
create_contents if create_bitmap
end
end
#--------------------------------------------------------------------------
# ? ???????????
#--------------------------------------------------------------------------
def create_gold_window
@gold_window = Window_Gold.new(384, 0)
@gold_window.openness = 0
end
#--------------------------------------------------------------------------
# ? ????????????
#--------------------------------------------------------------------------
def create_number_input_window
@number_input_window = Window_NumberInput.new
@number_input_window.visible = false
end
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
def create_back_sprite
@back_sprite = Sprite.new
@back_sprite.bitmap = @old_mback = Cache.system($game_message.mback)
@back_sprite.opacity = @old_mback_opac = $game_message.mback_opac
@back_sprite.visible = (@background == 1)
@back_sprite.z = 190
end
#--------------------------------------------------------------------------
# ? ???????????
#--------------------------------------------------------------------------
def dispose_gold_window
@gold_window.dispose
end
#--------------------------------------------------------------------------
# ? ????????????
#--------------------------------------------------------------------------
def dispose_number_input_window
@number_input_window.dispose
end
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
def dispose_back_sprite
@back_sprite.dispose
end
#--------------------------------------------------------------------------
# ? ???????????
#--------------------------------------------------------------------------
def update_gold_window
@gold_window.update
end
#--------------------------------------------------------------------------
# ? ????????????
#--------------------------------------------------------------------------
def update_number_input_window
@number_input_window.update
end
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
def update_back_sprite
@back_sprite.visible = (@background == 1)
@back_sprite.y = y - 16
@back_sprite.opacity = $nms.mback_opac > openness ? openness : $nms.mback_opac
@back_sprite.update
end
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def update_show_fast
if self.pause or self.openness < 255
@show_fast = false
elsif Input.trigger?(Input::C) and @wait_count < 2 and !@no_press_input
@show_fast = true
elsif not Input.press?(Input::C)
@show_fast = false
end
if @show_fast and @wait_count > 0
@wait_count -= 1
end
end
#--------------------------------------------------------------------------
# ? ????????????????????
#--------------------------------------------------------------------------
def continue?
return true if $game_message.num_input_variable_id > 0
return false if $game_message.texts.empty?
if self.openness > 0 and not $game_temp.in_battle
return false if @background != $game_message.background
return false if @position != $game_message.position
end
return true
end
#--------------------------------------------------------------------------
# ? EDITED: NMS 2.2+
#--------------------------------------------------------------------------
def start_message
@all_text_width = 0
@pop = nil
@text = ""
@text_line = $game_message.texts.size < $game_message.max_line ? $game_message.texts.size + 1 : MAX_LINE + 1
for i in 0...$game_message.texts.size
# Change " " to "" (Spacing for choice)
@text += "" if i >= $game_message.choice_start
@text += $game_message.texts[i].clone + "\x00"
end
@item_max = $game_message.choice_max
convert_special_characters
reset_window
update_window_size
new_page
end
#--------------------------------------------------------------------------
# ? EDITED
#--------------------------------------------------------------------------
def new_page
@animf = false
contents.clear
if @face.bitmap != nil
@face.bitmap.dispose
end
if $game_message.face_name.empty?
@contents_x = TEXT_X_PLUS
else
nms_draw_new_face
# CHECK FOR MOVE EFFECT
@ori_x = @face.x
if $nms.face_move and ((MOVE_ONLY_FIRST and @showtime <= 1) or (MOVE_ONLY_FIRST == false))
if $game_message.side == 0 or $game_message.side == 1
@face.x = 0 - @face.width
else
@face.x = Graphics.width
end
end
@contents_x = get_x_face
end
@main_contents_x = @contents_x
@contents_y = 0
@line_count = 0
@typse_count = 0
@show_fast = false
@line_show_fast = false
@pause_skip = false
contents.font.color = text_color(0)
@contents_x += CHOICE_INPUT_X_PLUS if $game_message.choice_max > 00
if @old_mback != Cache.system($nms.mback) or @old_mback_opac != $nms.mback_opac
dispose_back_sprite; create_back_sprite
end
@no_press_input = false
self.oy = 0
end
#--------------------------------------------------------------------------
# ? EDITED
#--------------------------------------------------------------------------
def new_line
biggest = @biggest_text_height > WLH ? @biggest_text_height : WLH
@contents_y += biggest
if $nms.txt_scrl and @contents_y >= contents.height and @text != ""
rect = Rect.new(0, biggest, contents.width, contents.height - biggest)
cont_s = Bitmap.new(contents.width,contents.height)
cont_s.blt(0, 0, contents, rect)
rect_s = Rect.new(0,0,contents.width,contents.height)
contents.clear_rect(0, 0, contents.width, contents.height)
contents.blt(0, 0, cont_s, rect_s)
@contents_y = rect.height
cont_s.dispose
@show_fast = false
@no_press_input = true
end
@contents_x = @main_contents_x
@contents_x += CHOICE_INPUT_X_PLUS if $game_message.choice_max > 0
@biggest_text_height = WLH
@line_count += 1
@line_show_fast = false
end
#--------------------------------------------------------------------------
# ? EDITED
#--------------------------------------------------------------------------
def convert_special_characters
clear_namebox if @namebox != nil
# Woratana's :: Quick Text
@text.gsub!(/\\QT\[([0-9]+)\]/i) { $nms.qt[$1.to_i] }
#--------------------------
# DEFAULT FEATURES
#-----------------------
@text.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
@text.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
@text.gsub!(/\\C\[(.*?)\]/i) { "\x01{#{$1}}" }
@text.gsub!(/\\G/i) { "\x02" }
@text.gsub!(/\\\./) { "\x03" }
@text.gsub!(/\\\|/) { "\x04" }
@text.gsub!(/\\!/) { "\x05" }
@text.gsub!(/\\>/) { "\x06" }
@text.gsub!(/\\</) { "\x07" }
@text.gsub!(/\\\^/) { "\x08" }
@text.gsub!(/\\\\/) { "\\" }
#--------------------------
# * NMS FEATURES!!
#-----------------------
# Woratana's :: Draw Weapon Name + Icon
@text.gsub!(/\\DW\[([0-9]+)\]/i) { "\x83[#{$data_weapons[$1.to_i].icon_index}]\x01{#{NMS_WEAPON_NAME_COLOR_ID}}\\nw[#{$1.to_i}]\x01{#{$nms.last_color}}"}
# Woratana's :: Draw Item Name + Icon
@text.gsub!(/\\DI\[([0-9]+)\]/i) { "\x83[#{$data_items[$1.to_i].icon_index}]\x01{#{NMS_ITEM_NAME_COLOR_ID}}\\ni[#{$1.to_i}]\x01{#{$nms.last_color}}" }
# Woratana's :: Draw Armor Name + Icon
@text.gsub!(/\\DA\[([0-9]+)\]/i) { "\x83[#{$data_armors[$1.to_i].icon_index}]\x01{#{NMS_ARMOR_NAME_COLOR_ID}}\\na[#{$1.to_i}]\x01{#{$nms.last_color}}"}
# Woratana's :: Draw Skill Name + Icon
@text.gsub!(/\\DS\[([0-9]+)\]/i) { "\x83[#{$data_skills[$1.to_i].icon_index}]\x01{#{NMS_ITEM_NAME_COLOR_ID}}\\ns[#{$1.to_i}]\x01{#{$nms.last_color}}"}
# Woratana's :: Call Animation
@text.gsub!(/\\ANI\[([0-9]+)\]/i) { "\x80[#{$1}]" }
# Woratana's :: Call Balloon
@text.gsub!(/\\BAL\[([0-9]+)\]/i) { "\x81[#{$1}]" }
# Woratana's :: Call Common Event
@text.gsub!(/\\CE\[([0-9]+)\]/i) { "\x82[#{$1}]" }
# Woratana's :: Draw Icon
@text.gsub!(/\\IC\[([0-9]+)\]/i) { "\x83[#{$1}]" }
# Woratana's :: Map Name
@text.gsub!(/\\MAP/i) { nms_get_map_name }
# Woratana's :: Actor Class Name
@text.gsub!(/\\NC\[([0-9]+)\]/i) { $data_classes[$game_actors[$1.to_i].class_id].name }
# Woratana's :: Party Actor Name
@text.gsub!(/\\NP\[([0-9]+)\]/i) { $game_party.members[($1.to_i - 1)].name }
# Woratana's :: Monster Name
@text.gsub!(/\\NM\[([0-9]+)\]/i) { $data_enemies[$1.to_i].name }
# Woratana's :: Troop Name
@text.gsub!(/\\NT\[([0-9]+)\]/i) { $data_troops[$1.to_i].name }
# Woratana's :: Item Name
@text.gsub!(/\\NI\[([0-9]+)\]/i) { $data_items[$1.to_i].name }
# Woratana's :: Weapon Name
@text.gsub!(/\\NW\[([0-9]+)\]/i) { $data_weapons[$1.to_i].name }
# Woratana's :: Armor Name
@text.gsub!(/\\NA\[([0-9]+)\]/i) { $data_armors[$1.to_i].name }
# Woratana's :: Skill Name
@text.gsub!(/\\NS\[([0-9]+)\]/i) { $data_skills[$1.to_i].name }
# Woratana's :: Item Price
@text.gsub!(/\\PRICE\[([0-9]+)\]/i) { $data_items[$1.to_i].price.to_s }
# Woratana's :: Font Name Change
@text.gsub!(/\\FN\[(.*?)\]/i) { "\x84[#{$1}]" }
# Woratana's :: Font Size Change
@text.gsub!(/\\FS\[(.*?)\]/i) { "\x85[#{$1}]" }
# Woratana's :: Reset Font Name
@text.gsub!(/\\REF/i) { "\x86" }
# Woratana's :: Reset Font Size
@text.gsub!(/\\RES/i) { "\x87" }
# Woratana's :: BOLD Text
@text.gsub!(/\\B/i) { "\x88" }
# Woratana's :: ITALIC Text
@text.gsub!(/\\I/i) { "\x89" }
# Woratana's :: Text DELAY
@text.gsub!(/\\DELAY\[([0-9]+)\]/i) { "\x90[#{$1}]"}
# Woratana's :: Reset Text Delay
@text.gsub!(/\\RED/i) { "\x91" }
# Woratana's :: Turn On/Off Letter by Letter
@text.gsub!(/\\LBL/i) { "\x92" }
# Woratana's NeoFace System
@text.scan(/\\SD\[([-,0-9]+)\]/i)
if $1.to_s != ""
$game_message.side = $1.to_i
@text.sub!(/\\SD\[([-,0-9]+)\]/i) {}
end
# Woratana's :: Name Box
@text.scan(/\\NB\[(.*?)\]/i)
if $1.to_s != ""
n_text = $1.to_s.gsub(/\x01\{(.*?)\}/i) {} # Clear If there's Color
@name_text = n_text
@text.sub!(/\\NB\[(.*?)\]/i) {}
end
# Woratana's :: Repeat Name Box
@text.gsub!(/\\RNB\[(.*?)\]/i) do
$game_message._name = $1.to_s
a = ""
end
# NMS 2++
# Woratana's :: SHADOW Text
@text.gsub!(/\\SH/i) { "\x93" }
# Woratana's :: Cancel Skip Text Button
@text.gsub!(/\\CB/i) { "\x94" }
# Woratana's :: Wait X Frame
@text.gsub!(/\\W\[([0-9]+)\]/i) { "\x95[#{$1}]" }
# Woratana's :: Add Space X Pixel
@text.gsub!(/\\SC\[([0-9]+)\]/i) { "\x96[#{$1}]" }
# Woratana's :: Play SE
@text.gsub!(/\\SE\[(.*?)\]/i) { "\x97[#{$1}]" }
# Woratana's :: Play ME
@text.gsub!(/\\ME\[(.*?)\]/i) { "\x98[#{$1}]" }
# Woratana's :: Play BGM
@text.gsub!(/\\BGM\[(.*?)\]/i) { "\x99[#{$1}]" }
# Woratana's :: Start New Line
@text.gsub!(/\\NL/i) { "\x09" }
# Woratana's :: Turn ON/OFF Typing Sound
@text.gsub!(/\\TYP/i) { "\x10" }
# Woratana's :: Draw Picture
@text.gsub!(/\\DP\[(.*?)\]/i) { "\x11[#{$1}]" }
# Woratana's :: Draw Face
@text.gsub!(/\\FA\{(.*?)\}/i) { "\x12{#{$1}}" }
# Woratana's :: Temporary Width
@text.scan(/\\WW\[([-,0-9]+)\]/i)
if $1.to_s != ''
$nms.msg_temp_w = $1.to_i
@text.sub!(/\\WW\[([-,0-9]+)\]/i) {}
end
# Woratana's :: Temporary Height
@text.scan(/\\WH\[([-,0-9]+)\]/i)
if $1.to_s != ''
$nms.msg_temp_h = $1.to_i
@text.sub!(/\\WH\[([-,0-9]+)\]/i) {}
end
# Woratana's :: Temporary X
@text.scan(/\\WX\[([-,0-9]+)\]/i)
if $1.to_s != ''
$nms.msg_temp_x = $1.to_i
@text.sub!(/\\WX\[([-,0-9]+)\]/i) {}
end
# Woratana's :: Temporary Y
@text.scan(/\\WY\[([-,0-9]+)\]/i)
if $1.to_s != ''
$nms.msg_temp_y = $1.to_i
@text.sub!(/\\WY\[([-,0-9]+)\]/i) {}
end
# Woratana's :: Remove text list
NMS_REMOVE_LIST.each {|i| @text.gsub!(/#{i}/i) {} }
# Woratana's :: Pop Text
@text.scan(/\\P\[(.*?)\]/i)
if $1.to_s != ""
@pop = $1.to_i
contents.font.name = $nms.nms_fontname if contents.font.name != $nms.nms_fontname
contents.font.size = $nms.nms_fontsize if contents.font.size != $nms.nms_fontsize
a = @text.split(/\x00/)
for i in 0..(a.size - 1)
text_width = contents.text_size(a[i]).width
@all_text_width = text_width if @all_text_width < text_width
end
nms_draw_new_face
if @face.bitmap != nil
if get_x_face == 0 and MOVE_TEXT
@all_text_width += (@face.width + TEXT_X_PLUS)
else
@all_text_width += get_x_face
end
@face.bitmap.dispose
@face.bitmap = nil
end
@text.sub!(/\\P\[(.*?)\]/i) {}
end
@name_text = $game_message._name if @name_text == nil and $game_message._name != ""
end
#--------------------------------------------------------------------------
# ? EDIT: NMS 2.2++
#--------------------------------------------------------------------------
def reset_window
@background = $game_message.background
@position = $game_message.position
if @background == 0
self.opacity = 255
else
self.opacity = 0
end
# Calculate Window X/Y and Size depends on Pop or normal message
if @pop != nil
$nms.msg_h = [((@text_line * WLH) + 8), $nms.msg_h_user].min
$nms.msg_w = @all_text_width + 32
case @pop
when 0 # Player
set_window_xy($game_player)
when -1 # This Event
set_window_xy($game_map.events[$game_message.event_id])
else # Event ID
set_window_xy($game_map.events[@pop])
end
else
$nms.msg_h = ((((@text_line * WLH) + 8) > $nms.msg_h_user) and ($nms.txt_scrl == false)) ? ((@text_line * WLH) + 8) : $nms.msg_h_user
$nms.msg_w = NMS_MSGWIN_WIDTH
self.x = $nms.msg_x
case @position
when 0 # Down
self.y = 0
@gold_window.y = 360
when 1 # Middle
self.y = ((Graphics.height - $nms.msg_h) / 2)
@gold_window.y = 0
when 2 # Up
self.y = Graphics.height - $nms.msg_h
@gold_window.y = 0
end
end
# Temporary Size & Position
if !$nms.msg_temp_w.nil?
$nms.msg_w = $nms.msg_temp_w
$nms.msg_temp_w = nil
end
if !$nms.msg_temp_h.nil?
$nms.msg_h = $nms.msg_temp_h
$nms.msg_temp_h = nil
end
if !$nms.msg_temp_x.nil?
self.x = $nms.msg_temp_x
$nms.msg_temp_x = nil
end
if !$nms.msg_temp_y.nil?
self.y = $nms.msg_temp_y
$nms.msg_temp_y = nil
end
# Fix Window Position if it's out of screen
self.x = 0 if self.x < 0
self.x = Graphics.width - $nms.msg_w if (self.x + $nms.msg_w) > Graphics.width
self.y = 0 if self.y < 0
self.y = Graphics.height - $nms.msg_h if (self.y + $nms.msg_h) > Graphics.height
end
#--------------------------------------------------------------------------
# ? SET Window XY for Pop Message
#--------------------------------------------------------------------------
def set_window_xy(chara)
char_x = chara.screen_x
char_y = chara.screen_y
self.x = char_x - ($nms.msg_w / 2)
self.y = ((char_y - 32 - $nms.msg_h) >= 0) ? (char_y - 32 - $nms.msg_h) : (char_y + 32)
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
def terminate_message
self.active = false
self.pause = false
self.index = -1
@gold_window.close
@number_input_window.active = false
@number_input_window.visible = false
$game_message.main_proc.call if $game_message.main_proc != nil
$game_message.clear
end
#--------------------------------------------------------------------------
# ? EDITED
#--------------------------------------------------------------------------
def update_message
loop do
c = @text.slice!(/./m)
case c
when nil
finish_message
break
when "\x00"
new_line if !$nms.txt_unl
if @line_count >= $game_message.max_line
unless @text.empty?
self.pause = true
break
end
end
when "\x80"
@text.sub!(/\[([0-9]+)\]/, "")
$game_map.events[$game_message.event_id].animation_id = $1.to_i
when "\x81"
@text.sub!(/\[([0-9]+)\]/, "")
$game_map.events[$game_message.event_id].balloon_id = $1.to_i
when "\x82"
@text.sub!(/\[([0-9]+)\]/, "")
a = $game_map.interpreter.params[0]
$game_map.interpreter.params[0] = $1.to_i
$game_map.interpreter.command_117
$game_map.interpreter.params[0] = a
when "\x83"
@text.sub!(/\[([0-9]+)\]/, "")
bitmap = Cache.system("Iconset")
icon_index = $1.to_i
# Check for Auto Cut
new_line if $nms.txt_cut and (@contents_x + 24 > contents.width)
# Draw ICON
draw_icon(icon_index, @contents_x, @contents_y, true)
@contents_x += 24
when "\x84"
@text.sub!(/\[(.*?)\]/, "")
$nms.nms_fontname = $1.to_s
next
when "\x85"
@text.sub!(/\[([0-9]+)\]/, "")
$nms.nms_fontsize = $1.to_i; next
when "\x86"
$nms.nms_fontname = NMS_FONT_NAME; next
when "\x87"
$nms.nms_fontsize = NMS_FONT_SIZE; next
when "\x88"
contents.font.bold = contents.font.bold == true ? false : true
next
when "\x89"
contents.font.italic = contents.font.italic == true ? false : true
next
when "\x90"
@text.sub!(/\[([0-9]+)\]/, "")
$nms.text_delay = $1.to_i; next
when "\x91"
$nms.text_delay = NMS_DELAY_PER_LETTER; next
when "\x92"
$nms.lbl = $nms.lbl == true ? false : true; next
when "\x93"
contents.font.shadow = contents.font.shadow == true ? false : true
next
when "\x94"
@no_press_input = @no_press_input == true ? false : true
next
when "\x95"
@text.sub!(/\[([0-9]+)\]/, "")
@wait_count = $1.to_i
break
when "\x96"
@text.sub!(/\[([0-9]+)\]/, "")
@contents_x += $1.to_i
next
when "\x97"
@text.sub!(/\[(.*?)\]/, "")
RPG::SE.new($1).play
when "\x98"
@text.sub!(/\[(.*?)\]/, "")
RPG::ME.new($1).play
when "\x99"
@text.sub!(/\[(.*?)\]/, "")
RPG::BGM.new($1).play
when "\x09"
new_line
when "\x10"
$nms.typ_se = !$nms.typ_se
when "\x11"
@text.sub!(/\[(.*?)\]/, "")
bitmap = Cache.system($1.to_s)
rect = Rect.new(0,0,0,0)
rect.width = bitmap.width
rect.height = bitmap.height
# Check for Auto Cut & Scroll
if (@contents_x + bitmap.width > contents.width)
if $nms.txt_cut; new_line
elsif $nms.txt_scrl_hori; nms_scroll_hori(bitmap.width)
end
end
# Draw Image
self.contents.blt(@contents_x, @contents_y, bitmap, rect)
@contents_x += bitmap.width
@biggest_text_height = bitmap.height if bitmap.height > @biggest_text_height
bitmap.dispose
when "\x12"
@text.sub!(/\{(.*?)\}/, "")
a = $1.to_s.split(',')
$nms.face_name = a[0]
$nms.face_index = a[1].to_i
$nms.side = a[2].to_i unless a[2].nil?
nms_draw_new_face
@ori_x = @face.x
when "\x01"
@text.sub!(/\{(.*?)\}/, "")
color_code = $1.to_s
if color_code.include?('#')
color_code.sub!(/([0123456789ABCDEF]+)/, "")
contents.font.color = get_hex($1)
else
$nms.last_color = color_code.to_i
contents.font.color = text_color($nms.last_color)
end
next
when "\x02"
@gold_window.refresh
@gold_window.open
when "\x03"
@wait_count = 15
break
when "\x04"
@wait_count = 60
break
when "\x05"
self.pause = true
break
when "\x06"
@line_show_fast = true
when "\x07"
@line_show_fast = false
when "\x08"
@pause_skip = true
else
contents.font.name = $nms.nms_fontname if contents.font.name != $nms.nms_fontname
contents.font.size = $nms.nms_fontsize if contents.font.size != $nms.nms_fontsize
c_width = contents.text_size(c).width
# Check for Text Cut & Scroll Horizontal
if (@contents_x + c_width > contents.width)
if $nms.txt_cut; new_line
elsif $nms.txt_scrl_hori
nms_scroll_hori(c_width)
@wait_count = $nms.txt_scrl_hori_delay
@text = c + @text
return
end
end
nms_line_height = contents.text_size(c).height
contents.draw_text(@contents_x, @contents_y, 40, nms_line_height, c)
@contents_x += c_width
# Change Biggest Text Height
@biggest_text_height = nms_line_height if nms_line_height > @biggest_text_height
# Play Typing Sound
if $nms.typ_se and @typse_count <= 0
RPG::SE.new($nms.typ_file, $nms.typ_vol).play
@typse_count += $nms.typ_skip
end
#Show Fast & Text Delay
@show_fast = true if $nms.lbl == false
@delay_text += $nms.text_delay
end
break unless @show_fast or @line_show_fast
end
end
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
def finish_message
if $game_message.choice_max > 0
start_choice
elsif $game_message.num_input_variable_id > 0
start_number_input
elsif @pause_skip
terminate_message
else
self.pause = true
end
@wait_count = 10
@text = nil
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def start_choice
self.active = true
self.index = 0
end
#--------------------------------------------------------------------------
# ? EDITED
#--------------------------------------------------------------------------
def start_number_input
digits_max = $game_message.num_input_digits_max
number = $game_variables[$game_message.num_input_variable_id]
@number_input_window.digits_max = digits_max
@number_input_window.number = number
if $game_message.face_name.empty? or MOVE_TEXT == false
@number_input_window.x = x - 23
else
case $game_message.side
when 0
@number_input_window.x = (x + 112) - 23
when 1
@number_input_window.x = (x + text_x) - 23
when 2
@number_input_window.x = x - 23
when -1
@number_input_window.x = x - 23
end
end
@number_input_window.x += CHOICE_INPUT_X_PLUS
@number_input_window.y = y + @contents_y
@number_input_window.active = true
@number_input_window.visible = true
@number_input_window.update
end
#--------------------------------------------------------------------------
# ? EDITED
#--------------------------------------------------------------------------
def update_cursor
if @index >= 0
if $game_message.face_name.empty?
x = TEXT_X_PLUS
else
x = get_x_face
end
y = ($game_message.choice_start + @index) * WLH
# CHANGE WIDTH OF CURSOR FOR CHOICE SELECT
if $game_message.face_name.empty? or MOVE_TEXT == false
facesize = x
else
facesize = get_x_face
facesize += @face.width if $game_message.side == 2
facesize += @face.width + 16 if $game_message.side == -1
end
self.cursor_rect.set(x, y, contents.width - facesize, WLH)
else
self.cursor_rect.empty
end
end
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def input_pause
if Input.trigger?(Input::B) or Input.trigger?(Input::C)
self.pause = false
if @text != nil and not @text.empty?
new_page if @line_count >= $game_message.max_line
else
terminate_message
end
end
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
def input_choice
if Input.trigger?(Input::B)
if $game_message.choice_cancel_type > 0
Sound.play_cancel
$game_message.choice_proc.call($game_message.choice_cancel_type - 1)
terminate_message
end
elsif Input.trigger?(Input::C)
Sound.play_decision
$game_message.choice_proc.call(self.index)
terminate_message
end
end
#--------------------------------------------------------------------------
# ? ???????
#--------------------------------------------------------------------------
def input_number
if Input.trigger?(Input::C)
Sound.play_decision
$game_variables[$game_message.num_input_variable_id] =
@number_input_window.number
$game_map.need_refresh = true
terminate_message
end
end
end
#==============================================================================
# NMS +[ADD ON]+ WINDOW_MESSAGE_CLASS
#------------------------------------------------------------------------------
#==============================================================================
class Window_Message < Window_Selectable
# Return X for Text
def get_x_face
if MOVE_TEXT == true
case $game_message.side
when 0
return 112 + TEXT_X_PLUS
when 1
return text_x
when 2
return TEXT_X_PLUS
else
return TEXT_X_PLUS
end
else
return TEXT_X_PLUS
end
end
def text_x
return @face.width + TEXT_X_PLUS
end
# Clear Name Box & Name Text
def clear_namebox
@nametxt.bitmap.dispose
@namebox.dispose
@namebox = nil
@name_text = nil
end
def nms_get_map_name
mapdata = load_data("Data/MapInfos.rvdata")
map_id = $game_map.map_id
return mapdata[map_id].name
end
#--------------------------------------
# DRAW FACE [Both Systems] METHOD
#------------------------------------
def draw_face2(face_name, x, y, index = 0, animf = false, animf_index = 0, animf_max = 1, nofade = false)
if animf
# Use Animated Face
bitmap = Cache.face(face_name)
rect = Rect.new(0,0,0,0)
rect.width = (bitmap.width / animf_max)
rect.height = bitmap.height
rect.x = animf_index * rect.width
rect.y = 0
@face.bitmap = Bitmap.new(rect.width,rect.height)
@face.bitmap.blt(0,0,bitmap,rect)
bitmap.dispose
elsif $game_message.side == 0 or $game_message.side == -1 or EightFaces_File
# USE 8 FACES PER FILE
bitmap = Cache.face(face_name)
rect = Rect.new(0,0,0,0)
rect.width = (bitmap.width / 4)
rect.height = (bitmap.height / 2)
rect.x = index % 4 * rect.width
rect.y = index / 4 * rect.height
@face.bitmap = Bitmap.new(rect.width,rect.height)
@face.bitmap.blt(0,0,bitmap,rect)
bitmap.dispose
else
# USE 1 FACES PER FILE
@face.bitmap = Cache.face(face_name)
end
# SET X/Y OF FACE DEPENDS ON FACE SIDE
if $game_message.side == 1
@face.mirror = false
@face.x = x + 6
@face.y = y - 6 + height - @face.height
elsif $game_message.side == 2
@face.mirror = true
@face.x = x + ((self.width - 6) - @face.width)
@face.y = y - 6 + height - @face.height
elsif $game_message.side == 0
@face.mirror = false
@face.x = x + 16
@face.y = y - 16 + height - @face.height
elsif $game_message.side == -1
@face.mirror = true
@face.x = x + self.contents.width - @face.width + 16
@face.y = y - 16 + height - @face.height
end
@face.x += FACE_X_PLUS
@face.y += FACE_Y_PLUS
@face_data = [face_name, index, $game_message.side]
if @face_data != @face_data_old and FADE_MOVE_WHEN_USE_NEW_FACE; @showtime = 1; @face_data_old = @face_data; end
@face.opacity = 0 if !nofade and ($nms.face_fade == true and ((FADE_ONLY_FIRST and @showtime <= 1) or (FADE_ONLY_FIRST == false)))
end
#--------------------------------------
# DRAW NAME BOX METHOD
#-----------------------------------
def draw_name(name,x,y)
name = name + NAMEBOX_TEXT_AFTER_NAME
a = Bitmap.new(33,33)
a.font.name = NAMEBOX_TEXT_FONT
a.font.size = NAMEBOX_TEXT_SIZE
rect = a.text_size(name)
a.dispose
@nametxt.bitmap = Bitmap.new(16 + rect.width, rect.height + NAMEBOX_TEXT_HEIGHT_PLUS)
@nametxt.x = x + 8
if $game_message.side == 1 or $game_message.side == 2
@nametxt.x += NAMEBOX_X_PLUS_NEO
else
@nametxt.x += NAMEBOX_X_PLUS_NOR
end
@nametxt.y = y - 20 + ($game_message.position == 0 ? NAMEBOX_Y_PLUS_TOP : NAMEBOX_Y_PLUS)
namebox_x_plus = ($game_message.side == 1 or $game_message.side == 2) ? NAMEBOX_X_PLUS_NEO : NAMEBOX_X_PLUS_NOR
@nametxt.x = ((self.x + $nms.msg_w) - namebox_x_plus - @nametxt.width) if MOVE_NAMEBOX and ($game_message.side == 2 or $game_message.side == -1)
@namebox = Window.new
@namebox.windowskin = Cache.system(NAMEBOX_SKIN)
@namebox.z = self.z + 10
@namebox.opacity = case @background
when 0; NAMEBOX_OPACITY
when 1; NAMEBOX_OPACITY_DIM_BG
when 2; NAMEBOX_OPACITY_NO_BG
end
@namebox.back_opacity = NAMEBOX_BACK_OPACITY
@namebox.openness = 255
@namebox.x = @nametxt.x - NAMEBOX_BOX_WIDTH_PLUS
@namebox.y = @nametxt.y - NAMEBOX_BOX_HEIGHT_PLUS
@namebox.width = @nametxt.bitmap.width + (NAMEBOX_BOX_WIDTH_PLUS * 2)
@namebox.height = @nametxt.bitmap.height + (NAMEBOX_BOX_HEIGHT_PLUS * 2)
# Fixed position bug
@namebox.x = 0 if @namebox.x < 0
@namebox.x = (Graphics.width - @namebox.width) if (@namebox.x + @namebox.width) > Graphics.width
@nametxt.bitmap.font.name = NAMEBOX_TEXT_FONT
@nametxt.bitmap.font.size = NAMEBOX_TEXT_SIZE
@nametxt.bitmap.font.bold = NAMEBOX_TEXT_BOLD
if NAMEBOX_TEXT_OUTLINE == true
# MAKE TEXT OUTLINE
old_shadow = @nametxt.bitmap.font.shadow
@nametxt.bitmap.font.color = Color.new(0,0,0)
@nametxt.bitmap.draw_text(0,2,@nametxt.bitmap.width,@nametxt.bitmap.height,name,1)
@nametxt.bitmap.draw_text(0,0,@nametxt.bitmap.width,@nametxt.bitmap.height,name,1)
@nametxt.bitmap.draw_text(2,0,@nametxt.bitmap.width,@nametxt.bitmap.height,name,1)
@nametxt.bitmap.draw_text(2,2,@nametxt.bitmap.width,@nametxt.bitmap.height,name,1)
@nametxt.bitmap.font.shadow = old_shadow
end
@nametxt.bitmap.font.color = Color.new($game_message.color[0],$game_message.color[1],$game_message.color[2])
@nametxt.bitmap.draw_text(1,1,@nametxt.bitmap.width,@nametxt.bitmap.height,name,1)
@name_text = nil
end
#--------------------------------------
# DRAW NEW FACE
#-----------------------------------
def nms_draw_new_face
# Setup Face Name / Index
name = $game_message.face_name
index = $game_message.face_index
animf_test = name.sub(/\[([0-9]+)\]/, "")
# Animated?
@animf = $1.to_i > 0 ? true : false
@animf_maxind = $1.to_i
@animf_ind = 0
@animf_dl = $nms.animf_delay
# CALL DRAW FACE METHOD
draw_face2(name, self.x, self.y, index, @animf, @animf_ind, @animf_maxind)
end
#--------------------------------------
# UPDATE ANIMATION FACE
#-----------------------------------
def update_animate_face
if (!self.pause or $nms.animf_cont)
@animf_dl -= 1
if @animf_dl <= 0
@animf_ind = (@animf_ind + 1) % @animf_maxind
@animf_dl = $nms.animf_delay
draw_face2($game_message.face_name, self.x, self.y, index, @animf, @animf_ind, @animf_maxind, true)
end
elsif @animf_ind != 0
@animf_ind = 0
draw_face2($game_message.face_name, self.x, self.y, index, @animf, @animf_ind, @animf_maxind, true)
end
end
#--------------------------------------
# SCROLL TEXT HORIZONTAL
#-----------------------------------
def nms_scroll_hori(scr_width)
biggest = @biggest_text_height > WLH ? @biggest_text_height : WLH
rect = Rect.new(0, @contents_y, contents.width, biggest)
bitmap = Bitmap.new(rect.width, rect.height)
bitmap.blt(0, 0, contents, rect)
contents.clear_rect(rect)
rect = Rect.new(0, 0, rect.width, rect.height)
contents.blt(0 - scr_width, @contents_y, bitmap, rect)
contents.clear_rect(0, 0, @face.width, @face.height) if @face.bitmap != nil
bitmap.dispose
@contents_x = @contents_x - scr_width
end
#--------------------------------------
# GET HEX COLOR by RPG & ERZENGEL
#------------------------------------
def get_hex(n)
red = 0
green = 0
blue = 0
if n.size != 6
print("Hex triplets must be six characters long!\nNormal color will be used.")
return normal_color
end
for i in 1..6
sliced = n.slice!(/./m)
value = hexconvert(sliced)
case i
when 1; red += value * 16
when 2; red += value
when 3; green += value * 16
when 4; green += value
when 5; blue += value * 16
when 6; blue += value
end
end
return Color.new(red, green, blue)
end
def hexconvert(n)
case n
when "0"; return 0
when "1"; return 1
when "2"; return 2
when "3"; return 3
when "4"; return 4
when "5"; return 5
when "6"; return 6
when "7"; return 7
when "8"; return 8
when "9"; return 9
when "A"; return 10
when "B"; return 11
when "C"; return 12
when "D"; return 13
when "E"; return 14
when "F";return 15
else; return -1
end
end
end # CLASS END
#==============================================================================
# NMS +[ADD ON]+ OTHER CLASS
#------------------------------------------------------------------------------
#==============================================================================
# STORE variables here~*
class Game_Message
attr_accessor :nms_fontname, :nms_fontsize, :event_id, :side, :color, :_name,
:last_color, :text_delay, :lbl, :msg_w, :msg_h, :msg_x, :max_line, :nms_face_name,
:nms_face_index, :next_msg, :typ_se, :typ_file, :typ_skip, :typ_vol, :mback, :mback_opac,
:qt, :txt_scrl, :msg_h_user, :animf_delay, :animf_cont, :txt_cut, :txt_unl, :txt_scrl_hori,
:txt_scrl_hori_delay, :face_fade, :face_move, :msg_temp_y, :msg_temp_x, :msg_temp_h,
:msg_temp_w
alias wor_nms_old_ini initialize
def initialize
create_nms_data
wor_nms_old_ini
end
def create_nms_data
# NFS
@side = Window_Base::DEFAULT_FACE_SIDE
@_name = ""
@color = Window_Base::NAMEBOX_TEXT_DEFAULT_COLOR
# NMS
@last_color = 0
@nms_fontname = Window_Base::NMS_FONT_NAME
@nms_fontsize = Window_Base::NMS_FONT_SIZE
@event_id = 0
@text_delay = Window_Base::NMS_DELAY_PER_LETTER
@lbl = true
@msg_w = Window_Base::NMS_MSGWIN_WIDTH
@msg_h = @msg_h_user = Window_Base::NMS_MSGWIN_MIN_HEIGHT
@msg_x = Window_Base::NMS_MSGWIN_X
@max_line = Window_Base::NMS_MAX_LINE
@nms_face_name = ""
@nms_face_index = 1
@next_msg = false
@typ_se = Window_Base::TYPING_SOUND
@typ_file = Window_Base::TYPING_SOUND_FILE
@typ_skip = Window_Base::TYPING_SOUND_SKIP
@typ_vol = Window_Base::TYPING_SOUND_VOLUME
@mback = Window_Base::NMS_MSG_BACK
@mback_opac = Window_Base::NMS_MSG_BACK_OPACITY
@qt = Array.new
@txt_scrl = Window_Base::NMS_TEXT_SCROLL
@animf_delay = Window_Base::ANIMATE_FACE_DELAY
@animf_cont = Window_Base::ANIMATE_FACE_CONTINUE
@txt_cut = Window_Base::NMS_TEXT_AUTO_CUT
@txt_scrl_hori = Window_Base::NMS_TEXT_AUTO_SCROLL_HORIZONTAL
@txt_scrl_hori_delay = Window_Base::NMS_TEXT_AUTO_SCROLL_HORIZONTAL_DELAY
@txt_unl = Window_Base::NMS_USER_NEW_LINE
@face_fade = Window_Base::FADE_EFFECT
@face_move = Window_Base::MOVE_EFFECT
@msg_temp_x = nil
@msg_temp_y = nil
@msg_temp_h = nil
@msg_temp_w = nil
end
end
class Game_Map
attr_accessor :interpreter
end
class Game_Interpreter
attr_accessor :params
end
class Game_Interpreter
def command_101
unless $game_message.busy
$game_message.event_id = @event_id
$game_message.face_name = @params[0]
$game_message.face_index = @params[1]
$game_message.background = @params[2]
$game_message.position = @params[3]
next_msg = true
loop do
if @list[@index].code == 101 and $game_message.max_line > $game_message.texts.size and next_msg
@index += 1
else
break
end
next_msg = false
while @list[@index].code == 401 and $game_message.max_line > $game_message.texts.size
next_msg = $game_message.next_msg
$game_message.texts.push(@list[@index].parameters[0])
@index += 1
end
end
if @list[@index].code == 102
setup_choices(@list[@index].parameters)
elsif @list[@index].code == 103
setup_num_input(@list[@index].parameters)
end
set_message_waiting
end
return false
end
def setup_choices(params)
if $game_message.texts.size <= $game_message.max_line - params[0].size
$game_message.choice_start = $game_message.texts.size
$game_message.choice_max = params[0].size
for s in params[0]
$game_message.texts.push(s)
end
$game_message.choice_cancel_type = params[1]
$game_message.choice_proc = Proc.new { |n| @branch[@indent] = n }
@index += 1
end
end
end
Espero que gostem.
FLw
Tópicos semelhantes
» [RMVX]MTB Battle System Plus+ 1.0 v2!
» [SCRIPT]LK-Light System 1.0
» [Fábrica]MTB System Factory II
» [RMVX]MTB Mercenary System
» [VX] MTB Battle System Plus+ 1.0 v3 (v3 Finalmente lançada)
» [SCRIPT]LK-Light System 1.0
» [Fábrica]MTB System Factory II
» [RMVX]MTB Mercenary System
» [VX] MTB Battle System Plus+ 1.0 v3 (v3 Finalmente lançada)
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos