View Single Post
10-05-15, 08:56 PM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,325
I think C still outputs that as a float if not type-casted, integer divide should be backslash (\).

Anyway, I decided to take a crack at my own version which replicates the table structure the OP suggested.
Lua Code:
  1. local Buttons={};
  2. for i=0,(24*4)-1 do--   Written this way to make it easier to understand (Also zero-based indices to make math easier)
  3.     local key=(i%2==1 and "CTRL-" or "")..(i%4>1 and "SHIFT-" or "").."F"..(math.floor(i/4)+1);
  4.     local name="FunctionButton_"..key:gsub("%-","_");
  5.     local button=CreateFrame("Button",name,nil,"SecureActionButtonTemplate");
  6.     button:SetAttribute("type","macro");
  7.     SetBindingClick(key,name);
  8.     Buttons[i+1]=button;
  9. end
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 10-05-15 at 09:10 PM.
  Reply With Quote