Mercurial > mm7
comparison UI/UIHouses.cpp @ 1610:fa0e700bcc80
m
author | Ritor1 |
---|---|
date | Sat, 14 Sep 2013 10:28:13 +0600 |
parents | debc6edce54c |
children | 11f12a34b397 |
comparison
equal
deleted
inserted
replaced
1609:debc6edce54c | 1610:fa0e700bcc80 |
---|---|
89 { | 89 { |
90 { 0, 1, 1, 34}, // HOUSE_STABLES_HARMONDALE | 90 { 0, 1, 1, 34}, // HOUSE_STABLES_HARMONDALE |
91 { 2, 3, 4, 5}, // HOUSE_STABLES_STEADWICK | 91 { 2, 3, 4, 5}, // HOUSE_STABLES_STEADWICK |
92 { 6, 7, 8, 8}, // HOUSE_STABLES_TULAREAN_FOREST | 92 { 6, 7, 8, 8}, // HOUSE_STABLES_TULAREAN_FOREST |
93 { 9, 10, 10, 10}, // HOUSE_STABLES_DEYJA | 93 { 9, 10, 10, 10}, // HOUSE_STABLES_DEYJA |
94 { 11, 11, 12, 12}, // HOUSE_STABLES_58 | 94 { 11, 11, 12, 12}, // HOUSE_STABLES_BRACADA_DESERT |
95 { 13, 13, 13, 13}, // HOUSE_STABLES_59 | 95 { 13, 13, 13, 13}, // HOUSE_STABLES_TATALIA |
96 { 14, 14, 15, 15}, // HOUSE_STABLES_60 | 96 { 14, 14, 15, 15}, // HOUSE_STABLES_AVLEE |
97 {255, 255, 255, 255}, // HOUSE_STABLES_61 | 97 {255, 255, 255, 255}, // HOUSE_STABLES_61 |
98 {255, 255, 255, 255}, // HOUSE_STABLES_62 | 98 {255, 255, 255, 255}, // HOUSE_STABLES_62 |
99 {255, 255, 255, 255}, // HOUSE_BOATS_63 | 99 {255, 255, 255, 255}, // HOUSE_BOATS_EMERALD_ISLE |
100 { 16, 17, 18, 19}, // HOUSE_BOATS_64 | 100 { 16, 17, 18, 19}, // HOUSE_BOATS_ERATHIA |
101 { 18, 20, 21, 21}, // HOUSE_BOATS_65 | 101 { 18, 20, 21, 21}, // HOUSE_BOATS_TULAREAN_FOREST |
102 { 22, 23, 24, 25}, // HOUSE_BOATS_66 | 102 { 22, 23, 24, 25}, // HOUSE_BOATS_BRACADA_DESERT |
103 { 22, 22, 23, 23}, // HOUSE_BOATS_67 | 103 { 22, 22, 23, 23}, // HOUSE_BOATS_EVENMORN_ISLAND |
104 {255, 255, 255, 255}, // HOUSE_BOATS_68 | 104 {255, 255, 255, 255}, // HOUSE_BOATS_68 |
105 { 27, 28, 29, 30}, // HOUSE_BOATS_69 | 105 { 27, 28, 29, 30}, // HOUSE_BOATS_TATALIA |
106 { 31, 32, 33, 33}, // HOUSE_BOATS_70 | 106 { 31, 32, 33, 33}, // HOUSE_BOATS_AVLEE |
107 { 24, 24, 24, 24}, // HOUSE_BOATS_71 | 107 { 24, 24, 24, 24}, // HOUSE_BOATS_71 |
108 {255, 255, 255, 255}, // HOUSE_BOATS_72 | 108 {255, 255, 255, 255}, // HOUSE_BOATS_72 |
109 {255, 255, 255, 255} // HOUSE_BOATS_73 | 109 {255, 255, 255, 255} // HOUSE_BOATS_73 |
110 }; | 110 }; |
111 | 111 |
1923 unsigned int v30; // ecx@62 | 1923 unsigned int v30; // ecx@62 |
1924 MapInfo pMap; // [sp-3Ch] [bp-2CCh]@62 | 1924 MapInfo pMap; // [sp-3Ch] [bp-2CCh]@62 |
1925 char pTopicArray[5][100]; // [sp+14h] [bp-27Ch]@37 | 1925 char pTopicArray[5][100]; // [sp+14h] [bp-27Ch]@37 |
1926 GUIWindow travel_window; // [sp+208h] [bp-88h]@1 | 1926 GUIWindow travel_window; // [sp+208h] [bp-88h]@1 |
1927 int pPrimaryTextHeight; // [sp+260h] [bp-30h]@36 | 1927 int pPrimaryTextHeight; // [sp+260h] [bp-30h]@36 |
1928 //unsigned int v60; // [sp+274h] [bp-1Ch]@36 | |
1929 int index; // [sp+27Ch] [bp-14h]@36 | 1928 int index; // [sp+27Ch] [bp-14h]@36 |
1930 //char *a1; // [sp+284h] [bp-Ch]@37 | |
1931 unsigned int pPrice; // [sp+288h] [bp-8h]@1 | 1929 unsigned int pPrice; // [sp+288h] [bp-8h]@1 |
1932 int travel_time; // [sp+28Ch] [bp-4h]@48 | 1930 int travel_time; // [sp+28Ch] [bp-4h]@48 |
1933 enum PlayerSpeech pSpeech; | 1931 enum PlayerSpeech pSpeech; |
1934 unsigned int pCurrentButton; | 1932 unsigned int pCurrentButton; |
1935 | 1933 |
1960 schedule_id = transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][index]; | 1958 schedule_id = transport_routes[(unsigned int)window_SpeakInHouse->ptr_1C - HOUSE_STABLES_HARMONDALE][index]; |
1961 pButton = pDialogueWindow->GetControl(i); | 1959 pButton = pDialogueWindow->GetControl(i); |
1962 | 1960 |
1963 if (schedule_id != 255) | 1961 if (schedule_id != 255) |
1964 { | 1962 { |
1965 if (schedule_id >= 25) | 1963 //if (schedule_id >= 25) |
1966 Log::Warning(L"Transport UI: scedule overflow"); | 1964 //Log::Warning(L"Transport UI: schedule overflow"); |
1967 if ( pCurrentButton >= 6 ) | 1965 if ( pCurrentButton >= 6 ) |
1968 v25 = true; | 1966 v25 = true; |
1969 else | 1967 else |
1970 v25 = transport_schedule[schedule_id].pSchedule[pParty->uDaysPlayed % 7]; | 1968 v25 = transport_schedule[schedule_id].pSchedule[pParty->uDaysPlayed % 7]; |
1971 } | 1969 } |
1972 | 1970 |
1973 if (schedule_id != 255 && v25 && (!transport_schedule[schedule_id].uQuestBit | 1971 if (schedule_id != 255 && v25 && (!transport_schedule[schedule_id].uQuestBit |
1974 || _449B57_test_bit(pParty->_quest_bits, transport_schedule[schedule_id].uQuestBit)) ) | 1972 || _449B57_test_bit(pParty->_quest_bits, transport_schedule[schedule_id].uQuestBit)) ) |
1975 { | 1973 { |
1976 //get color for current string(определение цвета текущей строки)------------ | 1974 //get color for current string(определение цвета текущей строки)---------- |
1977 if ( pDialogueWindow->pCurrentPosActiveItem == pCurrentButton ) | 1975 if ( pDialogueWindow->pCurrentPosActiveItem == pCurrentButton ) |
1978 sprintf(pTopicArray[index], "\f%05d", TargetColor(255, 255, 155)); | 1976 sprintf(pTopicArray[index], "\f%05d", TargetColor(255, 255, 155)); |
1979 else | 1977 else |
1980 sprintf(pTopicArray[index], "\f%05d", TargetColor(255, 255, 255)); | 1978 sprintf(pTopicArray[index], "\f%05d", TargetColor(255, 255, 255)); |
1981 //hired NPC premium(премия наёмного НПС)---------------------------------- | 1979 //hired NPC premium(премия наёмного НПС)---------------------------------- |
2406 unsigned int pNumActiveItem; // esi@18 | 2404 unsigned int pNumActiveItem; // esi@18 |
2407 int v11; // eax@18 | 2405 int v11; // eax@18 |
2408 unsigned int v12; // eax@19 | 2406 unsigned int v12; // eax@19 |
2409 int v13; // eax@21 | 2407 int v13; // eax@21 |
2410 int v14; // ecx@26 | 2408 int v14; // ecx@26 |
2411 //GUIButton *v15; // eax@28 | |
2412 //GUIButton *v16; // esi@28 | |
2413 int v17; // eax@28 | 2409 int v17; // eax@28 |
2414 char *v18; // eax@30 | 2410 char *v18; // eax@30 |
2415 int v19; // eax@30 | 2411 int v19; // eax@30 |
2416 unsigned int v20; // ecx@30 | 2412 unsigned int v20; // ecx@30 |
2417 int v21; // edx@30 | 2413 int v21; // edx@30 |
2421 int v25; // eax@34 | 2417 int v25; // eax@34 |
2422 char *v26; // esi@36 | 2418 char *v26; // esi@36 |
2423 int v27; // edi@46 | 2419 int v27; // edi@46 |
2424 unsigned int pColorText; // eax@57 | 2420 unsigned int pColorText; // eax@57 |
2425 signed int v31; // eax@59 | 2421 signed int v31; // eax@59 |
2426 //GUIWindow *v33; // edi@64 | |
2427 int v34; // eax@64 | 2422 int v34; // eax@64 |
2428 int v35; // ecx@64 | 2423 int v35; // ecx@64 |
2429 int v36; // esi@64 | 2424 int v36; // esi@64 |
2430 char v37; // sf@64 | |
2431 GUIButton *pButton; // eax@65 | 2425 GUIButton *pButton; // eax@65 |
2432 int v39; // edx@69 | 2426 int v39; // edx@69 |
2433 int v40; // ecx@69 | 2427 int v40; // ecx@69 |
2434 int v41; // ecx@69 | 2428 int v41; // ecx@69 |
2435 int v42; // ecx@70 | 2429 int v42; // ecx@70 |
2439 int v46; // ecx@72 | 2433 int v46; // ecx@72 |
2440 int v47; // eax@74 | 2434 int v47; // eax@74 |
2441 signed int v48; // edi@77 | 2435 signed int v48; // edi@77 |
2442 signed int i; // esi@79 | 2436 signed int i; // esi@79 |
2443 int v50; // eax@80 | 2437 int v50; // eax@80 |
2444 //GUIWindow *v51; // ecx@81 | |
2445 _QWORD v52; // qax@81 | 2438 _QWORD v52; // qax@81 |
2446 signed int v53; // edi@81 | 2439 signed int v53; // edi@81 |
2447 int v54; // edi@81 | 2440 int v54; // edi@81 |
2448 //GUIButton *v55; // esi@83 | |
2449 const char **v56; // eax@83 | 2441 const char **v56; // eax@83 |
2450 int v57; // eax@83 | 2442 int v57; // eax@83 |
2451 unsigned int v58; // ecx@83 | 2443 unsigned int v58; // ecx@83 |
2452 //Player *v59; // edx@83 | |
2453 unsigned __int16 v60; // ax@83 | 2444 unsigned __int16 v60; // ax@83 |
2454 int v61; // eax@99 | 2445 int v61; // eax@99 |
2455 char *v63; // eax@99 | 2446 char *v63; // eax@99 |
2456 GUIFont *v64; // edx@99 | 2447 GUIFont *v64; // edx@99 |
2457 GUIFont *v65; // edi@100 | 2448 GUIFont *v65; // edi@100 |
2465 unsigned int v73; // [sp-4h] [bp-278h]@99 | 2456 unsigned int v73; // [sp-4h] [bp-278h]@99 |
2466 char pTopic1[100]; // [sp+Ch] [bp-268h]@55 | 2457 char pTopic1[100]; // [sp+Ch] [bp-268h]@55 |
2467 char pTopic4[100]; // [sp+70h] [bp-204h]@59 | 2458 char pTopic4[100]; // [sp+70h] [bp-204h]@59 |
2468 char pTopic2[100]; // [sp+D4h] [bp-1A0h]@57 | 2459 char pTopic2[100]; // [sp+D4h] [bp-1A0h]@57 |
2469 char pTopic3[100]; // [sp+138h] [bp-13Ch]@59 | 2460 char pTopic3[100]; // [sp+138h] [bp-13Ch]@59 |
2470 //GUIWindow v78; // [sp+19Ch] [bp-D8h]@99 | |
2471 GUIWindow dialog_window; // [sp+1F0h] [bp-84h]@1 | 2461 GUIWindow dialog_window; // [sp+1F0h] [bp-84h]@1 |
2472 char *Str[2]; // [sp+244h] [bp-30h]@30 | 2462 char *Str[2]; // [sp+244h] [bp-30h]@30 |
2473 unsigned int pColorWhite; // [sp+24Ch] [bp-28h]@1 | |
2474 unsigned __int8 pTopic3Height; // [sp+253h] [bp-21h]@59 | 2463 unsigned __int8 pTopic3Height; // [sp+253h] [bp-21h]@59 |
2475 int v83; // [sp+254h] [bp-20h]@1 | 2464 int v83; // [sp+254h] [bp-20h]@1 |
2476 int pColorYellow; // [sp+258h] [bp-1Ch]@1 | |
2477 Player *pPlayer; // [sp+25Ch] [bp-18h]@1 | |
2478 int all_text_height; // [sp+260h] [bp-14h]@18 | 2465 int all_text_height; // [sp+260h] [bp-14h]@18 |
2479 unsigned __int8 v87; // [sp+266h] [bp-Eh]@59 | 2466 unsigned __int8 v87; // [sp+266h] [bp-Eh]@59 |
2480 unsigned __int8 pTopic2Height; // [sp+267h] [bp-Dh]@57 | 2467 unsigned __int8 pTopic2Height; // [sp+267h] [bp-Dh]@57 |
2481 int v89; // [sp+268h] [bp-Ch]@1 | 2468 int v89; // [sp+268h] [bp-Ch]@1 |
2482 unsigned int pTopic1Height; // [sp+26Fh] [bp-5h]@55 | 2469 unsigned int pTopic1Height; // [sp+26Fh] [bp-5h]@55 |
2483 int v91; // [sp+270h] [bp-4h]@3 | 2470 int v91; // [sp+270h] [bp-4h]@3 |
2484 GUIFont *pOutString; | 2471 GUIFont *pOutString; |
2485 unsigned __int8 pTopic4Height; | 2472 unsigned __int8 pTopic4Height; |
2486 int pTextHeight; | 2473 int pTextHeight; |
2487 | 2474 |
2488 pPlayer = pPlayers[uActiveCharacter]; | |
2489 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window)); | 2475 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window)); |
2490 dialog_window.uFrameX = 483; | 2476 dialog_window.uFrameX = 483; |
2491 dialog_window.uFrameWidth = 148; | 2477 dialog_window.uFrameWidth = 148; |
2492 dialog_window.uFrameZ = 334; | 2478 dialog_window.uFrameZ = 334; |
2493 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu); | |
2494 pColorYellow = TargetColor(0xFFu, 0xFFu, 0x9Bu); | |
2495 v2 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier; | 2479 v2 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier; |
2496 *(float *)&v83 = v2; | 2480 *(float *)&v83 = v2; |
2497 *(float *)&v89 = v2 * v2; | 2481 *(float *)&v89 = v2 * v2; |
2498 v3 = (signed __int64)(*(float *)&v89 * 0.1); | 2482 v3 = (signed __int64)(*(float *)&v89 * 0.1); |
2499 pItemNum = v3 * (100 - pPlayer->GetMerchant()) / 100; | 2483 pItemNum = v3 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100; |
2500 if ( pItemNum < v3 / 3 ) | 2484 if ( pItemNum < v3 / 3 ) |
2501 pItemNum = v3 / 3; | 2485 pItemNum = v3 / 3; |
2502 v5 = 1; | 2486 v5 = 1; |
2503 pOutString = (GUIFont *)pItemNum; | 2487 pOutString = (GUIFont *)pItemNum; |
2504 if ( pItemNum <= 0 ) | 2488 if ( pItemNum <= 0 ) |
2505 pOutString = (GUIFont *)1; | 2489 pOutString = (GUIFont *)1; |
2506 v6 = (signed __int64)(*(float *)&v89 * *(float *)&v83 * 0.0099999998); | 2490 v6 = (signed __int64)(*(float *)&v89 * *(float *)&v83 * 0.0099999998); |
2507 v7 = v6 * (100 - pPlayer->GetMerchant()) / 100; | 2491 v7 = v6 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100; |
2508 if ( v7 < v6 / 3 ) | 2492 if ( v7 < v6 / 3 ) |
2509 v7 = v6 / 3; | 2493 v7 = v6 / 3; |
2510 v83 = v7; | 2494 v83 = v7; |
2511 if ( v7 <= 0 ) | 2495 if ( v7 <= 0 ) |
2512 { | 2496 { |
2519 case HOUSE_DIALOGUE_MAIN: | 2503 case HOUSE_DIALOGUE_MAIN: |
2520 { | 2504 { |
2521 if ( !HouseUI_CheckIfPlayerCanInteract() ) | 2505 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
2522 return; | 2506 return; |
2523 | 2507 |
2524 sprintf(pTopic1, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 2 ? pColorYellow : pColorWhite); | 2508 sprintf(pTopic1, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 2 ? TargetColor(0xFFu, 0xFFu, 0x9Bu) : TargetColor(0xFFu, 0xFFu, 0xFFu)); |
2525 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[178], pOutString); // Rent room for %d gold | 2509 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[178], pOutString); // Rent room for %d gold |
2526 strcat(pTopic1, pTmpBuf2.data()); | 2510 strcat(pTopic1, pTmpBuf2.data()); |
2527 pTopic1Height = pFontArrus->CalcTextHeight(pTopic1, &dialog_window, 0, 0); | 2511 pTopic1Height = pFontArrus->CalcTextHeight(pTopic1, &dialog_window, 0, 0); |
2528 strcat(pTopic1, "\n \n"); | 2512 strcat(pTopic1, "\n \n"); |
2529 | 2513 |
2530 sprintf(pTopic2, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 3 ? pColorYellow : pColorWhite); | 2514 sprintf(pTopic2, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 3 ? TargetColor(0xFFu, 0xFFu, 0x9Bu) : TargetColor(0xFFu, 0xFFu, 0xFFu)); |
2531 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[86], // Buy food for %d days for %d gold | 2515 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[86], // Buy food for %d days for %d gold |
2532 (unsigned int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier, v83); | 2516 (unsigned int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier, v83); |
2533 strcat(pTopic2, pTmpBuf2.data()); | 2517 strcat(pTopic2, pTmpBuf2.data()); |
2534 pTopic2Height = pFontArrus->CalcTextHeight(pTopic2, &dialog_window, 0, 0); | 2518 pTopic2Height = pFontArrus->CalcTextHeight(pTopic2, &dialog_window, 0, 0); |
2535 strcat(pTopic2, "\n \n"); | 2519 strcat(pTopic2, "\n \n"); |
2536 | 2520 |
2537 sprintf(pTopic3, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 4 ? pColorYellow : pColorWhite); | 2521 sprintf(pTopic3, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 4 ? TargetColor(0xFFu, 0xFFu, 0x9Bu) : TargetColor(0xFFu, 0xFFu, 0xFFu)); |
2538 strcat(pTopic3, pGlobalTXT_LocalizationStrings[160]); // Learn Skills | 2522 strcat(pTopic3, pGlobalTXT_LocalizationStrings[160]); // Learn Skills |
2539 pTopic3Height = pFontArrus->CalcTextHeight(pTopic3, &dialog_window, 0, 0); | 2523 pTopic3Height = pFontArrus->CalcTextHeight(pTopic3, &dialog_window, 0, 0); |
2540 strcat(pTopic3, "\n \n"); | 2524 strcat(pTopic3, "\n \n"); |
2541 pTopic4[0] = 0; | 2525 pTopic4[0] = 0; |
2542 if ( (signed int)window_SpeakInHouse->par1C >= 108 && (signed int)window_SpeakInHouse->par1C <= 120 ) | 2526 if ( (signed int)window_SpeakInHouse->par1C >= 108 && (signed int)window_SpeakInHouse->par1C <= 120 ) |
2543 { | 2527 { |
2544 sprintf(pTopic4, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 5 ? pColorYellow : pColorWhite); | 2528 sprintf(pTopic4, "\f%05d", pDialogueWindow->pCurrentPosActiveItem == 5 ? TargetColor(0xFFu, 0xFFu, 0x9Bu) : TargetColor(0xFFu, 0xFFu, 0xFFu)); |
2545 strcat(pTopic4, pGlobalTXT_LocalizationStrings[611]); // Play Arcomage | 2529 strcat(pTopic4, pGlobalTXT_LocalizationStrings[611]); // Play Arcomage |
2546 pTopic4Height = pFontArrus->CalcTextHeight(pTopic4, &dialog_window, 0, 0); | 2530 pTopic4Height = pFontArrus->CalcTextHeight(pTopic4, &dialog_window, 0, 0); |
2547 } | 2531 } |
2548 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem; | 2532 |
2549 v36 = LOBYTE(pFontArrus->uFontHeight) - 3; | 2533 v36 = LOBYTE(pFontArrus->uFontHeight) - 3; |
2550 v37 = -pDialogueWindow->pNumPresenceButton < 0; | 2534 if ( pDialogueWindow->pNumPresenceButton ) |
2551 if ( !(v37 ^ (pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton)) ) | 2535 { |
2552 { | 2536 for ( pNumActiveItem = pDialogueWindow->pStartingPosActiveItem; |
2553 do | 2537 pNumActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; ++pNumActiveItem ) |
2554 { | 2538 { |
2555 pButton = pDialogueWindow->GetControl(pNumActiveItem); | 2539 pButton = pDialogueWindow->GetControl(pNumActiveItem); |
2556 if ( pButton->msg_param == 15 ) | 2540 if ( pButton->msg_param == 15 ) |
2557 { | 2541 { |
2558 v46 = pTopic1Height; | 2542 v46 = pTopic1Height; |
2586 pButton->uHeight = pTopic4Height; | 2570 pButton->uHeight = pTopic4Height; |
2587 pButton->uY = v39; | 2571 pButton->uY = v39; |
2588 v41 = v39 + v40 - 1; | 2572 v41 = v39 + v40 - 1; |
2589 pButton->uW = v41; | 2573 pButton->uW = v41; |
2590 } | 2574 } |
2591 pNumActiveItem++; | 2575 } |
2592 if ( pNumActiveItem >= pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ) | 2576 sprintfex(pTmpBuf.data(), "%s%s%s%s", pTopic1, pTopic2, pTopic3, pTopic4); |
2593 { | 2577 dialog_window.DrawTitleText(pFontArrus, 0, 146, 0, pTmpBuf.data(), 3); |
2594 sprintfex(pTmpBuf.data(), "%s%s%s%s", pTopic1, pTopic2, pTopic3, pTopic4); | |
2595 dialog_window.DrawTitleText(pFontArrus, 0, 146, 0, pTmpBuf.data(), 3); | |
2596 } | |
2597 } | |
2598 while ( pNumActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton ); | |
2599 } | 2578 } |
2600 break; | 2579 break; |
2601 } | 2580 } |
2602 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES: | 2581 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES: |
2603 { | 2582 { |
2647 { | 2626 { |
2648 v72 = pGlobalTXT_LocalizationStrings[639];// A tie! | 2627 v72 = pGlobalTXT_LocalizationStrings[639];// A tie! |
2649 } | 2628 } |
2650 strcpy(pTmpBuf.data(), v72); | 2629 strcpy(pTmpBuf.data(), v72); |
2651 v66 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138; | 2630 v66 = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138; |
2652 dialog_window.DrawTitleText(pFontArrus, 0, v66, pColorYellow, pTmpBuf.data(), 3); | 2631 dialog_window.DrawTitleText(pFontArrus, 0, v66, TargetColor(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3); |
2653 break; | 2632 break; |
2654 } | 2633 } |
2655 case HOUSE_DIALOGUE_TAVERN_REST: | 2634 case HOUSE_DIALOGUE_TAVERN_REST: |
2656 { | 2635 { |
2657 if ( pParty->uNumGold >= (unsigned int)pOutString ) | 2636 if ( pParty->uNumGold >= (unsigned int)pOutString ) |
2683 { | 2662 { |
2684 if ( !HouseUI_CheckIfPlayerCanInteract() ) | 2663 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
2685 return; | 2664 return; |
2686 v0 = 0; | 2665 v0 = 0; |
2687 v9 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); | 2666 v9 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); |
2688 pItemNum = v9 * (100 - pPlayer->GetMerchant()) / 100; | 2667 pItemNum = v9 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100; |
2689 if ( pItemNum < v9 / 3 ) | 2668 if ( pItemNum < v9 / 3 ) |
2690 pItemNum = v9 / 3; | 2669 pItemNum = v9 / 3; |
2691 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem; | 2670 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem; |
2692 all_text_height = 0; | 2671 all_text_height = 0; |
2693 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton ) | 2672 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton ) |
2694 { | 2673 { |
2695 do | 2674 do |
2696 { | 2675 { |
2697 v12 = pDialogueWindow->GetControl(pNumActiveItem)->msg_param - 36; | 2676 v12 = pDialogueWindow->GetControl(pNumActiveItem)->msg_param - 36; |
2698 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v12] && !pPlayer->pActiveSkills[v12] ) | 2677 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v12] |
2678 && !pPlayers[uActiveCharacter]->pActiveSkills[v12] ) | |
2699 { | 2679 { |
2700 all_text_height = pFontArrus->CalcTextHeight(pSkillNames[v12], &dialog_window, 0, 0); | 2680 all_text_height = pFontArrus->CalcTextHeight(pSkillNames[v12], &dialog_window, 0, 0); |
2701 v0++; | 2681 v0++; |
2702 } | 2682 } |
2703 ++pNumActiveItem; | 2683 ++pNumActiveItem; |
2717 pItemNum = 2; | 2697 pItemNum = 2; |
2718 do | 2698 do |
2719 { | 2699 { |
2720 pButton = pDialogueWindow->GetControl(pItemNum); | 2700 pButton = pDialogueWindow->GetControl(pItemNum); |
2721 v17 = pButton->msg_param - 36; | 2701 v17 = pButton->msg_param - 36; |
2722 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayer->classType][v17] || pPlayer->pActiveSkills[v17] ) | 2702 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][v17] |
2703 || pPlayers[uActiveCharacter]->pActiveSkills[v17] ) | |
2723 { | 2704 { |
2724 pButton->uW = 0; | 2705 pButton->uW = 0; |
2725 pButton->uHeight = 0; | 2706 pButton->uHeight = 0; |
2726 pButton->uY = 0; | 2707 pButton->uY = 0; |
2727 } | 2708 } |
2730 pButton->uY = v91 + v14; | 2711 pButton->uY = v91 + v14; |
2731 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v17], &dialog_window, 0, 0); | 2712 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[v17], &dialog_window, 0, 0); |
2732 pButton->uHeight = pTextHeight; | 2713 pButton->uHeight = pTextHeight; |
2733 v14 = pTextHeight + pButton->uY - 1; | 2714 v14 = pTextHeight + pButton->uY - 1; |
2734 pButton->uW = v14; | 2715 pButton->uW = v14; |
2735 pColorText = pColorYellow; | 2716 pColorText = TargetColor(0xFFu, 0xFFu, 0x9Bu); |
2736 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum ) | 2717 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum ) |
2737 pColorText = pColorWhite; | 2718 pColorText = TargetColor(0xFFu, 0xFFu, 0xFFu); |
2738 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v17], 3); | 2719 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[v17], 3); |
2739 } | 2720 } |
2740 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; | 2721 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; |
2741 pItemNum++; | 2722 pItemNum++; |
2742 } | 2723 } |
2743 while ( pItemNum < pNumActiveItem ); | 2724 while ( pItemNum < pNumActiveItem ); |
2744 } | 2725 } |
2745 return; | 2726 return; |
2746 } | 2727 } |
2747 } | 2728 } |
2748 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayer->pName, pClassNames[pPlayer->classType]); | 2729 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, |
2730 pClassNames[pPlayers[uActiveCharacter]->classType]); | |
2749 strcat(pTmpBuf.data(), "\n \n"); | 2731 strcat(pTmpBuf.data(), "\n \n"); |
2750 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]); | 2732 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]); |
2751 pTextHeight = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138; | 2733 pTextHeight = (174 - pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 0, 0)) / 2 + 138; |
2752 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, pColorYellow, pTmpBuf.data(), 3); | 2734 dialog_window.DrawTitleText(pFontArrus, 0, pTextHeight, TargetColor(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3); |
2753 return; | 2735 return; |
2754 } | 2736 } |
2755 | 2737 |
2756 case HOUSE_DIALOGUE_TAVERN_BUY_FOOD: | 2738 case HOUSE_DIALOGUE_TAVERN_BUY_FOOD: |
2757 { | 2739 { |
2796 for ( i = 0; i < v48; ++i ) | 2778 for ( i = 0; i < v48; ++i ) |
2797 all_text_height = pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 2779 all_text_height = pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
2798 all_text_height = (174 - all_text_height) / v48; | 2780 all_text_height = (174 - all_text_height) / v48; |
2799 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem; | 2781 pNumActiveItem = pDialogueWindow->pStartingPosActiveItem; |
2800 v54 = (174 - v48 * (174 - all_text_height) / v48 - all_text_height) / 2 - (174 - all_text_height) / v48 / 2 + 138; | 2782 v54 = (174 - v48 * (174 - all_text_height) / v48 - all_text_height) / 2 - (174 - all_text_height) / v48 / 2 + 138; |
2801 v37 = -pDialogueWindow->pNumPresenceButton < 0; | 2783 //v37 = -pDialogueWindow->pNumPresenceButton < 0; |
2802 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton ) | 2784 if ( pNumActiveItem < pNumActiveItem + pDialogueWindow->pNumPresenceButton ) |
2803 { | 2785 { |
2804 pItemNum = 2; | 2786 pItemNum = 2; |
2805 pNumString = 0; | 2787 pNumString = 0; |
2806 do | 2788 do |
2809 pButton->uY = all_text_height + v54; | 2791 pButton->uY = all_text_height + v54; |
2810 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0); | 2792 pTextHeight = pFontArrus->CalcTextHeight((const char *)pShopOptions[pNumString], &dialog_window, 0, 0); |
2811 pButton->uHeight = pTextHeight; | 2793 pButton->uHeight = pTextHeight; |
2812 v54 = pButton->uY + pTextHeight - 1; | 2794 v54 = pButton->uY + pTextHeight - 1; |
2813 pButton->uW = v54; | 2795 pButton->uW = v54; |
2814 pColorText = pColorYellow; | 2796 pColorText = TargetColor(0xFFu, 0xFFu, 0x9Bu); |
2815 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum ) | 2797 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum ) |
2816 pColorText = pColorWhite; | 2798 pColorText = TargetColor(0xFFu, 0xFFu, 0xFFu); |
2817 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3); | 2799 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, (const char *)pShopOptions[pNumString], 3); |
2818 pItemNum++; | 2800 pItemNum++; |
2819 ++pNumString; | 2801 ++pNumString; |
2820 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; | 2802 pNumActiveItem = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; |
2821 } | 2803 } |
3809 unsigned int v36; // edi@51 | 3791 unsigned int v36; // edi@51 |
3810 GUIButton *v37; // eax@52 | 3792 GUIButton *v37; // eax@52 |
3811 int v38; // eax@52 | 3793 int v38; // eax@52 |
3812 signed int v39; // ecx@54 | 3794 signed int v39; // ecx@54 |
3813 int v40; // edi@57 | 3795 int v40; // edi@57 |
3814 //GUIButton *v41; // eax@60 | |
3815 //GUIButton *v42; // esi@60 | |
3816 const char *v43; // ebx@60 | 3796 const char *v43; // ebx@60 |
3817 int v44; // eax@60 | 3797 int v44; // eax@60 |
3818 unsigned int v45; // ecx@60 | 3798 unsigned int v45; // ecx@60 |
3819 unsigned __int16 v46; // ax@60 | 3799 unsigned __int16 v46; // ax@60 |
3820 GUIFont *v47; // ebx@64 | 3800 GUIFont *v47; // ebx@64 |