Skip to content

Commit

Permalink
Merge pull request #35 from Gml-Launcher/feature/change-install-folder
Browse files Browse the repository at this point in the history
Feature/change install folder
  • Loading branch information
GamerVII-NET authored Jul 28, 2024
2 parents fb68d69 + 3f2f87e commit 0d334ab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Gml.Client/GmlClientManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,20 @@ public class GmlClientManager : IGmlClientManager
public IObservable<int> LoadedFilesCount => _loadedFilesCount;

public string ProjectName { get; }
public string InstallationDirectory => _installationDirectory;

public event EventHandler<ProgressChangedEventArgs>? ProgressChanged;

private readonly string _installationDirectory;
private string _installationDirectory;
private readonly ApiProcedures _apiProcedures;
private readonly SystemIoProcedures _systemProcedures;
private SystemIoProcedures _systemProcedures;
private ISubject<int> _progressChanged = new Subject<int>();
private ISubject<bool> _profilesChanged = new Subject<bool>();
private ISubject<int> _maxFileCount = new Subject<int>();
private ISubject<int> _loadedFilesCount = new Subject<int>();
private SignalRConnect? _launchbackendConnection;
private readonly string _webSocketAddress;
private readonly OsType _osType;
private IDisposable? _profilesChangedEvent;

public GmlClientManager(string installationDirectory, string gateWay, string projectName, OsType osType)
Expand All @@ -43,6 +45,7 @@ public GmlClientManager(string installationDirectory, string gateWay, string pro

var hostUri = new Uri(gateWay);

_osType = osType;
_systemProcedures = new SystemIoProcedures(installationDirectory, osType);
_apiProcedures = new ApiProcedures(new HttpClient
{
Expand Down Expand Up @@ -144,6 +147,12 @@ public async Task OpenServerConnection(IUser user)
await _launchbackendConnection.BuildAndConnect();
}

public void ChangeInstallationFolder(string installationDirectory)
{
_installationDirectory = installationDirectory;
_systemProcedures = new SystemIoProcedures(installationDirectory, _osType);
}

private async void UpdateInfo(long _)
{
if (_launchbackendConnection is not null)
Expand Down
2 changes: 2 additions & 0 deletions src/Gml.Client/IGmlClientManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public interface IGmlClientManager : IDisposable
public string ProjectName { get; }
IObservable<int> MaxFileCount { get; }
IObservable<int> LoadedFilesCount { get; }
string InstallationDirectory { get; }
Task<ResponseMessage<List<ProfileReadDto>>> GetProfiles();
Task<ResponseMessage<ProfileReadInfoDto?>?> GetProfileInfo(ProfileCreateInfoDto profileDto);
public Task<Process> GetProcess(ProfileReadInfoDto profileDto, OsType osType);
Expand All @@ -29,4 +30,5 @@ Task UpdateCurrentLauncher((IVersionFile? ActualVersion, bool IsActuallVersion)
string originalFileName);

Task OpenServerConnection(IUser user);
void ChangeInstallationFolder(string installationDirectory);
}

0 comments on commit 0d334ab

Please sign in to comment.