# HG changeset patch # User Ritor1 # Date 1379676697 -21600 # Node ID 6faacde46271a91a3161d992210c66a118517d8d # Parent a699ecd7aeb349514c00a8236ad9f6cb6718c1d4 DrawPopupWindow diff -r a699ecd7aeb3 -r 6faacde46271 UI/UIMainMenu.cpp --- a/UI/UIMainMenu.cpp Fri Sep 20 14:31:42 2013 +0600 +++ b/UI/UIMainMenu.cpp Fri Sep 20 17:31:37 2013 +0600 @@ -301,4 +301,51 @@ mm6title_texture.Release(); cred_texture.Release(); return MENU_MAIN; // return MENU_Main -} \ No newline at end of file +} +/*MENU_STATE MainMenuUI_Credits_Loop()//NewTitle +{ + MSG Msg; + GUIWindow credit_window; + RGBTexture mm6title_texture; + + if ( pMessageQueue_50CBD0->uNumMessages ) + pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; + ++pIcons_LOD->uTexturePacksCount; + if ( !pIcons_LOD->uNumPrevLoadedFiles ) + pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; + + //pAudioPlayer->PlayMusicTrack(MUSIC_Credits); + + mm6title_texture.Load("newtitle.pcx", 0); + pWindow_MainMenu->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_Escape, 0, 27, "", 0); + pCurrentScreen = SCREEN_CREATORS; + SetCurrentMenuID(MENU_CREDITSPROC); + + do + { + while ( PeekMessageA(&Msg, 0, 0, 0, 1) ) + { + if ( Msg.message == 18 ) + Game_DeinitializeAndTerminate(0); + TranslateMessage(&Msg); + DispatchMessageA(&Msg); + } + if ( BYTE1(dword_6BE364_game_settings_1) & 1 ) + { + WaitMessage(); + } + else + { + pRenderer->BeginScene(); + pRenderer->DrawTextureRGB(0, 0, &mm6title_texture); + pRenderer->EndScene(); + pRenderer->Present(); + pCurrentScreen = SCREEN_GAME; + GUI_MainMenuMessageProc(); + } + } + while ( GetCurrentMenuID() == MENU_CREDITSPROC ); + //pAudioPlayer->_4AA258(1); + mm6title_texture.Release(); + return MENU_MAIN; // return MENU_Main +}*/ \ No newline at end of file diff -r a699ecd7aeb3 -r 6faacde46271 UI/UIPartyCreation.cpp --- a/UI/UIPartyCreation.cpp Fri Sep 20 14:31:42 2013 +0600 +++ b/UI/UIPartyCreation.cpp Fri Sep 20 17:31:37 2013 +0600 @@ -384,20 +384,8 @@ void PlayerCreationUI_Initialize() { unsigned int v0; // ebx@5 - unsigned int v1; // eax@6 - int v2; // ecx@6 - //unsigned int v3; // eax@8 - //signed int v4; // ecx@8 signed int uControlParam; // [sp+10h] [bp-Ch]@7 - unsigned int uControlParama; // [sp+10h] [bp-Ch]@9 - unsigned int uControlParamb; // [sp+10h] [bp-Ch]@11 - unsigned int uControlParamc; // [sp+10h] [bp-Ch]@13 - signed int uControlParamd; // [sp+10h] [bp-Ch]@15 signed int uX; // [sp+14h] [bp-8h]@5 - unsigned int uXa; // [sp+14h] [bp-8h]@9 - unsigned int uXb; // [sp+14h] [bp-8h]@11 - unsigned int uXc; // [sp+14h] [bp-8h]@13 - signed int uXd; // [sp+14h] [bp-8h]@16 pMessageQueue_50CBD0->Flush(); @@ -421,11 +409,10 @@ pTexture_IC_KNIGHT[8] = pIcons_LOD->LoadTexturePtr("IC_SORC", TEXTURE_16BIT_PALETTE); pTexture_MAKETOP = pIcons_LOD->LoadTexturePtr("MAKETOP", TEXTURE_16BIT_PALETTE); pTexture_MAKESKY = pIcons_LOD->LoadTexturePtr("MAKESKY", TEXTURE_16BIT_PALETTE); - for(uX=0;uX < 22;++uX ) // load PlayerPortraits texture + for( uX = 0; uX < 22; ++uX ) // load PlayerPortraits texture { sprintf(pTmpBuf.data(), "%s01", pPlayerPortraitsNames[uX]); - v1 = pIcons_LOD->LoadTexture(pTmpBuf.data(), TEXTURE_16BIT_PALETTE); - pPlayerPortraits[uX] = &pIcons_LOD->pTextures[v1]; + pPlayerPortraits[uX] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf.data(), TEXTURE_16BIT_PALETTE)]; } pTexture_PlayerFaceMask = pIcons_LOD->LoadTexturePtr("FACEMASK", TEXTURE_16BIT_PALETTE); @@ -444,15 +431,15 @@ } while ( ++uControlParam < 20 ); pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); - uControlParama = 0; - uXa = 8; + uControlParam = 0; + uX = 8; do { - pGUIWindow_CurrentMenu->CreateButton(uXa, 120, 145, 25, 1, 0, UIMSG_PlayerCreationChangeName, uControlParama, 0, "", 0); - uXa += 158; - ++uControlParama; + pGUIWindow_CurrentMenu->CreateButton(uX, 120, 145, 25, 1, 0, UIMSG_PlayerCreationChangeName, uControlParam, 0, "", 0); + uX += 158; + ++uControlParam; } - while ( (signed int)uXa < 640 ); + while ( (signed int)uX < 640 ); pCreationUI_BtnPressLeft[0] = pGUIWindow_CurrentMenu->CreateButton( 10, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 0, 0, "", pTexture_presleft, 0); pCreationUI_BtnPressLeft[1] = pGUIWindow_CurrentMenu->CreateButton(169, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 1, 0, "", pTexture_presleft, 0); @@ -471,39 +458,39 @@ pCreationUI_BtnPressRight2[2] = pGUIWindow_CurrentMenu->CreateButton(391, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 2, 0, "", pTexture_pressrigh, 0); pCreationUI_BtnPressRight2[3] = pGUIWindow_CurrentMenu->CreateButton(549, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 3, 0, "", pTexture_pressrigh, 0); - uControlParamb = 0; - uXb = 8; + uControlParam = 0; + uX = 8; do { - pGUIWindow_CurrentMenu->CreateButton(uXb, 308, 150, v0, 1, 0, UIMSG_48, uControlParamb, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(uXb, v0 + 308, 150, v0, 1, 0, UIMSG_49, uControlParamb, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(uXb, 2 * v0 + 308, 150, v0, 1, 0, UIMSG_PlayerCreationRemoveUpSkill, uControlParamb, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(uXb, 3 * v0 + 308, 150, v0, 1, 0, UIMSG_PlayerCreationRemoveDownSkill, uControlParamb, 0, "", 0); - uXb += 158; - ++uControlParamb; + pGUIWindow_CurrentMenu->CreateButton(uX, 308, 150, v0, 1, 0, UIMSG_48, uControlParam, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uX, v0 + 308, 150, v0, 1, 0, UIMSG_49, uControlParam, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uX, 2 * v0 + 308, 150, v0, 1, 0, UIMSG_PlayerCreationRemoveUpSkill, uControlParam, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uX, 3 * v0 + 308, 150, v0, 1, 0, UIMSG_PlayerCreationRemoveDownSkill, uControlParam, 0, "", 0); + uX += 158; + ++uControlParam; } - while ( (signed int)uXb < 640 ); + while ( (signed int)uX < 640 ); pGUIWindow_CurrentMenu->CreateButton( 5, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 0, '1', "", 0); pGUIWindow_CurrentMenu->CreateButton(163, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 1, '2', "", 0); pGUIWindow_CurrentMenu->CreateButton(321, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 2, '3', "", 0); pGUIWindow_CurrentMenu->CreateButton(479, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 3, '4', "", 0); - uXc = 23; - uControlParamc = 2; + uX = 23; + uControlParam = 2; do { - pGUIWindow_CurrentMenu->CreateButton(uXc, 169, 120, 20, 1, 0, UIMSG_0, uControlParamc - 2, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(uXc, v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc - 1, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(uXc, 2 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(uXc, 3 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc + 1, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(uXc, 4 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc + 2, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(uXc, 5 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc + 3, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(uXc, 6 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc + 4, 0, "", 0); - uControlParamc += 7; - uXc += 158; + pGUIWindow_CurrentMenu->CreateButton(uX, 169, 120, 20, 1, 0, UIMSG_0, uControlParam - 2, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uX, v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam - 1, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uX, 2 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uX, 3 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam + 1, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uX, 4 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam + 2, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uX, 5 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam + 3, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uX, 6 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam + 4, 0, "", 0); + uControlParam += 7; + uX += 158; } - while ( (signed int)uControlParamc < 30 ); + while ( (signed int)uControlParam < 30 ); pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(28, 0, 7, 40); pGUIWindow_CurrentMenu->CreateButton(323, 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0, 0, "", 0); @@ -516,17 +503,17 @@ pGUIWindow_CurrentMenu->CreateButton(453, v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 8, 0, "", 0); pGUIWindow_CurrentMenu->CreateButton(453, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 4, 0, "", 0); - uControlParamd = 0; + uControlParam = 0; do { - uXd = -5; - if ( uControlParamd <= 3 ) - uXd = 0; - pGUIWindow_CurrentMenu->CreateButton(100 * (uControlParamd / 3) + uXd + 17, v0 * (uControlParamd % 3) + 417, 100, v0, 1, 0, UIMSG_PlayerCreationSelectActiveSkill, - uControlParamd, 0, "", 0); - ++uControlParamd; + uX = -5; + if ( uControlParam <= 3 ) + uX = 0; + pGUIWindow_CurrentMenu->CreateButton(100 * (uControlParam / 3) + uX + 17, v0 * (uControlParam % 3) + 417, 100, v0, 1, 0, UIMSG_PlayerCreationSelectActiveSkill, + uControlParam, 0, "", 0); + ++uControlParam; } - while ( uControlParamd < 9 ); + while ( uControlParam < 9 ); pPlayerCreationUI_BtnOK = pGUIWindow_CurrentMenu->CreateButton(580, 431, 51, 39, 1, 0, UIMSG_PlayerCreationClickOK, 0, '\r', "", pIcons_LOD->GetTexture(uTextureID_BUTTMAKE), 0); pPlayerCreationUI_BtnReset = pGUIWindow_CurrentMenu->CreateButton(527, 431, 51, 39, 1, 0, UIMSG_PlayerCreationClickReset, 0, 'C', "", pIcons_LOD->GetTexture(uTextureID_BUTTMAKE2), 0); @@ -546,49 +533,30 @@ //----- (00497526) -------------------------------------------------------- bool PlayerCreationUI_Loop() { - //RGBTexture *pTexture; // ebx@1 - //UINT v1; // esi@1 - unsigned int v2; // ecx@3 LONG uMouseX; // edi@6 LONG uMouseY; // eax@6 - GUIButton *pControlsHead; // edx@6 - //unsigned int pNumMessage; // ecx@7 - int pControlParam; // esi@12 + //GUIButton *pControlsHead; // edx@6 + //int pControlParam; // esi@12 signed int v8; // edi@30 int v9; // edx@31 char *v10; // ebx@37 - Player *v11; // esi@38 - //signed int uSpellBookPageCount; // ecx@40 - int v13; // eax@40 - //signed int uSkillIdx; // eax@45 - int v15; // eax@70 - signed int v16; // ecx@70 - //unsigned int v18; // [sp-4h] [bp-84h]@48 ItemGen item; // [sp+Ch] [bp-74h]@37 char v20[32]; // [sp+30h] [bp-50h]@29 - //char v21; // [sp+31h] [bp-4Fh]@29 - //__int16 v22; // [sp+4Dh] [bp-33h]@29 - char v23; // [sp+4Fh] [bp-31h]@29 MSG Msg; // [sp+50h] [bp-30h]@17 POINT v25; // [sp+6Ch] [bp-14h]@6 - bool v26; // [sp+74h] [bp-Ch]@1 - //POINT v24; // [sp+78h] [bp-8h]@6 - //Player *pPlayer; + bool party_not_creation_flag; // [sp+74h] [bp-Ch]@1 - //pTexture = &pTexture_PCX; - v26 = 0; + party_not_creation_flag = false; pTexture_PCX.Release(); pTexture_PCX.Load("makeme.pcx", 0); - v2 = 6; pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE; -//LABEL_27: - SetCurrentMenuID((MENU_STATE)v2); + SetCurrentMenuID(MENU_CREATEPARTY); while ( GetCurrentMenuID() == MENU_CREATEPARTY ) { uMouseX = pMouse->GetCursorPos(&v25)->x; uMouseY = pMouse->GetCursorPos(&v25)->y; - pControlsHead = pGUIWindow_CurrentMenu->pControlsHead; + //pControlsHead = pGUIWindow_CurrentMenu->pControlsHead; //does nothing actually /*if ( pControlsHead != (GUIButton *)v1 ) @@ -629,17 +597,13 @@ pRenderer->Present(); if ( uGameState == GAME_FINISHED )//if click Esc in PlayerCreation Window { - v26 = 1; - //v2 = 0; - //goto LABEL_27; + party_not_creation_flag = true; SetCurrentMenuID(MENU_MAIN); continue; } if ( uGameState == GAME_STATE_STARTING_NEW_GAME )//if click OK in PlayerCreation Window { uGameState = GAME_STATE_PLAYING; - //v2 = 1; - //goto LABEL_27; SetCurrentMenuID(MENU_NEWGAME); continue; } @@ -649,19 +613,15 @@ pGUIWindow_CurrentMenu->Release(); pIcons_LOD->RemoveTexturesPackFromTextureList(); - int v1 = 0; memset(v20, 0, 32); - do + for ( int i = 0; i < 32; i++ ) { - v8 = 0; - do + for ( v8 = 0; v8 < 10; ++v8 ) { v9 = rand() % 32; if ( !v20[v9] ) break; - ++v8; } - while ( v8 < 10 ); if ( v8 == 10 ) { v9 = 0; @@ -672,83 +632,75 @@ while ( v20[v9] ); } } - pParty->field_854[v1++] = v9; + pParty->field_854[i] = v9; v20[v9] = 1; } - while ( (signed int)v1 < 32 ); - //v10 = (char *)&pParty->pPlayers[0].sResMagicBase; - + item.Reset(); - //for ( pPlayer = &pParty->pPlayers[0]; pPlayer < &pParty->pPlayers[4]; pPlayer++) for (uint i = 0; i < 4; ++i) { - auto player = &pParty->pPlayers[i]; - //v11 = pPlayer; - if (player->classType == PLAYER_CLASS_KNIGHT) - player->sResMagicBase = 10; - //*((short *)v10 + 400) = 0; - player->pPlayerBuffs[22].uExpireTime = 0; + if (pParty->pPlayers[i].classType == PLAYER_CLASS_KNIGHT) + pParty->pPlayers[i].sResMagicBase = 10; + pParty->pPlayers[i].pPlayerBuffs[22].uExpireTime = 0; for (uint j = 0; j < 9; j++) { - if (player->pActiveSkills[PLAYER_SKILL_FIRE + j]) + if (pParty->pPlayers[i].pActiveSkills[PLAYER_SKILL_FIRE + j]) { - player->lastOpenedSpellbookPage = j; + pParty->pPlayers[i].lastOpenedSpellbookPage = j; break; } } pItemsTable->GenerateItem(2, 40, &item); - player->AddItem2(-1, &item); - //uSkillIdx = 0; - //v24.y = 0; + pParty->pPlayers[i].AddItem2(-1, &item); - player->sHealth = player->GetMaxHealth(); - player->sMana = player->GetMaxMana(); + pParty->pPlayers[i].sHealth = pParty->pPlayers[i].GetMaxHealth(); + pParty->pPlayers[i].sMana = pParty->pPlayers[i].GetMaxMana(); for (uint j = 0; j < 37; ++j) { - if (!player->pActiveSkills[j]) + if (!pParty->pPlayers[i].pActiveSkills[j]) continue; switch (j) { - case PLAYER_SKILL_STAFF: player->AddItem(-1, 61); break; - case PLAYER_SKILL_SWORD: player->AddItem(-1, 1); break; - case PLAYER_SKILL_DAGGER: player->AddItem(-1, 15); break; - case PLAYER_SKILL_AXE: player->AddItem(-1, 23); break; - case PLAYER_SKILL_SPEAR: player->AddItem(-1, 31); break; - case PLAYER_SKILL_BOW: player->AddItem(-1, 47); break; - case PLAYER_SKILL_MACE: player->AddItem(-1, 50); break; + case PLAYER_SKILL_STAFF: pParty->pPlayers[i].AddItem(-1, 61); break; + case PLAYER_SKILL_SWORD: pParty->pPlayers[i].AddItem(-1, 1); break; + case PLAYER_SKILL_DAGGER: pParty->pPlayers[i].AddItem(-1, 15); break; + case PLAYER_SKILL_AXE: pParty->pPlayers[i].AddItem(-1, 23); break; + case PLAYER_SKILL_SPEAR: pParty->pPlayers[i].AddItem(-1, 31); break; + case PLAYER_SKILL_BOW: pParty->pPlayers[i].AddItem(-1, 47); break; + case PLAYER_SKILL_MACE: pParty->pPlayers[i].AddItem(-1, 50); break; case PLAYER_SKILL_BLASTER: Error("No blasters at startup :p"); - case PLAYER_SKILL_SHIELD: player->AddItem(-1, 84); break; - case PLAYER_SKILL_LEATHER: player->AddItem(-1, 66); break; - case PLAYER_SKILL_CHAIN: player->AddItem(-1, 71); break; - case PLAYER_SKILL_PLATE: player->AddItem(-1, 76); break; + case PLAYER_SKILL_SHIELD: pParty->pPlayers[i].AddItem(-1, 84); break; + case PLAYER_SKILL_LEATHER: pParty->pPlayers[i].AddItem(-1, 66); break; + case PLAYER_SKILL_CHAIN: pParty->pPlayers[i].AddItem(-1, 71); break; + case PLAYER_SKILL_PLATE: pParty->pPlayers[i].AddItem(-1, 76); break; case PLAYER_SKILL_FIRE: - player->AddItem(-1, 0x191); - player->spellbook.pFireSpellbook.bIsSpellAvailable[0] = true; + pParty->pPlayers[i].AddItem(-1, 0x191); + pParty->pPlayers[i].spellbook.pFireSpellbook.bIsSpellAvailable[0] = true; break; case PLAYER_SKILL_AIR: - player->AddItem(-1, 0x19C); - player->spellbook.pAirSpellbook.bIsSpellAvailable[0] = true; + pParty->pPlayers[i].AddItem(-1, 0x19C); + pParty->pPlayers[i].spellbook.pAirSpellbook.bIsSpellAvailable[0] = true; break; case PLAYER_SKILL_WATER: - player->AddItem(-1, 0x1A7); - player->spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true; + pParty->pPlayers[i].AddItem(-1, 0x1A7); + pParty->pPlayers[i].spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true; break; case PLAYER_SKILL_EARTH: - player->AddItem(-1, 0x1B2); - player->spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true; + pParty->pPlayers[i].AddItem(-1, 0x1B2); + pParty->pPlayers[i].spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true; break; case PLAYER_SKILL_SPIRIT: - player->AddItem(-1, 0x1BD); - player->spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true; + pParty->pPlayers[i].AddItem(-1, 0x1BD); + pParty->pPlayers[i].spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true; break; case PLAYER_SKILL_MIND: - player->AddItem(-1, 0x1C8); - player->spellbook.pMindSpellbook.bIsSpellAvailable[0] = true; + pParty->pPlayers[i].AddItem(-1, 0x1C8); + pParty->pPlayers[i].spellbook.pMindSpellbook.bIsSpellAvailable[0] = true; break; case PLAYER_SKILL_BODY: - player->AddItem(-1, 0x1D3); - player->spellbook.pBodySpellbook.bIsSpellAvailable[0] = true; + pParty->pPlayers[i].AddItem(-1, 0x1D3); + pParty->pPlayers[i].spellbook.pBodySpellbook.bIsSpellAvailable[0] = true; break; case PLAYER_SKILL_LIGHT: case PLAYER_SKILL_DARK: @@ -761,23 +713,23 @@ case PLAYER_SKILL_PERCEPTION: case PLAYER_SKILL_TRAP_DISARM: case PLAYER_SKILL_LEARNING: - player->AddItem(-1, 0xDC); - player->AddItem(-1, 5 * (rand() % 3 + 40)); + pParty->pPlayers[i].AddItem(-1, 0xDC); + pParty->pPlayers[i].AddItem(-1, 5 * (rand() % 3 + 40)); break; - case PLAYER_SKILL_DODGE: player->AddItem(-1, 115); break; - case PLAYER_SKILL_UNARMED: player->AddItem(-1, 110); break; + case PLAYER_SKILL_DODGE: pParty->pPlayers[i].AddItem(-1, 115); break; + case PLAYER_SKILL_UNARMED: pParty->pPlayers[i].AddItem(-1, 110); break; default: break; } for (uint k = 0; k < 138; k++) { - if (player->pOwnItems[k].uItemID) - player->pOwnItems[k].SetIdentified(); + if (pParty->pPlayers[i].pOwnItems[k].uItemID) + pParty->pPlayers[i].pOwnItems[k].SetIdentified(); } } } pAudioPlayer->StopChannels(-1, -1); - return v26; + return party_not_creation_flag; } \ No newline at end of file diff -r a699ecd7aeb3 -r 6faacde46271 UI/UIPopup.cpp --- a/UI/UIPopup.cpp Fri Sep 20 14:31:42 2013 +0600 +++ b/UI/UIPopup.cpp Fri Sep 20 17:31:37 2013 +0600 @@ -29,151 +29,96 @@ //----- (004179BC) -------------------------------------------------------- -void CharacterUI_DrawTooltip(const char *a1, const char *a2) +void CharacterUI_DrawTooltip(const char *Title, const char *content) { - //const char *v2; // ebx@1 - //const char *v3; // edi@1 - //unsigned int v4; // eax@1 - GUIWindow Dst; // [sp+Ch] [bp-5Ch]@1 + GUIWindow popup_window; // [sp+Ch] [bp-5Ch]@1 POINT v6; // [sp+60h] [bp-8h]@1 - //v2 = a2; - //v3 = a1; - memset(&Dst, 0, 0x54u); - Dst.uFrameWidth = 384; - Dst.uFrameHeight = 256; - Dst.uFrameX = 128; - Dst.uFrameY = pMouse->GetCursorPos(&v6)->y + 30; - Dst.uFrameHeight = pFontSmallnum->CalcTextHeight(a2, &Dst, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24; - Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1; - Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1; - Dst.DrawMessageBox(0); - Dst.uFrameX += 12; - Dst.uFrameWidth -= 24; - Dst.uFrameY += 12; - Dst.uFrameHeight -= 12; - Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1; - Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1; - sprintf(pTmpBuf.data(), "\f%05d%s\f00000\n", ui_character_tooltip_header_default_color, a1); - Dst.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3u); - Dst.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, a2, 0, 0, 0); + memset(&popup_window, 0, 0x54u); + popup_window.uFrameWidth = 384; + popup_window.uFrameHeight = 256; + popup_window.uFrameX = 128; + popup_window.uFrameY = pMouse->GetCursorPos(&v6)->y + 30; + popup_window.uFrameHeight = pFontSmallnum->CalcTextHeight(content, &popup_window, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24; + popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1; + popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1; + popup_window.DrawMessageBox(0); + + popup_window.uFrameX += 12; + popup_window.uFrameWidth -= 24; + popup_window.uFrameY += 12; + popup_window.uFrameHeight -= 12; + popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1; + popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1; + sprintf(pTmpBuf.data(), "\f%05d%s\f00000\n", ui_character_tooltip_header_default_color, Title); + popup_window.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3); + popup_window.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, content, 0, 0, 0); } //----- (004151D9) -------------------------------------------------------- void __fastcall DrawPopupWindow(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight) - { - unsigned int v4; // ebx@1 - Texture *v5; // edi@1 - signed int uTileWidth; // ecx@1 - int v7; // eax@5 - int v8; // ecx@10 - unsigned int v9; // ebx@14 - int v10; // [sp+10h] [bp-28h]@5 - signed int uTileHeight; // [sp+18h] [bp-20h]@1 - int v12; // [sp+1Ch] [bp-1Ch]@7 - int v13; // [sp+20h] [bp-18h]@1 - int a5; // [sp+24h] [bp-14h]@5 - unsigned int a5a; // [sp+24h] [bp-14h]@11 - unsigned int a4; // [sp+28h] [bp-10h]@1 - int uNumXTiles; // [sp+2Ch] [bp-Ch]@3 - unsigned int uNumXTilesa; // [sp+2Ch] [bp-Ch]@6 - unsigned int uNumXTilesb; // [sp+2Ch] [bp-Ch]@11 - unsigned int a2a; // [sp+30h] [bp-8h]@1 - unsigned int v21; // [sp+34h] [bp-4h]@5 - unsigned int v22; // [sp+34h] [bp-4h]@11 +{ + unsigned int uNumTiles; // [sp+2Ch] [bp-Ch]@6 + unsigned int coord_x; // [sp+2Ch] [bp-Ch]@3 + unsigned int coord_y; // [sp+34h] [bp-4h]@5 - v4 = uY; - a2a = uX; - a4 = uX + uWidth; - pRenderer->SetTextureClipRect(uX, v4, uX + uWidth, v4 + uHeight); - v5 = pIcons_LOD->GetTexture(uTextureID_Parchment); - uTileWidth = v5->uTextureWidth; - v13 = v5->uTextureWidth; - uTileHeight = v5->uTextureHeight; - if ( v5->uTextureWidth && v5->uTextureHeight) + pRenderer->SetTextureClipRect(uX, uY, uX + uWidth, uY + uHeight); + if ( pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth && pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureHeight) + { + uNumTiles = uWidth / pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth; + if ( uWidth % pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth ) + ++uNumTiles; + coord_y = uY; + for ( uint j = 0; j <= uHeight / pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureHeight; j++ ) { - uNumXTiles = (signed int)uWidth / uTileWidth; - if ( (signed int)uWidth % uTileWidth ) - ++uNumXTiles; - a5 = 0; - v21 = v4; - v7 = uNumXTiles + 1; - v10 = uNumXTiles + 1; - do - { - uNumXTilesa = a2a - v13; - if ( v7 > 0 ) - { - v12 = v7; - do - { - uNumXTilesa += v13; - pRenderer->DrawTextureIndexed(uNumXTilesa, v21, v5); - --v12; - } - while ( v12 ); - v7 = v10; - } - v21 += uTileHeight; - v8 = a5++; - } - while ( v8 < (signed int)uHeight / uTileHeight ); - a5a = v4 + uHeight - 32; - pRenderer->DrawTextureTransparent(a2a, v4, pIcons_LOD->GetTexture(uTextureID_5076AC)); - pRenderer->DrawTextureTransparent(a2a, a5a, pIcons_LOD->GetTexture(uTextureID_5076B4)); - pRenderer->DrawTextureTransparent(a4 - 32, v4, pIcons_LOD->GetTexture(uTextureID_5076A8)); - pRenderer->DrawTextureTransparent(a4 - 32, a5a, pIcons_LOD->GetTexture(uTextureID_5076B0)); - uNumXTilesb = a2a + 32; - v22 = v4 + uHeight - 10; - if ( (signed int)uWidth > 64 ) - { - pRenderer->SetTextureClipRect(a2a + 32, v4, a4 - 32, v4 + uHeight); - pRenderer->DrawTextureTransparent(uNumXTilesb, v4, pIcons_LOD->GetTexture(uTextureID_507698)); - pRenderer->DrawTextureTransparent(uNumXTilesb, v22, pIcons_LOD->GetTexture(uTextureID_5076A4)); - if ( (signed int)uWidth > 512 ) - { - pRenderer->DrawTextureTransparent(a2a + 544, v4, pIcons_LOD->GetTexture(uTextureID_507698)); - pRenderer->DrawTextureTransparent(a2a + 544, v22, pIcons_LOD->GetTexture(uTextureID_5076A4)); - } - } - v9 = v4 + 32; - if ( (signed int)uHeight > 64 ) - { - pRenderer->SetTextureClipRect(a2a, v9, a4, a5a); - pRenderer->DrawTextureTransparent(a2a, v9, pIcons_LOD->GetTexture(uTextureID_5076A0)); - pRenderer->DrawTextureTransparent(a4 - 10, v9, pIcons_LOD->GetTexture(uTextureID_50769C)); - } - pRenderer->ResetTextureClipRect(); - } + coord_x = uX - pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth; + for ( uint i = uNumTiles + 1; i; --i ) + { + coord_x += pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth; + pRenderer->DrawTextureIndexed(coord_x, coord_y, pIcons_LOD->GetTexture(uTextureID_Parchment)); + } + coord_y += pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureHeight; } - - + pRenderer->DrawTextureTransparent(uX, uY, pIcons_LOD->GetTexture(uTextureID_5076AC)); + pRenderer->DrawTextureTransparent(uX, uY + uHeight - 32, pIcons_LOD->GetTexture(uTextureID_5076B4)); + pRenderer->DrawTextureTransparent(uX + uWidth - 32, uY, pIcons_LOD->GetTexture(uTextureID_5076A8)); + pRenderer->DrawTextureTransparent(uX + uWidth - 32, uY + uHeight - 32, pIcons_LOD->GetTexture(uTextureID_5076B0)); + if ( uWidth > 64 ) + { + pRenderer->SetTextureClipRect(uX + 32, uY, uX + uWidth - 32, uY + uHeight); + pRenderer->DrawTextureTransparent(uX + 32, uY, pIcons_LOD->GetTexture(uTextureID_507698)); + pRenderer->DrawTextureTransparent(uX + 32, uY + uHeight - 10, pIcons_LOD->GetTexture(uTextureID_5076A4)); + if ( uWidth > 512 ) + { + pRenderer->DrawTextureTransparent(uX + 544, uY, pIcons_LOD->GetTexture(uTextureID_507698)); + pRenderer->DrawTextureTransparent(uX + 544, uY + uHeight - 10, pIcons_LOD->GetTexture(uTextureID_5076A4)); + } + } + if ( uHeight > 64 ) + { + pRenderer->SetTextureClipRect(uX, uY + 32, uX + uWidth, uY + uHeight - 32); + pRenderer->DrawTextureTransparent(uX, uY + 32, pIcons_LOD->GetTexture(uTextureID_5076A0)); + pRenderer->DrawTextureTransparent(uX + uWidth - 10, uY + 32, pIcons_LOD->GetTexture(uTextureID_50769C)); + } + pRenderer->ResetTextureClipRect(); + } +} //----- (0041D895) -------------------------------------------------------- void GameUI_DrawItemInfo( struct ItemGen* inspect_item ) { ItemGen *v1; // esi@1 unsigned int v2; // eax@3 - //char *v3; // edi@5 - //unsigned int v4; // eax@5 - //unsigned int v5; // esi@5 signed int v6; // eax@5 int v7; // edx@5 - //unsigned int v9; // eax@12 char v10; // zf@16 ItemGen *v11; // eax@16 ItemGen *v12; // eax@25 - //unsigned int v13; // ecx@32 - //unsigned int v14; // eax@32 - //Render *v15; // edi@33 const char *v16; // eax@34 int v17; // eax@36 int v18; // esi@37 unsigned __int16 v19; // ax@37 - //char v20; // al@40 char v21; // al@44 - //char v22; // al@48 - //char v23; // al@51 int v24; // eax@52 int v25; // eax@57 int v26; // eax@60 @@ -193,47 +138,31 @@ GUIFont *v40; // edx@113 signed int v41; // [sp-20h] [bp-298h]@113 int v42; // [sp-1Ch] [bp-294h]@113 - //char *v43; // [sp-18h] [bp-290h]@46 unsigned int v44; // [sp-18h] [bp-290h]@113 - //int v45; // [sp-14h] [bp-28Ch]@46 const char *v46; // [sp-14h] [bp-28Ch]@58 char *v47; // [sp-14h] [bp-28Ch]@110 - //char *v48; // [sp-10h] [bp-288h]@46 const char *v49; // [sp-10h] [bp-288h]@56 char *v50; // [sp-10h] [bp-288h]@58 int v51; // [sp-10h] [bp-288h]@110 const char *v52; // [sp-Ch] [bp-284h]@36 - //int v53; // [sp-Ch] [bp-284h]@46 char *v54; // [sp-Ch] [bp-284h]@56 int v55; // [sp-Ch] [bp-284h]@58 int v56; // [sp-Ch] [bp-284h]@110 unsigned int v57; // [sp-8h] [bp-280h]@36 - //int v58; // [sp-8h] [bp-280h]@46 int v59; // [sp-8h] [bp-280h]@56 int v60; // [sp-8h] [bp-280h]@58 unsigned int v61; // [sp-8h] [bp-280h]@110 char out_text[300]; // [sp+8h] [bp-270h]@40 - //char Dest[100]; // [sp+6Ch] [bp-20Ch]@40 - //char v64[100]; // [sp+D0h] [bp-1A8h]@40 char v65[120]; // [sp+134h] [bp-144h]@92 char Source[40]; // [sp+1ACh] [bp-CCh]@49 stru351_summoned_item v67; - //int v67; // [sp+1D4h] [bp-A4h]@91 - //int v68; // [sp+1D8h] [bp-A0h]@106 - //int v69; // [sp+1DCh] [bp-9Ch]@101 - //int v70; // [sp+1E0h] [bp-98h]@97 - //int v71; // [sp+1E8h] [bp-90h]@93 - //int v72; // [sp+1ECh] [bp-8Ch]@91 int var88; // [sp+1F0h] [bp-88h]@1 Texture *v73; // [sp+1F4h] [bp-84h]@5 - //unsigned int v75; // [sp+1F8h] [bp-80h]@5 - //char *v76; // [sp+1FCh] [bp-7Ch]@5 int v77; // [sp+200h] [bp-78h]@12 int v78; // [sp+204h] [bp-74h]@5 GUIWindow wHintWindow; // [sp+208h] [bp-70h]@2 POINT a2; // [sp+25Ch] [bp-1Ch]@2 int v81; // [sp+264h] [bp-14h]@5 - // GUIFont *pFontComic; // [sp+268h] [bp-10h]@1 PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18 char* v84; int v85; @@ -1748,10 +1677,8 @@ break; case 26: // Class description { - auto v24 = pClassNames[pPlayers[uActiveCharacter]->classType]; - auto v7 = pClassDescriptions[pPlayers[uActiveCharacter]->classType]; - if (v7 && v24) - CharacterUI_DrawTooltip(v24, v7); + if (pClassDescriptions[pPlayers[uActiveCharacter]->classType] && pClassNames[pPlayers[uActiveCharacter]->classType]) + CharacterUI_DrawTooltip(pClassNames[pPlayers[uActiveCharacter]->classType], pClassDescriptions[pPlayers[uActiveCharacter]->classType]); } break;