TimothyLuke / GSE-Advanced-Macro-Compiler

GSE is an alternative advanced macro editor and engine for World of Warcraft.
https://discord.gg/gseunited
MIT License
215 stars 73 forks source link

[BUG] Macro icon not updating for Toy commands #1376

Closed F-Lambda closed 11 months ago

F-Lambda commented 11 months ago

🔵 Describe the bug: So, in vanilla macros, setting an icon to question mark and putting #showtooltip at the top of the macro causes the macro icon to update to whatever the macro will fire (or the first thing if it fires multiple because of 0 GCD). This works whether you're doing /cast spell, /use item, or /usetoy toy.

GSE mimics this behavior of showing the icon of whatever action block will be activated. However, it only works for /cast spell and /use item. For some reason, /usetoy toy just shows the question mark, with the tooltip just showing the macro name when it gets to that block.

🔵 To reproduce: (Steps to reproduce the behavior) Here's an example macro that doesn't work as expected:

{
    ["Variables"] = {

    },
    ["Actions"] = {
        [1] = {
            [1] = "/cast Wound Poison",
            ["Type"] = "Action"
        },
        [2] = {
            [1] = "/cast Atrophic Poison",
            ["Type"] = "Action"
        },
        [3] = {
            [1] = "/use Crystal of Insanity",
            ["Type"] = "Action"
        },
        [4] = {
            [1] = "/usetoy Crate of Bobbers: Tugboat",
            ["Type"] = "Action"
        },
        [5] = {
            [1] = "/usetoy Reusable Oversized Bobber",
            ["Type"] = "Action"
        },
        [6] = {
            [1] = "/usetoy Ancient Pandaren Fishing Charm",
            ["Type"] = "Action"
        }
    },
    ["InbuiltVariables"] = {

    }
}

🔵 Screenshots: The button when it reaches the toys: image

🔵 Expected behavior: Toy icon is shown

🔵 GSE.lua file:

dGJOcaGEfjTnk1mvemBIA(QOUjKYViKVPi1of1Er7MI9Rk)esmmc1VPQHcuAWQ0WLOdkHNrehtsNtrvlKGwQQslgWYv4HQQEQWYaYZfzIQqtfQjtKMoPlcuDvc4YsDDkzJqSvvKnRQy7afFuruFvrOPPO0PPYJb1Nvuz0qQoSsNufmoffxds68GSofjUnb61kImReZCLX5FeeeeBBBBHcGGC(lZGiMXe2KkqP0vBPmajgKKAf08vqsQvuzCAhUfqUtetLbAl8WNiM5kXmoTd3ci3jIPYOawDEtIyMReZCLHi4nPV7m2tppdmuzZOawDEdvMbrmZvgIG3K(UsMPAlzAgyOYMrbS68gQmlHyMRmezL639FaL0v(D9FE3dM0ACkedmuzZOawDEdvMNLyMRmezLA1d9U)Jv731)5Df6ba6rAkVl2Aoa)QmWqLnJcy15nuzgvIzUYqKvQvp07(TTslGC)UOaMEKCtTL(Uc9aa9GbgQSzuaRoVHkZ2eZCLHiRuREO3TWa7AJ(UGDns3rBExexcDNzU39h9DiidmuzZOawDEdvQmoyaSCY6PD4wa5ormvQuzmXENuH1ytetLbATUhxDjMbELBJMyWOWsr3pyWyYb4N6rY5nmlPIQygOTgRv(Gr7byAJ68gkKXrxAbKBWL6u)GamYRGnJZ)iiii2222cfab58xgF7vkkgzicWaCZh)aU)9cwU6c4KDkefYikB4dhzEwgyu(zUkwmiXIzCS)SwYkZvQuPsc
# BUFF

## Talents: ?,?,?,?,?,?,?

This macro contains 1 macro template. This Sequence was exported from GSE 3.1.50.

🔵 Desktop (please complete the following information):

🔵 GSE Version:

TimothyLuke commented 11 months ago

Hey F-Lambda, I can confirm the issue. I’m just not sure it’s something I can fix. The code that updates the icon doesn’t seem to be able to recognise a toy as a “spell” to set the icon. There is supposed to be an equivalent for an item but I dont think there is a toy version. Toys became their own thing with the collection API and while /use toy differentiates that you are trying to use a toy in the collection, neither SetMacroSpell or SetMacroItem recognise toys.

TimothyLuke commented 11 months ago

The code to do this is very simple. This goes into Storage.lua. The issue is that neither SetMacroItem or SetMacroSpell see into the Toybox. This is limited to WoW's own code only and not accessible for GSE at this time.

            if strlower(cmd) == "usetoy" or strlower(cmd) == "toy" then
                --print(spell, target)
                --local _, _, _, _, _, _, _, _, itemId = GetItemInfo(spell)
                --SetMacroSpell(gsebutton, spell, target)
                SetMacroItem(gsebutton, spell, target)
                foundSpell = true
            end