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


 
PortalPortal  InícioInício  ProcurarProcurar  Últimas imagensÚltimas imagens  RegistrarRegistrar  Entrar  

Compartilhe|

Icon Inventory

Ver o tópico anterior Ver o tópico seguinte Ir para baixo
AutorMensagem
Douglanilo
Douglanilo
Mestre
Mestre

Masculino Postagens : 959
Data de inscrição : 02/04/2009
Icon Inventory 11101010

Icon Inventory Vide http://www.twevergrand.com
MensagemAssunto: Icon Inventory Icon Inventory EmptyDom Out 11, 2009 1:49 pm

Icon Inventory
Por Mac


Introdução
Este script mostra os itens em forma de ícones e sem agrupa-los.
Para usar copie e cole acima do main.

ScreenShot
Icon Inventory Iconitemmenusz3

script
Código:
#==============================================================================
# Icon Inventory (WindowSkin Versão)
#==============================================================================
# Criador: Mac
# Versão : 1.0
#------------------------------------------------------------------------------
# Divulgação e Tradução : LegendsX
#==============================================================================

class Window_Item < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
  super(0, 63, 640, 417)
  @column_max = 10
  refresh
  self.index = 0
  # If in battle, move window to center of screen
  # and make it semi-transparent
  if $game_temp.in_battle
  self.y = 64
  self.height = 256
  self.back_opacity = 160
  end
end
#--------------------------------------------------------------------------
# * Get Item
#--------------------------------------------------------------------------
def item
  return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
  if self.contents != nil
  self.contents.dispose
  self.contents = nil
  end
  @data = []
  # Add item
  for i in 1...$data_items.size
  if $game_party.item_number(i) > 0
    @data.push($data_items[i])
  end
  end
  # Also add weapons and items if outside of battle
  unless $game_temp.in_battle
  for i in 1...$data_weapons.size
    if $game_party.weapon_number(i) > 0
    @data.push($data_weapons[i])
    end
  end
  for i in 1...$data_armors.size
    if $game_party.armor_number(i) > 0
    @data.push($data_armors[i])
    end
  end
  end
  # If item count is not 0, make a bit map and draw all items
  @item_max = @data.size
  if @item_max > 0
  self.contents = Bitmap.new(width - 32, row_max * 32)
  for i in 0...@item_max
    draw_item(i)
  end
  end
end
#--------------------------------------------------------------------------
# * Draw Item
#  index : item number
#--------------------------------------------------------------------------
def draw_item(index)
  item = @data[index]
  case item
  when RPG::Item
  number = $game_party.item_number(item.id)
  when RPG::Weapon
  number = $game_party.weapon_number(item.id)
  when RPG::Armor
  number = $game_party.armor_number(item.id)
  end
  if item.is_a?(RPG::Item) and
  $game_party.item_can_use?(item.id)
  self.contents.font.color = normal_color
  else
  self.contents.font.color = disabled_color
  end
  x = 4 + index % 10 * (32 + 32)
  y = index / 10 * 32
  rect = Rect.new(x, y, self.width / @column_max - 32, 32)
  self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  bitmap = RPG::Cache.icon(item.icon_name)
  opacity = self.contents.font.color == normal_color ? 255 : 128
  self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  self.contents.draw_text(x, y + 9, 24, 32, number.to_s, 2)
end
#--------------------------------------------------------------------------
# * Help Text Update
#--------------------------------------------------------------------------

def update_help
  @help_window.set_text(self.item == nil ? "" : self.item.description)
end
end

Créditos e Agradecimentos
Feito Por Mac
Postagem na The World of Ever Grand por Douglanilo
Ir para o topo Ir para baixo

Icon Inventory

Ver o tópico anterior Ver o tópico seguinte Ir para o topo
Página 1 de 1

Permissões neste sub-fórumNão podes responder a tópicos
The World of EverGrand :: Programação em Linguagens :: Ruby Game Scripting System :: Scripts :: RPG Maker XP-