diff --git a/WinGreed/HUMAN_CROWD_Applause.wav b/WinGreed/HUMAN_CROWD_Applause.wav new file mode 100644 index 0000000..5e1af4b Binary files /dev/null and b/WinGreed/HUMAN_CROWD_Applause.wav differ diff --git a/WinGreed/WinGreed.csproj b/WinGreed/WinGreed.csproj index 13ee123..c440f3c 100644 --- a/WinGreed/WinGreed.csproj +++ b/WinGreed/WinGreed.csproj @@ -23,4 +23,10 @@ + + + PreserveNewest + + + \ No newline at end of file diff --git a/WinGreed/frmPersonRound.Designer.cs b/WinGreed/frmPersonRound.Designer.cs index f2dee80..6300d0e 100644 --- a/WinGreed/frmPersonRound.Designer.cs +++ b/WinGreed/frmPersonRound.Designer.cs @@ -261,6 +261,7 @@ this.Name = "frmPersonRound"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Din tur -"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmPersonRound_FormClosing); this.Shown += new System.EventHandler(this.frmPersonRound_Shown); this.ResumeLayout(false); this.PerformLayout(); diff --git a/WinGreed/frmPersonRound.cs b/WinGreed/frmPersonRound.cs index 7f624c7..87514b9 100644 --- a/WinGreed/frmPersonRound.cs +++ b/WinGreed/frmPersonRound.cs @@ -195,7 +195,7 @@ namespace WinGreed actTxtBox.Refresh(); tempChsn += outPut.NumSum; txtChosenPoints.Text = tempChsn.ToString(); - AddedPoints = tempChsn; + if (((TextBox)this.Controls.Find($"txtMaxValue{row}", true).FirstOrDefault()).Text == actTxtBox.Text && int.Parse(actTxtBox.Text.Trim()) > 0 && _ht.Dices.Count(x => x.Chosen == true) == _ht.Dices.Count) @@ -413,5 +413,13 @@ namespace WinGreed txtTotalPoints.Text = TotPoints.ToString(); _ht.Score = TotPoints; } + + private void frmPersonRound_FormClosing(object sender, FormClosingEventArgs e) + { + if (int.Parse( txtChosenPoints.Text.Trim() )>0) + { + AddedPoints = tempChsn; + } + } } } diff --git a/WinGreed/frmPersonRound.resx b/WinGreed/frmPersonRound.resx index af9b7e7..08166bc 100644 --- a/WinGreed/frmPersonRound.resx +++ b/WinGreed/frmPersonRound.resx @@ -65,7 +65,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAEZTeXN0ZW0uV2luZG93cy5Gb3JtcywgQ3VsdHVyZT1uZXV0cmFs LCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAmU3lzdGVtLldpbmRvd3MuRm9ybXMu SW1hZ2VMaXN0U3RyZWFtZXIBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAnhUAAAJNU0Z0AUkBTAIBAQYB - AAFIAQABSAEAASABAAEgAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMAAYADAAFAAwABAQEAAQgG + AAFQAQABUAEAASABAAEgAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMAAYADAAFAAwABAQEAAQgG AAEgGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEAAfABygGmAQABMwUAATMB AAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQEAAYABfAH/AQACUAH/AQAB kwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/ATMDAAFmAwABmQMAAcwCAAEzAwAC diff --git a/WinGreed/frmStart.cs b/WinGreed/frmStart.cs index 4ecd29a..33af9d4 100644 --- a/WinGreed/frmStart.cs +++ b/WinGreed/frmStart.cs @@ -18,7 +18,8 @@ namespace WinGreed { if (lvMemberList.Items.Count > 0) { - var nextLvInstance = lvMemberList.Items[NextLvItem()]; + var plNr = NextLvItem(); + var nextLvInstance = lvMemberList.Items[plNr]; var nextPlayerName = nextLvInstance.Text; if (!GameOver || (GameOver && nextLvInstance != gocFirst.lvsave)) @@ -27,7 +28,10 @@ namespace WinGreed fPR.TotPoints = int.Parse(nextLvInstance.SubItems[2].Text); fPR.ShowDialog(); nextLvInstance.SubItems[2].Text = fPR.TotPoints.ToString(); - lstLogBox.Items.Add($"{nextPlayerName} -> {fPR.AddedPoints} poäng."); + if (fPR.TotPoints > 0 && fPR.AddedPoints>0) + { + lstLogBox.Items.Add($"{nextPlayerName} -> {fPR.AddedPoints} poäng."); + } } if (GameOver) @@ -66,6 +70,9 @@ namespace WinGreed gocFirst.lvsave = nextLvInstance; } } + plNr = actPlayerNo; + btnSpela.Text = $"Låt {lvMemberList.Items[NextLvItem()].Text} spela"; + actPlayerNo = plNr; } } @@ -98,6 +105,11 @@ namespace WinGreed txtNewName.Text = ""; txtNewName.Visible = false; btnAddOk.Visible = false; + if (lvMemberList.Items.Count > 1) + { + btnSpela.Enabled = true; + btnSpela.Text = $"Låt {lvMemberList.Items[0].Text} spela"; + } } private void txtNewName_TextChanged(object sender, EventArgs e) @@ -115,7 +127,7 @@ namespace WinGreed private void PlaySomething() { var soundPlayer = new SoundPlayer(); - soundPlayer.SoundLocation = @"C:\Users\tommy\Downloads\smartsound_HUMAN_CROWD_Applause_Short.wav"; + soundPlayer.SoundLocation = @".\HUMAN_CROWD_Applause.wav"; soundPlayer.Play(); }