From 3efb6993c7147fc0d1a14aca56d5c8f86f096f75 Mon Sep 17 00:00:00 2001 From: gahusb Date: Wed, 17 Jun 2026 08:37:25 +0900 Subject: [PATCH] =?UTF-8?q?fix(deck):=20=EB=A9=94=EC=9D=B4=EC=BB=A4=20?= =?UTF-8?q?=EC=A0=80=EC=9E=91=20=EB=B2=84=ED=8A=BC=EC=97=90=20ButtonCompon?= =?UTF-8?q?ent=20=EB=9F=B0=ED=83=80=EC=9E=84=20=EB=B6=80=EC=B0=A9=20(?= =?UTF-8?q?=ED=81=B4=EB=A6=AD=20=EB=B3=B5=EA=B5=AC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 사용자 메이커 저작 버튼들이 ButtonComponent 없는 단순 스프라이트라 BindXxx가 ButtonComponent ~= nil 조건에서 스킵 → 어떤 버튼도 클릭 안 됨(시작 화면 포함). 바인드 조건 41곳의 `X.ButtonComponent ~= nil`을 `(X.ButtonComponent ~= nil or X:AddComponent("ButtonComponent") ~= nil)`로 바꿔 없으면 런타임 부착 후 통과(있으면 short-circuit). Entity:AddComponent(ControlOnly) 실측 확인. .ui 무수정(연결만). 메뉴·로비·charselect·전투·상점·덱·맵 버튼 전부 일괄 적용. 검증(플레이테스트): 부트 후 NewGame/Start/Warrior 핸들러 바인딩 완료·버튼 ButtonComponent 부착 확인. 메뉴 상태서 타 UIGroup 활성 자식 0(레이캐스트 블로커 없음). 실제 클릭은 사용자 확인. Co-Authored-By: Claude Opus 4.8 (1M context) --- tools/deck/cb/deckturn.mjs | 50 +++++++++++++++++++------------------- tools/deck/cb/deckview.mjs | 6 ++--- tools/deck/cb/map.mjs | 2 +- tools/deck/cb/soul.mjs | 2 +- tools/deck/cb/state.mjs | 22 ++++++++--------- 5 files changed, 41 insertions(+), 41 deletions(-) diff --git a/tools/deck/cb/deckturn.mjs b/tools/deck/cb/deckturn.mjs index a101720..7c48121 100644 --- a/tools/deck/cb/deckturn.mjs +++ b/tools/deck/cb/deckturn.mjs @@ -11,7 +11,7 @@ for i = #list, 2, -1 do \tlist[i], list[j] = list[j], list[i] end`, [{ Type: 'any', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'list' }]), method('BindButtons', `local endTurn = _EntityService:GetEntityByPath("/ui/RunUIGroup/DeckHud/EndTurnButton") -if endTurn ~= nil and endTurn.ButtonComponent ~= nil then +if endTurn ~= nil and (endTurn.ButtonComponent ~= nil or endTurn:AddComponent("ButtonComponent") ~= nil) then if self.EndTurnHandler ~= nil then endTurn:DisconnectEvent(ButtonClickEvent, self.EndTurnHandler) self.EndTurnHandler = nil @@ -19,7 +19,7 @@ if endTurn ~= nil and endTurn.ButtonComponent ~= nil then self.EndTurnHandler = endTurn:ConnectEvent(ButtonClickEvent, function() self:EndPlayerTurn() end) end local drawPile = _EntityService:GetEntityByPath("/ui/RunUIGroup/DeckHud/DrawPile") -if drawPile ~= nil and drawPile.ButtonComponent ~= nil then +if drawPile ~= nil and (drawPile.ButtonComponent ~= nil or drawPile:AddComponent("ButtonComponent") ~= nil) then if self.DrawPileHandler ~= nil then drawPile:DisconnectEvent(ButtonClickEvent, self.DrawPileHandler) self.DrawPileHandler = nil @@ -27,7 +27,7 @@ if drawPile ~= nil and drawPile.ButtonComponent ~= nil then self.DrawPileHandler = drawPile:ConnectEvent(ButtonClickEvent, function() self:OpenDeckInspect("draw") end) end local discardPile = _EntityService:GetEntityByPath("/ui/RunUIGroup/DeckHud/DiscardPile") -if discardPile ~= nil and discardPile.ButtonComponent ~= nil then +if discardPile ~= nil and (discardPile.ButtonComponent ~= nil or discardPile:AddComponent("ButtonComponent") ~= nil) then if self.DiscardPileHandler ~= nil then discardPile:DisconnectEvent(ButtonClickEvent, self.DiscardPileHandler) self.DiscardPileHandler = nil @@ -35,7 +35,7 @@ if discardPile ~= nil and discardPile.ButtonComponent ~= nil then self.DiscardPileHandler = discardPile:ConnectEvent(ButtonClickEvent, function() self:OpenDeckInspect("discard") end) end local exhaustPile = _EntityService:GetEntityByPath("/ui/RunUIGroup/DeckHud/ExhaustPile") -if exhaustPile ~= nil and exhaustPile.ButtonComponent ~= nil then +if exhaustPile ~= nil and (exhaustPile.ButtonComponent ~= nil or exhaustPile:AddComponent("ButtonComponent") ~= nil) then if self.ExhaustPileHandler ~= nil then exhaustPile:DisconnectEvent(ButtonClickEvent, self.ExhaustPileHandler) self.ExhaustPileHandler = nil @@ -43,7 +43,7 @@ if exhaustPile ~= nil and exhaustPile.ButtonComponent ~= nil then self.ExhaustPileHandler = exhaustPile:ConnectEvent(ButtonClickEvent, function() self:OpenDeckInspect("exhaust") end) end local inspectClose = _EntityService:GetEntityByPath("/ui/DeckUIGroup/DeckInspectHud/Close") -if inspectClose ~= nil and inspectClose.ButtonComponent ~= nil then +if inspectClose ~= nil and (inspectClose.ButtonComponent ~= nil or inspectClose:AddComponent("ButtonComponent") ~= nil) then if self.DeckInspectCloseHandler ~= nil then inspectClose:DisconnectEvent(ButtonClickEvent, self.DeckInspectCloseHandler) self.DeckInspectCloseHandler = nil @@ -51,7 +51,7 @@ if inspectClose ~= nil and inspectClose.ButtonComponent ~= nil then self.DeckInspectCloseHandler = inspectClose:ConnectEvent(ButtonClickEvent, function() self:CloseDeckInspect() end) end local allDeckButton = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/TopBar/AllDeckButton") -if allDeckButton ~= nil and allDeckButton.ButtonComponent ~= nil then +if allDeckButton ~= nil and (allDeckButton.ButtonComponent ~= nil or allDeckButton:AddComponent("ButtonComponent") ~= nil) then if self.AllDeckHandler ~= nil then allDeckButton:DisconnectEvent(ButtonClickEvent, self.AllDeckHandler) self.AllDeckHandler = nil @@ -59,7 +59,7 @@ if allDeckButton ~= nil and allDeckButton.ButtonComponent ~= nil then self.AllDeckHandler = allDeckButton:ConnectEvent(ButtonClickEvent, function() self:OpenAllDeck() end) end local allDeckClose = _EntityService:GetEntityByPath("/ui/DeckUIGroup/DeckAllHud/Close") -if allDeckClose ~= nil and allDeckClose.ButtonComponent ~= nil then +if allDeckClose ~= nil and (allDeckClose.ButtonComponent ~= nil or allDeckClose:AddComponent("ButtonComponent") ~= nil) then if self.AllDeckCloseHandler ~= nil then allDeckClose:DisconnectEvent(ButtonClickEvent, self.AllDeckCloseHandler) self.AllDeckCloseHandler = nil @@ -78,14 +78,14 @@ for i = 1, 10 do cardEntity:ConnectEvent(UITouchEndDragEvent, function(ev) self:OnCardDragEnd(i, ev.TouchPoint) end) cardEntity:ConnectEvent(UITouchEnterEvent, function() self:HoverCard(i) end) cardEntity:ConnectEvent(UITouchExitEvent, function() self:UnhoverCard(i) end) - if cardEntity.ButtonComponent ~= nil then + if (cardEntity.ButtonComponent ~= nil or cardEntity:AddComponent("ButtonComponent") ~= nil) then cardEntity:ConnectEvent(ButtonClickEvent, function() self:OnCardButton(i) end) end end end for i = 1, 3 do local rc = _EntityService:GetEntityByPath("/ui/RunUIGroup/RewardHud/Reward" .. tostring(i)) - if rc ~= nil and rc.ButtonComponent ~= nil then + if rc ~= nil and (rc.ButtonComponent ~= nil or rc:AddComponent("ButtonComponent") ~= nil) then rc:ConnectEvent(ButtonClickEvent, function() self:PickReward(i) end) if rc.UITouchReceiveComponent ~= nil then local cardPath = "/ui/RunUIGroup/RewardHud/Reward" .. tostring(i) @@ -95,7 +95,7 @@ for i = 1, 3 do end end local skip = _EntityService:GetEntityByPath("/ui/RunUIGroup/RewardHud/Skip") -if skip ~= nil and skip.ButtonComponent ~= nil then +if skip ~= nil and (skip.ButtonComponent ~= nil or skip:AddComponent("ButtonComponent") ~= nil) then skip:ConnectEvent(ButtonClickEvent, function() self:PickReward(0) end) end local mapNodeIds = {} @@ -108,13 +108,13 @@ table.insert(mapNodeIds, "boss") for i = 1, #mapNodeIds do local nid = mapNodeIds[i] local mn = _EntityService:GetEntityByPath("/ui/RunUIGroup/MapHud/Node_" .. nid) - if mn ~= nil and mn.ButtonComponent ~= nil then + if mn ~= nil and (mn.ButtonComponent ~= nil or mn:AddComponent("ButtonComponent") ~= nil) then mn:ConnectEvent(ButtonClickEvent, function() self:PickNode(nid) end) end end for i = 1, 3 do local sc = _EntityService:GetEntityByPath("/ui/RunUIGroup/ShopHud/Card" .. tostring(i)) - if sc ~= nil and sc.ButtonComponent ~= nil then + if sc ~= nil and (sc.ButtonComponent ~= nil or sc:AddComponent("ButtonComponent") ~= nil) then sc:ConnectEvent(ButtonClickEvent, function() self:BuyCard(i) end) if sc.UITouchReceiveComponent ~= nil then local cardPath = "/ui/RunUIGroup/ShopHud/Card" .. tostring(i) @@ -124,20 +124,20 @@ for i = 1, 3 do end end local shopLeave = _EntityService:GetEntityByPath("/ui/RunUIGroup/ShopHud/Leave") -if shopLeave ~= nil and shopLeave.ButtonComponent ~= nil then +if shopLeave ~= nil and (shopLeave.ButtonComponent ~= nil or shopLeave:AddComponent("ButtonComponent") ~= nil) then shopLeave:ConnectEvent(ButtonClickEvent, function() self:LeaveNode() end) end local shopRelic = _EntityService:GetEntityByPath("/ui/RunUIGroup/ShopHud/Relic") -if shopRelic ~= nil and shopRelic.ButtonComponent ~= nil then +if shopRelic ~= nil and (shopRelic.ButtonComponent ~= nil or shopRelic:AddComponent("ButtonComponent") ~= nil) then shopRelic:ConnectEvent(ButtonClickEvent, function() self:BuyRelic() end) end local restLeave = _EntityService:GetEntityByPath("/ui/RunUIGroup/RestHud/Leave") -if restLeave ~= nil and restLeave.ButtonComponent ~= nil then +if restLeave ~= nil and (restLeave.ButtonComponent ~= nil or restLeave:AddComponent("ButtonComponent") ~= nil) then restLeave:ConnectEvent(ButtonClickEvent, function() self:LeaveNode() end) end for i = 1, ${MAX_MONSTERS} do local ms = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/MonsterStatus" .. tostring(i)) - if ms ~= nil and ms.ButtonComponent ~= nil then + if ms ~= nil and (ms.ButtonComponent ~= nil or ms:AddComponent("ButtonComponent") ~= nil) then ms:ConnectEvent(ButtonClickEvent, function() self:SetTarget(i) end) end end @@ -171,41 +171,41 @@ for i = 1, 5 do end end local pmUse = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/PotionMenu/Use") -if pmUse ~= nil and pmUse.ButtonComponent ~= nil then +if pmUse ~= nil and (pmUse.ButtonComponent ~= nil or pmUse:AddComponent("ButtonComponent") ~= nil) then pmUse:ConnectEvent(ButtonClickEvent, function() self:UsePotion() end) end local pmToss = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/PotionMenu/Toss") -if pmToss ~= nil and pmToss.ButtonComponent ~= nil then +if pmToss ~= nil and (pmToss.ButtonComponent ~= nil or pmToss:AddComponent("ButtonComponent") ~= nil) then pmToss:ConnectEvent(ButtonClickEvent, function() self:TossPotion() end) end local pmClose = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/PotionMenu/Close") -if pmClose ~= nil and pmClose.ButtonComponent ~= nil then +if pmClose ~= nil and (pmClose.ButtonComponent ~= nil or pmClose:AddComponent("ButtonComponent") ~= nil) then pmClose:ConnectEvent(ButtonClickEvent, function() self:ClosePotionMenu() end) end local shopPotion = _EntityService:GetEntityByPath("/ui/RunUIGroup/ShopHud/Potion") -if shopPotion ~= nil and shopPotion.ButtonComponent ~= nil then +if shopPotion ~= nil and (shopPotion.ButtonComponent ~= nil or shopPotion:AddComponent("ButtonComponent") ~= nil) then shopPotion:ConnectEvent(ButtonClickEvent, function() self:BuyPotion() end) end local chest = _EntityService:GetEntityByPath("/ui/RunUIGroup/TreasureHud/Chest") -if chest ~= nil and chest.ButtonComponent ~= nil then +if chest ~= nil and (chest.ButtonComponent ~= nil or chest:AddComponent("ButtonComponent") ~= nil) then chest:ConnectEvent(ButtonClickEvent, function() self:OpenChest() end) end local treasureLeave = _EntityService:GetEntityByPath("/ui/RunUIGroup/TreasureHud/Leave") -if treasureLeave ~= nil and treasureLeave.ButtonComponent ~= nil then +if treasureLeave ~= nil and (treasureLeave.ButtonComponent ~= nil or treasureLeave:AddComponent("ButtonComponent") ~= nil) then treasureLeave:ConnectEvent(ButtonClickEvent, function() self:LeaveNode() end) end local jcRelic = _EntityService:GetEntityByPath("/ui/SelectUIGroup/JobChoiceHud/RelicButton") -if jcRelic ~= nil and jcRelic.ButtonComponent ~= nil then +if jcRelic ~= nil and (jcRelic.ButtonComponent ~= nil or jcRelic:AddComponent("ButtonComponent") ~= nil) then jcRelic:ConnectEvent(ButtonClickEvent, function() self:PickJobReward("relic") end) end local jcJob = _EntityService:GetEntityByPath("/ui/SelectUIGroup/JobChoiceHud/JobButton") -if jcJob ~= nil and jcJob.ButtonComponent ~= nil then +if jcJob ~= nil and (jcJob.ButtonComponent ~= nil or jcJob:AddComponent("ButtonComponent") ~= nil) then jcJob:ConnectEvent(ButtonClickEvent, function() self:PickJobReward("job") end) end for i = 1, 3 do local slotIdx = i local jb = _EntityService:GetEntityByPath("/ui/SelectUIGroup/JobSelectHud/Job_slot" .. tostring(i)) - if jb ~= nil and jb.ButtonComponent ~= nil then + if jb ~= nil and (jb.ButtonComponent ~= nil or jb:AddComponent("ButtonComponent") ~= nil) then jb:ConnectEvent(ButtonClickEvent, function() if self.JobOpts ~= nil and self.JobOpts[slotIdx] ~= nil then self:SetJob(self.JobOpts[slotIdx].id) diff --git a/tools/deck/cb/deckview.mjs b/tools/deck/cb/deckview.mjs index 6876bbc..a6c3ef6 100644 --- a/tools/deck/cb/deckview.mjs +++ b/tools/deck/cb/deckview.mjs @@ -69,7 +69,7 @@ end`, [ { Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'cardId' }, ]), method('BindClassDeckTabs', `local warriorTab = _EntityService:GetEntityByPath("/ui/DeckUIGroup/DeckAllHud/WarriorTab") -if warriorTab ~= nil and warriorTab.ButtonComponent ~= nil then +if warriorTab ~= nil and (warriorTab.ButtonComponent ~= nil or warriorTab:AddComponent("ButtonComponent") ~= nil) then if self.WarriorDeckTabHandler ~= nil then warriorTab:DisconnectEvent(ButtonClickEvent, self.WarriorDeckTabHandler) self.WarriorDeckTabHandler = nil @@ -77,7 +77,7 @@ if warriorTab ~= nil and warriorTab.ButtonComponent ~= nil then self.WarriorDeckTabHandler = warriorTab:ConnectEvent(ButtonClickEvent, function() self:SetClassDeckTab("warrior") end) end local thiefTab = _EntityService:GetEntityByPath("/ui/DeckUIGroup/DeckAllHud/ThiefTab") -if thiefTab ~= nil and thiefTab.ButtonComponent ~= nil then +if thiefTab ~= nil and (thiefTab.ButtonComponent ~= nil or thiefTab:AddComponent("ButtonComponent") ~= nil) then if self.ThiefDeckTabHandler ~= nil then thiefTab:DisconnectEvent(ButtonClickEvent, self.ThiefDeckTabHandler) self.ThiefDeckTabHandler = nil @@ -85,7 +85,7 @@ if thiefTab ~= nil and thiefTab.ButtonComponent ~= nil then self.ThiefDeckTabHandler = thiefTab:ConnectEvent(ButtonClickEvent, function() self:SetClassDeckTab("bandit") end) end local mageTab = _EntityService:GetEntityByPath("/ui/DeckUIGroup/DeckAllHud/MageTab") -if mageTab ~= nil and mageTab.ButtonComponent ~= nil then +if mageTab ~= nil and (mageTab.ButtonComponent ~= nil or mageTab:AddComponent("ButtonComponent") ~= nil) then if self.MageDeckTabHandler ~= nil then mageTab:DisconnectEvent(ButtonClickEvent, self.MageDeckTabHandler) self.MageDeckTabHandler = nil diff --git a/tools/deck/cb/map.mjs b/tools/deck/cb/map.mjs index cb84a8a..504423a 100644 --- a/tools/deck/cb/map.mjs +++ b/tools/deck/cb/map.mjs @@ -151,7 +151,7 @@ if e.SpriteGUIRendererComponent ~= nil then e.SpriteGUIRendererComponent.Color = Color(0.68, 0.68, 0.72, 0.85) end end -if e.ButtonComponent ~= nil then +if (e.ButtonComponent ~= nil or e:AddComponent("ButtonComponent") ~= nil) then e.ButtonComponent.Enable = reachable end`, [{ Type: 'string', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'id' }]), method('RenderMapDots', `local node = self.MapNodes[fromId] diff --git a/tools/deck/cb/soul.mjs b/tools/deck/cb/soul.mjs index 68841dc..cb664b5 100644 --- a/tools/deck/cb/soul.mjs +++ b/tools/deck/cb/soul.mjs @@ -88,7 +88,7 @@ self.SoulShopBound = true for i = 1, 4 do local idx = i local e = _EntityService:GetEntityByPath("/ui/LobbyUIGroup/SoulShopHud/Item" .. tostring(i)) - if e ~= nil and e.ButtonComponent ~= nil then + if e ~= nil and (e.ButtonComponent ~= nil or e:AddComponent("ButtonComponent") ~= nil) then e:ConnectEvent(ButtonClickEvent, function() self:BuySoulUnlock(idx) end) end end`), diff --git a/tools/deck/cb/state.mjs b/tools/deck/cb/state.mjs index c85bddc..b1b5f52 100644 --- a/tools/deck/cb/state.mjs +++ b/tools/deck/cb/state.mjs @@ -54,7 +54,7 @@ self:SetText("/ui/DefaultGroup/MainMenu/Subtitle", "캐릭터를 고르고 덱 self:SetText("/ui/DefaultGroup/MainMenu/NewGameButton", "새 게임") self:BindMenuButtons()`), method('BindMenuButtons', `local buttonEntity = _EntityService:GetEntityByPath("/ui/DefaultGroup/MainMenu/NewGameButton") -if buttonEntity ~= nil and buttonEntity.ButtonComponent ~= nil then +if buttonEntity ~= nil and (buttonEntity.ButtonComponent ~= nil or buttonEntity:AddComponent("ButtonComponent") ~= nil) then if self.NewGameHandler ~= nil then buttonEntity:DisconnectEvent(ButtonClickEvent, self.NewGameHandler) self.NewGameHandler = nil @@ -62,7 +62,7 @@ if buttonEntity ~= nil and buttonEntity.ButtonComponent ~= nil then self.NewGameHandler = buttonEntity:ConnectEvent(ButtonClickEvent, function() self:ShowLobby() end) end local warrior = _EntityService:GetEntityByPath("/ui/SelectUIGroup/CharacterSelectHud/WarriorButton") -if warrior ~= nil and warrior.ButtonComponent ~= nil then +if warrior ~= nil and (warrior.ButtonComponent ~= nil or warrior:AddComponent("ButtonComponent") ~= nil) then if self.WarriorSelectHandler ~= nil then warrior:DisconnectEvent(ButtonClickEvent, self.WarriorSelectHandler) self.WarriorSelectHandler = nil @@ -70,7 +70,7 @@ if warrior ~= nil and warrior.ButtonComponent ~= nil then self.WarriorSelectHandler = warrior:ConnectEvent(ButtonClickEvent, function() self:SelectClass("warrior") end) end local thief = _EntityService:GetEntityByPath("/ui/SelectUIGroup/CharacterSelectHud/ThiefButton") -if thief ~= nil and thief.ButtonComponent ~= nil then +if thief ~= nil and (thief.ButtonComponent ~= nil or thief:AddComponent("ButtonComponent") ~= nil) then if self.ThiefSelectHandler ~= nil then thief:DisconnectEvent(ButtonClickEvent, self.ThiefSelectHandler) self.ThiefSelectHandler = nil @@ -78,7 +78,7 @@ if thief ~= nil and thief.ButtonComponent ~= nil then self.ThiefSelectHandler = thief:ConnectEvent(ButtonClickEvent, function() self:SelectClass("bandit") end) end local mage = _EntityService:GetEntityByPath("/ui/SelectUIGroup/CharacterSelectHud/MageButton") -if mage ~= nil and mage.ButtonComponent ~= nil then +if mage ~= nil and (mage.ButtonComponent ~= nil or mage:AddComponent("ButtonComponent") ~= nil) then if self.MageSelectHandler ~= nil then mage:DisconnectEvent(ButtonClickEvent, self.MageSelectHandler) self.MageSelectHandler = nil @@ -86,7 +86,7 @@ if mage ~= nil and mage.ButtonComponent ~= nil then self.MageSelectHandler = mage:ConnectEvent(ButtonClickEvent, function() self:SelectClass("magician") end) end local allDeckClose = _EntityService:GetEntityByPath("/ui/DeckUIGroup/DeckAllHud/Close") -if allDeckClose ~= nil and allDeckClose.ButtonComponent ~= nil then +if allDeckClose ~= nil and (allDeckClose.ButtonComponent ~= nil or allDeckClose:AddComponent("ButtonComponent") ~= nil) then if self.AllDeckCloseHandler ~= nil then allDeckClose:DisconnectEvent(ButtonClickEvent, self.AllDeckCloseHandler) self.AllDeckCloseHandler = nil @@ -95,7 +95,7 @@ if allDeckClose ~= nil and allDeckClose.ButtonComponent ~= nil then end self:BindClassDeckTabs() local start = _EntityService:GetEntityByPath("/ui/SelectUIGroup/CharacterSelectHud/StartButton") -if start ~= nil and start.ButtonComponent ~= nil then +if start ~= nil and (start.ButtonComponent ~= nil or start:AddComponent("ButtonComponent") ~= nil) then if self.StartGameHandler ~= nil then start:DisconnectEvent(ButtonClickEvent, self.StartGameHandler) self.StartGameHandler = nil @@ -103,7 +103,7 @@ if start ~= nil and start.ButtonComponent ~= nil then self.StartGameHandler = start:ConnectEvent(ButtonClickEvent, function() self:StartNewGame() end) end local charBack = _EntityService:GetEntityByPath("/ui/SelectUIGroup/CharacterSelectHud/BackButton") -if charBack ~= nil and charBack.ButtonComponent ~= nil then +if charBack ~= nil and (charBack.ButtonComponent ~= nil or charBack:AddComponent("ButtonComponent") ~= nil) then if self.CharBackHandler ~= nil then charBack:DisconnectEvent(ButtonClickEvent, self.CharBackHandler) self.CharBackHandler = nil @@ -111,7 +111,7 @@ if charBack ~= nil and charBack.ButtonComponent ~= nil then self.CharBackHandler = charBack:ConnectEvent(ButtonClickEvent, function() self:ShowLobby() end) end local ascMinus = _EntityService:GetEntityByPath("/ui/DefaultGroup/MainMenu/AscMinus") -if ascMinus ~= nil and ascMinus.ButtonComponent ~= nil then +if ascMinus ~= nil and (ascMinus.ButtonComponent ~= nil or ascMinus:AddComponent("ButtonComponent") ~= nil) then if self.AscMinusHandler ~= nil then ascMinus:DisconnectEvent(ButtonClickEvent, self.AscMinusHandler) self.AscMinusHandler = nil @@ -119,7 +119,7 @@ if ascMinus ~= nil and ascMinus.ButtonComponent ~= nil then self.AscMinusHandler = ascMinus:ConnectEvent(ButtonClickEvent, function() self:AdjustAscension(-1) end) end local ascPlus = _EntityService:GetEntityByPath("/ui/DefaultGroup/MainMenu/AscPlus") -if ascPlus ~= nil and ascPlus.ButtonComponent ~= nil then +if ascPlus ~= nil and (ascPlus.ButtonComponent ~= nil or ascPlus:AddComponent("ButtonComponent") ~= nil) then if self.AscPlusHandler ~= nil then ascPlus:DisconnectEvent(ButtonClickEvent, self.AscPlusHandler) self.AscPlusHandler = nil @@ -171,7 +171,7 @@ end self.LobbyBound = true local function bindClick(path, fn) local e = _EntityService:GetEntityByPath(path) - if e ~= nil and e.ButtonComponent ~= nil then + if e ~= nil and (e.ButtonComponent ~= nil or e:AddComponent("ButtonComponent") ~= nil) then e:ConnectEvent(ButtonClickEvent, fn) end end @@ -182,7 +182,7 @@ bindClick("/ui/LobbyUIGroup/SoulShopHud/Close", function() self:CloseSoulShop() method('ShowCodex', `self.CodexMode = true self.ClassDeckMode = true local close = _EntityService:GetEntityByPath("/ui/DeckUIGroup/DeckAllHud/Close") -if close ~= nil and close.ButtonComponent ~= nil then +if close ~= nil and (close.ButtonComponent ~= nil or close:AddComponent("ButtonComponent") ~= nil) then if self.AllDeckCloseHandler ~= nil then close:DisconnectEvent(ButtonClickEvent, self.AllDeckCloseHandler) end