Menuscreen while message disable on some events

Discussion in 'RGSS3 Script Requests' started by jumadelux, Dec 13, 2016.

  1. jumadelux

    jumadelux Villager Member

    Messages:
    23
    Likes Received:
    1
    Location:
    Bermuda
    First Language:
    English
    Hello,


    I need to disable this script on some events instead of scene.


    I think it should be possible by a script call, anyway i can't find any script call here.


    Could someone help me? ;_;


    Sorry if i'm posting in a wrong section ><


    Thankyou before!

    Code:
    
    #===================================
    # MenuScreen While Message (MSWM)
    #===================================
    # by bStefan aka. regendo
    # by request from AABattery
    # : http://www.rpgmakervxace.net/index.php?/user/608-aabattery/
    # please give credit if used
    # for use with RMVX ACE
    #===================================
    # Call Scene_Menu while a message
    # : is being displayed
    #===================================
    # implement over Main
    #===================================
    # customize:
    # : add Scenes you don't want the
    # : script to happen to NOCALLMENU
    # : (like Scene_Battle, which would
    # : be really annoying)
    #===================================
    
    module Regendo
      
      unless @scripts
        @scripts = Hash.new
        def self.contains?(key)
          @scripts[key] == true
        end
      end
      @scripts["Menu_during_Message"] = true
      
      module Menu_during_Message
        
        #=======
        #CONFIG
        #=======
        NOCALLMENU = [Scene_Title, Scene_Battle] #scenes in which call_menu shall not work.
        BUTTON = Input::B #which button will trigger the menu?
      end
    end
      
    class Window_Message < Window_Base
    
      BUTTON = Regendo::Menu_during_Message::BUTTON
      NOCALLMENU = Regendo::Menu_during_Message::NOCALLMENU
      
      alias update_old update
      def update
        update_old
        call_menu if Input.trigger?(BUTTON) && !forbidden_scene_by_regendo
      end
      
      def call_menu
        Sound.play_ok
        SceneManager.call(Scene_Menu)
        Window_MenuCommand::init_command_position
      end
    
      def input_pause
        self.pause = true
        wait(10)
        
        case BUTTON
        when Input::B
          Fiber.yield until Input.trigger?(:C)
        when Input::C
          Fiber.yield until Input.trigger?(:B)
        else
          Fiber.yield until Input.trigger?(:B) || Input.trigger?(:C)
        end
        
        Input.update
        self.pause = false
      end
      
      def forbidden_scene_by_regendo
        return false unless NOCALLMENU
        NOCALLMENU.any? do |scene|
          SceneManager.scene_is?(scene)
        end
      end
    end
     
    Last edited by a moderator: Dec 16, 2016
    #1
  2. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    12,395
    Likes Received:
    12,630
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    Afraid you'll need a script edit. The author didn't write that in a way so that it can be turned off for some specific events (only for scenes). I can move this to script requests for you so you can request an edit if you wish.
     
    #2
  3. jumadelux

    jumadelux Villager Member

    Messages:
    23
    Likes Received:
    1
    Location:
    Bermuda
    First Language:
    English
    Yes, please,


    And thankyou for you respond, again :D
     
    #3
  4. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    12,395
    Likes Received:
    12,630
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    Ok


    Moved to RGSS3 Script Requests at OP's Request
     
    Last edited by a moderator: Dec 13, 2016
    #4
  5. jumadelux

    jumadelux Villager Member

    Messages:
    23
    Likes Received:
    1
    Location:
    Bermuda
    First Language:
    English
    Sorry but could I bump?
     
    #5
  6. Shaz

    Shaz Veteran Veteran

    Messages:
    37,912
    Likes Received:
    11,586
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Allocate a switch that you will turn on when you want the menu call disabled.  I'll use 15 in my example below, so where you see 15, replace it with the switch id you want to use (no leading zeros).


    Change this line:

    Code:
    call_menu if Input.trigger?(BUTTON) && !forbidden_scene_by_regendo
    to this:

    Code:
    call_menu if Input.trigger?(BUTTON) && !forbidden_scene_by_regendo && !$game_switches[15]


    Then turn that switch on when you want to disable the menu call, and off to enable it again.
     
    #6
  7. jumadelux

    jumadelux Villager Member

    Messages:
    23
    Likes Received:
    1
    Location:
    Bermuda
    First Language:
    English


    It works! Thankyou so much shaz!!! xD
     
    #7
    Shaz likes this.

Share This Page