Page 4 of 4

Re: How to handle widget selection

Posted: 02 Oct 2014, 19:16
by Silentwings
Funkencool's widget selector in BAR, what's the deal with reusing that code, are we allowed to do that, and would it be even possible without chili?
Respectively, yes (eventually) and (basically) no. The main menu code of BAR is GPLv2 (I am also an author on it) but for obvious reasons we don't want such code recognizably used elsewhere until some time after BAR has been released. The chili example widget selector is a more suitable base on which to start building your own stuff - it is much simpler code and iirc is standalone.
And about chili: is it a all or nothing thing: can you implement some parts of chili, say for main menu, but not all other stuff?
The chili API is all or nothing, although it is just lua and can be modified. Once you have that, you can write chili UIs into as little or as much of your existing stuff as you wish too.

Re: How to handle widget selection

Posted: 02 Oct 2014, 19:20
by gajop
Jools wrote:
smoth wrote: Image

You would do a chilibutton and have an image. Done.
This looks a lot more like something you would use a Chili.ComboBox for, although that doesn't support images (yet).

Re: How to handle widget selection

Posted: 02 Oct 2014, 19:31
by smoth
I think he just wants a button to show a menu selection like he pictured earlier in that post.

Re: How to handle widget selection

Posted: 02 Oct 2014, 19:36
by Jools
smoth wrote:I think he just wants a button to show a menu selection like he pictured earlier in that post.
Yes.

And engine menu is accessed by Sendcommands("quitmenu") I think, or something similar. You tell me that's not possible to bind to a button called exit?

Re: How to handle widget selection

Posted: 02 Oct 2014, 20:19
by gajop
Jools wrote:
smoth wrote:I think he just wants a button to show a menu selection like he pictured earlier in that post.
Yes.

And engine menu is accessed by Sendcommands("quitmenu") I think, or something similar. You tell me that's not possible to bind to a button called exit?
sure it is, e.g.

Code: Select all

local myButton = Chili.Button {
  x = 0, y = 0, width = "100%", height = "100%",
  caption = "Exit",
  OnClick = {
    function()
      SendCommands("quitmenu")
    end
  },
}
You can put arbitrary Lua code to be executed upon clicking the button.

Re: How to handle widget selection

Posted: 02 Oct 2014, 20:42
by smoth
Jools wrote:You tell me that's not possible to bind to a button called exit?
I just didn't know the command or if there was one. Assuming things tends to end badly in spring stuff