Use localized store titles in vehicle pack receipts
Include the catalogue titles in the entitlement price data and select the matching language in the client receipt formatter. Checked TypeScript, the GUI pack rebuild, and the patched Quirrel script.
This commit is contained in:
1 parent
2d9ac527fb
commit
b15cece581
2 files changed
+31
No files matched your search
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"id": "online-shop/localize-vehicle-pack-titles",
|
||||
"title": "Display localized titles for offline vehicle packs",
|
||||
"file": "scripts/onlineshop/entitlements.nut",
|
||||
"program_behaviour": {
|
||||
"stock": "The entitlement name is looked up in the game's localization table by product ID, alias, or group.",
|
||||
"patched": "Use the catalogue title for offline vehicle packs, selecting Chinese or English from the current game language. Products without a catalogue title use the existing name formatter."
|
||||
},
|
||||
"derivation": {
|
||||
"requirement": "The purchase receipt title matches the name of the vehicle pack shown in the local store.",
|
||||
"cause": "The game's localization table has no entries for the locally generated vehicle pack IDs.",
|
||||
"lighter_options_ruled_out": [
|
||||
"Supply the names in the price response alone. The original name formatter does not read those fields."
|
||||
],
|
||||
"if_not_applied": "Vehicle pack receipts can show the raw localization key as the title."
|
||||
},
|
||||
"features": [
|
||||
"G-Store"
|
||||
],
|
||||
"evidence": [
|
||||
"2.61.0.37 scripts/onlineshop/entitlements.nut: getEntitlementConfig copies all price parameters, and getEntitlementName calls getEntitlementShortName.",
|
||||
"2.61.0.37 scripts/onlineshop/entitlementrewardwnd.nut: getTitle uses getEntitlementName.",
|
||||
"packages/local-service/src/char/actions/store-actions.ts: localized titles in the entitlement price response."
|
||||
],
|
||||
"edit": {
|
||||
"find": "function getEntitlementShortName(ent) {\r\n local name = \"\"",
|
||||
"replace": "function getEntitlementShortName(ent) {\r\n let catalogueTitle = ent?.wtoTitleEn\r\n if (catalogueTitle != null) {\r\n let { isChineseVersion, isChineseHarmonized } = require(\"%scripts/langUtils/language.nut\")\r\n let isChinese = isChineseVersion() || isChineseHarmonized()\r\n return isChinese ? (ent?.wtoTitleZh ?? catalogueTitle) : catalogueTitle\r\n }\r\n\r\n local name = \"\""
|
||||
}
|
||||
}
|
||||
@@ -70,6 +70,8 @@ function buildEntitlementsPriceBlk(products: readonly StoreProduct[]): BlkBlock
|
||||
setParam(block, 'ttl', { type: 'int', value: product.premiumDays! });
|
||||
} else if (product.kind === 'vehicle-pack' && product.vehicles) {
|
||||
setParam(block, 'onlinePurchase', { type: 'bool', value: true });
|
||||
setParam(block, 'wtoTitleEn', { type: 'string', value: product.title.en });
|
||||
setParam(block, 'wtoTitleZh', { type: 'string', value: product.title.zh });
|
||||
for (const vehicle of product.vehicles) {
|
||||
appendParam(block, 'aircraftGift', { type: 'string', value: vehicle.name });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user