Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
CommunityContentScreen.cs
浏览该文件的文档.
1using System.Text.Json;
2using System.Xml.Linq;
3using Engine;
6using SixLabors.ImageSharp;
7using SixLabors.ImageSharp.PixelFormats;
8using SixLabors.ImageSharp.Processing;
10
11namespace Game {
19
25
41
42 public object m_filter;
43 public Order m_order;
45 public double m_contentExpiryTime;
46
47 public bool m_isOwn;
48 public bool m_isAdmin;
49 public bool m_isCNLanguageType;
50
51 public Dictionary<string, IEnumerable<object>> m_itemsCache = [];
52
54
55 public const string fName = "CommunityContentScreen";
56
58 XElement node = ContentManager.Get<XElement>("Screens/CommunityContentScreen");
59 LoadContents(this, node);
60 m_treePanel = Children.Find<TreeViewWidget>("Tree");
61 m_orderLabel = Children.Find<LabelWidget>("Order");
62 m_changeOrderButton = Children.Find<ButtonWidget>("ChangeOrder");
63 m_filterLabel = Children.Find<LabelWidget>("Filter");
64 m_changeFilterButton = Children.Find<ButtonWidget>("ChangeFilter");
65 m_downloadButton = Children.Find<ButtonWidget>("Download");
66 m_actionButton = Children.Find<ButtonWidget>("Action");
67 m_action2Button = Children.Find<ButtonWidget>("Action2");
68 m_webPageButton = Children.Find<ButtonWidget>("WebPage");
69 m_loginButton = Children.Find<ButtonWidget>("Login");
70 m_inputKey = Children.Find<TextBoxWidget>("key");
71 m_placeHolder = Children.Find<LabelWidget>("placeholder");
72 m_clearSearchLink = Children.Find<LinkWidget>("ClearSearchLink");
73 m_searchKey = Children.Find<ButtonWidget>("Search");
74 m_searchTypeButton = Children.Find<ButtonWidget>("SearchType");
75 m_searchType = SearchType.ByName;
76 /*
77 m_treePanel.ItemWidgetFactory = delegate (object item)
78 {
79 var communityContentEntry = item as CommunityContentEntry;
80 if (communityContentEntry != null)
81 {
82 XElement node2 = ContentManager.Get<XElement>("Widgets/CommunityContentItem");
83 var obj = (ContainerWidget)LoadWidget(this, node2, null);
84 communityContentEntry.IconInstance = obj.Children.Find<RectangleWidget>("CommunityContentItem.Icon");
85 communityContentEntry.IconInstance.Subtexture = communityContentEntry.Icon == null ? ExternalContentManager.GetEntryTypeIcon(communityContentEntry.Type) : new Subtexture(communityContentEntry.Icon, Vector2.Zero, Vector2.One);
86 obj.Children.Find<LabelWidget>("CommunityContentItem.Text").Text = communityContentEntry.Name;
87 Color txtColor = Color.White;
88 if (communityContentEntry.Boutique > 0)
89 {
90 txtColor = new Color(255, 215, 0);
91 }
92 if (m_isOwn && communityContentEntry.IsShow == 0)
93 {
94 txtColor = Color.Gray;
95 }
96 obj.Children.Find<LabelWidget>("CommunityContentItem.Text").Color = txtColor;
97 obj.Children.Find<LabelWidget>("CommunityContentItem.Details").Text = $"{ExternalContentManager.GetEntryTypeDescription(communityContentEntry.Type)} {DataSizeFormatter.Format(communityContentEntry.Size)}";
98 obj.Children.Find<StarRatingWidget>("CommunityContentItem.Rating").Rating = communityContentEntry.RatingsAverage;
99 obj.Children.Find<StarRatingWidget>("CommunityContentItem.Rating").IsVisible = communityContentEntry.RatingsAverage > 0f;
100 obj.Children.Find<LabelWidget>("CommunityContentItem.ExtraText").Text = communityContentEntry.ExtraText;
101 return obj;
102 }
103 XElement node3 = ContentManager.Get<XElement>("Widgets/CommunityContentItemMore");
104 var containerWidget = (ContainerWidget)LoadWidget(this, node3, null);
105 m_moreLink = containerWidget.Children.Find<LinkWidget>("CommunityContentItemMore.Link");
106 m_moreLink.Tag = item as string;
107 return containerWidget;
108 };
109 m_treePanel.SelectionChanged += delegate
110 {
111 if (m_treePanel.SelectedItem != null && !(m_treePanel.SelectedItem is CommunityContentEntry))
112 {
113 m_treePanel.SelectedItem = null;
114 }
115 };
116 */
117 }
118
119 public override void Enter(object[] parameters) {
121 if (provider is SchubExternalContentProvider contentProvider) {
122 m_provider = contentProvider;
123 break;
124 }
125 }
126 if (parameters.Length > 0
127 && parameters[0].ToString() == "Mod") {
129 }
130 else {
131 m_filter = string.Empty;
132 }
133 m_order = Order.ByRank;
134 m_inputKey.Text = string.Empty;
135 m_isOwn = false;
136 string languageType = !ModsManager.Configs.TryGetValue("Language", out string value) ? "zh-CN" : value;
137 m_isCNLanguageType = languageType == "zh-CN";
140 delegate(bool isAdmin) { m_isAdmin = isAdmin; },
141 delegate(Exception e) {
143 }
144 );
145 PopulateList(null);
146 }
147
148 public override void Update() {
149 m_placeHolder.IsVisible = string.IsNullOrEmpty(m_inputKey.Text);
150 m_clearSearchLink.IsVisible = !string.IsNullOrEmpty(m_inputKey.Text) || m_inputKey.HasFocus;
151 m_actionButton.IsVisible = m_isAdmin || m_isOwn;
152 m_action2Button.IsVisible = m_isAdmin || m_isOwn;
153 if (!m_isCNLanguageType) {
154 m_actionButton.IsVisible = false;
155 m_action2Button.IsVisible = false;
156 m_webPageButton.IsVisible = false;
157 }
158 CommunityContentEntry communityContentEntry = m_treePanel.SelectedNode?.Tag as CommunityContentEntry;
159 m_downloadButton.IsEnabled = communityContentEntry != null;
160 if (communityContentEntry != null) {
161 m_actionButton.IsEnabled = m_isAdmin || m_isOwn;
162 m_actionButton.Text = m_order == Order.ByHide || m_isOwn ? LanguageControl.Get(fName, 23) :
163 communityContentEntry.Boutique == 0 ? LanguageControl.Get(fName, 15) : LanguageControl.Get(fName, 16);
164 m_action2Button.IsEnabled = m_filter.ToString() != "Mod" && (m_isAdmin || m_isOwn);
165 }
166 else {
167 m_actionButton.IsEnabled = false;
168 m_action2Button.IsEnabled = false;
169 m_actionButton.Text = LanguageControl.Get(fName, 17);
170 }
171 if (m_isOwn) {
172 m_searchType = SearchType.ByName;
173 m_searchTypeButton.IsEnabled = false;
174 }
175 else {
176 m_searchTypeButton.IsEnabled = true;
177 }
178 m_action2Button.Text = communityContentEntry != null && communityContentEntry.IsShow == 0
181 m_orderLabel.Text = GetOrderDisplayName(m_order);
182 m_filterLabel.Text = GetFilterDisplayName(m_filter);
183 m_searchTypeButton.Text = GetSearchTypeDisplayName(m_searchType);
184 if (m_changeOrderButton.IsClicked) {
185 List<Order> items = EnumUtils.GetEnumValues<Order>().Cast<Order>().ToList();
186 if (!m_isAdmin) {
187 items.Remove(Order.ByHide);
188 }
190 null,
192 LanguageControl.Get(fName, "Order Type"),
193 items,
194 60f,
195 item => GetOrderDisplayName((Order)item),
196 delegate(object item) {
197 m_order = (Order)item;
198 PopulateList(null, true);
199 }
200 )
201 );
202 }
203 if (m_searchKey.IsClicked) {
204 PopulateList(null);
205 }
206 if (m_changeFilterButton.IsClicked) {
207 List<object> list = [string.Empty];
210 select t) {
211 list.Add(item);
212 }
213 if (!string.IsNullOrEmpty(SettingsManager.ScpboxAccessToken)) {
215 }
217 null,
219 LanguageControl.Get(fName, "Filter"),
220 list,
221 60f,
223 delegate(object item) {
224 m_filter = item;
225 m_isOwn = item is string str && !string.IsNullOrEmpty(str);
226 PopulateList(null, true);
227 }
228 )
229 );
230 }
231 if (m_clearSearchLink.IsClicked) {
232 m_inputKey.Text = string.Empty;
233 PopulateList(null);
234 }
235 if (m_downloadButton.IsClicked
236 && communityContentEntry != null) {
237 DownloadEntry(communityContentEntry);
238 }
239 if (m_actionButton.IsClicked
240 && communityContentEntry != null) {
241 if (m_order == Order.ByHide || m_isOwn) {
243 null,
244 new MessageDialog(
246 communityContentEntry.Name,
249 delegate(MessageDialogButton button) {
250 if (button == MessageDialogButton.Button1) {
251 CancellableBusyDialog busyDialog = new(LanguageControl.Get(fName, 2), false);
252 DialogsManager.ShowDialog(null, busyDialog);
254 communityContentEntry.Index,
255 busyDialog.Progress,
256 delegate(byte[] data) {
257 DialogsManager.HideDialog(busyDialog);
258 m_treePanel.RemoveAtTag(communityContentEntry);
259 JsonElement result = JsonDocument.Parse(data, JsonDocumentReader.DefaultJsonOptions).RootElement;
260 string msg = result[0].GetInt32() == 200
261 ? LanguageControl.Get(fName, 27) + communityContentEntry.Name
262 : result[1].GetString();
264 null,
265 new MessageDialog(LanguageControl.Get(fName, 20), msg, LanguageControl.Ok, null, null)
266 );
267 },
268 delegate(Exception e) {
269 DialogsManager.HideDialog(busyDialog);
271 null,
272 new MessageDialog(LanguageControl.Error, e.Message, LanguageControl.Ok, null, null)
273 );
274 }
275 );
276 }
277 }
278 )
279 );
280 }
281 else {
282 if (communityContentEntry.Boutique == 0) {
284 null,
285 new TextBoxDialog(
287 "5",
288 4,
289 delegate(string s) {
290 if (!string.IsNullOrEmpty(s)) {
291 int boutique = 5;
292 try {
293 boutique = int.Parse(s);
294 }
295 catch {
296 // ignored
297 }
298 CancellableBusyDialog busyDialog = new(LanguageControl.Get(fName, 2), false);
299 DialogsManager.ShowDialog(null, busyDialog);
301 communityContentEntry.Type.ToString(),
302 communityContentEntry.Index,
303 boutique,
304 busyDialog.Progress,
305 delegate(byte[] data) {
306 DialogsManager.HideDialog(busyDialog);
307 m_order = Order.ByBoutique;
308 PopulateList(null, true);
309 JsonElement result = JsonDocument.Parse(data, JsonDocumentReader.DefaultJsonOptions).RootElement;
310 string msg = result[0].GetInt32() == 200
311 ? LanguageControl.Get(fName, 19) + communityContentEntry.Name
312 : result[1].GetString();
314 null,
315 new MessageDialog(LanguageControl.Get(fName, 20), msg, LanguageControl.Ok, null, null)
316 );
317 },
318 delegate(Exception e) {
319 DialogsManager.HideDialog(busyDialog);
321 null,
322 new MessageDialog(LanguageControl.Error, e.Message, LanguageControl.Ok, null, null)
323 );
324 }
325 );
326 }
327 }
328 )
329 );
330 }
331 else {
333 null,
334 new MessageDialog(
336 communityContentEntry.Name,
339 delegate(MessageDialogButton button) {
340 if (button == MessageDialogButton.Button1) {
341 CancellableBusyDialog busyDialog = new(LanguageControl.Get(fName, 2), false);
342 DialogsManager.ShowDialog(null, busyDialog);
344 communityContentEntry.Type.ToString(),
345 communityContentEntry.Index,
346 0,
347 busyDialog.Progress,
348 delegate(byte[] data) {
349 DialogsManager.HideDialog(busyDialog);
350 PopulateList(null, true);
351 JsonElement result = JsonDocument.Parse(data, JsonDocumentReader.DefaultJsonOptions).RootElement;
352 string msg = result[0].GetInt32() == 200
353 ? LanguageControl.Get(fName, 22) + communityContentEntry.Name
354 : result[1].GetString();
356 null,
357 new MessageDialog(LanguageControl.Get(fName, 20), msg, LanguageControl.Ok, null, null)
358 );
359 },
360 delegate(Exception e) {
361 DialogsManager.HideDialog(busyDialog);
363 null,
364 new MessageDialog(LanguageControl.Error, e.Message, LanguageControl.Ok, null, null)
365 );
366 }
367 );
368 }
369 }
370 )
371 );
372 }
373 }
374 }
375 if (m_action2Button.IsClicked
376 && communityContentEntry != null) {
377 CancellableBusyDialog busyDialog = new(LanguageControl.Get(fName, 2), false);
378 DialogsManager.ShowDialog(null, busyDialog);
379 int isShow = (communityContentEntry.IsShow + 1) % 2;
380 string sucessMsg = isShow == 1 ? LanguageControl.Get(fName, 28) : LanguageControl.Get(fName, 29);
382 communityContentEntry.Index,
383 isShow,
384 busyDialog.Progress,
385 delegate(byte[] data) {
386 DialogsManager.HideDialog(busyDialog);
387 if (!m_isOwn) {
388 m_treePanel.RemoveAtTag(communityContentEntry);
389 }
390 else {
391 PopulateList(null, true);
392 }
393 JsonElement result = JsonDocument.Parse(data, JsonDocumentReader.DefaultJsonOptions).RootElement;
394 string msg = result[0].GetInt32() == 200 ? sucessMsg + communityContentEntry.Name : result[1].GetString();
396 null,
397 new MessageDialog(LanguageControl.Get(fName, 20), msg, LanguageControl.Ok, null, null)
398 );
399 },
400 delegate(Exception e) {
401 DialogsManager.HideDialog(busyDialog);
403 }
404 );
405 }
406 if (m_webPageButton.IsClicked) {
408 }
409 if (m_searchTypeButton.IsClicked) {
410 if (m_isAdmin) {
411 if (m_searchType == SearchType.ByName) {
412 m_searchType = SearchType.ByAuthor;
413 }
414 else if (m_searchType == SearchType.ByAuthor) {
415 m_searchType = SearchType.ByUserId;
416 }
417 else if (m_searchType == SearchType.ByUserId) {
418 m_searchType = SearchType.ByName;
419 }
420 }
421 else {
422 if (m_searchType == SearchType.ByName) {
423 m_searchType = SearchType.ByAuthor;
424 }
425 else if (m_searchType == SearchType.ByAuthor) {
426 m_searchType = SearchType.ByName;
427 }
428 else if (m_searchType == SearchType.ByUserId) {
429 m_searchType = SearchType.ByName;
430 }
431 }
432 }
433 if (m_loginButton.IsClicked) {
434 //DialogsManager.ShowDialog(null, new MoreCommunityLinkDialog());
435 if (m_provider.IsLoggedIn) {
436 string info = string.IsNullOrEmpty(SettingsManager.ScpboxUserInfo) ? "暂无用户信息" : SettingsManager.ScpboxUserInfo;
438 null,
439 new MessageDialog(
440 "账号已登录,是否登出?",
441 info,
444 delegate(MessageDialogButton button) {
445 if (button == MessageDialogButton.Button1) {
446 m_provider.Logout();
447 }
448 }
449 )
450 );
451 }
452 else {
454 }
455 }
456 if (Input.Back
457 || Children.Find<BevelledButtonWidget>("TopBar.Back").IsClicked) {
458 ScreensManager.SwitchScreen("Content");
459 }
460 if (Input.Hold.HasValue
461 && Input.HoldTime > 2f
462 && Input.Hold.Value.Y < 20f) {
464 Task.Delay(250).Wait();
465 }
466 }
467
468 public void PopulateList(string cursor, bool force = false) {
469 string text = string.Empty;
471 text = "1";
472 }
474 text = "0";
475 }
476 string text2 = m_filter is string s ? s : string.Empty;
477 string text3 = m_filter is ExternalContentType ? LanguageControl.Get(fName, m_filter.ToString()) : string.Empty;
478 string text4 = m_order.ToString();
479 string cacheKey = $"{text2}\n{text3}\n{text4}\n{text}\n{m_inputKey.Text}";
480 if (string.IsNullOrEmpty(cursor)
481 && !force) {
482 m_treePanel.ScrollPosition = 0f;
483 if (m_contentExpiryTime != 0.0
485 && m_itemsCache.TryGetValue(cacheKey, out IEnumerable<object> value)) {
486 m_treePanel.Clear(false);
487 foreach (object item in value) //添加
488 {
489 if (item is TreeViewNode treeViewNode) {
490 m_treePanel.AddRoot(treeViewNode);
491 }
492 }
493 return;
494 }
495 m_treePanel.Clear();
496 }
497 if (force) {
498 m_treePanel.Clear();
499 }
500 CancellableBusyDialog busyDialog = new(LanguageControl.Get(fName, 2), false);
501 DialogsManager.ShowDialog(null, busyDialog);
503 cursor,
504 text2,
505 text3,
506 text,
507 text4,
508 m_inputKey.Text,
509 m_searchType.ToString(),
510 busyDialog.Progress,
511 delegate(List<CommunityContentEntry> list, string nextCursor) {
512 DialogsManager.HideDialog(busyDialog);
514 while (m_treePanel.Nodes.Count > 0
515 && m_treePanel.Nodes[^1].Tag is "Load More") //移除原先添加的"加载更多"节点
516 {
517 m_treePanel.Nodes.RemoveAt(m_treePanel.Nodes.Count - 1);
518 }
519 foreach (CommunityContentEntry item2 in list) {
520 TreeViewNode rootNode = m_treePanel.Nodes.FirstOrDefault(x => x.Tag is int id && id == item2.CollectionID);
521 if (rootNode == null) {
522 rootNode = CreateCollectionNode(item2);
523 m_treePanel.AddRoot(rootNode);
524 }
525 rootNode.AddChild(ContentToNode(item2));
526 m_treePanel.m_widgetsDirty = true;
527 if (item2.Icon == null
528 && !string.IsNullOrEmpty(item2.IconSrc)) {
530 item2.IconSrc,
531 null,
532 null,
534 delegate(byte[] data) {
536 delegate {
537 if (data.Length > 0) {
538 try {
539 Image<Rgba32> image = SixLabors.ImageSharp.Image.Load<Rgba32>(data);
540 bool flag = image.Width > image.Height;
541 if (image.Width > 256
542 || image.Height > 256) {
543 image.Mutate(x => x.Resize(flag ? 256 : 0, flag ? 0 : 256, KnownResamplers.Bicubic));
544 }
545 Vector2 iconMargin = Vector2.Zero;
546 if (flag) {
547 float ratio = (float)image.Height / image.Width;
548 iconMargin = new Vector2(0f, (1f - ratio) * 32f);
549 }
550 else if (image.Width < image.Height) {
551 float ratio = (float)image.Width / image.Height;
552 iconMargin = new Vector2((1f - ratio) * 32f, 0f);
553 }
554 Texture2D texture = Texture2D.Load(image);
555 item2.Icon = texture;
556 TreeViewNode linkedNode = item2.LinkedNode;
557 if (linkedNode != null) {
558 linkedNode.Icon = texture; //资源节点的图标
559 linkedNode.IconMargin = iconMargin;
560 TreeViewNode parentNode = item2.LinkedNode.ParentNode;
561 if (parentNode is { Tag: int }
562 && parentNode.Nodes.Last(item3 => item3.Icon != null) == linkedNode) //合集节点的图标
563 {
564 parentNode.Icon = texture;
565 parentNode.IconMargin = iconMargin;
566 }
567 }
568 }
569 catch (Exception) {
570 //System.Diagnostics.Debug.WriteLine(e.Message);
571 }
572 }
573 }
574 );
575 },
576 delegate { }
577 );
578 }
579 else if (item2.LinkedNode != null) {
580 item2.LinkedNode.Icon = item2.Icon;
581 item2.LinkedNode.IconMargin = Vector2.Zero;
582 }
583 }
584 if (list.Count > 0
585 && !string.IsNullOrEmpty(nextCursor)) {
586 //加载更多节点
587 TreeViewNode loadMoreNode = new(LanguageControl.Get(fName, "35"), new Color(64, 192, 64), string.Empty, Color.Transparent);
588 loadMoreNode.Selectable = false;
589 loadMoreNode.Tag = "Load More";
590 loadMoreNode.OnClicked = () => PopulateList(nextCursor);
591 m_treePanel.AddRoot(loadMoreNode);
592 }
593 m_itemsCache[cacheKey] = new List<object>(m_treePanel.Nodes);
594 },
595 delegate(Exception error) {
596 DialogsManager.HideDialog(busyDialog);
597 DialogsManager.ShowDialog(null, new MessageDialog(LanguageControl.Error, error.Message, LanguageControl.Ok, null, null));
598 }
599 );
600 }
601
603 string userId = UserManager.ActiveUser != null ? UserManager.ActiveUser.UniqueId : string.Empty;
604 CancellableBusyDialog busyDialog = new(string.Format(LanguageControl.Get(fName, 1), entry.Name), false);
605 DialogsManager.ShowDialog(null, busyDialog);
607 entry.Address,
608 entry.Name,
609 entry.Type,
610 userId,
611 busyDialog.Progress,
612 delegate { DialogsManager.HideDialog(busyDialog); },
613 delegate(Exception error) {
614 DialogsManager.HideDialog(busyDialog);
615 DialogsManager.ShowDialog(null, new MessageDialog(LanguageControl.Error, error.Message, LanguageControl.Ok, null, null));
616 }
617 );
618 }
619
621 if (UserManager.ActiveUser != null) {
623 null,
624 new MessageDialog(
629 delegate(MessageDialogButton button) {
630 if (button == MessageDialogButton.Button1) {
631 CancellableBusyDialog busyDialog = new(string.Format(LanguageControl.Get(fName, 3), entry.Name), false);
632 DialogsManager.ShowDialog(null, busyDialog);
634 entry.Address,
636 busyDialog.Progress,
637 delegate {
638 DialogsManager.HideDialog(busyDialog);
639 DialogsManager.ShowDialog(
640 null,
641 new MessageDialog(
642 LanguageControl.Get(fName, 6),
643 LanguageControl.Get(fName, 7),
644 LanguageControl.Ok,
645 null,
646 null
647 )
648 );
649 },
650 delegate(Exception error) {
651 DialogsManager.HideDialog(busyDialog);
653 null,
654 new MessageDialog(LanguageControl.Error, error.Message, LanguageControl.Ok, null, null)
655 );
656 }
657 );
658 }
659 }
660 )
661 );
662 }
663 }
664
665 public string GetFilterDisplayName(object filter) => filter is string s ? !string.IsNullOrEmpty(s)
668 filter is ExternalContentType externalContentType ? ExternalContentManager.GetEntryTypeDescription(externalContentType) :
669 throw new InvalidOperationException(LanguageControl.Get(fName, 10));
670
671 public string GetOrderDisplayName(Order order) {
672 return order switch {
677 _ => throw new InvalidOperationException(LanguageControl.Get(fName, 13))
678 };
679 }
680
681 public string GetSearchTypeDisplayName(SearchType searchType) {
682 return searchType switch {
683 SearchType.ByName => m_isCNLanguageType ? "资源名" : "Name",
684 SearchType.ByAuthor => m_isCNLanguageType ? "用户名" : "User",
685 SearchType.ByUserId => m_isCNLanguageType ? "用户ID" : "UID",
686 _ => "null"
687 };
688 }
689
691 string title = contentEntry.Name;
692 string desc =
693 $"{ExternalContentManager.GetEntryTypeDescription(contentEntry.Type)} {DataSizeFormatter.Format(contentEntry.Size)} {contentEntry.ExtraText}";
694 TreeViewNode node = new(title, Color.White, desc, new Color(128, 128, 128), contentEntry.Icon) { Tag = contentEntry };
695 contentEntry.LinkedNode = node;
696 return node;
697 }
698
700 TreeViewNode node =
701 new(contentEntry.CollectionName, Color.White, contentEntry.CollectionDetails, new Color(128, 128, 128)) {
702 Tag = contentEntry.CollectionID
703 };
704 return node;
705 }
706 }
707}
Engine.Color Color
Engine.Media.Image Image
static void Dispatch(Action action, bool waitUntilCompleted=false)
static Texture2D Load(LegacyImage image, int mipLevelsCount=1)
static double RealTime
定义 Time.cs:38
ExternalContentType Type
TreeViewNode LinkedNode
string Name
Texture2D Icon
string CollectionName
string CollectionDetails
int Index
string IconSrc
string Address
int Boutique
int CollectionID
static void UpdateHidePara(int id, int isShow, CancellableProgress progress, Action< byte[]> success, Action< Exception > failure)
static void UpdateBoutique(string type, int id, int boutique, CancellableProgress progress, Action< byte[]> success, Action< Exception > failure)
static void DeleteFile(int id, CancellableProgress progress, Action< byte[]> success, Action< Exception > failure)
static void Download(string address, string name, ExternalContentType type, string userId, CancellableProgress progress, Action success, Action< Exception > failure)
static void List(string cursor, string userFilter, string typeFilter, string moderationFilter, string sortOrder, string keySearch, string searchType, CancellableProgress progress, Action< List< CommunityContentEntry >, string > success, Action< Exception > failure)
static void IsAdmin(CancellableProgress progress, Action< bool > success, Action< Exception > failure)
static void Delete(string address, string userId, CancellableProgress progress, Action success, Action< Exception > failure)
Dictionary< string, IEnumerable< object > > m_itemsCache
void DownloadEntry(CommunityContentEntry entry)
string GetSearchTypeDisplayName(SearchType searchType)
TreeViewNode CreateCollectionNode(CommunityContentEntry contentEntry)
void PopulateList(string cursor, bool force=false)
void DeleteEntry(CommunityContentEntry entry)
override void Enter(object[] parameters)
SchubExternalContentProvider m_provider
TreeViewNode ContentToNode(CommunityContentEntry contentEntry)
readonly WidgetsList Children
static object Get(Type type, string name)
static void HideDialog(Dialog dialog)
static void ShowDialog(ContainerWidget parentWidget, Dialog dialog)
static IList< int > GetEnumValues(Type type)
static bool IsEntryTypeDownloadSupported(ExternalContentType type)
static void ShowLoginUiIfNeeded(IExternalContentProvider provider, bool showWarningDialog, Action handler)
static List< IExternalContentProvider > m_providers
static string GetEntryTypeDescription(ExternalContentType type)
static readonly JsonDocumentOptions DefaultJsonOptions
static string Get(string className, int key)
获取在当前语言类名键对应的字符串
static void SwitchScreen(string name, params object[] parameters)
static CommunityContentMode CommunityContentMode
List< TreeViewNode > Nodes
void AddChild(TreeViewNode child)
readonly string UniqueId
static UserInfo ActiveUser
static void LaunchBrowser(string url)
static void Get(string address, Dictionary< string, string > parameters, Dictionary< string, string > headers, CancellableProgress progress, Action< byte[]> success, Action< Exception > failure)
virtual void LoadContents(object eventsTarget, XElement node)
static Dictionary< string, string > Configs
static Color Transparent
定义 Color.cs:5
static Color White
static readonly Vector2 Zero