comparison GUIWindow.cpp @ 2271:7ffddbe09e55

DrawMessageBox
author Ritor1
date Thu, 13 Mar 2014 23:56:31 +0600
parents aff7a7b072b7
children 42b6a910b5d8
comparison
equal deleted inserted replaced
2268:fd788d2e9585 2271:7ffddbe09e55
78 { 78 {
79 if (uNumMessages) 79 if (uNumMessages)
80 uNumMessages = pMessages[0].field_8 != 0; 80 uNumMessages = pMessages[0].field_8 != 0;
81 } 81 }
82 82
83
84 //----- (004356B9) -------------------------------------------------------- 83 //----- (004356B9) --------------------------------------------------------
85 void GUIMessageQueue::PopMessage(enum UIMessageType *pType, int *pParam, int *a4) 84 void GUIMessageQueue::PopMessage(enum UIMessageType *pType, int *pParam, int *a4)
86 { 85 {
87 signed int v4; // edx@1
88 GUIMessage *v5; // eax@2
89
90 v4 = 0;
91 if ( this->uNumMessages ) 86 if ( this->uNumMessages )
92 { 87 {
93 v5 = this->pMessages;
94 *pType = this->pMessages[0].eType; 88 *pType = this->pMessages[0].eType;
95 *pParam = this->pMessages[0].param; 89 *pParam = this->pMessages[0].param;
96 *a4 = this->pMessages[0].field_8; 90 *a4 = this->pMessages[0].field_8;
97 if ( (signed int)(this->uNumMessages - 1) > 0 ) 91 if ( (signed int)(this->uNumMessages - 1) > 0 )
98 { 92 {
99 do 93 for ( uint i = 0; i < (signed int)(this->uNumMessages - 1); ++i )
100 { 94 {
101 v5->eType = v5[1].eType; 95 this->pMessages[i].eType = this->pMessages[i + 1].eType;
102 v5->param = v5[1].param; 96 this->pMessages[i].param = this->pMessages[i + 1].param;
103 v5->field_8 = v5[1].field_8; 97 this->pMessages[i].field_8 = this->pMessages[i + 1].field_8;
104 ++v4; 98 }
105 ++v5;
106 }
107 while ( v4 < (signed int)(this->uNumMessages - 1) );
108 } 99 }
109 --this->uNumMessages; 100 --this->uNumMessages;
110 } 101 }
111 } 102 }
112
113
114
115
116
117 103
118 //----- (0041B4E1) -------------------------------------------------------- 104 //----- (0041B4E1) --------------------------------------------------------
119 int __fastcall GUI_ReplaceHotkey(unsigned __int8 uOldHotkey, unsigned __int8 uNewHotkey, char bFirstCall) 105 int __fastcall GUI_ReplaceHotkey(unsigned __int8 uOldHotkey, unsigned __int8 uNewHotkey, char bFirstCall)
120 { 106 {
121 unsigned __int8 v3; // bl@1 107 unsigned __int8 v3; // bl@1
157 } 143 }
158 } 144 }
159 } 145 }
160 return result; 146 return result;
161 } 147 }
162
163
164
165 148
166 //----- (0041B438) -------------------------------------------------------- 149 //----- (0041B438) --------------------------------------------------------
167 GUIButton *__fastcall GUI_HandleHotkey(unsigned __int8 uHotkey) 150 GUIButton *__fastcall GUI_HandleHotkey(unsigned __int8 uHotkey)
168 { 151 {
169 char v1; // al@1 152 char v1; // al@1
341 break; 324 break;
342 } 325 }
343 case WINDOW_null: 326 case WINDOW_null:
344 return; 327 return;
345 default: 328 default:
346 {
347 break; 329 break;
348 }
349 } 330 }
350 //v8 = this->pControlsHead; 331 //v8 = this->pControlsHead;
351 if ( this->pControlsHead ) 332 if ( this->pControlsHead )
352 { 333 {
353 do 334 do
370 ++this->numVisibleWindows; 351 ++this->numVisibleWindows;
371 } 352 }
372 pVisibleWindowsIdxs[uNumVisibleWindows] = 0; 353 pVisibleWindowsIdxs[uNumVisibleWindows] = 0;
373 uNumVisibleWindows = uNumVisibleWindows - 1; 354 uNumVisibleWindows = uNumVisibleWindows - 1;
374 } 355 }
375
376
377
378
379
380 356
381 //----- (0041CD3B) -------------------------------------------------------- 357 //----- (0041CD3B) --------------------------------------------------------
382 GUIButton *GUIWindow::GetControl(unsigned int uID) 358 GUIButton *GUIWindow::GetControl(unsigned int uID)
383 { 359 {
384 GUIButton *result; // eax@1 360 GUIButton *result; // eax@1
645 621
646 //----- (00415551) -------------------------------------------------------- 622 //----- (00415551) --------------------------------------------------------
647 void GUIWindow::DrawMessageBox(int arg0) 623 void GUIWindow::DrawMessageBox(int arg0)
648 { 624 {
649 unsigned int v2; // edi@1 625 unsigned int v2; // edi@1
650 GUIWindow *v3; // ebx@1
651 signed int v4; // esi@2 626 signed int v4; // esi@2
652 unsigned int v5; // eax@2 627 unsigned int v5; // eax@2
653 unsigned int v6; // edx@4
654 unsigned int v7; // ecx@6
655 unsigned int v8; // eax@9
656 __int32 v9; // eax@10
657 unsigned int v10; // eax@18
658 LONG v11; // ecx@18
659 unsigned int v12; // edx@18
660 unsigned int v13; // eax@18
661 const char *v14; // ecx@18
662 int v15; // eax@19
663 unsigned int v16; // esi@19 628 unsigned int v16; // esi@19
664 const char *v17; // ebx@25 629 GUIWindow current_window; // [sp+Ch] [bp-60h]@18
665 int v18; // eax@26 630 POINT cursor; // [sp+60h] [bp-Ch]@8
666 GUIWindow v19; // [sp+Ch] [bp-60h]@18
667 POINT a2; // [sp+60h] [bp-Ch]@8
668 unsigned int v21; // [sp+68h] [bp-4h]@18
669 unsigned int v22; // [sp+74h] [bp+8h]@2 631 unsigned int v22; // [sp+74h] [bp+8h]@2
670 unsigned int v23; // [sp+74h] [bp+8h]@18
671 632
672 v2 = 0; 633 v2 = 0;
673 v3 = this;
674 if ( arg0 ) 634 if ( arg0 )
675 { 635 {
676 v4 = pViewport->uViewportTL_X; 636 v4 = pViewport->uViewportTL_X;
677 v5 = pViewport->uViewportBR_X; 637 v5 = pViewport->uViewportBR_X;
678 v2 = pViewport->uViewportTL_Y; 638 v2 = pViewport->uViewportTL_Y;
682 { 642 {
683 v4 = 0; 643 v4 = 0;
684 v5 = window->GetWidth(); 644 v5 = window->GetWidth();
685 v22 = window->GetHeight(); 645 v22 = window->GetHeight();
686 } 646 }
687 v6 = this->uFrameX; 647 pMouse->GetCursorPos(&cursor);
688 if ( (signed int)this->uFrameX >= v4 ) 648 if ( (signed int)this->uFrameX >= v4 )
689 { 649 {
690 v7 = this->uFrameWidth; 650 if ( (signed int)(this->uFrameWidth + this->uFrameX) > (signed int)v5 )
691 if ( (signed int)(v7 + v6) <= (signed int)v5 ) 651 {
692 goto LABEL_9; 652 this->uFrameX = v5 - this->uFrameWidth;
693 v3->uFrameX = v5 - v7; 653 this->uFrameY = cursor.y + 30;
654 }
694 } 655 }
695 else 656 else
696 { 657 {
697 this->uFrameX = v4; 658 this->uFrameX = v4;
698 } 659 this->uFrameY = cursor.y + 30;
699 v3->uFrameY = pMouse->GetCursorPos(&a2)->y + 30; 660 }
700 LABEL_9: 661
701 v8 = v3->uFrameY; 662 if ( (signed int)this->uFrameY >= (signed int)v2 )
702 if ( (signed int)v8 >= (signed int)v2 ) 663 {
703 { 664 if ( (signed int)(this->uFrameY + this->uFrameHeight) > (signed int)v22 )
704 if ( (signed int)(v8 + v3->uFrameHeight) <= (signed int)v22 ) 665 this->uFrameY = cursor.y - this->uFrameHeight - 30;
705 goto LABEL_14;
706 v9 = pMouse->GetCursorPos(&a2)->y - v3->uFrameHeight - 30;
707 } 666 }
708 else 667 else
709 { 668 this->uFrameY = cursor.y + 30;
710 v9 = pMouse->GetCursorPos(&a2)->y + 30; 669 if ( (signed int)this->uFrameY < (signed int)v2 )
711 } 670 this->uFrameY = v2;
712 v3->uFrameY = v9; 671 if ( (signed int)this->uFrameX < v4 )
713 LABEL_14: 672 this->uFrameX = v4;
714 if ( (signed int)v3->uFrameY < (signed int)v2 ) 673 this->uFrameZ = this->uFrameWidth + this->uFrameX - 1;
715 v3->uFrameY = v2; 674 this->uFrameW = this->uFrameHeight + this->uFrameY - 1;
716 if ( (signed int)v3->uFrameX < v4 ) 675 memcpy(&current_window, this, sizeof(current_window));
717 v3->uFrameX = v4; 676 current_window.uFrameX += 12;
718 v10 = v3->uFrameWidth; 677 current_window.uFrameWidth -= 24;
719 v11 = v3->uFrameX; 678 current_window.uFrameY += 12;
720 v12 = v3->uFrameY; 679 current_window.uFrameHeight -= 12;
721 v21 = v10; 680 current_window.uFrameZ = current_window.uFrameWidth + current_window.uFrameX - 1;
722 a2.y = v11; 681 current_window.uFrameW = current_window.uFrameHeight + current_window.uFrameY - 1;
723 v3->uFrameZ = v10 + v11 - 1; 682 if ( this->Hint )
724 v13 = v3->uFrameHeight; 683 v16 = pFontLucida->CalcTextHeight(this->Hint, &current_window, 0, 0) + 24;
725 v3->uFrameW = v13 + v12 - 1;
726 memcpy(&v19, v3, sizeof(v19));
727 v19.uFrameX += 12;
728 v19.uFrameWidth -= 24;
729 v19.uFrameY += 12;
730 v19.uFrameHeight -= 12;
731 v19.uFrameZ = v19.uFrameWidth + v19.uFrameX - 1;
732 v23 = v12;
733 v19.uFrameW = v19.uFrameHeight + v19.uFrameY - 1;
734 v14 = v3->Hint;
735 if ( v14 )
736 {
737 v15 = pFontLucida->CalcTextHeight(v14, &v19, 0, 0);
738 v12 = v23;
739 v16 = v15 + 24;
740 }
741 else 684 else
742 { 685 v16 = this->uFrameHeight;
743 v16 = v13;
744 }
745 if ( (signed int)v16 < 64 ) 686 if ( (signed int)v16 < 64 )
746 v16 = 64; 687 v16 = 64;
747 if ( (signed int)(v16 + v12) > 479 ) 688 if ( (signed int)(v16 + this->uFrameY) > 479 )
748 v16 = 479 - v12; 689 v16 = 479 - this->uFrameY;
749 DrawPopupWindow(a2.y, v12, v21, v16); 690 DrawPopupWindow(this->uFrameX, this->uFrameY, this->uFrameWidth, v16);
750 v17 = v3->Hint; 691 if ( this->Hint )
751 if ( v17 ) 692 current_window.DrawTitleText(pFontLucida, 0, (signed int)(v16 - pFontLucida->CalcTextHeight(this->Hint, &current_window, 0, 0)) / 2 - 14, 0, this->Hint, 3);
752 { 693 }
753 v18 = pFontLucida->CalcTextHeight(v17, &v19, 0, 0);
754 v19.DrawTitleText(pFontLucida, 0, (signed int)(v16 - v18) / 2 - 14, 0, v17, 3);
755 }
756 }
757
758
759
760 694
761 //----- (00411B59) -------------------------------------------------------- 695 //----- (00411B59) --------------------------------------------------------
762 void __fastcall LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer) 696 void __fastcall LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer)
763 { 697 {
764 unsigned int v2; // esi@1 698 //unsigned int v2; // esi@1
765 unsigned int v3; // edi@1 699 //unsigned int v3; // edi@1
766 FILE *v4; // ebx@1 700 FILE *v4; // ebx@1
767 FILE *v5; // eax@2 701 FILE *v5; // eax@2
768 char pContainerName[64]; // [sp+Ch] [bp-44h]@1 702 char pContainerName[64]; // [sp+Ch] [bp-44h]@1
769 unsigned int v7; // [sp+4Ch] [bp-4h]@1 703 //unsigned int v7; // [sp+4Ch] [bp-4h]@1
770 704
771 v2 = uSlot; 705 //v2 = uSlot;
772 v7 = uPlayer; 706 //v7 = uPlayer;
773 v3 = uSlot + 1; 707 //v3 = uSlot + 1;
774 sprintf(pContainerName, "data\\lloyd%d%d.pcx", uPlayer, uSlot + 1); 708 sprintf(pContainerName, "data\\lloyd%d%d.pcx", uPlayer, uSlot + 1);
775 v4 = fopen(pContainerName, "rb"); 709 v4 = fopen(pContainerName, "rb");
776 if ( v4 ) 710 if ( v4 )
777 { 711 {
778 pSavegameThumbnails[v2].LoadFromFILE(v4, 0, 1u); 712 pSavegameThumbnails[uSlot].LoadFromFILE(v4, 0, 1);
779 fclose(v4); 713 fclose(v4);
780 } 714 }
781 else 715 else
782 { 716 {
783 sprintf(pContainerName, "lloyd%d%d.pcx", v7, v3); 717 sprintf(pContainerName, "lloyd%d%d.pcx", uPlayer, uSlot + 1);
784 v5 = pNew_LOD->FindContainer(pContainerName, 1); 718 v5 = pNew_LOD->FindContainer(pContainerName, 1);
785 if ( v5 ) 719 if ( v5 )
786 pSavegameThumbnails[v2].LoadFromFILE(v5, 0, 0); 720 pSavegameThumbnails[uSlot].LoadFromFILE(v5, 0, 0);
787 else 721 else
788 *((int *)&pSavegameThumbnails.data()->pPixels + 10 * v2) = 0; 722 *((int *)&pSavegameThumbnails.data()->pPixels + 10 * uSlot) = 0;
789 } 723 }
790 } 724 }
791 725
792 726
793 //----- (00411621) -------------------------------------------------------- 727 //----- (00411621) --------------------------------------------------------
898 { 832 {
899 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); 833 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
900 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); 834 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
901 } 835 }
902 else 836 else
903 {
904 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); 837 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]);
905 }
906 return; 838 return;
907 } 839 }
908 if ( current_npc_text ) 840 if ( current_npc_text )
909 { 841 {
910 pDialogWindow.uFrameWidth = 458; 842 pDialogWindow.uFrameWidth = 458;
923 { 855 {
924 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); 856 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
925 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); 857 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
926 } 858 }
927 else 859 else
928 {
929 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); 860 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]);
930 }
931 return; 861 return;
932 } 862 }
933 for ( v8 = 0; v8 < uNumDialogueNPCPortraits; ++v8 ) 863 for ( v8 = 0; v8 < uNumDialogueNPCPortraits; ++v8 )
934 { 864 {
935 pRenderer->DrawTextureIndexed(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8] - 4, 865 pRenderer->DrawTextureIndexed(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8] - 4,
962 { 892 {
963 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); 893 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
964 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); 894 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
965 } 895 }
966 else 896 else
967 {
968 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); 897 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]);
969 }
970 return; 898 return;
971 } 899 }
972 v4 = (char *)pDialogueNPCCount - 1; 900 v4 = (char *)pDialogueNPCCount - 1;
973 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]); 901 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]);
974 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[(signed int)v4]); 902 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[(signed int)v4]);
979 { 907 {
980 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); 908 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
981 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); 909 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
982 } 910 }
983 else 911 else
984 {
985 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); 912 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]);
986 }
987 return; 913 return;
988 } 914 }
989 if ( v4 || !dword_591080 )//на изумрудном острове заходит на корабле пока не выполнены квесты 915 if ( v4 || !dword_591080 )//на изумрудном острове заходит на корабле пока не выполнены квесты
990 {
991 SimpleHouseDialog(); 916 SimpleHouseDialog();
992 }
993 else 917 else
994 { 918 {
995 sprintfex( pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], 919 sprintfex( pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429],
996 p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterName, 920 p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterName,
997 p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle); 921 p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle);
1056 { 980 {
1057 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); 981 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
1058 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); 982 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
1059 } 983 }
1060 else 984 else
1061 {
1062 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); 985 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]);
1063 }
1064 } 986 }
1065 987
1066 //----- (004B1854) -------------------------------------------------------- 988 //----- (004B1854) --------------------------------------------------------
1067 void GUIWindow::DrawShops_next_generation_time_string( __int64 next_generation_time ) 989 void GUIWindow::DrawShops_next_generation_time_string( __int64 next_generation_time )
1068 { 990 {
1115 strcat(pTmpBuf.data(), pTmpBuf2.data()); 1037 strcat(pTmpBuf.data(), pTmpBuf2.data());
1116 } 1038 }
1117 this->DrawTitleText(pFontArrus, 0, (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), this, 0, 0)) / 2 + 101, Color16(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3); 1039 this->DrawTitleText(pFontArrus, 0, (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), this, 0, 0)) / 2 + 101, Color16(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3);
1118 } 1040 }
1119 1041
1120
1121
1122 //----- (0044D406) -------------------------------------------------------- 1042 //----- (0044D406) --------------------------------------------------------
1123 void GUIWindow::DrawTitleText( GUIFont *a2, signed int uHorizontalMargin, unsigned int uVerticalMargin, unsigned __int16 uDefaultColor, 1043 void GUIWindow::DrawTitleText( GUIFont *a2, signed int uHorizontalMargin, unsigned int uVerticalMargin, unsigned __int16 uDefaultColor,
1124 const char *pInString, unsigned int uLineSpacing ) 1044 const char *pInString, unsigned int uLineSpacing )
1125 { 1045 {
1126 GUIWindow *pWindow; // esi@1 1046 //GUIWindow *pWindow; // esi@1
1127 unsigned int v8; // ebx@1 1047 unsigned int v8; // ebx@1
1128 char *v9; // eax@1 1048 char *v9; // eax@1
1129 unsigned int v11; // edi@1 1049 unsigned int v11; // edi@1
1130 signed int v12; // esi@1 1050 signed int v12; // esi@1
1131 int v13; // eax@2 1051 int v13; // eax@2
1132 GUIFont *pFont; // [sp+Ch] [bp-4h]@1 1052 GUIFont *pFont; // [sp+Ch] [bp-4h]@1
1133 const char *Stra; // [sp+24h] [bp+14h]@5 1053 const char *Stra; // [sp+24h] [bp+14h]@5
1134 1054
1135 pWindow = this; 1055 //pWindow = this;
1136 pFont = a2; 1056 pFont = a2;
1137 v8 = this->uFrameWidth - uHorizontalMargin; 1057 v8 = this->uFrameWidth - uHorizontalMargin;
1138 ui_current_text_color = uDefaultColor; 1058 ui_current_text_color = uDefaultColor;
1139 v9 = FitTextInAWindow(pInString, a2, this, uHorizontalMargin, 0); 1059 v9 = FitTextInAWindow(pInString, a2, this, uHorizontalMargin, 0);
1140 Stra = strtok(v9, "\n"); 1060 Stra = strtok(v9, "\n");
1141 v11 = uHorizontalMargin + pWindow->uFrameX; 1061 v11 = uHorizontalMargin + this->uFrameX;
1142 v12 = uVerticalMargin + pWindow->uFrameY; 1062 v12 = uVerticalMargin + this->uFrameY;
1143 while ( 1 ) 1063 while ( 1 )
1144 { 1064 {
1145 if ( !Stra ) 1065 if ( !Stra )
1146 break; 1066 break;
1147 v13 = (signed int)(v8 - pFont->GetLineWidth(Stra)) >> 1; 1067 v13 = (signed int)(v8 - pFont->GetLineWidth(Stra)) >> 1;
1151 v12 += pFont->uFontHeight - uLineSpacing; 1071 v12 += pFont->uFontHeight - uLineSpacing;
1152 Stra = strtok(0, "\n"); 1072 Stra = strtok(0, "\n");
1153 } 1073 }
1154 } 1074 }
1155 // 5C6DB4: using guessed type int ui_current_text_color; 1075 // 5C6DB4: using guessed type int ui_current_text_color;
1156
1157
1158 1076
1159 //----- (0044CE08) -------------------------------------------------------- 1077 //----- (0044CE08) --------------------------------------------------------
1160 void GUIWindow::DrawText( GUIFont *a2, signed int uX, int uY, unsigned int uFontColor, const char *Str, int a7, int a8, signed int uFontShadowColor ) 1078 void GUIWindow::DrawText( GUIFont *a2, signed int uX, int uY, unsigned int uFontColor, const char *Str, int a7, int a8, signed int uFontShadowColor )
1161 { 1079 {
1162 GUIWindow *v9; // edi@1 1080 GUIWindow *v9; // edi@1
1200 v30 = strlen(Str); 1118 v30 = strlen(Str);
1201 LOBYTE(v11) = 0; 1119 LOBYTE(v11) = 0;
1202 if ( !uX ) 1120 if ( !uX )
1203 uX = 12; 1121 uX = 12;
1204 if ( a8 ) 1122 if ( a8 )
1205 {
1206 v32 = Str; 1123 v32 = Str;
1207 }
1208 else 1124 else
1209 { 1125 {
1210 v11 = (int)FitTextInAWindow(Str, v10, v9, uX, 0); 1126 v11 = (int)FitTextInAWindow(Str, v10, v9, uX, 0);
1211 v32 = (const char *)v11; 1127 v32 = (const char *)v11;
1212 } 1128 }
1228 || (char)v11 == 10 ) 1144 || (char)v11 == 10 )
1229 { 1145 {
1230 switch ( (unsigned __int8)v11 ) 1146 switch ( (unsigned __int8)v11 )
1231 { 1147 {
1232 case 9u: 1148 case 9u:
1233 strncpy(Dest, &v32[v14 + 1], 3u); 1149 strncpy(Dest, &v32[v14 + 1], 3);
1234 Dest[3] = 0; 1150 Dest[3] = 0;
1235 pInString += 3; 1151 pInString += 3;
1236 v29 = atoi(Dest); 1152 v29 = atoi(Dest);
1237 v19 = atoi(Dest); 1153 v19 = atoi(Dest);
1238 LOBYTE(v11) = (char)v31; 1154 LOBYTE(v11) = (char)v31;
1245 v12 = uX + v29 + v31->uFrameX; 1161 v12 = uX + v29 + v31->uFrameX;
1246 if ( a8 ) 1162 if ( a8 )
1247 goto LABEL_36; 1163 goto LABEL_36;
1248 break; 1164 break;
1249 case 0xCu: 1165 case 0xCu:
1250 strncpy(Dest, &v32[v14 + 1], 5u); 1166 strncpy(Dest, &v32[v14 + 1], 5);
1251 Dest[5] = 0; 1167 Dest[5] = 0;
1252 v11 = atoi(Dest); 1168 v11 = atoi(Dest);
1253 pInString += 5; 1169 pInString += 5;
1254 uFontColor = v11; 1170 uFontColor = v11;
1255 break; 1171 break;
1256 case 0xDu: 1172 case 0xDu:
1257 strncpy(Dest, &v32[v14 + 1], 3u); 1173 strncpy(Dest, &v32[v14 + 1], 3);
1258 Dest[3] = 0; 1174 Dest[3] = 0;
1259 pInString += 3; 1175 pInString += 3;
1260 v18 = atoi(Dest); 1176 v18 = atoi(Dest);
1261 v11 = v10->GetLineWidth(&v32[pInString]); 1177 v11 = v10->GetLineWidth(&v32[pInString]);
1262 v12 = v31->uFrameZ - v11 - v18; 1178 v12 = v31->uFrameZ - v11 - v18;
1283 v28 = *((int *)&v10->cFirstChar + 3 * v15 + 9); 1199 v28 = *((int *)&v10->cFirstChar + 3 * v15 + 9);
1284 if ( v14 > 0 ) 1200 if ( v14 > 0 )
1285 v12 += v10->pMetrics[v15].uLeftSpacing; 1201 v12 += v10->pMetrics[v15].uLeftSpacing;
1286 v17 = (int)((char *)&v10[1] + v10->font_pixels_offset[v15]); 1202 v17 = (int)((char *)&v10[1] + v10->font_pixels_offset[v15]);
1287 if ( (short)uFontColor ) 1203 if ( (short)uFontColor )
1288 pRenderer->DrawText( 1204 pRenderer->DrawText(v12, v13, (unsigned __int8 *)v17, v16, LOBYTE(v10->uFontHeight),
1289 v12, 1205 v10->pFontPalettes[0], uFontColor, uFontShadowColor);
1290 v13,
1291 (unsigned __int8 *)v17,
1292 v16,
1293 LOBYTE(v10->uFontHeight),
1294 v10->pFontPalettes[0],
1295 uFontColor,
1296 uFontShadowColor);
1297 else 1206 else
1298 pRenderer->DrawTextPalette( 1207 pRenderer->DrawTextPalette(v12, v13, (unsigned char*)v17, v16, LOBYTE(v10->uFontHeight),
1299 v12, 1208 v10->pFontPalettes[0], a7);
1300 v13,
1301 (unsigned char*)v17,
1302 v16,
1303 LOBYTE(v10->uFontHeight),
1304 v10->pFontPalettes[0],
1305 a7);
1306 LOBYTE(v11) = v30; 1209 LOBYTE(v11) = v30;
1307 v12 += v28; 1210 v12 += v28;
1308 if ( (signed int)pInString < (signed int)v30 ) 1211 if ( (signed int)pInString < (signed int)v30 )
1309 { 1212 {
1310 LOBYTE(v11) = 3 * *v27; 1213 LOBYTE(v11) = 3 * *v27;