Skip to content

Commit

Permalink
all done
Browse files Browse the repository at this point in the history
  • Loading branch information
BigSpice committed Oct 21, 2023
1 parent 329cfd0 commit 63a0561
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 45 deletions.
Binary file modified VTOL_2.0.0/.vs/VTOL/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 1 addition & 3 deletions VTOL_2.0.0/Pages/Page_Mods.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public List<NORTHSTARCOMPATIBLE_MOD> READ_UPDATE_MOD_LIST(DirectoryInfo[] modsTo
}
else
{
try
try//todo fix icon png left behind
{
////// Parse the JSON content
JObject jsonObject = JObject.Parse(jsonContent);
Expand Down Expand Up @@ -468,7 +468,6 @@ public async Task Call_Mods_From_Folder()

}

//TODO migrate to using the enabled mod list instad of var directory info in existingDirectories
foreach (var Verified_Installed_Mod in CLEANED_FORMAT_MODS)
{
try
Expand Down Expand Up @@ -932,7 +931,6 @@ public void Move_Mods(string val, bool Enable_Disable)

if (Directory.Exists(User_Settings_Vars.NorthstarInstallLocation + @"R2Northstar\packages\"))
{
//TODO, move the move mods method


if (val != null)
Expand Down
31 changes: 18 additions & 13 deletions VTOL_2.0.0/Pages/Page_Thunderstore.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2540,9 +2540,9 @@ await Task.Run(() =>

downloader.DownloadFileCompleted += delegate (object sender4, AsyncCompletedEventArgs e4)
{
string MODName = words[4] + "-" + words[1];


downloader_DownloadCompleted(sender4, e4, Progress_Bar, words[1], words[4], Destinfo.FullName + @"NS_Downloaded_Mods\" + words[4] + "-" + separatedname[0]+ ".zip", Skin_Install_, NS_CANDIDATE_INSTALL);
downloader_DownloadCompleted(sender4, e4, Progress_Bar, MODName, words[4], Destinfo.FullName + @"NS_Downloaded_Mods\" + words[4] + "-" + separatedname[0]+ ".zip", Skin_Install_, NS_CANDIDATE_INSTALL);
};
downloader.StartAsync();
if (cancellationToken.IsCancellationRequested)
Expand Down Expand Up @@ -3240,14 +3240,21 @@ public async Task Unpack_To_Location_Custom(string Target_Zip, string Destinatio

if (manidata.SelectToken("namespace") == null)
{
// namespace__ = manidata.SelectToken("namespace").Value<string>();

// Create a new JObject for the namespace
JObject namespaceObject = new JObject();
namespaceObject["namespace"] = namespace_;
Console.WriteLine("Namespace not found - Inserting : " + namespaceObject.ToString() + " " + Destinfo1.FullName);
Console.WriteLine("Namespace not found - Inserting : " + namespace_.ToString());
// namespaceObject[namespace__] = namespace_;
manidata["namespace"] = namespace_;

// string updatedJson = JsonConvert.SerializeObject(namespaceObject, Formatting.Indented);

File.WriteAllText(manifest_json, manidata.ToString());

Console.WriteLine("File updated and saved.");
}

}
}
if (File.Exists(Mod_json))
{

Expand All @@ -3256,9 +3263,7 @@ public async Task Unpack_To_Location_Custom(string Target_Zip, string Destinatio
string Name = data.SelectToken("Name").Value<string>();
string Version = data.SelectToken("Version").Value<string>();

//todo get namespace from endpoint

MoveDirectory___(Destination, Destinfo1.Parent + @"\" + (namespace_.ToString()).Replace(" ", "_") + "-"+ (Name.ToString()).Replace(" ", "_") + "-" + Version.ToString());


string Json_Path = FindFirstFile(User_Settings_Vars.NorthstarInstallLocation + @"R2Northstar\", "enabledmods.json");
Expand Down Expand Up @@ -3811,7 +3816,7 @@ private async Task DownloadZipAsync(DownloadQueueItem item, CancellationToken ca
if (parts.Length >= 2) // check if there are at least two parts
{
URl = parts[0];
name = parts[parts.Length - 3]; // get the second last item
name = parts[4] + "-"+parts[1]; // get the second last item
}
Main.DispatchIfNecessary(() =>
{
Expand Down Expand Up @@ -3880,7 +3885,7 @@ public void CancelDownload(string name, bool clear_all = false)
var item = _queue_List_Clear.FirstOrDefault(i =>
{
return i.Name.ToLower().Contains(name.ToLower());
});
});//todo fix clear

if (item != null)
{
Expand Down Expand Up @@ -3954,20 +3959,20 @@ private void Install_Bttn_Thunderstore_Click(object sender, RoutedEventArgs e)
string[] parts = Button.Tag.ToString().Split('|');
if (parts.Length >= 2) // check if there are at least two parts
{
name = parts[parts.Length - 3]; // get the second last item
name = parts[1]; // get the second last item
}
Console.WriteLine(Button.Tag.ToString());

DispatchIfNecessary(async () =>
{
if (Button.Tag.ToString().Contains("http") || Button.Tag.ToString().Contains("https"))
if (parts[0].Contains("http") || parts[0].Contains("https"))
{
var item = new DownloadQueueItem
{
Name = name,
DownloadUrl = Button.Tag.ToString(),
DestinationPath = User_Settings_Vars.NorthstarInstallLocation + @"NS_Downloaded_Mods",
Extract = tags.Contains("DDS"),
Extract = false,
IsNorthstarRelease = Button.Tag.ToString().Contains("Northstar Release Candidate") || Button.Tag.ToString().Contains("NorthstarReleaseCandidate") || (Button.Tag.ToString().Contains("Northstar") && Button.ToolTip.ToString().Count() < 5),
Progress = Progress_Bar

Expand Down
30 changes: 1 addition & 29 deletions VTOL_2.0.0/Pages/Page_Tools.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1984,35 +1984,7 @@ private void Items_List_SelectionChanged(object sender, SelectionChangedEventArg


}
//TODO Treenode
//private void ExecuteOnDemandLoading(object obj)
//{
// var node = obj as TreeViewNode;

// // Skip the repeated population of child items when every time the node expands.
// if (node.ChildNodes.Count > 0)
// {
// node.IsExpanded = true;
// return;
// }

// //Animation starts for expander to show progressing of load on demand
// node.ShowExpanderAnimation = true;
// var sfTreeView = Application.Current.MainWindow.FindName("sfTreeView") as SfTreeView;
// sfTreeView.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(() =>
// {
// currentNode = node;
// timer.Start();
// }));
//}
//private bool CanExecuteOnDemandLoading(object sender)
//{
// var hasChildNodes = ((sender as TreeViewNode).Content as Data_Tree).HasChildNodes;
// if (hasChildNodes)
// return true;
// else
// return false;
//}

private void Button_Click(object sender, RoutedEventArgs e)
{
System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog();
Expand Down

0 comments on commit 63a0561

Please sign in to comment.