Skip to content

feat(setup): 添加“停止使用 PCL CE”功能 - #3433

Merged
Chiloven945 merged 16 commits into
PCL-Community:devfrom
Creative-Generator:feat/stop-using-pclce
Jul 18, 2026
Merged

feat(setup): 添加“停止使用 PCL CE”功能#3433
Chiloven945 merged 16 commits into
PCL-Community:devfrom
Creative-Generator:feat/stop-using-pclce

Conversation

@Hill23333

@Hill23333 Hill23333 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary by Sourcery

添加一个设置选项,用于停止使用 PCL CE 并清理相关数据,在完成后退出应用程序。

新功能:

  • 引入一个启动器设置操作,允许用户停止使用 PCL CE,并可选择删除相关的 Minecraft 资源。

增强改进:

  • 实现对 PCL CE 相关数据和配置文件的清理,支持错误汇总并提供面向用户的状态消息。
  • 扩展安装/设置 UI 和本地化字符串,以支持新的“停止使用 PCL CE”工作流程。
Original summary in English

Summary by Sourcery

Add a setup option to stop using PCL CE and clean up related data, then exit the application after completion.

New Features:

  • Introduce a launcher settings action that lets users stop using PCL CE and optionally remove related Minecraft resources.

Enhancements:

  • Implement cleanup of PCL CE-related data and configuration files, with error aggregation and user-facing status messages.
  • Extend setup UI and localization strings to support the new stop-using-PCL-CE workflow.

@pcl-ce-automation pcl-ce-automation Bot added 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 size: L PR 大小评估:大型 labels Jul 17, 2026
@sourcery-ai

sourcery-ai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

审阅者指南

在设置杂项页中添加一个“停止使用 PCL CE”的流程,引导用户经过一系列确认对话框,删除与 PCL CE 相关的数据和配置(可选地删除 Minecraft 资源文件夹中的内容),将任何错误展示给用户,然后关闭应用程序,同时包含必要的 IoC 和本地化接线以及 UI 挂钩。

新“停止使用 PCL CE”设置流程的时序图

sequenceDiagram
    actor User
    participant PageSetupLauncherMisc
    participant ModMain
    participant StopUsingPClCeCore
    participant Lifecycle

    User ->> PageSetupLauncherMisc: BtnSystemStopUsingPclCe_Click
    PageSetupLauncherMisc ->> ModMain: MyMsgBox
    alt [user chooses continue or continue_and_remove]
        PageSetupLauncherMisc ->> ModMain: MyMsgBox
        alt [user confirms final warning]
            PageSetupLauncherMisc ->> StopUsingPClCeCore: StopUsingPClCeCore(removeMcResources)
            StopUsingPClCeCore --> PageSetupLauncherMisc: exceptions
            alt [exceptions.Count > 0]
                PageSetupLauncherMisc ->> ModMain: MyMsgBox
            else [no exceptions]
                PageSetupLauncherMisc ->> ModMain: MyMsgBox
            end
            PageSetupLauncherMisc ->> Lifecycle: Shutdown
        else [user cancels]
            PageSetupLauncherMisc --> User: [no changes]
        end
    else [user cancels initial dialog]
        PageSetupLauncherMisc --> User: [no changes]
    end
Loading

删除 PCL CE 数据和配置的流程图

flowchart TD
    A[Start StopUsingPClCeCore removeMcResources] --> B[Delete PCL CE data folders via Delete]
    B --> C{removeMcResources and States.Game.Folders not empty}
    C -->|Yes| D[For each game folder: Delete PCL.ini via Delete]
    D --> E[Delete version config.v1.yml files via Delete]
    C -->|No| F[Skip MC resource deletion]
    E --> G[Return exceptions]
    F --> G[Return exceptions]
Loading

文件级变更

