From bb4172bce208079581d7b63d22ef62616739b5db Mon Sep 17 00:00:00 2001 From: Sebastian Lindfors Date: Thu, 26 Sep 2024 11:16:34 +0200 Subject: [PATCH] Fix pager API (raid cursor) on SoD --- ConsolePort/ConsolePort.toc | 2 +- ConsolePort/Controller/Pager.lua | 24 ++++++++++++------- ConsolePort_Bar/ConsolePort_Bar.toc | 2 +- ConsolePort_Config/ConsolePort_Config.toc | 2 +- ConsolePort_Cursor/ConsolePort_Cursor.toc | 2 +- ConsolePort_Keyboard/ConsolePort_Keyboard.toc | 2 +- ConsolePort_Mapper/ConsolePort_Mapper.toc | 2 +- ConsolePort_Menu/ConsolePort_Menu.toc | 2 +- ConsolePort_World/ConsolePort_World.toc | 2 +- 9 files changed, 24 insertions(+), 16 deletions(-) diff --git a/ConsolePort/ConsolePort.toc b/ConsolePort/ConsolePort.toc index 0ddb0dba..87ed80a8 100644 --- a/ConsolePort/ConsolePort.toc +++ b/ConsolePort/ConsolePort.toc @@ -1,5 +1,5 @@ ## Interface: 110002 -## Interface-Classic: 11502 +## Interface-Classic: 11504 ## Interface-Wrath: 30403 ## Interface-Cata: 40400 ## IconTexture: Interface\AddOns\ConsolePort\Assets\Textures\Logo\CP_Thumb diff --git a/ConsolePort/Controller/Pager.lua b/ConsolePort/Controller/Pager.lua index be645edb..68872b4f 100644 --- a/ConsolePort/Controller/Pager.lua +++ b/ConsolePort/Controller/Pager.lua @@ -160,10 +160,14 @@ Pager.Env = { if type == 'spell' then local slot = self::GetActionSpellInfo(...) if slot then - return ]]..(IsHarmfulSpell - and ('IsHarmfulSpell(slot, "spell")') - or ('IsSpellHarmful(id, %d)'):format(Enum.SpellBookSpellBank.Player) - )..[[; + return ]]..(function() + if CPAPI.IsClassicEraVersion then + return 'IsSpellHarmful(id)' + elseif CPAPI.IsClassicVersion then + return 'IsHarmfulSpell(slot, "spell")' + end + return ('IsSpellHarmful(id, %d)'):format(Enum.SpellBookSpellBank.Player) + end)()..[[; end elseif type == 'item' and id then return IsHarmfulItem(id) @@ -180,10 +184,14 @@ Pager.Env = { if type == 'spell' then local slot = self::GetActionSpellInfo(...) if slot then - return ]]..(IsHelpfulSpell - and ('IsHelpfulSpell(slot, "spell")') - or ('IsSpellHelpful(id, %d)'):format(Enum.SpellBookSpellBank.Player) - )..[[; + return ]]..(function() + if CPAPI.IsClassicEraVersion then + return 'IsSpellHelpful(id)' + elseif CPAPI.IsClassicVersion then + return 'IsHelpfulSpell(slot, "spell")' + end + return ('IsSpellHelpful(id, %d)'):format(Enum.SpellBookSpellBank.Player) + end)()..[[; end elseif type == 'item' and id then return IsHelpfulItem(id) diff --git a/ConsolePort_Bar/ConsolePort_Bar.toc b/ConsolePort_Bar/ConsolePort_Bar.toc index 35f07bb1..a2ca654b 100644 --- a/ConsolePort_Bar/ConsolePort_Bar.toc +++ b/ConsolePort_Bar/ConsolePort_Bar.toc @@ -1,5 +1,5 @@ ## Interface: 110002 -## Interface-Classic: 11502 +## Interface-Classic: 11504 ## Interface-Wrath: 30403 ## Interface-Cata: 40400 ## IconTexture: Interface\AddOns\ConsolePort\Assets\Textures\Logo\CP_Thumb diff --git a/ConsolePort_Config/ConsolePort_Config.toc b/ConsolePort_Config/ConsolePort_Config.toc index a0365a8b..74b57cbc 100644 --- a/ConsolePort_Config/ConsolePort_Config.toc +++ b/ConsolePort_Config/ConsolePort_Config.toc @@ -1,5 +1,5 @@ ## Interface: 110002 -## Interface-Classic: 11502 +## Interface-Classic: 11504 ## Interface-Wrath: 30403 ## Interface-Cata: 40400 ## IconTexture: Interface\AddOns\ConsolePort\Assets\Textures\Logo\CP_Thumb diff --git a/ConsolePort_Cursor/ConsolePort_Cursor.toc b/ConsolePort_Cursor/ConsolePort_Cursor.toc index e1f8f2fe..0e4adae5 100644 --- a/ConsolePort_Cursor/ConsolePort_Cursor.toc +++ b/ConsolePort_Cursor/ConsolePort_Cursor.toc @@ -1,5 +1,5 @@ ## Interface: 110002 -## Interface-Classic: 11502 +## Interface-Classic: 11504 ## Interface-Wrath: 30403 ## Interface-Cata: 40400 ## IconTexture: Interface\AddOns\ConsolePort\Assets\Textures\Logo\CP_Thumb diff --git a/ConsolePort_Keyboard/ConsolePort_Keyboard.toc b/ConsolePort_Keyboard/ConsolePort_Keyboard.toc index 9a1b2553..ae856e17 100644 --- a/ConsolePort_Keyboard/ConsolePort_Keyboard.toc +++ b/ConsolePort_Keyboard/ConsolePort_Keyboard.toc @@ -1,5 +1,5 @@ ## Interface: 110002 -## Interface-Classic: 11502 +## Interface-Classic: 11504 ## Interface-Wrath: 30403 ## Interface-Cata: 40400 ## IconTexture: Interface\AddOns\ConsolePort\Assets\Textures\Logo\CP_Thumb diff --git a/ConsolePort_Mapper/ConsolePort_Mapper.toc b/ConsolePort_Mapper/ConsolePort_Mapper.toc index d5e51a72..9ca82c55 100644 --- a/ConsolePort_Mapper/ConsolePort_Mapper.toc +++ b/ConsolePort_Mapper/ConsolePort_Mapper.toc @@ -1,5 +1,5 @@ ## Interface: 110002 -## Interface-Classic: 11502 +## Interface-Classic: 11504 ## Interface-Wrath: 30403 ## Interface-Cata: 40400 ## IconTexture: Interface\AddOns\ConsolePort\Assets\Textures\Logo\CP_Thumb diff --git a/ConsolePort_Menu/ConsolePort_Menu.toc b/ConsolePort_Menu/ConsolePort_Menu.toc index a7d3ec32..ff410ebc 100644 --- a/ConsolePort_Menu/ConsolePort_Menu.toc +++ b/ConsolePort_Menu/ConsolePort_Menu.toc @@ -1,5 +1,5 @@ ## Interface: 110002 -## Interface-Classic: 11502 +## Interface-Classic: 11504 ## Interface-Wrath: 30403 ## Interface-Cata: 40400 ## IconTexture: Interface\AddOns\ConsolePort\Assets\Textures\Logo\CP_Thumb diff --git a/ConsolePort_World/ConsolePort_World.toc b/ConsolePort_World/ConsolePort_World.toc index 0df6e808..24b2dbc3 100644 --- a/ConsolePort_World/ConsolePort_World.toc +++ b/ConsolePort_World/ConsolePort_World.toc @@ -1,5 +1,5 @@ ## Interface: 110002 -## Interface-Classic: 11502 +## Interface-Classic: 11504 ## Interface-Wrath: 30403 ## Interface-Cata: 40400 ## IconTexture: Interface\AddOns\ConsolePort\Assets\Textures\Logo\CP_Thumb