How to handle widget selection - Page 4

How to handle widget selection

Hearken back to the days of yore and enjoy the first major Spring module!

Moderators: Moderators, Content Developer

User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: How to handle widget selection

Post 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.
Last edited by Silentwings on 02 Oct 2014, 19:21, edited 1 time in total.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: How to handle widget selection

Post 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).
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: How to handle widget selection

Post by smoth »

I think he just wants a button to show a menu selection like he pictured earlier in that post.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: How to handle widget selection

Post 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?
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: How to handle widget selection

Post 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.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: How to handle widget selection

Post 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
Post Reply

Return to “XTA”