void aButton::render() { if ( state != HIDDEN ) { if ( textureHandle ) { unsigned long gosID = mcTextureManager->get_gosTextureHandle( textureHandle ); gos_SetRenderState( gos_State_Texture, gosID ); } else gos_SetRenderState( gos_State_Texture, 0 ); gos_SetRenderState( gos_State_AlphaMode, gos_Alpha_AlphaInvAlpha); gos_SetRenderState( gos_State_Filter, gos_FilterNone); gos_SetRenderState( gos_State_AlphaTest, true); gos_SetRenderState( gos_State_TextureAddress, gos_TextureClamp ); gos_SetRenderState( gos_State_TextureMapBlend,gos_BlendModulateAlpha ); gos_DrawQuads( location, 4 ); if ( data.textID && data.textFont ) { char buffer[256]; cLoadString( data.textID, buffer, 256 ); DWORD width, height; gos_TextSetAttributes(data.textFont, data.textColors[state], data.textSize, true, true, false, false, data.textAlign); gos_TextSetRegion( data.textRect.left, data.textRect.top, data.textRect.right, data.textRect.bottom ); gos_TextStringLength( &width, &height, buffer ); gos_TextSetPosition( data.textRect.left, (data.textRect.top + data.textRect.bottom)/2 - height/2 + 1 ); gos_TextDraw( buffer ); if ( data.outlineText ) { drawEmptyRect( data.textRect, data.textColors[state], data.textColors[state] ); } } if ( data.outline ) { GUI_RECT tmp; tmp.left = location[0].x; tmp.top = location[0].y; tmp.right = location[2].x; tmp.bottom = location[2].y; drawEmptyRect( tmp, location[0].argb, location[0].argb ); } for ( int i = 0; i < numberOfChildren(); i++ ) { pChildren[i]->render(); } } }
void InfoWindow::drawName( const char* name ) { GUI_RECT rect = { NAMELEFT, NAMETOP, NAMERIGHT, SCROLLTOP}; drawRect( rect, 0xff000000 ); drawEmptyRect( NameRect, 0xff002f55, 0xff002f55 ); nameFont.render( name, NAMELEFT, NAMETOP, NAMERIGHT - NAMELEFT, NAMEBOTTOM - NAMETOP, 0xff5c96c2, 0, 3 ); }
void CGUIInputText::drawGalaxyStyle(SDL_Rect& lRect) { if(!mEnabled) return; SDL_Surface *blitsfc = g_pVideoDriver->getBlitSurface(); // Now lets draw the text of the list control CFont &Font = g_pGfxEngine->getFont(mFontID); SDL_PixelFormat *format = g_pVideoDriver->getBlitSurface()->format; const Uint32 oldcolor = Font.getFGColor(); Uint32 newcolor; if(mHovered || mButtonDown) newcolor = SDL_MapRGB( format, 84, 234, 84); else newcolor = SDL_MapRGB( format, 38, 134, 38); Font.setupColor( newcolor ); drawEmptyRect( blitsfc, &lRect, newcolor); Font.drawFont( blitsfc, getInputString(), lRect.x+24, lRect.y+2, false ); Font.setupColor( oldcolor ); }
void OptionsGamePlay::render() { LogisticsScreen::render(); long colorToMatch = getButton( MSG_BASE )->isPressed() ? rects[36].getColor() : rects[37].getColor(); for ( int i = 4; i < 36; i++ ) { if ( rects[i].getColor() == colorToMatch ) { GUI_RECT tmp = { rects[i].globalX() - 2, rects[i].globalY() - 2, rects[i].globalRight() + 1, rects[i].globalBottom() + 1 }; drawEmptyRect( tmp, 0xffffffff, 0xffffffff ); break; } } rects[37].render(); rects[36].render(); camera.render(); }
void MPPrefs::updateStripeColors(const MC2Player* players, long playerCount, bool bDrawRect) { if ( getButton(MP_PREFS_STRIPE )->isPressed() ) { for( int i = 0; i < playerCount; i++ ) { if ( players[i].commanderID == MPlayer->commanderID ) { for ( int j = FIRST_COLOR_RECT; j < LAST_COLOR_RECT+1; j++ ) { if ( MPlayer->colors[players[i].stripeColor] == rects[j].getColor() ) { GUI_RECT rect = { rects[j].globalX() - 1, rects[j].globalY() - 1, rects[j].right(), rects[j].bottom() }; if ( bDrawRect ) drawEmptyRect( rect, 0xffffffff, 0xffffffff ); break; } } } } } MC2Player* pInfo = MPlayer->getPlayerInfo( MPlayer->commanderID ); rects[STRIPE_RECT].setColor( MPlayer->colors[pInfo->stripeColor] ); }
void aRect::render() { int32_t color = getColor(); if(isShowing()) //bOutline ? drawEmptyRect( getGUI_RECT(), color, color ) : drawRect( getGUI_RECT(), color ); bOutline ? drawEmptyRect(getGlobalGUI_RECT(), color, color) : drawRect(getGlobalGUI_RECT(), color); }
void AttributeMeter::render(int32_t xOffset, int32_t yOffset) { int32_t i; if(!bShow) return; float barCount = percent * numBars; int32_t nBarCount = (int32_t)barCount; float remainder = addedPercent * numBars + (barCount - float(nBarCount)); int32_t nAddedCount = (int32_t)remainder; RECT tmpOutside = outsideRect; tmpOutside.left += xOffset; tmpOutside.right += xOffset; tmpOutside.top += yOffset; tmpOutside.bottom += yOffset; //drawRect( tmpOutside, 0xff000000 ); drawEmptyRect(tmpOutside, rectColor, rectColor); RECT tmpRect; tmpRect.left = outsideRect.left + 2 * skipWidth + xOffset; tmpRect.right = tmpRect.left + unitWidth; tmpRect.top = outsideRect.top + 2 * skipWidth + yOffset; tmpRect.bottom = outsideRect.bottom - 2 * skipWidth + yOffset; int32_t color = colorMin; tmpRect.bottom += skipWidth; for(i = 0; i < nBarCount; i++) { drawRect(tmpRect, color); color = interpolateColor(colorMin, colorMax, ((float)i) / (float)numBars); tmpRect.left += unitWidth + skipWidth; tmpRect.right = tmpRect.left + unitWidth; } for(i = 0; i < nAddedCount; i++) { drawRect(tmpRect, color); color = interpolateColor(addedColorMin, addedColorMax, ((float)i) / (float)numBars); tmpRect.left += unitWidth + skipWidth; tmpRect.right = tmpRect.left + unitWidth; } tmpRect.bottom -= skipWidth; tmpRect.right -= 1; for(i = nBarCount + nAddedCount; i < numBars; i++) { drawEmptyRect(tmpRect, rectColor, rectColor); tmpRect.left += unitWidth + skipWidth; tmpRect.right = tmpRect.left + unitWidth - 1; } }
void aRect::render(int32_t x, int32_t y) { // RECT tmpRect = getGUI_RECT(); RECT tmpRect = getGlobalGUI_RECT(); tmpRect.left += x; tmpRect.right += x; tmpRect.top += y; tmpRect.bottom += y; int32_t color = getColor(); bOutline ? drawEmptyRect(tmpRect, color, color) : drawRect(tmpRect, color); }
void aScrollBar::render() { topButton.moveTo( globalX() + 2, topButton.globalY() ); bottomButton.moveTo( globalX() + 2, bottomButton.globalY() ); scrollTab.moveTo( globalX() + 2, scrollTab.globalY() ); aObject::render(); GUI_RECT area = { location[0].x, location[0].y, location[2].x, location[2].y }; drawEmptyRect( area, color, color ); }
void mcScrollButton::render() { if ( isShowing() && state != DISABLED ) { setColor( regularColor ); aButton::render(); GUI_RECT rect = { globalX(), globalY(), globalRight()-1, globalBottom()-1 }; drawEmptyRect( rect, lightEdge, darkEdge ); } }
void DeadPilotListItem::render() { if ( !showWindow ) return; GUI_RECT tmp; tmp.left = globalX(); tmp.right = globalX() + width(); tmp.top = globalY(); tmp.bottom = globalY() + height(); aObject::render(); drawEmptyRect( tmp, s_area->getColor(), s_area->getColor() ); liveIcon->render( globalX() + s_liveIconRect->left(), globalY() + s_liveIconRect->top(), globalX() + s_liveIconRect->left() + s_liveIconRect->width(), globalY() + s_liveIconRect->top() + s_liveIconRect->height() ); tmp.left = globalX() + s_liveIconRect->left(); tmp.top = globalY() + s_liveIconRect->top(); tmp.right = globalX() + s_liveIconRect->left() + s_liveIconRect->width(); tmp.bottom = globalY() + s_liveIconRect->top() + s_liveIconRect->height(); drawEmptyRect( tmp, s_liveIconRect->getColor(), s_liveIconRect->getColor() ); deadIcon->render( globalX() + s_deadIconRect->left(), globalY() + s_deadIconRect->top(), globalX() + s_deadIconRect->left() + s_deadIconRect->width(), globalY() + s_deadIconRect->top() + s_deadIconRect->height() ); tmp.left = globalX() + s_deadIconRect->left(); tmp.top = globalY() + s_deadIconRect->top(); tmp.right = globalX() + s_deadIconRect->left() + s_deadIconRect->width(); tmp.bottom = globalY() + s_deadIconRect->top() + s_deadIconRect->height(); drawEmptyRect( tmp, s_deadIconRect->getColor(), s_deadIconRect->getColor() ); }
void MPPrefs::updateBaseColors( const MC2Player* players, long playerCount, bool bDrawRect ) { if ( getButton(MP_PREFS_BASE )->isPressed() ) { for( int i = 0; i < playerCount; i++ ) { if ( players[i].commanderID == MPlayer->commanderID ) { for ( int j = FIRST_COLOR_RECT; j < LAST_COLOR_RECT+1; j++ ) { if ( MPlayer->colors[players[i].baseColor[BASECOLOR_PREFERENCE]] == rects[j].getColor() ) { GUI_RECT rect = { rects[j].globalX() - 1, rects[j].globalY() - 1, rects[j].right(), rects[j].bottom() }; if ( bDrawRect ) drawEmptyRect( rect, 0xffffffff, 0xffffffff ); break; } } } else { for ( int j = FIRST_COLOR_RECT; j < LAST_COLOR_RECT+1; j++ ) { if ( MPlayer->colors[players[i].baseColor[BASECOLOR_SELF]] == rects[j].getColor() && bDrawRect ) { statics[21].moveTo( rects[j].globalX(), rects[j].globalY() ); statics[21].render(); break; } } } } } MC2Player* pInfo = MPlayer->getPlayerInfo( MPlayer->commanderID ); rects[BASE_RECT].setColor( MPlayer->colors[pInfo->baseColor[BASECOLOR_PREFERENCE]] ); }
void ObjectSelectionBrush::render( int screenX, int screenY ) { if ( bPainting ) { //------------------------------------------ Stuff::Vector4D Screen; eye->projectZ( lastWorldPos, Screen ); GUI_RECT rect = { screenX, screenY, Screen.x, Screen.y }; drawRect( rect, 0x30ffffff ); drawEmptyRect( rect, 0xff000000, 0xff000000 ); } if ( !bPainting ) { EditorInterface::instance()->ChangeCursor( IDC_TARGET ); } }
void InfoWindow::drawSkillBar( int skill, float yVal, float height ) { float left = InfoWindow::SKILLLEFT; float right = InfoWindow::SKILLRIGHT; int barCount = skill/InfoWindow::NUMBERSKILLBARS; int redIncrement = 0; int greenIncrement = 0; int blueIncrement = 0; if ( barCount ) { redIncrement = (205/barCount) << 16; greenIncrement = ((234-83)/barCount) << 8; blueIncrement = (255 - 146)/barCount; } unsigned long color = 0xff005392; GUI_RECT outSideRect = { left - SKILLSKIP + .5, yVal - .5, right + SKILLSKIP + .5, yVal + height + 1.5}; drawRect( outSideRect, 0xff000000 ); GUI_RECT rect = { left + InfoWindow::SKILLSKIP, yVal + InfoWindow::SKILLSKIP + .5, left + InfoWindow::SKILLSKIP + SKILLUNITWIDTH, yVal + height - InfoWindow::SKILLSKIP + .5 }; drawEmptyRect( outSideRect, 0xff002f55, 0xff002f55 ); for ( int i = 0; i < barCount; i++ ) { drawRect( rect, color ); color += redIncrement; color += greenIncrement; color += blueIncrement; rect.left += SKILLUNITWIDTH + 1; rect.right = rect.left + SKILLUNITWIDTH; } char buffer[32]; sprintf( buffer, "%ld", skill ); componentFont.render( buffer, SKILLRIGHT+2, yVal, SCROLLLEFT - SKILLRIGHT - 2, SKILLHEIGHT, 0xff005392, 0, 0 ); }
void InfoWindow::render() { drawScrollingStuff(); GUI_RECT tmpRect = { SCROLLBOXLEFT, SCROLLBOXBOTTOM, SCROLLBOXRIGHT, INFOTOP + INFOHEIGHT }; drawRect( tmpRect, 0xff000000 ); for ( int i = 0; i < 2; i++ ) { if ( buttons[i].isEnabled() ) buttons[i].render(); } long scrollBarLength = buttons[1].location[0].y - buttons[0].location[2].y - 4 - SCROLLBUTTONHEIGHT; gos_VERTEX v[4]; for ( i = 0; i < 4; i++ ) { v[i].argb = 0xff5c96c2; v[i].frgb = 0; v[i].rhw = .5; v[i].x = SCROLLBUTTONX; v[i].y = SCROLLMIN + scrollPos; v[i].z = 0.f; v[i].u = v[i].v = 0.f; // v[i].u = ((float)SCROLLBUTTONU)/256.f + .1/256.f; // v[i].v = ((float)SCROLLBUTTONV)/256.f + .1/256.f ; } if ( infoLength < scrollBarLength || !pUnit ) { buttons[0].disable( 1 ); buttons[1].disable( 1 ); SCROLLMAX = 0; } else { buttons[0].disable( 0 ); buttons[1].disable( 0 ); float physicalRange = buttons[1].location[0].y - buttons[0].location[2].y; float buttonHeight = SCROLLBUTTONHEIGHT; float RealRange = infoLength; buttonHeight = physicalRange * physicalRange/(physicalRange + RealRange); if ( buttonHeight < SCROLLBUTTONHEIGHT ) buttonHeight = SCROLLBUTTONHEIGHT; SCROLLMAX = buttons[1].location[0].y - buttonHeight - 2; v[2].x = v[3].x = SCROLLBUTTONX + SCROLLBUTTONWIDTH; v[1].y = v[2].y = SCROLLBOTTOM; v[1].y = v[2].y = v[0].y + buttonHeight; // v[2].u = v[3].u = .1/256.f + (float)(SCROLLBUTTONU + ((float)SCROLLBUTTONWIDTH))/256.f; // v[1].v = v[2].v = .1/256.f + (float)(SCROLLBUTTONV + ((float)SCROLLBUTTONHEIGHT))/256.f; gos_SetRenderState( gos_State_Texture, 0 ); gos_DrawQuads( v, 4 ); } // draw the name of the unit if ( pUnit ) { drawName( pUnit->getIfaceName() ); gos_SetRenderState( gos_State_Texture, 0 ); // draw the health bar DWORD color; float barStatus = pUnit->getAppearance()->barStatus; if (barStatus > 1.0f) barStatus = 1.0f; if (barStatus >= 0.5) color = SB_GREEN; else if (barStatus > 0.2) color = SB_YELLOW; else color = SB_RED; v[0].x = v[1].x = HEALTHLEFT; v[2].x = v[3].x = HEALTHRIGHT; v[0].y = v[3].y = HEALTHTOP; v[1].y = v[2].y = HEALTHBOTTOM; unsigned long dimColor = ( color & 0xff7f7f7f ); for ( int i = 0; i < 4; i++ ) v[i].argb = dimColor; gos_DrawQuads( v, 4 ); v[2].x = v[3].x = HEALTHLEFT + (HEALTHRIGHT - HEALTHLEFT)* barStatus; for ( i = 0; i < 4; i++ ) v[i].argb = color | 0xff000000; gos_DrawQuads( v, 4 ); } else { char noUnit[256]; cLoadString( IDS_NOUNIT, noUnit, 255 ); drawName( noUnit ); } GUI_RECT border = { SCROLLBOXLEFT, SCROLLBOXTOP, SCROLLBOXRIGHT, SCROLLBOXBOTTOM }; drawEmptyRect( border, SCROLLCOLOR, SCROLLCOLOR ); GUI_RECT rect = { SCROLLLEFT, SCROLLTOP, SCROLLRIGHT, SCROLLBOTTOM }; drawEmptyRect( rect, SCROLLCOLOR, SCROLLCOLOR ); }
void ActivePilotListItem::render() { if ( !showWindow ) return; float timeOffset = 0; if ( pilot->killedIcons.Count() ) timeOffset += 1.5 + .5 * pilot->killedIcons.Count(); if ( currentTime - timeOffset > 0 ) { medalAwardedText.setColor( s_medalAwardedAnim->getColor( currentTime - timeOffset ) ); if ( currentTime - timeOffset > 1.5 ) { float tmpTime = currentTime - timeOffset - 1.5; for ( int i = 0; i < medalCount; i++ ) { if ( tmpTime > 0.f ) { if ( !medalIcons[i]->isShowing() ) // play sound when it shows up { soundSystem->playDigitalSample( LOG_PILOTMEDAL ); } medalIcons[i]->showGUIWindow( true ); medalTexts[i]->showGUIWindow( true ); } tmpTime -= .5f; } } } else { medalAwardedText.setColor( 0 ); for ( int i = 0; i < medalCount; i++ ) { medalIcons[i]->showGUIWindow( 0 ); medalTexts[i]->showGUIWindow( 0 ); } } if ( medalCount ) timeOffset += (1.5 + .5 * medalCount); if ( currentTime - timeOffset > 0 ) { if ( promotionText.getColor() == 0 && currentTime - timeOffset < .3 && pilot->promotePilot() ) { soundSystem->playDigitalSample( LOG_PROMOTED ); } promotionText.setColor( s_pilotPromotedAnim->getColor( currentTime -timeOffset ) ); } else { promotionText.setColor( 0 ); } bool bCanBeDone = currentTime > flashTime(); aObject::render(); GUI_RECT tmp; tmp.left = s_area->left(); tmp.top = globalY() + s_area->top(); tmp.right = tmp.left + s_area->width(); tmp.bottom = tmp.top + s_area->height(); drawEmptyRect( tmp, s_area->getColor(), s_area->getColor() ); // now do same thing with line.... tmp.right = tmp.left + s_totalWidth; tmp.top -= 12; tmp.bottom = tmp.top + 2; drawRect( tmp, 0xff002f55 ); pilotIcon->render( globalX() + s_iconRect->left(), globalY() + s_iconRect->top(), globalX() + s_iconRect->right(), globalY() + s_iconRect->bottom() ); long color = s_skillAnim->getColor( currentTime ); for ( int i = 0; i < 4; i++ ) { attributeMeters[i].setAddedColorMax( color ); attributeMeters[i].setAddedColorMin( color ); attributeMeters[i].render(globalX(), globalY()); } //for ( i = 0; i < 5; i++ ) for ( i = 0; i < 9; i++ ) //magic 12042011 { tmp = s_outline[i]->getGUI_RECT(); tmp.left += globalX(); tmp.top += globalY(); tmp.right += globalX(); tmp.bottom += globalY(); drawEmptyRect( tmp, s_outline[i]->getColor(), s_outline[i]->getColor() ); } long x = globalX() + s_killIconRect->left(); long y = globalY() + s_killIconRect->top(); int counter = 0; int oldPossible = 2.0 * (currentTime - frameLength - 1.5); int numPossible = 2.0 * (currentTime - 1.5); if ( currentTime - 1.5 < 0 ) numPossible = -1; if (currentTime - 1.5 - frameLength < 0 ) oldPossible = -1; if ( numPossible > 0 && promotionShown && bCanBeDone ) // finish when all of the dead guys are rendered bDone = true; // when adding a new icon, play sound if ( oldPossible != numPossible && numPossible < pilot->killedIcons.Count() ) { soundSystem->playDigitalSample( LOG_KILLMARKER, Stuff::Vector3D(-9999.0f,-9999.0,-9999.0f), true ); } for ( EList< ForceGroupIcon*, ForceGroupIcon* >::EIterator iter = pilot->killedIcons.Begin(); !iter.IsDone(); iter++ ) { if ( counter > numPossible ) break; if ( counter && !(counter % 8) ) { y += s_killIconRect->height() + 1; x = globalX() + s_killIconRect->left(); } (*iter)->renderUnitIcon( x, y, x + s_killIconRect->width(), y + s_killIconRect->height() ); x += s_killIconRect->width() + 1; counter++; } }
void InfoWindow::drawScrollingStuff() { if ( !pUnit ) return; float offset = 0.f; if ( infoLength ) { float increment = infoLength/(SCROLLMAX - SCROLLMIN ); offset = -increment * scrollPos; } float curY = SCROLLBOXTOP + SECTIONSKIP + offset; if ( icon ) { if ( SCROLLTOP + offset > NAMETOP ) // draw icons if visible { icon->renderUnitIcon( MECHLEFT, curY, MECHRIGHT, curY + MECHHEIGHT); icon->renderUnitIconBack( MECHBACKLEFT, curY, MECHBACKRIGHT, curY + MECHHEIGHT ); } curY += MECHHEIGHT + SECTIONSKIP; if( curY > NAMEBOTTOM ) // draw divider if visible drawDivider( curY ); } long textColors[4] = { 0xff6E7C00, 0xff005392, 0xffA21600 }; char disabledCount[60][2]; long ammo[60]; char ranges[60]; long names[60]; memset( disabledCount, 0, sizeof( char ) * 60 * 2); memset( names, 0, sizeof( char* ) * 60 ); memset( ranges, 0, sizeof( char ) * 60 ); memset( ammo, 0, sizeof( long ) * 60 ); bool bDraw[4]; memset( bDraw, 0, sizeof( bool ) * 4 ); int curComponentCount = 60; int i = 0; for (long curWeapon = pUnit->numOther; curWeapon < (pUnit->numOther + pUnit->numWeapons); curWeapon++) { long nName = pUnit->inventory[curWeapon].masterID; bool bFound = 0; for ( int j = 0; j < i; j++ ) { if ( nName == names[j] ) { disabledCount[j][1] ++; if (!pUnit->inventory[curWeapon].disabled && (pUnit->getWeaponShots(curWeapon) > 0) && pUnit->inventory[curWeapon].health > 0 ) { disabledCount[j][0]++; } bFound = true; } } if ( bFound ) continue; names[i] = nName; //ONly need to add in the AMMO once!! // Glenn has taken the liberty of combining all shots of this type // into one master ammo list!! if ( MasterComponent::masterList[pUnit->inventory[curWeapon].masterID].getWeaponAmmoType() == WEAPON_AMMO_NONE || g_unlimitedAmmo ) ammo[i] = -1; else ammo[i] += pUnit->getWeaponShots( curWeapon ); int range = MasterComponent::masterList[pUnit->inventory[curWeapon].masterID].getWeaponRange(); ranges[i] = range; bDraw[range] = true; if (!pUnit->inventory[curWeapon].disabled && (pUnit->getWeaponShots(curWeapon) > 0) && pUnit->inventory[curWeapon].health > 0 ) { disabledCount[i][0]++; } disabledCount[i][1]++; i++; } curY += SECTIONSKIP; unsigned long height = componentFont.height(); // removing headers for now // long stringIDs[4] = { IDS_SHORT, IDS_MEDIUM, IDS_LONG, IDS_COMPONENT}; // long headerColors[4] = { 0xFFC8E100, 0xff0091FF, 0xFFFF0000, 0xffFF8A00 }; EString capHeader; for ( int j = 0; j < 3; j++ ) { if ( !bDraw[j] ) // make sure we have one continue; // char header[64]; if ( curY > NAMETOP ) { // cLoadString( stringIDs[j], header, 63 ); // capHeader = header; //capHeader.MakeUpper(); // componentFont.render( capHeader, COMPONENTLEFT, curY, SCROLLLEFT - COMPONENTLEFT, height, headerColors[j], 0, 0 ); } // curY += height; for ( i = 0; i < curComponentCount; i++ ) { if ( !names[i] ) break; char tmpName[256]; if ( ranges[i] == j ) { if ( curY > NAMETOP ) { cLoadString( IDS_COMP_ABBR0 + names[i], tmpName, 255 ); capHeader.Format( "%ld/%ld %s", disabledCount[i][0], disabledCount[i][1], tmpName ); componentFont.render( capHeader, COMPONENTLEFT, curY, SCROLLLEFT - COMPONENTLEFT, height, textColors[j], 0, 0 ); } curY += height; if ( ammo[i] != -1 ) { if ( curY > NAMETOP ) { // make the ammo number char tmpNumber[64]; char tmpNumber2[64]; cLoadString( IDS_MISSION_SHOTSLEFT, tmpNumber, 63 ); sprintf( tmpNumber2, tmpNumber, ammo[i] ); componentFont.render( tmpNumber2, COMPONENTLEFT, curY, SCROLLLEFT - COMPONENTLEFT, height, textColors[j], 0, 0 ); } curY += height; } } } curY += SECTIONSKIP; if ( curY > NAMEBOTTOM ) drawDivider( curY ); curY += SECTIONSKIP; } memset( names, 0, sizeof( char* ) * 60 ); long count[4]; count[0] = pUnit->ecm; count[1] = pUnit->probe; count[2] = pUnit->jumpJets; count[3] = pUnit->isMech() ? pUnit->sensor : 255; if ((count[0] || count[1] || count[2] || count[3] ) ) { if ( curY > NAMETOP ) { // cLoadString( stringIDs[j], header, 63 ); // componentFont.render( header, COMPONENTLEFT, curY, SCROLLLEFT - COMPONENTLEFT, height, headerColors[j], 0, 0 ); } // curY += height; } for ( curWeapon = 0; curWeapon < 4; curWeapon++ ) { if ( count[curWeapon] != 255) { long color = 0xffc29b00; //Neither the ecm, probe, sensors or JumpJets can ever REALLY be disabled. No matter what the setting is!! // if (pUnit->inventory[count[curWeapon]].disabled) // color = 0xff7f7f7f; char tmpName[256]; cLoadString( IDS_COMP_ABBR0 + pUnit->inventory[count[curWeapon]].masterID, tmpName, 255 ); if ( curY > NAMETOP ) { componentFont.render( tmpName, COMPONENTLEFT, curY, SCROLLLEFT - COMPONENTLEFT, height, color, 0, 0 ); } curY += height; curY += InfoWindow::SECTIONSKIP; } } if ( curY > NAMEBOTTOM ) drawDivider( curY ); curY += SECTIONSKIP; // DON'T DO PILOT INFO if ENEMY OR mech is destroyed or disabled. if ( pUnit->getTeam() && !Team::home->isEnemy(pUnit->getTeam()) && pUnit->isMech() && !pUnit->isDisabled() && !pUnit->isDestroyed()) { MechWarrior* pWarrior = pUnit->getPilot(); if ( icon ) { if ( curY > NAMETOP ) { if ( pWarrior->active() ) icon->renderPilotIcon( PILOTLEFT, curY, PILOTRIGHT, curY + PILOTHEIGHT ); GUI_RECT tmpRect = { PILOTLEFT, curY, PILOTRIGHT + 1, curY + PILOTHEIGHT + 1 }; drawEmptyRect( tmpRect, SCROLLCOLOR, SCROLLCOLOR ); float right = SCROLLLEFT; float top = curY + PILOTHEIGHT/2 - height/2; float bottom = top + height; // draw the name of the pilot char deadPilotName[256]; cLoadString( IDS_NOPILOT, deadPilotName, 255 ); capHeader = pWarrior->active() ? pWarrior->getName() : deadPilotName; componentFont.render( capHeader, PILOTNAMELEFT, top, right - PILOTNAMELEFT, bottom - top, 0xff005392, 0, 0 ); } curY += PILOTHEIGHT; curY += SECTIONSKIP; } curY += SECTIONSKIP; int rank = pWarrior->getRank(); int skills[2] = { MWS_GUNNERY, MWS_PILOTING }; char buffer[256]; //ACE not continguous with other ranks. Added too late! if (rank != 4) cLoadString( IDS_GREEN + rank, buffer, 256 ); else cLoadString( IDS_ACE, buffer, 256 ); if ( curY > NAMETOP ) { componentFont.render( buffer, SKILLLEFT, curY, SCROLLLEFT - SKILLLEFT, height, 0xff005392, 0, 0 ); } int currentSkill = rank; for ( j = 0; j < 3; j ++ ) { gos_VERTEX v[4]; float height = skillInfos[currentSkill].location[1].y - skillInfos[currentSkill].location[0].y; for ( i = 0; i < 4; i++ ) { v[i] = skillInfos[currentSkill].location[i]; v[i].y = curY; v[i].rhw = .5; } v[1].y = v[2].y = curY + height; if ( curY > NAMETOP ) { GUI_RECT tmpRect = { v[0].x - .5, v[0].y - .5, v[2].x + 1.5, v[2].y + 1.5 }; drawEmptyRect( tmpRect, 0xff002f55, 0xff002f55 ); unsigned long gosID = mcTextureManager->get_gosTextureHandle( skillInfos[currentSkill].textureHandle ); gos_SetRenderState( gos_State_Texture, gosID ); gos_DrawQuads( v, 4 ); if ( j != 0 ) { int skill = pWarrior->getSkill( skills[j-1] ); drawSkillBar( skill, curY, height ); } } curY += height; curY += SECTIONSKIP; currentSkill = j + 5; } for ( i = 0; i < NUM_SPECIALTY_SKILLS; i++ ) { if ( pWarrior->specialtySkills[i] ) { if ( curY > NAMETOP ) { cLoadString( IDS_SPECIALTY + i, buffer, 256 ); componentFont.render( buffer, NAMELEFT, curY, NAMERIGHT - NAMELEFT, height, 0xff005392, 0, 0 ); } curY += height; } } } else curY += 10 * SECTIONSKIP; if ( infoLength == 0 ) infoLength = curY - SCROLLTOP - ( SCROLLBOTTOM - SCROLLTOP ); }