Skip to content

Commit

Permalink
10 tries = good/5 tries excellent result
Browse files Browse the repository at this point in the history
  • Loading branch information
DGrothe-PhD committed Dec 9, 2023
1 parent 2918967 commit deae03d
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/GameResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public GameResult(string name, short level, int numberOfRows)

InitializeComponent();
FormatDialog();
ShowResult();
StoreResult();
StartPosition = FormStartPosition.Manual;
if (GuessedRow.Caller != null)
Expand All @@ -39,24 +40,32 @@ private void FormatDialog()
pnlEmoji.BackgroundImageLayout = ImageLayout.Stretch;
pnlEmoji.Size = pnlEmoji.Size.Rescale(Parameter.resizePercentage);

lblResult.Text = name + Environment.NewLine + Resources.YouHaveWon;
lblResult.Location = new Point(
pnlEmoji.Width + 24 * Parameter.resizePercentage / 100,
lblResult.Location.Y
);
lblExtraInfo.Location = new Point(
pnlEmoji.Width + 24 * Parameter.resizePercentage / 100,
lblResult.Height + lblResult.Location.Y + 24 * Parameter.resizePercentage / 100
lblResult.Height + lblResult.Location.Y + 40 * Parameter.resizePercentage / 100
);

Size = new Size(Width, pnlEmoji.Size.Height + 28 * Parameter.resizePercentage/100);
Size = new Size(Width, pnlEmoji.Size.Height + 28 * Parameter.resizePercentage / 100);
}

private void ShowResult()
{
lblResult.Text = name + Environment.NewLine + Resources.YouHaveWon;
lblExtraInfo.Text = String.Format(Resources.TellNumberOfRows, numberOfRows);

lblExtraInfo.Text += numberOfRows switch
{
< 6 => Environment.NewLine + Resources.QuicklyGuessed,
< 11 => Environment.NewLine + Resources.QuiteGood,
_ => ""
};
lblExtraInfo.Font = lblExtraInfo.Font.Resize(Parameter.resizePercentage);
lblResult.Font = lblResult.Font.Resize(Parameter.resizePercentage);
}

private void StoreResult()
{
//Debug games are not stored.
Expand Down
27 changes: 27 additions & 0 deletions src/locales/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/locales/Resources.de-DE.resx
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ Lösung war:</value>
F4 = Zeige Statistik
F3 = Mit Tipps oder ohne</value>
</data>
<data name="QuicklyGuessed" xml:space="preserve">
<value>Exzellent!</value>
</data>
<data name="QuiteGood" xml:space="preserve">
<value>Gut!</value>
</data>
<data name="RunningGameMessageText" xml:space="preserve">
<value>Bitte beenden Sie zunächst das laufende Spiel.</value>
</data>
Expand All @@ -230,6 +236,9 @@ F3 = Mit Tipps oder ohne</value>
<data name="TellNumberOfRows" xml:space="preserve">
<value>Sie haben {0} Reihen gebraucht.</value>
</data>
<data name="TookLong" xml:space="preserve">
<value>tbd</value>
</data>
<data name="WordLengthLabelText" xml:space="preserve">
<value>Wortlänge</value>
</data>
Expand Down
9 changes: 9 additions & 0 deletions src/locales/Resources.en-GB.resx
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ Solution was:</value>
F4 = Open Statistics
F3 = Toggle Tips</value>
</data>
<data name="QuicklyGuessed" xml:space="preserve">
<value>Excellent!</value>
</data>
<data name="QuiteGood" xml:space="preserve">
<value>Good!</value>
</data>
<data name="RunningGameMessageText" xml:space="preserve">
<value>Please stop the running game first.</value>
</data>
Expand All @@ -230,6 +236,9 @@ F3 = Toggle Tips</value>
<data name="TellNumberOfRows" xml:space="preserve">
<value>It took you {0} rows to guess the word.</value>
</data>
<data name="TookLong" xml:space="preserve">
<value>tbd</value>
</data>
<data name="WordLengthLabelText" xml:space="preserve">
<value>Word length</value>
</data>
Expand Down
9 changes: 9 additions & 0 deletions src/locales/Resources.fr-FR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ La solution était:</value>
F4 = montrer les statistiques
F3 = Avec ou sans de conseils</value>
</data>
<data name="QuicklyGuessed" xml:space="preserve">
<value>Excellent!</value>
</data>
<data name="QuiteGood" xml:space="preserve">
<value>C'est assez bon!</value>
</data>
<data name="RunningGameMessageText" xml:space="preserve">
<value>Veuillez d'abord quitter le jeu en cours.</value>
</data>
Expand All @@ -230,6 +236,9 @@ F3 = Avec ou sans de conseils</value>
<data name="TellNumberOfRows" xml:space="preserve">
<value>Vous avez eu besoin de {0} lignes.</value>
</data>
<data name="TookLong" xml:space="preserve">
<value>tbd</value>
</data>
<data name="WordLengthLabelText" xml:space="preserve">
<value>Longueur des mots</value>
</data>
Expand Down
9 changes: 9 additions & 0 deletions src/locales/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ Solution was:</value>
F4 = Open Statistics
F3 = Toggle Tips</value>
</data>
<data name="QuicklyGuessed" xml:space="preserve">
<value>Excellent!</value>
</data>
<data name="QuiteGood" xml:space="preserve">
<value>Good!</value>
</data>
<data name="RunningGameMessageText" xml:space="preserve">
<value>Please stop the running game first.</value>
</data>
Expand All @@ -230,6 +236,9 @@ F3 = Toggle Tips</value>
<data name="TellNumberOfRows" xml:space="preserve">
<value>It took you {0} rows to guess the word.</value>
</data>
<data name="TookLong" xml:space="preserve">
<value>tbd</value>
</data>
<data name="WordLengthLabelText" xml:space="preserve">
<value>Word length</value>
</data>
Expand Down

0 comments on commit deae03d

Please sign in to comment.