module SES
module ExternalText
LANGUAGE={ #do not touch this line
english: "English",
indonesian: "Indonesian",
} #do not touch this line
#hash for defining what language files you have
#format=> key: "string",
DEFAULT_LANGUAGE = :english
#set the default language. format=> :key
end
end
module DataManager
#modify it to convert txt to rvdata2 based on key send
def self.create_text(key)
language = SES::ExternalText::LANGUAGE[key]
text = {}
key = ""
File.open("Data/"+language+".txt", "r") do |file|
file.readlines.each_with_index do |v, i|
next if v =~ /(^\s*(#|\/\/).*|^\s*$)/
SES::ExternalText::Tags.each_pair do |k,p|
(eval(p); v = "") if v =~ k
end
text[key][1] << v unless v.empty?
end
end
File.open("Data/"+language+".rvdata2", "w") do |file| Marshal.dump(text, file) end
end
#change it to convert txt to rvdata2 for all language hash member
#there's also msg box warning if default language files missing
def self.load_normal_database
en_et_dm_lnd
SES::ExternalText::LANGUAGE.each_key{|key|
language = SES::ExternalText::LANGUAGE[key.to_sym]
create_text(key) if FileTest.exist?("Data/"+language+".txt")
}
default_language = SES::ExternalText::LANGUAGE[SES::ExternalText::DEFAULT_LANGUAGE]
if !FileTest.exist?("Data/"+default_language+".rvdata2")
return msgbox("Missing Default Language Files!!")
end
$game_text = load_data("Data/"+default_language+".rvdata2")
end
def self.load_battle_test_database
en_et_dm_lbd
SES::ExternalText::LANGUAGE.each_key{|key|
language = SES::ExternalText::LANGUAGE[key.to_sym]
create_text(key) if FileTest.exist?("Data/"+language+".txt")
}
default_language = SES::ExternalText::LANGUAGE[SES::ExternalText::DEFAULT_LANGUAGE]
if !FileTest.exist?("Data/"+default_language+".rvdata2")
return msgbox("Missing Default Language Files!!")
end
$game_text = load_data("Data/"+default_language+".rvdata2")
end
#change language function. there's also msg box warning if that
#language files not exist
def self.change_language(key)
language = SES::ExternalText::LANGUAGE[key.to_sym]
return if !language
if !FileTest.exist?("Data/"+language+".rvdata2")
return msgbox("Language Files Not Exist!!")
end
$game_text = load_data("Data/"+language+".rvdata2")
end
end
class Window_LanguageSelect < Window_Command
def call_ok_handler
$data_system.set_language(command_name(@index))
activate
SceneManager.scene.exit = true
end
def make_command_list; @list = SES::ExternalText::Languages; end
end
class Scene_LanguageSelect < Scene_Base
attr_accessor :exit
def start
super
@exit = false
create_background
@text_window = Window_Help.new(1)
set_help_text
@select_window = Window_LanguageSelect.new
end
end
a = get_text("Choice 1")
@get_choices = [a,"No!"]
The terms of use (the license, really) is clearly explained under the Author's Notes, just like every other SES script. Essentially, you're free to do whatever you want with any SES script as long as credit and the license terms are maintained (which means anyone else can also modify your modifications under the same terms). Both commercial and non-commercial use is allowed as well.Hello, I think this is a really awesome script. Aside from crediting, what are the other terms of use? Thanks.
WOW. My bad. I can't believe I missed it. I opened the script and tried to ctrl F "terms" lol. Thanks for pointing it out solistra!The terms of use (the license, really) is clearly explained under the Author's Notes, just like every other SES script. Essentially, you're free to do whatever you want with any SES script as long as credit and the license terms are maintained (which means anyone else can also modify your modifications under the same terms). Both commercial and non-commercial use is allowed as well.
.