Skip to content

Commit

Permalink
3.0.2 pre release changes finalized and completed.
Browse files Browse the repository at this point in the history
  • Loading branch information
BigSpice committed Jan 21, 2024
1 parent 2f885f9 commit 743598b
Show file tree
Hide file tree
Showing 22 changed files with 133 additions and 145 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.
Binary file not shown.
Binary file not shown.
17 changes: 12 additions & 5 deletions VTOL_2.0.0/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
Closing="Main_Win_Control_Closing"
BorderBrush="#B27F7F7F"
BorderThickness="1,1,1,1"
SizeToContent="WidthAndHeight"
Height="700" Width="1201"

>
<!--SizeToContent="WidthAndHeight"-->

<Window.Resources>

Expand Down Expand Up @@ -125,7 +127,6 @@

x:Name="RootMainGrid"
Grid.Row="1"
Height="700" Width="1201"
Margin="0" AllowDrop="False">

<Grid.ColumnDefinitions>
Expand Down Expand Up @@ -303,7 +304,7 @@
Grid.Column="0"
Margin="6,40,6,0"
Frame="{Binding ElementName=RootFrame}"
SelectedPageIndex="0" Navigated="RootNavigation_Navigated" Precache="False" TransitionDuration="420" Orientation="Vertical" LostFocus="RootNavigation_LostFocus" AllowDrop="False" TransitionType="FadeIn" PreviewMouseDown="RootNavigation_PreviewMouseDown" TargetUpdated="RootNavigation_TargetUpdated" SourceUpdated="RootNavigation_SourceUpdated" Foreground="#FFF10000"
SelectedPageIndex="0" Navigated="RootNavigation_Navigated" Precache="False" TransitionDuration="420" Orientation="Vertical" LostFocus="RootNavigation_LostFocus" AllowDrop="False" PreviewMouseDown="RootNavigation_PreviewMouseDown" TargetUpdated="RootNavigation_TargetUpdated" SourceUpdated="RootNavigation_SourceUpdated" Foreground="#FFF10000"
>
<ui:NavigationCompact.Items>
<ui:NavigationItem x:Name="Home"
Expand All @@ -323,7 +324,7 @@
/>
<ui:NavigationSeparator />



<ui:NavigationItem x:Name="Server"
Content="{x:Static properties:Language.MainWindow_Server}"
Expand Down Expand Up @@ -372,7 +373,13 @@
<Image Source="/Resources/Icons/Main_UI/VTOL_multires.ico" Height="30" Width="33" Margin="-11,0,0,0" RenderOptions.BitmapScalingMode="HighQuality"
/>
<TextBlock x:Name="VERSION_TEXT" Text="VTOL - 0.0.0 |" FontWeight="Normal" FontFamily="Nacelle" TextDecorations="{x:Null}" FontStyle="Normal" Margin="10,0,0,0" VerticalAlignment="Center"/>
<ui:Button x:Name="NORTHSTAR_BUTTON" Width="176" Height="21" Content="Northstar Version 0.0.0" Padding="0,0.5,0,0" VerticalAlignment="Stretch" FontSize="12" BorderThickness="1,1,1,1" Margin="5,0,0,-1" Background="#33FFFFFF" VerticalContentAlignment="Center" BorderBrush="{x:Null}" Click="NORTHSTAR_BUTTON_Click" FontFamily="Nacelle">
<ui:Button x:Name="NORTHSTAR_BUTTON" Width="176" Height="21" Content="Northstar Version 0.0.0" Padding="0,0.5,0,0" VerticalAlignment="Stretch" FontSize="12" BorderThickness="1,1,1,1" Margin="5,0,0,-1" VerticalContentAlignment="Center" BorderBrush="{x:Null}" Click="NORTHSTAR_BUTTON_Click" FontFamily="Nacelle">
<ui:Button.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox" SpreadMethod="Repeat">
<GradientStop Color="#D203606F" Offset="0.045"/>
<GradientStop Color="#A1268A77" Offset="1"/>
</LinearGradientBrush>
</ui:Button.Background>
<ui:Button.PressedBackground>
<SolidColorBrush Color="{DynamicResource {x:Static SystemColors.GradientActiveCaptionColorKey}}"/>
</ui:Button.PressedBackground>
Expand Down
2 changes: 1 addition & 1 deletion VTOL_2.0.0/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public partial class MainWindow : Window
public string AppDataFolder = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));

