mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-02-22 17:18:12 +01:00
Fixed equipset's bindings.
This commit is contained in:
parent
3906bea408
commit
35efa1fd9b
@ -40,7 +40,7 @@ void EntityEquipSet::_validate_property(PropertyInfo &property) const {
|
||||
String prop = property.name;
|
||||
if (prop.begins_with("Entry_")) {
|
||||
int frame = prop.get_slicec('/', 0).get_slicec('_', 1).to_int();
|
||||
if (frame > _entry_count) {
|
||||
if (frame >= _entry_count) {
|
||||
property.usage = 0;
|
||||
}
|
||||
}
|
||||
@ -49,7 +49,8 @@ void EntityEquipSet::_validate_property(PropertyInfo &property) const {
|
||||
void EntityEquipSet::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_entry_count"), &EntityEquipSet::get_entry_count);
|
||||
ClassDB::bind_method(D_METHOD("set_entry_count", "value"), &EntityEquipSet::set_entry_count);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "entry_count", PROPERTY_HINT_RANGE, "0," + itos(MAX_ENTRIES), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), "set_entry_count", "get_entry_count");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_entry", "index"), &EntityEquipSet::get_entry);
|
||||
ClassDB::bind_method(D_METHOD("set_entry", "index", "entry"), &EntityEquipSet::set_entry);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user