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

Remove MainMenuDarkeningPanel #511

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -77,7 +79,7 @@ private void BtnExMapEditor_LeftClick(object sender, EventArgs e)

mapEditorProcess.Start();

Enabled = false;
Disable();
}

private void BtnExCredits_LeftClick(object sender, EventArgs e)
Expand All @@ -87,7 +89,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
Loading