Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Koneki » LDT - Execution Environment. Help!
LDT - Execution Environment. Help! [message #1416934] Sun, 07 July 2013 08:54 Go to next message
simon birkedal is currently offline simon birkedalFriend
Messages: 12
Registered: July 2013
Junior Member
Greetings,

I'm trying to develop my own Execution Environment for World of Warcraft(in LDT), so far it works well. Now i'm at the Widget Reference, which requires the following:

myVariable:WidgetAPI, an example would be:

local btn = CreateFrame("Button", "MyButton", UIParent)
btn:SetSize(10, 10)
btn:SetPoint("TOPLEFT", UIParent, "TOPRIGHT")

is there a way to make the execution environment register the widget api according to the variable given in the line before to register which FrameType i selected here: CreateFrame("FrameType", "Name", Parent)

So if the "FrameType" would be something like this instead:

local frame = CreateFrame("Frame", "MyFrame", UIParent)
frame:SetClampedToScreen(true)
frame:EnableMouse(true)
frame:RegisterForDrag(true)

So code assist works as soon as i type, myVariable:


Sorry for my English.. Thank you in advance!
Re: LDT - Execution Environment. Help! [message #1416935 is a reply to message #1416934] Mon, 08 July 2013 09:26 Go to previous messageGo to next message
Simon Bernard is currently offline Simon BernardFriend
Messages: 345
Registered: July 2009
Senior Member
Hi,
Currently there are no way to define a function which returns different types according a parameter value.
If we implements this feature, I don't really know how could be the syntax to do that in documentation language :).

For now, the only thing you could do is to create all the type users needed in your execution environment.
And users of your execution environment should use http://wiki.eclipse.org/Koneki/LDT/User_Area/New_Noteworthies/New_Noteworthy_1.0#Explicit_Variable_Description_.26_Typing to type their variables :


local frame = CreateFrame("Frame", "BagBuddy", UIParent) -- yourmodule#frame
frame:SetSize(425, 425)
frame:SetPoint("CENTER", UIParent, "CENTER")

local btn = CreateFrame("Button", "MyButton", UIParent) -- yourmodule#button
btn:SetSize(10, 10)
btn:SetPoint("TOPLEFT", UIParent, "TOPRIGHT")


For the texture sample not sure I understand the point :).

Simon
Re: LDT - Execution Environment. Help! [message #1416936 is a reply to message #1416935] Mon, 08 July 2013 09:50 Go to previous messageGo to next message
simon birkedal is currently offline simon birkedalFriend
Messages: 12
Registered: July 2013
Junior Member
Thanks for the answer! :)

Is there maybe a way to add some sort of Regular Expression to it? Because what's really important for what i try to accomplish is that myVariable can be anything in the following:

myVariable:SetOwner

so no matter what i type in myVariable, as soon as i hit :, SetOwner, etc shows in the drop down.

If you have a look at the WoW Reference section for Widgets here: www.wowprogramming.com/docs/widgets

The Alpha, Animation, etc are the standard global values used by Blizzard, but in order to make a succesful AddOn for World of Warcraft - you'll have to define your own.

So my real question is:

Would it be possible to make Code Assist, simply by pressing the :, because you can actually also define a widget which has no name.
Re: LDT - Execution Environment. Help! [message #1416937 is a reply to message #1416936] Mon, 08 July 2013 13:54 Go to previous messageGo to next message
Simon Bernard is currently offline Simon BernardFriend
Messages: 345
Registered: July 2009
Senior Member
Sorry, but I'm not sure to understand what you want to do :/.

I take a look to the WOW API and I see two problem :
1)the http://www.wowwiki.com/UIOBJECT_Frame#Class_Hierarchy
2)the constructors which is able to create objects of different types.


For the 1) the LDT language does not support inheritance so the documentation must be duplicate for each type (e.g. you must define SetSize for Button, Cooldown and all the child class of Region ... :/)
For the 2) there is the workaround I gave you before. (the explicit typing of local var)

