comparison mm7_1.cpp @ 8:13da46a8d45d

15.01.13(CharacterScreen run)
author Ritor1
date Tue, 15 Jan 2013 21:37:04 +0600
parents 9c0607679772
children 66319a734368
comparison
equal deleted inserted replaced
7:bf019a7475f3 8:13da46a8d45d
4974 4974
4975 //----- (00420EFF) -------------------------------------------------------- 4975 //----- (00420EFF) --------------------------------------------------------
4976 void __cdecl GameUI_WritePointedObjectStatusString() 4976 void __cdecl GameUI_WritePointedObjectStatusString()
4977 { 4977 {
4978 int v1; // ebx@6 4978 int v1; // ebx@6
4979 GUIWindow *v2; // edi@7 4979 GUIWindow *pWindow; // edi@7
4980 GUIButton *i; // ecx@11 4980 GUIButton *pButton; // ecx@11
4981 Player *v4; // eax@19 4981 Player *pPlayer; // eax@19
4982 char v5; // cl@19 4982 char v5; // cl@19
4983 unsigned int v6; // eax@19 4983 unsigned int v6; // eax@19
4984 int v7; // ecx@19 4984 int v7; // ecx@19
4985 __int16 v8; // fps@23 4985 __int16 v8; // fps@23
4986 unsigned __int8 v9; // c0@23 4986 unsigned __int8 v9; // c0@23
4987 unsigned __int8 v10; // c3@23 4987 unsigned __int8 v10; // c3@23
4988 enum UIMessageType v11; // esi@24 4988 enum UIMessageType pMessageType1; // esi@24
4989 int v12; // edx@25 4989 int v12; // edx@25
4990 char *v13; // ecx@28 4990 char *v13; // ecx@28
4991 int v14; // eax@41 4991 int v14; // eax@41
4992 ItemGen *v15; // ecx@44 4992 ItemGen *pItemGen; // ecx@44
4993 int v16; // ecx@46 4993 int v16; // ecx@46
4994 const char *v17; // eax@49 4994 const char *v17; // eax@49
4995 signed int v18; // eax@55 4995 signed int v18; // eax@55
4996 signed int v19; // ecx@63 4996 signed int v19; // ecx@63
4997 BLVFace *pFace; // eax@69 4997 BLVFace *pFace; // eax@69
5007 signed int v30; // ecx@88 5007 signed int v30; // ecx@88
5008 const char *v31; // eax@91 5008 const char *v31; // eax@91
5009 __int16 v32; // fps@109 5009 __int16 v32; // fps@109
5010 unsigned __int8 v33; // c0@109 5010 unsigned __int8 v33; // c0@109
5011 unsigned __int8 v34; // c3@109 5011 unsigned __int8 v34; // c3@109
5012 enum UIMessageType v35; // esi@110 5012 enum UIMessageType pMessageType2; // esi@110
5013 int v36; // edx@111 5013 int v36; // edx@111
5014 enum UIMessageType v37; // edx@117 5014 enum UIMessageType pMessageType3; // edx@117
5015 int v38; // ecx@118 5015 int v38; // ecx@118
5016 const char *v39; // [sp-8h] [bp-E8h]@20 5016 const char *v39; // [sp-8h] [bp-E8h]@20
5017 char *v40; // [sp-8h] [bp-E8h]@83 5017 char *v40; // [sp-8h] [bp-E8h]@83
5018 int v41; // [sp-4h] [bp-E4h]@20 5018 int v41; // [sp-4h] [bp-E4h]@20
5019 char Str1[200]; // [sp+Ch] [bp-D4h]@129 5019 char Str1[200]; // [sp+Ch] [bp-D4h]@129
5023 5023
5024 v13 = nullptr; 5024 v13 = nullptr;
5025 5025
5026 pMouse->uPointingObjectID = 0; 5026 pMouse->uPointingObjectID = 0;
5027 pMouse->GetClickPos(&pX, &pY); 5027 pMouse->GetClickPos(&pX, &pY);
5028 if ( (pX & 0x80000000u) != 0 || (signed int)pX > 639 || (pY & 0x80000000u) != 0 || (signed int)pY > 479 ) 5028 if ( pX || (signed int)pX > 639 || pY || (signed int)pY > 479 )
5029 return; 5029 return;
5030 if ( !pCurrentScreen ) 5030 if ( !pCurrentScreen )
5031 { 5031 {
5032 if ( (signed int)pX > 467 || (signed int)pY > 351 ) 5032 if ( (signed int)pX > 467 || (signed int)pY > 351 )
5033 goto _click_on_game_ui; 5033 goto _click_on_game_ui;
5038 || (signed int)pX > (signed int)pViewport->uScreenZ 5038 || (signed int)pX > (signed int)pViewport->uScreenZ
5039 || (signed int)pY < (signed int)pViewport->uScreenY 5039 || (signed int)pY < (signed int)pViewport->uScreenY
5040 || (signed int)pY > (signed int)pViewport->uScreenW ) 5040 || (signed int)pY > (signed int)pViewport->uScreenW )
5041 v18 = -1; 5041 v18 = -1;
5042 if ( v18 == -1 ) 5042 if ( v18 == -1 )
5043 goto LABEL_61; 5043 //goto LABEL_61;
5044 {
5045 pMouse->uPointingObjectID = 0;
5046 if ( pMouse->uPointingObjectID == 0 )
5047 {
5048 if ( uLastPointedObjectID != 0 )
5049 {
5050 pStatusBarString[0] = 0;
5051 bForceDrawStatusBar = 1;
5052 }
5053 }
5054 uLastPointedObjectID = pMouse->uPointingObjectID;
5055 return;
5056 }
5044 } 5057 }
5045 else 5058 else
5046 { 5059 {
5047 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; 5060 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];
5048 } 5061 }
5050 v19 = (signed int)(unsigned __int16)v18 >> 3; 5063 v19 = (signed int)(unsigned __int16)v18 >> 3;
5051 if ( (v18 & 7) == OBJECT_Item ) 5064 if ( (v18 & 7) == OBJECT_Item )
5052 { 5065 {
5053 v30 = v19; 5066 v30 = v19;
5054 if ( pObjectList->pObjects[pLayingItems[v30].uObjectDescID].uFlags & 0x10 ) 5067 if ( pObjectList->pObjects[pLayingItems[v30].uObjectDescID].uFlags & 0x10 )
5055 goto LABEL_73; 5068 //goto LABEL_73;
5069 {
5070 pMouse->uPointingObjectID = 0;
5071 //goto LABEL_50;
5072 uLastPointedObjectID = 1;
5073 if ( pMouse->uPointingObjectID == 0 )
5074 {
5075 if ( uLastPointedObjectID != 0 )
5076 {
5077 pStatusBarString[0] = 0;
5078 bForceDrawStatusBar = 1;
5079 }
5080 }
5081 uLastPointedObjectID = pMouse->uPointingObjectID;
5082 return;
5083 }
5056 if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID ) 5084 if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID )
5057 { 5085 {
5058 v22 = pLayingItems[v30].stru_24.GetDisplayName(); 5086 v22 = pLayingItems[v30].stru_24.GetDisplayName();
5059 LABEL_93: 5087 //LABEL_93:
5060 v26 = v22; 5088 v26 = v22;
5061 goto LABEL_87; 5089 //goto LABEL_87;
5090 sub_41C0B8_set_status_string(v26);
5091 if ( pMouse->uPointingObjectID == 0 )
5092 {
5093 if ( uLastPointedObjectID != 0 )
5094 {
5095 pStatusBarString[0] = 0;
5096 bForceDrawStatusBar = 1;
5097 }
5098 }
5099 uLastPointedObjectID = pMouse->uPointingObjectID;
5100 return;
5062 } 5101 }
5063 v31 = pLayingItems[v30].stru_24.GetDisplayName(); 5102 v31 = pLayingItems[v30].stru_24.GetDisplayName();
5064 v28 = pTmpBuf; 5103 v28 = pTmpBuf;
5065 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[470], v31);// "Get %s" 5104 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[470], v31);// "Get %s"
5066 } 5105 }
5077 { 5116 {
5078 if ( v23->IsInteractive() ) 5117 if ( v23->IsInteractive() )
5079 v26 = pNPCTopics[stru_5E4C90._decor_events[v24->_idx_in_stru123 - 75] + 379].pTopic; 5118 v26 = pNPCTopics[stru_5E4C90._decor_events[v24->_idx_in_stru123 - 75] + 379].pTopic;
5080 else 5119 else
5081 v26 = pDecorationList->pDecorations[v24->uDecorationDescID].field_20; 5120 v26 = pDecorationList->pDecorations[v24->uDecorationDescID].field_20;
5082 goto LABEL_87; 5121 //goto LABEL_87;
5122 sub_41C0B8_set_status_string(v26);
5123 if ( pMouse->uPointingObjectID == 0 )
5124 {
5125 if ( uLastPointedObjectID != 0 )
5126 {
5127 pStatusBarString[0] = 0;
5128 bForceDrawStatusBar = 1;
5129 }
5130 }
5131 uLastPointedObjectID = pMouse->uPointingObjectID;
5132 return;
5083 } 5133 }
5084 v22 = _444732_GetEventHintString(v25); 5134 v22 = _444732_GetEventHintString(v25);
5085 if ( !v22 ) 5135 if ( !v22 )
5086 goto _return; 5136 //goto _return;
5087 goto LABEL_93; 5137 {
5138 if ( pMouse->uPointingObjectID == 0 )
5139 {
5140 if ( uLastPointedObjectID != 0 )
5141 {
5142 pStatusBarString[0] = 0;
5143 bForceDrawStatusBar = 1;
5144 }
5145 }
5146 uLastPointedObjectID = pMouse->uPointingObjectID;
5147 return;
5148 }
5149 //goto LABEL_93;
5150 v26 = v22;
5151 //goto LABEL_87;
5152 sub_41C0B8_set_status_string(v26);
5153 if ( pMouse->uPointingObjectID == 0 )
5154 {
5155 if ( uLastPointedObjectID != 0 )
5156 {
5157 pStatusBarString[0] = 0;
5158 bForceDrawStatusBar = 1;
5159 }
5160 }
5161 uLastPointedObjectID = pMouse->uPointingObjectID;
5162 return;
5088 } 5163 }
5089 if ( (v18 & 7) == 6 ) // bmodel 5164 if ( (v18 & 7) == 6 ) // bmodel
5090 { 5165 {
5091 if ( v18 < (signed int)0x2000000u ) 5166 if ( v18 < (signed int)0x2000000u )
5092 { 5167 {
5093 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) 5168 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
5094 { 5169 {
5095 v21 = pOutdoor->pBModels[(signed int)(unsigned __int16)v18 >> 9].pFaces[v19 & 0x3F].sCogTriggeredID; 5170 v21 = pOutdoor->pBModels[(signed int)(unsigned __int16)v18 >> 9].pFaces[v19 & 0x3F].sCogTriggeredID;
5096 goto LABEL_71; 5171 //goto LABEL_71;
5172 if ( !v21 || (v22 = _444732_GetEventHintString(v21)) == 0 )
5173 //goto LABEL_73;
5174 {
5175 pMouse->uPointingObjectID = 0;
5176 //goto LABEL_50;
5177 uLastPointedObjectID = 1;
5178 if ( pMouse->uPointingObjectID == 0 )
5179 {
5180 if ( uLastPointedObjectID != 0 )
5181 {
5182 pStatusBarString[0] = 0;
5183 bForceDrawStatusBar = 1;
5184 }
5185 }
5186 uLastPointedObjectID = pMouse->uPointingObjectID;
5187 return;
5188 }
5189 //goto LABEL_93;
5190 v26 = v22;
5191 //goto LABEL_87;
5192 sub_41C0B8_set_status_string(v26);
5193 if ( pMouse->uPointingObjectID == 0 )
5194 {
5195 if ( uLastPointedObjectID != 0 )
5196 {
5197 pStatusBarString[0] = 0;
5198 bForceDrawStatusBar = 1;
5199 }
5200 }
5201 uLastPointedObjectID = pMouse->uPointingObjectID;
5202 return;
5097 } 5203 }
5098 pFace = &pIndoor->pFaces[v19]; 5204 pFace = &pIndoor->pFaces[v19];
5099 if ( BYTE3(pFace->uAttributes) & 6 ) 5205 if ( BYTE3(pFace->uAttributes) & 6 )
5100 { 5206 {
5101 v21 = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID; 5207 v21 = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID;
5102 LABEL_71: 5208 //LABEL_71:
5103 if ( !v21 || (v22 = _444732_GetEventHintString(v21)) == 0 ) 5209 if ( !v21 || (v22 = _444732_GetEventHintString(v21)) == 0 )
5104 goto LABEL_73; 5210 //goto LABEL_73;
5105 goto LABEL_93; 5211 {
5212 pMouse->uPointingObjectID = 0;
5213 //goto LABEL_50;
5214 uLastPointedObjectID = 1;
5215 if ( pMouse->uPointingObjectID == 0 )
5216 {
5217 if ( uLastPointedObjectID != 0 )
5218 {
5219 pStatusBarString[0] = 0;
5220 bForceDrawStatusBar = 1;
5221 }
5222 }
5223 uLastPointedObjectID = pMouse->uPointingObjectID;
5224 return;
5225 }
5226 //goto LABEL_93;
5227 v26 = v22;
5228 //goto LABEL_87;
5229 sub_41C0B8_set_status_string(v26);
5230 if ( pMouse->uPointingObjectID == 0 )
5231 {
5232 if ( uLastPointedObjectID != 0 )
5233 {
5234 pStatusBarString[0] = 0;
5235 bForceDrawStatusBar = 1;
5236 }
5237 }
5238 uLastPointedObjectID = pMouse->uPointingObjectID;
5239 return;
5106 } 5240 }
5107 } 5241 }
5108 LABEL_73: 5242 //LABEL_73:
5109 pMouse->uPointingObjectID = 0; 5243 pMouse->uPointingObjectID = 0;
5110 goto LABEL_50; 5244 //goto LABEL_50;
5245 uLastPointedObjectID = 1;
5246 if ( pMouse->uPointingObjectID == 0 )
5247 {
5248 if ( uLastPointedObjectID != 0 )
5249 {
5250 pStatusBarString[0] = 0;
5251 bForceDrawStatusBar = 1;
5252 }
5253 }
5254 uLastPointedObjectID = pMouse->uPointingObjectID;
5255 return;
5111 } 5256 }
5112 LABEL_61: 5257 //LABEL_61:
5113 pMouse->uPointingObjectID = 0; 5258 pMouse->uPointingObjectID = 0;
5114 goto _return; 5259 //goto _return;
5260 if ( pMouse->uPointingObjectID == 0 )
5261 {
5262 if ( uLastPointedObjectID != 0 )
5263 {
5264 pStatusBarString[0] = 0;
5265 bForceDrawStatusBar = 1;
5266 }
5267 }
5268 uLastPointedObjectID = pMouse->uPointingObjectID;
5269 return;
5115 } 5270 }
5116 if ( v18 >= 335544320 ) 5271 if ( v18 >= 335544320 )
5117 goto LABEL_61; 5272 //goto LABEL_61;
5273 {
5274 pMouse->uPointingObjectID = 0;
5275 if ( pMouse->uPointingObjectID == 0 )
5276 {
5277 if ( uLastPointedObjectID != 0 )
5278 {
5279 pStatusBarString[0] = 0;
5280 bForceDrawStatusBar = 1;
5281 }
5282 }
5283 uLastPointedObjectID = pMouse->uPointingObjectID;
5284 return;
5285 }
5118 pActor = &pActors[v19]; 5286 pActor = &pActors[v19];
5119 v28 = pTmpBuf; 5287 v28 = pTmpBuf;
5120 v29 = pActor->dword_000334_unique_name; 5288 v29 = pActor->dword_000334_unique_name;
5121 if ( v29 ) 5289 if ( v29 )
5122 v40 = (char *)*(&pMonsterStats->pPlacement.uNumStrings + v29); 5290 v40 = (char *)*(&pMonsterStats->pPlacement.uNumStrings + v29);
5123 else 5291 else
5124 v40 = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].pName; 5292 v40 = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].pName;
5125 strncpy(pTmpBuf, v40, 0x7D0u); 5293 strncpy(pTmpBuf, v40, 0x7D0u);
5126 } 5294 }
5127 v26 = v28; 5295 v26 = v28;
5128 LABEL_87: 5296 //LABEL_87:
5129 sub_41C0B8_set_status_string(v26); 5297 sub_41C0B8_set_status_string(v26);
5130 goto _return; 5298 //goto _return;
5299 if ( pMouse->uPointingObjectID == 0 )
5300 {
5301 if ( uLastPointedObjectID != 0 )
5302 {
5303 pStatusBarString[0] = 0;
5304 bForceDrawStatusBar = 1;
5305 }
5306 }
5307 uLastPointedObjectID = pMouse->uPointingObjectID;
5308 return;
5131 } 5309 }
5132 v1 = uNumVisibleWindows; 5310 v1 = uNumVisibleWindows;
5133 if ( uNumVisibleWindows <= 0 ) 5311 if ( uNumVisibleWindows <= 0 )
5134 { 5312 {
5135 LABEL_38: 5313 LABEL_38:
5136 if ( pCurrentScreen == 10 ) 5314 if ( pCurrentScreen == 10 )
5137 { 5315 {
5138 sub_42038D(); 5316 sub_42038D();
5139 goto _return; 5317 //goto _return;
5140 }
5141 if ( pCurrentScreen == 13 )
5142 {
5143 if ( dword_F8B19C != 2
5144 || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0)
5145 || v16 == -65536 )
5146 goto _return;
5147 v15 = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 4);
5148 LABEL_49:
5149 v17 = v15->GetDisplayName();
5150 sub_41C0B8_set_status_string(v17);
5151 LABEL_50:
5152 uLastPointedObjectID = 1;
5153 _return:
5154 if ( pMouse->uPointingObjectID == 0 ) 5318 if ( pMouse->uPointingObjectID == 0 )
5155 { 5319 {
5156 if ( uLastPointedObjectID != 0 ) 5320 if ( uLastPointedObjectID != 0 )
5157 { 5321 {
5158 pStatusBarString[0] = 0; 5322 pStatusBarString[0] = 0;
5160 } 5324 }
5161 } 5325 }
5162 uLastPointedObjectID = pMouse->uPointingObjectID; 5326 uLastPointedObjectID = pMouse->uPointingObjectID;
5163 return; 5327 return;
5164 } 5328 }
5329 if ( pCurrentScreen == 13 )
5330 {
5331 if ( dword_F8B19C != 2
5332 || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0)
5333 || v16 == -65536 )
5334 //goto _return;
5335 {
5336 if ( pMouse->uPointingObjectID == 0 )
5337 {
5338 if ( uLastPointedObjectID != 0 )
5339 {
5340 pStatusBarString[0] = 0;
5341 bForceDrawStatusBar = 1;
5342 }
5343 }
5344 uLastPointedObjectID = pMouse->uPointingObjectID;
5345 return;
5346 }
5347 pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 4);
5348 //LABEL_49:
5349 v17 = pItemGen->GetDisplayName();
5350 sub_41C0B8_set_status_string(v17);
5351 //LABEL_50:
5352 uLastPointedObjectID = 1;
5353 //_return:
5354 if ( pMouse->uPointingObjectID == 0 )
5355 {
5356 if ( uLastPointedObjectID != 0 )
5357 {
5358 pStatusBarString[0] = 0;
5359 bForceDrawStatusBar = 1;
5360 }
5361 }
5362 uLastPointedObjectID = pMouse->uPointingObjectID;
5363 return;
5364 }
5165 if ( (signed int)pY < 350 ) 5365 if ( (signed int)pY < 350 )
5166 { 5366 {
5167 v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; 5367 v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];
5168 if ( v14 == 0 || v14 == -65536 || (unsigned int)v14 >= 0x1388 ) 5368 if ( v14 == 0 || v14 == -65536 || (unsigned int)v14 >= 0x1388 )
5169 goto _return; 5369 //goto _return;
5170 v15 = (ItemGen *)&pPlayers[uActiveCharacter]->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v14 + 5]; 5370 {
5171 goto LABEL_49; 5371 if ( pMouse->uPointingObjectID == 0 )
5372 {
5373 if ( uLastPointedObjectID != 0 )
5374 {
5375 pStatusBarString[0] = 0;
5376 bForceDrawStatusBar = 1;
5377 }
5378 }
5379 uLastPointedObjectID = pMouse->uPointingObjectID;
5380 return;
5381 }
5382 pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v14 + 5];
5383 //goto LABEL_49;
5384 v17 = pItemGen->GetDisplayName();
5385 sub_41C0B8_set_status_string(v17);
5386 uLastPointedObjectID = 1;
5387 if ( pMouse->uPointingObjectID == 0 )
5388 {
5389 if ( uLastPointedObjectID != 0 )
5390 {
5391 pStatusBarString[0] = 0;
5392 bForceDrawStatusBar = 1;
5393 }
5394 }
5395 uLastPointedObjectID = pMouse->uPointingObjectID;
5396 return;
5172 } 5397 }
5173 _click_on_game_ui: 5398 _click_on_game_ui:
5174 if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX 5399 if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX
5175 && (signed int)pX <= (signed int)pWindowList[0].uFrameZ 5400 && (signed int)pX <= (signed int)pWindowList[0].uFrameZ
5176 && (signed int)pY >= (signed int)pWindowList[0].uFrameY 5401 && (signed int)pY >= (signed int)pWindowList[0].uFrameY
5177 && (signed int)pY <= (signed int)pWindowList[0].uFrameW ) 5402 && (signed int)pY <= (signed int)pWindowList[0].uFrameW )
5178 { 5403 {
5179 for ( i = pWindowList[0].pControlsHead; i != (GUIButton *)0; i = i->pNext ) 5404 for ( pButton = pWindowList[0].pControlsHead; pButton != (GUIButton *)0; pButton = pButton->pNext )
5180 { 5405 {
5181 if ( i->uButtonType == 1 ) 5406 if ( pButton->uButtonType == 1 )
5182 { 5407 {
5183 if ( (signed int)pX >= (signed int)i->uX 5408 if ( (signed int)pX >= (signed int)pButton->uX
5184 && (signed int)pX <= (signed int)i->uZ 5409 && (signed int)pX <= (signed int)pButton->uZ
5185 && (signed int)pY >= (signed int)i->uY 5410 && (signed int)pY >= (signed int)pButton->uY
5186 && (signed int)pY <= (signed int)i->uW ) 5411 && (signed int)pY <= (signed int)pButton->uW )
5187 { 5412 {
5188 v37 = (UIMessageType)i->field_1C; 5413 pMessageType3 = (UIMessageType)pButton->field_1C;
5189 if ( v37 == 0 ) 5414 if ( pMessageType3 == 0 )
5190 goto LABEL_28; 5415 //goto LABEL_28;
5191 v38 = i->uControlParam; 5416 {
5417 v13 = pButton->pButtonName;
5418 sub_41C0B8_set_status_string(v13);
5419 uLastPointedObjectID = 1;
5420 return;
5421 }
5422 v38 = pButton->uControlParam;
5192 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 5423 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
5193 { 5424 {
5194 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = v37; 5425 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType3;
5195 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v38; 5426 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v38;
5196 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 5427 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
5197 ++pMessageQueue_50CBD0->uNumMessages; 5428 ++pMessageQueue_50CBD0->uNumMessages;
5198 } 5429 }
5199 goto LABEL_131; 5430 //goto LABEL_131;
5200 }
5201 }
5202 else
5203 {
5204 if ( i->uButtonType == 2 )
5205 {
5206 v45 = pX - i->uX;
5207 v45 = pY - i->uY;
5208
5209 if (pX >= i->uX && pX <= i->uZ &&
5210 pY >= i->uY && pY <= i->uW)
5211 //if ( (double)(signed int)i->uWidth != 0.0 )
5212 //{
5213 // if ( (double)(signed int)i->uHeight != 0.0 )
5214 // {
5215 //UNDEF(v32);
5216 //if ( v33 | v34 )
5217 {
5218 v35 = (UIMessageType)i->field_1C;
5219 if ( v35 != 0 )
5220 {
5221 v36 = i->uControlParam;
5222 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
5223 {
5224 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = v35;
5225 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v36;
5226 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
5227 goto LABEL_27;
5228 }
5229 }
5230 goto LABEL_28;
5231 //}
5232 //}
5233 }
5234 }
5235 else
5236 {
5237 if ( i->uButtonType == 3
5238 && (signed int)pX >= (signed int)i->uX
5239 && (signed int)pX <= (signed int)i->uZ
5240 && (signed int)pY >= (signed int)i->uY
5241 && (signed int)pY <= (signed int)i->uW )
5242 goto LABEL_19;
5243 }
5244 }
5245 }
5246 }
5247 pMouse->uPointingObjectID = sub_46A99B();
5248 goto _return;
5249 }
5250 while ( 1 ) // some other fullscreen ui
5251 {
5252 v2 = &pWindowList[pVisibleWindowsIdxs[v1] - 1];
5253 if ( (signed int)pX >= (signed int)v2->uFrameX
5254 && (signed int)pX <= (signed int)v2->uFrameZ
5255 && (signed int)pY >= (signed int)v2->uFrameY
5256 && (signed int)pY <= (signed int)v2->uFrameW )
5257 {
5258 for ( i = v2->pControlsHead; ; i = i->pNext )
5259 {
5260 if ( !i )
5261 break;
5262 if ( i->uButtonType == 1 )
5263 {
5264 if ( (signed int)pX >= (signed int)i->uX
5265 && (signed int)pX <= (signed int)i->uZ
5266 && (signed int)pY >= (signed int)i->uY
5267 && (signed int)pY <= (signed int)i->uW )
5268 {
5269 LABEL_24:
5270 v11 = (UIMessageType)i->field_1C;
5271 if ( v11 )
5272 {
5273 v12 = i->uControlParam;
5274 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
5275 {
5276 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = v11;
5277 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12;
5278 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
5279 LABEL_27:
5280 ++pMessageQueue_50CBD0->uNumMessages;
5281 }
5282 }
5283 LABEL_28:
5284 v13 = i->pButtonName;
5285 _set_status_and_ret:
5286 sub_41C0B8_set_status_string(v13);
5287 LABEL_131:
5288 uLastPointedObjectID = 1; 5431 uLastPointedObjectID = 1;
5289 return; 5432 return;
5290 } 5433 }
5291 } 5434 }
5292 else 5435 else
5293 { 5436 {
5294 if ( i->uButtonType == 2 ) 5437 if ( pButton->uButtonType == 2 )
5295 { 5438 {
5296 v45 = pX - i->uX; 5439 v45 = pX - pButton->uX;
5297 v45 = pY - i->uY; 5440 v45 = pY - pButton->uY;
5298 if ( (double)(signed int)i->uWidth != 0.0 ) 5441
5442 if (pX >= pButton->uX && pX <= pButton->uZ &&
5443 pY >= pButton->uY && pY <= pButton->uW)
5444 if ( (double)(signed int)pButton->uWidth != 0.0 )
5299 { 5445 {
5300 if ( (double)(signed int)i->uHeight != 0.0 ) 5446 if ( (double)(signed int)pButton->uHeight != 0.0 )
5301 { 5447 {
5302 //UNDEF(v8); 5448 //UNDEF(v32);
5303 if ( v9 | v10 ) 5449 if ( v33 | v34 )
5304 goto LABEL_24; 5450 {
5451 pMessageType2 = (UIMessageType)pButton->field_1C;
5452 if ( pMessageType2 != 0 )
5453 {
5454 v36 = pButton->uControlParam;
5455 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
5456 {
5457 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType2;
5458 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v36;
5459 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
5460 //goto LABEL_27;
5461 ++pMessageQueue_50CBD0->uNumMessages;
5462 v13 = pButton->pButtonName;
5463 sub_41C0B8_set_status_string(v13);
5464 uLastPointedObjectID = 1;
5465 return;
5466 }
5467 }
5468 //goto LABEL_28;
5469 v13 = pButton->pButtonName;
5470 sub_41C0B8_set_status_string(v13);
5471 uLastPointedObjectID = 1;
5472 return;
5473 }
5305 } 5474 }
5306 } 5475 }
5307 } 5476 }
5308 else // click on skill 5477 else
5309 { 5478 {
5310 if ( i->uButtonType == 3 5479 if ( pButton->uButtonType == 3
5311 && (signed int)pX >= (signed int)i->uX 5480 && (signed int)pX >= (signed int)pButton->uX
5312 && (signed int)pX <= (signed int)i->uZ 5481 && (signed int)pX <= (signed int)pButton->uZ
5313 && (signed int)pY >= (signed int)i->uY 5482 && (signed int)pY >= (signed int)pButton->uY
5314 && (signed int)pY <= (signed int)i->uW ) 5483 && (signed int)pY <= (signed int)pButton->uW )
5484 //goto LABEL_19;
5315 { 5485 {
5316 LABEL_19: 5486 pPlayer = pPlayers[uActiveCharacter];
5317 v4 = pPlayers[uActiveCharacter]; 5487 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->uControlParam]);
5318 v5 = LOBYTE(v4->pActiveSkills[i->uControlParam]); 5488 v6 = pPlayer->uSkillPoints;
5319 v6 = v4->uSkillPoints;
5320 v7 = (v5 & 0x3F) + 1; 5489 v7 = (v5 & 0x3F) + 1;
5321 if ( v6 < v7 ) 5490 if ( v6 < v7 )
5322 { 5491 {
5323 v41 = v7 - v6; 5492 v41 = v7 - v6;
5324 v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" 5493 v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here"
5328 v41 = v7; 5497 v41 = v7;
5329 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" 5498 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points"
5330 } 5499 }
5331 sprintf(Str1, v39, v41); 5500 sprintf(Str1, v39, v41);
5332 v13 = Str1; 5501 v13 = Str1;
5333 goto _set_status_and_ret; 5502 //goto _set_status_and_ret;
5503 sub_41C0B8_set_status_string(v13);
5504 uLastPointedObjectID = 1;
5505 return;
5334 } 5506 }
5335 } 5507 }
5336 } 5508 }
5337 } 5509 }
5338 } 5510 }
5339 if ( v2->uFrameHeight == 480 ) 5511 pMouse->uPointingObjectID = sub_46A99B();
5512 //goto _return;
5513 if ( pMouse->uPointingObjectID == 0 )
5514 {
5515 if ( uLastPointedObjectID != 0 )
5516 {
5517 pStatusBarString[0] = 0;
5518 bForceDrawStatusBar = 1;
5519 }
5520 }
5521 uLastPointedObjectID = pMouse->uPointingObjectID;
5522 return;
5523 }
5524 while ( 1 ) // some other fullscreen ui
5525 {
5526 pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1];
5527 if ( (signed int)pX >= (signed int)pWindow->uFrameX
5528 && (signed int)pX <= (signed int)pWindow->uFrameZ
5529 && (signed int)pY >= (signed int)pWindow->uFrameY
5530 && (signed int)pY <= (signed int)pWindow->uFrameW )
5531 {
5532 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext )
5533 {
5534 if ( !pButton )
5535 break;
5536 if ( pButton->uButtonType == 1 )
5537 {
5538 if ( (signed int)pX >= (signed int)pButton->uX
5539 && (signed int)pX <= (signed int)pButton->uZ
5540 && (signed int)pY >= (signed int)pButton->uY
5541 && (signed int)pY <= (signed int)pButton->uW )
5542 {
5543 //LABEL_24:
5544 pMessageType1 = (UIMessageType)pButton->field_1C;
5545 if ( pMessageType1 )
5546 {
5547 v12 = pButton->uControlParam;
5548 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
5549 {
5550 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1;
5551 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12;
5552 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
5553 //LABEL_27:
5554 ++pMessageQueue_50CBD0->uNumMessages;
5555 }
5556 }
5557 //LABEL_28:
5558 v13 = pButton->pButtonName;
5559 //_set_status_and_ret:
5560 sub_41C0B8_set_status_string(v13);
5561 //LABEL_131:
5562 uLastPointedObjectID = 1;
5563 return;
5564 }
5565 }
5566 else
5567 {
5568 if ( pButton->uButtonType == 2 )
5569 {
5570 v45 = pX - pButton->uX;
5571 v45 = pY - pButton->uY;
5572 if ( (double)(signed int)pButton->uWidth != 0.0 )
5573 {
5574 if ( (double)(signed int)pButton->uHeight != 0.0 )
5575 {
5576 //UNDEF(v8);
5577 if ( v9 | v10 )
5578 //goto LABEL_24;
5579 {
5580 pMessageType1 = (UIMessageType)pButton->field_1C;
5581 if ( pMessageType1 )
5582 {
5583 v12 = pButton->uControlParam;
5584 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
5585 {
5586 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1;
5587 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12;
5588 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
5589 ++pMessageQueue_50CBD0->uNumMessages;
5590 }
5591 }
5592 v13 = pButton->pButtonName;
5593 sub_41C0B8_set_status_string(v13);
5594 uLastPointedObjectID = 1;
5595 return;
5596 }
5597 }
5598 }
5599 }
5600 else // click on skill
5601 {
5602 if ( pButton->uButtonType == 3
5603 && (signed int)pX >= (signed int)pButton->uX
5604 && (signed int)pX <= (signed int)pButton->uZ
5605 && (signed int)pY >= (signed int)pButton->uY
5606 && (signed int)pY <= (signed int)pButton->uW )
5607 {
5608 //LABEL_19:
5609 pPlayer = pPlayers[uActiveCharacter];
5610 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->uControlParam]);
5611 v6 = pPlayer->uSkillPoints;
5612 v7 = (v5 & 0x3F) + 1;
5613 if ( v6 < v7 )
5614 {
5615 v41 = v7 - v6;
5616 v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here"
5617 }
5618 else
5619 {
5620 v41 = v7;
5621 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points"
5622 }
5623 sprintf(Str1, v39, v41);
5624 v13 = Str1;
5625 //goto _set_status_and_ret;
5626 sub_41C0B8_set_status_string(v13);
5627 uLastPointedObjectID = 1;
5628 return;
5629 }
5630 }
5631 }
5632 }
5633 }
5634 if ( pWindow->uFrameHeight == 480 )
5340 break; 5635 break;
5341 --v1; 5636 --v1;
5342 if ( v1 <= 0 ) 5637 if ( v1 <= 0 )
5343 { 5638 {
5344 goto LABEL_38; 5639 goto LABEL_38;