From f68827bdc27a172b43edc33bf63613648d970768 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 23 May 2024 21:40:59 +0100 Subject: [PATCH] Added ability to insert custom text into the server watermark at the bottom via core.json config --- project/assets/configs/core.json | 3 ++- project/src/models/spt/config/ICoreConfig.ts | 2 ++ project/src/utils/Watermark.ts | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/project/assets/configs/core.json b/project/assets/configs/core.json index 98f9a159..105a2af0 100644 --- a/project/assets/configs/core.json +++ b/project/assets/configs/core.json @@ -28,5 +28,6 @@ "giveCommandEnabled": true } } - } + }, + "customWatermarkLocaleKeys": [] } diff --git a/project/src/models/spt/config/ICoreConfig.ts b/project/src/models/spt/config/ICoreConfig.ts index 53096600..dc4e2ae8 100644 --- a/project/src/models/spt/config/ICoreConfig.ts +++ b/project/src/models/spt/config/ICoreConfig.ts @@ -18,6 +18,8 @@ export interface ICoreConfig extends IBaseConfig commit?: string /** Timestamp of server build */ buildTime?: string + /** Server locale keys that will be added to the bottom of the startup watermark */ + customWatermarkLocaleKeys?: string[] } export interface IBsgLogging diff --git a/project/src/utils/Watermark.ts b/project/src/utils/Watermark.ts index 581ad1b2..a4a50481 100644 --- a/project/src/utils/Watermark.ts +++ b/project/src/utils/Watermark.ts @@ -95,6 +95,14 @@ export class Watermark this.text = this.text.concat([...modding]); } + if (this.sptConfig.customWatermarkLocaleKeys?.length > 0) + { + for (const key of this.sptConfig.customWatermarkLocaleKeys) + { + this.text.push(...["", this.localisationService.getText(key)]); + } + } + this.setTitle(); this.resetCursor(); this.draw();