-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
66 lines (57 loc) · 2.08 KB
/
Program.cs
File metadata and controls
66 lines (57 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using SkyrimNX_ModManager.Controllers;
using SkyrimNX_ModManager.Models;
using SkyrimNX_ModManager.Properties;
using System;
using System.IO;
namespace SkyrimNX_ModManager
{
class Program
{
static ModConverter converter = new ModConverter();
static void Main(string[] args)
{
// TODO: Initializing and checking Paths
int choice;
Console.WriteLine("Please select an Option:");
Console.WriteLine("(1) Convert Mods");
Console.WriteLine("(2) Upload Mods");
Console.WriteLine("(3) Change Load Order");
Console.Write("\nEnter choice: ");
Int32.TryParse(Console.ReadLine(), out choice);
Console.Clear();
switch (choice)
{
case 1:
PrepareLocalMods();
break;
case 2:
UploadMods();
break;
default:
break;
}
}
static void PrepareLocalMods()
{
Mod[] baseModList = converter.ReturnModList(Settings.Default.ModsDirectory);
foreach (Mod currentMod in baseModList)
{
Console.WriteLine("Converting " + currentMod.Name);
currentMod.Path = converter.Transform(Operation.Convert, currentMod);
currentMod.Path = converter.Transform(Operation.Unpack, currentMod);
currentMod.Path = converter.Transform(Operation.Merge, currentMod);
Directory.Move(currentMod.Path, $"{Settings.Default.ConvertedModsDirectory}/{currentMod.Name}");
converter.CleanUpDirectory();
}
}
static void UploadMods()
{
Mod[] convertedModList = converter.ReturnModList(Settings.Default.ConvertedModsDirectory);
FileTransfer filetransfer = new FileTransfer(true);
foreach (Mod m in convertedModList)
{
filetransfer.Upload(m);
}
}
}
}