Mercurial > mm7
changeset 999:dcdfbb6eede9
Слияние
author | Ritor1 |
---|---|
date | Tue, 14 May 2013 17:38:14 +0600 |
parents | e4383e6dfbef (current diff) 5876a9cafa3e (diff) |
children | 53109a1455fc |
files | GUIWindow.cpp GUIWindow.h Player.cpp mm7_3.cpp mm7_5.cpp |
diffstat | 15 files changed, 908 insertions(+), 866 deletions(-) [+] |
line wrap: on
line diff
--- a/Actor.cpp Tue May 14 17:37:24 2013 +0600 +++ b/Actor.cpp Tue May 14 17:38:14 2013 +0600 @@ -34,6 +34,61 @@ stru319 stru_50C198; // idb + + + +//----- (0041AF52) -------------------------------------------------------- +void Actor::DrawHealthBar(Actor *a1, GUIWindow *a2) +{ + unsigned int v2; // eax@1 + GUIWindow *v3; // edi@1 + unsigned int v4; // esi@1 + signed int v5; // ebx@4 + double v6; // st7@5 + unsigned int v7; // eax@6 + unsigned int v8; // ebx@10 + unsigned int v9; // [sp+14h] [bp-Ch]@4 + unsigned int v10; // [sp+1Ch] [bp-4h]@4 + + v2 = a1->pMonsterInfo.uHP; + v3 = a2; + v4 = 25; + if ( (signed int)v2 > 25 ) + { + v4 = 200; + if ( (signed int)v2 < 200 ) + v4 = a1->pMonsterInfo.uHP; + } + v5 = a1->sCurrentHP; + v10 = v4; + v9 = uTextureID_mhp_grn; + if ( v5 < (signed int)v2 ) + { + v6 = (double)(signed int)v2; + v10 = (signed __int64)((double)(signed int)v4 / (double)(signed int)v2 * (double)a1->sCurrentHP); + if ( v5 <= (signed int)(signed __int64)(0.34 * v6) ) + { + v7 = uTextureID_mhp_red; + v9 = v7; + } + else if ( v5 <= (signed int)(signed __int64)(v6 * 0.67) ) + { + v7 = uTextureID_mhp_yel; + v9 = v7; + } + } + v8 = a2->uFrameX + (signed int)(a2->uFrameWidth - v4) / 2; + + pRenderer->SetTextureClipRect(v8, a2->uFrameY + 32, v8 + v4, a2->uFrameY + 52); + pRenderer->DrawTextureIndexed(v8, v3->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_bd)); + pRenderer->SetTextureClipRect(v8, v3->uFrameY + 32, v8 + v10, v3->uFrameY + 52); + pRenderer->DrawTextureIndexed(v8, v3->uFrameY + 34, pIcons_LOD->GetTexture(v9)); + + pRenderer->ResetTextureClipRect(); + pRenderer->DrawTextureIndexed(v8 - 5, v3->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capl)); + pRenderer->DrawTextureIndexed(v8 + v4, v3->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capr)); +} + //----- (00448A40) -------------------------------------------------------- void Actor::ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle) {
--- 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)
--- a/GUIWindow.h Tue May 14 17:37:24 2013 +0600 +++ b/GUIWindow.h Tue May 14 17:38:14 2013 +0600 @@ -461,7 +461,29 @@ + + +void draw_leather(); + + + + +// game ui +void GameUI_DrawRightPanel(); +void GameUI_DrawRightPanelFrames(); +void GameUI_DrawRightPanelItems(); void GameUI_QuickRef_Draw(); +void GameUI_DrawFoodAndGold(); +void GameUI_DrawLifeManaBars(); +void GameUI_DrawHiredNPCs(); +void GameUI_DrawPortraits(unsigned int _this); +void GameUI_Footer(); +void GameUI_Footer_2(); +void GameUI_SetFooterString(const char *pStr); +void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap); +void GameUI_DrawPartySpells(); +void GameUI_DrawTorchlightAndWizardEye(); +void GameUI_DrawCharacterSelectionFrame(); @@ -472,8 +494,9 @@ -//character ui -unsigned int GetSkillColor(unsigned int uPlayerClass, PLAYER_SKILL_TYPE uPlayerSkillType, signed int skill_level); + +// character ui +struct GUIWindow *CharacterUI_Initialize(unsigned int _this); const char *CharacterUI_GetSkillDescText(unsigned int uPlayerID, PLAYER_SKILL_TYPE uPlayerSkillType); char CharacterUI_SkillsTab_ShowHint(); void CharacterUI_StatsTab_ShowHint(); @@ -487,11 +510,28 @@ void CharacterUI_DrawPaperdollWithRingOverlay(Player *player); void CharacterUI_ReleaseButtons(); +unsigned int GetSkillColor(unsigned int uPlayerClass, PLAYER_SKILL_TYPE uPlayerSkillType, signed int skill_level); +//book ui +void BookUI_Draw(WindowType book); +void BookUI_Questbook_Draw(); +void BookUI_Autonotes_Draw(); +void BookUI_Map_Draw(); +void BookUI_Calendar_Draw(); + +void OnCloseSpellBook(); +void InitializeBookTextures(); +void InitializeBookFonts(); +void DrawSpellBookContent(); +void DrawBook_History(); +unsigned int __cdecl DrawLloydBeaconsScreen(); +void DrawTownPortalScreen(); +void LoadSpellbook(unsigned int uID); // idb +void DrawSpellDescriptionPopup(int spell_index); @@ -650,12 +690,26 @@ extern GUIButton *pCreationUI_BtnPressLeft[4]; extern GUIButton *pCreationUI_BtnPressRight[4]; +extern int uTextureID_GameUI_CharSelectionFrame; // 50C98C -extern unsigned int ui_color_text_default; -extern unsigned int ui_color_text_highlight; -extern unsigned int ui_color_text_header; -extern unsigned int ui_color_text_bonus; -extern unsigned int ui_color_text_bonus_neg; -extern unsigned int ui_color_text_skill_upgradeable; -extern unsigned int ui_color_text_skill_not_upgradeable; -extern unsigned int ui_color_text_awards[6]; \ No newline at end of file +extern unsigned int ui_character_default_text_color; +extern unsigned int ui_character_skill_highlight_color; +extern unsigned int ui_character_header_text_color; +extern unsigned int ui_character_bonus_text_color; +extern unsigned int ui_character_bonus_text_color_neg; +extern unsigned int ui_character_skill_upgradeable_color; +extern unsigned int ui_character_skill_default_color; +extern unsigned int ui_character_award_color[6]; +extern unsigned int ui_game_minimap_outline_color; +extern unsigned int ui_game_minimap_actor_friendly_color; +extern unsigned int ui_game_minimap_actor_hostile_color; +extern unsigned int ui_game_minimap_actor_corpse_color; +extern unsigned int ui_game_minimap_decoration_color_1; +extern unsigned int ui_game_minimap_projectile_color; +extern unsigned int ui_game_minimap_treasure_color; +extern unsigned int ui_book_quests_title_color; +extern unsigned int ui_book_quests_text_color; +extern unsigned int ui_book_autonotes_title_color; +extern unsigned int ui_book_autonotes_text_color; +extern unsigned int ui_book_map_title_color; +extern unsigned int ui_book_map_coordinates_color; \ No newline at end of file
--- a/Game.cpp Tue May 14 17:37:24 2013 +0600 +++ b/Game.cpp Tue May 14 17:38:14 2013 +0600 @@ -160,12 +160,12 @@ GameUI_DrawPartySpells(); if (v4 || pParty->pHirelings[0].evt_C || pParty->pHirelings[1].evt_C ) - DrawHiredNPCs(); + GameUI_DrawHiredNPCs(); GameUI_DrawPortraits(v4); GameUI_DrawLifeManaBars(); GameUI_DrawCharacterSelectionFrame(); if ( sub_44100D() ) - draw_right_panel(); + GameUI_DrawRightPanel(); if ( !pVideoPlayer->AnyMovieLoaded() ) { pStru6Instance->DrawPlayerBuffAnims();
--- a/Player.cpp Tue May 14 17:37:24 2013 +0600 +++ b/Player.cpp Tue May 14 17:38:14 2013 +0600 @@ -3273,9 +3273,9 @@ unsigned int result; // eax@2 if ( CanTrainToNextLevel() ) - result = TargetColor(0, 0xFFu, 0); + result = ui_character_bonus_text_color; else - result = 0; + result = ui_character_default_text_color; return result; }
--- a/UIBooks.cpp Tue May 14 17:37:24 2013 +0600 +++ b/UIBooks.cpp Tue May 14 17:38:14 2013 +0600 @@ -46,6 +46,164 @@ + + + +//----- (00413CC6) -------------------------------------------------------- +void BookUI_Draw(WindowType book) +{ + pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId)); + switch (book) + { + case WINDOW_QuestBook: BookUI_Questbook_Draw(); break; + case WINDOW_AutonotesBook: BookUI_Autonotes_Draw(); break; + case WINDOW_MapsBook: BookUI_Map_Draw(); break; + case WINDOW_CalendarBook: BookUI_Calendar_Draw(); break; + case WINDOW_LloydsBeacon: DrawLloydBeaconsScreen(); break; + case WINDOW_TownPortal: DrawTownPortalScreen(); break; + case WINDOW_HistoryBook: DrawBook_History(); break; + } +} + + + +//----- (00413D6F) -------------------------------------------------------- +void BookUI_Calendar_Draw() +{ + unsigned int v0; // esi@1 + char *v1; // eax@5 + int v2; // ecx@5 + char *v3; // eax@6 + GUIWindow a1; // [sp+Ch] [bp-60h]@5 + unsigned int v6; // [sp+60h] [bp-Ch]@1 + int v7; // [sp+64h] [bp-8h]@1 + int a5; // [sp+68h] [bp-4h]@1 + + v0 = pParty->uCurrentHour; + v6 = pMapStats->GetMapInfo(pCurrentMapName); + a5 = TargetColor(0x4Bu, 0x4Bu, 0x4Bu); + pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_13); + v7 = (unsigned __int8)pDayMoonPhase[pParty->uDaysPlayed]; + if ( (signed int)v0 <= 12 ) + { + if ( !v0 ) + v0 = 12; + } + else + { + v0 -= 12; + } + a1.uFrameX = game_viewport_x; + a1.uFrameY = game_viewport_y; + a1.uFrameWidth = game_viewport_width; + a1.uFrameHeight = game_viewport_height; + a1.uFrameZ = game_viewport_z; + a1.uFrameW = game_viewport_w; + a1.DrawTitleText(pBook2Font, 0, 0x16u, 0, pGlobalTXT_LocalizationStrings[186], 3u); + if ( pParty->uCurrentHour >= 12 ) + { + if ( pParty->uCurrentHour >= 24 ) + v2=0; + else + v2=1; + } + else + v2=0; + v1 = GetDayPart(); + sprintf( + pTmpBuf, + "%s\t100:\t110%d:%02d %s - %s", + pGlobalTXT_LocalizationStrings[526], + v0, + pParty->uCurrentMinute, + aAMPMNames[v2], + v1); + a1.DrawText(pBookFont, 70, 55, a5, pTmpBuf, 0, 0, 0); + sprintf( + pTmpBuf, + "%s\t100:\t110%d - %s", + pGlobalTXT_LocalizationStrings[56], + pParty->uDaysPlayed + 1, + aDayNames[pParty->uDaysPlayed % 7]); + a1.DrawText(pBookFont, 70, 2 * LOBYTE(pBookFont->uFontHeight) + 49, a5, pTmpBuf, 0, 0, 0); + sprintf( + pTmpBuf, + "%s\t100:\t110%d - %s", + pGlobalTXT_LocalizationStrings[146], + pParty->uCurrentMonth + 1, + aMonthNames[pParty->uCurrentMonth]); + a1.DrawText(pBookFont, 70, 4 * LOBYTE(pBookFont->uFontHeight) + 43, a5, pTmpBuf, 0, 0, 0); + sprintf(pTmpBuf, "%s\t100:\t110%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear); + a1.DrawText(pBookFont, 70, 6 * LOBYTE(pBookFont->uFontHeight) + 37, a5, pTmpBuf, 0, 0, 0); + sprintf(pTmpBuf, "%s\t100:\t110%s", pGlobalTXT_LocalizationStrings[530], aMoonPhaseNames[v7]); + a1.DrawText(pBookFont, 70, 8 * LOBYTE(pBookFont->uFontHeight) + 31, a5, pTmpBuf, 0, 0, 0); + if ( v6 ) + v3 = pMapStats->pInfos[v6].pName; + else + v3 = "Unknown"; + sprintf(pTmpBuf, "%s\t100:\t110%s", pGlobalTXT_LocalizationStrings[531], v3); + a1.DrawText(pBookFont, 70, 10 * LOBYTE(pBookFont->uFontHeight) + 25, a5, pTmpBuf, 0, 0, 0); +} + + + +//----- (0041192C) -------------------------------------------------------- +void 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 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); +} + + + //----- (00411300) -------------------------------------------------------- void LoadSpellbook(unsigned int spell_school) { @@ -85,7 +243,7 @@ } //----- (0041140B) -------------------------------------------------------- -GUIWindow *__cdecl sub_41140B() +GUIWindow *sub_41140B() { signed int v0; // esi@1 GUIButton *v1; // eax@3 @@ -120,7 +278,7 @@ } //----- (00411473) -------------------------------------------------------- -void __cdecl sub_411473() +void sub_411473() { pTexture_pagemask->Release(); pTexture_506448->Release(); @@ -137,7 +295,7 @@ //----- (00411597) -------------------------------------------------------- -void __cdecl OnCloseSpellBook() +void OnCloseSpellBook() { pAllocator->FreeChunk(pSpellFont); pSpellFont = 0; @@ -162,7 +320,7 @@ //----- (00412AF9) -------------------------------------------------------- void sub_412AF9() - { +{ int v0; // ecx@1 v0 = 0; @@ -174,7 +332,7 @@ } //----- (00412B58) -------------------------------------------------------- -void __cdecl DrawSpellBookContent() +void DrawSpellBookContent() { Player *v0; // ebx@1 int v1; // ebp@1 @@ -377,7 +535,7 @@ // 50654C: using guessed type int dword_50654C; //----- (00412E85) -------------------------------------------------------- -char __cdecl DrawBook_History() +void DrawBook_History() { unsigned int v0; // eax@3 unsigned int v1; // eax@7 @@ -433,7 +591,7 @@ a1.uFrameZ = game_viewport_z; a1.uFrameW = game_viewport_w; if ( v3 ) - a1.DrawTitleText(pBook2Font, 0, 0x16u, 0, v3, 3u); + a1.DrawTitleText(pBook2Font, 0, 22, 0, v3, 3); } a1.uFrameX = 48; a1.uFrameY = 70; @@ -477,15 +635,14 @@ if ( v7 ) { v9 = pAutonoteFont->_44C6C2(v8, &a1, 1u, (unsigned __int8)byte_5C6D50[dword_506528]); - LOBYTE(v8) = a1.DrawText(pAutonoteFont, 1, 0, 0, (const char *)v9, 0, a1.uFrameY + a1.uFrameHeight, 0); + a1.DrawText(pAutonoteFont, 1, 0, 0, (const char *)v9, 0, a1.uFrameY + a1.uFrameHeight, 0); ++num_achieved_awards; } - return (char)v8; } //----- (00413126) -------------------------------------------------------- -void __cdecl DrawBook_Quests() +void BookUI_Questbook_Draw() { unsigned int v0; // eax@3 unsigned int v1; // eax@7 @@ -534,7 +691,8 @@ a1.uFrameY = game_viewport_y; a1.uFrameZ = game_viewport_z; a1.uFrameW = game_viewport_w; - a1.DrawTitleText(pBook2Font, 0, 0x16u, 0, pGlobalTXT_LocalizationStrings[174], 3u); + a1.DrawTitleText(pBook2Font, 0, 22, ui_book_quests_title_color, pGlobalTXT_LocalizationStrings[174], 3); //"Current Quests" + a1.uFrameX = 48; a1.uFrameY = 70; a1.uFrameWidth = 360; @@ -568,7 +726,7 @@ v4 = achieved_awards[v3]; ++num_achieved_awards; v5 = pQuestTable[v4-1];//(&dword_722F10)[4 * v4]; - a1.DrawText(pAutonoteFont, 1, 0, 0, pQuestTable[v4-1], 0, 0, 0);//(&dword_722F10)[4 * v4], 0, 0, 0); + a1.DrawText(pAutonoteFont, 1, 0, ui_book_quests_text_color, pQuestTable[v4-1], 0, 0, 0);//(&dword_722F10)[4 * v4], 0, 0, 0); v6 = pAutonoteFont->CalcTextHeight(v5, &a1, 1, 0); v7 = a1.uFrameY + v6; if ( (signed int)(a1.uFrameY + v6) > (signed int)a1.uFrameHeight ) @@ -581,7 +739,7 @@ //----- (0041338E) -------------------------------------------------------- -void __cdecl DrawBook_Autonotes() +void BookUI_Autonotes_Draw() { unsigned int v0; // eax@3 unsigned int v1; // eax@7 @@ -795,10 +953,11 @@ a1.uFrameWidth = game_viewport_width; a1.uFrameHeight = game_viewport_height; a1.uFrameX = game_viewport_x; - a1.uFrameY = game_viewport_z; + a1.uFrameY = game_viewport_y; a1.uFrameZ = game_viewport_z; a1.uFrameW = game_viewport_w; - a1.DrawTitleText(pBook2Font, 0, 0x16u, 0, pGlobalTXT_LocalizationStrings[154], 3u); + a1.DrawTitleText(pBook2Font, 0, 22, ui_book_autonotes_title_color, pGlobalTXT_LocalizationStrings[154], 3); // "Auto notes" + a1.uFrameX = 48; a1.uFrameY = 70; a1.uFrameWidth = 360; @@ -875,7 +1034,7 @@ //v14 = (&dword_723718_autonote_related)[8 * v13]; v14 = pAutonoteTxt[v13-1].pText; //a1.DrawText(pAutonoteFont, 1, 0, 0, (&dword_723718_autonote_related)[8 * v13], 0, 0, 0); - a1.DrawText(pAutonoteFont, 1, 0, 0, pAutonoteTxt[v13-1].pText, 0, 0, 0); + a1.DrawText(pAutonoteFont, 1, 0, ui_book_autonotes_text_color, pAutonoteTxt[v13-1].pText, 0, 0, 0); v15 = pAutonoteFont->CalcTextHeight(v14, &a1, 1, 0); v16 = a1.uFrameY + v15; if ( (signed int)(a1.uFrameY + v15) > (signed int)a1.uFrameHeight ) @@ -888,9 +1047,8 @@ //----- (00413980) -------------------------------------------------------- -void DrawBook_Maps() - { - +void BookUI_Map_Draw() +{ int v6; // eax@31 unsigned int map_id; // eax@35 Texture *buttnTxtr; // [sp-4h] [bp-DCh]@3 @@ -1008,10 +1166,11 @@ map_window.uFrameW = game_viewport_w; map_id = pMapStats->GetMapInfo(pCurrentMapName); if ( map_id ) - map_window.DrawTitleText(pBook2Font, -14, 12, 0, pMapStats->pInfos[map_id].pName, 3); + map_window.DrawTitleText(pBook2Font, -14, 12, ui_book_map_title_color, pMapStats->pInfos[map_id].pName, 3); + map_window.uFrameX = 0; sprintf(party_coord, pGlobalTXT_LocalizationStrings[659], pParty->vPosition.x, pParty->vPosition.y); //"x: %d y: %d" - map_window.DrawTitleText(pFontComic, 0, 320, 0, party_coord, 0); + map_window.DrawTitleText(pFontComic, 0, 320, ui_book_map_coordinates_color, party_coord, 0); } //----- (00442955) -------------------------------------------------------- @@ -1518,19 +1677,3 @@ - -//----- (00413CC6) -------------------------------------------------------- -void DrawCurrentBook(unsigned int uBook) -{ - pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId)); - switch ((enum WindowType)uBook) - { - case WINDOW_LloydsBeacon: DrawLloydBeaconsScreen(); break; - case WINDOW_TownPortal: DrawTownPortalScreen(); break; - case WINDOW_QuestBook: DrawBook_Quests(); break; - case WINDOW_AutonotesBook: DrawBook_Autonotes(); break; - case WINDOW_MapsBook: DrawBook_Maps(); break; - case WINDOW_CalendarBook: DrawBook_Calendar(); break; - case WINDOW_HistoryBook: DrawBook_History(); break; - } -}
--- a/UICharacter.cpp Tue May 14 17:37:24 2013 +0600 +++ b/UICharacter.cpp Tue May 14 17:38:14 2013 +0600 @@ -45,33 +45,160 @@ -unsigned int ui_color_text_default; -unsigned int ui_color_text_highlight; -unsigned int ui_color_text_header; -unsigned int ui_color_text_bonus; -unsigned int ui_color_text_bonus_neg; -unsigned int ui_color_text_skill_upgradeable; -unsigned int ui_color_text_skill_not_upgradeable; -unsigned int ui_color_text_awards[6]; + +int bRingsShownInCharScreen; // 5118E0 + + + +unsigned int ui_character_default_text_color; +unsigned int ui_character_skill_highlight_color; +unsigned int ui_character_header_text_color; +unsigned int ui_character_bonus_text_color; +unsigned int ui_character_bonus_text_color_neg; +unsigned int ui_character_skill_upgradeable_color; +unsigned int ui_character_skill_default_color; +unsigned int ui_character_award_color[6]; + +unsigned int ui_game_minimap_outline_color; +unsigned int ui_game_minimap_actor_friendly_color; +unsigned int ui_game_minimap_actor_hostile_color; +unsigned int ui_game_minimap_actor_corpse_color; +unsigned int ui_game_minimap_decoration_color_1; +unsigned int ui_game_minimap_projectile_color; +unsigned int ui_game_minimap_treasure_color; + +unsigned int ui_book_quests_title_color; +unsigned int ui_book_quests_text_color; +unsigned int ui_book_autonotes_title_color; +unsigned int ui_book_autonotes_text_color; +unsigned int ui_book_map_title_color; +unsigned int ui_book_map_coordinates_color; void set_default_ui_skin() { - ui_color_text_default = TargetColor(255, 255, 255); - ui_color_text_highlight = TargetColor(255, 0, 0); - ui_color_text_header = TargetColor(255, 255, 155); - ui_color_text_bonus = TargetColor(0, 255, 0); - ui_color_text_bonus_neg = TargetColor(255, 0, 0); + ui_character_default_text_color = TargetColor(255, 255, 255); + ui_character_header_text_color = TargetColor(255, 255, 155); + ui_character_bonus_text_color = TargetColor(0, 255, 0); + ui_character_bonus_text_color_neg = TargetColor(255, 0, 0); + + ui_character_skill_upgradeable_color = TargetColor(0, 175, 255); + ui_character_skill_default_color = TargetColor(255, 0, 0); + ui_character_skill_highlight_color = TargetColor(255, 0, 0); + + ui_character_award_color[0] = TargetColor(248, 108, 160); + ui_character_award_color[1] = TargetColor(112, 220, 248); + ui_character_award_color[2] = TargetColor(192, 192, 240); + ui_character_award_color[3] = TargetColor( 64, 244, 96); + ui_character_award_color[4] = TargetColor(232, 244, 96); + ui_character_award_color[5] = TargetColor(240, 252, 192); + + ui_game_minimap_outline_color = TargetColor(0, 0, 255); + ui_game_minimap_actor_friendly_color = TargetColor(0, 255, 0); + ui_game_minimap_actor_hostile_color = TargetColor(255, 0, 0); + ui_game_minimap_actor_corpse_color = TargetColor(255, 255, 0); + ui_game_minimap_decoration_color_1 = TargetColor(255, 255, 255); + ui_game_minimap_projectile_color = TargetColor(255, 0, 0); + ui_game_minimap_treasure_color = TargetColor(0, 0, 255); + + ui_book_quests_title_color = TargetColor(255, 255, 255); + ui_book_quests_text_color = TargetColor(255, 255, 255); + ui_book_autonotes_title_color = TargetColor(255, 255, 255); + ui_book_autonotes_text_color = TargetColor(255, 255, 255); + ui_book_map_title_color = TargetColor(255, 255, 255); + ui_book_map_coordinates_color = TargetColor(255, 255, 255); +} + + + + +//----- (00421626) -------------------------------------------------------- +GUIWindow *CharacterUI_Initialize(unsigned int _this) +{ + GUIWindow *pWindow; // edi@3 + + ++pIcons_LOD->uTexturePacksCount; + if ( !pIcons_LOD->uNumPrevLoadedFiles ) + pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; + + pEventTimer->Pause(); + pAudioPlayer->StopChannels(-1, -1); + bRingsShownInCharScreen = false; + CharacterUI_LoadPaperdollTextures(); + pCurrentScreen = _this; - ui_color_text_skill_upgradeable = TargetColor(0, 175, 255); - ui_color_text_skill_not_upgradeable = TargetColor(255, 0, 0); + pWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_CharacterRecord, uActiveCharacter, 0); + pCharacterScreen_StatsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 12, pViewport->uViewportTL_Y + 308, + pIcons_LOD->GetTexture(papredoll_dbrds[9])->uTextureWidth, + pIcons_LOD->GetTexture(papredoll_dbrds[9])->uTextureHeight, + 1, 0, UIMSG_ClickStatsBtn, 0, 'S', pGlobalTXT_LocalizationStrings[216],// Stats + pIcons_LOD->GetTexture(papredoll_dbrds[10]), + pIcons_LOD->GetTexture(papredoll_dbrds[9]), 0); + pCharacterScreen_SkillsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 102, pViewport->uViewportTL_Y + 308, + pIcons_LOD->GetTexture(papredoll_dbrds[7])->uTextureWidth, + pIcons_LOD->GetTexture(papredoll_dbrds[7])->uTextureHeight, + 1, 0, UIMSG_ClickSkillsBtn, 0, 'K', pGlobalTXT_LocalizationStrings[205],//Skills + pIcons_LOD->GetTexture(papredoll_dbrds[8]), + pIcons_LOD->GetTexture(papredoll_dbrds[7]), 0); + pCharacterScreen_InventoryBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 192, pViewport->uViewportTL_Y + 308, + pIcons_LOD->GetTexture(papredoll_dbrds[5])->uTextureWidth, + pIcons_LOD->GetTexture(papredoll_dbrds[5])->uTextureHeight, + 1, 0, UIMSG_ClickInventoryBtn, 0, 'I', pGlobalTXT_LocalizationStrings[120], //Inventory + pIcons_LOD->GetTexture(papredoll_dbrds[6]), + pIcons_LOD->GetTexture(papredoll_dbrds[5]), 0); + pCharacterScreen_AwardsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 282, pViewport->uViewportTL_Y + 308, + pIcons_LOD->GetTexture(papredoll_dbrds[3])->uTextureWidth, + pIcons_LOD->GetTexture(papredoll_dbrds[3])->uTextureHeight, + 1, 0, UIMSG_ClickAwardsBtn, 0, 'A', pGlobalTXT_LocalizationStrings[22], //Awards + pIcons_LOD->GetTexture(papredoll_dbrds[4]), + pIcons_LOD->GetTexture(papredoll_dbrds[3]), 0); + pCharacterScreen_ExitBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 371, pViewport->uViewportTL_Y + 308, + pIcons_LOD->GetTexture(papredoll_dbrds[1])->uTextureWidth, + pIcons_LOD->GetTexture(papredoll_dbrds[1])->uTextureHeight, + 1, 0, UIMSG_ClickExitCharacterWindowBtn, 0, 0, pGlobalTXT_LocalizationStrings[79],//Exit + pIcons_LOD->GetTexture(papredoll_dbrds[2]), + pIcons_LOD->GetTexture(papredoll_dbrds[1]), 0); + pWindow->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, UIMSG_InventoryLeftClick, 0, 0, "", 0); + pCharacterScreen_DetalizBtn = pWindow->CreateButton(0x258u, 0x12Cu, 30, 30, 1, 0, UIMSG_ChangeDetaliz, 0, 0, pGlobalTXT_LocalizationStrings[64], 0); + pCharacterScreen_DollBtn = pWindow->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0); - ui_color_text_awards[0] = TargetColor(248, 108, 160); - ui_color_text_awards[1] = TargetColor(112, 220, 248); - ui_color_text_awards[2] = TargetColor(192, 192, 240); - ui_color_text_awards[3] = TargetColor( 64, 244, 96); - ui_color_text_awards[4] = TargetColor(232, 244, 96); - ui_color_text_awards[5] = TargetColor(240, 252, 192); + pWindow->CreateButton( 61, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); + pWindow->CreateButton(177, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); + pWindow->CreateButton(292, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); + pWindow->CreateButton(407, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); + + pWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, '\t', "", 0); + FillAwardsData(); + return pWindow; } +//----- (004219BE) -------------------------------------------------------- +GUIWindow *CastSpellInfo::sub_4219BE() +{ + GUIWindow *v2; // ebx@1 + + pEventTimer->Pause(); + pAudioPlayer->StopChannels(-1, -1); + bRingsShownInCharScreen = 0; + CharacterUI_LoadPaperdollTextures(); + pCurrentScreen = SCREEN_CASTING; + v2 = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell_InInventory, (int)this, 0); + pCharacterScreen_ExitBtn = v2->CreateButton(394, 318, 75, 33, 1, 0, UIMSG_ClickExitCharacterWindowBtn, 0, 0, + pGlobalTXT_LocalizationStrings[79], // Close + pIcons_LOD->GetTexture(papredoll_dbrds[2]), + pIcons_LOD->GetTexture(papredoll_dbrds[1]), 0); + v2->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, UIMSG_InventoryLeftClick, 0, 0, "", 0); + pCharacterScreen_DollBtn = v2->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0); + + v2->CreateButton( 61, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); + v2->CreateButton(177, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); + v2->CreateButton(292, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); + v2->CreateButton(407, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); + + return v2; +} + + + + static int CharacterUI_SkillsTab_Draw__DrawSkillTable(Player *player, int x, int y, int *skill_list, int skill_list_size, int right_margin, const char *skill_group_name) @@ -79,7 +206,7 @@ int y_offset = y; sprintf(pTmpBuf, "%s\r%03d%s", skill_group_name, right_margin, pGlobalTXT_LocalizationStrings[131]); //"Level" - pGUIWindow_CurrentMenu->DrawText(pFontArrus, x, y, ui_color_text_header, pTmpBuf, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, x, y, ui_character_header_text_color, pTmpBuf, 0, 0, 0); int num_skills_drawn = 0; for (uint i = 0; i < skill_list_size; ++i) @@ -107,14 +234,14 @@ uint skill_color = 0; uint skill_mastery_color = 0; if (player->uSkillPoints > skill_level) - skill_color = ui_color_text_skill_upgradeable; + skill_color = ui_character_skill_upgradeable_color; if (pGUIWindow_CurrentMenu->pCurrentPosActiveItem == j) { if (player->uSkillPoints > skill_level) - skill_mastery_color = ui_color_text_bonus; + skill_mastery_color = ui_character_bonus_text_color; else - skill_mastery_color = ui_color_text_skill_not_upgradeable; + skill_mastery_color = ui_character_skill_default_color; skill_color = skill_mastery_color; } @@ -135,7 +262,7 @@ } if (!skill_mastery_color) - skill_mastery_color = ui_color_text_header; + skill_mastery_color = ui_character_header_text_color; sprintfex(pTmpBuf, "%s \f%05d%s\f%05d\r%03d%2d", pSkillNames[skill], skill_mastery_color, v46, skill_color, right_margin, skill_level); @@ -162,10 +289,10 @@ sprintfex(pTmpBuf, "%s \f%05d^Pv[%s]\f00000\r177%s: \f%05d%d\f00000", pGlobalTXT_LocalizationStrings[206], // Skills for - ui_color_text_header, + ui_character_header_text_color, player->pName, pGlobalTXT_LocalizationStrings[207], // Skill Points - player->uSkillPoints ? ui_color_text_bonus : ui_color_text_default, + player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, player->uSkillPoints); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0); @@ -218,7 +345,7 @@ //int v22; // [sp+CCh] [bp-4h]@40 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("fr_award", TEXTURE_16BIT_PALETTE)); - sprintfex(pTmpBuf, "%s \f%05d", pGlobalTXT_LocalizationStrings[LOCSTR_AVARDS_FOR], ui_color_text_header); + sprintfex(pTmpBuf, "%s \f%05d", pGlobalTXT_LocalizationStrings[LOCSTR_AVARDS_FOR], ui_character_header_text_color); sprintfex(Source, pGlobalTXT_LocalizationStrings[LOCSTR_S_THE_S], player->pName, pClassNames[player->classType]); strcat(pTmpBuf, Source); strcat(pTmpBuf, "\f00000"); @@ -290,7 +417,7 @@ v6 = pTmpBuf; - a1.DrawText(pFontArrus, 0, 0, ui_color_text_awards[pAwards[v5].uPriority % 6], v6, 0, 0, 0); + a1.DrawText(pFontArrus, 0, 0, ui_character_award_color[pAwards[v5].uPriority % 6], v6, 0, 0, 0); a1.uFrameY = pFontArrus->CalcTextHeight(v6, &a1, 0, 0) + a1.uFrameY + 4; if (a1.uFrameY > a1.uFrameHeight) break; @@ -1866,6 +1993,8 @@ pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(a2, 1, 0, a5); } + + //----- (00418511) -------------------------------------------------------- char CharacterUI_StatsTab_Draw(Player *player) { @@ -1949,12 +2078,12 @@ //pPlayer = &pParty->pPlayers[uPlayerID-1]; //pPlayer = player; pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("fr_stats", TEXTURE_16BIT_PALETTE)); - sprintf(pTmpBuf, "\f%05d", ui_color_text_header); + sprintf(pTmpBuf, "\f%05d", ui_character_header_text_color); sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]);//"^Pi[%s] %s" / "%s the %s" strcat(pTmpBuf, pTmpBuf2); sprintfex(pTmpBuf2, "\f00000\r180%s: \f%05d%d\f00000\n\n\n", pGlobalTXT_LocalizationStrings[207], // "Skill points" - player->uSkillPoints ? ui_color_text_bonus : ui_color_text_default, + player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, player->uSkillPoints); strcat(pTmpBuf, pTmpBuf2); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, 18, 0, pTmpBuf, 0, 0, 0);
--- a/UIMainMenu.cpp Tue May 14 17:37:24 2013 +0600 +++ b/UIMainMenu.cpp Tue May 14 17:38:14 2013 +0600 @@ -78,6 +78,20 @@ memset(pVisibleWindowsIdxs, 0, sizeof(pVisibleWindowsIdxs)); } +//----- (004415C5) -------------------------------------------------------- +void LoadPartyBuffIcons() +{ + for (uint i = 0; i < 14; ++i) + { + char filename[200]; + sprintf(filename, "isn-%02d", i + 1); + pTextureIDs_PartyBuffIcons[i] = pIcons_LOD->LoadTexture(filename, TEXTURE_16BIT_PALETTE); + } + + uIconIdx_FlySpell = pIconsFrameTable->FindIcon("spell21"); + uIconIdx_WaterWalk = pIconsFrameTable->FindIcon("spell27"); +} + //----- (0041B690) -------------------------------------------------------- void __cdecl MainMenuUI_Create() {
--- a/UiGame.cpp Tue May 14 17:37:24 2013 +0600 +++ b/UiGame.cpp Tue May 14 17:38:14 2013 +0600 @@ -48,35 +48,37 @@ +int uTextureID_GameUI_CharSelectionFrame; // 50C98C + //----- (0041A57E) -------------------------------------------------------- void GameUI_QuickRef_Draw() { - unsigned int v0; // ebx@1 + //unsigned int v0; // ebx@1 //unsigned int v1; // eax@1 - Player *pPlayer; // ebp@2 - int v3; // eax@6 - int v4; // edi@6 + //Player *pPlayer; // ebp@2 + //int v3; // eax@6 + //int v4; // edi@6 unsigned int v5; // eax@7 unsigned int v6; // edi@9 unsigned int v7; // edi@11 - signed int v8; // eax@13 + //signed int v8; // eax@13 unsigned int v9; // eax@13 unsigned int v10; // edi@13 - int v11; // eax@15 + //int v11; // eax@15 unsigned int v12; // eax@15 unsigned int v13; // edi@15 - int v14; // eax@17 - int v15; // ST18_4@17 - int v16; // ebx@17 - int v17; // eax@17 + //int v14; // eax@17 + //int v15; // ST18_4@17 + //int v16; // ebx@17 + //int v17; // eax@17 unsigned int v18; // eax@17 unsigned int v19; // edi@17 - int v20; // eax@19 + //int v20; // eax@19 unsigned int v21; // edi@19 char *v22; // eax@21 unsigned int v23; // edi@21 - int v24; // eax@23 + //int v24; // eax@23 unsigned int v25; // edi@23 char *v26; // eax@25 unsigned int v27; // edi@25 @@ -88,101 +90,90 @@ const char *v33; // ST10_4@35 unsigned int v34; // eax@35 unsigned int v35; // edi@35 - unsigned __int8 v36; // al@37 + //unsigned __int8 v36; // al@37 char *v37; // eax@38 int v38; // eax@41 signed int v39; // edi@42 - char *v40; // eax@45 - unsigned int v41; // eax@45 + //char *v40; // eax@45 + //unsigned int v41; // eax@45 signed int v43; // [sp+10h] [bp-1Ch]@1 unsigned int v44; // [sp+14h] [bp-18h]@2 int v45; // [sp+18h] [bp-14h]@1 - unsigned int v46; // [sp+1Ch] [bp-10h]@1 - unsigned int v47; // [sp+20h] [bp-Ch]@1 + //unsigned int v46; // [sp+1Ch] [bp-10h]@1 + //unsigned int v47; // [sp+20h] [bp-Ch]@1 unsigned int v48; // [sp+24h] [bp-8h]@33 //unsigned int v49; // [sp+28h] [bp-4h]@1 - v0 = 0; - v47 = TargetColor(0xFFu, 0xFFu, 0x9Bu); + //v0 = 0; + //v47 = TargetColor(0xFFu, 0xFFu, 0x9Bu); //v49 = TargetColor(0xFFu, 0, 0); - v46 = TargetColor(0, 0xFFu, 0); + //v46 = TargetColor(0, 0xFFu, 0); //v1 = pIcons_LOD->LoadTexture("quikref", TEXTURE_16BIT_PALETTE); - pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("quikref", TEXTURE_16BIT_PALETTE)); + pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("quikref", TEXTURE_16BIT_PALETTE)); v43 = 0; v45 = LOBYTE(pFontArrus->uFontHeight) + 1; do - { - pPlayer = &pParty->pPlayers[v43]; + { + auto player = &pParty->pPlayers[v43]; v44 = 94 * v43 + 89; - if ( v43 == v0 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x12u, v0, pGlobalTXT_LocalizationStrings[149], 60, v0);//Name - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 94 * v43 + 89, 0x12u, v47, pPlayer->pName, 84, v0); - if ( v43 == v0 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x2Fu, v0, pGlobalTXT_LocalizationStrings[131], 60, v0); //. - v3 = pPlayer->GetActualLevel(); - sprintf(pTmpBuf, "%lu", v3); - v4 = pPlayer->GetBaseLevel(); - if ( pPlayer->GetActualLevel() <= v4 ) - v5 = pPlayer->GetExperienceDisplayColor(); + if ( v43 == 0 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x12u, 0, pGlobalTXT_LocalizationStrings[149], 60, 0);//Name + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 94 * v43 + 89, 0x12u, ui_character_header_text_color, player->pName, 84, 0); + if ( v43 == 0 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x2Fu, 0, pGlobalTXT_LocalizationStrings[131], 60, 0); //. + sprintf(pTmpBuf, "%lu", player->GetActualLevel()); + if ( player->GetActualLevel() <= player->GetBaseLevel()) + v5 = player->GetExperienceDisplayColor(); else - v5 = TargetColor(0, 0xFFu, v0); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, 0x2Fu, v5, pTmpBuf, 84, v0); + v5 = ui_character_bonus_text_color; + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, 0x2Fu, v5, pTmpBuf, 84, 0); v6 = v45 + 47; - if ( v43 == v0 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v45 + 47, v0, pGlobalTXT_LocalizationStrings[41], 60, v0);// - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v6, v0, pClassNames[pPlayer->classType], 84, v0); + if ( v43 == 0 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v45 + 47, 0, pGlobalTXT_LocalizationStrings[41], 60, 0);// + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v6, 0, pClassNames[player->classType], 84, 0); v7 = v45 + v6; - if ( v43 == v0 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v7, v0, pGlobalTXT_LocalizationStrings[107], 60, v0);//. - sprintf(pTmpBuf, "%d", pPlayer->sHealth); - v8 = pPlayer->GetMaxHealth(); - v9 = UI_GetHealthManaStringColor(pPlayer->sHealth, v8); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v7, v9, pTmpBuf, 84, v0); + if ( v43 == 0 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v7, 0, pGlobalTXT_LocalizationStrings[107], 60, 0);//. + sprintf(pTmpBuf, "%d", player->sHealth); + v9 = UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth()); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v7, v9, pTmpBuf, 84, 0); v10 = v45 + v7; - if ( v43 == v0 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v10, v0, pGlobalTXT_LocalizationStrings[209], 60, v0);// - sprintf(pTmpBuf, "%d", pPlayer->sMana); - v11 = pPlayer->GetMaxMana(); - v12 = UI_GetHealthManaStringColor(pPlayer->sMana, v11); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v10, v12, pTmpBuf, 84, v0); + if ( v43 == 0 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v10, 0, pGlobalTXT_LocalizationStrings[209], 60, 0);// + sprintf(pTmpBuf, "%d", player->sMana); + v12 = UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana()); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v10, v12, pTmpBuf, 84, 0); v13 = v45 + v10; - if ( v43 == v0 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v13, v0, pGlobalTXT_LocalizationStrings[0], 60, v0);// - v14 = pPlayer->GetActualAC(); - sprintf(pTmpBuf, "%d", v14); - v15 = v0; - v16 = pPlayer->GetBaseAC(); - v17 = pPlayer->GetActualAC(); - v18 = UI_GetHealthManaStringColor(v17, v16); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v13, v18, pTmpBuf, 84, v15); - v0 = 0; + if ( v43 == 0 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v13, 0, pGlobalTXT_LocalizationStrings[0], 60, 0);// + sprintf(pTmpBuf, "%d", player->GetActualAC()); + v18 = UI_GetHealthManaStringColor(player->GetActualAC(), player->GetBaseAC()); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v13, v18, pTmpBuf, 84, 0); v19 = v45 + v13; if ( !v43 ) pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v19, 0, pGlobalTXT_LocalizationStrings[18], 60, 0);// - v20 = pPlayer->GetActualAttack(0); - sprintf(pTmpBuf, "%+d", v20); + sprintf(pTmpBuf, "%+d", player->GetActualAttack(0)); pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v19, 0, pTmpBuf, 84, 0); v21 = v45 + v19; if ( !v43 ) pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v21, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//. - v22 = pPlayer->GetMeleeDamageString(); + v22 = player->GetMeleeDamageString(); pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v21, 0, v22, 84, 0); v23 = v45 + v21; if ( !v43 ) pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v23, 0, pGlobalTXT_LocalizationStrings[203], 60, 0);// - v24 = pPlayer->GetRangedAttack(); - sprintf(pTmpBuf, "%+d", v24); + sprintf(pTmpBuf, "%+d", player->GetRangedAttack()); pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v23, 0, pTmpBuf, 84, 0); v25 = v45 + v23; if ( !v43 ) pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v25, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//. - v26 = pPlayer->GetRangedDamageString(); + v26 = player->GetRangedDamageString(); pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v25, 0, v26, 84, 0); v27 = v45 + v25; if ( !v43 ) pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v27, 0, pGlobalTXT_LocalizationStrings[205], 60, 0);// v28 = 0; - v29 = (char *)pPlayer->pActiveSkills; + v29 = (char *)player->pActiveSkills; v30 = 36; do { @@ -197,10 +188,10 @@ v31 = v45 + v27; if ( !v43 ) pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v31, 0, pGlobalTXT_LocalizationStrings[168], 60, 0);// - sprintf(pTmpBuf, "%lu", pPlayer->uSkillPoints); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v31, pPlayer->uSkillPoints != 0 ? v46 : 0, pTmpBuf, 84, 0); + sprintf(pTmpBuf, "%lu", player->uSkillPoints); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v31, player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, pTmpBuf, 84, 0); v32 = v45 + v31; - v48 = pPlayer->GetMajorConditionIdx(); + v48 = player->GetMajorConditionIdx(); if ( !v43 ) pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v32, 0, pGlobalTXT_LocalizationStrings[45], 60, 0);//. v33 = aCharacterConditionNames[v48]; @@ -209,9 +200,8 @@ v35 = v45 + v32; if ( !v43 ) pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v35, 0, pGlobalTXT_LocalizationStrings[170], 60, 0);//.. - v36 = pPlayer->uQuickSpell; - if ( v36 ) - v37 = pSpellStats->pInfos[v36].pShortName; + if (player->uQuickSpell) + v37 = pSpellStats->pInfos[player->uQuickSpell].pShortName; else v37 = pGlobalTXT_LocalizationStrings[153];// pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v35, 0, v37, 84, 0); @@ -223,23 +213,24 @@ if ( v38 >= 0 ) { if ( v38 <= 5 ) - v39 = TargetColor(0xFF, 0xFF, 0xFF); + v39 = ui_character_default_text_color; else - v39 = TargetColor(0xFF, 0, 0); + v39 = ui_character_bonus_text_color_neg; } else - v39 = v46; + v39 = ui_character_bonus_text_color; - v40 = GetReputationString(v38); - sprintf(pTmpBuf, "%s: \f%05d%s\f00000", pGlobalTXT_LocalizationStrings[180], v39, v40);//Reputation + sprintf(pTmpBuf, "%s: \f%05d%s\f00000", pGlobalTXT_LocalizationStrings[180], v39, GetReputationString(v38));//Reputation pGUIWindow_CurrentMenu->DrawText(pFontArrus, 22, 323, 0, pTmpBuf, 0, 0, 0); - v41 = pParty->GetPartyFame(); - sprintf(pTmpBuf, "\r261%s: %d", pGlobalTXT_LocalizationStrings[84], v41);// Fame + + sprintf(pTmpBuf, "\r261%s: %d", pGlobalTXT_LocalizationStrings[84], pParty->GetPartyFame());// Fame pGUIWindow_CurrentMenu->DrawText(pFontArrus, 0, 323, 0, pTmpBuf, 0, 0, 0); - } +} + + //----- (0041AD6E) -------------------------------------------------------- -void __cdecl GameUI_DrawRightPanelItems() +void GameUI_DrawRightPanelItems() { if (GameUI_RightPanel_BookFlashTimer > pParty->uTimePlayed) GameUI_RightPanel_BookFlashTimer = 0; @@ -247,26 +238,25 @@ if (pParty->uTimePlayed - GameUI_RightPanel_BookFlashTimer > 128) { GameUI_RightPanel_BookFlashTimer = pParty->uTimePlayed; - byte_50697C = byte_50697C == 0; + + static bool byte_50697C = false; // 50697C + byte_50697C = !byte_50697C; if ( byte_50697C && pCurrentScreen != SCREEN_REST ) { - if ( bFlashQuestBook ) - pRenderer->DrawTextureTransparent(493, 355, pIcons_LOD->GetTexture(uTextureID_ib_td1_A)); - if ( bFlashAutonotesBook ) - pRenderer->DrawTextureTransparent(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A)); - if ( bFlashHistoryBook ) - pRenderer->DrawTextureTransparent(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A)); + if (bFlashQuestBook) pRenderer->DrawTextureTransparent(493, 355, pIcons_LOD->GetTexture(uTextureID_ib_td1_A)); + if (bFlashAutonotesBook) pRenderer->DrawTextureTransparent(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A)); + if (bFlashHistoryBook) pRenderer->DrawTextureTransparent(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A)); } else { - pRenderer->DrawTextureRGB(468u, 0, pTexture_RightFrame); - DrawHiredNPCs(); + pRenderer->DrawTextureRGB(468, 0, pTexture_RightFrame); + GameUI_DrawHiredNPCs(); } } } //----- (0041AEBB) -------------------------------------------------------- -void __cdecl GameUI_DrawFoodAndGold() +void GameUI_DrawFoodAndGold() { int v2; // esi@2 @@ -280,316 +270,122 @@ } } -//----- (0041AF52) -------------------------------------------------------- -void Actor::DrawHealthBar(Actor *a1, GUIWindow *a2) -{ - unsigned int v2; // eax@1 - GUIWindow *v3; // edi@1 - unsigned int v4; // esi@1 - signed int v5; // ebx@4 - double v6; // st7@5 - unsigned int v7; // eax@6 - unsigned int v8; // ebx@10 - unsigned int v9; // [sp+14h] [bp-Ch]@4 - unsigned int v10; // [sp+1Ch] [bp-4h]@4 - - v2 = a1->pMonsterInfo.uHP; - v3 = a2; - v4 = 25; - if ( (signed int)v2 > 25 ) - { - v4 = 200; - if ( (signed int)v2 < 200 ) - v4 = a1->pMonsterInfo.uHP; - } - v5 = a1->sCurrentHP; - v10 = v4; - v9 = uTextureID_mhp_grn; - if ( v5 < (signed int)v2 ) - { - v6 = (double)(signed int)v2; - v10 = (signed __int64)((double)(signed int)v4 / (double)(signed int)v2 * (double)a1->sCurrentHP); - if ( v5 <= (signed int)(signed __int64)(0.34 * v6) ) - { - v7 = uTextureID_mhp_red; - v9 = v7; - } - else if ( v5 <= (signed int)(signed __int64)(v6 * 0.67) ) - { - v7 = uTextureID_mhp_yel; - v9 = v7; - } - } - v8 = a2->uFrameX + (signed int)(a2->uFrameWidth - v4) / 2; - - pRenderer->SetTextureClipRect(v8, a2->uFrameY + 32, v8 + v4, a2->uFrameY + 52); - pRenderer->DrawTextureIndexed(v8, v3->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_bd)); - pRenderer->SetTextureClipRect(v8, v3->uFrameY + 32, v8 + v10, v3->uFrameY + 52); - pRenderer->DrawTextureIndexed(v8, v3->uFrameY + 34, pIcons_LOD->GetTexture(v9)); - - pRenderer->ResetTextureClipRect(); - pRenderer->DrawTextureIndexed(v8 - 5, v3->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capl)); - pRenderer->DrawTextureIndexed(v8 + v4, v3->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capr)); -} //----- (0041B0C9) -------------------------------------------------------- -void __cdecl GameUI_DrawLifeManaBars() +void GameUI_DrawLifeManaBars() { - Texture *v0; // ebx@1 - Player *v1; // ecx@2 - float v2; // ST38_4@3 double v3; // st7@3 - signed __int64 v4; // qax@6 - Player *v5; // ecx@24 - float v6; // ST30_4@25 double v7; // st7@25 - bool v8; // ST38_4@27 Texture *v9; // [sp-4h] [bp-30h]@10 Texture *v10; // [sp+Ch] [bp-20h]@1 - Player *v11; // [sp+10h] [bp-1Ch]@2 - int v12; // [sp+10h] [bp-1Ch]@24 - Texture *v13; // [sp+14h] [bp-18h]@1 - Texture *v14; // [sp+18h] [bp-14h]@1 - float v15; // [sp+1Ch] [bp-10h]@1 - signed int v16; // [sp+24h] [bp-8h]@1 - signed int v17; // [sp+28h] [bp-4h]@8 + + + v10 = pIcons_LOD->GetTexture(uTextureID_BarBlue); - v0 = pIcons_LOD->GetTexture(uTextureID_BarGreen); - v14 = pIcons_LOD->GetTexture(uTextureID_BarYellow); - v13 = pIcons_LOD->GetTexture(uTextureID_BarRed); - v16 = 0; - v10 = pIcons_LOD->GetTexture(uTextureID_BarBlue); - v15 = v0->uTextureHeight; - do + for (uint i = 0; i < 4; ++i) { - v1 = &pParty->pPlayers[v16]; - v11 = v1; - if ( v1->sHealth > 0 ) + auto player = pParty->pPlayers + i; + + if (player->sHealth > 0) { - v11 = &pParty->pPlayers[v16]; - v2 = (double)v1->sHealth; - v3 = v2 / (double)v1->GetMaxHealth(); - if( v3 > 0.5 ) - { - if ( v3 > 1.0 ) - v3 = 1.0; - v4 = (signed __int64)((1.0 - v3) * v15); - if ( v16 == 2 || v16 == 3 ) - v17 = 2; - else - v17 = 0; - pRenderer->SetTextureClipRect( - v17 + pHealthBarPos[v16], - v4 + 402, - v17 + pHealthBarPos[v16] + v0->uTextureWidth, - v0->uTextureHeight + 402); - v9 = v0; - } - else if ( v3 > 0.25 ) - { - if ( v16 == 2 || v16 == 3 ) - v17 = 2; - else - v17 = 0; - pRenderer->SetTextureClipRect( - v17 + pHealthBarPos[v16], - (unsigned __int64)(signed __int64)((1.0 - v3) * v15) + 402, - v17 + pHealthBarPos[v16] + v14->uTextureWidth, - v14->uTextureHeight + 402); - v9 = v14; - } - else if ( v3 > 0.0 ) - { - if ( v16 == 2 || v16 == 3 ) - v17 = 2; - else - v17 = 0; - pRenderer->SetTextureClipRect( - v17 + pHealthBarPos[v16], - (unsigned __int64)(signed __int64)((1.0 - v3) * v15) + 402, - v17 + pHealthBarPos[v16] + v13->uTextureWidth, - v13->uTextureHeight + 402); - v9 = v13; - } + int v17 = 0; + if (i == 2 || i == 3) + v17 = 2; + + v3 = (double)player->sHealth / (double)player->GetMaxHealth(); + if( v3 > 0.5 ) + { + if ( v3 > 1.0 ) + v3 = 1.0; + v9 = pIcons_LOD->GetTexture(uTextureID_BarGreen); + } + else if ( v3 > 0.25 ) + v9 = pIcons_LOD->GetTexture(uTextureID_BarYellow); + else if ( v3 > 0.0 ) + v9 = pIcons_LOD->GetTexture(uTextureID_BarRed); + + if( v3 > 0.0 ) { - pRenderer->DrawTextureIndexed(v17 + pHealthBarPos[v16], 0x192u, v9); + pRenderer->SetTextureClipRect(v17 + pHealthBarPos[i], + (signed __int64)((1.0 - v3) * v9->uTextureHeight) + 402, + v17 + pHealthBarPos[i] + v9->uTextureWidth, + v9->uTextureHeight + 402); + + pRenderer->DrawTextureIndexed(v17 + pHealthBarPos[i], 402, v9); pRenderer->ResetTextureClipRect(); } } - v5 = v11; - v12 = v11->sMana; - if ( v12 > 0 ) + + + if (player->sMana > 0) { - v6 = (double)v12; - v7 = v6 / (double)v5->GetMaxMana(); + v7 = player->sMana / (double)player->GetMaxMana(); if ( v7 > 1.0 ) v7 = 1.0; - v8 = v16 == 2; - pRenderer->SetTextureClipRect( - (v16 == 2) + pManaBarPos[v16], - (unsigned __int64)(signed __int64)((1.0 - v7) * v15) + 402, - v8 + pManaBarPos[v16] + v10->uTextureWidth, - v10->uTextureHeight + 402); - pRenderer->DrawTextureIndexed(v8 + pManaBarPos[v16], 0x192u, v10); + + int v17 = 0; + if (i == 2) + v17 = 1; + + pRenderer->SetTextureClipRect(v17 + pManaBarPos[i], + (signed __int64)((1.0 - v7) * v10->uTextureHeight) + 402, + v17 + pManaBarPos[i] + v10->uTextureWidth, + v10->uTextureHeight + 402); + pRenderer->DrawTextureIndexed(v17 + pManaBarPos[i], 402, v10); pRenderer->ResetTextureClipRect(); } - ++v16; } - while ( v16 < 4 ); } //----- (0041B3B6) -------------------------------------------------------- -void __cdecl draw_right_panel() +void GameUI_DrawRightPanel() { - pRenderer->DrawTextureTransparent(pViewport->uViewportBR_X, 0, pIcons_LOD->GetTexture(uTextureID_right_panel)); + pRenderer->DrawTextureTransparent(pViewport->uViewportBR_X, 0, + pIcons_LOD->GetTexture(uTextureID_right_panel)); } //----- (0041B3E2) -------------------------------------------------------- -void __cdecl GameUI_DrawRightPanelFrames() +void GameUI_DrawRightPanelFrames() { - pRenderer->DrawTextureRGB(0, 0, pTexture_TopFrame); - pRenderer->DrawTextureRGB(0, 8u, pTexture_LeftFrame); - pRenderer->DrawTextureRGB(468u, 0, pTexture_RightFrame); - pRenderer->DrawTextureRGB(0, 352u, pTexture_BottomFrame); + pRenderer->DrawTextureRGB(0, 0, pTexture_TopFrame); + pRenderer->DrawTextureRGB(0, 8, pTexture_LeftFrame); + pRenderer->DrawTextureRGB(468, 0, pTexture_RightFrame); + pRenderer->DrawTextureRGB(0, 352, pTexture_BottomFrame); GameUI_DrawFoodAndGold(); GameUI_DrawRightPanelItems(); } -//----- (0041B438) -------------------------------------------------------- -GUIButton *__fastcall GUI_HandleHotkey(unsigned __int8 uHotkey) + +//----- (0041C047) -------------------------------------------------------- +void GameUI_Footer_2() { - 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]; + char *v1; // edx@2 + int v5; // eax@5 -//----- (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 ) + pRenderer->DrawTextureRGB(0, 352, pTexture_StatusBar); + if (GameUI_Footer_TimeLeft) + v1 = GameUI_Footer_TimedString; + else { - 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; - } + if (!pFooterString[0]) + return; + v1 = pFooterString; } - 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; + + v5 = pFontLucida->AlignText_Center(450, v1); + pPrimaryWindow->DrawText(pFontLucida, v5 + 11, 357, uGameUIFontMain, v1, 0, 0, uGameUIFontShadow); } - - -//----- (0041C047) -------------------------------------------------------- -void __cdecl GameUI_Footer_2() - { - unsigned int v0; // eax@1 - char *v1; // edx@2 - unsigned int v2; // ST18_4@5 - const char *v3; // ST0C_4@5 - unsigned int v4; // ST08_4@5 - int v5; // eax@5 - - pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); - if ( GameUI_Footer_TimeLeft ) - { - v1 = GameUI_Footer_TimedString; - } - else - { - if ( !pFooterString[0] ) - return; - v1 = pFooterString; - } - LOWORD(v0) = uGameUIFontShadow; - v2 = v0; - LOWORD(v0) = uGameUIFontMain; - v3 = v1; - v4 = v0; - v5 = pFontLucida->AlignText_Center(0x1C2u, v1); - pPrimaryWindow->DrawText(pFontLucida, v5 + 11, 357, v4, v3, 0, 0, v2); - } - //----- (0041C0B8) -------------------------------------------------------- -void __thiscall sub_41C0B8_set_status_string(const char *pStr) - { +void GameUI_SetFooterString(const char *pStr) +{ const char *v1; // esi@1 int i; // eax@7 int j; // eax@11 v1 = pStr; - if ( pStr && strcmp(pStr, "test") && !IsBadStringPtrA(v1, 1u) && (*v1 || GameUI_Footer_TimeLeft) ) + if ( pStr && strcmp(pStr, "test") && !IsBadStringPtrA(v1, 1) && (*v1 || GameUI_Footer_TimeLeft) ) { if ( GameUI_Footer_TimeLeft ) { @@ -612,7 +408,7 @@ //----- (0041C179) -------------------------------------------------------- void GameUI_Footer() { - unsigned int v0; // ebp@1 + //unsigned int v0; // ebp@1 char *v1; // edi@5 int v2; // eax@5 unsigned int v3; // esi@5 @@ -622,10 +418,9 @@ size_t v7; // eax@10 GUIFont *v8; // ecx@10 char v9; // zf@12 - unsigned int v10; // ST08_4@13 + //unsigned int v10; // ST08_4@13 int v11; // eax@13 - v0 = uGameUIFontShadow; if ( pFooterString[0] || GameUI_Footer_TimeLeft || bForceDrawFooter ) { pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); @@ -659,9 +454,8 @@ bForceDrawFooter = 0; if ( !v9 ) { - v10 = uGameUIFontMain; v11 = pFontLucida->AlignText_Center(v3, v1); - pPrimaryWindow->DrawText(pFontLucida, v11 + 11, 357, v10, v1, 0, 0, v0); + pPrimaryWindow->DrawText(pFontLucida, v11 + 11, 357, uGameUIFontMain, v1, 0, 0, uGameUIFontShadow); } } } @@ -784,7 +578,7 @@ //LABEL_93: v26 = v22; //goto LABEL_87; - sub_41C0B8_set_status_string(v26); + GameUI_SetFooterString(v26); if ( pMouse->uPointingObjectID == 0 ) { if ( uLastPointedObjectID != 0 ) @@ -816,7 +610,7 @@ else v26 = pDecorationList->pDecorations[v24->uDecorationDescID].field_20; //goto LABEL_87; - sub_41C0B8_set_status_string(v26); + GameUI_SetFooterString(v26); if ( pMouse->uPointingObjectID == 0 ) { if ( uLastPointedObjectID != 0 ) @@ -846,7 +640,7 @@ //goto LABEL_93; v26 = v22; //goto LABEL_87; - sub_41C0B8_set_status_string(v26); + GameUI_SetFooterString(v26); if ( pMouse->uPointingObjectID == 0 ) { if ( uLastPointedObjectID != 0 ) @@ -887,7 +681,7 @@ //goto LABEL_93; v26 = v22; //goto LABEL_87; - sub_41C0B8_set_status_string(v26); + GameUI_SetFooterString(v26); if ( pMouse->uPointingObjectID == 0 ) { if ( uLastPointedObjectID != 0 ) @@ -924,7 +718,7 @@ //goto LABEL_93; v26 = v22; //goto LABEL_87; - sub_41C0B8_set_status_string(v26); + GameUI_SetFooterString(v26); if ( pMouse->uPointingObjectID == 0 ) { if ( uLastPointedObjectID != 0 ) @@ -992,7 +786,7 @@ } v26 = v28; //LABEL_87: - sub_41C0B8_set_status_string(v26); + GameUI_SetFooterString(v26); //goto _return; if ( pMouse->uPointingObjectID == 0 ) { @@ -1036,7 +830,7 @@ //LABEL_28: v13 = pButton->pButtonName; //_set_status_and_ret: - sub_41C0B8_set_status_string(v13); + GameUI_SetFooterString(v13); //LABEL_131: uLastPointedObjectID = 1; return; @@ -1058,7 +852,7 @@ pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); } v13 = pButton->pButtonName; - sub_41C0B8_set_status_string(v13); + GameUI_SetFooterString(v13); uLastPointedObjectID = 1; return; //} @@ -1091,7 +885,7 @@ sprintf(Str1, v39, v41); v13 = Str1; //goto _set_status_and_ret; - sub_41C0B8_set_status_string(v13); + GameUI_SetFooterString(v13); uLastPointedObjectID = 1; return; } @@ -1146,7 +940,7 @@ pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 4); //LABEL_49: v17 = pItemGen->GetDisplayName(); - sub_41C0B8_set_status_string(v17); + GameUI_SetFooterString(v17); //LABEL_50: uLastPointedObjectID = 1; //_return: @@ -1181,7 +975,7 @@ pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v14-1]; //goto LABEL_49; v17 = pItemGen->GetDisplayName(); - sub_41C0B8_set_status_string(v17); + GameUI_SetFooterString(v17); uLastPointedObjectID = 1; if ( pMouse->uPointingObjectID == 0 ) { @@ -1214,7 +1008,7 @@ //goto LABEL_28; { v13 = pButton->pButtonName; - sub_41C0B8_set_status_string(v13); + GameUI_SetFooterString(v13); uLastPointedObjectID = 1; return; } @@ -1247,7 +1041,7 @@ //goto LABEL_28; v13 = pButton->pButtonName; - sub_41C0B8_set_status_string(v13); + GameUI_SetFooterString(v13); uLastPointedObjectID = 1; return; //} @@ -1280,7 +1074,7 @@ sprintf(Str1, v39, v41); v13 = Str1; //goto _set_status_and_ret; - sub_41C0B8_set_status_string(v13); + GameUI_SetFooterString(v13); uLastPointedObjectID = 1; return; } @@ -1305,30 +1099,18 @@ //----- (0044158F) -------------------------------------------------------- -void __cdecl GameUI_DrawCharacterSelectionFrame() +void GameUI_DrawCharacterSelectionFrame() { if ( uActiveCharacter ) - pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9, - 380, &pIcons_LOD->pTextures[dword_50C98C]); + pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9, 380, + pIcons_LOD->GetTexture(uTextureID_GameUI_CharSelectionFrame)); } -//----- (004415C5) -------------------------------------------------------- -void LoadPartyBuffIcons() - { - for (uint i = 0; i < 14; ++i) - { - char filename[200]; - sprintf(filename, "isn-%02d", i + 1); - pTextureIDs_PartyBuffIcons[i] = pIcons_LOD->LoadTexture(filename, TEXTURE_16BIT_PALETTE); - } - uIconIdx_FlySpell = pIconsFrameTable->FindIcon("spell21"); - uIconIdx_WaterWalk = pIconsFrameTable->FindIcon("spell27"); - } //----- (0044162D) -------------------------------------------------------- -void __cdecl GameUI_DrawPartySpells() - { +void GameUI_DrawPartySpells() +{ unsigned int v0; // ebp@1 //signed int v1; // edi@1 //int v2; // eax@2 @@ -1350,7 +1132,6 @@ { auto tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]); //v3 = pTextureIDs_PartyBuffIcons[i]; - if (tex) pRenderer->_4A65CC(pPartySpellbuffsUI_XYs[i][0], pPartySpellbuffsUI_XYs[i][1], tex, tex, v0 + 20 * pPartySpellbuffsUI_smthns[i], 0, 63); @@ -1364,20 +1145,20 @@ if (pParty->FlyActive()) { if ( pParty->bFlying ) - v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID]; + v7 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID); else - v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID]; + v7 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID); if ( pRenderer->pRenderD3D ) - pRenderer->DrawTextureIndexed(8u, 8u, v7); + pRenderer->DrawTextureIndexed(8, 8, v7); else - pRenderer->DrawTextureTransparent(8u, 8u, v7); + pRenderer->DrawTextureTransparent(8, 8, v7); } if (pParty->WaterWalkActive()) { if ( pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER) - v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID]; + v9 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID); else - v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID]; + v9 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID); if ( pRenderer->pRenderD3D ) pRenderer->DrawTextureIndexed(396u, 8u, v9); else @@ -1401,65 +1182,6 @@ } -//----- (00421626) -------------------------------------------------------- -GUIWindow *GameUI_InitializeCharacterWindow(unsigned int _this) -{ - unsigned int v1; // edi@1 - GUIWindow *pWindow; // edi@3 - - ++pIcons_LOD->uTexturePacksCount; - v1 = _this; - if ( !pIcons_LOD->uNumPrevLoadedFiles ) - pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; - pEventTimer->Pause(); - pAudioPlayer->StopChannels(-1, -1); - bRingsShownInCharScreen = 0; - CharacterUI_LoadPaperdollTextures(); - pCurrentScreen = v1; - - pWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_CharacterRecord, uActiveCharacter, 0); - pCharacterScreen_StatsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 12, pViewport->uViewportTL_Y + 308, - pIcons_LOD->GetTexture(papredoll_dbrds[9])->uTextureWidth, - pIcons_LOD->GetTexture(papredoll_dbrds[9])->uTextureHeight, - 1, 0, UIMSG_ClickStatsBtn, 0, 'S', pGlobalTXT_LocalizationStrings[216],// Stats - pIcons_LOD->GetTexture(papredoll_dbrds[10]), - pIcons_LOD->GetTexture(papredoll_dbrds[9]), 0); - pCharacterScreen_SkillsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 102, pViewport->uViewportTL_Y + 308, - pIcons_LOD->GetTexture(papredoll_dbrds[7])->uTextureWidth, - pIcons_LOD->GetTexture(papredoll_dbrds[7])->uTextureHeight, - 1, 0, UIMSG_ClickSkillsBtn, 0, 'K', pGlobalTXT_LocalizationStrings[205],//Skills - pIcons_LOD->GetTexture(papredoll_dbrds[8]), - pIcons_LOD->GetTexture(papredoll_dbrds[7]), 0); - pCharacterScreen_InventoryBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 192, pViewport->uViewportTL_Y + 308, - pIcons_LOD->GetTexture(papredoll_dbrds[5])->uTextureWidth, - pIcons_LOD->GetTexture(papredoll_dbrds[5])->uTextureHeight, - 1, 0, UIMSG_ClickInventoryBtn, 0, 'I', pGlobalTXT_LocalizationStrings[120], //Inventory - pIcons_LOD->GetTexture(papredoll_dbrds[6]), - pIcons_LOD->GetTexture(papredoll_dbrds[5]), 0); - pCharacterScreen_AwardsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 282, pViewport->uViewportTL_Y + 308, - pIcons_LOD->GetTexture(papredoll_dbrds[3])->uTextureWidth, - pIcons_LOD->GetTexture(papredoll_dbrds[3])->uTextureHeight, - 1, 0, UIMSG_ClickAwardsBtn, 0, 'A', pGlobalTXT_LocalizationStrings[22], //Awards - pIcons_LOD->GetTexture(papredoll_dbrds[4]), - pIcons_LOD->GetTexture(papredoll_dbrds[3]), 0); - pCharacterScreen_ExitBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 371, pViewport->uViewportTL_Y + 308, - pIcons_LOD->GetTexture(papredoll_dbrds[1])->uTextureWidth, - pIcons_LOD->GetTexture(papredoll_dbrds[1])->uTextureHeight, - 1, 0, UIMSG_ClickExitCharacterWindowBtn, 0, 0, pGlobalTXT_LocalizationStrings[79],//Exit - pIcons_LOD->GetTexture(papredoll_dbrds[2]), - pIcons_LOD->GetTexture(papredoll_dbrds[1]), 0); - pWindow->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, UIMSG_InventoryLeftClick, 0, 0, "", 0); - pCharacterScreen_DetalizBtn = pWindow->CreateButton(0x258u, 0x12Cu, 0x1Eu, 0x1Eu, 1, 0, UIMSG_ChangeDetaliz, 0, 0, pGlobalTXT_LocalizationStrings[64], 0); - pCharacterScreen_DollBtn = pWindow->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0); - pWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); - pWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); - pWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); - pWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); - pWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, '\t', "", 0); - FillAwardsData(); - return pWindow; -} - //----- (004921C1) -------------------------------------------------------- void GameUI_DrawPortraits(unsigned int _this) @@ -1665,16 +1387,16 @@ //signed int v57; // [sp-4h] [bp-58h]@54 //unsigned __int16 v58; // [sp-4h] [bp-58h]@77 unsigned __int16 v59; // [sp-4h] [bp-58h]@100 - unsigned __int16 v60; // [sp+10h] [bp-44h]@66 - unsigned int v61; // [sp+10h] [bp-44h]@85 - unsigned int v63; // [sp+14h] [bp-40h]@85 - unsigned int v65; // [sp+18h] [bp-3Ch]@85 + //unsigned __int16 v60; // [sp+10h] [bp-44h]@66 + //unsigned int v61; // [sp+10h] [bp-44h]@85 + //unsigned int v63; // [sp+14h] [bp-40h]@85 + //unsigned int v65; // [sp+18h] [bp-3Ch]@85 unsigned int lPitch; // [sp+20h] [bp-34h]@1 unsigned int lPitcha; // [sp+20h] [bp-34h]@23 char *lPitchb; // [sp+20h] [bp-34h]@106 unsigned int v69; // [sp+24h] [bp-30h]@23 signed int v70; // [sp+24h] [bp-30h]@37 - unsigned __int16 uBlue; // [sp+28h] [bp-2Ch]@1 + //unsigned __int16 uBlue; // [sp+28h] [bp-2Ch]@1 signed int uBluea; // [sp+28h] [bp-2Ch]@37 int v73; // [sp+2Ch] [bp-28h]@30 int v76; // [sp+34h] [bp-20h]@91 @@ -1691,15 +1413,15 @@ float uWb; // [sp+60h] [bp+Ch]@30 unsigned int uWd; // [sp+60h] [bp+Ch]@95 float uZooma; // [sp+64h] [bp+10h]@117 - unsigned int flagsb; // [sp+68h] [bp+14h]@66 + //unsigned int flagsb; // [sp+68h] [bp+14h]@66 Actor *flagsc; // [sp+68h] [bp+14h]@86 - unsigned int flagsd; // [sp+68h] [bp+14h]@105 + //unsigned int flagsd; // [sp+68h] [bp+14h]@105 uCenterX = (uX + uZ) / 2; uCenterY = (uY + uW) / 2; lPitch = pRenderer->uTargetSurfacePitch; - TargetColor(0, 0, 0); - uBlue = TargetColor(0, 0, 0xFFu); + //TargetColor(0, 0, 0); + //uBlue = TargetColor(0, 0, 0xFFu); auto bWizardEyeActive = pParty->WizardEyeActive(); auto uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel(); if (CheckHiredNPCSpeciality(Cartographer)) @@ -1868,7 +1590,7 @@ - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16), - uBlue); + ui_game_minimap_outline_color); } } @@ -1880,8 +1602,8 @@ uint arrow_idx = floorf(0.5f + 7 * angle); pRenderer->DrawTextureTransparent(uCenterX - 3, uCenterY - 3, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[arrow_idx])); - flagsb = TargetColor(0, 0, 255); - v60 = TargetColor(255, 0, 0); + //flagsb = TargetColor(0, 0, 255); + //v60 = TargetColor(255, 0, 0); if (bWizardEyeActive) { //uZe = 0; @@ -1908,24 +1630,23 @@ assert(uZoom >= 512); if (pObjectList->pObjects[object->uObjectDescID].uFlags & OBJECT_DESC_UNPICKABLE) { - pRenderer->RasterLine2D(v37, v38, - v37, v38, v60); + pRenderer->RasterLine2D(v37, v38, v37, v38, ui_game_minimap_projectile_color); } else if (uZoom > 512) { - pRenderer->RasterLine2D(v37 - 1, v38 - 1, v37 - 1, v38 + 1, flagsb); - pRenderer->RasterLine2D(v37, v38 - 2, v37, v38 + 1, flagsb); - pRenderer->RasterLine2D(v37 + 1, v38 - 1, v37 + 1, v38 + 1, flagsb); - pRenderer->RasterLine2D(v37 - 2, v38, v37 - 2, v38 + 1, flagsb); + pRenderer->RasterLine2D(v37 - 1, v38 - 1, v37 - 1, v38 + 1, ui_game_minimap_treasure_color); + pRenderer->RasterLine2D(v37, v38 - 2, v37, v38 + 1, ui_game_minimap_treasure_color); + pRenderer->RasterLine2D(v37 + 1, v38 - 1, v37 + 1, v38 + 1, ui_game_minimap_treasure_color); + pRenderer->RasterLine2D(v37 - 2, v38, v37 - 2, v38 + 1, ui_game_minimap_treasure_color); pRenderer->RasterLine2D(v37 + 2, v38, - v37 + 2, v38 + 1, flagsb); + v37 + 2, v38 + 1, ui_game_minimap_treasure_color); } else { pRenderer->RasterLine2D(v37 - 1, v38 - 1, - v37 - 1, v38, flagsb); + v37 - 1, v38, ui_game_minimap_treasure_color); pRenderer->RasterLine2D(v37, v38 - 1, - v37, v38, flagsb); + v37, v38, ui_game_minimap_treasure_color); } //LABEL_82: //LABEL_83: @@ -1940,9 +1661,9 @@ LABEL_85: - v63 = TargetColor(255, 0, 0); - v61 = TargetColor(0, 255, 0); - v65 = TargetColor(255, 255, 0); + //v63 = TargetColor(255, 0, 0); + //v61 = TargetColor(0, 255, 0); + //v65 = TargetColor(255, 255, 0); uZf = 0; if ( (signed int)uNumActors > 0 ) { @@ -1962,11 +1683,11 @@ { if ( v40 <= pRenderer->raster_clip_z && v41 >= pRenderer->raster_clip_y && v41 <= pRenderer->raster_clip_w ) { - uWd = v61; + uWd = ui_game_minimap_actor_friendly_color; if ( BYTE3(flagsc->uAttributes) & 1 ) - uWd = v63; - if ( flagsc->uAIState == 5 ) - uWd = v65; + uWd = ui_game_minimap_actor_hostile_color; + if ( flagsc->uAIState == Dead) + uWd = ui_game_minimap_actor_corpse_color; if ( (signed int)uZoom > 1024 ) { pRenderer->RasterLine2D(v40 - 1, v41 - 2, v40 - 1, v41 + 2, uWd); @@ -2002,7 +1723,7 @@ } - flagsd = TargetColor(255, 255, 255); + //flagsd = TargetColor(255, 255, 255); uZg = 0; if ( (signed int)uNumLevelDecorations > 0 ) { @@ -2024,14 +1745,14 @@ { v48 = v47 + 1; v49 = v47 - 1; - pRenderer->RasterLine2D(v46 - 1, v47 - 1, v46 - 1, v47 + 1, flagsd); - pRenderer->RasterLine2D(v46, v49, v46, v48, flagsd); - pRenderer->RasterLine2D(v46 + 1, v49, v46 + 1, v48, flagsd); + pRenderer->RasterLine2D(v46 - 1, v47 - 1, v46 - 1, v47 + 1, ui_game_minimap_decoration_color_1); + pRenderer->RasterLine2D(v46, v49, v46, v48, ui_game_minimap_decoration_color_1); + pRenderer->RasterLine2D(v46 + 1, v49, v46 + 1, v48, ui_game_minimap_decoration_color_1); v45 = lPitchb; } else { - pRenderer->RasterLine2D(v46, uCenterY - v77, v46, uCenterY - v77, flagsd); + pRenderer->RasterLine2D(v46, uCenterY - v77, v46, uCenterY - v77, ui_game_minimap_decoration_color_1); } } } @@ -2081,7 +1802,7 @@ //----- (00491F87) -------------------------------------------------------- -void __cdecl DrawHiredNPCs() +void GameUI_DrawHiredNPCs() { //int v6; // eax@15 char v7; // al@17
--- a/mm7_1.cpp Tue May 14 17:37:24 2013 +0600 +++ b/mm7_1.cpp Tue May 14 17:38:14 2013 +0600 @@ -510,7 +510,7 @@ _w = (ItemGen *)(&pChests[(unsigned int)pChestWindow->ptr_1C] -32 + 18 * *((short *)&pChests[(unsigned int)pChestWindow->ptr_1C].igChestItems[139].uExpireTime + v1 + 3)); v2 = _w->GetDisplayName(); - sub_41C0B8_set_status_string(v2); + GameUI_SetFooterString(v2); } } } @@ -671,32 +671,7 @@ } } -//----- (004219BE) -------------------------------------------------------- -GUIWindow *CastSpellInfo::sub_4219BE() -{ - int v1; // esi@1 - GUIWindow *v2; // ebx@1 - auto a4 = this; - v1 = (int)a4; - pEventTimer->Pause(); - pAudioPlayer->StopChannels(-1, -1); - bRingsShownInCharScreen = 0; - CharacterUI_LoadPaperdollTextures(); - pCurrentScreen = SCREEN_CASTING; - v2 = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell_InInventory, v1, 0); - pCharacterScreen_ExitBtn = v2->CreateButton(394, 318, 75, 33, 1, 0, UIMSG_ClickExitCharacterWindowBtn, 0, 0, - pGlobalTXT_LocalizationStrings[79], // Close - pIcons_LOD->GetTexture(papredoll_dbrds[2]), - pIcons_LOD->GetTexture(papredoll_dbrds[1]), 0); - v2->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, UIMSG_InventoryLeftClick, 0, 0, "", 0); - pCharacterScreen_DollBtn = v2->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0); - v2->CreateButton( 61, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); - v2->CreateButton(177, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); - v2->CreateButton(292, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); - v2->CreateButton(407, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); - return v2; -} //----- (00421B2C) -------------------------------------------------------- bool __cdecl sub_421B2C_PlaceInInventory_or_DropPickedItem() @@ -838,7 +813,7 @@ } v5 = 7; //LABEL_22: - pGUIWindow_CurrentMenu = GameUI_InitializeCharacterWindow(v5); + pGUIWindow_CurrentMenu = CharacterUI_Initialize(v5); return; } if ( pCurrentScreen == SCREEN_SPELL_BOOK ) @@ -908,7 +883,7 @@ pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; v5 = 14; //goto LABEL_22; - pGUIWindow_CurrentMenu = GameUI_InitializeCharacterWindow(v5); + pGUIWindow_CurrentMenu = CharacterUI_Initialize(v5); return; } } @@ -1342,7 +1317,7 @@ pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-C", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-C", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-C", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-C", 2); + pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-C", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-c", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2); @@ -1389,7 +1364,7 @@ uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-C", TEXTURE_16BIT_PALETTE); uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-C", TEXTURE_16BIT_PALETTE); uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-C", TEXTURE_16BIT_PALETTE); - dword_50C98C = pIcons_LOD->LoadTexture("IB-selec-C", TEXTURE_16BIT_PALETTE); + uTextureID_GameUI_CharSelectionFrame = pIcons_LOD->LoadTexture("IB-selec-C", TEXTURE_16BIT_PALETTE); uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-c", TEXTURE_16BIT_PALETTE); uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-c", TEXTURE_16BIT_PALETTE); uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE); @@ -1430,7 +1405,7 @@ pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-a", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-a", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-a", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-a", 2); + pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-a", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-a", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2); @@ -1472,7 +1447,7 @@ dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-a", TEXTURE_16BIT_PALETTE); uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-A", TEXTURE_16BIT_PALETTE); uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-A", TEXTURE_16BIT_PALETTE); - dword_50C98C = pIcons_LOD->LoadTexture("IB-selec-A", TEXTURE_16BIT_PALETTE); + uTextureID_GameUI_CharSelectionFrame = pIcons_LOD->LoadTexture("IB-selec-A", TEXTURE_16BIT_PALETTE); uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-a", TEXTURE_16BIT_PALETTE); uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-a", TEXTURE_16BIT_PALETTE); uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-a", TEXTURE_16BIT_PALETTE); @@ -1526,7 +1501,7 @@ pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-B", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-B", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-B", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-B", 2); + pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-B", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-b", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2);
--- a/mm7_2.cpp Tue May 14 17:37:24 2013 +0600 +++ b/mm7_2.cpp Tue May 14 17:38:14 2013 +0600 @@ -11251,7 +11251,7 @@ else v24 = pDecorationList->pDecorations[v26->uDecorationDescID].field_20; LABEL_51: - sub_41C0B8_set_status_string(v24); + GameUI_SetFooterString(v24); return v19; }
--- a/mm7_3.cpp Tue May 14 17:37:24 2013 +0600 +++ b/mm7_3.cpp Tue May 14 17:38:14 2013 +0600 @@ -11484,7 +11484,7 @@ } //----- (0044100D) -------------------------------------------------------- -bool __cdecl sub_44100D() +bool sub_44100D() { return pCurrentScreen == SCREEN_NPC_DIALOGUE || pCurrentScreen == SCREEN_CHARACTERS || pCurrentScreen > SCREEN_LOADGAME && pCurrentScreen <= SCREEN_E ||
--- a/mm7_5.cpp Tue May 14 17:37:24 2013 +0600 +++ b/mm7_5.cpp Tue May 14 17:38:14 2013 +0600 @@ -82,7 +82,7 @@ unsigned int v33; // eax@277 unsigned __int8 v34; // al@279 unsigned __int8 v35; // al@280 - //GUIWindow *pWindow3; // ecx@332 + GUIWindow *pWindow3; // ecx@332 int v37; // eax@341 int v38; // eax@358 SHORT v39; // ax@365 @@ -97,7 +97,7 @@ char v48; // zf@405 BLVFace *pBLVFace; // ecx@410 ODMFace *pODMFace; // ecx@412 - CastSpellInfo *pSpellInfo; // ecx@415 + CastSpellInfo *v51; // ecx@415 void *v52; // eax@424 __int16 v53; // ax@431 int v54; // eax@432 @@ -155,6 +155,12 @@ Player *pPlayer5; // ST78_4@758 unsigned int v107; // eax@758 unsigned int v108; // eax@758 + char *v109; // ST64_4@759 + Player *v110; // ST78_4@759 + int v111; // ST60_4@759 + int v112; // ST5C_4@759 + char *v113; // ST58_4@759 + signed int v114; // eax@759 unsigned int v115; // eax@764 int v116; // eax@776 POINT *pPoint3; // eax@777 @@ -1486,6 +1492,7 @@ pIcons_LOD->_4355F7(); continue; } +LABEL_319: CharacterUI_ReleaseButtons(); sub_419379(); pIcons_LOD->_4114F2(); @@ -1518,6 +1525,7 @@ pIcons_LOD->_4355F7(); continue; } + pWindow3 = pGUIWindow_Settings; if ( !pGUIWindow_Settings )//Draw Menu { dword_6BE138 = -1; @@ -1563,7 +1571,7 @@ stru_506E40._40E55E("gamma.pcx", 0); continue; } - pGUIWindow_Settings->Release(); + pWindow3->Release(); pGUIWindow_Settings = 0; pMouse->SetCursorBitmap("MICON1"); GameUI_Footer_TimeLeft = 0; @@ -1595,7 +1603,7 @@ pParty->field_709 = 0; } } - DrawHiredNPCs(); + GameUI_DrawHiredNPCs(); continue; case UIMSG_TransitionUI_Confirm: if ( pMessageQueue_50CBD0->uNumMessages ) @@ -1803,12 +1811,13 @@ v47 = pActors[v46].uAIState == Dead; if ( !v47 ) continue; - pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; - LOBYTE(pSpellInfo->field_8) &= 0xBFu; - pSpellInfo->uPlayerID_2 = uMessageParam; - pSpellInfo->spell_target_pid = v44; - pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); - pGUIWindow_Settings->Release(); + v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; + LOBYTE(v51->field_8) &= 0xBFu; + v51->uPlayerID_2 = uMessageParam; + v51->spell_target_pid = v44; + pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); + pWindow3 = pGUIWindow_Settings; + pWindow3->Release(); pGUIWindow_Settings = 0; pMouse->SetCursorBitmap("MICON1"); GameUI_Footer_TimeLeft = 0; @@ -1821,12 +1830,13 @@ v47 = (pObjectList->pObjects[pSpriteObjects[v46].uObjectDescID].uFlags & 0x10) == 0; if ( !v47 ) continue; - pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; - LOBYTE(pSpellInfo->field_8) &= 0xBFu; - pSpellInfo->uPlayerID_2 = uMessageParam; - pSpellInfo->spell_target_pid = v44; - pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); - pGUIWindow_Settings->Release(); + v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; + LOBYTE(v51->field_8) &= 0xBFu; + v51->uPlayerID_2 = uMessageParam; + v51->spell_target_pid = v44; + pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); + pWindow3 = pGUIWindow_Settings; + pWindow3->Release(); pGUIWindow_Settings = 0; pMouse->SetCursorBitmap("MICON1"); GameUI_Footer_TimeLeft = 0; @@ -1848,12 +1858,13 @@ if ( !(pODMFace->uAttributes & 0x02000000) || !pODMFace->sCogTriggeredID ) continue; v44 = uNumSeconds; - pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; - LOBYTE(pSpellInfo->field_8) &= 0xBFu; - pSpellInfo->uPlayerID_2 = uMessageParam; - pSpellInfo->spell_target_pid = v44; - pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); - pGUIWindow_Settings->Release(); + v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; + *((char *)v51 + 8) &= 0xBFu; + v51->uPlayerID_2 = uMessageParam; + v51->spell_target_pid = v44; + pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); + pWindow3 = pGUIWindow_Settings; + pWindow3->Release(); pGUIWindow_Settings = 0; pMouse->SetCursorBitmap("MICON1"); GameUI_Footer_TimeLeft = 0; @@ -1868,21 +1879,23 @@ } if ( v48 ) continue; - pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; - LOBYTE(pSpellInfo->field_8) &= 0xBFu; - pSpellInfo->uPlayerID_2 = uMessageParam; - pSpellInfo->spell_target_pid = v44; - pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); - pGUIWindow_Settings->Release(); + v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; + LOBYTE(v51->field_8) &= 0xBFu; + v51->uPlayerID_2 = uMessageParam; + v51->spell_target_pid = v44; + pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); + pWindow3 = pGUIWindow_Settings; + pWindow3->Release(); pGUIWindow_Settings = 0; pMouse->SetCursorBitmap("MICON1"); GameUI_Footer_TimeLeft = 0; unk_50C9A0 = 0; back_to_game(); continue; - case UIMSG_CastSpell_Character_Big_Improvement://Preservation and blessing, treatment paralysis, hand hammers(individual upgrade),regeneration - case UIMSG_CastSpell_Character_Small_Improvement://Fate, cure - case UIMSG_HiredNPC_CastSpell: + case UIMSG_CastSpell_8F: + __debugbreak(); + case UIMSG_CastSpell_SPIRIT_Preservation://and blessing, treatment paralysis, hand hammers(individual upgrade) + case UIMSG_CastSpell_SPIRIT_Fate: if ( pMessageQueue_50CBD0->uNumMessages ) pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; if ( unk_50C9A0 ) @@ -1894,21 +1907,21 @@ { if ( pGUIWindow_Settings ) { - pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; + v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; switch ( uMessage ) { - case UIMSG_CastSpell_Character_Big_Improvement: - LOBYTE(pSpellInfo->field_8) &= 0xFDu; + case UIMSG_CastSpell_SPIRIT_Preservation: + LOBYTE(v51->field_8) &= 0xFDu; break; - case UIMSG_CastSpell_Character_Small_Improvement: - HIBYTE(pSpellInfo->field_8) &= 0xFEu; + case UIMSG_CastSpell_SPIRIT_Fate: + HIBYTE(v51->field_8) &= 0xFEu; break; - case UIMSG_HiredNPC_CastSpell: - HIBYTE(pSpellInfo->field_8) &= 0xFDu; + case UIMSG_CastSpell_8F: + HIBYTE(v51->field_8) &= 0xFDu; break; } - pSpellInfo->uPlayerID_2 = uMessageParam; - pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); + v51->uPlayerID_2 = uMessageParam; + pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); pGUIWindow_Settings->Release(); pGUIWindow_Settings = 0; pEventTimer->Resume(); @@ -1980,7 +1993,7 @@ continue; v173 = pMapStats->pInfos[sub_410D99_get_map_index(HIWORD(pPlayer->pInstalledBeacons[uMessageParam].field_18))].pName; sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[474], v173);// "Recall to %s" - sub_41C0B8_set_status_string(pTmpBuf); + GameUI_SetFooterString(pTmpBuf); continue; } v59 = pMapStats->GetMapInfo(pCurrentMapName); @@ -1990,13 +2003,13 @@ if ( !*((int *)&pSavegameThumbnails->pPixels + 10 * uMessageParam) || !v59 ) { sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[476], thise);// "Set to %s" - sub_41C0B8_set_status_string(pTmpBuf); + GameUI_SetFooterString(pTmpBuf); continue; } v174 = pMapStats->pInfos[sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName; v158 = (unsigned int)thise; sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[475], v158, v174);// "Set %s over %s" - sub_41C0B8_set_status_string(pTmpBuf); + GameUI_SetFooterString(pTmpBuf); continue; case UIMSG_CloseAfterInstallBeacon: dword_50CDC8 = 1; @@ -2211,7 +2224,7 @@ if ( uMessageParam != 5 ) { sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[35], v200); - sub_41C0B8_set_status_string(pTmpBuf); + GameUI_SetFooterString(pTmpBuf); continue; } v69 = pMapStats->pInfos[8].pName; @@ -2223,7 +2236,7 @@ v69 = pMapStats->pInfos[21].pName; } sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[35], v69); - sub_41C0B8_set_status_string(pTmpBuf); + GameUI_SetFooterString(pTmpBuf); continue; } v68 = 210; @@ -2261,7 +2274,7 @@ //goto LABEL_519; { sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[35], v200); - sub_41C0B8_set_status_string(pTmpBuf); + GameUI_SetFooterString(pTmpBuf); continue; } v69 = pMapStats->pInfos[8].pName; @@ -2273,7 +2286,7 @@ v69 = pMapStats->pInfos[21].pName; } sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[35], v69); - sub_41C0B8_set_status_string(pTmpBuf); + GameUI_SetFooterString(pTmpBuf); continue; case UIMSG_ShowFinalWindow: sprintf(pFinalMessage, "%s\n \n%s\n \n%s", pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer." @@ -2392,8 +2405,9 @@ } _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter); continue; - case UIMSG_CastSpell_Monster_Improvement://Fate, cure - case UIMSG_CastSpell_Shoot_Monster://FireBlow, Lightning, Ice Lightning, Swarm, + case UIMSG_CastSpell_GreatShot://??? + __debugbreak(); + case UIMSG_CastSpell_SmallShot://FireBlow, Lightning, Ice Lightning, Swarm, if ( pRenderer->pRenderD3D ) { v81 = pGame->pVisInstance->get_picked_object_zbuf_val(); @@ -2412,22 +2426,23 @@ v1 = ""; continue; } - pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; - if ( uMessage == UIMSG_CastSpell_Shoot_Monster ) - { - LOBYTE(pSpellInfo->field_8) &= 0xF7; + v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; + if ( uMessage == UIMSG_CastSpell_SmallShot ) + { + LOBYTE(v51->field_8) &= 0xF7; } else { - if ( uMessage == UIMSG_CastSpell_Monster_Improvement ) - HIBYTE(pSpellInfo->field_8) &= 0xFEu; + if ( uMessage == UIMSG_CastSpell_GreatShot ) + HIBYTE(v51->field_8) &= 0xFEu; else - HIBYTE(pSpellInfo->field_8) &= 0xFDu; - } - pSpellInfo->uPlayerID_2 = uMessageParam; - pSpellInfo->spell_target_pid = v44; - pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); - pGUIWindow_Settings->Release(); + HIBYTE(v51->field_8) &= 0xFDu; + } + v51->uPlayerID_2 = uMessageParam; + v51->spell_target_pid = v44; + pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); + pWindow3 = pGUIWindow_Settings; + pWindow3->Release(); pGUIWindow_Settings = 0; pMouse->SetCursorBitmap("MICON1"); GameUI_Footer_TimeLeft = 0; @@ -2679,7 +2694,7 @@ v177 = pGlobalTXT_LocalizationStrings[484];// "Select a spell then click here to set a QuickSpell" strcpy(pTmpBuf, v177); } - sub_41C0B8_set_status_string(pTmpBuf); + GameUI_SetFooterString(pTmpBuf); continue; case UIMSG_SPellbook_ShowHightlightedSpellInfo: if ( !uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter], @@ -2699,7 +2714,7 @@ v161 = pGlobalTXT_LocalizationStrings[486]; } sprintfex(pTmpBuf, v161, v178); - sub_41C0B8_set_status_string(pTmpBuf); + GameUI_SetFooterString(pTmpBuf); continue; case UIMSG_ClickInstallRemoveQuickSpellBtn: GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_PressedButton2, (int)pBtn_InstallRemoveSpell, 0); @@ -2796,14 +2811,13 @@ pCurrentScreen = SCREEN_GAME; pIcons_LOD->_4114F2(); v103 = quick_spell_at_page + 11 * player->lastOpenedSpellbookPage; - /*if ( dword_50C9E8 < 40 ) + if ( dword_50C9E8 < 40 ) { dword_50C9EC[3 * dword_50C9E8] = UIMSG_CastSpellFromBook; dword_50C9EC[3 * dword_50C9E8 + 1] = v103; dword_50C9EC[3 * dword_50C9E8 + 2] = uActiveCharacter - 1; ++dword_50C9E8; - }*/ - pMessageQueue_50CBD0->AddMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1); + } } else { @@ -3002,7 +3016,7 @@ GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_AwardsBtn, 0); FillAwardsData(); continue; - case UIMSG_ClickBooksBtn: + case UIMSG_AutonotesBook:// ( ) switch ( uMessageParam ) { case 11://Page UP @@ -3013,12 +3027,12 @@ BtnDown_flag = 1; pButton = pBtn_Book_1; break; - case 0://Zoom plus + case 0: pButton = pBtn_Book_1; BtnDown_flag = 1; break; - case 1://Zoom minus - pButton = pBtn_Book_2; + case 1: + pButton = pBtn_Book_2;// MapsBook BtnUp_flag = 1; break; case 2://Potions @@ -3067,7 +3081,7 @@ v174 = (char *)pParty->uNumGoldInBank; v158 = pParty->uNumGold + pParty->uNumGoldInBank; sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[489], v158, v174);// "You have %d total gold, %d in the Bank" - sub_41C0B8_set_status_string(pTmpBuf); + GameUI_SetFooterString(pTmpBuf); continue; case UIMSG_ShowStatus_DateTime: pNPCData4 = (NPCData *)pParty->uCurrentHour; @@ -3084,11 +3098,11 @@ uNumSeconds = 0; sprintf(pTmpBuf, "%d:%02d%s %s %d %s %d", pNPCData4, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7], 7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, aMonthNames[pParty->uCurrentMonth], pParty->uCurrentYear); - sub_41C0B8_set_status_string(pTmpBuf); + GameUI_SetFooterString(pTmpBuf); continue; case UIMSG_ShowStatus_Food: sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[501], pParty->uNumFoodRations); // "You have %lu food" - sub_41C0B8_set_status_string(pTmpBuf); + GameUI_SetFooterString(pTmpBuf); continue; case UIMSG_ShowStatus_Player: pPlayer5 = pPlayers[uMessageParam]; @@ -3096,16 +3110,20 @@ strcat(pTmpBuf, ": "); v107 = pPlayer5->GetMajorConditionIdx(); strcat(pTmpBuf, aCharacterConditionNames[v107]); - sub_41C0B8_set_status_string(pTmpBuf); + GameUI_SetFooterString(pTmpBuf); v108 = 8 * uMessageParam - 8; LOBYTE(v108) = v108 | 4; pMouse->uPointingObjectID = PID(OBJECT_Player,v108); continue; case UIMSG_ShowStatus_ManaHP: - sprintf(pTmpBuf, "%d / %d %s %d / %d %s", pPlayers[uMessageParam]->sHealth, pPlayers[uMessageParam]->GetMaxHealth(), - pGlobalTXT_LocalizationStrings[108], pPlayers[uMessageParam]->sMana, pPlayers[uMessageParam]->GetMaxMana(), - pGlobalTXT_LocalizationStrings[212]); - sub_41C0B8_set_status_string(pTmpBuf); + v109 = pGlobalTXT_LocalizationStrings[212];// "Spell Points" + v110 = pPlayers[uMessageParam]; + v111 = v110->GetMaxMana(); + v112 = v110->sMana; + v113 = pGlobalTXT_LocalizationStrings[108];// "Hit Points" + v114 = v110->GetMaxHealth(); + sprintf(pTmpBuf, "%d / %d %s %d / %d %s", v110->sHealth, v114, v113, v112, v111, v109); + GameUI_SetFooterString(pTmpBuf); continue; case UIMSG_CHEST_ClickItem: if ( pCurrentScreen == SCREEN_CHEST_INVENTORY ) @@ -3128,6 +3146,7 @@ } v115 = pMessageQueue_50CBD0->uNumMessages; if ( !pMessageQueue_50CBD0->uNumMessages ) + //goto LABEL_768; { pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); /*if ( (signed int)v115 < 40 ) @@ -3201,7 +3220,7 @@ if ( pCurrentScreen ) continue; pParty->uFlags |= 2u; - GUIWindow::Create(519, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomOut, 0); + GUIWindow::Create(0x207u, 0x88u, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomOut, 0); uNumSeconds = 131072; v118 = 2 * viewparams->uMinimapZoom; ++viewparams->field_28; @@ -3231,7 +3250,7 @@ if ( pCurrentScreen ) continue; pParty->uFlags |= 2u; - GUIWindow::Create(574, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomIn, 0); + GUIWindow::Create(0x23Eu, 0x88u, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomIn, 0); uNumSeconds = 32768; v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16; --viewparams->field_28; @@ -9971,86 +9990,8 @@ return pGlobalTXT_LocalizationStrings[567]; } -//----- (00413D6F) -------------------------------------------------------- -char __cdecl DrawBook_Calendar() -{ - unsigned int v0; // esi@1 - char *v1; // eax@5 - int v2; // ecx@5 - char *v3; // eax@6 - GUIWindow a1; // [sp+Ch] [bp-60h]@5 - unsigned int v6; // [sp+60h] [bp-Ch]@1 - int v7; // [sp+64h] [bp-8h]@1 - int a5; // [sp+68h] [bp-4h]@1 - - v0 = pParty->uCurrentHour; - v6 = pMapStats->GetMapInfo(pCurrentMapName); - a5 = TargetColor(0x4Bu, 0x4Bu, 0x4Bu); - pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_13); - v7 = (unsigned __int8)pDayMoonPhase[pParty->uDaysPlayed]; - if ( (signed int)v0 <= 12 ) - { - if ( !v0 ) - v0 = 12; - } - else - { - v0 -= 12; - } - a1.uFrameX = game_viewport_x; - a1.uFrameY = game_viewport_y; - a1.uFrameWidth = game_viewport_width; - a1.uFrameHeight = game_viewport_height; - a1.uFrameZ = game_viewport_z; - a1.uFrameW = game_viewport_w; - a1.DrawTitleText(pBook2Font, 0, 0x16u, 0, pGlobalTXT_LocalizationStrings[186], 3u); - if ( pParty->uCurrentHour >= 12 ) - { - if ( pParty->uCurrentHour >= 24 ) - v2=0; - else - v2=1; - } - else - v2=0; - v1 = GetDayPart(); - sprintf( - pTmpBuf, - "%s\t100:\t110%d:%02d %s - %s", - pGlobalTXT_LocalizationStrings[526], - v0, - pParty->uCurrentMinute, - aAMPMNames[v2], - v1); - a1.DrawText(pBookFont, 70, 55, a5, pTmpBuf, 0, 0, 0); - sprintf( - pTmpBuf, - "%s\t100:\t110%d - %s", - pGlobalTXT_LocalizationStrings[56], - pParty->uDaysPlayed + 1, - aDayNames[pParty->uDaysPlayed % 7]); - a1.DrawText(pBookFont, 70, 2 * LOBYTE(pBookFont->uFontHeight) + 49, a5, pTmpBuf, 0, 0, 0); - sprintf( - pTmpBuf, - "%s\t100:\t110%d - %s", - pGlobalTXT_LocalizationStrings[146], - pParty->uCurrentMonth + 1, - aMonthNames[pParty->uCurrentMonth]); - a1.DrawText(pBookFont, 70, 4 * LOBYTE(pBookFont->uFontHeight) + 43, a5, pTmpBuf, 0, 0, 0); - sprintf(pTmpBuf, "%s\t100:\t110%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear); - a1.DrawText(pBookFont, 70, 6 * LOBYTE(pBookFont->uFontHeight) + 37, a5, pTmpBuf, 0, 0, 0); - sprintf(pTmpBuf, "%s\t100:\t110%s", pGlobalTXT_LocalizationStrings[530], aMoonPhaseNames[v7]); - a1.DrawText(pBookFont, 70, 8 * LOBYTE(pBookFont->uFontHeight) + 31, a5, pTmpBuf, 0, 0, 0); - if ( v6 ) - v3 = pMapStats->pInfos[v6].pName; - else - v3 = "Unknown"; - sprintf(pTmpBuf, "%s\t100:\t110%s", pGlobalTXT_LocalizationStrings[531], v3); - return a1.DrawText(pBookFont, 70, 10 * LOBYTE(pBookFont->uFontHeight) + 25, a5, pTmpBuf, 0, 0, 0); -} - //----- (00413FF1) -------------------------------------------------------- -void __cdecl SetMonthNames() +void SetMonthNames() { aMonthNames[0] = pGlobalTXT_LocalizationStrings[415]; aMonthNames[1] = pGlobalTXT_LocalizationStrings[416]; @@ -10067,7 +10008,7 @@ } //----- (0041406F) -------------------------------------------------------- -void __cdecl SetDayNames() +void SetDayNames() { aDayNames[0] = pGlobalTXT_LocalizationStrings[145]; aDayNames[1] = pGlobalTXT_LocalizationStrings[230]; @@ -10079,7 +10020,7 @@ } //----- (004140BB) -------------------------------------------------------- -void __cdecl SetSpellSchoolNames() +void SetSpellSchoolNames() { aSpellSchoolNames[0] = pGlobalTXT_LocalizationStrings[87]; aSpellSchoolNames[1] = pGlobalTXT_LocalizationStrings[6]; @@ -10093,7 +10034,7 @@ } //----- (0041411B) -------------------------------------------------------- -void __cdecl SetAttributeNames() +void SetAttributeNames() { aAttributeNames[0] = pGlobalTXT_LocalizationStrings[144]; aAttributeNames[1] = pGlobalTXT_LocalizationStrings[116]; @@ -10105,13 +10046,13 @@ } //----- (00414162) -------------------------------------------------------- -void __cdecl uGameUIFontMain_initialize() +void uGameUIFontMain_initialize() { uGameUIFontMain = TargetColor(0xAu, 0, 0); } //----- (00414174) -------------------------------------------------------- -void __cdecl uGameUIFontShadow_initialize() +void uGameUIFontShadow_initialize() { uGameUIFontShadow = TargetColor(0xE6u, 214u, 193u); } @@ -10257,7 +10198,7 @@ } case WINDOW_Book: { - DrawCurrentBook((unsigned int)pWindow->ptr_1C); + BookUI_Draw((WindowType)(int)pWindow->ptr_1C); continue; } case WINDOW_Dialogue:
--- a/mm7_data.cpp Tue May 14 17:37:24 2013 +0600 +++ b/mm7_data.cpp Tue May 14 17:38:14 2013 +0600 @@ -1505,7 +1505,6 @@ //unsigned __int8 bMonsterInfoUI_bDollInitialized; char *aSpellNames[44]; int pMainScreenNum; // weak -char byte_50697C; // weak int dword_506980; // weak int dword_506984; // weak int dword_506988; // weak @@ -1595,7 +1594,6 @@ unsigned int uIconID_TurnStop; unsigned int uIconID_TurnHour; int uIconID_CharacterFrame; // idb -int dword_50C98C; // weak unsigned int uIconID_TurnStart; int dword_50C994; // weak int dword_50C998_turnbased_icon_1A; // weak @@ -1630,13 +1628,7 @@ int papredoll_flying_feet[777]; // idb int paperdoll_boots_texture[4][6];//0x511638 int paperdoll_cloak_collar_texture[4][10]; // weak -//int dword_51179C; // weak -//int dword_5117A0; // weak -//int dword_5117A4; // weak -//int dword_5117A8; // weak -//int dword_5117AC; // weak int paperdoll_cloak_texture[4][10]; -int bRingsShownInCharScreen; // weak int _unused000; // weak unsigned __int16 pOdmMinimap[117][137];
--- a/mm7_data.h Tue May 14 17:37:24 2013 +0600 +++ b/mm7_data.h Tue May 14 17:38:14 2013 +0600 @@ -933,7 +933,6 @@ //extern unsigned __int8 bMonsterInfoUI_bDollInitialized; extern char *aSpellNames[44]; extern int pMainScreenNum; // weak -extern char byte_50697C; // weak extern int dword_506980; // weak extern int dword_506984; // weak extern int dword_506988; // weak @@ -1023,7 +1022,6 @@ extern unsigned int uIconID_TurnStop; extern unsigned int uIconID_TurnHour; extern int uIconID_CharacterFrame; // idb -extern int dword_50C98C; // weak extern unsigned int uIconID_TurnStart; extern int dword_50C994; // weak extern int dword_50C998_turnbased_icon_1A; // weak @@ -1547,26 +1545,12 @@ void __fastcall ZBuffer_DoFill(int *pZBuffer, Texture *pTex, int uZValue); void __fastcall sub_40F92A(int *pZBuffer, struct Texture *a2, int a3); // idb void __cdecl SetMoonPhaseNames(); -void DrawSpellDescriptionPopup(int spell_index); signed int __fastcall sub_410D99_get_map_index(int a1); -unsigned int __cdecl DrawLloydBeaconsScreen(); -void DrawTownPortalScreen(); -void LoadSpellbook(unsigned int uID); // idb struct GUIWindow *__cdecl sub_41140B(); void __cdecl sub_411473(); -void __cdecl OnCloseSpellBook(); -void __cdecl InitializeBookTextures(); -void __cdecl InitializeBookFonts(); void __fastcall LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer); void sub_412AF9(); -void DrawSpellBookContent(); -char DrawBook_History(); -void DrawBook_Quests(); -void DrawBook_Autonotes(); -void DrawBook_Maps(); -void DrawCurrentBook(unsigned int uBook); // idb char *GetDayPart(); -char DrawBook_Calendar(); void SetAttributeNames(); void uGameUIFontMain_initialize(); void uGameUIFontShadow_initialize(); @@ -1594,21 +1578,12 @@ void sub_419220(); void sub_419379(); unsigned int __fastcall GetSizeInInventorySlots(unsigned int uNumPixels); -void __cdecl draw_leather(); -void __cdecl GameUI_DrawRightPanelItems(); -void __cdecl GameUI_DrawFoodAndGold(); -void __cdecl GameUI_DrawLifeManaBars(); -void __cdecl draw_right_panel(); -void __cdecl GameUI_DrawRightPanelFrames(); struct GUIButton *__fastcall GUI_HandleHotkey(unsigned __int8 uHotkey); // idb int __fastcall GUI_ReplaceHotkey(unsigned __int8 uOldHotkey, unsigned __int8 uNewHotkey, char bFirstCall); void __cdecl MainMenuUI_LoadFontsAndSomeStuff(); void __cdecl MainMenuUI_Create(); -void __cdecl GameUI_Footer_2(); -void __thiscall sub_41C0B8_set_status_string(const char *pStr); // idb -void __cdecl GameUI_Footer(); +char __fastcall sub_41D20D_buff_remaining_time_string(int ecx0, struct GUIWindow *edx0, __int64 a3, struct GUIFont *a2); bool UI_OnKeyDown(unsigned int vkKey); -char __fastcall sub_41D20D_buff_remaining_time_string(int ecx0, struct GUIWindow *edx0, __int64 a3, struct GUIFont *a2); void GameUI_DrawItemInfo(struct ItemGen* inspect_item); // idb void MonsterPopup_Draw(unsigned int uActorID, struct GUIWindow *edx0); void __cdecl nullsub_3(); // idb @@ -1621,7 +1596,6 @@ void __fastcall party_finds_gold(unsigned int uNumGold, int _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal); // idb void OnChestLeftClick(); void __cdecl GameUI_WritePointedObjectStatusString(); -struct GUIWindow *__thiscall GameUI_InitializeCharacterWindow(unsigned int _this); struct GUIWindow *__thiscall sub_4219BE(void *a4); bool __cdecl sub_421B2C_PlaceInInventory_or_DropPickedItem(); void __fastcall GameUI_OnPlayerPortraitLeftClick(unsigned int uPlayerID); // idb @@ -1702,12 +1676,8 @@ void __fastcall sub_4406BC(unsigned int node_id, unsigned int uFirstNode); // idb void __fastcall sub_440BED(struct IndoorLocation_drawstru *_this); bool sub_44100D(); -void GameUI_DrawTorchlightAndWizardEye(); -void GameUI_DrawCharacterSelectionFrame(); void LoadPartyBuffIcons(); -void GameUI_DrawPartySpells(); __int16 __fastcall sub_441A4E(int a1); -void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap); void DrawBook_Map_sub(unsigned int tl_x, unsigned int tl_y, unsigned int br_x, int br_y, int _48074); // idb void Initialize2DA(); @@ -1948,8 +1918,6 @@ void LoadPlayerPortraintsAndVoices(); int __fastcall ReloadPlayerPortraits(int, int); // weak void sub_491E3A(); -void DrawHiredNPCs(); -void __thiscall GameUI_DrawPortraits(unsigned int _this); signed int __thiscall CycleCharacter(unsigned int _this); void __fastcall Rest(unsigned int uHoursToSleep); int _493938_regenerate();