From 74d068423bff6f48064ea53e095f0a8ff57f8dac Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 21 May 2011 17:53:58 +1200 Subject: [PATCH] Give a sensible error instead of spawning inaccessible filepickers when Fullscreen. --- OpenRA.Mods.Cnc/Widgets/CncInstallFromCDLogic.cs | 8 ++++++++ OpenRA.Mods.Cnc/Widgets/CncMusicPlayerLogic.cs | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/OpenRA.Mods.Cnc/Widgets/CncInstallFromCDLogic.cs b/OpenRA.Mods.Cnc/Widgets/CncInstallFromCDLogic.cs index ae14b0a76f..b184439f37 100755 --- a/OpenRA.Mods.Cnc/Widgets/CncInstallFromCDLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/CncInstallFromCDLogic.cs @@ -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))); } diff --git a/OpenRA.Mods.Cnc/Widgets/CncMusicPlayerLogic.cs b/OpenRA.Mods.Cnc/Widgets/CncMusicPlayerLogic.cs index c25d9ede3a..349c23a627 100644 --- a/OpenRA.Mods.Cnc/Widgets/CncMusicPlayerLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/CncMusicPlayerLogic.cs @@ -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));