This is clearly 2 limitations of the documentation language, we need to think about a way to resolved this problems. Waiting I hope the workarounds could help you.
Re: LDT - Execution Environment. Help! [message #1416938 is a reply to message #1416937] Mon, 08 July 2013 14:18 Go to previous messageGo to next message
simon birkedal is currently offline simon birkedalFriend
Messages: 12
Registered: July 2013
Junior Member
www.wowprogramming.com/docs/widgets

Now go to e.g. Cooldown and click it(or click here: www.wowprogramming.com/docs/widgets/Cooldown

Inside the cooldown, you'll se that it has 4 defined methods, same goes for each widget and is the only thing you'd actually have to worry about.

The EditBox:
www.wowprogramming.com/docs/widgets/EditBox

This one has 48 defined methods. However some of the other widgets also has some of the functions defined - e.g. GetIndentedWordWrap() can be used by:

ScrollingMessageFrame
EditBox
SimpleHTML
FontString
MessageFrame
and others.

BTW WoWWiki is abit outdated - you should either check WoWPedia.org or WoWProgramming.com (i prefer WoWProgramming because its system is easier to understand IMO)



Not sure if anything i just said has anything to do with what you meant.. But my english is not very good - so please don't find me annoying or anything, i'm not doing this to sound stupid or anything.. really hope you get what i'm trying to achieve. PS LDT Is awesome!

Regards,
fRodzet
Re: LDT - Execution Environment. Help! [message #1416939 is a reply to message #1416938] Tue, 09 July 2013 09:16 Go to previous messageGo to next message
Simon Bernard is currently offline Simon BernardFriend
Messages: 345
Registered: July 2009
Senior Member
Are you ok with the concept of "type" in the documentation language ?

There are a sample http://wiki.eclipse.org/Koneki/LDT/User_Area/Documentation_Language#Sample_mixing_code_and_comments.
Re: LDT - Execution Environment. Help! [message #1416941 is a reply to message #1416939] Tue, 09 July 2013 13:14 Go to previous messageGo to next message
simon birkedal is currently offline simon birkedalFriend
Messages: 12
Registered: July 2013
Junior Member
Not exactly sure how Type works tbh, i think the documentation is abit meh - for those who's new at this or programming in general.

But i know that if you add a field to the global.lua file which looks something like this:

@field [parent = #global] GameTooltip#GameTooltip GameTooltip

then creating a file named GameTooltip.lua and adding the following content to it:

@module GameTooltip

then you can do:

@function [parent=#GameTooltip] SetOwner
@param self

That would work as supposed to, but only if i use the word GameTooltip and put in a :, SetOwner drops down in the list. And ofcourse it recognizes if i say: local tooltip = GameTooltip, then tooltip and :, would dropdown SetOwner aswell.


But how the metafunction type works - i have no idea, i took a look at the standard io in the 5.1 execution environment, and tried to figure out why type was so important as the documentation says - but i couldn't figure it out.
Re: LDT - Execution Environment. Help! [message #1416946 is a reply to message #1416941] Tue, 09 July 2013 16:59 Go to previous messageGo to next message
simon birkedal is currently offline simon birkedalFriend
Messages: 12
Registered: July 2013
Junior Member
I'd also like to know one thing:

Is it a must have to make a docs folder with an index html in it? In order for a Execution Environment to work?
Re: LDT - Execution Environment. Help! [message #1416947 is a reply to message #1416946] Wed, 10 July 2013 09:14 Go to previous messageGo to next message
Simon Bernard is currently offline Simon BernardFriend
Messages: 345
Registered: July 2009
Senior Member
The 'type' concept is the key of your problem, you must understand it.
The documentation explain it and they are also a sample as I said before.

Did you try the sample by creating a geometry.lua file with the code of the 2nd sample and in another file, did something like that :

-- load the geometry module in the variable g
local g = require 'geometry'

-- use the newRectangle function of gemotry to create a new rectangle
local r = g.newRectangle(10,10,10,10)

-- move the rectangle
r:move(2,2)

You will have autocompletion on g and r variables.


You said the documentation is abit meh ... you could propose enhancement...
This documentation aim not to learn the basic in programming and even the basic in lua. Those are prerequisites to understand it.
Re: LDT - Execution Environment. Help! [message #1416948 is a reply to message #1416947] Wed, 10 July 2013 09:49 Go to previous message
simon birkedal is currently offline simon birkedalFriend
Messages: 12
Registered: July 2013
Junior Member
Ty very much - i'll give it a go :)

I will keep ya updated on how it goes :) But according to your description of type its starting to make sense :) Is it possible to make it : instead of the letters A-Z? :) Also do you know if you can somehow add regular expressions to variables - generally in lua, can't seem to find it.

Then i could do something like: local %a+: = require 'geometry'
Previous Topic:Problem Starting Koneki with DM-Server 3.6
Next Topic:Variable Reference Issue
Goto Forum:
  


Current Time: Thu Mar 28 08:10:19 GMT 2024

Powered by FUDForum. Page generated in 0.02246 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top