赞 | 1 |
VIP | 1 |
好人卡 | 0 |
积分 | 4 |
经验 | 10487 |
最后登录 | 2024-10-12 |
在线时间 | 170 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 419
- 在线时间
- 170 小时
- 注册时间
- 2012-7-28
- 帖子
- 29
|
3楼
楼主 |
发表于 2014-10-12 23:18:17
|
只看该作者
永燃的狂炎 发表于 2014-10-12 22:45
兄弟,秀秀脚本. . . . . .
#encoding:utf-8
#==============================================================================
# ■ Window_MenuStatus
#------------------------------------------------------------------------------
# 菜单画面中,显示队伍成员状态的窗口
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_reader :pending_index # 保留位置(整队用)
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, window_width, window_height)
@pending_index = -1
refresh
end
=begin
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
Graphics.width - 160
end
#--------------------------------------------------------------------------
# ● 获取窗口的高度
#--------------------------------------------------------------------------
def window_height
Graphics.height
end
=end
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
#Graphics.height
Graphics.width - 136
end
#--------------------------------------------------------------------------
# ● 获取窗口的高度
#--------------------------------------------------------------------------
def window_height
Graphics.height - 96
end
#--------------------------------------------------------------------------
# ● 获取项目数
#--------------------------------------------------------------------------
def item_max
$game_party.battle_members.size#$game_party.members.size
end
#--------------------------------------------------------------------------
# ● 绘制项目
#--------------------------------------------------------------------------
def draw_item(index)
#draw_vert_line(384)
#if index < 5
#col_max = 3
actor = $game_party.battle_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 + 108, rect.y + line_height / 2)
draw_actor_name(actor, rect.x + 1, rect.y + 72)
#else
#col_max = 1
#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 + 424, rect.y + 1, enabled)
#draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)
#draw_actor_name(actor, rect.x + 1 + 424, rect.y + 72)
#end
#↓-----------------------------------------------------------------------
#draw_text(x, y, width, line_height, $game_party.quname(index))
#↑-----------------------------------------------------------------------
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
#↓-------------------------------------------------------------------------
# ● 获取列数
#--------------------------------------------------------------------------
def col_max
return 3 #跟据分辨率的不同可以改
end
#--------------------------------------------------------------------------
# ● 获取项目的高度
#--------------------------------------------------------------------------
def item_height
window_height / 3
end
#--------------------------------------------------------------------------
# ● 绘制水平线
#--------------------------------------------------------------------------
#def draw_vert_line(x)
#line_x = x
#contents.fill_rect(x, 0, 2, Graphics.height - 96, line_color)
#end
#--------------------------------------------------------------------------
# ● 获取水平线的颜色
#--------------------------------------------------------------------------
#def line_color
#color = normal_color
#color.alpha = 48
#color
#end
#↑---------------------------------------------------------------------------
end
---------------------------------------------------------------------------------------------------------
分割线,以上是原始窗口的修改,以下是复制原始窗口脚本后修改出来的
---------------------------------------------------------------------------------------------------------
#encoding:utf-8
#==============================================================================
# ■ Window_MenuStatus
#------------------------------------------------------------------------------
# 菜单画面中,显示队伍成员状态的窗口
#==============================================================================
class Window_MenuStatusII < Window_Selectable
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_reader :pending_index # 保留位置(整队用)
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, window_width, window_height)
@pending_index = -1
refresh
end
=begin
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
Graphics.width - 160
end
#--------------------------------------------------------------------------
# ● 获取窗口的高度
#--------------------------------------------------------------------------
def window_height
Graphics.height
end
=end
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
#Graphics.height
136
end
#--------------------------------------------------------------------------
# ● 获取窗口的高度
#--------------------------------------------------------------------------
def window_height
Graphics.height - 96
end
#--------------------------------------------------------------------------
# ● 获取项目数
#--------------------------------------------------------------------------
def item_max
$game_party.unbattle_members.size#$game_party.members.size
end
#--------------------------------------------------------------------------
# ● 绘制项目
#--------------------------------------------------------------------------
def draw_item(index)
#draw_vert_line(Graphics.width - 160)
actor = $game_party.unbattle_members[index]#$game_party.members
#actor = $game_party.quldr[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 + 108, rect.y + line_height / 2)
draw_actor_name(actor, rect.x + 1, rect.y + 72)
#↓-----------------------------------------------------------------------
#draw_text(x, y, width, line_height, $game_party.quname(index))
#↑-----------------------------------------------------------------------
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
#↓-------------------------------------------------------------------------
# ● 获取列数
#--------------------------------------------------------------------------
def col_max
return 1 #跟据分辨率的不同可以改
end
#--------------------------------------------------------------------------
# ● 获取项目的高度
#--------------------------------------------------------------------------
def item_height
window_height / 3
end
#↑---------------------------------------------------------------------------
end
-------------------------------------------------------------------------------------------------------------
下面是在Scene_Menu中调用双窗口的部分
-------------------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------
# ● 生成状态窗口
#--------------------------------------------------------------------------
def create_status_window
@status_window = Window_MenuStatus.new(0, 48)
@status_windowII = Window_MenuStatusII.new(408, 48)
#@status_window = Window_MenuStatus.new(@command_window.width, 0)
end
|
|