Skip to content

refactor: 皮肤管理 - #6037

Open
CiiLu wants to merge 48 commits into
HMCL-dev:mainfrom
CiiLu:qwqawa
Open

CiiLu wants to merge 48 commits into
HMCL-dev:mainfrom
CiiLu:qwqawa

Conversation

@CiiLu

@CiiLu CiiLu commented May 1, 2026 •

Copy link
Copy Markdown
Contributor

功能已全部完成, 当前的UI仅作占位 ,review 时可以不 review UI 相关部分代码

@3gf8jv4dv

3gf8jv4dv commented May 1, 2026 •

Copy link
Copy Markdown
Contributor

左测边栏只有一个「皮肤」和一个「保存」,看起来显得空荡荡的。但我暂时想不出更好的设计。

有计划把披风拆分到另一个页面么?

此外不知道目前的皮肤渲染器,是否支持渲染披风的鞘翅形态。我看 Prism Launcher 里有个对应的选项。

@CiiLu

CiiLu commented May 1, 2026 •

Copy link
Copy Markdown
Contributor Author

此外不知道目前的皮肤渲染器,是否支持渲染披风的鞘翅形态。

不支持

有计划把披风拆分到另一个页面么?

微软账户还好,但是外置账户和离线账户披风是用户自己选择的,不知道怎么设计

@3gf8jv4dv

Copy link
Copy Markdown
Contributor

这样的话是不是可以干脆不要左边那一栏了,这样还能把更多空间留给主体

我也这么觉得 🤔

@3gf8jv4dv

Copy link
Copy Markdown
Contributor

要不把这个页面做成类似衣柜的形式。

目前「本地皮肤图片文件」的文件选择器,在 Windows 上似乎没有记忆功能,每次点开都在「此电脑」,切皮肤/披风的步骤略繁琐。如果能做成衣柜形式,那么大伙可以预先添加一批皮肤/披风到衣柜,要切换的时候直接在衣柜里应用,一步完成。

同时,对于微软账户/外置登录,也可以点击需要的皮肤/披风 (微软账户只能自主上传皮肤),在衣柜里确认后自动上传到微软或对应服务器。

@3gf8jv4dv

Copy link
Copy Markdown
Contributor

另外,account.skin.upload 可以改一下。改成「Manage Skin」「管理皮肤」「管理外觀」。

@CiiLu

CiiLu commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

要不把这个页面做成类似衣柜的形式。

我原本想的就是这样设计,但是实现和操作上有一些问题。我先把其他的实现完再尝试一下改成这样吧。

@CiiLu

CiiLu commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

目前本 PR 功能已全部完成,但我不知道 UI 该怎么搞(

@CiiLu
CiiLu marked this pull request as ready for review August 17, 2026 07:08
@qiao-mai-mian

Copy link
Copy Markdown
Image > 点击衣架图标(角色按钮)→ 弹窗列出 当前这个外置登录账号(邮箱账号)下全部角色,供用户选择

目前本 PR 功能已全部完成,但我不知道 UI 该怎么搞(

@github-actions github-actions 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.

🤖 Static analysis found the following issues (max count 10):

throw new CredentialExpiredException(e);
} else {
throw e;
YggdrasilSession acquiredSession;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[ERROR] [com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck]

'if' child has incorrect indentation level 16, expected level should be 12.

} else {
throw e;
YggdrasilSession acquiredSession;
try {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[ERROR] [com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck]

'try' has incorrect indentation level 16, expected level should be 12.

throw e;
YggdrasilSession acquiredSession;
try {
acquiredSession = service.refresh(session.getAccessToken(), session.getClientToken(), null);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[ERROR] [com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck]

'try' child has incorrect indentation level 20, expected level should be 16.

YggdrasilSession acquiredSession;
try {
acquiredSession = service.refresh(session.getAccessToken(), session.getClientToken(), null);
} catch (RemoteAuthenticationException e) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[ERROR] [com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck]

'try rcurly' has incorrect indentation level 16, expected level should be 12.

try {
acquiredSession = service.refresh(session.getAccessToken(), session.getClientToken(), null);
} catch (RemoteAuthenticationException e) {
if ("ForbiddenOperationException".equals(e.getRemoteName())) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[ERROR] [com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck]

'if' has incorrect indentation level 20, expected level should be 16.

acquiredSession = service.refresh(session.getAccessToken(), session.getClientToken(), null);
} catch (RemoteAuthenticationException e) {
if ("ForbiddenOperationException".equals(e.getRemoteName())) {
throw new CredentialExpiredException(e);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[ERROR] [com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck]

'if' child has incorrect indentation level 24, expected level should be 20.

} catch (RemoteAuthenticationException e) {
if ("ForbiddenOperationException".equals(e.getRemoteName())) {
throw new CredentialExpiredException(e);
} else {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[ERROR] [com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck]

'if rcurly' has incorrect indentation level 20, expected level should be 16.

if ("ForbiddenOperationException".equals(e.getRemoteName())) {
throw new CredentialExpiredException(e);
} else {
throw e;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[ERROR] [com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck]

'else' child has incorrect indentation level 24, expected level should be 20.

throw new CredentialExpiredException(e);
} else {
throw e;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[ERROR] [com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck]

'else rcurly' has incorrect indentation level 20, expected level should be 16.

} else {
throw e;
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[ERROR] [com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck]

'catch rcurly' has incorrect indentation level 16, expected level should be 12.

@github-actions github-actions 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.

🤖 Static analysis found the following issues (max count 10):

import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.nio.file.Files;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[ERROR] [com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck]

Unused import - java.nio.file.Files.

import java.io.InputStream;
import java.net.HttpURLConnection;
import java.nio.file.Files;
import java.nio.file.Path;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[ERROR] [com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck]

Unused import - java.nio.file.Path.

import java.net.HttpURLConnection;
import java.nio.file.Files;
import java.nio.file.Path;
import java.net.URISyntaxException;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[ERROR] [com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck]

Unused import - java.net.URISyntaxException.

@@ -38,6 +38,7 @@
import java.net.HttpURLConnection;
import java.nio.file.Files;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[ERROR] [com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck]

Unused import - java.nio.file.Files.

@@ -38,6 +38,7 @@
import java.net.HttpURLConnection;
import java.nio.file.Files;
import java.nio.file.Path;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[ERROR] [com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck]

Unused import - java.nio.file.Path.

import java.net.HttpURLConnection;
import java.nio.file.Files;
import java.nio.file.Path;
import java.net.URI;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[ERROR] [com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck]

Unused import - java.net.URI.


public void writeStorage(JsonObject storage) {
storage.addProperty("type", type.name().toLowerCase(Locale.ROOT));
storage.addProperty("localSkinPath", localSkinPath);

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.

使用GPT Sol 6.1生成:

这里漏保存了 textureModel。第 119 行读取缺失字段时得到 "default",第 123 行因此恢复为 SkinModel.WIDE。离线账号选择细手臂本地皮肤并保存后,重启启动器就会丢失模型选择。需要补回 storage.addProperty("textureModel", textureModel().modelName);。

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

4 participants