Menambahkan pilihan baru di menu utama RMVXA

Di RMVXA normalnya pada menu utama cuma ada command New Game, Continue, dan shutdown.
Script ini membuat kamu bisa menambahkan satu command lagi di bawah command continue.


Cara pemasangan dan konfigurasi ada di script.
Berikut Scriptnya :
#==============================================================================
# File    : SA31 - Window Title
# Author  : Syamsul Anwar
# Contact : tkdpalapa@gmail.com
#==============================================================================
      Switch = true # On/Off
#==============================================================================
=begin
  
    Cara pasang :
    Taruh di antara ▼ Matrial & ▼ Main
    
    Fungsi :
    Script ini untuk nambahin command baru setelah command Continue
    
=end
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#
#                                Konfigurasi                                   #
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#
  module Sa31
    module Credits
   #==========================================================================
   # Tampilan
   #==========================================================================
    # Nama command
    Name    = "Nama Command"
    # Warna teks
    Color   = 0 # <= Default 0
   #==========================================================================
   # Ukuran Window
   #==========================================================================
    Kiri     = 40 #x
    Atas     = 30 #y
    Panjang  = 544 - 40 * 2 #width
    Lebar    = 416 - 30 * 2 #height    
   #=========================================================================#
   # Petunjuk :                                                              #
   # Jika ingin menambahkan text, Tulis dengan format berikut :              #
   #                                                                         #
   # "Baris" => "Teks",                                                      #
   # "Jarak[Baris]" => (x),                                                  #
   #                                                                         #
   # Begini yang gue maksud :                                                #
   #                                                                         #
   # "3" => "Welcome",                                                       #
   # "Jarak_3 => 200,                                                        #
   #-------------------------------------------------------------------------#
   # Catatan: jangan lupakan tanda koma(,)                                   #
   #=========================================================================#
    T = { 
   #==========================================================================
   # Isi
   #==========================================================================
     
      "2"       => "Welcome!",
      "Jarak_2" => 50,
      
      "7"       => "Sample Text",
      "Jarak_7" => 170,
      
      # Tambakan disini
      
   #==========================================================================
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#
#                              Akhir Konfigurasi                               #
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#
    } # <= Jangan disentuh
  end
end

if Switch

class Scene_Title < Scene_Base

  alias ccw1 create_command_window
  def create_command_window
    ccw1
    @command_window.set_handler(:sa31, method(:command_sa31))
  end

  def command_sa31
    close_command_window
    SceneManager.call(Sa31WindowTitle)
  end

end

class Window_TitleCommand < Window_Command

  def make_command_list
    add_command(Vocab::new_game, :new_game)
    add_command(Vocab::continue, :continue, continue_enabled)
    add_command(Sa31::Credits::Name , :sa31)
    add_command(Vocab::shutdown, :shutdown)
  end

end

class Sa31WindowTitle < Scene_MenuBase
  include Sa31::Credits
  def start
    super
     @credits = Credits.new(Kiri, Atas, Panjang, Lebar)
   end
   
   def update
     Input.update
     Graphics.update
     return_scene if Input.trigger?(:B)
   end
end
  
class Credits < Window_Base
  include Sa31::Credits
  def initialize(kiri,atas,panjang,lebar)
    super(kiri,atas,panjang,lebar)
    refresh
  end
  
  def teks(jarak,teks,baris)
    @teks  = teks
    @jarak = jarak
    @baris = (baris - 1) * 24
    draw_text(@jarak,@baris,contents.width,line_height,@teks)
  end
  
  def refresh
    contents.clear
    x = 0 if !x
    contents.font.size = 24
    until x >= 20
     x += 1
     change_color(text_color(Sa31::Credits::Color))
     if T["Jarak_#{x}"] && T["#{x}"]
      teks(T["Jarak_#{x}"],T["#{x}"],x)
     end
     puts "Baris #{x} = #{T["#{x}"]}"
    end
  end
  
end
end
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
#                                                                              #
#                             Akhir dari file..                                #
#                                                                              #
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#

Tidak ada komentar:

Posting Komentar