MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / GUI_Production_BuildThis_Click

Function GUI_Production_BuildThis_Click

src/gui/widget_click.c:1380–1406  ·  view source on GitHub ↗

* Handles Click event for the "Build this" button in production window. * * @return True, always. */

Source from the content-addressed store, hash-verified

1378 * @return True, always.
1379 */
1380bool GUI_Production_BuildThis_Click(Widget *w)
1381{
1382 if (g_factoryWindowStarport) {
1383 if (g_factoryWindowOrdered == 0) {
1384 GUI_Widget_MakeInvisible(w);
1385 GUI_Purchase_ShowInvoice();
1386 GUI_Widget_MakeVisible(w);
1387 } else {
1388 g_factoryWindowResult = FACTORY_BUY;
1389 }
1390 } else {
1391 FactoryWindowItem *item;
1392 ObjectInfo *oi;
1393
1394 item = GUI_FactoryWindow_GetItem(g_factoryWindowSelected);
1395 oi = item->objectInfo;
1396
1397 if (oi->available > 0) {
1398 item->amount = 1;
1399 g_factoryWindowResult = FACTORY_BUY;
1400 }
1401 }
1402
1403 GUI_Widget_MakeNormal(w, false);
1404
1405 return true;
1406}
1407
1408/**
1409 * Handles Click event for the "+" button in starport window.

Callers

nothing calls this directly

Calls 5

GUI_Widget_MakeInvisibleFunction · 0.85
GUI_Purchase_ShowInvoiceFunction · 0.85
GUI_Widget_MakeVisibleFunction · 0.85
GUI_Widget_MakeNormalFunction · 0.85

Tested by

no test coverage detected