static void Main(string[] args) { FFGImport d2e = new FFGImport(GameType.D2E, Platform.Windows, "."); d2e.Inspect(); if (d2e.ImportAvailable()) { Console.Write("D2E Import Avaialable"); } if (d2e.NeedImport()) { Console.Write("D2E Import Needed"); } if (d2e.Import(null)) { Console.Write("D2E Import Complete"); } FFGImport mom = new FFGImport(GameType.MoM, Platform.Windows, "."); mom.Inspect(); if (mom.ImportAvailable()) { Console.Write("MoM Import Avaialable"); } if (mom.NeedImport()) { Console.Write("MoM Import Needed"); } if (mom.Import(null)) { Console.Write("MoM Import Complete"); } }
// Import content public void Import(string type) { Destroyer.Destroy(); // Create the image Texture2D tex = Resources.Load("sprites/logo") as Texture2D; Sprite sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), Vector2.zero, 1); DialogBox db = new DialogBox(new Vector2(UIScaler.GetHCenter(-3), 8), new Vector2(6, 6), StringKey.NULL, Color.clear, Color.white); db.background.GetComponent <UnityEngine.UI.Image>().sprite = sprite; db.background.AddComponent <SpritePulser>(); // Display message db = new DialogBox(new Vector2(2, 20), new Vector2(UIScaler.GetWidthUnits() - 4, 2), CONTENT_IMPORTING); db.textObj.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetMediumFont(); if (type.Equals("D2E")) { importThread = new Thread(new ThreadStart(delegate { fcD2E.Import(); })); } if (type.Equals("MoM")) { importThread = new Thread(new ThreadStart(delegate { fcMoM.Import(); })); } importThread.Start(); //while (!importThread.IsAlive) ; }
// Import content public void Import(string type, bool manual_path_selection = false) { string path = null; ValkyrieDebug.Log("INFO: Import " + type); if (manual_path_selection) { string app_filename = ""; if (type.Equals("D2E")) { app_filename = "Road to Legend"; } if (type.Equals("MoM")) { app_filename = "Mansions of Madness"; } string[] array_path = SFB.StandaloneFileBrowser.OpenFilePanel("Select file " + app_filename + ".exe", "", "exe", false); // return when pressing back if (array_path.Length == 0) { return; } path = Path.Combine(Path.GetDirectoryName(array_path[0]), app_filename + "_Data"); // return if wrong file is selected if (!Directory.Exists(path)) { return; } } Destroyer.Destroy(); new LoadingScreen(CONTENT_IMPORTING.Translate()); importType = type; if (type.Equals("D2E")) { importThread = new Thread(new ThreadStart(delegate { fcD2E.Import(path); })); } if (type.Equals("MoM")) { importThread = new Thread(new ThreadStart(delegate { fcMoM.Import(path); })); } #if IA if (type.Equals("IA")) { importThread = new Thread(new ThreadStart(delegate { fcIA.Import(path); })); } #endif importThread.Start(); }
// Import (called once message displayed) private void PerformImport(string type) { if (type.Equals("D2E")) { fcD2E.Import(); } if (type.Equals("MoM")) { fcMoM.Import(); } Destroyer.Dialog(); new GameSelectionScreen(); }
// Import content public void Import(string type) { Destroyer.Destroy(); new LoadingScreen(CONTENT_IMPORTING.Translate()); importType = type; if (type.Equals("D2E")) { importThread = new Thread(new ThreadStart(delegate { fcD2E.Import(); })); } if (type.Equals("MoM")) { importThread = new Thread(new ThreadStart(delegate { fcMoM.Import(); })); } importThread.Start(); }
// Import content public void Import(string type) { Destroyer.Destroy(); // Create an object GameObject logo = new GameObject("logo"); // Mark it as dialog logo.tag = Game.DIALOG; logo.transform.SetParent(Game.Get().uICanvas.transform); RectTransform transBg = logo.AddComponent <RectTransform>(); transBg.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Left, UIScaler.GetHCenter(-3) * UIScaler.GetPixelsPerUnit(), 6 * UIScaler.GetPixelsPerUnit()); transBg.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, 8 * UIScaler.GetPixelsPerUnit(), 6 * UIScaler.GetPixelsPerUnit()); // Create the image Texture2D tex = Resources.Load("sprites/logo") as Texture2D; Sprite sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), Vector2.zero, 1); UnityEngine.UI.Image uiImage = logo.AddComponent <UnityEngine.UI.Image>(); uiImage.sprite = sprite; logo.AddComponent <SpritePulser>(); // Display message UIElement ui = new UIElement(); ui.SetLocation(2, 20, UIScaler.GetWidthUnits() - 4, 2); ui.SetText(CONTENT_IMPORTING); ui.SetFontSize(UIScaler.GetMediumFont()); if (type.Equals("D2E")) { importThread = new Thread(new ThreadStart(delegate { fcD2E.Import(); })); } if (type.Equals("MoM")) { importThread = new Thread(new ThreadStart(delegate { fcMoM.Import(); })); } importThread.Start(); //while (!importThread.IsAlive) ; }