From e182fa36499d7a88932bb4bdb09fd2eeeda92b17 Mon Sep 17 00:00:00 2001
From: muqing <1966944300@qq.com>
Date: Wed, 31 Jul 2024 11:24:52 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84MOD=E4=BF=A1=E6=81=AF?=
=?UTF-8?q?=E7=95=8C=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
RustTools/WindowUI/ModulePage.xaml | 28 ++++++++++++++--
RustTools/WindowUI/ModulePage.xaml.cs | 47 ++++++++++++++++++++-------
2 files changed, 60 insertions(+), 15 deletions(-)
diff --git a/RustTools/WindowUI/ModulePage.xaml b/RustTools/WindowUI/ModulePage.xaml
index 4c26b27..0192103 100644
--- a/RustTools/WindowUI/ModulePage.xaml
+++ b/RustTools/WindowUI/ModulePage.xaml
@@ -79,12 +79,34 @@
DefaultLabelPosition="Right"
IsOpen="False">
-
+
-
+
-
+
+
diff --git a/RustTools/WindowUI/ModulePage.xaml.cs b/RustTools/WindowUI/ModulePage.xaml.cs
index e2e2e54..aca1610 100644
--- a/RustTools/WindowUI/ModulePage.xaml.cs
+++ b/RustTools/WindowUI/ModulePage.xaml.cs
@@ -40,21 +40,13 @@ public sealed partial class ModulePage : WindowEx
}
private async void init(string v)
{
- //string json = "\r\n{\"code\":0,\"message\":\"ȡɹ\",\"data\":{\"id\":\"585886886883885357567508566896\",\"name\":\"ģ5.0\",\"describe\":\"\",\"icon\":\"\",\"tags\":\"[]\",\"screenshots\":\"\",\"developer\":\"SDL_13964\",\"link\":\"..\\/user\\/SDL_13964\\/mods\\/585886886883885357567508566896\\/585886886883885357567508566896.rwmod\",\"downloadNumber\":\"366\",\"versionNumber\":\"1\",\"versionName\":\"1.14514\",\"updateTime\":\"2022-07-20 14:20:09\",\"creationTime\":\"2022-07-20 14:20:09\",\"unitNumber\":\"909\",\"hidden\":\"0\",\"coinNumber\":\"1\",\"minVersion\":\"\"}}";
-
var json = await ApiFox.mod.getInfo("", v);
var a = JsonConvert.DeserializeObject(json);
if (a != null)
{
Mod = a.data;
- if (Mod.IconUrl.Equals(""))
- {
- Mod.IconUrl = "/Assets/image/image_106.svg";
- }
- else
- {
- Mod.IconUrl = Mod.IconUrl.Replace("..", wl.api);
- }
+ Mod.IconUrl = Mod.IconUrl.Equals("") ? "/Assets/image/image_106.svg" : Mod.IconUrl.Replace("..", wl.api);
+ Mod.Link = Mod.Link.Replace("..", wl.api);
Title = Mod.Name;
var l = " | ";
title_b.Text = "λ" + Mod.UnitNumber + l + Mod.DownloadNumber + "" + l + "汾" + Mod.VersionName;
@@ -89,9 +81,7 @@ public sealed partial class ModulePage : WindowEx
private void WindowEx_SizeChanged(object sender, WindowSizeChangedEventArgs args)
{
- gj.sc(Width);
DescriptionText.Width = Width-50;
-
}
@@ -100,4 +90,37 @@ public sealed partial class ModulePage : WindowEx
// ڹرʱбƳ
ModulePageList.Remove(this);
}
+
+ private void AppBarButton_Click(object sender, RoutedEventArgs e)
+ {
+ var label = ((AppBarButton)sender).Name;
+ gj.sc(label);
+ switch (label)
+ {
+ case "ReportButton":
+ gj.sc("ٱģ鳭Ϯ");
+ //if (Toast.IsOpen) Toast.IsOpen = false;
+ Toast.Title = "ٱģ";
+ Toast.Subtitle = "ٱܽԾٱ";
+ Toast.IsOpen = true;
+
+ break;
+ case "LikeButton":
+ gj.sc("ģͶһ");
+ //if (Toast.IsOpen) Toast.IsOpen = false;
+ Toast.Title = "ִ֧ģ";
+ Toast.Subtitle = "ֺ֧Զ۳һӲңû֧ʧ";
+ Toast.IsOpen = true;
+
+ break;
+ case "DownLoadButton":
+ gj.sc("شģ:"+Mod.Link);
+ break;
+ }
+ }
+
+ private void Toast_ActionButtonClick(TeachingTip sender, object args)
+ {
+
+ }
}