Advertisement
roninator2

Kid Friendly Basic Quest - Status Actor Hud

Dec 14th, 2024
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 6.05 KB | None | 0 0
  1. # ╔═════════════════════════════════════╦════════════════════╗
  2. # ║ Title: KFBQ Status Actor HUD        ║  Version: 1.00     ║
  3. # ║ Author: Roninator2                  ║                    ║
  4. # ╠═════════════════════════════════════╬════════════════════╣
  5. # ║ Function:                           ║   Date Created     ║
  6. # ║                                     ╠════════════════════╣
  7. # ║   FFMQ Style Actor Status HUD       ║    09 Mar 2023     ║
  8. # ╚═════════════════════════════════════╩════════════════════╝
  9. # ╔══════════════════════════════════════════════════════════╗
  10. # ║ Instructions:                                            ║
  11. # ║                                                          ║
  12. # ║  Set the Windows to look like FFMQ.                      ║
  13. # ║                                                          ║
  14. # ╚══════════════════════════════════════════════════════════╝
  15. # ╔══════════════════════════════════════════════════════════╗
  16. # ║ Terms of use:                                            ║
  17. # ║ Free for all uses in RPG Maker - Except nudity           ║
  18. # ╚══════════════════════════════════════════════════════════╝
  19.  
  20. #==============================================================================
  21. # ** Scene Status
  22. #==============================================================================
  23. class Scene_Status < Scene_MenuBase
  24.   #--------------------------------------------------------------------------
  25.   # * Start
  26.   #--------------------------------------------------------------------------
  27.   alias r2_status_hud_start  start
  28.   def start
  29.     r2_status_hud_start
  30.     start_hud
  31.   end
  32.   #--------------------------------------------------------------------------
  33.   # * Start HUD
  34.   #--------------------------------------------------------------------------
  35.   def start_hud
  36.     @actor1_hud = Actor_Hud_Window.new($game_party.members[0].id)
  37.     @actor2_hud = Actor_Hud_Window.new($game_party.members[1].id) if $game_party.members[1]
  38.     draw_no_actor if !$game_party.members[1]
  39.     @actor1_level = Actor_Level_Window.new($game_party.members[0].id)
  40.     @actor1_level.viewport = Viewport.new
  41.     @actor1_level.viewport.z += 100
  42.     @actor2_level = Actor_Level_Window.new($game_party.members[1].id) if $game_party.members[1]
  43.     @actor2_level.viewport = Viewport.new if $game_party.members[1]
  44.     @actor2_level.viewport.z += 100 if $game_party.members[1]
  45.     @actor1_name = Actor_Name_Window.new($game_party.members[0].id)
  46.     @actor1_name.viewport = Viewport.new
  47.     @actor1_name.viewport.z += 100
  48.     @actor2_name = Actor_Name_Window.new($game_party.members[1].id) if $game_party.members[1]
  49.     @actor2_name.viewport = Viewport.new if $game_party.members[1]
  50.     @actor2_name.viewport.z += 100 if $game_party.members[1]
  51.     @actor2_control = Actor_Control_Window.new($game_party.members[1].id) if $game_party.members[1]
  52.     @actor2_control.viewport = Viewport.new if $game_party.members[1]
  53.     @actor2_control.viewport.z += 100 if $game_party.members[1]
  54.   end
  55.   #--------------------------------------------------------------------------
  56.   # * Update
  57.   #--------------------------------------------------------------------------
  58.   alias r2_menu_hud_update    update
  59.   def update
  60.     r2_menu_hud_update
  61.     @actor1_hud.update
  62.     if @actor2_hud == nil
  63.       @actor2_hud = Actor_Hud_Window.new($game_party.members[1].id) if $game_party.members[1]
  64.       @actor2_control = Actor_Control_Window.new($game_party.members[1].id) if $game_party.members[1]
  65.       draw_no_actor if !$game_party.members[1] && (@no_actor == 0)
  66.     else
  67.       remove_blank_space if $game_party.members[1]
  68.       clean_actor if !$game_party.members[1]
  69.       @actor2_hud.update if $game_party.members[1]
  70.     end
  71.   end
  72.   #--------------------------------------------------------------------------
  73.   # * Remove Window if no second player
  74.   #--------------------------------------------------------------------------
  75.   def clean_actor
  76.     return if @actor2_hud == nil
  77.     @actor2_hud.dispose
  78.     @actor2_hud = nil
  79.     @actor2_level.dispose
  80.     @actor2_control.dispose
  81.     @actor2_name.dispose
  82.   end
  83.   #--------------------------------------------------------------------------
  84.   # * Draw place holder image when no second player
  85.   #--------------------------------------------------------------------------
  86.   def draw_no_actor
  87.     @no_actor = Sprite.new
  88.     @no_actor.bitmap = Cache.system("Blank_Actor")
  89.     @no_actor.x = Graphics.width / 2
  90.     @no_actor.y = Graphics.height - 100
  91.     @no_actor.z = 2
  92.   end
  93.   #--------------------------------------------------------------------------
  94.   # * Remove place holder image when second player added
  95.   #--------------------------------------------------------------------------
  96.   def remove_blank_space
  97.     return if (@no_actor == 0) || (@no_actor == nil)
  98.     @no_actor.bitmap.dispose
  99.     @no_actor.dispose
  100.     @no_actor = 0
  101.   end
  102.   #--------------------------------------------------------------------------
  103.   # * Terminate
  104.   #--------------------------------------------------------------------------
  105.   alias r2_terminator_menu_sprite  terminate
  106.   def terminate
  107.     r2_terminator_menu_sprite
  108.     remove_blank_space
  109.   end
  110. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement