Aldeia RPG

Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Suporte ao desenvolvimento de jogos


2 participantes

    [PEDIDO] Opacidade no chat do NPCrystal

    Inato
    Inato
    Iniciante
    Iniciante


    Mensagens : 76
    Créditos : 7

    Ficha do personagem
    Nível: 1
    Experiência:
    [PEDIDO] Opacidade no chat do NPCrystal Left_bar_bleue0/0[PEDIDO] Opacidade no chat do NPCrystal Empty_bar_bleue  (0/0)
    Vida:
    [PEDIDO] Opacidade no chat do NPCrystal Left_bar_bleue30/30[PEDIDO] Opacidade no chat do NPCrystal Empty_bar_bleue  (30/30)

    [PEDIDO] Opacidade no chat do NPCrystal Empty [PEDIDO] Opacidade no chat do NPCrystal

    Mensagem por Inato Ter maio 08, 2018 3:19 pm

    Yo meu povo!

    Andei olhando o Netplay e o VXA-OS e reparei que o chat fica meio transparente quando não se está utilizando, e quando vai utilizar, a opacidade aumenta, mostrando mais nitidamente o chat, e achei isso muito legal, fazendo com que você tenha mais visibilidade de tela, pois as vezes o chat preenchi muita visão quando não se ta utilizando.

    Então, tem como fazer isso no NPCrystal?

    (Acho até melhor do que ficar minimizando sabe...)
    GallighanMaker
    GallighanMaker
    Colaborador
    Colaborador


    Medalhas : [PEDIDO] Opacidade no chat do NPCrystal ZgLkiRU
    Mensagens : 985
    Créditos : 102

    Ficha do personagem
    Nível: 1
    Experiência:
    [PEDIDO] Opacidade no chat do NPCrystal Left_bar_bleue0/0[PEDIDO] Opacidade no chat do NPCrystal Empty_bar_bleue  (0/0)
    Vida:
    [PEDIDO] Opacidade no chat do NPCrystal Left_bar_bleue30/30[PEDIDO] Opacidade no chat do NPCrystal Empty_bar_bleue  (30/30)

    [PEDIDO] Opacidade no chat do NPCrystal Empty Re: [PEDIDO] Opacidade no chat do NPCrystal

    Mensagem por GallighanMaker Sáb maio 12, 2018 12:57 pm

    A janela do chat deve ter valores de opacidade, cores etc, você pode diminuir essa opacidade por funções, por exemplo, assim que o player ativar o chat ou digitar nele você usa essa mesma função para aumenta-la.

    Isso é apenas conceito, faz muuuito tempo que abandonei o NP Crystal, tem muita coisa melhor por ai. (na época era fantastico mas tinha muitos problemas relacionados a servidor etc...).


    _________________
    [PEDIDO] Opacidade no chat do NPCrystal 8dVK0ku
    using C# and import Python developer || Expert in Unity Engine IDE. || [PEDIDO] Opacidade no chat do NPCrystal 769_heart 2D pixel games.
    Inato
    Inato
    Iniciante
    Iniciante


    Mensagens : 76
    Créditos : 7

    Ficha do personagem
    Nível: 1
    Experiência:
    [PEDIDO] Opacidade no chat do NPCrystal Left_bar_bleue0/0[PEDIDO] Opacidade no chat do NPCrystal Empty_bar_bleue  (0/0)
    Vida:
    [PEDIDO] Opacidade no chat do NPCrystal Left_bar_bleue30/30[PEDIDO] Opacidade no chat do NPCrystal Empty_bar_bleue  (30/30)

    [PEDIDO] Opacidade no chat do NPCrystal Empty Re: [PEDIDO] Opacidade no chat do NPCrystal

    Mensagem por Inato Dom maio 13, 2018 12:20 pm

    GallighanMaker escreveu:A janela do chat deve ter valores de opacidade, cores etc, você pode diminuir essa opacidade por funções, por exemplo, assim que o player ativar o chat ou digitar nele você usa essa mesma função para aumenta-la.

    Isso é apenas conceito, faz muuuito tempo que abandonei o NP Crystal, tem muita coisa melhor por ai. (na época era fantastico mas tinha muitos problemas relacionados a servidor etc...).

    Sim sim, é justamente isso que quero. Mas infelizmente não sei mexer/criar em scripts, só sei fazer umas pequenas edições  Razz (~sounoob)

    Pois falar em coisa melhor que o NPCrystal, o que você sugere de "melhor"? Fiquei curioso agora...  Question
    GallighanMaker
    GallighanMaker
    Colaborador
    Colaborador


    Medalhas : [PEDIDO] Opacidade no chat do NPCrystal ZgLkiRU
    Mensagens : 985
    Créditos : 102

    Ficha do personagem
    Nível: 1
    Experiência:
    [PEDIDO] Opacidade no chat do NPCrystal Left_bar_bleue0/0[PEDIDO] Opacidade no chat do NPCrystal Empty_bar_bleue  (0/0)
    Vida:
    [PEDIDO] Opacidade no chat do NPCrystal Left_bar_bleue30/30[PEDIDO] Opacidade no chat do NPCrystal Empty_bar_bleue  (30/30)

    [PEDIDO] Opacidade no chat do NPCrystal Empty Re: [PEDIDO] Opacidade no chat do NPCrystal

    Mensagem por GallighanMaker Dom maio 13, 2018 2:35 pm

    Os netplays atuais ou outras engines mesmo xD.

    Posta o script responsável pelo chat e pela janela do chat caso existir, talvez eu possa ajudar.


    _________________
    [PEDIDO] Opacidade no chat do NPCrystal 8dVK0ku
    using C# and import Python developer || Expert in Unity Engine IDE. || [PEDIDO] Opacidade no chat do NPCrystal 769_heart 2D pixel games.
    Inato
    Inato
    Iniciante
    Iniciante


    Mensagens : 76
    Créditos : 7

    Ficha do personagem
    Nível: 1
    Experiência:
    [PEDIDO] Opacidade no chat do NPCrystal Left_bar_bleue0/0[PEDIDO] Opacidade no chat do NPCrystal Empty_bar_bleue  (0/0)
    Vida:
    [PEDIDO] Opacidade no chat do NPCrystal Left_bar_bleue30/30[PEDIDO] Opacidade no chat do NPCrystal Empty_bar_bleue  (30/30)

    [PEDIDO] Opacidade no chat do NPCrystal Empty Re: [PEDIDO] Opacidade no chat do NPCrystal

    Mensagem por Inato Dom maio 13, 2018 7:25 pm

    GallighanMaker escreveu:Os netplays atuais ou outras engines mesmo xD.

    Posta o script responsável pelo chat e pela janela do chat caso existir, talvez eu possa ajudar.

    Tô esperando o VXA-OS ficar mais completo pra eu repassar meu projeto todo pra ele, mas enquanto isso, vou me desenrolando no Crystal heheh =)

    Bem o script de chat que tenho é esse:

    Código:
    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
    #|Autor: RD12|             Window Chat
    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
    class Window_Chat < Window_Base
      attr_accessor :Chat_txt
      attr_reader :temp
      attr_reader :chat_tipo
      def initialize
        super(-17, 320, 360, 200)
        self.contents = Bitmap.new(width - 32, height - 32)
        self.z = 995
        self.back_opacity = 0
        self.windowskin = RPG::Cache.windowskin("")
        @chat_img = RPG::Cache.picture("vazio") #chat_back << NOME DA IMG
        #Configurações da Fonte
        self.contents.font.size = 14
        self.contents.font.name = "Segoe UI"
        #Widgets
        @Chat_txt = Text_Box.new(self, 60, 140, 250, 40, 1.2)
        #Botões do Chat
        @types = [" Local ", "Global", "Grupo", "Guilda"]
        @Type = Button.new(self,14, 140, @types[0]) {type_click}
        @Type.opacity = 145
        @chat_tipo = 0
        @old_text = ""
        @temp = ""#
        @tempcount = 0
        @Chat_Enabled = User_Edit::Chat_Enabled.capitalize
        refresh
      end
      #Mudar tipo
      def type_click
        if @chat_tipo == 3
          @chat_tipo = 0
        else
          @chat_tipo += 1
        end
        @Type.text = @types[@chat_tipo]
        refresh    
        @Chat_txt.text = ""    
      end
      
      def input_update
        @tempcount += 1 if $chat.temp != ""
        if @tempcount >= 25 + $chat.temp.size*2
          @temp = ""
          send_tag
          @tempcount = 0
        end
        if @Chat_txt.text.size > 40
          limpar
          return
        end
        cmd = @Chat_txt.text.split
        @Chat_txt.text = @Chat_txt.text.capitalize
        #Envia mensagem ou ativa/desativa para escrever no Chat
       if Input.trigger?(Input::Enter)
        if @Chat_txt.text == @Chat_Enabled
          @Chat_txt.active = true
          @Chat_txt.text = ""
          @Chat_txt.refresh;@Chat_txt.update
        elsif @Chat_txt.text == ""
          @Chat_txt.active = false
          @Chat_txt.text = @Chat_Enabled
        elsif Network::Main.group == 'admin'
          case cmd[0] #Tags para Admins
           when "/online"
             texto("Jogadores online: #{Network::Main.players.size}")
             limpar
             return
           when "/item"
             Network::Main.socket.send("<10> p_item('#{cmd[1]}', '#{cmd[2]}', '#{cmd[3]}', #{cmd[4]}) </10> \n")
             texto("Você deu #{cmd[3]} #{$data_items[cmd[2].to_i].name} para #{cmd[1]}")
             limpar
             return
           when "/mover"
             Network::Main.socket.send("<10> move_player('#{cmd[1]}', #{cmd[2]}, #{cmd[3]}, #{cmd[4]}) </10> \n")
             limpar
             return
           when "/puxar"
             x,y = $game_player.x,$game_player.y
             map = $game_map.map_id
             Network::Main.socket.send("<10> puxar_player('#{cmd[1]}', #{map}, #{x}, #{y}) </10> \n")
             limpar
             return
           when "/kick"
             Network::Main.socket.send("<10> kick('#{cmd[1]}') </10> \n") if cmd[1]
             texto("Você expulsou #{cmd[1]} do jogo.")
             limpar
             return
           when "/msg"
             msg = @Chat_txt.text.gsub("/msg", "")
             Network::Main.socket.send("<10> msg_global('#{msg}') </10> \n") if cmd[1]
             limpar
             return
           end
           self.Enviar_Msg(type)
          else #Tags para jogadores normais
           if cmd[0] == "/online"
            texto("Jogadores online: #{Network::Main.players.size}")
            limpar
            return
           end      
           self.Enviar_Msg(type)
        end
       end
        if !@Chat_txt.active and @Chat_txt.text == ""
          @Chat_txt.text = @Chat_Enabled
        end
        if @Chat_txt.active and @Chat_txt.text == @Chat_Enabled
          @Chat_txt.text = ""
        end
      end

      def refresh
        self.contents.clear
        return unless $chat_log
        #▬▬Imagem e texto do Chat▬▬
        self.contents.blt(-8, 43, @chat_img, Rect.new(0, 0, @chat_img.width, @chat_img.height))
        ary = [0,5,4,3,2,1]
        for i in 1..5
          text = $chat_log[($chat_log.size-i-$scroll.abs)].to_s
          self.contents.font.color = User_Edit::Chat_Cores[text[0,1].to_i]
          self.contents.draw_text(-5, 15*ary[i]+24, self.width-32, 32, text, 0)
        end
      end

      def Enviar_Msg(type=nil)
        texto = @Chat_txt.text.capitalize
        return if texto == "" or texto[0, texto.size] == " "*texto.size
        #▬▬▬▬Chat Filter▬▬▬▬
        for c in 0...User_Edit::Chat_Filtro.size-1
         @p = User_Edit::Chat_Filtro[c]
         tdown = texto.downcase
         if tdown.include?(@p)
          texto = tdown.gsub(@p,'*'*@p.size)
         end
       end
       return (limpar; self.texto("Sem flood por favor!")) if @old_text == texto
       @old_text = texto
       #▬▬▬Verificar o tipo do chat e enviar [map,party,guild..]▬▬▬
       type =  @chat_tipo.to_s
       type = type.to_s  if type
       @Msg = type.to_s + " "+$game_party.actors[0].name+": "+texto
       @map = $game_map.map_id
       if type == "2" and $game_player.party.size > 0
         Network::Main.socket.send("<10> $chat.Mensagem('#{@Msg}',#{Network::Main.id},#{@chat_tipo}) </10> \n")
        @temp = texto
      elsif type == "2"
         texto("Você não está em um grupo")
       end
       if type == "0" or type == "1"
         Network::Main.socket.send("<10> $chat.Mensagem('#{@Msg}',#{@map},#{@chat_tipo}) </10> \n")
         send_tag
         @temp = texto
       end
       if type == "3" and $game_player.guild != ""
         Network::Main.socket.send("<10> $chat.Mensagem('#{@Msg}','#{$game_player.guild}',#{@chat_tipo}) </10> \n")
         @temp = texto
       elsif type == "3"
         texto("Você não está em uma guilda")
       end
       send_tag
       limpar
       @tempcount = 0
       $chat.refresh
      end
      
      #Limpar a text box de escrever
      def limpar
        @Chat_txt.text = ""
        @Chat_txt.refresh
      end

      #Receber a mensagem e colocar no chat
      def Mensagem(text, arg, tipo)#'arg' varia entre map_id, party ou name
        return unless $scene.is_a?(Scene_Map)
        $chat_log.push text if $game_map.map_id == arg and tipo == 0
        $chat_log.push text if tipo == 1
        if $game_player.party.include?(arg.to_s) or
          Network::Main.id == arg.to_s
          $chat_log << text
        end
        if $game_player.guild == arg
          $chat_log << text
        end
        $chat.refresh  
      end  
      #Adiciona texto no chat
      def texto(texto)
        return unless $scene.is_a?(Scene_Map)
        $chat_log << "4"+texto
        $chat.refresh  
      end  
      
      def send_tag
         Network::Main.socket.send("<5> @chat_text = '#{@temp}' </5> \n")
      end
    end
    GallighanMaker
    GallighanMaker
    Colaborador
    Colaborador


    Medalhas : [PEDIDO] Opacidade no chat do NPCrystal ZgLkiRU
    Mensagens : 985
    Créditos : 102

    Ficha do personagem
    Nível: 1
    Experiência:
    [PEDIDO] Opacidade no chat do NPCrystal Left_bar_bleue0/0[PEDIDO] Opacidade no chat do NPCrystal Empty_bar_bleue  (0/0)
    Vida:
    [PEDIDO] Opacidade no chat do NPCrystal Left_bar_bleue30/30[PEDIDO] Opacidade no chat do NPCrystal Empty_bar_bleue  (30/30)

    [PEDIDO] Opacidade no chat do NPCrystal Empty Re: [PEDIDO] Opacidade no chat do NPCrystal

    Mensagem por GallighanMaker Dom maio 13, 2018 11:00 pm

    Faça um backup desse script antes de colar o que disponibilizei abaixo, caso não der der certo ou der algum erro, apenas voltar o script anterior.

    Código:
    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
    #|Autor: RD12|            Window Chat
    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
    class Window_Chat < Window_Base
      attr_accessor :Chat_txt
      attr_reader :temp
      attr_reader :chat_tipo
      def initialize
        super(-17, 320, 360, 200)
        self.contents = Bitmap.new(width - 32, height - 32)
        self.z = 995
        self.back_opacity = 255
        self.windowskin = RPG::Cache.windowskin("")
        @chat_img = RPG::Cache.picture("vazio") #chat_back << NOME DA IMG
        #Configurações da Fonte
        self.contents.font.size = 14
        self.contents.font.name = "Segoe UI"
        #Widgets
        @Chat_txt = Text_Box.new(self, 60, 140, 250, 40, 1.2)
        #Botões do Chat
        @types = [" Local ", "Global", "Grupo", "Guilda"]
        @Type = Button.new(self,14, 140, @types[0]) {type_click}
        @Type.opacity = 255
        @chat_tipo = 0
        @old_text = ""
        @temp = ""#
        @tempcount = 0
        @Chat_Enabled = User_Edit::Chat_Enabled.capitalize
        refresh
      end
      #Mudar tipo
      def type_click
        if @chat_tipo == 3
          @chat_tipo = 0
        else
          @chat_tipo += 1
        end
        @Type.text = @types[@chat_tipo]
        refresh   
        @Chat_txt.text = ""   
      end
     
      def input_update
        @tempcount += 1 if $chat.temp != ""
        if @tempcount >= 25 + $chat.temp.size*2
          @temp = ""
          send_tag
          @tempcount = 0
        end
        if @Chat_txt.text.size > 40
          limpar
          return
        end
        cmd = @Chat_txt.text.split
        @Chat_txt.text = @Chat_txt.text.capitalize
        #Envia mensagem ou ativa/desativa para escrever no Chat
      if Input.trigger?(Input::Enter)
        if @Chat_txt.text == @Chat_Enabled
          @Chat_txt.active = true
          @Chat_txt.text = ""
          @Chat_txt.refresh;@Chat_txt.update
          @Type.opacity = 145
          self.back_opacity = 0
        elsif @Chat_txt.text == ""
          @Chat_txt.active = false
          @Chat_txt.text = @Chat_Enabled
        elsif Network::Main.group == 'admin'
          case cmd[0] #Tags para Admins
          when "/online"
            texto("Jogadores online: #{Network::Main.players.size}")
            limpar
            return
          when "/item"
            Network::Main.socket.send("<10> p_item('#{cmd[1]}', '#{cmd[2]}', '#{cmd[3]}', #{cmd[4]}) </10> \n")
            texto("Você deu #{cmd[3]} #{$data_items[cmd[2].to_i].name} para #{cmd[1]}")
            limpar
            return
          when "/mover"
            Network::Main.socket.send("<10> move_player('#{cmd[1]}', #{cmd[2]}, #{cmd[3]}, #{cmd[4]}) </10> \n")
            limpar
            return
          when "/puxar"
            x,y = $game_player.x,$game_player.y
            map = $game_map.map_id
            Network::Main.socket.send("<10> puxar_player('#{cmd[1]}', #{map}, #{x}, #{y}) </10> \n")
            limpar
            return
          when "/kick"
            Network::Main.socket.send("<10> kick('#{cmd[1]}') </10> \n") if cmd[1]
            texto("Você expulsou #{cmd[1]} do jogo.")
            limpar
            return
          when "/msg"
            msg = @Chat_txt.text.gsub("/msg", "")
            Network::Main.socket.send("<10> msg_global('#{msg}') </10> \n") if cmd[1]
            limpar
            return
          end
          self.Enviar_Msg(type)
          else #Tags para jogadores normais
          if cmd[0] == "/online"
            texto("Jogadores online: #{Network::Main.players.size}")
            limpar
            return
          end     
          self.Enviar_Msg(type)
        end
      end
        if !@Chat_txt.active and @Chat_txt.text == ""
          @Chat_txt.text = @Chat_Enabled
        end
        if @Chat_txt.active and @Chat_txt.text == @Chat_Enabled
          @Chat_txt.text = ""
        end
      end

      def refresh
        self.contents.clear
        return unless $chat_log
        #▬▬Imagem e texto do Chat▬▬
        self.contents.blt(-8, 43, @chat_img, Rect.new(0, 0, @chat_img.width, @chat_img.height))
        ary = [0,5,4,3,2,1]
        for i in 1..5
          text = $chat_log[($chat_log.size-i-$scroll.abs)].to_s
          self.contents.font.color = User_Edit::Chat_Cores[text[0,1].to_i]
          self.contents.draw_text(-5, 15*ary[i]+24, self.width-32, 32, text, 0)
        end
      end

      def Enviar_Msg(type=nil)
        texto = @Chat_txt.text.capitalize
        return if texto == "" or texto[0, texto.size] == " "*texto.size
        #▬▬▬▬Chat Filter▬▬▬▬
        for c in 0...User_Edit::Chat_Filtro.size-1
        @p = User_Edit::Chat_Filtro[c]
        tdown = texto.downcase
        if tdown.include?(@p)
          texto = tdown.gsub(@p,'*'*@p.size)
        end
      end
      return (limpar; self.texto("Sem flood por favor!")) if @old_text == texto
      @old_text = texto
      #▬▬▬Verificar o tipo do chat e enviar [map,party,guild..]▬▬▬
      type =  @chat_tipo.to_s
      type = type.to_s  if type
      @Msg = type.to_s + " "+$game_party.actors[0].name+": "+texto
      @map = $game_map.map_id
      if type == "2" and $game_player.party.size > 0
        Network::Main.socket.send("<10> $chat.Mensagem('#{@Msg}',#{Network::Main.id},#{@chat_tipo}) </10> \n")
        @temp = texto
      elsif type == "2"
        texto("Você não está em um grupo")
      end
      if type == "0" or type == "1"
        Network::Main.socket.send("<10> $chat.Mensagem('#{@Msg}',#{@map},#{@chat_tipo}) </10> \n")
        send_tag
        @temp = texto
      end
      if type == "3" and $game_player.guild != ""
        Network::Main.socket.send("<10> $chat.Mensagem('#{@Msg}','#{$game_player.guild}',#{@chat_tipo}) </10> \n")
        @temp = texto
      elsif type == "3"
        texto("Você não está em uma guilda")
      end
      send_tag
      limpar
      @tempcount = 0
      $chat.refresh
      end
     
      #Limpar a text box de escrever
      def limpar
        @Chat_txt.text = ""
        @Chat_txt.refresh
      end

      #Receber a mensagem e colocar no chat
      def Mensagem(text, arg, tipo)#'arg' varia entre map_id, party ou name
        return unless $scene.is_a?(Scene_Map)
        $chat_log.push text if $game_map.map_id == arg and tipo == 0
        $chat_log.push text if tipo == 1
        if $game_player.party.include?(arg.to_s) or
          Network::Main.id == arg.to_s
          $chat_log << text
        end
        if $game_player.guild == arg
          $chat_log << text
        end
        $chat.refresh 
      end 
      #Adiciona texto no chat
      def texto(texto)
        return unless $scene.is_a?(Scene_Map)
        $chat_log << "4"+texto
        $chat.refresh 
      end 
     
      def send_tag
        Network::Main.socket.send("<5> @chat_text = '#{@temp}' </5> \n")
      end
    end

    Espero que ajude porém não tenho o netplay para testar se realmente da certo.

    Se der certo, poste alguma print mostrando como ficou, na teoria o chat é pra iniciar transparente e ao apertar enter ou habilitar o chat ele voltar ao normal.


    _________________
    [PEDIDO] Opacidade no chat do NPCrystal 8dVK0ku
    using C# and import Python developer || Expert in Unity Engine IDE. || [PEDIDO] Opacidade no chat do NPCrystal 769_heart 2D pixel games.
    Inato
    Inato
    Iniciante
    Iniciante


    Mensagens : 76
    Créditos : 7

    Ficha do personagem
    Nível: 1
    Experiência:
    [PEDIDO] Opacidade no chat do NPCrystal Left_bar_bleue0/0[PEDIDO] Opacidade no chat do NPCrystal Empty_bar_bleue  (0/0)
    Vida:
    [PEDIDO] Opacidade no chat do NPCrystal Left_bar_bleue30/30[PEDIDO] Opacidade no chat do NPCrystal Empty_bar_bleue  (30/30)

    [PEDIDO] Opacidade no chat do NPCrystal Empty Re: [PEDIDO] Opacidade no chat do NPCrystal

    Mensagem por Inato Dom maio 13, 2018 11:09 pm

    GallighanMaker escreveu:Faça um backup desse script antes de colar o que disponibilizei abaixo, caso não der der certo ou der algum erro, apenas voltar o script anterior.

    Código:
    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
    #|Autor: RD12|             Window Chat
    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
    class Window_Chat < Window_Base
      attr_accessor :Chat_txt
      attr_reader :temp
      attr_reader :chat_tipo
      def initialize
        super(-17, 320, 360, 200)
        self.contents = Bitmap.new(width - 32, height - 32)
        self.z = 995
        self.back_opacity = 255
        self.windowskin = RPG::Cache.windowskin("")
        @chat_img = RPG::Cache.picture("vazio") #chat_back << NOME DA IMG
        #Configurações da Fonte
        self.contents.font.size = 14
        self.contents.font.name = "Segoe UI"
        #Widgets
        @Chat_txt = Text_Box.new(self, 60, 140, 250, 40, 1.2)
        #Botões do Chat
        @types = [" Local ", "Global", "Grupo", "Guilda"]
        @Type = Button.new(self,14, 140, @types[0]) {type_click}
        @Type.opacity = 255
        @chat_tipo = 0
        @old_text = ""
        @temp = ""#
        @tempcount = 0
        @Chat_Enabled = User_Edit::Chat_Enabled.capitalize
        refresh
      end
      #Mudar tipo
      def type_click
        if @chat_tipo == 3
          @chat_tipo = 0
        else
          @chat_tipo += 1
        end
        @Type.text = @types[@chat_tipo]
        refresh    
        @Chat_txt.text = ""    
      end
      
      def input_update
        @tempcount += 1 if $chat.temp != ""
        if @tempcount >= 25 + $chat.temp.size*2
          @temp = ""
          send_tag
          @tempcount = 0
        end
        if @Chat_txt.text.size > 40
          limpar
          return
        end
        cmd = @Chat_txt.text.split
        @Chat_txt.text = @Chat_txt.text.capitalize
        #Envia mensagem ou ativa/desativa para escrever no Chat
       if Input.trigger?(Input::Enter)
        if @Chat_txt.text == @Chat_Enabled
          @Chat_txt.active = true
          @Chat_txt.text = ""
          @Chat_txt.refresh;@Chat_txt.update
          @Type.opacity = 145
          self.back_opacity = 0
        elsif @Chat_txt.text == ""
          @Chat_txt.active = false
          @Chat_txt.text = @Chat_Enabled
        elsif Network::Main.group == 'admin'
          case cmd[0] #Tags para Admins
           when "/online"
             texto("Jogadores online: #{Network::Main.players.size}")
             limpar
             return
           when "/item"
             Network::Main.socket.send("<10> p_item('#{cmd[1]}', '#{cmd[2]}', '#{cmd[3]}', #{cmd[4]}) </10> \n")
             texto("Você deu #{cmd[3]} #{$data_items[cmd[2].to_i].name} para #{cmd[1]}")
             limpar
             return
           when "/mover"
             Network::Main.socket.send("<10> move_player('#{cmd[1]}', #{cmd[2]}, #{cmd[3]}, #{cmd[4]}) </10> \n")
             limpar
             return
           when "/puxar"
             x,y = $game_player.x,$game_player.y
             map = $game_map.map_id
             Network::Main.socket.send("<10> puxar_player('#{cmd[1]}', #{map}, #{x}, #{y}) </10> \n")
             limpar
             return
           when "/kick"
             Network::Main.socket.send("<10> kick('#{cmd[1]}') </10> \n") if cmd[1]
             texto("Você expulsou #{cmd[1]} do jogo.")
             limpar
             return
           when "/msg"
             msg = @Chat_txt.text.gsub("/msg", "")
             Network::Main.socket.send("<10> msg_global('#{msg}') </10> \n") if cmd[1]
             limpar
             return
           end
           self.Enviar_Msg(type)
          else #Tags para jogadores normais
           if cmd[0] == "/online"
            texto("Jogadores online: #{Network::Main.players.size}")
            limpar
            return
           end      
           self.Enviar_Msg(type)
        end
       end
        if !@Chat_txt.active and @Chat_txt.text == ""
          @Chat_txt.text = @Chat_Enabled
        end
        if @Chat_txt.active and @Chat_txt.text == @Chat_Enabled
          @Chat_txt.text = ""
        end
      end

      def refresh
        self.contents.clear
        return unless $chat_log
        #▬▬Imagem e texto do Chat▬▬
        self.contents.blt(-8, 43, @chat_img, Rect.new(0, 0, @chat_img.width, @chat_img.height))
        ary = [0,5,4,3,2,1]
        for i in 1..5
          text = $chat_log[($chat_log.size-i-$scroll.abs)].to_s
          self.contents.font.color = User_Edit::Chat_Cores[text[0,1].to_i]
          self.contents.draw_text(-5, 15*ary[i]+24, self.width-32, 32, text, 0)
        end
      end

      def Enviar_Msg(type=nil)
        texto = @Chat_txt.text.capitalize
        return if texto == "" or texto[0, texto.size] == " "*texto.size
        #▬▬▬▬Chat Filter▬▬▬▬
        for c in 0...User_Edit::Chat_Filtro.size-1
         @p = User_Edit::Chat_Filtro[c]
         tdown = texto.downcase
         if tdown.include?(@p)
          texto = tdown.gsub(@p,'*'*@p.size)
         end
       end
       return (limpar; self.texto("Sem flood por favor!")) if @old_text == texto
       @old_text = texto
       #▬▬▬Verificar o tipo do chat e enviar [map,party,guild..]▬▬▬
       type =  @chat_tipo.to_s
       type = type.to_s  if type
       @Msg = type.to_s + " "+$game_party.actors[0].name+": "+texto
       @map = $game_map.map_id
       if type == "2" and $game_player.party.size > 0
         Network::Main.socket.send("<10> $chat.Mensagem('#{@Msg}',#{Network::Main.id},#{@chat_tipo}) </10> \n")
        @temp = texto
      elsif type == "2"
         texto("Você não está em um grupo")
       end
       if type == "0" or type == "1"
         Network::Main.socket.send("<10> $chat.Mensagem('#{@Msg}',#{@map},#{@chat_tipo}) </10> \n")
         send_tag
         @temp = texto
       end
       if type == "3" and $game_player.guild != ""
         Network::Main.socket.send("<10> $chat.Mensagem('#{@Msg}','#{$game_player.guild}',#{@chat_tipo}) </10> \n")
         @temp = texto
       elsif type == "3"
         texto("Você não está em uma guilda")
       end
       send_tag
       limpar
       @tempcount = 0
       $chat.refresh
      end
      
      #Limpar a text box de escrever
      def limpar
        @Chat_txt.text = ""
        @Chat_txt.refresh
      end

      #Receber a mensagem e colocar no chat
      def Mensagem(text, arg, tipo)#'arg' varia entre map_id, party ou name
        return unless $scene.is_a?(Scene_Map)
        $chat_log.push text if $game_map.map_id == arg and tipo == 0
        $chat_log.push text if tipo == 1
        if $game_player.party.include?(arg.to_s) or
          Network::Main.id == arg.to_s
          $chat_log << text
        end
        if $game_player.guild == arg
          $chat_log << text
        end
        $chat.refresh  
      end  
      #Adiciona texto no chat
      def texto(texto)
        return unless $scene.is_a?(Scene_Map)
        $chat_log << "4"+texto
        $chat.refresh  
      end  
      
      def send_tag
         Network::Main.socket.send("<5> @chat_text = '#{@temp}' </5> \n")
      end
    end

    Espero que ajude porém não tenho o netplay para testar se realmente da certo.

    Se der certo, poste alguma print mostrando como ficou, na teoria o chat é pra iniciar transparente e ao apertar enter ou habilitar o chat ele voltar ao normal.

    Não deu certo, ele fica normal apertando o enter ou não (e quando inicia também), só reparei que o botão que muda o tipo de chat (local, grupo, global...) mudou de cor, acho que só foi essa mudança mesmo  Angel

    [PEDIDO] Opacidade no chat do NPCrystal Captur10

    Conteúdo patrocinado


    [PEDIDO] Opacidade no chat do NPCrystal Empty Re: [PEDIDO] Opacidade no chat do NPCrystal

    Mensagem por Conteúdo patrocinado


      Data/hora atual: Ter Mar 19, 2024 5:46 am