瀏覽代碼

Add a tooltip for Inclusive and Self in the editor profiler

This also changes the display mode tooltips to reflect the fact that
times are now displayed in milliseconds instead of seconds.
Hugo Locurcio 4 年之前
父節點
當前提交
e837e04ef8
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      editor/debugger/editor_profiler.cpp

+ 3 - 2
editor/debugger/editor_profiler.cpp

@@ -588,8 +588,8 @@ EditorProfiler::EditorProfiler() {
 	hb->add_child(memnew(Label(TTR("Measure:"))));
 	hb->add_child(memnew(Label(TTR("Measure:"))));
 
 
 	display_mode = memnew(OptionButton);
 	display_mode = memnew(OptionButton);
-	display_mode->add_item(TTR("Frame Time (sec)"));
-	display_mode->add_item(TTR("Average Time (sec)"));
+	display_mode->add_item(TTR("Frame Time (ms)"));
+	display_mode->add_item(TTR("Average Time (ms)"));
 	display_mode->add_item(TTR("Frame %"));
 	display_mode->add_item(TTR("Frame %"));
 	display_mode->add_item(TTR("Physics Frame %"));
 	display_mode->add_item(TTR("Physics Frame %"));
 	display_mode->connect("item_selected", callable_mp(this, &EditorProfiler::_combo_changed));
 	display_mode->connect("item_selected", callable_mp(this, &EditorProfiler::_combo_changed));
@@ -601,6 +601,7 @@ EditorProfiler::EditorProfiler() {
 	display_time = memnew(OptionButton);
 	display_time = memnew(OptionButton);
 	display_time->add_item(TTR("Inclusive"));
 	display_time->add_item(TTR("Inclusive"));
 	display_time->add_item(TTR("Self"));
 	display_time->add_item(TTR("Self"));
+	display_time->set_tooltip(TTR("Inclusive: Includes time from other functions called by this function.\nUse this to spot bottlenecks.\n\nSelf: Only count the time spent in the function itself, not in other functions called by that function.\nUse this to find individual functions to optimize."));
 	display_time->connect("item_selected", callable_mp(this, &EditorProfiler::_combo_changed));
 	display_time->connect("item_selected", callable_mp(this, &EditorProfiler::_combo_changed));
 
 
 	hb->add_child(display_time);
 	hb->add_child(display_time);