FancyMenu [Fabric] [MOVED TO NEW PROJECT]

FancyMenu [Fabric] [MOVED TO NEW PROJECT]

16M Downloads

LUA scripting for advanced usage

Merith-TK opened this issue ยท 4 comments

commented

may I suggest adding a form of "scripting" in a soft-external sense?
Where a user can use a bit of lua code that runs for the specied UI
(pause_menu will only run pause_menu.lua for example)
And can interact with elements by using their ID?

that way we can have scripts that run without getting reset when layouts change

commented

But what would be needed for that to be actually useful? Wouldn't it be important to interact with the element's properties? Like size, position, visibility and all the stuff that exists only for specific element types.

That's a lot of work for it to be used by like 4 people in total later.

I also don't really see how this would be able to do stuff you can't do in FM already. Do you have some examples of what you had in mind exactly?

If it's just to store data: You can already do that by using variables. There are actions to set variable values and placeholders and loading requirements that get the stored value.

commented

Yeah I dont see this feature being implemented any time soon
Its main use would be for those who want to do some advanced stuff

One of my friends had the idea to add an "randomized" layout where it would randomly place the elements,

Its main purpose would be an more advanced way of doing actionscript, I tried to use action script and it... it is pain. it works... mostly, but it is pain. an simple

if  $$value == "tryme" then
  toggleLayout("new_layout")
end

takes an excessive amount of time for what it does.

Action-script also doesnt really allow for more "dynamic" alterations from what I have looked at, such as the idea my friend had.

commented

There are Ticker elements. You could use these to set a X or Y position variable. Best would be to use the Calculator and Random Number placeholders for that. The elements then would use the position variables via Advanced Positioning (right-click the element).

Actions have an easy to understand scripting "language" level, so everyone understands it. Like the "program a robot" games in school to show kids how programming works.

I am very sorry, but I don't think I will implement this.

commented

Fair enough, I like the idea of action script as it is but as someone coming from programming kubejs and computercraft scripts, far, far too many clicks,

The menus definitely could use slot of enhancement (perhaps make action script elements have a similar edit UI as a layout element?)

That being said, with your example of "program a robot" in schools, block based programming like that would probably not be a bad idea, with drag'n'drop aspect like scratch over the current,
Add If
Add Condition
Select Condition Type
Enter Conditions
Confirm
Close
Nesting of submenus that it currently is. For just a single if statement. Not including actions and other if/elses