comparison GUIWindow.cpp @ 189:038a4d09406f

new texts file, fix text rendender error
author Gloval
date Sat, 16 Feb 2013 00:33:21 +0400
parents c5bd7a825ef2
children e6e348d66a75
comparison
equal deleted inserted replaced
185:16d257ffc802 189:038a4d09406f
18 #include "stru179.h" 18 #include "stru179.h"
19 #include "SaveLoad.h" 19 #include "SaveLoad.h"
20 #include "FactionTable.h" 20 #include "FactionTable.h"
21 #include "StorylineTextTable.h" 21 #include "StorylineTextTable.h"
22 #include "Events2D.h" 22 #include "Events2D.h"
23 #include "texts.h"
23 #include "Autonotes.h" 24 #include "Autonotes.h"
24 25
25 26
26 #include "mm7_data.h" 27 #include "mm7_data.h"
27 28
238 v28 = pPlayer->uQuickSpell; 239 v28 = pPlayer->uQuickSpell;
239 if ( v28 ) 240 if ( v28 )
240 v29 = pSpellStats->pInfos[v28].pShortName; 241 v29 = pSpellStats->pInfos[v28].pShortName;
241 else 242 else
242 v29 = pGlobalTXT_LocalizationStrings[153]; 243 v29 = pGlobalTXT_LocalizationStrings[153];
243 sprintf(pTmpBuf2, "%s: %s", pGlobalTXT_LocalizationStrings[172], v29); 244 sprintf((char*)pTmpBuf2, "%s: %s", (char*)pGlobalTXT_LocalizationStrings[172], v29);
244 strcat(pTmpBuf, pTmpBuf2); 245 strcat((char*)pTmpBuf, (char*)pTmpBuf2);
245 DrawText(pFontArrus, 120, 22, 0, pTmpBuf, 0, 0, 0); 246 DrawText(pFontArrus, 120, 22, 0, pTmpBuf, 0, 0, 0);
246 247
247 uFramesetIDa = 0; 248 uFramesetIDa = 0;
248 for (uint i = 0; i < 24; ++i) 249 for (uint i = 0; i < 24; ++i)
249 { 250 {
1319 } 1320 }
1320 1321
1321 1322
1322 1323
1323 //----- (0044D406) -------------------------------------------------------- 1324 //----- (0044D406) --------------------------------------------------------
1324 char *GUIWindow::DrawTitleText(GUIFont *a2, unsigned int uHorizontalMargin, unsigned int uVerticalMargin, unsigned __int16 uDefaultColor, const char *pInString, unsigned int uLineSpacing) 1325 char *GUIWindow::DrawTitleText(GUIFont *a2, unsigned int uHorizontalMargin, unsigned int uVerticalMargin,
1326 unsigned __int16 uDefaultColor, const char *pInString, unsigned int uLineSpacing)
1325 { 1327 {
1326 GUIWindow *pWindow; // esi@1 1328 GUIWindow *pWindow; // esi@1
1327 unsigned int v8; // ebx@1 1329 unsigned int v8; // ebx@1
1328 char *v9; // eax@1 1330 char *v9; // eax@1
1329 char *result; // eax@1 1331 char *result; // eax@1
1696 } 1698 }
1697 return v28; 1699 return v28;
1698 } 1700 }
1699 1701
1700 //----- (0041D12F) -------------------------------------------------------- 1702 //----- (0041D12F) --------------------------------------------------------
1701 GUIButton *GUIWindow::CreateButton(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, int a6, int a7, unsigned int uControlID, unsigned int uControlParam, unsigned __int8 uHotkey, const char *pName, Texture *pTextures, ...) 1703 GUIButton *GUIWindow::CreateButton(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight,
1704 int a6, int a7, unsigned int uControlID, unsigned int uControlParam, unsigned __int8 uHotkey, const char *pName, Texture *pTextures, ...)
1702 { 1705 {
1703 GUIButton *pButton; // esi@1 1706 GUIButton *pButton; // esi@1
1704 unsigned int v13; // eax@1 1707 unsigned int v13; // eax@1
1705 unsigned int v14; // ebx@4 1708 unsigned int v14; // ebx@4
1706 unsigned int v15; // eax@4 1709 unsigned int v15; // eax@4
1707 unsigned int pTextureNum; // ebx@4 1710 unsigned int TextureNum=0; // ebx@4
1708 unsigned int v17; // eax@4 1711 unsigned int v17; // eax@4
1709 Texture *v18; // eax@4 1712 Texture *v18; // eax@4
1710 Texture **v19; // ecx@5 1713 Texture **v19; // ecx@5
1711 Texture **v20; // edx@5 1714 Texture **v20; // edx@5
1712 GUIButton *v21; // eax@7 1715 GUIButton *v21; // eax@7
1716 va_list texturs_ptr;
1713 1717
1714 pButton = (GUIButton *)pAllocator->AllocNamedChunk(0, 0xBCu, "BUTTON"); 1718 pButton = (GUIButton *)pAllocator->AllocNamedChunk(0, 0xBCu, "BUTTON");
1715 pButton->pParent = this; 1719 pButton->pParent = this;
1716 pButton->uX = uX + this->uFrameX; 1720 pButton->uX = uX + this->uFrameX;
1717 v13 = uY + this->uFrameY; 1721 v13 = uY + this->uFrameY;
1721 if ( a6 == 2 && !uHeight ) 1725 if ( a6 == 2 && !uHeight )
1722 pButton->uHeight = uWidth; 1726 pButton->uHeight = uWidth;
1723 v14 = pButton->uX; 1727 v14 = pButton->uX;
1724 pButton->uButtonType = a6; 1728 pButton->uButtonType = a6;
1725 v15 = v14 + uWidth - 1; 1729 v15 = v14 + uWidth - 1;
1726 pTextureNum = 0;
1727 pButton->uZ = v15; 1730 pButton->uZ = v15;
1728 v17 = pButton->uY; 1731 v17 = pButton->uY;
1729 pButton->field_2C = 0; 1732 pButton->field_2C = 0;
1730 pButton->uW = v17 + uHeight - 1; 1733 pButton->uW = v17 + uHeight - 1;
1731 pButton->field_1C = a7; 1734 pButton->field_1C = a7;
1732 pButton->uControlID = uControlID; 1735 pButton->uControlID = uControlID;
1733 pButton->uControlParam = uControlParam; 1736 pButton->uControlParam = uControlParam;
1734 pButton->uHotkey = uHotkey; 1737 pButton->uHotkey = uHotkey;
1735 strlen(pName); 1738 strlen(pName);
1736 strcpy(pButton->pButtonName, pName); 1739 strcpy(pButton->pButtonName, pName);
1737 v18 = pTextures; 1740 va_start(texturs_ptr, pName);
1738 if ( pTextures ) 1741 while (NULL!=(pTextures=va_arg(texturs_ptr, Texture *)))
1739 { 1742 {
1740 v19 = &pTextures; 1743 pButton->pTextures[TextureNum]=pTextures;
1741 v20 = pButton->pTextures; 1744 ++TextureNum;
1742 do 1745 }
1743 { 1746 va_end(texturs_ptr);
1744 ++v19; 1747 pButton->uNumTextures = TextureNum;
1745 *v20 = v18; 1748 if ( this->pControlsTail )
1746 ++pTextureNum; 1749 this->pControlsTail->pNext = pButton;
1747 ++v20;
1748 v18 = *v19;
1749 }
1750 while ( *v19 );
1751 }
1752 pButton->uNumTextures = pTextureNum;
1753 v21 = this->pControlsTail;
1754 if ( v21 )
1755 v21->pNext = pButton;
1756 else 1750 else
1757 this->pControlsHead = pButton; 1751 this->pControlsHead = pButton;
1758 pButton->pPrev = this->pControlsTail; 1752 pButton->pPrev = this->pControlsTail;
1759 this->pControlsTail = pButton; 1753 this->pControlsTail = pButton;
1760 pButton->pNext = 0; 1754 pButton->pNext = 0;
1977 { 1971 {
1978 uWidtha = v26 + 1; 1972 uWidtha = v26 + 1;
1979 if ( v26 + 1 == v25 && uHouse_ExitPic ) 1973 if ( v26 + 1 == v25 && uHouse_ExitPic )
1980 { 1974 {
1981 v30 = pMapStats->pInfos[uHouse_ExitPic].pName; 1975 v30 = pMapStats->pInfos[uHouse_ExitPic].pName;
1982 v29 = pGlobalTXT_LocalizationStrings[411];//Войти в ^Pv[%s] 1976 v29 = (char*)pGlobalTXT_LocalizationStrings[411];//Войти в ^Pv[%s]
1983 } 1977 }
1984 else 1978 else
1985 { 1979 {
1986 if ( v26 || !dword_591080 ) 1980 if ( v26 || !dword_591080 )
1987 v27 = array_5913D8[v26 - (dword_591080 != 0)]->pName; 1981 v27 = array_5913D8[v26 - (dword_591080 != 0)]->pName;
1988 else 1982 else
1989 //v27 = (char *)p2DEvents_minus1_::08[13 * a4]; 1983 //v27 = (char *)p2DEvents_minus1_::08[13 * a4];
1990 v27 = (char *)p2DEvents[pButton - 1].pProprieterName; 1984 v27 = (char *)p2DEvents[pButton - 1].pProprieterName;
1991 v30 = v27; 1985 v30 = v27;
1992 v29 = pGlobalTXT_LocalizationStrings[435];//Побеседовать с ^Pt[%s] 1986 v29 = (char*)pGlobalTXT_LocalizationStrings[435];//Побеседовать с ^Pt[%s]
1993 } 1987 }
1994 sprintf(&byte_591180[100 * v26], v29, v30); 1988 sprintf(&byte_591180[100 * v26], v29, v30);
1995 array_5913D8[v26 + 7] = (NPCData *)pWindow->CreateButton(*(&pNPCPortraits_x + v26 + 6 * uNumDialogueNPCPortraits - 6), 1989 array_5913D8[v26 + 7] = (NPCData *)pWindow->CreateButton(*(&pNPCPortraits_x + v26 + 6 * uNumDialogueNPCPortraits - 6),
1996 *(&pNPCPortraits_y + v26 + 6 * uNumDialogueNPCPortraits - 6), 1990 *(&pNPCPortraits_y + v26 + 6 * uNumDialogueNPCPortraits - 6),
1997 0x3Fu, 0x49u, 1, 0, 0x19Au, v26, 0, &byte_591180[100 * v26], 0, 0, 0); 1991 0x3Fu, 0x49u, 1, 0, 0x19Au, v26, 0, &byte_591180[100 * v26], 0, 0, 0);