forked from Agorath/ChummerGenSR4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmDiceHits.cs
91 lines (82 loc) · 1.62 KB
/
frmDiceHits.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
using System;
using System.Windows.Forms;
namespace Chummer
{
public partial class frmDiceHits : Form
{
private int _intDice = 0;
#region Control Events
public frmDiceHits()
{
InitializeComponent();
LanguageManager.Instance.Load(GlobalOptions.Instance.Language, this);
MoveControls();
}
private void frmDiceHits_Load(object sender, EventArgs e)
{
lblDice.Text = LanguageManager.Instance.GetString("String_DiceHits_HitsOn") + " " + _intDice.ToString() + "D6: ";
nudDiceResult.Maximum = _intDice;
nudDiceResult.Minimum = 0;
lblResult.Text = "";
MoveControls();
}
private void cmdOK_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
#endregion
#region Properties
/// <summary>
/// Number of dice that are rolled for the lifestyle.
/// </summary>
public int Dice
{
get
{
return _intDice;
}
set
{
_intDice = value;
}
}
/// <summary>
/// Window title.
/// </summary>
public string Title
{
set
{
this.Text = value;
}
}
/// <summary>
/// Description text.
/// </summary>
public string Description
{
set
{
lblDescription.Text = value;
}
}
/// <summary>
/// Dice roll result.
/// </summary>
public int Result
{
get
{
return Convert.ToInt32(nudDiceResult.Value);
}
}
#endregion
#region Methods
private void MoveControls()
{
nudDiceResult.Left = lblDice.Left + lblDice.Width + 6;
lblResult.Left = nudDiceResult.Left + nudDiceResult.Width + 6;
}
#endregion
}
}