Give a sensible error instead of spawning inaccessible filepickers when Fullscreen.

This commit is contained in:
Paul Chote
2011-05-21 17:53:58 +12:00
parent cb53bcd17d
commit 74d068423b
2 changed files with 16 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ using System.IO;
using System.Linq;
using System.Threading;
using OpenRA.FileFormats;
using OpenRA.FileFormats.Graphics;
using OpenRA.Widgets;
namespace OpenRA.Mods.Cnc.Widgets
@@ -47,6 +48,13 @@ namespace OpenRA.Mods.Cnc.Widgets
void PromptForCD()
{
if (Game.Settings.Graphics.Mode == WindowMode.Fullscreen)
{
statusLabel.GetText = () => "Error: Installing from Fullscreen mode is not supported";
panel.GetWidget("BACK_BUTTON").IsVisible = () => true;
return;
}
progressBar.SetIndeterminate(true);
Game.Utilities.PromptFilepathAsync("Select CONQUER.MIX on the C&C CD", path => Game.RunAfterTick(() => Install(path)));
}

View File

@@ -13,6 +13,7 @@ using System.IO;
using System.Linq;
using System.Threading;
using OpenRA.FileFormats;
using OpenRA.FileFormats.Graphics;
using OpenRA.GameRules;
using OpenRA.Graphics;
using OpenRA.Traits;
@@ -214,6 +215,13 @@ namespace OpenRA.Mods.Cnc.Widgets
void PromptForCD()
{
if (Game.Settings.Graphics.Mode == WindowMode.Fullscreen)
{
statusLabel.GetText = () => "Error: Installing from Fullscreen mode is not supported";
panel.GetWidget("BACK_BUTTON").IsVisible = () => true;
return;
}
progressBar.SetIndeterminate(true);
statusLabel.GetText = () => "Waiting for file";
Game.Utilities.PromptFilepathAsync("Select SCORES.MIX on the C&C CD", path => Install(path));