Mercurial > mm7
diff UI/Books/UIMapBook.cpp @ 1430:71a2cf416478
LloydBeacons
author | Ritor1 |
---|---|
date | Fri, 02 Aug 2013 13:48:57 +0600 |
parents | 28f87f5234a1 |
children | 4d13549db029 |
line wrap: on
line diff
--- a/UI/Books/UIMapBook.cpp Thu Aug 01 17:51:16 2013 +0600 +++ b/UI/Books/UIMapBook.cpp Fri Aug 02 13:48:57 2013 +0600 @@ -88,34 +88,34 @@ unsigned int __cdecl DrawLloydBeaconsScreen() { Player *pPlayer; // esi@1 - char *v1; // eax@1 - unsigned __int16 v2; // ax@6 - unsigned int result; // eax@11 - unsigned int v4; // esi@13 - unsigned int v5; // ecx@13 - char v6; // zf@13 - LloydBeacon *v7; // esi@14 - int v8; // eax@14 - unsigned __int64 v9; // kr08_8@14 - unsigned int v10; // esi@14 - unsigned int v11; // eax@14 - char *v12; // eax@19 - char *v13; // ecx@22 - int v14; // eax@27 + char *pText; // eax@1 + //unsigned __int16 v2; // ax@6 + //unsigned int result; // eax@11 + //unsigned int v4; // esi@13 + //unsigned int v5; // ecx@13 + //char v6; // zf@13 + //LloydBeacon *v7; // esi@14 + int pTextHeight; // eax@14 + int RemainingTime; // kr08_8@14 + unsigned int pHours; // esi@14 + unsigned int pDays; // eax@14 + char *pSelectionText; // eax@19 + //char *v13; // ecx@22 + //int v14; // eax@27 Texture *v19; // [sp-4h] [bp-8Ch]@4 GUIWindow pWindow; // [sp+Ch] [bp-7Ch]@1 - unsigned int v23; // [sp+64h] [bp-24h]@14 - __int64 v24; // [sp+68h] [bp-20h]@14 - unsigned int v25; // [sp+70h] [bp-18h]@13 + //unsigned int v23; // [sp+64h] [bp-24h]@14 + //__int64 v24; // [sp+68h] [bp-20h]@14 + //unsigned int v25; // [sp+70h] [bp-18h]@13 char *Str; // [sp+74h] [bp-14h]@14 - int v27; // [sp+78h] [bp-10h]@11 - LloydBeacon *v28; // [sp+7Ch] [bp-Ch]@12 - RGBTexture *v29; // [sp+80h] [bp-8h]@12 + int BeaconID; // [sp+78h] [bp-10h]@11 + //LloydBeacon *v28; // [sp+7Ch] [bp-Ch]@12 + //RGBTexture *v29; // [sp+80h] [bp-8h]@12 int uNumMaxBeacons; // [sp+84h] [bp-4h]@6 pPlayer = &pParty->pPlayers[_506348_current_lloyd_playerid]; - pRenderer->DrawTextureIndexed(8u, 8u, pTexture_LloydBeacons[(unsigned __int8)bRecallingBeacon]); - v1 = pGlobalTXT_LocalizationStrings[523]; // Recall Beacon + pRenderer->DrawTextureIndexed(8, 8, pTexture_LloydBeacons[(unsigned __int8)bRecallingBeacon]); + pText = pGlobalTXT_LocalizationStrings[523]; // Recall Beacon pWindow.uFrameX = game_viewport_x; pWindow.uFrameY = game_viewport_y; pWindow.uFrameWidth = 428; @@ -123,9 +123,9 @@ pWindow.uFrameZ = 435; pWindow.uFrameW = game_viewport_w; if ( !bRecallingBeacon ) - v1 = pGlobalTXT_LocalizationStrings[375]; // Set Beacon - sprintf(pTmpBuf.data(), "%s", v1); - pWindow.DrawTitleText(pBook2Font, 0, 22u, 0, pTmpBuf.data(), 3u); + pText = pGlobalTXT_LocalizationStrings[375]; // Set Beacon + sprintf(pTmpBuf.data(), "%s", pText); + pWindow.DrawTitleText(pBook2Font, 0, 22u, 0, pTmpBuf.data(), 3); if ( bRecallingBeacon ) { pRenderer->DrawTextureTransparent(pBtn_Book_1->uX, pBtn_Book_1->uY, pTex_tab_an_6b__zoom_on); @@ -137,109 +137,75 @@ v19 = pTex_tab_an_6b__zoom_on; } pRenderer->DrawTextureTransparent(pBtn_Book_2->uX, pBtn_Book_2->uY, v19); - v2 = pPlayer->pActiveSkills[14]; uNumMaxBeacons = 1; - if ( HIBYTE(v2) & 1 || (v2 & 0x80u) != 0 ) + if ( HIBYTE(pPlayer->pActiveSkills[14]) & 1 || (pPlayer->pActiveSkills[14] & 0x80u) != 0 ) { uNumMaxBeacons = 5; } else { - if ( v2 & 0x40 ) + if ( pPlayer->pActiveSkills[14] & 0x40 ) uNumMaxBeacons = 3; } - result = 0; - v27 = 0; if ( uNumMaxBeacons > 0 ) { - v29 = pSavegameThumbnails.data(); - v28 = pPlayer->pInstalledBeacons; - while ( 1 ) + for ( BeaconID = 0; BeaconID < uNumMaxBeacons; BeaconID++ ) { pWindow.uFrameWidth = 92; - v4 = result; pWindow.uFrameHeight = 68; - v5 = pLloydsBeaconsPreviewXs[result]; - pWindow.uFrameY = pLloydsBeaconsPreviewYs[result]; - v25 = pWindow.uFrameY; - pWindow.uFrameX = v5; + pWindow.uFrameY = pLloydsBeaconsPreviewYs[BeaconID]; + pWindow.uFrameX = pLloydsBeaconsPreviewXs[BeaconID]; pWindow.uFrameW = pWindow.uFrameY + 67; - v6 = v29->pPixels == 0; - pWindow.uFrameZ = v5 + 91; - if ( !v6 ) - break; + pWindow.uFrameZ = pLloydsBeaconsPreviewXs[BeaconID] + 91; + //if ( pSavegameThumbnails[BeaconID].pPixels != 0 ) + if ( pPlayer->pInstalledBeacons[BeaconID].SaveFileID != 0 ) + { + pRenderer->DrawTextureTransparent(pLloydsBeacons_SomeXs[BeaconID], pLloydsBeacons_SomeYs[BeaconID], pTexture_CurrentBook); + pRenderer->DrawTextureRGB(pLloydsBeaconsPreviewXs[BeaconID], pLloydsBeaconsPreviewYs[BeaconID], &pSavegameThumbnails[BeaconID]); + Str = pMapStats->pInfos[sub_410D99_get_map_index(pPlayer->pInstalledBeacons[BeaconID].SaveFileID)].pName; + pTextHeight = pSpellFont->CalcTextHeight(Str, &pWindow, 0, 0); + pWindow.uFrameY += -6 - pTextHeight; + pWindow.DrawTitleText(pSpellFont, 0, 0, 1, Str, 3); + RemainingTime = pPlayer->pInstalledBeacons[BeaconID].uBeaconTime - pParty->uTimePlayed; + pHours = (signed __int64)((double)RemainingTime * 0.234375) / 60 / 60; + pDays = pHours / 24; + if ( pDays ) + { + sprintf(pTmpBuf.data(), "%lu %s", pDays + 1, pGlobalTXT_LocalizationStrings[57]);//days + pWindow.uFrameY = pWindow.uFrameY + pWindow.uFrameHeight + 4; + pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf.data(), 3); + continue; + } + else + { + if ( pHours + 1 <= 23 ) + { + if ( pHours < 1 ) + pSelectionText = pGlobalTXT_LocalizationStrings[109];// Hour + else + pSelectionText = pGlobalTXT_LocalizationStrings[110];// Hours + sprintf(pTmpBuf.data(), "%lu %s", pHours + 1, pSelectionText); + pWindow.uFrameY = pWindow.uFrameY + pWindow.uFrameHeight + 4; + pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf.data(), 3); + continue; + } + } + sprintf(pTmpBuf.data(), "%lu %s", pDays + 1, pGlobalTXT_LocalizationStrings[56]);//Day + pWindow.uFrameY = pWindow.uFrameY + pWindow.uFrameHeight + 4; + pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf.data(), 3); + continue; + } if ( !bRecallingBeacon ) { - pRenderer->DrawTextureTransparent(pLloydsBeacons_SomeXs[v4], pLloydsBeacons_SomeYs[v4], pTexture_CurrentBook); - v14 = pSpellFont->CalcTextHeight(pGlobalTXT_LocalizationStrings[19], &pWindow, 0, 0); - pWindow.DrawTitleText(pSpellFont, 0, (signed int)pWindow.uFrameHeight / 2 - v14 / 2, 1, pGlobalTXT_LocalizationStrings[19], 3); - } -LABEL_29: - ++v29; - ++v28; - result = v27++ + 1; - if ( v27 >= uNumMaxBeacons ) - goto LABEL_30; - } - pRenderer->DrawTextureTransparent(pLloydsBeacons_SomeXs[v4], pLloydsBeacons_SomeYs[v4], pTexture_CurrentBook); - pRenderer->DrawTextureRGB(pLloydsBeaconsPreviewXs[v4], pLloydsBeaconsPreviewYs[v4], v29); - v7 = v28; - Str = pMapStats->pInfos[sub_410D99_get_map_index(HIWORD(v28->field_18))].pName; - v8 = pSpellFont->CalcTextHeight(Str, &pWindow, 0, 0); - pWindow.uFrameY += -6 - v8; - pWindow.DrawTitleText(pSpellFont, 0, 0, 1u, Str, 3u); - v9 = v7->uBeaconTime - pParty->uTimePlayed; - LODWORD(v24) = LODWORD(v7->uBeaconTime) - LODWORD(pParty->uTimePlayed); - HIDWORD(v24) = HIDWORD(v9); - v23 = (unsigned __int64)((signed __int64)((double)v24 * 0.234375) / 60 / 60) >> 32; - v10 = (signed __int64)((double)v24 * 0.234375) / 60 / 60; - v11 = v10 / 0x18; - if ( (unsigned int)((signed __int64)((double)v24 * 0.234375) / 60 / 60) / 0x18 ) - { - v13 = pGlobalTXT_LocalizationStrings[57]; // Days - if ( v11 > 1 ) - { - sprintf(pTmpBuf.data(), "%lu %s", v11 + 1, v13); - pWindow.uFrameY = v25 + pWindow.uFrameHeight + 4; - pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf.data(), 3); - goto LABEL_29; + pRenderer->DrawTextureTransparent(pLloydsBeacons_SomeXs[BeaconID], pLloydsBeacons_SomeYs[BeaconID], pTexture_CurrentBook); + pTextHeight = pSpellFont->CalcTextHeight(pGlobalTXT_LocalizationStrings[19], &pWindow, 0, 0); + pWindow.DrawTitleText(pSpellFont, 0, (signed int)pWindow.uFrameHeight / 2 - pTextHeight / 2, 1, pGlobalTXT_LocalizationStrings[19], 3);//Доступно } } - else - { - if ( (signed __int64)(__PAIR__(v23, v10) + 1) <= 23 ) - { - if ( (v23 & 0x80000000u) != 0 || (signed int)v23 <= 0 && v10 <= 1 ) - v12 = pGlobalTXT_LocalizationStrings[109];// Hour - else - v12 = pGlobalTXT_LocalizationStrings[110];// Hours - sprintf(pTmpBuf.data(), "%lu %s", v10 + 1, v12); - pWindow.uFrameY = v25 + pWindow.uFrameHeight + 4; - pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf.data(), 3); - goto LABEL_29; - } - } - v13 = pGlobalTXT_LocalizationStrings[56]; // Day - sprintf(pTmpBuf.data(), "%lu %s", v11 + 1, v13); - pWindow.uFrameY = v25 + pWindow.uFrameHeight + 4; - pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf.data(), 3); - goto LABEL_29; } -LABEL_30: if ( byte_506360 ) - { - /*result = pMessageQueue_50CBD0->uNumMessages; - if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_CloseAfterInstallBeacon; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; - result = 3 * pMessageQueue_50CBD0->uNumMessages + 3; - *(&pMessageQueue_50CBD0->uNumMessages + result) = 0; - ++pMessageQueue_50CBD0->uNumMessages; - }*/ pMessageQueue_50CBD0->AddMessage(UIMSG_CloseAfterInstallBeacon, 0, 0); - } - return result; + return BeaconID; }