Exemple #1
0
        public void OnBtActionBarClick(object sender, RoutedEventArgs e)
        {
            GameHowLongToBeat gameHowLongToBeat = HowLongToBeat.PluginDatabase.Get(HowLongToBeatDatabase.GameSelected);

            if (gameHowLongToBeat.HasData || gameHowLongToBeat.HasDataEmpty)
            {
                var    ViewExtension   = new Views.HowLongToBeatView(_PlayniteApi, PluginDatabase.PluginSettings, gameHowLongToBeat);
                Window windowExtension = PlayniteUiHelper.CreateExtensionWindow(_PlayniteApi, "HowLongToBeat", ViewExtension);
                windowExtension.ShowDialog();

                var TaskIntegrationUI = Task.Run(() =>
                {
                    HowLongToBeat.howLongToBeatUI.RefreshElements(HowLongToBeatDatabase.GameSelected);
                });
            }
        }
        public void OnBtActionBarClick(object sender, RoutedEventArgs e)
        {
#if DEBUG
            logger.Debug($"HowLongToBeat - HowLongToBeat.HltbGameData: {JsonConvert.SerializeObject(HowLongToBeat.HltbGameData)}");
#endif
            if (!HowLongToBeat.HltbGameData.hasData)
            {
                HowLongToBeat.HltbGameData.SearchData(HowLongToBeat.GameSelected);
            }

            if (HowLongToBeat.HltbGameData.hasData)
            {
                if (_Settings.EnableTag)
                {
                    HowLongToBeat.HltbGameData.AddTag();
                }

                var    ViewExtension   = new Views.HowLongToBeatView(HowLongToBeat.HltbGameData, HowLongToBeat.GameSelected, _PlayniteApi, _Settings);
                Window windowExtension = PlayniteUiHelper.CreateExtensionWindow(_PlayniteApi, "HowLongToBeat", ViewExtension);
                windowExtension.ShowDialog();
            }
        }