summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/classes/EditorFileDialog.xml10
-rw-r--r--editor/editor_file_dialog.cpp17
-rw-r--r--editor/editor_file_dialog.h2
-rw-r--r--misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj4
-rw-r--r--platform/linuxbsd/tts_linux.cpp9
-rw-r--r--platform/linuxbsd/tts_linux.h2
-rw-r--r--platform/linuxbsd/x11/key_mapping_x11.cpp4
-rw-r--r--platform/macos/key_mapping_macos.mm4
-rw-r--r--platform/windows/display_server_windows.cpp2
-rw-r--r--platform/windows/key_mapping_windows.cpp4
-rw-r--r--scene/gui/label.cpp5
11 files changed, 39 insertions, 24 deletions
diff --git a/doc/classes/EditorFileDialog.xml b/doc/classes/EditorFileDialog.xml
index 29a8f470a1..7f8808acc7 100644
--- a/doc/classes/EditorFileDialog.xml
+++ b/doc/classes/EditorFileDialog.xml
@@ -25,6 +25,13 @@
Removes all filters except for "All Files (*)".
</description>
</method>
+ <method name="get_line_edit">
+ <return type="LineEdit" />
+ <description>
+ Returns the LineEdit for the selected file.
+ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.
+ </description>
+ </method>
<method name="get_vbox">
<return type="VBoxContainer" />
<description>
@@ -62,6 +69,9 @@
<member name="file_mode" type="int" setter="set_file_mode" getter="get_file_mode" enum="EditorFileDialog.FileMode" default="4">
The dialog's open or save mode, which affects the selection behavior. See [enum FileMode]
</member>
+ <member name="filters" type="PackedStringArray" setter="set_filters" getter="get_filters" default="PackedStringArray()">
+ The available file type filters. For example, this shows only [code].png[/code] and [code].gd[/code] files: [code]set_filters(PackedStringArray(["*.png ; PNG Images","*.gd ; GDScript Files"]))[/code]. Multiple file types can also be specified in a single filter. [code]"*.png, *.jpg, *.jpeg ; Supported Images"[/code] will show both PNG and JPEG files when selected.
+ </member>
<member name="show_hidden_files" type="bool" setter="set_show_hidden_files" getter="is_showing_hidden_files" default="false">
If [code]true[/code], hidden files and directories will be visible in the [EditorFileDialog]. This property is synchronized with [member EditorSettings.filesystem/file_dialog/show_hidden_files].
</member>
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index 50826f572a..b4ef719ab0 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -1015,6 +1015,19 @@ void EditorFileDialog::add_filter(const String &p_filter, const String &p_descri
invalidate();
}
+void EditorFileDialog::set_filters(const Vector<String> &p_filters) {
+ if (filters == p_filters) {
+ return;
+ }
+ filters = p_filters;
+ update_filters();
+ invalidate();
+}
+
+Vector<String> EditorFileDialog::get_filters() const {
+ return filters;
+}
+
String EditorFileDialog::get_current_dir() const {
return dir_access->get_current_dir();
}
@@ -1570,6 +1583,8 @@ void EditorFileDialog::_bind_methods() {
ClassDB::bind_method(D_METHOD("clear_filters"), &EditorFileDialog::clear_filters);
ClassDB::bind_method(D_METHOD("add_filter", "filter", "description"), &EditorFileDialog::add_filter, DEFVAL(""));
+ ClassDB::bind_method(D_METHOD("set_filters", "filters"), &EditorFileDialog::set_filters);
+ ClassDB::bind_method(D_METHOD("get_filters"), &EditorFileDialog::get_filters);
ClassDB::bind_method(D_METHOD("get_current_dir"), &EditorFileDialog::get_current_dir);
ClassDB::bind_method(D_METHOD("get_current_file"), &EditorFileDialog::get_current_file);
ClassDB::bind_method(D_METHOD("get_current_path"), &EditorFileDialog::get_current_path);
@@ -1579,6 +1594,7 @@ void EditorFileDialog::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_file_mode", "mode"), &EditorFileDialog::set_file_mode);
ClassDB::bind_method(D_METHOD("get_file_mode"), &EditorFileDialog::get_file_mode);
ClassDB::bind_method(D_METHOD("get_vbox"), &EditorFileDialog::get_vbox);
+ ClassDB::bind_method(D_METHOD("get_line_edit"), &EditorFileDialog::get_line_edit);
ClassDB::bind_method(D_METHOD("set_access", "access"), &EditorFileDialog::set_access);
ClassDB::bind_method(D_METHOD("get_access"), &EditorFileDialog::get_access);
ClassDB::bind_method(D_METHOD("set_show_hidden_files", "show"), &EditorFileDialog::set_show_hidden_files);
@@ -1605,6 +1621,7 @@ void EditorFileDialog::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_dir", PROPERTY_HINT_DIR, "", PROPERTY_USAGE_NONE), "set_current_dir", "get_current_dir");
ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_file", PROPERTY_HINT_FILE, "*", PROPERTY_USAGE_NONE), "set_current_file", "get_current_file");
ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_path", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_current_path", "get_current_path");
+ ADD_PROPERTY(PropertyInfo(Variant::PACKED_STRING_ARRAY, "filters"), "set_filters", "get_filters");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_hidden_files"), "set_show_hidden_files", "is_showing_hidden_files");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disable_overwrite_warning"), "set_disable_overwrite_warning", "is_overwrite_warning_disabled");
diff --git a/editor/editor_file_dialog.h b/editor/editor_file_dialog.h
index 1944cacf70..e3515f8073 100644
--- a/editor/editor_file_dialog.h
+++ b/editor/editor_file_dialog.h
@@ -242,6 +242,8 @@ public:
void popup_file_dialog();
void clear_filters();
void add_filter(const String &p_filter, const String &p_description = "");
+ void set_filters(const Vector<String> &p_filters);
+ Vector<String> get_filters() const;
void set_enable_multiple_selection(bool p_enable);
Vector<String> get_selected_files() const;
diff --git a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
index 16e58172b2..09e8bf4cc7 100644
--- a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
+++ b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
@@ -14,7 +14,6 @@
1FF8DBB11FBA9DE1009DE660 /* dummy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1FF8DBB01FBA9DE1009DE660 /* dummy.cpp */; };
D07CD44E1C5D589C00B7FB28 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D07CD44D1C5D589C00B7FB28 /* Images.xcassets */; };
9039D3BE24C093AC0020482C /* MoltenVK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9039D3BD24C093AC0020482C /* MoltenVK.xcframework */; };
- 9073252C24BF980B0063BCD4 /* vulkan in Resources */ = {isa = PBXBuildFile; fileRef = 905036DC24BF932E00301046 /* vulkan */; };
D0BCFE4618AEBDA2004A7AAE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D0BCFE4418AEBDA2004A7AAE /* InfoPlist.strings */; };
D0BCFE7818AEBFEB004A7AAE /* $binary.pck in Resources */ = {isa = PBXBuildFile; fileRef = D0BCFE7718AEBFEB004A7AAE /* $binary.pck */; };
$pbx_launch_screen_build_reference
@@ -42,7 +41,6 @@
1FF4C1881F584E6300A41E41 /* $binary.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "$binary.entitlements"; sourceTree = "<group>"; };
1FF8DBB01FBA9DE1009DE660 /* dummy.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = dummy.cpp; sourceTree = "<group>"; };
9039D3BD24C093AC0020482C /* MoltenVK.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = MoltenVK; path = MoltenVK.xcframework; sourceTree = "<group>"; };
- 905036DC24BF932E00301046 /* vulkan */ = {isa = PBXFileReference; lastKnownFileType = folder; name = vulkan; path = "$binary/vulkan"; sourceTree = "<group>"; };
D07CD44D1C5D589C00B7FB28 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
D0BCFE3418AEBDA2004A7AAE /* $binary.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "$binary.app"; sourceTree = BUILT_PRODUCTS_DIR; };
D0BCFE4318AEBDA2004A7AAE /* $binary-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "$binary-Info.plist"; sourceTree = "<group>"; };
@@ -72,7 +70,6 @@
D0BCFE2B18AEBDA2004A7AAE = {
isa = PBXGroup;
children = (
- 905036DC24BF932E00301046 /* vulkan */,
1F1575711F582BE20003B888 /* dylibs */,
D0BCFE7718AEBFEB004A7AAE /* $binary.pck */,
D0BCFE4118AEBDA2004A7AAE /* $binary */,
@@ -185,7 +182,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 9073252C24BF980B0063BCD4 /* vulkan in Resources */,
D07CD44E1C5D589C00B7FB28 /* Images.xcassets in Resources */,
D0BCFE7818AEBFEB004A7AAE /* $binary.pck in Resources */,
$pbx_launch_screen_build_phase
diff --git a/platform/linuxbsd/tts_linux.cpp b/platform/linuxbsd/tts_linux.cpp
index 6b8584ef6c..ce0199e87f 100644
--- a/platform/linuxbsd/tts_linux.cpp
+++ b/platform/linuxbsd/tts_linux.cpp
@@ -35,11 +35,6 @@
TTS_Linux *TTS_Linux::singleton = nullptr;
-void TTS_Linux::_bind_methods() {
- ClassDB::bind_method(D_METHOD("_speech_event", "msg_id", "client_id", "type"), &TTS_Linux::_speech_event);
- ClassDB::bind_method(D_METHOD("_speech_index_mark", "msg_id", "client_id", "type", "index_mark"), &TTS_Linux::_speech_index_mark);
-}
-
void TTS_Linux::speech_init_thread_func(void *p_userdata) {
TTS_Linux *tts = (TTS_Linux *)p_userdata;
if (tts) {
@@ -82,7 +77,7 @@ void TTS_Linux::speech_init_thread_func(void *p_userdata) {
void TTS_Linux::speech_event_index_mark(size_t p_msg_id, size_t p_client_id, SPDNotificationType p_type, char *p_index_mark) {
TTS_Linux *tts = TTS_Linux::get_singleton();
if (tts) {
- tts->call_deferred(SNAME("_speech_index_mark"), p_msg_id, p_client_id, (int)p_type, String::utf8(p_index_mark));
+ callable_mp(tts, &TTS_Linux::_speech_index_mark).call_deferred(p_msg_id, p_client_id, (int)p_type, String::utf8(p_index_mark));
}
}
@@ -97,7 +92,7 @@ void TTS_Linux::_speech_index_mark(size_t p_msg_id, size_t p_client_id, int p_ty
void TTS_Linux::speech_event_callback(size_t p_msg_id, size_t p_client_id, SPDNotificationType p_type) {
TTS_Linux *tts = TTS_Linux::get_singleton();
if (tts) {
- tts->call_deferred(SNAME("_speech_event"), p_msg_id, p_client_id, (int)p_type);
+ callable_mp(tts, &TTS_Linux::_speech_event).call_deferred(p_msg_id, p_client_id, (int)p_type);
}
}
diff --git a/platform/linuxbsd/tts_linux.h b/platform/linuxbsd/tts_linux.h
index 3fcbe3207b..4134f8fa2f 100644
--- a/platform/linuxbsd/tts_linux.h
+++ b/platform/linuxbsd/tts_linux.h
@@ -46,7 +46,6 @@
#endif
class TTS_Linux : public Object {
- GDCLASS(TTS_Linux, Object);
_THREAD_SAFE_CLASS_
List<DisplayServer::TTSUtterance> queue;
@@ -65,7 +64,6 @@ class TTS_Linux : public Object {
static TTS_Linux *singleton;
protected:
- static void _bind_methods();
void _speech_event(size_t p_msg_id, size_t p_client_id, int p_type);
void _speech_index_mark(size_t p_msg_id, size_t p_client_id, int p_type, const String &p_index_mark);
diff --git a/platform/linuxbsd/x11/key_mapping_x11.cpp b/platform/linuxbsd/x11/key_mapping_x11.cpp
index e5eba6ccad..f21c151288 100644
--- a/platform/linuxbsd/x11/key_mapping_x11.cpp
+++ b/platform/linuxbsd/x11/key_mapping_x11.cpp
@@ -217,8 +217,8 @@ void KeyMappingX11::initialize() {
scancode_map[0x1F] = Key::I;
scancode_map[0x20] = Key::O;
scancode_map[0x21] = Key::P;
- scancode_map[0x22] = Key::BRACELEFT;
- scancode_map[0x23] = Key::BRACERIGHT;
+ scancode_map[0x22] = Key::BRACKETLEFT;
+ scancode_map[0x23] = Key::BRACKETRIGHT;
scancode_map[0x24] = Key::ENTER;
scancode_map[0x25] = Key::CTRL;
scancode_map[0x26] = Key::A;
diff --git a/platform/macos/key_mapping_macos.mm b/platform/macos/key_mapping_macos.mm
index 31b71ac1b8..c3f147e33f 100644
--- a/platform/macos/key_mapping_macos.mm
+++ b/platform/macos/key_mapping_macos.mm
@@ -98,10 +98,10 @@ void KeyMappingMacOS::initialize() {
keysym_map[0x1b] = Key::MINUS;
keysym_map[0x1c] = Key::KEY_8;
keysym_map[0x1d] = Key::KEY_0;
- keysym_map[0x1e] = Key::BRACERIGHT;
+ keysym_map[0x1e] = Key::BRACKETRIGHT;
keysym_map[0x1f] = Key::O;
keysym_map[0x20] = Key::U;
- keysym_map[0x21] = Key::BRACELEFT;
+ keysym_map[0x21] = Key::BRACKETLEFT;
keysym_map[0x22] = Key::I;
keysym_map[0x23] = Key::P;
keysym_map[0x24] = Key::ENTER;
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp
index d2889a3442..92af3fef69 100644
--- a/platform/windows/display_server_windows.cpp
+++ b/platform/windows/display_server_windows.cpp
@@ -4237,7 +4237,7 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win
window_position = screen_get_position(p_screen) + (screen_get_size(p_screen) - p_resolution) / 2;
}
- WindowID main_window = _create_window(p_mode, p_vsync_mode, 0, Rect2i(window_position, p_resolution));
+ WindowID main_window = _create_window(p_mode, p_vsync_mode, p_flags, Rect2i(window_position, p_resolution));
ERR_FAIL_COND_MSG(main_window == INVALID_WINDOW_ID, "Failed to create main window.");
joypad = new JoypadWindows(&windows[MAIN_WINDOW_ID].hWnd);
diff --git a/platform/windows/key_mapping_windows.cpp b/platform/windows/key_mapping_windows.cpp
index d43f74126d..aa393464b6 100644
--- a/platform/windows/key_mapping_windows.cpp
+++ b/platform/windows/key_mapping_windows.cpp
@@ -257,8 +257,8 @@ void KeyMappingWindows::initialize() {
scansym_map[0x17] = Key::I;
scansym_map[0x18] = Key::O;
scansym_map[0x19] = Key::P;
- scansym_map[0x1A] = Key::BRACELEFT;
- scansym_map[0x1B] = Key::BRACERIGHT;
+ scansym_map[0x1A] = Key::BRACKETLEFT;
+ scansym_map[0x1B] = Key::BRACKETRIGHT;
scansym_map[0x1C] = Key::ENTER;
scansym_map[0x1D] = Key::CTRL;
scansym_map[0x1E] = Key::A;
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index b861d7af01..81426158a2 100644
--- a/scene/gui/label.cpp
+++ b/scene/gui/label.cpp
@@ -209,10 +209,7 @@ bool Label::_shape() {
// Fill after min_size calculation.
- int visible_lines = lines_rid.size();
- if (max_lines_visible >= 0 && visible_lines > max_lines_visible) {
- visible_lines = max_lines_visible;
- }
+ int visible_lines = get_visible_line_count();
if (autowrap_mode != TextServer::AUTOWRAP_OFF) {
bool lines_hidden = visible_lines > 0 && visible_lines < lines_rid.size();
if (lines_hidden) {