2021-05-27 21:56:16 +00:00
|
|
|
extends Control
|
|
|
|
|
|
|
|
|
|
|
|
func read_license(key):
|
|
|
|
var file = File.new()
|
|
|
|
var filenews = ""
|
|
|
|
if key.empty():
|
|
|
|
filenews = "res://LICENSE"
|
|
|
|
else:
|
|
|
|
filenews = "res://LICENSE_" + key
|
|
|
|
|
|
|
|
if file.file_exists(filenews):
|
|
|
|
#print(filenews + " exist ! ")
|
|
|
|
file.open(filenews, File.READ)
|
|
|
|
var content = file.get_as_text()
|
|
|
|
file.close()
|
|
|
|
$window_dialog/margin_container/v_box_container/tab_container/OPTION_INFO_LICENSE.text = content
|
|
|
|
return true
|
|
|
|
return false
|
|
|
|
|
2021-06-07 21:07:44 +00:00
|
|
|
|
2021-05-27 21:56:16 +00:00
|
|
|
func load_license():
|
|
|
|
var current_locale = TranslationServer.get_locale()
|
|
|
|
var root_language = current_locale.split('_')[0]
|
|
|
|
if read_license(current_locale):
|
|
|
|
pass
|
|
|
|
elif read_license(root_language):
|
|
|
|
pass
|
|
|
|
elif read_license(""):
|
|
|
|
pass
|
|
|
|
|
2021-06-07 21:07:44 +00:00
|
|
|
|
2021-05-27 21:56:16 +00:00
|
|
|
func read_authors(key):
|
|
|
|
var file = File.new()
|
|
|
|
var filenews = ""
|
|
|
|
if key.empty():
|
|
|
|
filenews = "res://AUTHORS"
|
|
|
|
else:
|
|
|
|
filenews = "res://AUTHORS_" + key
|
|
|
|
|
|
|
|
if file.file_exists(filenews):
|
|
|
|
#print(filenews + " exist ! ")
|
|
|
|
file.open(filenews, File.READ)
|
|
|
|
var content = file.get_as_text()
|
|
|
|
file.close()
|
|
|
|
$window_dialog/margin_container/v_box_container/tab_container/OPTION_INFO_AUTHORS.text = content
|
|
|
|
return true
|
|
|
|
return false
|
|
|
|
|
|
|
|
func load_authors():
|
|
|
|
var current_locale = TranslationServer.get_locale()
|
|
|
|
var root_language = current_locale.split('_')[0]
|
|
|
|
if read_authors(current_locale):
|
|
|
|
pass
|
|
|
|
elif read_authors(root_language):
|
|
|
|
pass
|
|
|
|
elif read_authors(""):
|
|
|
|
pass
|
2021-06-07 21:07:44 +00:00
|
|
|
|
2021-05-27 21:56:16 +00:00
|
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
func _ready():
|
|
|
|
load_authors()
|
|
|
|
load_license()
|
|
|
|
|
|
|
|
|
|
|
|
func _on_button_pressed():
|
|
|
|
$window_dialog.hide()
|