Only include relevant versions in page title

This commit is contained in:
Misode
2021-02-02 00:57:30 +01:00
parent bf3b0204eb
commit e025e5ffc3
7 changed files with 20 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
import { App, Models } from './App';
import { App, checkVersion, Models } from './App';
import { View } from './views/View';
import { Home } from './views/Home'
import { FieldSettings } from './views/FieldSettings'
@@ -42,7 +42,10 @@ const router = async () => {
}
}
document.title = locale('title.suffix', [title])
const versions = config.versions
.filter(v => checkVersion(v.id, App.model.get()?.minVersion))
.map(v => v.id).join(', ')
document.title = `${title} Minecraft ${versions}`
App.mobilePanel.set(panel)
const view = new View()
view.mount(target, renderer(view), true)

View File

@@ -203,6 +203,14 @@ export class DecoratorPreview extends Preview {
}
return new Array(count).fill(pos)
},
count_multilayer: (config, pos) => {
return new Array(this.sampleUniformInt(config?.count ?? 1)).fill(pos)
.map(p => [
p[0] + this.nextInt(16),
p[1],
p[2] + this.nextInt(16)
])
},
count_noise: (config, pos) => {
const noise = this.biomeInfoNoise.getValue(pos[0] / 200, 0, pos[2] / 200)
const count = noise < config.noise_level ? config.below_noise : config.above_noise

View File

@@ -21,7 +21,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="<%= htmlWebpackPlugin.options.title %>. Generate JSON and use it in data packs.">
<meta name="og:title" content="<%= htmlWebpackPlugin.options.title %>">
<meta name="og:description" content="<%= htmlWebpackPlugin.options.title %>. Generate JSON and use it in data packs.">
<title><%= htmlWebpackPlugin.options.title %></title>
<link rel="icon" href="/favicon-32.png" sizes="32x32">
<link rel="stylesheet" href="<%= htmlWebpackPlugin.files.publicPath %>styles/global.css">

View File

@@ -26,7 +26,6 @@
"share": "Share",
"title.generator": "%0% Generator",
"title.home": "Data Pack Generators",
"title.suffix": "%0% Minecraft 1.15, 1.16, 1.17",
"presets": "Presets",
"preview": "Visualize",
"preview.show_density": "Show Density",

View File

@@ -22,7 +22,6 @@
"share": "分享",
"title.generator": "%0% 生成器",
"title.home": "数据包生成器",
"title.suffix": "%0% Minecraft 1.15, 1.16, 1.17",
"undo": "撤销",
"world": "世界设置",
"worldgen/biome": "生物群系",

View File

@@ -22,7 +22,6 @@
"share": "分享",
"title.generator": "%0% 生成器",
"title.home": "資料包生成器",
"title.suffix": "%0% Minecraft 1.15, 1.16, 1.17",
"undo": "復原",
"world": "世界設定",
"worldgen/biome": "生態域",