feat(agreement): show and record the WTOffline terms
Require explicit acceptance in the existing game dialog and retain the accepted version in the local account profile. Verified full Quirrel compilation for .37 and .43, a temporary .43 build, and the launcher checks.
This commit is contained in:
1 parent
223f1ef638
commit
a0beedd898
28 files changed
+171
-2
No files matched your search
@@ -552,7 +552,7 @@
|
||||
}
|
||||
},
|
||||
"statement": "Project information",
|
||||
"statementBody": "WTOffline is an independent, unofficial project with no affiliation to Gaijin Entertainment. An installed copy of the official War Thunder client is required."
|
||||
"statementBody": "WTOffline is a noncommercial hobby project independent of Gaijin. Running it requires your own War Thunder base game files."
|
||||
},
|
||||
"features": {
|
||||
"A-Offline startup": "Offline startup",
|
||||
|
||||
@@ -552,7 +552,7 @@
|
||||
}
|
||||
},
|
||||
"statement": "项目信息",
|
||||
"statementBody": "WTOffline 是独立开发的非官方项目,与 Gaijin Entertainment 无关。运行需要已安装的战争雷霆正版客户端。"
|
||||
"statementBody": "WTOffline 是一个独立于 Gaijin 的非商业兴趣项目。运行需要自备战争雷霆游戏本体文件。"
|
||||
},
|
||||
"features": {
|
||||
"A-Offline startup": "离线启动",
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
from "sqEulaUtils" import getAgreedEulaVersion, setAgreedEulaVersion
|
||||
@@ -0,0 +1 @@
|
||||
from "%scripts/eulaWnd.nut" import LOCAL_AGREED_EULA_VERSION_SAVE_ID, getEulaVersion, openEulaWnd, localAgreedEulaVersion
|
||||
@@ -0,0 +1,15 @@
|
||||
} else {
|
||||
if ((isSony || isXbox || steam_is_running())
|
||||
&& (agreedEulaVersion == 0 || localAgreedEulaVersion.get() >= currentEulaVersion)) {
|
||||
setAgreedEulaVersion(currentEulaVersion)
|
||||
if (agreedEulaVersion == 0)
|
||||
sendBqEvent("CLIENT_NEW_USER_1", "acceptEula", { details = "acceptEula" })
|
||||
sendBqEvent("CLIENT_GAMEPLAY_1", "eula_screen", "accept")
|
||||
} else {
|
||||
openEulaWnd({
|
||||
isForView = false
|
||||
isNewEulaVersion = agreedEulaVersion > 0
|
||||
doOnlyLocalSave = false
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
from "%sqstd/platform.nut" import isSony, isXbox
|
||||
from "%scripts/user/profileStates.nut" import userIdStr, havePlayerTag
|
||||
@@ -0,0 +1,2 @@
|
||||
from "%scripts/bqQueue/bqQueue.nut" import sendBqEvent
|
||||
from "%scripts/options/fxOptions.nut" import needShowHdrSettingsOnStart, openHdrSettings
|
||||
@@ -0,0 +1,36 @@
|
||||
// Show the agreement whenever the account has yet to accept its current version.
|
||||
{
|
||||
"id": "agreement/require-explicit-acceptance",
|
||||
"title": "Require explicit agreement acceptance",
|
||||
"features": [
|
||||
"A-Local accounts"
|
||||
],
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.37",
|
||||
"file": "scripts/login/loginpseudothreadsconfig.nut",
|
||||
"edits": [
|
||||
{
|
||||
"find": "find-platform.nut",
|
||||
"replace": "replace-platform.nut"
|
||||
},
|
||||
{
|
||||
"find": "find-agreement-import.nut",
|
||||
"replace": "replace-agreement-import.nut"
|
||||
},
|
||||
{
|
||||
"find": "find-telemetry.nut",
|
||||
"replace": "replace-telemetry.nut"
|
||||
},
|
||||
{
|
||||
"find": "find-acceptance-import.nut",
|
||||
"replace": "replace-acceptance-import.nut"
|
||||
},
|
||||
{
|
||||
"find": "find-login.nut",
|
||||
"replace": "replace-login.nut"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
from "sqEulaUtils" import getAgreedEulaVersion
|
||||
@@ -0,0 +1 @@
|
||||
from "%scripts/eulaWnd.nut" import LOCAL_AGREED_EULA_VERSION_SAVE_ID, getEulaVersion, openEulaWnd
|
||||
@@ -0,0 +1,7 @@
|
||||
} else {
|
||||
openEulaWnd({
|
||||
isForView = false
|
||||
isNewEulaVersion = agreedEulaVersion > 0
|
||||
doOnlyLocalSave = false
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
from "%scripts/user/profileStates.nut" import userIdStr, havePlayerTag
|
||||
@@ -0,0 +1 @@
|
||||
from "%scripts/options/fxOptions.nut" import needShowHdrSettingsOnStart, openHdrSettings
|
||||
@@ -0,0 +1,5 @@
|
||||
let eulaText = loadAndProcessText()
|
||||
if (eulaText == null)
|
||||
showObjById("eula_online_link", hasFeature("AllowExternalLink"), this.scene).link = getCurCircuitOverride("eulaURL", loc("url/eula"))
|
||||
textObj.setValue(eulaText ?? loc("eula/textMissing"))
|
||||
let hasOneOkBtn = this.isForView || this.isNewEulaVersion
|
||||
@@ -0,0 +1,5 @@
|
||||
from "%appGlobals/curCircuitOverride.nut" import getCurCircuitOverride
|
||||
from "sqEulaUtils" import setAgreedEulaVersion
|
||||
from "dagor.workcycle" import defer
|
||||
from "%sqstd/globalState.nut" import hardPersistWatched
|
||||
from "%sqstd/packedText.nut" import readPackedText
|
||||
@@ -0,0 +1 @@
|
||||
from "%scripts/langUtils/language.nut" import getCurLangShortName
|
||||
@@ -0,0 +1,10 @@
|
||||
function loadAndProcessText(){
|
||||
let shortLang = getCurLangShortName()
|
||||
local langPostfix = shortLangToEulaLang?[shortLang] ?? shortLang
|
||||
langPostfix = langPostfix == "" ? "" : $"_{langPostfix}"
|
||||
let eulaPrefixForCircuit = getCurCircuitOverride("eulaPrefix", "")
|
||||
let text = readEula(eulaPrefixForCircuit, langPostfix) ?? readEula("", langPostfix)
|
||||
if (text == null)
|
||||
logerr($"EulaWnd: %langTxt/{eulaPrefixForCircuit}eula{langPostfix}.txt is missing")
|
||||
return text == null ? null : wordHyphenation(text)
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
let readEula = @(prefix, postfix) readPackedText($"%langTxt/{prefix}eula{postfix}.txt")
|
||||
?? readPackedText($"%langTxt/{prefix}eula.txt")
|
||||
@@ -0,0 +1,16 @@
|
||||
local eulaVersion = -1
|
||||
|
||||
let localAgreedEulaVersion = hardPersistWatched("localAgreedEulaVersion", 0)
|
||||
|
||||
let shortLangToEulaLang = {
|
||||
en = ""
|
||||
cs = "cz"
|
||||
ja = "jp"
|
||||
zhhx = "zh"
|
||||
}
|
||||
|
||||
function getEulaVersion() {
|
||||
if (eulaVersion == -1)
|
||||
eulaVersion = to_integer_safe(getCurCircuitOverride("eulaVersion") ?? loc("eula_version", "12"))
|
||||
return eulaVersion
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
let eulaTitle = getCurCircuitOverride("eulaPrefix", "") != "" ? ""
|
||||
: this.isNewEulaVersion ? loc("eula/eulaUpdateTitle")
|
||||
: loc("eula/eulaTitle")
|
||||
@@ -0,0 +1,44 @@
|
||||
// Keep the stock agreement window and account acceptance, with WTOffline's own text and version.
|
||||
{
|
||||
"id": "agreement/show-offline-terms",
|
||||
"title": "Show the WTOffline statement and agreement",
|
||||
"features": [
|
||||
"A-Local accounts"
|
||||
],
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.37",
|
||||
"file": "scripts/eulawnd.nut",
|
||||
"edits": [
|
||||
{
|
||||
"find": "find-language.nut",
|
||||
"replace": "replace-language.nut"
|
||||
},
|
||||
{
|
||||
"find": "find-imports.nut",
|
||||
"replace": "replace-imports.nut"
|
||||
},
|
||||
{
|
||||
"find": "find-terms.nut",
|
||||
"replace": "replace-terms.nut"
|
||||
},
|
||||
{
|
||||
"find": "find-read.nut",
|
||||
"replace": "replace-read.nut"
|
||||
},
|
||||
{
|
||||
"find": "find-loader.nut",
|
||||
"replace": "replace-loader.nut"
|
||||
},
|
||||
{
|
||||
"find": "find-display.nut",
|
||||
"replace": "replace-display.nut"
|
||||
},
|
||||
{
|
||||
"find": "find-title.nut",
|
||||
"replace": "replace-title.nut"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
let agreementIsChinese = isChineseVersion() || isChineseHarmonized()
|
||||
textObj.setValue(agreementIsChinese ? offlineAgreementChinese : wordHyphenation(offlineAgreementEnglish))
|
||||
let hasOneOkBtn = this.isForView
|
||||
@@ -0,0 +1,3 @@
|
||||
from "sqEulaUtils" import setAgreedEulaVersion
|
||||
from "dagor.workcycle" import defer
|
||||
from "%sqstd/globalState.nut" import hardPersistWatched
|
||||
@@ -0,0 +1 @@
|
||||
from "%scripts/langUtils/language.nut" import isChineseVersion, isChineseHarmonized
|
||||
@@ -0,0 +1 @@
|
||||
let offlineAgreementEnglish = "WTOffline is a noncommercial hobby project independent of Gaijin.\n\nThe game uses a local account. Saves, caches, and logs are stored in the copy's data folder. Adaptation pack checks and official background images can be disabled in the launcher settings.\n\nI have read and agree to this statement and agreement. I confirm that this offline copy is already running with the base game files I provided and am authorized to use."
|
||||
@@ -0,0 +1 @@
|
||||
let offlineAgreementChinese = "WTOffline 是一个独立于 Gaijin 的非商业兴趣项目。\n\n游戏使用本地账号。存档、缓存和日志保存在副本的数据目录。启动器的适配包检查和官网背景图可在设置中关闭。\n\n我已阅读并同意以上声明与协议。我确认,当前运行的离线副本已经在使用我自行提供且有权使用的游戏本体文件。"
|
||||
@@ -0,0 +1,5 @@
|
||||
// Start the project agreement above the stock version stored in existing accounts.
|
||||
const WTO_AGREEMENT_VERSION = 10001
|
||||
|
||||
let localAgreedEulaVersion = hardPersistWatched("localAgreedEulaVersion", 0)
|
||||
let getEulaVersion = @() WTO_AGREEMENT_VERSION
|
||||
@@ -0,0 +1 @@
|
||||
let eulaTitle = agreementIsChinese ? "WTOffline 离线版声明与协议" : "WTOffline Statement and Agreement"
|
||||
Reference in new issue
Block a user