So I've had trouble finding a solution to this on my own.
The idea is to be able to support "plugins" to my addon.
Disregard the unfinished state, as it is primary a learning project for myself.
As seen i have my table named Stylemeter.datamodules
here.
Now i want to be able to write let's say a Damage Taken module which may look like something like this:
Code:
dt = {
["Damage Taken"] = {
["activated"] = true,
["strings"] = {
["SWING_DAMAGE"] = {
"arg12", --damagetaken swing
},
["RANGE_DAMAGE"] = {
"arg15", --damagetaken range
},
["SPELL_DAMAGE"] = {
"arg15", --damagetaken spell
},
["ENVIRONMENTAL_DAMAGE"] = {
"arg13", --damagetaken environmental
},
},
},
}
how can i copy the contents of dt into StyleMeter.datamodules?
I've come across deepcopy functions in my research, but all the do seems to make a direct copy of the table, i want to actually insert these keys and values to an existing one.
Or is my approach here completely in the wrong direction?