赞 | 35 |
VIP | 0 |
好人卡 | 72 |
积分 | 62 |
经验 | 38967 |
最后登录 | 2025-7-20 |
在线时间 | 1458 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 6240
- 在线时间
- 1458 小时
- 注册时间
- 2015-7-25
- 帖子
- 617
 
|
根据楼主给出的菜单要求↓
效果图:
脚本↓
module MFXRB ITEM = "ITEM" SKILL= "MAGIC" EQUIP= "EQI" SAVE = "SAVE" GEND = "SHUT DOWN" SAVETEXT="CONTINUE" FILE = "DATA" FH = "☆" FHF = "△" end module DataManager def self.make_save_header header = {} header[:characters] = $game_party.characters_for_savefile header[:playtime_s] = $game_system.playtime_s header[:map] = $game_map.display_name header[:lv] = $game_party.leader.level header[:hp] = $game_party.leader.hp header[:face] = $game_party.face_for_savefile header end end class Game_Party < Game_Unit def face_for_savefile battle_members.collect do |actor| [actor.face_name, actor.face_index] end end end 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(:save, method(:command_save)) @command_window.set_handler(:game_end, method(:command_game_end)) @command_window.set_handler(:cancel, method(:return_scene)) end end class Window_MenuCommand < Window_Command def make_command_list add_main_commands add_original_commands add_save_command add_game_end_command end def add_main_commands add_command(MFXRB::FH+MFXRB::ITEM, :item, main_commands_enabled) add_command(MFXRB::FH+MFXRB::SKILL, :skill, main_commands_enabled) add_command(MFXRB::FH+MFXRB::EQUIP, :equip, main_commands_enabled) end def add_save_command add_command(MFXRB::FH+MFXRB::SAVE, :save, save_enabled) end def add_game_end_command add_command(MFXRB::FH+MFXRB::GEND, :game_end) end end class Window_MenuStatus < Window_Selectable 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_face(actor, rect.x + 1, rect.y + 1, enabled) draw_actor_name(actor, rect.x + 100, rect.y + 1) draw_actor_class(actor, rect.x + 250, rect.y + 1) draw_actor_level(actor, rect.x + 100, rect.y + line_height) d_a_zt(actor,rect.x + 180, rect.y + line_height) d_ah(actor, rect.x + 240, rect.y + line_height) d_aexp(actor, rect.x + 100, rect.y + line_height*2) d_am(actor, rect.x + 240, rect.y + line_height*2) end end class Window_Base < Window def d_a_zt(actor,x,y,width=100) draw_text_ex(x,y,if actor.dead?;"死亡";else "正常";end) end def d_ah(actor, x, y) draw_text(x, y, 30, line_height, Vocab::hp_a) draw_text(x + 35, y, 100, line_height, actor.hp.to_s+"/"+actor.mhp.to_s) end def d_am(actor, x, y, width = 124) draw_text(x, y, 30, line_height, Vocab::mp_a) draw_text(x + 35, y, 100, line_height, actor.mp.to_s+"/"+actor.mmp.to_s) end def d_aexp(actor, x, y, width = 124) s1 = actor.max_level? ? "-------" : actor.exp s2 = actor.max_level? ? "-------" : actor.next_level_exp - actor.exp draw_text(x, y, 30, line_height, "E") draw_text(x + 35, y, 100, line_height, s1.to_s+"/"+s2.to_s) end end class Scene_File < Scene_MenuBase def visible_max return 3 end end class Scene_Save < Scene_File def help_window_text MFXRB::FH+MFXRB::SAVETEXT+MFXRB::FH end end class Window_SaveFile < Window_Base def refresh contents.clear change_color(normal_color) name = MFXRB::FHF+MFXRB::FILE + " #{@file_index + 1}" draw_text(4, 0, 200, line_height, name) @name_width = text_size(name).width draw_party_face(140, y) draw_map(-490, y + line_height) draw_lv(-490, y + line_height*2) draw_shp(-400, y + line_height*2) end def draw_map(x, y) header = DataManager.load_header(@file_index) return unless header draw_text(x, y, width, line_height, header[:map], 2) end def draw_lv(x, y) header = DataManager.load_header(@file_index) return unless header draw_text(x, y, width, line_height, "LV "+header[:lv].to_s, 2) end def draw_shp(x, y) header = DataManager.load_header(@file_index) return unless header draw_text(x, y, width, line_height, "HP "+header[:hp].to_s, 2) end def draw_party_face(x, y) header = DataManager.load_header(@file_index) return unless header && header[:face] header[:face].each_with_index do |data, i| draw_face(data[0], data[1], x + i * 96, y) end end end
module MFXRB
ITEM = "ITEM"
SKILL= "MAGIC"
EQUIP= "EQI"
SAVE = "SAVE"
GEND = "SHUT DOWN"
SAVETEXT="CONTINUE"
FILE = "DATA"
FH = "☆"
FHF = "△"
end
module DataManager
def self.make_save_header
header = {}
header[:characters] = $game_party.characters_for_savefile
header[:playtime_s] = $game_system.playtime_s
header[:map] = $game_map.display_name
header[:lv] = $game_party.leader.level
header[:hp] = $game_party.leader.hp
header[:face] = $game_party.face_for_savefile
header
end
end
class Game_Party < Game_Unit
def face_for_savefile
battle_members.collect do |actor|
[actor.face_name, actor.face_index]
end
end
end
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(:save, method(:command_save))
@command_window.set_handler(:game_end, method(:command_game_end))
@command_window.set_handler(:cancel, method(:return_scene))
end
end
class Window_MenuCommand < Window_Command
def make_command_list
add_main_commands
add_original_commands
add_save_command
add_game_end_command
end
def add_main_commands
add_command(MFXRB::FH+MFXRB::ITEM, :item, main_commands_enabled)
add_command(MFXRB::FH+MFXRB::SKILL, :skill, main_commands_enabled)
add_command(MFXRB::FH+MFXRB::EQUIP, :equip, main_commands_enabled)
end
def add_save_command
add_command(MFXRB::FH+MFXRB::SAVE, :save, save_enabled)
end
def add_game_end_command
add_command(MFXRB::FH+MFXRB::GEND, :game_end)
end
end
class Window_MenuStatus < Window_Selectable
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_face(actor, rect.x + 1, rect.y + 1, enabled)
draw_actor_name(actor, rect.x + 100, rect.y + 1)
draw_actor_class(actor, rect.x + 250, rect.y + 1)
draw_actor_level(actor, rect.x + 100, rect.y + line_height)
d_a_zt(actor,rect.x + 180, rect.y + line_height)
d_ah(actor, rect.x + 240, rect.y + line_height)
d_aexp(actor, rect.x + 100, rect.y + line_height*2)
d_am(actor, rect.x + 240, rect.y + line_height*2)
end
end
class Window_Base < Window
def d_a_zt(actor,x,y,width=100)
draw_text_ex(x,y,if actor.dead?;"死亡";else "正常";end)
end
def d_ah(actor, x, y)
draw_text(x, y, 30, line_height, Vocab::hp_a)
draw_text(x + 35, y, 100, line_height, actor.hp.to_s+"/"+actor.mhp.to_s)
end
def d_am(actor, x, y, width = 124)
draw_text(x, y, 30, line_height, Vocab::mp_a)
draw_text(x + 35, y, 100, line_height, actor.mp.to_s+"/"+actor.mmp.to_s)
end
def d_aexp(actor, x, y, width = 124)
s1 = actor.max_level? ? "-------" : actor.exp
s2 = actor.max_level? ? "-------" : actor.next_level_exp - actor.exp
draw_text(x, y, 30, line_height, "E")
draw_text(x + 35, y, 100, line_height, s1.to_s+"/"+s2.to_s)
end
end
class Scene_File < Scene_MenuBase
def visible_max
return 3
end
end
class Scene_Save < Scene_File
def help_window_text
MFXRB::FH+MFXRB::SAVETEXT+MFXRB::FH
end
end
class Window_SaveFile < Window_Base
def refresh
contents.clear
change_color(normal_color)
name = MFXRB::FHF+MFXRB::FILE + " #{@file_index + 1}"
draw_text(4, 0, 200, line_height, name)
@name_width = text_size(name).width
draw_party_face(140, y)
draw_map(-490, y + line_height)
draw_lv(-490, y + line_height*2)
draw_shp(-400, y + line_height*2)
end
def draw_map(x, y)
header = DataManager.load_header(@file_index)
return unless header
draw_text(x, y, width, line_height, header[:map], 2)
end
def draw_lv(x, y)
header = DataManager.load_header(@file_index)
return unless header
draw_text(x, y, width, line_height, "LV "+header[:lv].to_s, 2)
end
def draw_shp(x, y)
header = DataManager.load_header(@file_index)
return unless header
draw_text(x, y, width, line_height, "HP "+header[:hp].to_s, 2)
end
def draw_party_face(x, y)
header = DataManager.load_header(@file_index)
return unless header && header[:face]
header[:face].each_with_index do |data, i|
draw_face(data[0], data[1], x + i * 96, y)
end
end
end
|
|