Skip to content

Commit 9871e08

Browse files
committed
Added demographics & wonders panels.
1 parent 63a8ef3 commit 9871e08

18 files changed

+187
-545
lines changed

appsettings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"Civ2Path": "D:\\DOS\\CIV 2\\Civ2\\"
2+
"Civ2Path": "C:\\Civ2\\"
33
}

civ2.csproj.user

+4-4
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@
8181
<Compile Update="src\Forms\Menu Game\GraphicOptionsPanel.cs">
8282
<SubType>Component</SubType>
8383
</Compile>
84-
<Compile Update="src\Forms\Menu World\_DemographicsForm.cs">
85-
<SubType>Form</SubType>
84+
<Compile Update="src\Forms\Menu World\DemographicsPanel.cs">
85+
<SubType>Component</SubType>
8686
</Compile>
87-
<Compile Update="src\Forms\Menu World\_WondersOfWorldForm.cs">
88-
<SubType>Form</SubType>
87+
<Compile Update="src\Forms\Menu World\WondersOfWorldPanel.cs">
88+
<SubType>Component</SubType>
8989
</Compile>
9090
<Compile Update="src\Forms\_MinimapPanel.cs">
9191
<SubType>Component</SubType>

src/Forms/Main.cs

+10-6
Original file line numberDiff line numberDiff line change
@@ -504,19 +504,23 @@ private void CasualtyTimeline_Click(object sender, EventArgs e) { }
504504
#region WORLD MENU EVENTS
505505
private void WondersOfWorld_Click(object sender, EventArgs e)
506506
{
507-
//WondersOfWorldForm WondersOfWorldForm = new WondersOfWorldForm();
508-
//WondersOfWorldForm.Load += new EventHandler(AdvisorsForm_Load); //so you set the correct size of form
509-
//WondersOfWorldForm.ShowDialog();
507+
WondersOfWorldPanel WondersOfWorldPanel = new WondersOfWorldPanel(this, 622, 421);
508+
Controls.Add(WondersOfWorldPanel);
509+
WondersOfWorldPanel.Location = new Point(this.ClientSize.Width / 2 - WondersOfWorldPanel.Size.Width / 2, this.ClientSize.Height / 2 - WondersOfWorldPanel.Size.Height / 2);
510+
WondersOfWorldPanel.Show();
511+
WondersOfWorldPanel.BringToFront();
510512
}
511513

512514
private void Top5Cities_Click(object sender, EventArgs e) { }
513515
private void CivScore_Click(object sender, EventArgs e) { }
514516

515517
private void Demographics_Click(object sender, EventArgs e)
516518
{
517-
//DemographicsForm DemographicsForm = new DemographicsForm();
518-
//DemographicsForm.Load += new EventHandler(AdvisorsForm_Load); //so you set the correct size of form
519-
//DemographicsForm.ShowDialog();
519+
DemographicsPanel DemographicsPanel = new DemographicsPanel(this, 622, 421);
520+
Controls.Add(DemographicsPanel);
521+
DemographicsPanel.Location = new Point(this.ClientSize.Width / 2 - DemographicsPanel.Size.Width / 2, this.ClientSize.Height / 2 - DemographicsPanel.Size.Height / 2);
522+
DemographicsPanel.Show();
523+
DemographicsPanel.BringToFront();
520524
}
521525
private void Spaceships_Click(object sender, EventArgs e) { }
522526
#endregion

src/Forms/Menu Advisors/AttitudeAdvisorPanel.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ public partial class AttitudeAdvisorPanel : Civ2panel
1111
Game Game => Game.Instance;
1212

1313
private readonly Main Main;
14-
private readonly Button _closeButton;
1514
private readonly VScrollBar _verticalBar;
1615
private int _barValue; // Starting value of view of horizontal bar
1716

