poi-plugin-leveling-plan 0.0.1 → 0.0.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/assets/main.css CHANGED
@@ -174,7 +174,160 @@
174
174
 
175
175
  /* Map Selector */
176
176
  #leveling-plan .map-selector {
177
- width: 100%;
177
+ display: inline-block;
178
+ position: relative;
179
+ }
180
+
181
+ #leveling-plan .map-selector-dropdown {
182
+ max-height: 200px;
183
+ overflow-y: auto;
184
+ }
185
+
186
+ #leveling-plan .map-selector-list {
187
+ padding: 5px;
188
+ }
189
+
190
+ #leveling-plan .map-selector-item {
191
+ display: flex;
192
+ align-items: center;
193
+ gap: 8px;
194
+ padding: 6px 10px;
195
+ cursor: pointer;
196
+ border-radius: 3px;
197
+ }
198
+
199
+ #leveling-plan .map-selector-item:hover {
200
+ background-color: rgba(0, 0, 0, 0.1);
201
+ }
202
+
203
+ #leveling-plan .map-selector-item.selected {
204
+ background-color: rgba(51, 122, 183, 0.1);
205
+ }
206
+
207
+ #leveling-plan .map-selector-check {
208
+ width: 20px;
209
+ }
210
+
211
+ #leveling-plan .map-selector-name {
212
+ flex: 1;
213
+ }
214
+
215
+ #leveling-plan .map-selector-exp {
216
+ color: #888;
217
+ font-size: 12px;
218
+ }
219
+
220
+ #leveling-plan .quick-select-buttons {
221
+ display: flex;
222
+ flex-wrap: wrap;
223
+ gap: 8px;
224
+ margin-bottom: 15px;
225
+ }
226
+
227
+ .bp5-dark #leveling-plan .map-selector-dropdown {
228
+ background: #303030;
229
+ }
230
+
231
+ .bp5-dark #leveling-plan .map-selector-item:hover {
232
+ background-color: rgba(255, 255, 255, 0.1);
233
+ }
234
+
235
+ .bp5-dark #leveling-plan .map-selector-item.selected {
236
+ background-color: rgba(79, 172, 254, 0.2);
237
+ }
238
+
239
+ .bp5-dark #leveling-plan .map-selector-exp {
240
+ color: #999;
241
+ }
242
+
243
+ #leveling-plan .map-selector .bp5-popover {
244
+ position: absolute;
245
+ contain: layout;
246
+ z-index: 1000;
247
+ }
248
+
249
+ #leveling-plan .map-selector .bp5-popover-content,
250
+ #leveling-plan .map-selector .bp5-menu {
251
+ max-height: 300px;
252
+ overflow-y: auto;
253
+ position: relative;
254
+ }
255
+
256
+ #leveling-plan .map-select-item {
257
+ display: flex;
258
+ align-items: center;
259
+ gap: 8px;
260
+ }
261
+
262
+ #leveling-plan .map-select-check {
263
+ width: 20px;
264
+ }
265
+
266
+ #leveling-plan .map-select-name {
267
+ flex: 1;
268
+ }
269
+
270
+ #leveling-plan .map-select-exp {
271
+ color: #888;
272
+ font-size: 12px;
273
+ }
274
+
275
+ #leveling-plan .quick-select-buttons {
276
+ display: flex;
277
+ flex-wrap: wrap;
278
+ gap: 8px;
279
+ margin-bottom: 15px;
280
+ }
281
+
282
+ #leveling-plan .map-selector .bp5-menu {
283
+ max-height: 300px;
284
+ overflow-y: auto;
285
+ }
286
+
287
+ #leveling-plan .map-selector-tabs {
288
+ display: flex;
289
+ flex-direction: column;
290
+ min-width: 280px;
291
+ }
292
+
293
+ #leveling-plan .map-selector-tab-panel {
294
+ max-height: 250px;
295
+ overflow-y: auto;
296
+ width: 200px;
297
+ list-style: none;
298
+ }
299
+
300
+ #leveling-plan .map-selector-tab-panel ul,
301
+ #leveling-plan .map-selector-tab-panel li {
302
+ list-style: none;
303
+ padding-left: 0;
304
+ }
305
+
306
+ #leveling-plan .map-selector-popover .bp5-menu-item::before {
307
+ display: none;
308
+ }
309
+
310
+ #leveling-plan .map-select-item {
311
+ display: flex;
312
+ align-items: center;
313
+ gap: 8px;
314
+ }
315
+
316
+ #leveling-plan .map-select-check {
317
+ width: 20px;
318
+ }
319
+
320
+ #leveling-plan .map-select-name {
321
+ flex: 1;
322
+ }
323
+
324
+ #leveling-plan .map-select-exp {
325
+ color: #888;
326
+ font-size: 12px;
327
+ }
328
+
329
+ .bp5-dark #leveling-plan .map-select-exp {
330
+ color: #999;
178
331
  }
