赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 2861 |
最后登录 | 2017-6-18 |
在线时间 | 42 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 42 小时
- 注册时间
- 2016-11-27
- 帖子
- 30
|
5楼
楼主 |
发表于 2017-4-16 15:55:15
|
只看该作者
- #==============================================================================
- # Simple Menu by VitorJ (http://vjrgss.blogspot.com/)
- #-Funcao-----------------------------------------------------------------------
- # Modifica o menu padrao.
- #-Nome do mapa-----------------------------------------------------------------
- # O nome que aparecera na area de nome do mapa sera o nome escolhido para
- # exibicao, caso nao tenha um, ele ira procurar o seguinte comando na nota do
- # mapa: <mname>Nome do Mapa</mname>
- # Onde o nome do mapa deve ser posto, nao e necessario estar entre aspas.
- #==============================================================================
- module VJSM
- Icons = []
- #Icones para as opcoes
- Icons[0] = 12 #物品
- Icons[1] = 4 #技能
- Icons[2] = 9 #装备
- Icons[3] = 5 #状态
- Icons[4] = 15 #队伍
- Icons[5] = 13 #数据
- Icons[6] = 6 #设置
- ##
- Next = "下一等级" #Proximo level
- Gold_Icon = 117 #Icone do gold
- PlayTime_Icon = 49 #Icone do tempo de jogo
- Map_Icon = 83 #Icone do mapa atual
- File = "存档" #Opзгo de file
- end
- class Window_MenuStatus < Window_Selectable
- attr_reader :pending_index
- def initialize(x, y)
- super(x, y, window_width, window_height)
- self.windowskin = Cache.system("Window_Menu")
- @pending_index = -1
- refresh
- end
- def window_width
- Graphics.width
- end
- def window_height
- Graphics.height - 96
- end
- def item_max
- $game_party.members.size
- end
- def col_max
- return 2
- end
- def item_height
- (height - standard_padding * 2) / 2
- end
- def draw_item(index)
- actor = $game_party.members[index]
- enabled = $game_party.battle_members.include?(actor)
- rect = item_rect(index)
- draw_item_background(index)
- draw_actor_name(actor, rect.x+1, rect.y+1)
- draw_actor_face(actor, rect.x+1, rect.y+1 + line_height, enabled)
- draw_actor_class(actor, rect.x+1, (rect.y+rect.height) - (line_height+1))
- draw_actor_level(actor, rect.x+98+16, rect.y+1)
- draw_exp_info(actor, rect.x+98+16, rect.y + line_height)
- draw_actor_hp(actor, rect.x+98+16, rect.y + line_height * 2)
- draw_actor_mp(actor, rect.x+98+16, rect.y + line_height * 3)
- draw_actor_icons(actor, rect.x+98+16, rect.y + line_height * 4)
- end
- def draw_actor_icons(actor, x, y, width = 128)
- icons = (actor.state_icons + actor.buff_icons)
- i = 0
- icons.each do |icon|
- ix = x+(i*24)
- iy = y+(0)
- if i >= 5
- ix = x+((i-5)*24)
- iy = y+(24)
- end
- draw_icon(icon, ix, iy)
- i+= 1
- end
- end
- def draw_exp_info(actor, x, y)
- s2 = actor.max_level? ? "-------" : actor.next_level_exp - actor.exp
- s_next = VJSM::Next
- change_color(system_color)
- draw_text(x, y, 128, line_height, s_next)
- change_color(normal_color)
- draw_text(x, y, 128, line_height, s2, 2)
- end
- def draw_item_background(index)
- if index == @pending_index
- contents.fill_rect(item_rect(index), pending_color)
- end
- end
- def process_ok
- super
- $game_party.menu_actor = $game_party.members[index]
- end
- def select_last
- select($game_party.menu_actor.index || 0)
- end
- def pending_index=(index)
- last_pending_index = @pending_index
- @pending_index = index
- redraw_item(@pending_index)
- redraw_item(last_pending_index)
- end
- end
- class Window_NewMenuStatus < Window_Base
- def initialize(actor)
- super(0, 0, Graphics.width - 160, 120)
- @actor = actor
- refresh
- end
- def set_actor(actor)
- return if actor == @actor
- @actor = actor
- refresh
- end
- def refresh
- contents.clear
- actor = @actor
- enabled = $game_party.battle_members.include?(actor)
- draw_actor_face(actor,1, 1, enabled)
- draw_actor_simple_status(actor, 108, line_height / 2)
- end
- end
- class Window_Time < Window_Base
- def initialize(x,y)
- super(x, y, Graphics.width/3, 48)
- refresh
- end
- def update
- refresh
- end
- def refresh
- contents.clear
- playtime = $game_system.playtime_s
- draw_icon(VJSM::PlayTime_Icon, 0, 0)
- change_color(normal_color) #(normal_color) #CHANGED1
- draw_text(0, 0, self.contents.width, line_height, playtime, 2)
- end
- end
- class Window_MenuGold < Window_Base
- def initialize(x,y)
- super(x, y, Graphics.width/3, 48)
- refresh
- end
- def refresh
- contents.clear
- gold = $game_party.gold
- draw_icon(VJSM::Gold_Icon, 0, 0)
- change_color(normal_color)
- draw_text(0, 0, self.contents.width, line_height, gold, 2)
- end
- end
- class Window_MenuMapName < Window_Base
- def initialize(x,y)
- super(x, y, (Graphics.width/3)*2, 48)
- refresh
- end
- def refresh
- contents.clear
- if $game_map.display_name.empty?
- map_a = load_data(sprintf("Data/Map%03d.rvdata2", $game_map.map_id))
- note = map_a.note.split("\r\n")
- text = "No Data"
- note.each do |thing|
- if thing.include?("<mname>")
- text = thing
- text.slice!("<mname>")
- text.slice!("</mname>")
- end
- end
- map = text
- else
- map = $game_map.display_name
- end
- change_color(normal_color)
- draw_icon(VJSM::Map_Icon, 0, 0)
- draw_text(0, 0, self.contents.width, line_height, map, 2)
- end
- end
- class Window_Command_Name < Window_Base
- def initialize(text,w=171)
- super(0, 0, w, 48)
- self.windowskin = Cache.system("Window_Menu") #tip1
- @text = text
- refresh
- end
- def refresh
- contents.clear
- draw_text(0, 0, self.contents.width, self.contents.height, @text, 1)
- end
- def set_text(text)
- return if text == @text
- @text = text
- refresh
- end
- end
- class Window_MenuFile < Window_Command
- def initialize
- super(0, 0)
- update_placement
- end
- def window_width
- return 160
- end
- def update_placement
- self.x = (Graphics.width - width) / 2
- self.y = (Graphics.height - height) / 2
- end
- def make_command_list
- add_command(Vocab::save, :save, save_enabled)
- add_command(Vocab::continue, :continue)
- add_command(Vocab::cancel, :cancel)
- end
- def save_enabled
- !$game_system.save_disabled
- end
- end
- class Window_MenuCommand < Window_Command
- def self.init_command_position
- @@last_command_symbol = nil
- end
- def initialize
- super(0, 0)
- self.windowskin = Cache.system("Window_Menu") #tip2
- select_last
- end
- def item_rect(index)
- rect = Rect.new
- rect.width = item_width
- rect.height = item_height
- rect.x = index % col_max * item_width
- rect.y = index / col_max * item_height
- rect
- end
- def item_width
- return 24
- end
- def window_width
- return 192
- end
- def window_height
- return 48
- end
- def col_max
- return 8
- end
- def visible_line_number
- item_max
- end
- def make_command_list
- add_main_commands
- add_formation_command
- add_original_commands
- add_save_command
- add_game_end_command
- end
- def draw_item(index)
- x = item_rect(index).x
- y = item_rect(index).y
- draw_icon(VJSM::Icons[index], x, y, command_enabled?(index))
- end
- def add_main_commands
- add_command(Vocab::item, :item, main_commands_enabled)
- add_command(Vocab::skill, :skill, main_commands_enabled)
- add_command(Vocab::equip, :equip, main_commands_enabled)
- add_command(Vocab::status, :status, main_commands_enabled)
- end
- def add_formation_command
- add_command(Vocab::formation, :formation, formation_enabled)
- end
- def get_name(index)
- return command_name(index)
- end
- def add_original_commands
- end
- def add_save_command
- add_command(VJSM::File, :file)
- end
- def add_game_end_command
- add_command(Vocab::game_end, :game_end)
- end
- def main_commands_enabled
- $game_party.exists
- end
- def formation_enabled
- $game_party.members.size >= 2 && !$game_system.formation_disabled
- end
- def save_enabled
- !$game_system.save_disabled
- end
- def process_ok
- @@last_command_symbol = current_symbol
- super
- end
- def select_last
- select_symbol(@@last_command_symbol)
- end
- end
- class Scene_Menu < Scene_MenuBase
- #--------------------------------------------------------------------------
- # * Inicializaзгo do processo
- #--------------------------------------------------------------------------
- def start
- super
- create_command_window
- create_gold_window
- create_status_window
- create_time_window
- create_map_window
- end
- #--------------------------------------------------------------------------
- # * Criaзгo da janela de comando
- #--------------------------------------------------------------------------
- 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(:formation, method(:command_formation))
- @command_window.set_handler(:file, method(:command_save))
- @command_window.set_handler(:game_end, method(:command_game_end))
- @command_window.set_handler(:cancel, method(:return_scene))
- @command_window.y = 0
- @command_window.x = 0
- @command_name = Window_Command_Name.new(@command_window.get_name(@command_window.index))
- @command_name.y = @command_window.y
- @command_name.x = @command_window.x + @command_window.width
- end
- #--------------------------------------------------------------------------
- # * Criaзгo da janela de dinheiro
- #--------------------------------------------------------------------------
- def create_gold_window
- x = @command_name.x + @command_name.width
- y = @command_name.y
- @gold_window = Window_MenuGold.new(x,y)
- end
- #--------------------------------------------------------------------------
- # * Criaзгo da janela de atributos
- #--------------------------------------------------------------------------
- def create_status_window
- x = @command_window.x
- y = @command_window.y + @command_window.height
- @status_window = Window_MenuStatus.new(x, y)
- end
- def create_time_window
- y = @status_window.y + @status_window.height
- x = 0
- @window_time = Window_Time.new(x,y)
- end
- def create_map_window
- y = @window_time.y
- x = @window_time.x + @window_time.width
- @window_map = Window_MenuMapName.new(x,y)
- end
- def update
- update_basic
- @command_name.set_text(@command_window.get_name(@command_window.index))
- end
- #--------------------------------------------------------------------------
- # * Comando [Item]
- #--------------------------------------------------------------------------
- def command_item
- SceneManager.call(Scene_Item)
- end
- #--------------------------------------------------------------------------
- # * Comando [Habilidade] [Equipamentos] [Atributos]
- #--------------------------------------------------------------------------
- def command_personal
- @status_window.select_last
- @status_window.activate
- @status_window.set_handler(:ok, method(:on_personal_ok))
- @status_window.set_handler(:cancel, method(:on_personal_cancel))
- end
- #--------------------------------------------------------------------------
- # * Comando [Formaзгo]
- #--------------------------------------------------------------------------
- def command_formation
- @status_window.select_last
- @status_window.activate
- @status_window.set_handler(:ok, method(:on_formation_ok))
- @status_window.set_handler(:cancel, method(:on_formation_cancel))
- end
- #--------------------------------------------------------------------------
- # * Comando [Salvar]
- #--------------------------------------------------------------------------
- def command_save
- SceneManager.call(Scene_Save)
- end
- #--------------------------------------------------------------------------
- # * Comando [Fim do Jogo]
- #--------------------------------------------------------------------------
- def command_game_end
- SceneManager.call(Scene_End)
- end
- #--------------------------------------------------------------------------
- # * Comandos individuais [Confirmaзгo]
- #--------------------------------------------------------------------------
- def on_personal_ok
- case @command_window.current_symbol
- when :skill
- SceneManager.call(Scene_Skill)
- when :equip
- SceneManager.call(Scene_Equip)
- when :status
- SceneManager.call(Scene_Status)
- end
- end
- #--------------------------------------------------------------------------
- # * Comandos individuais [Cancelamento]
- #--------------------------------------------------------------------------
- def on_personal_cancel
- @status_window.unselect
- @command_window.activate
- end
- #--------------------------------------------------------------------------
- # * Mudanзa de Ordem [Confirmaзгo]
- #--------------------------------------------------------------------------
- def on_formation_ok
- if @status_window.pending_index >= 0
- $game_party.swap_order(@status_window.index,
- @status_window.pending_index)
- @status_window.pending_index = -1
- @status_window.redraw_item(@status_window.index)
- else
- @status_window.pending_index = @status_window.index
- end
- @status_window.activate
- end
- #--------------------------------------------------------------------------
- # * Mudanзa de Ordem [Cancelamento]
- #--------------------------------------------------------------------------
- def on_formation_cancel
- if @status_window.pending_index >= 0
- @status_window.pending_index = -1
- @status_window.activate
- else
- @status_window.unselect
- @command_window.activate
- end
- end
- end
复制代码 |
|