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


3 participantes

    Window_Help_Item

    Paulo Soreto
    Paulo Soreto
    Lenda
    Lenda


    Mensagens : 1980
    Créditos : 367

    Ficha do personagem
    Nível: 1
    Experiência:
    Window_Help_Item Left_bar_bleue0/0Window_Help_Item Empty_bar_bleue  (0/0)
    Vida:
    Window_Help_Item Left_bar_bleue30/30Window_Help_Item Empty_bar_bleue  (30/30)

    Window_Help_Item Empty Window_Help_Item

    Mensagem por Paulo Soreto Qua Mar 13, 2013 12:06 am

    Introdução
    Fiz uma janela substituta a do np, visualmente se nota pouco, mas olhem no código e verão a diferença.

    Screen
    Spoiler:

    Código
    Código:
    #===============================================================================
    # * Window Help Item
    #-------------------------------------------------------------------------------
    # Paulo Soreto
    # 13.03.2013
    # 1.0
    #===============================================================================
    class Window_Help2 < Window_Base
      def initialize(x,y,a,b)
        super(x,y,a,b)
        setup
        @actor = $game_party.actors[0]
      end
     
      def setup
        self.contents = Bitmap.new(width - 32, height - 32)
        self.opacity = 200
        self.windowskin = RPG::Cache.windowskin('Help')
        self.z = 999999999
        @dragable = true
        @closable = true
      end
     
      def refresh
        self.contents.clear
        select_item
        return if @item.nil?
        setup_font
        self.contents.draw_text(0, 0, self.contents.width, 32, @item.name, 1)
        set_normal_font
        if @item.is_a?(RPG::Armor)
          draw_armor
        elsif @item.is_a?(RPG::Weapon)
          draw_weapon
        elsif @item.is_a?(RPG::Item)
          draw_item
        end
      end
     
      def draw_armor
        @text = [["Str:", @item.str_plus.to_s],
                ["Dex:", @item.dex_plus.to_s],
                ["Int:", @item.int_plus.to_s],
                ["Agi:", @item.agi_plus.to_s],
                ["Preço", @item.price.to_s]]
        @type = 0
        draw_text
      end
     
      def draw_weapon
        @text = [["Str:", @item.str_plus.to_s],
                ["Dex:", @item.dex_plus.to_s],
                ["Int:", @item.int_plus.to_s],
                ["Agi:", @item.agi_plus.to_s],
                ["Dano:", @item.atk.to_s],
                ["Preço:", @item.price.to_s]]
        @type = 1
        draw_text
      end
     
      def draw_item
        @text = [@item.description, ["Preço:", @item.price.to_s]]
        draw_text
      end
     
      def draw_text
        ini = 22
        if @text.size < 3
          self.contents.draw_text(0, ini, self.contents.width, 20, @text[0], 1)
          self.contents.draw_text(0, 18 + ini, 64, 20, @text[1][0])
          self.contents.draw_text(64, 18 + ini, 64, 20, @text[1][1])
          return
        end
        for i in 0...@text.size
          self.contents.draw_text(0, i * 14 + ini, 64, 20, @text[i][0])
          self.contents.draw_text(64, i * 14 + ini, 64, 20, @text[i][1])
        end
        self.contents.font.bold = true
        if check_equipable
          self.contents.font.color = Color.new(35,142,35)
          self.contents.draw_text(0, 114, self.contents.width, 32, "Pode ser equipado", 1)
        else
          self.contents.font.color = Color.new(142,35,35)
          self.contents.draw_text(0, 114, self.contents.width, 32, "Não pode ser equipado", 1)
        end
      end
     
      def check_equipable
        case @type
        when 0
          armor_set = $data_classes[@actor.class_id].armor_set
          return true if armor_set.include?(@item.id)
        when 1
          weapon_set = $data_classes[@actor.class_id].weapon_set
          return true if weapon_set.include?(@item.id)
        end
      end
     
      def set_normal_font
        self.contents.font.color = Color.new(0, 0, 0)
        self.contents.font.bold = false
        self.contents.font.italic = false
      end
     
      def setup_font
        if @item.is_a?(RPG::Item)
          self.contents.font.color = Color.new(107,35,142)
        elsif @item.is_a?(RPG::Weapon)
          self.contents.font.color = Color.new(92,51,23)
        elsif @item.is_a?(RPG::Armor)
          self.contents.font.color = Color.new(255,127,0)
        end
        self.contents.font.bold = true
        self.contents.font.italic = true
      end
     
      def select_item
        if $help_trade == true
          @item = $trade_w.item
        elsif $help_loja == true
          @item = $loja_w.item
        else
          @item = $item_w.item
        end
      end
    end


    Última edição por Paulo Soreto em Qua Mar 13, 2013 2:16 pm, editado 4 vez(es)


    _________________
    Window_Help_Item FwYnoXI
    Minos
    Minos
    Ocasional
    Ocasional


    Mensagens : 238
    Créditos : 38

    Window_Help_Item Empty Re: Window_Help_Item

    Mensagem por Minos Qua Mar 13, 2013 8:28 am

    Modificação Boa Se For Ver Irei Usar Em Meu Projeto Successful a +1cred
    Jonny
    Jonny
    Aldeia Friend
    Aldeia Friend


    Medalhas : Window_Help_Item Trophy11Window_Help_Item 9P5Gx
    Mensagens : 1936
    Créditos : 327

    Window_Help_Item Empty Re: Window_Help_Item

    Mensagem por Jonny Qua Mar 13, 2013 2:53 pm

    Buen sistema.. muy dinamico pero algo simple.. Fuckthashit
    + 1 Cred


    _________________
    Spoiler:


    Window_Help_Item KVIdx

    Conteúdo patrocinado


    Window_Help_Item Empty Re: Window_Help_Item

    Mensagem por Conteúdo patrocinado


      Data/hora atual: Qui maio 23, 2024 6:22 pm