Mercurial > mm7
comparison UI/UiGame.cpp @ 1672:f3986fd1a122
GameUI_DrawDialogue()
author | Ritor1 |
---|---|
date | Wed, 18 Sep 2013 20:36:18 +0600 |
parents | 5302a9811767 |
children | f84b8b2a875c eccd4278fc2f |
comparison
equal
deleted
inserted
replaced
1671:4bbb80c7dba7 | 1672:f3986fd1a122 |
---|---|
345 { | 345 { |
346 NPCData *pNPC; // ebx@2 | 346 NPCData *pNPC; // ebx@2 |
347 int pGreetType; // eax@2 | 347 int pGreetType; // eax@2 |
348 int pTextHeight; // esi@39 | 348 int pTextHeight; // esi@39 |
349 GUIButton *pButton; // eax@43 | 349 GUIButton *pButton; // eax@43 |
350 int v32; // ebx@93 | 350 int all_text_height; // ebx@93 |
351 int v38; // eax@95 | 351 signed int index; // esi@99 |
352 signed int v39; // esi@99 | |
353 signed int v40; // eax@102 | |
354 unsigned int v41; // ebx@102 | |
355 int v42; // edi@102 | 352 int v42; // edi@102 |
356 unsigned int v45; // ecx@104 | 353 int v45; |
357 unsigned __int16 pTextColor; // ax@104 | 354 unsigned __int16 pTextColor; // ax@104 |
358 GUIWindow window; // [sp+ACh] [bp-68h]@42 | 355 GUIWindow window; // [sp+ACh] [bp-68h]@42 |
359 char *Str; // [sp+100h] [bp-14h]@104 | |
360 GUIFont *pOutString; // [sp+10Ch] [bp-8h]@39 | 356 GUIFont *pOutString; // [sp+10Ch] [bp-8h]@39 |
361 char *pInString=NULL; // [sp+110h] [bp-4h]@32 | 357 char *pInString=NULL; // [sp+110h] [bp-4h]@32 |
362 | 358 |
363 if ( !pDialogueWindow ) | 359 if ( !pDialogueWindow ) |
364 return; | 360 return; |
588 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[658]); // Collect Prize | 584 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[658]); // Collect Prize |
589 } | 585 } |
590 } | 586 } |
591 | 587 |
592 // Install Buttons(Установка кнопок)-------- | 588 // Install Buttons(Установка кнопок)-------- |
593 v32 = 0; | 589 index = 0; |
594 //v35 = (uint)pDialogueWindow->pStartingPosActiveItem; | 590 all_text_height = 0; |
595 for ( int i = pDialogueWindow->pStartingPosActiveItem; i < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; ++i ) | 591 for ( int i = pDialogueWindow->pStartingPosActiveItem; |
592 i < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; ++i ) | |
596 { | 593 { |
597 pButton = pDialogueWindow->GetControl(i); | 594 pButton = pDialogueWindow->GetControl(i); |
598 if ( !pButton ) | 595 if ( !pButton ) |
599 break; | 596 break; |
600 v38 = pFontArrus->CalcTextHeight(pButton->pButtonName, &window, 0, 0); | 597 all_text_height += pFontArrus->CalcTextHeight(pButton->pButtonName, &window, 0, 0); |
601 v32 += v38; | 598 index++; |
602 //++v35; | 599 } |
603 } | 600 if ( index ) |
604 v39 = pDialogueWindow->pNumPresenceButton; | 601 { |
605 if ( v39 ) | 602 v45 = (174 - all_text_height) / index; |
606 { | 603 if ( v45 > 32 ) |
607 pOutString = (GUIFont *)((174 - v32) / v39); | 604 v45 = 32; |
608 if ( (174 - v32) / v39 > 32 ) | 605 v42 = (174 - v45 * index - all_text_height)/ 2 - v45 / 2 + 138; |
609 pOutString = (GUIFont *)32; | 606 for ( int i = pDialogueWindow->pStartingPosActiveItem; |
610 int v55 = 1; | 607 i < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++i ) |
611 v40 = 174 - (int)pOutString * v39 - v32; | 608 { |
612 v41 = pDialogueWindow->pStartingPosActiveItem; | 609 pButton = pDialogueWindow->GetControl(i); |
613 v42 = v40 / 2 - (signed int)pOutString / 2 + 138; | 610 if ( !pButton ) |
614 if ( (signed int)v41 < (signed int)(v41 + v39) ) | 611 break; |
615 { | 612 pButton->uY = (unsigned int)(v45 + v42); |
616 do | 613 pTextHeight = pFontArrus->CalcTextHeight(pButton->pButtonName, &window, 0, 0); |
617 { | 614 pButton->uHeight = pTextHeight; |
618 pButton = pDialogueWindow->GetControl(v41); | 615 v42 = pButton->uY + pTextHeight - 1; |
619 if ( !pButton ) | 616 pButton->uW = v42; |
620 break; | 617 pTextColor = ui_game_dialogue_option_highlight_color; |
621 pButton->uY = (unsigned int)((char *)pOutString + v42); | 618 if ( pDialogueWindow->pCurrentPosActiveItem != i ) |
622 Str = pButton->pButtonName; | 619 pTextColor = ui_game_dialogue_option_normal_color; |
623 pTextHeight = pFontArrus->CalcTextHeight(pButton->pButtonName, &window, 0, 0); | 620 window.DrawTitleText(pFontArrus, 0, pButton->uY, pTextColor, pButton->pButtonName, 3); |
624 v45 = pButton->uY; | |
625 pButton->uHeight = pTextHeight; | |
626 v42 = v45 + pTextHeight - 1; | |
627 pButton->uW = v42; | |
628 pTextColor = ui_game_dialogue_option_highlight_color; | |
629 if ( pDialogueWindow->pCurrentPosActiveItem != v55 ) | |
630 pTextColor = ui_game_dialogue_option_normal_color; | |
631 window.DrawTitleText(pFontArrus, 0, v45, pTextColor, Str, 3); | |
632 ++v55; | |
633 ++v41; | |
634 } | |
635 while ( (signed int)v41 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); | |
636 } | 621 } |
637 } | 622 } |
638 pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId)); | 623 pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId)); |
639 } | 624 } |
640 | 625 |