Boas pessoal!
Faz um bom tempo que não faço nada aqui no fórum e acho que talvez continue assim, mas a poucos dias atrás eu não tinha nada pra fazer então resolvi modificar o chat do net play master de um jeito que deixou o chat mais bonito porém eles ocupa mais espaço no jogo mas em compensação da pra ver perfeitamente através dele.
SE FOR USAR APAGUE TODAS AS CONTAS CRIADAS NO SEU JOGO E CRIE UMA NOVA. CASO VOCÊ NÃO SIGA ESTAS INSTRUÇÕES O SEU JOGO PODE FICAR COM LAG(MUITO LAG).
Vai ai uma imagem!
Scripts
Substitua o seu [SC1] New Chat por este:
Agora adicione esses scripts abaixo do [WNG] Text_Box
E por ultimo adicione esse script em baixo do user_edits
Quase esqueci de falar. Tirei o chat da party
Pronto! Se for usar não esqueça dos credits ao autor *Eu*
Faz um bom tempo que não faço nada aqui no fórum e acho que talvez continue assim, mas a poucos dias atrás eu não tinha nada pra fazer então resolvi modificar o chat do net play master de um jeito que deixou o chat mais bonito porém eles ocupa mais espaço no jogo mas em compensação da pra ver perfeitamente através dele.
SE FOR USAR APAGUE TODAS AS CONTAS CRIADAS NO SEU JOGO E CRIE UMA NOVA. CASO VOCÊ NÃO SIGA ESTAS INSTRUÇÕES O SEU JOGO PODE FICAR COM LAG(MUITO LAG).
Vai ai uma imagem!
- Spoiler:
Scripts
Substitua o seu [SC1] New Chat por este:
- Código:
#==============================================================================
# ** Chat
#------------------------------------------------------------------------------
# By Valentine
#==============================================================================
class Scene_Map
alias chat_map_main_draw main_draw
alias chat_map_update update
#--------------------------------------------------------------------------
# * Main
#--------------------------------------------------------------------------
def main_draw
@chat = Window_Chat.new(7, 305, 292, 130)
$chat = @chat
@chat_text = Window_Normal.new(-14,303,326,200)
$chat_textinho = @chat_text
@chat_text.opacity = 1
@chat_text.z = 9999
$chat_id = 1
@box = Light_Box.new(@chat_text,18,135,286,30)
@box.active = true
@chat_privado = Window_Dummys.new(170,391,120,100)
@private_input = Light_Box.new(@chat_privado,25,20,70,10)
@chat_privado.visible = false
@chat_privado.active = false
@chat_privado.z = 99999
@chat_privado.opacity = 1
$game_temp.chat_log.push("Boas-vindas ao Fallen Empire!")
if $chat_ativo_agr == true
@box.active = true
@chat.visible = true
@chat.active = true
@chat_text.visible = true
@chat_text.active = true
else
@chat.visible = false
@chat.active = false
@chat_text.visible = false
@chat_text.active = false
@chat_privado.visible = false
@chat_privado.active = false
@box.active = false
end
@map_chat = Light_Button.new(@chat_text,18,155,LANGUAGE::CHATMAP,0,0, 1) {@chat_privado.visible = false; @chat_privado.active = false; $chat_id = 1; @box.active = true}
@global_chat = Light_Button.new(@chat_text,61,155,LANGUAGE::CHATGLOBAL,0,0, 2) {@chat_privado.visible = false; @chat_privado.active = false; $chat_id = 2; @box.active = true}
@guild_chat = Light_Button.new(@chat_text,112,155,LANGUAGE::CHATGUILD,0,0, 4) {@chat_privado.visible = false; @chat_privado.active = false; $chat_id = 4; @box.active = true}
@private_chat = Light_Button.new(@chat_text,152,155,LANGUAGE::CHATPRIVATE,0,0, 5) {@chat_privado.visible = true; @chat_privado.active = true; $chat_id = 5; @box.active = true}
@chat_button = Light_Button.new(@chat_text,260,155,LANGUAGE::CHAT_SEND){enviando_msg; @box.active = true}
chat_map_main_draw
end
def dispose
@chat.dispose
@chat_text.dispose
@chat_privado.dispose
end
def enviando_msg
return if @box.text == ""
name = $game_party.actors[0].name
level = $game_party.actors[0].level
textss = @box.text
id = Network::Main.id
if @box.text == "/online"
@pl = Network::Main.players.size
$game_temp.chat_log.push(LANGUAGE::PLAYERSON+" #{@pl}")
@box.text = ""
return
end
if $chat_id == 3 and !$party.empty? #Party
for i in 0..$party.members.size
if $party.members[i] != nil
if $parte_s == true
Network::Main.mchat($charzinho_id,"[PT] #{name}: #{textss}")
$game_temp.chat_log.push("[PT] #{name}: #{textss}")
else
Network::Main.mchat($party.members[i].netid,"[PT] #{name}: #{textss}")
$game_temp.chat_log.push("[PT] #{name}: #{textss}")
end
end
end
end
if $chat_id == 3 and $party.empty? #Party
$game_temp.chat_log.push(LANGUAGE::NOTPARTY)
end
if $chat_id == 4 and $game_party.actors[0].guild == "" #Guild
$game_temp.chat_log.push(LANGUAGE::NOTGUILD)
@box.text = ""
return
end
if $chat_id == 5 #Private
for p in Network::Main.players.values
if @private_input.text == ""
$game_temp.chat_log.push(LANGUAGE::NOTPLAYERNAME)
@box.text = ""
return
end
if p.nome == @private_input.text.to_s
name = $game_party.actors[0].name
textss = @box.text
Network::Main.pchat(p.netid,"/p #{$game_party.actors[0].name}: #{textss}")
$game_temp.chat_log.push("/p #{$game_party.actors[0].name}: #{textss}")
@box.text = ""
return
end
end
$game_temp.chat_log.push(LANGUAGE::NOTPLAYEREXIST)
@box.text = ""
return
end
if $chat_id == 4 #Guild
for p in Network::Main.players.values
if p.guild == $game_party.actors[0].guild
name = $game_party.actors[0].name
textss = @box.text
Network::Main.pchat(p.netid,"/gd #{$game_party.actors[0].name}: #{textss}")
end
end
$game_temp.chat_log.push("/gd #{$game_party.actors[0].name}: #{textss}")
@box.text = ""
return
end
if $chat_id == 1 #Map
for mp in Network::Main.mapplayers.values
next if mp == nil
next if mp.map_id != $game_map.map_id
name = $game_party.actors[0].name
textss = @box.text
Network::Main.mchat(mp.netid,"#{name}: #{textss}")
$chat_text = textss
Network::Main.send_start
$chat_msg = true
end
name = $game_party.actors[0].name
textss = @box.text
$game_temp.chat_log.push("#{name}: #{textss}")
actor = $game_party.actors[0]
actor.damage = "#{textss}"
$chat_msg = true
end
if $chat_id == 2 #Global
Network::Main.socket.send("<chat>/g #{name}: #{textss}</chat>\n")
end
@box.text = ""
return
end
def update
if $guild_position == LANGUAGE::GUILDLEADER
$guild_created_input.active if !$guild_created_input2.active if !@box.active
$guild_created_input2.active if !$guild_created_input.active if !@box.active
end
@private_input.active if !@box.active
@chat.refresh if $chat_size != $game_temp.chat_log.size and @chat.visible
if @box.active == true or @chat_text.in_area?
@chat_text.update if @chat_text.visible
end
chat_map_update
@chat_privado.update if @chat_privado.visible
if Input.pressed(Input::Mouse_Left) and @private_input.in_area?
@private_input.active = true
@box.active = false
@box.refresh
end
if Input.pressed(Input::Mouse_Left) and $guild_created_input.in_area?
$guild_created_input.active = true
@box.active = false
@box.refresh
end
if Input.pressed(Input::Mouse_Left) and $guild_input.in_area?
$guild_input.active = true
@box.active = false
@box.refresh
end
if Input.pressed(Input::Mouse_Left) and $currency_box.in_area?
$currency_box.active = true
@box.active = false
@box.refresh
end
if @chat.visible
if Input.trigger?(Input::Tab)
$chat_id = $chat_id + 1
$chat_id = 1 if $chat_id >= 6
if $chat_id == 5
@chat_privado.visible = true
@chat_privado.active = true
else
@chat_privado.visible = false
@chat_privado.active = false
end
@chat_text.update if @chat_text.visible
@chat.refresh
end
end
if Input.pressed(Input::Mouse_Left) and @box.in_area?
$guild_created_input.active = false
@box.active = true
@private_input.refresh
$guild_created_input.refresh
@private_input.active = false
$currency_box.active = false
end
if not @box.active and not $painel_input.active and not $currency_box.active and not $guild_input.active and not $guild_created_input.active and not @private_input.active
if Input.triggerd?(Input::Letters["I"])
$equip_w.refresh
$item_w.refresh
$janela_gold_w.refresh
$equip_w.visible = !$equip_w.visible
$equip_w.active = !$equip_w.active
$item_w.visible = !$item_w.visible
$item_w.active = !$item_w.active
$janela_gold_w.visible = !$janela_gold_w.visible
elsif Input.triggerd?(Input::Letters["H"])
$skill.refresh
$skill.visible = !$skill.visible
$skill.active = !$skill.active
elsif Input.triggerd?(Input::Letters["S"])
$status.refresh
$status.visible = !$status.visible
$status.active = !$status.active
elsif Input.triggerd?(Input::Letters["G"])
$member_list.refresh
$guild_created.refresh
$member_list.visible = false
$member_list.active = false
$guild_created.visible = !$guild_created.visible
$guild_created.active = !$guild_created.active
$flag2.visible = !$flag2.visible
elsif Input.triggerd?(Input::Letters["Q"])
$quest_list.refresh
$quest_w.refresh
$quest_list.visible = !$quest_list.visible
$quest_list.active = !$quest_list.active
$quest_w.visible = false
$quest_w.active = false
end
end
if Input.triggerd?(Input::Fkeys[5]) and @chat.visible == true
@chat.visible = false
@chat.active = false
@chat_text.visible = false
@chat_text.active = false
@chat_privado.visible = false
@chat_privado.active = false
@box.active = false
$chat_ativo_agr = false
elsif Input.triggerd?(Input::Fkeys[5]) and @chat.visible == false
@box.active = true
@chat.visible = true
@chat.active = true
@chat_text.visible = true
@chat_text.active = true
$chat_ativo_agr = true
end
if @box.active
if Input.triggerd?(13)
enviando_msg
end
end
end
end
Agora adicione esses scripts abaixo do [WNG] Text_Box
- Código:
#==============================================================================
# ** Text boxes - This class is used to create Text boxes.
#------------------------------------------------------------------------------
# Author Trebor777
# Modified Valentine
# Version 2.0
#==============================================================================
class Light_Box < Widget
attr_accessor( :hide, :active, :extended)
def initialize(win,x,y,width,max,lines=1,nospace=false,password=false)
super(win,x,y)
@max = max
@width = width
@height = lines*(18)
@lines = lines
@nospace = nospace
@password = password
s.bitmap = Bitmap.new(width,lines*(18))
s.bitmap.font.color = Color.new(0, 0, 0, 255)
s.bitmap.font.size = win.contents.font.size
@text = ""
@extended = true
@wait = 0
@hide = false
@blink = false
self.tool_tip=["Comprimento máximo de #{@max} caráters."]
refresh
end
#--------------------------------------------------------------------------
def text
return @text
end
#--------------------------------------------------------------------------
def text=(t)
@text=t.to_s
refresh
end
#--------------------------------------------------------------------------
def con(t)
if @password == true
return if text == nil
t = text
text = []
for i in 0..t.size-1
text.push("*")
end
return text.to_s
else
return "" if t == nil
return t if !@hide
return "*"*t.size
end
end
#--------------------------------------------------------------------------
def refresh
s.bitmap.fill_rect(1, 0, @s.bitmap.width-2, s.bitmap.height, Config::LIGHT__BORDA)
s.bitmap.fill_rect(0, 1, @s.bitmap.width, s.bitmap.height-2, Config::LIGHT__COR1)
s.bitmap.fill_rect(1, 1, @s.bitmap.width-2, s.bitmap.height-12, Config::LIGHT__COR2)
s.bitmap.fill_rect(1, 6, @s.bitmap.width-2, s.bitmap.height-12, Config::LIGHT__COR3)
s.bitmap.fill_rect(1, 11, @s.bitmap.width-2, s.bitmap.height-12, Config::LIGHT__COR4)
if s.bitmap.height>win.contents.height-5
win.oy=text.count("-N-")*win.contents.font.size-1
end
if @lines>1 and text.count("-N-")>0
i=0
for line in text.split("-N-")
@tw = s.bitmap.text_size(con(line)).width
s.bitmap.draw_text(5, i*win.contents.font.size, @width, 18, con(line))
i+=1
end
else
@tw = s.bitmap.text_size(con(text)).width
s.bitmap.draw_text(5, 0, @width, 18, con(text))
end
@tw = 0 if text[-1,1] == "-N-"
s.bitmap.font.color = Color.new(40,40,40)
s.bitmap.draw_text(@tw+4, text.count("-N-")*win.contents.font.size-1, @width, 18, '|') if self.active and not @blink
s.bitmap.draw_text(@tw+4, text.count("-N-")*win.contents.font.size-1, @width, 18, ' ') if !self.active or (self.active and @blink)
end
#--------------------------------------------------------------------------
def outclick
refresh
end
#--------------------------------------------------------------------------
def update
super
s.visible = win.visible
if self.active and not @blink
@wait += 1
@blink = true if @wait >= 20
@wait = 0 if @wait >= 20
elsif not @blink
@blink = false
@wait = 0
end
if self.active and @blink
@wait += 1
@blink = false if @wait >= 20
@wait = 0 if @wait >= 20
elsif @blink
@blink = false
@wait = 0
end
if self.active
entry = @text
if Input.triggerd?(Input::Back) and entry.size != 0
entry.chop!
@text = entry
refresh
return
end
if entry.size-entry.count("-N-") == @max
return
end
k=""
Input::Carac.keys.each do |key|
if Input.triggerd?(Input::Numberkeys[key]) or Input.triggerd?(Input::Carac[key])
k = key.to_s.downcase
if Input.pressed?(Input::CapsLock)
k = key.to_s.upcase
end
if Input.pressed?(Input::Shift)
k = key.to_s.upcase
k = Input::Equ[key].to_s if key.kind_of? Numeric and @extended
end
entry+="-N-" if entry.split("-N-").last != nil and @s.bitmap.text_size(entry.split("-N-").last+k).width>=@s.bitmap.width-5
entry+=k
end
end
if @extended
k=""
if Input.triggerd?(Input::Comma)
k=","
k="<" if Input.pressed?(Input::Shift)
elsif Input.triggerd?(Input::Space)
k=" " if @nospace == false
elsif Input.triggerd?(Input::Dot)
k="."
k=">" if Input.pressed?(Input::Shift)
elsif Input.triggerd?(Input::Collon)
k=";"
k=":" if Input.pressed?(Input::Shift)
elsif Input.triggerd?(Input::Equal)
k="="
k="+" if Input.pressed?(Input::Shift)
elsif Input.triggerd?(Input::Backslash)
k="/"
k="?" if Input.pressed?(Input::Shift)
elsif Input.triggerd?(Input::Quote)
k="'"
k="''" if Input.pressed?(Input::Shift)
elsif Input.triggerd?(Input::Underscore)
k="-"
k="_" if Input.pressed?(Input::Shift)
elsif Input.triggerd?(Input::Lb)
k="["
k="{" if Input.pressed?(Input::Shift)
elsif Input.triggerd?(Input::Rb)
k="]"
k= "}" if Input.pressed?(Input::Shift)
elsif Input.triggerd?(Input::DC)
k="\\"
k="|" if Input.pressed?(Input::Shift)
end
if k!=""
entry+="-N-" if entry.split("-N-").last != nil and @s.bitmap.text_size(entry.split("-N-").last+k).width>=@s.bitmap.width-5
entry+=k
end
end
entry+="-N-" if Input.triggerd?(13) and @lines>1 and entry.count("-N-")<@lines-1
if entry != @text
@text = entry
end
s.bitmap.font.size = win.contents.font.size
s.bitmap.font.color = win.text_color(2) if text.size-text.count("-N-") == @max
refresh
end
end
#--------------------------------------------------------------------------
def dispose
super
@text = nil
end
end
- Código:
#==============================================================================
# ** Button - This class is used to create buttons.
#------------------------------------------------------------------------------
# Author Trebor777
# Modified Valentine
# Version 2.0
#==============================================================================
class Light_Button < Widget
attr_accessor :mask
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(win,x,y,text,id=0,widgetid=0,chatid=0,&block)
super(win,x,y)
@text = text
@block = block
@chatid = chatid
@id = id
@widgetid = widgetid
refresh
end
#--------------------------------------------------------------------------
# Draw the button text, and create the mask.
#--------------------------------------------------------------------------
def refresh
b = Bitmap.new(4,4)
if not @id == 2
b.font.size = 16
if @id == 3
cx = 54
else
cx = b.text_size(@text).width
end
else
cx = 104
end
b.dispose
s.bitmap = Bitmap.new(cx+10, 18)
s.bitmap.font.color = Color.new(0,0,0,255)
s.bitmap.font.size = 16 if not @id == 2
@mask = Sprite.new(win.viewport)
@mask.x=s.x
@mask.y=s.y
if @chatid == $chat_id
@mask.visible=true
else
@mask.visible=false
end
@mask.z = 5000
@mask.bitmap=Bitmap.new(s.bitmap.width,s.bitmap.height)
@mask.bitmap.fill_rect(0, 0, @s.bitmap.width, @s.bitmap.height, Window_Edits::Button_ColorSkin_Start)
s.bitmap.clear
s.bitmap.fill_rect(1, 0, @s.bitmap.width-2, s.bitmap.height, Config::LIGHT_BORDA)
s.bitmap.fill_rect(0, 1, @s.bitmap.width, s.bitmap.height-2, Config::LIGHT_COR1)
s.bitmap.fill_rect(1, 1, @s.bitmap.width-2, s.bitmap.height-12, Config::LIGHT_COR2)
s.bitmap.fill_rect(1, 6, @s.bitmap.width-2, s.bitmap.height-12, Config::LIGHT_COR3)
s.bitmap.fill_rect(1, 11, @s.bitmap.width-2, s.bitmap.height-12, Config::LIGHT_COR4)
s.bitmap.font.color = Color.new(40,40,40)
s.bitmap.font.size = 13
s.bitmap.draw_text(0, 1, @s.bitmap.width, s.bitmap.height, @text, 1)
end
#--------------------------------------------------------------------------
# Dispose the mask, and itself
#--------------------------------------------------------------------------
def dispose
@mask.dispose
super
end
#--------------------------------------------------------------------------
# Frame update, check the mask status, and active status
#--------------------------------------------------------------------------
def update
@mask.visible= false if @mask.visible and !visible
if visible
@mask.x=s.x if @mask.x != s.x
@mask.y=s.y if @mask.y != s.y
@mask.update
if in_area? or @chatid == $chat_id
@mask.visible=true
else
@mask.visible=false
end
self.active=false if self.active
s.opacity = Window_Edits::Button_Active_Opacity if s.opacity<Window_Edits::Button_Active_Opacity
end
if win!=nil
x= s.x
y= s.y
s.visible = win.visible
end
if (Input.pressed(Input::Mouse_Left) and in_area? and s.visible and @widgetid == 1) or (Input.trigger(Input::Mouse_Left) and in_area? and s.visible and @widgetid != 1)
@active=true
win.active = true
clicked
return
elsif Input.trigger(Input::Mouse_Left) and !in_area? and s.visible
@active=false
outclick
return
end
#super
end
#--------------------------------------------------------------------------
# Change the button opacity when clicked
#--------------------------------------------------------------------------
def clicked
$game_system.se_play($data_system.decision_se)
s.opacity -= Window_Edits::Button_Not_Active_Opacity if s.opacity==Window_Edits::Button_Active_Opacity
if @block != nil
@block.call
else
self.active = true
end
end
#--------------------------------------------------------------------------
# Visible
#--------------------------------------------------------------------------
def visible=(v)
@mask.visible=v if @mask != nil
s.visible = v if s != nil
end
end
E por ultimo adicione esse script em baixo do user_edits
- Código:
#==============================================================================
# ** Módulo Config
#------------------------------------------------------------------------------
# Autor PedroMatoso
# Versão 0.1
# Data 03/04/13
#================================================================
module Config
#=========================Buttons===============================
#--------------------- Cor do Light Button ---------------------
LIGHT_BORDA = Color.new(28,28,28)
LIGHT_COR1 = Color.new(28,28,28)
LIGHT_COR2 = Color.new(255, 255, 255, 90)
LIGHT_COR3 = Color.new(255, 255, 255, 90)
LIGHT_COR4 = Color.new(255, 255, 255, 90)
#---------------------------------------------------------------
#--------------------- Cor da Light Box ------------------------
LIGHT__BORDA = Color.new(28,28,28)
LIGHT__COR1 = Color.new(28,28,28)
LIGHT__COR2 = Color.new(255, 255, 255, 1)
LIGHT__COR3 = Color.new(255, 255, 255, 1)
LIGHT__COR4 = Color.new(255, 255, 255, 1)
#---------------------------------------------------------------
#===============================================================
end
Quase esqueci de falar. Tirei o chat da party
Pronto! Se for usar não esqueça dos credits ao autor *Eu*