コード例 #1
0
 public void Clear()
 {
     for (int s = 0; s < 8; s++)
     {
         chosenResults[s] = 0;
         fixedResults[s]  = false;
         results[s].Clear();
         lowerBoundWilds[s] = 0;
         lowerBoundDoms[s]  = 0;
         upperBoundDoms[s]  = 0;
     }
     validResults  = false;
     uniqueResults = false;
     statsWithTE.Clear();
     imprintingBonusRange = new MinMaxDouble(0);
     levelWildSum         = 0;
     levelDomSum          = 0;
     lastTEUnique         = false;
     possibleIssues       = IssueNotes.Issue.None;
 }
コード例 #2
0
        /// <summary>
        /// Call this method if an extraction failed. Possible causes of the failure are displayed for the user.
        /// </summary>
        /// <param name="issues"></param>
        private void ExtractionFailed(IssueNotes.Issue issues = IssueNotes.Issue.None)
        {
            issues |= extractor.possibleIssues; // add all issues that arised during extraction
            if (issues == IssueNotes.Issue.None)
            {
                // set background of inputs to neutral
                numericUpDownLevel.BackColor                    = SystemColors.Window;
                numericUpDownLowerTEffBound.BackColor           = SystemColors.Window;
                numericUpDownUpperTEffBound.BackColor           = SystemColors.Window;
                numericUpDownImprintingBonusExtractor.BackColor = SystemColors.Window;
                cbExactlyImprinting.BackColor                   = Color.Transparent;
                panelSums.BackColor                  = Color.Transparent;
                panelWildTamedBred.BackColor         = Color.Transparent;
                labelTE.BackColor                    = Color.Transparent;
                llOnlineHelpExtractionIssues.Visible = false;
                labelErrorHelp.Visible               = false;
                lbImprintingFailInfo.Visible         = false; // TODO move imprinting-fail to upper note-info
                extractor.possibleIssues             = IssueNotes.Issue.None;
            }
            else
            {
                // highlight controls which most likely need to be checked to solve the issue
                if (issues.HasFlag(IssueNotes.Issue.WildTamedBred))
                {
                    panelWildTamedBred.BackColor = Color.LightSalmon;
                }
                if (issues.HasFlag(IssueNotes.Issue.TamingEffectivenessRange))
                {
                    if (numericUpDownLowerTEffBound.Value > 0)
                    {
                        numericUpDownLowerTEffBound.BackColor = Color.LightSalmon;
                    }
                    if (numericUpDownUpperTEffBound.Value < 100)
                    {
                        numericUpDownUpperTEffBound.BackColor = Color.LightSalmon;
                    }
                    if (numericUpDownLowerTEffBound.Value == 0 && numericUpDownUpperTEffBound.Value == 100)
                    {
                        issues -= IssueNotes.Issue.TamingEffectivenessRange;
                    }
                }
                if (issues.HasFlag(IssueNotes.Issue.CreatureLevel))
                {
                    numericUpDownLevel.BackColor = Color.LightSalmon;
                    numericUpDownImprintingBonusExtractor.BackColor = Color.LightSalmon;
                    statIOs[(int)StatNames.Torpidity].Status        = StatIOStatus.Error;
                }
                if (issues.HasFlag(IssueNotes.Issue.ImprintingLocked))
                {
                    cbExactlyImprinting.BackColor = Color.LightSalmon;
                }
                if (issues.HasFlag(IssueNotes.Issue.ImprintingNotPossible))
                {
                    numericUpDownImprintingBonusExtractor.BackColor = Color.LightSalmon;
                }

                // don't show some issue notes if the input is not wrong
                if (issues.HasFlag(IssueNotes.Issue.LockedDom))
                {
                    bool oneStatIsDomLocked = false;
                    for (int s = 0; s < Values.STATS_COUNT; s++)
                    {
                        if (statIOs[s].DomLevelLockedZero)
                        {
                            oneStatIsDomLocked = true;
                            break;
                        }
                    }
                    if (!oneStatIsDomLocked)
                    {
                        // no stat is domLocked, remove this note (which is ensured to be there)
                        issues -= IssueNotes.Issue.LockedDom;
                    }
                }

                if (!issues.HasFlag(IssueNotes.Issue.StatMultipliers))
                {
                    issues |= IssueNotes.Issue.StatMultipliers; // add this always?
                }
                if (rbTamedExtractor.Checked && creatureCollection.considerWildLevelSteps)
                {
                    issues |= IssueNotes.Issue.WildLevelSteps;
                }

                labelErrorHelp.Text = "The extraction failed. See the following list of possible causes:\n\n" +
                                      IssueNotes.getHelpTexts(issues);
                labelErrorHelp.Visible = true;
                llOnlineHelpExtractionIssues.Visible = true;
                groupBoxPossibilities.Visible        = false;
                groupBoxRadarChartExtractor.Visible  = false;
                lbInfoYellowStats.Visible            = false;
                if (rbBredExtractor.Checked && numericUpDownImprintingBonusExtractor.Value > 0)
                {
                    lbImprintingFailInfo.Text    = Loc.s("lbImprintingFailInfo");
                    lbImprintingFailInfo.Visible = true;
                }
                else if (rbTamedExtractor.Checked && "Procoptodon,Pulmonoscorpius,Troodon".Split(',').ToList().Contains(speciesSelector1.SelectedSpecies.name))
                {
                    // creatures that display wrong stat-values after taming
                    lbImprintingFailInfo.Text = $"The {speciesSelector1.SelectedSpecies.name} is known for displaying wrong stat-values after taming. " +
                                                "Please try the extraction again after the server restarted.";
                    lbImprintingFailInfo.Visible = true;
                }
                toolStripButtonSaveCreatureValuesTemp.Visible = true;

                // check for updates
                if (DateTime.Now.AddHours(-5) > Properties.Settings.Default.lastUpdateCheck)
                {
                    CheckForUpdates(true);
                }
            }
        }