Thread Tools Display Modes
Prev Previous Post   Next Post Next
12-11-16, 10:24 AM   #1
Lolzen
An Aku'mai Servant
 
Lolzen's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 36
Copy table contents to another table with exustung content

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?
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Copy table contents to another table with exustung content


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off