Advertisement
TroyZ

Error

Jan 31st, 2019
489
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.85 KB | None | 0 0
  1. # ==============================================================================
  2. # ▼▼▼▼▼▼                     TroyZ - FFL Mission Mode                     ▼▼▼▼▼▼
  3. # ==============================================================================
  4. # Change Logs :
  5. #
  6. # ------------------------------------------------------------------------------
  7. # Story dipisah2 berdasarkan misinya. Total ada 20 misi.
  8.  
  9. module AGUNG
  10.   module MISSION_MODE
  11.     MISSION_MODE_TITLE = "Mission Mode"
  12.     MISSION_LIST = {
  13.      #No.  Nama Misi      
  14.       1 => ["A New Leaf", 4],
  15.       2 => ["Suspicious Behavior", 5],
  16.       3 => ["Hidden Power", 6],
  17.     }
  18.   end
  19. end
  20.  
  21. # ------------------------------------------------------------------------------
  22. # Window_MissionModeTitle, judul scene
  23. # ------------------------------------------------------------------------------
  24. class Window_MissionModeTitle < Window_Base
  25.   include AGUNG::MISSION_MODE
  26.   def initialize
  27.     super(0, 0, 640, line_height * 2)
  28.   end
  29.  
  30.   def draw_help
  31.     draw_text(0, 0, 640, line_height, MISSION_MODE_TITLE, 1)
  32.   end
  33. end
  34. # ------------------------------------------------------------------------------
  35. # Window_MissionHelp, bantuan tombol yang dibawah
  36. # ------------------------------------------------------------------------------
  37. class Window_MissionHelp < Window_Base
  38.   def initialize
  39.     super(0, 435, 640, line_height * 2)
  40.   end
  41.  
  42.   def draw_help
  43.     @text = "Z : OK | X : Cancel | Q : Scroll Up | W : Scroll Down"
  44.     draw_text(0, 0, 640, line_height, @text, 1)
  45.   end
  46. end
  47. # ------------------------------------------------------------------------------
  48. # Window_MissionTitle, judul misi disebelah kanan
  49. # ------------------------------------------------------------------------------
  50. class Window_MissionTitle < Window_Base
  51.   def initialize
  52.     super(Graphics.width / 2, 48, Graphics.width / 2, line_height * 2)
  53.   end
  54.  
  55.   def draw_desc
  56.     @text = "Judul misi ditulis disini"
  57.     draw_text(0, 0, Graphics.width / 2, line_height, @text, 1)
  58.   end
  59. end
  60. # ------------------------------------------------------------------------------
  61. # Window_MissionDesc, deskripsi misi dibawahnya judul misi
  62. # ------------------------------------------------------------------------------
  63. class Window_MissionDesc < Window_Base
  64.   def initialize
  65.     super(Graphics.width / 2, 96, Graphics.width / 2, 339)
  66.   end
  67.  
  68.   def draw_desc
  69.     @text = "Deskripsi misi ditulis disini"
  70.     draw_text(0, 0, Graphics.width / 2, line_height, @text)
  71.   end
  72. end
  73. # ------------------------------------------------------------------------------
  74. # Window_MissionList, semua misi muncul disini
  75. # ------------------------------------------------------------------------------
  76. class Window_MissionList < Window_Selectable
  77.   include AGUNG::MISSION_MODE
  78.   def initialize(x, y, width, height)
  79.     super
  80.     @data = []
  81.   end
  82.  
  83.   def item_max
  84.     @data ? @data.size : 1
  85.   end
  86.  
  87.   def item
  88.     @data && index >= 0 ? @data[index] : nil
  89.   end
  90.  
  91.   def include?
  92.    
  93.   end
  94.  
  95.   def make_item_list
  96.     @data = MISSION_LIST.values.each do |item| item end
  97.     puts @data
  98.   end
  99.  
  100.   def draw_item(index)
  101.     item = @data[index]
  102.     if item
  103.       rect = item_rect(index)
  104.       rect.width -= 4
  105.       draw_text(x + 24, y + 24, width, line_height, item)
  106.     end
  107.   end
  108.  
  109.   def refresh
  110.     make_item_list
  111.     create_contents
  112.     draw_all_items
  113.   end
  114.  
  115.   def update
  116.     super
  117.     if @old_index != @index
  118.       refresh
  119.       @old_index = @index
  120.     end
  121.   end
  122. end
  123. # ------------------------------------------------------------------------------
  124. # Scene_MissionMode, disinilah semua ini berawal :v
  125. # ------------------------------------------------------------------------------
  126. class Scene_MissionMode < Scene_Base
  127.   def start
  128.     super    
  129.     create_background
  130.     create_mission_mode_title
  131.     create_mission_mode_help
  132.     create_mission_title
  133.     create_mission_desc
  134.     create_mission_list
  135.   end
  136.  
  137.   def create_background
  138.     @background_sprite = Sprite.new
  139.     @background_sprite.bitmap = SceneManager.background_bitmap
  140.     @background_sprite.color.set(16, 16, 16, 128)
  141.   end
  142.  
  143.   def create_mission_mode_title
  144.     @title = Window_MissionModeTitle.new
  145.     @title.draw_help
  146.   end
  147.  
  148.   def create_mission_mode_help
  149.     @help = Window_MissionHelp.new
  150.     @help.draw_help
  151.   end
  152.  
  153.   def create_mission_title
  154.     @mission_title = Window_MissionTitle.new
  155.     @mission_title.draw_desc
  156.   end
  157.  
  158.   def create_mission_desc
  159.     @mission_desc = Window_MissionDesc.new
  160.     @mission_desc.draw_desc
  161.   end
  162.  
  163.   def create_mission_list
  164.     @mission_list = Window_MissionList.new(0, 48, Graphics.width / 2, 387)
  165.     @mission_list.set_handler(:ok,     method(:on_item_ok))
  166.     @mission_list.set_handler(:cancel, method(:on_item_cancel))
  167.   end
  168.  
  169.   def on_item_ok
  170.  
  171.   end
  172.  
  173.   def on_item_cancel
  174.  
  175.   end
  176. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement