Variables LAM
Hi, I've been trying for a few days to make a selection in LAM (type = "dropdown",) work...
In game I get to see the dropdown. But even if I put data there is no effect (I was trying it with a message in the game chat "d(" but it never worked) My idea is to show information about some sets. Since I'm asking around here, and I know many of you are professionals in LUA, I'm going to ask what I would really like to achieve.. I have a "dropdown" in LAM2 (visible, but not functional), I would like for example when selecting Dark Convergence to activate some variables corresponding to that SET. LAM2 code: Code:
[4] = { My main LUA file: Code:
function addonname.SetData() That's all, I don't speak English (this post has been translated), regards! |
The value has to be recognized somewhere and you can't reuse it. Then once Lam sets the value, then change the global set variable you want. The setFunc for Lam can call a function.
What language do you speak? Code:
local function SetData() |
Quote:
I have some of them at the top of the main file. The addon, as it is, works... but what has been said, I can't make the change from one set to another through LAM2. Regards! Code:
-- Varaiables |
Quote:
(function expected instead of nil stack traceback) And I speak Spanish, thank you! |
Quote:
Programando es muy sencillo, "Cuando se realiza un condición, haga un acción." Eso es todo. |
Quote:
Que puse es codigo falso. Sólo muestra la idea. No es completo y no va funcionar asi. Por ejemplo "addonname.Sets" no sirve si no tiene asi en su modificacion. |
Code:
-- Varaiables Si solo tiene nada mas un selección por el menu, necesita cambiar 4 a 1. Code:
[4] = { -- Este no puede "4" si no es el cuarto parte del menu Incluyendo todo lo que necesitas para LAM:RegisterAddonPanel(addonname.NAME, panelData) y LAM:RegisterOptionControls(addonname.NAME, optionsData) |
Esta extensión es tu obra, o estas modificando un extensión que ya existe?
|
The setFunc of your LAM2 dropdown control is there to update your SavedVariables e.g. with the chosen set name from the choices table.
Hint: Also provide a choicesValues table with numbers instead of set names Strings! That way you can use the unique setId numbers instead of having to be carefull with translated setnames! choices = {"setname1", "setname2"}, choicesValues = {1, 2}, getFunc = function() return yourSavedVariables.chosenSetId end, setFunc = function(value) -- Store value in your SavedVariables yourSavedVariables.chosenSetId = value --Update any visual information based on the chosen value (set's ID) updateVisualSetData(value) end, As you choose an entry from the dropdown, e.g. setname2, the value 2 will be passed to the parameter "value" of the setFunc. |
All times are GMT -6. The time now is 05:41 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI