Fixed Indicators being rendered at a wrong location when in the mirror dimension
This commit is contained in:
1 parent
8a4a2420ef
commit
72cfe38931
2 files changed
+32
-3
No files matched your search
@@ -359,7 +359,26 @@ function EID:printBulletPoints(description, renderPos)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
---------------------------Handle New Room--------------------------------
|
||||||
|
local function IsMirror()
|
||||||
|
local lvl = game:GetLevel()
|
||||||
|
for i=0,168 do
|
||||||
|
local data = lvl:GetRoomByIdx(i).Data
|
||||||
|
if data and data.Name == 'Knife Piece Room' then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
local isMirrorRoom = false
|
||||||
|
function EID:onNewRoom()
|
||||||
|
if game:GetLevel():GetAbsoluteStage() == LevelStage.STAGE1_2 then
|
||||||
|
isMirrorRoom = IsMirror()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
EID:AddCallback(ModCallbacks.MC_POST_NEW_ROOM, EID.onNewRoom)
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
---------------------------Handle Rendering--------------------------------
|
---------------------------Handle Rendering--------------------------------
|
||||||
|
|
||||||
@@ -374,11 +393,16 @@ function EID:renderIndicator(entity)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
local repDiv = 1
|
local repDiv = 1
|
||||||
|
local entityPos = Isaac.WorldToScreen(entity.Position)
|
||||||
|
local sprite = entity:GetSprite()
|
||||||
if REPENTANCE then
|
if REPENTANCE then
|
||||||
repDiv = 255
|
repDiv = 255
|
||||||
|
if isMirrorRoom then
|
||||||
|
local screenCenter = EID:GetScreenSize()/2
|
||||||
|
entityPos.X = entityPos.X - (entityPos-screenCenter).X * 2
|
||||||
|
sprite.FlipX = true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
local sprite = entity:GetSprite()
|
|
||||||
local entityPos = Isaac.WorldToScreen(entity.Position)
|
|
||||||
if EID.Config["Indicator"] == "blink" then
|
if EID.Config["Indicator"] == "blink" then
|
||||||
local c = 255 - math.floor(255 * ((entity.FrameCount % 40) / 40))
|
local c = 255 - math.floor(255 * ((entity.FrameCount % 40) / 40))
|
||||||
sprite.Color = Color(1, 1, 1, 1, c/repDiv, c/repDiv, c/repDiv)
|
sprite.Color = Color(1, 1, 1, 1, c/repDiv, c/repDiv, c/repDiv)
|
||||||
@@ -409,6 +433,11 @@ function EID:renderIndicator(entity)
|
|||||||
end
|
end
|
||||||
ArrowSprite:Render(Isaac.WorldToScreen(entity.Position + ArrowOffset), nullVector, nullVector)
|
ArrowSprite:Render(Isaac.WorldToScreen(entity.Position + ArrowOffset), nullVector, nullVector)
|
||||||
end
|
end
|
||||||
|
if REPENTANCE then
|
||||||
|
if isMirrorRoom then
|
||||||
|
sprite.FlipX = false
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function EID:renderHUDLocationIndicators()
|
function EID:renderHUDLocationIndicators()
|
||||||
|
|||||||
+1
-1
@@ -90,7 +90,7 @@ https://moddingofisaac.com/mod/1079/external-item-descriptions
|
|||||||
- Jake for the sweet [b]German[/b] language pack
|
- Jake for the sweet [b]German[/b] language pack
|
||||||
- [url=https://steamcommunity.com/id/whytefang/]adc[/url] for creating an awesome new Languagepack and providing ideas for new functionalities
|
- [url=https://steamcommunity.com/id/whytefang/]adc[/url] for creating an awesome new Languagepack and providing ideas for new functionalities
|
||||||
</description>
|
</description>
|
||||||
<version>3.62</version>
|
<version>3.64</version>
|
||||||
<visibility>Public</visibility>
|
<visibility>Public</visibility>
|
||||||
<tag id="Lua"/>
|
<tag id="Lua"/>
|
||||||
<tag id="Items"/>
|
<tag id="Items"/>
|
||||||
|
|||||||
Reference in new issue
Block a user