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

Function GUI_FactoryWindow_DrawCaption

src/gui/gui.c:3581–3612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3579}
3580
3581void 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
3614void GUI_FactoryWindow_UpdateDetails(const FactoryWindowItem *item)
3615{

Callers 4

GUI_Purchase_ShowInvoiceFunction · 0.85
GUI_Purchase_Plus_ClickFunction · 0.85
GUI_Purchase_Minus_ClickFunction · 0.85

Calls 9

GFX_Screen_SetActiveFunction · 0.85
GUI_DrawFilledRectangleFunction · 0.85
GUI_DrawText_WrapperFunction · 0.85
String_Get_ByIndexFunction · 0.85
Font_GetStringWidthFunction · 0.85
GUI_Mouse_Hide_SafeFunction · 0.85
GFX_Screen_Copy2Function · 0.85
GUI_Mouse_Show_SafeFunction · 0.85

Tested by

no test coverage detected