mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-31 17:53:32 +00:00
Updated UT detection code
Updated UT plugin
This commit is contained in:
parent
7791b64a0f
commit
f1bf40cb12
@ -167,7 +167,8 @@ namespace Artemis.DAL
|
|||||||
var gifDir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Artemis\gifs";
|
var gifDir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Artemis\gifs";
|
||||||
Directory.CreateDirectory(gifDir);
|
Directory.CreateDirectory(gifDir);
|
||||||
var gifPath = gifDir + $"\\{fileName}.gif";
|
var gifPath = gifDir + $"\\{fileName}.gif";
|
||||||
gifFile.Save(gifPath);
|
if (!File.Exists(gifPath))
|
||||||
|
gifFile.Save(gifPath);
|
||||||
|
|
||||||
foreach (var profile in profiles)
|
foreach (var profile in profiles)
|
||||||
{
|
{
|
||||||
|
|||||||
Binary file not shown.
@ -47,7 +47,7 @@ namespace Artemis.Modules.Games.UnrealTournament
|
|||||||
var gameSettings = (UnrealTournamentSettings) Settings;
|
var gameSettings = (UnrealTournamentSettings) Settings;
|
||||||
// If already propertly set up, don't do anything
|
// If already propertly set up, don't do anything
|
||||||
if (gameSettings.GameDirectory != null &&
|
if (gameSettings.GameDirectory != null &&
|
||||||
File.Exists(gameSettings.GameDirectory + "UE4-Win64-Shipping.exe"))
|
File.Exists(gameSettings.GameDirectory + @"\Engine\Binaries\Win64\UE4-Win64-Shipping.exe"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Attempt to read the file
|
// Attempt to read the file
|
||||||
@ -65,7 +65,7 @@ namespace Artemis.Modules.Games.UnrealTournament
|
|||||||
// Use backslash in path for consistency
|
// Use backslash in path for consistency
|
||||||
utDir = utDir.Replace('/', '\\');
|
utDir = utDir.Replace('/', '\\');
|
||||||
|
|
||||||
if (!File.Exists(utDir + @"\UE4-Win64-Shipping.exe"))
|
if (!File.Exists(utDir + @"\Engine\Binaries\Win64\UE4-Win64-Shipping.exe"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gameSettings.GameDirectory = utDir;
|
gameSettings.GameDirectory = utDir;
|
||||||
@ -78,7 +78,7 @@ namespace Artemis.Modules.Games.UnrealTournament
|
|||||||
var gameSettings = (UnrealTournamentSettings) Settings;
|
var gameSettings = (UnrealTournamentSettings) Settings;
|
||||||
var path = gameSettings.GameDirectory;
|
var path = gameSettings.GameDirectory;
|
||||||
|
|
||||||
if (!File.Exists(path + @"\UE4-Win64-Shipping.exe"))
|
if (!File.Exists(path + @"\Engine\Binaries\Win64\UE4-Win64-Shipping.exe"))
|
||||||
{
|
{
|
||||||
_dialogService.ShowErrorMessageBox("Please select a valid Unreal Tournament directory\n\n" +
|
_dialogService.ShowErrorMessageBox("Please select a valid Unreal Tournament directory\n\n" +
|
||||||
@"By default Unreal Tournament is in C:\Program Files\Epic Games\UnrealTournament");
|
@"By default Unreal Tournament is in C:\Program Files\Epic Games\UnrealTournament");
|
||||||
|
|||||||
@ -1,52 +1,52 @@
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Artemis.DAL;
|
using Artemis.DAL;
|
||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Modules.Abstract;
|
using Artemis.Modules.Abstract;
|
||||||
using Artemis.Properties;
|
using Artemis.Properties;
|
||||||
using Ninject;
|
using Ninject;
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.UnrealTournament
|
namespace Artemis.Modules.Games.UnrealTournament
|
||||||
{
|
{
|
||||||
public sealed class UnrealTournamentViewModel : ModuleViewModel
|
public sealed class UnrealTournamentViewModel : ModuleViewModel
|
||||||
{
|
{
|
||||||
public UnrealTournamentViewModel(MainManager mainManager,
|
public UnrealTournamentViewModel(MainManager mainManager,
|
||||||
[Named(nameof(UnrealTournamentModel))] ModuleModel moduleModel, IKernel kernel)
|
[Named(nameof(UnrealTournamentModel))] ModuleModel moduleModel, IKernel kernel)
|
||||||
: base(mainManager, moduleModel, kernel)
|
: base(mainManager, moduleModel, kernel)
|
||||||
{
|
|
||||||
DisplayName = "Unreal Tournament";
|
|
||||||
InstallGif();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool UsesProfileEditor => true;
|
|
||||||
|
|
||||||
public void BrowseDirectory()
|
|
||||||
{
|
|
||||||
var dialog = new FolderBrowserDialog {SelectedPath = ((UnrealTournamentSettings) Settings).GameDirectory};
|
|
||||||
var result = dialog.ShowDialog();
|
|
||||||
if (result != DialogResult.OK)
|
|
||||||
return;
|
|
||||||
|
|
||||||
((UnrealTournamentSettings) Settings).GameDirectory = dialog.SelectedPath;
|
|
||||||
((UnrealTournamentModel) ModuleModel).PlaceFiles();
|
|
||||||
Settings.Save();
|
|
||||||
NotifyOfPropertyChange(() => Settings);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void PlaceFiles()
|
|
||||||
{
|
{
|
||||||
((UnrealTournamentModel)ModuleModel).PlaceFiles();
|
DisplayName = "Unreal Tournament";
|
||||||
Settings.Save();
|
InstallGif();
|
||||||
NotifyOfPropertyChange(() => Settings);
|
}
|
||||||
}
|
|
||||||
|
public override bool UsesProfileEditor => true;
|
||||||
// Installing GIF on editor open to make sure the proper profiles are loaded
|
|
||||||
private void InstallGif()
|
public void BrowseDirectory()
|
||||||
{
|
{
|
||||||
var gif = Resources.redeemer;
|
var dialog = new FolderBrowserDialog {SelectedPath = ((UnrealTournamentSettings) Settings).GameDirectory};
|
||||||
if (gif == null)
|
var result = dialog.ShowDialog();
|
||||||
return;
|
if (result != DialogResult.OK)
|
||||||
|
return;
|
||||||
ProfileProvider.InsertGif("UnrealTournament", "Default", "Redeemer GIF", gif, "redeemer");
|
|
||||||
}
|
((UnrealTournamentSettings) Settings).GameDirectory = dialog.SelectedPath;
|
||||||
}
|
((UnrealTournamentModel) ModuleModel).PlaceFiles();
|
||||||
|
Settings.Save();
|
||||||
|
NotifyOfPropertyChange(() => Settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void PlaceFiles()
|
||||||
|
{
|
||||||
|
((UnrealTournamentModel)ModuleModel).PlaceFiles();
|
||||||
|
Settings.Save();
|
||||||
|
NotifyOfPropertyChange(() => Settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Installing GIF on editor open to make sure the proper profiles are loaded
|
||||||
|
private void InstallGif()
|
||||||
|
{
|
||||||
|
var gif = Resources.redeemer;
|
||||||
|
if (gif == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ProfileProvider.InsertGif("UnrealTournament", "Default", "Redeemer GIF", gif, "redeemer");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user