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

Method ProjectSettings

core/config/project_settings.cpp:1515–1722  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1513}
1514
1515ProjectSettings::ProjectSettings() {
1516 CRASH_COND_MSG(singleton != nullptr, "Instantiating a new ProjectSettings singleton is not supported.");
1517 singleton = this;
1518
1519#ifdef TOOLS_ENABLED
1520 // Available only at runtime in editor builds. Needs to be processed before anything else to work properly.
1521 if (!Engine::get_singleton()->is_editor_hint()) {
1522 String editor_features = OS::get_singleton()->get_environment("GODOT_EDITOR_CUSTOM_FEATURES");
1523 if (!editor_features.is_empty()) {
1524 PackedStringArray feature_list = editor_features.split(",");
1525 for (const String &s : feature_list) {
1526 custom_features.insert(s);
1527 }
1528 }
1529 }
1530#endif
1531
1532 GLOBAL_DEF_BASIC("application/config/name", "");
1533 GLOBAL_DEF_BASIC(PropertyInfo(Variant::DICTIONARY, "application/config/name_localized", PROPERTY_HINT_LOCALIZABLE_STRING), Dictionary());
1534 GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "application/config/description", PROPERTY_HINT_MULTILINE_TEXT), "");
1535 GLOBAL_DEF_BASIC("application/config/version", "");
1536 GLOBAL_DEF_INTERNAL(PropertyInfo(Variant::STRING, "application/config/tags"), PackedStringArray());
1537 GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "application/run/main_scene", PROPERTY_HINT_FILE, "*.tscn,*.scn,*.res"), "");
1538 GLOBAL_DEF_RST("application/run/disable_modified_security_assistance", false);
1539 GLOBAL_DEF("application/run/disable_stdout", false);
1540 GLOBAL_DEF("application/run/disable_stderr", false);
1541 GLOBAL_DEF("application/run/print_header", true);
1542 GLOBAL_DEF("application/run/enable_alt_space_menu", false);
1543 GLOBAL_DEF_RST("application/config/use_hidden_project_data_directory", true);
1544 GLOBAL_DEF("application/config/use_custom_user_dir", false);
1545 GLOBAL_DEF("application/config/custom_user_dir_name", "");
1546 GLOBAL_DEF("application/config/project_settings_override", "");
1547
1548 GLOBAL_DEF("application/run/main_loop_type", "SceneTree");
1549 GLOBAL_DEF("application/config/auto_accept_quit", true);
1550 GLOBAL_DEF("application/config/quit_on_go_back", true);
1551
1552 GLOBAL_DEF_BASIC("application/boot_splash/bg_color", Color(0.14, 0.14, 0.14));
1553
1554 GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "accessibility/general/accessibility_support", PROPERTY_HINT_ENUM, "Auto (When Screen Reader is Running),Always Active,Disabled"), 0);
1555 GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "accessibility/general/updates_per_second", PROPERTY_HINT_RANGE, "1,100,1"), 60);
1556
1557 // The default window size is tuned to:
1558 // - Have a 16:9 aspect ratio,
1559 // - Have both dimensions divisible by 8 to better play along with video recording,
1560 // - Be displayable correctly in windowed mode on a 1366×768 display (tested on Windows 10 with default settings).
1561 GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "display/window/size/viewport_width", PROPERTY_HINT_RANGE, "1,7680,1,or_greater"), 1152); // 8K resolution
1562 GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "display/window/size/viewport_height", PROPERTY_HINT_RANGE, "1,4320,1,or_greater"), 648); // 8K resolution
1563
1564 GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "display/window/size/mode", PROPERTY_HINT_ENUM, "Windowed,Minimized,Maximized,Fullscreen,Exclusive Fullscreen"), 0);
1565
1566 // Keep the enum values in sync with the `Window::WINDOW_INITIAL_POSITION_` enum.
1567 GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "display/window/size/initial_position_type", PROPERTY_HINT_ENUM, "Absolute:0,Center of Primary Screen:1,Center of Other Screen:3,Center of Screen With Mouse Pointer:4,Center of Screen With Keyboard Focus:5"), 1);
1568 GLOBAL_DEF_BASIC(PropertyInfo(Variant::VECTOR2I, "display/window/size/initial_position"), Vector2i());
1569 // Keep the enum values in sync with the `DisplayServer::SCREEN_` enum.
1570 GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "display/window/size/initial_screen", PROPERTY_HINT_RANGE, "0,64,1,or_greater"), 0);
1571
1572 GLOBAL_DEF_BASIC("display/window/size/resizable", true);

Callers

nothing calls this directly

Calls 12

splitMethod · 0.80
add_hidden_prefixMethod · 0.80
get_base_dirMethod · 0.80
PropertyInfoClass · 0.50
DictionaryClass · 0.50
ColorClass · 0.50
Vector2iClass · 0.50
StringClass · 0.50
is_editor_hintMethod · 0.45
get_environmentMethod · 0.45
is_emptyMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected