void DrawSmartCardCredits( OptionsRefCon *optionGlobals, short numCreds ) { short oldFont; char buffer[8]; StatTextDesc *STDPtr; xyString *s; SetCurrentDevice( kScrollA ); STDPtr = (StatTextDesc *)((optionGlobals->theDitlList)->items[kSmartCardCredits].objectData); oldFont = GetCurFont (); SetCurFont( STDPtr->font ); SetupTextGDevice( &(optionGlobals->textRect), optionGlobals->textPatterns ); SetFontColors( STDPtr->color0, STDPtr->color1, STDPtr->color2, STDPtr->color3 ); if (numCreds >= 0) { SegaNumToString( numCreds, buffer ); DrawPaddedClippedSegaText( (STDPtr->animationData).xPos, (STDPtr->animationData).yPos, 6*8, kJustifyLeft, buffer ); } else { s = (xyString *)DBGetItem( kStringType, kNoSmartCardPresentString ); DrawPaddedClippedSegaText( (STDPtr->animationData).xPos, (STDPtr->animationData).yPos, 6*8, kJustifyLeft, s->cString ); } SetCurFont ( oldFont ); }
static long ChooseTauntSetup( ScreenParams *params ) { ChooseTauntGlobals *choose; KeyboardEntryLayout *keyLayout; segaCharRect tbRect; Point boxLocation; Rect boxRect; DisableDefDialogs(); choose = (ChooseTauntGlobals *)NewMemory( kTemp, sizeof(ChooseTauntGlobals) ); EraseGDevice ( kScrollA ); SetBackdropID ( kBlackBackground, true, 0 ); GetScreenLayoutPoint( kChooseTauntScreen, kTauntEntryBoxLocation, &boxLocation ); choose->typingBox = DrawDBGraphicAt( 0, kTauntEntryField, boxLocation.h>>3, boxLocation.v>>3, kScrollB ); SetCurrentDevice( kScrollA ); SetCurFont( kXBandHeavy ); SetFontColors( 0, 11, 10, 0 ); choose->titlePatterns = DrawScreenLayoutString( kChooseTauntScreen, kTauntHeadlineString ); SetCurFont( kXBandLight9Font ); SetFontColors( 0, 9, 8, 0 ); choose->descriptionPatterns = BoxScreenLayoutString( kChooseTauntScreen, kTauntDescriptionString, kTauntDescriptionRect, kJustLeft ); GetScreenLayoutCharRect( kChooseTauntScreen, kTauntJizzleRect, &tbRect ); choose->tbRef = DrawTextBox( &tbRect, kGreenColor, kScrollA ); StartTextBoxAnimation( choose->tbRef, 10 ); keyLayout = SetupKeyboardEntryLayout( kChooseTauntKeyboardEntry ); choose->keyRef = InitKeyboardEntry( keyLayout, 0 ); choose->keyLayout = keyLayout; SetKeyboardEntryMeasureProc( choose->keyRef, TauntMeasureProc ); /* Place the existing taunt in the entry field */ { char *existingTaunt; existingTaunt = (char *)GetPersonificationPart( GetCurrentLocalUser()->userID, kPersonificationTauntText ); StuffCurrentKeyboardField( choose->keyRef, existingTaunt ); } return (long) choose; }
BOOL COptionTreeItemFont::CreateFontItem(LOGFONT lfFont, COLORREF crFontColor, LOGFONT lfDefaultFont, COLORREF crDefaultFontColor, DWORD dwOptions) { // Make sure options is not NULL if (m_otOption == NULL) { return FALSE; } // Save options m_dwOptions = dwOptions; // Set font SetCurFont(lfFont); // Set default font SetDefaultFont(lfDefaultFont); // Set color SetTextColor(crFontColor); // Set default font color SetDefaultTextColor(crDefaultFontColor); // Get default height m_lDefaultHeight = GetHeight(); return TRUE; }
BOOL COptionTreeItemFont::CreateFontItem(CHARFORMAT cfFont, COLORREF crFontColor, DWORD dwOptions) { // Declare variables LOGFONT lfFont; // Make sure options is not NULL if (m_otOption == NULL) { return FALSE; } // Save options m_dwOptions = dwOptions; // Set font ConvertFont(lfFont, cfFont); SetCurFont(lfFont); // Set color SetTextColor(crFontColor); // Get default height m_lDefaultHeight = GetHeight(); return TRUE; }
static void _AddPWChar( ChoosePasswordGlobals* choose, long command ) { short tempX; char dotText[10]; short index; // if it's "A" "B" or "C", add it to the string if (( command & kAllLetters) && !( command & ~kAllLetters) ) { PlayDBFX( kPasswordEntrySnd, 0, 0 ); if (choose->newPWFill >= kMaxPWLength) { return; } choose->newPW[choose->newPWFill++] = command; // record a stroke tempX = choose->txX; for (index=0; index<choose->newPWFill; ++index) dotText[index] = kDotText; dotText[choose->newPWFill] = 0; SetCurFont(kMain2BitFont); SetFontColors( kDotColor0, kDotColor1, kDotColor2, kDotColor3 ); DrawSegaString( &tempX, &choose->txY, dotText ); VDPIdle(); } }
static long ChoosePasswordSetup( ScreenParams *params ) { ChoosePasswordGlobals *choose; Point boxLocation; segaCharRect tbRect; choose = (ChoosePasswordGlobals *)NewMemory( kTemp, sizeof(ChoosePasswordGlobals)); choose->addPWChar = (ChoosePasswordProc) _AddPWChar; choose->doubleCheckAndSetPassword = (ChoosePasswordProc) _DoubleCheckAndSetPassword; choose->resetEnteredPassword = (ChoosePasswordProc) _ResetEnteredPassword; choose->setupPWChar = (ChoosePasswordProc) _SetupPWChar; choose->charSprite = 0; // zero allocations choose->textState = 0; EraseGDevice ( kScrollA ); SetBackdropID ( kBlackBackground, true, 0 ); SetCurrentDevice( kScrollA ); GetScreenLayoutPoint( kChoosePasswordScreen, kLayoutBoxPoint, &boxLocation ); choose->boxGraphic = DrawDBGraphicAt( 0, kPasswordBox, boxLocation.h>>3, boxLocation.v>>3, kScrollA ); SetCurrentDevice( kScrollA ); SetCurFont( kXBandHeavy ); SetFontColors( 0, 11, 10, 0 ); choose->titlePatterns = DrawScreenLayoutString( kChoosePasswordScreen, kLayoutTitleString ); SetCurFont( kXBandLight9Font ); SetFontColors( 0, 9, 8, 0 ); choose->descriptionPatterns = BoxScreenLayoutString( kChoosePasswordScreen, kLayoutDescriptionString, kLayoutDescriptionRect, kJustLeft ); SetFontColors( 0, kDarkPurpleColor, kPurpleColor, 0 ); choose->donePatterns = DrawScreenLayoutString( kChoosePasswordScreen, kLayoutDoneString ); GetScreenLayoutCharRect( kChoosePasswordScreen, kLayoutJizzleRect, &tbRect ); choose->jizzleRef = DrawTextBox( &tbRect, kGreenColor, kScrollA ); StartTextBoxAnimation( choose->jizzleRef, 10 ); SetupPWChar( choose ); return (long) choose; }
static long ShowDescriptionString( XSetupGlobals *setup, DBID stringID ) { char *string = GetSegaString( stringID ); if (string) { SetupTextGDevice( &setup->descriptionRect, setup->descriptionPatterns ); SetCurFont( kXBandBold10Font ); SetFontColors( 0, kDarkGreenColor, kGreenColor, 0 ); DrawPaddedClippedSegaText( 0, 0, kPadWidth, kJustCenter, string ); } }
long XSetupSetup( ScreenParams *params ) { XSetupGlobals *setup; Point *xPosition; segaCharRect jizzleRect; char *phoneString; phoneNumber *local1, *local2; setup = (XSetupGlobals *)NewMemory( kTemp, sizeof(XSetupGlobals) ); EraseGDevice ( kScrollA ); SetBackdropID ( kBlackBackground, true, 0 ); SetCurrentDevice( kScrollA ); SetCurFont( kXBandHeavy ); SetFontColors( 0, kDarkYellowColor, kYellowColor, 0 ); setup->titlePatterns = DrawScreenLayoutString( kXBandSetupScreen, kSetupTitleString ); setup->bgGraphic = DrawDBGraphicAt( 0, kSettingsIcon, 29, 2, kScrollA ); setup->lineGraphic = DrawDBGraphicAt( 0, kGrayHorizontalLine, 5, 18, kScrollA ); GetScreenLayoutCharRect( kXBandSetupScreen, 0, &jizzleRect ); setup->jizzle = DrawTextBox( &jizzleRect, 8, kScrollA ); StartTextBoxAnimation( setup->jizzle, 10 ); GetScreenLayoutCharRect( kXBandSetupScreen, kSetupDescriptionRect, &setup->descriptionRect ); setup->descriptionPatterns = LinearizeScreenArea( &setup->descriptionRect, 0 ); // Accept Challenges: setup->radioRefs[kAcceptChallengesButton] = SetupRadioButton( kAcceptChallengesButton+1, phoneString ); RadioButtonSetSelection(setup->radioRefs[kAcceptChallengesButton], GetAcceptChallengesOption( GetCurUserID() ) ); DrawRadioButton( setup->radioRefs[kAcceptChallengesButton] ); // Call Waiting: setup->radioRefs[kCallWaitingButton] = SetupRadioButton( kCallWaitingButton+1, nil ); RadioButtonSetSelection(setup->radioRefs[kCallWaitingButton], GetCallWaitingOption( GetCurUserID() ) ); DrawRadioButton(setup->radioRefs[kCallWaitingButton]); // Calling From: phoneString = (char *) GetBoxPhoneNumber()->phoneNumber; GetLocalAccessPhoneNumber(&local1, &local2); if ( local1->phoneNumber[0] == 0 ) { phoneString = GetSegaString(kBoxPhoneNumber); setup->newPhoneNumber = true; } else setup->newPhoneNumber = false; setup->radioRefs[kIMovedButton] = SetupRadioButton( kIMovedButton+1, phoneString ); RadioButtonSetSelection(setup->radioRefs[kIMovedButton], setup->newPhoneNumber || GetIMovedOption() ); DrawRadioButton( setup->radioRefs[kIMovedButton] ); // Keyboard Type: setup->radioRefs[kKeyboardButton] = SetupRadioButton( kKeyboardButton+1, nil ); RadioButtonSetSelection(setup->radioRefs[kKeyboardButton], GetQwertyKeyboardOption( GetCurUserID() ) ); DrawRadioButton( setup->radioRefs[kKeyboardButton] ); // Set active button setup->activeButton = kAcceptChallengesButton; ActivateRadioButton(setup->radioRefs[setup->activeButton]); VDPIdle(); // Set up the DITL setup->theDitlList = SetupDITLItemList( kXBandSetupScreen ); setup->myControlTable = SetupControlTable( kXBandSetupScreen ); NewDITL( setup->myControlTable, setup->theDitlList ); // Invalidate the description text setup->descriptionInvalid = true; return (long) setup; }
void RenderDITLTextButton( DITLItem *theItem ) { short pixelWidth; short clipWidth; short xCenter; short xLeft; short xCharOffset; short yCharOffset; TextButtonDesc *theTextButt; segaCharRect textRect; short cellWidth; short oldFont; TextButtGraphicsPriv * state; AnimationRef animation; short height; short adjheight; char *frameSequence; state = (TextButtGraphicsPriv *) theItem->refCon; if ( !state ) return; // // Draw the bitmap // theTextButt = (TextButtonDesc *)theItem->objectData; if( theTextButt->animationData.bitmap == 0 ) return; state->buttonID = theTextButt->buttonID; state->currentFrame = 0; state->x = theTextButt->animationData.xPos/8; state->y = theTextButt->animationData.yPos/8; frameSequence = DBGetItem( kButtonSequenceType, theTextButt->buttonID ); if (frameSequence) { state->frameCount = *(short *)frameSequence; state->frameSequence = frameSequence+sizeof(short); } else { state->frameSequence = nil; } state->fxSequence = DBGetItem( kButtonSequenceFXType, theTextButt->buttonID ); SetCurrentDevice( kScrollA ); state->buttReference = DrawGraphic( theTextButt->animationData.bitmap, theTextButt->animationData.xPos/8, theTextButt->animationData.yPos/8, 0, 0, 0 ); // // Figure out how to draw the text using the info in the refCon // clipWidth = theTextButt->pixelWidth; state->textSprite = 0; if( theTextButt->myCString[0] != 0 ) { oldFont = GetCurFont (); SetCurFont ( ((TextButtonDesc *) theItem->objectData)->font ); pixelWidth = MeasureSegaText( theTextButt->myCString ); if ( theTextButt->textXCenter == 0 ) { xLeft = theTextButt->animationData.bitmap->width << 2; } else { xLeft = theTextButt->textXCenter; } xLeft += theItem->xPos; xLeft -= (pixelWidth >> 1); cellWidth = ( (pixelWidth+7) + (xLeft & 7) ) >> 3; cellWidth = (cellWidth+3) & ~3; textRect.left = xLeft>>3; textRect.right = textRect.left + cellWidth; if ( theTextButt->textYTop == 0 ) { textRect.top = theTextButt->animationData.bitmap->height; } else { textRect.top = ( theTextButt->textYTop + 4 ) >> 3; } textRect.top += (theItem->yPos >> 3); height = GetCurFontHeight(); adjheight = height >> 3; if ( (adjheight << 3) < height ) adjheight++; textRect.bottom = textRect.top + adjheight; SetCurrentDevice( kScrollA ); state->textSprite = CreateTextSprite( &textRect, 0 ); if (state->textSprite) { SetFontColors( theTextButt->color0, theTextButt->color1, theTextButt->color2, theTextButt->color3 ); DrawClippedSegaText( 0, 0, clipWidth, theTextButt->myCString ); MoveSprite( state->textSprite, xLeft+128, (textRect.top<<3) + 128); DrawSprite( state->textSprite ); } SetCurFont ( oldFont ); }