Project1
标题:
跳过标题的脚本和仿仙三的脚本冲突,帮忙解决!谢谢!
[打印本页]
作者:
5dare
时间:
2010-12-15 22:56
标题:
跳过标题的脚本和仿仙三的脚本冲突,帮忙解决!谢谢!
我使用了跳过开头脚本 然后根据柳柳的个性自制菜单而跟着做了一个自制个性标题,还是用了 截图存档和截图读档,但是在储存的时候发生冲突, 截图存档的307行 发生冲突。 解读读档是发生在400行,我把脚本都贴出来了,求求各位高手帮帮忙,解决下冲突!!我用的是仿仙剑3的那个工程做的。
跳过标题的脚本是
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
class Scene_Title
#==============================================================================
# 脚本作者:朱仔メ龍 QQ:251724722
# 脚本转载请保留以上信息
#==============================================================================
def main
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
$game_system = Game_System.new
Graphics.frame_count = 0
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_party.setup_starting_members
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
复制代码
而截图存档的脚本 是
#===============================================================================
BBS_66RPG_DIR = "Save/" # 储存文件夹名,请制作游戏时自行建立此文件夹
# 若想使用自定义背景图,脚本62行的井号去掉,并放置一张相应图形。
# 在你的Scene_Title中找到这一段(如果使用其他插件脚本,在插件中找):
# for i in 0..3
# if FileTest.exist?("Save#{i+1}.rxdata")
# 请自行把0..3改为0..最大进度号,比如0..9
# "Save#{i+1}.rxdata" 改为"Save/Save#{i}.rxdata"
# 增加进度的方法:138,258行,继续添加。你也可以改“进度X”为“回忆X”或者“红/绿/蓝笔记本”
# 注意:这个脚本是兼容亿万星辰的“轩辕剑菜单”的版本,不过用在其他场合貌似也不会出错
# 使用时把这个脚本放在“轩辕剑菜单”脚本的下方,也就是更靠近Main的位置
# 兼容处理:叶子
#===============================================================================
module Screen
@screen = Win32API.new 'screenshot', 'Screenshot', %w(l l l l p l l), ''
@readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
@findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l'
module_function
#-----------------------------------------------------------------------------
# here comes the stuff...
# i add here the stuff for automatic change of the number for the screenshot
# so it wont overrite the old one...
# if you want to change so stuff change them in this line below
# or you can change them in your command line... like
# Screen::shot("screenshot", 2)
# this change the name and the type of the screenshot
# (0 = bmp, 1 = jpg and 2 = png)
# ----------------------------------------------------------------------------
def shot(file = "shot", typ = 1)
# to add the right extension...
if typ == 0
typname = ".bmp"
elsif typ == 1
typname = ".jpg"
elsif typ == 2
typname = ".png"
end
file_index = 0
dir = "Save/"
# make the filename....
file_name = dir + file.to_s + typname.to_s
if $shot_guodu == 1
file_name = "Graphics/Pictures/sys_screen.jpg"
$shot_guodu = 0
end
# make the screenshot.... Attention dont change anything from here on....
@screen.call(160,120,320,240,file_name,handel,typ)
end
# find the game window...
def handel
game_name = "\0" * 256
@readini.call('Game','Title','',game_name,255,".\\Game.ini")
game_name.delete!("\0")
return @findwindow.call('RGSS Player',game_name)
end
end
class Window_FileCommand < Window_Selectable
attr_accessor :index
def initialize(index,zzhsavenumber)
@zzhsavenumber = zzhsavenumber
super(-16,-8,640,430)
self.windowskin = nil
self.contents = Bitmap.new(640, 480)
@index = index
@commands = []
for i in 0..35
@commands.push(i.to_s)
end
@
[email protected]
self.opacity = 0
end
def update
self.top_row=($top_row)
self.contents.clear
self_update
if self.active and @item_max > 0
index_var = @index
tp_index = @index
mouse_x, mouse_y = Mouse.get_mouse_pos
mouse_not_in_rect = true
$mouse_not_in_rect = true
$zzhindex=@index
for i in 0...@item_max
@index = i
@zzhaaa_1=1
update_cursor_rect
top_x = self.cursor_rect.x + self.x + 16
top_y = self.cursor_rect.y + self.y + 16
bottom_x = top_x + self.cursor_rect.width
bottom_y = top_y + self.cursor_rect.height
if (mouse_x > top_x) and (mouse_y > top_y) and
(mouse_x < bottom_x) and (mouse_y < bottom_y)
mouse_not_in_rect = false
$mouse_not_in_rect= false
$zzhindex=@index
if tp_index != @index
tp_index = @index
$game_system.se_play($data_system.cursor_se)
end
break
end
end
if mouse_not_in_rect
mouse_x, mouse_y = Mouse.get_mouse_pos
# 当前行被显示开头行前面的情况下
if self.top_row < row_max-page_row_max and Mouse.press?(Mouse::LEFT)and (mouse_x>500)and(mouse_x<545)and(mouse_y>383)and(mouse_y<408)
self.top_row +=1
delay(0.1)
end
# 当前行被显示末尾行之后的情况下
if self.top_row > 0 and Mouse.press?(Mouse::LEFT)and (mouse_x>500)and(mouse_x<545)and(mouse_y>32)and(mouse_y<58)
# 从当前行向末尾滚动
self.top_row -=1
delay(0.1)
end
@index = index_var
if self.is_a?(Window_Target)
@index=-3
end
@zzhaaa_1=2
update_cursor_rect
Mouse.click_lock
else
Mouse.click_unlock
end
end
$top_row = self.top_row
end
def update_cursor_rect
# 光标位置不满 0 的情况下
if @index < 0
self.cursor_rect.empty
return
end
# 获取当前的行
row = @index
# 当前行被显示开头行前面的情况下
if row < self.top_row
# 从当前行向开头行滚动
self.cursor_rect.empty
return
end
# 当前行被显示末尾行之后的情况下
if row > self.top_row + (self.page_row_max - 1)
# 从当前行向末尾滚动
self.cursor_rect.empty
return
end
# 计算光标坐标
x = 8
y = 26 + @index * 92- self.oy
# 更新国标矩形
self.cursor_rect.set(x, y, 490, 92)
end
def top_row
# 将窗口内容的传送源 Y 坐标、1 行的高 32 等分
return self.oy / 92
end
#--------------------------------------------------------------------------
# ● 设置开头行
# row : 显示开头的行
#--------------------------------------------------------------------------
def top_row=(row)
# row 未满 0 的场合更正为 0
if row < 0
row = 0
end
# row 超过 row_max - 1 的情况下更正为 row_max - 1
if row > row_max - 1
row = row_max - 1
end
# row 1 行高的 32 倍、窗口内容的传送源 Y 坐标
self.oy = row * 92
end
#--------------------------------------------------------------------------
# ● 获取 1 页可以显示的行数
#--------------------------------------------------------------------------
def page_row_max
# 窗口的高度,设置画面的高度减去 32 ,除以 1 行的高度 32
return (self.height - 32) / 92
end
def delay(seconds)
for i in 0...(seconds * 1)
sleep 0.01
Graphics.update
end
end
end
class Window_FilePicture2 < Window_Base
def initialize
super(-16,-8,640,480)
self.contents = Bitmap.new(640, 480)
self.opacity = 0
self.contents.clear
end
def update
self.contents.clear
if $mouse_not_in_rect == false
bitmap = Bitmap.new("Graphics/System/menu/sys/存档-2.png")
src_rect = Rect.new(0, 0, bitmap.width+15, bitmap.height+15)
self.contents.blt(8, 30 + ($zzhindex - $top_row) * 92 , bitmap, src_rect)
end
end
end
class Window_FilePicture < Window_Base
def initialize(index)
super(-16,-8,640,480)
self.contents = Bitmap.new(640, 480)
self.opacity = 0
self.contents.clear
bitmap = Bitmap.new("Graphics/System/menu/sys/存档顶条.png")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(5, 12, bitmap, src_rect)
bitmap = Bitmap.new("Graphics/System/menu/sys/存档底条.png")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(6, 394, bitmap, src_rect)
if index == 0
bitmap = Bitmap.new("Graphics/System/menu/sys/存储进度-3.png")
else
bitmap = Bitmap.new("Graphics/System/menu/sys/读取进度-3.png")
end
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
bitmap1 = Bitmap.new("Graphics/System/menu/sys/存档-1.png")
src_rect1 = Rect.new(0, 0, bitmap1.width+15, bitmap1.height+15)
for i in 0..3
self.contents.blt(8, 30+i*92, bitmap1, src_rect1)
self.contents.blt(37, 43+i*92 , bitmap, src_rect)
end
bitmap = Bitmap.new("Graphics/System/menu/sys/存档滚动条.png")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(500, 32, bitmap, src_rect)
if index == 0
bitmap = Bitmap.new("Graphics/System/menu/sys/存储进度-1.png")
bitmap1 = Bitmap.new("Graphics/System/menu/sys/读取进度-2.png")
else
bitmap = Bitmap.new("Graphics/System/menu/sys/存储进度-2.png")
bitmap1 = Bitmap.new("Graphics/System/menu/sys/读取进度-1.png")
end
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(97, 0, bitmap, src_rect)
src_rect = Rect.new(0, 0, bitmap1.width, bitmap1.height)
self.contents.blt(282, 0, bitmap1, src_rect)
end
end
class Window_File < Window_Base
attr_accessor :index
def initialize(index ,zzhsavenumber )
@zzhsavenumber = zzhsavenumber
@backsp = Sprite.new
@backsp.z = 99
super(-8,0,525,480)
self.opacity = 0
#这行可以不用
self.contents = Bitmap.new(width - 32, height - 32)
@index = index
#这里我要说明一句,之所以用sprite是为了放缩图片
@sprite = Sprite.new
@sprite.visible = false
@sprite.z = 1000
@sp_ch = []
@sp_ch[0] = Sprite.new
refresh
end
def refresh
self.contents.clear
for i in @sp_ch
i.visible = false
end
@sprite.visible = false
self.contents.font.size =18
self.contents.font.name = ["华文行楷","隶书","黑体","楷体","宋体"]
self.contents.font.color.set(0,0,0)
$zzhok = false
self.contents.draw_text(-3, 55+@zzhsavenumber * 92, 32, 32, @index.to_s , 1)
$zzhok = true
if FileTest.exist?(BBS_66RPG_DIR+"Save#{@index}.rxdata")
@sprite.visible = true
if FileTest.exist?(BBS_66RPG_DIR+"Save#{@index}.jpg")
@sprite.bitmap = Bitmap.new(BBS_66RPG_DIR+"Save#{@index}.jpg")
else
#self.contents.draw_text(32,64,400,32,"截图似乎有点问题……您搞什么了您?")
end
@sprite.x = 379
@sprite.y = 50 + @zzhsavenumber * 92
@sprite.zoom_x = 0.292
@sprite.zoom_y = 0.29
file = File.open(BBS_66RPG_DIR+"Save#{@index}.rxdata", "r")
@time_stamp = file.mtime
@gold = Marshal.load(file)
@save_map_name = Marshal.load(file)
@characters = Marshal.load(file)
@frame_count = Marshal.load(file)
@game_system = Marshal.load(file)
@game_switches = Marshal.load(file)
@game_variables = Marshal.load(file)
@total_sec = @frame_count / Graphics.frame_rate
file.close
$game_temp.last_file_index = @index
for i in
[email protected]
@sp_ch[i] = Sprite.new
@sp_ch[i].visible = true
@sp_ch[i].bitmap = Bitmap.new("Graphics/system/menu/headp/" +@characters[i][2].to_s + "_save.png")
if i==0
@sp_ch[i].x = 72
else
@sp_ch[i].x = 77+i*43
end
@sp_ch[i].y = 120 + @zzhsavenumber * 92-@sp_ch[i].bitmap.height
@sp_ch[i].z = 1001
end
# 描绘游戏时间
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.size =18
self.contents.font.name = ["华文行楷","隶书","黑体","楷体","宋体"]
self.contents.font.color.set(0,0,0)
$zzhok = false
self.contents.draw_text(210, 40+@zzhsavenumber * 92, 72, 32, "时间" , 2)
self.contents.draw_text(290, 40+@zzhsavenumber * 92, 72, 32, time_string, 2)
self.contents.draw_text(210, 60+@zzhsavenumber * 92, 72, 32, "金钱", 2)
self.contents.draw_text(290, 60+@zzhsavenumber * 92, 72, 32, @gold, 2)
self.contents.draw_text(210, 80+@zzhsavenumber * 92, 72, 32, "地点", 2)
self.contents.draw_text(290, 80+@zzhsavenumber * 92, 72, 32, @save_map_name, 2)
$zzhok = true
# 描绘时间标记
#self.contents.font.color = normal_color
#time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
#self.contents.draw_text(4, 420, 420 + 16, 32, time_string, 2)
#src_rect = Rect.new(0,0,16,16)
#bitmap = Bitmap.new("Graphics/system/menu/back/money.png")
#self.contents.blt(420 + 16 - @gold.size * 16, 4 + 8, bitmap, src_rect)
#else
# self.contents.draw_text(32,32,420 + 16,32,"空白记忆")
end
end
def dispose
super
@sprite.dispose
@backsp.dispose
for i in @sp_ch
i.dispose
end
end
end
class Scene_Save
def main
@picture_window = Window_FilePicture_2.new(1)
@picture_window2= Window_FilePicture2_2.new
@save_command_window = Window_FileCommand_2.new($game_temp.last_file_index,0)
@save_command_window.y = -4
@save_command_window.index = $game_temp.last_file_index
#@save_command_window.update
@content_window0 = Window_File_2.new($game_temp.last_file_index,0)
@content_window1 = Window_File_2.new($game_temp.last_file_index+1,1)
@content_window2 = Window_File_2.new($game_temp.last_file_index+2,2)
@content_window3 = Window_File_2.new($game_temp.last_file_index+3,3)
@oldtop_row=0
$top_row=0
if $game_temp.last_file_index <= 33
$top_row=$game_temp.last_file_index
else
$top_row=33
end
@save_command_window.active = true
@save_command_window_update = true
# 执行过渡
Graphics.transition
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果画面被切换的话就中断循环
if $scene != self
break
end
end
# 准备过渡
Graphics.freeze
@save_command_window.dispose
@content_window0.dispose
@content_window1.dispose
@content_window2.dispose
@content_window3.dispose
@picture_window.dispose
@picture_window2.dispose
end
def update
@save_command_window.update
@picture_window2.update
if @oldtop_row != $top_row
@content_window0.index = $top_row
@content_window0.refresh
@content_window1.index = $top_row+1
@content_window1.refresh
@content_window2.index = $top_row+2
@content_window2.refresh
@content_window3.index = $top_row+3
@content_window3.refresh
end
@oldtop_row = $top_row
#——————下面这一部分是原装脚本——————#
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
if $game_temp.save_calling
$game_temp.save_calling = false
$scene = Scene_Map.new
return
end
#$scene = Scene_Map.new
end
#———————————————————————#
if Input.trigger?(Input::C)
# 演奏存档 SE
$game_system.se_play($data_system.save_se)
# 写入存档数据
file = File.open(BBS_66RPG_DIR+"Save#{@save_command_window.index}.rxdata", "wb")
write_save_data(file)
if FileTest.exist?(BBS_66RPG_DIR+"shot.jpg")
File.rename(BBS_66RPG_DIR+"shot.jpg", BBS_66RPG_DIR+"Save#{@save_command_window.index}.jpg")
end
file.close
$game_temp.last_file_index = @save_command_window.index
# 如果被事件调用
if $game_temp.save_calling
# 清除存档调用标志
$game_temp.save_calling = false
# 切换到地图画面
$scene = Scene_Map.new
return
end
# 切换到菜单画面
$scene = Scene_Map.new
end
#———————————————————————#
end
#--------------------------------------------------------------------------
# ● 写入存档数据
# file : 写入用文件对像 (已经打开)
#--------------------------------------------------------------------------
def write_save_data(file)
# 生成描绘存档文件用的角色图形
characters = []
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
characters.push([actor.character_name, actor.character_hue, actor.id, actor.battler_name, actor.battler_hue])
end
#####################################################################
id = $game_map.map_id
name = $data_mapinfos[id].name
if name.include?("★")
@save_map_name = name.split(/★/)[0]
else
@save_map_name = name
end
Marshal.dump($game_party.gold.to_s, file)
Marshal.dump(@save_map_name, file)
#####################################################################
# 写入描绘存档文件用的角色数据
Marshal.dump(characters, file)
# 写入测量游戏时间用画面计数
Marshal.dump(Graphics.frame_count, file)
# 增加 1 次存档次数
$game_system.save_count += 1
# 保存魔法编号
# (将编辑器保存的值以随机值替换)
$game_system.magic_number = $data_system.magic_number
# 写入各种游戏对像
Marshal.dump($game_system, file)
Marshal.dump($game_switches, file)
Marshal.dump($game_variables, file)
Marshal.dump($game_self_switches, file)
Marshal.dump($game_screen, file)
Marshal.dump($game_actors, file)
Marshal.dump($game_party, file)
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
end
end
class Scene_Menu
alias bbs_66rpg_shotsave_main main
def main
if @menu_index == 0
Screen::shot
end
bbs_66rpg_shotsave_main
end
end
class Interpreter
#--------------------------------------------------------------------------
# ● 调用存档画面
#--------------------------------------------------------------------------
def command_352
# 设置战斗中断标志
$game_temp.battle_abort = true
# 设置调用存档标志
$game_temp.save_calling = true
# 推进索引
@index += 1
# 结束
Screen::shot
return false
end
end
复制代码
还有在个性标题的时候进入读档界面,也发生了冲突 是 第400行 发生冲突
class Scene_Load
def initialize(force = false)
@in_game = force
# 再生成临时对像
$game_temp = Game_Temp.new
# 选择存档时间最新的文件
$game_temp.last_file_index = 0
latest_time = Time.at(0)
for i in 0..6
filename = BBS_66RPG_DIR+"Save#{i}.rxdata"
if FileTest.exist?(filename)
file = File.open(filename, "r")
if file.mtime > latest_time
latest_time = file.mtime
$game_temp.last_file_index = i
end
file.close
end
end
end
def main
@picture_window = Window_FilePicture_2.new(0)
@picture_window2= Window_FilePicture2_2.new
@load_command_window = Window_FileCommand_2.new($game_temp.last_file_index,0)
@load_command_window.y = -4
@load_command_window.index = $game_temp.last_file_index
@content_window0 = Window_File_2.new($game_temp.last_file_index,0)
@content_window1 = Window_File_2.new($game_temp.last_file_index+1,1)
@content_window2 = Window_File_2.new($game_temp.last_file_index+2,2)
@content_window3 = Window_File_2.new($game_temp.last_file_index+3,3)
@oldtop_row=0
if $game_temp.last_file_index <= 33
$top_row=$game_temp.last_file_index
else
$top_row=33
end
@load_command_window.active = true
@load_command_window_update = true
# 执行过渡
Graphics.transition
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果画面被切换的话就中断循环
if $scene != self
break
end
end
# 准备过渡
Graphics.freeze
@load_command_window.dispose
@content_window0.dispose
@content_window1.dispose
@content_window2.dispose
@content_window3.dispose
@picture_window.dispose
@picture_window2.dispose
end
def update
@load_command_window.update
@picture_window2.update
if @oldtop_row != $top_row
@content_window0.index = $top_row
@content_window0.refresh
@content_window1.index = $top_row+1
@content_window1.refresh
@content_window2.index = $top_row+2
@content_window2.refresh
@content_window3.index = $top_row+3
@content_window3.refresh
end
@oldtop_row = $top_row
#——————下面这一部分是原装脚本——————#
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Title.new
end
#Mouse.press?(Mouse::LEFT)and
mouse_x, mouse_y = Mouse.get_mouse_pos
if (mouse_x>600)and(mouse_x<640)and(mouse_y>430)and(mouse_y<470)
if Mouse.zzhtrigger?(Mouse::LEFT)
$scene = Scene_Title.new
end
end
#———————————————————————#
if Input.trigger?(Input::C)
# 文件不存在的情况下
unless FileTest.exist?(BBS_66RPG_DIR+"Save#{@load_command_window.index}.rxdata")
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
if $piantou == 1
for i in 1..3
$menupicback[i].bitmap.dispose
end
end
# 演奏读档 SE
$game_system.se_play($data_system.load_se)
# 写入存档数据
file = File.open(BBS_66RPG_DIR+"Save#{@load_command_window.index}.rxdata", "rb")
read_save_data(file)
file.close
# 还原 BGM、BGS
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
# 刷新地图 (执行并行事件)
$game_map.update
# 切换到地图画面
$scene = Scene_Map.new
end
#———————————————————————#
end
#--------------------------------------------------------------------------
# ● 写入存档数据
# file : 写入用文件对像 (已经打开)
#--------------------------------------------------------------------------
def read_save_data(file)
@gold = Marshal.load(file)
@save_map_name = Marshal.load(file)
# 读取描绘存档文件用的角色数据
characters = Marshal.load(file)
# 读取测量游戏时间用画面计数
Graphics.frame_count = Marshal.load(file)
# 读取各种游戏对像
$game_system = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
$game_self_switches = Marshal.load(file)
$game_screen = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)
# 魔法编号与保存时有差异的情况下
# (加入编辑器的编辑过的数据)
if $game_system.magic_number != $data_system.magic_number
# 重新装载地图
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end
# 刷新同伴成员
$game_party.refresh
end
end
class Window_FileCommand_2 < Window_Selectable
attr_accessor :index
def initialize(index,zzhsavenumber)
@zzhsavenumber = zzhsavenumber
super(44,16,640,454)
self.windowskin = nil
self.contents = Bitmap.new(640, 480)
@index = index
@commands = []
for i in 0..35
@commands.push(i.to_s)
end
@
[email protected]
self.opacity = 0
end
def update
self.top_row=($top_row)
self.contents.clear
self_update
if self.active and @item_max > 0
index_var = @index
tp_index = @index
mouse_x, mouse_y = Mouse.get_mouse_pos
mouse_not_in_rect = true
$mouse_not_in_rect = true
$zzhindex=@index
for i in 0...@item_max
@index = i
@zzhaaa_1=1
update_cursor_rect
top_x = self.cursor_rect.x + self.x + 16
top_y = self.cursor_rect.y + self.y + 16
bottom_x = top_x + self.cursor_rect.width
bottom_y = top_y + self.cursor_rect.height
if (mouse_x > top_x) and (mouse_y > top_y) and
(mouse_x < bottom_x) and (mouse_y < bottom_y)
mouse_not_in_rect = false
$mouse_not_in_rect= false
$zzhindex=@index
if tp_index != @index
tp_index = @index
$game_system.se_play($data_system.cursor_se)
end
break
end
end
if mouse_not_in_rect
mouse_x, mouse_y = Mouse.get_mouse_pos
# 当前行被显示开头行前面的情况下
if self.top_row < row_max-page_row_max and Mouse.press?(Mouse::LEFT)and (mouse_x>560)and(mouse_x<605)and(mouse_y>407)and(mouse_y<432)
self.top_row +=1
delay(0.1)
end
# 当前行被显示末尾行之后的情况下
if self.top_row > 0 and Mouse.press?(Mouse::LEFT)and (mouse_x>560)and(mouse_x<605)and(mouse_y>56)and(mouse_y<82)
# 从当前行向末尾滚动
self.top_row -=1
delay(0.1)
end
@index = index_var
if self.is_a?(Window_Target)
@index=-3
end
@zzhaaa_1=2
update_cursor_rect
Mouse.click_lock
else
Mouse.click_unlock
end
end
$top_row = self.top_row
end
def update_cursor_rect
# 光标位置不满 0 的情况下
if @index < 0
self.cursor_rect.empty
return
end
# 获取当前的行
row = @index
# 当前行被显示开头行前面的情况下
if row < self.top_row
# 从当前行向开头行滚动
self.cursor_rect.empty
return
end
# 当前行被显示末尾行之后的情况下
if row > self.top_row + (self.page_row_max - 1)
# 从当前行向末尾滚动
self.cursor_rect.empty
return
end
# 计算光标坐标
x = 8
y = 26 + @index * 92- self.oy
# 更新国标矩形
self.cursor_rect.set(x, y, 490, 92)
end
def top_row
# 将窗口内容的传送源 Y 坐标、1 行的高 32 等分
return self.oy / 92
end
#--------------------------------------------------------------------------
# ● 设置开头行
# row : 显示开头的行
#--------------------------------------------------------------------------
def top_row=(row)
# row 未满 0 的场合更正为 0
if row < 0
row = 0
end
# row 超过 row_max - 1 的情况下更正为 row_max - 1
if row > row_max - 1
row = row_max - 1
end
# row 1 行高的 32 倍、窗口内容的传送源 Y 坐标
self.oy = row * 92
end
#--------------------------------------------------------------------------
# ● 获取 1 页可以显示的行数
#--------------------------------------------------------------------------
def page_row_max
# 窗口的高度,设置画面的高度减去 32 ,除以 1 行的高度 32
return (self.height - 32) / 92
end
def delay(seconds)
for i in 0...(seconds * 1)
sleep 0.01
Graphics.update
end
end
end
class Window_FilePicture2_2 < Window_Base
def initialize
super(-16,-8,640,480)
self.contents = Bitmap.new(640, 480)
self.opacity = 0
self.contents.clear
end
def update
self.contents.clear
zzhx=60
zzhy=24
if $mouse_not_in_rect == false
bitmap = Bitmap.new("Graphics/System/menu/sys/存档-2.png")
src_rect = Rect.new(0, 0, bitmap.width+15, bitmap.height+15)
self.contents.blt(8+zzhx, 30 + ($zzhindex - $top_row) * 92 +zzhy, bitmap, src_rect)
end
end
end
class Window_FilePicture_2 < Window_Base
def initialize (index)
super(-16,-16,672,512)
self.contents = Bitmap.new(656, 496)
zzhx=60
zzhy=32
self.opacity = 0
self.contents.clear
bitmap = Bitmap.new("Graphics/System/menu/底图_读档.jpg")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(0, 0, bitmap, src_rect)
bitmap = Bitmap.new("Graphics/System/menu/sys/存档顶条.png")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(5+zzhx, 12+zzhy, bitmap, src_rect)
bitmap = Bitmap.new("Graphics/System/menu/sys/存档底条.png")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(6+zzhx, 394+zzhy, bitmap, src_rect)
if index ==0
bitmap = Bitmap.new("Graphics/System/menu/sys/读取进度-3.png")
else
bitmap = Bitmap.new("Graphics/System/menu/sys/存储进度-3.png")
end
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
bitmap1 = Bitmap.new("Graphics/System/menu/sys/存档-1.png")
src_rect1 = Rect.new(0, 0, bitmap1.width+15, bitmap1.height+15)
for i in 0..3
self.contents.blt(8+zzhx, 30+i*92+zzhy, bitmap1, src_rect1)
self.contents.blt(37+zzhx, 43+i*92+zzhy , bitmap, src_rect)
end
bitmap = Bitmap.new("Graphics/System/menu/sys/存档滚动条.png")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(500+zzhx, 32+zzhy, bitmap, src_rect)
end
end
class Window_File_2 < Window_Base
attr_accessor :index
def initialize(index ,zzhsavenumber )
@zzhsavenumber = zzhsavenumber
@backsp = Sprite.new
@backsp.z = 99
super(-8,0,525,480)
self.opacity = 0
#这行可以不用
self.contents = Bitmap.new(width - 32, height - 32)
@index = index
#这里我要说明一句,之所以用sprite是为了放缩图片
@sprite = Sprite.new
@sprite.visible = false
@sprite.z = 1000
@sp_ch = []
@sp_ch[0] = Sprite.new
refresh
end
def refresh
self.contents.clear
zzhx=60
zzhy=24
for i in @sp_ch
i.visible = false
end
@sprite.visible = false
self.contents.font.size =18
self.contents.font.name = ["华文行楷","隶书","黑体","楷体","宋体"]
self.contents.font.color.set(0,0,0)
$zzhok = false
self.contents.draw_text(-3+zzhx, 55+@zzhsavenumber * 92+zzhy, 32, 32, @index.to_s , 1)
$zzhok = true
if FileTest.exist?(BBS_66RPG_DIR+"Save#{@index}.rxdata")
@sprite.visible = true
if FileTest.exist?(BBS_66RPG_DIR+"Save#{@index}.jpg")
@sprite.bitmap = Bitmap.new(BBS_66RPG_DIR+"Save#{@index}.jpg")
else
#self.contents.draw_text(32,64,400,32,"截图似乎有点问题……您搞什么了您?")
end
@sprite.x = 379+zzhx
@sprite.y = 50 + @zzhsavenumber * 92+zzhy
@sprite.zoom_x = 0.292
@sprite.zoom_y = 0.29
file = File.open(BBS_66RPG_DIR+"Save#{@index}.rxdata", "r")
@time_stamp = file.mtime
@gold = Marshal.load(file)
@save_map_name = Marshal.load(file)
@characters = Marshal.load(file)
@frame_count = Marshal.load(file)
@game_system = Marshal.load(file)
@game_switches = Marshal.load(file)
@game_variables = Marshal.load(file)
@total_sec = @frame_count / Graphics.frame_rate
file.close
for i in
[email protected]
@sp_ch[i] = Sprite.new
@sp_ch[i].visible = true
@sp_ch[i].bitmap = Bitmap.new("Graphics/system/menu/headp/" +@characters[i][2].to_s + "_save.png")
if i==0
@sp_ch[i].x = 72+zzhx
else
@sp_ch[i].x = 77+i*43+zzhx
end
@sp_ch[i].y = 120 + @zzhsavenumber * 92-@sp_ch[i].bitmap.height+zzhy
@sp_ch[i].z = 1001
end
# 描绘游戏时间
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.size =18
self.contents.font.name = ["华文行楷","隶书","黑体","楷体","宋体"]
self.contents.font.color.set(0,0,0)
$zzhok = false
self.contents.draw_text(210+zzhx, 40+@zzhsavenumber * 92+zzhy, 72, 32, "时间" , 2)
self.contents.draw_text(290+zzhx, 40+@zzhsavenumber * 92+zzhy, 72, 32, time_string, 2)
self.contents.draw_text(210+zzhx, 60+@zzhsavenumber * 92+zzhy, 72, 32, "金钱", 2)
self.contents.draw_text(290+zzhx, 60+@zzhsavenumber * 92+zzhy, 72, 32, @gold, 2)
self.contents.draw_text(210+zzhx, 80+@zzhsavenumber * 92+zzhy, 72, 32, "地点", 2)
self.contents.draw_text(290+zzhx, 80+@zzhsavenumber * 92+zzhy, 72, 32, @save_map_name, 2)
$zzhok = true
# 描绘时间标记
#self.contents.font.color = normal_color
#time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
#self.contents.draw_text(4, 420, 420 + 16, 32, time_string, 2)
#src_rect = Rect.new(0,0,16,16)
#bitmap = Bitmap.new("Graphics/system/menu/back/money.png")
#self.contents.blt(420 + 16 - @gold.size * 16, 4 + 8, bitmap, src_rect)
#else
# self.contents.draw_text(32,32,420 + 16,32,"空白记忆")
end
end
def dispose
super
@sprite.dispose
@backsp.dispose
for i in @sp_ch
i.dispose
end
end
end
复制代码
请各位高手帮忙解决下!!!!
作者:
563296144
时间:
2010-12-20 17:48
回复
5dare
的帖子
查看一下 你的脚本编辑器里的冲突 也就是400段 那一段代码 在你的 脚本编辑器里 一定有重复的 ,我的运行没有任何问题 = =
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1