lotrointerface.com
Search Downloads


Go Back   LoTROInterface > LotRO > Developer Discussions > Lua Programming Help (L)

Reply
Thread Tools Display Modes
  #1  
Unread 12-31-2021, 12:57 PM
goldbishop goldbishop is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Nov 2010
Posts: 30
PluginData Load problem

So I have this little code that doesnt seem to populate, ever:
Code:
data = Turbine.PluginData.Load( Turbine.DataScope.Account, "LocationLog_Data" );
I initially had this in a Class file, where it will be closest to need.

As I did some searching and information gathering, I bubbled up to the Main file to no avail; at which point, I even bubbled it up the INI file and same result.

Activities I have tried
  • I have used a Callback method
  • I have used it locally (part of the Window Class) and globally (part of Main and INI)

even with a 30 secs wait, I have not seen a change in the TreeView I am trying to populate.

Below is the code that leverages the "theoretical" loaded data.
Code:
function LocationLogWindow:InitializeData()
	LoadDataIntoTreeView(data);
	
	Turbine.Shell.WriteLine("@data Count: " .. #data );
end 

function LoadDataIntoTreeView(dat)
	Turbine.Shell.WriteLine("Data File Count: " .. #dat );
	
	if ( dat ~= nil ) then
		-- data = dat;
		
		Turbine.Shell.WriteLine("LoadDataIntoTreeView @data Count: " .. #dat );
		rootNode = tvData:GetNodes();
		
		-- @k1 - Table Key; @v1 Table Value
		for k1, v1 in pairs (dat) do
			-- Turbine.Shell.WriteLine( "Node: " .. k1 );
			local node = tvNode();
			rootNode:Add( node );
			
			local subNodes = node:GetChildNodes();
			
			for k2, v2 in pairs (v1) do
				-- Turbine.Shell.WriteLine( "Region: " .. k2 );
				local node = tvNode();
				subNodes:Add( node );
				
				local subNodes = node:GetChildNodes();
				
				for k3, v3 in pairs (v2) do
					-- Turbine.Shell.WriteLine( "Coord: " .. k3 );
					local node = tvNode();
					subNodes:Add( node );					
				end 
			end 
		end 
	else 
		Turbine.Shell.WriteLine("@data not available");
	end 
end
Shell WriteLine result on Loading of the Plugin:
Code:
Data File Count: 0
LoadDataIntoTreeView @data Count: 0
@data Count: 0
Reply With Quote
  #2  
Unread 12-31-2021, 01:03 PM
goldbishop goldbishop is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Nov 2010
Posts: 30
Ok....typical me....2 mins after posting it, I solve my own problem on rendering.

I am curious why the LUA count mechanism isn't working.
Code:
#table
Reply With Quote
  #3  
Unread 01-01-2022, 06:36 AM
Hyoss's Avatar
Hyoss Hyoss is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Jan 2011
Posts: 150
Quote:
Originally Posted by goldbishop
Ok....typical me....2 mins after posting it, I solve my own problem on rendering.

I am curious why the LUA count mechanism isn't working.
Code:
#table
The Lua # operator only counts entries with integer keys: http://www.lua.org/manual/5.1/manual.html#2.5.5
Reply With Quote
Reply


Thread Tools
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding new values to existing plugindata Lumbra Lua Programming Help (L) 0 01-25-2013 07:43 PM
queued PluginData.Save calls execute on unload K1R4D3L General Authoring Discussion (L) 8 05-16-2012 11:14 AM
PluginData file naming also parent plugin source Cordeval General Authoring Discussion (L) 3 02-18-2012 02:50 PM
Is there a "max size" issue with PluginData? magill General Authoring Discussion (L) 0 04-16-2011 10:35 PM
cosmos cant get it to load ickypoo Interface Help (L) 2 04-11-2011 11:44 AM


All times are GMT -5. The time now is 05:39 AM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui