Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to change the seed without a dialog window #432

Closed
59 changes: 45 additions & 14 deletions src/TQVaultAE.GUI/CharacterEditDialog.Designer.cs

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

5 changes: 4 additions & 1 deletion src/TQVaultAE.GUI/CharacterEditDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private void UpdatePlayerInfo(bool mustResetAttributes = false)
playerInfo.MasteriesAllowed = 2;

playerInfo.CurrentXP = int.Parse(xpTextBox.Text);
playerInfo.Money = PlayerCollection.PlayerInfo.Money > 0 ? PlayerCollection.PlayerInfo.Money : 0;
playerInfo.Money = Math.Max(0, Math.Abs(int.Parse(moneyTextBox.Text)));
playerInfo.DifficultyUnlocked = difficultlyComboBox.SelectedIndex;
playerInfo.SkillPoints = Convert.ToInt32(skillPointsNumericUpDown.Value);

Expand Down Expand Up @@ -187,6 +187,7 @@ private void CharacterEditDlg_Load(object sender, EventArgs e)
IntelligenceLabel.Text = Resources.CEIntelligence;
healthLabel.Text = Resources.CEHealth;
manaLabel.Text = Resources.CEMana;
moneyLabel.Text = Resources.CEMoney;
levelLabel.Text = Resources.CELevel;
xpLabel.Text = Resources.CEXp;
attributeLabel.Text = Resources.CEAttributePoints;
Expand Down Expand Up @@ -254,6 +255,8 @@ private void CharacterEditDlg_Load(object sender, EventArgs e)
manacUpDown.Value = PlayerCollection.PlayerInfo.BaseMana;
manacUpDown.Tag = attrHMTag;

moneyTextBox.Text = PlayerCollection.PlayerInfo.Money.ToString();

if (PlayerCollection.PlayerInfo.CurrentLevel > Convert.ToInt32(levelNumericUpDown.Maximum))
levelNumericUpDown.Maximum = PlayerCollection.PlayerInfo.CurrentLevel;

Expand Down
15 changes: 15 additions & 0 deletions src/TQVaultAE.GUI/Components/SackPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,7 @@ protected virtual void MouseDownCallback(object sender, MouseEventArgs e)
if (Config.Settings.Default.AllowItemEdit)
{
this.contextMenu.Items.Add(Resources.SackPanelMenuSeed);
this.contextMenu.Items.Add(Resources.SackPanelMenuSeedForce);

// Add option to complete a charm or relic if
// not already completed.
Expand Down Expand Up @@ -2584,6 +2585,20 @@ private void ContextMenuItemClicked(object sender, ToolStripItemClickedEventArgs
this.InvalidateItemCacheItemTooltip(focusedItem);
}
}
else if (selectedMenuItem == Resources.SackPanelMenuSeedForce)
{
int origSeed = focusedItem.Seed;
focusedItem.Seed = Item.GenerateSeed();
focusedItem.IsModified = true;

// See if the seed was changed
if (focusedItem.Seed != origSeed)
{
// Tell the sack that it has been modified
this.Sack.IsModified = true;
this.InvalidateItemCacheItemTooltip(focusedItem);
}
}
else if (selectedMenuItem == Resources.SackPanelMenuCharm || selectedMenuItem == Resources.SackPanelMenuRelic)
{
focusedItem.Number = 10;
Expand Down
20 changes: 19 additions & 1 deletion src/TQVaultAE.Presentation/Resources.Designer.cs

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

3 changes: 3 additions & 0 deletions src/TQVaultAE.Presentation/Resources.de.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1081,4 +1081,7 @@ Hier ist ein komplexes Beispiel: 'arctic & frost @schwert $ episch | selten'
<data name="ItemEmbers" xml:space="preserve">
<value>Eternal Embers Gegenstand</value>
</data>
<data name="CEMoney" xml:space="preserve">
<value>Geld</value>
</data>
</root>
3 changes: 3 additions & 0 deletions src/TQVaultAE.Presentation/Resources.es.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1075,4 +1075,7 @@ He aquí un ejemplo complejo: 'glacial &amp; hielo @espada $raro'</value>
<data name="ItemEmbers" xml:space="preserve">
<value>Objeto de Eternal Embers</value>
</data>
<data name="CEMoney" xml:space="preserve">
<value>Dinero</value>
</data>
</root>
3 changes: 3 additions & 0 deletions src/TQVaultAE.Presentation/Resources.pl.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1077,4 +1077,7 @@ Oto złożony przykład: 'arktyczny &amp;mróz @miecz $pospolity | epicki'</valu
<data name="ItemEmbers" xml:space="preserve">
<value>Przedmiot z Eternal Embers</value>
</data>
<data name="CEMoney" xml:space="preserve">
<value>Pieniądze</value>
</data>
</root>
3 changes: 3 additions & 0 deletions src/TQVaultAE.Presentation/Resources.pt.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1544,4 +1544,7 @@ O personagem também não poderá equipar itens onde os requisitos não forem at
<data name="ItemEmbers" xml:space="preserve">
<value>Item de Eternal Embers</value>
</data>
<data name="CEMoney" xml:space="preserve">
<value>Dinheiro</value>
</data>
</root>
Loading