|
11-15-2011, 02:28 PM
|
|
The Indomitable
|
|
Join Date: May 2011
Posts: 13
|
|
right, so i need to set each datastring of quickslot(n)savedatax to a table with data and type
(where n = quickslot's number)
e.g.
Code:
shortcut(n) = quickslot(n):GetShortcut()
local type(n) = shortcut(n):GetType(),
local data(n) = shortcut(n):GetData()
quickslot1SavData = type,data,
-- And then copy for the other shortcuts...
}
local savedatax ={
quickslot(n)SavData = { Data = data(n),
Type = type(n),
}
...
}
and for loading:
Code:
savedatax = Turbine.etc.loading(Blardyblar)
local sc(n)=Turbine.UI.Lotro.Shortcut();
sc(n):SetType(savedatax.quickslot(n)SavData.Type);
sc(n):SetData((savedatax.quickslot(n)SavData.Data);
quickslot(n):SetShortcut(sc(n));
God that's a bit confusing! lets try it shall we...
SRY 4 FORMATTING
__________________
We create that what only we love most, But what truly creates us is what(who) loves us the most. - ME, i'm philosopher nao
Where's Chuck Norris' plugin?
|
11-15-2011, 02:55 PM
|
|
The Indomitable
|
|
Join Date: May 2011
Posts: 13
|
|
ok it's not working!
i can get the type value of 0.000000 but no data, i've tried items, skills and alias'... here's the code:
Code:
Save = Turbine.UI.Button();
Save:SetParent( window );
Save:SetPosition( 210, 34 );
Save:SetSize( 78, 15 );
Save:SetBackColor( Turbine.UI.Color( 0.0, 0.05, 1.0 ) );
Save:SetText( ""..Lang[1][21] ); --for lang files
Save:SetTextAlignment( Turbine.UI.ContentAlignment.MiddleCenter );
Save:SetForeColor( Turbine.UI.Color( 0.0, 0.0, 0.0 ) );
local savedatax ={
quickslot1SavData = { Data = "",
Type = "",
}
}
shortcut1 = quickslot1:GetShortcut();
local type1 = shortcut1:GetType();
local data1 = shortcut1:GetData();
Save.Click = function( sender , args )
savedatax.quickslot1SavData.Data = data1;
savedatax.quickslot1SavData.Type = type1;
Turbine.Shell.WriteLine("Pre Save");
Turbine.PluginData.Save(Turbine.DataScope.Character, "KmabcSaveData", savedatax);
Turbine.Shell.WriteLine("Post Save");
end
__________________
We create that what only we love most, But what truly creates us is what(who) loves us the most. - ME, i'm philosopher nao
Where's Chuck Norris' plugin?
|
11-16-2011, 01:04 AM
|
The Undying
|
|
Join Date: Apr 2011
Posts: 52
|
|
You seem to be building your data for saving where you initialize the UI. At that point I imagine your quickslot is empty.
|
11-16-2011, 02:10 AM
|
|
The Indomitable
|
|
Join Date: May 2011
Posts: 13
|
|
Quote:
Originally Posted by Equendil
You seem to be building your data for saving where you initialize the UI. At that point I imagine your quickslot is empty.
|
so... how do i sort this? I've never done this before and so have no clue what i'm doing really.
__________________
We create that what only we love most, But what truly creates us is what(who) loves us the most. - ME, i'm philosopher nao
Where's Chuck Norris' plugin?
|
11-16-2011, 02:20 AM
|
The Undying
|
|
Join Date: Apr 2011
Posts: 52
|
|
Quote:
Originally Posted by Queekusme
so... how do i sort this? I've never done this before and so have no clue what i'm doing really.
|
Move that stuff:
Code:
shortcut1 = quickslot1:GetShortcut();
local type1 = shortcut1:GetType();
local data1 = shortcut1:GetData();
to where you save the data.
|
11-16-2011, 01:40 PM
|
|
The Indomitable
|
|
Join Date: May 2011
Posts: 13
|
|
so in savedatax, i'll try it now!
__________________
We create that what only we love most, But what truly creates us is what(who) loves us the most. - ME, i'm philosopher nao
Where's Chuck Norris' plugin?
|
11-16-2011, 02:04 PM
|
|
The Indomitable
|
|
Join Date: May 2011
Posts: 13
|
|
still not getting the data,
Code:
Save = Turbine.UI.Button();
Save:SetParent( window );
Save:SetPosition( 210, 34 );
Save:SetSize( 78, 15 );
Save:SetBackColor( Turbine.UI.Color( 0.0, 0.05, 1.0 ) );
Save:SetText( ""..Lang[1][21] );
Save:SetTextAlignment( Turbine.UI.ContentAlignment.MiddleCenter );
Save:SetForeColor( Turbine.UI.Color( 0.0, 0.0, 0.0 ) );
shortcut1 = quickslot1:GetShortcut();
local savedatax ={
quickslot1SavData = { Data = shortcut1:GetType(),
Type = shortcut1:GetData(),
}
}
quickslot1.ShortcutChanged = function( sender , args ) -- I changed this to save me time whilst clicking the button, Should be Save.Click...
savedatax.quickslot1SavData.Data = shortcut1:GetData();
savedatax.quickslot1SavData.Type = shortcut1:GetType();
Turbine.Shell.WriteLine("Pre Save");
Turbine.PluginData.Save(Turbine.DataScope.Character, "KmabcSaveData", savedatax);
Turbine.Shell.WriteLine("Post Save");
end
could people copy this into their posts when they reply so i can see exactly what you are referring to, as it would really help me,
thanks
PS, when i change the line:
shortcut1 = quickslot1:GetShortcut();
to
shortcut1 = quickslotlyrical:GetShortcut();
it gets the value for the link, but not on any of the quickslots with items
__________________
We create that what only we love most, But what truly creates us is what(who) loves us the most. - ME, i'm philosopher nao
Where's Chuck Norris' plugin?
Last edited by Queekusme : 11-16-2011 at 02:06 PM.
|
11-17-2011, 01:15 PM
|
The Undying
|
|
Join Date: Apr 2011
Posts: 52
|
|
If your quickslot has changed, you must reacquire the shortcut. Move "shortcut1 = quickslot1:GetShortcut();" to when you save things.
There is no magic performed by the lua runtime, if you get components/data before shortcuts are set, you'll get empty shortcuts.
Code:
Save = Turbine.UI.Button();
Save:SetParent( window );
Save:SetPosition( 210, 34 );
Save:SetSize( 78, 15 );
Save:SetBackColor( Turbine.UI.Color( 0.0, 0.05, 1.0 ) );
Save:SetText( ""..Lang[1][21] );
Save:SetTextAlignment( Turbine.UI.ContentAlignment.MiddleCenter );
Save:SetForeColor( Turbine.UI.Color( 0.0, 0.0, 0.0 ) );
local savedatax ={
quickslot1SavData = { Data = shortcut1:GetType(),
Type = shortcut1:GetData(),
}
}
quickslot1.ShortcutChanged = function( sender , args ) -- I changed this to save me time whilst clicking the button, Should be Save.Click...
shortcut1 = quickslot1:GetShortcut();
savedatax.quickslot1SavData.Data = shortcut1:GetData();
savedatax.quickslot1SavData.Type = shortcut1:GetType();
Turbine.Shell.WriteLine("Pre Save");
Turbine.PluginData.Save(Turbine.DataScope.Character, "KmabcSaveData", savedatax);
Turbine.Shell.WriteLine("Post Save");
end
Last edited by Equendil : 11-17-2011 at 01:19 PM.
|
11-18-2011, 02:04 AM
|
|
The Indomitable
|
|
Join Date: May 2011
Posts: 13
|
|
IT'S WORKING
For anyone else's reference:
Code:
Save = Turbine.UI.Button(); -- Not used anymore but will keep in
Save:SetParent( window );
Save:SetPosition( 210, 34 );
Save:SetSize( 78, 15 );
Save:SetBackColor( Turbine.UI.Color( 0.0, 0.05, 1.0 ) );
Save:SetText( ""..Lang[1][21] );
Save:SetTextAlignment( Turbine.UI.ContentAlignment.MiddleCenter );
Save:SetForeColor( Turbine.UI.Color( 0.0, 0.0, 0.0 ) );
shortcut = quickslot1:GetShortcut();
local savedatax ={
quickslot1SavData = { Data = shortcut:GetType(),
Type = shortcut:GetData(),
}
}
quickslot1.ShortcutChanged = function( sender , args )
shortcut1 = quickslot1:GetShortcut();
savedatax.quickslot1SavData.Data = shortcut1:GetData();
savedatax.quickslot1SavData.Type = shortcut1:GetType();
Turbine.Shell.WriteLine("Pre Save");
Turbine.PluginData.Save(Turbine.DataScope.Character, "KmabcSaveData", savedatax);
Turbine.Shell.WriteLine("Post Save");
end
__________________
We create that what only we love most, But what truly creates us is what(who) loves us the most. - ME, i'm philosopher nao
Where's Chuck Norris' plugin?
Last edited by Queekusme : 11-18-2011 at 02:13 AM.
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:07 AM.
|
|