赞 | 2 |
VIP | 0 |
好人卡 | 0 |
积分 | 11 |
经验 | 8458 |
最后登录 | 2023-6-27 |
在线时间 | 140 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 1080
- 在线时间
- 140 小时
- 注册时间
- 2008-7-1
- 帖子
- 149
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
求救!!我想把这个菜单拦加多4个功能,加多保存功能,读取功能,调整队伍位置功能与加滚动栏出来
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs menu screen processing.
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make command window
s1 = "物品使用"
s2 = "特殊技能"
s3 = "武器装备"
s4 = "目标行动"
s5 = "人物档案"
s6 = "操作说明"
s7 = "结束游戏"
@command_window = Window_Command.new(120, [s1, s2, s3, s4, s5, s6, s7])
@command_window.x=472
@command_window.y=48 #空出96/2=48
@command_window.index = @menu_index
# If number of party members is 0
if $game_party.actors.size == 0
# Disable items, skills, equipment, and status
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(4)
end
if $game_party.actors.size <= 1
@command_window.disable_item(5)
end
# If save is forbidden
if $game_system.save_disabled
# Disable save
@command_window.disable_item(5)
end
# Make play time window
#@playtime_window = Window_PlayTime.new
#@playtime_window.x = 0
#@playtime_window.y = 256
# Make Mapname window
@steps_window = Window_Steps.new
@steps_window.x = 472
@steps_window.y = 304
# Make gold window
#@gold_window = Window_Gold.new
#@gold_window.x = 0
#@gold_window.y = 416
# Make status window
@status_window = Window_MenuStatus.new
@status_window.x = 48
@status_window.y = 48
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@command_window.dispose
#@playtime_window.dispose
@steps_window.dispose
#@gold_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
#@playtime_window.update
@steps_window.update
#@gold_window.update
@status_window.update
# If command window is active: call update_command
if @command_window.active
update_command
return
end
# If status window is active: call update_status
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If command other than save or end game, and party members = 0
if $game_party.actors.size == 0 and @command_window.index < 5
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
elsif $game_party.actors.size <= 1 and @command_window.index ==3
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Branch by command window cursor position
case @command_window.index
when 0 # item
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 1 # skill
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3 # Tactics
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to end game screen
$scene = Scene_Mession.new
when 5 # 帮助
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 切换到说明画面
$scene = Scene_Gamehelp.new
when 6 # end game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to end game screen
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Make command window active
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # Item
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to equipment screen
$scene = Scene_Item.new(@status_window.index)
when 1 # skill
# If this actor's action limit is 2 or more
if $game_party.actors[@status_window.index].restriction >= 2
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to skill screen
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to equipment screen
$scene = Scene_Equip.new(@status_window.index)
when 3 # tactics
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to status screen
$scene = Scene_Tactics.new(@status_window.index)
end
return
end
end
end
此贴于 2008-11-22 10:46:25 被版主darkten提醒,请楼主看到后对本贴做出回应。
先说明我的是ARPG来的,可以弄很多个成员加入
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
# This window displays party member status on the menu screen.
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 424, 475)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 116
actor = $game_party.actors
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 86, y)
draw_actor_level(actor, x, y + 32)
draw_actor_state(actor, x + 90, y + 32)
draw_actor_exp(actor, x, y + 64, 150)
draw_actor_hp(actor, x-56 + 236, y + 32)
draw_actor_sp(actor, x + 236-56, y + 64)
end
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
end
此贴于 2008-11-24 13:44:35 被版主darkten提醒,请楼主看到后对本贴做出回应。 此贴于 2008-11-26 15:21:29 被版主darkten提醒,请楼主看到后对本贴做出回应。 此贴于 2008-11-27 13:41:22 被版主darkten提醒,请楼主看到后对本贴做出回应。 此贴于 2008-11-28 12:47:17 被版主darkten提醒,请楼主看到后对本贴做出回应。 |
|