Automatically load sessions when HTTPSessionManagerFile enters tree.

This commit is contained in:
Relintai 2025-05-03 22:21:03 +02:00
parent 45f2f77a58
commit ebd3280443
2 changed files with 15 additions and 0 deletions

View File

@ -163,6 +163,20 @@ HTTPSessionManagerFile::HTTPSessionManagerFile() {
HTTPSessionManagerFile::~HTTPSessionManagerFile() {
}
void HTTPSessionManagerFile::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
if (Engine::get_singleton()->is_editor_hint()) {
return;
}
load_sessions();
} break;
default:
break;
}
}
void HTTPSessionManagerFile::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_save_folder_path"), &HTTPSessionManagerFile::get_save_folder_path);
ClassDB::bind_method(D_METHOD("set_save_folder_path", "val"), &HTTPSessionManagerFile::set_save_folder_path);

View File

@ -54,6 +54,7 @@ public:
~HTTPSessionManagerFile();
protected:
void _notification(int p_what);
static void _bind_methods();
String _save_folder_path;