/// <summary> /// Fills displayed fields w/ data from the race's Id. /// </summary> internal override void SelectId() { RacialFlags_text.Clear(); // clear the info-fields to force TextChanged events -> RacialFeat1_text.Clear(); RacialFeat2_text.Clear(); RacialFeat3_text.Clear(); RacialFeat4_text.Clear(); RacialFeat5_text.Clear(); Race race = he.Races[he.Id]; bool dirty = (race.differ != bit_clean); RaceChanged racechanged; if (dirty) { racechanged = he.RacesChanged[he.Id]; } else { racechanged = new RaceChanged(); // not used. } int val = race.flags; RacialFlags_reset.Text = val.ToString(); if (dirty) { val = racechanged.flags; } RacialFlags_text.Text = val.ToString(); val = race.feat1; RacialFeat1_reset.Text = val.ToString(); if (dirty) { val = racechanged.feat1; } RacialFeat1_text.Text = val.ToString(); val = race.feat2; RacialFeat2_reset.Text = val.ToString(); if (dirty) { val = racechanged.feat2; } RacialFeat2_text.Text = val.ToString(); val = race.feat3; RacialFeat3_reset.Text = val.ToString(); if (dirty) { val = racechanged.feat3; } RacialFeat3_text.Text = val.ToString(); val = race.feat4; RacialFeat4_reset.Text = val.ToString(); if (dirty) { val = racechanged.feat4; } RacialFeat4_text.Text = val.ToString(); val = race.feat5; RacialFeat5_reset.Text = val.ToString(); if (dirty) { val = racechanged.feat5; } RacialFeat5_text.Text = val.ToString(); }
/// <summary> /// Handler for the "apply changed data to currently selected /// spell/race/class" button. /// </summary> /// <param name="sender">bu_Apply</param> /// <param name="e"></param> /// <remarks>See /// <c><see cref="Click_applyGlobal()">Click_applyGlobal()</see></c> to /// apply all altered data globally.</remarks> void Click_apply(object sender, EventArgs e) { SetTitleText(); switch (Type) { case Type2da.Spells: { Spell spell = Spells[Id]; if (spell.differ != control_Spells.bit_clean) { spell.differ = control_Spells.bit_clean; spell.isChanged = true; SpellChanged spellchanged = SpellsChanged[Id]; spell.spellinfo = spellchanged.spellinfo; spell.targetinfo = spellchanged.targetinfo; spell.effectweight = spellchanged.effectweight; spell.effecttypes = spellchanged.effecttypes; spell.damageinfo = spellchanged.damageinfo; spell.savetype = spellchanged.savetype; spell.savedctype = spellchanged.savedctype; Spells[Id] = spell; SpellsChanged.Remove(Id); HenchControl.SetResetColor(DefaultForeColor); AfterSelect_node(null, null); // refresh all displayed data for the current spell jic } if (Spells[Id].isChanged) // this goes outside the SpellsChanged check above because uh color goes screwy if not. { Tree.SelectedNode.ForeColor = Color.Blue; } else // I doubt this ever *needs* to run ... but safety. { Tree.SelectedNode.ForeColor = DefaultForeColor; } break; } case Type2da.Racial: { Race race = Races[Id]; if (race.differ != control_Racial.bit_clean) { race.differ = control_Racial.bit_clean; race.isChanged = true; RaceChanged racechanged = RacesChanged[Id]; race.flags = racechanged.flags; race.feat1 = racechanged.feat1; race.feat2 = racechanged.feat2; race.feat3 = racechanged.feat3; race.feat4 = racechanged.feat4; race.feat5 = racechanged.feat5; Races[Id] = race; RacesChanged.Remove(Id); HenchControl.SetResetColor(DefaultForeColor); AfterSelect_node(null, null); // refresh all displayed data for the current node jic } if (Races[Id].isChanged) // this goes outside the RacesChanged check above because uh color goes screwy if not. { Tree.SelectedNode.ForeColor = Color.Blue; } else // I doubt this ever *needs* to run ... but safety. { Tree.SelectedNode.ForeColor = DefaultForeColor; } break; } case Type2da.Classes: { Class @class = Classes[Id]; if (@class.differ != control_Classes.bit_clean) { @class.differ = control_Classes.bit_clean; @class.isChanged = true; ClassChanged classchanged = ClassesChanged[Id]; @class.flags = classchanged.flags; @class.feat1 = classchanged.feat1; @class.feat2 = classchanged.feat2; @class.feat3 = classchanged.feat3; @class.feat4 = classchanged.feat4; @class.feat5 = classchanged.feat5; @class.feat6 = classchanged.feat6; @class.feat7 = classchanged.feat7; @class.feat8 = classchanged.feat8; @class.feat9 = classchanged.feat9; @class.feat10 = classchanged.feat10; @class.feat11 = classchanged.feat11; Classes[Id] = @class; ClassesChanged.Remove(Id); HenchControl.SetResetColor(DefaultForeColor); AfterSelect_node(null, null); // refresh all displayed data for the current node jic } if (Classes[Id].isChanged) // this goes outside the ClassesChanged check above because uh color goes screwy if not. { Tree.SelectedNode.ForeColor = Color.Blue; } else // I doubt this ever *needs* to run ... but safety. { Tree.SelectedNode.ForeColor = DefaultForeColor; } break; } } }