Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # RSM's PRETTY BUTTONS ON TITLE SCREEN ACE v1.0
- # Projeto Baú dos Scripts do RSM - www.condadobraveheart.com
- #_______________________________________________________________________________
- # Descrição | Esse script troca os botões da tela de título por uns um
- # | pouco mais interessante com direito a organização horizontal
- # | e ícones bonitinhos. As consigurações estão no módulo Config.
- #________________|______________________________________________________________
- #===============================================================================
- #==============================================================================
- # ** Aqui é onde nóis configura os bagulho
- #------------------------------------------------------------------------------
- module Config
- # Ajuste fino da coordenada Y da posição da janela
- Title_Window_Y = -32
- # Fundo transparente da janela?
- Title_Window_Vis = false
- # Imagem pra pegar os ícones (ficará na pasta 'System')
- Title_Buttons = "Title_Buttons"
- end
- #==============================================================================
- # ** Window_Base
- #------------------------------------------------------------------------------
- class Window_Base < Window
- # Uma propriedade nova que pode vir a calhar...
- attr_accessor :text_align
- def text_align
- 0
- end
- #--------------------------------------------------------------------------
- # * Função sobrescrita, porém só com um argumento opcional
- #--------------------------------------------------------------------------
- def process_normal_character(c, pos, a = text_align)
- text_width = text_size(c).width
- draw_text(pos[:x], pos[:y], text_width * 2, pos[:height], c, a)
- pos[:x] += text_width
- end
- #--------------------------------------------------------------------------
- # * Função sobrescrita, porém só com um argumento opcional
- #--------------------------------------------------------------------------
- def draw_text_ex(x, y, text, reset = true)
- reset_font_settings if reset
- text = convert_escape_characters(text)
- pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
- process_character(text.slice!(0, 1), text, pos) until text.empty?
- end
- end
- #==============================================================================
- # ** Window_TitleCommand
- #------------------------------------------------------------------------------
- class Window_TitleCommand
- #--------------------------------------------------------------------------
- # * Nossas opções
- #--------------------------------------------------------------------------
- def text_align
- 1 # Centro
- end
- def col_max
- return 3
- end
- def window_width
- return 128 * 3
- end
- def window_height
- return 128
- end
- #--------------------------------------------------------------------------
- # * Fazendo ajuste fino
- #--------------------------------------------------------------------------
- alias rsm_diff_title_upd_placemente update_placement
- def update_placement
- rsm_diff_title_upd_placemente
- self.y += Config::Title_Window_Y
- end
- #--------------------------------------------------------------------------
- # * (SOBRESCRITO) Dando uam mudada na hora de desenhar as opções da janela
- #--------------------------------------------------------------------------
- def draw_item(index)
- rect = item_rect_for_text(index)
- pos_x = (index * item_width) + (index * spacing) + 24
- draw_title_icon(Config::Title_Buttons, index, pos_x, 16, command_enabled?(index))
- change_color(normal_color, command_enabled?(index))
- draw_text_ex(rect.x, rect. y + rect.height - 32, command_name(index), false)
- end
- #--------------------------------------------------------------------------
- # * Tirando o fundo da janela, se assim for desejado...
- #--------------------------------------------------------------------------
- def update
- super
- unless Config::Title_Window_Vis
- self.opacity = 0
- self.back_opacity = 0
- end
- end
- #--------------------------------------------------------------------------
- # * (SOBRESCRITO)Largura da linha para ajeitarmos o cursor
- #--------------------------------------------------------------------------
- def item_height
- (height - standard_padding * 2 + spacing) / 1 - spacing
- end
- #--------------------------------------------------------------------------
- # * (NOVO) Desenhando as figuras diretamente da imagem
- #--------------------------------------------------------------------------
- def draw_title_icon(file, icon_index, x, y, enabled = true)
- bitmap = Cache.system(file)
- rect = Rect.new(icon_index * 48, 0, 48, 48)
- contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement