Advertisement
Holy87

Localization Tool - ENG

Aug 6th, 2015
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 27.39 KB | None | 0 0
  1. =begin
  2.  ==============================================================================
  3.   ■ Localization Tool (Holy87)
  4.       version 1.0.1
  5.       User difficulty: ★
  6.       License: CC-BY. Everyone can distribute this script and use in their free
  7.       and commercial games. Credit required.
  8.  ==============================================================================
  9.     This script automatically localize a completed project, creating a specific
  10.     language file.
  11.  ==============================================================================
  12.   ■ Compatibility
  13.     Requires the localization script.
  14.  ==============================================================================
  15.   ■ Installation & Instructions
  16.     ● Install this script under Materials and Localization script and before the Main.
  17.     ● Make sure to have created the Localization folder in the project root.
  18.     ● MAKE A BACKUP COPY. The tool will modify definitely ALL the dialogues, so
  19.       be sure to have a copy of the project in case something will be wrong.
  20.     ● Start the game in TEST mode, then in the title screen press LEFT+ESC.
  21.       Select a language in which will be created the localization file (if
  22.       there aren't select other, then you can configure the header manually
  23.       later).
  24.     ● At the end of the operation, the language file will be created.
  25.     ● IMPORTANT: Just the conversion end, close RPG Maker WITHOUT saving
  26.       (otherwise the changes will be overriden), then reopen the project.
  27.    
  28.    
  29.   ■ What the tool does
  30.      
  31.     ● Creates a language file in Localization folder, with proper header and strings
  32.     ● Fetches all the database and writes all the heroes, classes, skills, items,
  33.       weapons, armors, enemies and states informations
  34.       gli eroi, classi, skill, oggetti, armi, armature, nemici e stati
  35.     ● Searches in all maps, battles and common events all the dialogues and, when
  36.       it finds them, it creates the string with the key inside the file and
  37.       EDITS the dialog with the created string key.
  38.     ● Writes the map names also.
  39.    
  40.   ■ What not does the tool
  41.  
  42.     ● Traduction. There's no traduction, once created the localization, you
  43.       must translate every string of the file for the other languages.
  44.     ● Create a localization for script strings. I'm sorry, but this is a job
  45.       that you must do manually.
  46.      
  47.  ==============================================================================
  48. =end
  49. module LocalizationOptions
  50.   #--------------------------------------------------------------------------
  51.   # * Languages of the menu. It's just a convenience to create languages already
  52.   #   with the header configured. The Other command creates the language file,
  53.   #   but you must edit the header manually.
  54.   #--------------------------------------------------------------------------
  55.   LANGUAGES = {
  56.   #ID      #short     #complete name
  57.   1033  => ["en",     "English"],             #english-united states
  58.   1040  => ["it",     "Italiano"],            #traditional italian
  59.   1036  => ["fr",     "Français"],            #french
  60.   1031  => ["de",     "Deutsch"],             #german
  61.   1034  => ["es",     "Español"],             #spanish
  62.   1030  => ["da",     "Danske"],              #danish
  63.   1026  => ["bg-BG"   "Belgian"],             #belgian
  64.   1027  => ["ca-ES"   "Català"],              #catalan
  65.   1041  => ["jp",     "日本 - 日本語"],           #japanese
  66.   1042  => ["ko",     "한국의"],                #korean
  67.   1049  => ["ru",     "Pусский"],             #russian
  68.   2055  => ["de-BG",  "Deutsch - Schweizer"], #german-swiss
  69.   4103  => ["de-LU",  "Deutsch - Luxemburg"], #german-luxemburg
  70.   2057  => ["en-UL",  "English - UK"],        #english-united kingdom
  71.   3081  => ["en-AU",  "English - Australia"], #english-australian
  72.   4105  => ["en-CA",  "English - Canada"],    #english-canadian
  73.   5129  => ["en-NZ",  "English - New Zeland"],#english-new zeland
  74.   2058  => ["es-MX",  "Español - México"],    #spanish-mexico
  75.   11274 => ["es-AR",  "Español - Cile"],      #spanish-cile
  76.   2060  => ["fr-BE",  "Français - Belgique"], #french-belgium
  77.   4108  => ["fr-CH",  "Français - Suisse"],   #french-swiss
  78.   2064  => ["it-CH",  "Italiano - Svizzera"], #italian-swiss
  79.   0     => ["na",     "Other"],  #other language to configure manually
  80.   }
  81.   #--------------------------------------------------------------------------
  82.   # * Vocables
  83.   #--------------------------------------------------------------------------
  84.   VOCABS = {
  85.   :start => "Start the conversion",
  86.   :select=> "Language select",
  87.   :exit  => "Exit",
  88.   :wait  => "File creation %s done...",
  89.   :done  => "Language creation completed.",
  90.   }
  91.   #--------------------------------------------------------------------------
  92.   # * The string keys that will be generated.
  93.   #--------------------------------------------------------------------------
  94.   STRING = "Map[%03d] Ev[%03d] Page %02d Line %d"
  95.   CHOICE = "Map[%03d] Ev[%03d] Page %02d Line %d - %d"
  96.   BATTLE = "Troop[%03d] Page %02d Line %d"
  97.   BATTLC = "Troop[%03d] Page %02d Line %d - %d"
  98.   COMMON = "C. Ev[%03d] Line %d"
  99.   COMMOC = "C. Ev[%03d] Line %d - %d"
  100.   MAPNAM = "Map[%03d] Name"
  101.  
  102. #--------------------------- END OF THE SCRIPT ------------------------------
  103.  
  104.  
  105.  
  106.  
  107.  
  108.   #--------------------------------------------------------------------------
  109.   # * Returns the proper vocab
  110.   #--------------------------------------------------------------------------
  111.   def vocab(vocab_id)
  112.     return VOCABS[vocab_id]
  113.   end
  114. end
  115.  
  116. #==============================================================================
  117. # ** Scene_Localization
  118. #------------------------------------------------------------------------------
  119. #  Scene for localization tool
  120. #==============================================================================
  121. class Scene_Localization < Scene_MenuBase
  122.   include LocalizationOptions
  123.   #--------------------------------------------------------------------------
  124.   # * start
  125.   #--------------------------------------------------------------------------
  126.   def start
  127.     super
  128.     create_localization_window
  129.     create_language_window
  130.     create_popup_window
  131.   end
  132.   #--------------------------------------------------------------------------
  133.   # * localization window creation
  134.   #--------------------------------------------------------------------------
  135.   def create_localization_window
  136.     @localization_window = Window_LocalizationInfo.new
  137.     @localization_window.set_handler(:start, method(:open_language))
  138.     @localization_window.set_handler(:cancel, method(:return_scene))
  139.     @localization_window.activate
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # * language list windows creation
  143.   #--------------------------------------------------------------------------
  144.   def create_language_window
  145.     x = @localization_window.x
  146.     @language_window = Window_LanguageList.new(x, 0, 250, Graphics.height)
  147.     @language_window.set_handler(:ok, method(:start_creation))
  148.     @language_window.set_handler(:cancel, method(:open_localization))
  149.   end
  150.   #--------------------------------------------------------------------------
  151.   # * popup window creation
  152.   #--------------------------------------------------------------------------
  153.   def create_popup_window
  154.     @popup_window = Window_ToolPpup.new
  155.     @popup_window.set_pressure_method(method(:process_done))
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # * start creation
  159.   #--------------------------------------------------------------------------
  160.   def start_creation
  161.     @language_window.openness = 0
  162.     @popup_window.visible = true
  163.     @popup_window.set_text(vocab(:wait))
  164.     Graphics.update
  165.     localization_tool = Loc_Tool.new(@language_window.item)
  166.     localization_tool.start_creating
  167.     @popup_window.activate
  168.     @popup_window.set_text(sprintf(vocab(:done), localization_tool.file_name))
  169.   end
  170.   #--------------------------------------------------------------------------
  171.   # * language selection process
  172.   #--------------------------------------------------------------------------
  173.   def open_language
  174.     @localization_window.close
  175.     @language_window.open
  176.     @language_window.activate
  177.   end
  178.   #--------------------------------------------------------------------------
  179.   # * localization process (back)
  180.   #--------------------------------------------------------------------------
  181.   def open_localization
  182.     @language_window.close
  183.     @localization_window.open
  184.     @localization_window.activate
  185.   end
  186.   #--------------------------------------------------------------------------
  187.   # * localization done
  188.   #--------------------------------------------------------------------------
  189.   def process_done
  190.     @popup_window.visible = false
  191.     @popup_window.deactivate
  192.     @localization_window.open
  193.     @localization_window.activate
  194.   end
  195. end
  196.  
  197. #==============================================================================
  198. # ** Window_LocalizationInfo
  199. #------------------------------------------------------------------------------
  200. #  window for localization commands
  201. #==============================================================================
  202. class Window_LocalizationInfo < Window_Command
  203.   include LocalizationOptions
  204.   #--------------------------------------------------------------------------
  205.   # * initialize
  206.   #--------------------------------------------------------------------------
  207.   def initialize
  208.     super(0, 0)
  209.     update_placement
  210.     self.openness = 0
  211.     open
  212.   end
  213.   #--------------------------------------------------------------------------
  214.   # * Get Window Width
  215.   #--------------------------------------------------------------------------
  216.   def window_width
  217.     return 250
  218.   end
  219.   #--------------------------------------------------------------------------
  220.   # * Update Window Position
  221.   #--------------------------------------------------------------------------
  222.   def update_placement
  223.     self.x = (Graphics.width - width) / 2
  224.     self.y = (Graphics.height * 1.6 - height) / 2
  225.   end
  226.   #--------------------------------------------------------------------------
  227.   # * Create Command List
  228.   #--------------------------------------------------------------------------
  229.   def make_command_list
  230.     add_command(vocab(:start), :start)
  231.     add_command(vocab(:exit), :cancel)
  232.   end
  233. end
  234.  
  235. #==============================================================================
  236. # ** Window_LanguageList
  237. #------------------------------------------------------------------------------
  238. #  Shows the list of avaiable language for this tool
  239. #==============================================================================
  240. class Window_LanguageList < Window_Selectable
  241.   include LocalizationOptions
  242.   #--------------------------------------------------------------------------
  243.   # * Object initialization
  244.   #--------------------------------------------------------------------------
  245.   def initialize(x, y, width, height)
  246.     super
  247.     make_language_list
  248.     create_contents
  249.     refresh
  250.     self.index = 0
  251.     self.openness = 0
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # * Make language list
  255.   #--------------------------------------------------------------------------
  256.   def make_language_list
  257.     @data = get_languages(LANGUAGES)
  258.   end
  259.   #--------------------------------------------------------------------------
  260.   # * Get Number of Items
  261.   #--------------------------------------------------------------------------
  262.   def item_max
  263.     @data ? @data.size : 0
  264.   end
  265.   #--------------------------------------------------------------------------
  266.   # * draw_item
  267.   #   index: indice dell
  268.   #--------------------------------------------------------------------------
  269.   def draw_item(index)
  270.     item = @data[index]
  271.     if item
  272.       rect = item_rect(index)
  273.       rect.width -= 4
  274.       draw_text(rect, item.name)
  275.     end
  276.   end
  277.   #--------------------------------------------------------------------------
  278.   # * Selected item
  279.   #--------------------------------------------------------------------------
  280.   def item
  281.     return @data[@index]
  282.   end
  283.   #--------------------------------------------------------------------------
  284.   # * Get all languages
  285.   #--------------------------------------------------------------------------
  286.   def get_languages(hash)
  287.     ary = []
  288.     hash.each_pair do |a, b|
  289.       ary.push(Language.new(a, b[0], b[1]))
  290.     end
  291.     return ary
  292.   end
  293. end    
  294.  
  295. #==============================================================================
  296. # ** Window_ToolPpup
  297. #------------------------------------------------------------------------------
  298. #  Window that appears when the localization is finished
  299. #==============================================================================
  300. class Window_ToolPpup < Window_Base
  301.   #--------------------------------------------------------------------------
  302.   # * Object initialization
  303.   #--------------------------------------------------------------------------
  304.   def initialize
  305.     super(0,0,0,line_height + standard_padding*2)
  306.     deactivate
  307.     self.visible = false
  308.   end
  309.   #--------------------------------------------------------------------------
  310.   # * Set new text
  311.   #   text = new text
  312.   #--------------------------------------------------------------------------
  313.   def set_text(text)
  314.     width = text_size(text).width + self.padding*2
  315.     self.width = width
  316.     x = (Graphics.width - width)/2
  317.     y = (Graphics.height - height)/2
  318.     @text = text
  319.     refresh
  320.   end
  321.   #--------------------------------------------------------------------------
  322.   # * set the method launched when pressing :C
  323.   #--------------------------------------------------------------------------
  324.   def set_pressure_method(mth)
  325.     @method = mth
  326.   end
  327.   #--------------------------------------------------------------------------
  328.   # * Refresh
  329.   #--------------------------------------------------------------------------
  330.   def refresh
  331.     create_contents
  332.     return if @text.nil?
  333.     draw_text(0,0,contents_width, line_height, @text)
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # * Update
  337.   #--------------------------------------------------------------------------
  338.   def update
  339.     super
  340.     check_pressure if self.active == true
  341.   end
  342.   #--------------------------------------------------------------------------
  343.   # * Pressure check
  344.   #--------------------------------------------------------------------------
  345.   def check_pressure
  346.     return unless @method
  347.     @method.call if Input.trigger?(:C) or Input.trigger?(:B)
  348.   end
  349. end
  350.  
  351. #==============================================================================
  352. # ** Loc_Tool
  353. #------------------------------------------------------------------------------
  354. #  Localization class that parses all the game and creates the file.
  355. #==============================================================================
  356. class Loc_Tool
  357.   include LocalizationOptions
  358.   #--------------------------------------------------------------------------
  359.   # * Object initialization
  360.   #   language: language object
  361.   #--------------------------------------------------------------------------
  362.   def initialize(language)
  363.     @id = language.id
  364.     @short = language.short
  365.     @name = language.name
  366.   end
  367.   #--------------------------------------------------------------------------
  368.   # * Returns the language file name
  369.   #--------------------------------------------------------------------------
  370.   def file_name
  371.     H87Localization.language_folder+"/#{@short}.ini"
  372.   end
  373.   #--------------------------------------------------------------------------
  374.   # * Creation process
  375.   #--------------------------------------------------------------------------
  376.   def start_creating
  377.     File.open(file_name,"w") do |file|
  378.       file.write(header)
  379.       file.write(actors)
  380.       file.write(classes)
  381.       file.write(skills)
  382.       file.write(items)
  383.       file.write(weapons)
  384.       file.write(armors)
  385.       file.write(enemies)
  386.       file.write(states)
  387.       file.write(terms)
  388.       file.write(dialogs)
  389.     end
  390.   end
  391.   #--------------------------------------------------------------------------
  392.   # * Header creation
  393.   #--------------------------------------------------------------------------
  394.   def header
  395.     mp = Mark_Parser.new("header")
  396.     mp.add_item("Language",@name)
  397.     mp.add_item("ID",@id)
  398.     return mp.to_s
  399.   end
  400.   #--------------------------------------------------------------------------
  401.   # * Actors list creation
  402.   #--------------------------------------------------------------------------
  403.   def actors
  404.     attributes = [:id, :name, :nickname, :description]
  405.     return attr_process("actors",$data_actors,attributes)
  406.   end
  407.   #--------------------------------------------------------------------------
  408.   # * Classes list creation
  409.   #--------------------------------------------------------------------------
  410.   def classes
  411.     attributes = [:id, :name]
  412.     return attr_process("classes",$data_classes,attributes)
  413.   end
  414.   #--------------------------------------------------------------------------
  415.   # * Skills list creation
  416.   #--------------------------------------------------------------------------
  417.   def skills
  418.     attributes = [:id, :name, :description, :message1, :message2]
  419.     return attr_process("skills",$data_skills,attributes)
  420.   end
  421.   #--------------------------------------------------------------------------
  422.   # * Items list creation
  423.   #--------------------------------------------------------------------------
  424.   def items
  425.     attributes = [:id, :name, :description]
  426.     return attr_process("items",$data_items,attributes)
  427.   end
  428.   #--------------------------------------------------------------------------
  429.   # * Weapons list creation
  430.   #--------------------------------------------------------------------------
  431.   def weapons
  432.     attributes = [:id, :name, :description]
  433.     return attr_process("weapons",$data_weapons,attributes)
  434.   end
  435.   #--------------------------------------------------------------------------
  436.   # * Armors list creation
  437.   #--------------------------------------------------------------------------
  438.   def armors
  439.     attributes = [:id, :name, :description]
  440.     return attr_process("armors",$data_armors,attributes)
  441.   end
  442.   #--------------------------------------------------------------------------
  443.   # * Enemies list creation
  444.   #--------------------------------------------------------------------------
  445.   def enemies
  446.     attributes = [:id, :name]
  447.     return attr_process("enemies",$data_enemies,attributes)
  448.   end
  449.   #--------------------------------------------------------------------------
  450.   # * States list creation
  451.   #--------------------------------------------------------------------------
  452.   def states
  453.     attributes = [:id, :name, :message1, :message2, :message3, :message4]
  454.     return attr_process("states",$data_states,attributes)
  455.   end
  456.   #--------------------------------------------------------------------------
  457.   # * Terms list creation
  458.   #--------------------------------------------------------------------------
  459.   def terms
  460.     terms = $data_system.terms
  461.     mp = Mark_Parser.new("params")
  462.     for i in 0..terms.basic.size-1
  463.       mp.add_item(i, terms.params[i])
  464.     end
  465.     mp2 = Mark_Parser.new("basic")
  466.     for i in 0..terms.basic.size-1
  467.       mp2.add_item(i, terms.basic[i])
  468.     end
  469.     mp3 = Mark_Parser.new("etypes")
  470.     for i in 0..terms.etypes.size-1
  471.       mp3.add_item(i, terms.etypes[i])
  472.     end
  473.     mp4 = Mark_Parser.new("commands")
  474.     for i in 0..terms.commands.size-1
  475.       mp4.add_item(i, terms.commands[i])
  476.     end
  477.     return mp.to_s + mp2.to_s + mp3.to_s + mp4.to_s
  478.   end
  479.   #--------------------------------------------------------------------------
  480.   # * Dialog list creation
  481.   #--------------------------------------------------------------------------
  482.   def dialogs
  483.     mp = Mark_Parser.new("strings")
  484.     records = 0
  485.     records += get_from_map(mp)
  486.     records += get_from_troops(mp)
  487.     records += get_from_common_events(mp)
  488.     println "#{records} strings created from Message Dialogs."
  489.     return mp.to_s
  490.   end
  491.   #--------------------------------------------------------------------------
  492.   # * Get all message box on all over the maps
  493.   #--------------------------------------------------------------------------
  494.   def get_from_map(mp)
  495.     records = 0
  496.     for i in 1..999
  497.       map_file = sprintf("Data/Map%03d.rvdata2", i)
  498.       next unless File.exist?(map_file)
  499.       map = load_data(map_file)
  500.       if !map.display_name.empty?
  501.         name = sprintf(MAPNAM,i)
  502.         mp.add_item(name, map.display_name)
  503.         map.display_name = "{S: #{name}}"
  504.       end
  505.       map.events.each_pair do |event_id, event|
  506.         event.pages.each_with_index do |page, page_i|
  507.           page.list.each_with_index do |command, command_i|
  508.             case command.code
  509.             when 401
  510.               next if command.parameters[0] =~ H87Localization::REG_EXCAPE
  511.               name = sprintf(STRING,i,event_id,page_i,command_i)
  512.               mp.add_item(name, command.parameters[0])
  513.               command.parameters[0] = "{S: #{name}}"
  514.               records += 1
  515.             when 102
  516.               command.parameters[0].each_with_index do |param, param_i|
  517.                 next if param =~ H87Localization::REG_EXCAPE
  518.                 name = sprintf(CHOICE,i,event_id,page_i,command_i,param_i)
  519.                 mp.add_item(name, param)
  520.                 command.parameters[0][param_i] = "{S: #{name}}"
  521.                 records += 1
  522.               end
  523.             end
  524.           end
  525.         end
  526.       end
  527.       save_data(map, map_file)
  528.     end
  529.     return records
  530.   end
  531.   #--------------------------------------------------------------------------
  532.   # * Get all message box in all troops
  533.   #--------------------------------------------------------------------------
  534.   def get_from_troops(mp)
  535.     records = 0
  536.     for troop in $data_troops
  537.       next if troop.nil?
  538.       troop.pages.each_with_index do |page, page_i|
  539.         page.list.each_with_index do |command, command_i|
  540.           case command.code
  541.           when 401
  542.             next if command.parameters[0] =~ H87Localization::REG_EXCAPE
  543.             name = sprintf(BATTLE,troop.id,page_i,command_i)
  544.             mp.add_item(name, command.parameters[0])
  545.             command.parameters[0] = "{S: #{name}}"
  546.             records += 1
  547.           when 102
  548.             command.parameters[0].each_with_index do |param, param_i|
  549.               next if param =~ H87Localization::REG_EXCAPE
  550.               name = sprintf(BATTLC,troop.id,page_i,command_i,param_i)
  551.               mp.add_item(name, param)
  552.               command.parameters[0][param_i] = "{S: #{name}}"
  553.               records += 1
  554.             end
  555.           end
  556.         end
  557.       end
  558.     end
  559.     save_data($data_troops,"Data/Troops.rvdata2")
  560.     return records
  561.   end
  562.   #--------------------------------------------------------------------------
  563.   # * Gets all message box in all common events
  564.   #--------------------------------------------------------------------------
  565.   def get_from_common_events(mp)
  566.     records = 0
  567.     for event in $data_common_events
  568.       next if event.nil?
  569.       event.list.each_with_index do |command, command_i|
  570.         case command.code
  571.         when 401
  572.           next if command.parameters[0] =~ H87Localization::REG_EXCAPE
  573.           name = sprintf(COMMON,event.id,command_i)
  574.           mp.add_item(name, command.parameters[0])
  575.           command.parameters[0] = "{S: #{name}}"
  576.           records += 1
  577.         when 102
  578.           command.parameters[0].each_with_index do |param, param_i|
  579.             next if param =~ H87Localization::REG_EXCAPE
  580.             name = sprintf(COMMOC,event.id,command_i,param_i)
  581.             mp.add_item(name, param)
  582.             command.parameters[0][param_i] = "{S: #{name}}"
  583.             records += 1
  584.           end
  585.         end
  586.       end
  587.     end
  588.     save_data($data_common_events, "Data/CommonEvents.rvdata2")
  589.     return records
  590.   end
  591.   #--------------------------------------------------------------------------
  592.   # * Process that creates tag with attributes
  593.   #   name: tag name
  594.   #   array: database array
  595.   #   attributes: attributes to copy
  596.   #--------------------------------------------------------------------------
  597.   def attr_process(name, array, attributes)
  598.     mp = Mark_Parser.new(name)
  599.     for item in array
  600.       next if item.nil?
  601.       next if item.name.empty?
  602.       next if item.name == " "
  603.       mp.add_item
  604.       for attr in attributes
  605.         attr_value = eval("item.#{attr}")
  606.         next if attr_value == ""
  607.         mp.push_attr(attr.to_s, attr_value)
  608.       end
  609.     end
  610.     println "#{name} saved. #{array.size} lines created."
  611.     return mp.to_s
  612.   end
  613. end
  614.  
  615. #==============================================================================
  616. # ** Mark Parser
  617. #------------------------------------------------------------------------------
  618. #  This class is used within Localization_Tool and creates the string that
  619. #  will be written into the file.
  620. #==============================================================================
  621. class Mark_Parser
  622.   attr_accessor :tag
  623.   #--------------------------------------------------------------------------
  624.   # * Object initialization
  625.   #--------------------------------------------------------------------------
  626.   def initialize(tag)
  627.     @tag = tag
  628.     @items = []
  629.   end
  630.   #--------------------------------------------------------------------------
  631.   # * Add attribute to item
  632.   #   attr_name: name of attribute
  633.   #   value: value of attribute
  634.   #--------------------------------------------------------------------------
  635.   def push_attr(attr_name, value)
  636.     return if value =~ H87Localization::REG_EXCAPE
  637.     val = value.to_s.gsub(/[\r\n]+/,"\\n").gsub(";","\\;")
  638.     @items.last.push("#{attr_name}:#{val}")
  639.   end
  640.   #--------------------------------------------------------------------------
  641.   # * Add new item
  642.   #--------------------------------------------------------------------------
  643.   def add_item(attr_name = nil, value = nil)
  644.     @items.push([])
  645.     push_attr(attr_name, value) if attr_name != nil
  646.   end
  647.   #--------------------------------------------------------------------------
  648.   # * String converter
  649.   #--------------------------------------------------------------------------
  650.   def to_s
  651.     string = ""
  652.     string << "<#{@tag}>\n"
  653.     @items.each do |item|
  654.       string << item * "; "
  655.       string << "\n"
  656.     end
  657.     string << "</#{@tag}>\n\n"
  658.     return string
  659.   end
  660. end
  661.  
  662. #==============================================================================
  663. # ** Scene_Title
  664. #------------------------------------------------------------------------------
  665. #  Access for tool's scene
  666. #==============================================================================
  667. class Scene_Title < Scene_Base
  668.   alias h87loctool_update update unless $@
  669.   #--------------------------------------------------------------------------
  670.   # * update
  671.   #--------------------------------------------------------------------------
  672.   def update
  673.     h87loctool_update
  674.     go_loc_tool if Input.trigger?(:B) && Input.press?(:LEFT) && $TEST
  675.   end
  676.   #--------------------------------------------------------------------------
  677.   # * go to localizer tool scene
  678.   #--------------------------------------------------------------------------
  679.   def go_loc_tool
  680.     SceneManager.call(Scene_Localization)
  681.   end
  682. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement