public void SetScData(long value, long maxValue)
        {
            if (PluginDatabase.PluginSettings.IntegrationShowProgressBarIndicator)
            {
                AchievementsIndicator.Content = value + "/" + maxValue;
            }
            else
            {
                AchievementsIndicator.Content = string.Empty;
                AchievementsProgressBar.SetValue(Grid.ColumnProperty, 0);
                AchievementsProgressBar.SetValue(Grid.ColumnSpanProperty, 3);
            }

            AchievementsProgressBar.Value   = value;
            AchievementsProgressBar.Maximum = maxValue;

            if (PluginDatabase.PluginSettings.IntegrationShowProgressBarPercent)
            {
                AchievementsPercent.Content = (maxValue != 0) ? (int)Math.Round((double)(value * 100 / maxValue)) + "%" : 0 + "%";
            }
            else
            {
                AchievementsPercent.Content = string.Empty;
            }
        }
        public SuccessStoryAchievementsProgressBar(long value, long maxValue, bool showPercent, bool showIndicator)
        {
            InitializeComponent();

            if (showIndicator)
            {
                AchievementsIndicator.Content = value + "/" + maxValue;
            }
            else
            {
                AchievementsIndicator.Content = "";
                AchievementsProgressBar.SetValue(Grid.ColumnProperty, 0);
                AchievementsProgressBar.SetValue(Grid.ColumnSpanProperty, 3);
            }

            AchievementsProgressBar.Value   = value;
            AchievementsProgressBar.Maximum = maxValue;

            if (showPercent)
            {
                AchievementsPercent.Content = (maxValue != 0) ? (int)Math.Round((double)(value * 100 / maxValue)) + "%" : 0 + "%";
            }
            else
            {
                AchievementsPercent.Content = "";
            }
        }
예제 #3
0
        public void SetScData(long value, long maxValue, bool showPercent, bool showIndicator, bool withContener = false)
        {
            _withContener = withContener;

            if (showIndicator)
            {
                AchievementsIndicator.Content = value + "/" + maxValue;
            }
            else
            {
                AchievementsIndicator.Content = string.Empty;
                AchievementsProgressBar.SetValue(Grid.ColumnProperty, 0);
                AchievementsProgressBar.SetValue(Grid.ColumnSpanProperty, 3);
            }

            AchievementsProgressBar.Value   = value;
            AchievementsProgressBar.Maximum = maxValue;

            if (showPercent)
            {
                AchievementsPercent.Content = (maxValue != 0) ? (int)Math.Round((double)(value * 100 / maxValue)) + "%" : 0 + "%";
            }
            else
            {
                AchievementsPercent.Content = string.Empty;
            }
        }