forked from Agorath/ChummerGenSR4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmLifestyleNuyen.cs
105 lines (95 loc) · 2.33 KB
/
frmLifestyleNuyen.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
using System;
using System.Windows.Forms;
namespace Chummer
{
public partial class frmLifestyleNuyen : Form
{
private int _intDice = 0;
private int _intExtra = 0;
private int _intMultiplier = 0;
#region Control Events
public frmLifestyleNuyen()
{
InitializeComponent();
LanguageManager.Instance.Load(GlobalOptions.Instance.Language, this);
MoveControls();
}
private void cmdOK_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
private void frmLifestyleNuyen_Load(object sender, EventArgs e)
{
lblDice.Text = LanguageManager.Instance.GetString("Label_LifestyleNuyen_ResultOf") + " " + _intDice.ToString() + "D6: (";
nudDiceResult.Maximum = _intDice * 6;
nudDiceResult.Minimum = _intDice;
lblResult.Text = " + " + _intExtra.ToString() + ") x " + _intMultiplier.ToString() + " = " + string.Format("{0:###,###,##0¥}", (nudDiceResult.Value + _intExtra) * _intMultiplier);
MoveControls();
}
private void nudDiceResult_ValueChanged(object sender, EventArgs e)
{
lblResult.Text = " + " + _intExtra.ToString() + ") x " + _intMultiplier.ToString() + " = " + string.Format("{0:###,###,##0¥}", (nudDiceResult.Value + _intExtra) * _intMultiplier);
}
#endregion
#region Properties
/// <summary>
/// Number of dice that are rolled for the lifestyle.
/// </summary>
public int Dice
{
get{
return _intDice;
}
set
{
_intDice = value;
}
}
/// <summary>
/// Extra number that is added to the dice roll.
/// </summary>
public int Extra
{
get
{
return _intExtra;
}
set
{
_intExtra = value;
}
}
/// <summary>
/// D6 multiplier for the Lifestyle.
/// </summary>
public int Multiplier
{
get
{
return _intMultiplier;
}
set
{
_intMultiplier = value;
}
}
/// <summary>
/// The total amount of Nuyen resulting from the dice roll.
/// </summary>
public int StartingNuyen
{
get
{
return Convert.ToInt32((nudDiceResult.Value + _intExtra) * _intMultiplier);
}
}
#endregion
#region Methods
private void MoveControls()
{
nudDiceResult.Left = lblDice.Left + lblDice.Width + 6;
lblResult.Left = nudDiceResult.Left + nudDiceResult.Width + 6;
}
#endregion
}
}