Kod:
#================================================= =============================#
#Ikony # Tytuł #
#------------------------------------------------- -----------------------------#
# Autor: Gab! (Mundo RPG Maker) #
# Data: 16/06/2011 #
#------------------------------------------------- -----------------------------#
#------------------------------------------------------------------------------#
# Wykonane dla: glorenconi #
# Fabryczne: PRO Coders #
# #
# OŚWIADCZENIE już skonfigurowane #
#------------------------------------------------------------------------------#
# www.mundorpgmaker.com #
# www.mundorpgmaker.com/forum #
#------------------------------------------------------------------------------#
# Masz pełną wolność modyfikacji, dystrybucji i wykorzystania skryptu z #
# TAKICH HEAD, pozostaje nienaruszona. Bez zmian. #
#==============================================================================#
#==============================================================================#
# * KONFIGURACJA #
#==============================================================================#
module Gab
module TitleIcons
ICONS = [
# ID z ikon, aby zmienić
# Oddzielając je przecinkami
[1,20,34], # Nowa gra
[2,33,31], # Wczytaj gre
[3,16,25] # Wyjdź z gry
]
CTIME = 3 # Tempo, em segundos, da troca dos ícones
end
end
#==============================================================================#
# * KONIEC KONFIGURACJI #
#==============================================================================#
class Scene_Title
alias old_st_ccw create_command_window unless $@
alias old_st_upd update unless $@
def create_command_window(*args)
old_st_ccw(*args)
@window_icon_index = [0]*3
tmp = -1
@window_icon_index.map!{|i| (i + 1) % Gab::TitleIcons::ICONS[tmp += 1].size}
tmp = -1
@command_window.icon = @window_icon_index.map{|i| Gab::TitleIcons::ICONS[tmp += 1][i]}
@command_window.refresh
end
def update(*args)
old_st_upd(*args)
if (Graphics.frame_count % (Graphics.frame_rate * Gab::TitleIcons::CTIME)) == 0
tmp = -1
@window_icon_index.map!{|i| (i + 1) % Gab::TitleIcons::ICONS[tmp += 1].size}
tmp = -1
@command_window.icon = @window_icon_index.map{|i| Gab::TitleIcons::ICONS[tmp += 1][i]}
@command_window.refresh
end
end
end
class Window_Command
attr_accessor :icon
def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32, icon = [])
row_max = (commands.size + column_max - 1) / column_max if row_max == 0
super(0, 0, width, row_max * WLH + 32, spacing)
@commands, @item_max, @column_max, @icon = commands, commands.size, column_max, icon
refresh
self.index = 0
end
def draw_item(index, enabled = true)
rect = item_rect(index)
rect.x += 4
rect.width -= 8
if !@icon.empty? && defined?(@icon[index])
draw_icon(@icon[index], rect.x, rect.y, enabled)
rect.x += 24
end
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(rect, @commands[index])
end
end