preload_worldselect.nut 415 B

123456789101112131415
  1. // Preload data necessary for the world select menu
  2. if(!("world_select" in state)) {
  3. state.world_select <- {};
  4. }
  5. for(local i = 1; i <= 4; i++) {
  6. if(!("/levels/world" + i + "/worldmap.stwm" in state.world_select)){
  7. print("Initing world " + i);
  8. state.world_select["/levels/world" + i + "/worldmap.stwm"] <- {};
  9. state.world_select["/levels/world" + i + "/worldmap.stwm"].unlocked <- (i == 1);
  10. }
  11. }