Mercurial > mm7
comparison mm7_5.cpp @ 994:3431f6abc786
GameUI clean
author | Nomad |
---|---|
date | Tue, 14 May 2013 12:35:06 +0200 |
parents | 3a3ab572eff5 |
children | 5876a9cafa3e |
comparison
equal
deleted
inserted
replaced
993:ada1ed5f44a1 | 994:3431f6abc786 |
---|---|
1601 --pParty->field_709; | 1601 --pParty->field_709; |
1602 if ( pParty->field_709 < 1 ) | 1602 if ( pParty->field_709 < 1 ) |
1603 pParty->field_709 = 0; | 1603 pParty->field_709 = 0; |
1604 } | 1604 } |
1605 } | 1605 } |
1606 DrawHiredNPCs(); | 1606 GameUI_DrawHiredNPCs(); |
1607 continue; | 1607 continue; |
1608 case UIMSG_TransitionUI_Confirm: | 1608 case UIMSG_TransitionUI_Confirm: |
1609 if ( pMessageQueue_50CBD0->uNumMessages ) | 1609 if ( pMessageQueue_50CBD0->uNumMessages ) |
1610 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 1610 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
1611 dword_50CDC8 = 1; | 1611 dword_50CDC8 = 1; |
1991 { | 1991 { |
1992 if ( !*((int *)&pSavegameThumbnails->pPixels + 10 * uMessageParam) ) | 1992 if ( !*((int *)&pSavegameThumbnails->pPixels + 10 * uMessageParam) ) |
1993 continue; | 1993 continue; |
1994 v173 = pMapStats->pInfos[sub_410D99_get_map_index(HIWORD(pPlayer->pInstalledBeacons[uMessageParam].field_18))].pName; | 1994 v173 = pMapStats->pInfos[sub_410D99_get_map_index(HIWORD(pPlayer->pInstalledBeacons[uMessageParam].field_18))].pName; |
1995 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[474], v173);// "Recall to %s" | 1995 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[474], v173);// "Recall to %s" |
1996 sub_41C0B8_set_status_string(pTmpBuf); | 1996 GameUI_SetFooterString(pTmpBuf); |
1997 continue; | 1997 continue; |
1998 } | 1998 } |
1999 v59 = pMapStats->GetMapInfo(pCurrentMapName); | 1999 v59 = pMapStats->GetMapInfo(pCurrentMapName); |
2000 thise = "Not in Map Stats"; | 2000 thise = "Not in Map Stats"; |
2001 if ( v59 ) | 2001 if ( v59 ) |
2002 thise = pMapStats->pInfos[v59].pName; | 2002 thise = pMapStats->pInfos[v59].pName; |
2003 if ( !*((int *)&pSavegameThumbnails->pPixels + 10 * uMessageParam) || !v59 ) | 2003 if ( !*((int *)&pSavegameThumbnails->pPixels + 10 * uMessageParam) || !v59 ) |
2004 { | 2004 { |
2005 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[476], thise);// "Set to %s" | 2005 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[476], thise);// "Set to %s" |
2006 sub_41C0B8_set_status_string(pTmpBuf); | 2006 GameUI_SetFooterString(pTmpBuf); |
2007 continue; | 2007 continue; |
2008 } | 2008 } |
2009 v174 = pMapStats->pInfos[sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName; | 2009 v174 = pMapStats->pInfos[sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName; |
2010 v158 = (unsigned int)thise; | 2010 v158 = (unsigned int)thise; |
2011 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[475], v158, v174);// "Set %s over %s" | 2011 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[475], v158, v174);// "Set %s over %s" |
2012 sub_41C0B8_set_status_string(pTmpBuf); | 2012 GameUI_SetFooterString(pTmpBuf); |
2013 continue; | 2013 continue; |
2014 case UIMSG_CloseAfterInstallBeacon: | 2014 case UIMSG_CloseAfterInstallBeacon: |
2015 dword_50CDC8 = 1; | 2015 dword_50CDC8 = 1; |
2016 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | 2016 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
2017 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | 2017 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
2222 break; | 2222 break; |
2223 default: | 2223 default: |
2224 if ( uMessageParam != 5 ) | 2224 if ( uMessageParam != 5 ) |
2225 { | 2225 { |
2226 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[35], v200); | 2226 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[35], v200); |
2227 sub_41C0B8_set_status_string(pTmpBuf); | 2227 GameUI_SetFooterString(pTmpBuf); |
2228 continue; | 2228 continue; |
2229 } | 2229 } |
2230 v69 = pMapStats->pInfos[8].pName; | 2230 v69 = pMapStats->pInfos[8].pName; |
2231 break; | 2231 break; |
2232 } | 2232 } |
2234 else | 2234 else |
2235 { | 2235 { |
2236 v69 = pMapStats->pInfos[21].pName; | 2236 v69 = pMapStats->pInfos[21].pName; |
2237 } | 2237 } |
2238 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[35], v69); | 2238 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[35], v69); |
2239 sub_41C0B8_set_status_string(pTmpBuf); | 2239 GameUI_SetFooterString(pTmpBuf); |
2240 continue; | 2240 continue; |
2241 } | 2241 } |
2242 v68 = 210; | 2242 v68 = 210; |
2243 break; | 2243 break; |
2244 } | 2244 } |
2272 default: | 2272 default: |
2273 if ( uMessageParam != 5 ) | 2273 if ( uMessageParam != 5 ) |
2274 //goto LABEL_519; | 2274 //goto LABEL_519; |
2275 { | 2275 { |
2276 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[35], v200); | 2276 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[35], v200); |
2277 sub_41C0B8_set_status_string(pTmpBuf); | 2277 GameUI_SetFooterString(pTmpBuf); |
2278 continue; | 2278 continue; |
2279 } | 2279 } |
2280 v69 = pMapStats->pInfos[8].pName; | 2280 v69 = pMapStats->pInfos[8].pName; |
2281 break; | 2281 break; |
2282 } | 2282 } |
2284 else | 2284 else |
2285 { | 2285 { |
2286 v69 = pMapStats->pInfos[21].pName; | 2286 v69 = pMapStats->pInfos[21].pName; |
2287 } | 2287 } |
2288 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[35], v69); | 2288 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[35], v69); |
2289 sub_41C0B8_set_status_string(pTmpBuf); | 2289 GameUI_SetFooterString(pTmpBuf); |
2290 continue; | 2290 continue; |
2291 case UIMSG_ShowFinalWindow: | 2291 case UIMSG_ShowFinalWindow: |
2292 sprintf(pFinalMessage, "%s\n \n%s\n \n%s", pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer." | 2292 sprintf(pFinalMessage, "%s\n \n%s\n \n%s", pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer." |
2293 pGlobalTXT_LocalizationStrings[118],// "We hope that you've enjoyed playing Might and Magic VII as much as we did making it. We have saved this screen as MM7_WIN.PCX in your MM7 directory. You can print it out as proof of your accomplishment." | 2293 pGlobalTXT_LocalizationStrings[118],// "We hope that you've enjoyed playing Might and Magic VII as much as we did making it. We have saved this screen as MM7_WIN.PCX in your MM7 directory. You can print it out as proof of your accomplishment." |
2294 pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team." | 2294 pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team." |
2692 v177 = pGlobalTXT_LocalizationStrings[584];// "Click here to remove your Quick Spell" | 2692 v177 = pGlobalTXT_LocalizationStrings[584];// "Click here to remove your Quick Spell" |
2693 else | 2693 else |
2694 v177 = pGlobalTXT_LocalizationStrings[484];// "Select a spell then click here to set a QuickSpell" | 2694 v177 = pGlobalTXT_LocalizationStrings[484];// "Select a spell then click here to set a QuickSpell" |
2695 strcpy(pTmpBuf, v177); | 2695 strcpy(pTmpBuf, v177); |
2696 } | 2696 } |
2697 sub_41C0B8_set_status_string(pTmpBuf); | 2697 GameUI_SetFooterString(pTmpBuf); |
2698 continue; | 2698 continue; |
2699 case UIMSG_SPellbook_ShowHightlightedSpellInfo: | 2699 case UIMSG_SPellbook_ShowHightlightedSpellInfo: |
2700 if ( !uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter], | 2700 if ( !uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter], |
2701 !*(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + 6734) + uMessageParam + 402)) ) | 2701 !*(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + 6734) + uMessageParam + 402)) ) |
2702 continue; | 2702 continue; |
2712 { | 2712 { |
2713 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName; | 2713 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName; |
2714 v161 = pGlobalTXT_LocalizationStrings[486]; | 2714 v161 = pGlobalTXT_LocalizationStrings[486]; |
2715 } | 2715 } |
2716 sprintfex(pTmpBuf, v161, v178); | 2716 sprintfex(pTmpBuf, v161, v178); |
2717 sub_41C0B8_set_status_string(pTmpBuf); | 2717 GameUI_SetFooterString(pTmpBuf); |
2718 continue; | 2718 continue; |
2719 case UIMSG_ClickInstallRemoveQuickSpellBtn: | 2719 case UIMSG_ClickInstallRemoveQuickSpellBtn: |
2720 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_PressedButton2, (int)pBtn_InstallRemoveSpell, 0); | 2720 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_PressedButton2, (int)pBtn_InstallRemoveSpell, 0); |
2721 if ( !uActiveCharacter ) | 2721 if ( !uActiveCharacter ) |
2722 continue; | 2722 continue; |
3079 continue; | 3079 continue; |
3080 case UIMSG_ShowStatus_Funds: | 3080 case UIMSG_ShowStatus_Funds: |
3081 v174 = (char *)pParty->uNumGoldInBank; | 3081 v174 = (char *)pParty->uNumGoldInBank; |
3082 v158 = pParty->uNumGold + pParty->uNumGoldInBank; | 3082 v158 = pParty->uNumGold + pParty->uNumGoldInBank; |
3083 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[489], v158, v174);// "You have %d total gold, %d in the Bank" | 3083 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[489], v158, v174);// "You have %d total gold, %d in the Bank" |
3084 sub_41C0B8_set_status_string(pTmpBuf); | 3084 GameUI_SetFooterString(pTmpBuf); |
3085 continue; | 3085 continue; |
3086 case UIMSG_ShowStatus_DateTime: | 3086 case UIMSG_ShowStatus_DateTime: |
3087 pNPCData4 = (NPCData *)pParty->uCurrentHour; | 3087 pNPCData4 = (NPCData *)pParty->uCurrentHour; |
3088 if ( (signed int)pParty->uCurrentHour <= 12 ) | 3088 if ( (signed int)pParty->uCurrentHour <= 12 ) |
3089 { | 3089 { |
3096 } | 3096 } |
3097 if ( pParty->uCurrentHour < 0xC || (uNumSeconds = 1, pParty->uCurrentHour >= 0x18) ) | 3097 if ( pParty->uCurrentHour < 0xC || (uNumSeconds = 1, pParty->uCurrentHour >= 0x18) ) |
3098 uNumSeconds = 0; | 3098 uNumSeconds = 0; |
3099 sprintf(pTmpBuf, "%d:%02d%s %s %d %s %d", pNPCData4, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7], | 3099 sprintf(pTmpBuf, "%d:%02d%s %s %d %s %d", pNPCData4, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7], |
3100 7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, aMonthNames[pParty->uCurrentMonth], pParty->uCurrentYear); | 3100 7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, aMonthNames[pParty->uCurrentMonth], pParty->uCurrentYear); |
3101 sub_41C0B8_set_status_string(pTmpBuf); | 3101 GameUI_SetFooterString(pTmpBuf); |
3102 continue; | 3102 continue; |
3103 case UIMSG_ShowStatus_Food: | 3103 case UIMSG_ShowStatus_Food: |
3104 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[501], pParty->uNumFoodRations); // "You have %lu food" | 3104 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[501], pParty->uNumFoodRations); // "You have %lu food" |
3105 sub_41C0B8_set_status_string(pTmpBuf); | 3105 GameUI_SetFooterString(pTmpBuf); |
3106 continue; | 3106 continue; |
3107 case UIMSG_ShowStatus_Player: | 3107 case UIMSG_ShowStatus_Player: |
3108 pPlayer5 = pPlayers[uMessageParam]; | 3108 pPlayer5 = pPlayers[uMessageParam]; |
3109 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], pPlayer5->pName, pClassNames[pPlayer5->classType]);// "%s the %s" | 3109 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], pPlayer5->pName, pClassNames[pPlayer5->classType]);// "%s the %s" |
3110 strcat(pTmpBuf, ": "); | 3110 strcat(pTmpBuf, ": "); |
3111 v107 = pPlayer5->GetMajorConditionIdx(); | 3111 v107 = pPlayer5->GetMajorConditionIdx(); |
3112 strcat(pTmpBuf, aCharacterConditionNames[v107]); | 3112 strcat(pTmpBuf, aCharacterConditionNames[v107]); |
3113 sub_41C0B8_set_status_string(pTmpBuf); | 3113 GameUI_SetFooterString(pTmpBuf); |
3114 v108 = 8 * uMessageParam - 8; | 3114 v108 = 8 * uMessageParam - 8; |
3115 LOBYTE(v108) = v108 | 4; | 3115 LOBYTE(v108) = v108 | 4; |
3116 pMouse->uPointingObjectID = PID(OBJECT_Player,v108); | 3116 pMouse->uPointingObjectID = PID(OBJECT_Player,v108); |
3117 continue; | 3117 continue; |
3118 case UIMSG_ShowStatus_ManaHP: | 3118 case UIMSG_ShowStatus_ManaHP: |
3121 v111 = v110->GetMaxMana(); | 3121 v111 = v110->GetMaxMana(); |
3122 v112 = v110->sMana; | 3122 v112 = v110->sMana; |
3123 v113 = pGlobalTXT_LocalizationStrings[108];// "Hit Points" | 3123 v113 = pGlobalTXT_LocalizationStrings[108];// "Hit Points" |
3124 v114 = v110->GetMaxHealth(); | 3124 v114 = v110->GetMaxHealth(); |
3125 sprintf(pTmpBuf, "%d / %d %s %d / %d %s", v110->sHealth, v114, v113, v112, v111, v109); | 3125 sprintf(pTmpBuf, "%d / %d %s %d / %d %s", v110->sHealth, v114, v113, v112, v111, v109); |
3126 sub_41C0B8_set_status_string(pTmpBuf); | 3126 GameUI_SetFooterString(pTmpBuf); |
3127 continue; | 3127 continue; |
3128 case UIMSG_CHEST_ClickItem: | 3128 case UIMSG_CHEST_ClickItem: |
3129 if ( pCurrentScreen == SCREEN_CHEST_INVENTORY ) | 3129 if ( pCurrentScreen == SCREEN_CHEST_INVENTORY ) |
3130 { | 3130 { |
3131 OnInventoryLeftClick(); | 3131 OnInventoryLeftClick(); |