Change Details Files
在设置杂项页中实现“停止使用 PCL CE”动作流程,包括删除逻辑和关闭行为。
  • 接入 IoC 命名空间以访问生命周期操作
  • 添加点击事件处理程序 BtnSystemStopUsingPclCe_Click,使用本地化字符串运行两步确认流程
  • 调用核心删除例程,并根据其结果显示错误摘要或完成消息
  • 在操作完成后通过 Lifecycle.Shutdown 触发应用程序关闭
Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs
实现核心例程以移除 PCL CE 数据以及可选的与 Minecraft 相关的配置文件。
  • 添加 StopUsingPClCeCore(bool removeMcResources),用于协调删除操作并收集异常
  • 使用 Paths 辅助方法删除已知的 PCL CE 相关数据目录
  • 在需要时,可选地删除游戏文件夹下的 PCL.ini 和特定版本的 config.v1.yml
  • 引入本地 Delete 辅助方法,安全删除文件或目录,并在失败时用包含路径上下文的 IOException 进行包装
Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs
在设置杂项 UI 和本地化中挂接新的“停止使用 PCL CE”动作。
  • 扩展设置杂项 XAML,暴露一个用于“停止使用 PCL CE”操作的 UI 入口(例如按钮)
  • 添加或调整用于新流程的确认消息、错误及完成文案的 en-US 本地化条目
  • 添加或调整与 en-US 文案相对应的 zh-CN 本地化条目
Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml
PCL.Core/App/Localization/Languages/en-US.xaml
PCL.Core/App/Localization/Languages/zh-CN.xaml

提示和命令

