Ejemplo n.º 1
0
        public static void Init()
        {
            if (initialized)
            {
                return;
            }
            var sc = new SynchronizationContext();

            SynchronizationContext.SetSynchronizationContext(sc);
            CoreLib.InitLib(TaskScheduler.FromCurrentSynchronizationContext(), x => { });
#if AZURE
            ME1Directory.DefaultGamePath = ME1UnrealObjectInfo.MiniGameFilesPath = GetTestMiniGamePath(MEGame.ME1);
            ME2Directory.DefaultGamePath = ME2UnrealObjectInfo.MiniGameFilesPath = GetTestMiniGamePath(MEGame.ME2);
            ME3Directory.DefaultGamePath = ME3UnrealObjectInfo.MiniGameFilesPath = GetTestMiniGamePath(MEGame.ME3);
#endif
            initialized = true;
        }
Ejemplo n.º 2
0
        private static void initCoreLib()
        {
#if DEBUG
            MemoryAnalyzer.IsTrackingMemory = true;
#endif
            void packageSaveFailed(string message)
            {
                // I'm not sure if this requires ui thread since it's win32 but i'll just make sure
                Application.Current.Dispatcher.Invoke(() =>
                {
                    MessageBox.Show(message);
                });
            }

            CoreLib.InitLib(TaskScheduler.FromCurrentSynchronizationContext(), packageSaveFailed);
            CoreLibSettingsBridge.MapSettingsIntoBridge();
            PackageSaver.CheckME3Running = () =>
            {
                GameController.TryGetME3Process(out var me3Proc);
                return(me3Proc != null);
            };
            PackageSaver.NotifyRunningTOCUpdateRequired = GameController.SendTOCUpdateMessage;
            PackageSaver.GetPNGForThumbnail             = texture2D => texture2D.GetPNG(texture2D.GetTopMip());
        }