diff options
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/default_theme/default_theme.cpp | 11 | ||||
-rw-r--r-- | scene/resources/default_theme/icon_zoom_less.png | bin | 0 -> 390 bytes | |||
-rw-r--r-- | scene/resources/default_theme/icon_zoom_more.png | bin | 0 -> 388 bytes | |||
-rw-r--r-- | scene/resources/default_theme/icon_zoom_reset.png | bin | 0 -> 311 bytes | |||
-rw-r--r-- | scene/resources/default_theme/theme_data.h | 15 | ||||
-rw-r--r-- | scene/resources/packed_scene.cpp | 36 | ||||
-rw-r--r-- | scene/resources/sample.cpp | 2 | ||||
-rw-r--r-- | scene/resources/scene_format_text.cpp | 20 |
8 files changed, 73 insertions, 11 deletions
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index f713b9e979..fb9f66a40a 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -264,8 +264,8 @@ void make_default_theme() { // ToolButton Ref<StyleBox> tb_empty = memnew( StyleBoxEmpty ); - tb_empty->set_default_margin(MARGIN_LEFT,8); - tb_empty->set_default_margin(MARGIN_RIGHT,8); + tb_empty->set_default_margin(MARGIN_LEFT,6); + tb_empty->set_default_margin(MARGIN_RIGHT,6); tb_empty->set_default_margin(MARGIN_TOP,4); tb_empty->set_default_margin(MARGIN_BOTTOM,4); @@ -884,6 +884,13 @@ void make_default_theme() { t->set_stylebox("panelf","Panel", tc_sb ); t->set_stylebox("panel","PanelContainer", tc_sb ); + t->set_icon("minus","GraphEdit", make_icon(icon_zoom_less_png) ); + t->set_icon("reset","GraphEdit", make_icon(icon_zoom_reset_png) ); + t->set_icon("more","GraphEdit", make_icon(icon_zoom_more_png) ); + t->set_stylebox("bg","GraphEdit", make_stylebox( tree_bg_png,4,4,4,5) ); + + + t->set_icon( "logo","Icons", make_icon(logo_png) ); diff --git a/scene/resources/default_theme/icon_zoom_less.png b/scene/resources/default_theme/icon_zoom_less.png Binary files differnew file mode 100644 index 0000000000..3e50ce0c22 --- /dev/null +++ b/scene/resources/default_theme/icon_zoom_less.png diff --git a/scene/resources/default_theme/icon_zoom_more.png b/scene/resources/default_theme/icon_zoom_more.png Binary files differnew file mode 100644 index 0000000000..4f2928064c --- /dev/null +++ b/scene/resources/default_theme/icon_zoom_more.png diff --git a/scene/resources/default_theme/icon_zoom_reset.png b/scene/resources/default_theme/icon_zoom_reset.png Binary files differnew file mode 100644 index 0000000000..36fafc2037 --- /dev/null +++ b/scene/resources/default_theme/icon_zoom_reset.png diff --git a/scene/resources/default_theme/theme_data.h b/scene/resources/default_theme/theme_data.h index 4c440ab99a..6414efa74d 100644 --- a/scene/resources/default_theme/theme_data.h +++ b/scene/resources/default_theme/theme_data.h @@ -214,6 +214,21 @@ static const unsigned char icon_stop_png[]={ }; +static const unsigned char icon_zoom_less_png[]={ +0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x12,0x0,0x0,0xb,0x12,0x1,0xd2,0xdd,0x7e,0xfc,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xe0,0x2,0x8,0x11,0x19,0x15,0x8e,0xdd,0x4e,0x19,0x0,0x0,0x1,0x25,0x49,0x44,0x41,0x54,0x38,0xcb,0x9d,0x92,0xc1,0x8a,0xc2,0x30,0x10,0x86,0xbf,0x99,0x36,0x94,0xd2,0xaa,0x4,0x5b,0x28,0x78,0xe9,0xfb,0x3f,0x95,0x22,0x78,0x11,0x9,0x4a,0xf,0xb5,0xd8,0x64,0x2f,0xdb,0xec,0xb2,0xad,0xbb,0xae,0xdf,0x29,0xcc,0x64,0xfe,0xfc,0x33,0x19,0xe1,0x13,0xe7,0x1c,0xd6,0x5a,0x2e,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xef,0x3d,0x55,0x55,0xf1,0x1,0x48,0x6e,0x80,0x3e,0x13,0xf0,0x5,0xd,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 +}; + + +static const unsigned char icon_zoom_more_png[]={ +0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x12,0x0,0x0,0xb,0x12,0x1,0xd2,0xdd,0x7e,0xfc,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xe0,0x2,0x8,0x11,0x19,0x1f,0x6e,0x8,0xa7,0x7,0x0,0x0,0x1,0x23,0x49,0x44,0x41,0x54,0x38,0xcb,0x9d,0x92,0x4d,0xaf,0x82,0x30,0x10,0x45,0xcf,0x8c,0x36,0xe0,0x77,0x1a,0x59,0xb0,0x70,0xe1,0xff,0xff,0x57,0xae,0xd5,0x34,0x10,0x30,0x60,0x68,0xeb,0xe6,0xc1,0xf3,0x9,0x26,0xfa,0xee,0xae,0x69,0xe7,0xcc,0xcc,0xbd,0x15,0x7e,0xe4,0x9c,0xc3,0x5a,0xcb,0xf5,0x7a,0x25,0x84,0x0,0x80,0xaa,0xb2,0xdf,0xef,0x87,0xbb,0x29,0x49,0x5f,0xc,0x50,0x55,0x15,0xde,0x7b,0xe6,0xf3,0x39,0x0,0x5d,0xd7,0x31,0x9b,0xcd,0x58,0xad,0x56,0x88,0xc8,0x24,0x44,0x1,0xac,0xb5,0x14,0x45,0x41,0x8,0x1,0x63,0xc,0x87,0xc3,0x81,0xae,0xeb,0x22,0x10,0xbd,0xf7,0xb1,0x2c,0xcb,0x68,0xad,0x1d,0x1a,0xfd,0x99,0xc0,0x39,0x47,0xdb,0xb6,0x34,0x4d,0x3,0xc0,0x6e,0xb7,0x3,0xa0,0x28,0x8a,0xf8,0xfc,0x30,0x4d,0x53,0xc9,0xf3,0x7c,0x3c,0x81,0xb5,0x96,0xa6,0x69,0x58,0xaf,0xd7,0x6c,0x36,0x1b,0xfa,0x89,0x5e,0xd5,0x37,0x98,0x5c,0x1,0x40,0x44,0x50,0xd5,0xb7,0x66,0xbd,0x93,0x0,0x9c,0x4e,0x27,0x62,0x8c,0xf1,0x9b,0xc2,0xe3,0xf1,0x28,0x0,0xea,0x9c,0x23,0x49,0x12,0xfe,0x2b,0x5,0x98,0x32,0xe7,0x63,0xc0,0xbb,0x78,0xbe,0xf2,0xe0,0xf5,0x27,0x7a,0xef,0xb9,0xdd,0x6e,0xaf,0x9e,0x48,0x92,0x24,0x18,0x63,0xc8,0xb2,0x6c,0x9c,0x42,0xef,0xbe,0xaa,0x62,0x8c,0x19,0x75,0x5a,0x2c,0x16,0xdc,0xef,0x77,0xaa,0xaa,0xe2,0x7c,0x3e,0x8f,0x1,0xcf,0xa0,0xa9,0x28,0x8d,0x31,0xf4,0x41,0xd5,0x75,0x3d,0x40,0xf4,0xe3,0x5d,0x45,0xd8,0x6e,0xb7,0xc3,0xb9,0xae,0x6b,0x2e,0x97,0xcb,0xaf,0x7,0x9f,0xc8,0x39,0x47,0x8c,0x91,0xb2,0x2c,0x1,0x58,0x2e,0x97,0xdf,0x1,0x9e,0x21,0x21,0x4,0xb2,0x2c,0xe3,0x1,0xf3,0xd9,0x85,0xaf,0x46,0x21,0x2f,0x17,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 +}; + + +static const unsigned char icon_zoom_reset_png[]={ +0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0x0,0x9,0x70,0x48,0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0x9,0x55,0x25,0xc6,0xc8,0x30,0xc,0x0,0x14,0x45,0xf1,0x59,0x81,0xc7,0x22,0x21,0x4,0x9a,0xa6,0xe1,0xf,0x29,0x54,0x56,0xd3,0x43,0xf4,0x61,0x53,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 +}; + + static const unsigned char line_edit_png[]={ 0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0xa,0x0,0x0,0x0,0xa,0x8,0x6,0x0,0x0,0x0,0x8d,0x32,0xcf,0xbd,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xdf,0xa,0x14,0x3,0x1d,0x2f,0xec,0x8c,0x33,0x2f,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x0,0x9d,0x49,0x44,0x41,0x54,0x18,0xd3,0xb5,0x90,0x31,0xe,0xc2,0x40,0x10,0x3,0xed,0xbb,0xd5,0x25,0xa1,0xa1,0x3,0x9,0x41,0xc1,0x33,0x78,0x15,0x5f,0xc8,0x93,0x41,0x14,0x49,0x2e,0xbb,0xb7,0x29,0x2,0x52,0x20,0x14,0x34,0x58,0x72,0x63,0x4f,0x61,0x99,0xfb,0xdd,0xe1,0x9a,0x52,0xd5,0xc6,0x10,0x6b,0x92,0x58,0xca,0xdd,0x61,0xc5,0xfa,0x9c,0x87,0x96,0xa7,0xe3,0xf9,0x56,0xa5,0x7a,0x2b,0x22,0x0,0xde,0x41,0xc0,0xa1,0xaa,0x18,0x72,0x7f,0x97,0x18,0x62,0x23,0x22,0x88,0x22,0xe0,0x7,0xe8,0x70,0x0,0x80,0x6a,0x6c,0x2,0xc9,0x2,0x70,0x5,0x1,0x78,0x66,0x4,0xc9,0x12,0xf0,0xa3,0xfe,0x0,0xba,0x7b,0x98,0x67,0xfb,0xaa,0x9c,0x33,0x87,0xbb,0x7,0xb1,0x62,0x9d,0xaa,0xa6,0xd7,0xfc,0x6f,0xf7,0x58,0xb1,0x3e,0x36,0xf5,0xa6,0x3,0x70,0x29,0x66,0x30,0x53,0x5d,0x5a,0x75,0xd4,0x51,0xc7,0x47,0xce,0x43,0x3b,0x1,0xc,0x2e,0x55,0x5d,0x5f,0x72,0xb6,0x33,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 }; diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 57d2a8d890..43196a43d4 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -33,7 +33,7 @@ #include "scene/gui/control.h" #include "scene/2d/node_2d.h" #include "scene/main/instance_placeholder.h" - +#include "core/core_string_names.h" #define PACK_VERSION 2 bool SceneState::can_instance() const { @@ -99,6 +99,7 @@ Node *SceneState::instance(bool p_gen_edit_state) const { Node *node=NULL; + if (i==0 && base_scene_idx>=0) { //scene inheritance on root node //print_line("scene inherit"); @@ -193,7 +194,26 @@ Node *SceneState::instance(bool p_gen_edit_state) const { ERR_FAIL_INDEX_V( nprops[j].name, sname_count, NULL ); ERR_FAIL_INDEX_V( nprops[j].value, prop_count, NULL ); - node->set(snames[ nprops[j].name ],props[ nprops[j].value ],&valid); + if (snames[ nprops[j].name ]==CoreStringNames::get_singleton()->_script) { + //work around to avoid old script variables from disappearing, should be the proper fix to: + //https://github.com/godotengine/godot/issues/2958 + + //store old state + List<Pair<StringName,Variant> > old_state; + if (node->get_script_instance()) { + node->get_script_instance()->get_property_state(old_state); + } + + node->set(snames[ nprops[j].name ],props[ nprops[j].value ],&valid); + + //restore old state for new script, if exists + for (List<Pair<StringName,Variant> >::Element *E=old_state.front();E;E=E->next()) { + node->set(E->get().first,E->get().second); + } + } else { + + node->set(snames[ nprops[j].name ],props[ nprops[j].value ],&valid); + } } } @@ -460,6 +480,7 @@ Error SceneState::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<S List<PropertyInfo> plist; p_node->get_property_list(&plist); + bool saved_script=false; for (List<PropertyInfo>::Element *E=plist.front();E;E=E->next()) { @@ -508,8 +529,10 @@ Error SceneState::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<S break; } } - - if (exists && p_node->get_script_instance()) { +#if 0 +// this workaround ended up causing problems: +https://github.com/godotengine/godot/issues/3127 + if (saved_script && exists && p_node->get_script_instance()) { //if this is an overriden value by another script, save it anyway //as the script change will erase it //https://github.com/godotengine/godot/issues/2958 @@ -522,7 +545,7 @@ Error SceneState::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<S } } - +#endif if (exists && bool(Variant::evaluate(Variant::OP_EQUAL,value,original))) { //exists and did not change continue; @@ -543,6 +566,9 @@ Error SceneState::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<S } } + if (name=="script/script") + saved_script=true; + NodeData::Property prop; prop.name=_nm_get_string( name,name_map); prop.value=_vm_get_variant( value, variant_map); diff --git a/scene/resources/sample.cpp b/scene/resources/sample.cpp index 4b25a2c490..87fcfc425d 100644 --- a/scene/resources/sample.cpp +++ b/scene/resources/sample.cpp @@ -151,8 +151,8 @@ void Sample::set_loop_format(LoopFormat p_format) { if (sample.is_valid()) AudioServer::get_singleton()->sample_set_loop_format(sample,(AudioServer::SampleLoopFormat)p_format); loop_format=p_format; - } + Sample::LoopFormat Sample::get_loop_format() const { return loop_format; diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp index 2f18e70d7f..d9f6beabc0 100644 --- a/scene/resources/scene_format_text.cpp +++ b/scene/resources/scene_format_text.cpp @@ -85,8 +85,7 @@ Error ResourceInteractiveLoaderText::_parse_ext_resource(VariantParser::Stream* r_res=ResourceLoader::load(path,type); if (r_res.is_null()) { - r_err_str="Couldn't load external resource: "+path; - return ERR_PARSE_ERROR; + WARN_PRINT(String("Couldn't load external resource: "+path).utf8().get_data()); } VariantParser::get_token(p_stream,token,line,r_err_str); @@ -171,6 +170,7 @@ Error ResourceInteractiveLoaderText::poll() { _printerr(); } + resource_current++; return error; @@ -228,6 +228,8 @@ Error ResourceInteractiveLoaderText::poll() { } + resource_current++; + while(true) { String assign; @@ -292,6 +294,8 @@ Error ResourceInteractiveLoaderText::poll() { resource=Ref<Resource>(r); + resource_current++; + while(true) { String assign; @@ -394,6 +398,13 @@ Error ResourceInteractiveLoaderText::poll() { int node_id = packed_scene->get_state()->add_node(parent,owner,type,name,instance); + if (next_tag.fields.has("groups")) { + + Array groups = next_tag.fields["groups"]; + for (int i=0;i<groups.size();i++) { + packed_scene->get_state()->add_node_group(node_id,packed_scene->get_state()->add_name(groups[i])); + } + } while(true) { @@ -739,6 +750,8 @@ void ResourceInteractiveLoaderText::open(FileAccess *p_f,bool p_skip_first_tag) stream.f=f; is_scene=false; + resource_current=0; + VariantParser::Tag tag; Error err = VariantParser::parse_tag(&stream,lines,error_text,tag); @@ -1374,9 +1387,10 @@ bool ResourceFormatSaverText::recognize(const RES& p_resource) const { } void ResourceFormatSaverText::get_recognized_extensions(const RES& p_resource,List<String> *p_extensions) const { - p_extensions->push_back("tres"); //text resource if (p_resource->get_type()=="PackedScene") p_extensions->push_back("tscn"); //text scene + else + p_extensions->push_back("tres"); //text resource } |