//WelshSkillsListUI welshSkillListUI; public void InitialiseMe(string grammarID, string shortDesc, string longDesc, string tally) { base.InitialiseMe(grammarID, shortDesc, longDesc); extraInfo = transform.Find("ExtraInformation"); //welshSkillListUI = FindObjectOfType<WelshSkillsListUI>(); progressSlider = extraInfo.Find("ProgressSlider").GetComponent <Slider>(); progressLbl = extraInfo.Find("ProgressLbl").GetComponent <Text>(); int tallyInt = int.Parse(tally); progressSlider.value = tallyInt; int threshold; string proficiencyLbl; GrammarProficienciesHandler proficiencyHandler = new GrammarProficienciesHandler(grammarID); proficiencyHandler.GetProficiencyDetailsFromTally(tallyInt, out proficiencyLbl, out threshold); progressLbl.text = proficiencyLbl; progressSlider.maxValue = threshold; }
//WelshSkillsListUI welshSkillListUI; public void InitialiseMe(string grammarID, string grammarSummaryStr, string grammarDetailsStr, string tally, string tallyMod, string skillInc) { base.InitialiseMe(grammarID, grammarSummaryStr, grammarDetailsStr); //welshSkillListUI = FindObjectOfType<WelshSkillsListUI>(); extraInfo = transform.Find("ExtraInformation"); progressSlider = extraInfo.Find("ProgressSlider").GetComponent <Slider>(); progressLbl = extraInfo.Find("ProgressLbl").GetComponent <Text>(); tallyModifier = extraInfo.Find("TallyModifier").GetComponent <Text>(); skillsIncrementer = extraInfo.Find("SkillPointIncrementer").GetComponent <Text>(); int tallyInt = int.Parse(tally); int threshold; string proficiencyString; GrammarProficienciesHandler proficienciesHandler = new GrammarProficienciesHandler(grammarID); proficienciesHandler.GetProficiencyDetailsFromTally(tallyInt, out proficiencyString, out threshold); progressSlider.maxValue = threshold; progressSlider.value = tallyInt; progressLbl.text = proficiencyString; SetTallyModifier(tallyMod); SetSkillsIncrementer(skillInc); }
private void UpdateGrammarSkillPoints() { foreach (KeyValuePair <int, string[]> pair in grammarDetailsDict) { int currentTally = int.Parse(pair.Value[0]); int threshold; string grammarProficiency; GrammarProficienciesHandler grammarProficienciesHandler = new GrammarProficienciesHandler(pair.Key.ToString()); grammarProficienciesHandler.GetProficiencyDetailsFromTally(currentTally, out grammarProficiency, out threshold); int grammarProficiencyAcquired = DbCommands.GetCountFromTable( "AcquiredGrammarSkills", "RuleIDs = " + pair.Key.ToString() + " AND ProficiencyNames = " + DbCommands.GetParameterNameFromValue(grammarProficiency) + " AND SaveIDs = 0", grammarProficiency); if (grammarProficiencyAcquired < 1) { if (currentTally >= threshold) { DbCommands.InsertTupleToTable("AcquiredGrammarSkills", pair.Key.ToString(), grammarProficiency, "0"); skillPointsGainedTotal++; pair.Value[1] = "+"; if (highestTallyPossible > currentTally) { DbCommands.UpdateTableField("DiscoveredVocabGrammar", "CorrectTallies", "0", "SaveIDs = 0 " + "AND RuleIDs = " + pair.Key.ToString() + ";"); pair.Value[0] = "0"; } } } } }