Esempio n. 1
0
String OS_Unix::get_user_data_dir() const {

	String appname = get_safe_application_name();
	if (appname != "") {
		bool use_godot_dir = ProjectSettings::get_singleton()->get("application/config/use_shared_user_dir");
		if (use_godot_dir) {
			return get_data_path().plus_file(get_godot_dir_name()).plus_file("app_userdata").plus_file(appname);
		} else {
			return get_data_path().plus_file(appname);
		}
	}

	return ProjectSettings::get_singleton()->get_resource_path();
}
Esempio n. 2
0
String OS_Unix::get_user_data_dir() const {

	String appname = get_safe_dir_name(ProjectSettings::get_singleton()->get("application/config/name"));
	if (appname != "") {
		bool use_custom_dir = ProjectSettings::get_singleton()->get("application/config/use_custom_user_dir");
		if (use_custom_dir) {
			String custom_dir = get_safe_dir_name(ProjectSettings::get_singleton()->get("application/config/custom_user_dir_name"), true);
			if (custom_dir == "") {
				custom_dir = appname;
			}
			return get_data_path().plus_file(custom_dir);
		} else {
			return get_data_path().plus_file(get_godot_dir_name()).plus_file("app_userdata").plus_file(appname);
		}
	}

	return ProjectSettings::get_singleton()->get_resource_path();
}