赞 | 50 |
VIP | 429 |
好人卡 | 14 |
积分 | 8 |
经验 | 146370 |
最后登录 | 2022-6-27 |
在线时间 | 3431 小时 |
Lv2.观梦者 会吐槽的画师
- 梦石
- 0
- 星屑
- 782
- 在线时间
- 3431 小时
- 注册时间
- 2011-6-10
- 帖子
- 6535
|
本帖最后由 上贺茂润 于 2015-10-1 07:48 编辑
- #==============================================================================
- # ■ VX存档画面改行走图为脸图
- #------------------------------------------------------------------------------
- # (ノ`Д)ノ□)□)□)反物质光波~
- #==============================================================================
- module SaveEx
- # 脸图显示
- USE_FACE = true
- MAP_NAME = true
- BASE_NAME = true
- end
- #==============================================================================
- # ■ Game_Map 扩张
- #==============================================================================
- class Game_Map
- def map_name
- mapInfo = load_data(sprintf("Data/MapInfos.rvdata"))
- return mapInfo[@map_id].name
- end
- def parent_id
- mapInfo = load_data(sprintf("Data/MapInfos.rvdata"))
- return mapInfo[@map_id].parent_id
- end
- def base_parent_id
- mapInfo = load_data(sprintf("Data/MapInfos.rvdata"))
- return search_parent_id(mapInfo)
- end
- def search_parent_id(mapInfo)
- m_id = @map_id
- loop do
- p_id = mapInfo[m_id].parent_id
- return m_id if p_id == 0
- m_id = p_id
- end
- end
- def base_map_name
- mapInfo = load_data(sprintf("Data/MapInfos.rvdata"))
- return mapInfo[search_parent_id(mapInfo)].name
- end
- end
- #==============================================================================
- # ■ FileHeader
- #==============================================================================
- class FileHeader
- attr_reader :characters
- attr_reader :faces
- attr_reader :map_name
- def initialize
- @characters = []
- @faces = []
- for actor in $game_party.members
- @characters.push([actor.character_name, actor.character_index])
- @faces.push([actor.face_name, actor.face_index])
- end
- @map_name = SaveEx::BASE_NAME ? $game_map.base_map_name : $game_map.map_name
- end
- end
- #==============================================================================
- # ■ Window_SaveFile
- #==============================================================================
- class Window_SaveFile < Window_Base
- attr_reader :filename
- attr_reader :file_exist
- attr_reader :time_stamp
- attr_reader :selected
- def initialize(file_index, filename)
- super(0, 56 + file_index % 4 * 90, 544, 90)
- @file_index = file_index
- @filename = filename
- load_gamedata
- refresh
- @selected = false
- end
- def load_gamedata
- @time_stamp = Time.at(0)
- @file_exist = FileTest.exist?(@filename)
- if @file_exist
- file = File.open(@filename, "r")
- @time_stamp = file.mtime
- begin
- @header = Marshal.load(file)
- @frame_count = Marshal.load(file)
- @last_bgm = Marshal.load(file)
- @last_bgs = Marshal.load(file)
- @game_system = Marshal.load(file)
- @game_message = Marshal.load(file)
- @game_switches = Marshal.load(file)
- @game_variables = Marshal.load(file)
- @total_sec = @frame_count / Graphics.frame_rate
- rescue
- @file_exist = false
- ensure
- file.close
- end
- end
- end
- def refresh
- self.contents.clear
- self.contents.font.color = normal_color
- name = Vocab::File + " #{@file_index + 1}"
- self.contents.draw_text(4, 0, 200, WLH, name)
- @name_width = contents.text_size(name).width
- if @file_exist
- SaveEx::USE_FACE ? draw_party_faces(100, -10) : draw_party_characters(152, 58)
- self.contents.draw_text(320-16, 0, 200, WLH, @header.map_name, 2) if SaveEx::MAP_NAME
- draw_playtime(0, 34, contents.width - 4, 2)
- end
- end
- def draw_party_characters(x, y)
- for i in [email protected]
- name = @header.characters[i][0]
- index = @header.characters[i][1]
- draw_character(name, index, x + i * 48, y)
- end
- end
- def draw_party_faces(x, y)
- for i in [email protected]
- name = @header.faces[i][0]
- index = @header.faces[i][1]
- draw_face(name, index, x + i * 90, y) # 4人以上だと文字とかぶる…
- end
- end
- end
- #==============================================================================
- # ■ Scene_File
- #==============================================================================
- class Scene_File < Scene_Base
- def initialize(saving, from_title, from_event, menu_index=4)
- @saving = saving
- @from_title = from_title
- @from_event = from_event
- @menu_index = menu_index
- end
- def return_scene
- if @from_title
- $scene = Scene_Title.new
- elsif @from_event
- $scene = Scene_Map.new
- else
- $scene = Scene_Menu.new(@menu_index)
- end
- end
- def write_save_data(file)
- header = FileHeader.new
- $game_system.save_count += 1
- $game_system.version_id = $data_system.version_id
- @last_bgm = RPG::BGM::last
- @last_bgs = RPG::BGS::last
- Marshal.dump(header, file)
- Marshal.dump(Graphics.frame_count, file)
- Marshal.dump(@last_bgm, file)
- Marshal.dump(@last_bgs, file)
- Marshal.dump($game_system, file)
- Marshal.dump($game_message, file)
- Marshal.dump($game_switches, file)
- Marshal.dump($game_variables, file)
- Marshal.dump($game_self_switches, 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
- def read_save_data(file)
- header = Marshal.load(file)
- Graphics.frame_count = Marshal.load(file)
- @last_bgm = Marshal.load(file)
- @last_bgs = Marshal.load(file)
- $game_system = Marshal.load(file)
- $game_message = Marshal.load(file)
- $game_switches = Marshal.load(file)
- $game_variables = Marshal.load(file)
- $game_self_switches = 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.version_id != $data_system.version_id
- $game_map.setup($game_map.map_id)
- $game_player.center($game_player.x, $game_player.y)
- end
- end
- end
复制代码 (=゚ω゚)=@怪蜀黍 |
评分
-
查看全部评分
|