frmMain.Family.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using SOTF_Struct.Generic;
  7. namespace SOTF_Savegame_Editor {
  8. partial class frmMain {
  9. public class FamilyInfo {
  10. public FamilyInfo() {
  11. }
  12. public FamilyInfo(int FamilyID) {
  13. this.FamilyID = FamilyID;
  14. }
  15. private Influence Influence_Player_Total = new Influence();
  16. private Influence Influence_Cannibal_Total = new Influence();
  17. private Influence Influence_Creepy_Total = new Influence();
  18. private int Influence_Player_Count = 0;
  19. private int Influence_Cannibal_Count = 0;
  20. private int Influence_Creepy_Count = 0;
  21. public Influence Influence_Player = new Influence();
  22. public Influence Influence_Cannibal = new Influence();
  23. public Influence Influence_Creepy = new Influence();
  24. public int FamilyID = 0;
  25. public List<int> actorID = new List<int>();
  26. private int _creeps = 0;
  27. private int _animals = 0;
  28. private int _cannibals = 0;
  29. private int _females = 0;
  30. private int _males = 0;
  31. private int _diverse = 0;
  32. private int _npc = 0;
  33. public int Creeps { get => this._creeps; }
  34. public int Animals { get => this._animals; }
  35. public int Cannibals { get => this._cannibals; }
  36. public int Females { get => this._females; }
  37. public int Males { get => this._males; }
  38. public int NPC { get => this._npc; }
  39. public int InfluencedByPlayer {
  40. get => this.Influence_Player_Count;
  41. }
  42. public int InfluencedByCreep {
  43. get => this.Influence_Creepy_Count;
  44. }
  45. public int InfluencedByCannibal {
  46. get => this.Influence_Cannibal_Count;
  47. }
  48. public int ActorCount {
  49. get {
  50. return this._animals + this._cannibals + this._creeps + this._npc;
  51. }
  52. }
  53. public string _familyType = "";
  54. public string FamilyType {
  55. get {
  56. if (this._familyType == "")
  57. this.RefreshFamilyType();
  58. return this._familyType;
  59. }
  60. }
  61. private void RefreshFamilyType() {
  62. string prefix1 = "";
  63. string prefix2 = "";
  64. string name = "";
  65. string surfix = "";
  66. string gendre = "";
  67. if (this._males == 0 && this._diverse == 0 && this._females > 0)
  68. gendre = "female ";
  69. else if (this._males > 0 && this._diverse == 0 && this._females == 0)
  70. gendre = "male ";
  71. if (this.Influence_Player.Fear > 80)
  72. prefix1 = "scared ";
  73. else if (this.Influence_Player.Fear > 60)
  74. prefix1 = "fearing ";
  75. else if (this.Influence_Player.Fear > 40)
  76. prefix1 = "awed ";
  77. else if (this.Influence_Player.Fear > 40)
  78. prefix1 = "distrusted ";
  79. if (this.Influence_Player.Anger > 80 && this.Influence_Player.Sentiment < 10)
  80. prefix2 = "bloodlust ";
  81. else if (this.Influence_Player.Anger > 80 && this.Influence_Player.Sentiment < 60)
  82. prefix2 = "aggressive ";
  83. else if (this.Influence_Player.Anger > 60 && this.Influence_Player.Sentiment < 10)
  84. prefix2 = "angry ";
  85. else if (this.Influence_Player.Anger > 70 && this.Influence_Player.Sentiment < 20)
  86. prefix2 = "angry ";
  87. else if (this.Influence_Player.Anger > 50 && this.Influence_Player.Sentiment < 20)
  88. prefix2 = "wrathful ";
  89. else if (this.Influence_Player.Anger > 20 && this.Influence_Player.Sentiment < 20)
  90. prefix2 = "upset ";
  91. else if (this.Influence_Player.Anger < 60 && this.Influence_Player.Sentiment > 80)
  92. prefix2 = "lionized ";
  93. else if (this.Influence_Player.Anger < 10 && this.Influence_Player.Sentiment > 60)
  94. prefix2 = "loving ";
  95. else if (this.Influence_Player.Anger < 20 && this.Influence_Player.Sentiment > 70)
  96. prefix2 = "bundling ";
  97. else if (this.Influence_Player.Anger < 20 && this.Influence_Player.Sentiment > 50)
  98. prefix2 = "carring ";
  99. else if (this.Influence_Player.Anger < 20 && this.Influence_Player.Sentiment > 20)
  100. prefix2 = "liked ";
  101. if (this._animals >= 1 && this._cannibals == 0 && this._creeps == 0 && this._npc == 0)
  102. name = "Animals";
  103. else if (this._animals == 0 && this._cannibals >= 1 && this._creeps == 0 && this._npc == 0)
  104. name = "Canibals";
  105. else if (this._animals == 0 && this._cannibals == 0 && this._creeps >= 1 && this._npc == 0)
  106. name = "Creeps";
  107. else if (this._animals == 0 && this._cannibals == 0 && this._creeps == 0 && this._npc >= 1)
  108. name = "NPCs";
  109. else if (this._animals == 0 && this._cannibals >= 1 && this._creeps >= 1 && this._npc == 0)
  110. name = "Foes";
  111. else if (this._animals >= 1 && this._cannibals == 0 && this._creeps == 0 && this._npc >= 1)
  112. name = "Neutrals";
  113. else
  114. name = "Somethin";
  115. int mob = this._npc + this._animals + this._cannibals + this._creeps;
  116. if (mob > 50) surfix = " of the Gods";
  117. else if (mob > 30) surfix = " of the Army";
  118. else if (mob > 20) surfix = " of the Gang";
  119. else if (mob > 15) surfix = " of the Tribe";
  120. else if (mob > 10) surfix = " of the Family";
  121. string combined = prefix1 + prefix2 + gendre + name + surfix;
  122. combined = combined.Substring(0, 1).ToUpper() + combined.Substring(1);
  123. this._familyType = combined;
  124. }
  125. public void AddInfluence(Influence i) {
  126. if (i.TypeId.ToLower() == "player") {
  127. this.Influence_Player_Count++;
  128. this.Influence_Player_Total += i;
  129. this.Influence_Player = this.Influence_Player_Total / this.Influence_Player_Count;
  130. } else if (i.TypeId.ToLower() == "cannibal") {
  131. this.Influence_Cannibal_Count++;
  132. this.Influence_Cannibal_Total += i;
  133. this.Influence_Cannibal = this.Influence_Cannibal_Total / this.Influence_Cannibal_Count;
  134. } else if (i.TypeId.ToLower() == "creepy") {
  135. this.Influence_Creepy_Count++;
  136. this.Influence_Creepy_Total += i;
  137. this.Influence_Creepy = this.Influence_Creepy_Total / this.Influence_Creepy_Count;
  138. }
  139. }
  140. public void AddInfluence(Influence[] ins) {
  141. foreach (Influence i in ins) {
  142. if (i.TypeId.ToLower() == "player") {
  143. this.Influence_Player_Count++;
  144. this.Influence_Player_Total += i;
  145. } else if (i.TypeId.ToLower() == "cannibal") {
  146. this.Influence_Cannibal_Count++;
  147. this.Influence_Cannibal_Total += i;
  148. } else if (i.TypeId.ToLower() == "creepy") {
  149. this.Influence_Creepy_Count++;
  150. this.Influence_Creepy_Total += i;
  151. }
  152. }
  153. this.Influence_Player = this.Influence_Player_Total / this.Influence_Player_Count;
  154. this.Influence_Cannibal = this.Influence_Cannibal_Total / this.Influence_Cannibal_Count;
  155. this.Influence_Creepy = this.Influence_Creepy_Total / this.Influence_Creepy_Count;
  156. this._familyType = "";
  157. }
  158. public void AddInfluence(List<Influence> ins) {
  159. foreach (Influence i in ins) {
  160. if (i.TypeId.ToLower() == "player") {
  161. this.Influence_Player_Count++;
  162. this.Influence_Player_Total += i;
  163. } else if (i.TypeId.ToLower() == "cannibal") {
  164. this.Influence_Cannibal_Count++;
  165. this.Influence_Cannibal_Total += i;
  166. } else if (i.TypeId.ToLower() == "creepy") {
  167. this.Influence_Creepy_Count++;
  168. this.Influence_Creepy_Total += i;
  169. }
  170. }
  171. this.Influence_Player = this.Influence_Player_Total / this.Influence_Player_Count;
  172. this.Influence_Cannibal = this.Influence_Cannibal_Total / this.Influence_Cannibal_Count;
  173. this.Influence_Creepy = this.Influence_Creepy_Total / this.Influence_Creepy_Count;
  174. this._familyType = "";
  175. }
  176. public void AddActor(int index, Actor a) {
  177. if (!this.actorID.Contains(index))
  178. this.actorID.Add(index);
  179. if (a.TypeId <= 7) this._animals++;
  180. else if (a.TypeId <= 10) this._npc++;
  181. else if (a.TypeId == 11) this._creeps++;
  182. else if (a.TypeId <= 16) this._cannibals++;
  183. else if (a.TypeId == 17) this._animals++;
  184. else if (a.TypeId <= 21) this._creeps++;
  185. else if (a.TypeId <= 31) this._cannibals++;
  186. else if (a.TypeId <= 37) this._animals++;
  187. else if (a.TypeId == 38) this._cannibals++;
  188. else if (a.TypeId == 39) this._npc++;
  189. else if (a.TypeId <= 42) this._creeps++;
  190. else if (a.TypeId <= 44) this._cannibals++;
  191. else if (a.TypeId <= 47) this._creeps++;
  192. if (a.Gendre == 0) this._diverse++;
  193. else if (a.Gendre == 1) this._males++;
  194. else if (a.Gendre == 2) this._females++;
  195. this._familyType = "";
  196. }
  197. }
  198. private void UpdateFamilyList() {
  199. this.tvFamily.BeginUpdate();
  200. this.tvFamily.Nodes.Clear();
  201. Dictionary<int, FamilyInfo> familyList = new Dictionary<int, FamilyInfo>();
  202. for (int i = 0, c = this.saveData.VailWorldSim.Actors.Count; i < c; i++) {
  203. if (!familyList.ContainsKey(this.saveData.VailWorldSim.Actors[i].FamilyId))
  204. familyList.Add(this.saveData.VailWorldSim.Actors[i].FamilyId, new FamilyInfo(this.saveData.VailWorldSim.Actors[i].FamilyId));
  205. familyList[this.saveData.VailWorldSim.Actors[i].FamilyId].AddActor(i, this.saveData.VailWorldSim.Actors[i]);
  206. foreach (InfluenceMemoryList iL in this.saveData.VailWorldSim.InfluenceMemory) {
  207. if (iL.UniqueId == this.saveData.VailWorldSim.Actors[i].UniqueId)
  208. familyList[this.saveData.VailWorldSim.Actors[i].FamilyId].AddInfluence(iL.Influences);
  209. }
  210. }
  211. foreach (KeyValuePair<int, FamilyInfo> p in familyList) {
  212. string name = p.Value.FamilyType;
  213. TreeNode node = null;
  214. foreach (TreeNode n in this.tvFamily.Nodes)
  215. if (n.Text == name) {
  216. node = n;
  217. break;
  218. }
  219. if (node == null)
  220. node = tvFamily.Nodes.Add(name);
  221. node.Nodes.Add(new TreeNode() { Text = p.Key.ToString() + " [" + p.Value.ActorCount + "]", Tag = p.Value });
  222. }
  223. this.tvFamily.EndUpdate();
  224. }
  225. private void tvFamily_AfterSelect(object sender, TreeViewEventArgs e) {
  226. if (e.Node == null) {
  227. // No node selected
  228. this.ShowMiniMapItem(null);
  229. this.flowFamily.Controls.Clear();
  230. this.cbFamily_Anger.Enabled = false;
  231. this.cbFamily_Fear.Enabled = false;
  232. this.cbFamily_Sentiment.Enabled = false;
  233. this.lblFamily_Anger.Text = "-";
  234. this.lblFamily_Fear.Text = "-";
  235. this.lblFamily_Sentiment.Text = "-";
  236. this.lblFamilyName.Text = "-";
  237. this.cmdFamily_InfluencesRemove.Enabled = false;
  238. this.cmdFamily_InfluencesExisting.Enabled = false;
  239. this.cmdFamily_InfluencesAll.Enabled = false;
  240. } else if (e.Node.Tag == null) {
  241. this.ShowMiniMapItem(null);
  242. this.flowFamily.Controls.Clear();
  243. this.cbFamily_Anger.Enabled = false;
  244. this.cbFamily_Fear.Enabled = false;
  245. this.cbFamily_Sentiment.Enabled = false;
  246. this.lblFamily_Anger.Text = "-";
  247. this.lblFamily_Fear.Text = "-";
  248. this.lblFamily_Sentiment.Text = "-";
  249. this.lblFamilyName.Text = "-";
  250. this.cmdFamily_InfluencesRemove.Enabled = false;
  251. this.cmdFamily_InfluencesExisting.Enabled = false;
  252. this.cmdFamily_InfluencesAll.Enabled = false;
  253. } else if (e.Node.Tag.GetType() == typeof(FamilyInfo)) {
  254. FamilyInfo family = (FamilyInfo)e.Node.Tag;
  255. ShowFamilyInfo(family);
  256. }
  257. }
  258. private void ShowFamilyInfo(FamilyInfo family) {
  259. this.cbFamily_Anger.Enabled = true;
  260. this.cbFamily_Fear.Enabled = true;
  261. this.cbFamily_Sentiment.Enabled = true;
  262. this.cbFamily_Anger.Value = family.Influence_Player.Anger;
  263. this.cbFamily_Fear.Value = family.Influence_Player.Fear;
  264. this.cbFamily_Sentiment.Value = family.Influence_Player.Sentiment;
  265. this.lblFamily_Anger.Text = family.Influence_Player.Anger.ToString("0.00") + " %";
  266. this.lblFamily_Fear.Text = family.Influence_Player.Fear.ToString("0.00") + " %";
  267. this.lblFamily_Sentiment.Text = family.Influence_Player.Sentiment.ToString("0.00") + " %";
  268. this.cmdFamily_InfluencesRemove.Enabled = family.InfluencedByPlayer > 0;
  269. this.cmdFamily_InfluencesExisting.Enabled = family.InfluencedByPlayer > 0;
  270. this.cmdFamily_InfluencesAll.Enabled = true;
  271. this.lblFamilyName.Text = family.FamilyType;
  272. if (family.actorID.Count > 0) {
  273. this.ShowMiniMapItem(new MiniMapItem(
  274. family.actorID[0],
  275. this.saveData.VailWorldSim.Actors[family.actorID[0]].GetDisplayName(),
  276. eMiniMapType.Actor,
  277. this.saveData.VailWorldSim.Actors[family.actorID[0]].Position
  278. ));
  279. this.flowFamily.Controls.Clear();
  280. Font xfont = new Font(this.Font.FontFamily, 14, FontStyle.Bold);
  281. for (int i = 0; i < Math.Min(family.actorID.Count, 150); i++) {
  282. Actor a = this.saveData.VailWorldSim.Actors[family.actorID[i]];
  283. ActorProfile ap = new ActorProfile(
  284. a,
  285. this.saveData.VailWorldSim.GetInfluenceMemory(a, "player")
  286. ) {
  287. AutoSize = false,
  288. Width = 160,
  289. Height = 150,
  290. Font = xfont,
  291. BorderStyle = BorderStyle.FixedSingle,
  292. Padding = new Padding(10)
  293. };
  294. ap.MouseDown += Ap_MouseDown;
  295. this.flowFamily.Controls.Add(ap);
  296. }
  297. }
  298. }
  299. private void Ap_MouseDown(object? sender, MouseEventArgs e) {
  300. ActorProfile ap = (ActorProfile)sender;
  301. if (ap.Actor != null) {
  302. this.ShowMiniMapItem(new MiniMapItem(
  303. 0,
  304. ap.Actor.GetDisplayName(),
  305. eMiniMapType.Actor,
  306. ap.Actor.Position
  307. ));
  308. }
  309. }
  310. [Flags]
  311. public enum eInfluence {
  312. Anger = 1,
  313. Fear = 2,
  314. Sentiment = 4
  315. }
  316. bool bFamily_InfluenceOnlyOnExisting = true;
  317. private void SetFamilyInfluence(FamilyInfo family, bool OnlyOnExisting, eInfluence state, double value) {
  318. this.SetFamilyInfluence(family, "player", OnlyOnExisting, state, value);
  319. }
  320. private void SetFamilyInfluence(FamilyInfo family, string Type, bool OnlyOnExisting, eInfluence state, double value) {
  321. for (int i = 0, c = family.actorID.Count; i < c; i++) {
  322. int actorTypeId = this.saveData.VailWorldSim.Actors[family.actorID[i]].TypeId;
  323. // Ignore Virginia and Kelvin
  324. if (actorTypeId == 9 && actorTypeId == 10)
  325. continue;
  326. bool bFound = false;
  327. int uniqueID = this.saveData.VailWorldSim.Actors[family.actorID[i]].UniqueId;
  328. if (Type.ToLower() == "player") {
  329. if (state.HasFlag(eInfluence.Anger))
  330. this.saveData.VailWorldSim.Actors[family.actorID[i]].Stats.Anger = value;
  331. if (state.HasFlag(eInfluence.Fear))
  332. this.saveData.VailWorldSim.Actors[family.actorID[i]].Stats.Fear = value;
  333. if (state.HasFlag(eInfluence.Sentiment))
  334. this.saveData.VailWorldSim.Actors[family.actorID[i]].Stats.Affection = value;
  335. }
  336. for (int j = 0, c2 = this.saveData.VailWorldSim.InfluenceMemory.Count; j < c2; j++) {
  337. if (this.saveData.VailWorldSim.InfluenceMemory[j].UniqueId == uniqueID) {
  338. for (int k = 0, c3 = this.saveData.VailWorldSim.InfluenceMemory[j].Influences.Count; k < c3; k++)
  339. if (this.saveData.VailWorldSim.InfluenceMemory[j].Influences[k].TypeId.ToLower() == Type.ToLower()) {
  340. if (state.HasFlag(eInfluence.Anger))
  341. this.saveData.VailWorldSim.InfluenceMemory[j].Influences[k].Anger = value;
  342. else if (state.HasFlag(eInfluence.Fear))
  343. this.saveData.VailWorldSim.InfluenceMemory[j].Influences[k].Fear = value;
  344. else if (state.HasFlag(eInfluence.Sentiment))
  345. this.saveData.VailWorldSim.InfluenceMemory[j].Influences[k].Sentiment = value;
  346. bFound = true;
  347. break;
  348. }
  349. }
  350. }
  351. if (bFound == false && OnlyOnExisting == false) {
  352. Influence inf = new Influence() {
  353. TypeId = "Player",
  354. Anger = (state.HasFlag(eInfluence.Anger) ? value : 0.0d),
  355. Fear = (state.HasFlag(eInfluence.Fear) ? value : 0.0d),
  356. Sentiment = (state.HasFlag(eInfluence.Sentiment) ? value : 0.0d)
  357. };
  358. this.saveData.VailWorldSim.InfluenceMemory.Add(
  359. new InfluenceMemoryList() {
  360. UniqueId = uniqueID,
  361. Influences = new List<Influence>() { inf }
  362. }
  363. );
  364. family.AddInfluence(inf);
  365. }
  366. }
  367. }
  368. private void cmsFamilyInfluence_Click(object sender, EventArgs e) {
  369. System.Diagnostics.Debug.WriteLine("cmsFamilyInfluence_Click(\"" + sender.ToString() + "\")");
  370. if (this.tvFamily.SelectedNode != null && this.tvFamily.SelectedNode.Tag.GetType() == typeof(FamilyInfo)) {
  371. System.Diagnostics.Debug.WriteLine(" - Get Family");
  372. FamilyInfo family = (FamilyInfo)this.tvFamily.SelectedNode.Tag;
  373. if (sender == this.cmsFamilyInfluence_AngerLow)
  374. this.SetFamilyInfluence(family, bFamily_InfluenceOnlyOnExisting, eInfluence.Anger, -100.0);
  375. else if (sender == this.cmsFamilyInfluence_AngerNeutral)
  376. this.SetFamilyInfluence(family, bFamily_InfluenceOnlyOnExisting, eInfluence.Anger, 0.0);
  377. else if (sender == this.cmsFamilyInfluence_AngerHigh)
  378. this.SetFamilyInfluence(family, bFamily_InfluenceOnlyOnExisting, eInfluence.Anger, 100.0);
  379. else if (sender == this.cmsFamilyInfluence_FearLow)
  380. this.SetFamilyInfluence(family, bFamily_InfluenceOnlyOnExisting, eInfluence.Fear, -100.0);
  381. else if (sender == this.cmsFamilyInfluence_FearNeutral)
  382. this.SetFamilyInfluence(family, bFamily_InfluenceOnlyOnExisting, eInfluence.Fear, 0.0);
  383. else if (sender == this.cmsFamilyInfluence_FearHigh)
  384. this.SetFamilyInfluence(family, bFamily_InfluenceOnlyOnExisting, eInfluence.Fear, 100.0);
  385. else if (sender == this.cmsFamilyInfluence_SentimentLow)
  386. this.SetFamilyInfluence(family, bFamily_InfluenceOnlyOnExisting, eInfluence.Sentiment, -100.0);
  387. else if (sender == this.cmsFamilyInfluence_SentimentNeutral)
  388. this.SetFamilyInfluence(family, bFamily_InfluenceOnlyOnExisting, eInfluence.Sentiment, 0.0);
  389. else if (sender == this.cmsFamilyInfluence_SentimentHigh)
  390. this.SetFamilyInfluence(family, bFamily_InfluenceOnlyOnExisting, eInfluence.Sentiment, 100.0);
  391. else
  392. System.Diagnostics.Debug.WriteLine(" - Sender not found");
  393. this.ShowFamilyInfo(family);
  394. } else {
  395. System.Diagnostics.Debug.WriteLine(" - notFound: " + (this.tvFamily.SelectedNode == null ? "null" : this.tvFamily.SelectedNode.Text));
  396. }
  397. }
  398. private void RemoveInfluence(FamilyInfo family) {
  399. this.RemoveInfluence(family, "player");
  400. }
  401. private void RemoveInfluence(FamilyInfo family, string Type) {
  402. for (int i = 0, c = family.actorID.Count; i < c; i++) {
  403. bool bFound = false;
  404. int uniqueID = this.saveData.VailWorldSim.Actors[family.actorID[i]].UniqueId;
  405. for (int j = this.saveData.VailWorldSim.InfluenceMemory.Count - 1; j >= 0; j--) {
  406. if (this.saveData.VailWorldSim.InfluenceMemory[j].UniqueId == uniqueID) {
  407. for (int k = this.saveData.VailWorldSim.InfluenceMemory[j].Influences.Count - 1; k >= 0; k--)
  408. if (this.saveData.VailWorldSim.InfluenceMemory[j].Influences[k].TypeId.ToLower() == Type.ToLower()) {
  409. this.saveData.VailWorldSim.InfluenceMemory[j].Influences.RemoveAt(k);
  410. if (this.saveData.VailWorldSim.InfluenceMemory[j].Influences.Count == 0) {
  411. this.saveData.VailWorldSim.InfluenceMemory.RemoveAt(j);
  412. }
  413. }
  414. }
  415. }
  416. }
  417. this.ShowFamilyInfo(family);
  418. }
  419. private void cmdFamily_Influences_Click(object sender, EventArgs e) {
  420. this.bFamily_InfluenceOnlyOnExisting = sender == this.cmdFamily_InfluencesExisting;
  421. Button cmd = (Button)sender;
  422. this.cmsFamilyInfluence.Show(cmd, 0, cmd.Height);
  423. }
  424. private void cmdFamily_InfluencesRemove_Click(object sender, EventArgs e) {
  425. if (this.tvFamily.SelectedNode != null && this.tvFamily.SelectedNode.Tag.GetType() == typeof(FamilyInfo)) {
  426. FamilyInfo family = (FamilyInfo)this.tvFamily.SelectedNode.Tag;
  427. this.RemoveInfluence(family);
  428. }
  429. }
  430. }
  431. }