public NotificationManager NotificationManager;

public bool loaded_mods = false;
public bool Is_Focused = true;
// public List<string> Current_Installed_Mods = new List<string>();
public HashSet<GENERAL_MOD> Current_Installed_Mods = new HashSet<GENERAL_MOD>();
Expand Down
1 change: 0 additions & 1 deletion VTOL_2.0.0/Pages/Page_Home.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3808,7 +3808,6 @@ private void Unpack_To_Location(string Target_Zip, string Destination_Zip)
{
if (Directory.Exists(folderPath))
{
MessageBox.Show(folderPath);

TryDeleteDirectory(folderPath, true);

Expand Down
2 changes: 1 addition & 1 deletion VTOL_2.0.0/Pages/Page_Mods.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
<Label Content="{x:Static properties:Language.MODINFO}" Margin="0,13,0,0" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" UseLayoutRounding="True" Padding="0,0,0,0" Background="{x:Null}" Foreground="White" FontSize="16" FontWeight="Bold" Height="23" VerticalAlignment="Top" HorizontalAlignment="Center" Width="240"/>

<Label x:Name="INFO_VERSION_SET" Content="v1.0.0" Margin="274,0,0,404" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Right" UseLayoutRounding="True" Padding="0,0,0,0" Height="23" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="229" FontSize="14"/>
<Label x:Name="INFO_VERSION_MOD_SET" Content="Path/to/mod" Margin="274,0,0,382" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Right" UseLayoutRounding="True" Padding="0,0,0,0" Height="22" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="229" FontSize="14"/>
<Label x:Name="INFO_VERSION_MOD_SET" Content="Path/to/mod" Margin="274,0,0,382" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Right" UseLayoutRounding="True" Padding="0,0,0,0" Height="22" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="229" FontSize="14" Loaded="INFO_VERSION_MOD_SET_Loaded" LayoutUpdated="INFO_VERSION_MOD_SET_LayoutUpdated"/>
<Label x:Name="INFO_MOD_SIZE_SET" Content="5GB" Margin="274,0,0,362" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Right" UseLayoutRounding="True" Padding="0,0,0,0" Height="20" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="229" FontSize="14"/>
<Label Content="{x:Static properties:Language.VERSION}" Margin="32,0,0,404" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" UseLayoutRounding="True" Padding="0,0,0,0" Height="23" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="231" FontSize="14"/>
<Label Content="{x:Static properties:Language.PATH}" Margin="32,0,0,382" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" UseLayoutRounding="True" Padding="0,0,0,0" Height="22" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="231" FontSize="14"/>
Expand Down
91 changes: 35 additions & 56 deletions VTOL_2.0.0/Pages/Page_Mods.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using FuzzyString;
using HandyControl.Tools.Extension;
using Ionic.Zip;
using Lsj.Util.Win32.BaseTypes;
using Lsj.Util.Win32.Structs;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Serilog;
Expand Down Expand Up @@ -448,28 +450,27 @@ public async Task Call_Mods_From_Folder()
string NS_Mod_Dir = User_Settings_Vars.NorthstarInstallLocation + @"R2Northstar\packages";

System.IO.DirectoryInfo rootDirs = new DirectoryInfo(NS_Mod_Dir);
System.IO.DirectoryInfo NS_Dirs = new DirectoryInfo(User_Settings_Vars.NorthstarInstallLocation + @"R2Northstar\mods");



if (IsValidPath(rootDirs.FullName) == true)
{

System.IO.DirectoryInfo[] subDirs = null;
subDirs = rootDirs.GetDirectories();

var dirs = rootDirs.EnumerateDirectories("*", new EnumerationOptions
{ RecurseSubdirectories = false }).ToArray();
subDirs = rootDirs.GetDirectories().Concat(NS_Dirs.GetDirectories()).ToArray();



if (subDirs.Count() > 0)
{
int index = 0;
List<DirectoryInfo> existingDirectories = null;
string Json_Path = FindFirstFile(User_Settings_Vars.NorthstarInstallLocation + @"R2Northstar\", "enabledmods.json");


if (File.Exists(Json_Path))
{

List<NORTHSTARCOMPATIBLE_MOD> DIRECTORY_MODS = READ_UPDATE_MOD_LIST(dirs);
List<NORTHSTARCOMPATIBLE_MOD> DIRECTORY_MODS = READ_UPDATE_MOD_LIST(subDirs);

CLEANED_FORMAT_MODS = DIRECTORY_MODS;

Expand All @@ -488,7 +489,6 @@ public async Task Call_Mods_From_Folder()
{


index++;

// bool Has_Manifest_or_plugins = await Check_Plugins_and_multi_mod(Verified_Installed_Mod.DIRECTORY_INFO.FullName, Verified_Installed_Mod.DIRECTORY_INFO.Name);
if (Regex.IsMatch(Verified_Installed_Mod.Name.Trim(), @"^Northstar\.CustomServers\w{0,2}$") || Regex.IsMatch(Verified_Installed_Mod.Name.Trim(), @"^Northstar\.Custom\w{0,2}$") || Regex.IsMatch(Verified_Installed_Mod.Name.Trim(), @"^Northstar\.Client\w{0,2}$"))
Expand Down Expand Up @@ -526,7 +526,7 @@ public async Task Call_Mods_From_Folder()
ToolTip_Dynamic = "The Mod Is not Registered Properly in the Backend List, Please Fix the Mod formatting or update your TF2 Mod List by Launching the Game";
Flag_mod = 100;
}
else if(Verified_Installed_Mod.Has_Valid_Mod == false)
else if(Verified_Installed_Mod.Has_Valid_Mod == false && !Verified_Installed_Mod.Name.Contains("Northstar"))
{
IS_CORE_MOD_temp = "#c80815";

Expand Down Expand Up @@ -568,7 +568,7 @@ public async Task Call_Mods_From_Folder()
ver = parts[2];
}


Main.loaded_mods = true;
Main.Current_Installed_Mods.Add(new GENERAL_MOD { Name = name, Version = ver, Author = author });
});
}
Expand Down Expand Up @@ -1920,45 +1920,7 @@ private string CleanSearchQuery(string searchQuery)
return Regex.Replace(searchQuery, @"[^\w]+", string.Empty, RegexOptions.IgnoreCase);
}

private string Find_Folder(string searchQuery, string folderPath)
{
List<FuzzyStringComparisonOptions> options = new List<FuzzyStringComparisonOptions>();
searchQuery = CleanSearchQuery(searchQuery);

// Choose which algorithms should weigh in for the comparison
options.Add(FuzzyStringComparisonOptions.UseLevenshteinDistance);
options.Add(FuzzyStringComparisonOptions.UseNormalizedLevenshteinDistance);
options.Add(FuzzyStringComparisonOptions.UseLongestCommonSubstring);
options.Add(FuzzyStringComparisonOptions.UseHammingDistance);

// Choose the relative strength of the comparison - is it almost exactly equal? or is it just close?
FuzzyStringComparisonTolerance tolerance = FuzzyStringComparisonTolerance.Strong;



// Get a boolean determination of approximate equality
var directory = new DirectoryInfo(folderPath);
var directories = directory
.EnumerateDirectories()
.FirstOrDefault(dir =>
{
string secondPart = dir.Name.Split('-')[1];
bool similarity = searchQuery.ApproximatelyEquals(secondPart, options, tolerance);
Console.WriteLine($"Comparing {secondPart} with {searchQuery}. Similarity: {similarity}");
return similarity = true || dir.Name.Contains(searchQuery, StringComparison.OrdinalIgnoreCase);
});



if (directories != null)
{
return directories.FullName;
}
else
{
return null;
}
}

//private string Find_Folder(string searchQuery, string folderPath)
//{
// searchQuery = CleanSearchQuery(searchQuery);
Expand Down Expand Up @@ -2101,15 +2063,21 @@ public static List<DirectoryInfo> ParseDirectoryStrings(string filePath, HashSet
return directoryInfoList;
}
static string TruncatePath(string fullPath, string keyword)
{
int index = fullPath.IndexOf(keyword);
{ // Define the pattern to match "R2Northstar\" followed by any characters until the next directory separator
string pattern = @"\\R2Northstar\\([^\\]+)";

if (index >= 0)
// Use Regex to match the pattern
Match match = Regex.Match(fullPath, pattern, RegexOptions.IgnoreCase);

// If a match is found, extract the captured group
if (match.Success)
{
return fullPath.Substring(index);
return "R2Northstar\\" + match.Groups[1].Value.Trim();
}

return fullPath;
// If no match is found, return an empty string or handle it as needed
return string.Empty;

}

void Open_Mod_Info(string FolderDir)
Expand Down Expand Up @@ -3087,7 +3055,7 @@ private void EXIT(object sender, RoutedEventArgs e)
}
Image_BG.Source = null;

Options_Panel_Mod.Hide();
Options_Panel_Mod.Collapse();
GC.Collect();

}
Expand All @@ -3100,7 +3068,7 @@ private void Options_Panel_Mod_MouseDown(object sender, MouseButtonEventArgs e)
File.Delete(Image_BG.Source.ToString());
}
Image_BG.Source = null;
Options_Panel_Mod.Hide();
Options_Panel_Mod.Collapse();


