Good vs. Evil

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
46 working on the gui code for arena keeper again. Main problems that I'm trying to address:
  • Not being able to use anything more complex than a button.
  • The state of the GUI isn't remembered between update/draw calls, which gives the following limitations:
    • The idea of a focused widget is impossible.
    • Its impossible for me to change the cursor when you hover over an widget.
    • Every screen needs to remember to update their own widgets and remembers to redraw them
  • Rather coupled to my game, impossible to release as library.
So far, the code is not for those that fear generics, but then again, so is most rust code

Code:
pub fn add_widget<R, W, Res>(&mut self, widget: R, layer_id: u64) -> Result<Response<Res>, ()>
where
     R: RawWidget<Res, W>,
     W: Widget + 'a,
     Res: Sized,
{
//code here
}
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
46 seems like my new gui system is now able to do anything I wanted it to do. I now just need to implement some widgets for it.

But first, time for some cleanup and to "extract" it from my game, so it can become its own little library.

edit: I also need a name, suggestions are welcome
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
48 right now it has "mergui" as a temporary name. Its a mashup of mercury and gui and chosen because to my knowledge mercury is another word for quicksilver. quicksilver being important as that is the engine that I use and thus what the library will be made to work with.

I'm not totally sold on that name though, as I don't expect many people to get the name unless they get it explained.

Other possible names:
quick gui -> sounds too generic
silver gui -> sounds better but rather bland
quicksilver gui -> just...way too long and also makes it seems like it is an official library
 
  • Like
Reactions: GamerwithnoGame