mirror of
https://github.com/godotengine/godot.git
synced 2024-11-25 13:43:15 +00:00
-added hints to sprite v/hframes, fixes truncation problem
-removed an error being printed often unnecesarly about missing child
This commit is contained in:
parent
3a59747c62
commit
1fecba6b5b
@ -322,8 +322,8 @@ void Sprite::_bind_methods() {
|
||||
ADD_PROPERTYNZ( PropertyInfo( Variant::VECTOR2, "offset"), _SCS("set_offset"),_SCS("get_offset"));
|
||||
ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "flip_h"), _SCS("set_flip_h"),_SCS("is_flipped_h"));
|
||||
ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "flip_v"), _SCS("set_flip_v"),_SCS("is_flipped_v"));
|
||||
ADD_PROPERTYNO( PropertyInfo( Variant::INT, "vframes"), _SCS("set_vframes"),_SCS("get_vframes"));
|
||||
ADD_PROPERTYNO( PropertyInfo( Variant::INT, "hframes"), _SCS("set_hframes"),_SCS("get_hframes"));
|
||||
ADD_PROPERTYNO( PropertyInfo( Variant::INT, "vframes",PROPERTY_HINT_RANGE,"1,16384,1"), _SCS("set_vframes"),_SCS("get_vframes"));
|
||||
ADD_PROPERTYNO( PropertyInfo( Variant::INT, "hframes",PROPERTY_HINT_RANGE,"1,16384,1"), _SCS("set_hframes"),_SCS("get_hframes"));
|
||||
ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "frame",PROPERTY_HINT_SPRITE_FRAME), _SCS("set_frame"),_SCS("get_frame"));
|
||||
ADD_PROPERTYNO( PropertyInfo( Variant::COLOR, "modulate"), _SCS("set_modulate"),_SCS("get_modulate"));
|
||||
ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "region"), _SCS("set_region"),_SCS("is_region"));
|
||||
|
@ -578,8 +578,8 @@ void Sprite3D::_bind_methods() {
|
||||
ObjectTypeDB::bind_method(_MD("get_hframes"),&Sprite3D::get_hframes);
|
||||
|
||||
ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_texture"),_SCS("get_texture"));
|
||||
ADD_PROPERTY( PropertyInfo( Variant::INT, "vframes"), _SCS("set_vframes"),_SCS("get_vframes"));
|
||||
ADD_PROPERTY( PropertyInfo( Variant::INT, "hframes"), _SCS("set_hframes"),_SCS("get_hframes"));
|
||||
ADD_PROPERTY( PropertyInfo( Variant::INT, "vframes",PROPERTY_HINT_RANGE,"1,16384,1"), _SCS("set_vframes"),_SCS("get_vframes"));
|
||||
ADD_PROPERTY( PropertyInfo( Variant::INT, "hframes",PROPERTY_HINT_RANGE,"1,16384,1"), _SCS("set_hframes"),_SCS("get_hframes"));
|
||||
ADD_PROPERTY( PropertyInfo( Variant::INT, "frame",PROPERTY_HINT_SPRITE_FRAME), _SCS("set_frame"),_SCS("get_frame"));
|
||||
ADD_PROPERTY( PropertyInfo( Variant::BOOL, "region"), _SCS("set_region"),_SCS("is_region"));
|
||||
ADD_PROPERTY( PropertyInfo( Variant::RECT2, "region_rect"), _SCS("set_region_rect"),_SCS("get_region_rect"));
|
||||
|
@ -523,7 +523,7 @@ Ref<Script> EditorData::get_scene_root_script(int p_idx) const {
|
||||
if (!edited_scene[p_idx].root)
|
||||
return Ref<Script>();
|
||||
Ref<Script> s=edited_scene[p_idx].root->get_script();
|
||||
if (!s.is_valid()) {
|
||||
if (!s.is_valid() && edited_scene[p_idx].root->get_child_count()) {
|
||||
Node *n = edited_scene[p_idx].root->get_child(0);
|
||||
while(!s.is_valid() && n && n->get_filename()==String()) {
|
||||
s=n->get_script();
|
||||
|
@ -2403,8 +2403,10 @@ void PropertyEditor::update_tree() {
|
||||
|
||||
|
||||
item->set_cell_mode( 1, TreeItem::CELL_MODE_RANGE );
|
||||
if (p.hint==PROPERTY_HINT_SPRITE_FRAME) {
|
||||
item->set_range_config(1,0,99999,1);
|
||||
|
||||
if (p.hint==PROPERTY_HINT_RANGE || p.hint==PROPERTY_HINT_EXP_RANGE) {
|
||||
} else if (p.hint==PROPERTY_HINT_RANGE || p.hint==PROPERTY_HINT_EXP_RANGE) {
|
||||
|
||||
int c = p.hint_string.get_slice_count(",");
|
||||
float min=0,max=100,step=1;
|
||||
|
Loading…
Reference in New Issue
Block a user