1. Hello,

    I'm writing a looting addon for my guild, or at least attempt to, so I can see how far I get. It's getting along nicely. I've made a frame that pops up when something of relevance is looted. This frame has like 15 child frames, and each of those has a number of buttons (created with a template). In order to access those buttons I'm using a table so I can shorten my code a bit, but this doesn't seem like an elegant solution. So my question, is there a way to access the frames (buttons) without this table?

    SDKP_LootFrame_Item_Button_MS_Table = {};
    SDKP_LootFrame_Item_Button_MS_Table[1] = SDKP_LootFrame_Item1_Button_MS;
    SDKP_LootFrame_Item_Button_MS_Table[2] = SDKP_LootFrame_Item2_Button_MS;
    SDKP_LootFrame_Item_Button_MS_Table[3] = SDKP_LootFrame_Item3_Button_MS;
    SDKP_LootFrame_Item_Button_MS_Table[4] = SDKP_LootFrame_Item4_Button_MS;
    SDKP_LootFrame_Item_Button_MS_Table[5] = SDKP_LootFrame_Item5_Button_MS;
    SDKP_LootFrame_Item_Button_MS_Table[6] = SDKP_LootFrame_Item6_Button_MS;
    SDKP_LootFrame_Item_Button_MS_Table[7] = SDKP_LootFrame_Item7_Button_MS;
    SDKP_LootFrame_Item_Button_MS_Table[8] = SDKP_LootFrame_Item8_Button_MS;
    SDKP_LootFrame_Item_Button_MS_Table[9] = SDKP_LootFrame_Item9_Button_MS;
    SDKP_LootFrame_Item_Button_MS_Table[10] = SDKP_LootFrame_Item10_Button_MS;
    

    then accessing with

    SDKP_LootFrame_Item_Button_MS_Table[buttonnrInt]:Disable()

    you get the idea

    Either you can look them up using their names in the global environment G["SDKPLootFrameItem1Button_MS"] or you can do what you're already doing. Either way you're using a table to look them up =)

    You can easily make that table local and shorten the name quite a bit.

    Wauw fast reply.

    So, I could concatenate the name together and the look it up in the global environment and basically going through a bigger table. Is doing that less performant and should I stick to what I'm doing atm?

    edit: Yeah will shorten the names after I'm done with everything.. easier to just Find+Replace. Keeping the long names for clarity atm.

    What you are doing is the best way to do it, to be honest!

    Okay ty for the help !! :)