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

Function GUI_FactoryWindow_UpdateDetails

src/gui/gui.c:3614–3632  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3612}
3613
3614void GUI_FactoryWindow_UpdateDetails(const FactoryWindowItem *item)
3615{
3616 int16 y;
3617 const ObjectInfo *oi = item->objectInfo;
3618 uint16 type = item->objectType;
3619
3620 /* check the available units and unit count limit */
3621 if (oi->available == -1) return;
3622
3623 y = 160;
3624 if (oi->available <= item->amount) y = 169;
3625 else if (g_starPortEnforceUnitLimit && g_table_unitInfo[type].movementType != MOVEMENT_WINGER && g_table_unitInfo[type].movementType != MOVEMENT_SLITHER) {
3626 House *h = g_playerHouse;
3627 if (h->unitCount >= h->unitCountMax) y = 178;
3628 }
3629 GUI_Mouse_Hide_Safe();
3630 GUI_Screen_Copy(16, y, 16, 99, 23, 9, SCREEN_1, SCREEN_ACTIVE);
3631 GUI_Mouse_Show_Safe();
3632}
3633
3634/**
3635 * Update the selection in the factory window.

Callers 3

GUI_Purchase_Plus_ClickFunction · 0.85
GUI_Purchase_Minus_ClickFunction · 0.85

Calls 3

GUI_Mouse_Hide_SafeFunction · 0.85
GUI_Screen_CopyFunction · 0.85
GUI_Mouse_Show_SafeFunction · 0.85

Tested by

no test coverage detected