🤔 Para Refletir : "A verdadeira ideia criativa vem do momento mais simplório do dia." - Yonori Akari

[Ace] Atalhos para Scenes

Membro Membro
Postagens
206
Bravecoins
148
Atalhos para Scenes
Script original por Rafidelis, conversão por Takkun.

Esse Script possibilita que você acesse as opções do Menu,sem precisar entrar no menu,isso ocorre através de atalhos, demais informações no script.

Ruby:
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#===============================================================================
#                       S C E N E    A T A L H O S   
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#    By : RAFIDELIS
#    Convertido por: Faalco
#    Email: Rafa_fidelis@hotmail.com Rafa_fidelis@yahoo.com.br
#-------------------------------------------------------------------------------
#    AGRADECIMENTOS: Primeiramente ao Marcelo Cavaco,pelas apostilas
#    Destrinchando o RGSS e Conhecendo os Scripts RGSS,pois estão me
#    auciliando muito na minha caminhada scriptere tambem ao Dark Chocobo,LB,
#    RTH e PHCDO,valew msm gente!
#    A toda galera Maker do Brasil(claro sem vocês eu não teria motivos para
#    tentar fazer scripts)
#    E aos foruns de RpgMaker do Brasil,destaque para www.ReinoRpg.com.     
#===============================================================================
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

module Rafis
#===============================================================================|
#                I N I C I O  D A S  C O N F I G U R A Ç Õ E S
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
#     DEFINA ABAIXO QUAIS TECLAS SERÃO RESPONSAVEIS POR CHAMAR CADA SCENE
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
#           Vide Fim do Script as teclas que você pode utilizar
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
TECLA_ATALHO_ITEM = Input::F5                       # F5 no teclado
TECLA_ATALHO_HABILIDADES = Input::F6                # F6 no teclado
TECLA_ATALHO_EQUIPAMENTOS = Input::F7               # F7 no teclado
TECLA_ATALHO_STATUS = Input::F8                     # F8 no teclado
TECLA_ATALHO_SAVE = Input::L                        # Q no teclado
TECLA_ATALHO_LOAD = Input::R                        # W no teclado
end
#===============================================================================|
#                    R E T O R N A R   A O   M E N U ?
# true = Para quando você acessar um atalho,ao pressionar ESC retornar ao Menu,
# essa modificação tambem sera ativada quando você entrar no menu do jogo.
# false = Para quando você acessar um atalho,ao pressionar ESC retornar ao Mapa
#===============================================================================|

RETORNAR_AO_MENU = false

#===============================================================================
#                    I N I C I O   D O  S C R I P T
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Scene_Map
  alias rafidelis_atalhos_update update
  def update
    rafidelis_atalhos_update
    rafis_atalho_item if Input.trigger?(Rafis::TECLA_ATALHO_ITEM)
    rafis_atalho_habilidades if Input.trigger?(Rafis::TECLA_ATALHO_HABILIDADES)
    rafis_atalho_equipamentos if Input.trigger?(Rafis::TECLA_ATALHO_EQUIPAMENTOS)
    rafis_atalho_status if Input.trigger?(Rafis::TECLA_ATALHO_STATUS)
    rafis_atalho_save if Input.trigger?(Rafis::TECLA_ATALHO_SAVE)
    rafis_atalho_load if Input.trigger?(Rafis::TECLA_ATALHO_LOAD)
  end
end
#===============================================================================
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  def rafis_atalho_item
    Sound.play_cursor   
    $scene = SceneManager.call(Scene_Item)
    if Input.trigger?(Input::B)
      retornar
    end
  end
#===============================================================================
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
class Scene_Item
  alias retornar return_scene
  def return_scene
    retornar
    if RETORNAR_AO_MENU == true
      $scene = SceneManager.call(Scene_Menu)
    else
      $scene = SceneManager.call(Scene_Map)
    end
  end
end

#===============================================================================
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  def rafis_atalho_habilidades
    Sound.play_cursor
    $scene = SceneManager.call(Scene_Skill)
    if Input.trigger?(Input::B)
      retornar_1
    end
  end
