Commit bdf82f74 authored by IamIpanda's avatar IamIpanda

Update Command.rb

[fix] generate_delta doesn't work correctly when different changes happen on multi-language.
[warn] That code hasn't been verified.
parent 17293014
......@@ -24,24 +24,25 @@ module Commands
end
def generate_delta(languages = nil)
Log.logger.info "Generate delta card image(s)"
self.clear_mse
data = Sqlite.load
changes = HashJudger.compare data
generates = changes[0] + changes[2]
removes = changes[1]
data = Sqlite.split generates
Log.logger.info "Generate delta card image(s) with parameter: #{languages.inspect}"
if languages == nil
process(removes, data)
process_generate_delta
else
for language in languages
Global.language = language
process(removes, data)
process_generate_delta
end
end
end
def process(removes, data)
def process_generate_delta
Log.logger.info "Generate delta card image with language #{Global.language}"
self.clear_mse
data = Sqlite.load # Language effected here
changes = HashJudger.compare data
generates = changes[0] + changes[2]
removes = changes[1]
data = Sqlite.split generates
for card in removes
id = YGOCoreJudgers.get_id card
path = File.join Global.full_answer_path, id.to_s + Global.image_type
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment