Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update #19

Merged
merged 8 commits into from
Jan 16, 2025
4 changes: 2 additions & 2 deletions core/debugger/remote_debugger_peer.cpp
Original file line number Diff line number Diff line change
@@ -173,12 +173,12 @@ Error RemoteDebuggerPeerTCP::connect_to_host(const String &p_host, uint16_t p_po
} else {
const int ms = waits[i];
OS::get_singleton()->delay_usec(ms * 1000);
print_verbose("Remote Debugger: Connection failed with status: '" + String::num(tcp_client->get_status()) + "', retrying in " + String::num(ms) + " msec.");
print_verbose("Remote Debugger: Connection failed with status: '" + String::num_int64(tcp_client->get_status()) + "', retrying in " + String::num_int64(ms) + " msec.");
}
}

if (tcp_client->get_status() != StreamPeerTCP::STATUS_CONNECTED) {
ERR_PRINT(vformat("Remote Debugger: Unable to connect. Status: %s.", String::num(tcp_client->get_status())));
ERR_PRINT(vformat("Remote Debugger: Unable to connect. Status: %s.", String::num_int64(tcp_client->get_status())));
return FAILED;
}
connected = true;
2 changes: 1 addition & 1 deletion editor/editor_file_system.cpp
Original file line number Diff line number Diff line change
@@ -1747,7 +1747,7 @@ void EditorFileSystem::_save_filesystem_cache(EditorFileSystemDirectory *p_dir,
if (!p_dir) {
return; //none
}
p_file->store_line("::" + p_dir->get_path() + "::" + String::num(p_dir->modified_time));
p_file->store_line("::" + p_dir->get_path() + "::" + String::num_int64(p_dir->modified_time));

for (int i = 0; i < p_dir->files.size(); i++) {
const EditorFileSystemDirectory::FileInfo *file_info = p_dir->files[i];
2 changes: 1 addition & 1 deletion editor/export/editor_export_platform.cpp
Original file line number Diff line number Diff line change
@@ -2209,7 +2209,7 @@ Vector<String> EditorExportPlatform::gen_export_flags(BitField<EditorExportPlatf
if (p_flags.has_flag(DEBUG_FLAG_REMOTE_DEBUG)) {
ret.push_back("--remote-debug");

ret.push_back(get_debug_protocol() + host + ":" + String::num(remote_port));
ret.push_back(get_debug_protocol() + host + ":" + String::num_int64(remote_port));

List<String> breakpoints;
ScriptEditor::get_singleton()->get_breakpoints(&breakpoints);
4 changes: 2 additions & 2 deletions editor/plugins/script_text_editor.cpp
Original file line number Diff line number Diff line change
@@ -757,7 +757,7 @@ void ScriptTextEditor::_update_bookmark_list() {
line = line.substr(0, 50);
}

bookmarks_menu->add_item(String::num((int)bookmark_list[i] + 1) + " - `" + line + "`");
bookmarks_menu->add_item(String::num_int64(bookmark_list[i] + 1) + " - `" + line + "`");
bookmarks_menu->set_item_metadata(-1, bookmark_list[i]);
}
}
@@ -912,7 +912,7 @@ void ScriptTextEditor::_update_breakpoint_list() {
line = line.substr(0, 50);
}

breakpoints_menu->add_item(String::num((int)breakpoint_list[i] + 1) + " - `" + line + "`");
breakpoints_menu->add_item(String::num_int64(breakpoint_list[i] + 1) + " - `" + line + "`");
breakpoints_menu->set_item_metadata(-1, breakpoint_list[i]);
}
}
2 changes: 1 addition & 1 deletion editor/plugins/text_editor.cpp
Original file line number Diff line number Diff line change
@@ -229,7 +229,7 @@ void TextEditor::_update_bookmark_list() {
line = line.substr(0, 50);
}

bookmarks_menu->add_item(String::num((int)bookmark_list[i] + 1) + " - \"" + line + "\"");
bookmarks_menu->add_item(String::num_int64(bookmark_list[i] + 1) + " - \"" + line + "\"");
bookmarks_menu->set_item_metadata(-1, bookmark_list[i]);
}
}
2 changes: 1 addition & 1 deletion editor/plugins/text_shader_editor.cpp
Original file line number Diff line number Diff line change
@@ -1075,7 +1075,7 @@ void TextShaderEditor::_update_bookmark_list() {
line = line.substr(0, 50);
}