179
332
 
180
333
  #leveling-plan .quick-select-buttons {
@@ -257,10 +410,115 @@
257
410
  margin-top: 20px;
258
411
  }
259
412
 
413
+ /* Map Experience Overview */
414
+ #leveling-plan .map-exp-overview {
415
+ margin-top: 20px;
416
+ padding-top: 20px;
417
+ border-top: 1px solid #ddd;
418
+ }
419
+
420
+ #leveling-plan .map-exp-table-container {
421
+ max-height: 400px;
422
+ overflow-y: auto;
423
+ margin-top: 10px;
424
+ }
425
+
426
+ #leveling-plan .map-exp-table {
427
+ width: 100%;
428
+ border-collapse: collapse;
429
+ font-size: 13px;
430
+ }
431
+
432
+ #leveling-plan .map-exp-table th,
433
+ #leveling-plan .map-exp-table td {
434
+ padding: 8px 12px;
435
+ text-align: left;
436
+ border-bottom: 1px solid #eee;
437
+ }
438
+
439
+ #leveling-plan .map-exp-table th {
440
+ background-color: #fff;
441
+ font-weight: bold;
442
+ position: sticky;
443
+ top: 0;
444
+ z-index: 1;
445
+ }
446
+
447
+ .bp5-dark #leveling-plan .map-exp-table th {
448
+ background-color: #303030;
449
+ }
450
+
451
+ #leveling-plan .map-exp-table tr:nth-child(even) {
452
+ background-color: rgba(0, 0, 0, 0.02);
453
+ }
454
+
455
+ #leveling-plan .map-exp-table tr:hover {
456
+ background-color: rgba(0, 0, 0, 0.05);
457
+ }
458
+
459
+ #leveling-plan .map-id {
460
+ font-weight: bold;
461
+ min-width: 50px;
462
+ }
463
+
464
+ #leveling-plan .preset-exp {
465
+ color: #666;
466
+ }
467
+
468
+ #leveling-plan .personal-exp {
469
+ color: #999;
470
+ }
471
+
472
+ #leveling-plan .personal-exp.active {
473
+ color: #ffc107;
474
+ font-weight: bold;
475
+ }
476
+
477
+ #leveling-plan .sample-count {
478
+ color: #666;
479
+ }
480
+
481
+ #leveling-plan .sample-count.insufficient {
482
+ color: #d9534f;
483
+ }
484
+
485
+ #leveling-plan .insufficient-note {
486
+ font-size: 11px;
487
+ opacity: 0.8;
488
+ }
489
+
490
+ #leveling-plan .source-badge {
491
+ display: inline-block;
492
+ padding: 2px 8px;
493
+ border-radius: 3px;
494
+ font-size: 11px;
495
+ }
496
+
497
+ #leveling-plan .source-badge.personal {
498
+ background-color: #ffc107;
499
+ color: #000;
500
+ }
501
+
502
+ #leveling-plan .source-badge.preset {
503
+ background-color: #5bc0de;
504
+ color: #fff;
505
+ }
506
+
260
507
  .bp5-popover-transition-container{
261
508
  z-index: 11000;
262
509
  }
263
510
 
