| 3579 | } |
| 3580 | |
| 3581 | void GUI_FactoryWindow_DrawCaption(const char *caption) |
| 3582 | { |
| 3583 | Screen oldScreenID; |
| 3584 | |
| 3585 | oldScreenID = GFX_Screen_SetActive(SCREEN_1); |
| 3586 | |
| 3587 | GUI_DrawFilledRectangle(128, 21, 310, 35, 116); |
| 3588 | |
| 3589 | if (caption != NULL && *caption != '\0') { |
| 3590 | GUI_DrawText_Wrapper(caption, 128, 23, 12, 0, 0x12); |
| 3591 | } else { |
| 3592 | FactoryWindowItem *item = GUI_FactoryWindow_GetItem(g_factoryWindowSelected); |
| 3593 | ObjectInfo *oi = item->objectInfo; |
| 3594 | uint16 width; |
| 3595 | |
| 3596 | GUI_DrawText_Wrapper(String_Get_ByIndex(oi->stringID_full), 128, 23, 12, 0, 0x12); |
| 3597 | |
| 3598 | width = Font_GetStringWidth(String_Get_ByIndex(STR_COST_999)); |
| 3599 | GUI_DrawText_Wrapper(String_Get_ByIndex(STR_COST_3D), 310 - width, 23, 12, 0, 0x12, item->credits); |
| 3600 | |
| 3601 | if (g_factoryWindowStarport) { |
| 3602 | width += Font_GetStringWidth(String_Get_ByIndex(STR_QTY_99)) + 2; |
| 3603 | GUI_DrawText_Wrapper(String_Get_ByIndex(STR_QTY_2D), 310 - width, 23, 12, 0, 0x12, item->amount); |
| 3604 | } |
| 3605 | } |
| 3606 | |
| 3607 | GUI_Mouse_Hide_Safe(); |
| 3608 | if (oldScreenID == SCREEN_0) GFX_Screen_Copy2(128, 21, 128, 21, 182, 14, SCREEN_1, oldScreenID, false); |
| 3609 | GUI_Mouse_Show_Safe(); |
| 3610 | |
| 3611 | GFX_Screen_SetActive(oldScreenID); |
| 3612 | } |
| 3613 | |
| 3614 | void GUI_FactoryWindow_UpdateDetails(const FactoryWindowItem *item) |
| 3615 | { |
no test coverage detected