Exemplo n.º 1
0
 static {
   Console.setscmd(
       "bgm",
       new Console.Command() {
         public void run(Console cons, String[] args) {
           int i = 1;
           String opt;
           boolean loop = false;
           if (i < args.length) {
             while ((opt = args[i]).charAt(0) == '-') {
               i++;
               if (opt.equals("-l")) loop = true;
             }
             String resnm = args[i++];
             int ver = -1;
             if (i < args.length) ver = Integer.parseInt(args[i++]);
             Music.play(Resource.remote().load(resnm, ver), loop);
           } else {
             Music.play(null, false);
           }
         }
       });
   Console.setscmd(
       "bgmsw",
       new Console.Command() {
         public void run(Console cons, String[] args) {
           if (args.length < 2) enable(!enabled);
           else enable(Utils.parsebool(args[1], true));
         }
       });
 }
Exemplo n.º 2
0
 static {
   Console.setscmd(
       "die",
       new Console.Command() {
         public void run(Console cons, String[] args) {
           throw (new Error("Triggered death"));
         }
       });
   Console.setscmd(
       "threads",
       new Console.Command() {
         public void run(Console cons, String[] args) {
           Utils.dumptg(null, cons.out);
         }
       });
 }
 static {
   Console.setscmd(
       "sfx",
       new Console.Command() {
         public void run(Console cons, String[] args) {
           play(Resource.load(args[1]));
         }
       });
   Console.setscmd(
       "sfxvol",
       new Console.Command() {
         public void run(Console cons, String[] args) {
           setvolume(Double.parseDouble(args[1]));
         }
       });
 }
Exemplo n.º 4
0
 static {
   Console.setscmd(
       "cachedb",
       new Console.Command() {
         public void run(Console cons, String[] args) {
           cachedb = Utils.parsebool(args[1], false);
         }
       });
 }