@@ -25,7 +24,7 @@ public AttitudeAdvisorPanel(Main parent, int _width, int _height) : base(_width,
2524
DrawPanel.Paint += DrawPanel_Paint;
2625

2726
// Close button
28-
_closeButton = new Civ2button
27+
Civ2button _closeButton = new Civ2button
2928
{
3029
Location = new Point(2, 373),
3130
Size = new Size(596, 24),

src/Forms/Menu Advisors/CityStatusPanel.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ public partial class CityStatusPanel : Civ2panel
1313

1414
private readonly Main Main;
1515
private readonly VScrollBar _verticalBar;
16-
private readonly Civ2button _closeButton;
1716
private int _barValue; // Starting value of view of horizontal bar
1817

1918
public CityStatusPanel(Main parent, int _width, int _height) : base(_width, _height, null, 11, 10)
@@ -26,7 +25,7 @@ public CityStatusPanel(Main parent, int _width, int _height) : base(_width, _hei
2625
DrawPanel.Paint += DrawPanel_Paint;
2726

2827
// Close button
29-
_closeButton = new Civ2button
28+
Civ2button _closeButton = new Civ2button
3029
{
3130
Location = new Point(2, 373),
3231
Size = new Size(596, 24),

src/Forms/Menu Advisors/DefenseMinisterPanel.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ public partial class DefenseMinisterPanel : Civ2panel
1313
Game Game => Game.Instance;
1414

1515
private readonly Main Main;
16+
private readonly Civ2button _casualtiesButton;
1617
private readonly VScrollBar _verticalBar;
17-
private readonly Civ2button _closeButton, _casualtiesButton;
1818
private readonly int[] _activeUnitCount, _unitInProductionCount;
1919
private bool _showStatistics; // true=statistics are shown, false=casualties are shown
2020
private int _barValue; // Starting value of view of horizontal bar
@@ -42,7 +42,7 @@ public DefenseMinisterPanel(Main parent, int _width, int _height) : base(_width,
4242
_casualtiesButton.Click += new EventHandler(CasualtiesButton_Click);
4343

4444
// Close button
45-
_closeButton = new Civ2button
45+
Civ2button _closeButton = new Civ2button
4646
{
4747
Location = new Point(301, 373),
4848
Size = new Size(297, 24),

src/Forms/Menu Advisors/ScienceAdvisorPanel.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ public partial class ScienceAdvisorPanel : Civ2panel
1313

1414
private readonly Main Main;
1515
private readonly HScrollBar _horizontalBar;
16-
private readonly Civ2button _closeButton, _goalButton;
1716
private readonly List<int> _discoveredAdvances;
1817
private readonly int _techsPerColumn;
1918
private int _barValue; // Starting value of view of horizontal bar
@@ -30,7 +29,7 @@ public ScienceAdvisorPanel(Main parent, int _width, int _height) : base(_width,
3029
_barValue = 0;
3130

3231
// Goal button
33-
_goalButton = new Civ2button
32+
Civ2button _goalButton = new Civ2button
3433
{
3534
Location = new Point(2, 373),
3635
Size = new Size(297, 24),
@@ -41,7 +40,7 @@ public ScienceAdvisorPanel(Main parent, int _width, int _height) : base(_width,
4140
_goalButton.Click += new EventHandler(GoalButton_Click);
4241

4342
// Close button
44-
_closeButton = new Civ2button
43+
Civ2button _closeButton = new Civ2button
4544
{
4645
Location = new Point(301, 373),
4746
Size = new Size(297, 24),

src/Forms/Menu Advisors/TradeAdvisorPanel.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ public partial class TradeAdvisorPanel : Civ2panel
1414

1515
private readonly Main Main;
1616
private readonly VScrollBar _verticalBar;
17-
private readonly Civ2button _closeButton, _supplyDemandButton;
1817
private readonly int _totalCost, _totalIncome, _totalScience, _discoveries;
1918
private readonly int[] _upkeepOfImprovements, _noOfImprovements; // In order according to RULES.TXT
2019
private int _barValue;
@@ -29,7 +28,7 @@ public TradeAdvisorPanel(Main parent, int _width, int _height) : base(_width, _h
2928
DrawPanel.Paint += DrawPanel_Paint;
3029

3130
// Casualties button
32-
_supplyDemandButton = new Civ2button
31+
Civ2button _supplyDemandButton = new Civ2button
3332
{
3433
Location = new Point(2, 373),
3534
Size = new Size(297, 24),
@@ -40,7 +39,7 @@ public TradeAdvisorPanel(Main parent, int _width, int _height) : base(_width, _h
4039
_supplyDemandButton.Click += new EventHandler(SupplyDemandButton_Click);
4140

4241
// Close button
43-
_closeButton = new Civ2button
42+
Civ2button _closeButton = new Civ2button
4443
{
4544
Location = new Point(301, 373),
4645
Size = new Size(297, 24),

src/Forms/Menu Game/CityreportOptionsPanel.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ public partial class CityreportOptionsPanel : Civ2panel
1010
Game Game => Game.Instance;
1111

1212
private readonly Main Main;
13-
private readonly Civ2button _OKButton, _cancelButton;
1413
private readonly List<DoubleBufferedPanel> _clickPanels;
1514
private readonly string[] _textOptions;
1615
private readonly bool[] _choiceOptions;
@@ -24,7 +23,7 @@ public CityreportOptionsPanel(Main parent, int _width, int _height) : base(_widt
2423
DrawPanel.Paint += DrawPanel_Paint;
2524

2625
// OK button
27-
_OKButton = new Civ2button
26+
Civ2button _OKButton = new Civ2button
2827
{
2928
Location = new Point(9, 398),
3029
Size = new Size(363, 36),
@@ -35,7 +34,7 @@ public CityreportOptionsPanel(Main parent, int _width, int _height) : base(_widt
3534
_OKButton.Click += new EventHandler(OKButton_Click);
3635

3736
// Cancel button
38-
_cancelButton = new Civ2button
37+
Civ2button _cancelButton = new Civ2button
3938
{
4039
Location = new Point(374, 398),
4140
Size = new Size(363, 36),

src/Forms/Menu Game/GameOptionsPanel.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ public partial class GameOptionsPanel : Civ2panel
1010
Game Game => Game.Instance;
1111

1212
private readonly Main Main;
13-
private readonly Civ2button _OKButton, _cancelButton;
1413
private readonly List<DoubleBufferedPanel> _clickPanels;
1514
private readonly string[] _textOptions;
1615
private readonly bool[] _choiceOptions;
@@ -24,7 +23,7 @@ public GameOptionsPanel(Main parent, int _width, int _height) : base(_width, _he
2423
DrawPanel.Paint += DrawPanel_Paint;
2524

2625
// OK button
27-
_OKButton = new Civ2button
26+
Civ2button _OKButton = new Civ2button
2827
{
2928
Location = new Point(9, 398),
3029
Size = new Size(363, 36),
@@ -35,7 +34,7 @@ public GameOptionsPanel(Main parent, int _width, int _height) : base(_width, _he
3534
_OKButton.Click += new EventHandler(OKButton_Click);
3635

3736
// Cancel button
38-
_cancelButton = new Civ2button
37+
Civ2button _cancelButton = new Civ2button
3938
{
4039
Location = new Point(374, 398),
4140
Size = new Size(363, 36),

src/Forms/Menu Game/GraphicOptionsPanel.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ public partial class GraphicOptionsPanel : Civ2panel
1010
Game Game => Game.Instance;
1111

1212
private readonly Main Main;
13-
private readonly Civ2button _OKButton, _cancelButton;
1413
private readonly List<DoubleBufferedPanel> _clickPanels;
1514
private readonly string[] _textOptions;
1615
private readonly bool[] _choiceOptions;
@@ -24,7 +23,7 @@ public GraphicOptionsPanel(Main parent, int _width, int _height) : base(_width,
2423
DrawPanel.Paint += DrawPanel_Paint;
2524

2625
// OK button
27-
_OKButton = new Civ2button
26+
Civ2button _OKButton = new Civ2button
2827
{
2928
Location = new Point(9, 238),
3029
Size = new Size(363, 36),
@@ -35,7 +34,7 @@ public GraphicOptionsPanel(Main parent, int _width, int _height) : base(_width,
3534
_OKButton.Click += new EventHandler(OKButton_Click);
3635

3736
// Cancel button
38-
_cancelButton = new Civ2button
37+
Civ2button _cancelButton = new Civ2button
3938
{
4039
Location = new Point(374, 238),
4140
Size = new Size(363, 36),

0 commit comments

Comments
 (0)