赞 | 7 |
VIP | 0 |
好人卡 | 3 |
积分 | 13 |
经验 | 35360 |
最后登录 | 2024-12-21 |
在线时间 | 821 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 1276
- 在线时间
- 821 小时
- 注册时间
- 2013-8-3
- 帖子
- 458
|
200星屑
原脚本改了一下状态栏出现两个问题:
1.整队后数据重叠
2.角色状态栏显示变成阶梯往下跑了
请大佬帮忙修改
#encoding:utf-8 #============================================================================== # ■ Window_MenuStatus #------------------------------------------------------------------------------ # 菜单画面中,显示队伍成员状态的窗口 #============================================================================== class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # ● 定义实例变量 #-------------------------------------------------------------------------- attr_reader :pending_index # 保留位置(整队用) #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize(x, y) super(x-160, y+300, window_width, window_height) @pending_index = -1 refresh end #-------------------------------------------------------------------------- # ● 获取窗口的宽度 #-------------------------------------------------------------------------- def window_width Graphics.width end #-------------------------------------------------------------------------- # ● 获取窗口的高度 #-------------------------------------------------------------------------- def window_height Graphics.height - 300 end #-------------------------------------------------------------------------- # ● 获取列数 #-------------------------------------------------------------------------- def col_max return 4.2 end #-------------------------------------------------------------------------- # ● 获取项目数 #-------------------------------------------------------------------------- def item_max $game_party.members.size end #-------------------------------------------------------------------------- # ● 获取项目的高度 #-------------------------------------------------------------------------- def item_height (height - standard_padding * 2) / 4 end def draw_current_and_max_values(x, y, width, current, max, color1, color2) change_color(color1) xr = x + width if width < 96 draw_text(xr - 40, y, 42, line_height, current, 2) else draw_text(xr - 92, y, 42, line_height, current, 2) change_color(color2) draw_text(xr - 52, y, 12, line_height, "/", 2) draw_text(xr - 42, y, 42, line_height, max, 2) end end #-------------------------------------------------------------------------- # ● 绘制 HP #-------------------------------------------------------------------------- def draw_actor_hp(actor, x, y, width = 100) #draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2) change_color(normal_color) draw_text(x, y-2, 30, line_height, Vocab::hp_a) draw_current_and_max_values(x+15, y-2, width, actor.hp, actor.mhp, hp_color(actor), normal_color) draw_text(x, y-15, 30, line_height, "—") draw_text(x+20, y-15, 30, line_height, "—") draw_text(x+40, y-15, 30, line_height, "—") draw_text(x+60, y-15, 30, line_height, "—") draw_text(x+80, y-15, 30, line_height, "—") draw_text(x+100, y-15, 30, line_height, "—") end #-------------------------------------------------------------------------- # ● 绘制 MP #-------------------------------------------------------------------------- def draw_actor_mp(actor, x, y, width = 100) # draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2) change_color(normal_color) draw_text(x, y-2, 30, line_height, Vocab::mp_a) draw_current_and_max_values(x+15, y-2, width, actor.mp, actor.mmp, hp_color(actor), normal_color) end def draw_actor_simple_status(actor, x, y) contents.font.size = 20 draw_actor_name(actor, x, y-15) draw_actor_icons(actor, x, y + 50) draw_actor_level(actor, x+60, y+55) # draw_actor_class(actor, x, y) draw_actor_hp(actor, x, y + 10) draw_actor_mp(actor, x, y + 30) 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_face(actor, rect.x + 1, rect.y + 1, enabled) draw_actor_simple_status(actor, rect.x , rect.y + line_height / 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 class Window_MenuStatus < Window_Selectable attr_accessor :on_formation #-------------------------------------------------------------------------- # ● 按下确定键时的处理 #-------------------------------------------------------------------------- alias t_151116_process_ok process_ok def process_ok #~ if @on_formation && self.index == 0 if @on_formation && actor_now.id == 1 Sound.play_buzzer return end t_151116_process_ok end def actor_now return $game_party.members[self.index] end end #-------------------------------------------------------------------------- # ● 设置保留位置(整队用) #-------------------------------------------------------------------------- def pending_index=(index) last_pending_index = @pending_index @pending_index = index redraw_item(@pending_index) redraw_item(last_pending_index) end end
#encoding:utf-8
#==============================================================================
# ■ Window_MenuStatus
#------------------------------------------------------------------------------
# 菜单画面中,显示队伍成员状态的窗口
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_reader :pending_index # 保留位置(整队用)
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize(x, y)
super(x-160, y+300, window_width, window_height)
@pending_index = -1
refresh
end
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
Graphics.width
end
#--------------------------------------------------------------------------
# ● 获取窗口的高度
#--------------------------------------------------------------------------
def window_height
Graphics.height - 300
end
#--------------------------------------------------------------------------
# ● 获取列数
#--------------------------------------------------------------------------
def col_max
return 4.2
end
#--------------------------------------------------------------------------
# ● 获取项目数
#--------------------------------------------------------------------------
def item_max
$game_party.members.size
end
#--------------------------------------------------------------------------
# ● 获取项目的高度
#--------------------------------------------------------------------------
def item_height
(height - standard_padding * 2) / 4
end
def draw_current_and_max_values(x, y, width, current, max, color1, color2)
change_color(color1)
xr = x + width
if width < 96
draw_text(xr - 40, y, 42, line_height, current, 2)
else
draw_text(xr - 92, y, 42, line_height, current, 2)
change_color(color2)
draw_text(xr - 52, y, 12, line_height, "/", 2)
draw_text(xr - 42, y, 42, line_height, max, 2)
end
end
#--------------------------------------------------------------------------
# ● 绘制 HP
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 100)
#draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
change_color(normal_color)
draw_text(x, y-2, 30, line_height, Vocab::hp_a)
draw_current_and_max_values(x+15, y-2, width, actor.hp, actor.mhp,
hp_color(actor), normal_color)
draw_text(x, y-15, 30, line_height, "—")
draw_text(x+20, y-15, 30, line_height, "—")
draw_text(x+40, y-15, 30, line_height, "—")
draw_text(x+60, y-15, 30, line_height, "—")
draw_text(x+80, y-15, 30, line_height, "—")
draw_text(x+100, y-15, 30, line_height, "—")
end
#--------------------------------------------------------------------------
# ● 绘制 MP
#--------------------------------------------------------------------------
def draw_actor_mp(actor, x, y, width = 100)
# draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
change_color(normal_color)
draw_text(x, y-2, 30, line_height, Vocab::mp_a)
draw_current_and_max_values(x+15, y-2, width, actor.mp, actor.mmp,
hp_color(actor), normal_color)
end
def draw_actor_simple_status(actor, x, y)
contents.font.size = 20
draw_actor_name(actor, x, y-15)
draw_actor_icons(actor, x, y + 50)
draw_actor_level(actor, x+60, y+55)
# draw_actor_class(actor, x, y)
draw_actor_hp(actor, x, y + 10)
draw_actor_mp(actor, x, y + 30)
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_face(actor, rect.x + 1, rect.y + 1, enabled)
draw_actor_simple_status(actor, rect.x , rect.y + line_height / 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
class Window_MenuStatus < Window_Selectable
attr_accessor :on_formation
#--------------------------------------------------------------------------
# ● 按下确定键时的处理
#--------------------------------------------------------------------------
alias t_151116_process_ok process_ok
def process_ok
#~ if @on_formation && self.index == 0
if @on_formation && actor_now.id == 1
Sound.play_buzzer
return
end
t_151116_process_ok
end
def actor_now
return $game_party.members[self.index]
end
end
#--------------------------------------------------------------------------
# ● 设置保留位置(整队用)
#--------------------------------------------------------------------------
def pending_index=(index)
last_pending_index = @pending_index
@pending_index = index
redraw_item(@pending_index)
redraw_item(last_pending_index)
end
end
|
最佳答案
查看完整内容
#encoding:utf-8
#==============================================================================
# ■ Window_MenuStatus
#------------------------------------------------------------------------------
# 菜单画面中,显示队伍成员状态的窗口
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------- ...
|