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

[转载发布] Mobius's Title Command Manager

[复制链接]
累计送礼:
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-1 19:21:08 | 显示全部楼层 |阅读模式
    Mobius's Title Command Manager 1.0

    by

    MobiusXVI​


    Release Notes
    v. 1.0 Initial Release

    Introduction
    This script allows you to add custom commands to the title, remove existing commands, and order them however you like!

    Features
    - Easily add new commands to the title
    - Remove un-needed commands from the title

    How to Use
    Copy the script into the script editor below the default scripts but above Main. If you're using other scripts which affect the menu, I recommend placing this script above them in the script editor. Follow the instructions and configuration guidance within the script itself.

    Script
    Spoiler#===============================================================================
    # Mobius' Title Command Manager
    # Author: Mobius XVI
    # Version: 1.0
    # Date: 9 AUG 2017
    #===============================================================================
    #
    # Introduction:
    #
    #   This script allows you to add custom commands to the title, remove existing
    #   commands, and order them however you like.
    #
    # Instructions:
    #
    #  - Place this script below all the default scripts but above main.
    #    If you're using other scripts which affect the title, I recommend
    #    placing this script above them in the script editor.
    #
    #  - The customization section below has additional instructions on
    #    how to set up and organize the commands.
    #
    # Issues/Bugs/Possible Bugs:
    #
    #   - As this script replaces the default title system scripts, it
    #     may be incompatible with other title system scripts.
    #
    #
    #  Credits/Thanks:
    #    - Mobius XVI, author
    #
    #  License
    #  
    #    This script is available in its entirety for commercial and non-commercial
    #    use. View the specific license terms below.  
    #
    #    The MIT License (MIT)
    #
    #      Copyright (c) 2017 darmes
    #
    #       Permission is hereby granted, free of charge, to any person obtaining a copy
    #       of this software and associated documentation files (the "Software"), to deal
    #       in the Software without restriction, including without limitation the rights
    #       to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    #       copies of the Software, and to permit persons to whom the Software is
    #       furnished to do so, subject to the following conditions:
    #
    #       The above copyright notice and this permission notice shall be included in all
    #       copies or substantial portions of the Software.
    #
    #       THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    #       IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    #       FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    #       AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    #       LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    #       OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    #       SOFTWARE.
    #  
    #      Further, if you do decide to use this script in a commercial product,
    #      I'd ask that you let me know via a forum post or a PM. Thanks.
    #
    #==============================================================================
    # ** CUSTOMIZATION START
    #==============================================================================
    module Mobius
        module Title_Commands
            # COMMAND OPTIONS #
            # These options allow you to configure all of the title commands.
            # Big picture: Every command has a 'command key' associated it with.
            # This allows you to link several different settings to the same command.
            # The keys are all of the type ':key_name'. That is a colon followed
            # by the key's name. As a rule, the keys should be all lowercase.
            # Additionally every command will need a key placed in the COMMAND_ORDER,
            # COMMAND_NAMES, and COMMAND_CALLS options below. It's optional for
            # COMMAND_ACTOR_SELECT, and COMMAND_ACTOR_REQUIRED.

            # Order of Commands #
            # Place all of your command keys in between the two square brackets.
            # Each key should be separated from the others with a comma.
            # The order in which these keys are placed will determine their order
            # in game, i.e. the first (top) key will be the first (top) command.
            COMMAND_ORDER = [
                            :new_game,
                            :continue,                     
                            :shutdown,                    
                            ]

            # Command Display Names #
            # This links your command keys to their display text in game.
            # In general, these will be the same but they might vary a little.
            # Think of this like setting a 'word' in the database. In fact,
            # this overwrites the database setting, so be sure to define them here.
            # Each entry is a pair like this - :command_key => "Display Name"
            # Separate entries with commas. The order of these entries does NOT
            # affect the order in game.
            COMMAND_NAMES = {
                            :new_game        => "New Game",
                            :continue        => "Continue",
                            :shutdown        => "Shutdown",                    
                            }

            # Command Script Calls #
            # This links your command keys to their script call.
            # In general, these will be very similar to their key.
            # If a script says you can call it by doing this:
            # SceneManager.call(Scene_CustomScript)
            # You will likely need the 'Scene_CustomScript' part.
                    # Look at the continue command below for an example.
            # Each entry is a pair like this - :command_key => Script_Call
            # Separate entries with commas. The order of these entries does NOT
            # affect the order in game.
            COMMAND_CALLS = {
                            :new_game     => :command_new_game, # special
                            :continue     => Scene_Load,
                            :shutdown     => :command_shutdown, # special
                            }
                    # NOTE FOR ADVANCED USERS #
                    # You'll notice in the above command calls, that new_game and shutdown
                    # use symbols connected to preexisting method names. This ensures
                    # all original functionality remains intact. However, this also
                    # means that should you want to write your own method for a
                    # command, you can link it to a key by writing the method name as
                    # a symbol. The script will then treat is as such.
        end
    end
    #==============================================================================
    # ** CUSTOMIZATION END  
    #------------------------------------------------------------------------------
    # ** EDIT BELOW THIS LINE AT OWN RISK!!!
    #==============================================================================
    #==============================================================================
    # ** Window_TitleCommand
    #==============================================================================
    class Window_TitleCommand < Window_Command
        #--------------------------------------------------------------------------
        # * Configuration Binding
        #--------------------------------------------------------------------------
            include Mobius::Title_Commands
        #--------------------------------------------------------------------------
        # * Create Command List
        #--------------------------------------------------------------------------
        def make_command_list
            for cmd in COMMAND_ORDER
                cmd_name = COMMAND_NAMES[cmd]
                add_command(cmd_name, cmd)
            end
        end
    end
    #==============================================================================
    # ** Scene_Title
    #==============================================================================
    class Scene_Title < Scene_Base
        #--------------------------------------------------------------------------
        # * Configuration Binding
        #--------------------------------------------------------------------------
        include Mobius::Title_Commands
      #--------------------------------------------------------------------------
      # * Create Command Window
      #--------------------------------------------------------------------------
      def create_command_window
            # create window
        @command_window = Window_TitleCommand.new
            # Add command handlers
            for cmd in COMMAND_ORDER
                # get command call
                cmd_call = COMMAND_CALLS[cmd]
          if cmd_call.is_a?(Symbol)
            method_symbol = cmd_call
                # if command call is a class and not a symbol
                elsif cmd_call.is_a?(Class)
                    # create a new method for the class
                    method_symbol = create_command_method(cmd_call)
                end
                # set command handler
                @command_window.set_handler(cmd, method(method_symbol))
            end
      end
        #--------------------------------------------------------------------------
        # * Create Command Method
        #--------------------------------------------------------------------------
        def create_command_method(scene_class)
        # convert class to canonical symbol
            sym = scene_class.name.to_sym
        # create method body as proc
            block = proc { close_command_window
                       SceneManager.call(scene_class) }
        # Use 'send hack' to call define method since it's private
        self.class.send
    define_method, sym, block)
        # return the symbol for reference later
        return sym   
        end   
    end




    FAQ
    Q. Can this do _______?
    A. Maybe! Leave a post on the forum, and I might just add the feature if it can't already do it.

    Credits and Thanks
    - MobiusXVI, author

    License
    This script is available in its entirety for commercial and non-commercial use. View the full license terms in the script header.


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-18 08:56 , Processed in 0.136194 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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