about summary refs log tree commit diff stats
path: root/apworld/client/saver.gd
blob: 44bc179e7f511efbc5a7fe2307f8b85e48df4514 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
extends "res://scripts/nodes/saver.gd"


func levelLoaded():
	if type == "keyholders":
		var ap = global.get_node("Archipelago")
		ap.keyboard.load_keyholders.call_deferred(global.map)
	else:
		reload.call_deferred()


func reload():
	# Just rewriting this whole thing so I can remove Chris's safeguard.
	var file = FileAccess.open(path + type + ".save", FileAccess.READ)
	if file:
		var data = file.get_var(true)
		file.close()
		for datum in data:
			var saveable = get_node_or_null(datum[0])
			if saveable != null:
				saveable.is_complete = datum[1]
				if saveable.is_complete:
					saveable.loadData(saveable.is_complete)
p">) const; DoorShuffleMode GetDoorShuffleMode() const { return door_shuffle_mode_; } bool IsColorShuffle() const { return color_shuffle_; } bool IsPaintingShuffle() const { return painting_shuffle_; } const std::map<std::string, std::string> GetPaintingMapping() const { return painting_mapping_; } private: void RefreshTracker(); int64_t GetItemId(const std::string& item_name); TrackerFrame* tracker_frame_; bool client_active_ = false; std::mutex client_mutex_; std::set<int64_t> inventory_; std::set<int64_t> checked_locations_; std::map<std::tuple<int, int>, int64_t> ap_id_by_location_id_; std::map<std::string, int64_t> ap_id_by_item_name_; std::map<LingoColor, int64_t> ap_id_by_color_; DoorShuffleMode door_shuffle_mode_ = kNO_DOORS; bool color_shuffle_ = false; bool painting_shuffle_ = false; std::map<std::string, std::string> painting_mapping_; }; APState& GetAPState(); #endif /* end of include guard: AP_STATE_H_664A4180 */