mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +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";
|
||||
Directory.CreateDirectory(gifDir);
|
||||
var gifPath = gifDir + $"\\{fileName}.gif";
|
||||
gifFile.Save(gifPath);
|
||||
if (!File.Exists(gifPath))
|
||||
gifFile.Save(gifPath);
|
||||
|
||||
foreach (var profile in profiles)
|
||||
{
|
||||
|
||||
Binary file not shown.
@ -47,7 +47,7 @@ namespace Artemis.Modules.Games.UnrealTournament
|
||||
var gameSettings = (UnrealTournamentSettings) Settings;
|
||||
// If already propertly set up, don't do anything
|
||||
if (gameSettings.GameDirectory != null &&
|
||||
File.Exists(gameSettings.GameDirectory + "UE4-Win64-Shipping.exe"))
|
||||
File.Exists(gameSettings.GameDirectory + @"\Engine\Binaries\Win64\UE4-Win64-Shipping.exe"))
|
||||
return;
|
||||
|
||||
// Attempt to read the file
|
||||
@ -65,7 +65,7 @@ namespace Artemis.Modules.Games.UnrealTournament
|
||||
// Use backslash in path for consistency
|
||||
utDir = utDir.Replace('/', '\\');
|
||||
|
||||
if (!File.Exists(utDir + @"\UE4-Win64-Shipping.exe"))
|
||||
if (!File.Exists(utDir + @"\Engine\Binaries\Win64\UE4-Win64-Shipping.exe"))
|
||||
return;
|
||||
|
||||
gameSettings.GameDirectory = utDir;
|
||||
@ -78,7 +78,7 @@ namespace Artemis.Modules.Games.UnrealTournament
|
||||
var gameSettings = (UnrealTournamentSettings) Settings;
|
||||
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" +
|
||||
@"By default Unreal Tournament is in C:\Program Files\Epic Games\UnrealTournament");
|
||||
|
||||
@ -1,52 +1,52 @@
|
||||
using System.Windows.Forms;
|
||||
using Artemis.DAL;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Modules.Abstract;
|
||||
using Artemis.Properties;
|
||||
using Ninject;
|
||||
|
||||
namespace Artemis.Modules.Games.UnrealTournament
|
||||
{
|
||||
public sealed class UnrealTournamentViewModel : ModuleViewModel
|
||||
{
|
||||
public UnrealTournamentViewModel(MainManager mainManager,
|
||||
[Named(nameof(UnrealTournamentModel))] ModuleModel moduleModel, IKernel 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()
|
||||
using System.Windows.Forms;
|
||||
using Artemis.DAL;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Modules.Abstract;
|
||||
using Artemis.Properties;
|
||||
using Ninject;
|
||||
|
||||
namespace Artemis.Modules.Games.UnrealTournament
|
||||
{
|
||||
public sealed class UnrealTournamentViewModel : ModuleViewModel
|
||||
{
|
||||
public UnrealTournamentViewModel(MainManager mainManager,
|
||||
[Named(nameof(UnrealTournamentModel))] ModuleModel moduleModel, IKernel kernel)
|
||||
: base(mainManager, moduleModel, kernel)
|
||||
{
|
||||
((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");
|
||||
}
|
||||
}
|
||||
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();
|
||||
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