Mercurial > mm7
diff GUIWindow.cpp @ 999:dcdfbb6eede9
Слияние
author | Ritor1 |
---|---|
date | Tue, 14 May 2013 17:38:14 +0600 |
parents | bdbbdfa77ea6 5876a9cafa3e |
children | eac5af72b614 c45d51b3f4f4 |
line wrap: on
line diff
--- a/GUIWindow.cpp Tue May 14 17:37:24 2013 +0600 +++ b/GUIWindow.cpp Tue May 14 17:38:14 2013 +0600 @@ -76,6 +76,105 @@ + + + +//----- (0041B4E1) -------------------------------------------------------- +int __fastcall GUI_ReplaceHotkey(unsigned __int8 uOldHotkey, unsigned __int8 uNewHotkey, char bFirstCall) +{ + unsigned __int8 v3; // bl@1 + int result; // eax@1 + int i; // edx@2 + GUIButton *j; // ecx@3 + int k; // edx@7 + GUIButton *l; // ecx@8 + unsigned __int8 v9; // [sp+4h] [bp-8h]@1 + char v10; // [sp+8h] [bp-4h]@1 + + v3 = uNewHotkey; + v10 = toupper(uOldHotkey); + result = toupper(v3); + v9 = result; + if ( bFirstCall ) + { + for ( i = uNumVisibleWindows; i >= 0; --i ) + { + result = 84 * pVisibleWindowsIdxs[i]; + //for ( j = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); j; j = j->pNext ) + for ( j = pWindowList[pVisibleWindowsIdxs[i] - 1].pControlsHead; j; j = j->pNext ) + j->field_28 = 0; + } + } + for ( k = uNumVisibleWindows; k >= 0; --k ) + { + result = 84 * pVisibleWindowsIdxs[k]; + //for ( l = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); l; l = l->pNext ) + for ( l = pWindowList[pVisibleWindowsIdxs[k] - 1].pControlsHead; l; l = l->pNext ) + { + LOBYTE(result) = v10; + if ( l->uHotkey == v10 ) + { + if ( !l->field_28 ) + { + LOBYTE(result) = v9; + l->field_28 = 1; + l->uHotkey = v9; + } + } + } + } + return result; +} + + + + +//----- (0041B438) -------------------------------------------------------- +GUIButton *__fastcall GUI_HandleHotkey(unsigned __int8 uHotkey) +{ + char v1; // al@1 + int v2; // esi@1 + char v3; // dl@1 + GUIWindow *v4; // ecx@2 + GUIButton *result; // eax@2 + //int v6; // edx@12 + + v1 = toupper(uHotkey); + v2 = uNumVisibleWindows; + v3 = v1; + if ( uNumVisibleWindows >= 0 ) + { + while ( 2 ) + { + v4 = &pWindowList[pVisibleWindowsIdxs[v2] - 1]; + for ( result = v4->pControlsHead; result; result = result->pNext ) + { + if ( result->uHotkey == v3 ) + { + pMessageQueue_50CBD0->AddMessage(result->msg, result->msg_param, 0); + /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) + { + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)result->uControlID; + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v6; + *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; + ++pMessageQueue_50CBD0->uNumMessages; + }*/ + return result; + } + } + if ( v4->uFrameX || v4->uFrameY || !(v4->uFrameWidth == 640 & v4->uFrameHeight == 480) ) + { + --v2; + if ( v2 >= 0 ) + continue; + } + break; + } + } + return 0; +} +// 5075E0: using guessed type int pVisibleWindowsIdxs[20]; + //----- (0041D73D) -------------------------------------------------------- char GUIWindow::_41D73D_draw_buff_tooltip() { @@ -845,56 +944,7 @@ } -//----- (0041192C) -------------------------------------------------------- -void __cdecl InitializeBookTextures() -{ - //signed int v0; // ebp@3 - //Texture **v1; // ebx@3 - pAudioPlayer->StopChannels(-1, -1); - ++pIcons_LOD->uTexturePacksCount; - if ( !pIcons_LOD->uNumPrevLoadedFiles ) - pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; - pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); - pSpellBookPagesTextr_9 = pIcons_LOD->LoadTexturePtr("book", TEXTURE_16BIT_PALETTE); - pTexture_pagemask = pIcons_LOD->LoadTexturePtr("pagemask", TEXTURE_16BIT_PALETTE); - pTexture_506448 = pIcons_LOD->LoadTexturePtr("ib-m5-u", TEXTURE_16BIT_PALETTE); - ptr_506440 = pIcons_LOD->LoadTexturePtr("ib-m5-d", TEXTURE_16BIT_PALETTE); - pTexture_50643C = pIcons_LOD->LoadTexturePtr("ib-m6-u",TEXTURE_16BIT_PALETTE); - //v0 = 1; - - static const char *texNames[9] = - { - "SBFB00", "SBAB00", "SBWB00", "SBEB00", - "SBSB00", "SBMB00", "SBBB00", "SBLB00", - }; - - pTexture_506444 = pIcons_LOD->LoadTexturePtr("ib-m6-d",TEXTURE_16BIT_PALETTE); - for (uint i = 0; i < 8; ++i) - { - pSpellBookPagesTextr[i] = pIcons_LOD->LoadTexturePtr(texNames[i], TEXTURE_16BIT_PALETTE); - - sprintf(pTmpBuf, "tab%da", i+1); - pTextures_tabs[i][0] = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE); - sprintf(pTmpBuf, "tab%db", i+1); - pTextures_tabs[i][1] = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE); - } -} - -//----- (00411AAA) -------------------------------------------------------- -void __cdecl InitializeBookFonts() -{ - pAudioPlayer->StopChannels(-1, -1); - ++pIcons_LOD->uTexturePacksCount; - if ( !pIcons_LOD->uNumPrevLoadedFiles ) - pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; - pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); - pTexture_mapbordr = pIcons_LOD->LoadTexturePtr("mapbordr", TEXTURE_16BIT_PALETTE); - pBookFont = LoadFont("book.fnt", "FONTPAL", NULL); - pBook2Font = LoadFont("book2.fnt", "FONTPAL", NULL); - pAutonoteFont = LoadFont("autonote.fnt", "FONTPAL", NULL); - pSpellFont = LoadFont("spell.fnt", "FONTPAL", NULL); -} //----- (00411B59) -------------------------------------------------------- void __fastcall LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer)