Mercurial > mm7
comparison UIHouses.cpp @ 949:c0d0656aa662
Awards
author | Nomad |
---|---|
date | Wed, 01 May 2013 20:04:24 +0200 |
parents | 5a2dbb00c399 |
children | e9292c58644a |
comparison
equal
deleted
inserted
replaced
948:5a2dbb00c399 | 949:c0d0656aa662 |
---|---|
619 v0 = pGlobalTXT_LocalizationStrings[672]; | 619 v0 = pGlobalTXT_LocalizationStrings[672]; |
620 v1 = pGlobalTXT_LocalizationStrings[672]; | 620 v1 = pGlobalTXT_LocalizationStrings[672]; |
621 v5.uFrameX = 483; | 621 v5.uFrameX = 483; |
622 v5.uFrameWidth = 148; | 622 v5.uFrameWidth = 148; |
623 v5.uFrameZ = 334; | 623 v5.uFrameZ = 334; |
624 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | 624 v2 = TargetColor(0xFFu, 0xFFu, 0x9Bu); |
625 v3 = pFontArrus->CalcTextHeight(v0, &v5, 0, 0); | 625 v3 = pFontArrus->CalcTextHeight(v0, &v5, 0, 0); |
626 v5.DrawTitleText(pFontArrus, 0, (310 - v3) / 2 + 18, v2, v1, 3u); | 626 v5.DrawTitleText(pFontArrus, 0, (310 - v3) / 2 + 18, v2, v1, 3u); |
627 } | 627 } |
628 | 628 |
629 | 629 |
1731 //v61 = pPlayers[uActiveCharacter]; | 1731 //v61 = pPlayers[uActiveCharacter]; |
1732 v1 = pPlayers[uActiveCharacter]; | 1732 v1 = pPlayers[uActiveCharacter]; |
1733 v53.uFrameX = 483; | 1733 v53.uFrameX = 483; |
1734 v53.uFrameWidth = 148; | 1734 v53.uFrameWidth = 148; |
1735 v53.uFrameZ = 334; | 1735 v53.uFrameZ = 334; |
1736 auto color_default = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 255); | 1736 auto color_default = TargetColor(255, 255, 255); |
1737 auto color_selected = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 155); | 1737 auto color_selected = TargetColor(255, 255, 155); |
1738 v3 = 52 * (unsigned int)v0->ptr_1C; | 1738 v3 = 52 * (unsigned int)v0->ptr_1C; |
1739 //v59 = (GUIWindow *)((((p2DEvents_minus1___00[v3 / 2] != 27) - 1) & 0xFFFFFFE7) + 50); | 1739 //v59 = (GUIWindow *)((((p2DEvents_minus1___00[v3 / 2] != 27) - 1) & 0xFFFFFFE7) + 50); |
1740 //v59 = (GUIWindow *)((((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != BildingType_Stables) - 1) & 0xFFFFFFE7) + 50); | 1740 //v59 = (GUIWindow *)((((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != BildingType_Stables) - 1) & 0xFFFFFFE7) + 50); |
1741 //v4 = (signed __int64)((double)(signed int)v59 * p2DEvents_minus1__20[v3 / 4]); | 1741 //v4 = (signed __int64)((double)(signed int)v59 * p2DEvents_minus1__20[v3 / 4]); |
1742 | 1742 |
2029 | 2029 |
2030 memcpy(&_this, window_SpeakInHouse, sizeof(_this)); | 2030 memcpy(&_this, window_SpeakInHouse, sizeof(_this)); |
2031 _this.uFrameX = 483; | 2031 _this.uFrameX = 483; |
2032 _this.uFrameWidth = 148; | 2032 _this.uFrameWidth = 148; |
2033 _this.uFrameZ = 334; | 2033 _this.uFrameZ = 334; |
2034 v28 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 2034 v28 = TargetColor(0xFFu, 0xFFu, 0xFFu); |
2035 v30 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | 2035 v30 = TargetColor(0xFFu, 0xFFu, 0x9Bu); |
2036 sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine); | 2036 sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[605], pParty->uFine); |
2037 _this.DrawTitleText(pFontArrus, 0, 0x104u, v30, pTmpBuf, 3u); | 2037 _this.DrawTitleText(pFontArrus, 0, 0x104u, v30, pTmpBuf, 3u); |
2038 switch(dialog_menu_id) | 2038 switch(dialog_menu_id) |
2039 { | 2039 { |
2040 case HOUSE_DIALOGUE_MAIN: | 2040 case HOUSE_DIALOGUE_MAIN: |
2090 } | 2090 } |
2091 | 2091 |
2092 case HOUSE_DIALOGUE_TOWNHALL_99: | 2092 case HOUSE_DIALOGUE_TOWNHALL_99: |
2093 { | 2093 { |
2094 v5 = &pMonsterStats->pInfos[word_F8B1A0]; | 2094 v5 = &pMonsterStats->pInfos[word_F8B1A0]; |
2095 v6 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 2095 v6 = TargetColor(0xFFu, 0xFFu, 0xFFu); |
2096 v7 = v5->pName; | 2096 v7 = v5->pName; |
2097 v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | 2097 v8 = TargetColor(0xFFu, 0xFFu, 0x9Bu); |
2098 sprintf(pTmpBuf, &byte_4F0F98, v8, v7, v6); | 2098 sprintf(pTmpBuf, &byte_4F0F98, v8, v7, v6); |
2099 sprintf(pTmpBuf2, dword_F8B1A4, pTmpBuf, 100 * v5->uLevel); | 2099 sprintf(pTmpBuf2, dword_F8B1A4, pTmpBuf, 100 * v5->uLevel); |
2100 current_npc_text = pTmpBuf2; | 2100 current_npc_text = pTmpBuf2; |
2101 memcpy(&a1, pDialogueWindow, sizeof(a1)); | 2101 memcpy(&a1, pDialogueWindow, sizeof(a1)); |
2102 w.uFrameWidth = 458; | 2102 w.uFrameWidth = 458; |
2199 | 2199 |
2200 memcpy(&_this, window_SpeakInHouse, sizeof(_this)); | 2200 memcpy(&_this, window_SpeakInHouse, sizeof(_this)); |
2201 _this.uFrameX = 483; | 2201 _this.uFrameX = 483; |
2202 _this.uFrameWidth = 148; | 2202 _this.uFrameWidth = 148; |
2203 _this.uFrameZ = 334; | 2203 _this.uFrameZ = 334; |
2204 *(int *)v13 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 2204 *(int *)v13 = TargetColor(0xFFu, 0xFFu, 0xFFu); |
2205 *(int *)v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | 2205 *(int *)v14 = TargetColor(0xFFu, 0xFFu, 0x9Bu); |
2206 sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank); | 2206 sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank); |
2207 _this.DrawTitleText(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf, 3u); | 2207 _this.DrawTitleText(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf, 3u); |
2208 switch(dialog_menu_id) | 2208 switch(dialog_menu_id) |
2209 { | 2209 { |
2210 case HOUSE_DIALOGUE_MAIN: | 2210 case HOUSE_DIALOGUE_MAIN: |
2427 pPlayer = pPlayers[uActiveCharacter]; | 2427 pPlayer = pPlayers[uActiveCharacter]; |
2428 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window)); | 2428 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window)); |
2429 dialog_window.uFrameX = 483; | 2429 dialog_window.uFrameX = 483; |
2430 dialog_window.uFrameWidth = 148; | 2430 dialog_window.uFrameWidth = 148; |
2431 dialog_window.uFrameZ = 334; | 2431 dialog_window.uFrameZ = 334; |
2432 pColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 2432 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu); |
2433 pColorYellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | 2433 pColorYellow = TargetColor(0xFFu, 0xFFu, 0x9Bu); |
2434 v2 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier; | 2434 v2 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier; |
2435 *(float *)&v83 = v2; | 2435 *(float *)&v83 = v2; |
2436 *(float *)&v89 = v2 * v2; | 2436 *(float *)&v89 = v2 * v2; |
2437 v3 = (signed __int64)(*(float *)&v89 * 0.1); | 2437 v3 = (signed __int64)(*(float *)&v89 * 0.1); |
2438 pItemNum = v3 * (100 - pPlayer->GetMerchant()) / 100; | 2438 pItemNum = v3 * (100 - pPlayer->GetMerchant()) / 100; |
2876 pPlayer = pPlayers[uActiveCharacter]; | 2876 pPlayer = pPlayers[uActiveCharacter]; |
2877 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window)); | 2877 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window)); |
2878 dialog_window.uFrameX = 483; | 2878 dialog_window.uFrameX = 483; |
2879 dialog_window.uFrameWidth = 148; | 2879 dialog_window.uFrameWidth = 148; |
2880 dialog_window.uFrameZ = 334; | 2880 dialog_window.uFrameZ = 334; |
2881 pColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 2881 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu); |
2882 pColorYellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); | 2882 pColorYellow = TargetColor(0xE1u, 0xCDu, 0x23u); |
2883 | 2883 |
2884 switch(dialog_menu_id) | 2884 switch(dialog_menu_id) |
2885 { | 2885 { |
2886 case HOUSE_DIALOGUE_MAIN: | 2886 case HOUSE_DIALOGUE_MAIN: |
2887 { | 2887 { |
3407 pPlayer = pPlayers[uActiveCharacter]; | 3407 pPlayer = pPlayers[uActiveCharacter]; |
3408 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window)); | 3408 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window)); |
3409 dialog_window.uFrameX = 483; | 3409 dialog_window.uFrameX = 483; |
3410 dialog_window.uFrameWidth = 148; | 3410 dialog_window.uFrameWidth = 148; |
3411 dialog_window.uFrameZ = 334; | 3411 dialog_window.uFrameZ = 334; |
3412 pColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 3412 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu); |
3413 pColorYellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); | 3413 pColorYellow = TargetColor(0xE1u, 0xCDu, 0x23u); |
3414 switch(dialog_menu_id) | 3414 switch(dialog_menu_id) |
3415 { | 3415 { |
3416 case HOUSE_DIALOGUE_MAIN: | 3416 case HOUSE_DIALOGUE_MAIN: |
3417 { | 3417 { |
3418 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 3418 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
3996 | 3996 |
3997 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window)); | 3997 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window)); |
3998 dialog_window.uFrameX = 483; | 3998 dialog_window.uFrameX = 483; |
3999 dialog_window.uFrameWidth = 148; | 3999 dialog_window.uFrameWidth = 148; |
4000 dialog_window.uFrameZ = 334; | 4000 dialog_window.uFrameZ = 334; |
4001 pWhiteColor = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 4001 pWhiteColor = TargetColor(0xFFu, 0xFFu, 0xFFu); |
4002 pYellowColor = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); | 4002 pYellowColor = TargetColor(0xE1u, 0xCDu, 0x23u); |
4003 switch (dialog_menu_id) | 4003 switch (dialog_menu_id) |
4004 { | 4004 { |
4005 case HOUSE_DIALOGUE_MAIN: | 4005 case HOUSE_DIALOGUE_MAIN: |
4006 { | 4006 { |
4007 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 4007 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
4494 | 4494 |
4495 memcpy(&working_window, window_SpeakInHouse, sizeof(GUIWindow)); | 4495 memcpy(&working_window, window_SpeakInHouse, sizeof(GUIWindow)); |
4496 working_window.uFrameX = 483; | 4496 working_window.uFrameX = 483; |
4497 working_window.uFrameWidth = 148; | 4497 working_window.uFrameWidth = 148; |
4498 working_window.uFrameZ = 334; | 4498 working_window.uFrameZ = 334; |
4499 pColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 4499 pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu); |
4500 pColorYellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | 4500 pColorYellow = TargetColor(0xFFu, 0xFFu, 0x9Bu); |
4501 base_teach_price = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier * 500.0); | 4501 base_teach_price = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier * 500.0); |
4502 v63 = base_teach_price * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100; | 4502 v63 = base_teach_price * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100; |
4503 if ( v63 < base_teach_price / 3 ) | 4503 if ( v63 < base_teach_price / 3 ) |
4504 v63 = base_teach_price / 3; | 4504 v63 = base_teach_price / 3; |
4505 strcpy(Dest, ""); | 4505 strcpy(Dest, ""); |
4797 v0 = window_SpeakInHouse; | 4797 v0 = window_SpeakInHouse; |
4798 memcpy(&v57, window_SpeakInHouse, sizeof(v57)); | 4798 memcpy(&v57, window_SpeakInHouse, sizeof(v57)); |
4799 v57.uFrameX = 483; | 4799 v57.uFrameX = 483; |
4800 v57.uFrameWidth = 148; | 4800 v57.uFrameWidth = 148; |
4801 v57.uFrameZ = 334; | 4801 v57.uFrameZ = 334; |
4802 HIDWORD(v58) = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 4802 HIDWORD(v58) = TargetColor(0xFFu, 0xFFu, 0xFFu); |
4803 HIDWORD(v59) = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | 4803 HIDWORD(v59) = TargetColor(0xFFu, 0xFFu, 0x9Bu); |
4804 v1 = pPlayers[uActiveCharacter]; | 4804 v1 = pPlayers[uActiveCharacter]; |
4805 //v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C]); | 4805 //v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C]); |
4806 v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier); | 4806 v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier); |
4807 HIDWORD(v60) = v2; | 4807 HIDWORD(v60) = v2; |
4808 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN ) | 4808 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN ) |
5188 //v0 = pPlayers[uActiveCharacter]; | 5188 //v0 = pPlayers[uActiveCharacter]; |
5189 memcpy(&v65, window_SpeakInHouse, sizeof(v65)); | 5189 memcpy(&v65, window_SpeakInHouse, sizeof(v65)); |
5190 v65.uFrameX = 483; | 5190 v65.uFrameX = 483; |
5191 v65.uFrameWidth = 148; | 5191 v65.uFrameWidth = 148; |
5192 v65.uFrameZ = 334; | 5192 v65.uFrameZ = 334; |
5193 white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 255); | 5193 white = TargetColor(255, 255, 255); |
5194 color2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); | 5194 color2 = TargetColor(0xE1u, 0xCDu, 0x23u); |
5195 //v71 = color2; | 5195 //v71 = color2; |
5196 //v2 = v0->uLevel; | 5196 //v2 = v0->uLevel; |
5197 //v3 = 0; | 5197 //v3 = 0; |
5198 //v4 = 0; | 5198 //v4 = 0; |
5199 //for ( i = v2; v4 < (signed int)v2; ++v4 ) | 5199 //for ( i = v2; v4 < (signed int)v2; ++v4 ) |
5598 | 5598 |
5599 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window)); | 5599 memcpy(&dialog_window, window_SpeakInHouse, sizeof(dialog_window)); |
5600 dialog_window.uFrameX = 483; | 5600 dialog_window.uFrameX = 483; |
5601 dialog_window.uFrameWidth = 148; | 5601 dialog_window.uFrameWidth = 148; |
5602 dialog_window.uFrameZ = 334; | 5602 dialog_window.uFrameZ = 334; |
5603 pWhiteColor = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 255); | 5603 pWhiteColor = TargetColor(255, 255, 255); |
5604 pYellowColor = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(225, 205, 35); | 5604 pYellowColor = TargetColor(225, 205, 35); |
5605 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN) | 5605 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN) |
5606 { | 5606 { |
5607 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 5607 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
5608 return; | 5608 return; |
5609 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" | 5609 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" |