poi-plugin-koushu-rate 2.0.13 → 2.0.15
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/index.js +190 -61
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -40,6 +40,7 @@ const WEEKDAY_KEYS = ["monday", "tuesday", "wednesday", "thursday", "friday", "s
|
|
|
40
40
|
const WEEKDAY_LABELS = { monday: "周一", tuesday: "周二", wednesday: "周三", thursday: "周四", friday: "周五", saturday: "周六", sunday: "周日" };
|
|
41
41
|
const ALL_DAYS_KEY = "all";
|
|
42
42
|
|
|
43
|
+
|
|
43
44
|
function japanWeekdayKey() {
|
|
44
45
|
const japanNow = new Date(Date.now() + 9 * 60 * 60 * 1000)
|
|
45
46
|
return ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"][japanNow.getUTCDay()]
|
|
@@ -505,6 +506,10 @@ const CSS = `
|
|
|
505
506
|
border-color: #2d72d2;
|
|
506
507
|
color: #fff;
|
|
507
508
|
}
|
|
509
|
+
.kr2-plan-target-btn:disabled {
|
|
510
|
+
opacity: 0.4;
|
|
511
|
+
cursor: not-allowed;
|
|
512
|
+
}
|
|
508
513
|
.kr2-level-max-blue {
|
|
509
514
|
color: #4fc3f7;
|
|
510
515
|
font-weight: 700;
|
|
@@ -858,6 +863,42 @@ const CSS = `
|
|
|
858
863
|
.kr2-row:hover {
|
|
859
864
|
background: #252a31;
|
|
860
865
|
}
|
|
866
|
+
.kr2-row-not-improveable {
|
|
867
|
+
color: #abb3bf;
|
|
868
|
+
cursor: default;
|
|
869
|
+
}
|
|
870
|
+
.kr2-row-not-improveable .kr2-name,
|
|
871
|
+
.kr2-row-not-improveable .kr2-secretary,
|
|
872
|
+
.kr2-row-not-improveable .kr2-meta {
|
|
873
|
+
color: #abb3bf;
|
|
874
|
+
}
|
|
875
|
+
.kr2-reco-empty {
|
|
876
|
+
min-height: 34px;
|
|
877
|
+
}
|
|
878
|
+
.kr2-not-improveable-group {
|
|
879
|
+
border-top: 1px solid rgba(255, 255, 255, 0.12);
|
|
880
|
+
}
|
|
881
|
+
.kr2-collapse-toggle {
|
|
882
|
+
width: 100%;
|
|
883
|
+
padding: 10px 14px;
|
|
884
|
+
border: 0;
|
|
885
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
|
|
886
|
+
background: #252a31;
|
|
887
|
+
color: #abb3bf;
|
|
888
|
+
text-align: center;
|
|
889
|
+
font-size: 14px;
|
|
890
|
+
cursor: pointer;
|
|
891
|
+
}
|
|
892
|
+
.kr2-collapse-toggle:hover {
|
|
893
|
+
background: #2f343c;
|
|
894
|
+
}
|
|
895
|
+
.kr2-improveable-group {
|
|
896
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.12);
|
|
897
|
+
}
|
|
898
|
+
.kr2-fav-btn:disabled {
|
|
899
|
+
opacity: 0.4;
|
|
900
|
+
cursor: default;
|
|
901
|
+
}
|
|
861
902
|
.kr2-fav-btn {
|
|
862
903
|
width: 24px;
|
|
863
904
|
height: 24px;
|
|
@@ -1077,6 +1118,7 @@ const CSS = `
|
|
|
1077
1118
|
align-items: flex-end;
|
|
1078
1119
|
gap: 6px;
|
|
1079
1120
|
}
|
|
1121
|
+
|
|
1080
1122
|
.kr2-material-list {
|
|
1081
1123
|
display: flex;
|
|
1082
1124
|
flex-direction: column;
|
|
@@ -2280,6 +2322,33 @@ function buildRows(staticData, masterEquips, fallbackNames, akashi, recommendati
|
|
|
2280
2322
|
if (ib >= 0) return 1
|
|
2281
2323
|
return Number(a.id) - Number(b.id)
|
|
2282
2324
|
})
|
|
2325
|
+
const improveableKeys = new Set(Object.keys(stepsByEquip))
|
|
2326
|
+
const nonImproveableIds = Object.keys(fallbackNames).filter((id) => !improveableKeys.has(id)).map(Number).sort((a, b) => a - b)
|
|
2327
|
+
for (const id of nonImproveableIds) {
|
|
2328
|
+
const key = String(id)
|
|
2329
|
+
const fallback = fallbackNames[key] || {}
|
|
2330
|
+
const master = masterEquips[key] || {}
|
|
2331
|
+
const category = CATEGORY_ALIASES[translateTypeName(fallback.type || master.api_type_name)] || "其他"
|
|
2332
|
+
const name = String(master.api_name || fallback.name || ("装备 " + id))
|
|
2333
|
+
rows.push({
|
|
2334
|
+
id: key,
|
|
2335
|
+
name,
|
|
2336
|
+
typeName: String(fallback.type || master.api_type_name || ""),
|
|
2337
|
+
icon: master.api_type && master.api_type[3] != null ? Number(master.api_type[3]) : (fallback.icon != null ? Number(fallback.icon) : 0),
|
|
2338
|
+
base: null,
|
|
2339
|
+
days: [],
|
|
2340
|
+
category,
|
|
2341
|
+
reco: false,
|
|
2342
|
+
akashiName: "",
|
|
2343
|
+
recommend: null,
|
|
2344
|
+
secretaries: null,
|
|
2345
|
+
searchText: normalizeText([name, category, id].join(" ")),
|
|
2346
|
+
phase0: null,
|
|
2347
|
+
phase1: null,
|
|
2348
|
+
upgrades: null,
|
|
2349
|
+
improveable: false,
|
|
2350
|
+
})
|
|
2351
|
+
}
|
|
2283
2352
|
return rows
|
|
2284
2353
|
}
|
|
2285
2354
|
|
|
@@ -2732,8 +2801,8 @@ function PlanningPage({ rows, inventoryByEquip, useItemCounts, selection, onTogg
|
|
|
2732
2801
|
React.createElement(
|
|
2733
2802
|
"div",
|
|
2734
2803
|
{ className: "kr2-plan-target-group" },
|
|
2735
|
-
React.createElement("button", { type: "button", className: "kr2-plan-target-btn" + (!p.evoUpgradeId && p.target !== "max" ? " kr2-plan-target-active" : ""), onClick: () => onTarget(p.row.id, "6") }, "+6"),
|
|
2736
|
-
React.createElement("button", { type: "button", className: "kr2-plan-target-btn" + (!p.evoUpgradeId && p.target === "max" ? " kr2-plan-target-active" : ""), onClick: () => onTarget(p.row.id, "max") }, "max"),
|
|
2804
|
+
React.createElement("button", { type: "button", disabled: p.row.improveable === false, className: "kr2-plan-target-btn" + (!p.evoUpgradeId && p.target !== "max" ? " kr2-plan-target-active" : ""), onClick: () => onTarget(p.row.id, "6") }, "+6"),
|
|
2805
|
+
React.createElement("button", { type: "button", disabled: p.row.improveable === false, className: "kr2-plan-target-btn" + (!p.evoUpgradeId && p.target === "max" ? " kr2-plan-target-active" : ""), onClick: () => onTarget(p.row.id, "max") }, "max"),
|
|
2737
2806
|
React.createElement(EvolutionButton, { rowId: p.row.id, branches: p.row.upgrades || [], value: p.evoUpgradeId, onSelect: onEvo })
|
|
2738
2807
|
)
|
|
2739
2808
|
),
|
|
@@ -2837,6 +2906,7 @@ class StrongPage extends React.Component {
|
|
|
2837
2906
|
if (n >= 10) return "max"
|
|
2838
2907
|
return "+" + String(n)
|
|
2839
2908
|
}
|
|
2909
|
+
const demandMap = {}
|
|
2840
2910
|
for (const row of rows || []) {
|
|
2841
2911
|
const sel = (selection || {})[row.id] || { selected: true, target: "max", qty: 1 }
|
|
2842
2912
|
const qty = Math.max(1, Math.min(99, Math.round(Number(sel.qty) || 1)))
|
|
@@ -2845,32 +2915,49 @@ class StrongPage extends React.Component {
|
|
|
2845
2915
|
const displayRow = evoUpgrade
|
|
2846
2916
|
? Object.assign({}, row, { id: row.id + ":evo:" + evoUpgrade.upgrade_id, name: evoUpgrade.targetName, category: evoUpgrade.targetCategory || row.category })
|
|
2847
2917
|
: row
|
|
2848
|
-
const
|
|
2849
|
-
const targetLevelValue = evoUpgrade ? 0 : (sel.target === "max" ? 10 : 6)
|
|
2850
|
-
const
|
|
2851
|
-
|
|
2852
|
-
|
|
2918
|
+
const targetEquipId = evoUpgrade ? String(evoUpgrade.upgrade_id) : row.id
|
|
2919
|
+
const targetLevelValue = evoUpgrade ? 0 : (row.improveable === false ? 0 : (sel.target === "max" ? 10 : 6))
|
|
2920
|
+
const bucket = demandMap[targetEquipId] || (demandMap[targetEquipId] = { equipId: targetEquipId, displayRow, demands: {} })
|
|
2921
|
+
bucket.demands[String(targetLevelValue)] = (bucket.demands[String(targetLevelValue)] || 0) + qty
|
|
2922
|
+
}
|
|
2923
|
+
for (const bucket of Object.values(demandMap)) {
|
|
2924
|
+
const inv = (inventoryByEquip || {})[bucket.equipId]
|
|
2925
|
+
const inventoryLevels = []
|
|
2853
2926
|
if (inv && inv.levels) {
|
|
2854
2927
|
for (const level of Object.keys(inv.levels)) {
|
|
2855
2928
|
const count = Math.max(0, Math.round(Number(inv.levels[level]) || 0))
|
|
2856
|
-
if (count > 0)
|
|
2929
|
+
if (count > 0) inventoryLevels.push({ level: Number(level), count })
|
|
2857
2930
|
}
|
|
2858
|
-
|
|
2931
|
+
inventoryLevels.sort((a, b) => b.level - a.level)
|
|
2859
2932
|
}
|
|
2860
|
-
const
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2933
|
+
const remaining = {}
|
|
2934
|
+
for (const lv of inventoryLevels) remaining[String(lv.level)] = lv.count
|
|
2935
|
+
const targetLevels = Object.keys(bucket.demands).map(Number).sort((a, b) => b - a)
|
|
2936
|
+
const allocation = {}
|
|
2937
|
+
const shortfall = {}
|
|
2938
|
+
for (const tl of targetLevels) {
|
|
2939
|
+
let need = bucket.demands[String(tl)] || 0
|
|
2940
|
+
for (const lv of inventoryLevels) {
|
|
2941
|
+
if (need <= 0) break
|
|
2942
|
+
const avail = remaining[String(lv.level)] || 0
|
|
2943
|
+
if (avail <= 0) continue
|
|
2944
|
+
const take = Math.min(need, avail)
|
|
2945
|
+
const key = String(tl) + "|" + String(lv.level)
|
|
2946
|
+
const alloc = allocation[key] || (allocation[key] = { targetLevelValue: tl, inventoryLevel: lv.level, qty: 0, stock: 0 })
|
|
2947
|
+
alloc.qty += take
|
|
2948
|
+
alloc.stock += take
|
|
2949
|
+
remaining[String(lv.level)] = avail - take
|
|
2950
|
+
need -= take
|
|
2951
|
+
}
|
|
2952
|
+
if (need > 0) shortfall[String(tl)] = need
|
|
2865
2953
|
}
|
|
2866
|
-
const
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
item.qty = base + (remainder > 0 ? 1 : 0)
|
|
2870
|
-
if (remainder > 0) remainder -= 1
|
|
2954
|
+
for (const key of Object.keys(allocation)) {
|
|
2955
|
+
const alloc = allocation[key]
|
|
2956
|
+
entries.push({ key: bucket.equipId + ":" + key, row: bucket.displayRow, targetLevel: levelText(alloc.targetLevelValue), targetLevelValue: alloc.targetLevelValue, qty: alloc.qty, inventoryLevel: alloc.inventoryLevel, stock: alloc.stock })
|
|
2871
2957
|
}
|
|
2872
|
-
for (const
|
|
2873
|
-
|
|
2958
|
+
for (const tl of Object.keys(shortfall)) {
|
|
2959
|
+
const value = Number(tl)
|
|
2960
|
+
entries.push({ key: bucket.equipId + ":short:" + tl, row: bucket.displayRow, targetLevel: levelText(value), targetLevelValue: value, qty: shortfall[tl], inventoryLevel: null, stock: inventoryLoaded ? 0 : null, notFound: true })
|
|
2874
2961
|
}
|
|
2875
2962
|
}
|
|
2876
2963
|
for (const item of entries) {
|
|
@@ -2961,6 +3048,7 @@ class LevelOneTable extends React.Component {
|
|
|
2961
3048
|
|
|
2962
3049
|
render() {
|
|
2963
3050
|
const phase = this.props.phase
|
|
3051
|
+
const kcDevData = this.props.kcDevData
|
|
2964
3052
|
if (!phase) {
|
|
2965
3053
|
return React.createElement(
|
|
2966
3054
|
"div",
|
|
@@ -2971,6 +3059,7 @@ class LevelOneTable extends React.Component {
|
|
|
2971
3059
|
const normal = phase.consume_improvement_min
|
|
2972
3060
|
const materials = phase.materials || []
|
|
2973
3061
|
const hasMaterials = materials.some((item) => item && (item.item_name || item.item_material_key || item.item_equipment_id != null))
|
|
3062
|
+
|
|
2974
3063
|
const rows = []
|
|
2975
3064
|
LEVEL_ONE_ROWS.forEach((rate) => {
|
|
2976
3065
|
const key = rate.range
|
|
@@ -2990,6 +3079,7 @@ class LevelOneTable extends React.Component {
|
|
|
2990
3079
|
"div",
|
|
2991
3080
|
{ className: "kr2-material-cell" },
|
|
2992
3081
|
React.createElement(RateCell, { range: "素材详情", open: !!this.state.open[key], onToggle: () => this.toggle(key) }),
|
|
3082
|
+
|
|
2993
3083
|
!!this.state.open[key]
|
|
2994
3084
|
? React.createElement(MaterialDetail, { materials, onMaterialClick: this.props.onMaterialClick, inventoryByEquip: this.props.inventoryByEquip, useItemCounts: this.props.useItemCounts, onInventoryClick: this.props.onInventoryClick })
|
|
2995
3085
|
: null
|
|
@@ -3032,6 +3122,7 @@ class LevelTwoTable extends React.Component {
|
|
|
3032
3122
|
const phase0 = this.props.phase0
|
|
3033
3123
|
const phase1 = this.props.phase1
|
|
3034
3124
|
const upgrades = this.props.upgrades || null
|
|
3125
|
+
const kcDevData = this.props.kcDevData
|
|
3035
3126
|
const rows = []
|
|
3036
3127
|
const pushRateRow = (step, range, label, key, p, subText, evolTarget, maxBlue) => {
|
|
3037
3128
|
const normal = step ? step.consume_improvement_min : null
|
|
@@ -3039,6 +3130,7 @@ class LevelTwoTable extends React.Component {
|
|
|
3039
3130
|
const rec = buildRecommendation(normal, certain, p)
|
|
3040
3131
|
const materials = step ? step.materials || [] : []
|
|
3041
3132
|
const hasMaterials = materials.some((item) => item && (item.item_name || item.item_material_key || item.item_equipment_id != null))
|
|
3133
|
+
|
|
3042
3134
|
const rangeNode = maxBlue
|
|
3043
3135
|
? React.createElement("span", null, "★9→", React.createElement("span", { className: "kr2-level-max-blue" }, "max"))
|
|
3044
3136
|
: range
|
|
@@ -3075,6 +3167,7 @@ class LevelTwoTable extends React.Component {
|
|
|
3075
3167
|
"div",
|
|
3076
3168
|
{ className: "kr2-material-cell" },
|
|
3077
3169
|
React.createElement(RateCell, { range: rec.text, open: !!this.state.open[key], onToggle: () => this.toggle(key), tone: rec.tone }),
|
|
3170
|
+
|
|
3078
3171
|
!!this.state.open[key]
|
|
3079
3172
|
? React.createElement(MaterialDetail, { materials, onMaterialClick: this.props.onMaterialClick, inventoryByEquip: this.props.inventoryByEquip, useItemCounts: this.props.useItemCounts, onInventoryClick: this.props.onInventoryClick })
|
|
3080
3173
|
: null
|
|
@@ -3153,13 +3246,13 @@ class LevelSection extends React.Component {
|
|
|
3153
3246
|
}
|
|
3154
3247
|
}
|
|
3155
3248
|
|
|
3156
|
-
function EquipmentRow({ row, expanded, onToggle, onMaterialClick, inventoryByEquip, useItemCounts, onInventoryClick, isFavorite, onFavoriteClick, secretaryText }) {
|
|
3249
|
+
function EquipmentRow({ row, expanded, onToggle, onMaterialClick, inventoryByEquip, useItemCounts, onInventoryClick, isFavorite, onFavoriteClick, secretaryText, kcDevData }) {
|
|
3157
3250
|
return React.createElement(
|
|
3158
3251
|
"div",
|
|
3159
3252
|
null,
|
|
3160
3253
|
React.createElement(
|
|
3161
3254
|
"div",
|
|
3162
|
-
{ className: "kr2-row", onClick: onToggle },
|
|
3255
|
+
{ className: "kr2-row" + (row.improveable === false ? " kr2-row-not-improveable" : ""), onClick: row.improveable === false ? null : onToggle },
|
|
3163
3256
|
React.createElement(
|
|
3164
3257
|
"button",
|
|
3165
3258
|
{ className: "kr2-fav-btn" + (isFavorite ? " kr2-fav-active" : ""), onClick: (e) => { e.stopPropagation(); onFavoriteClick && onFavoriteClick(row.id) }, title: isFavorite ? "取消收藏" : "收藏" },
|
|
@@ -3169,33 +3262,35 @@ function EquipmentRow({ row, expanded, onToggle, onMaterialClick, inventoryByEqu
|
|
|
3169
3262
|
"span",
|
|
3170
3263
|
{ className: "kr2-expand" },
|
|
3171
3264
|
React.createElement(SlotitemIcon, { slotitemId: row.icon, className: "kr2-icon" }),
|
|
3172
|
-
React.createElement("span", { className: "kr2-arrow" }, expanded ? "▼" : "▶")
|
|
3265
|
+
React.createElement("span", { className: "kr2-arrow" }, row.improveable === false ? "" : expanded ? "▼" : "▶")
|
|
3173
3266
|
),
|
|
3174
3267
|
React.createElement("span", { className: "kr2-name" }, row.name),
|
|
3175
|
-
React.createElement("span", { className: "kr2-secretary" }, secretaryText || "-"),
|
|
3268
|
+
React.createElement("span", { className: "kr2-secretary" }, row.improveable === false ? "" : (secretaryText || "-")),
|
|
3176
3269
|
React.createElement(
|
|
3177
3270
|
"span",
|
|
3178
3271
|
{ className: "kr2-meta" },
|
|
3179
|
-
row.days && row.days.length >= 7 ? "每日可改修" : (row.days || []).map((d) => WEEKDAY_LABELS[d] || d).join("·")
|
|
3272
|
+
row.improveable === false ? "改修未开放" : (row.days && row.days.length >= 7 ? "每日可改修" : (row.days || []).map((d) => WEEKDAY_LABELS[d] || d).join("·"))
|
|
3180
3273
|
),
|
|
3181
|
-
|
|
3182
|
-
"
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3274
|
+
row.improveable === false
|
|
3275
|
+
? React.createElement("div", { className: "kr2-reco kr2-reco-empty" }, "")
|
|
3276
|
+
: React.createElement(
|
|
3277
|
+
"span",
|
|
3278
|
+
{ className: "kr2-reco" },
|
|
3279
|
+
React.createElement(
|
|
3280
|
+
"span",
|
|
3281
|
+
{ className: "kr2-reco-line" },
|
|
3282
|
+
React.createElement("span", { className: "kr2-reco-label" }, "推荐星级"),
|
|
3283
|
+
React.createElement("span", { className: "kr2-stars kr2-stars-priority" }, row.recommend && Number(row.recommend.priority) > 0 ? starText(row.recommend.priority) : "")
|
|
3284
|
+
),
|
|
3285
|
+
React.createElement(
|
|
3286
|
+
"span",
|
|
3287
|
+
{ className: "kr2-reco-line" },
|
|
3288
|
+
React.createElement("span", { className: "kr2-reco-label" }, "活动强度"),
|
|
3289
|
+
React.createElement("span", { className: "kr2-stars kr2-stars-activity" }, row.recommend && Number(row.recommend.activity) > 0 ? starText(row.recommend.activity) : "")
|
|
3290
|
+
)
|
|
3291
|
+
)
|
|
3197
3292
|
),
|
|
3198
|
-
expanded
|
|
3293
|
+
row.improveable !== false && expanded
|
|
3199
3294
|
? React.createElement(
|
|
3200
3295
|
"div",
|
|
3201
3296
|
{ className: "kr2-detail" },
|
|
@@ -3205,7 +3300,7 @@ function EquipmentRow({ row, expanded, onToggle, onMaterialClick, inventoryByEqu
|
|
|
3205
3300
|
React.createElement(
|
|
3206
3301
|
LevelSection,
|
|
3207
3302
|
{ title: "0→5", defaultOpen: false, resourceText: "成功率100% · 改修资材 " + (row.phase0 ? row.phase0.consume_improvement_min : "--") },
|
|
3208
|
-
React.createElement(LevelOneTable, { phase: row.phase0, onMaterialClick, inventoryByEquip, useItemCounts, onInventoryClick })
|
|
3303
|
+
React.createElement(LevelOneTable, { phase: row.phase0, onMaterialClick, inventoryByEquip, useItemCounts, onInventoryClick, kcDevData })
|
|
3209
3304
|
)
|
|
3210
3305
|
),
|
|
3211
3306
|
React.createElement(
|
|
@@ -3214,7 +3309,7 @@ function EquipmentRow({ row, expanded, onToggle, onMaterialClick, inventoryByEqu
|
|
|
3214
3309
|
React.createElement(
|
|
3215
3310
|
LevelSection,
|
|
3216
3311
|
{ title: "6→max", defaultOpen: true, resourceText: "成功率 95 / 90 / 82 / 77 / 67 / 62 %" },
|
|
3217
|
-
React.createElement(LevelTwoTable, { phase0: row.phase0, phase1: row.phase1, upgrades: row.upgrades, onMaterialClick, inventoryByEquip, useItemCounts, onInventoryClick })
|
|
3312
|
+
React.createElement(LevelTwoTable, { phase0: row.phase0, phase1: row.phase1, upgrades: row.upgrades, onMaterialClick, inventoryByEquip, useItemCounts, onInventoryClick, kcDevData })
|
|
3218
3313
|
)
|
|
3219
3314
|
)
|
|
3220
3315
|
)
|
|
@@ -3463,6 +3558,8 @@ class KoushuRateApp extends React.Component {
|
|
|
3463
3558
|
favoritesOnly: readFavoritesOnly(),
|
|
3464
3559
|
starSort: readUiState().starSort || null,
|
|
3465
3560
|
activeTab: "list",
|
|
3561
|
+
improveableOpen: true,
|
|
3562
|
+
nonImproveableOpen: false,
|
|
3466
3563
|
planSelection: readPlanSelection(),
|
|
3467
3564
|
includeDevExpected: readPlanIncludeDev(),
|
|
3468
3565
|
}
|
|
@@ -3741,7 +3838,7 @@ class KoushuRateApp extends React.Component {
|
|
|
3741
3838
|
const favoritesOnly = !!this.state.favoritesOnly
|
|
3742
3839
|
let rows = this.state.rows.filter((row) => {
|
|
3743
3840
|
if (favoritesOnly && !this.state.favorites[row.id]) return false
|
|
3744
|
-
if (day !== ALL_DAYS_KEY && (row.days || []).indexOf(day) < 0) return false
|
|
3841
|
+
if (row.improveable !== false && day !== ALL_DAYS_KEY && (row.days || []).indexOf(day) < 0) return false
|
|
3745
3842
|
if (category !== "all" && row.category !== category) return false
|
|
3746
3843
|
return true
|
|
3747
3844
|
})
|
|
@@ -3764,6 +3861,23 @@ class KoushuRateApp extends React.Component {
|
|
|
3764
3861
|
})
|
|
3765
3862
|
.map((item) => item.row)
|
|
3766
3863
|
}
|
|
3864
|
+
const improveableRows = rows.filter((row) => row.improveable !== false)
|
|
3865
|
+
const notImproveableRows = rows.filter((row) => row.improveable === false)
|
|
3866
|
+
const renderEquipmentRow = (row) =>
|
|
3867
|
+
React.createElement(EquipmentRow, {
|
|
3868
|
+
key: row.id,
|
|
3869
|
+
row,
|
|
3870
|
+
expanded: !!this.state.expanded[row.id],
|
|
3871
|
+
onToggle: () => this.toggle(row.id),
|
|
3872
|
+
onMaterialClick: this.openKcDevPopup,
|
|
3873
|
+
inventoryByEquip,
|
|
3874
|
+
useItemCounts,
|
|
3875
|
+
onInventoryClick: this.openInventoryPopup,
|
|
3876
|
+
isFavorite: !!this.state.favorites[row.id],
|
|
3877
|
+
onFavoriteClick: this.toggleFavorite,
|
|
3878
|
+
secretaryText: secretaryText(row.secretaries, day),
|
|
3879
|
+
kcDevData: this.state.kcDevData,
|
|
3880
|
+
})
|
|
3767
3881
|
|
|
3768
3882
|
return React.createElement(
|
|
3769
3883
|
"div",
|
|
@@ -3913,21 +4027,36 @@ class KoushuRateApp extends React.Component {
|
|
|
3913
4027
|
{ className: "kr2-list", style: this.state.activeTab === "plan" || this.state.activeTab === "strong" ? { display: "none" } : null },
|
|
3914
4028
|
rows.length === 0
|
|
3915
4029
|
? React.createElement("div", { className: "kr2-empty" }, favoritesOnly ? "还没有收藏装备" : "没有匹配的装备")
|
|
3916
|
-
:
|
|
3917
|
-
React.createElement(
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
4030
|
+
: [
|
|
4031
|
+
React.createElement(
|
|
4032
|
+
"div",
|
|
4033
|
+
{ key: "improveable-group", className: "kr2-improveable-group" },
|
|
4034
|
+
React.createElement(
|
|
4035
|
+
"button",
|
|
4036
|
+
{ type: "button", className: "kr2-collapse-toggle", onClick: () => this.setState((prev) => ({ improveableOpen: !prev.improveableOpen })) },
|
|
4037
|
+
this.state.improveableOpen ? "▼ " : "▶ ",
|
|
4038
|
+
"可改修装备 (",
|
|
4039
|
+
String(improveableRows.length),
|
|
4040
|
+
")"
|
|
4041
|
+
),
|
|
4042
|
+
this.state.improveableOpen ? improveableRows.map((row) => renderEquipmentRow(row)) : null
|
|
4043
|
+
),
|
|
4044
|
+
notImproveableRows.length > 0
|
|
4045
|
+
? React.createElement(
|
|
4046
|
+
"div",
|
|
4047
|
+
{ key: "not-improveable-group", className: "kr2-not-improveable-group" },
|
|
4048
|
+
React.createElement(
|
|
4049
|
+
"button",
|
|
4050
|
+
{ type: "button", className: "kr2-collapse-toggle", onClick: () => this.setState((prev) => ({ nonImproveableOpen: !prev.nonImproveableOpen })) },
|
|
4051
|
+
this.state.nonImproveableOpen ? "▼ " : "▶ ",
|
|
4052
|
+
"不可改修装备 (",
|
|
4053
|
+
String(notImproveableRows.length),
|
|
4054
|
+
")"
|
|
4055
|
+
),
|
|
4056
|
+
this.state.nonImproveableOpen ? notImproveableRows.map((row) => renderEquipmentRow(row)) : null
|
|
4057
|
+
)
|
|
4058
|
+
: null,
|
|
4059
|
+
]
|
|
3931
4060
|
),
|
|
3932
4061
|
this.state.activeTab === "plan"
|
|
3933
4062
|
? React.createElement(PlanningPage, {
|