Add cache break string to Assets library.json
This commit is contained in:
@@ -22,6 +22,7 @@ import flash.media.Sound;
|
||||
#end
|
||||
|
||||
@:access(lime.text.Font)
|
||||
@:access(lime.utils.Assets)
|
||||
|
||||
|
||||
class AssetLibrary {
|
||||
@@ -738,25 +739,6 @@ class AssetLibrary {
|
||||
}
|
||||
|
||||
|
||||
@:noCompletion private function __cacheBreak (path:String):String {
|
||||
|
||||
#if web
|
||||
if (path.indexOf ("?") > -1) {
|
||||
|
||||
path += "&" + Assets.cache.version;
|
||||
|
||||
} else {
|
||||
|
||||
path += "?" + Assets.cache.version;
|
||||
|
||||
}
|
||||
#end
|
||||
|
||||
return path;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@:noCompletion private function __fromManifest (manifest:AssetManifest):Void {
|
||||
|
||||
var hasSize = (manifest.version >= 2);
|
||||
@@ -773,7 +755,7 @@ class AssetLibrary {
|
||||
|
||||
if (Reflect.hasField (asset, "path")) {
|
||||
|
||||
paths.set (id, __cacheBreak (basePath + Reflect.field (asset, "path")));
|
||||
paths.set (id, Assets.__cacheBreak (basePath + Reflect.field (asset, "path")));
|
||||
|
||||
}
|
||||
|
||||
@@ -783,7 +765,7 @@ class AssetLibrary {
|
||||
|
||||
for (i in 0...pathGroup.length) {
|
||||
|
||||
pathGroup[i] = __cacheBreak (basePath + pathGroup[i]);
|
||||
pathGroup[i] = Assets.__cacheBreak (basePath + pathGroup[i]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -511,9 +511,15 @@ class Assets {
|
||||
path = libraryPaths[id];
|
||||
rootPath = defaultRootPath;
|
||||
|
||||
} else if (StringTools.endsWith (path, ".bundle")) {
|
||||
} else {
|
||||
|
||||
path += "/library.json";
|
||||
if (StringTools.endsWith (path, ".bundle")) {
|
||||
|
||||
path += "/library.json";
|
||||
|
||||
}
|
||||
|
||||
path = __cacheBreak (path);
|
||||
|
||||
}
|
||||
|
||||
@@ -608,7 +614,26 @@ class Assets {
|
||||
}
|
||||
|
||||
|
||||
private static function __libraryNotFound (name:String):String {
|
||||
@:noCompletion private static function __cacheBreak (path:String):String {
|
||||
|
||||
#if web
|
||||
if (path.indexOf ("?") > -1) {
|
||||
|
||||
path += "&" + cache.version;
|
||||
|
||||
} else {
|
||||
|
||||
path += "?" + cache.version;
|
||||
|
||||
}
|
||||
#end
|
||||
|
||||
return path;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@:noCompletion private static function __libraryNotFound (name:String):String {
|
||||
|
||||
if (name == null || name == "") {
|
||||
|
||||
@@ -636,7 +661,7 @@ class Assets {
|
||||
|
||||
|
||||
|
||||
private static function library_onChange ():Void {
|
||||
@:noCompletion private static function library_onChange ():Void {
|
||||
|
||||
cache.clear ();
|
||||
onChange.dispatch ();
|
||||
|
||||
Reference in New Issue
Block a user