solar-system
solar-system copied to clipboard
People Management Pane
My idea what to have a people management pane where you can assign your workers to different jobs to generate certain resources faster than others. I started work on this, but for some reason cannot get the ButtonWidget to work. Even the hover feature doesn't work. Does someone want to take a look at this and tell me what I'm doing wrong? The code is in my fork.
https://github.com/aes421/solar-system
@Zac-Garby you may be able to help since you did the launch button, I assume
I had a look at your code but couldn't find anything about the button widget. The way you use them (as far as I can remember) is initialise them like I did in the ShipDesigner, and set callback
(I believe it's called) to a lambda function which is called when it's clicked.
That's what I did, and nothing fails. However, something is wrong with it because none of the functions get called like they do on your launch button. Not even the hover effect works.
I'm trying to see what's the problem, but I can't find anything. Weird
EDIT: Even more strangely, perhaps: If I add a std::cout
to ButtonWidget::update
, it only prints anything when I'm on the Ship Designer sidebar - not the PlanetInspector.
EDIT: Okay, I feel like an idiot. The PlanetInspector sidebar never actually called WidgetList::update
..
The fix is as simple as adding widgets.update(dt)
somewhere in PlanetInspector::update