#===============================================================================
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 class Scene_Skill
    alias retornar_1 return_scene
    def return_scene
      retornar_1
      if RETORNAR_AO_MENU == true
      $scene = SceneManager.call(Scene_Menu)
    else
      $scene = SceneManager.call(Scene_Map)
    end
  end
end
#===============================================================================
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  def rafis_atalho_equipamentos
    Sound.play_cursor
    $scene = SceneManager.call(Scene_Equip)
    if Input.trigger?(Input::B)
      retornar_2
    end
  end
#===============================================================================
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  class Scene_Equip
    alias retornar_2 return_scene
    def return_scene
      retornar_2
      if RETORNAR_AO_MENU == true
      $scene = SceneManager.call(Scene_Menu)
    else
      $scene = SceneManager.call(Scene_Map)
    end   
  end
end

#===============================================================================
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  def rafis_atalho_status
    Sound.play_cursor
    $scene = SceneManager.call(Scene_Status)
    if Input.trigger?(Input::B)
      retornar_3
    end
  end
#===============================================================================
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  class Scene_Status
    alias retornar_3 return_scene
    def return_scene
      retornar_3
      if RETORNAR_AO_MENU == true
      $scene = SceneManager.call(Scene_Menu)
    else
      $scene = SceneManager.call(Scene_Map)     
    end
  end
end

#===============================================================================
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  def rafis_atalho_save
    Sound.play_cursor
    $scene = SceneManager.call(Scene_Save)
    if Input.trigger?(Input::B)
      retornar_4
    end
  end
    
#===============================================================================
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def rafis_atalho_load
    Sound.play_cursor
    $scene = SceneManager.call(Scene_Load)
    if Input.trigger?(Input::B)
      retornar_4
    end
  end
 
  class Scene_File
    alias retornar_4 return_scene
    def return_scene
      retornar_4
      if RETORNAR_AO_MENU == true
        $scene = SceneManager.call(Scene_Menu)
      else
        $scene = SceneManager.call(Scene_Map)
        end
      end
    end
#===============================================================================
#                         F I M   D O  S C R I P T
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

=begin
#===============================================================================
#                L I S T A   D E   T E C L A S   
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Primeiramente gostaria de Agradecer ao RTH e PHCDO pois peguei essa lista em uma
das aulas deles^^

# Teclas:
    # Tecla DOWN
    Input::DOWN # => Seta para baixo do teclado
  
    # Tecla UP
    Input::UP # => Seta para cima do teclado
  
    # Tecla RIGHT
    Input::RIGHT # => Seta para direita do teclado
  
    # Tecla LEFT
    Input::LEFT # => Seta para esquerda do teclado
  
    # Tecla A
    Input::A # => Tecla Z do teclado
  
    # Tecla B
    Input::B # => Tecla X do teclado
  
    # Tecla C
    Input::C # => Tecla C do teclado
  
    # Tecla X
    Input::X # => Tecla A do teclado
  
    # Tecla Y
    Input::Y # => Tecla S do teclado
  
    # Tecla Z
    Input::Z # => Tecla D do teclado
  
    # Tecla L
    Input::L # => Tecla Q do teclado
  
    # Tecla R
    Input::R # => Tecla W do teclado
  
    # Tecla SHIFT
    Input::SHIFT # => Tecla Shift do teclado
  
    # Tecla CTRL
    Input::CTRL # => Tecla Ctrl do teclado
  
    # Tecla ALT
    Input::ALT # => Tecla Alt do teclado
  
    # Tecla F5
    Input::F5 # => Tecla F5 do teclado
  
    # Tecla F6
    Input::F6 # => Tecla F6 do teclado
  
    # Tecla F7
    Input::F7 # => Tecla F7 do teclado
  
    # Tecla F8
    Input::F8 # => Tecla F8 do teclado
  
    # Tecla F9
    Input::F9 # => Tecla F9 do teclado
=end

 
Voltar
Topo