From 971fc10e9cbac43aed28550154d8c30ea63375f7 Mon Sep 17 00:00:00 2001 From: Shaun Date: Wed, 22 Feb 2023 06:39:21 +0200 Subject: [PATCH] modding #1974: Added the ability for mods to override default UIs --- src/client/ui/factory.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/client/ui/factory.js b/src/client/ui/factory.js index 9d02b76a..93e4c326 100644 --- a/src/client/ui/factory.js +++ b/src/client/ui/factory.js @@ -90,8 +90,13 @@ define([ let path = null; if (options && options.path) path = options.path + `\\${type}.js`; - else - path = this.root + 'ui/templates/' + type + '/' + type; + else { + const entryInClientConfig = globals.clientConfig.uiList.find(u => u.type === type); + if (entryInClientConfig) + path = entryInClientConfig.path; + else + path = this.root + 'ui/templates/' + type + '/' + type; + } require([path], this.onGetTemplate.bind(this, options, type)); },