Explorar o código

Display remote_host/port in network->debug settings

Fabio Alessandrelli %!s(int64=8) %!d(string=hai) anos
pai
achega
3b123367a1
Modificáronse 3 ficheiros con 11 adicións e 7 borrados
  1. 3 3
      editor/editor_export.cpp
  2. 1 1
      editor/editor_run.cpp
  3. 7 3
      editor/editor_settings.cpp

+ 3 - 3
editor/editor_export.cpp

@@ -210,7 +210,7 @@ EditorExportPreset::EditorExportPreset() {
 
 void EditorExportPlatform::gen_debug_flags(Vector<String> &r_flags, int p_flags) {
 
-	String host = EditorSettings::get_singleton()->get("network/debug_host");
+	String host = EditorSettings::get_singleton()->get("network/debug/remote_host");
 
 	if (p_flags & DEBUG_FLAG_REMOTE_DEBUG_LOCALHOST)
 		host = "localhost";
@@ -620,7 +620,7 @@ Error EditorExportPlatform::save_zip(const Ref<EditorExportPreset> &p_preset, co
 
 void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags) {
 
-	String host = EditorSettings::get_singleton()->get("network/debug_host");
+	String host = EditorSettings::get_singleton()->get("network/debug/remote_host");
 
 	if (p_flags & DEBUG_FLAG_REMOTE_DEBUG_LOCALHOST)
 		host = "localhost";
@@ -2108,7 +2108,7 @@ static int _get_pad(int p_alignment, int p_n) {
 
 void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags) {
 
-	String host = EditorSettings::get_singleton()->get("network/debug_host");
+	String host = EditorSettings::get_singleton()->get("network/debug/remote_host");
 
 	if (p_flags&EXPORT_REMOTE_DEBUG_LOCALHOST)
 		host="localhost";

+ 1 - 1
editor/editor_run.cpp

@@ -41,7 +41,7 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li
 	List<String> args;
 
 	String resource_path = GlobalConfig::get_singleton()->get_resource_path();
-	String remote_host = EditorSettings::get_singleton()->get("network/debug_host");
+	String remote_host = EditorSettings::get_singleton()->get("network/debug/remote_host");
 
 	if (resource_path != "") {
 		args.push_back("-path");

+ 7 - 3
editor/editor_settings.cpp

@@ -407,7 +407,8 @@ void EditorSettings::setup_network() {
 	IP::get_singleton()->get_local_addresses(&local_ip);
 	String lip;
 	String hint;
-	String current = has("network/debug_host") ? get("network/debug_host") : "";
+	String current = has("network/debug/remote_host") ? get("network/debug/remote_host") : "";
+	int port = has("network/debug/remote_port") ? (int)get("network/debug/remote_port") : 6007;
 
 	for (List<IP_Address>::Element *E = local_ip.front(); E; E = E->next()) {
 
@@ -422,8 +423,11 @@ void EditorSettings::setup_network() {
 		hint += ip;
 	}
 
-	set("network/debug_host", lip);
-	add_property_hint(PropertyInfo(Variant::STRING, "network/debug_host", PROPERTY_HINT_ENUM, hint));
+	set("network/debug/remote_host", lip);
+	add_property_hint(PropertyInfo(Variant::STRING, "network/debug/remote_host", PROPERTY_HINT_ENUM, hint));
+
+	set("network/debug/remote_port", port);
+	add_property_hint(PropertyInfo(Variant::INT, "network/debug/remote_port", PROPERTY_HINT_RANGE, "1,65535,1"));
 }
 
 void EditorSettings::save() {