1
0
Fork 0
mirror of https://github.com/haselkern/Minecraft-ArmorStand.git synced 2025-05-17 15:05:33 +00:00
This commit is contained in:
Lars Martens 2021-08-26 22:49:17 +02:00
parent e196645bfb
commit 3b54fdb5e3
7 changed files with 2294 additions and 57 deletions

View file

@ -3,7 +3,7 @@
This project is currently being rewritten. This document should be changed to include help for users and then help for contributors, especially translators. This project is currently being rewritten. This document should be changed to include help for users and then help for contributors, especially translators.
## TODO ## TODO
The following things still have to be done. Possibly in this order. The following things still have to be done.
- [X] Equipment - [X] Equipment
- [ ] Equipment locking - [ ] Equipment locking
- [ ] Can we scrape the MC wiki for a searchable dropdown list? https://minecraft.fandom.com/api.php ? - [ ] Can we scrape the MC wiki for a searchable dropdown list? https://minecraft.fandom.com/api.php ?
@ -25,5 +25,11 @@ The following things still have to be done. Possibly in this order.
- You can save and load - You can save and load
- How to remove an invulnerable armor stand - How to remove an invulnerable armor stand
- [ ] Ask before exit - [ ] Ask before exit
- [ ] vue i18n - [X] vue i18n
- [ ] vue element transitions - [ ] vue element transitions
## Development
For first time setup a `npm install` is required once. After that you can run `npm run dev` to start the hot-reloading development server.
## Translating
Translations are located in `src/locales`. To add a new translation, copy `en.yaml` to a new file `xy.yaml`, add it as an option in `src/App.vue` and then translate your new file. The file `en.yaml` (the english version) serves as the truth from which other files should be derived.

