unmount all to avoid write permission problems
fight the new caching mechanism and M$ WindowsTM file systems
This commit is contained in:
@@ -39,6 +39,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool previousShowShellSetting;
|
||||||
void LoadInstallMusicContainer()
|
void LoadInstallMusicContainer()
|
||||||
{
|
{
|
||||||
var installMusicContainer = Ui.OpenWindow("INSTALL_MUSIC_PANEL", new WidgetArgs());
|
var installMusicContainer = Ui.OpenWindow("INSTALL_MUSIC_PANEL", new WidgetArgs());
|
||||||
@@ -52,6 +53,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
var musicPlayerLogic = (MusicPlayerLogic)installButton.Parent.LogicObject;
|
var musicPlayerLogic = (MusicPlayerLogic)installButton.Parent.LogicObject;
|
||||||
musicPlayerLogic.BuildMusicTable();
|
musicPlayerLogic.BuildMusicTable();
|
||||||
Ui.CloseWindow();
|
Ui.CloseWindow();
|
||||||
|
Game.Settings.Game.ShowShellmap = previousShowShellSetting;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -61,14 +63,26 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
|
|
||||||
var cancelButton = installMusicContainer.GetOrNull<ButtonWidget>("CANCEL_BUTTON");
|
var cancelButton = installMusicContainer.GetOrNull<ButtonWidget>("CANCEL_BUTTON");
|
||||||
if (cancelButton != null)
|
if (cancelButton != null)
|
||||||
cancelButton.OnClick = () => Ui.CloseWindow();
|
{
|
||||||
|
cancelButton.OnClick = () =>
|
||||||
|
{
|
||||||
|
Game.Settings.Game.ShowShellmap = previousShowShellSetting;
|
||||||
|
Ui.CloseWindow();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
var copyFromDiscButton = installMusicContainer.GetOrNull<ButtonWidget>("COPY_FROM_CD_BUTTON");
|
var copyFromDiscButton = installMusicContainer.GetOrNull<ButtonWidget>("COPY_FROM_CD_BUTTON");
|
||||||
if (copyFromDiscButton != null)
|
if (copyFromDiscButton != null)
|
||||||
{
|
{
|
||||||
copyFromDiscButton.OnClick = () => Ui.OpenWindow("INSTALL_FROMCD_PANEL", new WidgetArgs() {
|
copyFromDiscButton.OnClick = () =>
|
||||||
|
{
|
||||||
|
previousShowShellSetting = Game.Settings.Game.ShowShellmap;
|
||||||
|
Game.Settings.Game.ShowShellmap = false;
|
||||||
|
GlobalFileSystem.UnmountAll();
|
||||||
|
Ui.OpenWindow("INSTALL_FROMCD_PANEL", new WidgetArgs() {
|
||||||
{ "continueLoading", after },
|
{ "continueLoading", after },
|
||||||
});
|
});
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
var downloadButton = installMusicContainer.GetOrNull<ButtonWidget>("DOWNLOAD_BUTTON");
|
var downloadButton = installMusicContainer.GetOrNull<ButtonWidget>("DOWNLOAD_BUTTON");
|
||||||
@@ -78,10 +92,16 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
var musicInstallData = new Dictionary<string, string> { };
|
var musicInstallData = new Dictionary<string, string> { };
|
||||||
musicInstallData["PackageMirrorList"] = installData["MusicPackageMirrorList"];
|
musicInstallData["PackageMirrorList"] = installData["MusicPackageMirrorList"];
|
||||||
|
|
||||||
downloadButton.OnClick = () => Ui.OpenWindow("INSTALL_DOWNLOAD_PANEL", new WidgetArgs() {
|
downloadButton.OnClick = () =>
|
||||||
|
{
|
||||||
|
previousShowShellSetting = Game.Settings.Game.ShowShellmap;
|
||||||
|
Game.Settings.Game.ShowShellmap = false;
|
||||||
|
GlobalFileSystem.UnmountAll();
|
||||||
|
Ui.OpenWindow("INSTALL_DOWNLOAD_PANEL", new WidgetArgs() {
|
||||||
{ "afterInstall", after },
|
{ "afterInstall", after },
|
||||||
{ "installData", new ReadOnlyDictionary<string, string>(musicInstallData) },
|
{ "installData", new ReadOnlyDictionary<string, string>(musicInstallData) },
|
||||||
});
|
});
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user