Good vs. Evil

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

GamerwithnoGame

Over-Achiever
Jan 29, 2015
2,808
1,507
224
51. D'aww! :) Ours must be about 2 or 3 now. He's gotten used to our routine so much, that when my wife stands up in the evening he doesn't even need to be told to get in his bed - he goes straight there!
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
53 and... I just watched an AOE2 game that took longer then an hour and ended with both players still in the castle age.
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
55 age of empires 2.
Also, I really can't wait till wasm is ready for production code and languages pop op that are made to compile to it. JS may get the job done but when you end up with code like below......
Code:
                loadJS("routes",
                    () => loadJS("pageHandler",
                        () => loadJS("alertManager",
                            () => loadJS("api",
                                () => loadJS("htmlGenerator",
                                    () => loadJS("menuManager",
                                        () =>{
                                            //after the app is loaded for the first time we want to know what page to load
                                            pageHandler.goTo(window.location.href,false)
                                        }
                                    )
                                )
                            )
                        )
                    )
                )
it gets annoying very fast. I managed to rewrite it though. This version may also be faster, can't exactly test that easily though as it is very network depending.
Code:
         let toLoad =[
           "routes",
           "pageHandler",
           "alertManager",
           "api",
           "htmlGenerator",
           "menuManager"
         ];
         let loaded=0;
         function checkDone(){
           loaded++;
           if(loaded===toLoad.length){
             //after the app is loaded for the first time we want to know what page to load
             pageHandler.goTo(window.location.href,false)
           }
         }
         toLoad.forEach(value=>{
           $.getScript(conf.js+value+".js",()=>checkDone())
         })
 
  • Like
Reactions: GamerwithnoGame