summaryrefslogtreecommitdiffstats
path: root/core/resource.h
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-01-10 01:04:31 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-01-10 01:07:03 -0300
commita503f8aadcb8cbc85bde589fb25ea06e599b367b (patch)
tree070ebbf0dd6af2d43c5519f5e32045b3512f0e9e /core/resource.h
parent68c008ca8d87a1f72fcf17467ee43714954e9ce4 (diff)
downloadredot-engine-a503f8aadcb8cbc85bde589fb25ea06e599b367b.tar.gz
Groundbreaking!! Godot resources can now be flagged to be local to the scene being edited!
This means that each time this scene is instanced, the resource will be unique! As such, thanks to this, the following features were implemented: -ButtonGroup is no longer a control, it's now a resource local to the scene -ViewportTexture can be created from the editor and set to any object, making ViewportSprite and other kind of nodes obsolete!
Diffstat (limited to 'core/resource.h')
-rw-r--r--core/resource.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/core/resource.h b/core/resource.h
index 40b6dd78a0..8b73bcdc57 100644
--- a/core/resource.h
+++ b/core/resource.h
@@ -61,6 +61,7 @@ class ResourceImportMetadata : public Reference {
Map<String,Variant> options;
StringArray _get_options() const;
+
protected:
static void _bind_methods();
@@ -82,6 +83,7 @@ public:
void get_options(List<String> *r_options) const;
+
ResourceImportMetadata();
};
@@ -108,6 +110,10 @@ friend class ResourceCache;
uint64_t last_modified_time;
#endif
+ bool local_to_scene;
+friend class SceneState;
+ Node* local_scene;
+
protected:
void emit_changed();
@@ -121,6 +127,8 @@ protected:
void _take_over_path(const String& p_path);
public:
+ static Node* (*_get_local_scene_func)(); //used by editor
+
virtual bool editor_can_reload_from_file();
virtual void reload_from_file();
@@ -137,12 +145,17 @@ public:
int get_subindex() const;
Ref<Resource> duplicate(bool p_subresources=false);
+ Ref<Resource> duplicate_for_local_scene(Node *p_scene,Map<Ref<Resource>,Ref<Resource> >& remap_cache);
+
void set_import_metadata(const Ref<ResourceImportMetadata>& p_metadata);
Ref<ResourceImportMetadata> get_import_metadata() const;
+ void set_local_to_scene(bool p_enable);
+ bool is_local_to_scene() const;
+ virtual void setup_local_to_scene();
-
+ Node* get_local_scene() const;
#ifdef TOOLS_ENABLED