Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove CoreStringNames and SceneStringNames #50941

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions core/config/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "project_settings.h"

#include "core/core_bind.h" // For Compression enum.
#include "core/core_string_names.h"
#include "core/input/input_map.h"
#include "core/io/dir_access.h"
#include "core/io/file_access.h"
Expand Down Expand Up @@ -173,7 +172,7 @@ bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) {
}
}
} else {
if (p_name == CoreStringNames::get_singleton()->_custom_features) {
if (p_name == SNAME("_custom_features")) {
Vector<String> custom_feature_array = String(p_value).split(",");
for (int i = 0; i < custom_feature_array.size(); i++) {
custom_features.insert(custom_feature_array[i]);
Expand Down Expand Up @@ -706,7 +705,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const Map<Str
if (p_custom_features != String()) {
file->store_32(count + 1);
//store how many properties are saved, add one for custom featuers, which must always go first
String key = CoreStringNames::get_singleton()->_custom_features;
String key = SNAME("_custom_features");
file->store_pascal_string(key);

int len;
Expand Down
81 changes: 0 additions & 81 deletions core/core_string_names.cpp

This file was deleted.

102 changes: 0 additions & 102 deletions core/core_string_names.h

This file was deleted.

1 change: 0 additions & 1 deletion core/io/packed_data_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

#include "packed_data_container.h"

#include "core/core_string_names.h"
#include "core/io/marshalls.h"

Variant PackedDataContainer::getvar(const Variant &p_key, bool *r_valid) const {
Expand Down
3 changes: 1 addition & 2 deletions core/io/resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

#include "resource.h"

#include "core/core_string_names.h"
#include "core/io/file_access.h"
#include "core/io/resource_loader.h"
#include "core/math/math_funcs.h"
Expand All @@ -41,7 +40,7 @@
#include <stdio.h>

void Resource::emit_changed() {
emit_signal(CoreStringNames::get_singleton()->changed);
emit_signal(SNAME("changed"));
}

void Resource::_resource_path_changed() {
Expand Down
17 changes: 8 additions & 9 deletions core/math/a_star.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

#include "core/math/geometry_3d.h"
#include "core/object/script_language.h"
#include "scene/scene_string_names.h"

int AStar::get_available_point_id() const {
if (points.is_empty()) {
Expand Down Expand Up @@ -388,8 +387,8 @@ bool AStar::_solve(Point *begin_point, Point *end_point) {
}

real_t AStar::_estimate_cost(int p_from_id, int p_to_id) {
if (get_script_instance() && get_script_instance()->has_method(SceneStringNames::get_singleton()->_estimate_cost)) {
return get_script_instance()->call(SceneStringNames::get_singleton()->_estimate_cost, p_from_id, p_to_id);
if (get_script_instance() && get_script_instance()->has_method(SNAME("_estimate_cost"))) {
return get_script_instance()->call(SNAME("_estimate_cost"), p_from_id, p_to_id);
}

Point *from_point;
Expand All @@ -404,8 +403,8 @@ real_t AStar::_estimate_cost(int p_from_id, int p_to_id) {
}

real_t AStar::_compute_cost(int p_from_id, int p_to_id) {
if (get_script_instance() && get_script_instance()->has_method(SceneStringNames::get_singleton()->_compute_cost)) {
return get_script_instance()->call(SceneStringNames::get_singleton()->_compute_cost, p_from_id, p_to_id);
if (get_script_instance() && get_script_instance()->has_method(SNAME("_compute_cost"))) {
return get_script_instance()->call(SNAME("_compute_cost"), p_from_id, p_to_id);
}

Point *from_point;
Expand Down Expand Up @@ -660,8 +659,8 @@ Vector2 AStar2D::get_closest_position_in_segment(const Vector2 &p_point) const {
}

real_t AStar2D::_estimate_cost(int p_from_id, int p_to_id) {
if (get_script_instance() && get_script_instance()->has_method(SceneStringNames::get_singleton()->_estimate_cost)) {
return get_script_instance()->call(SceneStringNames::get_singleton()->_estimate_cost, p_from_id, p_to_id);
if (get_script_instance() && get_script_instance()->has_method(SNAME("_estimate_cost"))) {
return get_script_instance()->call(SNAME("_estimate_cost"), p_from_id, p_to_id);
}

AStar::Point *from_point;
Expand All @@ -676,8 +675,8 @@ real_t AStar2D::_estimate_cost(int p_from_id, int p_to_id) {
}

real_t AStar2D::_compute_cost(int p_from_id, int p_to_id) {
if (get_script_instance() && get_script_instance()->has_method(SceneStringNames::get_singleton()->_compute_cost)) {
return get_script_instance()->call(SceneStringNames::get_singleton()->_compute_cost, p_from_id, p_to_id);
if (get_script_instance() && get_script_instance()->has_method(SNAME("_compute_cost"))) {
return get_script_instance()->call(SNAME("_compute_cost"), p_from_id, p_to_id);
}

AStar::Point *from_point;
Expand Down
3 changes: 1 addition & 2 deletions core/object/message_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "message_queue.h"

#include "core/config/project_settings.h"
#include "core/core_string_names.h"
#include "core/object/script_language.h"

MessageQueue *MessageQueue::singleton = nullptr;
Expand Down Expand Up @@ -104,7 +103,7 @@ Error MessageQueue::push_notification(ObjectID p_id, int p_notification) {
Message *msg = memnew_placement(&buffer[buffer_end], Message);

msg->type = TYPE_NOTIFICATION;
msg->callable = Callable(p_id, CoreStringNames::get_singleton()->notification); //name is meaningless but callable needs it
msg->callable = Callable(p_id, SNAME("notification")); //name is meaningless but callable needs it
//msg->target;
msg->notification = p_notification;

Expand Down
17 changes: 8 additions & 9 deletions core/object/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

#include "object.h"

#include "core/core_string_names.h"
#include "core/io/resource.h"
#include "core/object/class_db.h"
#include "core/object/message_queue.h"
Expand Down Expand Up @@ -413,14 +412,14 @@ void Object::set(const StringName &p_name, const Variant &p_value, bool *r_valid
}
}

if (p_name == CoreStringNames::get_singleton()->_script) {
if (p_name == SNAME("script")) {
set_script(p_value);
if (r_valid) {
*r_valid = true;
}
return;

} else if (p_name == CoreStringNames::get_singleton()->_meta) {
} else if (p_name == SNAME("__meta__")) {
//set_meta(p_name,p_value);
metadata = p_value.duplicate();
if (r_valid) {
Expand Down Expand Up @@ -495,14 +494,14 @@ Variant Object::get(const StringName &p_name, bool *r_valid) const {
}
}

if (p_name == CoreStringNames::get_singleton()->_script) {
if (p_name == SNAME("script")) {
ret = get_script();
if (r_valid) {
*r_valid = true;
}
return ret;

} else if (p_name == CoreStringNames::get_singleton()->_meta) {
} else if (p_name == SNAME("__meta__")) {
ret = metadata;
if (r_valid) {
*r_valid = true;
Expand Down Expand Up @@ -706,7 +705,7 @@ Variant Object::_call_deferred_bind(const Variant **p_args, int p_argcount, Call
}

bool Object::has_method(const StringName &p_method) const {
if (p_method == CoreStringNames::get_singleton()->_free) {
if (p_method == SNAME("free")) {
return true;
}

Expand Down Expand Up @@ -777,7 +776,7 @@ Variant Object::call(const StringName &p_name, VARIANT_ARG_DECLARE) {
Variant Object::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
r_error.error = Callable::CallError::CALL_OK;

if (p_method == CoreStringNames::get_singleton()->_free) {
if (p_method == SNAME("free")) {
//free must be here, before anything, always ready
#ifdef DEBUG_ENABLED
if (p_argcount != 0) {
Expand Down Expand Up @@ -897,7 +896,7 @@ void Object::set_script(const Variant &p_script) {
}

notify_property_list_changed(); //scripts may add variables, so refresh is desired
emit_signal(CoreStringNames::get_singleton()->script_changed);
emit_signal(SNAME("script_changed"));
}

void Object::set_script_instance(ScriptInstance *p_instance) {
Expand Down Expand Up @@ -1536,7 +1535,7 @@ void Object::clear_internal_resource_paths() {
}

void Object::notify_property_list_changed() {
emit_signal(CoreStringNames::get_singleton()->property_list_changed);
emit_signal(SNAME("property_list_changed"));
}

void Object::_bind_methods() {
Expand Down
1 change: 0 additions & 1 deletion core/object/script_language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "script_language.h"

#include "core/config/project_settings.h"
#include "core/core_string_names.h"
#include "core/debugger/engine_debugger.h"
#include "core/debugger/script_debugger.h"

Expand Down
Loading