GC.Collect();
Expand All @@ -3115,5 +3083,16 @@ private void Open_Folder__Click(object sender, RoutedEventArgs e)

}
}


private void INFO_VERSION_MOD_SET_Loaded(object sender, RoutedEventArgs e)
{

}

private void INFO_VERSION_MOD_SET_LayoutUpdated(object sender, EventArgs e)
{

}
}
}
5 changes: 3 additions & 2 deletions VTOL_2.0.0/Pages/Page_Thunderstore.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

</Image>

<ui:VirtualizingItemsControl x:Name="Thunderstore_List" VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling" VirtualizingPanel.ScrollUnit="Pixel" ItemsSource="{Binding itemsList}" Margin="35,174,35,0" ScrollViewer.CanContentScroll="True" Foreground="White" Width="1078" Height="445" CacheLengthUnit="Pixel" UseLayoutRounding="True" ScrollViewer.VerticalScrollBarVisibility="Visible" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalAlignment="Top" Background="#E85A5A5A" SourceUpdated="Thunderstore_List_SourceUpdated" >
<ui:VirtualizingItemsControl x:Name="Thunderstore_List" VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling" VirtualizingPanel.ScrollUnit="Pixel" ItemsSource="{Binding itemsList}" Margin="35,174,35,0" ScrollViewer.CanContentScroll="True" Foreground="White" Width="1078" Height="445" CacheLengthUnit="Pixel" UseLayoutRounding="True" ScrollViewer.VerticalScrollBarVisibility="Visible" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalAlignment="Top" Background="#E85A5A5A" SourceUpdated="Thunderstore_List_SourceUpdated" LayoutUpdated="Thunderstore_List_LayoutUpdated" >
<!--<ui:CardExpander
HorizontalContentAlignment="Center"
Expand Down Expand Up @@ -231,7 +231,7 @@

</DataTemplate>
</ui:VirtualizingItemsControl.ItemTemplate>

<!--<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
Expand Down Expand Up @@ -266,6 +266,7 @@


<ui:Dialog x:Name="Dialog" ButtonRightClick="Dialog_ButtonRightClick" Foreground="White" Focusable="False" ButtonLeftClick="Dialog_ButtonLeftClick" SnapsToDevicePixels="False"/>
<Button x:Name="Reload_BTTN" Width="120" Height="30" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,456,0,0" Background="#FF018156" Content="Reload" Click="Reload_BTTN_Click"></Button>
<ui:ProgressRing x:Name="Loading_Ring" Width="120" Height="120" IsIndeterminate="True" Visibility="Visible" Margin="0,327,0,0" VerticalAlignment="Top" HorizontalAlignment="Center" IsHitTestVisible="False" IsTabStop="False" Progress="40" OverridesDefaultStyle="False" EngAngle="20">
<ui:ProgressRing.Foreground>
<RadialGradientBrush SpreadMethod="Pad" Center="1,1" GradientOrigin="1,1" RadiusX="2.8" RadiusY="2.9">
Expand Down
Loading

0 comments on commit 743598b

Please sign in to comment.