2143
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -12,6 +12,7 @@
"vue": "^3.0.11" "vue": "^3.0.11"
}, },
"devDependencies": { "devDependencies": {
"@intlify/vite-plugin-vue-i18n": "^2.4.0",
"@vitejs/plugin-vue": "^1.2.2", "@vitejs/plugin-vue": "^1.2.2",
"@vue/compiler-sfc": "^3.0.11", "@vue/compiler-sfc": "^3.0.11",
"autoprefixer": "^10.3.1", "autoprefixer": "^10.3.1",

View file

@ -6,89 +6,95 @@
<div class="w-2/5 right-0 ml-60"> <div class="w-2/5 right-0 ml-60">
<div class="bg-white m-4 p-4 border border-gray-900"> <div class="bg-white m-4 p-4 border border-gray-900">
<h1>{{t("hero")}}</h1>
<select v-model="locale">
<option value="en">🇬🇧 English</option>
</select>
<select v-model="mcVersion"> <select v-model="mcVersion">
<option value="1.16">Minecraft 1.16 and above</option> <option value="1.16">Minecraft 1.16 +</option>
<option value="1.14">Minecraft 1.14 &amp; 1.15</option> <option value="1.14">Minecraft 1.14 &amp; 1.15</option>
<option value="1.13">Minecraft 1.13</option> <option value="1.13">Minecraft 1.13</option>
<option value="1.11">Minecraft 1.11 &amp; 1.12</option> <option value="1.11">Minecraft 1.11 &amp; 1.12</option>
<option value="1.9">Minecraft 1.9 &amp; 1.10</option> <option value="1.9">Minecraft 1.9 &amp; 1.10</option>
<option value="1.8">Minecraft 1.8</option> <option value="1.8">Minecraft 1.8</option>
</select> </select>
<label><input v-model="armorstand.noBasePlate" type="checkbox">No Base Plate</label> <label><input v-model="armorstand.noBasePlate" type="checkbox">{{t("checkNoBasePlate")}}</label>
<label><input v-model="armorstand.noGravity" type="checkbox">No Gravity</label> <label><input v-model="armorstand.noGravity" type="checkbox">{{t("checkNoGravity")}}</label>
<label><input v-model="armorstand.showArms" type="checkbox">Show Arms</label> <label><input v-model="armorstand.showArms" type="checkbox">{{t("checkShowArms")}}</label>
<label><input v-model="armorstand.small" type="checkbox">Small</label> <label><input v-model="armorstand.small" type="checkbox">{{t("checkSmall")}}</label>
<details> <details>
<summary>Advanced</summary> <summary>{{t("checkAdvanced")}}</summary>
<label><input v-model="armorstand.invisible" type="checkbox">Invisible</label> <label><input v-model="armorstand.invisible" type="checkbox">{{t("checkInvisible")}}</label>
<label><input v-model="armorstand.invulnerable" type="checkbox">Invulnerable</label> <label><input v-model="armorstand.invulnerable" type="checkbox">{{t("checkInvulnerable")}}</label>
<label><input v-model="armorstand.persistenceRequired" type="checkbox">Persistence Required</label> <label><input v-model="armorstand.persistenceRequired" type="checkbox">{{t("checkPersistenceRequired")}}</label>
<label><input v-model="armorstand.marker" type="checkbox">Marker</label> <label><input v-model="armorstand.marker" type="checkbox">{{t("checkMarker")}}</label>
<label><input v-model="armorstand.centerCorrected" type="checkbox">Center Corrected</label> <label><input v-model="armorstand.centerCorrected" type="checkbox">{{t("checkCenterCorrected")}}</label>
</details> </details>
<hr> <hr>
<table> <table>
<tr> <tr>
<td>Rotation</td> <td>{{t("sliderRotation")}}</td>
<td colspan="3"> <td colspan="3">
<input @dblclick="() => armorstand.rotation = 0" class="w-full" type="range" min="-180" max="180" v-model="armorstand.rotation" /> <input @dblclick="() => armorstand.rotation = 0" class="w-full" type="range" min="-180" max="180" v-model="armorstand.rotation" />
</td> </td>
</tr> </tr>
<RotationSliderRow label="Head" :rotation="armorstand.head" /> <RotationSliderRow :label="t('sliderHead')" :rotation="armorstand.head" />
<RotationSliderRow label="Body" :rotation="armorstand.body" /> <RotationSliderRow :label="t('sliderBody')" :rotation="armorstand.body" />
<RotationSliderRow label="Left Leg" :rotation="armorstand.legLeft" /> <RotationSliderRow :label="t('sliderLeftLeg')" :rotation="armorstand.legLeft" />
<RotationSliderRow label="Right Leg" :rotation="armorstand.legRight" /> <RotationSliderRow :label="t('sliderRightLeg')" :rotation="armorstand.legRight" />
<RotationSliderRow v-if="armorstand.showArms" label="Left Arm" :rotation="armorstand.armLeft" /> <RotationSliderRow v-if="armorstand.showArms" :label="t('sliderLeftArm')" :rotation="armorstand.armLeft" />
<RotationSliderRow v-if="armorstand.showArms" label="Right Arm" :rotation="armorstand.armRight" /> <RotationSliderRow v-if="armorstand.showArms" :label="t('sliderRightArm')" :rotation="armorstand.armRight" />
</table> </table>
<hr> <hr>
<label><input v-model="armorstand.enableEquipment" type="checkbox">Enable Equipment</label> <label><input v-model="armorstand.enableEquipment" type="checkbox">{{t("equipEnable")}}</label>
<div v-if="armorstand.enableEquipment"> <div v-if="armorstand.enableEquipment">
<input v-model="armorstand.equipHandRight" placeholder="Item in right hand"/> <input v-model="armorstand.equipHandRight" :placeholder="t('equipHandRight')"/>
<input v-model="armorstand.equipHandLeft" placeholder="Item in left hand"/> <input v-model="armorstand.equipHandLeft" :placeholder="t('equipHandLeft')"/>
<input v-model="armorstand.equipShoes" placeholder="Boots"/> <input v-model="armorstand.equipShoes" :placeholder="t('equipShoes')"/>
<input v-model="armorstand.equipLeggings" placeholder="Leggings"/> <input v-model="armorstand.equipLeggings" :placeholder="t('equipLeggings')"/>
<input v-model="armorstand.equipChestplate" placeholder="Chestplate"/> <input v-model="armorstand.equipChestplate" :placeholder="t('equipChestplate')"/>
<input v-model="armorstand.equipHelmet" placeholder="Helmet"/> <input v-model="armorstand.equipHelmet" :placeholder="t('equipHelmet')"/>
<select v-model="armorstand.helmetMode"> <select v-model="armorstand.helmetMode">
<option value="item">Item Name</option> <option value="item">{{t("equipHelmetModeItem")}}</option>
<option value="name">Player Name</option> <option value="name">{{t("equipHelmetModePlayer")}}</option>
<option value="url">Image URL</option> <option value="url">{{t("equipHelmetModeUrl")}}</option>
</select> </select>
</div> </div>
<hr> <hr>
<input v-model="armorstand.customName" placeholder="Custom Name"/> <input v-model="armorstand.customName" :placeholder="t('customName')"/>
<label><input v-model="armorstand.showCustomName" type="checkbox">Show custom name</label> <label><input v-model="armorstand.showCustomName" type="checkbox">{{t("cnShow")}}</label>
<div v-if="armorstand.showCustomName"> <div v-if="armorstand.showCustomName">
<select v-model="armorstand.customNameColor"> <select v-model="armorstand.customNameColor">
<option value="">None</option> <option value="">{{t("cnColorNone")}}</option>
<option value="black">Black</option> <option value="black">{{t("cnColorBlack")}}</option>
<option value="dark_blue">Dark Blue</option> <option value="dark_blue">{{t("cnColorDarkBlue")}}</option>
<option value="dark_green">Dark Green</option> <option value="dark_green">{{t("cnColorDarkGreen")}}</option>
<option value="dark_aqua">Dark Aqua</option> <option value="dark_aqua">{{t("cnColorDarkAqua")}}</option>
<option value="dark_red">Dark Red</option> <option value="dark_red">{{t("cnColorDarkRed")}}</option>
<option value="dark_purple">Dark Purple</option> <option value="dark_purple">{{t("cnColorDarkPurple")}}</option>
<option value="gold">Gold</option> <option value="gold">{{t("cnColorGold")}}</option>
<option value="gray">Gray</option> <option value="gray">{{t("cnColorGray")}}</option>
<option value="dark_gray">Dark Gray</option> <option value="dark_gray">{{t("cnColorDarkGray")}}</option>
<option value="blue">Blue</option> <option value="blue">{{t("cnColorBlue")}}</option>
<option value="green">Green</option> <option value="green">{{t("cnColorGreen")}}</option>
<option value="aqua">Aqua</option> <option value="aqua">{{t("cnColorAqua")}}</option>
<option value="red">Red</option> <option value="red">{{t("cnColorRed")}}</option>
<option value="light_purple">Light Purple</option> <option value="light_purple">{{t("cnColorLightPurple")}}</option>
<option value="yellow">Yellow</option> <option value="yellow">{{t("cnColorYellow")}}</option>
<option value="white">White</option> <option value="white">{{t("cnColorWhite")}}</option>
</select> </select>
<label><input v-model="armorstand.customNameBold" type="checkbox">Bold</label> <label><input v-model="armorstand.customNameBold" type="checkbox">{{t("cnBold")}}</label>
<label><input v-model="armorstand.customNameItalic" type="checkbox">Italic</label> <label><input v-model="armorstand.customNameItalic" type="checkbox">{{t("cnItalic")}}</label>
<label><input v-model="armorstand.customNameStrikethrough" type="checkbox">Strikethrough</label> <label><input v-model="armorstand.customNameStrikethrough" type="checkbox">{{t("cnStrikethrough")}}</label>
<label><input v-model="armorstand.customNameObfuscated" type="checkbox">Obfuscated</label> <label><input v-model="armorstand.customNameObfuscated" type="checkbox">{{t("cnObfuscated")}}</label>
</div> </div>
<hr> <hr>
@ -103,6 +109,7 @@
</template> </template>
<script> <script>
import { useI18n } from 'vue-i18n'
import Scene from "./Scene.vue" import Scene from "./Scene.vue"
import RotationSliderRow from "./RotationSliderRow.vue" import RotationSliderRow from "./RotationSliderRow.vue"
import {generateIntArray, generateUUID, isXYZZero, xyzToTextArray} from "./util.js" import {generateIntArray, generateUUID, isXYZZero, xyzToTextArray} from "./util.js"
@ -427,6 +434,14 @@ class Armorstand {
} }
export default { export default {
setup() {
const { locale, t } = useI18n({
inheritLocale: true,
useScope: "global"
})
return { locale, t }
},
data() { data() {
return { return {
armorstand: new Armorstand(), armorstand: new Armorstand(),

60
src/locales/en.yaml Normal file
View file

@ -0,0 +1,60 @@
# General informaiton
hero: Minecraft Armor Stand
# Checkboxes
checkNoBasePlate: No Base Plate
checkNoGravity: No Gravity
checkShowArms: Show Arms
checkSmall: Small
checkAdvanced: Advanced
checkInvisible: Invisible
checkInvulnerable: Invulnerable
checkPersistenceRequired: Persistence Required
checkMarker: Marker
checkCenterCorrected: Center Corrected
# Sliders
sliderRotation: Rotation
sliderHead: Head
sliderBody: Body
sliderLeftLeg: Left Leg
sliderRightLeg: Right Leg
sliderLeftArm: Left Arm
sliderRightArm: Right Arm
# Equipment
equipEnable: Enable Equipment
equipHandRight: Item in right hand
equipHandLeft: Item in left hand
equipShoes: Boots
equipLeggings: Leggings
equipChestplate: Chestplate
equipHelmet: Helmet
equipHelmetModeItem: Item Name
equipHelmetModePlayer: Player Name
equipHelmetModeUrl: Image URL
# Custom Name
customName: Custom Name
cnShow: Show custom name
cnBold: Bold
cnItalic: Italic
cnStrikethrough: Strikethrough
cnObfuscated: Obfuscated
cnColorNone: None
cnColorBlack: Black
cnColorDarkBlue: Dark Blue
cnColorDarkGreen: Dark Green
cnColorDarkAqua: Dark Aqua
cnColorDarkRed: Dark Red
cnColorDarkPurple: Dark Purple
cnColorGold: Gold
cnColorGray: Gray
cnColorDarkGray: Dark Gray
cnColorBlue: Blue
cnColorGreen: Green
cnColorAqua: Aqua
cnColorRed: Red
cnColorLightPurple: Light Purple
cnColorYellow: Yellow
cnColorWhite: White

View file

@ -1,5 +1,14 @@
import { createApp } from "troisjs" import { createApp } from "troisjs"
import { createI18n } from "vue-i18n"
import App from "./App.vue" import App from "./App.vue"
import "./main.css" import "./main.css"
createApp(App).mount("#app") // Setup internationalization
import messages from '@intlify/vite-plugin-vue-i18n/messages'
const i18n = createI18n({
locale: "en",
fallbackLocale: "en",
messages
})
createApp(App).use(i18n).mount("#app")

View file

@ -1,7 +1,14 @@
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
import vueI18n from '@intlify/vite-plugin-vue-i18n'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [vue()] plugins: [
vue(),
vueI18n({
include: path.resolve(__dirname, './src/locales/**')
})
]
}) })