|
12-01-2010, 08:28 PM
|
The Undying
|
|
Join Date: Nov 2010
Posts: 30
|
|
Issues with loading plugin
Alright, i have done as much as i can to figure this out but have come up dry.
In game return:
Quote:
...gins\GoldbishopsPlugins\FrameworkReport\__init_ _.lua:1: Failed to import package "GoldbishopsPlugins.FrameworkReport.FrameworkRepor tWindow".
...\Plugins\GoldbishopsPlugins\FrameworkReport\Mai n.lua:2: Failed to import package "GoldbishopsPlugins.FrameworkReport".
Unable to load "frameworkreport".
|
Code Files
__init__.lua
Quote:
import "GoldbishopsPlugins.FrameworkReport.FrameworkRepor tWindow";
|
Main.lua
Quote:
import "Turbine";
import "GoldbishopsPlugins.FrameworkReport";
--Setup Framework Report Window
FrameworkReport = FrameworkReportWindow();
FrameworkReport:SetVisible( true );
--FrameworkReport Command
FrameworkReportCommand = Turbine.ShellCommand();
function FrameworkReportCommand:GetHelp()
local h = { query = "used to requery the framework",
help = "returns a list of acceptable commands",
show = "use to show Report Window",
hide = "use to hide Report Window",
toggle = "use to flip visibility of Report Window",
refresh = "use to refresh the Report Window" }
return h;
-- Turbine.Shell.WriteLine
-- for k, v in pairs(h) do
-- help = k .. ": " .. v .. "\n\n"
-- end
end
function FrameworkReportCommand:Execute( command, arguments )
if (arguments == "query") then
--TODO: Add re-querying
-- elseif ( arguments == "help" or arguments == "?" ) then
-- GetCommandHelp;
elseif ( arguments == "show" ) then
FrameworkReport:SetVisible( true );
elseif ( arguments == "hide" ) then
FrameworkReport:SetVisible( false );
elseif ( arguments == "toggle" ) then
FrameworkReport:SetVisible( not FrameworkReport .IsVisible() );
elseif ( arguments == "refresh" ) then
FrameworkReport:Refresh();
end
end
Turbine.Shell.AddCommand( "tob;frameworkreport", FrameworkReportCommand );
--Return the Commands available for the plugin
function GetCommandHelp()
end
|
|
12-01-2010, 08:31 PM
|
|
The Undying
|
|
Join Date: Sep 2010
Posts: 207
|
|
Whatever the problem is, it's not in Main, but in your ReportWindow class. When you get that kind of an error message it means basically...
It can't import the package (class) because there's something wrong with it - usually a typographical error as opposed to a logic error.
|
12-01-2010, 08:35 PM
|
The Undying
|
|
Join Date: Nov 2010
Posts: 30
|
|
Tried reviewing this file more than a few hours and even rebuilt it several time just in case.
FrameworkReportWindow.lua
Quote:
import "Turbine";
import "Turbine.UI";
import "Turbine.UI.Extensions";
import "Turbine.UI.Lotro";
FrameworkReportWindow = class( Turbine.UI.Extensions.SimpleWindow );
function FrameworkReportWindow:Constructor()
Turbine.UI.Extensions.Window.Constructor( self );
local edgePadding = 25;
self:SetSize( 400, 400 );
self:SetPosition( Turbine.UI.Display.GetWidth() - self:GetWidth() - edgePadding, Turbine.UI.Display.GetHeight() - self:GetHeight() - edgePadding * 1.5 );
self:SetBackColor( Turbine.UI.Color( .5, 0.0, 0.0, 1.0) );
self:SetText( "Framework Report Window" );
self:SetOpacity( 1.0 );
self:SetFadeSpeed( 1.0 );
self:MouseEnter = function( sender, args )
sender:SetOpacity( 1.0 );
end
self:MouseLeave = function( sender, args )
sender:SetOpacity( 0.0 );
end
self.listNamespace = Turbine.UI.ListBox();
self.listNamespace:SetParent( self );
self.listNamespace:SetPosition( 25, 5 );
self.listNamespace:SetSize( 100, 15 );
self.listNamespace:SetVisible( true );
self.listClass = Turbine.UI.ListBox();
self.listClass:SetParent( self );
self.listClass:SetPosition( 150, 5 );
self.listClass:SetSize( 100, 15 );
self.listClass:SetVisible( true );
self.scrollBar = Turbine.UI.Lotro.ScrollBar();
self.scrollBar:SetParent( self );
self.scrollBar:SetOrientation( Turbine.UI.Orientation.Vertical );
self.scrollBar:SetPosition( 375, 0 );
self.scrollBar:SetSize( 25, 400 );
self.scrollBar:SetVisible( true );
self.textBox = Turbine.UI.Lotro.TextBox();
self.textBox:SetParent( self );
self.textBox:SetMultiline( true );
self.textBox:SetReadOnly( true );
self.textBox:SetPosition( 25, 30 );
self.textBox:SetWidth( 350 );
self.textBox:SetVerticalScrollBar( self.scrollBar )
self.textBox:SetVisible( true );
self:Refresh();
end
function FrameworkReportWindow:Refresh()
self:PerformLayout();
end
function FrameworkReportWindow:PerformLayout()
self:Layout( { } );
end
function FrameworkReportWindow:Layout( args )
local width, height = self:GetSize();
end
|
Last edited by goldbishop : 12-01-2010 at 08:55 PM.
Reason: Left the Window section of the filename off.
|
12-01-2010, 08:59 PM
|
|
The Undying
|
|
Join Date: Apr 2007
Posts: 162
|
|
have you tried changing:
Turbine.UI.Extensions.Window.Constructor( self );
to
Turbine.UI.Extension.SimpleWindow.Constructor(self );
?
|
12-01-2010, 09:21 PM
|
|
The Undying
|
|
Join Date: Sep 2010
Posts: 207
|
|
Quote:
Originally Posted by goldbishop
Tried reviewing this file more than a few hours and even rebuilt it several time just in case.
FrameworkReportWindow.lua
|
Most of it looks alright, but the following has got me scratching my head (in yellow)
Code:
function FrameworkReportWindow:Refresh()
self:PerformLayout();
end
function FrameworkReportWindow:PerformLayout()
self:Layout( { } );
end
function FrameworkReportWindow:Layout( args )
local width, height = self:GetSize();
end
When you make functions inside a class, they're generally made like so:
Code:
function self:Refresh()
self:PerformLayout();
end
|
12-01-2010, 09:38 PM
|
The Undying
|
|
Join Date: Nov 2010
Posts: 30
|
|
Quote:
Originally Posted by D.H1cks
have you tried changing:
Turbine.UI.Extensions.Window.Constructor( self );
to
Turbine.UI.Extension.SimpleWindow.Constructor(self );
?
|
Yep....and even tried using the Core Window class and same result. Im sure im missing something but i just cant put my finger on it.
At first it was a semi-colon but still reported same error.
Problem so far seems to be the MouseEnter and MouseLeave functions being declared with a delta function inside the constructor. Pulled them out into the body of the file and worked just grand.
Side Note:
What is the name of the control that acts like a Drop-Down List box?
|
12-01-2010, 09:41 PM
|
The Undying
|
|
Join Date: Nov 2010
Posts: 30
|
|
Quote:
Originally Posted by Digital_Utopia
Most of it looks alright, but the following has got me scratching my head (in yellow)
Code:
function FrameworkReportWindow:Refresh()
self:PerformLayout();
end
function FrameworkReportWindow:PerformLayout()
self:Layout( { } );
end
function FrameworkReportWindow:Layout( args )
local width, height = self:GetSize();
end
When you make functions inside a class, they're generally made like so:
Code:
function self:Refresh()
self:PerformLayout();
end
|
Think of those as stationary templates....till i get to the point of actually implementation.
|
12-01-2010, 09:43 PM
|
|
The Undying
|
|
Join Date: Apr 2007
Posts: 162
|
|
Ah, try changing them to self.MouseEnter = function(sender,args) and self.MouseLeave = function(sender,args) ?
This is what I have in my plugin:
Code:
self.MouseEnter = function(sender, args)
self:SetBackColor(self.bgColor);
end
self.MouseLeave = function(sender, args)
self:SetBackColor(Turbine.UI.Color(0,0,0,0));
end
Last edited by D.H1cks : 12-01-2010 at 09:46 PM.
|
12-01-2010, 09:47 PM
|
The Undying
|
|
Join Date: Nov 2010
Posts: 30
|
|
when doing that signature do i need to have it all on one line or can i split it up across several lines as long as the end tag is there?
I borrowed the code from their Plugis templates provided by the packages. For some reason it didnt like them in my plugin. Thinking im missing some Import or something.
|
12-01-2010, 10:15 PM
|
|
The Undying
|
|
Join Date: Apr 2007
Posts: 162
|
|
OK, I have to go back a step here and ask. Is there really a space between the r and t in your __init__.lua file? As in
Code:
FrameworkReport.FrameworkRepor tWindow
|
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 05:50 PM.
|
|