Thread: Real basic help
View Single Post
  #2  
Unread 12-29-2010, 05:46 PM
SanDBoX's Avatar
SanDBoX SanDBoX is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Location: Idaho
Posts: 40
Lua is an extreamly flexable language which is easy to learn (hurts the head if you are a c-type programmer already) but you can create a window with only a handful of lines, the hard part (for me atleast) was figuring out how to get lotro to "see" the plugin, for that you can create your own directory with the other plugins and "steal" the .plugin file then rename and modify it (with a text editor or IDE if you have one) then just a matter of making another directory (with your plugin's name). after that you create two files (or three if you plan to have an single place to put your imports) your "main.lua" and your "window.lua" files, in your window file you put in basic code like this -
Code:
import "Turbine"
import "Turbine.UI"
import "Turbine.UI.Lotro"

Window = class( Turbine.UI.Window )

function Window:Constructor()
    Turbine.UI.Lotro.Window.Constructor( self )
    self:SetVisible( true )
    
    --I Setup Window Data
    self:SetSize( 200, 150 )
    self:SetBackColor( Turbine.UI.Color() )
    self:SetPosition( 25, 150 )
    self:SetText( "Hello World!" )
end
that will give you a very basic small window, then in your main.lua file put -
Code:
import <your directory name>.Window

window = Window()
at that point it would just be a matter of digging through the API documentation to get whatever elements/widgets you want to use. there are a lot of examples you can use since you can just open up any of the existing plugins and read them! (I have done that to figure a lot of things out like saving/loading data.)

hope that is a good enough primmer to get you going!
Reply With Quote