Skip to content

Commit 3e2a0c2

Browse files
committed
🚧 v1.6.0
1 parent f54f807 commit 3e2a0c2

File tree

8 files changed

+176
-3
lines changed

8 files changed

+176
-3
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"title": "Animated Java",
55
"icon": "icon.svg",
66
"description": "A Blockbench plugin that makes complex animation a breeze in Minecraft: Java Edition.",
7-
"version": "1.5.2",
8-
"display_version": "1.5.2",
7+
"version": "1.6.0",
8+
"display_version": "1.6.0",
99
"min_blockbench_version": "4.11.1",
1010
"variant": "desktop",
1111
"tags": [

src/components/changelogDialog.svelte

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<script lang="ts">
2+
import changelog from '../pluginPackage/changelog.json'
3+
4+
function formatDateFull(date: string) {
5+
// @ts-expect-error
6+
return getDateDisplay(date).full
7+
}
8+
function formatDateShort(date: string) {
9+
// @ts-expect-error
10+
return getDateDisplay(date).short
11+
}
12+
13+
const ISSUES_URL = 'https://api.github.com/repos/animated-java/animated-java/issues/'
14+
15+
async function formatMarkdown(text: string) {
16+
const issues: Record<number, { title: string; url: string }> = {}
17+
text = text.replace(/\[(.*?)\]\((.*?)\)/g, (match, title, url) => {
18+
const issueMatch = url.match(/issues\/(\d+)/)
19+
if (issueMatch) {
20+
const issueNumber = parseInt(issueMatch[1])
21+
issues[issueNumber] = { title, url }
22+
return `$$$ISSUE${issueNumber}$$$`
23+
}
24+
return `<a href="${url}" target="_blank">${title}</a>`
25+
})
26+
for (const [issueNumber, { title, url }] of Object.entries(issues)) {
27+
await fetch(`${ISSUES_URL}${issueNumber}`)
28+
.then(response => response.json())
29+
.then(data => {
30+
text = text.replace(
31+
`$$$ISSUE${issueNumber}$$$`,
32+
`<a href="${url}" target="_blank">#${issueNumber} - ${data.title}</a>`,
33+
)
34+
})
35+
}
36+
// inline code blocks
37+
text = text.replace(/`([^`]+?)`/g, '<code>$1</code>')
38+
return text
39+
}
40+
</script>
41+
42+
<div class="content plugin_browser_tabbed_page" id="plugin_browser_changelog">
43+
{#each Object.values(changelog) as versions}
44+
<h3>
45+
{versions.title}
46+
</h3>
47+
<!-- svelte-ignore a11y-label-has-associated-control -->
48+
<label class="plugin_changelog_author">{versions.author}</label>
49+
<!-- svelte-ignore a11y-label-has-associated-control -->
50+
<label class="plugin_changelog_date" title={formatDateFull(versions.date)}>
51+
<i class="material-icons icon">calendar_today</i>
52+
<!-- svelte-ignore missing-declaration -->
53+
{formatDateShort(versions.date)}
54+
</label>
55+
<ul>
56+
{#each versions.categories as category}
57+
<li>
58+
<h4>{category.title}</h4>
59+
<ul class="plugin_changelog_features">
60+
{#each category.list as item}
61+
<li>
62+
{#await formatMarkdown(item) then data}
63+
{@html data}
64+
{/await}
65+
</li>
66+
{/each}
67+
</ul>
68+
</li>
69+
{/each}
70+
</ul>
71+
<hr />
72+
{/each}
73+
</div>
74+
75+
<style>
76+
.content {
77+
max-height: 75vh;
78+
overflow: auto;
79+
}
80+
:global(.plugin_browser_tabbed_page code) {
81+
background-color: var(--color-back);
82+
padding: 0.2em 0.4em;
83+
border-radius: 3px;
84+
font-size: 0.8em;
85+
}
86+
</style>

src/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import { openBlueprintLoadingDialog } from './interface/blueprintLoadingPopup'
4343
import { openInstallPopup } from './interface/installedPopup'
4444
import { cleanupExportedFiles } from './systems/cleaner'
4545
import mcbFiles from './systems/datapackCompiler/mcbFiles'
46+
import { openChangelogDialog } from './interface/changelogDialog'
4647

4748
// @ts-ignore
4849
globalThis.AnimatedJava = {
@@ -85,9 +86,18 @@ globalThis.AnimatedJava = {
8586
},
8687
cleanupExportedFiles,
8788
mcbFiles,
89+
openChangelogDialog,
8890
},
8991
}
9092

93+
requestAnimationFrame(() => {
94+
const lastVersion = localStorage.getItem('animated-java-last-version')
95+
if (lastVersion !== PACKAGE.version) {
96+
localStorage.setItem('animated-java-last-version', PACKAGE.version)
97+
openChangelogDialog()
98+
}
99+
})
100+
91101
// Uninstall events
92102
events.EXTRACT_MODS.subscribe(() => {
93103
// @ts-ignore

src/interface/animatedJavaBarItem.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { createAction, createBarMenu } from '../util/moddingTools'
77
import { translate } from '../util/translation'
88
import { openAboutDialog } from './aboutDialog'
99
import { openBlueprintSettingsDialog } from './blueprintSettingsDialog'
10+
import { openChangelogDialog } from './changelogDialog'
1011

1112
function createIconImg() {
1213
const IMG = document.createElement('img')
@@ -58,6 +59,20 @@ MenuBar.addAction(
5859
MENU.id
5960
)
6061

62+
MenuBar.addAction(
63+
createAction(`${PACKAGE.name}:changelog`, {
64+
icon: 'history',
65+
category: 'animated_java',
66+
name: translate('action.open_changelog.name'),
67+
click() {
68+
openChangelogDialog()
69+
},
70+
}),
71+
MENU.id
72+
)
73+
74+
MENU.structure.push(new MenuSeparator())
75+
6176
MenuBar.addAction(
6277
createAction(`${PACKAGE.name}:blueprint_settings`, {
6378
icon: 'settings',

src/interface/changelogDialog.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import ChangelogDialog from '../components/changelogDialog.svelte'
2+
import { PACKAGE } from '../constants'
3+
import { SvelteDialog } from '../util/svelteDialog'
4+
import { translate } from '../util/translation'
5+
6+
export const DIALOG_ID = `${PACKAGE.name}:animationPropertiesDialog`
7+
8+
export function openChangelogDialog() {
9+
new SvelteDialog({
10+
id: DIALOG_ID,
11+
title: translate('dialog.changelog_dialog.title'),
12+
width: 600,
13+
component: ChangelogDialog,
14+
props: {},
15+
buttons: ['OK!'],
16+
preventKeybinds: true,
17+
}).show()
18+
}

src/lang/en.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
### Actions
22
animated_java.action.open_blueprint_settings.name: Blueprint Settings
33
animated_java.action.open_documentation.name: Documentation
4+
animated_java.action.open_changelog.name: Changelog
45
animated_java.action.open_about.name: About
56
animated_java.action.open_bone_config.name: Bone Config
67
animated_java.action.open_locator_config.name: Locator Config
@@ -31,6 +32,9 @@ animated_java.dialog.reset: Reset to Default
3132
animated_java.dialog.about.title: About Animated Java
3233
animated_java.dialog.about.close_button: Close
3334

35+
## Changelog
36+
animated_java.dialog.changelog_dialog.title: Changelog
37+
3438
## Unexpected Error Dialog
3539
animated_java.dialog.unexpected_error.title: An Unexpected Error Occurred!
3640
animated_java.dialog.unexpected_error.close_button: Close

src/pluginPackage/changelog.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"1.6.0": {
3+
"title": "v1.6.0",
4+
"author": "Titus Evans (SnaveSutit)",
5+
"date": "2025-01-08",
6+
"categories": [
7+
{
8+
"title": "Changes",
9+
"list": [
10+
"Added changelog popup! (You're looking at it right now!)",
11+
"Added an export target for Minecraft 1.21.4",
12+
"Improved internal MCB File compression",
13+
"Slightly improved empty JSON text rendering ([#322](https://github.com/Animated-Java/animated-java/issues/322)",
14+
"Added an Extract action to remove exported files from the Resource Pack and Data Pack",
15+
"Added 1.21.4 target MC version",
16+
"Changed missing assets and data folder for resource and data pack folder settings errors into warnings",
17+
"Added support for item definitions (1.21.4)",
18+
"Changed default resource pack structure: `animated_java:textures/item/export_namespace/` -> `animated_java:textures/blueprint/export_namespace/` & `animated_java:models/item/export_namespace/` -> `animated_java:models/blueprint/export_namespace/`",
19+
"Added a dialog and exception for exporting a blueprint with invalid cube rotations."
20+
]
21+
},
22+
{
23+
"title": "Fixes",
24+
"list": [
25+
"Fixed tags getting cleared out in old exports",
26+
"Fixed incorrect export location for transparent texture.",
27+
"Fixed Per-Face UV not being enforced when converting",
28+
"Fixed [#348](https://github.com/Animated-Java/animated-java/issues/348)",
29+
"Fixed [#349](https://github.com/Animated-Java/animated-java/issues/349)",
30+
"Fixed [#347](https://github.com/Animated-Java/animated-java/issues/347)",
31+
"Fixed [#345](https://github.com/Animated-Java/animated-java/issues/345)",
32+
"Fixed [#341](https://github.com/Animated-Java/animated-java/issues/341)",
33+
"Fixed [#343](https://github.com/Animated-Java/animated-java/issues/343)",
34+
"Fixed [#340](https://github.com/Animated-Java/animated-java/issues/340)",
35+
"Fixed [#342](https://github.com/Animated-Java/animated-java/issues/342)"
36+
]
37+
}
38+
]
39+
}
40+
}

src/systems/datapackCompiler/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ export default async function compileDataPack(options: {
771771
color: 'red',
772772
},
773773
{ text: `Minecraft ${aj.target_minecraft_version}`, color: 'aqua' },
774-
{ text: ' in an different version!', color: 'red' },
774+
{ text: ' in the wrong version!', color: 'red' },
775775
{
776776
text: '\n Please ensure that the data pack is loaded in the correct version, or that your blueprint settings are configured to target the correct version(s) of Minecraft.',
777777
color: 'yellow',

0 commit comments

Comments
 (0)