Skip to content

Commit 87f5cc2

Browse files
authored
Merge pull request #7919 from PCL-Community/#7894
fix(cape): 更换披风后未更新当前选择的披风
2 parents 8323c1f + 1f1a334 commit 87f5cc2

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml.vb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ Retry:
233233
Dim SkinData As JObject = GetJson(McLoginMsLoader.Output.ProfileJson)
234234
'获取玩家的所有披风
235235
Dim SelId As Integer? = Nothing
236+
'获取玩家当前的披风
237+
Dim CurId As Integer? = Nothing
236238
RunInUiWait(
237239
Sub()
238240
Try
@@ -247,9 +249,12 @@ Retry:
247249
{"Common", "普通披风"}, {"Pan", "薄煎饼披风"}, {"Founder's", "创始人披风"}, {"Copper", "铜披风"}, {"Zombie Horse", "僵尸马披风"}
248250
}
249251
Dim SelectionControl As New List(Of IMyRadio) From {New MyRadioBox With {.Text = "无披风"}}
252+
Dim Id As Integer = 0
250253
For Each Cape In SkinData("capes")
254+
Id += 1
251255
Dim CapeName As String = Cape("alias").ToString
252256
If CapeNames.ContainsKey(CapeName) Then CapeName = CapeNames(CapeName)
257+
If Cape("state")?.ToString = "ACTIVE" Then CurId = Id
253258
SelectionControl.Add(New MyRadioBox With {.Text = CapeName, .Checked = Cape("state")?.ToString = "ACTIVE"})
254259
Next
255260
SelId = MyMsgBoxSelect(SelectionControl, "选择披风", "确定", "取消")
@@ -269,6 +274,12 @@ Retry:
269274
Return
270275
Else
271276
Hint("更改披风成功!", HintType.Green)
277+
'#7894,更换披风后需更新当前选择的披风
278+
SkinData("capes")(SelId - 1)("state") = "ACTIVE"
279+
If CurId IsNot Nothing Then
280+
SkinData("capes")(CurId - 1)("state") = "INACTIVE"
281+
End If
282+
McLoginMsLoader.Output.ProfileJson = SkinData.ToString()
272283
End If
273284
Catch ex As Exception
274285
Log(ex, "更改披风失败", LogLevel.Hint)

0 commit comments

Comments
 (0)