Ejemplo n.º 1
0
        public static int InitTaskMethod(object obj)
        {
            CancellationToken token = (CancellationToken)obj;

            if (!token.IsCancellationRequested)
            {
                Memory.Strings = new Strings();
            }

            if (!token.IsCancellationRequested) // requires strings because it uses an array generated in strings.
            {
                Kernel_Bin = new Kernel_bin();
            }

            if (!token.IsCancellationRequested)
            {
                Memory.MItems = Items_In_Menu.Read(); // this has a soft requirement on kernel_bin. It checks for null so should work without it.
            }
            if (!token.IsCancellationRequested)
            {
                Saves.Init(); //loads all savegames from steam or cd2000 directories. first come first serve.
            }
            if (!token.IsCancellationRequested)
            {
                InitStrings();
            }

            if (graphics?.GraphicsDevice != null) // all below require graphics to work. to load textures graphics device needed.
            {
                if (!token.IsCancellationRequested)
                {
                    Memory.font = new Font(); //this initializes the fonts and drawing system- holds fonts in-memory
                }
                if (!token.IsCancellationRequested)
                {
                    Memory.Cards = new Cards(); // card images in menu.
                }
                if (!token.IsCancellationRequested)
                {
                    Memory.Faces = new Faces();
                }

                if (!token.IsCancellationRequested)
                {
                    Memory.Icons = new Icons();
                }

                // requires font, faces, and icons.
                // currently cards only used in debug menu. will have support for cards when added to menu.
                if (!token.IsCancellationRequested)
                {
                    Module_main_menu_debug.Init();
                }
            }
            return(0);
        }
Ejemplo n.º 2
0
        public static int InitTaskMethod(object obj)
        {
            CancellationToken token = (CancellationToken)obj;

            if (!token.IsCancellationRequested)
            {
                Memory.font = new Font(); //this initializes the fonts and drawing system- holds fonts in-memory
            }
            if (!token.IsCancellationRequested)
            {
                Memory.Strings = new Strings();
            }

            if (!token.IsCancellationRequested)
            {
                Memory.MItems = Items_In_Menu.Read();
            }

            if (!token.IsCancellationRequested)
            {
                Kernel_Bin = new Kernel_bin();
            }

            if (!token.IsCancellationRequested)
            {
                Memory.Cards = new Cards();
            }

            if (!token.IsCancellationRequested)
            {
                Memory.Faces = new Faces();
            }

            if (!token.IsCancellationRequested)
            {
                Memory.Icons = new Icons();
            }

            if (!token.IsCancellationRequested)
            {
                Saves.Init(); //loads all savegames from steam or cd2000 directories. first come first serve.
            }
            if (!token.IsCancellationRequested)
            {
                InitStrings();
            }

            if (!token.IsCancellationRequested)
            {
                Module_main_menu_debug.Init();
            }
            return(0);
        }