Create the documents directory if it doesn't exist

This commit is contained in:
Pera Pisar 2019-04-25 02:51:10 +02:00
parent 9b926e0cdb
commit ed10371231
No known key found for this signature in database
GPG Key ID: 6E1174E4DF875DCA
2 changed files with 11 additions and 7 deletions

View File

@ -123,7 +123,8 @@ def safe_puzzle_write
when 'zh_CN' when 'zh_CN'
doc_text = DOCUMENT_TEXT_ZH_CN doc_text = DOCUMENT_TEXT_ZH_CN
end end
File.open(Oneshot::DOCS_PATH + "/DOCUMENT.oneshot.txt", 'w') do |file| Dir.mkdir(Oneshot::DOCS_PATH) unless File.exists?(Oneshot::DOCS_PATH)
File.open("#{Oneshot::DOCS_PATH}/DOCUMENT.oneshot.txt", 'w') do |file|
file.puts(doc_text + $game_variables[20].to_s) file.puts(doc_text + $game_variables[20].to_s)
end end
end end
@ -144,7 +145,8 @@ def safe_puzzle_postgame_write
when 'zh_CN' when 'zh_CN'
doc_text = DOCUMENT_POSTGAME_TEXT_ZH_CN doc_text = DOCUMENT_POSTGAME_TEXT_ZH_CN
end end
File.open(Oneshot::DOCS_PATH + "/DOCUMENT.oneshot.txt", 'w') do |file| Dir.mkdir(Oneshot::DOCS_PATH) unless File.exists?(Oneshot::DOCS_PATH)
File.open("#{Oneshot::DOCS_PATH}/DOCUMENT.oneshot.txt", 'w') do |file|
file.puts(doc_text + $game_variables[20].to_s) file.puts(doc_text + $game_variables[20].to_s)
end end
end end

View File

@ -505,6 +505,7 @@ module Script
locale = 'en' locale = 'en'
end end
source_dir = "Graphics/Fogs/_/scenario1/" + locale.downcase source_dir = "Graphics/Fogs/_/scenario1/" + locale.downcase
Dir.mkdir(Oneshot::DOCS_PATH) unless File.exists?(Oneshot::DOCS_PATH)
copy_file(source_dir + "/pw1.png", Oneshot::DOCS_PATH + "/ONESHOT_password1.png") copy_file(source_dir + "/pw1.png", Oneshot::DOCS_PATH + "/ONESHOT_password1.png")
copy_file(source_dir + "/pw2.png", Oneshot::DOCS_PATH + "/ONESHOT_password2.png") copy_file(source_dir + "/pw2.png", Oneshot::DOCS_PATH + "/ONESHOT_password2.png")
copy_file(source_dir + "/pw3.png", Oneshot::DOCS_PATH + "/ONESHOT_password3.png") copy_file(source_dir + "/pw3.png", Oneshot::DOCS_PATH + "/ONESHOT_password3.png")
@ -516,11 +517,12 @@ module Script
if !Language::LANGUAGES.include? locale if !Language::LANGUAGES.include? locale
locale = 'en' locale = 'en'
end end
source_dir = "Graphics/Fogs/_/scenario2/" + locale.downcase source_dir = "Graphics/Fogs/_/scenario2/#{locale.downcase}"
copy_file(source_dir + "/pw1.png", Oneshot::DOCS_PATH + "/ONESHOT_password1.png") Dir.mkdir(Oneshot::DOCS_PATH) unless File.exists?(Oneshot::DOCS_PATH)
copy_file(source_dir + "/pw2.png", Oneshot::DOCS_PATH + "/ONESHOT_password2.png") copy_file("#{source_dir}/pw1.png", "#{Oneshot::DOCS_PATH}/ONESHOT_password1.png")
copy_file(source_dir + "/pw3.png", Oneshot::DOCS_PATH + "/ONESHOT_password3.png") copy_file("#{source_dir}/pw2.png", "#{Oneshot::DOCS_PATH}/ONESHOT_password2.png")
copy_file(source_dir + "/pw4.png", Oneshot::DOCS_PATH + "/ONESHOT_password4.png") copy_file("#{source_dir}/pw3.png", "#{Oneshot::DOCS_PATH}/ONESHOT_password3.png")
copy_file("#{source_dir}/pw4.png", "#{Oneshot::DOCS_PATH}/ONESHOT_password4.png")
end end
=begin =begin