与 Sourcery 交互

  • 触发一次新的审阅: 在 Pull Request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub issue: 在某条审阅评论下回复,让 Sourcery 将其创建为 issue。你也可以在审阅评论下回复 @sourcery-ai issue 来从该评论创建一个 issue。
  • 生成 Pull Request 标题: 在 Pull Request 标题中任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在 Pull Request 中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成 Pull Request 摘要: 在 Pull Request 正文任意位置写入 @sourcery-ai summary,即可在该位置生成 PR 摘要。你也可以在 Pull Request 中评论 @sourcery-ai summary 来在任何时候(重新)生成摘要。
  • 生成审阅者指南: 在 Pull Request 中评论 @sourcery-ai guide,即可在任何时候(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在 Pull Request 中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,这会很有用。
  • 撤销所有 Sourcery 审阅: 在 Pull Request 中评论 @sourcery-ai dismiss,即可撤销所有现有的 Sourcery 审阅。尤其适用于你想从一次新的审阅重新开始的场景——别忘了再评论 @sourcery-ai review 来触发新的审阅!

自定义你的体验

访问你的 控制面板 以:

  • 启用或禁用审阅功能,例如 Sourcery 生成的 Pull Request 摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、移除或编辑自定义审阅说明。
  • 调整其他审阅设置。

获取帮助

Original review guide in English

Reviewer's Guide

Adds a "Stop using PCL CE" flow in the setup misc page that guides the user through confirmation dialogs, deletes PCL CE-related data and configuration (optionally in Minecraft resource folders), surfaces any errors to the user, and then shuts down the application, along with the necessary IoC and localization wiring and UI hook-up.

Sequence diagram for the new "Stop using PCL CE" setup flow

sequenceDiagram
    actor User
    participant PageSetupLauncherMisc
    participant ModMain
    participant StopUsingPClCeCore
    participant Lifecycle

    User ->> PageSetupLauncherMisc: BtnSystemStopUsingPclCe_Click
    PageSetupLauncherMisc ->> ModMain: MyMsgBox
    alt [user chooses continue or continue_and_remove]
        PageSetupLauncherMisc ->> ModMain: MyMsgBox
        alt [user confirms final warning]
            PageSetupLauncherMisc ->> StopUsingPClCeCore: StopUsingPClCeCore(removeMcResources)
            StopUsingPClCeCore --> PageSetupLauncherMisc: exceptions
            alt [exceptions.Count > 0]
                PageSetupLauncherMisc ->> ModMain: MyMsgBox
            else [no exceptions]
                PageSetupLauncherMisc ->> ModMain: MyMsgBox
            end
            PageSetupLauncherMisc ->> Lifecycle: Shutdown
        else [user cancels]
            PageSetupLauncherMisc --> User: [no changes]
        end
    else [user cancels initial dialog]
        PageSetupLauncherMisc --> User: [no changes]
    end
Loading

Flow diagram for deleting PCL CE data and configuration

flowchart TD
    A[Start StopUsingPClCeCore removeMcResources] --> B[Delete PCL CE data folders via Delete]
    B --> C{removeMcResources and States.Game.Folders not empty}
    C -->|Yes| D[For each game folder: Delete PCL.ini via Delete]
    D --> E[Delete version config.v1.yml files via Delete]
    C -->|No| F[Skip MC resource deletion]
    E --> G[Return exceptions]
    F --> G[Return exceptions]
Loading

File-Level Changes

Change Details Files
Implement "Stop using PCL CE" action flow in the setup misc page, including deletion logic and shutdown behavior.
  • Wire in IoC namespace to access lifecycle operations
  • Add click handler BtnSystemStopUsingPclCe_Click that runs a two-step confirmation flow using localized strings
  • Call core deletion routine and display either an error summary or a completion message based on its result
  • Trigger application shutdown via Lifecycle.Shutdown after the operation completes
Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs
Implement core routine to remove PCL CE data and optional Minecraft-related configuration files.
  • Add StopUsingPClCeCore(bool removeMcResources) that coordinates deletions and collects exceptions
  • Delete known PCL CE-related data directories using Paths helpers
  • Optionally delete PCL.ini and version-specific config.v1.yml under game folders when requested
  • Introduce local Delete helper that safely deletes files or directories and wraps failures in IOException with path context
Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs
Hook up the new "Stop using PCL CE" action in the setup misc UI and localization.
  • Extend the setup misc XAML to expose a UI entry point (e.g., button) for the stop-using-PCL-CE action
  • Add or adjust en-US localization entries for confirmation messages, error and completion text for the new flow
  • Add or adjust zh-CN localization entries mirroring the en-US texts for the new flow
Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml
PCL.Core/App/Localization/Languages/en-US.xaml
PCL.Core/App/Localization/Languages/zh-CN.xaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

嗨——我已经审查了你的更改,看起来非常棒!


Sourcery 为开源项目免费使用——如果你觉得我们的代码审查有帮助,请考虑分享 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会利用这些反馈来改进为你提供的审查。
Original comment in English

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f825373581

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs Outdated
Comment thread Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f746dd76f4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 37a70e9467

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs Outdated
Comment thread PCL.Core/App/Localization/Languages/en-US.xaml Outdated
Comment thread PCL.Core/App/Localization/Languages/zh-CN.xaml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 56a62f27fd

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs Outdated
Hill23333 and others added 2 commits July 17, 2026 23:56
Co-authored-by: ChilovenBustiangle <116699482+Chiloven945@users.noreply.github.com>
Co-authored-by: ChilovenBustiangle <116699482+Chiloven945@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 83e72bcc3b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 46bb54943b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 20c43e1dc6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread PCL.Core/App/Localization/Languages/en-US.xaml Outdated
Comment thread PCL.Core/App/Localization/Languages/zh-CN.xaml Outdated
Comment thread Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs Outdated
@Chiloven945 Chiloven945 changed the title feat(setup): 停止使用 PCL CE feat(setup): 添加“停止使用 PCL CE”功能 Jul 17, 2026
@Hill23333
Hill23333 requested a review from Lokins577 July 18, 2026 05:01

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1c97622ebf

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@Chiloven945
Chiloven945 merged commit 0487e73 into PCL-Community:dev Jul 18, 2026
3 checks passed
@pcl-ce-automation pcl-ce-automation Bot added 👌 完成 相关问题已修复或功能已实现,计划在下次版本更新时正式上线 and removed 🛠️ 等待审查 Pull Request 已完善,等待维护者或负责人进行代码审查 labels Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: L PR 大小评估:大型 👌 完成 相关问题已修复或功能已实现,计划在下次版本更新时正式上线

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants