Display remote_host/port in network->debug settings

This commit is contained in:
Fabio Alessandrelli 2017-05-09 13:57:07 +02:00
parent 98eb58a93c
commit 3b123367a1
3 changed files with 11 additions and 7 deletions

View file

@ -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";

View file

@ -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");

View file

@ -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() {