Ejemplo n.º 1
0
    protected void Application_Startup(object sender, StartupEventArgs e)
    {
        // Set crash logs output to Logs - any unhandled exceptions will be saved to a text file locally.
        // Release only, because we want to see Exceptions in IDE during development.
#if RELEASE
        Application.Current.DispatcherUnhandledException += OnUnhandledException;
#endif

        // Set default culture for all threads for this application (affects date and string formats, e.g. periods instead of commas)
        CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
        CultureInfo.DefaultThreadCurrentCulture   = CultureInfo.InvariantCulture;
        CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture;

        // Load JSONs.
        GameAssetsHelper.Load();

        var gameWindow = new GameWindow();
        Current.MainWindow = gameWindow;
        gameWindow.Show();

        UserDataHelper.Load();

        (GameAssets.Pages["MainMenu"] as MainMenuPage).UpdateCreateHeroButton();
        (GameAssets.Pages["MainMenu"] as MainMenuPage).UpdateSelectOrDeleteHeroButtons();

        // Save current time as the application's start time (for achievement tracking).
        User.SessionStartDate = DateTime.Now;

        GeneralToolTipHelper.SetGlobalToolTipDelay();
    }
Ejemplo n.º 2
0
    protected void Application_Startup(object sender, StartupEventArgs e)
    {
        // Set default culture for all threads for this application (affects date and string formats, e.g. periods instead of commas)
        CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
        CultureInfo.DefaultThreadCurrentCulture   = CultureInfo.InvariantCulture;
        CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture;

        FilePathHelper.CalculateGameAssetsFilePaths();

        /* Content seeding - use with caution!
         * GameAssetsHelper.SeedContent<Artifact>(FilePathHelper.ArtifactsFilePath);
         * GameAssetsHelper.SeedContent<Artifact>(FilePathHelper.BlessingsFilePath);
         * GameAssetsHelper.SeedContent<Artifact>(FilePathHelper.BossesFilePath);
         * GameAssetsHelper.SeedContent<Artifact>(FilePathHelper.DungeonsFilePath);
         * GameAssetsHelper.SeedContent<Artifact>(FilePathHelper.DungeonGroupsFilePath);
         * GameAssetsHelper.SeedContent<Artifact>(FilePathHelper.MonstersFilePath);
         * GameAssetsHelper.SeedContent<Artifact>(FilePathHelper.RegionsFilePath);
         * GameAssetsHelper.SeedContent<Artifact>(FilePathHelper.QuestsFilePath);
         * GameAssetsHelper.SeedContent<Artifact>(FilePathHelper.RecipesFilePath);
         * GameAssetsHelper.SeedContent<Artifact>(FilePathHelper.PriestOfferFilePath);
         * GameAssetsHelper.SeedContent<Artifact>(FilePathHelper.ShopOfferFilePath);
         */

        GameAssetsHelper.LoadAllContent();
    }
Ejemplo n.º 3
0
    private void MainWindow_OnClosing(object sender, CancelEventArgs e)
    {
        SaveObjectChanges();

        GameAssetsHelper.SaveAllContent();

        ValidationHelper.ValidateData();
    }