preload_worldselect.nut 462 B

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