diff --git a/packs/tables-pnj/000183.ldb b/packs/tables-pnj/000183.ldb deleted file mode 100644 index d3c88fb..0000000 Binary files a/packs/tables-pnj/000183.ldb and /dev/null differ diff --git a/packs/tables-pnj/000184.ldb b/packs/tables-pnj/000184.ldb deleted file mode 100644 index 4c01fe5..0000000 Binary files a/packs/tables-pnj/000184.ldb and /dev/null differ diff --git a/packs/tables-pnj/000186.ldb b/packs/tables-pnj/000186.ldb deleted file mode 100644 index c4f3981..0000000 Binary files a/packs/tables-pnj/000186.ldb and /dev/null differ diff --git a/packs/tables-pnj/000188.ldb b/packs/tables-pnj/000188.ldb deleted file mode 100644 index ef6fdeb..0000000 Binary files a/packs/tables-pnj/000188.ldb and /dev/null differ diff --git a/packs/tables-pnj/000213.ldb b/packs/tables-pnj/000213.ldb new file mode 100644 index 0000000..04786d9 Binary files /dev/null and b/packs/tables-pnj/000213.ldb differ diff --git a/packs/tables-pnj/000214.ldb b/packs/tables-pnj/000214.ldb new file mode 100644 index 0000000..33c43ef Binary files /dev/null and b/packs/tables-pnj/000214.ldb differ diff --git a/packs/tables-pnj/000215.ldb b/packs/tables-pnj/000215.ldb new file mode 100644 index 0000000..a0c7699 Binary files /dev/null and b/packs/tables-pnj/000215.ldb differ diff --git a/packs/tables-pnj/000217.ldb b/packs/tables-pnj/000217.ldb new file mode 100644 index 0000000..70a139a Binary files /dev/null and b/packs/tables-pnj/000217.ldb differ diff --git a/packs/tables-pnj/000187.log b/packs/tables-pnj/000218.log similarity index 62% rename from packs/tables-pnj/000187.log rename to packs/tables-pnj/000218.log index b820db0..4bd7786 100644 Binary files a/packs/tables-pnj/000187.log and b/packs/tables-pnj/000218.log differ diff --git a/packs/tables-pnj/000219.ldb b/packs/tables-pnj/000219.ldb new file mode 100644 index 0000000..482da88 Binary files /dev/null and b/packs/tables-pnj/000219.ldb differ diff --git a/packs/tables-pnj/LOG b/packs/tables-pnj/LOG index 6a5254f..95f2192 100644 --- a/packs/tables-pnj/LOG +++ b/packs/tables-pnj/LOG @@ -32,3 +32,73 @@ 2026/06/01-22:51:23.050617 7f52c4bfb6c0 Level-0 table #188: started 2026/06/01-22:51:23.083717 7f52c4bfb6c0 Level-0 table #188: 3847811 bytes OK 2026/06/01-22:51:23.090754 7f52c4bfb6c0 Delete type=0 #185 +2026/06/01-22:54:31.041731 7f52c4bfb6c0 Level-0 table #190: started +2026/06/01-22:54:31.075783 7f52c4bfb6c0 Level-0 table #190: 3898158 bytes OK +2026/06/01-22:54:31.085709 7f52c4bfb6c0 Delete type=0 #187 +2026/06/01-22:56:43.017283 7f52c4bfb6c0 Level-0 table #192: started +2026/06/01-22:56:43.056579 7f52c4bfb6c0 Level-0 table #192: 3942180 bytes OK +2026/06/01-22:56:43.067120 7f52c4bfb6c0 Delete type=0 #189 +2026/06/01-22:56:43.067709 7f52c4bfb6c0 Compacting 4@0 + 2@1 files +2026/06/01-22:56:43.096331 7f52c4bfb6c0 Generated table #193@0: 12110 keys, 2146786 bytes +2026/06/01-22:56:43.123233 7f52c4bfb6c0 Generated table #194@0: 13796 keys, 1794145 bytes +2026/06/01-22:56:43.123251 7f52c4bfb6c0 Compacted 4@0 + 2@1 files => 3940931 bytes +2026/06/01-22:56:43.135664 7f52c4bfb6c0 compacted to: files[ 0 2 2 0 0 0 0 ] +2026/06/01-22:56:43.136005 7f52c4bfb6c0 Delete type=2 #183 +2026/06/01-22:56:43.136216 7f52c4bfb6c0 Delete type=2 #184 +2026/06/01-22:56:43.136413 7f52c4bfb6c0 Delete type=2 #186 +2026/06/01-22:56:43.136721 7f52c4bfb6c0 Delete type=2 #188 +2026/06/01-22:56:43.137001 7f52c4bfb6c0 Delete type=2 #190 +2026/06/01-22:56:43.137270 7f52c4bfb6c0 Delete type=2 #192 +2026/06/01-23:02:49.561038 7f52c4bfb6c0 Level-0 table #196: started +2026/06/01-23:02:49.590283 7f52c4bfb6c0 Level-0 table #196: 3996082 bytes OK +2026/06/01-23:02:49.596507 7f52c4bfb6c0 Delete type=0 #191 +2026/06/01-23:05:28.996035 7f52c4bfb6c0 Level-0 table #198: started +2026/06/01-23:05:29.028796 7f52c4bfb6c0 Level-0 table #198: 4042529 bytes OK +2026/06/01-23:05:29.035710 7f52c4bfb6c0 Delete type=0 #195 +2026/06/01-23:11:22.779385 7f52c4bfb6c0 Level-0 table #200: started +2026/06/01-23:11:22.817516 7f52c4bfb6c0 Level-0 table #200: 4095432 bytes OK +2026/06/01-23:11:22.823424 7f52c4bfb6c0 Delete type=0 #197 +2026/06/01-23:19:54.339957 7f52c4bfb6c0 Level-0 table #202: started +2026/06/01-23:19:54.367799 7f52c4bfb6c0 Level-0 table #202: 4146311 bytes OK +2026/06/01-23:19:54.373753 7f52c4bfb6c0 Delete type=0 #199 +2026/06/01-23:19:54.374306 7f52c4bfb6c0 Compacting 4@0 + 2@1 files +2026/06/01-23:19:54.395646 7f52c4bfb6c0 Generated table #203@0: 11893 keys, 2146843 bytes +2026/06/01-23:19:54.419845 7f52c4bfb6c0 Generated table #204@0: 15341 keys, 1997992 bytes +2026/06/01-23:19:54.419877 7f52c4bfb6c0 Compacted 4@0 + 2@1 files => 4144835 bytes +2026/06/01-23:19:54.426071 7f52c4bfb6c0 compacted to: files[ 0 2 2 0 0 0 0 ] +2026/06/01-23:19:54.426414 7f52c4bfb6c0 Delete type=2 #193 +2026/06/01-23:19:54.426875 7f52c4bfb6c0 Delete type=2 #194 +2026/06/01-23:19:54.427165 7f52c4bfb6c0 Delete type=2 #196 +2026/06/01-23:19:54.427644 7f52c4bfb6c0 Delete type=2 #198 +2026/06/01-23:19:54.428125 7f52c4bfb6c0 Delete type=2 #200 +2026/06/01-23:19:54.428618 7f52c4bfb6c0 Delete type=2 #202 +2026/06/01-23:23:22.212670 7f52c4bfb6c0 Level-0 table #206: started +2026/06/01-23:23:22.246031 7f52c4bfb6c0 Level-0 table #206: 4199267 bytes OK +2026/06/01-23:23:22.252324 7f52c4bfb6c0 Delete type=0 #201 +2026/06/01-23:32:01.046035 7f52c4bfb6c0 Level-0 table #208: started +2026/06/01-23:32:01.083523 7f52c4bfb6c0 Level-0 table #208: 4245727 bytes OK +2026/06/01-23:32:01.090732 7f52c4bfb6c0 Delete type=0 #205 +2026/06/01-23:34:50.675178 7f52c4bfb6c0 Level-0 table #210: started +2026/06/01-23:34:50.708986 7f52c4bfb6c0 Level-0 table #210: 4300427 bytes OK +2026/06/01-23:34:50.715366 7f52c4bfb6c0 Delete type=0 #207 +2026/06/01-23:37:05.691865 7f52c4bfb6c0 Level-0 table #212: started +2026/06/01-23:37:05.728371 7f52c4bfb6c0 Level-0 table #212: 4351044 bytes OK +2026/06/01-23:37:05.735021 7f52c4bfb6c0 Delete type=0 #209 +2026/06/01-23:37:05.735982 7f52c4bfb6c0 Compacting 4@0 + 2@1 files +2026/06/01-23:37:05.756894 7f52c4bfb6c0 Generated table #213@0: 11588 keys, 2145171 bytes +2026/06/01-23:37:05.783035 7f52c4bfb6c0 Generated table #214@0: 16666 keys, 2163321 bytes +2026/06/01-23:37:05.787317 7f52c4bfb6c0 Generated table #215@0: 308 keys, 41171 bytes +2026/06/01-23:37:05.787329 7f52c4bfb6c0 Compacted 4@0 + 2@1 files => 4349663 bytes +2026/06/01-23:37:05.793772 7f52c4bfb6c0 compacted to: files[ 0 3 2 0 0 0 0 ] +2026/06/01-23:37:05.793970 7f52c4bfb6c0 Delete type=2 #203 +2026/06/01-23:37:05.794138 7f52c4bfb6c0 Delete type=2 #204 +2026/06/01-23:37:05.794271 7f52c4bfb6c0 Delete type=2 #206 +2026/06/01-23:37:05.794472 7f52c4bfb6c0 Delete type=2 #208 +2026/06/01-23:37:05.794734 7f52c4bfb6c0 Delete type=2 #210 +2026/06/01-23:37:05.794942 7f52c4bfb6c0 Delete type=2 #212 +2026/06/01-23:54:42.760778 7f52c4bfb6c0 Level-0 table #217: started +2026/06/01-23:54:42.788274 7f52c4bfb6c0 Level-0 table #217: 4406061 bytes OK +2026/06/01-23:54:42.794452 7f52c4bfb6c0 Delete type=0 #211 +2026/06/02-00:07:09.406466 7f52c4bfb6c0 Level-0 table #219: started +2026/06/02-00:07:09.441912 7f52c4bfb6c0 Level-0 table #219: 4455911 bytes OK +2026/06/02-00:07:09.447798 7f52c4bfb6c0 Delete type=0 #216 diff --git a/packs/tables-pnj/MANIFEST-000171 b/packs/tables-pnj/MANIFEST-000171 index 9323706..5b8cc7b 100644 Binary files a/packs/tables-pnj/MANIFEST-000171 and b/packs/tables-pnj/MANIFEST-000171 differ diff --git a/scripts/CommerceDialog.js b/scripts/CommerceDialog.js index 8079612..801ebb8 100644 --- a/scripts/CommerceDialog.js +++ b/scripts/CommerceDialog.js @@ -51,15 +51,36 @@ export class CommerceDialog extends HandlebarsApplicationMixin(ApplicationV2) { }, }; this._tradeGoods = null; + this._worldNames = {}; + + if (options.defaultWorld) { + const w = options.defaultWorld; + this._defaultWorld = w; + this._worldNames['pax.uwpDep'] = w.name || ''; + this._worldNames['cargo.uwpDep'] = w.name || ''; + this._worldNames['trade.uwp'] = w.name || ''; + if (w.uwp) this._formData.pax.uwpDep = w.uwp; + if (w.zone) this._formData.pax.zoneDep = w.zone; + if (w.uwp) this._formData.cargo.uwpDep = w.uwp; + if (w.zone) this._formData.cargo.zoneDep = w.zone; + if (w.uwp) this._formData.trade.uwp = w.uwp; + if (w.zone) this._formData.trade.zone = w.zone; + this._activeTab = 'trade'; + } } async _prepareContext() { _registerHandlebarsHelpers(); - return { + const ctx = { ...this._formData, activeActor: buildActiveActorContext(), activeTab: this._activeTab, }; + if (this._defaultWorld) { + ctx.defaultWorldName = this._defaultWorld.name; + ctx.defaultWorldLoc = `${this._defaultWorld.sector || ''} ${this._defaultWorld.hex || ''}`.trim(); + } + return ctx; } async _onRender(context, options) { @@ -128,6 +149,12 @@ export class CommerceDialog extends HandlebarsApplicationMixin(ApplicationV2) { this._bindWorldSearch(html); + // Pré-remplir les champs recherche avec le nom du monde + if (this._defaultWorld?.name) { + html.find('.world-search-widget[data-role="dep"] .world-search-input, .world-block-full .world-search-input') + .val(this._defaultWorld.name); + } + html.on('click', (ev) => { if (!$(ev.target).closest('.world-search-widget').length) { html.find('.world-search-results').empty(); @@ -204,6 +231,7 @@ export class CommerceDialog extends HandlebarsApplicationMixin(ApplicationV2) { $li.on('click', async () => { $results.empty(); $input.val(w.name); + if (uwpTarget) this._worldNames[uwpTarget] = w.name; const [detail, coords] = await Promise.all([ fetchWorldDetail(w.sector, w.hex).catch(() => null), fetchWorldCoordinates(w.sector, w.hex).catch(() => null), @@ -222,11 +250,13 @@ export class CommerceDialog extends HandlebarsApplicationMixin(ApplicationV2) { html.find('[name="cargo.uwpDep"]').val(resolvedUwp); html.find('[name="cargo.zoneDep"]').val(resolvedZone); $cargoDep.data('coords', coords); + this._worldNames['cargo.uwpDep'] = w.name; const $tradeWorld = html.find('.world-search-widget[data-uwp-target="trade.uwp"]'); $tradeWorld.find('.world-search-input').val(w.name); html.find('[name="trade.uwp"]').val(resolvedUwp); html.find('[name="trade.zone"]').val(resolvedZone); + this._worldNames['trade.uwp'] = w.name; } if (parsecsTarget) { @@ -370,6 +400,8 @@ export class CommerceDialog extends HandlebarsApplicationMixin(ApplicationV2) { }); if (!result.success) return ui.notifications.error(result.errors.join(' | ')); + result.dep = { ...result.dep, name: this._worldNames['pax.uwpDep'] || '' }; + result.dest = { ...result.dest, name: this._worldNames['pax.uwpDest'] || '' }; await this._postToChatResult(result); } @@ -394,6 +426,8 @@ export class CommerceDialog extends HandlebarsApplicationMixin(ApplicationV2) { if (!result.success) return ui.notifications.error(result.errors.join(' | ')); result.cargoRevenue = result.lots.reduce((s, l) => s + l.revenue, 0); + result.dep = { ...result.dep, name: this._worldNames['cargo.uwpDep'] || '' }; + result.dest = { ...result.dest, name: this._worldNames['cargo.uwpDest'] || '' }; await this._postToChatResult(result); } @@ -413,6 +447,7 @@ export class CommerceDialog extends HandlebarsApplicationMixin(ApplicationV2) { if (!result.success) return ui.notifications.error(result.errors.join(' | ')); + result.world = { ...result.world, name: this._worldNames['trade.uwp'] || '' }; this._tradeGoods = result; const goodsDiv = html.find('.trade-goods-result'); const listDiv = html.find('.trade-goods-list'); diff --git a/scripts/SectorMapApp.js b/scripts/SectorMapApp.js index fe5baa4..a5254f3 100644 --- a/scripts/SectorMapApp.js +++ b/scripts/SectorMapApp.js @@ -5,6 +5,9 @@ * Les clics sur la carte affichent les détails du monde dans le chat. */ +import { searchWorlds } from './travellerMapApi.js'; +import { TravelDialog } from './travelDialog.js'; + const { ApplicationV2 } = foundry.applications.api; const MODULE_ID = 'mgt2-compendium-amiral-denisov'; @@ -21,9 +24,12 @@ export class SectorMapApp extends ApplicationV2 { this._sector = sector; this._subsector = subsector; this._handler = null; + this._mapHex = null; + this._searchTimeout = null; } get title() { + if (!this._sector) return 'Carte stellaire — Traveller Map'; return this._subsector ? `Sous-secteur ${this._subsector} — ${this._sector}` : `Secteur ${this._sector}`; @@ -31,10 +37,15 @@ export class SectorMapApp extends ApplicationV2 { get _mapUrl() { const base = 'https://travellermap.com'; + if (!this._sector) return `${base}/?style=mongoose&hideui=1`; if (this._subsector) { return `${base}/?sector=${encodeURIComponent(this._sector)}&subsector=${encodeURIComponent(this._subsector)}&style=mongoose&hideui=1`; } - return `${base}/go/${encodeURIComponent(this._sector)}?style=mongoose`; + let url = `${base}/go/${encodeURIComponent(this._sector)}?style=mongoose`; + if (this._mapHex) { + url += `&hex=${this._mapHex}&scale=512`; + } + return url; } /* ───── Rendu ───── */ @@ -49,10 +60,15 @@ export class SectorMapApp extends ApplicationV2 { _renderHTML() { return `