赞 | 9 |
VIP | 0 |
好人卡 | 3 |
积分 | 45 |
经验 | 57973 |
最后登录 | 2024-10-12 |
在线时间 | 1053 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 4481
- 在线时间
- 1053 小时
- 注册时间
- 2013-3-28
- 帖子
- 390
|
本帖最后由 陈大帅帅帅哥 于 2016-2-18 20:31 编辑
class Window_Command_New < Window_Selectable def initialize(actors=4,enemynums=0) super(160, 20, 968, 620) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = HS::OPACITY self.z = 90 @commands = ["装备","物品","魔法","状态","战斗","队列","任务","系统"] @item_max = 8 @column_max = 8 # bitmap = RPG::Cache.icon("菜单") # self.contents.blt( - 22,-34, bitmap, Rect.new(-5, -34, 965, 569)) #bitmap = RPG::Cache.icon("属性养成") #self.contents.blt(32, 48, bitmap, Rect.new(0, 0, 65, 24)) #bitmap = RPG::Cache.icon("上阵出战") #self.contents.blt(99, 48, bitmap, Rect.new(0, 0, 65, 24)) #bitmap = RPG::Cache.icon("出仕下野") #self.contents.blt(164, 48, bitmap, Rect.new(0, 0, 65, 24)) #bitmap = RPG::Cache.icon("合成进阶") #self.contents.blt(232, 48, bitmap, Rect.new(0, 0, 65, 24)) #bitmap = RPG::Cache.icon("载入史册") #self.contents.blt(297, 48, bitmap, Rect.new(0, 0, 65, 24)) #bitmap = RPG::Cache.icon("放马南山") #self.contents.blt(364, 48, bitmap, Rect.new(0, 0, 65, 24)) @actors = actors @enemynums = enemynums draw_item(0, @actors==0 ? disabled_color : normal_color) draw_item(1, normal_color) draw_item(2, @actors==0 ? disabled_color : normal_color) draw_item(3, @actors==0 ? disabled_color : normal_color) draw_item(4, @actors==0 ? disabled_color : normal_color) draw_item(5, @actors==0 ? disabled_color : normal_color) draw_item(6, normal_color) draw_item(7, normal_color) self.index = 0 end def draw_item(index, color) self.contents.font.color = color x = 4 + index % 8 * 70 y = 2 # y = index / 2 * 32 rect = Rect.new(x+32, y+47, 0, 0) self.contents.fill_rect(rect, Color.new(200, 255,20, 200))#(0, 0, 0, 0)) self.contents.draw_text(rect, @commands[index], 1) end ######################### def refresh self.contents.clear # Color.new(红色192, 绿192, 蓝192, 透明255) for i in 0...@item_max if i == self.index #@index # actors = Color.new(220, 200, 20, 255)# Color.new(红色192, 绿192, 蓝192, 透明255) font_name = "黑体" else actors = normal_color #Color.new(180, 150, 60, 255)# font_name = "黑体" end draw_item(i, color, font_name)#加入各种i=我,颜色,字体, end end ###################################################################### def update_cursor_rect # 光标位置不满 0 的情况下 if @index < 0 self.cursor_rect.empty return end # 获取当前的行 row = @index / @column_max # 当前行被显示开头行前面的情况下 if row > self.top_row #< # 从当前行向开头行滚动 self.top_row = row end # 当前行被显示末尾行之后的情况下 if row > self.top_row + (self.page_row_max - 1) # 从当前行向末尾滚动 self.top_row = row - (self.page_row_max - 1) end # 计算光标的宽 cursor_width = 68 #600 / (@column_max + 1) - 32 # 计算光标坐标 x = 4 + index % 8 * 70 y = 2 # 更新国标矩形 self.cursor_rect.set(x+32, y+47, 68, 28) end end class Scene_Menu def initialize(menu_index = 0) @menu_index = menu_index end def main #卐----------------------------------------------------------------------------- @sxyc = Sprite.new @szcz = Sprite.new @csxy = Sprite.new @hcjj = Sprite.new @zrsc = Sprite.new @fmns = Sprite.new @sxyc.bitmap = RPG::Cache.icon("属性养成") @szcz.bitmap = RPG::Cache.icon("上阵出战") @csxy.bitmap = RPG::Cache.icon("出仕下野") @hcjj.bitmap = RPG::Cache.icon("合成进阶") @zrsc.bitmap = RPG::Cache.icon("载入史册") @fmns.bitmap = RPG::Cache.icon("放马南山") @sxyc.x = 62 @sxyc.y = 80 @sxyc.z = 91 @szcz.x = 129 @szcz.y = 80 @szcz.z = 91 @csxy.x = 194 @csxy.y = 80 @csxy.z = 91 @hcjj.x = 262 @hcjj.y = 80 @hcjj.z = 91 @zrsc.x = 327 @zrsc.y = 80 @zrsc.z = 91 @fmns.x = 394 @fmns.y = 80 @fmns.z = 91 #卐----------------------------------------------------------------------------- # check_enemy_in_map($game_player.x,$game_player.y) cmd = Window_Command_New.new($game_party.actors.size) cmd.index = @menu_index Graphics.transition loop do Graphics.update Input.update cmd.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new end if Input.trigger?(Input::C) case cmd.index when 0 $game_system.se_play($data_system.buzzer_se) $scene = Scene_Equip.new when 1 $game_system.se_play($data_system.decision_se) $scene = Scene_Item.new when 2 $game_system.se_play($data_system.decision_se) $scene = Scene_Skill.new when 3 $game_system.se_play($data_system.decision_se) $scene = Scene_Status.new when 4 $game_system.se_play($data_system.decision_se) when 5 $game_system.se_play($data_system.decision_se) $scene = Scene_Change_Turn.new when 6 print "可以自己结合叶子的任务系统设计" when 7 print "自己安排什么 储存、读取、什么的等" end end if $scene != self break end end Graphics.freeze cmd.dispose #卐----------------------------------------------------------------------------- # ★释放精灵 @sxyc.dispose @szcz.dispose @csxy.dispose @hcjj.dispose @zrsc.dispose @fmns.dispose #卐----------------------------------------------------------------------------- end end
class Window_Command_New < Window_Selectable
def initialize(actors=4,enemynums=0)
super(160, 20, 968, 620)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = HS::OPACITY
self.z = 90
@commands = ["装备","物品","魔法","状态","战斗","队列","任务","系统"]
@item_max = 8
@column_max = 8
# bitmap = RPG::Cache.icon("菜单")
# self.contents.blt( - 22,-34, bitmap, Rect.new(-5, -34, 965, 569))
#bitmap = RPG::Cache.icon("属性养成")
#self.contents.blt(32, 48, bitmap, Rect.new(0, 0, 65, 24))
#bitmap = RPG::Cache.icon("上阵出战")
#self.contents.blt(99, 48, bitmap, Rect.new(0, 0, 65, 24))
#bitmap = RPG::Cache.icon("出仕下野")
#self.contents.blt(164, 48, bitmap, Rect.new(0, 0, 65, 24))
#bitmap = RPG::Cache.icon("合成进阶")
#self.contents.blt(232, 48, bitmap, Rect.new(0, 0, 65, 24))
#bitmap = RPG::Cache.icon("载入史册")
#self.contents.blt(297, 48, bitmap, Rect.new(0, 0, 65, 24))
#bitmap = RPG::Cache.icon("放马南山")
#self.contents.blt(364, 48, bitmap, Rect.new(0, 0, 65, 24))
@actors = actors
@enemynums = enemynums
draw_item(0, @actors==0 ? disabled_color : normal_color)
draw_item(1, normal_color)
draw_item(2, @actors==0 ? disabled_color : normal_color)
draw_item(3, @actors==0 ? disabled_color : normal_color)
draw_item(4, @actors==0 ? disabled_color : normal_color)
draw_item(5, @actors==0 ? disabled_color : normal_color)
draw_item(6, normal_color)
draw_item(7, normal_color)
self.index = 0
end
def draw_item(index, color)
self.contents.font.color = color
x = 4 + index % 8 * 70
y = 2
# y = index / 2 * 32
rect = Rect.new(x+32, y+47, 0, 0)
self.contents.fill_rect(rect, Color.new(200, 255,20, 200))#(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index], 1)
end
#########################
def refresh
self.contents.clear
# Color.new(红色192, 绿192, 蓝192, 透明255)
for i in 0...@item_max
if i == self.index #@index #
actors = Color.new(220, 200, 20, 255)# Color.new(红色192, 绿192, 蓝192, 透明255)
font_name = "黑体"
else
actors = normal_color #Color.new(180, 150, 60, 255)#
font_name = "黑体"
end
draw_item(i, color, font_name)#加入各种i=我,颜色,字体,
end
end
######################################################################
def update_cursor_rect
# 光标位置不满 0 的情况下
if @index < 0
self.cursor_rect.empty
return
end
# 获取当前的行
row = @index / @column_max
# 当前行被显示开头行前面的情况下
if row > self.top_row #<
# 从当前行向开头行滚动
self.top_row = row
end
# 当前行被显示末尾行之后的情况下
if row > self.top_row + (self.page_row_max - 1)
# 从当前行向末尾滚动
self.top_row = row - (self.page_row_max - 1)
end
# 计算光标的宽
cursor_width = 68 #600 / (@column_max + 1) - 32
# 计算光标坐标
x = 4 + index % 8 * 70
y = 2
# 更新国标矩形
self.cursor_rect.set(x+32, y+47, 68, 28)
end
end
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
#卐-----------------------------------------------------------------------------
@sxyc = Sprite.new
@szcz = Sprite.new
@csxy = Sprite.new
@hcjj = Sprite.new
@zrsc = Sprite.new
@fmns = Sprite.new
@sxyc.bitmap = RPG::Cache.icon("属性养成")
@szcz.bitmap = RPG::Cache.icon("上阵出战")
@csxy.bitmap = RPG::Cache.icon("出仕下野")
@hcjj.bitmap = RPG::Cache.icon("合成进阶")
@zrsc.bitmap = RPG::Cache.icon("载入史册")
@fmns.bitmap = RPG::Cache.icon("放马南山")
@sxyc.x = 62
@sxyc.y = 80
@sxyc.z = 91
@szcz.x = 129
@szcz.y = 80
@szcz.z = 91
@csxy.x = 194
@csxy.y = 80
@csxy.z = 91
@hcjj.x = 262
@hcjj.y = 80
@hcjj.z = 91
@zrsc.x = 327
@zrsc.y = 80
@zrsc.z = 91
@fmns.x = 394
@fmns.y = 80
@fmns.z = 91
#卐-----------------------------------------------------------------------------
# check_enemy_in_map($game_player.x,$game_player.y)
cmd = Window_Command_New.new($game_party.actors.size)
cmd.index = @menu_index
Graphics.transition
loop do
Graphics.update
Input.update
cmd.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
end
if Input.trigger?(Input::C)
case cmd.index
when 0
$game_system.se_play($data_system.buzzer_se)
$scene = Scene_Equip.new
when 1
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new
when 4
$game_system.se_play($data_system.decision_se)
when 5
$game_system.se_play($data_system.decision_se)
$scene = Scene_Change_Turn.new
when 6
print "可以自己结合叶子的任务系统设计"
when 7
print "自己安排什么 储存、读取、什么的等"
end
end
if $scene != self
break
end
end
Graphics.freeze
cmd.dispose
#卐-----------------------------------------------------------------------------
# ★释放精灵
@sxyc.dispose
@szcz.dispose
@csxy.dispose
@hcjj.dispose
@zrsc.dispose
@fmns.dispose
#卐-----------------------------------------------------------------------------
end
end
根据刚刚的大神的思路弄了一晚上(果然自己太渣了)
x值和y值你自己调一下,z值最好不要动
这段脚本替换Scene_Menu |
|