comparison UI/UIHouses.cpp @ 2374:802460e60eee

add UIArena.cpp and UIArena.h and other
author Ritor1
date Sun, 01 Jun 2014 18:37:09 +0600
parents bddcaf5d5db2
children 6a7309a847ea
comparison
equal deleted inserted replaced
2373:b4a79e3ef2f0 2374:802460e60eee
27 #include "..\Keyboard.h" 27 #include "..\Keyboard.h"
28 #include "..\MapInfo.h" 28 #include "..\MapInfo.h"
29 #include "..\Log.h" 29 #include "..\Log.h"
30 #include "..\Game.h" 30 #include "..\Game.h"
31 #include "..\CastSpellInfo.h" 31 #include "..\CastSpellInfo.h"
32
33 #include "../Level/Decoration.h"
32 34
33 #include "..\stru159.h" 35 #include "..\stru159.h"
34 int uHouse_ExitPic; // weak 36 int uHouse_ExitPic; // weak
35 37
36 int dword_591080; // weak 38 int dword_591080; // weak
3298 test_string=tmp_pos+1; 3300 test_string=tmp_pos+1;
3299 } while ((decode_step<24)&&!break_loop); 3301 } while ((decode_step<24)&&!break_loop);
3300 } 3302 }
3301 3303
3302 } 3304 }
3305
3306 //----- (004BD8B5) --------------------------------------------------------
3307 int HouseDialogPressCloseBtn()
3308 {
3309 if ( pMessageQueue_50CBD0->uNumMessages )
3310 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
3311 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED);
3312 pKeyActionMap->ResetKeys();
3313 activeLevelDecoration = nullptr;
3314 current_npc_text = 0;
3315 if ( pDialogueNPCCount == 0)
3316 return 0;
3317
3318 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL && ShopTexture )
3319 {
3320 ShopTexture->Release();
3321 ShopTexture = 0;
3322 }
3323
3324 switch(dialog_menu_id)
3325 {
3326 case -1:
3327 _4B4224_UpdateNPCTopics((int)((char *)pDialogueNPCCount - 1));
3328 pVideoPlayer->_4BF5B2();
3329 break;
3330
3331 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
3332 case HOUSE_DIALOGUE_LEARN_SKILLS:
3333 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN:
3334 pVideoPlayer->_4BF5B2();
3335 UI_CreateEndConversationButton();
3336 dialog_menu_id = HOUSE_DIALOGUE_MAIN;
3337 InitializaDialogueOptions(in_current_building_type);
3338 break;
3339
3340 case HOUSE_DIALOGUE_SHOP_SELL:
3341 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
3342 case HOUSE_DIALOGUE_SHOP_REPAIR:
3343 UI_CreateEndConversationButton();
3344 dialog_menu_id = HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT;
3345 InitializaDialogueOptions_Shops(in_current_building_type);
3346 break;
3347
3348 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES:
3349 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS:
3350 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT:
3351 pVideoPlayer->_4BF5B2();
3352 UI_CreateEndConversationButton();
3353 dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN;
3354 InitializaDialogueOptions_Tavern(in_current_building_type);
3355 break;
3356
3357 case HOUSE_DIALOGUE_NULL:
3358 case HOUSE_DIALOGUE_MAIN:
3359 pDialogueNPCCount = 0;
3360 pDialogueWindow->Release();
3361 dialog_menu_id = HOUSE_DIALOGUE_NULL;
3362 pDialogueWindow = 0;
3363 pIcons_LOD->SyncLoadedFilesCount();
3364
3365 if ( uNumDialogueNPCPortraits == 1 )
3366 return 0;
3367
3368 pBtn_ExitCancel = window_SpeakInHouse->pControlsHead;
3369 if ( uNumDialogueNPCPortraits > 0 )
3370 {
3371 for ( uint i = 0; i < (unsigned int)uNumDialogueNPCPortraits; ++i )
3372 {
3373 HouseNPCPortraitsButtonsList[i] = window_SpeakInHouse->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][i],
3374 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][i],
3375 63, 73, 1, 0, UIMSG_ClickHouseNPCPortrait, i, 0, byte_591180[i].data(), 0, 0, 0);
3376 }
3377 }
3378
3379 pVideoPlayer->_4BF5B2();
3380 break;
3381
3382 default:
3383 pVideoPlayer->_4BF5B2();
3384 dialog_menu_id = HOUSE_DIALOGUE_MAIN;
3385 InitializaDialogueOptions(in_current_building_type);
3386 break;
3387 }
3388 return 1;
3389 }