IceDragon200

Bel-ObjectiveScene

Jun 13th, 2011
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.93 KB | None | 0 0
  1. #==============================================================================
  2. # Simple Current Objective
  3. #   06/13/2011
  4. #------------------------------------------------------------------------------
  5. #   By Nathanial / Beleren
  6. #==============================================================================
  7. # + Installation
  8. #   Place this below Materials.
  9. #
  10. # + Menu Addition
  11. #   If you're using the default RMVX menu, please read my topic, as I have
  12. #   instructions on how to add a menu option to display the current objective
  13. #   screen. If you're not, please consult whoever wrote your menu script, as
  14. #   I cannot be bothered to help every person get this in their custom menu.
  15. #==============================================================================
  16.  
  17. #==============================================================================#
  18. # ** Current_Objective
  19. #==============================================================================#
  20. module Current_Objective
  21.  
  22.   module_function
  23.  
  24.   def option ; return "Objective" ; end
  25.  
  26.   Objective_Container = 1 # // This is the variable ID that holds current objective.
  27.   Background_Variable = 2 # // Used for managing the menubackground
  28.  
  29.   def current
  30.     case $game_variables[Objective_Container]
  31.     when 0 ; return "               Head to the ruins Northheast of Vance."
  32.     when 1 ; return "Talk to the Elder to intrude the haven."
  33.     when 2 ; return "Eat some cake."
  34.     when 3 ; return "And... another"
  35.     else   ; return "No Objective"  
  36.     end  
  37.   end
  38.  
  39.   def get_background()
  40.     case $game_variables[Background_Variable]
  41.     when 0 ; return Cache.picture( "beg-scene-01" )
  42.     when 1 ; return Cache.picture( "insert picture filename here" )
  43.     when 2 ; return Cache.picture( "insert picture filename here" )
  44.     when 3 ;
  45.     else   ; return Cache.picture( "" ) # // Return Blank Image
  46.     end  
  47.   end
  48.  
  49. end
  50.  
  51.  
  52. ###################################################################
  53. #  DO NOT EDIT UNLESS YOU KNOW WHAT TO DO                         #
  54. ###################################################################
  55. #==============================================================================#
  56. # ** Objective_Window
  57. #==============================================================================#
  58. class Objective_Window < Window_Base
  59.  
  60.   def initialize()
  61.     super(0, 0, Graphics.width, 150)#0,116,544,300
  62.     create_contents()
  63.     refresh()
  64.   end
  65.  
  66.   def objective_window_contents ; return Current_Objective::current ; end
  67.  
  68.   def refresh()
  69.     stb = -26
  70.     txw = -170
  71.     self.contents.clear()
  72.     line = objective_window_contents
  73.     self.contents.draw_text(0, txw += 20, 544, 416, line)
  74.   end
  75.  
  76. end
  77.  
  78. #==============================================================================#
  79. # ** Quest_Picture # Unused
  80. #==============================================================================#
  81. class Quest_Picture < Sprite
  82.  
  83.   def initialize()
  84.     super()
  85.     self.bitmap = Cache.picture(Current_Objective::picture)
  86.   end
  87.  
  88. end
  89.  
  90. #==============================================================================#
  91. # ** Objective_Screen
  92. #==============================================================================#
  93. class Objective_Screen < Scene_Base
  94.  
  95.   def start()
  96.     super()
  97.     create_menu_background()
  98.     @objective_window = Objective_Window.new
  99.     @menuback_sprite.color.set( 0, 0, 0, 255 )
  100.     @menuback_sprite.bitmap = Current_Objective.get_background()
  101.     #@qpic = Quest_Picture.new
  102.   end
  103.  
  104.   def terminate()
  105.     super()
  106.     dispose_menu_background()
  107.     @objective_window.dispose() unless @objective_window.nil?()
  108.     #@qpic.dispose
  109.   end
  110.  
  111.   def update()
  112.     super()
  113.     update_menu_background()
  114.     @objective_window.update()
  115.     update_objective_screen()
  116.   end
  117.  
  118.   def update_objective_screen
  119.     if Input.trigger?(Input::B)
  120.       Sound.play_cancel
  121.       $scene = Scene_Menu.new(5)
  122.     end
  123.   end
  124.  
  125. end
Advertisement
Add Comment
Please, Sign In to add comment