Advertisement
TheSixth

Confirm Text Fix

Jul 27th, 2016
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.80 KB | None | 0 0
  1. module SaveConfirm
  2.  
  3.   Texts = {
  4.     :save => "Confirm Save",
  5.     :load => "Confirm Load",
  6.     :delete => "Confirm Delete",
  7.   }
  8.  
  9. end
  10.  
  11. class Scene_File < Scene_MenuBase
  12.  
  13.   alias fix_texts7762 confirm_choice
  14.   def confirm_choice
  15.     @confirm_window.ctext = SaveConfirm::Texts[@action_window.current_symbol]
  16.     @confirm_window.refresh
  17.     fix_texts7762
  18.   end
  19.  
  20. end
  21.  
  22. class Window_Confirm < Window_Command
  23.  
  24.   attr_accessor :ctext
  25.    
  26.   def alignment
  27.     return 1
  28.   end
  29.  
  30.   def make_command_list
  31.     txt = @ctext ? @ctext : ""
  32.     add_command(txt, :on_confirm_ok)
  33.     add_command("Nevermind", :on_confirm_cancel)
  34.   end
  35.  
  36.   def draw_item(index)
  37.     change_color(normal_color, command_enabled?(index))
  38.     draw_text(item_rect_for_text(index), command_name(index), alignment)
  39.   end
  40.  
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement