myslot icon indicating copy to clipboard operation
myslot copied to clipboard

Add toy support for action bar export/import

Open Copilot opened this issue 2 months ago • 0 comments

Toys placed in action bars were not preserved during export/import, even when the target character had learned them. WoW's GetActionInfo() returns toys as "item" type, indistinguishable from regular items.

Changes

Protobuf schema

  • Added TOY = 10 to SlotType enum

Export (GetActionInfo)

  • Detect toys using C_ToyBox.PlayerHasToy() when GetActionInfo() returns "item"
  • Mark as MYSLOT_TOY instead of MYSLOT_ITEM
  • Validate index is numeric before API call

Import (RecoverData)

  • Restore toys using C_ToyBox.PickupToyBoxItem()
  • Handle three cases:
    • Player has toy → place in action bar
    • Player missing toy → "Ignore unlearned toy" message
    • No C_ToyBox API → "not supported in this WoW version" message

Example

-- Export detects toy vs item
if slotType == "item" and index and type(index) == "number" and C_ToyBox and C_ToyBox.PlayerHasToy then
    if C_ToyBox.PlayerHasToy(index) then
        msg.type = MYSLOT_TOY  -- Distinguish from regular items
    end
end

-- Import uses toy-specific API
elseif slotType == MYSLOT_TOY then
    if C_ToyBox and C_ToyBox.PickupToyBoxItem and C_ToyBox.PlayerHasToy then
        if C_ToyBox.PlayerHasToy(index) then
            C_ToyBox.PickupToyBoxItem(index)
        end
    end
end
Original prompt

This section details on the original issue you should resolve

<issue_title>support toy bar export</issue_title> <issue_description>Dear Boshi,

First of all, thank you for creating and maintaining the Myslot addon. It has been an incredibly useful tool for managing macros, key bindings, and action bar layouts across my characters.

I would like to kindly suggest a feature enhancement for future versions of Myslot.

Currently, when exporting action bar layouts, any toys placed in action bar slots are not properly transferred even if the target character has learned them. It would be great if Myslot could detect and include toys in the export/import process, just like it handles spells and items.

Many players frequently use toys such as hearthstone-type toys or engineering wormhole generators, and having those preserved in the action bar layout would be a big quality-of-life improvement.

I looked through the GitHub issues but didn’t find any confirmed feature request specifically related to toys.
Apologies if this has already been suggested — I just wanted to share my experience and hope it might be helpful.

Thank you for your consideration, and again, thank you for your excellent work on Myslot.

Best regards,
다민님
Korea - Azshara server</issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes tg123/myslot#84

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot avatar Dec 26 '25 08:12 Copilot