511
+ #leveling-plan .map-selector-popover .bp5-menu {
512
+ max-height: 300px;
513
+ overflow-y: auto;
514
+ }
515
+
516
+ #leveling-plan .map-selector-popover.bp5-overlay {
517
+ position: absolute;
518
+ height: 0;
519
+ overflow: visible;
520
+ }
521
+
264
522
  /* Ship Selector Portal - ensure it appears above modals */
265
523
  .ship-selector-portal .bp3-popover {
266
524
  z-index: 10 !important;
@@ -269,3 +527,9 @@
269
527
  .ship-selector-portal .bp3-overlay-backdrop {
270
528
  z-index: 9 !important;
271
529
  }
530
+
531
+ /* Useitem Icon */
532
+ #leveling-plan .useitem-icon {
533
+ width: 18px;
534
+ height: 18px;
535
+ }
package/i18n/en-US.json CHANGED
@@ -45,5 +45,12 @@
45
45
  "MVP": "MVP",
46
46
  "Reset to Default": "Reset to Default",
47
47
  "Save Settings": "Save Settings",
48
- "Are you sure you want to delete this plan?": "Are you sure you want to delete this plan?"
48
+ "Are you sure you want to delete this plan?": "Are you sure you want to delete this plan?",
49
+ "Map Experience Overview": "Map Experience Overview",
50
+ "Preset Value": "Preset Value",
51
+ "Personal Value": "Personal Value",
52
+ "Sample Count": "Sample Count",
53
+ "Currently Used": "Currently Used",
54
+ "Samples Insufficient": "Samples Insufficient",
55
+ "No personal data": "No personal data"
49
56
  }
package/i18n/ja-JP.json CHANGED
@@ -45,5 +45,12 @@
45
45
  "MVP": "MVP",
46
46
  "Reset to Default": "デフォルトに戻す",
47
47
  "Save Settings": "設定を保存",
48
- "Are you sure you want to delete this plan?": "この計画を削除してもよろしいですか?"
48
+ "Are you sure you want to delete this plan?": "この計画を削除してもよろしいですか?",
49
+ "Map Experience Overview": "海域経験値一覧",
50
+ "Preset Value": "プリセット値",
51
+ "Personal Value": "個人値",
52
+ "Sample Count": "サンプル数",
53
+ "Currently Used": "現在使用中",
54
+ "Samples Insufficient": "サンプル不足",
55
+ "No personal data": "個人データなし"
49
56
  }
package/i18n/zh-CN.json CHANGED
@@ -45,5 +45,12 @@
45
45
  "MVP": "MVP",
46
46
  "Reset to Default": "恢复默认",
47
47
  "Save Settings": "保存设置",
48
- "Are you sure you want to delete this plan?": "确定要删除这个计划吗?"
48
+ "Are you sure you want to delete this plan?": "确定要删除这个计划吗?",
49
+ "Map Experience Overview": "海图经验总览",
50
+ "Preset Value": "预设值",
51
+ "Personal Value": "个人值",
52
+ "Sample Count": "样本数",
53
+ "Currently Used": "当前使用",
54
+ "Samples Insufficient": "样本不足",
55
+ "No personal data": "无个人数据"
49
56
  }
package/i18n/zh-TW.json CHANGED
@@ -45,5 +45,12 @@
45
45
  "MVP": "MVP",
46
46
  "Reset to Default": "恢復預設",
47
47
  "Save Settings": "儲存設定",
48
- "Are you sure you want to delete this plan?": "確定要刪除這個計劃嗎?"
48
+ "Are you sure you want to delete this plan?": "確定要刪除這個計劃嗎?",
49
+ "Map Experience Overview": "海圖經驗總覽",
50
+ "Preset Value": "預設值",
51
+ "Personal Value": "個人值",
52
+ "Sample Count": "樣本數",
53
+ "Currently Used": "當前使用",
54
+ "Samples Insufficient": "樣本不足",
55
+ "No personal data": "無個人數據"
49
56
  }
