Skip to content

Commit

Permalink
Remove MainMenuDarkeningPanel
Browse files Browse the repository at this point in the history
  • Loading branch information
SadPencil committed Feb 21, 2024
1 parent b96ef8e commit e71a36e
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 214 deletions.
9 changes: 8 additions & 1 deletion DXMainClient/DXGUI/GameClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,14 @@ private IServiceProvider BuildServiceProvider(WindowManager windowManager)
.AddSingletonXnaControl<MainMenu>()
.AddSingletonXnaControl<MapPreviewBox>()
.AddSingletonXnaControl<GameLaunchButton>()
.AddSingletonXnaControl<PlayerExtraOptionsPanel>();
.AddSingletonXnaControl<PlayerExtraOptionsPanel>()
.AddSingletonXnaControl<CampaignSelector>()
.AddSingletonXnaControl<GameLoadingWindow>()
.AddSingletonXnaControl<StatisticsWindow>()
.AddSingletonXnaControl<UpdateQueryWindow>()
.AddSingletonXnaControl<ManualUpdateQueryWindow>()
.AddSingletonXnaControl<UpdateWindow>()
.AddSingletonXnaControl<ExtrasWindow>();
// transient xna controls - new instance on each request
services
Expand Down
4 changes: 2 additions & 2 deletions DXMainClient/DXGUI/Generic/CampaignSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ private void LbCampaignList_SelectedIndexChanged(object sender, EventArgs e)

private void BtnCancel_LeftClick(object sender, EventArgs e)
{
Enabled = false;
Disable();
}

private void BtnLaunch_LeftClick(object sender, EventArgs e)
Expand Down Expand Up @@ -317,7 +317,7 @@ private void LaunchMission(Mission mission)
UserINISettings.Instance.Difficulty.Value = trbDifficultySelector.Value;
UserINISettings.Instance.SaveSettings();

((MainMenuDarkeningPanel)Parent).Hide();
Disable();

discordHandler.UpdatePresence(mission.UntranslatedGUIName, difficultyName, mission.IconPath, true);
GameProcessLogic.GameProcessExited += GameProcessExited_Callback;
Expand Down
14 changes: 8 additions & 6 deletions DXMainClient/DXGUI/Generic/ExtrasWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ namespace DTAClient.DXGUI.Generic
{
public class ExtrasWindow : XNAWindow
{
public ExtrasWindow(WindowManager windowManager) : base(windowManager)
{
private StatisticsWindow statisticsWindow;

public ExtrasWindow(WindowManager windowManager, StatisticsWindow statisticsWindow) : base(windowManager)
{
this.statisticsWindow = statisticsWindow;
}

public override void Initialize()
Expand Down Expand Up @@ -59,8 +61,8 @@ public override void Initialize()

private void BtnExStatistics_LeftClick(object sender, EventArgs e)
{
MainMenuDarkeningPanel parent = (MainMenuDarkeningPanel)Parent;
parent.Show(parent.StatisticsWindow);
Disable();
statisticsWindow.Enable();
}

private void BtnExMapEditor_LeftClick(object sender, EventArgs e)
Expand All @@ -75,7 +77,7 @@ private void BtnExMapEditor_LeftClick(object sender, EventArgs e)

mapEditorProcess.Start();

Enabled = false;
Disable();
}

private void BtnExCredits_LeftClick(object sender, EventArgs e)
Expand All @@ -85,7 +87,7 @@ private void BtnExCredits_LeftClick(object sender, EventArgs e)

private void BtnExCancel_LeftClick(object sender, EventArgs e)
{
Enabled = false;
Disable();
}
}
}
4 changes: 2 additions & 2 deletions DXMainClient/DXGUI/Generic/GameLoadingWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private void ListBox_SelectedIndexChanged(object sender, EventArgs e)

private void BtnCancel_LeftClick(object sender, EventArgs e)
{
Enabled = false;
Disable();
}

private void BtnLaunch_LeftClick(object sender, EventArgs e)
Expand Down Expand Up @@ -136,7 +136,7 @@ private void BtnLaunch_LeftClick(object sender, EventArgs e)

discordHandler.UpdatePresence(sg.GUIName, true);

Enabled = false;
Disable();
GameProcessLogic.GameProcessExited += GameProcessExited_Callback;

GameProcessLogic.StartGameProcess(WindowManager);
Expand Down
Loading

0 comments on commit e71a36e

Please sign in to comment.