O TEMA DO FÓRUM ESTÁ EM MANUTENÇÃO. FEEDBACKS AQUI: ACESSAR

Remoção de Janela

Iniciado por Quasar, 13/04/2013 às 16:34

13/04/2013 às 16:34 Última edição: 14/04/2013 às 14:41 por xXChristopherXx
Será que alguém pode me ajudar? Estou elaborando um jogo no RMXP Netplay Master V4 , e queria remover a janela que está com destaque vermelho e deixar a janela que está com destaque verde.

Opa, fiz aqui, foi fácil, mas é provável que possa surgir erros no futuro. Qualquer erro, só dizer aqui que tento resolver blz?
Você vai perceber que apenas comentei umas linhas, mas não apaguei porque é possível que se der erro, seja preciso delas. Então deixe do jeito que eu deixei blz!?

Spoiler
#==============================================================================
# ** 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(0, 337, 305, 126)
    #@chat.visible = false
    
    @chat_text = Window_Normal.new(-14,303,326,200)
    $chat = @chat_text#@chat
    $chat_textinho = @chat_text
    @chat_text.opacity = 1
    @chat_text.z = 9999
    $chat_id = 1
    @box = Text_Box.new(@chat_text,13,158,243,30)
    @box.active = true
    @chat_privado = Window_Dummys.new(200,391,120,100)
    @private_input = Text_Box.new(@chat_privado,13,47,78,10)
    @chat_privado.visible = false
    @chat_privado.active = false
    @chat_privado.z = 99999
    @chat_privado.opacity = 1
    
    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 = Button.new(@chat_text,16,23,LANGUAGE::CHATMAP,0,0, 1) {@chat_privado.visible = false; @chat_privado.active = false; $chat_id  = 1; @box.active = true}
    #@global_chat = Button.new(@chat_text,56,23,LANGUAGE::CHATGLOBAL,0,0, 2) {@chat_privado.visible = false; @chat_privado.active = false; $chat_id  = 2; @box.active = true}
    #@party_chat = Button.new(@chat_text,100,23,LANGUAGE::CHATPARTY,0,0, 3) {@chat_privado.visible = false; @chat_privado.active = false; $chat_id  = 3; @box.active = true}
    #@guild_chat = Button.new(@chat_text,137,23,LANGUAGE::CHATGUILD,0,0, 4) {@chat_privado.visible = false; @chat_privado.active = false; $chat_id  = 4; @box.active = true}
    #@private_chat = Button.new(@chat_text,175,23,LANGUAGE::CHATPRIVATE,0,0, 5) {@chat_privado.visible = true; @chat_privado.active = true; $chat_id  = 5; @box.active = true}
    @chat_button = Button.new(@chat_text,257,158,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
    #@chat.visible = false
    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
[close]


Não sei se você pensou nisso. Mas, NÃO precisa e nem deve por crédito ou agradecimentos para mim no seu projeto.

Paz e Tédio a todos! Voltei marujos! o/

Putz cara funfou de boa aqui, mas pq não quer os créditos ?

Porque não oras.

Bom, agora bota o icone de resolvido, e pede para um moderador trancar.

Obrigado por colaborar com a organização do fórum.

Paz e Tédio a todos. Yo-How.