Quantcast
WoWInterface - View Single Post - upvalue functions and default key values of an array
View Single Post
04-06-20, 11:22 AM   #4
gmarco
A Frostmaul Preserver
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 290
I think in this way it could be fine to write and it seems to works to

Lua Code:
  1. if event == "PLAYER_LOGIN" then
  2.     local GMEXP_DEFAULTS = { LONGNRFMT = false, SCALE = 1, LIST = true, MAXLIST = 12 }
  3.     for k in pairs(GMEXP_DEFAULTS) do
  4.         GMEXP_CFG[k] = GMEXP_CFG[k] or GMEXP_DEFAULTS[k]
  5.     end
  6. end
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote