Mercurial > mm7
comparison UI/UIBooks.cpp @ 1402:a519a6a412d0
CloseSpellBook and close SpellBookPage
author | Ritor1 |
---|---|
date | Fri, 19 Jul 2013 17:21:40 +0600 |
parents | ae435824ac4d |
children | d3c5f28a0ca5 |
comparison
equal
deleted
inserted
replaced
1401:3161094869e0 | 1402:a519a6a412d0 |
---|---|
46 | 46 |
47 | 47 |
48 //----- (0041192C) -------------------------------------------------------- | 48 //----- (0041192C) -------------------------------------------------------- |
49 void InitializeBookTextures() | 49 void InitializeBookTextures() |
50 { | 50 { |
51 //signed int v0; // ebp@3 | |
52 //Texture **v1; // ebx@3 | |
53 | 51 |
54 pAudioPlayer->StopChannels(-1, -1); | 52 pAudioPlayer->StopChannels(-1, -1); |
55 | 53 |
56 ++pIcons_LOD->uTexturePacksCount; | 54 ++pIcons_LOD->uTexturePacksCount; |
57 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | 55 if ( !pIcons_LOD->uNumPrevLoadedFiles ) |
58 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | 56 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; |
59 | 57 |
60 pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0); | 58 pAudioPlayer->PlaySound(SOUND_OpenBook, 0, 0, -1, 0, 0, 0, 0); |
61 pSpellBookPagesTextr_9 = pIcons_LOD->LoadTexturePtr("book", TEXTURE_16BIT_PALETTE); | 59 pSpellBookPagesTextr_9 = pIcons_LOD->LoadTexturePtr("book", TEXTURE_16BIT_PALETTE); |
62 pTexture_pagemask = pIcons_LOD->LoadTexturePtr("pagemask", TEXTURE_16BIT_PALETTE); | 60 pTexture_pagemask = pIcons_LOD->LoadTexturePtr("pagemask", TEXTURE_16BIT_PALETTE); |
63 pTexture_506448 = pIcons_LOD->LoadTexturePtr("ib-m5-u", TEXTURE_16BIT_PALETTE); | 61 pSpellBookCloseBtnTextr = pIcons_LOD->LoadTexturePtr("ib-m5-u", TEXTURE_16BIT_PALETTE); |
64 ptr_506440 = pIcons_LOD->LoadTexturePtr("ib-m5-d", TEXTURE_16BIT_PALETTE); | 62 pSpellBookClickCloseBtnTextr = pIcons_LOD->LoadTexturePtr("ib-m5-d", TEXTURE_16BIT_PALETTE); |
65 pTexture_50643C = pIcons_LOD->LoadTexturePtr("ib-m6-u",TEXTURE_16BIT_PALETTE); | 63 pSBQuickSpellBtnTextr = pIcons_LOD->LoadTexturePtr("ib-m6-u",TEXTURE_16BIT_PALETTE); |
66 //v0 = 1; | 64 //v0 = 1; |
67 | 65 |
68 static const char *texNames[9] = // 004E24EC | 66 static const char *texNames[9] = // 004E24EC |
69 { | 67 { |
70 "SBFB00", "SBAB00", "SBWB00", "SBEB00", | 68 "SBFB00", "SBAB00", "SBWB00", "SBEB00", |
71 "SBSB00", "SBMB00", "SBBB00", "SBLB00", "SBDB00" | 69 "SBSB00", "SBMB00", "SBBB00", "SBLB00", "SBDB00" |
72 }; | 70 }; |
73 | 71 |
74 pTexture_506444 = pIcons_LOD->LoadTexturePtr("ib-m6-d",TEXTURE_16BIT_PALETTE); | 72 pSBClickQuickSpellBtnTextr = pIcons_LOD->LoadTexturePtr("ib-m6-d",TEXTURE_16BIT_PALETTE); |
75 for (uint i = 0; i < 9; ++i) | 73 for (uint i = 0; i < 9; ++i) |
76 { | 74 { |
77 pSpellBookPagesTextr[i] = pIcons_LOD->LoadTexturePtr(texNames[i], TEXTURE_16BIT_PALETTE); | 75 pSpellBookPagesTextr[i] = pIcons_LOD->LoadTexturePtr(texNames[i], TEXTURE_16BIT_PALETTE); |
78 | 76 |
79 sprintf(pTmpBuf.data(), "tab%da", i+1); | 77 sprintf(pTmpBuf.data(), "tab%da", i+1); |
104 | 102 |
105 | 103 |
106 | 104 |
107 | 105 |
108 //----- (0041140B) -------------------------------------------------------- | 106 //----- (0041140B) -------------------------------------------------------- |
109 void sub_41140B() | 107 void OnCloseSpellBookPage() |
110 { | 108 { |
111 signed int v0; // esi@1 | 109 GUIButton *pNextButton; // esi@4 |
112 GUIButton *v1; // eax@3 | |
113 GUIButton *v2; // esi@4 | |
114 | 110 |
115 v0 = 0; | 111 for ( uint i = 1; i <= 11; i++ ) |
116 do | |
117 { | 112 { |
118 dword_5063D8[11+v0]->Release(); | 113 SBPageCSpellsTextureList[i]->Release(); |
119 dword_506408[11+v0]->Release(); | 114 SBPageSSpellsTextureList[i]->Release(); |
120 --v0; | |
121 } | 115 } |
122 while ( v0 >= -11 ); | |
123 pIcons_LOD->SyncLoadedFilesCount(); | 116 pIcons_LOD->SyncLoadedFilesCount(); |
124 v1 = pGUIWindow_CurrentMenu->pControlsHead; | 117 if ( pGUIWindow_CurrentMenu->pControlsHead ) |
125 if ( v1 ) | |
126 { | 118 { |
127 do | 119 do |
128 { | 120 { |
129 v2 = v1->pNext; | 121 pNextButton = pGUIWindow_CurrentMenu->pControlsHead->pNext; |
130 pAllocator->FreeChunk(v1); | 122 pAllocator->FreeChunk(pGUIWindow_CurrentMenu->pControlsHead); |
131 v1 = v2; | 123 pGUIWindow_CurrentMenu->pControlsHead = pNextButton; |
132 } | 124 } |
133 while ( v2 ); | 125 while ( pNextButton ); |
134 } | 126 } |
135 pGUIWindow_CurrentMenu->pControlsHead = 0; | 127 pGUIWindow_CurrentMenu->pControlsHead = 0; |
136 pGUIWindow_CurrentMenu->pControlsTail = 0; | 128 pGUIWindow_CurrentMenu->pControlsTail = 0; |
137 pGUIWindow_CurrentMenu->uNumControls = 0; | 129 pGUIWindow_CurrentMenu->uNumControls = 0; |
138 } | 130 } |
139 | 131 |
140 //----- (00411473) -------------------------------------------------------- | 132 //----- (00411473) -------------------------------------------------------- |
141 void sub_411473() | 133 void OnCloseSpellBook() |
142 { | 134 { |
143 pTexture_pagemask->Release(); | 135 pTexture_pagemask->Release(); |
144 pTexture_506448->Release(); | 136 pSpellBookCloseBtnTextr->Release(); |
145 pTexture_50643C->Release(); | 137 pSBQuickSpellBtnTextr->Release(); |
146 for (uint i = 0; i < 9; ++i) | 138 for (uint i = 0; i < 9; ++i) |
147 { | 139 { |
148 pSpellBookPagesTextr[i]->Release(); | 140 pSpellBookPagesTextr[i]->Release(); |
149 pTextures_tabs[i][0]->Release(); | 141 pTextures_tabs[i][0]->Release(); |
150 pTextures_tabs[i][1]->Release(); | 142 pTextures_tabs[i][1]->Release(); |