bookmarks_menu->add_item(String::num((int)bookmark_list[i] + 1) + " - \"" + line + "\"");
bookmarks_menu->add_item(String::num_int64(bookmark_list[i] + 1) + " - \"" + line + "\"");
bookmarks_menu->set_item_metadata(-1, bookmark_list[i]);
}
}
21 changes: 14 additions & 7 deletions editor/project_manager.cpp
Original file line number Diff line number Diff line change
@@ -149,7 +149,7 @@ void ProjectManager::_build_icon_type_cache(Ref<Theme> p_theme) {

// Main layout.

void ProjectManager::_update_size_limits() {
void ProjectManager::_update_size_limits(bool p_custom_res) {
const Size2 minimum_size = Size2(720, 450) * EDSCALE;
const Size2 default_size = Size2(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT) * EDSCALE;

@@ -159,20 +159,21 @@ void ProjectManager::_update_size_limits() {
// Calling Window methods this early doesn't sync properties with DS.
w->set_min_size(minimum_size);
DisplayServer::get_singleton()->window_set_min_size(minimum_size);
if (DisplayServer::get_singleton()->window_get_size() == default_size) {
if (!p_custom_res) {
// Only set window size if it currently matches the default, which is defined in `main/main.cpp`.
// This allows CLI arguments to override the window size.
w->set_size(default_size);
DisplayServer::get_singleton()->window_set_size(default_size);
}
}
Size2 real_size = DisplayServer::get_singleton()->window_get_size();

Rect2i screen_rect = DisplayServer::get_singleton()->screen_get_usable_rect(DisplayServer::get_singleton()->window_get_current_screen());
if (screen_rect.size != Vector2i()) {
// Center the window on the screen.
Vector2i window_position;
window_position.x = screen_rect.position.x + (screen_rect.size.x - default_size.x) / 2;
window_position.y = screen_rect.position.y + (screen_rect.size.y - default_size.y) / 2;
window_position.x = screen_rect.position.x + (screen_rect.size.x - real_size.x) / 2;
window_position.y = screen_rect.position.y + (screen_rect.size.y - real_size.y) / 2;
DisplayServer::get_singleton()->window_set_position(window_position);

// Limit popup menus to prevent unusably long lists.
@@ -612,7 +613,13 @@ void ProjectManager::_open_selected_projects_check_warnings() {
}

void ProjectManager::_open_selected_projects_check_recovery_mode() {
ProjectList::Item project = project_list->get_selected_projects()[0];
Vector<ProjectList::Item> selected_projects = project_list->get_selected_projects();

if (selected_projects.is_empty()) {
return;
}

const ProjectList::Item &project = selected_projects[0];
if (project.missing) {
return;
}
@@ -1152,7 +1159,7 @@ void ProjectManager::_titlebar_resized() {

// Object methods.

ProjectManager::ProjectManager() {
ProjectManager::ProjectManager(bool p_custom_res) {
singleton = this;

set_translation_domain("godot.editor");
@@ -1740,7 +1747,7 @@ ProjectManager::ProjectManager() {
title_bar->connect(SceneStringName(item_rect_changed), callable_mp(this, &ProjectManager::_titlebar_resized));
}

_update_size_limits();
_update_size_limits(p_custom_res);
}

ProjectManager::~ProjectManager() {
4 changes: 2 additions & 2 deletions editor/project_manager.h
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ class ProjectManager : public Control {

Ref<Theme> theme;

void _update_size_limits();
void _update_size_limits(bool p_custom_res);
void _update_theme(bool p_skip_creation = false);
void _titlebar_resized();

@@ -262,7 +262,7 @@ class ProjectManager : public Control {

void add_new_tag(const String &p_tag);

ProjectManager();
ProjectManager(bool p_custom_res);
~ProjectManager();
};

6 changes: 3 additions & 3 deletions main/main.cpp
Original file line number Diff line number Diff line change
@@ -230,6 +230,8 @@ static bool init_use_custom_pos = false;
static bool init_use_custom_screen = false;
static Vector2 init_custom_pos;
static int64_t init_embed_parent_window_id = 0;
static bool use_custom_res = true;
static bool force_res = false;

// Debug

@@ -1019,8 +1021,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
String remotefs_pass;

Vector<String> breakpoints;
bool use_custom_res = true;
bool force_res = false;
bool delta_smoothing_override = false;

String default_renderer = "";
@@ -4318,7 +4318,7 @@ int Main::start() {
translation_server->get_editor_domain()->set_pseudolocalization_enabled(true);
}

ProjectManager *pmanager = memnew(ProjectManager);
ProjectManager *pmanager = memnew(ProjectManager(force_res || use_custom_res));
ProgressDialog *progress_dialog = memnew(ProgressDialog);
pmanager->add_child(progress_dialog);

4 changes: 4 additions & 0 deletions misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
054F8BE62D38852F00B81423 /* MetalFX.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 054F8BE52D38852F00B81423 /* MetalFX.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
1F1575721F582BE20003B888 /* dylibs in Resources */ = {isa = PBXBuildFile; fileRef = 1F1575711F582BE20003B888 /* dylibs */; };
DEADBEEF2F582BE20003B888 /* $binary.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = DEADBEEF1F582BE20003B888 /* $binary.xcframework */; };
$modules_buildfile
@@ -42,6 +43,7 @@
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>"; };
054F8BE52D38852F00B81423 /* MetalFX.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalFX.framework; path = System/Library/Frameworks/MetalFX.framework; sourceTree = SDKROOT; };
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>"; };
@@ -60,6 +62,7 @@
buildActionMask = 2147483647;
files = (
9039D3BE24C093AC0020482C /* MoltenVK.xcframework in Frameworks */,
054F8BE62D38852F00B81423 /* MetalFX.framework in Frameworks */,
DEADBEEF2F582BE20003B888 /* $binary.xcframework */,
$modules_buildphase
$additional_pbx_frameworks_build
@@ -94,6 +97,7 @@
isa = PBXGroup;
children = (
9039D3BD24C093AC0020482C /* MoltenVK.xcframework */,
054F8BE52D38852F00B81423 /* MetalFX.framework */,
DEADBEEF1F582BE20003B888 /* $binary.xcframework */,
$modules_buildgrp
$additional_pbx_frameworks_refs
2 changes: 1 addition & 1 deletion modules/regex/regex.cpp
Original file line number Diff line number Diff line change
@@ -196,7 +196,7 @@ Error RegEx::compile(const String &p_pattern, bool p_show_error) {
if (p_show_error) {
PCRE2_UCHAR32 buf[256];
pcre2_get_error_message_32(err, buf, 256);
String message = String::num(offset) + ": " + String((const char32_t *)buf);
String message = String::num_int64(offset) + ": " + String((const char32_t *)buf);
ERR_PRINT(message.utf8());
}
return FAILED;
2 changes: 1 addition & 1 deletion modules/websocket/emws_peer.cpp
Original file line number Diff line number Diff line change
@@ -93,7 +93,7 @@ Error EMWSPeer::connect_to_url(const String &p_url, Ref<TLSOptions> p_tls_option
requested_url = scheme + host;

if (port && ((scheme == "ws://" && port != 80) || (scheme == "wss://" && port != 443))) {
requested_url += ":" + String::num(port);
requested_url += ":" + String::num_int64(port);
}

if (!path.is_empty()) {
2 changes: 1 addition & 1 deletion platform/ios/export/export_plugin.cpp
Original file line number Diff line number Diff line change
@@ -3163,7 +3163,7 @@ Error EditorExportPlatformIOS::run(const Ref<EditorExportPreset> &p_preset, int
if (p_debug_flags.has_flag(DEBUG_FLAG_REMOTE_DEBUG)) {
cmd_args_list.push_back("--remote-debug");

cmd_args_list.push_back(get_debug_protocol() + host + ":" + String::num(remote_port));
cmd_args_list.push_back(get_debug_protocol() + host + ":" + String::num_int64(remote_port));

List<String> breakpoints;
ScriptEditor::get_singleton()->get_breakpoints(&breakpoints);
2 changes: 1 addition & 1 deletion platform/ios/ios.mm
Original file line number Diff line number Diff line change
@@ -191,7 +191,7 @@
String iOS::get_rate_url(int p_app_id) const {
String app_url_path = "itms-apps://itunes.apple.com/app/idAPP_ID";

String ret = app_url_path.replace("APP_ID", String::num(p_app_id));
String ret = app_url_path.replace("APP_ID", String::num_int64(p_app_id));

print_verbose(vformat("Returning rate url %s", ret));
return ret;
Loading