Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: v1.4.3 #57

Merged
merged 2 commits into from
Jul 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "better-japanese",
"version": "1.4.2",
"version": "1.4.3",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
21 changes: 13 additions & 8 deletions src/common/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ const betterJapanese = {
isRegisteredHook: false,

init: function() {
this.load()

this.fallbackTimer = setTimeout(() => {
this.checkUpdate()
this.initialized = true
Expand All @@ -52,6 +50,8 @@ const betterJapanese = {
},

initAfterLoad: async function() {
betterJapanese.load()

// メニューに独自ボタンを実装
// この方法で実装しないとCCSEなどのメニュー独自実装Modと競合してしまう
let origin = eval('Game.UpdateMenu.toString()').split('\n')
Expand Down Expand Up @@ -114,12 +114,6 @@ const betterJapanese = {
return negative ? '-' + output : output + decimal
}

// 背景の名前を翻訳
for (let i = 1; i < Game.AllBGs.length; i++) {
Game.AllBGs[i].enName = Game.AllBGs[i].name
Game.AllBGs[i].name = loc(Game.AllBGs[i].enName)
}

// カスタムCSSを適用
let customStyle = document.createElement('style')
customStyle.innerHTML = `
Expand Down Expand Up @@ -188,6 +182,17 @@ const betterJapanese = {

document.head.appendChild(customStyle)

// 設定の「日本語訳の改善」がOFFになっている場合はここから下は実行しない (ニュース欄やアップデート履歴が壊れる)
if (!betterJapanese.config.replaceJP) return

console.log(betterJapanese.config.replaceJP)

// 背景の名前を翻訳
for (let i = 1; i < Game.AllBGs.length; i++) {
Game.AllBGs[i].enName = Game.AllBGs[i].name
Game.AllBGs[i].name = loc(Game.AllBGs[i].enName)
}

// 在庫市場のquoteを実装
while (!Game.Objects['Bank'].hasOwnProperty('minigame')) await new Promise(resolve => setTimeout(resolve, 1000))
if (typeof(betterJapanese.origins.goodTooltip) === 'undefined') {
Expand Down