Mercurial > mm7
comparison UI/UICharacter.cpp @ 1465:090ff42290c4
Слияние
author | Ritor1 |
---|---|
date | Mon, 26 Aug 2013 10:39:24 +0600 |
parents | b870630761df 845907a747d3 |
children | ec79ee6d44ce |
comparison
equal
deleted
inserted
replaced
1464:b870630761df | 1465:090ff42290c4 |
---|---|
41 unsigned int ui_character_stat_buffed_color; | 41 unsigned int ui_character_stat_buffed_color; |
42 unsigned int ui_character_stat_debuffed_color; | 42 unsigned int ui_character_stat_debuffed_color; |
43 unsigned int ui_character_skillinfo_can_learn; | 43 unsigned int ui_character_skillinfo_can_learn; |
44 unsigned int ui_character_skillinfo_can_learn_gm; | 44 unsigned int ui_character_skillinfo_can_learn_gm; |
45 unsigned int ui_character_skillinfo_cant_learn; | 45 unsigned int ui_character_skillinfo_cant_learn; |
46 unsigned int ui_character_condition_normal_color; | |
47 unsigned int ui_character_condition_light_color; | |
48 unsigned int ui_character_condition_moderate_color; | |
49 unsigned int ui_character_condition_severe_color; | |
46 std::array<unsigned int, 6> ui_character_award_color; | 50 std::array<unsigned int, 6> ui_character_award_color; |
47 | 51 |
48 unsigned int ui_game_minimap_outline_color; | 52 unsigned int ui_game_minimap_outline_color; |
49 unsigned int ui_game_minimap_actor_friendly_color; | 53 unsigned int ui_game_minimap_actor_friendly_color; |
50 unsigned int ui_game_minimap_actor_hostile_color; | 54 unsigned int ui_game_minimap_actor_hostile_color; |
105 ui_character_stat_debuffed_color = TargetColor(255, 35, 0); | 109 ui_character_stat_debuffed_color = TargetColor(255, 35, 0); |
106 | 110 |
107 ui_character_skillinfo_can_learn = TargetColor(255, 255, 255); | 111 ui_character_skillinfo_can_learn = TargetColor(255, 255, 255); |
108 ui_character_skillinfo_can_learn_gm = TargetColor(255, 255, 0); | 112 ui_character_skillinfo_can_learn_gm = TargetColor(255, 255, 0); |
109 ui_character_skillinfo_cant_learn = TargetColor(255, 0, 0); | 113 ui_character_skillinfo_cant_learn = TargetColor(255, 0, 0); |
114 | |
115 ui_character_condition_normal_color = TargetColor(255, 255, 255); | |
116 ui_character_condition_light_color = TargetColor(0, 255, 0); | |
117 ui_character_condition_moderate_color = TargetColor(225, 205, 35); | |
118 ui_character_condition_severe_color = TargetColor(255, 35, 0); | |
110 | 119 |
111 ui_character_award_color[0] = TargetColor(248, 108, 160); | 120 ui_character_award_color[0] = TargetColor(248, 108, 160); |
112 ui_character_award_color[1] = TargetColor(112, 220, 248); | 121 ui_character_award_color[1] = TargetColor(112, 220, 248); |
113 ui_character_award_color[2] = TargetColor(192, 192, 240); | 122 ui_character_award_color[2] = TargetColor(192, 192, 240); |
114 ui_character_award_color[3] = TargetColor( 64, 244, 96); | 123 ui_character_award_color[3] = TargetColor( 64, 244, 96); |
561 } | 570 } |
562 | 571 |
563 //----- (0041A000) -------------------------------------------------------- | 572 //----- (0041A000) -------------------------------------------------------- |
564 void CharacterUI_AwardsTab_Draw(Player *player) | 573 void CharacterUI_AwardsTab_Draw(Player *player) |
565 { | 574 { |
566 unsigned int result; // eax@1 | 575 int items_per_page; // eax@1 |
567 char *v6; // ebx@15 | 576 char *v6; // ebx@15 |
568 char Source[100]; // [sp+Ch] [bp-C4h]@1 | 577 char Source[100]; // [sp+Ch] [bp-C4h]@1 |
569 GUIWindow awards_window; // [sp+70h] [bp-60h]@1 | 578 GUIWindow awards_window; // [sp+70h] [bp-60h]@1 |
570 | 579 |
571 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("fr_award", TEXTURE_16BIT_PALETTE)); | 580 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("fr_award", TEXTURE_16BIT_PALETTE)); |
573 sprintfex(Source, pGlobalTXT_LocalizationStrings[LOCSTR_S_THE_S], player->pName, pClassNames[player->classType]); | 582 sprintfex(Source, pGlobalTXT_LocalizationStrings[LOCSTR_S_THE_S], player->pName, pClassNames[player->classType]); |
574 strcat(pTmpBuf.data(), Source); | 583 strcat(pTmpBuf.data(), Source); |
575 strcat(pTmpBuf.data(), "\f00000"); | 584 strcat(pTmpBuf.data(), "\f00000"); |
576 | 585 |
577 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf.data(), 0, 0, 0); | 586 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf.data(), 0, 0, 0); |
578 result = books_primary_item_per_page; | 587 items_per_page = books_primary_item_per_page; |
579 awards_window.uFrameX = 12; | 588 awards_window.uFrameX = 12; |
580 awards_window.uFrameY = 48; | 589 awards_window.uFrameY = 48; |
581 awards_window.uFrameWidth = 424; | 590 awards_window.uFrameWidth = 424; |
582 awards_window.uFrameHeight = 290; | 591 awards_window.uFrameHeight = 290; |
583 awards_window.uFrameZ = 435; | 592 awards_window.uFrameZ = 435; |
584 awards_window.uFrameW = 337; | 593 awards_window.uFrameW = 337; |
585 if (BtnDown_flag && num_achieved_awards + books_primary_item_per_page < full_num_items_in_book) | 594 if (BtnDown_flag && num_achieved_awards + books_primary_item_per_page < full_num_items_in_book) |
586 result = books_primary_item_per_page++ + 1; | 595 items_per_page = books_primary_item_per_page++ + 1; |
587 if (BtnUp_flag && result) | 596 if (BtnUp_flag && items_per_page) |
588 { | 597 { |
589 --result; | 598 --items_per_page; |
590 books_primary_item_per_page = result; | 599 books_primary_item_per_page = items_per_page; |
591 } | 600 } |
592 | 601 |
593 if ( books_page_number < 0 ) | 602 if ( books_page_number < 0 ) |
594 { | 603 { |
595 result += num_achieved_awards; | 604 items_per_page += num_achieved_awards; |
596 books_primary_item_per_page = result; | 605 books_primary_item_per_page = items_per_page; |
597 if ( (signed int)(num_achieved_awards + result) > full_num_items_in_book ) | 606 if ( (signed int)(num_achieved_awards + items_per_page) > full_num_items_in_book ) |
598 { | 607 { |
599 result = full_num_items_in_book - num_achieved_awards; | 608 items_per_page = full_num_items_in_book - num_achieved_awards; |
600 books_primary_item_per_page = result; | 609 books_primary_item_per_page = items_per_page; |
601 } | 610 } |
602 } | 611 } |
603 else if ( books_page_number > 0 ) | 612 else if ( books_page_number > 0 ) |
604 { | 613 { |
605 result -= num_achieved_awards; | 614 items_per_page -= num_achieved_awards; |
606 books_primary_item_per_page = result; | 615 books_primary_item_per_page = items_per_page; |
607 if ( (result & 0x80000000u) != 0 ) | 616 if ( items_per_page < 0 ) |
608 { | 617 { |
609 result = 0; | 618 items_per_page = 0; |
610 books_primary_item_per_page = result; | 619 books_primary_item_per_page = items_per_page; |
611 } | 620 } |
612 } | 621 } |
613 BtnDown_flag = 0; | 622 BtnDown_flag = 0; |
614 BtnUp_flag = 0; | 623 BtnUp_flag = 0; |
615 num_achieved_awards = 0; | 624 num_achieved_awards = 0; |
616 books_page_number = 0; | 625 books_page_number = 0; |
617 | 626 |
618 for ( int i = result; i < full_num_items_in_book; ++i) | 627 for ( int i = items_per_page; i < full_num_items_in_book; ++i) |
619 { | 628 { |
620 v6 = (char *)pAwards[achieved_awards[i]].pText;//(char *)dword_723E80_award_related[v20 / 4]; | 629 v6 = (char *)pAwards[achieved_awards[i]].pText;//(char *)dword_723E80_award_related[v20 / 4]; |
621 pTmpBuf[0] = 0; | 630 pTmpBuf[0] = 0; |
622 switch (achieved_awards[i]) | 631 switch (achieved_awards[i]) |
623 { | 632 { |
665 pRenderer->ClearZBuffer(0, 479); | 674 pRenderer->ClearZBuffer(0, 479); |
666 switch (pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0]) | 675 switch (pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0]) |
667 { | 676 { |
668 case WINDOW_CharacterWindow_Stats: // stats | 677 case WINDOW_CharacterWindow_Stats: // stats |
669 CharacterUI_ReleaseButtons(); | 678 CharacterUI_ReleaseButtons(); |
670 sub_419379(); | 679 ReleaseAwardsScrollBar(); |
671 CharacterUI_StatsTab_Draw(player); | 680 CharacterUI_StatsTab_Draw(player); |
672 pRenderer->DrawTextureIndexed(pCharacterScreen_StatsBtn->uX, | 681 pRenderer->DrawTextureIndexed(pCharacterScreen_StatsBtn->uX, |
673 pCharacterScreen_StatsBtn->uY, | 682 pCharacterScreen_StatsBtn->uY, |
674 pIcons_LOD->LoadTexturePtr("ib-cd1-d", TEXTURE_16BIT_PALETTE)); | 683 pIcons_LOD->LoadTexturePtr("ib-cd1-d", TEXTURE_16BIT_PALETTE)); |
675 break; | 684 break; |
678 if (dword_507CC0_activ_ch != uActiveCharacter) | 687 if (dword_507CC0_activ_ch != uActiveCharacter) |
679 { | 688 { |
680 CharacterUI_ReleaseButtons(); | 689 CharacterUI_ReleaseButtons(); |
681 CharacterUI_SkillsTab_CreateButtons(); | 690 CharacterUI_SkillsTab_CreateButtons(); |
682 } | 691 } |
683 sub_419379(); | 692 ReleaseAwardsScrollBar(); |
684 CharacterUI_SkillsTab_Draw(player); | 693 CharacterUI_SkillsTab_Draw(player); |
685 pRenderer->DrawTextureIndexed(pCharacterScreen_SkillsBtn->uX, | 694 pRenderer->DrawTextureIndexed(pCharacterScreen_SkillsBtn->uX, |
686 pCharacterScreen_SkillsBtn->uY, | 695 pCharacterScreen_SkillsBtn->uY, |
687 pIcons_LOD->LoadTexturePtr("ib-cd2-d", TEXTURE_16BIT_PALETTE)); | 696 pIcons_LOD->LoadTexturePtr("ib-cd2-d", TEXTURE_16BIT_PALETTE)); |
688 break; | 697 break; |
689 | 698 |
690 case WINDOW_CharacterWindow_Awards: // awards | 699 case WINDOW_CharacterWindow_Awards: // awards |
691 CharacterUI_ReleaseButtons(); | 700 CharacterUI_ReleaseButtons(); |
692 sub_419379(); | 701 ReleaseAwardsScrollBar(); |
693 CreateAwardsScrollBar(); | 702 CreateAwardsScrollBar(); |
694 CharacterUI_AwardsTab_Draw(player); | 703 CharacterUI_AwardsTab_Draw(player); |
695 pRenderer->DrawTextureIndexed(pCharacterScreen_AwardsBtn->uX, | 704 pRenderer->DrawTextureIndexed(pCharacterScreen_AwardsBtn->uX, |
696 pCharacterScreen_AwardsBtn->uY, | 705 pCharacterScreen_AwardsBtn->uY, |
697 pIcons_LOD->LoadTexturePtr("ib-cd4-d", TEXTURE_16BIT_PALETTE)); | 706 pIcons_LOD->LoadTexturePtr("ib-cd4-d", TEXTURE_16BIT_PALETTE)); |
698 break; | 707 break; |
699 | 708 |
700 case WINDOW_CharacterWindow_Inventory: // inventory and other | 709 case WINDOW_CharacterWindow_Inventory: // inventory and other |
701 CharacterUI_ReleaseButtons(); | 710 CharacterUI_ReleaseButtons(); |
702 sub_419379(); | 711 ReleaseAwardsScrollBar(); |
703 CharacterUI_InventoryTab_Draw(player, false); | 712 CharacterUI_InventoryTab_Draw(player, false); |
704 pRenderer->DrawTextureIndexed(pCharacterScreen_InventoryBtn->uX, | 713 pRenderer->DrawTextureIndexed(pCharacterScreen_InventoryBtn->uX, |
705 pCharacterScreen_InventoryBtn->uY, | 714 pCharacterScreen_InventoryBtn->uY, |
706 pIcons_LOD->LoadTexturePtr("ib-cd3-d", TEXTURE_16BIT_PALETTE)); | 715 pIcons_LOD->LoadTexturePtr("ib-cd3-d", TEXTURE_16BIT_PALETTE)); |
707 break; | 716 break; |
2343 } | 2352 } |
2344 | 2353 |
2345 //----- (00419100) -------------------------------------------------------- | 2354 //----- (00419100) -------------------------------------------------------- |
2346 void FillAwardsData() | 2355 void FillAwardsData() |
2347 { | 2356 { |
2348 auto pPlayer = pPlayers[uActiveCharacter]; | 2357 Player* pPlayer = pPlayers[uActiveCharacter]; |
2349 | 2358 |
2350 memset(achieved_awards.data(), 0, 4000); | 2359 memset(achieved_awards.data(), 0, 4000); |
2351 num_achieved_awards = 0; | 2360 num_achieved_awards = 0; |
2352 | 2361 |
2353 memset(pTmpBuf2.data(), 0, 0x7D0u); | 2362 memset(pTmpBuf2.data(), 0, 0x7D0u); |
2354 BtnDown_flag = 0; | 2363 BtnDown_flag = 0; |
2355 BtnUp_flag = 0; | 2364 BtnUp_flag = 0; |
2356 books_page_number = 0; | 2365 books_page_number = 0; |
2357 books_primary_item_per_page = 0; | 2366 books_primary_item_per_page = 0; |
2358 for (int i = 0; i < 105; ++i) | 2367 for (int i = 1; i < 105; ++i) |
2359 { | 2368 { |
2360 if ( _449B57_test_bit(pPlayer->_guilds_member_bits, i) && pAwards[i].pText ) | 2369 if ( _449B57_test_bit(pPlayer->_achieved_awards_bits, i) && pAwards[i].pText ) |
2361 { | 2370 { |
2362 achieved_awards[num_achieved_awards++] = (AwardType)i; | 2371 achieved_awards[num_achieved_awards++] = (AwardType)i; |
2363 } | 2372 } |
2364 } | 2373 } |
2365 full_num_items_in_book = num_achieved_awards; | 2374 full_num_items_in_book = num_achieved_awards; |
2366 num_achieved_awards = 0; | 2375 num_achieved_awards = 0; |
2367 | 2376 |
2368 //sort awards index | 2377 //sort awards index |
2369 if (full_num_items_in_book > 0) | 2378 |
2370 { | 2379 if (full_num_items_in_book>0) |
2371 std::stable_sort(achieved_awards.begin(), achieved_awards.end(), awardSort); | 2380 { |
2372 } | 2381 for (int i = 0; i< full_num_items_in_book; ++i) |
2382 achieved_awards[full_num_items_in_book+i] = (AwardType)(rand()%16); | |
2383 for (int i = 1; i< full_num_items_in_book; ++i) | |
2384 { | |
2385 for (int j = i; j< full_num_items_in_book; ++j) | |
2386 { | |
2387 AwardType tmp; | |
2388 if (pAwards[achieved_awards[j]].uPriority < pAwards[achieved_awards[i]].uPriority) | |
2389 { | |
2390 tmp= achieved_awards[j]; | |
2391 achieved_awards[j] = achieved_awards[i]; | |
2392 achieved_awards[i] = tmp; | |
2393 } | |
2394 } | |
2395 } | |
2396 } | |
2397 | |
2398 | |
2399 // if (full_num_items_in_book > 0) | |
2400 /* { | |
2401 std::stable_sort(achieved_awards.begin(), achieved_awards.end(), awardSort); | |
2402 }*/ | |
2373 } | 2403 } |
2374 | 2404 |
2375 | 2405 |
2376 //----- (0043EF2B) -------------------------------------------------------- | 2406 //----- (0043EF2B) -------------------------------------------------------- |
2377 void WetsuitOn( unsigned int uPlayerID ) | 2407 void WetsuitOn( unsigned int uPlayerID ) |
2433 papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | 2463 papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); |
2434 IsPlayerWearingWatersuit[uPlayerID] = 0; | 2464 IsPlayerWearingWatersuit[uPlayerID] = 0; |
2435 } | 2465 } |
2436 } | 2466 } |
2437 //----- (00468F8A) -------------------------------------------------------- | 2467 //----- (00468F8A) -------------------------------------------------------- |
2438 void __cdecl OnPaperdollLeftClick() | 2468 void OnPaperdollLeftClick() |
2439 { | 2469 { |
2440 int v1; // ecx@1 | 2470 int v1; // ecx@1 |
2441 unsigned int v2; // edi@1 | 2471 unsigned int v2; // edi@1 |
2442 unsigned int v3; // edx@4 | 2472 unsigned int v3; // edx@4 |
2443 unsigned int pSkillType; // esi@5 | 2473 unsigned int pSkillType; // esi@5 |