设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 126|回复: 0

[转载发布] ZS Save & Load Grid Menu

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-2 13:03:26 | 显示全部楼层 |阅读模式
    ZS Save & Load Grid Menu - 1.0 // A purely visual script. Allows a couple of customization features.

    Customization

    • Change help window and file slot opacity / back opacity individually.
    • Add a custom save and load menu background image.
    • Background image can be different depending on whether you are looking at the Save or Load menu.
    • Customize font name and font italic value for either the file slot name or for the whole menu.
    • Adjust the slot's name in-script. (Already a thing that can be done in Ace, but I wanted to leave the option there.)
    • Adjust the help window's position; you can also remove the help window entirely
    • Simplify the playtime display text hour:min instead of the default hour:min:sec display.
                    Code:       
    1. #==============================================================================
    2. #
    3. # ** Title: ZS Save & Load Grid Menu 1.0
    4. #    Created: April 2019
    5. #
    6. #------------------------------------------------------------------------------
    7. #
    8. # Script is allowed for commercial and non-commercial games.
    9. # In the game's credits or read.me, please credit "ZirconStorms".
    10. # Additional credits: Sixth, for extra code help
    11. #
    12. #------------------------------------------------------------------------------
    13. # !! Don't remove the license, link or author part of this script header.
    14. #------------------------------------------------------------------------------
    15. #
    16. # Known issues:
    17. # 1. All save slots must be on screen at once, as file scrolling is buggy.
    18. # 2. Positioning for sprites/faces isn't perfect/center-aligned.
    19. #
    20. #==============================================================================
    21. # Customizable Section Begins Here.
    22. #==============================================================================
    23. module RLGridSave
    24.     SAVECOUNT = 8
    25.     # Options: 2,4,6,8,10
    26.     HELPWINDOW = :bottom
    27.     # :top = Help window is on top of screen
    28.     # :bottom = Help window is on the bottom
    29.     # :none = Help window is not visible
    30.     # For SAVECOUNT value of 10, using :none is recommended.
    31.     SAVEFONT = "Cambria"
    32.     # Set to SAVEFONT = Font.default_name if you want your default font.
    33.     FONTLAYOUT = :all
    34.     # :header - Will only apply custom font for the File Slot text
    35.     # :all - Will apply custom font for all the save/load menu.
    36.     SAVETEXTITALICS = true
    37.     # true =  File slot text will be in italics
    38.     # false = File slot text will not be in italics
    39.     SAVETEXT = "Slot"
    40.     # Can be changed to whatever
    41.     SHOWSAVETIME = true
    42.     # true =  Playtime is shown on screen
    43.     # false = Playtime is hidden
    44.     SAVETIMETYPE = :compact
    45.     # :default = Hour.Minutes.Seconds
    46.     # :compact = Hour.Minutes
    47.     SHOWACTORS = :sprites
    48.     # :sprites = Actor sprites are shown on the save files
    49.     # :faces = Actor facesets from the database are shown on save files
    50.     # :none = No actor images are shown on the save files
    51.     SAVEOPACITY = 255
    52.     # insert a value for your window opacity
    53.     # 0 is fully transparent. 255 is fully opaque.
    54.     SAVEBACKOPACITY = 128
    55.     # insert a value for your window border opacity.
    56.     # 0 is fully transparent. 255 is fully opaque.
    57.     SAVEBACKGROUND = false
    58.     # true = Uses a background image.
    59.     # false = Doesn't use a background image.
    60.     SAVEBACKIMAGE = "File_Image"
    61.     # Image that comes up when you enter the Save scene.
    62.     # Image must be put in Graphics/System. Put your filename in quotes.
    63.     LOADBACKIMAGE = "File_Image_2"
    64.     # Image that comes up when you enter the Load scene.
    65.     # Image must be put in Graphics/System. Put your filename in quotes.
    66. end
    67. #==============================================================================
    68. # Customizable Section Ends Here
    69. #==============================================================================
    70. module DataManager
    71.   def self.make_save_header
    72.     header = {}
    73.     header[:characters] = $game_party.characters_for_savefile
    74.     header[:faces] = $game_party.faces_for_savefile
    75.     header[:playtime_s] = $game_system.playtime_s
    76.     header
    77.   end
    78. end
    79. class Game_Party < Game_Unit
    80.   def faces_for_savefile
    81.     battle_members.collect do |actor|
    82.     [actor.face_name, actor.face_index]
    83.   end
    84. end
    85. end
    86. class Window_SaveFile < Window_Base
    87.   attr_reader   :selected   # selected
    88.   alias ghostinitialize initialize
    89.   def initialize(height, index)
    90.     super(0, 0, Graphics.width / 2, height)
    91.     @file_index = index
    92.       self.back_opacity = RLGridSave::SAVEBACKOPACITY
    93.       self.opacity = RLGridSave::SAVEOPACITY
    94.     if @file_index % 2 != 0
    95.       self.x += width
    96.     end
    97.     case @file_index
    98.       when 0, 1
    99.         self.y = 0
    100.       when 2, 3
    101.         self.y += height
    102.       when 4, 5
    103.         self.y += (height * 2)
    104.       when 6, 7
    105.         self.y += (height * 3)
    106.       when 8,9
    107.         self.y += (height * 4)
    108.       end
    109.     refresh
    110.     @selected = false
    111.   end
    112.   def refresh
    113.     contents.clear
    114.     change_color(normal_color)
    115.     name = RLGridSave::SAVETEXT + " #{@file_index + 1}"
    116.     contents.font.name = RLGridSave::SAVEFONT
    117.     contents.font.italic = RLGridSave::SAVETEXTITALICS
    118.     draw_text(4, 0, 200, line_height, name)
    119.     @name_width = text_size(name).width
    120.     draw_party_faces(0, contents.height / 4) if RLGridSave::SHOWACTORS == :faces
    121.     if RLGridSave::SAVECOUNT == 10
    122.     draw_party_characters(20, 60) if RLGridSave::SHOWACTORS == :sprites
    123.       else
    124.     draw_party_characters(20, 70) if RLGridSave::SHOWACTORS == :sprites
    125.     end
    126.     contents.font.italic = false
    127.     contents.font.name = Font.default_name if RLGridSave::FONTLAYOUT == :header
    128.     contents.font.name = RLGridSave::SAVEFONT if RLGridSave::FONTLAYOUT == :all
    129.     draw_playtime(0, contents.height / contents.height, contents.width - 4, 2) if RLGridSave::SHOWSAVETIME == true
    130.     self.contents.font.color = (text_color(1))
    131.   end
    132.   def draw_party_characters(x, y)
    133.     header = DataManager.load_header(@file_index)
    134.     return unless header
    135.     header[:characters].each_with_index do |data, i|
    136.       draw_character(data[0], data[1], x + i * 48, y)
    137.     end
    138.   end
    139.   def draw_party_faces(x, y)
    140.     header = DataManager.load_header(@file_index)
    141.     return unless header
    142.     header[:faces].each_with_index do |data, i|
    143.     case RLGridSave::SAVECOUNT
    144.       when 2,4
    145.         draw_oldface(data[0], data[1], x, y + 0) if i == 0
    146.         draw_oldface(data[0], data[1], x + (1 * 96), y + 0) if i == 1
    147.         draw_oldface(data[0], data[1], x, y + (1 * 44)) if i == 2
    148.         draw_oldface(data[0], data[1], x + (1 * 96),y + (1 * 44)) if i == 3
    149.       when 6, 8, 10
    150.         draw_newface(data[0], data[1], x, y + 10) if i == 0
    151.         draw_newface(data[0], data[1], x + (1 * 96), y + 10) if i == 1
    152.         draw_newface(data[0], data[1], x, y + (1 * 32)) if i == 2
    153.         draw_newface(data[0], data[1], x + (1 * 96),y + (1 * 32)) if i == 3
    154.       end
    155.   end
    156.   end
    157.   def draw_oldface(face_name, face_index, x, y, enabled = true)
    158.     bitmap = Cache.face(face_name)
    159.     rect = Rect.new(face_index % 4 * 96, (face_index / 4 * 96)+ 30, 96, 44)
    160.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
    161.     bitmap.dispose
    162.   end
    163.   def draw_newface(face_name, face_index, x, y, enabled = true)
    164.     bitmap = Cache.face(face_name)
    165.     rect = Rect.new(face_index % 4 * 96, (face_index / 4 * 96)+ 30, 96, 22)
    166.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
    167.     bitmap.dispose
    168.   end
    169.   def draw_playtime(x, y, width, align)
    170.     header = DataManager.load_header(@file_index)
    171.     return unless header
    172.     draw_text(x, y, width, line_height, header[:playtime_s], 2)
    173.   end
    174. end
    175. class Scene_File < Scene_MenuBase
    176.   def start
    177.     super
    178.     create_help_window if RLGridSave::HELPWINDOW != :none
    179.     create_saveimage if RLGridSave::SAVEBACKGROUND == true
    180.     create_savefile_viewport
    181.     create_savefile_windows
    182.     init_selection
    183.   end
    184.   def create_saveimage
    185.     @SaveBG = Sprite.new
    186.     @SaveBG.bitmap = Cache.system(RLGridSave::SAVEBACKIMAGE) if SceneManager.scene_is?(Scene_Save)
    187.     @SaveBG.bitmap = Cache.system(RLGridSave::LOADBACKIMAGE) if SceneManager.scene_is?(Scene_Load)
    188.   end
    189.   def dispose_saveimage
    190.     @SaveBG.dispose
    191.     @SaveBG.bitmap.dispose
    192.   end
    193.   def create_help_window
    194.     @help_window = Window_Help.new(1)
    195.     @help_window.back_opacity = RLGridSave::SAVEBACKOPACITY
    196.     @help_window.opacity = RLGridSave::SAVEOPACITY
    197.     @help_window.set_text(help_window_text)
    198.     @help_window.y = Graphics.height - @help_window.height if RLGridSave::HELPWINDOW == :bottom
    199.   end
    200.   def create_savefile_windows
    201.     @savefile_windows = Array.new(item_max) do |i|
    202.       Window_SaveFile.new(savefile_height, i)
    203.     end
    204.     @savefile_windows.each {|window| window.viewport = @savefile_viewport }
    205.   end
    206.   def create_savefile_viewport
    207.     @savefile_viewport = Viewport.new
    208.     if RLGridSave::HELPWINDOW == :top #&& RLGridSave::SAVECOUNT != 1
    209.       @savefile_viewport.rect.y = @help_window.height
    210.     else
    211.       @savefile_viewport.rect.y = 0
    212.     end
    213.     if RLGridSave::SAVECOUNT != 1 && RLGridSave::HELPWINDOW != :none
    214.       @savefile_viewport.rect.height -= @help_window.height
    215.     else
    216.       @savefile_viewport.rect.height = Graphics.height
    217.     end
    218.   end
    219.   def item_max
    220.     return RLGridSave::SAVECOUNT
    221.   end
    222.   def visible_max
    223.     return RLGridSave::SAVECOUNT
    224.   end
    225.   def savefile_height
    226.     @savefile_viewport.rect.height / (visible_max/2)
    227.   end
    228.   def update_cursor
    229.     last_index = @index
    230.     cursor_down (Input.trigger?(:RIGHT))  if Input.repeat?(:RIGHT)
    231.     cursor_up   (Input.trigger?(:LEFT))    if Input.repeat?(:LEFT)
    232.     cursor_pagedown   if Input.trigger?(:R)
    233.     cursor_pageup     if Input.trigger?(:L)
    234.     if @index != last_index
    235.       Sound.play_cursor
    236.       @savefile_windows[last_index].selected = false
    237.       @savefile_windows[@index].selected = true
    238.     end
    239.   end
    240. end
    241. class Game_System
    242.   alias ghostplaytime_s playtime_s
    243.   def playtime_s
    244.     hour = playtime / 60 / 60
    245.     min = playtime / 60 % 60
    246.     if RLGridSave::SAVETIMETYPE != :default
    247.       sprintf("%02d:%02d", hour, min)
    248.     else
    249.       sec = playtime % 60
    250.       sprintf("%02d:%02d:%02d", hour, min, sec)
    251.     end
    252.   end
    253. end
    254. #===============================================================================
    255. # End of Script
    256. #===============================================================================
    复制代码

    Setup:

    • Paste under the Materials slot, above main.
    • I wouldn't recommend tampering past the module, but if you know what you're doing, you can finetune the face's x and y positions.
    Known issues:

    • All save slots must be on screen at once, as file scrolling is buggy. (Hoping to fix this)
    • Positioning for sprites/faces isn't perfect/center-aligned.
    Planned features:

    • Ability to use an icon instead of text for the File slot name.
    • Adjust font boldness and color for the entire menu or just for the File slot name.
    • Ability to add an image graphic for slots that are used/unused.
    • Scrolling/moving image backgrounds for the save and load screen.
    These are not guaranteed to be implemented, but I'll do my best to accommodate to user requests.

    Usage notes:

    • Don't remove ZirconStorms from the script code.
    • Script is allowed for commercial and non-commercial projects.
    • Users are free to modify the script as they wish for their own projects.
    Additional credits: Sixth, for extra code help.


    本贴来自国际rpgmaker官方论坛作者:tvghost处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/zs-save-load-grid-menu.107604/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-17 11:39 , Processed in 0.138971 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表