Suporte no desenvolvimento de jogos


    Como coloco um ícone no mapa redirecionando a esse script?

    avatar
    Gumg
    Membro Ativo
    Membro Ativo

    Mensagens : 273
    Créditos : 29
    Cash : 0

    Como coloco um ícone no mapa redirecionando a esse script? Empty Como coloco um ícone no mapa redirecionando a esse script?

    Mensagem por Gumg em Qua Mar 09, 2011 11:52 pm

    Ooi galera!
    Estava querendo usar o script de PM do Netplay 2.1 no Netplay v3 !
    Então
    eu queria saber como colocar um ícone na HUD pra quando clicar nele,
    abrir a Scene_Mail (acho que é essa que tem que abrir)
    Será que alguém poderia me ajudar? O script é esse:
    Spoiler:

    Código:
    #==============================================
    # <> Mail Client v1.0
    #==============================================

    module SC # don't delete module, it's ripping if done anyway!
    RXSC_MAIL = "Mail Client Script: Ver.1.0"
    MAIL_HEAR_SOUND = true # set to true to hear a sound on receive
    end

    class Mail

    attr_accessor :mail # Mail
    attr_accessor :msg # Content of mail
    attr_accessor :account # Your e-mail account
    attr_accessor :sender # The sender
    attr_accessor :read # If it's read or new
    attr_accessor :font # Contents font

    def initialize # Define the variables we're going to use
    # Why are they global variables you ask? So we can use 'em outside this class
    @mail = [] # mail IDs
    @msg = {} # mail msgs
    #@account = "#{$game_party.actors[0].name.downcase}@#{User_Edit::GAME_MAIL}" # This is the player's mail
    @account = "#{$game_party.actors[0].name}" # This is the player's mail
    @sender = [] # sender IDs
    @read = {} # unread option IDs
    @font = {} # font
    end

    def received_include?(string) # check if string is in mail or sender (can be number)
    if @mail.include?(string)
    return true
    elsif @sender.include?(string)
    return true
    else
    return false
    end
    end

    def is_new?(string) # see if mail is unread
    if @read[string] == true
    return false
    elsif @read[string] == false
    return true
    else
    return false
    end
    end

    def write_mail(topic = nil,from = nil,msg = [], type = nil, font = nil)
    if SC::MAIL_HEAR_SOUND == true # Sound when receiving
    Audio.se_play("Audio/SE/055-Right01", 100, 150) # You may change the soundfile
    # In fact, you may even use Music Effects, BGM (not recommended) or BGS.
    # Change the 'se_play' to 'me_play','bgm_play' or 'bgs_play' respectivly.
    # You should also change the directory when something else than SE is used.
    end
    if topic == nil or topic == ""# Subject of message
    @mail.push("(Nessun Titolo)") # if no subject specified
    else
    @mail.push(topic)
    end
    if msg == nil # Write a message in array format, like: ["line1, "line2, "etc"]
    else
    @msg[topic] = msg
    end
    if from == nil or from == "" # The sender of the mail
    @sender.push("(Sconosciuto)") # if no sender specified
    else
    @sender.push(from)
    end
    if font != nil
    @font[topic] = font
    end
    @read[topic] = false # set it to unread
    if type != nil # some cool stuff
    if type == 1
    # Type 1: Corrupted Mail
    @msg[topic].push("","* AUTO MAIL *","The mail is corrupted.","Sorry for this inconvinience.","","Greetings from Webmaster")
    elsif type == 2
    # Type 2: Infected Mail
    @msg[topic].push("","* AUTO MAIL *","This mail is infected.","Delete it immediately.","","Greetings from Webmaster")
    elsif type == 3
    # Type 3: Incomplete Mail
    @msg[topic].push("","*
     AUTO MAIL *","Mail was not sent correctly.","Some parts may have been
    lost.","","Greetings from Webmaster")
    elsif type == 4
    # Add more if you like, see above for the examples
    end
    end
    end
    end

    # This is the topic window or in other words the message window.
    # So this is the window where the contents of a mail is shown.
    # You may change it in how you want it actually.
    # Screwing this up is your own fault... but then again, you can always repaste...
    class Window_Topic < Window_Base

    def initialize(mail)
    super(0, 0, 640, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    self.contents.font.color = Color.new(0, 0, 0, 255)

    self.visible = false
    @mail = mail # This is the index of the inbox and will be converted to the mail ID
    refresh
    end

    def refresh
    self.contents.clear
    unless @mail == "Nessuno" # Just a block
    self.contents.draw_text(4, 0, self.width - 40, 32, "Oggetto: #{$mail.mail[@mail]}")
    self.contents.draw_text(4, 32, self.width - 40, 32, "Da: #{$mail.sender[@mail]}")
    self.contents.draw_text(4, 64, self.width - 40, 32, "Destinatario: #{$game_party.actors[0].name}")
    rect = Rect.new(0, 100, self.width, 2)
    self.contents.fill_rect(rect, Color.new(50, 50, 50)) # Modify the color as pleased
    end
    end

    def show_msg(msg) # Show the mail message contents
    @topic = $mail.mail[@mail].to_s
    @msg = $mail.msg[@topic]
    y = 85 # start line 1 at this y-position
    unless @msg == nil or @mail == "Nessuno" # Also just a block
    for line in 0...3 # this is the message, as you see, max lines is 20
    y += 16 # space between the lines
    self.contents.font.size = 22 # font size
    if $mail.font[@topic] != nil
    self.contents.font.name = $mail.font[@topic] # own font
    end
    self.contents.draw_text(4, y, self.width, 32, @msg[line].to_s)
    end
    end
    end
    end

    # This is the inbox
    # When email is received it will be added at the end of the list.
    # So that you can see, like the real one, which one's old or new.
    class Window_Inbox < Window_Selectable

    def initialize
    super(0, 64, 640, 416)
    @column_max = 1
    self.index = 0
    refresh
    end

    def item
    return @data[self.index]
    end

    def refresh
    if self.contents != nil
    self.contents.dispose
    self.contents = nil
    end
    @data = []
    for i in 0...$mail.mail.size # This is the var for mails
    @data.push($mail.mail[i])
    end
    @item_max = @data.size
    if @item_max >= 0
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    for i in 0...@item_max
    draw_item(i)
    end
    end
    end

    def draw_item(index)
    item = @data[index]
    self.contents.font.color = normal_color
    x = 4
    y = index * 32 # 32 stands for space between lines
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(x, y, self.width - 40, 32, item.to_s) # mail topic (subject)
    self.contents.draw_text(x + 400, y, self.width - 40, 32, "Da: " + $mail.sender[index].to_s) # Sender
    if $mail.read[item] == false
    self.contents.font.color = Color.new(130,225,89)
    self.contents.draw_text(x + 300, y, self.width - 40, 32, "NUOVA") # if mail is unread
    else
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 300, y, self.width - 40, 32, "LETTA") # if mail is read, change as pleased
    end
    end
    end

    # This is the built-in mail client.
    # You may modify it but try not to screw it too much up.
    class Scene_Mail

    def main
    @help_window = Window_Help.new
    if $mail.mail.size == 0 or $mail.mail == nil
    @help_window.set_text("#{$game_party.actors[0].name} // EMAIL: Nessuna Email")
    else
    @help_window.set_text("#{$game_party.actors[0].name} // EMAIL: #{$mail.mail.size}")
    end
    @help_window.z = 100
    @inbox = Window_Inbox.new
    @inbox.active = true
    @inbox.visible = true
    @inbox.z = 200
    @topic_window = Window_Topic.new("Nessuno")
    @topic_window.z = 100
    @message_window = Window_Message.new # For msg's to show...
    Graphics.transition
    loop do
    Graphics.update
    Input.update
    update
    if $scene != self
    break
    end
    end
    Graphics.freeze
    @inbox.dispose
    @topic_window.dispose
    @message_window.dispose
    @help_window.dispose
    end

    def update
    @message_window.update
    @inbox.update
    @help_window.update
    @topic_window.update
    if $game_temp.message_window_showing
    return
    end
    if @inbox.active == false
    update_topic
    return
    end
    if @inbox.active == true
    update_inbox
    return
    end
    end

    def update_inbox
    if $mail.mail.size == 0 or $mail.mail == nil
    @inbox.index = -1
    end
    if Input.trigger?(Input::C) # selecting the topic at inbox
    if @inbox.index == nil or $mail.mail.size == 0 # if no topics...
    $game_system.se_play($data_system.buzzer_se) # errrr
    return
    end
    $game_system.se_play($data_system.decision_se)
    @topic_window.contents.clear
    @topic_window = Window_Topic.new(@inbox.index)
    @topic_window.show_msg(@inbox.index)
    if $mail.read[$mail.mail[@inbox.index]] == false
    $mail.read[$mail.mail[@inbox.index]] = true
    @inbox.refresh
    end
    @topic_window.visible = true
    @inbox.active = false
    @inbox.visible = false
    @help_window.visible = false
    end
    if Input.trigger?(Input::B)
    $game_system.se_play($data_system.cancel_se)
    $scene = Scene_Map.new # This would be the previous scene
    end
    if Input.trigger?(Input::Z) # Deletes selected email
    $mail.mail.delete_at(@inbox.index)
    $mail.msg.delete(@inbox.index)
    $mail.sender.delete_at(@inbox.index)
    $game_system.se_play($data_system.decision_se)
    @inbox.refresh
    if $mail.mail.size == 0
    @inbox.index = 0
    @help_window.set_text("#{$game_party.actors[0].name} // EMAIL: Nessuna Email")
    else
    @help_window.set_text("#{$game_party.actors[0].name} // EMAIL: #{$mail.mail.size}")
    end
    if @inbox.index > 1
    @inbox.index -= 1
    else
    @inbox.index = 0
    end
    end
    if Input.trigger?(Input::X) # Deletes all
    $mail.mail.clear
    $mail.msg.clear
    $mail.sender.clear
    $game_system.se_play($data_system.decision_se)
    @inbox.refresh
    @help_window.set_text("#{$game_party.actors[0].name} // EMAIL: #{$mail.mail.size}")
    @inbox.index = -1 # this will make the cursor be hidden (cuz there arent any mails)
    end
    end

    def update_topic # this command is for the topic window, add stuff if you like
    if Input.trigger?(Input::B) # cancel button to return to inbox
    $game_system.se_play($data_system.cancel_se)
    @inbox.active = true
    @inbox.visible = true
    @help_window.visible = true
    @topic_window.visible = false
    end
    end
    end

    #==============================================================================
    # ** Window_Back
    #------------------------------------------------------------------------------

    class Window_Back < Window_Base
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize
        super(0, 0, 640, 480)
        self.contents = Bitmap.new(width - 32, height - 32)
        self.contents.font.color = Color.new(0, 0, 0, 255)
      end
    end


    #==============================================================================
    # ■ Scene_Text
    #------------------------------------------------------------------------------
    #  メニュー画面の処理を行うクラスです。
    #==============================================================================

    class Scene_Write_Mail
      #-----------------------------------------------------------------------
      # ● メイン処理
      #--------------------------------------------------------------------------
      def main
        @input_dest_window = Input_MDest.new
        @input_topic_window = Input_MTopic.new
        @back = Window_Back.new
        @dest = Text_Box.new(@input_dest_window,164,16,400,400)
        @topic = Text_Box.new(@input_topic_window,164,16,400,400)
        @send_button = Button.new(@back,520,360,"  Invia  ") {send_mail}
        @erase_button = Button.new(@back,400,360,"  Cancella Testo  ") {@text_mail.text = ""}
        @text_mail = Text_Box.new(@back,16,160,600,800,8)
       
        @topic.extended
        @dest.extended
        @text_mail.extended
        Graphics.transition
        # メインループ
        loop do
          # ゲーム画面を更新
          Graphics.update
          # 入力情報を更新
          Input.update
          # フレーム更新
          update
          # 画面が切り替わったらループを中断
          if $scene != self
            break
          end
        end
        # トランジション準備
        Graphics.freeze
        @input_dest_window.dispose
        @input_topic_window.dispose
        @text_mail.dispose
        @send_button.dispose
        @erase_button.dispose
        @dest.dispose
        @topic.dispose
        @back.dispose
      end
      #--------------------------------------------------------------------------
      # ● フレーム更新
      #--------------------------------------------------------------------------
      def send_mail
     
     
    #$mail.write_mail(@input_topic_window.testo,$game_party.actors[0].name,[@text_linee_1.testo,@text_linee_2.testo,@text_linee_3.testo])
      Network::Main.socket.send("MAIL|#{@dest.text}|#{@topic.text}|#{@text_mail.text}|<->")
      $scene = Scene_Reinit.new
      return
      end
     
      def update
        @send_button.update
        @erase_button.update
        @text_mail.update
        @dest.update
        @topic.update
      if Input.trigger?(Input::B)
      $scene = Scene_Map.new
      end 
      end
     

    end


    module Network
    class Main
      def self.mail(topic,from,msg)
      @testo = []
      for txt in msg.split("-N-")
        @testo.push(txt)
      end
      $mail.write_mail(topic,from,@testo)
      end 
    end
    end

    #==============================================================================
    # ** Input_MDest
    #------------------------------------------------------------------------------
    #  PERMETTE DI SCRIVERE UN TESTO DENTRO UNA CASELLA
    #==============================================================================
    #topic = nil,from = nil,msg = []

    class Input_MDest < Window_Base
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize(x=0,y=0,a=640,b=64)
        super(x,y,a,b)
        self.contents = Bitmap.new(width - 32, height - 32)
          self.contents.font.color = Color.new(0, 0, 0, 255)
     refresh
      end
     
      #--------------------------------------------------------------------------
      # * Refresh
      #--------------------------------------------------------------------------
      def refresh
        self.contents.clear
        self.contents.draw_text(0,-8, 640, 32, "Destinatario:")
      end
     
    end
    #==============================================================================
    # ** Input_MTopic
    #------------------------------------------------------------------------------
    #  PERMETTE DI SCRIVERE UN TESTO DENTRO UNA CASELLA
    #==============================================================================
    #topic = nil,from = nil,msg = [], type = nil, font = nil)
    class Input_MTopic < Window_Base
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize(x=0,y=65,a=640,b=64)
        super(x,y,a,b)
        self.contents = Bitmap.new(width - 32, height - 32)
          self.contents.font.color = Color.new(0, 0, 0, 255)
     refresh
      end
     
      #--------------------------------------------------------------------------
      # * Refresh
      #--------------------------------------------------------------------------
      def refresh
        self.contents.clear
        self.contents.draw_text(0,-8, 640, 32, "Oggetto:")
      end
     
    end


     
    Jonny
    Jonny
    Aldeia Friend
    Aldeia Friend

    Medalhas : Como coloco um ícone no mapa redirecionando a esse script? Trophy11Como coloco um ícone no mapa redirecionando a esse script? 9P5Gx
    Mensagens : 1937
    Créditos : 327
    Cash : 0

    Como coloco um ícone no mapa redirecionando a esse script? Empty Re: Como coloco um ícone no mapa redirecionando a esse script?

    Mensagem por Jonny em Qui Mar 10, 2011 12:01 am

    Este Post no ba a qui va en la Seccion de Dúvidas e Pedidos


    _________________
    Spoiler:

      


    Como coloco um ícone no mapa redirecionando a esse script? KVIdx
    Valentine
    Valentine
    Administrador
    Administrador

    Medalhas : Como coloco um ícone no mapa redirecionando a esse script? 94JxvComo coloco um ícone no mapa redirecionando a esse script? ZgLkiRU
    Mensagens : 5014
    Créditos : 1111
    Cash : 0

    Como coloco um ícone no mapa redirecionando a esse script? Empty Re: Como coloco um ícone no mapa redirecionando a esse script?

    Mensagem por Valentine em Qui Mar 10, 2011 12:02 am

    Tópico movido e esse script não funciona no netplay master v3


    _________________
    Como coloco um ícone no mapa redirecionando a esse script? AIymW

    Conteúdo patrocinado

    Como coloco um ícone no mapa redirecionando a esse script? Empty Re: Como coloco um ícone no mapa redirecionando a esse script?

    Mensagem por Conteúdo patrocinado

      Tópicos similares

      -

      Data/hora atual: Sab Nov 16, 2019 6:38 pm