Advertisement
roninator2

Kid Friendly Basic Quest - System Actor Hud

Dec 14th, 2024
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 6.86 KB | None | 0 0
  1. # ╔═════════════════════════════════════╦════════════════════╗
  2. # ║ Title: KFBQ System Actor HUD        ║  Version: 1.00     ║
  3. # ║ Author: Roninator2                  ║                    ║
  4. # ╠═════════════════════════════════════╬════════════════════╣
  5. # ║ Function:                           ║   Date Created     ║
  6. # ║                                     ╠════════════════════╣
  7. # ║   FFMQ Style Actor System 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 System
  22. #==============================================================================
  23. class Scene_KFBQSystem < Scene_MenuBase
  24.   #--------------------------------------------------------------------------
  25.   # * Start
  26.   #--------------------------------------------------------------------------
  27.   alias r2_options_hud_start  start
  28.   def start
  29.     r2_options_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_options_hud_update    update
  59.   def update
  60.     r2_options_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.     check_figure
  72.   end
  73.   #--------------------------------------------------------------------------
  74.   # * Select what image to show for HP bar
  75.   #--------------------------------------------------------------------------
  76.   def check_figure
  77.     @figure = $game_system.life_indicator? if @figure.nil?
  78.     return if @figure == $game_system.life_indicator?
  79.     @actor1_hud.refresh if @figure != $game_system.life_indicator?
  80.     @actor2_hud.refresh if @figure != $game_system.life_indicator? && $game_party.members[1]
  81.     @figure = $game_system.life_indicator?
  82.   end
  83.   #--------------------------------------------------------------------------
  84.   # * Remove Window if no second player
  85.   #--------------------------------------------------------------------------
  86.   def clean_actor
  87.     return if @actor2_hud == nil
  88.     @actor2_hud.dispose
  89.     @actor2_hud = nil
  90.     @actor2_level.dispose
  91.     @actor2_control.dispose
  92.     @actor2_name.dispose
  93.   end
  94.   #--------------------------------------------------------------------------
  95.   # * Draw place holder image when no second player
  96.   #--------------------------------------------------------------------------
  97.   def draw_no_actor
  98.     @no_actor = Sprite.new
  99.     @no_actor.bitmap = Cache.system("Blank_Actor")
  100.     @no_actor.x = Graphics.width / 2
  101.     @no_actor.y = Graphics.height - 100
  102.     @no_actor.z = 2
  103.   end
  104.   #--------------------------------------------------------------------------
  105.   # * Remove place holder image when second player added
  106.   #--------------------------------------------------------------------------
  107.   def remove_blank_space
  108.     return if (@no_actor == 0) || (@no_actor == nil)
  109.     @no_actor.bitmap.dispose
  110.     @no_actor.dispose
  111.     @no_actor = 0
  112.   end
  113.   #--------------------------------------------------------------------------
  114.   # * Terminate
  115.   #--------------------------------------------------------------------------
  116.   alias r2_terminator_custom_sprite  terminate
  117.   def terminate
  118.     r2_terminator_custom_sprite
  119.     remove_blank_space
  120.   end
  121.   #--------------------------------------------------------------------------
  122.   # * Call for changing values
  123.   #--------------------------------------------------------------------------
  124.   def change_data(value = false)
  125.     update
  126.   end
  127. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement