Give a sensible error instead of spawning inaccessible filepickers when Fullscreen.
This commit is contained in:
@@ -13,6 +13,7 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using OpenRA.FileFormats;
|
using OpenRA.FileFormats;
|
||||||
|
using OpenRA.FileFormats.Graphics;
|
||||||
using OpenRA.Widgets;
|
using OpenRA.Widgets;
|
||||||
|
|
||||||
namespace OpenRA.Mods.Cnc.Widgets
|
namespace OpenRA.Mods.Cnc.Widgets
|
||||||
@@ -47,6 +48,13 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
|
|
||||||
void PromptForCD()
|
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);
|
progressBar.SetIndeterminate(true);
|
||||||
Game.Utilities.PromptFilepathAsync("Select CONQUER.MIX on the C&C CD", path => Game.RunAfterTick(() => Install(path)));
|
Game.Utilities.PromptFilepathAsync("Select CONQUER.MIX on the C&C CD", path => Game.RunAfterTick(() => Install(path)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using OpenRA.FileFormats;
|
using OpenRA.FileFormats;
|
||||||
|
using OpenRA.FileFormats.Graphics;
|
||||||
using OpenRA.GameRules;
|
using OpenRA.GameRules;
|
||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
@@ -214,6 +215,13 @@ namespace OpenRA.Mods.Cnc.Widgets
|
|||||||
|
|
||||||
void PromptForCD()
|
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);
|
progressBar.SetIndeterminate(true);
|
||||||
statusLabel.GetText = () => "Waiting for file";
|
statusLabel.GetText = () => "Waiting for file";
|
||||||
Game.Utilities.PromptFilepathAsync("Select SCORES.MIX on the C&C CD", path => Install(path));
|
Game.Utilities.PromptFilepathAsync("Select SCORES.MIX on the C&C CD", path => Install(path));
|
||||||
|
|||||||
Reference in New Issue
Block a user