mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 13:49:54 +00:00
Add special compat methods for EditorFileDialog enum fns
Fixes broken binary compatibility in GDExtension, introduced by moving methods from EditorFileDialog to its base class FileDialog. While the general derived-to-base compat mechanism works, the function hashes are changed when enum types are also moved between classes. An earlier attempt restored original enums in EditorFileDialog and added regular compatibility methods, however this caused shadowed symbols in C# bindings. Instead, hash mappings are now directly hardcoded as "special compat hashes".
This commit is contained in:
parent
8105ff7ac7
commit
f31aa20562
2 changed files with 7 additions and 1 deletions
|
|
@ -331,6 +331,12 @@ void GDExtensionSpecialCompatHashes::initialize() {
|
||||||
});
|
});
|
||||||
mappings.insert("EditorFileDialog", {
|
mappings.insert("EditorFileDialog", {
|
||||||
{ "add_filter", 233059325, 3388804757 },
|
{ "add_filter", 233059325, 3388804757 },
|
||||||
|
{ "get_access", 778734016, 3344081076 },
|
||||||
|
{ "set_access", 3882893764, 4104413466 },
|
||||||
|
{ "get_display_mode", 3517174669, 1092104624 },
|
||||||
|
{ "set_display_mode", 3049004050, 2692197101 },
|
||||||
|
{ "get_file_mode", 2681044145, 4074825319 },
|
||||||
|
{ "set_file_mode", 274150415, 3654936397 },
|
||||||
});
|
});
|
||||||
mappings.insert("EditorImportPlugin", {
|
mappings.insert("EditorImportPlugin", {
|
||||||
{ "append_import_external_resource", 3645925746, 320493106 },
|
{ "append_import_external_resource", 3645925746, 320493106 },
|
||||||
|
|
|
||||||
|
|
@ -1370,7 +1370,7 @@ ProjectManager::ProjectManager() {
|
||||||
FileDialog::set_get_thumbnail_callback(callable_mp_static(ProjectManager::_file_dialog_get_thumbnail));
|
FileDialog::set_get_thumbnail_callback(callable_mp_static(ProjectManager::_file_dialog_get_thumbnail));
|
||||||
|
|
||||||
FileDialog::set_default_show_hidden_files(EDITOR_GET("filesystem/file_dialog/show_hidden_files"));
|
FileDialog::set_default_show_hidden_files(EDITOR_GET("filesystem/file_dialog/show_hidden_files"));
|
||||||
FileDialog::set_default_display_mode((EditorFileDialog::DisplayMode)EDITOR_GET("filesystem/file_dialog/display_mode").operator int());
|
FileDialog::set_default_display_mode((FileDialog::DisplayMode)EDITOR_GET("filesystem/file_dialog/display_mode").operator int());
|
||||||
|
|
||||||
int swap_cancel_ok = EDITOR_GET("interface/editor/accept_dialog_cancel_ok_buttons");
|
int swap_cancel_ok = EDITOR_GET("interface/editor/accept_dialog_cancel_ok_buttons");
|
||||||
if (swap_cancel_ok != 0) { // 0 is auto, set in register_scene based on DisplayServer.
|
if (swap_cancel_ok != 0) { // 0 is auto, set in register_scene based on DisplayServer.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue