mirror of
https://github.com/godotengine/godot-visual-script.git
synced 2026-01-03 10:09:19 +03:00
Removed _change_notify
-For inspector refresh, the inspector now detects if a property change by polling a few times per second and then does update the control if so. This process is very cheap. -For property list refresh, a new signal (property_list_changed) was added to Object. _change_notify() is replaced by notify_property_list_changed() -Changed all objects using the old method to the signal, or just deleted the calls to _change_notify(<property>) since they are unnecesary now.
This commit is contained in:
@@ -647,7 +647,7 @@ String VisualScriptBuiltinFunc::get_caption() const {
|
||||
void VisualScriptBuiltinFunc::set_func(BuiltinFunc p_which) {
|
||||
ERR_FAIL_INDEX(p_which, FUNC_MAX);
|
||||
func = p_which;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ protected:
|
||||
}
|
||||
|
||||
void _sig_changed() {
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
emit_signal("changed");
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ protected:
|
||||
public:
|
||||
void edit(const StringName &p_sig) {
|
||||
sig = p_sig;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
VisualScriptEditorSignalEdit() { undo_redo = nullptr; }
|
||||
@@ -195,11 +195,10 @@ protected:
|
||||
}
|
||||
|
||||
void _var_changed() {
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
emit_signal("changed");
|
||||
}
|
||||
void _var_value_changed() {
|
||||
_change_notify("value"); // So the whole tree is not redrawn, makes editing smoother in general.
|
||||
emit_signal("changed");
|
||||
}
|
||||
|
||||
@@ -331,7 +330,7 @@ protected:
|
||||
public:
|
||||
void edit(const StringName &p_var) {
|
||||
var = p_var;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
VisualScriptEditorVariableEdit() { undo_redo = nullptr; }
|
||||
|
||||
@@ -63,7 +63,7 @@ bool VisualScriptExpression::_set(const StringName &p_name, const Variant &p_val
|
||||
}
|
||||
expression_dirty = true;
|
||||
ports_changed_notify();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -628,7 +628,7 @@ VisualScriptNodeInstance *VisualScriptSwitch::instance(VisualScriptInstance *p_i
|
||||
bool VisualScriptSwitch::_set(const StringName &p_name, const Variant &p_value) {
|
||||
if (String(p_name) == "case_count") {
|
||||
case_values.resize(p_value);
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
return true;
|
||||
}
|
||||
@@ -638,7 +638,7 @@ bool VisualScriptSwitch::_set(const StringName &p_name, const Variant &p_value)
|
||||
ERR_FAIL_INDEX_V(idx, case_values.size(), false);
|
||||
|
||||
case_values.write[idx].type = Variant::Type(int(p_value));
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
|
||||
return true;
|
||||
@@ -733,7 +733,7 @@ void VisualScriptTypeCast::set_base_type(const StringName &p_type) {
|
||||
}
|
||||
|
||||
base_type = p_type;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -747,7 +747,7 @@ void VisualScriptTypeCast::set_base_script(const String &p_path) {
|
||||
}
|
||||
|
||||
script = p_path;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
|
||||
@@ -281,7 +281,7 @@ void VisualScriptFunctionCall::set_basic_type(Variant::Type p_type) {
|
||||
}
|
||||
basic_type = p_type;
|
||||
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ void VisualScriptFunctionCall::set_base_type(const StringName &p_type) {
|
||||
}
|
||||
|
||||
base_type = p_type;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ void VisualScriptFunctionCall::set_base_script(const String &p_path) {
|
||||
}
|
||||
|
||||
base_script = p_path;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -328,7 +328,7 @@ void VisualScriptFunctionCall::set_singleton(const StringName &p_type) {
|
||||
base_type = obj->get_class();
|
||||
}
|
||||
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ void VisualScriptFunctionCall::set_function(const StringName &p_type) {
|
||||
_update_method_cache();
|
||||
}
|
||||
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -439,7 +439,7 @@ void VisualScriptFunctionCall::set_base_path(const NodePath &p_type) {
|
||||
}
|
||||
|
||||
base_path = p_type;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -453,7 +453,7 @@ void VisualScriptFunctionCall::set_call_mode(CallMode p_mode) {
|
||||
}
|
||||
|
||||
call_mode = p_mode;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -476,7 +476,7 @@ void VisualScriptFunctionCall::set_rpc_call_mode(VisualScriptFunctionCall::RPCCa
|
||||
}
|
||||
rpc_call_mode = p_mode;
|
||||
ports_changed_notify();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
VisualScriptFunctionCall::RPCCallMode VisualScriptFunctionCall::get_rpc_call_mode() const {
|
||||
@@ -1067,7 +1067,7 @@ void VisualScriptPropertySet::set_basic_type(Variant::Type p_type) {
|
||||
}
|
||||
basic_type = p_type;
|
||||
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
_update_base_type();
|
||||
ports_changed_notify();
|
||||
}
|
||||
@@ -1082,7 +1082,7 @@ void VisualScriptPropertySet::set_base_type(const StringName &p_type) {
|
||||
}
|
||||
|
||||
base_type = p_type;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -1096,7 +1096,7 @@ void VisualScriptPropertySet::set_base_script(const String &p_path) {
|
||||
}
|
||||
|
||||
base_script = p_path;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -1191,7 +1191,7 @@ void VisualScriptPropertySet::set_property(const StringName &p_type) {
|
||||
property = p_type;
|
||||
index = StringName();
|
||||
_update_cache();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -1206,7 +1206,7 @@ void VisualScriptPropertySet::set_base_path(const NodePath &p_type) {
|
||||
|
||||
base_path = p_type;
|
||||
_update_base_type();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -1221,7 +1221,7 @@ void VisualScriptPropertySet::set_call_mode(CallMode p_mode) {
|
||||
|
||||
call_mode = p_mode;
|
||||
_update_base_type();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -1243,7 +1243,7 @@ void VisualScriptPropertySet::set_index(const StringName &p_type) {
|
||||
}
|
||||
index = p_type;
|
||||
_update_cache();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -1259,7 +1259,7 @@ void VisualScriptPropertySet::set_assign_op(AssignOp p_op) {
|
||||
|
||||
assign_op = p_op;
|
||||
_update_cache();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -1760,7 +1760,7 @@ void VisualScriptPropertyGet::set_base_type(const StringName &p_type) {
|
||||
}
|
||||
|
||||
base_type = p_type;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -1774,7 +1774,7 @@ void VisualScriptPropertyGet::set_base_script(const String &p_path) {
|
||||
}
|
||||
|
||||
base_script = p_path;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -1871,7 +1871,7 @@ void VisualScriptPropertyGet::set_property(const StringName &p_type) {
|
||||
property = p_type;
|
||||
|
||||
_update_cache();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -1885,7 +1885,7 @@ void VisualScriptPropertyGet::set_base_path(const NodePath &p_type) {
|
||||
}
|
||||
|
||||
base_path = p_type;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
_update_base_type();
|
||||
ports_changed_notify();
|
||||
}
|
||||
@@ -1900,7 +1900,7 @@ void VisualScriptPropertyGet::set_call_mode(CallMode p_mode) {
|
||||
}
|
||||
|
||||
call_mode = p_mode;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
_update_base_type();
|
||||
ports_changed_notify();
|
||||
}
|
||||
@@ -1915,7 +1915,7 @@ void VisualScriptPropertyGet::set_basic_type(Variant::Type p_type) {
|
||||
}
|
||||
basic_type = p_type;
|
||||
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -1937,7 +1937,7 @@ void VisualScriptPropertyGet::set_index(const StringName &p_type) {
|
||||
}
|
||||
index = p_type;
|
||||
_update_cache();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -2261,7 +2261,7 @@ void VisualScriptEmitSignal::set_signal(const StringName &p_type) {
|
||||
|
||||
name = p_type;
|
||||
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ bool VisualScriptFunction::_set(const StringName &p_name, const Variant &p_value
|
||||
arguments.write[i].type = Variant::NIL;
|
||||
}
|
||||
ports_changed_notify();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
return true;
|
||||
}
|
||||
if (String(p_name).begins_with("argument_")) {
|
||||
@@ -312,7 +312,7 @@ VisualScriptFunction::VisualScriptFunction() {
|
||||
|
||||
void VisualScriptFunction::set_stack_less(bool p_enable) {
|
||||
stack_less = p_enable;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
bool VisualScriptFunction::is_stack_less() const {
|
||||
@@ -421,7 +421,7 @@ bool VisualScriptLists::_set(const StringName &p_name, const Variant &p_value) {
|
||||
inputports.write[i].type = Variant::NIL;
|
||||
}
|
||||
ports_changed_notify();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
return true;
|
||||
}
|
||||
if (String(p_name).begins_with("input_") && is_input_port_editable()) {
|
||||
@@ -457,7 +457,7 @@ bool VisualScriptLists::_set(const StringName &p_name, const Variant &p_value) {
|
||||
outputports.write[i].type = Variant::NIL;
|
||||
}
|
||||
ports_changed_notify();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
return true;
|
||||
}
|
||||
if (String(p_name).begins_with("output_") && is_output_port_editable()) {
|
||||
@@ -578,7 +578,7 @@ void VisualScriptLists::add_input_data_port(Variant::Type p_type, const String &
|
||||
}
|
||||
|
||||
ports_changed_notify();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
void VisualScriptLists::set_input_data_port_type(int p_idx, Variant::Type p_type) {
|
||||
@@ -590,7 +590,7 @@ void VisualScriptLists::set_input_data_port_type(int p_idx, Variant::Type p_type
|
||||
|
||||
inputports.write[p_idx].type = p_type;
|
||||
ports_changed_notify();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
void VisualScriptLists::set_input_data_port_name(int p_idx, const String &p_name) {
|
||||
@@ -602,7 +602,7 @@ void VisualScriptLists::set_input_data_port_name(int p_idx, const String &p_name
|
||||
|
||||
inputports.write[p_idx].name = p_name;
|
||||
ports_changed_notify();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
void VisualScriptLists::remove_input_data_port(int p_argidx) {
|
||||
@@ -615,7 +615,7 @@ void VisualScriptLists::remove_input_data_port(int p_argidx) {
|
||||
inputports.remove(p_argidx);
|
||||
|
||||
ports_changed_notify();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
// output data port interaction
|
||||
@@ -634,7 +634,7 @@ void VisualScriptLists::add_output_data_port(Variant::Type p_type, const String
|
||||
}
|
||||
|
||||
ports_changed_notify();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
void VisualScriptLists::set_output_data_port_type(int p_idx, Variant::Type p_type) {
|
||||
@@ -646,7 +646,7 @@ void VisualScriptLists::set_output_data_port_type(int p_idx, Variant::Type p_typ
|
||||
|
||||
outputports.write[p_idx].type = p_type;
|
||||
ports_changed_notify();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
void VisualScriptLists::set_output_data_port_name(int p_idx, const String &p_name) {
|
||||
@@ -658,7 +658,7 @@ void VisualScriptLists::set_output_data_port_name(int p_idx, const String &p_nam
|
||||
|
||||
outputports.write[p_idx].name = p_name;
|
||||
ports_changed_notify();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
void VisualScriptLists::remove_output_data_port(int p_argidx) {
|
||||
@@ -671,7 +671,7 @@ void VisualScriptLists::remove_output_data_port(int p_argidx) {
|
||||
outputports.remove(p_argidx);
|
||||
|
||||
ports_changed_notify();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
// sequences
|
||||
@@ -1433,7 +1433,7 @@ void VisualScriptConstant::set_constant_type(Variant::Type p_type) {
|
||||
Callable::CallError ce;
|
||||
Variant::construct(type, value, nullptr, 0, ce);
|
||||
ports_changed_notify();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
Variant::Type VisualScriptConstant::get_constant_type() const {
|
||||
@@ -1764,7 +1764,7 @@ String VisualScriptGlobalConstant::get_caption() const {
|
||||
|
||||
void VisualScriptGlobalConstant::set_global_constant(int p_which) {
|
||||
index = p_which;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -1850,7 +1850,7 @@ String VisualScriptClassConstant::get_caption() const {
|
||||
|
||||
void VisualScriptClassConstant::set_class_constant(const StringName &p_which) {
|
||||
name = p_which;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -1876,7 +1876,7 @@ void VisualScriptClassConstant::set_base_type(const StringName &p_which) {
|
||||
} else {
|
||||
name = "";
|
||||
}
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -1983,7 +1983,7 @@ String VisualScriptBasicTypeConstant::get_text() const {
|
||||
|
||||
void VisualScriptBasicTypeConstant::set_basic_type_constant(const StringName &p_which) {
|
||||
name = p_which;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -2010,7 +2010,7 @@ void VisualScriptBasicTypeConstant::set_basic_type(Variant::Type p_which) {
|
||||
} else {
|
||||
name = "";
|
||||
}
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -2140,7 +2140,7 @@ String VisualScriptMathConstant::get_caption() const {
|
||||
|
||||
void VisualScriptMathConstant::set_math_constant(MathConstant p_which) {
|
||||
constant = p_which;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -2233,7 +2233,7 @@ String VisualScriptEngineSingleton::get_caption() const {
|
||||
void VisualScriptEngineSingleton::set_singleton(const String &p_string) {
|
||||
singleton = p_string;
|
||||
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -2342,7 +2342,7 @@ String VisualScriptSceneNode::get_caption() const {
|
||||
|
||||
void VisualScriptSceneNode::set_node_path(const NodePath &p_path) {
|
||||
path = p_path;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -2620,7 +2620,7 @@ String VisualScriptResourcePath::get_caption() const {
|
||||
|
||||
void VisualScriptResourcePath::set_resource_path(const String &p_path) {
|
||||
path = p_path;
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -3748,7 +3748,7 @@ void VisualScriptDeconstruct::set_deconstruct_type(Variant::Type p_type) {
|
||||
type = p_type;
|
||||
_update_elements();
|
||||
ports_changed_notify();
|
||||
_change_notify(); //to make input appear/disappear
|
||||
notify_property_list_changed(); //to make input appear/disappear
|
||||
}
|
||||
|
||||
Variant::Type VisualScriptDeconstruct::get_deconstruct_type() const {
|
||||
|
||||
@@ -152,7 +152,7 @@ void VisualScriptYield::set_yield_mode(YieldMode p_mode) {
|
||||
}
|
||||
yield_mode = p_mode;
|
||||
ports_changed_notify();
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
VisualScriptYield::YieldMode VisualScriptYield::get_yield_mode() {
|
||||
@@ -359,7 +359,7 @@ void VisualScriptYieldSignal::set_base_type(const StringName &p_type) {
|
||||
|
||||
base_type = p_type;
|
||||
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ void VisualScriptYieldSignal::set_signal(const StringName &p_type) {
|
||||
|
||||
signal = p_type;
|
||||
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -389,7 +389,7 @@ void VisualScriptYieldSignal::set_base_path(const NodePath &p_type) {
|
||||
|
||||
base_path = p_type;
|
||||
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
@@ -404,7 +404,7 @@ void VisualScriptYieldSignal::set_call_mode(CallMode p_mode) {
|
||||
|
||||
call_mode = p_mode;
|
||||
|
||||
_change_notify();
|
||||
notify_property_list_changed();
|
||||
ports_changed_notify();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user