Use StringName in pluginscript's set/get_prop and add_global_constant

This commit is contained in:
Emmanuel Leblond 2020-02-01 05:16:48 +01:00
parent 43f84445ba
commit af8905fdf3
No known key found for this signature in database
GPG key ID: C360860E645EFFC0
3 changed files with 6 additions and 10 deletions

View file

@ -39,13 +39,11 @@
#include "pluginscript_script.h"
bool PluginScriptInstance::set(const StringName &p_name, const Variant &p_value) {
String name = String(p_name);
return _desc->set_prop(_data, (const godot_string *)&name, (const godot_variant *)&p_value);
return _desc->set_prop(_data, (const godot_string_name *)&p_name, (const godot_variant *)&p_value);
}
bool PluginScriptInstance::get(const StringName &p_name, Variant &r_ret) const {
String name = String(p_name);
return _desc->get_prop(_data, (const godot_string *)&name, (godot_variant *)&r_ret);
return _desc->get_prop(_data, (const godot_string_name *)&p_name, (godot_variant *)&r_ret);
}
Ref<Script> PluginScriptInstance::get_script() const {