Skip to content

Commit 4efedcb

Browse files
committed
fix: 实例图标分配不正确
1 parent 8f0086e commit 4efedcb

1 file changed

Lines changed: 7 additions & 25 deletions

File tree

Plain Craft Launcher 2/Pages/PageDownload/ModDownloadLib.cs

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -275,32 +275,14 @@ public static void McDownloadClientCore(string Id, string JsonUrl, ModNet.NetPre
275275
public static MyListItem McDownloadListItem(JObject Entry, MyListItem.ClickEventHandler OnClick, bool IsSaveOnly)
276276
{
277277
// 确定图标
278-
string Logo;
279-
switch ("type")
278+
string Logo = Entry["type"].ToString() switch
280279
{
281-
case "release":
282-
{
283-
Logo = ModBase.PathImage + "Blocks/Grass.png";
284-
break;
285-
}
286-
case "snapshot":
287-
case "pending":
288-
{
289-
Logo = ModBase.PathImage + "Blocks/CommandBlock.png";
290-
break;
291-
}
292-
case "special":
293-
{
294-
Logo = ModBase.PathImage + "Blocks/GoldBlock.png";
295-
break;
296-
}
297-
298-
default:
299-
{
300-
Logo = ModBase.PathImage + "Blocks/CobbleStone.png";
301-
break;
302-
}
303-
}
280+
"release" => ModBase.PathImage + "Blocks/Grass.png",
281+
"snapshot" => ModBase.PathImage + "Blocks/CommandBlock.png",
282+
"pending" => ModBase.PathImage + "Blocks/CommandBlock.png",
283+
"special" => ModBase.PathImage + "Blocks/GoldBlock.png",
284+
_ => ModBase.PathImage + "Blocks/CobbleStone.png"
285+
};
304286

305287
// 建立控件
306288
var FormattedVersion = McFormatter.FormatVersion(Entry["id"].ToString()).Replace("_", " ");

0 commit comments

Comments
 (0)