Home » Archived » Lua Development Tools » LDT - Execution Environment. Help!(variable detection.)
LDT - Execution Environment. Help! [message #1067180] |
Sun, 07 July 2013 04:51  |
Eclipse User |
|
|
|
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!
EDIT:
An example:
local frame = CreateFrame("Frame", "BagBuddy", UIParent)
frame:SetSize(425, 425) -- Code Assistant dependent on the FrameType
frame:SetPoint("CENTER", UIParent, "CENTER") -- Same goes here
texture = frame:CreateTexture("Portrait", "BACKGROUND")
texture:SetPoint("TOPLEFT", frame, "TOPRIGHT") -- Code Assistant if above field is myVariable = frame:CreateTexture(...)
texture:SetSize(60, 60) -- Same goes here
texture:SetTexture("Interface\\ICONS\\INV_Misc_EngGizmos_17") -- Same goes here
Or simply by Code Assist everything that has a colon.
[Updated on: Sun, 07 July 2013 05:33] by Moderator
|
|
|
Re: LDT - Execution Environment. Help! [message #1067309 is a reply to message #1067180] |
Mon, 08 July 2013 05:26   |
Eclipse User |
|
|
|
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 types which could be userfull in your execution environment.
And users of your execution environment should use the explicit typing syntax 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
[Updated on: Mon, 08 July 2013 05:27] by Moderator
|
|
|
Re: LDT - Execution Environment. Help! [message #1067316 is a reply to message #1067309] |
Mon, 08 July 2013 05:50   |
Eclipse User |
|
|
|
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.
EDIT:
Quote:For the texture sample not sure I understand the point.
Was also a really bad example by me, sorry bout that.
Quote:local frame = CreateFrame("Frame", "BagBuddy", UIParent)
frame:SetSize(425, 425) -- Code Assistant dependent on the FrameType
frame:SetPoint("CENTER", UIParent, "CENTER") -- Same goes here
texture = frame:CreateTexture("Portrait", "BACKGROUND")
texture:SetPoint("TOPLEFT", frame, "TOPRIGHT") -- Code Assistant if above field is myVariable = frame:CreateTexture(...)
texture:SetSize(60, 60) -- Same goes here
texture:SetTexture("Interface\\ICONS\\INV_Misc_EngGizmos_17") -- Same goes here
In the first part i tell that the local variable "Frame" will create a frame using CreateFrame
now for the second part, i tell that texture is a child to the parent frame. Because i tell that texture is equal to frame:CreateTeture(parameter) i only have to type texture:someFunction(someParameter)..
[Updated on: Mon, 08 July 2013 09:37] by Moderator
|
|
| | | | | | | |
Goto Forum:
Current Time: Mon Apr 14 17:05:22 EDT 2025
Powered by FUDForum. Page generated in 0.03337 seconds
|