package/index.js CHANGED
@@ -16,7 +16,7 @@ const windowOptions = {
16
16
  x: config.get('poi.window.x', 0),
17
17
  y: config.get('poi.window.y', 0),
18
18
  width: 820,
19
- height: 650 // Initialize auto-complete observer when plugin loads
19
+ height: 650 // Initialize observers when plugin loads
20
20
  // Import and initialize in next tick to ensure POI is ready
21
21
 
22
22
  };
@@ -33,6 +33,16 @@ if (typeof setImmediate === 'function') {
33
33
  } catch (error) {
34
34
  console.error('[LevelingPlan] Failed to load auto-complete observer:', error);
35
35
  }
36
+
37
+ try {
38
+ const {
39
+ initBattleObserver
40
+ } = require('./services/battle-observer');
41
+
42
+ initBattleObserver();
43
+ } catch (error) {
44
+ console.error('[LevelingPlan] Failed to load battle observer:', error);
45
+ }
36
46
  });
37
47
  } else {
38
48
  setTimeout(() => {
@@ -45,5 +55,15 @@ if (typeof setImmediate === 'function') {
45
55
  } catch (error) {
46
56
  console.error('[LevelingPlan] Failed to load auto-complete observer:', error);
47
57
  }
58
+
59
+ try {
60
+ const {
61
+ initBattleObserver
62
+ } = require('./services/battle-observer');
63
+
64
+ initBattleObserver();
65
+ } catch (error) {
66
+ console.error('[LevelingPlan] Failed to load battle observer:', error);
67
+ }
48
68
  }, 0);
49
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poi-plugin-leveling-plan",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Leveling plan plugin for poi",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.stopBattleObserver = exports.initBattleObserver = void 0;
5
+
6
+ var _configHelper = require("../utils/config-helper");
7
+
8
+ let currentMapId = '';
9
+
10
+ const handleResponse = e => {
11
+ const {
12
+ path,
13
+ body
14
+ } = e.detail;
15
+
16
+ if (path === '/kcsapi/api_req_sortie/battleresult' || path === '/kcsapi/api_req_combined_battle/battleresult' || path === '/kcsapi/api_req_battle/battleresult' || path === '/kcsapi/api_req_practice/battle_result') {
17
+ console.log('[LevelingPlan] Battle result event:', path, 'currentMapId:', currentMapId);
18
+
19
+ if (!currentMapId) {
20
+ console.warn('[LevelingPlan] Battle result received but no mapId set');
21
+ return;
22
+ }
23
+
24
+ const baseExp = body === null || body === void 0 ? void 0 : body.api_get_base_exp;
25
+
26
+ if (baseExp && baseExp > 0) {
27
+ (0, _configHelper.recordMapExp)(currentMapId, baseExp);
28
+ console.log(`[LevelingPlan] Recorded map exp: ${currentMapId} = ${baseExp}`);
29
+ }
30
+ }
31
+
32
+ if (path === '/kcsapi/api_req_map/start') {
33
+ const worldId = body === null || body === void 0 ? void 0 : body.api_maparea_id;
34
+ const mapNo = body === null || body === void 0 ? void 0 : body.api_mapinfo_no;
35
+
36
+ if (worldId !== undefined && mapNo !== undefined) {
37
+ currentMapId = `${worldId}${mapNo}`;
38
+ console.log(`[LevelingPlan] Entered map: ${currentMapId}`);
39
+ }
40
+ }
41
+
42
+ if (path && path.includes('port')) {
43
+ currentMapId = '';
44
+ }
45
+ };
46
+
47
+ const initBattleObserver = () => {
48
+ window.addEventListener('game.response', handleResponse);
49
+ console.log('[LevelingPlan] Battle observer initialized');
50
+ };
51
+
52
+ exports.initBattleObserver = initBattleObserver;
53
+
54
+ const stopBattleObserver = () => {
55
+ window.removeEventListener('game.response', handleResponse);
56
+ console.log('[LevelingPlan] Battle observer stopped');
57
+ };
58
+
59
+ exports.stopBattleObserver = stopBattleObserver;