Added constructor without Prototype parameter to make it possible
to have SkinFiles which don't know or care about what prototype they belong to.
This commit is contained in:
parent
77da4999aa
commit
1a777b5c5a
1 changed files with 17 additions and 2 deletions
|
@ -43,6 +43,19 @@ public class SkinFile implements Updatable {
|
|||
this.skin = new Skin (body, app);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a skinfile without that doesn't belong to a prototype, or at
|
||||
* least it doesn't know about its prototype and isn't managed by the prototype.
|
||||
*/
|
||||
public SkinFile (File file, String name, Application app) {
|
||||
this.prototype = null;
|
||||
this.app = app;
|
||||
this.name = name;
|
||||
this.file = file;
|
||||
this.skin = null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tell the type manager whether we need an update. this is the case when
|
||||
* the file has been modified or deleted.
|
||||
|
@ -56,8 +69,10 @@ public class SkinFile implements Updatable {
|
|||
|
||||
if (!file.exists ()) {
|
||||
// remove skin from prototype
|
||||
if (prototype != null) {
|
||||
prototype.skins.remove (name);
|
||||
prototype.updatables.remove (file.getName());
|
||||
}
|
||||
} else {
|
||||
// we only need to update if the skin has already been initialized
|
||||
if (skin != null)
|
||||
|
|
Loading…
Add table
Reference in a new issue