comparison GUI/UI/UiGame.cpp @ 2547:fed97f15d1e1

* SaveLoad * QuickReference * Modal * Character
author a.parshin
date Tue, 12 May 2015 01:45:31 +0200
parents 4087cbc62706
children f2a8ed07e921
comparison
equal deleted inserted replaced
2546:4087cbc62706 2547:fed97f15d1e1
35 35
36 #include "GUI/GUIWindow.h" 36 #include "GUI/GUIWindow.h"
37 #include "GUI/GUIFont.h" 37 #include "GUI/GUIFont.h"
38 #include "GUI/UI/UIHouses.h" 38 #include "GUI/UI/UIHouses.h"
39 #include "GUI/UI/UIGame.h" 39 #include "GUI/UI/UIGame.h"
40 #include "GUI/UI/UICharacter.h"
40 41
41 #include "Media/Audio/AudioPlayer.h" 42 #include "Media/Audio/AudioPlayer.h"
42 43
43 int uTextureID_GameUI_CharSelectionFrame; // 50C98C 44 int uTextureID_GameUI_CharSelectionFrame; // 50C98C
44 45
561 return; 562 return;
562 563
563 uActiveCharacter = uPlayerID; 564 uActiveCharacter = uPlayerID;
564 return; 565 return;
565 } 566 }
566 pGUIWindow_CurrentMenu = CharacterUI_Initialize(SCREEN_CHARACTERS); 567 pGUIWindow_CurrentMenu = new GUIWindow_CharacterRecord(uActiveCharacter, SCREEN_CHARACTERS);//CharacterUI_Initialize(SCREEN_CHARACTERS);
567 return; 568 return;
568 } 569 }
569 if ( current_screen_type == SCREEN_SPELL_BOOK ) 570 if ( current_screen_type == SCREEN_SPELL_BOOK )
570 return; 571 return;
571 if ( current_screen_type == SCREEN_CHEST ) 572 if ( current_screen_type == SCREEN_CHEST )
621 } 622 }
622 if (dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD || dialog_menu_id == HOUSE_DIALOGUE_SHOP_6) 623 if (dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD || dialog_menu_id == HOUSE_DIALOGUE_SHOP_6)
623 { 624 {
624 __debugbreak(); // fix indexing 625 __debugbreak(); // fix indexing
625 current_character_screen_window = WINDOW_CharacterWindow_Inventory; 626 current_character_screen_window = WINDOW_CharacterWindow_Inventory;
626 pGUIWindow_CurrentMenu = CharacterUI_Initialize(SCREEN_E); 627 pGUIWindow_CurrentMenu = new GUIWindow_CharacterRecord(uActiveCharacter, SCREEN_E);//CharacterUI_Initialize(SCREEN_E);
627 return; 628 return;
628 } 629 }
629 } 630 }
630 631
631 //----- (00416B01) -------------------------------------------------------- 632 //----- (00416B01) --------------------------------------------------------
1327 v39 = ""; 1328 v39 = "";
1328 if ( uFramesetIDa == 0 ) 1329 if ( uFramesetIDa == 0 )
1329 v39 = pGlobalTXT_LocalizationStrings[153]; // "None" 1330 v39 = pGlobalTXT_LocalizationStrings[153]; // "None"
1330 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[450], v39); // "Active Spells: %s" 1331 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[450], v39); // "Active Spells: %s"
1331 window->DrawText(pFontArrus, 14, 114, 0, pTmpBuf.data(), 0, 0, 0); 1332 window->DrawText(pFontArrus, 14, 114, 0, pTmpBuf.data(), 0, 0, 0);
1332 }
1333
1334 //----- (0041A57E) --------------------------------------------------------
1335 void GameUI_QuickRef_Draw()
1336 {
1337 unsigned int pTextColor; // eax@7
1338 unsigned int pX; // [sp+14h] [bp-18h]@2
1339 unsigned int pY; // edi@9
1340 int pSkillsCount; // ecx@27
1341 const char *pText; // eax@38
1342 int pFontHeight; // [sp+18h] [bp-14h]@1
1343
1344 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("quikref", TEXTURE_16BIT_PALETTE));
1345 pFontHeight = LOBYTE(pFontArrus->uFontHeight) + 1;
1346 for ( uint i = 0; i < 4; ++i )
1347 {
1348 Player* player = &pParty->pPlayers[i];
1349 pX = 94 * i + 89;
1350 if ( i == 0 )
1351 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, 18, 0, pGlobalTXT_LocalizationStrings[149], 60, 0);//Name
1352 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 94 * i + 89, 18, ui_character_header_text_color, player->pName, 84, 0);
1353 if ( i == 0 )
1354 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, 47, 0, pGlobalTXT_LocalizationStrings[131], 60, 0); //Уров.
1355 sprintf(pTmpBuf.data(), "%lu", player->GetActualLevel());
1356 if ( player->GetActualLevel() <= player->GetBaseLevel())
1357 pTextColor = player->GetExperienceDisplayColor();
1358 else
1359 pTextColor = ui_character_bonus_text_color;
1360 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, 47, pTextColor, pTmpBuf.data(), 84, 0);
1361 pY = pFontHeight + 47;
1362 if ( i == 0 )
1363 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pFontHeight + 47, 0, pGlobalTXT_LocalizationStrings[41], 60, 0);//Класс
1364 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pClassNames[player->classType], 84, 0);
1365 pY = pFontHeight + pY;
1366 if ( i == 0 )
1367 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[107], 60, 0);//Здор.
1368 sprintf(pTmpBuf.data(), "%d", player->sHealth);
1369 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->sHealth, player->GetMaxHealth());
1370 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, pTmpBuf.data(), 84, 0);
1371 pY = pFontHeight + pY;
1372 if ( i == 0 )
1373 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[209], 60, 0);//Мана
1374 sprintf(pTmpBuf.data(), "%d", player->sMana);
1375 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->sMana, player->GetMaxMana());
1376 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, pTmpBuf.data(), 84, 0);
1377 pY = pFontHeight + pY;
1378 if ( i == 0 )
1379 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[0], 60, 0);//Класс брони
1380 sprintf(pTmpBuf.data(), "%d", player->GetActualAC());
1381 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualAC(), player->GetBaseAC());
1382 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, pTmpBuf.data(), 84, 0);
1383 pY = pFontHeight + pY;
1384 if ( !i )
1385 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[18], 60, 0);//Атака
1386 sprintf(pTmpBuf.data(), "%+d", player->GetActualAttack(false));
1387 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pTmpBuf.data(), 84, 0);
1388 pY = pFontHeight + pY;
1389 if ( !i )
1390 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//Повр.
1391 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, player->GetMeleeDamageString(), 84, 0);
1392 pY = pFontHeight + pY;
1393 if ( !i )
1394 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[203], 60, 0);// Стрелять
1395 sprintf(pTmpBuf.data(), "%+d", player->GetRangedAttack());
1396 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pTmpBuf.data(), 84, 0);
1397 pY = pFontHeight + pY;
1398 if ( !i )
1399 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//Повр.
1400 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, player->GetRangedDamageString(), 84, 0);
1401 pY = pFontHeight + pY;
1402 if ( !i )
1403 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[205], 60, 0);//Навыки
1404 pSkillsCount = 0;
1405 for ( uint j = 0; j <= 36; ++j )
1406 {
1407 if ( player->pActiveSkills[j] )
1408 ++pSkillsCount;
1409 }
1410 sprintf(pTmpBuf.data(), "%lu", pSkillsCount);
1411 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pTmpBuf.data(), 84, 0);
1412 pY = pFontHeight + pY;
1413 if ( !i )
1414 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[168], 60, 0);//Очки
1415 sprintf(pTmpBuf.data(), "%lu", player->uSkillPoints);
1416 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, pTmpBuf.data(), 84, 0);
1417 pY = pFontHeight + pY;
1418 if ( !i )
1419 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[45], 60, 0);//Сост.
1420 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, aCharacterConditionNames[player->GetMajorConditionIdx()], 84, 0);
1421 pY = pFontHeight + pY;
1422 if ( !i )
1423 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[170], 60, 0);//Б.Прим.
1424 if (player->uQuickSpell)
1425 pText = pSpellStats->pInfos[player->uQuickSpell].pShortName;
1426 else
1427 pText = pGlobalTXT_LocalizationStrings[153];//Нет
1428 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pText, 84, 0);
1429 }
1430
1431 if ( pParty->GetPartyReputation() >= 0 )
1432 {
1433 if ( pParty->GetPartyReputation() <= 5 )
1434 pTextColor = ui_character_default_text_color;
1435 else
1436 pTextColor = ui_character_bonus_text_color_neg;
1437 }
1438 else
1439 pTextColor = ui_character_bonus_text_color;
1440
1441 sprintf(pTmpBuf.data(), "%s: \f%05d%s\f00000", pGlobalTXT_LocalizationStrings[180], pTextColor, GetReputationString(pParty->GetPartyReputation()));//Reputation
1442 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 22, 323, 0, pTmpBuf.data(), 0, 0, 0);
1443 sprintf(pTmpBuf.data(), "\r261%s: %d", pGlobalTXT_LocalizationStrings[84], pParty->GetPartyFame());// Fame Слава
1444 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 0, 323, 0, pTmpBuf.data(), 0, 0, 0);
1445 } 1333 }
1446 1334
1447 //----- (0041AD6E) -------------------------------------------------------- 1335 //----- (0041AD6E) --------------------------------------------------------
1448 void GameUI_DrawRightPanelItems() 1336 void GameUI_DrawRightPanelItems()
1449 { 1337 {