Mercurial > mm7
comparison UI/UIShops.cpp @ 1838:211dfe2d8db1
changing global char* vars to const char* vars
author | Grumpy7 |
---|---|
date | Fri, 11 Oct 2013 09:19:40 +0200 |
parents | 0c75c3e7e436 |
children | 2e6d3cd052e0 |
comparison
equal
deleted
inserted
replaced
1829:e4e27261d84e | 1838:211dfe2d8db1 |
---|---|
42 { | 42 { |
43 case HOUSE_DIALOGUE_MAIN: | 43 case HOUSE_DIALOGUE_MAIN: |
44 { | 44 { |
45 if ( HouseUI_CheckIfPlayerCanInteract() ) | 45 if ( HouseUI_CheckIfPlayerCanInteract() ) |
46 { | 46 { |
47 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; | 47 pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[134]; |
48 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; | 48 pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[152]; |
49 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; | 49 pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[159]; |
50 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; | 50 pShopOptions[3] = (char *)pGlobalTXT_LocalizationStrings[160]; |
51 all_text_height = 0; | 51 all_text_height = 0; |
52 for ( int i = 0; i < 4; ++i ) | 52 for ( int i = 0; i < 4; ++i ) |
53 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 53 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
54 v103 = (174 - all_text_height) / 4; | 54 v103 = (174 - all_text_height) / 4; |
55 v19 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138; | 55 v19 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138; |
245 | 245 |
246 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT: | 246 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT: |
247 { | 247 { |
248 draw_leather(); | 248 draw_leather(); |
249 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 249 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
250 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];//sell | 250 pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[200];//sell |
251 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];//identify | 251 pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[113];//identify |
252 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];//repair | 252 pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[179];//repair |
253 all_text_height = 0; | 253 all_text_height = 0; |
254 for ( int i = 0; i < 3; ++i ) | 254 for ( int i = 0; i < 3; ++i ) |
255 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 255 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
256 v103 = (174 - all_text_height) / 3; | 256 v103 = (174 - all_text_height) / 3; |
257 v19 = (3 * (58 - (signed int)v103) - all_text_height) / 2 - ((174 - all_text_height) / 3) / 2 + 138; | 257 v19 = (3 * (58 - (signed int)v103) - all_text_height) / 2 - ((174 - all_text_height) / 3) / 2 + 138; |
367 { | 367 { |
368 case HOUSE_DIALOGUE_MAIN: | 368 case HOUSE_DIALOGUE_MAIN: |
369 { | 369 { |
370 if ( !HouseUI_CheckIfPlayerCanInteract() ) | 370 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
371 return; | 371 return; |
372 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" | 372 pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" |
373 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special" | 373 pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[152]; //"Buy Special" |
374 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; //"Display Inventory" | 374 pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[159]; //"Display Inventory" |
375 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; | 375 pShopOptions[3] = (char *)pGlobalTXT_LocalizationStrings[160]; |
376 all_text_height = 0; | 376 all_text_height = 0; |
377 for( int i = 0; i < 4; ++i ) | 377 for( int i = 0; i < 4; ++i ) |
378 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 378 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
379 v146 = ( 174 - all_text_height ) / 4; | 379 v146 = ( 174 - all_text_height ) / 4; |
380 v23 = ( 174 - 4 * ( 174 - all_text_height ) / 4 - all_text_height ) / 2 - ( 174 - all_text_height ) / 4 / 2 + 138; | 380 v23 = ( 174 - 4 * ( 174 - all_text_height ) / 4 - all_text_height ) / 2 - ( 174 - all_text_height ) / 4 / 2 + 138; |
520 | 520 |
521 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT: | 521 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT: |
522 { | 522 { |
523 draw_leather(); | 523 draw_leather(); |
524 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 524 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
525 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200]; //"Sell" | 525 pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[200]; //"Sell" |
526 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113]; //"Identify" | 526 pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[113]; //"Identify" |
527 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179]; //"Repair" | 527 pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[179]; //"Repair" |
528 all_text_height = 0; | 528 all_text_height = 0; |
529 for ( int i = 0; i < 3; ++i ) | 529 for ( int i = 0; i < 3; ++i ) |
530 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 530 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
531 v146 = (174 - all_text_height) / 3; | 531 v146 = (174 - all_text_height) / 3; |
532 v23 = (3 * (58 - v146) - all_text_height) / 2 - v146 / 2 + 138; | 532 v23 = (3 * (58 - v146) - all_text_height) / 2 - v146 / 2 + 138; |
686 void AlchemistDialog() | 686 void AlchemistDialog() |
687 { | 687 { |
688 int index; // eax@7 | 688 int index; // eax@7 |
689 signed int v5; // esi@9 | 689 signed int v5; // esi@9 |
690 int v18; // eax@23 | 690 int v18; // eax@23 |
691 char *pText; // edx@29 | 691 const char *pText; // edx@29 |
692 unsigned int product_height_1row; // edi@55 | 692 unsigned int product_height_1row; // edi@55 |
693 unsigned int product_width_1row; // esi@57 | 693 unsigned int product_width_1row; // esi@57 |
694 unsigned int product_height_2row; // edi@67 | 694 unsigned int product_height_2row; // edi@67 |
695 unsigned int product_width_2row; // esi@69 | 695 unsigned int product_width_2row; // esi@69 |
696 ItemGen *item; // esi@118 | 696 ItemGen *item; // esi@118 |
713 { | 713 { |
714 case HOUSE_DIALOGUE_MAIN: | 714 case HOUSE_DIALOGUE_MAIN: |
715 { | 715 { |
716 if ( HouseUI_CheckIfPlayerCanInteract() ) | 716 if ( HouseUI_CheckIfPlayerCanInteract() ) |
717 { | 717 { |
718 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; | 718 pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[134]; |
719 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; | 719 pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[152]; |
720 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; | 720 pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[159]; |
721 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; | 721 pShopOptions[3] = (char *)pGlobalTXT_LocalizationStrings[160]; |
722 all_text_height = 0; | 722 all_text_height = 0; |
723 for ( int i = 0; i < 4; ++i ) | 723 for ( int i = 0; i < 4; ++i ) |
724 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 724 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
725 v18 = (174 - all_text_height) / 4; | 725 v18 = (174 - all_text_height) / 4; |
726 v105 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138; | 726 v105 = (174 - 4 * (174 - all_text_height) / 4 - all_text_height) / 2 - (174 - all_text_height) / 4 / 2 + 138; |
964 | 964 |
965 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT: | 965 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT: |
966 { | 966 { |
967 draw_leather(); | 967 draw_leather(); |
968 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 968 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
969 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200]; | 969 pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[200]; |
970 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113]; | 970 pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[113]; |
971 all_text_height = 0; | 971 all_text_height = 0; |
972 for ( int i = 0; i < 2; ++i ) | 972 for ( int i = 0; i < 2; ++i ) |
973 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 973 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
974 v18 = (174 - all_text_height) / 2; | 974 v18 = (174 - all_text_height) / 2; |
975 v105 = (2 * (87 - (174 - all_text_height) / 2) - all_text_height) / 2 - (174 - all_text_height) / 2 / 2 + 138; | 975 v105 = (2 * (87 - (174 - all_text_height) / 2) - all_text_height) / 2 - (174 - all_text_height) / 2 / 2 + 138; |
1088 dialog_window.uFrameZ = 334; | 1088 dialog_window.uFrameZ = 334; |
1089 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN) | 1089 if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN) |
1090 { | 1090 { |
1091 if ( !HouseUI_CheckIfPlayerCanInteract() ) | 1091 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
1092 return; | 1092 return; |
1093 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" | 1093 pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" |
1094 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152]; //"Buy Special" | 1094 pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[152]; //"Buy Special" |
1095 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159]; //"Display Inventory" | 1095 pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[159]; //"Display Inventory" |
1096 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160]; | 1096 pShopOptions[3] = (char *)pGlobalTXT_LocalizationStrings[160]; |
1097 all_text_height = 0; | 1097 all_text_height = 0; |
1098 for ( int i = 0; i < 4; ++i ) | 1098 for ( int i = 0; i < 4; ++i ) |
1099 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 1099 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
1100 one_string = (174 - all_text_height) / 4; | 1100 one_string = (174 - all_text_height) / 4; |
1101 v23 = (174 - 4 * one_string - all_text_height) / 2 - one_string / 2 + 138; | 1101 v23 = (174 - 4 * one_string - all_text_height) / 2 - one_string / 2 + 138; |
1293 | 1293 |
1294 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT ) | 1294 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT ) |
1295 { | 1295 { |
1296 draw_leather(); | 1296 draw_leather(); |
1297 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 1297 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
1298 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];// "Sell" | 1298 pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[200];// "Sell" |
1299 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];// "Identify" | 1299 pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[113];// "Identify" |
1300 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];// "Repair" | 1300 pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[179];// "Repair" |
1301 all_text_height = 0; | 1301 all_text_height = 0; |
1302 for ( uint i = 0; i < 3; ++i ) | 1302 for ( uint i = 0; i < 3; ++i ) |
1303 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); | 1303 all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); |
1304 one_string = ((174 - all_text_height) / 3); | 1304 one_string = ((174 - all_text_height) / 3); |
1305 v23 = (3 * (58 - (signed int)one_string) - all_text_height) / 2 - (174 - all_text_height) / 3 / 2 + 138; | 1305 v23 = (3 * (58 - (signed int)one_string) - all_text_height) / 2 - (174 - all_text_height) / 3 / 2 + 138; |