Skip to content

Commit

Permalink
Updated source code to v2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ClonkAndre committed Feb 1, 2024
1 parent 10839db commit 86e0cb3
Show file tree
Hide file tree
Showing 31 changed files with 765 additions and 560 deletions.
20 changes: 20 additions & 0 deletions GTAIVDowngrader/Classes/CommandLineArgument.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace GTAIVDowngrader.Classes
{
internal struct CommandLineArgument
{
#region Properties
public int Category { get; private set; }
public string ArgumentName { get; private set; }
public string ArgumentDescription { get; private set; }
#endregion

#region Constructor
public CommandLineArgument(int category, string aName, string aDesc)
{
Category = category;
ArgumentName = aName;
ArgumentDescription = aDesc;
}
#endregion
}
}
104 changes: 104 additions & 0 deletions GTAIVDowngrader/Classes/DowngradingInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
using System;
using System.Collections.Generic;
using System.IO;

using GTAIVDowngrader.JsonObjects;

namespace GTAIVDowngrader.Classes
{
internal class DowngradingInfo
{
#region Properties
public string IVExecutablePath { get; private set; }
public string IVWorkingDirectoy { get; private set; }
public string IVTargetBackupDirectory { get; private set; }
public string ReceivedMD5Hash { get; private set; }
public string RelatedMD5Hash { get; private set; }
public string NewGTAIVTargetLocation { get; private set; }

public GameVersion DowngradeTo { get; private set; }
public RadioDowngrader SelectedRadioDowngrader { get; private set; }
public VladivostokTypes SelectedVladivostokType { get; private set; }

public bool ConfigureForGFWL { get; private set; }
public bool InstallNoEFLCMusicInIVFix { get; private set; }
public bool InstallPrerequisites { get; private set; }
public bool WantsToCreateBackup { get; private set; }
public bool CreateBackupInZipFile { get; private set; }
public bool GTAIVInstallationGotMovedByDowngrader { get; private set; }

public List<ModInformation> SelectedMods;
public List<OptionalComponentInfo> SelectedOptionalComponents;
#endregion

#region Constructor
public DowngradingInfo()
{
SelectedMods = new List<ModInformation>();
SelectedOptionalComponents = new List<OptionalComponentInfo>();
}
#endregion

#region Methods
public void SetPath(string executablePath)
{
IVExecutablePath = executablePath;
IVWorkingDirectoy = Path.GetDirectoryName(executablePath);
}
public void SetTargetBackupPath(string backupPath)
{
IVTargetBackupDirectory = backupPath;
}
public void SetReceivedMD5Hash(string hash)
{
ReceivedMD5Hash = hash;
}
public void SetRelatedMD5Hash(string hash)
{
RelatedMD5Hash = hash;
}
public void SetNewGTAIVTargetLocation(string location)
{
NewGTAIVTargetLocation = location;
}

public void SetDowngradeVersion(GameVersion version)
{
DowngradeTo = version;
}
public void SetRadioDowngrader(RadioDowngrader radioDowngrader)
{
SelectedRadioDowngrader = radioDowngrader;
}
public void SetVladivostokType(VladivostokTypes type)
{
SelectedVladivostokType = type;
}

public void SetConfigureForGFWL(bool value)
{
ConfigureForGFWL = value;
}
public void SetInstallNoEFLCMusicInIVFix(bool value)
{
InstallNoEFLCMusicInIVFix = value;
}
public void SetInstallPrerequisites(bool value)
{
InstallPrerequisites = value;
}
public void SetWantsToCreateBackup(bool value)
{
WantsToCreateBackup = value;
}
public void SetCreateBackupInZipFile(bool value)
{
CreateBackupInZipFile = value;
}
public void SetGTAIVInstallationGotMovedByDowngrader(bool value)
{
GTAIVInstallationGotMovedByDowngrader = value;
}
#endregion
}
}
83 changes: 83 additions & 0 deletions GTAIVDowngrader/Classes/Enums.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
namespace GTAIVDowngrader
{

public enum Steps
{
S0_Welcome = 0,
S1_SelectIVExe,
S2_MD5FilesChecker,
S3_MoveGameFilesQuestion,
S4_MoveGameFiles,
S5_SelectDwngrdVersion,
S6_Multiplayer,
S7_SelectRadioDwngrd,
S7_1_SelectVladivostokType,
S8_SelectComponents,
S9_Confirm,
S10_Downgrade,
S11_SavefileDowngrade,
S11_SavefileDowngrade_2,
S11_SavefileDowngrade_3,
S12_Commandline,
S13_Finish,

MessageDialog,
StandaloneWarning,
Error
}

public enum LogType
{
Info,
Warning,
Error
}
public enum GameVersion
{
v1080,
v1070,
v1040
}
public enum ModVersion
{
All = 3,
v1080 = 0,
v1070 = 1,
v1040 = 2,
}
public enum RadioDowngrader
{
None,
SneedsDowngrader,
LegacyDowngrader
}
public enum VladivostokTypes
{
None,
New,
Old
}
public enum ModType
{
ASILoader,
ASIMod,
ScriptHook,
ScriptHookMod,
ScriptHookHook,
ScriptHookDotNet,
ScriptHookDotNetMod
}
public enum NotificationType
{
Info,
Warning,
Error,
Success
}
public enum SlideDirection
{
TopToBottom,
BottomToTop
}

}
38 changes: 38 additions & 0 deletions GTAIVDowngrader/Classes/FileDownload.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using GTAIVDowngrader.JsonObjects;

namespace GTAIVDowngrader.Classes
{
internal class FileDownload
{
#region Properties
public string FileName { get; private set; }
public string DownloadURL { get; private set; }
public long FileSize { get; private set; }
public bool NeedsToBeDecompressed { get; private set; }
#endregion

#region Constructor
public FileDownload(DowngradeInformation info)
{
FileName = info.FileName;
FileSize = info.FileSize;
DownloadURL = info.DownloadURL;
NeedsToBeDecompressed = info.NeedsToBeDecompressed;
}
public FileDownload(OptionalComponentInfo info)
{
FileName = info.FileName;
FileSize = info.FileSize;
DownloadURL = info.DownloadURL;
NeedsToBeDecompressed = false;
}
public FileDownload(ModInformation info)
{
FileName = info.FileName;
FileSize = info.FileSize;
DownloadURL = info.DownloadURL;
NeedsToBeDecompressed = false;
}
#endregion
}
}
Loading

0 comments on commit 86e0cb3

Please sign in to comment.