Skip to content

Commit a4f6b2a

Browse files
committed
Fix broken setting doc links
1 parent 62621e1 commit a4f6b2a

File tree

5 files changed

+43
-12
lines changed

5 files changed

+43
-12
lines changed

exporters/datapackExporter/datapackExporter.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,7 @@ export function loadExporter() {
10441044
displayName: TRANSLATIONS.datapack_mcmeta.name,
10451045
description: TRANSLATIONS.datapack_mcmeta.description,
10461046
defaultValue: '',
1047+
docsLink: '/docs/exporters/datapack_exporter/settings#datapack',
10471048
},
10481049
function onUpdate(setting) {
10491050
if (!setting.value) {
@@ -1069,18 +1070,22 @@ export function loadExporter() {
10691070
min: 0,
10701071
step: 1,
10711072
// resettable: true,
1073+
docsLink: '/docs/exporters/datapack_exporter/settings#interpolation_duration',
10721074
}),
10731075
outdated_rig_warning: new API.Settings.CheckboxSetting({
10741076
id: 'animated_java:datapack_exporter/outdated_rig_warning',
10751077
displayName: TRANSLATIONS.enable_outdated_rig_warning.name,
10761078
description: TRANSLATIONS.enable_outdated_rig_warning.description,
10771079
defaultValue: true,
1080+
docsLink: '/docs/exporters/datapack_exporter/settings#outdated_rig_warning',
10781081
}),
10791082
include_convenience_functions: new API.Settings.CheckboxSetting({
10801083
id: 'animated_java:datapack_exporter/include_convenience_functions',
10811084
displayName: TRANSLATIONS.include_convenience_functions.name,
10821085
description: TRANSLATIONS.include_convenience_functions.description,
10831086
defaultValue: true,
1087+
docsLink:
1088+
'/docs/exporters/datapack_exporter/settings#include_convenience_functions',
10841089
}),
10851090
// enable_single_rig_optimizations: new API.Settings.CheckboxSetting({
10861091
// id: 'animated_java:datapack_exporter/enable_single_rig_optimizations',
@@ -1095,6 +1100,7 @@ export function loadExporter() {
10951100
description: TRANSLATIONS.root_entity_nbt.description,
10961101
language: 'nbt',
10971102
defaultValue: '{}',
1103+
docsLink: '/docs/exporters/datapack_exporter/settings#root_entity_nbt',
10981104
},
10991105
function onUpdate(setting) {
11001106
try {

src/projectSettings.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export function getDefaultProjectSettings(): IAnimatedJavaProjectSettings {
135135
displayName: TRANSLATIONS.project_namespace.displayName,
136136
description: TRANSLATIONS.project_namespace.description,
137137
defaultValue: '',
138-
docsLink: 'page:project_settings#project_namespace',
138+
docsLink: '/docs/project_settings#project_namespace',
139139
},
140140
function onUpdate(setting) {
141141
if (setting.value === '')
@@ -158,7 +158,7 @@ export function getDefaultProjectSettings(): IAnimatedJavaProjectSettings {
158158
},
159159
min: 1,
160160
secondNumberLabel: 'x',
161-
docsLink: 'page:project_settings#project_resolution',
161+
docsLink: '/docs/project_settings#project_resolution',
162162
},
163163
function onUpdate(setting) {
164164
Project!.texture_width = setting.numberA
@@ -175,7 +175,7 @@ export function getDefaultProjectSettings(): IAnimatedJavaProjectSettings {
175175
description: TRANSLATIONS.rig_item.description,
176176
defaultValue: 'minecraft:white_dye',
177177
// resettable: true,
178-
docsLink: 'page:project_settings#rig_item',
178+
docsLink: '/docs/project_settings#rig_item',
179179
},
180180
function onUpdate(setting) {
181181
setting.value = setting.value.toLowerCase()
@@ -222,7 +222,7 @@ export function getDefaultProjectSettings(): IAnimatedJavaProjectSettings {
222222
description: TRANSLATIONS.rig_item_model.description,
223223
defaultValue: '',
224224
// resettable: true,
225-
docsLink: 'page:project_settings#rig_item_model',
225+
docsLink: '/docs/project_settings#rig_item_model',
226226
dependsOn: ['animated_java:project_settings/rig_item'],
227227
},
228228
function onUpdate(setting) {
@@ -267,7 +267,7 @@ export function getDefaultProjectSettings(): IAnimatedJavaProjectSettings {
267267
description: TRANSLATIONS.rig_export_folder.description,
268268
defaultValue: '',
269269
// resettable: true,
270-
docsLink: 'page:project_settings#rig_export_folder',
270+
docsLink: '/docs/project_settings#rig_export_folder',
271271
},
272272
function onUpdate(setting) {
273273
if (!setting.value) {
@@ -293,7 +293,7 @@ export function getDefaultProjectSettings(): IAnimatedJavaProjectSettings {
293293
description: TRANSLATIONS.texture_export_folder.description,
294294
defaultValue: '',
295295
// resettable: true,
296-
docsLink: 'page:project_settings#texture_export_folder',
296+
docsLink: '/docs/project_settings#texture_export_folder',
297297
},
298298
function onUpdate(setting) {
299299
if (!setting.value) {
@@ -317,7 +317,7 @@ export function getDefaultProjectSettings(): IAnimatedJavaProjectSettings {
317317
displayName: TRANSLATIONS.enable_advanced_resource_pack_settings.displayName,
318318
description: TRANSLATIONS.enable_advanced_resource_pack_settings.description,
319319
defaultValue: false,
320-
docsLink: 'page:project_settings#enable_advanced_resource_pack_settings',
320+
docsLink: '/docs/project_settings#enable_advanced_resource_pack_settings',
321321
}),
322322

323323
resource_pack_mcmeta: new Settings.FileSetting(
@@ -327,7 +327,7 @@ export function getDefaultProjectSettings(): IAnimatedJavaProjectSettings {
327327
description: TRANSLATIONS.resource_pack_mcmeta.description,
328328
defaultValue: '',
329329
// resettable: true,
330-
docsLink: 'page:project_settings#resource_pack_mcmeta',
330+
docsLink: '/docs/project_settings#resource_pack',
331331
},
332332
function onUpdate(setting) {
333333
if (!setting.value) {
@@ -351,7 +351,7 @@ export function getDefaultProjectSettings(): IAnimatedJavaProjectSettings {
351351
displayName: TRANSLATIONS.verbose.displayName,
352352
description: TRANSLATIONS.verbose.description,
353353
defaultValue: true,
354-
docsLink: 'page:project_settings#verbose',
354+
docsLink: '/docs/project_settings#verbose',
355355
}),
356356

357357
exporter: new Settings.DropdownSetting<string>(
@@ -360,7 +360,7 @@ export function getDefaultProjectSettings(): IAnimatedJavaProjectSettings {
360360
displayName: TRANSLATIONS.exporter.displayName,
361361
description: TRANSLATIONS.exporter.description,
362362
defaultValue: 0,
363-
docsLink: 'page:project_settings#exporter',
363+
docsLink: '/docs/project_settings#exporter',
364364
options: [],
365365
},
366366
undefined,

src/settings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ export const animatedJavaSettings = {
365365
displayName: translate('animated_java.settings.reduced_motion'),
366366
description: translate('animated_java.settings.reduced_motion.description').split('\n'),
367367
defaultValue: false,
368+
docsLink: '/docs/animated-java/settings#reduced-motion',
368369
},
369370
function onUpdate(setting) {
370371
reducedMotion.set(setting.value)
@@ -375,6 +376,7 @@ export const animatedJavaSettings = {
375376
displayName: translate('animated_java.settings.minify_output'),
376377
description: translate('animated_java.settings.minify_output.description').split('\n'),
377378
defaultValue: false,
379+
docsLink: '/docs/animated-java/settings#minify-output',
378380
}),
379381
}
380382

src/ui/ajDocs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function openAJDocsDialog(link?: string, section?: string) {
1717
id: 'animated_java:documentation',
1818
width: 1000,
1919
svelteComponent: DocsComponent,
20-
svelteComponentProps: { page: link, section },
20+
svelteComponentProps: { link, section },
2121
buttons: [translate('animated_java.dialog.close_button')],
2222
stackable: true,
2323
onClose: () => {

src/ui/components/newDocs/docsDialog.svelte

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,33 @@
7272
openPageUrl.set(event.link)
7373
})
7474
75+
function scrollToSection(section: string) {
76+
const element = document.getElementById(section)
77+
if (!element) return
78+
element.scrollIntoView({ behavior: 'smooth', block: 'start' })
79+
}
80+
7581
void load()
7682
//
7783
</script>
7884

85+
<script lang="ts">
86+
export let link: string
87+
export let section: string | undefined
88+
89+
function onLoad(event: HTMLDivElement) {
90+
setTimeout(() => {
91+
if (link) openPageUrl.set(link)
92+
if (section) {
93+
scrollToSection(section.replaceAll('_', '-'))
94+
console.log(link, section.replaceAll('_', '-'))
95+
}
96+
}, 100)
97+
}
98+
99+
//
100+
</script>
101+
79102
<div class="docs-container">
80103
{#if manifest}
81104
<div class="index-sidebar">
@@ -86,7 +109,7 @@
86109
</div>
87110
<div />
88111
</div>
89-
<div class="animated-java-page-container">
112+
<div class="animated-java-page-container" use:onLoad>
90113
<DocsPage page={getPage($openPageUrl)} />
91114
</div>
92115
{:else}

0 commit comments

Comments
 (0)