poi-plugin-quest-info-2 0.12.0 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # poi-plugin-quest-info-2
2
2
 
3
+ ## 0.12.2
4
+
5
+ ### Patch Changes
6
+
7
+ - cf28588: Update quest data
8
+
9
+ ## 0.12.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 8224a06: Fix locked quest status bug
14
+
3
15
  ## 0.12.0
4
16
 
5
17
  ### Minor Changes
@@ -1 +1 @@
1
- 53b0db6d5a521bcf934878d07918e06b9fceaef1
1
+ 5f441167d25695fe9ba0b81e9cf3d3725cc01e2f
@@ -4,4 +4,4 @@ export const KcwikiQuestData = {
4
4
  'zh-CN': zh_CN,
5
5
  }
6
6
 
7
- export const version = '53b0db6d5a521bcf934878d07918e06b9fceaef1'
7
+ export const version = '5f441167d25695fe9ba0b81e9cf3d3725cc01e2f'
@@ -5077,7 +5077,8 @@
5077
5077
  "memo2": "含有翔鹤、瑞鹤、胧、秋云的舰队分别出击 3-5,5-2,7-2P2,6-5 并取得 S 胜。",
5078
5078
  "name": "「第五航空战队」、纵横无尽",
5079
5079
  "pre": [
5080
- "D21"
5080
+ "D21",
5081
+ "B15"
5081
5082
  ],
5082
5083
  "rewards": "奖励:以下奖励三选一: 洋上补给 ×2 高速修复材 ×6 25mm 三连装机铳 ×2 以下奖励二选一: 試製東海 试制景云 (舰侦型)"
5083
5084
  },
@@ -1130,7 +1130,8 @@
1130
1130
  ],
1131
1131
  "post": [
1132
1132
  "A78",
1133
- "F80"
1133
+ "F80",
1134
+ "B143"
1134
1135
  ]
1135
1136
  },
1136
1137
  "226": {
@@ -4245,6 +4246,7 @@
4245
4246
  },
4246
4247
  "913": {
4247
4248
  "pre": [
4249
+ "B15",
4248
4250
  "D21"
4249
4251
  ],
4250
4252
  "post": []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poi-plugin-quest-info-2",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "private": false,
5
5
  "description": "show quest info",
6
6
  "homepage": "https://github.com/lawvs/poi-plugin-quest-2/",
@@ -4,7 +4,7 @@ import newQuestData from '../../build/kcQuestsData/quests-scn-new.json'
4
4
  describe('should version correct', () => {
5
5
  test('should KcwikiQuestData Game data version correct', () => {
6
6
  expect(version).toMatchInlineSnapshot(
7
- `"53b0db6d5a521bcf934878d07918e06b9fceaef1"`,
7
+ `"5f441167d25695fe9ba0b81e9cf3d3725cc01e2f"`,
8
8
  )
9
9
  })
10
10
 
@@ -356,6 +356,15 @@ export const getCompletedQuest = moize(
356
356
  export const getLockedQuest = moize(
357
357
  (inProgressQuest: number[]) => {
358
358
  const lockedQuest = calcQuestMap(inProgressQuest, getPostQuestIds)
359
+
360
+ // Fix https://github.com/lawvs/poi-plugin-quest-2/issues/87
361
+ // Since we check the quest chain in getCompletedQuest, we need to remove the completed quest from lockedQuest
362
+ const completedQuest = getCompletedQuest(inProgressQuest)
363
+ Object.keys(lockedQuest).forEach((gameId) => {
364
+ if (completedQuest[+gameId]) {
365
+ delete lockedQuest[+gameId]
366
+ }
367
+ })
359
368
  return lockedQuest
360
369
  },
361
370
  {
@@ -3,10 +3,10 @@ import React, { createContext, useContext } from 'react'
3
3
  import { useGameQuest } from '../poi/hooks'
4
4
  import { GameQuest } from '../poi/types'
5
5
  import {
6
+ QUEST_STATUS,
6
7
  getCompletedQuest,
7
8
  getLockedQuest,
8
9
  questApiStateToQuestStatus,
9
- QUEST_STATUS,
10
10
  } from '../questHelper'
11
11
 
12
12
  export const GameQuestContext = createContext<{
@@ -47,12 +47,12 @@ const useQuestStatusQuery = (inProgressQuests: GameQuest[]) => {
47
47
  return questApiStateToQuestStatus(theGameQuest.api_state)
48
48
  }
49
49
 
50
- if (gameId in lockedQuest) {
51
- return QUEST_STATUS.LOCKED
52
- }
53
50
  if (gameId in alreadyCompletedQuest) {
54
51
  return QUEST_STATUS.ALREADY_COMPLETED
55
52
  }
53
+ if (gameId in lockedQuest) {
54
+ return QUEST_STATUS.LOCKED
55
+ }
56
56
  return QUEST_STATUS.UNKNOWN
57
57
  },
58
58
  }