You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 19:31:35 +00:00
Use RequiredParam/RequiredResult in some high value places
This commit is contained in:
@@ -179,7 +179,7 @@ bool Control::_edit_use_rect() const {
|
||||
}
|
||||
#endif // DEBUG_ENABLED
|
||||
|
||||
void Control::reparent(Node *p_parent, bool p_keep_global_transform) {
|
||||
void Control::reparent(RequiredParam<Node> p_parent, bool p_keep_global_transform) {
|
||||
ERR_MAIN_THREAD_GUARD;
|
||||
if (p_keep_global_transform) {
|
||||
Transform2D temp = get_global_transform();
|
||||
@@ -3332,9 +3332,9 @@ bool Control::has_theme_constant(const StringName &p_name, const StringName &p_t
|
||||
|
||||
/// Local property overrides.
|
||||
|
||||
void Control::add_theme_icon_override(const StringName &p_name, const Ref<Texture2D> &p_icon) {
|
||||
void Control::add_theme_icon_override(const StringName &p_name, RequiredParam<Texture2D> rp_icon) {
|
||||
ERR_MAIN_THREAD_GUARD;
|
||||
ERR_FAIL_COND(p_icon.is_null());
|
||||
EXTRACT_PARAM_OR_FAIL(p_icon, rp_icon);
|
||||
|
||||
if (data.theme_icon_override.has(p_name)) {
|
||||
data.theme_icon_override[p_name]->disconnect_changed(callable_mp(this, &Control::_notify_theme_override_changed));
|
||||
@@ -3345,9 +3345,9 @@ void Control::add_theme_icon_override(const StringName &p_name, const Ref<Textur
|
||||
_notify_theme_override_changed();
|
||||
}
|
||||
|
||||
void Control::add_theme_style_override(const StringName &p_name, const Ref<StyleBox> &p_style) {
|
||||
void Control::add_theme_style_override(const StringName &p_name, RequiredParam<StyleBox> rp_style) {
|
||||
ERR_MAIN_THREAD_GUARD;
|
||||
ERR_FAIL_COND(p_style.is_null());
|
||||
EXTRACT_PARAM_OR_FAIL(p_style, rp_style);
|
||||
|
||||
if (data.theme_style_override.has(p_name)) {
|
||||
data.theme_style_override[p_name]->disconnect_changed(callable_mp(this, &Control::_notify_theme_override_changed));
|
||||
@@ -3358,9 +3358,9 @@ void Control::add_theme_style_override(const StringName &p_name, const Ref<Style
|
||||
_notify_theme_override_changed();
|
||||
}
|
||||
|
||||
void Control::add_theme_font_override(const StringName &p_name, const Ref<Font> &p_font) {
|
||||
void Control::add_theme_font_override(const StringName &p_name, RequiredParam<Font> rp_font) {
|
||||
ERR_MAIN_THREAD_GUARD;
|
||||
ERR_FAIL_COND(p_font.is_null());
|
||||
EXTRACT_PARAM_OR_FAIL(p_font, rp_font);
|
||||
|
||||
if (data.theme_font_override.has(p_name)) {
|
||||
data.theme_font_override[p_name]->disconnect_changed(callable_mp(this, &Control::_notify_theme_override_changed));
|
||||
|
||||
Reference in New Issue
Block a user