Mercurial > mm7
comparison mm7_5.cpp @ 565:e429ad557cda
Merge
author | Nomad |
---|---|
date | Tue, 05 Mar 2013 01:45:43 +0200 |
parents | 5eb2c6286c49 |
children | f54481c85df8 7c0763248a87 |
comparison
equal
deleted
inserted
replaced
564:8b77231088d8 | 565:e429ad557cda |
---|---|
15061 //v0 = (GUIWindow *)&pWindowList_at_506F50_minus1_indexing[21 * pVisibleWindowsIdxs[i]]; | 15061 //v0 = (GUIWindow *)&pWindowList_at_506F50_minus1_indexing[21 * pVisibleWindowsIdxs[i]]; |
15062 pWindow = &pWindowList[pVisibleWindowsIdxs[i] - 1]; | 15062 pWindow = &pWindowList[pVisibleWindowsIdxs[i] - 1]; |
15063 pWindowType = pWindow->eWindowType; | 15063 pWindowType = pWindow->eWindowType; |
15064 switch (pWindow->eWindowType) | 15064 switch (pWindow->eWindowType) |
15065 { | 15065 { |
15066 case WINDOW_MainMenu_Load: | 15066 case WINDOW_MainMenu_Load: |
15067 GameUI_MainMenu_DrawLoad(); | 15067 { |
15068 continue; | 15068 GameUI_MainMenu_DrawLoad(); |
15069 case WINDOW_5E: // window that initiates savegame loading | 15069 break; |
15070 { | 15070 } |
15071 if (pWindow->Hint != (char *)1) | 15071 case WINDOW_5E: // window that initiates savegame loading |
15072 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | 15072 { |
15073 auto pGUIButton3 = (GUIButton *)pWindow->ptr_1C; | 15073 if (pWindow->Hint != (char *)1) |
15074 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton3->pTextures[0]); | 15074 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
15075 pHint = pWindow->Hint; | 15075 auto pGUIButton3 = (GUIButton *)pWindow->ptr_1C; |
15076 viewparams->bRedrawGameUI = 1; | 15076 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton3->pTextures[0]); |
15077 if ( pHint && pHint != (char *)1 ) | 15077 pHint = pWindow->Hint; |
15078 pGUIButton3->DrawLabel(pHint, pFontCreate, 0, 0); | 15078 viewparams->bRedrawGameUI = 1; |
15079 pWindow->Release(); | 15079 if ( pHint && pHint != (char *)1 ) |
15080 if (pCurrentScreen == SCREEN_SAVEGAME) | 15080 pGUIButton3->DrawLabel(pHint, pFontCreate, 0, 0); |
15081 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveGame, 0, 0); | 15081 pWindow->Release(); |
15082 else | 15082 if (pCurrentScreen == SCREEN_SAVEGAME) |
15083 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); | 15083 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveGame, 0, 0); |
15084 } | 15084 else |
15085 continue; | 15085 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); |
15086 } | 15086 break; |
15087 if ( (signed int)pWindowType > 70 ) | 15087 } |
15088 { | 15088 case WINDOW_3: |
15089 if ( (signed int)pWindowType > 95 ) | 15089 { |
15090 { | 15090 pTexture = (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0);//pWindowType == 3 (0x3) |
15091 v33 = pWindowType - 96; | 15091 pY = pViewport->uViewportY; |
15092 if ( pWindowType == WINDOW_60 )//96 | 15092 pX = pViewport->uViewportX; |
15093 { | 15093 pRenderer->DrawTextureIndexed(pX, pY, pTexture); |
15094 if ( pWindow->Hint != (char *)1 ) | 15094 viewparams->bRedrawGameUI = 1; |
15095 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | 15095 break; |
15096 pGUIButton = (GUIButton *)pWindow->ptr_1C; | 15096 } |
15097 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton->pTextures[0]); | 15097 case WINDOW_CharacterRecord: |
15098 pHint = pWindow->Hint; | 15098 { |
15099 viewparams->bRedrawGameUI = 1; | 15099 CharacterUI_CharacterScreen_Draw(uActiveCharacter); |
15100 if ( pHint && pHint != (char *)1 ) | 15100 break; |
15101 pGUIButton->DrawLabel(pHint, pFontCreate, 0, 0); | 15101 } |
15102 pWindow->Release(); | 15102 case WINDOW_Options: |
15103 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | 15103 { |
15104 continue; | 15104 DrawGameOptions(); |
15105 pNumMessages = pMessageQueue_50CBD0->uNumMessages; | 15105 break; |
15106 //LABEL_151: | 15106 } |
15107 pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113; | 15107 case WINDOW_Book: |
15108 //LABEL_152: | 15108 { |
15109 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | 15109 SellectDrawBook((unsigned int)pWindow->ptr_1C); |
15110 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 15110 break; |
15111 ++pMessageQueue_50CBD0->uNumMessages;*/ | 15111 } |
15112 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | 15112 case WINDOW_QuickReference: |
15113 continue; | 15113 { |
15114 } | 15114 QuickRefDraw(); |
15115 v34 = v33 - 1; | 15115 break; |
15116 if ( v34 )//pWindowType > 97 | 15116 } |
15117 { | 15117 case WINDOW_Rest: |
15118 v35 = v34 - 1; | 15118 { |
15119 if ( v35 )//pWindowType > 98 | 15119 RestUI_Draw(); |
15120 { | 15120 break; |
15121 v36 = v35 - 1; | 15121 } |
15122 if ( v36 )//pWindowType > 99 | 15122 case WINDOW_Dialogue: |
15123 { | 15123 { |
15124 v37 = v36 - 4; | 15124 DrawDialogueUI(); |
15125 if ( v37 )//pWindowType > 103 | 15125 break; |
15126 { | 15126 } |
15127 v38 = v37 - 2; | 15127 case WINDOW_ChangeLocation: |
15128 if ( v38 )//pWindowType > 105 | 15128 { |
15129 { | 15129 TravelUI_Draw(); |
15130 if ( pWindowType == WINDOW_VideoOptions ) | 15130 break; |
15131 GameMenuUI_DrawVideoOptions(); | 15131 } |
15132 } | 15132 case WINDOW_SpellBook: |
15133 else if ( pWindowType == WINDOW_KeyMappingOptions ) | 15133 { |
15134 { | 15134 DrawSpellBookContent(); |
15135 GameMenuUI_DrawKeyBindings(); | 15135 break; |
15136 } | 15136 } |
15137 } | 15137 case WINDOW_GreetingNPC: |
15138 else//pWindowType == WINDOW_67 | 15138 { |
15139 { | 15139 DrawBranchlessDialogueUI(); |
15140 pWindow->DrawMessageBox(0); | 15140 break; |
15141 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); | 15141 } |
15142 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); | 15142 case WINDOW_Transition: |
15143 if ( !pKeyActionMap->field_204 ) | 15143 { |
15144 { | 15144 TransitionUI_Draw(); |
15145 ItemGen2.Reset(); | 15145 break; |
15146 pWindow->Release(); | 15146 } |
15147 pEventTimer->Resume(); | 15147 case WINDOW_Scroll: |
15148 pCurrentScreen = SCREEN_GAME; | 15148 { |
15149 viewparams->bRedrawGameUI = 1; | 15149 CreateScrollWindow(); |
15150 v39 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); | 15150 break; |
15151 if ( v39 > 0 ) | 15151 } |
15152 { | 15152 case WINDOW_FinalWindow: |
15153 if ( v39 < 800 ) | 15153 { |
15154 SpawnActor(v39); | 15154 sub_41420D_press_esc(); |
15155 } | 15155 break; |
15156 } | 15156 } |
15157 } | 15157 case WINDOW_VideoOptions: |
15158 continue; | 15158 { |
15159 } | 15159 GameMenuUI_DrawVideoOptions(); |
15160 pTexture = (Texture *)*((_DWORD *)pWindow->ptr_1C + 15);//pWindowType == 99 (0x63) WINDOW_63 | 15160 break; |
15161 } | |
15162 case WINDOW_KeyMappingOptions: | |
15163 { | |
15164 GameMenuUI_DrawKeyBindings(); | |
15165 break; | |
15166 } | |
15167 case WINDOW_17: | |
15168 { | |
15169 sub_4606FE(); | |
15170 break; | |
15171 } | |
15172 case WINDOW_1F: | |
15173 { | |
15174 pRenderer->ClearZBuffer(0, 479); | |
15175 draw_leather(); | |
15176 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | |
15177 CharacterUI_DrawPaperdoll(uActiveCharacter); | |
15178 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, | |
15179 (Texture *)(uTextureID_x_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_x_u] : 0)); | |
15180 break; | |
15181 } | |
15182 case WINDOW_RestWindow: | |
15183 { | |
15184 memset(&GUIButton2, 0, 0xBCu);//pWindowType == 98 (0x62) WINDOW_RestWindow | |
15185 GUIButton2.uZ = 197; | |
15186 GUIButton2.uW = 197; | |
15187 GUIButton2.uX = 27; | |
15188 GUIButton2.uY = 161; | |
15189 GUIButton2.uWidth = 171; | |
15190 GUIButton2.uHeight = 37; | |
15191 GUIButton2.pParent = pButton_RestUI_WaitUntilDawn->pParent; | |
15192 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
15193 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)pWindow->ptr_1C + 15)); | |
15194 viewparams->bRedrawGameUI = 1; | |
15195 GUIButton2.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, 0, 0);//Отдых и лечение 8 часов | |
15196 GUIButton2.pParent = 0; | |
15197 pGUIWindow2 = pWindow; | |
15198 pGUIWindow2->Release(); | |
15199 break; | |
15200 } | |
15201 case WINDOW_60: | |
15202 { | |
15203 if ( pWindow->Hint != (char *)1 ) | |
15204 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
15205 pGUIButton = (GUIButton *)pWindow->ptr_1C; | |
15206 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton->pTextures[0]); | |
15207 pHint = pWindow->Hint; | |
15208 viewparams->bRedrawGameUI = 1; | |
15209 if ( pHint && pHint != (char *)1 ) | |
15210 pGUIButton->DrawLabel(pHint, pFontCreate, 0, 0); | |
15211 pWindow->Release(); | |
15212 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
15213 break; | |
15214 } | |
15215 case WINDOW_61: | |
15216 { | |
15217 if ( pWindow->Hint != (char *)1 )//pWindowType == WINDOW_61 | |
15218 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
15219 v32 = pWindow->ptr_1C; | |
15220 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)v32 + 16)); | |
15221 pHint = pWindow->Hint; | |
15222 viewparams->bRedrawGameUI = 1; | |
15223 if ( pHint && pHint != (char *)1 ) | |
15224 ((GUIButton *)v32)->DrawLabel(pHint, pFontCreate, 0, 0); | |
15225 pWindow->Release(); | |
15226 pNumMessages = pMessageQueue_50CBD0->uNumMessages; | |
15227 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
15228 break; | |
15229 } | |
15230 case WINDOW_63: | |
15231 { | |
15232 pTexture = (Texture *)*((_DWORD *)pWindow->ptr_1C + 15);//pWindowType == 99 (0x63) WINDOW_63 | |
15161 pY = pWindow->uFrameY; | 15233 pY = pWindow->uFrameY; |
15162 pX = pWindow->uFrameX; | 15234 pX = pWindow->uFrameX; |
15163 //LABEL_18: | |
15164 pRenderer->DrawTextureIndexed(pX, pY, pTexture); | 15235 pRenderer->DrawTextureIndexed(pX, pY, pTexture); |
15165 //LABEL_114: | |
15166 viewparams->bRedrawGameUI = 1; | 15236 viewparams->bRedrawGameUI = 1; |
15167 continue; | 15237 break; |
15168 } | 15238 } |
15169 memset(&GUIButton2, 0, 0xBCu);//pWindowType == 98 (0x62) WINDOW_RestWindow | 15239 case WINDOW_CharacterWindow_Inventory: |
15170 GUIButton2.uZ = 197; | 15240 { |
15171 GUIButton2.uW = 197; | 15241 pWindow->DrawMessageBox(0); |
15172 GUIButton2.uX = 27; | 15242 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); |
15173 GUIButton2.uY = 161; | 15243 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); |
15174 GUIButton2.uWidth = 171; | 15244 if ( !pKeyActionMap->field_204 ) |
15175 GUIButton2.uHeight = 37; | |
15176 GUIButton2.pParent = pButton_RestUI_WaitUntilDawn->pParent; | |
15177 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
15178 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)pWindow->ptr_1C + 15)); | |
15179 viewparams->bRedrawGameUI = 1; | |
15180 GUIButton2.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, 0, 0);//Отдых и лечение 8 часов | |
15181 GUIButton2.pParent = 0; | |
15182 //goto LABEL_134; | |
15183 pGUIWindow2 = pWindow; | |
15184 //goto LABEL_110; | |
15185 pGUIWindow2->Release(); | |
15186 continue; | |
15187 } | |
15188 if ( pWindow->Hint != (char *)1 )//pWindowType == WINDOW_61 | |
15189 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
15190 v32 = pWindow->ptr_1C; | |
15191 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)v32 + 16)); | |
15192 //goto LABEL_138; | |
15193 pHint = pWindow->Hint; | |
15194 viewparams->bRedrawGameUI = 1; | |
15195 if ( pHint && pHint != (char *)1 ) | |
15196 ((GUIButton *)v32)->DrawLabel(pHint, pFontCreate, 0, 0); | |
15197 pWindow->Release(); | |
15198 pNumMessages = pMessageQueue_50CBD0->uNumMessages; | |
15199 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
15200 { | |
15201 pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113; | |
15202 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
15203 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
15204 ++pMessageQueue_50CBD0->uNumMessages; | |
15205 continue; | |
15206 }*/ | |
15207 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
15208 continue; | |
15209 } | |
15210 | |
15211 if ( pWindowType == WINDOW_5F ) | |
15212 { | |
15213 if ( pWindow->Hint != (char *)1 ) | |
15214 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
15215 v32 = pWindow->ptr_1C; | |
15216 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)v32 + 15)); | |
15217 //LABEL_138: | |
15218 pHint = pWindow->Hint; | |
15219 viewparams->bRedrawGameUI = 1; | |
15220 if ( pHint && pHint != (char *)1 ) | |
15221 ((GUIButton *)v32)->DrawLabel(pHint, pFontCreate, 0, 0); | |
15222 pWindow->Release(); | |
15223 //LABEL_142: | |
15224 pNumMessages = pMessageQueue_50CBD0->uNumMessages; | |
15225 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
15226 //goto LABEL_151; | |
15227 { | |
15228 pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113; //0x71 | |
15229 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
15230 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
15231 ++pMessageQueue_50CBD0->uNumMessages; | |
15232 continue; | |
15233 }*/ | |
15234 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
15235 continue; | |
15236 } | |
15237 v14 = pWindowType - 80; | |
15238 if ( v14 )//pWindowType > 80 | |
15239 { | |
15240 v15 = v14 - 9; | |
15241 if ( pWindowType == WINDOW_59) | |
15242 { | |
15243 pWindow->DrawMessageBox(0); | |
15244 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); | |
15245 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); | |
15246 if ( !pKeyActionMap->field_204 ) | |
15247 { | |
15248 pItemGen.Reset(); | |
15249 pWindow->Release(); | |
15250 pEventTimer->Resume(); | |
15251 pCurrentScreen = SCREEN_GAME; | |
15252 viewparams->bRedrawGameUI = 1; | |
15253 v26 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); | |
15254 if ( v26 > 0 ) | |
15255 { | 15245 { |
15256 if ( v26 < 800 ) | 15246 ItemGen2.Reset(); |
15257 { | 15247 pWindow->Release(); |
15258 pItemGen.SetIdentified(); | 15248 pEventTimer->Resume(); |
15259 pItemGen.uItemID = v26; | 15249 pCurrentScreen = SCREEN_GAME; |
15260 if ( pItemsTable->pItems[v26].uEquipType == 12 ) | 15250 viewparams->bRedrawGameUI = 1; |
15251 v39 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); | |
15252 if ( v39 > 0 ) | |
15261 { | 15253 { |
15262 pItemGen.uNumCharges = rand() % 6 + pItemsTable->pItems[pItemGen.uItemID].uDamageMod + 1; | 15254 if ( v39 < 800 ) |
15263 pItemGen.uMaxCharges = LOBYTE(pItemGen.uNumCharges); | 15255 SpawnActor(v39); |
15264 } | 15256 } |
15265 else | |
15266 { | |
15267 if ( v26 >= 221 && v26 < 271 ) | |
15268 pItemGen.uEncantmentType = rand() % 10 + 1; | |
15269 } | |
15270 pItemsTable->SetSpecialBonus(&pItemGen); | |
15271 pParty->SetHoldingItem(&pItemGen); | |
15272 } | |
15273 } | 15257 } |
15274 } | 15258 break; |
15275 continue; | 15259 } |
15276 } | 15260 case WINDOW_Chest: |
15277 v16 = v15 - 1; | 15261 { |
15278 if ( pWindowType == WINDOW_5A ) // Press buttons in title menu and in game, and escape in game | 15262 if ( pCurrentScreen == SCREEN_CHEST ) |
15279 { | |
15280 if ( pWindow->Hint != (char *)1 ) | |
15281 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
15282 pButtonPtr_1C = (GUIButton *)pWindow->ptr_1C; | |
15283 if ( pButtonPtr_1C->uX >= 0 )//if ( (pButtonPtr_1C->uX & 0x80000000u) == 0 ) | |
15284 { | |
15285 if ( (signed int)pButtonPtr_1C->uX <= 640 ) | |
15286 { | 15263 { |
15287 //v25 = pButtonPtr_1C->uY; | 15264 Chest::DrawChestUI((unsigned int)pWindow->ptr_1C); |
15288 if ( pButtonPtr_1C->uY >= 0 ) //if ( (pButtonPtr_1C->uY & 0x80000000u) == 0 ) | |
15289 { | |
15290 if ( (signed int)pButtonPtr_1C->uY <= 480 ) | |
15291 { | |
15292 pTexture2 = pButtonPtr_1C->pTextures[0]; | |
15293 //goto LABEL_94; | |
15294 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pTexture2); | |
15295 pHint1 = pWindow->Hint; | |
15296 viewparams->bRedrawGameUI = 1; | |
15297 if ( pHint1 ) | |
15298 { | |
15299 v24 = pHint1 == (char *)1; | |
15300 if ( !v24 ) | |
15301 pButtonPtr_1C->DrawLabel(pHint1, pFontCreate, 0, 0); | |
15302 } | |
15303 pGUIWindow2 = pWindow; | |
15304 pGUIWindow2->Release(); | |
15305 continue; | |
15306 } | |
15307 } | |
15308 } | 15265 } |
15309 } | 15266 else if ( pCurrentScreen == SCREEN_F ) |
15310 pHint1 = pWindow->Hint; | 15267 { |
15311 viewparams->bRedrawGameUI = 1; | 15268 pRenderer->ClearZBuffer(0, 479); |
15312 if ( pHint1 ) | 15269 draw_leather(); |
15313 { | 15270 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); |
15314 v24 = pHint1 == (char *)1; | 15271 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, |
15315 //goto LABEL_82; | 15272 (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0)); |
15316 if ( !v24 ) | 15273 } |
15317 pButtonPtr_1C->DrawLabel(pHint1, pFontCreate, 0, 0); | 15274 break; |
15318 pGUIWindow2 = pWindow; | 15275 } |
15319 pGUIWindow2->Release(); | 15276 case WINDOW_HouseInterior: |
15320 continue; | 15277 { |
15321 } | 15278 pWindowList[pVisibleWindowsIdxs[i] - 1].HouseDialogManager(); |
15322 //LABEL_134: | 15279 if ( !window_SpeakInHouse ) |
15323 pGUIWindow2 = pWindow; | 15280 continue; |
15324 //goto LABEL_110; | 15281 v10 = window_SpeakInHouse->ptr_1C; |
15325 pGUIWindow2->Release(); | 15282 if ( (signed int)v10 >= 53 ) |
15326 continue; | 15283 continue; |
15327 } | 15284 if ( pParty->field_3C._shop_ban_times[(signed int)v10] <=pParty->uTimePlayed ) |
15328 v17 = v16 - 1; | 15285 { |
15329 if ( pWindowType == WINDOW_5B )//Change button in Character window | 15286 if ( (signed int)v10 < 53 ) |
15330 { | 15287 { |
15331 if ( pWindow->Hint != (char *)1 ) | 15288 pParty->field_3C._shop_ban_times[(signed int)v10] = 0; |
15332 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | 15289 } |
15333 pButtonPtr_1C = (GUIButton *)pWindow->ptr_1C; | 15290 continue; |
15334 pTexture2 = pButtonPtr_1C->pTextures[1]; | 15291 } |
15335 //LABEL_94: | 15292 pNumMessages = pMessageQueue_50CBD0->uNumMessages; |
15336 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pTexture2); | 15293 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
15337 //LABEL_80: | 15294 break; |
15338 pHint1 = pWindow->Hint; | 15295 } |
15339 viewparams->bRedrawGameUI = 1; | 15296 default: |
15340 if ( pHint1 ) | 15297 { |
15341 { | 15298 break; |
15342 v24 = pHint1 == (char *)1; | 15299 } |
15343 //LABEL_82: | 15300 } |
15344 if ( !v24 ) | |
15345 pButtonPtr_1C->DrawLabel(pHint1, pFontCreate, 0, 0); | |
15346 } | |
15347 //goto LABEL_134; | |
15348 pGUIWindow2 = pWindow; | |
15349 //goto LABEL_110; | |
15350 pGUIWindow2->Release(); | |
15351 continue; | |
15352 } | |
15353 v18 = v17 - 1; | |
15354 if ( pWindowType == WINDOW_VoiceSwitcherButton ) // Change page in AutonotesBook | |
15355 { | |
15356 if ( pWindow->Hint != (char *)1 ) | |
15357 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
15358 pButtonPtr_1C = (GUIButton *)pWindow->ptr_1C; | |
15359 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButtonPtr_1C->pTextures[0]); | |
15360 //goto LABEL_80; | |
15361 pHint1 = pWindow->Hint; | |
15362 viewparams->bRedrawGameUI = 1; | |
15363 if ( pHint1 ) | |
15364 { | |
15365 v24 = pHint1 == (char *)1; | |
15366 if ( !v24 ) | |
15367 pButtonPtr_1C->DrawLabel(pHint1, pFontCreate, 0, 0); | |
15368 } | |
15369 pGUIWindow2 = pWindow; | |
15370 pGUIWindow2->Release(); | |
15371 continue; | |
15372 } | |
15373 v19 = v18 - 1; | |
15374 if ( pWindowType == WINDOW_5D ) | |
15375 { | |
15376 if ( pWindow->Hint != (char *)1 ) | |
15377 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
15378 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)pWindow->ptr_1C + 16)); | |
15379 viewparams->bRedrawGameUI = 1; | |
15380 //goto LABEL_134; | |
15381 pGUIWindow2 = pWindow; | |
15382 //goto LABEL_110; | |
15383 pGUIWindow2->Release(); | |
15384 continue; | |
15385 } | |
15386 } | |
15387 else if ( pWindowType == WINDOW_50 ) | |
15388 { | |
15389 v27 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | |
15390 if ( ptr_507BD0->field_40 == 1 ) | |
15391 { | |
15392 ptr_507BD0->DrawMessageBox(0); | |
15393 ptr_507BD0->DrawText(pFontCreate, 30, 40, v27, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); | |
15394 pGUIFont = pFontCreate; | |
15395 v31 = pFontCreate->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer); | |
15396 ptr_507BD0->DrawFlashingInputCursor(v31 + 30, 40, pGUIFont); | |
15397 continue; | |
15398 } | |
15399 if ( ptr_507BD0->field_40 == 2 ) | |
15400 { | |
15401 v29 = pMessageQueue_50CBD0->uNumMessages; | |
15402 pWindow->field_40 = 0; | |
15403 /*if ( (signed int)v29 < 40 ) | |
15404 { | |
15405 pMessageQueue_50CBD0->pMessages[v29].eType = (UIMessageType)(int)ptr_507BD0->ptr_1C; | |
15406 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
15407 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
15408 ++pMessageQueue_50CBD0->uNumMessages; | |
15409 }*/ | |
15410 pMessageQueue_50CBD0->AddMessage((UIMessageType)(int)ptr_507BD0->ptr_1C, 0, 0); | |
15411 pEventTimer->Resume(); | |
15412 ptr_507BD0->Release(); | |
15413 pCurrentScreen = SCREEN_GAME; | |
15414 //goto LABEL_114; | |
15415 viewparams->bRedrawGameUI = 1; | |
15416 continue; | |
15417 } | |
15418 if ( ptr_507BD0->field_40 == 3 ) | |
15419 { | |
15420 pWindow->field_40 = 0; | |
15421 pEventTimer->Resume(); | |
15422 pGUIWindow2 = ptr_507BD0; | |
15423 //LABEL_110: | |
15424 pGUIWindow2->Release(); | |
15425 continue; | |
15426 } | |
15427 } | |
15428 } | |
15429 else | |
15430 { | |
15431 if ( pWindowType == WINDOW_FinalWindow ) | |
15432 { | |
15433 sub_41420D_press_esc(); | |
15434 continue; | |
15435 } | |
15436 if ( (signed int)pWindowType > 18 ) | |
15437 { | |
15438 if ( (signed int)pWindowType > 25 ) | |
15439 { | |
15440 v12 = pWindowType - 26; | |
15441 if ( v12 )// pWindowType > 26 | |
15442 { | |
15443 v13 = v12 - 4; | |
15444 if ( v13 )//pWindowType > 30 | |
15445 { | |
15446 if ( pWindowType == WINDOW_1F) | |
15447 { | |
15448 pRenderer->ClearZBuffer(0, 479); | |
15449 draw_leather(); | |
15450 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | |
15451 CharacterUI_DrawPaperdoll(uActiveCharacter); | |
15452 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, | |
15453 (Texture *)(uTextureID_x_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_x_u] : 0)); | |
15454 } | |
15455 } | |
15456 else if( pWindowType == WINDOW_Scroll) | |
15457 { | |
15458 CreateScrollWindow(); | |
15459 } | |
15460 } | |
15461 else if ( pWindowType == WINDOW_Transition ) | |
15462 { | |
15463 TransitionUI_Draw(); | |
15464 } | |
15465 continue; | |
15466 } | |
15467 if ( pWindowType != 25 ) | |
15468 { | |
15469 v7 = pWindowType - 19; | |
15470 if ( v7 )// pWindowType > 19 | |
15471 { | |
15472 v8 = v7 - 1; | |
15473 if ( v8 )// pWindowType > 20 | |
15474 { | |
15475 v9 = v8 - 3; | |
15476 if ( v9 )//pWindowType > 23 | |
15477 { | |
15478 //if ( v9 == 1 ) //pWindowType == 24 (0x18) WINDOW_MainMenu_Load | |
15479 // sub_4606F7(); | |
15480 } | |
15481 else if ( pWindowType == WINDOW_17 ) | |
15482 { | |
15483 sub_4606FE(); | |
15484 } | |
15485 } | |
15486 else if ( pWindowType == WINDOW_Chest ) | |
15487 { | |
15488 if ( pCurrentScreen == SCREEN_CHEST ) | |
15489 { | |
15490 Chest::DrawChestUI((unsigned int)pWindow->ptr_1C); | |
15491 } | |
15492 else | |
15493 { | |
15494 if ( pCurrentScreen == SCREEN_F ) | |
15495 { | |
15496 pRenderer->ClearZBuffer(0, 479); | |
15497 draw_leather(); | |
15498 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | |
15499 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, | |
15500 (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0)); | |
15501 } | |
15502 } | |
15503 } | |
15504 } | |
15505 else if (pWindowType == WINDOW_GreetingNPC ) | |
15506 { | |
15507 DrawBranchlessDialogueUI(); | |
15508 } | |
15509 continue; | |
15510 } | |
15511 pWindowList[pVisibleWindowsIdxs[i] - 1].HouseDialogManager(); | |
15512 if ( !window_SpeakInHouse ) | |
15513 continue; | |
15514 v10 = window_SpeakInHouse->ptr_1C; | |
15515 if ( (signed int)v10 >= 53 ) | |
15516 continue; | |
15517 if ( pParty->field_3C._shop_ban_times[(signed int)v10] <=pParty->uTimePlayed ) | |
15518 { | |
15519 if ( (signed int)v10 < 53 ) | |
15520 { | |
15521 pParty->field_3C._shop_ban_times[(signed int)v10] = 0; | |
15522 } | |
15523 continue; | |
15524 } | |
15525 //goto LABEL_142; | |
15526 pNumMessages = pMessageQueue_50CBD0->uNumMessages; | |
15527 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
15528 { | |
15529 pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113; | |
15530 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
15531 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
15532 ++pMessageQueue_50CBD0->uNumMessages; | |
15533 continue; | |
15534 }*/ | |
15535 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
15536 continue; | |
15537 } | |
15538 if ( pWindowType == WINDOW_SpellBook ) | |
15539 { | |
15540 DrawSpellBookContent(); | |
15541 } | |
15542 else | |
15543 { | |
15544 if ( (signed int)pWindowType > 10 ) | |
15545 { | |
15546 v5 = pWindowType - 12; | |
15547 if ( v5 )//pWindowType >12 | |
15548 { | |
15549 v6 = v5 - 4; | |
15550 if ( v6 )//pWindowType > 16 | |
15551 { | |
15552 if ( pWindowType == WINDOW_ChangeLocation ) | |
15553 TravelUI_Draw(); | |
15554 } | |
15555 else if ( pWindowType == WINDOW_Rest ) | |
15556 { | |
15557 RestUI_Draw(); | |
15558 } | |
15559 } | |
15560 else if (pWindowType == WINDOW_QuickReference ) | |
15561 { | |
15562 QuickRefDraw(); | |
15563 } | |
15564 continue; | |
15565 } | |
15566 if ( pWindowType != 10 ) //pWindowType == 10 | |
15567 { | |
15568 v2 = pWindowType - 3; | |
15569 if ( v2 )//pWindowType > 3 | |
15570 { | |
15571 v3 = v2 - 1; | |
15572 if ( v3 )// pWindowType > 4 | |
15573 { | |
15574 v4 = v3 - 2; | |
15575 if ( v4 )//pWindowType > 6 | |
15576 { | |
15577 if ( pWindowType == WINDOW_Book ) | |
15578 SellectDrawBook((unsigned int)pWindow->ptr_1C); | |
15579 } | |
15580 else if (pWindowType == WINDOW_Options) | |
15581 { | |
15582 DrawGameOptions(); | |
15583 } | |
15584 } | |
15585 else if (pWindowType == WINDOW_CharacterRecord) | |
15586 { | |
15587 CharacterUI_CharacterScreen_Draw(uActiveCharacter); | |
15588 } | |
15589 continue; | |
15590 } | |
15591 pTexture = (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0);//pWindowType == 3 (0x3) | |
15592 pY = pViewport->uViewportY; | |
15593 pX = pViewport->uViewportX; | |
15594 //goto LABEL_18; | |
15595 pRenderer->DrawTextureIndexed(pX, pY, pTexture); | |
15596 viewparams->bRedrawGameUI = 1; | |
15597 continue; | |
15598 } | |
15599 DrawDialogueUI(); | |
15600 } | |
15601 } | |
15602 } | 15301 } |
15603 if ( GetCurrentMenuID() == -1 ) | 15302 if ( GetCurrentMenuID() == -1 ) |
15604 GameUI_DrawFoodAndGold(); | 15303 GameUI_DrawFoodAndGold(); |
15605 if ( sub_4637E0_is_there_popup_onscreen() ) | 15304 if ( sub_4637E0_is_there_popup_onscreen() ) |
15606 sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(0); | 15305 sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(0); |