From 3f97e5d4e6b8b6988d3d6e613e60b3eabd85212a Mon Sep 17 00:00:00 2001 From: Jari van der Kaap Date: Mon, 10 Apr 2023 16:46:55 +0200 Subject: [PATCH] fix: only have bot count on multiplayer servers --- data/ui_scripts/server_browser/__init__.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/data/ui_scripts/server_browser/__init__.lua b/data/ui_scripts/server_browser/__init__.lua index c29af165..493795a4 100644 --- a/data/ui_scripts/server_browser/__init__.lua +++ b/data/ui_scripts/server_browser/__init__.lua @@ -53,6 +53,7 @@ DataSources.LobbyServer = { SetModelValue(serverModel, "dedicated", serverInfo.dedicated) SetModelValue(serverModel, "ranked", serverInfo.ranked) SetModelValue(serverModel, "hardcore", serverInfo.hardcore) + SetModelValue(serverModel, "zombies", serverInfo.zombies) -- Added the bot count SetModelValue(serverModel, "botCount", serverInfo.botCount) return serverModel @@ -323,6 +324,12 @@ CoD.ServerBrowserRowInternal.new = function(menu, controller) botCount:setText("[" .. Engine.Localize(_botCount) .. "]") end end) + botCount:linkToElementModel(self, "zombies", true, function(model) + local zombies = Engine.GetModelValue(model) + if zombies ~= nil then + botCount:setAlpha(zombies and 0 or 1) + end + end) self:addElement(botCount) self.botCount = botCount @@ -359,6 +366,7 @@ CoD.ServerBrowserRowInternal.new = function(menu, controller) element.gametype:close() element.playerCount:close() element.maxPlayers:close() + element.botCount:close() element.ping:close() end)