Skip to content

Commit

Permalink
Fixed Bad sort Menu and broken download window when switching pages.
Browse files Browse the repository at this point in the history
Added mod counter
  • Loading branch information
BigSpice committed Jan 22, 2024
1 parent 419bb2f commit 18f98bb
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 100 deletions.
Binary file modified VTOL_2.0.0/.vs/ProjectEvaluation/vtol.metadata.v7.bin
Binary file not shown.
Binary file modified VTOL_2.0.0/.vs/ProjectEvaluation/vtol.projects.v7.bin
Binary file not shown.
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.
Binary file modified VTOL_2.0.0/.vs/VTOL/v17/.futdcache.v2
Binary file not shown.
Binary file modified VTOL_2.0.0/.vs/VTOL/v17/fileList.bin
Binary file not shown.
9 changes: 5 additions & 4 deletions VTOL_2.0.0/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,13 +1059,13 @@ private void Action_Center_Progress_Checked(object sender, RoutedEventArgs e)
{
From = Action_Center_Panel.Opacity,
To = 1,
Duration = new Duration(TimeSpan.FromSeconds(0.2)),
Duration = new Duration(TimeSpan.FromSeconds(0.3)),
AutoReverse = false
};
Action_Center_Panel.BeginAnimation(OpacityProperty, da);

Action_Center_Panel.Visibility = Visibility.Visible;
Action_Center_Panel.IsHitTestVisible = true;
}
Action_Center_Panel.IsHitTestVisible = true;
}

private void Action_Center_Progress_Unchecked(object sender, RoutedEventArgs e)
Expand All @@ -1080,9 +1080,10 @@ private void Action_Center_Progress_Unchecked(object sender, RoutedEventArgs e)
AutoReverse = false
};
Action_Center_Panel.BeginAnimation(OpacityProperty, da);
Action_Center_Panel.Visibility = Visibility.Collapsed;
Action_Center_Panel.IsHitTestVisible = false;

}
Action_Center_Panel.IsHitTestVisible = false;
}

private void Cancel_Button_Click(object sender, RoutedEventArgs e)
Expand Down
11 changes: 6 additions & 5 deletions VTOL_2.0.0/Pages/Page_Thunderstore.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</Page.Resources>
<Grid Focusable="True" OverridesDefaultStyle="True" ClipToBounds="True" Unloaded="Grid_Unloaded" GotFocus="Grid_GotFocus" UseLayoutRounding="True" Loaded="Grid_Loaded">
<ui:TextBox x:Name="Search_Bar_Suggest_Mods" TextWrapping="NoWrap" Height="36" BorderThickness="0,0,0,0" Icon="Search48" GotFocus="Search_Bar_Suggest_Mods_GotFocus" LostFocus="Search_Bar_Suggest_Mods_LostFocus" Background="{x:Null}" TextChanged="Search_Bar_Suggest_Mods_TextChanged" Padding="0,8,0,7" Margin="48,135,547,0" VerticalAlignment="Top" KeyUp="TextInput_OnKeyUpDone" Foreground="#34FFFFFF" PlaceholderText="Search" TextInput="Search_Bar_Suggest_Mods_TextInput" />
<ComboBox x:Name="Sort" Margin="0,136,320,0" Background="{x:Null}" BorderThickness="0,0,0,1" Height="36" VerticalAlignment="Top" BorderBrush="#82FFFFFF" SelectedIndex="-1" SelectionChanged="Sort_SelectionChanged" Padding="10,9,10,4.3" VerticalContentAlignment="Bottom" MinHeight="0" ScrollViewer.VerticalScrollBarVisibility="Auto" IsTextSearchEnabled="False" LostFocus="Sort_LostFocus" Width="224" UseLayoutRounding="True" Grid.IsSharedSizeScope="True" HorizontalAlignment="Right" MinWidth="225">
<ComboBox x:Name="Sort" Margin="0,136,320,0" SelectedValuePath="Content" Background="{x:Null}" BorderThickness="0,0,0,1" Height="36" VerticalAlignment="Top" BorderBrush="#82FFFFFF" SelectedIndex="-1" SelectionChanged="Sort_SelectionChanged" Padding="10,9,10,4.3" VerticalContentAlignment="Bottom" MinHeight="0" ScrollViewer.VerticalScrollBarVisibility="Auto" IsTextSearchEnabled="False" LostFocus="Sort_LostFocus" Width="224" UseLayoutRounding="True" Grid.IsSharedSizeScope="True" HorizontalAlignment="Right" MinWidth="225">
<ComboBoxItem Name="Name">Name</ComboBoxItem>
<ComboBoxItem Name="Rating">Rating</ComboBoxItem>
<ComboBoxItem Name="Date">Date</ComboBoxItem>
Expand All @@ -39,10 +39,11 @@
<ui:Button x:Name="padd" Content="" VerticalAlignment="Top" Height="35" Padding="0,0,0,0" Icon="ArrowSortDownLines20" BorderBrush="{x:Null}" Width="40" HorizontalAlignment="Right" Margin="0,135,278.3,0" Click="padd_Click" Background="#07FFFFFF" ToolTip="{x:Static properties:Language.Page_Mods_ReverseFilterOrder}" MouseOverBackground="#4CFFFFFF"/>

<hc:CheckComboBox x:Name="Search_Filters" ItemsSource="{Binding Final_List}" Height="28" VerticalAlignment="Top" SelectedIndex="-1" ShowClearButton="True" Cursor="Hand" Padding="7,0,7,5" BorderThickness="0,0,0,1" BorderBrush="#FF999999" Background="#00000000" SelectionChanged="Search_Filters_SelectionChanged" hc:InfoElement.Placeholder="Filters" ToolTip="Filter Thunderstore List" ScrollViewer.CanContentScroll="False" Margin="0,138,35,0" HorizontalAlignment="Right" Width="243" VerticalContentAlignment="Bottom" HorizontalContentAlignment="Center" />
<hc:Badge x:Name="Mod_Updates_Available" Content="Mod Updates Available" Margin="0,632,37,0" VerticalAlignment="Top" BadgeMargin="0,0,0,0" Height="19" Background="#FF45EC57" BorderBrush="#FF45EC57" Status="Processing" HorizontalContentAlignment="Right" VerticalContentAlignment="Center" Foreground="#FF8A8A8A" FontFamily="Nirmala UI" Visibility="Hidden" HorizontalAlignment="Right" Width="139"/>


<hc:Badge x:Name="Mod_Updates_Available" Content="Mod Updates Available" Margin="0,632,37,0" VerticalAlignment="Top" BadgeMargin="0,0,0,0" Height="19" Background="#FF45EC57" BorderBrush="#FF45EC57" Status="Processing" HorizontalContentAlignment="Right" VerticalContentAlignment="Center" Foreground="#FF8A8A8A" FontFamily="Nirmala UI" HorizontalAlignment="Right" Width="139"/>
<Label x:Name="Store_Mod_Label" Content="Store Mod Count:" Foreground="#FF8A8A8A" FontFamily="Nirmala UI" HorizontalAlignment="Right" Width="139" Margin="0,632,944,0" Padding="0,0,0,0" MinHeight="19" Height="19" VerticalAlignment="Top"/>
<Label x:Name="Couunter_Mods" Content="########" Foreground="#FF8A8A8A" FontFamily="Nirmala UI" HorizontalAlignment="Right" Width="116" Margin="0,632,870,0" Padding="0,0,0,0" MinHeight="19" Height="19" VerticalAlignment="Top"/>

(TODO) fix placement
<Label x:Name="Category_Label" Margin="0,142,193,0" Background="{x:Null}" Foreground="#34FFFFFF" Content="{x:Static properties:Language.Page_Thunderstore_Category}" VerticalContentAlignment="Center" VerticalAlignment="Top" FontSize="14" IsHitTestVisible="False" Height="20" Padding="0,0,0,0" IsEnabled="False" HorizontalAlignment="Right" Width="75" HorizontalContentAlignment="Left"/>
<Label x:Name="Sort_Label" Margin="0,144,460,0" Background="{x:Null}" Foreground="#34FFFFFF" Content="{x:Static properties:Language.Page_Thunderstore_Sort}" VerticalContentAlignment="Center" VerticalAlignment="Top" FontSize="14" IsHitTestVisible="False" Height="20" Padding="0,0,0,0" IsEnabled="False" HorizontalAlignment="Right" Width="75" HorizontalContentAlignment="Left"/>

Expand All @@ -53,7 +54,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" LayoutUpdated="Thunderstore_List_LayoutUpdated" >
<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="Item" 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
126 changes: 35 additions & 91 deletions VTOL_2.0.0/Pages/Page_Thunderstore.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,15 @@ public Page_Thunderstore()
};
worker.RunWorkerCompleted += (sender, eventArgs) =>
{
DispatchIfNecessary(async () =>
{
Couunter_Mods.Content = _updater.Thunderstore.Count().ToString();
//(TODO)fix placement
Loading_Ring.Visibility = Visibility.Hidden;
Loading_Ring.Visibility = Visibility.Hidden;
});
page_loaded = true;
};
Expand Down Expand Up @@ -1180,28 +1187,15 @@ private void Grid_MouseLeave(object sender, MouseEventArgs e)

