View Single Post
12-11-16, 11:50 AM   #3
Tosaido
A Fallenroot Satyr
 
Tosaido's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2015
Posts: 23
Lua Code:
  1. --[[
  2.  
  3. If you would like to slip the whole table called ["Damage_Taken"](remove the space) into Stylemeter.datamodules then you can just use
  4.  
  5. --]]
  6.  
  7. Stylemeter.datamodules.Damage_Taken = dt.Damage_Taken
  8.  
  9. --[[
  10.  
  11. or if the name of the table is dynamic/unknown then try this
  12.  
  13. --]]
  14.  
  15. for TableName, TableValue in pairs(dt) do
  16.     Stylemeter.datamodules[TableName] = TableValue
  17. end
  18.  
  19. --[[
  20.  
  21. or if you want to only copy the values within the table ["strings"] then try
  22.  
  23. NOTE: This is provided that a table with these names already exists
  24.  
  25. --]]
  26.  
  27. for StringName, StringValue in pairs(dt.Damage_Taken.strings) do
  28.     Stylemeter.datamodules.Damage_Taken.strings[StringName] = StringValue
  29. end
  30.  
  31. --[[
  32.  
  33. or if you want to only copy the values within the table ["strings"] and the name is dynamic/unknown then try
  34.  
  35. NOTE: This is provided that a table with these names already exists
  36.  
  37. --]]
  38.  
  39. for TableName, TableValue in pairs(dt) do
  40.  
  41.     for StringName, StringValue in pairs(TableValue.strings) do
  42.         Stylemeter.datamodules[TableName].strings[StringName] = StringValue
  43.     end
  44. end

Last edited by Tosaido : 12-11-16 at 11:56 AM.
  Reply With Quote