@@ -381,12 +381,12 @@ func _on_redock() -> void:
381381
382382
383383func _build_margin_container (margin : int = 12 ) -> MarginContainer :
384- var marginContainer := MarginContainer .new ()
385- marginContainer .add_theme_constant_override ("margin_left" , margin )
386- marginContainer .add_theme_constant_override ("margin_right" , margin )
387- marginContainer .add_theme_constant_override ("margin_top" , margin )
388- marginContainer .add_theme_constant_override ("margin_bottom" , margin )
389- return marginContainer
384+ var margin_container := MarginContainer .new ()
385+ margin_container .add_theme_constant_override ("margin_left" , margin )
386+ margin_container .add_theme_constant_override ("margin_right" , margin )
387+ margin_container .add_theme_constant_override ("margin_top" , margin )
388+ margin_container .add_theme_constant_override ("margin_bottom" , margin )
389+ return margin_container
390390
391391
392392func _build_ui () -> void :
@@ -571,7 +571,7 @@ func _build_ui() -> void:
571571
572572 var clients_open_btn := Button .new ()
573573 clients_open_btn .text = "Clients & Settings"
574- clients_open_btn .tooltip_text = "Open the MCP settings window — configure AI clients or disable tool domains to fit under a client's hard tool-count cap (e.g. Antigravity's 100)."
574+ clients_open_btn .tooltip_text = "Open the MCP settings window — configure AI clients, choose telemetry preferences, or disable tool domains to fit under a client's hard tool-count cap (e.g. Antigravity's 100)."
575575 clients_open_btn .pressed .connect (_on_open_clients_window )
576576 clients_row .add_child (clients_open_btn )
577577
@@ -595,7 +595,8 @@ func _build_ui() -> void:
595595
596596 _clients_window = Window .new ()
597597 _clients_window .title = "MCP Clients & Settings"
598- _clients_window .min_size = Vector2i (560 , 460 ) * EditorInterface .get_editor_scale ()
598+ ## `Vector2i * float` yields Vector2; wrap the result back to Vector2i.
599+ _clients_window .min_size = Vector2i (Vector2 (560 , 460 ) * EditorInterface .get_editor_scale ())
599600 _clients_window .visible = false
600601 _clients_window .close_requested .connect (_on_clients_window_close_requested )
601602 add_child (_clients_window )
@@ -991,7 +992,7 @@ func _on_log_logging_enabled_changed(enabled: bool) -> void:
991992func _on_port_apply_requested (new_port : int ) -> void :
992993 var es := EditorInterface .get_editor_settings ()
993994 if es != null :
994- es .set_setting (ClientConfigurator .SETTING_HTTP_PORT , new_port )
995+ es .set_setting (McpSettings .SETTING_HTTP_PORT , new_port )
995996 ## Every saved client config now points at the old port. Re-sweep so the
996997 ## drift banner appears in the same frame the user committed the change —
997998 ## the plugin reload below will run a second sweep on its own first paint,
@@ -1015,19 +1016,13 @@ func _refresh_server_label() -> void:
10151016# --- Telemetry setting persistence ---
10161017
10171018
1018- func _env_truthy (var_name : String ) -> bool :
1019- var val : String = OS .get_environment (var_name ).strip_edges ().to_lower ()
1020- return val in ["1" , "true" , "yes" , "on" ]
1021-
1022-
10231019## Returns true if GODOT_AI_DISABLE_TELEMETRY or DISABLE_TELEMETRY is set
10241020## to a truthy value, false if either is set and non-truthy, null if neither
10251021## env var is present at all.
10261022func _is_telemetry_disabled_via_env () -> Variant :
1027- var disabled : bool = _env_truthy ("GODOT_AI_DISABLE_TELEMETRY" ) or _env_truthy ("DISABLE_TELEMETRY" )
1028- if OS .has_environment ("GODOT_AI_DISABLE_TELEMETRY" ) or OS .has_environment ("DISABLE_TELEMETRY" ):
1029- return disabled
1030- return null
1023+ if not (OS .has_environment ("GODOT_AI_DISABLE_TELEMETRY" ) or OS .has_environment ("DISABLE_TELEMETRY" )):
1024+ return null
1025+ return McpSettings .env_truthy ("GODOT_AI_DISABLE_TELEMETRY" ) or McpSettings .env_truthy ("DISABLE_TELEMETRY" )
10311026
10321027
10331028## Reads the telemetry preference, applying env-var override when present.
@@ -1044,15 +1039,15 @@ func _load_telemetry_setting() -> void:
10441039 ## the env var honour the last-set value.
10451040 enabled = not bool (env_disabled )
10461041 if es != null :
1047- es .set_setting ("godot_ai/telemetry_enabled" , enabled )
1042+ es .set_setting (McpSettings . SETTING_TELEMETRY_ENABLED , enabled )
10481043 else :
10491044 ## No env var: read (or create) the EditorSettings key.
1050- if es != null and es .has_setting ("godot_ai/telemetry_enabled" ):
1051- enabled = bool (es .get_setting ("godot_ai/telemetry_enabled" ))
1045+ if es != null and es .has_setting (McpSettings . SETTING_TELEMETRY_ENABLED ):
1046+ enabled = bool (es .get_setting (McpSettings . SETTING_TELEMETRY_ENABLED ))
10521047 else :
10531048 enabled = true
10541049 if es != null :
1055- es .set_setting ("godot_ai/telemetry_enabled" , true )
1050+ es .set_setting (McpSettings . SETTING_TELEMETRY_ENABLED , true )
10561051
10571052 _telemetry_pending_enabled = enabled
10581053 _telemetry_saved_enabled = enabled
@@ -1117,7 +1112,7 @@ func _apply_dev_mode_visibility() -> void:
11171112# --- Button handlers ---
11181113
11191114
1120- func _do_plugin_reload ():
1115+ func _do_plugin_reload () -> void :
11211116 EditorInterface .set_plugin_enabled ("res://addons/godot_ai/plugin.cfg" , false )
11221117 EditorInterface .set_plugin_enabled ("res://addons/godot_ai/plugin.cfg" , true )
11231118
@@ -1920,14 +1915,14 @@ func _on_tools_apply() -> void:
19201915 var canonical_excluded := ToolCatalog .canonical (_tools_pending_excluded )
19211916 var es := EditorInterface .get_editor_settings ()
19221917 if es != null :
1923- es .set_setting (ClientConfigurator .SETTING_EXCLUDED_DOMAINS , canonical_excluded )
1924- es .set_setting ("godot_ai/telemetry_enabled" , _telemetry_pending_enabled )
1918+ es .set_setting (McpSettings .SETTING_EXCLUDED_DOMAINS , canonical_excluded )
1919+ es .set_setting (McpSettings . SETTING_TELEMETRY_ENABLED , _telemetry_pending_enabled )
19251920 _tools_saved_excluded = _tools_pending_excluded .duplicate ()
19261921 _telemetry_saved_enabled = _telemetry_pending_enabled
19271922 _refresh_tools_ui_state ()
1928- ## Plugin reload respawns the server with the new `--exclude-domains`
1929- ## flag (see `plugin.gd::_build_server_flags`). Mirrors the port-change
1930- ## Apply flow.
1923+ ## Plugin reload respawns the server with the new `--exclude-domains` flag
1924+ ## (see `plugin.gd::_build_server_flags`) and telemetry option . Mirrors the
1925+ ## port-change Apply flow.
19311926 _on_reload_plugin ()
19321927
19331928
0 commit comments