Skip to content

Commit

Permalink
Merge pull request #482 from ewanhowell5195/minecraft-title-generator…
Browse files Browse the repository at this point in the history
…-v1.4.1

fix ability to bypass EULA agreement in Minecraft Title Generator
  • Loading branch information
JannisX11 authored Feb 26, 2024
2 parents daabfa2 + af52f61 commit ae21bb3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
"author": "Ewan Howell",
"description": "Create Minecraft-styled title models!",
"tags": ["Minecraft", "Title", "Logo"],
"version": "1.4.0",
"version": "1.4.1",
"min_version": "4.8.0",
"variant": "both",
"creation_date": "2023-06-10",
Expand Down
35 changes: 20 additions & 15 deletions plugins/minecraft_title_generator/minecraft_title_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
author: "Ewan Howell",
description,
tags: ["Minecraft", "Title", "Logo"],
version: "1.4.0",
version: "1.4.1",
min_version: "4.8.0",
variant: "both",
creation_date: "2023-06-10",
Expand Down Expand Up @@ -334,11 +334,8 @@
},
format_page: {
component: {
methods: {
async create() {
if (!await MinecraftEULA.promptUser(id)) return
format.new()
}
methods: {
create: () => format.new()
},
template: `
<div style="display:flex;flex-direction:column;height:100%">
Expand Down Expand Up @@ -2378,6 +2375,11 @@
title: "Failed to load textures and fonts",
message: `Minecraft Title Generator was unable to load the textures and fonts. You will only be able to use the built-in texture and font.\n\nPlease make sure you are connected to the internet, and can access this <a href="${root}/fonts.json">fonts.json</a> file.\n\nIf you are unable to access the fonts.json file, it may be blocked by your computer or your internet service provider. If it is not your computer blocking it, you may be able to use a VPN to bypass the block. One good example is <a href="https://1.1.1.1/">Cloudflare WARP</a>, which is a free program that commonly resolves this issue.`
})
},
tabChange(tab) {
this.tab = tab
document.querySelector("#new_minecraft_title_text .dialog_content").scrollTop = 0
if (!tab) setTimeout(() => this.$el.querySelector("#minecraft-title-text-input").focus(), 0)
}
},
computed: {
Expand Down Expand Up @@ -2423,11 +2425,11 @@
</div>
</div>
<div id="minecraft-title-tabs">
<div @click="tab = 0" :class="{ selected: tab === 0 }">Text</div>
<div @click="tab = 1" :class="{ selected: tab === 1 }">Texture</div>
<div @click="tab = 2" :class="{ selected: tab === 2 }">Overlay</div>
<div @click="tab = 3" :class="{ selected: tab === 3 }">Style</div>
<div @click="tab = 4" :class="{ selected: tab === 4 }">Settings</div>
<div @click="tabChange(0)" :class="{ selected: tab === 0 }">Text</div>
<div @click="tabChange(1)" :class="{ selected: tab === 1 }">Texture</div>
<div @click="tabChange(2)" :class="{ selected: tab === 2 }">Overlay</div>
<div @click="tabChange(3)" :class="{ selected: tab === 3 }">Style</div>
<div @click="tabChange(4)" :class="{ selected: tab === 4 }">Settings</div>
</div>
<div id="minecraft-title-preview-container" :class="{ visible: [1, 2, 3].includes(tab) }">
<canvas @click="expandCanvas" id="minecraft-title-preview" class="checkerboard" width="2160" height="600"></canvas>
Expand Down Expand Up @@ -2827,17 +2829,20 @@
</div>
</div>
<div id="minecraft-title-buttons">
<button v-if="tab > 0" @click="tab--">Back</button>
<button v-if="tab > 0" @click="tabChange(tab - 1)">Back</button>
<div class="spacer"></div>
<button v-if="tab < 4" @click="tab++">Next</button>
<button v-if="tab < 4" @click="tabChange(tab + 1)">Next</button>
<button @click="finish">Finish</button>
</div>
</div>
`
},
onOpen() {
this.content_vue.tab = 0
this.content_vue.$el.querySelector("#minecraft-title-text-input").focus()
setTimeout(async () => {
this.content_vue.tab = 0
this.content_vue.$el.querySelector("#minecraft-title-text-input").focus()
if (!await MinecraftEULA.promptUser(id)) return dialog.close()
}, 0)
},
onConfirm() {
const text = this.content_vue.text.replace(/A/g, "😳").replace(/(\s|^)'/g, "$1😩").replace(/(\s|^)"/g, "$1😩😩").replace(/"/g, "''").toLowerCase().trim()
Expand Down

0 comments on commit ae21bb3

Please sign in to comment.