MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / get_name

Method get_name

editor/script/script_text_editor.cpp:793–814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

791}
792
793String ScriptTextEditor::get_name() {
794 String name;
795
796 name = script->get_path().get_file();
797 if (name.is_empty()) {
798 // This appears for newly created built-in scripts before saving the scene.
799 name = TTR("[unsaved]");
800 } else if (script->is_built_in()) {
801 const String &script_name = script->get_name();
802 if (!script_name.is_empty()) {
803 // If the built-in script has a custom resource name defined,
804 // display the built-in script name as follows: `ResourceName (scene_file.tscn)`
805 name = vformat("%s (%s)", script_name, name.get_slice("::", 0));
806 }
807 }
808
809 if (is_unsaved()) {
810 name += "(*)";
811 }
812
813 return name;
814}
815
816Ref<Texture2D> ScriptTextEditor::get_theme_icon() {
817 if (get_parent_control()) {

Callers 4

popup_connectionsMethod · 0.45
_update_warningsMethod · 0.45
drop_data_fwMethod · 0.45

Calls 7

TTRFunction · 0.85
vformatFunction · 0.85
is_built_inMethod · 0.80
get_sliceMethod · 0.80
get_fileMethod · 0.45
get_pathMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected