2024-07-31 13:57:37 +00:00
|
|
|
extends MarginContainer
|
|
|
|
|
2024-08-19 11:47:46 +00:00
|
|
|
var rd_web_button := Button.new()
|
|
|
|
var rd_changelog_button := Button.new()
|
2024-08-20 20:57:49 +00:00
|
|
|
var rd_wiki_button := Button.new()
|
|
|
|
var rd_credits_button := Button.new()
|
|
|
|
var rd_donate_button := Button.new()
|
|
|
|
var rd_contactus_button := Button.new()
|
|
|
|
var rd_licenses_button := Button.new()
|
2024-08-19 11:47:46 +00:00
|
|
|
var app_data := AppData.new()
|
2024-08-20 20:57:49 +00:00
|
|
|
var bArray :Array = [rd_web_button,rd_changelog_button,rd_wiki_button,
|
|
|
|
rd_credits_button,rd_donate_button,rd_contactus_button,rd_licenses_button]
|
|
|
|
|
2024-07-31 13:57:37 +00:00
|
|
|
func _ready():
|
2024-08-02 19:08:14 +00:00
|
|
|
#tk_about = class_functions.import_csv_data("res://tk_about.txt")
|
2024-07-31 13:57:37 +00:00
|
|
|
_connect_signals()
|
2024-09-05 18:04:56 +00:00
|
|
|
create_buttons()
|
|
|
|
|
|
|
|
func _connect_signals() -> void:
|
|
|
|
rd_web_button.pressed.connect(_about_button_pressed.bind("rd_web", rd_web_button))
|
|
|
|
rd_changelog_button.pressed.connect(_about_button_pressed.bind("rd_changelog", rd_changelog_button))
|
|
|
|
rd_wiki_button.pressed.connect(_about_button_pressed.bind("rd_wiki",rd_wiki_button))
|
|
|
|
rd_credits_button.pressed.connect(_about_button_pressed.bind("rd_credits", rd_credits_button))
|
|
|
|
rd_donate_button.pressed.connect(_about_button_pressed.bind("rd_donate", rd_donate_button))
|
|
|
|
rd_contactus_button.pressed.connect(_about_button_pressed.bind("rd_contactus", rd_contactus_button))
|
|
|
|
rd_licenses_button.pressed.connect(_about_button_pressed.bind("rd_licenses", rd_licenses_button))
|
|
|
|
|
|
|
|
func _about_button_pressed(id: String, button: Button) -> void:
|
2024-09-10 13:09:42 +00:00
|
|
|
var tmp_txt = button.text
|
2024-09-05 18:04:56 +00:00
|
|
|
match id:
|
|
|
|
"rd_web", "rd_changelog", "rd_wiki", "rd_credits", "rd_donate", "rd_contactus", "rd_licenses":
|
2024-09-10 13:09:42 +00:00
|
|
|
if class_functions.desktop_mode != "gamescope":
|
|
|
|
class_functions.logger("i","Loading website for " + id)
|
|
|
|
class_functions.launch_help(button.editor_description)
|
|
|
|
else:
|
|
|
|
button.text = "Help only in Desktop Mode"
|
|
|
|
await class_functions.wait(3.0)
|
|
|
|
button.text = tmp_txt
|
2024-09-05 18:04:56 +00:00
|
|
|
_:
|
2024-09-08 18:03:36 +00:00
|
|
|
class_functions.logger("d","Loading website for " + id)
|
2024-09-05 18:04:56 +00:00
|
|
|
print ("Website ID/Link not found")
|
|
|
|
|
|
|
|
func create_buttons() -> void:
|
|
|
|
app_data = data_handler.app_data
|
|
|
|
for button in bArray:
|
|
|
|
%GridContainer.add_child(button)
|
2024-08-02 19:08:14 +00:00
|
|
|
for id in app_data.about_links:
|
2024-08-18 21:42:40 +00:00
|
|
|
var web_data: Link = app_data.about_links[id]
|
2024-08-02 19:08:14 +00:00
|
|
|
match id:
|
2024-07-31 13:57:37 +00:00
|
|
|
"rd_web":
|
2024-08-19 11:47:46 +00:00
|
|
|
rd_web_button.text = web_data.name
|
|
|
|
rd_web_button.tooltip_text = web_data.description
|
2024-08-20 20:57:49 +00:00
|
|
|
rd_web_button.icon = ResourceLoader.load(web_data.icon)
|
2024-08-19 11:47:46 +00:00
|
|
|
rd_web_button.editor_description = web_data.url
|
2024-08-20 20:57:49 +00:00
|
|
|
rd_web_button.icon_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
|
|
|
rd_web_button.vertical_icon_alignment = VERTICAL_ALIGNMENT_TOP
|
2024-07-31 13:57:37 +00:00
|
|
|
"rd_changelog":
|
2024-08-19 11:47:46 +00:00
|
|
|
rd_changelog_button.text = web_data.name
|
|
|
|
rd_changelog_button.tooltip_text = web_data.description
|
2024-08-20 20:57:49 +00:00
|
|
|
rd_changelog_button.icon = ResourceLoader.load(web_data.icon)
|
2024-08-19 11:47:46 +00:00
|
|
|
rd_changelog_button.editor_description = web_data.url
|
2024-08-20 20:57:49 +00:00
|
|
|
rd_changelog_button.icon_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
|
|
|
rd_changelog_button.vertical_icon_alignment = VERTICAL_ALIGNMENT_TOP
|
2024-07-31 13:57:37 +00:00
|
|
|
"rd_wiki":
|
2024-08-20 20:57:49 +00:00
|
|
|
rd_wiki_button.text = web_data.name
|
|
|
|
rd_wiki_button.tooltip_text = web_data.description
|
|
|
|
rd_wiki_button.icon = ResourceLoader.load(web_data.icon)
|
|
|
|
rd_wiki_button.editor_description = web_data.url
|
|
|
|
rd_wiki_button.icon_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
|
|
|
rd_wiki_button.vertical_icon_alignment = VERTICAL_ALIGNMENT_TOP
|
2024-07-31 13:57:37 +00:00
|
|
|
"rd_credits":
|
2024-08-20 20:57:49 +00:00
|
|
|
rd_credits_button.text = web_data.name
|
|
|
|
rd_credits_button.tooltip_text = web_data.description
|
|
|
|
rd_credits_button.icon = ResourceLoader.load(web_data.icon)
|
|
|
|
rd_credits_button.editor_description = web_data.url
|
|
|
|
rd_credits_button.icon_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
|
|
|
rd_credits_button.vertical_icon_alignment = VERTICAL_ALIGNMENT_TOP
|
2024-07-31 13:57:37 +00:00
|
|
|
"rd_donate":
|
2024-08-20 20:57:49 +00:00
|
|
|
rd_donate_button.text = web_data.name
|
|
|
|
rd_donate_button.tooltip_text = web_data.description
|
|
|
|
rd_donate_button.icon = ResourceLoader.load(web_data.icon)
|
|
|
|
rd_donate_button.editor_description = web_data.url
|
|
|
|
rd_donate_button.icon_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
|
|
|
rd_donate_button.vertical_icon_alignment = VERTICAL_ALIGNMENT_TOP
|
2024-07-31 13:57:37 +00:00
|
|
|
"rd_contactus":
|
2024-08-20 20:57:49 +00:00
|
|
|
rd_contactus_button.text = web_data.name
|
|
|
|
rd_contactus_button.tooltip_text = web_data.description
|
|
|
|
rd_contactus_button.icon = ResourceLoader.load(web_data.icon)
|
|
|
|
rd_contactus_button.editor_description = web_data.url
|
|
|
|
rd_contactus_button.icon_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
|
|
|
rd_contactus_button.vertical_icon_alignment = VERTICAL_ALIGNMENT_TOP
|
2024-07-31 13:57:37 +00:00
|
|
|
"rd_licenses":
|
2024-08-20 20:57:49 +00:00
|
|
|
rd_licenses_button.text = web_data.name
|
|
|
|
rd_licenses_button.tooltip_text = web_data.description
|
|
|
|
rd_licenses_button.icon = ResourceLoader.load(web_data.icon)
|
|
|
|
rd_licenses_button.editor_description = web_data.url
|
|
|
|
rd_licenses_button.icon_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
|
|
|
rd_licenses_button.vertical_icon_alignment = VERTICAL_ALIGNMENT_TOP
|