Esempio n. 1
0
        public static void LetsGo()
        {
            #region Install Error Manager, and the global engine!
            NALACore.Core.Window.Title = SBubble.Title;
            #endregion


            #region The base MonoGame stuff
            SBubble.AddInit(delegate(string v) { SBubble.State(v).DoString($"function {FlowManager.NOTHING}() end", "Alright move along, nothing to see here!"); });
            SBubble.AddInit(BubbleConsole.StateInit);
            SBubble.AddInit(BubbleGraphics.InitGraphics);
            SBubble.AddInit(Bubble_Audio.Init);
            SBubble.AddInit(APIFlow.Init);
            SBubble.AddInit(BubbleSuperGlobal.Init);
            SBubble.AddInit(Bubble_Input.Init);
            SBubble.AddInit(Bubble_Save.Init);
            SBubble.AddInit(Bubble_Conf.Init);
            SBubble.AddInit(Bubble_GameJolt.Init);
            SBubble.AddInit(BubbleTimer.Init);
            SBubble.AddInit(Bubble_Swap.Init);
            #endregion

            #region Extras to use in savegames
            Bubble_Save.SaveXtra["RPGPARTY"] = delegate(UseJCR6.TJCRCreate j, string dir) {
                RPG.RPGSave(j, $"XTRA/{dir}");
            };
            Bubble_Save.LoadXtra["RPGPARTY"] = delegate(UseJCR6.TJCRDIR j, string dir) {
                RPG.RPGLoad(j, $"XTRA/{dir}");
                return(true);
            };
            Bubble_Save.SaveXtra["SWAP"] = Bubble_Swap.SwapSave;
            Bubble_Save.LoadXtra["SWAP"] = Bubble_Swap.SwapLoad;
            #endregion

            #region The stuff needed for NALA in particular
            // Own APIs for NIL and Lua
            //SBubble.AddInit(MapScriptAPI.API_Init);
            SBubble.AddInit(RPG_API.Init);

            // Kthura Init
            Kthura.SetDefaultTextureJCR(SBubble.JCR);                   // Textures are all in the same project
            KthuraDraw.DrawDriver           = new KthuraDrawMonoGame(); // Tell Kthura to use the MonoGame Driver to display the map
            KthuraDrawMonoGame.CrashOnNoTex = delegate(string msg) { SBubble.MyError("Kthura Texture Error", msg, ""); };

            // SBubble Kthura API
            SBubble.AddInit(KthuraBubble.KthuraBubble.Init);
            SBubble.AddInit(KthuraBubble.KthBlockAPI.Init);
            SBubble.AddInit(KthuraBubble.KthuraAbyssGenerator.Init);

            // TODO: API for TeddyBear
            // TODO: API for Swap Data Manager
            // TODO: API for RPGStat
            RPG.JCRSTORAGE = "lzma";
            #endregion

            // Start init script
            FlowManager.StartInitFlow();
        }