ItemReminder: fixed issue with handling multiplayer +J&E
This commit is contained in:
1 parent
01f5f599ba
commit
f6dce7064b
2 files changed
+18
-10
No files matched your search
+17
-9
@@ -444,12 +444,19 @@ function EID:IsCategorySelected(categoryID)
|
|||||||
return EID.ItemReminderCategories[EID.ItemReminderSelectedCategory + 1].id == categoryID
|
return EID.ItemReminderCategories[EID.ItemReminderSelectedCategory + 1].id == categoryID
|
||||||
end
|
end
|
||||||
|
|
||||||
function EID:ItemReminderHandleInitHoldTab(playerNumHoldingTab)
|
function EID:ItemReminderHandleInitHoldTab()
|
||||||
local oldDisplayPlayer = EID.ItemReminderSelectedPlayer
|
local oldDisplayPlayer = EID.ItemReminderSelectedPlayer
|
||||||
EID.ItemReminderSelectedPlayer = playerNumHoldingTab - 1
|
|
||||||
|
-- set currently displayed player to the one who is now holding tab
|
||||||
|
for i = 1, #EID.coopAllPlayers do
|
||||||
|
if EID.coopAllPlayers[i] == EID.holdTabPlayer then
|
||||||
|
EID.ItemReminderSelectedPlayer = i - 1
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local updatedPlayers = EID:UpdateAllPlayerPassiveItems()
|
local updatedPlayers = EID:UpdateAllPlayerPassiveItems()
|
||||||
if updatedPlayers[playerNumHoldingTab] or oldDisplayPlayer ~= EID.ItemReminderSelectedPlayer then
|
if updatedPlayers[EID.ItemReminderSelectedPlayer + 1] or oldDisplayPlayer ~= EID.ItemReminderSelectedPlayer then
|
||||||
EID.ItemReminderSelectedItem = 0
|
EID.ItemReminderSelectedItem = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -463,19 +470,20 @@ function EID:ItemReminderGetTitle()
|
|||||||
translatedTitleEnglish and translatedTitleEnglish[category.id] or category.id
|
translatedTitleEnglish and translatedTitleEnglish[category.id] or category.id
|
||||||
|
|
||||||
local combinedText = EID.ButtonToIconMap[EID.Config["ItemReminderNavigateLeftButton"]] ..
|
local combinedText = EID.ButtonToIconMap[EID.Config["ItemReminderNavigateLeftButton"]] ..
|
||||||
"{{ColorText}} " .. title .. " {{CR}}" .. EID.ButtonToIconMap[EID.Config["ItemReminderNavigateRightButton"]]
|
title .. EID.ButtonToIconMap[EID.Config["ItemReminderNavigateRightButton"]]
|
||||||
|
|
||||||
-- add player toggle when more than 1 player is present
|
-- add player toggle when more than 1 player is present
|
||||||
if #EID.coopAllPlayers > 1 then
|
if #EID.coopAllPlayers > 1 then
|
||||||
local currentPlayer = EID.coopAllPlayers[EID.ItemReminderSelectedPlayer + 1]
|
local curPlayerID = EID.ItemReminderSelectedPlayer + 1
|
||||||
local playerIcon = EID:GetPlayerIcon(currentPlayer:GetPlayerType())
|
local currentPlayer = EID.coopAllPlayers[curPlayerID]
|
||||||
|
local playerIcon = EID:GetPlayerIcon(currentPlayer:GetPlayerType(), "P" .. curPlayerID )
|
||||||
|
|
||||||
local playerSelectWidget = playerIcon .. " "
|
local playerSelectWidget = playerIcon .. " "
|
||||||
if not EID:IsCategorySelected("Passives") then
|
if not EID:IsCategorySelected("Passives") then
|
||||||
playerSelectWidget = EID.ButtonToIconMap[EID.Config["ItemReminderNavigateDownButton"]] .. " " ..
|
playerSelectWidget = EID.ButtonToIconMap[EID.Config["ItemReminderNavigateDownButton"]] ..
|
||||||
playerIcon .. " " .. EID.ButtonToIconMap[EID.Config["ItemReminderNavigateUpButton"]] .. " "
|
playerIcon .. EID.ButtonToIconMap[EID.Config["ItemReminderNavigateUpButton"]] .. "|"
|
||||||
end
|
end
|
||||||
combinedText = playerSelectWidget .. combinedText
|
combinedText = "{{ColorText}}" .. playerSelectWidget .. combinedText
|
||||||
end
|
end
|
||||||
return combinedText
|
return combinedText
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1284,7 +1284,7 @@ function EID:OnRender()
|
|||||||
if tabHeld then
|
if tabHeld then
|
||||||
EID.holdTabPlayer = EID.coopMainPlayers[playerNumHoldingTab]
|
EID.holdTabPlayer = EID.coopMainPlayers[playerNumHoldingTab]
|
||||||
if EID.holdTabCounter == 0 then -- update item reminder player selection
|
if EID.holdTabCounter == 0 then -- update item reminder player selection
|
||||||
EID:ItemReminderHandleInitHoldTab(playerNumHoldingTab)
|
EID:ItemReminderHandleInitHoldTab()
|
||||||
end
|
end
|
||||||
EID.holdTabCounter = EID.holdTabCounter + 1
|
EID.holdTabCounter = EID.holdTabCounter + 1
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in new issue
Block a user