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

[转载发布] ZS Compact Title Screen

[复制链接]
累计送礼:
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 11:34:22 | 显示全部楼层 |阅读模式
    ZS Compact Title Screen // Forum request. Combines the save menu and title menu into one.

    Customization:

    • Enable or disable the Continue command. If enabled, you have to click on Continue to scroll through save files. If disabled, you can scroll through the save files and command menu at the same time. (left/right for command window, up/down for the save files.)
    • Adjust the width of both windows, and adjust the offset of the characters drawn in the save files.
    Screenshots:








    Setup:


    • Paste under the Materials slot, above main.
    • This script does not write over Scene_Title. It's a new scene (Scene_TitleFile).
    Known issues:

    • None.
    Usage Notes:

                    Code:       
    1. #==============================================================================
    2. #
    3. # ** Title: ZS Compact Title Screen 1.0
    4. #    Created: August 2019
    5. #    Creator: ZirconStorms
    6. #    Extra Credits: PencilCase27 (Horizontal Commands code)
    7. #
    8. #------------------------------------------------------------------------------
    9. # ** Description: Combines the save menu and title menu into one.
    10. #------------------------------------------------------------------------------
    11. #
    12. # Script is allowed for commercial and non-commercial games.
    13. # In the game's credits or read.me, credit "ZirconStorms" and "PencilCase27".
    14. # No compatibility fixes will be provided unless frequently asked.
    15. #
    16. #==============================================================================
    17. # Customizable Section Begins Here.
    18. #==============================================================================
    19. module ZIRCON_TITLEFILE
    20.   CONTINUE_OPTION = false
    21.   #If set to false, you'll be able to control both menus at the same time.
    22.   #If set to true, you'll need to click on Continue to navigate the save files.
    23.   SHOW_TITLEGRAPHICS = true
    24.   #Show the titlescreen graphics if true, black background if false.
    25.   #Because this menu layout is crowded, the game title won't be drawn.
    26.   WINDOW_WIDTHS = 400 #Graphics.width
    27.   #set it to the value (in pixels) you want both the title and save file
    28.   #windows to have. Graphics.width = Full width of your game's window.
    29.   CHARACTEROFFSET = 45
    30.   #offsets the character sprites (to the left) by that value (in pixels).
    31. end
    32. #==============================================================================
    33. # Customizable Section Ends Here.
    34. #==============================================================================
    35. class Window_TitleCommand < Window_Command
    36.   #--------------------------------------------------------------------------
    37.   def initialize
    38.     super(0, 0)
    39.     if ZIRCON_TITLEFILE::CONTINUE_OPTION == true
    40.     select_symbol(:continue) if continue_enabled
    41.     select_symbol(:new_game) if !continue_enabled
    42.     else
    43.     select_symbol(:new_game)
    44.     end
    45.     self.openness = 255
    46.     self.x = (Graphics.width - width) / 2
    47.     open
    48.   end
    49.   #--------------------------------------------------------------------------
    50.   def make_command_list
    51.     add_command(Vocab::new_game, :new_game)
    52.     add_command(Vocab::continue, :continue, continue_enabled) if ZIRCON_TITLEFILE::CONTINUE_OPTION == true
    53.     add_command(Vocab::shutdown, :shutdown)
    54.   end
    55.   #--------------------------------------------------------------------------
    56.   def window_width
    57.     return ZIRCON_TITLEFILE::WINDOW_WIDTHS
    58.   end
    59.   #--------------------------------------------------------------------------
    60.   def window_height
    61.     return line_height + 24
    62.   end
    63.   #--------------------------------------------------------------------------
    64.   def col_max
    65.     return item_max
    66.   end
    67.   #--------------------------------------------------------------------------
    68.   def alignment
    69.     return 1
    70.   end
    71.   #--------------------------------------------------------------------------
    72. end #Window_TitleCommand
    73. #==============================================================================
    74. module SceneManager
    75.   #--------------------------------------------------------------------------
    76.   def self.first_scene_class
    77.     $BTEST ? Scene_Battle : Scene_TitleFile
    78.   end
    79.   #--------------------------------------------------------------------------
    80. end #SceneManager
    81. #==============================================================================
    82. class Window_SaveFile < Window_Base
    83.   #--------------------------------------------------------------------------
    84.   # * Public Instance Variables
    85.   #--------------------------------------------------------------------------
    86.   attr_reader   :selected                 # selected
    87.   #--------------------------------------------------------------------------
    88.   # * Object Initialization
    89.   #     index : index of save files
    90.   #--------------------------------------------------------------------------
    91.   def initialize(height, index)
    92.     super(0, index * height, Graphics.width, height)
    93.     @file_index = index
    94.     refresh
    95.     @selected = false
    96.     self.width = ZIRCON_TITLEFILE::WINDOW_WIDTHS
    97.     self.x = (Graphics.width - width) / 2
    98.     self.arrows_visible = false #Arrows on the right and left side are hidden.
    99.   end
    100.   #--------------------------------------------------------------------------
    101.   # * Refresh
    102.   #--------------------------------------------------------------------------
    103.   def refresh
    104.     contents.clear
    105.     change_color(normal_color)
    106.     name = Vocab::File + " #{@file_index + 1}"
    107.     draw_text(4, 0, 200, line_height, name)
    108.     @name_width = text_size(name).width
    109.     draw_party_characters(152 - ZIRCON_TITLEFILE::CHARACTEROFFSET, 58)
    110.     draw_playtime(0, contents.height - line_height, contents.width - 4, 2)
    111.   end
    112.   #--------------------------------------------------------------------------
    113.   # * Draw Play Time
    114.   #--------------------------------------------------------------------------
    115.   def draw_playtime(x, y, width, align)
    116.     header = DataManager.load_header(@file_index)
    117.     return unless header
    118.     draw_text(x - (Graphics.width - ZIRCON_TITLEFILE::WINDOW_WIDTHS), y, width, line_height, header[:playtime_s], 2)
    119.   end
    120.   #--------------------------------------------------------------------------
    121. end #Window_SaveFile
    122. #==============================================================================
    123. class Scene_TitleFile < Scene_Base
    124.   #--------------------------------------------------------------------------
    125.   # * Start Processing
    126.   #--------------------------------------------------------------------------
    127.   def start
    128.     super
    129.     SceneManager.clear
    130.     Graphics.freeze
    131.     if ZIRCON_TITLEFILE::SHOW_TITLEGRAPHICS == true
    132.     create_background
    133.     create_foreground
    134.     end
    135.     create_command_window
    136.     play_title_music
    137.     create_savefile_viewport
    138.     create_savefile_windows
    139.     @savedindex = 0
    140.     init_selection if ZIRCON_TITLEFILE::CONTINUE_OPTION == false
    141.   end
    142.   #--------------------------------------------------------------------------
    143.   # * Termination Processing
    144.   #--------------------------------------------------------------------------
    145.   def terminate
    146.     super
    147.     SceneManager.snapshot_for_background
    148.     if ZIRCON_TITLEFILE::SHOW_TITLEGRAPHICS == true
    149.     dispose_background
    150.     dispose_foreground
    151.     end
    152.     @savefile_viewport.dispose
    153.     @savefile_windows.each {|window| window.dispose }
    154.   end
    155.   #--------------------------------------------------------------------------
    156.   # * Create Background
    157.   #-------------------------------------------------------------------------
    158.   def create_background
    159.     @sprite1 = Sprite.new
    160.     @sprite1.bitmap = Cache.title1($data_system.title1_name)
    161.     @sprite2 = Sprite.new
    162.     @sprite2.bitmap = Cache.title2($data_system.title2_name)
    163.     center_sprite(@sprite1)
    164.     center_sprite(@sprite2)
    165.   end
    166.   #--------------------------------------------------------------------------
    167.   # * Create Foreground
    168.   #--------------------------------------------------------------------------
    169.   def create_foreground
    170.     @foreground_sprite = Sprite.new
    171.     @foreground_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
    172.   end
    173.   #--------------------------------------------------------------------------
    174.   # * Create Foreground
    175.   #--------------------------------------------------------------------------
    176.   def dispose_background
    177.     @sprite1.bitmap.dispose
    178.     @sprite1.dispose
    179.     @sprite2.bitmap.dispose
    180.     @sprite2.dispose
    181.   end
    182.   #--------------------------------------------------------------------------
    183.   # * Free Foreground
    184.   #--------------------------------------------------------------------------
    185.   def dispose_foreground
    186.     @foreground_sprite.bitmap.dispose
    187.     @foreground_sprite.dispose
    188.   end
    189.   #--------------------------------------------------------------------------
    190.   # * Move Sprite to Screen Center
    191.   #--------------------------------------------------------------------------
    192.   def center_sprite(sprite)
    193.     sprite.ox = sprite.bitmap.width / 2
    194.     sprite.oy = sprite.bitmap.height / 2
    195.     sprite.x = Graphics.width / 2
    196.     sprite.y = Graphics.height / 2
    197.   end
    198.   #--------------------------------------------------------------------------
    199.   # * Frame Update
    200.   #--------------------------------------------------------------------------
    201.   def update
    202.     super
    203.     @savefile_windows.each {|window| window.update }
    204.     update_savefile_selection
    205.   end
    206.   #--------------------------------------------------------------------------
    207.   # * Create Help Window
    208.   #--------------------------------------------------------------------------
    209.   def create_command_window
    210.     @command_window = Window_TitleCommand.new
    211.     @command_window.set_handler(:new_game, method(:command_new_game))
    212.     @command_window.set_handler(:continue, method(:command_continue))
    213.     @command_window.set_handler(:shutdown, method(:command_shutdown))
    214.   end
    215.   #--------------------------------------------------------------------------
    216.   # * Create Save File Viewport
    217.   #--------------------------------------------------------------------------
    218.   def create_savefile_viewport
    219.     @savefile_viewport = Viewport.new
    220.     @savefile_viewport.z = 300
    221.     @savefile_viewport.rect.y += @command_window.height
    222.     @savefile_viewport.rect.height -= @command_window.height
    223.   end
    224.   #--------------------------------------------------------------------------
    225.   # * Create Save File Window
    226.   #--------------------------------------------------------------------------
    227.   def create_savefile_windows
    228.     @savefile_windows = Array.new(item_max) do |i|
    229.       Window_SaveFile.new(savefile_height, i)
    230.     end
    231.     @savefile_windows.each {|window| window.viewport = @savefile_viewport }
    232.   end
    233.   #--------------------------------------------------------------------------
    234.   # * Initialize Selection State
    235.   #--------------------------------------------------------------------------
    236.   def init_selection
    237.     @index = first_savefile_index
    238.     @savefile_windows[@index].selected = true
    239.     ####self.top_index = @index - visible_max / 2
    240.     ensure_cursor_visible
    241.   end
    242.   #--------------------------------------------------------------------------
    243.   # * Get Number of Items
    244.   #--------------------------------------------------------------------------
    245.   def item_max
    246.     DataManager.savefile_max
    247.   end
    248.   #--------------------------------------------------------------------------
    249.   # * Get Number of Save Files to Show on Screen
    250.   #--------------------------------------------------------------------------
    251.   def visible_max
    252.     return 4
    253.   end
    254.   #--------------------------------------------------------------------------
    255.   # * Get Height of Save File Window
    256.   #--------------------------------------------------------------------------
    257.   def savefile_height
    258.     @savefile_viewport.rect.height / visible_max
    259.   end
    260.   #--------------------------------------------------------------------------
    261.   # * Get File Index to Select First
    262.   #--------------------------------------------------------------------------
    263.   def first_savefile_index
    264.     return @savedindex
    265.   end
    266.   #--------------------------------------------------------------------------
    267.   # * Get Current Index
    268.   #--------------------------------------------------------------------------
    269.   def index
    270.     @index
    271.   end
    272.   #--------------------------------------------------------------------------
    273.   # * Get Top Index
    274.   #--------------------------------------------------------------------------
    275.   def top_index
    276.     @savefile_viewport.oy / savefile_height
    277.   end
    278.   #--------------------------------------------------------------------------
    279.   # * Set Top Index
    280.   #--------------------------------------------------------------------------
    281.   def top_index=(index)
    282.     index = 0 if index < 0
    283.     index = item_max - visible_max if index > item_max - visible_max
    284.     @savefile_viewport.oy = index * savefile_height
    285.   end
    286.   #--------------------------------------------------------------------------
    287.   # * Get Bottom Index
    288.   #--------------------------------------------------------------------------
    289.   def bottom_index
    290.     top_index + visible_max - 1
    291.   end
    292.   #--------------------------------------------------------------------------
    293.   # * Set Bottom Index
    294.   #--------------------------------------------------------------------------
    295.   def bottom_index=(index)
    296.     self.top_index = index - (visible_max - 1)
    297.   end
    298.   #--------------------------------------------------------------------------
    299.   # * Update Save File Selection
    300.   #--------------------------------------------------------------------------
    301.   def update_savefile_selection
    302.     return on_savefile_ok     if Input.trigger?(:C)
    303.     return on_savefile_cancel if Input.trigger?(:B)
    304.     update_cursor
    305.   end
    306.   #--------------------------------------------------------------------------
    307.   # * Save File [OK]
    308.   #--------------------------------------------------------------------------
    309.   def on_savefile_ok
    310.   end
    311.   #--------------------------------------------------------------------------
    312.   # * Save File [Cancel]
    313.   #--------------------------------------------------------------------------
    314.   def on_savefile_cancel
    315.     Sound.play_cancel if @activate_files == true
    316.     @command_window.activate
    317.     @savefile_windows[@index].deactivate
    318.     @savedindex = @index
    319.     @activate_files = false
    320.   end
    321.   #--------------------------------------------------------------------------
    322.   # * Update Cursor
    323.   #--------------------------------------------------------------------------
    324.   def update_cursor
    325.     last_index = @index
    326.     if ZIRCON_TITLEFILE::CONTINUE_OPTION == false
    327.       cursor_down (Input.trigger?(:DOWN))  if Input.repeat?(:DOWN)
    328.       cursor_up   (Input.trigger?(:UP))    if Input.repeat?(:UP)
    329.       cursor_pagedown   if Input.trigger?(:R)
    330.       cursor_pageup     if Input.trigger?(:L)
    331.       if @index != last_index
    332.         Sound.play_cursor
    333.         @savefile_windows[last_index].selected = false
    334.         @savefile_windows[@index].selected = true
    335.       end
    336.     end
    337.     if @activate_files == true
    338.       cursor_down (Input.trigger?(:DOWN))  if Input.repeat?(:DOWN)
    339.       cursor_up   (Input.trigger?(:UP))    if Input.repeat?(:UP)
    340.       cursor_pagedown   if Input.trigger?(:R)
    341.       cursor_pageup     if Input.trigger?(:L)
    342.       if @index != last_index
    343.         Sound.play_cursor
    344.         @savefile_windows[last_index].selected = false
    345.         @savefile_windows[@index].selected = true
    346.       end
    347.     end
    348.   end
    349.   #--------------------------------------------------------------------------
    350.   # * Move Cursor Down
    351.   #--------------------------------------------------------------------------
    352.   def cursor_down(wrap)
    353.     @index = (@index + 1) % item_max if @index < item_max - 1 || wrap
    354.     ensure_cursor_visible
    355.   end
    356.   #--------------------------------------------------------------------------
    357.   # * Move Cursor Up
    358.   #--------------------------------------------------------------------------
    359.   def cursor_up(wrap)
    360.     @index = (@index - 1 + item_max) % item_max if @index > 0 || wrap
    361.     ensure_cursor_visible
    362.   end
    363.   #--------------------------------------------------------------------------
    364.   # * Move Cursor One Page Down
    365.   #--------------------------------------------------------------------------
    366.   def cursor_pagedown
    367.     if top_index + visible_max < item_max
    368.       self.top_index += visible_max
    369.       @index = [@index + visible_max, item_max - 1].min
    370.     end
    371.   end
    372.   #--------------------------------------------------------------------------
    373.   # * Move Cursor One Page Up
    374.   #--------------------------------------------------------------------------
    375.   def cursor_pageup
    376.     if top_index > 0
    377.       self.top_index -= visible_max
    378.       @index = [@index - visible_max, 0].max
    379.     end
    380.   end
    381.   #--------------------------------------------------------------------------
    382.   # * Scroll Cursor to Position Within Screen
    383.   #--------------------------------------------------------------------------
    384.   def ensure_cursor_visible
    385.     self.top_index = index if index < top_index
    386.     self.bottom_index = index if index > bottom_index
    387.   end
    388.   #--------------------------------------------------------------------------
    389.   # * [New Game] Command
    390.   #--------------------------------------------------------------------------
    391.   def command_new_game
    392.     if ZIRCON_TITLEFILE::CONTINUE_OPTION == true
    393.       DataManager.setup_new_game
    394.       #removed close command window effect.
    395.       fadeout_all
    396.       $game_map.autoplay
    397.       SceneManager.goto(Scene_Map)
    398.     else
    399.     if DataManager.load_game(@index)
    400.       Sound.play_load
    401.       fadeout_all
    402.       $game_system.on_after_load
    403.       SceneManager.goto(Scene_Map)
    404.     else
    405.       DataManager.setup_new_game
    406.       #removed close command window effect.
    407.       fadeout_all
    408.       $game_map.autoplay
    409.       SceneManager.goto(Scene_Map)
    410.     end
    411.     end
    412.   end
    413.   #--------------------------------------------------------------------------
    414.   # * [Continue] Command
    415.   #--------------------------------------------------------------------------
    416.   def command_continue
    417.     init_selection
    418.     @activate_files = true
    419.   end
    420.   #--------------------------------------------------------------------------
    421.   # * [Shut Down] Command
    422.   #--------------------------------------------------------------------------
    423.   def command_shutdown
    424.     #removed close command window effect.
    425.     fadeout_all
    426.     SceneManager.exit
    427.   end
    428.   #--------------------------------------------------------------------------
    429.   # * Play Title Screen Music
    430.   #--------------------------------------------------------------------------
    431.   def play_title_music
    432.     $data_system.title_bgm.play
    433.     RPG::BGS.stop
    434.     RPG::ME.stop
    435.   end
    436.   #--------------------------------------------------------------------------
    437. end #Scene_TitleFile
    438. #==============================================================================
    439. class Scene_End < Scene_MenuBase
    440.   #--------------------------------------------------------------------------
    441.   def command_to_title
    442.     close_command_window
    443.     fadeout_all
    444.     SceneManager.goto(Scene_TitleFile)
    445.   end
    446.   #--------------------------------------------------------------------------
    447. end #Scene_End
    448. #==============================================================================
    复制代码




    本贴来自国际rpgmaker官方论坛作者:tvghost处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/zs-compact-title-screen.111754/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

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

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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