Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Plain Craft Launcher 2/Modules/Minecraft/ModDownload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2477,11 +2477,12 @@ public static void McDownloadClientUpdateHint(string versionName, JsonObject jso
? Lang.Text("Minecraft.Update.UpdateTime") + Lang.Date(time)
: Lang.Text("Minecraft.Update.UpdatedAt") + Lang.TimeSpan(time - DateTime.Now));
var msgResult = ModMain.MyMsgBox(msgBoxText, Lang.Text("Minecraft.Update.Title"),
Lang.Text("Common.Action.Confirm"), Lang.Text("Common.Action.Download"),
Lang.Text("Common.Action.Download"),
(DateTime.Now - time).TotalHours > 3d ? Lang.Text("Common.Action.UpdateLog") : "",
button3Action: () => ModDownloadLib.McUpdateLogShow(version));
Lang.Text("Common.Action.Cancel"),
Comment on lines 2481 to +2482

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the cancel button in a waited slot

When the version was released within the last 3 hours, this ternary passes an empty button2 while still passing Cancel as button3. ModMain.MyMsgBox only blocks when button2.Length > 0 || forceWait, so in that fresh-release case it returns 1 immediately; the following if (msgResult == 1) then jumps to the download page before the user can cancel the update prompt. Put the cancel action in button2 when the changelog is hidden, or force the dialog to wait.

Useful? React with 👍 / 👎.

button2Action: () => ModDownloadLib.McUpdateLogShow(version));
// 弹窗结果
if (msgResult == 2)
if (msgResult == 1)
// 下载
ModBase.RunInUi(() =>
{
Expand Down
Loading