Setting up a global for using variables across scenes

I have got the persistence using static variables from a class created in a new root scene that is not used for anything else, simply a loading screen. This is the change in the script which is mostly adding the class name along with a new static variable envsa which updates on exiting the scene and is checked on entering the scene. I will also probably set up the dictionary in an autoload script as it won’t be altered and there will be others.

extends Control

var envdict = {"Aeternus":[0, 0, 5], "Diamond":[300, 0, 4], "Freedom":[600, 0, 1], "Insula":[900, 0, 8],
"Magmaria":[0, 200, 4], "Megalopolis":[300, 200, 2], "Pike":[600, 200, 8], "Rook":[900, 200, 8],
"Silver":[0, 400, 4], "Block":[300, 400, 6], "Wasteland":[600, 400, 7], "Discord":[900, 400, 5],
"Atlantis":[0, 600, 7], "ZhuLong":[300, 600, 6], "Anubis":[600, 600, 7], "Wagner":[900, 600, 6]}

func _ready() -> void:
	for n in Share.enviro.get_buttons():
		if n.name == Share.envsa:
			n.button_pressed = true
		n.toggled.connect(_enviropressed)
	Share.enviroatlas.region = Rect2(envdict[Share.enviro.get_pressed_button().name][0], envdict[Share.enviro.get_pressed_button().name][1], 300, 200)
	$choice.texture = Share.enviroatlas
	$Envdiff.text = "Difficulty " + str(envdict[Share.enviro.get_pressed_button().name][2])

func _enviropressed(toggled_on: bool) -> void:
	if toggled_on:
		Share.enviroatlas.region = Rect2(envdict[Share.enviro.get_pressed_button().name][0], envdict[Share.enviro.get_pressed_button().name][1], 300, 200)
		$choice.texture = Share.enviroatlas
		$Envdiff.text = "Difficulty " + str(envdict[Share.enviro.get_pressed_button().name][2])



func _on_button_17_pressed() -> void:
	Share.envsa = Share.enviro.get_pressed_button().name
	get_tree().change_scene_to_file.call_deferred("res://Mainmenu.tscn")


func _on_button_pressed() -> void:
	var envkey = envdict.keys()
	var renv = envkey.pick_random()
	for n in Share.enviro.get_buttons():
		if n.name == renv:
			n.button_pressed = true