From 7c6b659bd799080ca3a84110b112313a8cd12b1f Mon Sep 17 00:00:00 2001 From: kobewi Date: Tue, 8 Nov 2022 19:53:22 +0100 Subject: Add PropertyInfo overload for GLOBAL_DEF --- modules/gdscript/gdscript.cpp | 8 ++------ modules/webrtc/register_types.cpp | 3 +-- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'modules') diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index b7feedaeaa..07d887f0cd 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -2537,8 +2537,7 @@ GDScriptLanguage::GDScriptLanguage() { script_frame_time = 0; _debug_call_stack_pos = 0; - int dmcs = GLOBAL_DEF("debug/settings/gdscript/max_call_stack", 1024); - ProjectSettings::get_singleton()->set_custom_property_info("debug/settings/gdscript/max_call_stack", PropertyInfo(Variant::INT, "debug/settings/gdscript/max_call_stack", PROPERTY_HINT_RANGE, "1024,4096,1,or_greater")); //minimum is 1024 + int dmcs = GLOBAL_DEF(PropertyInfo(Variant::INT, "debug/settings/gdscript/max_call_stack", PROPERTY_HINT_RANGE, "1024,4096,1,or_greater"), 1024); if (EngineDebugger::is_active()) { //debugging enabled! @@ -2559,10 +2558,7 @@ GDScriptLanguage::GDScriptLanguage() { GDScriptWarning::Code code = (GDScriptWarning::Code)i; Variant default_enabled = GDScriptWarning::get_default_value(code); String path = GDScriptWarning::get_settings_path_from_code(code); - GLOBAL_DEF(path, default_enabled); - - PropertyInfo property_info = GDScriptWarning::get_property_info(code); - ProjectSettings::get_singleton()->set_custom_property_info(path, property_info); + GLOBAL_DEF(GDScriptWarning::get_property_info(code), default_enabled); } #endif // DEBUG_ENABLED } diff --git a/modules/webrtc/register_types.cpp b/modules/webrtc/register_types.cpp index 09cd538b96..e89fce2ed3 100644 --- a/modules/webrtc/register_types.cpp +++ b/modules/webrtc/register_types.cpp @@ -43,8 +43,7 @@ void initialize_webrtc_module(ModuleInitializationLevel p_level) { } #define SET_HINT(NAME, _VAL_, _MAX_) \ - GLOBAL_DEF(NAME, _VAL_); \ - ProjectSettings::get_singleton()->set_custom_property_info(NAME, PropertyInfo(Variant::INT, NAME, PROPERTY_HINT_RANGE, "2," #_MAX_ ",1,or_greater")); + GLOBAL_DEF(PropertyInfo(Variant::INT, NAME, PROPERTY_HINT_RANGE, "2," #_MAX_ ",1,or_greater"), _VAL_); SET_HINT(WRTC_IN_BUF, 64, 4096); -- cgit v1.2.3