From 34fa7ea7e8b4797cef2a26c1aeb15b51b96d9093 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Wed, 11 Oct 2023 13:26:36 +0200 Subject: [PATCH] removal of outdated code --- src/core/Global.ttslua | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index 9b69cd6c..53d5aba9 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -165,23 +165,6 @@ function tryObjectEnterContainer(container, object) return true end --- gets all objects that match the provided matcolor ----@param matColor String Color of the playermat ----@return objList Table Table of type-object pairs -function getObjectsForMatColor(matColor) - local objList = {} - for _, obj in ipairs(getObjects()) do - local memo = obj.getMemo() - if memo and memo:sub(1, 1) == "{" then - local decoded = JSON.decode(memo) or {} - if decoded.matColor == matColor then - objList[decoded.type] = obj - end - end - end - return objList -end - --------------------------------------------------------- -- chaos token drawing --------------------------------------------------------- @@ -310,10 +293,8 @@ function handleStatTrackerClick(_, _, isRightClick) playerColor = "White" playerName = "Overall" else - -- get mat color from memo - local mat = getObjectFromGUID(key) - local decoded = JSON.decode(mat.getMemo()) - local matColor = decoded.matColor + -- get mat color + local matColor = playmatApi.getMatColorByPosition(getObjectFromGUID(key).getPosition()) playerColor = playmatApi.getPlayerColor(matColor) playerName = Player[playerColor].steam_name or playerColor @@ -889,7 +870,8 @@ function applyOptionPanelChange(id, state) optionPanel[id] = state -- update master clue counter - getObjectFromMemo({matColor = "Mythos", type = "MasterClueCounter"}).setVar("useClickableCounters", state) + local counter = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "MasterClueCounter" }) + counter.setVar("useClickableCounters", state) -- option: Play area snap tags elseif id == "playAreaSnapTags" then