/* Actually display the menu text */ static void DrawPCMenu (BYTE beg_index, BYTE end_index, BYTE NewState, BYTE hilite, RECT *r) { #define PC_MENU_HEIGHT 8 BYTE pos; COUNT i; int num_items; FONT OldFont; TEXT t; UNICODE buf[256]; pos = beg_index + NewState; num_items = 1 + end_index - beg_index; r->corner.x -= 1; r->extent.width += 1; DrawFilledRectangle (r); if (num_items * PC_MENU_HEIGHT > r->extent.height) log_add (log_Error, "Warning, no room for all menu items!"); else r->corner.y += (r->extent.height - num_items * PC_MENU_HEIGHT) / 2; r->extent.height = num_items * PC_MENU_HEIGHT + 4; DrawPCMenuFrame (r); OldFont = SetContextFont (StarConFont); t.align = ALIGN_LEFT; t.baseline.x = r->corner.x + 2; t.baseline.y = r->corner.y + PC_MENU_HEIGHT -1; t.pStr = buf; t.CharCount = (COUNT)~0; r->corner.x++; r->extent.width -= 2; for (i = beg_index; i <= end_index; i++) { utf8StringCopy (buf, sizeof buf, (i == PM_FUEL) ? pm_fuel_str : (i == PM_CREW) ? pm_crew_str : GAME_STRING (MAINMENU_STRING_BASE + i)); if (hilite && pos == i) { // Currently selected menu option. // Draw the background of the selection. SetContextForeGroundColor (PCMENU_SELECTION_BACKGROUND_COLOR); r->corner.y = t.baseline.y - PC_MENU_HEIGHT + 2; r->extent.height = PC_MENU_HEIGHT - 1; DrawFilledRectangle (r); // Draw the text of the selected item. SetContextForeGroundColor (PCMENU_SELECTION_TEXT_COLOR); font_DrawText (&t); } else { // Draw the text of an unselected item. SetContextForeGroundColor (PCMENU_TEXT_COLOR); font_DrawText (&t); } t.baseline.y += PC_MENU_HEIGHT; } SetContextFont (OldFont); }
static void DrawDevice (COUNT device, COUNT pos, bool selected) { RECT r; TEXT t; t.align = ALIGN_CENTER; t.baseline.x = DEVICE_COL_1; r.extent.width = DEVICE_SEL_WIDTH; r.extent.height = TEXT_SPACING_Y * 2; r.corner.x = DEVICE_SEL_ORG_X; // draw line background r.corner.y = DEVICE_ORG_Y + pos * DEVICE_SPACING_Y + NAME_OFS_Y; SetContextForeGroundColor (selected ? DEVICES_SELECTED_BACK_COLOR : DEVICES_BACK_COLOR); DrawFilledRectangle (&r); SetContextFont (TinyFont); // print device name SetContextForeGroundColor (selected ? DEVICES_SELECTED_NAME_COLOR : DEVICES_NAME_COLOR); t.baseline.y = r.corner.y + TEXT_BASELINE; t.pStr = GAME_STRING (device + DEVICE_STRING_BASE + 1); t.CharCount = utf8StringPos (t.pStr, ' '); font_DrawText (&t); t.baseline.y += TEXT_SPACING_Y; t.pStr = skipUTF8Chars (t.pStr, t.CharCount + 1); t.CharCount = (COUNT)~0; font_DrawText (&t); }
void Widget_DrawControlEntry (WIDGET *_self, int x, int y) { WIDGET_CONTROLENTRY *self = (WIDGET_CONTROLENTRY *)_self; COLOR oldtext; COLOR inactive, default_color, selected; FONT oldfont = SetContextFont (StarConFont); FRAME oldFontEffect = SetContextFontEffect (NULL); TEXT t; int i, home_x, home_y; default_color = WIDGET_INACTIVE_SELECTED_COLOR; selected = WIDGET_ACTIVE_COLOR; inactive = WIDGET_INACTIVE_COLOR; t.baseline.x = x; t.baseline.y = y; t.align = ALIGN_LEFT; t.CharCount = ~0; t.pStr = self->category; if (widget_focus == _self) { oldtext = SetContextForeGroundColor (selected); } else { oldtext = SetContextForeGroundColor (default_color); } font_DrawText (&t); // 3 * SCREEN_WIDTH / ((self->maxcolumns + 1) * 2)) as per CHOICE, but only two options. home_x = t.baseline.x + (SCREEN_WIDTH / 2); home_y = t.baseline.y; t.align = ALIGN_CENTER; for (i = 0; i < 2; i++) { t.baseline.x = home_x + ((i % 3) * (SCREEN_WIDTH / 3)); // self->maxcolumns + 1 as per CHOICE. t.baseline.y = home_y + (8 * (i / 3)); t.pStr = self->controlname[i]; if (!t.pStr[0]) { t.pStr = "---"; } if ((widget_focus == _self) && (self->highlighted == i)) { SetContextForeGroundColor (selected); } else { SetContextForeGroundColor (default_color); } font_DrawText (&t); } SetContextFontEffect (oldFontEffect); SetContextFont (oldfont); SetContextForeGroundColor (oldtext); }
void Widget_DrawChoice (WIDGET *_self, int x, int y) { WIDGET_CHOICE *self = (WIDGET_CHOICE *)_self; COLOR oldtext; COLOR inactive, default_color, selected; FONT oldfont = SetContextFont (StarConFont); FRAME oldFontEffect = SetContextFontEffect (NULL); TEXT t; int i, home_x, home_y; default_color = WIDGET_INACTIVE_SELECTED_COLOR; selected = WIDGET_ACTIVE_COLOR; inactive = WIDGET_INACTIVE_COLOR; t.baseline.x = x; t.baseline.y = y; t.align = ALIGN_LEFT; t.CharCount = ~0; t.pStr = self->category; if (widget_focus == _self) { oldtext = SetContextForeGroundColor (selected); } else { oldtext = SetContextForeGroundColor (default_color); } font_DrawText (&t); home_x = t.baseline.x + 3 * (SCREEN_WIDTH / ((self->maxcolumns + 1) * 2)); home_y = t.baseline.y; t.align = ALIGN_CENTER; for (i = 0; i < self->numopts; i++) { t.baseline.x = home_x + ((i % 3) * (SCREEN_WIDTH / (self->maxcolumns + 1))); t.baseline.y = home_y + (8 * (i / 3)); t.pStr = self->options[i].optname; if ((widget_focus == _self) && (self->highlighted == i)) { SetContextForeGroundColor (selected); Widget_DrawToolTips (3, self->options[i].tooltip); } else if (i == self->selected) { SetContextForeGroundColor (default_color); } else { SetContextForeGroundColor (inactive); } font_DrawText (&t); } SetContextFontEffect (oldFontEffect); SetContextFont (oldfont); SetContextForeGroundColor (oldtext); }
// Auxiliary function for DrawFileStrings // If drawShips is set the ships themselves are drawn, in addition to the // fleet name and value; if not, only the fleet name and value are drawn. // If highlite is set the text is drawn in the color used for highlighting. static void DrawFileString (const MeleeTeam *team, const POINT *origin, BOOLEAN drawShips, BOOLEAN highlite) { SetContextForeGroundColor (highlite ? LOAD_TEAM_NAME_TEXT_COLOR_HILITE : LOAD_TEAM_NAME_TEXT_COLOR); // Print the name of the fleet { TEXT Text; Text.baseline = *origin; Text.align = ALIGN_LEFT; Text.pStr = MeleeTeam_getTeamName(team); Text.CharCount = (COUNT)~0; font_DrawText (&Text); } // Print the value of the fleet { TEXT Text; UNICODE buf[60]; sprintf (buf, "%u", MeleeTeam_getValue (team)); Text.baseline = *origin; Text.baseline.x += NUM_MELEE_COLUMNS * (LOAD_MELEE_BOX_WIDTH + LOAD_MELEE_BOX_SPACE) - 1; Text.align = ALIGN_RIGHT; Text.pStr = buf; Text.CharCount = (COUNT)~0; font_DrawText (&Text); } // Draw the ships for the fleet if (drawShips) { STAMP s; FleetShipIndex slotI; s.origin.x = origin->x + RES_SCALE(1); // JMS_GFX s.origin.y = origin->y + RES_STAT_SCALE(4); // JMS_GFX for (slotI = 0; slotI < MELEE_FLEET_SIZE; slotI++) { BYTE StarShip; StarShip = team->ships[slotI]; if (StarShip != MELEE_NONE) { s.frame = GetShipIconsFromIndex (StarShip); DrawStamp (&s); s.origin.x += RES_SCALE(17); // JMS_GFX } } } }
static void DrawElementAmount (COUNT element, bool selected) { RECT r; TEXT t; UNICODE buf[40]; r.corner.x = ELEMENT_SEL_ORG_X; r.extent.width = ELEMENT_SEL_WIDTH; r.extent.height = ELEMENT_SPACING_Y - 2; if (element == NUM_ELEMENT_CATEGORIES) r.corner.y = BIO_ORG_Y; else r.corner.y = ELEMENT_ORG_Y + (element * ELEMENT_SPACING_Y); // draw line background SetContextForeGroundColor (selected ? CARGO_SELECTED_BACK_COLOR : CARGO_BACK_COLOR); DrawFilledRectangle (&r); t.align = ALIGN_RIGHT; t.pStr = buf; t.baseline.y = r.corner.y + TEXT_BASELINE; if (element == NUM_ELEMENT_CATEGORIES) { // Bio snprintf (buf, sizeof buf, "%u", GLOBAL_SIS (TotalBioMass)); } else { // Element // print element's worth SetContextForeGroundColor (selected ? CARGO_SELECTED_WORTH_COLOR : CARGO_WORTH_COLOR); t.baseline.x = ELEMENT_COL_1; snprintf (buf, sizeof buf, "%u", GLOBAL (ElementWorth[element])); t.CharCount = (COUNT)~0; font_DrawText (&t); snprintf (buf, sizeof buf, "%u", GLOBAL_SIS (ElementAmounts[element])); } // print the element/bio amount SetContextForeGroundColor (selected ? CARGO_SELECTED_AMOUNT_COLOR : CARGO_AMOUNT_COLOR); t.baseline.x = ELEMENT_COL_2; t.CharCount = (COUNT)~0; font_DrawText (&t); }
static void FeedbackPlayerPhrase (UNICODE *pStr) { SetContext (SpaceContext); BatchGraphics (); DrawSISComWindow (); if (pStr[0]) { TEXT ct; ct.baseline.x = SIS_SCREEN_WIDTH >> 1; ct.baseline.y = SLIDER_Y + SLIDER_HEIGHT + RES_SCALE(13); // JMS_GFX ct.align = ALIGN_CENTER; ct.CharCount = (COUNT)~0; ct.pStr = GAME_STRING (FEEDBACK_STRING_BASE); // "(In response to your statement)" SetContextForeGroundColor (COMM_RESPONSE_INTRO_TEXT_COLOR); font_DrawText (&ct); ct.baseline.y += RES_SCALE(16); // JMS_GFX SetContextForeGroundColor (COMM_FEEDBACK_TEXT_COLOR); ct.pStr = pStr; add_text (-4, &ct); } UnbatchGraphics (); }
void Widget_DrawLabel (WIDGET *_self, int x, int y) { WIDGET_LABEL *self = (WIDGET_LABEL *)_self; Color oldtext = SetContextForeGroundColor (WIDGET_INACTIVE_SELECTED_COLOR); FONT oldfont = 0; FRAME oldFontEffect = SetContextFontEffect (NULL); TEXT t; int i; if (cur_font) oldfont = SetContextFont (cur_font); t.baseline.x = 160 << RESOLUTION_FACTOR; // JMS_GFX t.baseline.y = y; t.align = ALIGN_CENTER; t.CharCount = ~0; for (i = 0; i < self->line_count; i++) { t.pStr = self->lines[i]; font_DrawText (&t); t.baseline.y += (8 << RESOLUTION_FACTOR); // JMS_GFX } SetContextFontEffect (oldFontEffect); if (oldfont) SetContextFont (oldfont); SetContextForeGroundColor (oldtext); (void) x; }
void Widget_DrawLabel (WIDGET *_self, int x, int y) { WIDGET_LABEL *self = (WIDGET_LABEL *)_self; COLOR oldtext = SetContextForeGroundColor (WIDGET_INACTIVE_SELECTED_COLOR); FONT oldfont = SetContextFont (StarConFont); FRAME oldFontEffect = SetContextFontEffect (NULL); TEXT t; int i; t.baseline.x = 160; t.baseline.y = y; t.align = ALIGN_CENTER; t.CharCount = ~0; for (i = 0; i < self->line_count; i++) { t.pStr = self->lines[i]; font_DrawText (&t); t.baseline.y += 8; } SetContextFontEffect (oldFontEffect); SetContextFont (oldfont); SetContextForeGroundColor (oldtext); (void) x; }
void Widget_DrawButton (WIDGET *_self, int x, int y) { WIDGET_BUTTON *self = (WIDGET_BUTTON *)_self; COLOR oldtext; COLOR inactive, selected; FONT oldfont = SetContextFont (StarConFont); FRAME oldFontEffect = SetContextFontEffect (NULL); TEXT t; selected = WIDGET_ACTIVE_COLOR; inactive = WIDGET_INACTIVE_COLOR; t.baseline.x = 160; t.baseline.y = y; t.align = ALIGN_CENTER; t.CharCount = ~0; t.pStr = self->name; if (widget_focus == _self) { Widget_DrawToolTips (3, self->tooltip); oldtext = SetContextForeGroundColor (selected); } else { oldtext = SetContextForeGroundColor (inactive); } font_DrawText (&t); SetContextFontEffect (oldFontEffect); SetContextFont (oldfont); SetContextForeGroundColor (oldtext); (void) x; }
static void Widget_DrawToolTips (int numlines, const char **tips) { RECT r; FONT oldfont = SetContextFont (StarConFont); FRAME oldFontEffect = SetContextFontEffect (NULL); COLOR oldtext = SetContextForeGroundColor (WIDGET_INACTIVE_SELECTED_COLOR); TEXT t; int i; r.corner.x = 2; r.corner.y = 2; r.extent.width = SCREEN_WIDTH - 4; r.extent.height = SCREEN_HEIGHT - 4; t.align = ALIGN_CENTER; t.CharCount = ~0; t.baseline.x = r.corner.x + (r.extent.width >> 1); t.baseline.y = r.corner.y + (r.extent.height - 8 - 8 * numlines); for (i = 0; i < numlines; i++) { t.pStr = tips[i]; font_DrawText(&t); t.baseline.y += 8; } SetContextFontEffect (oldFontEffect); SetContextFont (oldfont); SetContextForeGroundColor (oldtext); }
static void DrawRestartMenu (BYTE OldState, BYTE NewState, FRAME f) { RECT r; TEXT t; UNICODE buf[64]; LockMutex (GraphicsLock); SetContext (ScreenContext); r.corner.x = r.corner.y = r.extent.width = r.extent.height = 0; SetContextClipRect (&r); r.corner.x = 0; r.corner.y = 0; r.extent.width = SCREEN_WIDTH; r.extent.height = SCREEN_HEIGHT; SetFlashRect (&r, SetAbsFrameIndex (f, NewState + 1)); // Put version number in the corner SetContextFont (TinyFont); t.pStr = buf; t.baseline.x = SCREEN_WIDTH - 3; t.baseline.y = SCREEN_HEIGHT - 2; t.align = ALIGN_RIGHT; t.CharCount = (COUNT)~0; sprintf (buf, "v%d.%d.%d%s", UQM_MAJOR_VERSION, UQM_MINOR_VERSION, UQM_PATCH_VERSION, UQM_EXTRA_VERSION); SetContextForeGroundColor (WHITE_COLOR); font_DrawText (&t); UnlockMutex (GraphicsLock); (void) OldState; /* Satisfying compiler (unused parameter) */ }
// Draw the full restart menu. Nothing is done with selections. static void DrawRestartMenuGraphic (MENU_STATE *pMS) { RECT r; STAMP s; TEXT t; UNICODE buf[64]; s.frame = pMS->CurFrame; GetFrameRect (s.frame, &r); s.origin.x = (SCREEN_WIDTH - r.extent.width) >> 1; s.origin.y = (SCREEN_HEIGHT - r.extent.height) >> 1; SetContextBackGroundColor (BLACK_COLOR); BatchGraphics (); ClearDrawable (); FlushColorXForms (); DrawStamp (&s); // Put the version number in the bottom right corner. SetContextFont (TinyFont); t.pStr = buf; t.baseline.x = SCREEN_WIDTH - 3; t.baseline.y = SCREEN_HEIGHT - 2; t.align = ALIGN_RIGHT; t.CharCount = (COUNT)~0; sprintf (buf, "v%d.%d.%d%s", UQM_MAJOR_VERSION, UQM_MINOR_VERSION, UQM_PATCH_VERSION, UQM_EXTRA_VERSION); SetContextForeGroundColor (WHITE_COLOR); font_DrawText (&t); UnbatchGraphics (); }
void DrawBattleCrewAmount (SHIP_INFO *ShipInfoPtr, COORD y_offs) { #define MAX_CREW_DIGITS 3 RECT r; TEXT t; UNICODE buf[40]; t.baseline.x = BATTLE_CREW_X + 2; if (optWhichMenu == OPT_PC) t.baseline.x -= 8; t.baseline.y = BATTLE_CREW_Y + y_offs; t.align = ALIGN_LEFT; t.pStr = buf; t.CharCount = (COUNT)~0; r.corner.x = t.baseline.x; r.corner.y = t.baseline.y - 5; r.extent.width = 6 * MAX_CREW_DIGITS + 6; r.extent.height = 5; sprintf (buf, "%u", ShipInfoPtr->crew_level); SetContextFont (StarConFont); SetContextForeGroundColor ( BUILD_COLOR (MAKE_RGB15 (0x0A, 0x0A, 0x0A), 0x08)); DrawFilledRectangle (&r); SetContextForeGroundColor (BLACK_COLOR); font_DrawText (&t); }
void DrawBattleCrewAmount (SHIP_INFO *ShipInfoPtr, COORD y_offs) { #define MAX_CREW_DIGITS 3 RECT r; TEXT t; UNICODE buf[40]; t.baseline.x = BATTLE_CREW_X + RES_STAT_SCALE(2) - RES_CASE(0,0,2); // JMS_GFX if (optWhichMenu == OPT_PC) t.baseline.x -= RES_STAT_SCALE(8); // JMS_GFX t.baseline.y = BATTLE_CREW_Y + y_offs; t.align = ALIGN_LEFT; t.pStr = buf; t.CharCount = (COUNT)~0; r.corner.x = t.baseline.x; r.corner.y = t.baseline.y - (5 << RESOLUTION_FACTOR); // JMS_GFX r.extent.width = 6 * MAX_CREW_DIGITS + (6 << RESOLUTION_FACTOR) + RESOLUTION_FACTOR; // JMS_GFX r.extent.height = (5 << RESOLUTION_FACTOR) + RES_CASE(0,2,3); // JMS_GFX sprintf (buf, "%u", ShipInfoPtr->crew_level); SetContextFont (StarConFont); SetContextForeGroundColor ( BUILD_COLOR (MAKE_RGB15 (0x0A, 0x0A, 0x0A), 0x08)); DrawFilledRectangle (&r); SetContextForeGroundColor (BLACK_COLOR); font_DrawText (&t); }
void Widget_DrawSlider(WIDGET *_self, int x, int y) { WIDGET_SLIDER *self = (WIDGET_SLIDER *)_self; Color oldtext; Color inactive, default_color, selected; FONT oldfont = 0; FRAME oldFontEffect = SetContextFontEffect (NULL); TEXT t; RECT r; int tick = (ScreenWidth - x) / 8; if (cur_font) oldfont = SetContextFont (cur_font); default_color = WIDGET_INACTIVE_SELECTED_COLOR; selected = WIDGET_ACTIVE_COLOR; inactive = WIDGET_INACTIVE_COLOR; t.baseline.x = x + 64 * RESOLUTION_FACTOR; // JMS_GFX; t.baseline.y = y; t.align = ALIGN_LEFT; t.CharCount = ~0; t.pStr = self->category; if (widget_focus == _self) { Widget_DrawToolTips (3, self->tooltip); oldtext = SetContextForeGroundColor (selected); } else { oldtext = SetContextForeGroundColor (default_color); } font_DrawText (&t); t.baseline.x -= 64 * RESOLUTION_FACTOR; // JMS_GFX; r.corner.x = t.baseline.x + 3 * tick; r.corner.y = t.baseline.y - 4; r.extent.height = 2; r.extent.width = 3 * tick; DrawFilledRectangle (&r); r.extent.width = 3; r.extent.height = 8; r.corner.y = t.baseline.y - 7; r.corner.x = t.baseline.x + 3 * tick + (3 * tick * (self->value - self->min) / (self->max - self->min)) - 1; DrawFilledRectangle (&r); (*self->draw_value)(self, t.baseline.x + 7 * tick, t.baseline.y); SetContextFontEffect (oldFontEffect); if (oldfont) SetContextFont (oldfont); SetContextForeGroundColor (oldtext); }
static void DrawConfirmationWindow (BOOLEAN answer) { Color oldfg = SetContextForeGroundColor (MENU_TEXT_COLOR); FONT oldfont = SetContextFont (StarConFont); FRAME oldFontEffect = SetContextFontEffect (NULL); RECT r; TEXT t; BatchGraphics (); r.corner.x = (SCREEN_WIDTH - CONFIRM_WIN_WIDTH) >> 1; r.corner.y = (SCREEN_HEIGHT - CONFIRM_WIN_HEIGHT) >> 1; r.extent.width = CONFIRM_WIN_WIDTH; r.extent.height = CONFIRM_WIN_HEIGHT; DrawShadowedBox (&r, SHADOWBOX_BACKGROUND_COLOR, SHADOWBOX_DARK_COLOR, SHADOWBOX_MEDIUM_COLOR); t.baseline.x = r.corner.x + (r.extent.width >> 1); t.baseline.y = r.corner.y + (8 << RESOLUTION_FACTOR); // JMS_GFX t.pStr = GAME_STRING (QUITMENU_STRING_BASE); // "Really Quit?" t.align = ALIGN_CENTER; t.CharCount = (COUNT)~0; font_DrawText (&t); t.baseline.y += (10 << RESOLUTION_FACTOR); // JMS_GFX t.baseline.x = r.corner.x + (r.extent.width >> 2); t.pStr = GAME_STRING (QUITMENU_STRING_BASE + 1); // "Yes" SetContextForeGroundColor (answer ? MENU_HIGHLIGHT_COLOR : MENU_TEXT_COLOR); font_DrawText (&t); t.baseline.x += (r.extent.width >> 1); t.pStr = GAME_STRING (QUITMENU_STRING_BASE + 2); // "No" SetContextForeGroundColor (answer ? MENU_TEXT_COLOR : MENU_HIGHLIGHT_COLOR); font_DrawText (&t); UnbatchGraphics (); SetContextFontEffect (oldFontEffect); SetContextFont (oldfont); SetContextForeGroundColor (oldfg); }
static void DrawDevicesDisplay (DEVICES_STATE *devState) { TEXT t; RECT r; STAMP s; COORD cy; COUNT i; r.corner.x = 2; r.corner.y = 20; r.extent.width = FIELD_WIDTH + 1; // XXX: Shouldn't the height be 1 less? This draws the bottom border // 1 pixel too low. Or if not, why do we need another box anyway? r.extent.height = 129 - r.corner.y; DrawStarConBox (&r, 1, SHADOWBOX_MEDIUM_COLOR, SHADOWBOX_DARK_COLOR, TRUE, DEVICES_BACK_COLOR); // print the "DEVICES" title SetContextFont (StarConFont); t.baseline.x = (STATUS_WIDTH >> 1) - 1; t.baseline.y = r.corner.y + 7; t.align = ALIGN_CENTER; t.pStr = GAME_STRING (DEVICE_STRING_BASE); t.CharCount = (COUNT)~0; SetContextForeGroundColor (DEVICES_SELECTED_NAME_COLOR); font_DrawText (&t); s.origin.x = DEVICE_COL_0; cy = DEVICE_ORG_Y; // draw device icons and print names for (i = 0; i < MAX_VIS_DEVICES; ++i, cy += DEVICE_SPACING_Y) { COUNT devIndex = devState->topIndex + i; if (devIndex >= devState->count) break; // draw device icon s.origin.y = cy + ICON_OFS_Y; s.frame = SetAbsFrameIndex (MiscDataFrame, 77 + devState->list[devIndex]); DrawStamp (&s); DrawDevice (devState->list[devIndex], i, false); } }
void ConfirmSaveLoad (STAMP *MsgStamp) { RECT r, clip_r; TEXT t; SetContextFont (StarConFont); GetContextClipRect (&clip_r); t.baseline.x = clip_r.extent.width >> 1; t.baseline.y = (clip_r.extent.height >> 1) + (3 << RESOLUTION_FACTOR); // JMS_GFX t.align = ALIGN_CENTER; t.CharCount = (COUNT)~0; if (MsgStamp) t.pStr = GAME_STRING (SAVEGAME_STRING_BASE + 0); // "Saving . . ." else t.pStr = GAME_STRING (SAVEGAME_STRING_BASE + 1); // "Loading . . ." TextRect (&t, &r, NULL); r.corner.x -= 4 << RESOLUTION_FACTOR; // JMS_GFX r.corner.y -= 4 << RESOLUTION_FACTOR; // JMS_GFX r.extent.width += 8 << RESOLUTION_FACTOR; // JMS_GFX r.extent.height += 8 << RESOLUTION_FACTOR; // JMS_GFX if (MsgStamp) { *MsgStamp = SaveContextFrame (&r); } if (RESOLUTION_FACTOR == 0) { DrawStarConBox (&r, 2, BUILD_COLOR (MAKE_RGB15 (0x10, 0x10, 0x10), 0x19), BUILD_COLOR (MAKE_RGB15 (0x08, 0x08, 0x08), 0x1F), TRUE, BUILD_COLOR (MAKE_RGB15 (0x0A, 0x0A, 0x0A), 0x08)); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x14, 0x14, 0x14), 0x0F)); } else { DrawStarConBox (&r, 2, PCMENU_TOP_LEFT_BORDER_COLOR, PCMENU_BOTTOM_RIGHT_BORDER_COLOR, TRUE, PCMENU_BACKGROUND_COLOR); SetContextForeGroundColor (PCMENU_SELECTION_TEXT_COLOR); } font_DrawText (&t); }
void DrawLabelAsWindow(WIDGET_LABEL *label) { COLOR oldfg = SetContextForeGroundColor (WIDGET_DIALOG_TEXT_COLOR); FONT oldfont = SetContextFont (StarConFont); FRAME oldFontEffect = SetContextFontEffect (NULL); RECT r; TEXT t; int i, win_w, win_h; /* Compute the dimensions of the label */ win_h = label->height ((WIDGET *)label) + 16; win_w = 0; for (i = 0; i < label->line_count; i++) { int len = utf8StringCount (label->lines[i]); if (len > win_w) { win_w = len; } } win_w = (win_w * 6) + 16; BatchGraphics (); r.corner.x = (SCREEN_WIDTH - win_w) >> 1; r.corner.y = (SCREEN_HEIGHT - win_h) >> 1; r.extent.width = win_w; r.extent.height = win_h; DrawShadowedBox (&r, SHADOWBOX_BACKGROUND_COLOR, SHADOWBOX_DARK_COLOR, SHADOWBOX_MEDIUM_COLOR); t.baseline.x = r.corner.x + (r.extent.width >> 1); t.baseline.y = r.corner.y + 16; for (i = 0; i < label->line_count; i++) { t.pStr = label->lines[i]; t.align = ALIGN_CENTER; t.CharCount = (COUNT)~0; font_DrawText (&t); t.baseline.y += 8; } UnbatchGraphics (); SetContextFontEffect (oldFontEffect); SetContextFont (oldfont); SetContextForeGroundColor (oldfg); }
void Widget_Slider_DrawValue (WIDGET_SLIDER *self, int x, int y) { TEXT t; char buffer[16]; sprintf (buffer, "%d", self->value); t.baseline.x = x; t.baseline.y = y; t.align = ALIGN_CENTER; t.CharCount = ~0; t.pStr = buffer; font_DrawText (&t); }
static void Widget_DrawToolTips (int numlines, const char **tips) { // This functions draws the text at the bottom of the screen // which explains what the current option does. RECT r; FONT oldfont = 0; FRAME oldFontEffect = SetContextFontEffect (NULL); Color oldtext = SetContextForeGroundColor (WIDGET_INACTIVE_SELECTED_COLOR); TEXT t; int i; if (cur_font) oldfont = SetContextFont (cur_font); r.corner.x = 2 << RESOLUTION_FACTOR; // JMS_GFX r.corner.y = 2 << RESOLUTION_FACTOR; // JMS_GFX r.extent.width = ScreenWidth - (4 << RESOLUTION_FACTOR); // JMS_GFX r.extent.height = ScreenHeight - (4 << RESOLUTION_FACTOR); // JMS_GFX t.align = ALIGN_CENTER; t.CharCount = ~0; t.baseline.x = r.corner.x + (r.extent.width >> 1); t.baseline.y = r.corner.y + (r.extent.height - (8 << RESOLUTION_FACTOR) - (8 << RESOLUTION_FACTOR) * numlines); // JMS_GFX for (i = 0; i < numlines; i++) { t.pStr = tips[i]; font_DrawText(&t); t.baseline.y += (8 << RESOLUTION_FACTOR); // JMS_GFX } SetContextFontEffect (oldFontEffect); if (oldfont) SetContextFont (oldfont); SetContextForeGroundColor (oldtext); }
// Draw the value of the fleet in the top right of the PickMeleeFrame. // Pre: caller holds the graphics lock. static void UpdatePickMeleeFleetValue (FRAME frame, COUNT which_player) { CONTEXT OldContext; COUNT value; RECT r; TEXT t; UNICODE buf[40]; value = GetRaceQueueValue (&race_q[which_player]); OldContext = SetContext (OffScreenContext); SetContextFGFrame (frame); // Erase the old value text. GetFrameRect (frame, &r); r.extent.width -= RES_SCALE(4); t.baseline.x = r.extent.width; r.corner.x = r.extent.width - RES_SCALE(6 * 3); // JMS_GFX r.corner.y = RES_SCALE(2); // JMS_GFX r.extent.width = RES_SCALE(6 * 3); // JMS_GFX r.extent.height = RES_SCALE(7 - 2) + RESOLUTION_FACTOR; // JMS_GFX SetContextForeGroundColor (PICK_BG_COLOR); DrawFilledRectangle (&r); // Draw the new value text. sprintf (buf, "%d", value); t.baseline.y = RES_SCALE(7); t.align = ALIGN_RIGHT; t.pStr = buf; t.CharCount = (COUNT)~0; SetContextFont (TinyFont); SetContextForeGroundColor (PICK_VALUE_COLOR); font_DrawText (&t); SetContext (OldContext); }
/* * Draws the retreat_wait counter for a ship. * Based on DrawBattleCrewAmount. * * StarShipPtr: the starship crew is to be drawn for. */ static void draw_retreat_clock (STARSHIP *StarShipPtr) { #define MAX_TIMER_DIGITS 3 RECT r; TEXT t; COORD y_offs; UNICODE buf[40]; int time_left = ((StarShipPtr->entrance_time + opt_retreat_wait) - battleFrameCount); assert ((StarShipPtr->playerNr > -1) && (StarShipPtr->playerNr < 2)); y_offs = status_y_offsets[StarShipPtr->playerNr]; t.baseline.x = BATTLE_TIMER_XOFFS; t.baseline.y = BATTLE_TIMER_YOFFS + y_offs; t.align = ALIGN_LEFT; t.pStr = buf; t.CharCount = (COUNT)~0; r.corner.x = t.baseline.x; r.corner.y = t.baseline.y - 5; r.extent.width = 6 * MAX_TIMER_DIGITS + 6; r.extent.height = 5; /* if the ship can retreat, write 0 to the buffer */ sprintf (buf, "%d",(StarShipPtr->CanRunAway) ? 0 : ((time_left / 24) + 1)); SetContextFont (StarConFont); SetContextForeGroundColor ( BUILD_COLOR (MAKE_RGB15 (0x0A, 0x0A, 0x0A), 0x08)); DrawFilledRectangle (&r); SetContextForeGroundColor (BLACK_COLOR); font_DrawText (&t); }
void ShowRemainingCapacity (void) { RECT r; TEXT t; CONTEXT OldContext; UNICODE buf[40]; OldContext = SetContext (StatusContext); SetContextFont (TinyFont); r.corner.x = 40; r.corner.y = FREE_ORG_Y; snprintf (buf, sizeof buf, "%u", GetStorageBayCapacity () - GLOBAL_SIS (TotalElementMass)); t.baseline.x = ELEMENT_COL_2 + 1; t.baseline.y = r.corner.y + TEXT_BASELINE; t.align = ALIGN_RIGHT; t.pStr = buf; t.CharCount = (COUNT)~0; r.extent.width = t.baseline.x - r.corner.x + 1; r.extent.height = ELEMENT_SPACING_Y - 2; BatchGraphics (); // erase previous free amount SetContextForeGroundColor (CARGO_BACK_COLOR); DrawFilledRectangle (&r); // print the new free amount SetContextForeGroundColor (CARGO_WORTH_COLOR); font_DrawText (&t); UnbatchGraphics (); SetContext (OldContext); }
void DrawCaptainsWindow (STARSHIP *StarShipPtr) { COORD y; COORD y_offs; RECT r; STAMP s; FRAME Frame; RACE_DESC *RDPtr; RDPtr = StarShipPtr->RaceDescPtr; Frame = RDPtr->ship_data.captain_control.background; if (Frame) { Frame = SetAbsFrameIndex (Frame, 0); RDPtr->ship_data.captain_control.background = Frame; Frame = SetRelFrameIndex (Frame, 1); RDPtr->ship_data.captain_control.turn = Frame; Frame = SetRelFrameIndex (Frame, 5); RDPtr->ship_data.captain_control.thrust = Frame; Frame = SetRelFrameIndex (Frame, 3); RDPtr->ship_data.captain_control.weapon = Frame; Frame = SetRelFrameIndex (Frame, 3); RDPtr->ship_data.captain_control.special = Frame; } BatchGraphics (); // Grey area under and around captain's window. assert (StarShipPtr->playerNr >= 0); y_offs = status_y_offsets[StarShipPtr->playerNr]; r.corner.x = CAPTAIN_XOFFS - RES_STAT_SCALE(4); // JMS_GFX r.corner.y = y_offs + SHIP_INFO_HEIGHT; r.extent.width = STATUS_WIDTH - 2; r.extent.height = SHIP_STATUS_HEIGHT - CAPTAIN_YOFFS + (4 << RESOLUTION_FACTOR); // JMS_GFX SetContextForeGroundColor ( BUILD_COLOR (MAKE_RGB15 (0x0A, 0x0A, 0x0A), 0x08)); DrawFilledRectangle (&r); // Left border of the status panel. SetContextForeGroundColor ( BUILD_COLOR (MAKE_RGB15 (0x08, 0x08, 0x08), 0x1F)); r.corner.x = 1; r.corner.y = y_offs + SHIP_INFO_HEIGHT; r.extent.width = 1; r.extent.height = (SHIP_STATUS_HEIGHT - SHIP_INFO_HEIGHT - 2); DrawFilledRectangle (&r); r.corner.x = 0; ++r.extent.height; DrawFilledRectangle (&r); // Lower and right border of the status panel. SetContextForeGroundColor ( BUILD_COLOR (MAKE_RGB15 (0x10, 0x10, 0x10), 0x19)); r.corner.x = STATUS_WIDTH - 1; r.corner.y = y_offs + SHIP_INFO_HEIGHT; r.extent.width = 1; r.extent.height = SHIP_STATUS_HEIGHT - SHIP_INFO_HEIGHT; DrawFilledRectangle (&r); r.corner.x = STATUS_WIDTH - 2; DrawFilledRectangle (&r); r.corner.x = 1; r.extent.width = STATUS_WIDTH - 2; r.corner.y = y_offs + (SHIP_STATUS_HEIGHT - 2); r.extent.height = 1; DrawFilledRectangle (&r); r.corner.x = 0; ++r.extent.width; ++r.corner.y; DrawFilledRectangle (&r); y = y_offs + CAPTAIN_YOFFS; // Darker grey rectangle at bottom and right of captain's window SetContextForeGroundColor ( BUILD_COLOR (MAKE_RGB15 (0x08, 0x08, 0x08), 0x1F)); r.corner.x = CAPTAIN_WIDTH + CAPTAIN_XOFFS; r.corner.y = y; r.extent.width = 1; r.extent.height = CAPTAIN_HEIGHT; DrawFilledRectangle (&r); r.corner.x = CAPTAIN_XOFFS - 1; r.corner.y += CAPTAIN_HEIGHT; r.extent.width = CAPTAIN_WIDTH + 2; r.extent.height = 1; DrawFilledRectangle (&r); // Light grey rectangle at top and left of captains window SetContextForeGroundColor ( BUILD_COLOR (MAKE_RGB15 (0x10, 0x10, 0x10), 0x19)); r.corner.x = CAPTAIN_XOFFS - 1; r.extent.width = CAPTAIN_WIDTH + 2; r.corner.y = y - 1; r.extent.height = 1; DrawFilledRectangle (&r); r.corner.x = CAPTAIN_XOFFS - 1; r.extent.width = 1; r.corner.y = y; r.extent.height = CAPTAIN_HEIGHT; DrawFilledRectangle (&r); s.frame = RDPtr->ship_data.captain_control.background; s.origin.x = CAPTAIN_XOFFS; s.origin.y = y; DrawStamp (&s); if (StarShipPtr->captains_name_index == 0 && StarShipPtr->playerNr == RPG_PLAYER_NUM) { // This is SIS TEXT t; t.baseline.x = STATUS_WIDTH >> 1; t.baseline.y = y + RES_CASE(6,-22,-44); // JMS_GFX t.align = ALIGN_CENTER; t.pStr = GLOBAL_SIS (CommanderName); t.CharCount = (COUNT)~0; SetContextForeGroundColor (RES_CASE(BUILD_COLOR (MAKE_RGB15 (0x00, 0x14, 0x00), 0x02), BLACK_COLOR, BLACK_COLOR)); SetContextFont (TinyFont); font_DrawText (&t); }
// windowRect, if not NULL, will be filled with the dimensions of the // window drawn. void DrawLabelAsWindow (WIDGET_LABEL *label, RECT *windowRect) { Color oldfg = SetContextForeGroundColor (WIDGET_DIALOG_TEXT_COLOR); FONT oldfont = 0; FRAME oldFontEffect = SetContextFontEffect (NULL); RECT r; TEXT t; int i, win_w, win_h; if (cur_font) oldfont = SetContextFont (cur_font); /* Compute the dimensions of the label */ win_h = label->height ((WIDGET *)label) + (16 << RESOLUTION_FACTOR); // JMS_GFX win_w = 0; for (i = 0; i < label->line_count; i++) { int len = utf8StringCount (label->lines[i]); if (len > win_w) { win_w = len; } } win_w = (win_w * (6 << RESOLUTION_FACTOR)) + (16 << RESOLUTION_FACTOR); // JMS_GFX BatchGraphics (); r.corner.x = (ScreenWidth - win_w) >> 1; r.corner.y = (ScreenHeight - win_h) >> 1; r.extent.width = win_w; r.extent.height = win_h; DrawShadowedBox (&r, win_bg_clr, win_dark_clr, win_medium_clr); t.baseline.x = r.corner.x + (r.extent.width >> 1); t.baseline.y = r.corner.y + (16 << RESOLUTION_FACTOR); // JMS_GFX for (i = 0; i < label->line_count; i++) { t.pStr = label->lines[i]; t.align = ALIGN_CENTER; t.CharCount = (COUNT)~0; font_DrawText (&t); t.baseline.y += (8 << RESOLUTION_FACTOR); // JMS_GFX } UnbatchGraphics (); SetContextFontEffect (oldFontEffect); if (oldfont) SetContextFont (oldfont); SetContextForeGroundColor (oldfg); if (windowRect != NULL) { // Add the outer border added by DrawShadowedBox. // XXX: It may be nicer to add a border size parameter to // DrawShadowedBox, instead of assuming 2 here. windowRect->corner.x = r.corner.x - 2 * (1 + RESOLUTION_FACTOR); windowRect->corner.y = r.corner.y - 2 * (1 + RESOLUTION_FACTOR); windowRect->extent.width = r.extent.width + 4 * (1 + RESOLUTION_FACTOR); windowRect->extent.height = r.extent.height + 4 * (1 + RESOLUTION_FACTOR); } }
void Widget_DrawTextEntry (WIDGET *_self, int x, int y) { WIDGET_TEXTENTRY *self = (WIDGET_TEXTENTRY *)_self; Color oldtext; Color inactive, default_color, selected; FONT oldfont = 0; FRAME oldFontEffect = SetContextFontEffect (NULL); TEXT t; if (cur_font) oldfont = SetContextFont (cur_font); default_color = WIDGET_INACTIVE_SELECTED_COLOR; selected = WIDGET_ACTIVE_COLOR; inactive = WIDGET_INACTIVE_COLOR; BatchGraphics (); t.baseline.x = x + 64 * RESOLUTION_FACTOR; // JMS_GFX t.baseline.y = y; t.align = ALIGN_LEFT; t.CharCount = ~0; t.pStr = self->category; if (widget_focus == _self) { oldtext = SetContextForeGroundColor (selected); } else { oldtext = SetContextForeGroundColor (default_color); } font_DrawText (&t); t.baseline.x -= 64 * RESOLUTION_FACTOR; // JMS_GFX /* Force string termination */ self->value[WIDGET_TEXTENTRY_WIDTH-1] = 0; t.baseline.y = y; t.CharCount = utf8StringCount (self->value); t.pStr = self->value; if (!(self->state & WTE_EDITING)) { // normal or selected state t.baseline.x = 160 << RESOLUTION_FACTOR; // JMS_GFX t.align = ALIGN_CENTER; if (widget_focus == _self) { oldtext = SetContextForeGroundColor (selected); } else { oldtext = SetContextForeGroundColor (inactive); } font_DrawText (&t); } else { // editing state COUNT i; RECT text_r; BYTE char_deltas[WIDGET_TEXTENTRY_WIDTH]; BYTE *pchar_deltas; RECT r; SIZE leading; t.baseline.x = 90 << RESOLUTION_FACTOR; // JMS_GFX t.align = ALIGN_LEFT; // calc background box dimensions // XXX: this may need some tuning, especially if a // different font is used. The font 'leading' values // are not what they should be. #define BOX_VERT_OFFSET 2 GetContextFontLeading (&leading); r.corner.x = t.baseline.x - 1; r.corner.y = t.baseline.y - leading + BOX_VERT_OFFSET; r.extent.width = ScreenWidth - r.corner.x - 10; r.extent.height = leading + 2; TextRect (&t, &text_r, char_deltas); #if 0 // XXX: this should potentially be used in ChangeCallback if ((text_r.extent.width + 2) >= r.extent.width) { // the text does not fit the input box size and so // will not fit when displayed later UnbatchGraphics (); // disallow the change return (FALSE); } #endif oldtext = SetContextForeGroundColor (selected); DrawFilledRectangle (&r); // calculate the cursor position and draw it pchar_deltas = char_deltas; for (i = self->cursor_pos; i > 0; --i) r.corner.x += (SIZE)*pchar_deltas++; if (self->cursor_pos < t.CharCount) /* cursor mid-line */ --r.corner.x; if (self->state & WTE_BLOCKCUR) { // Use block cursor for keyboardless systems if (self->cursor_pos == t.CharCount) { // cursor at end-line -- use insertion point r.extent.width = 1; } else if (self->cursor_pos + 1 == t.CharCount) { // extra pixel for last char margin r.extent.width = (SIZE)*pchar_deltas + 2; } else { // normal mid-line char r.extent.width = (SIZE)*pchar_deltas + 1; } } else { // Insertion point cursor r.extent.width = 1; } // position cursor within input field rect ++r.corner.x; ++r.corner.y; r.extent.height -= 2; SetContextForeGroundColor (WIDGET_CURSOR_COLOR); DrawFilledRectangle (&r); SetContextForeGroundColor (inactive); font_DrawText (&t); } UnbatchGraphics (); SetContextFontEffect (oldFontEffect); if (oldfont) SetContextFont (oldfont); SetContextForeGroundColor (oldtext); }
void Widget_DrawMenuScreen (WIDGET *_self, int x, int y) { RECT r; Color title, oldtext; Color inactive, default_color, selected; FONT oldfont = 0; FRAME oldFontEffect = SetContextFontEffect (NULL); TEXT t; int widget_index, height, widget_y; WIDGET_MENU_SCREEN *self = (WIDGET_MENU_SCREEN *)_self; if (cur_font) oldfont = SetContextFont (cur_font); r.corner.x = (2 << RESOLUTION_FACTOR) + 2 * RESOLUTION_FACTOR; // JMS_GFX r.corner.y = (2 << RESOLUTION_FACTOR); // JMS_GFX r.extent.width = ScreenWidth - (4 << RESOLUTION_FACTOR); // JMS_GFX r.extent.height = ScreenHeight - (4 << RESOLUTION_FACTOR); // JMS_GFX title = WIDGET_INACTIVE_SELECTED_COLOR; selected = WIDGET_ACTIVE_COLOR; inactive = WIDGET_INACTIVE_COLOR; default_color = title; DrawStamp (&self->bgStamp); oldtext = SetContextForeGroundColor (title); t.baseline.x = r.corner.x + (r.extent.width >> 1); t.baseline.y = r.corner.y + (8 << RESOLUTION_FACTOR); // JMS_GFX t.pStr = self->title; t.align = ALIGN_CENTER; t.CharCount = ~0; font_DrawText (&t); t.baseline.y += 8 << RESOLUTION_FACTOR; // JMS_GFX t.pStr = self->subtitle; font_DrawText (&t); height = 0; for (widget_index = 0; widget_index < self->num_children; widget_index++) { WIDGET *child = self->child[widget_index]; height += (*child->height)(child); height += 8 << RESOLUTION_FACTOR; // JMS_GFX /* spacing */ } height -= 8 << RESOLUTION_FACTOR; // JMS_GFX widget_y = (ScreenHeight - height) >> 1; for (widget_index = 0; widget_index < self->num_children; widget_index++) { WIDGET *c = self->child[widget_index]; (*c->draw)(c, 0, widget_y); widget_y += (*c->height)(c) + (8 << RESOLUTION_FACTOR); // JMS_GFX } SetContextFontEffect (oldFontEffect); if (oldfont) SetContextFont (oldfont); SetContextForeGroundColor (oldtext); (void) x; (void) y; }
static BOOLEAN DoConvSummary (SUMMARY_STATE *pSS) { #define DELTA_Y_SUMMARY RES_SCALE(8) // JMS_GFX //#define MAX_SUMM_ROWS ((SIS_SCREEN_HEIGHT - SLIDER_Y - SLIDER_HEIGHT) / DELTA_Y_SUMMARY #define MAX_SUMM_ROWS (SLIDER_Y / DELTA_Y_SUMMARY) - 1 // JMS_GFX if (!pSS->Initialized) { pSS->PrintNext = TRUE; pSS->NextSub = GetFirstTrackSubtitle (); pSS->LeftOver = NULL; pSS->InputFunc = DoConvSummary; pSS->Initialized = TRUE; DoInput (pSS, FALSE); } else if (GLOBAL (CurrentActivity) & CHECK_ABORT) { return FALSE; // bail out } else if (PulsedInputState.menu[KEY_MENU_SELECT] || PulsedInputState.menu[KEY_MENU_CANCEL] || PulsedInputState.menu[KEY_MENU_RIGHT]) { if (pSS->NextSub) { // we want the next page pSS->PrintNext = TRUE; } else { // no more, we are done return FALSE; } } else if (pSS->PrintNext) { // print the next page RECT r; TEXT t; int row; r.corner.x = 0; r.corner.y = 0; r.extent.width = SIS_SCREEN_WIDTH; r.extent.height = SLIDER_Y; //SIS_SCREEN_HEIGHT - SLIDER_Y - SLIDER_HEIGHT + RES_SCALE(2) + 16 * RESOLUTION_FACTOR; // JMS_GFX SetContext (AnimContext); SetContextForeGroundColor (COMM_HISTORY_BACKGROUND_COLOR); DrawFilledRectangle (&r); SetContextForeGroundColor (COMM_HISTORY_TEXT_COLOR); r.extent.width -= 2 + 2; t.baseline.x = RES_SCALE(2); // JMS_GFX t.align = ALIGN_LEFT; t.baseline.y = DELTA_Y_SUMMARY; SetContextFont (TinyFont); for (row = 0; row < MAX_SUMM_ROWS && pSS->NextSub; ++row, pSS->NextSub = GetNextTrackSubtitle (pSS->NextSub)) { const char *next = NULL; if (pSS->LeftOver) { // some text left from last subtitle t.pStr = pSS->LeftOver; pSS->LeftOver = NULL; } else { t.pStr = GetTrackSubtitleText (pSS->NextSub); if (!t.pStr) continue; } t.CharCount = (COUNT)~0; for ( ; row < MAX_SUMM_ROWS && !getLineWithinWidth (&t, &next, r.extent.width, (COUNT)~0); ++row) { if (CommData.AlienConv == ORZ_CONVERSATION) { // MB: nasty hack: remove '$'s from conversation for Orz UNICODE my_copy[128]; strcpy(my_copy, t.pStr); remove_char_from_string(my_copy, '$'); t.pStr = my_copy; font_DrawText(&t); } else { // Normal mode font_DrawText(&t); } t.baseline.y += DELTA_Y_SUMMARY; t.pStr = next; t.CharCount = (COUNT)~0; } if (row >= MAX_SUMM_ROWS) { // no more space on screen, but some text left over // from the current subtitle pSS->LeftOver = next; break; } // this subtitle fit completely if (CommData.AlienConv == ORZ_CONVERSATION) { // MB: nasty hack: remove '$'s from conversation for Orz UNICODE my_copy[128]; strcpy(my_copy, t.pStr); remove_char_from_string(my_copy, '$'); t.pStr = my_copy; font_DrawText(&t); } else { // Normal mode font_DrawText(&t); } t.baseline.y += DELTA_Y_SUMMARY; } if (row >= MAX_SUMM_ROWS && (pSS->NextSub || pSS->LeftOver)) { // draw *MORE* TEXT mt; UNICODE buffer[128]; mt.baseline.x = SIS_SCREEN_WIDTH >> 1; mt.baseline.y = t.baseline.y; mt.align = ALIGN_CENTER; snprintf (buffer, sizeof (buffer), "%s%s%s", // "MORE" STR_MIDDLE_DOT, GAME_STRING (FEEDBACK_STRING_BASE + 1), STR_MIDDLE_DOT); if (CommData.AlienConv == ORZ_CONVERSATION) { // MB: nasty hack: remove '$'s from conversation for Orz remove_char_from_string(buffer, '$'); } mt.pStr = buffer; SetContextForeGroundColor (COMM_MORE_TEXT_COLOR); font_DrawText (&mt); }