stick-the-quick/ui/MainMenu/About/About_Acknowledgements.gd

99 lines
2.7 KiB
GDScript

class_name About_Acknowledgements extends Control
@onready var _inspirations_button := (
$'CenterContainer/VBoxContainer/VBoxContainer/InspirationsButton'
) as Button
@onready var _tools_button := (
$CenterContainer/VBoxContainer/VBoxContainer/HBoxContainer/ToolsButton
) as Button
@onready var _anti_button := (
$CenterContainer/VBoxContainer/VBoxContainer/HBoxContainer/AntiButton
) as Button
@onready var _discord_button := (
$CenterContainer/VBoxContainer/VBoxContainer/DiscordButton
) as Button
@onready var _friends_button := (
$CenterContainer/VBoxContainer/VBoxContainer/FriendsButton
) as Button
@onready var _uncle_button := (
$CenterContainer/VBoxContainer/VBoxContainer/UncleButton
) as Button
@onready var _you_button := (
$CenterContainer/VBoxContainer/VBoxContainer/YouButton
) as Button
@onready var _mom_button := (
$CenterContainer/VBoxContainer/VBoxContainer/MomButton
) as Button
@onready var _back_button := (
$CenterContainer/VBoxContainer/BackButton
) as Button
func _ready() -> void:
_inspirations_button.pressed.connect(_inspirations)
_tools_button.pressed.connect(_tools)
_anti_button.pressed.connect(_anti)
_discord_button.pressed.connect(_discord)
_friends_button.pressed.connect(_friends)
_uncle_button.pressed.connect(_uncle)
_you_button.pressed.connect(_you)
_mom_button.pressed.connect(_mom)
_back_button.pressed.connect(_back)
func _notice(which: String) -> void:
UI.Call(load("res://ui/Notice.tscn"))
var notice := UI.context()
notice.get_node(
^"CenterContainer/PanelContainer"
).add_theme_stylebox_override(&'panel', load(
"res://ui/Conversation/ConversationStyleBox.tres"
))
notice.add_message(FileAccess.get_file_as_string(
"res://acknowledgements/%s.txt" % which
))
func _inspirations() -> void:
_notice("anonymous-inspirations")
func _tools() -> void:
UI.Call(load("res://ui/Notice.tscn"))
var notice := UI.context()
notice.get_node(
^"CenterContainer/PanelContainer"
).add_theme_stylebox_override(&'panel', load(
"res://ui/Conversation/ConversationStyleBox.tres"
))
var paragraphs := FileAccess.get_file_as_string(
"res://acknowledgements/tools.txt"
).split("\n\n")
var links_paragraph := paragraphs[2]
var links := links_paragraph.split("\t")
links.remove_at(0)
notice.add_message(paragraphs[0] + "\n\n" + paragraphs[1] + "\n\nLinks:\n")
for link in links:
var parts := link.split(' ', true, 1)
notice.add_link(parts[0])
if parts.size() > 1:
notice.add_message(parts[1])
notice.add_message(paragraphs[3])
func _anti() -> void:
_notice("anti")
func _discord() -> void:
_notice("ltf")
func _friends() -> void:
_notice("cd")
func _uncle() -> void:
_notice("uncle")
func _you() -> void:
_notice("you")
func _mom() -> void:
_notice("mom")
func _back() -> void:
UI.Return(self)