Advertisement
FlipelyFlip

Mog's Skill Issue Patch

Aug 27th, 2024 (edited)
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.92 KB | None | 0 0
  1. class Scene_Skill
  2.   #--------------------------------------------------------------------------
  3.   # ● Create Item Window
  4.   #--------------------------------------------------------------------------
  5.   def create_item_window
  6.       @skill_window = []
  7.       index = 0
  8.       window_max = @actor.added_skill_types.size
  9.       window_max = 1 if window_max == 0
  10.       for item in 0...window_max
  11.           @skill_window.push(Window_SkillList_Menu.new(196,95,205,240))
  12.           @skill_window[index].setup(@actor,@actor.added_skill_types[index],index)
  13.           @skill_window[index].help_window = @help_window
  14.           @skill_window[index].set_handler(:ok,     method(:on_item_ok))
  15.           @skill_window[index].set_handler(:cancel, method(:on_item_cancel))
  16.           @skill_window[index].active = false
  17.           @skill_window[index].index = -1
  18.           @skill_window[index].opacity = 0
  19.           @skill_window[index].contents_opacity = 0
  20.           @item_slide_range = [@skill_window[index].x, @skill_window[index].x + 50]
  21.           @skill_window[index].x = @item_slide_range[1]
  22.           index += 1
  23.       end  
  24.       @item_pre_index = @skill_window[@command_window.index].index
  25.       @old_command_index = @skill_window[@command_window.index].index
  26.   end  
  27.   #--------------------------------------------------------------------------
  28.   # ● Update Active
  29.   #--------------------------------------------------------------------------      
  30.   def update_active
  31.     if @last_phase != @phase
  32.       @last_phase = @phase
  33.       if @phase == 0
  34.          @skill_window[@command_window.index].active = false
  35.          @command_window.active = true
  36.          @actor_window.active = false
  37.       elsif @phase == 1
  38.          @skill_window[@command_window.index].active = true
  39.          @command_window.active = false
  40.          @actor_window.active = false
  41.       elsif @phase == 2
  42.          @skill_window[@command_window.index].active = false
  43.          @command_window.active = false
  44.          @actor_window.active = true
  45.       end
  46.     end
  47.   end
  48.   #--------------------------------------------------------------------------
  49.   # ● Update Windows
  50.   #--------------------------------------------------------------------------    
  51.   def update_windows
  52.       @press_lag -= 1 if @press_lag > 0
  53.       return if @command_window == nil
  54.       for skw in @skill_window
  55.           skw.update unless @press_lag > 0
  56.           if skw.windows_index == @command_window.index
  57. #~              skw.active = true
  58.              if @phase == 0
  59.                 skw.index = 0 if skw.index < 0 or skw.index >= skw.item_max
  60.              end  
  61.              skw.visible = true
  62.           else  
  63.              skw.visible = false
  64.              skw.active = false
  65.           end  
  66.       end
  67.       #@skill_window[@command_window.index].update
  68.       @command_window.update    
  69.       @actor_window.update
  70.       update_actor_window_slide
  71.       update_skill_list_slide
  72.   end
  73. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement