-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModManagerPage.xaml
More file actions
314 lines (294 loc) · 21.8 KB
/
ModManagerPage.xaml
File metadata and controls
314 lines (294 loc) · 21.8 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="WorkshopUploader.ModManagerPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:models="clr-namespace:WorkshopUploader.Models"
xmlns:l="clr-namespace:WorkshopUploader.Localization"
Title="{l:Translate Key=Mod_Headline}">
<ContentPage.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</ContentPage.Resources>
<Grid RowDefinitions="Auto,Auto,*" Padding="0" RowSpacing="0">
<!-- Header -->
<Grid Grid.Row="0" Padding="24,24,24,12" ColumnDefinitions="*,Auto" ColumnSpacing="12">
<VerticalStackLayout Grid.Column="0" Spacing="6">
<Label Style="{StaticResource Headline}" Text="{l:Translate Key=Mod_Headline}" />
<Label Style="{StaticResource SubHeadline}" Text="{l:Translate Key=Mod_Subtitle}" />
</VerticalStackLayout>
<Button
Grid.Column="1"
Clicked="OnRefreshCurrentTab"
Style="{StaticResource SecondaryButton}"
Text="{l:Translate Key=Refresh}"
VerticalOptions="Start" />
</Grid>
<!-- Segment Control (internal tabs) -->
<Grid Grid.Row="1" Padding="24,0,24,12" ColumnDefinitions="*,*,*,*" ColumnSpacing="6">
<Button x:Name="TabStore" Grid.Column="0" Text="{l:Translate Key=Mod_Store}" Clicked="OnTabStore" />
<Button x:Name="TabInstalled" Grid.Column="1" Text="{l:Translate Key=Mod_Installed}" Style="{StaticResource SecondaryButton}" Clicked="OnTabInstalled" />
<Button x:Name="TabFavorites" Grid.Column="2" Text="{l:Translate Key=Mod_Favorites}" Style="{StaticResource SecondaryButton}" Clicked="OnTabFavorites" />
<Button x:Name="TabHealth" Grid.Column="3" Text="{l:Translate Key=Mod_Health}" Style="{StaticResource SecondaryButton}" Clicked="OnTabHealth" />
</Grid>
<!-- Tab content area -->
<Grid Grid.Row="2" Padding="24,0,24,24">
<!-- STORE TAB -->
<VerticalStackLayout x:Name="StoreView" IsVisible="True" Spacing="12">
<!-- Search + filters -->
<Grid ColumnDefinitions="*,Auto" ColumnSpacing="8">
<Entry x:Name="SearchEntry" Grid.Column="0" Placeholder="{l:Translate Key=Mod_SearchPlaceholder}" ReturnCommand="{x:Null}" Completed="OnSearchSubmit" />
<Button Grid.Column="1" Text="{l:Translate Key=Search}" Clicked="OnSearchSubmit" />
</Grid>
<Grid ColumnDefinitions="*,*" ColumnSpacing="8">
<Picker x:Name="TagFilter" Grid.Column="0" Title="{l:Translate Key=Mod_FilterByTag}" SelectedIndexChanged="OnFilterChanged">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>All</x:String>
<x:String>vanilla</x:String>
<x:String>modded</x:String>
<x:String>melonloader</x:String>
<x:String>fmf</x:String>
<x:String>framework</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
<Picker x:Name="SortPicker" Grid.Column="1" Title="{l:Translate Key=Mod_SortBy}" SelectedIndexChanged="OnFilterChanged">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Last Updated</x:String>
<x:String>Newest</x:String>
<x:String>Top Rated</x:String>
<x:String>Trending</x:String>
<x:String>Most Subscribed</x:String>
<x:String>Title A-Z</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</Grid>
<Label x:Name="StoreStatusLabel" FontSize="11" TextColor="#5A9E96" />
<CollectionView x:Name="StoreList" SelectionMode="None">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical" Span="2" HorizontalItemSpacing="12" VerticalItemSpacing="12" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="models:WorkshopItemDetailVm">
<Border Padding="12" Margin="0,0,0,6" StrokeThickness="0" BackgroundColor="#001715">
<Border.StrokeShape>
<RoundRectangle CornerRadius="8" />
</Border.StrokeShape>
<Border.GestureRecognizers>
<TapGestureRecognizer Tapped="OnStoreItemTapped" />
</Border.GestureRecognizers>
<Grid ColumnDefinitions="56,*,Auto" ColumnSpacing="12">
<Border Grid.Column="0" StrokeThickness="0" BackgroundColor="#001E1C"
HeightRequest="56" WidthRequest="56">
<Border.StrokeShape>
<RoundRectangle CornerRadius="6" />
</Border.StrokeShape>
<Image Source="{Binding PreviewImageSource}" Aspect="AspectFill" />
</Border>
<VerticalStackLayout Grid.Column="1" Spacing="3" VerticalOptions="Center">
<Label FontAttributes="Bold" FontSize="14" TextColor="#C0FCF6" LineBreakMode="TailTruncation" Text="{Binding Title}" />
<HorizontalStackLayout Spacing="6">
<Label FontSize="10" TextColor="{Binding SourceColor}" Text="{Binding SourceLabel}"
BackgroundColor="#001E1C" Padding="5,1" />
<Label FontSize="11" TextColor="#7FBFB8" Text="{Binding OwnerName}" />
</HorizontalStackLayout>
<HorizontalStackLayout Spacing="10">
<Label FontSize="10" TextColor="#5A9E96" Text="{Binding NumSubscriptions, StringFormat='Subs: {0}'}" />
<Label FontSize="10" TextColor="#5A9E96" Text="{Binding Score, StringFormat='Score: {0:P0}'}" />
</HorizontalStackLayout>
<Label
FontSize="10"
LineBreakMode="WordWrap"
MaxLines="4"
TextColor="#D7A23B"
Text="{Binding DependencyHintCompact}"
IsVisible="{Binding HasDependencyHints}" />
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="2" VerticalOptions="Center" Spacing="4">
<Button Text="{l:Translate Key=Mod_Subscribe}" Clicked="OnQuickSubscribe" Padding="10,4" FontSize="11" />
</VerticalStackLayout>
</Grid>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<!-- Pagination -->
<HorizontalStackLayout x:Name="StorePagination" Spacing="8" HorizontalOptions="Center">
<Button x:Name="StorePrevBtn" Text="{l:Translate Key=Previous}" Style="{StaticResource SecondaryButton}" Clicked="OnStorePrev" IsEnabled="False" />
<Label x:Name="StorePageLabel" FontSize="12" TextColor="#7FBFB8" VerticalOptions="Center" />
<Button x:Name="StoreNextBtn" Text="{l:Translate Key=Next}" Style="{StaticResource SecondaryButton}" Clicked="OnStoreNext" IsEnabled="False" />
</HorizontalStackLayout>
</VerticalStackLayout>
<!-- INSTALLED TAB -->
<VerticalStackLayout x:Name="InstalledView" IsVisible="False" Spacing="12">
<Label x:Name="InstalledStatusLabel" FontSize="11" TextColor="#5A9E96" />
<CollectionView x:Name="InstalledList" SelectionMode="None">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="models:WorkshopItemDetailVm">
<Border Padding="12" Margin="0,0,0,6" StrokeThickness="0" BackgroundColor="#001715">
<Border.StrokeShape>
<RoundRectangle CornerRadius="8" />
</Border.StrokeShape>
<Border.GestureRecognizers>
<TapGestureRecognizer Tapped="OnStoreItemTapped" />
</Border.GestureRecognizers>
<Grid ColumnDefinitions="56,*,Auto,Auto" ColumnSpacing="10">
<Border Grid.Column="0" StrokeThickness="0" BackgroundColor="#001E1C"
HeightRequest="56" WidthRequest="56">
<Border.StrokeShape>
<RoundRectangle CornerRadius="6" />
</Border.StrokeShape>
<Image Source="{Binding PreviewImageSource}" Aspect="AspectFill" />
</Border>
<VerticalStackLayout Grid.Column="1" Spacing="3" VerticalOptions="Center">
<Label FontAttributes="Bold" FontSize="14" TextColor="#C0FCF6" LineBreakMode="TailTruncation" Text="{Binding Title}" />
<HorizontalStackLayout Spacing="6">
<Label FontSize="10" TextColor="{Binding SourceColor}" Text="{Binding SourceLabel}"
BackgroundColor="#001E1C" Padding="5,1" />
<Label FontSize="10" TextColor="#5A9E96" Text="{Binding Updated, StringFormat='Updated: {0:d}'}" />
</HorizontalStackLayout>
</VerticalStackLayout>
<Label Grid.Column="2" FontSize="10" TextColor="#D7A23B" VerticalOptions="Center"
Text="{Binding NeedsUpdate, StringFormat='Update: {0}'}" />
<Button Grid.Column="3" Text="{l:Translate Key=Mod_Unsubscribe}" Clicked="OnQuickUnsubscribe"
Style="{StaticResource SecondaryButton}" Padding="10,4" FontSize="11" VerticalOptions="Center" />
</Grid>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<HorizontalStackLayout x:Name="InstalledPagination" Spacing="8" HorizontalOptions="Center">
<Button x:Name="InstalledPrevBtn" Text="{l:Translate Key=Previous}" Style="{StaticResource SecondaryButton}" Clicked="OnInstalledPrev" IsEnabled="False" />
<Label x:Name="InstalledPageLabel" FontSize="12" TextColor="#7FBFB8" VerticalOptions="Center" />
<Button x:Name="InstalledNextBtn" Text="{l:Translate Key=Next}" Style="{StaticResource SecondaryButton}" Clicked="OnInstalledNext" IsEnabled="False" />
</HorizontalStackLayout>
</VerticalStackLayout>
<!-- FAVORITES TAB -->
<VerticalStackLayout x:Name="FavoritesView" IsVisible="False" Spacing="12">
<Label x:Name="FavoritesStatusLabel" FontSize="11" TextColor="#5A9E96" />
<CollectionView x:Name="FavoritesList" SelectionMode="None">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="models:WorkshopItemDetailVm">
<Border Padding="12" Margin="0,0,0,6" StrokeThickness="0" BackgroundColor="#001715">
<Border.StrokeShape>
<RoundRectangle CornerRadius="8" />
</Border.StrokeShape>
<Border.GestureRecognizers>
<TapGestureRecognizer Tapped="OnStoreItemTapped" />
</Border.GestureRecognizers>
<Grid ColumnDefinitions="56,*,Auto" ColumnSpacing="10">
<Border Grid.Column="0" StrokeThickness="0" BackgroundColor="#001E1C"
HeightRequest="56" WidthRequest="56">
<Border.StrokeShape>
<RoundRectangle CornerRadius="6" />
</Border.StrokeShape>
<Image Source="{Binding PreviewImageSource}" Aspect="AspectFill" />
</Border>
<VerticalStackLayout Grid.Column="1" Spacing="3" VerticalOptions="Center">
<Label FontAttributes="Bold" FontSize="14" TextColor="#C0FCF6" LineBreakMode="TailTruncation" Text="{Binding Title}" />
<HorizontalStackLayout Spacing="6">
<Label FontSize="10" TextColor="{Binding SourceColor}" Text="{Binding SourceLabel}"
BackgroundColor="#001E1C" Padding="5,1" />
<Label FontSize="11" TextColor="#7FBFB8" Text="{Binding OwnerName}" />
</HorizontalStackLayout>
</VerticalStackLayout>
<Button Grid.Column="2" Text="{l:Translate Key=Mod_Unfavorite}" Clicked="OnQuickUnfavorite"
Style="{StaticResource SecondaryButton}" Padding="10,4" FontSize="11" VerticalOptions="Center" />
</Grid>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<HorizontalStackLayout x:Name="FavoritesPagination" Spacing="8" HorizontalOptions="Center">
<Button x:Name="FavoritesPrevBtn" Text="{l:Translate Key=Previous}" Style="{StaticResource SecondaryButton}" Clicked="OnFavoritesPrev" IsEnabled="False" />
<Label x:Name="FavoritesPageLabel" FontSize="12" TextColor="#7FBFB8" VerticalOptions="Center" />
<Button x:Name="FavoritesNextBtn" Text="{l:Translate Key=Next}" Style="{StaticResource SecondaryButton}" Clicked="OnFavoritesNext" IsEnabled="False" />
</HorizontalStackLayout>
</VerticalStackLayout>
<!-- HEALTH TAB -->
<ScrollView x:Name="HealthView" IsVisible="False">
<VerticalStackLayout Spacing="16">
<!-- Dependency health -->
<Border Padding="20" StrokeThickness="0" BackgroundColor="#001715">
<Border.StrokeShape>
<RoundRectangle CornerRadius="8" />
</Border.StrokeShape>
<VerticalStackLayout Spacing="12">
<Grid ColumnDefinitions="*,Auto">
<Label Grid.Column="0" Style="{StaticResource SectionTitle}" Text="{l:Translate Key=Mod_DependencyHealth}" VerticalOptions="Center" />
<Button Grid.Column="1" Clicked="OnRefreshChecks" Style="{StaticResource SecondaryButton}" Text="{l:Translate Key=Mod_Check}" VerticalOptions="Center" />
</Grid>
<CollectionView x:Name="ChecksList" SelectionMode="None">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="models:DependencyCheckResult">
<Grid Padding="0,6" ColumnDefinitions="Auto,*,Auto" ColumnSpacing="12">
<Ellipse Grid.Column="0" WidthRequest="10" HeightRequest="10" VerticalOptions="Center" />
<VerticalStackLayout Grid.Column="1" Spacing="3">
<Label FontAttributes="Bold" FontSize="13" TextColor="#C0FCF6" Text="{Binding Label}" />
<Label FontSize="11" TextColor="#5A9E96" LineBreakMode="TailTruncation" MaxLines="2" Text="{Binding Detail}" />
</VerticalStackLayout>
<Button Grid.Column="2" Clicked="OnOpenFolder" CommandParameter="{Binding Path}"
Style="{StaticResource TertiaryButton}" Text="{l:Translate Key=Open}" VerticalOptions="Center" />
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</Border>
<!-- MelonLoader -->
<Border Padding="20" StrokeThickness="0" BackgroundColor="#001715">
<Border.StrokeShape>
<RoundRectangle CornerRadius="8" />
</Border.StrokeShape>
<VerticalStackLayout Spacing="10">
<Label Style="{StaticResource SectionTitle}" Text="{l:Translate Key=Mod_MelonLoader}" />
<Label x:Name="MelonStatusLabel" FontSize="12" TextColor="#7FBFB8" Text="{l:Translate Key=Mod_CheckingStatus}" />
<HorizontalStackLayout Spacing="8">
<Button Clicked="OnMelonLoaderDownload" Text="{l:Translate Key=Mod_DownloadPage}" />
<Button Clicked="OnOpenGameFolder" Style="{StaticResource SecondaryButton}" Text="{l:Translate Key=Mod_GameFolder}" />
</HorizontalStackLayout>
</VerticalStackLayout>
</Border>
<!-- Plugin channel -->
<Border Padding="20" StrokeThickness="0" BackgroundColor="#001715">
<Border.StrokeShape>
<RoundRectangle CornerRadius="8" />
</Border.StrokeShape>
<VerticalStackLayout Spacing="10">
<Label Style="{StaticResource SectionTitle}" Text="{l:Translate Key=Mod_PluginChannel}" />
<HorizontalStackLayout Spacing="12" VerticalOptions="Center">
<Label FontSize="12" TextColor="#7FBFB8" Text="{l:Translate Key=Mod_Channel}" VerticalOptions="Center" />
<Picker x:Name="ChannelPicker" WidthRequest="200" SelectedIndexChanged="OnChannelChanged">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Stable</x:String>
<x:String>Beta (experimental)</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</HorizontalStackLayout>
<Label x:Name="ChannelInfoLabel" FontSize="11" TextColor="#5A9E96" Text="Stable: official channel." />
<CollectionView x:Name="PluginsList" SelectionMode="None">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="models:PluginPackageInfo">
<Grid Padding="8,6" ColumnDefinitions="*,Auto,Auto" ColumnSpacing="12" BackgroundColor="#001E1C" Margin="0,2">
<Label Grid.Column="0" FontSize="13" TextColor="#C0FCF6" Text="{Binding PluginId}" VerticalOptions="Center" />
<Label Grid.Column="1" FontSize="11" TextColor="#5A9E96" Text="{Binding Version}" VerticalOptions="Center" />
<Label Grid.Column="2" FontSize="10" TextColor="#3ABFA8" Text="{Binding Channel}" VerticalOptions="Center" />
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</Border>
</VerticalStackLayout>
</ScrollView>
</Grid>
</Grid>
</ContentPage>