* Handles Click event for the "Build this" button in production window. * * @return True, always. */
| 1378 | * @return True, always. |
| 1379 | */ |
| 1380 | bool 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. |
nothing calls this directly
no test coverage detected