Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ** Scene_Item
- #------------------------------------------------------------------------------
- # Esta classe executa o processamento da tela de item.
- #==============================================================================
- class Scene_LuneCraft < Scene_ItemBase
- #--------------------------------------------------------------------------
- # * Inicialização do processo
- #--------------------------------------------------------------------------
- def start
- super
- @get_index = 0
- create_category_window
- create_item_window
- end
- #--------------------------------------------------------------------------
- # * Criação da janela de categorias
- #--------------------------------------------------------------------------
- def create_category_window
- @category_window = Window_CombineList.new
- @category_window.viewport = @viewport
- @help_window = Window_Help_Comb.new
- @help_window.viewport = @viewport
- @category_window.y = @help_window.height
- @category_window.set_handler(:cancel, method(:return_scene))
- end
- #--------------------------------------------------------------------------
- # * Criação da janela de itens
- #--------------------------------------------------------------------------
- def create_item_window
- @item_window = Window_ShowCombs.new
- @item_window.viewport = @viewport
- @category_window.item_window = @item_window
- end
- def update
- super
- unless @category_window.index == @get_index
- @item_window.refresh(@category_window.index)
- @get_index = @category_window.index
- end
- end
- #--------------------------------------------------------------------------
- # * Categoria [Confirmação]
- #--------------------------------------------------------------------------
- def on_category_ok
- @item_window.activate
- @item_window.select_last
- end
- #--------------------------------------------------------------------------
- # * Item [Confirmação]
- #--------------------------------------------------------------------------
- def on_item_ok
- $game_party.last_item.object = item
- determine_item
- end
- #--------------------------------------------------------------------------
- # * Item [Cancelamento]
- #--------------------------------------------------------------------------
- def on_item_cancel
- @item_window.unselect
- @category_window.activate
- end
- #--------------------------------------------------------------------------
- # * Execução de SE para o item
- #--------------------------------------------------------------------------
- def play_se_for_item
- Sound.play_use_item
- end
- #--------------------------------------------------------------------------
- # * Usando um item
- #--------------------------------------------------------------------------
- def use_item
- super
- @item_window.redraw_current_item
- end
- end
- #==============================================================================
- # ** Window_ItemCategory
- #------------------------------------------------------------------------------
- # Esta janela é usada para selecionar o tipo de item e equipamentos para
- # tela de itens ou lojas.
- #==============================================================================
- class Window_CombineList < Window_Command
- include Lune_Combine
- #--------------------------------------------------------------------------
- # * Variáveis públicas
- #--------------------------------------------------------------------------
- attr_reader :item_window
- #--------------------------------------------------------------------------
- # * Inicialização do objeto
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0)
- end
- #--------------------------------------------------------------------------
- # * Aquisição da largura da janela
- #--------------------------------------------------------------------------
- def window_width
- 150
- end
- def window_height
- Graphics.height - fitting_height(2)
- end
- #--------------------------------------------------------------------------
- # * Aquisição do número de colunas
- #--------------------------------------------------------------------------
- def col_max
- return 1
- end
- #--------------------------------------------------------------------------
- # * Atualização da tela
- #--------------------------------------------------------------------------
- def update
- super
- end
- #--------------------------------------------------------------------------
- # * Criação da lista de comandos
- #--------------------------------------------------------------------------
- def make_command_list
- for i in 0...Combination.size
- case Combination[i]['Res Type']
- when 1
- command = $data_items[Combination[i]['Result Item']]
- when 2
- command = $data_weapons[Combination[i]['Result Item']]
- when 3
- command = $data_armors[Combination[i]['Result Item']]
- end
- add_command(command.name, nil)
- end
- end
- #--------------------------------------------------------------------------
- # * Definição da janela de itens
- # item_window : janela de itens
- #--------------------------------------------------------------------------
- def item_window=(item_window)
- @item_window = item_window
- update
- end
- end
- #==============================================================================
- # ** Window_ShowCombs
- #------------------------------------------------------------------------------
- # Esta janela exibe a quantia de dinheiro.
- #==============================================================================
- class Window_ShowCombs < Window_Base
- include Lune_Combine
- #--------------------------------------------------------------------------
- # * Inicialização do objeto
- #--------------------------------------------------------------------------
- def initialize
- super(150, fitting_height(2), Graphics.width - 150, Graphics.height - fitting_height(2))
- refresh(0)
- end
- def draw_horz_line(y)
- line_y = y + line_height / 2 - 1
- contents.fill_rect(0, line_y, contents_width, 2, line_color)
- end
- #--------------------------------------------------------------------------
- # * Aquisição da largura da janela
- #--------------------------------------------------------------------------
- def window_width
- end
- def line_color
- color = normal_color
- color.alpha = 48
- color
- end
- #--------------------------------------------------------------------------
- # * Renovação
- #--------------------------------------------------------------------------
- def refresh(index)
- contents.clear
- contents.font.color.set(250, 55, 50)
- draw_text(0, 0, 140, 50, "Necessary", 0)
- draw_text(0, 30, 140, 50, "Items", 0)
- Combination[index]['Itens ID'].size == 1 ? (y = 30) : (y = 0)
- draw_horz_line(Combination[index]['Itens ID'].size * 30 + y)
- contents.font.color.set(normal_color)
- for i in 0...Combination[index]['Itens ID'].size
- case Combination[index]['Itens Types'][i]
- when 1
- command = $data_items[Combination[index]['Itens ID'][i]]
- when 2
- command = $data_weapons[Combination[index]['Itens ID'][i]]
- when 3
- command = $data_armors[Combination[index]['Itens ID'][i]]
- end
- draw_icon(command.icon_index, 150, i*30 + 10)
- draw_text(175, i * 30, 160, fitting_height(1), command.name, 0)
- draw_text(330, i * 30, 160, fitting_height(1), "X", 0)
- draw_text(350, i * 30, 160, fitting_height(1), Combination[index]['Quantity'][i], 0)
- end
- y = Combination[index]['Itens ID'].size * 30 + y + 20
- contents.font.color.set(50, 255, 50)
- draw_text(0, y, 140, 50, "Obtained", 0)
- draw_text(0, y + 30, 140, 50, "Items", 0)
- contents.font.color.set(normal_color)
- case Combination[index]['Res Type']
- when 1
- command = $data_items[Combination[index]['Result Item']]
- when 2
- command = $data_weapons[Combination[index]['Result Item']]
- when 3
- command = $data_armors[Combination[index]['Result Item']]
- end
- draw_icon(command.icon_index, 150, y + 10)
- draw_text(175, y, 160, fitting_height(1), command.name, 0)
- draw_text(330, y, 160, fitting_height(1), "X", 0)
- draw_text(350, y, 160, fitting_height(1), Combination[index]['ResQuantity'], 0)
- end
- def open
- refresh
- super
- end
- end
- #==============================================================================
- # ** Window_Gold
- #------------------------------------------------------------------------------
- # Esta janela exibe a quantia de dinheiro.
- #==============================================================================
- class Window_Help_Comb < Window_Base
- include Lune_Combine
- #--------------------------------------------------------------------------
- # * Inicialização do objeto
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, Graphics.width, fitting_height(2))
- draw_text(0, - 15, Graphics.width, fitting_height(1), Text_comb1, 0)
- draw_text(0, 15, Graphics.width, fitting_height(1), Text_comb2, 0)
- end
- end
- #==============================================================================
- # ** Scene_Menu
- #------------------------------------------------------------------------------
- # Esta classe executa o processamento da tela de menu.
- #==============================================================================
- if Lune_Combine::Craft_Menu
- class Scene_Menu < Scene_MenuBase
- def create_command_window
- @command_window = Window_MenuCommand.new
- @command_window.set_handler(:item, method(:command_item))
- @command_window.set_handler(:skill, method(:command_personal))
- @command_window.set_handler(:equip, method(:command_personal))
- @command_window.set_handler(:status, method(:command_personal))
- @command_window.set_handler(:elements, method(:command_craft))
- @command_window.set_handler(:formation, method(:command_formation))
- @command_window.set_handler(:save, method(:command_save))
- @command_window.set_handler(:game_end, method(:command_game_end))
- @command_window.set_handler(:cancel, method(:return_scene))
- end
- def command_craft
- SceneManager.call(Scene_LuneCraft)
- end
- end
- #==============================================================================
- # ** Window_MenuCommand
- #------------------------------------------------------------------------------
- # Esta janela exibe os comandos do menu.
- #==============================================================================
- class Window_MenuCommand < Window_Command
- alias raizen_add_main_commands add_main_commands
- def add_main_commands
- raizen_add_main_commands
- add_command(Lune_Combine::Craft, :elements, main_commands_enabled)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement