summaryrefslogtreecommitdiff
path: root/js/script_api.js
blob: afa57750644b177b09a600cb0cca0ec954fb2d8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function windw(action, transition) {
  var deferred = when.defer();
  setTimeout(function () {
    deferred.resolve(action);
  }, 100);
  return deferred.promise;
}
var types = {
  "ev": "event",
  "evh": "event",
  "ovl": "event",
  "bg": "bgs",
  "": "vfx"
}
// NOT iscene
function scene(type, name) {
  if (typeof name == "undefined") name = type;
  WARN("don't know extension, trying all");
  var bg = document.getElementById("bg");
  var img = "/" + types[type] + "/" + name;
  bg.onerror = function () {
    bg.onerror = function () {
      bg.src = img + ".jpg";
    };
    bg.src = img + ".png";
  };
  bg.src = img + ".webp";
}