protected void SomeWorkerThread(object o)
{
//int i = 0;
//while (true)
//{

DispatchIfNecessary(async () =>
{
foreach (var TS_MOD in _updater.Thunderstore)
{
AsyncLoadListViewItem(TS_MOD, false, "#");
}
});
//Legacy Grid_ Card = LoadListViewItem(TS_MOD, Search_, SearchQuery.Replace(" ", "_"));
// if (Card != null)
// {
// Thunderstore_List.Items.Add(Card);
// // ReplaceLoadingCardWithMod(Card);

//}




// }

}
public async Task Call_Ts_Mods()
{
Expand All @@ -1215,82 +1209,24 @@ public async Task Call_Ts_Mods()
List<Grid_> List = null;
_updater = new Updater("https://northstar.thunderstore.io/api/v1/package/");

//var NON_UI = new Thread(() =>
//{
_updater.Download_Cutom_JSON();
if (_updater.Thunderstore != null)
{
if (_updater.Thunderstore.Count() > 0)
{
if (_updater.Thunderstore.Count() > 0)
DispatchIfNecessary(async () =>
{
DispatchIfNecessary(async () =>
{
Thunderstore_List.Items.Clear();
// loadConvertItemLazy();
Thread t = new Thread(new ParameterizedThreadStart(SomeWorkerThread));
t.Start();
}); //if (Search_ == false)
//{
// if (tickle == false)
// {
// DispatchIfNecessary(async () =>
// {
// List = orderlist(LoadListViewData(Filter_Type, Search_, SearchQuery.Replace(" ", "_")));

// });
// }
// else
// {
// DispatchIfNecessary(async () =>
// {

// List = orderlist(LoadListViewData(Filter_Type, Search_, SearchQuery.Replace(" ", "_")));
// });


// }



//}
//else
//{

// List = LoadListViewData(Filter_Type, Search_, SearchQuery.Replace(" ", "_"));
Thunderstore_List.Items.Clear();
Thread t = new Thread(new ParameterizedThreadStart(SomeWorkerThread));
t.Start();
//}
});


}
}

//});
//NON_UI.IsBackground = true;

//NON_UI.Start();
//NON_UI.Join();









//DispatchIfNecessary(async () =>
//{
// itemsList = Thunderstore_List.Items.Cast<Grid_>().ToList();
// // Thunderstore_List.ItemsSource = List;
// Loading_Ring.Visibility = Visibility.Hidden;

//});





}


init = true;
Expand Down Expand Up @@ -1756,7 +1692,7 @@ public void orderlistitems()
List<Grid_> List = itemsList;
if (Sort.SelectedItem != null && List != null)
{
string value = Sort.SelectedItem.ToString().Replace("System.Windows.Controls.ComboBoxItem:", "").Trim();
string value = Convert.ToString(Sort.SelectedValue);

if (Reverse_ == true)
{
Expand Down Expand Up @@ -3543,7 +3479,7 @@ public async Task Unpack_To_Location_Custom(string Target_Zip, string Destinatio
// Convert back to JSON string
string updatedJson = JsonConvert.SerializeObject(jsonObject, Formatting.Indented);

// Write back to the file
// Write back to the fileorder
File.WriteAllText(Json_Path, updatedJson);

}
Expand Down Expand Up @@ -4715,7 +4651,7 @@ private void Page_Loaded_1(object sender, RoutedEventArgs e)
{
From = Main.Progress_Header.Opacity,
To = 1,
Duration = new Duration(TimeSpan.FromSeconds(0.2)),
Duration = new Duration(TimeSpan.FromSeconds(0.25)),
AutoReverse = false
};
Main.Progress_Header.BeginAnimation(OpacityProperty, da);
Expand Down Expand Up @@ -4768,11 +4704,15 @@ private void Thunderstore_Grid_Panel_Loaded(object sender, RoutedEventArgs e)
}
else
{
DoubleAnimation x = new DoubleAnimation
{
};
Card_Action.BeginAnimation(OpacityProperty, x);
//DoubleAnimation x = new DoubleAnimation
//{
// From = Card_Action.Opacity,
// To = 0,
// Duration = new Duration(TimeSpan.FromSeconds(0.2)),
// AutoReverse = false
//};
//Card_Action.BeginAnimation(OpacityProperty, x);
Card_Action.IsEnabled = false;
Card_Action.Icon = Wpf.Ui.Common.SymbolRegular.BoxMultiple20;
Expand Down Expand Up @@ -4966,6 +4906,10 @@ private void Page_Unloaded(object sender, RoutedEventArgs e)
}
Main.Progress_Header.IsHitTestVisible = false;
Main.Action_Center_Panel.IsHitTestVisible = false;
Main.Action_Center_Panel.Visibility = Visibility.Collapsed;
Main.Action_Center_Progress.IsChecked = false;
}
await SaveHSetAsync();
});
Expand Down

0 comments on commit 18f98bb

Please sign in to comment.